posthog-js 1.428.0 → 1.428.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/conversations.js +1 -1
- package/dist/customizations.d.ts +7 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/dead-clicks-autocapture.js +1 -1
- package/dist/dead-clicks-autocapture.js.map +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/main.d.ts +7 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +7 -1
- package/dist/module.full.d.ts +7 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.d.ts +7 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.d.ts +7 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.d.ts +7 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/dist/product-tours.js +1 -1
- package/dist/src/autocapture.d.ts +8 -1
- package/lib/package.json +1 -1
- package/lib/src/autocapture.d.ts +8 -1
- package/lib/src/autocapture.js +157 -9
- package/lib/src/autocapture.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){var t=["type"];function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},e.apply(null,arguments)}function r(t,e,r,i,n,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(i,n)}function i(t){return function(){var e=this,i=arguments;return new Promise(function(n,o){var a=t.apply(e,i);function s(t){r(a,n,o,s,u,"next",t)}function u(t){r(a,n,o,s,u,"throw",t)}s(void 0)})}}!function(){var r="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:r,o=null==n?void 0:n.navigator,a=null==n?void 0:n.document,s=null==n?void 0:n.location;null!=n&&n.XMLHttpRequest&&new n.XMLHttpRequest;var u=null==o?void 0:o.userAgent,l="undefined"!=typeof globalThis?globalThis:r;l&&"undefined"==typeof self&&(l.self=l),l&&"undefined"==typeof File&&(l.File=function(){});var h=null!=r?r:{},c="$session_recording_remote_config",d="$replay_sample_rate",v="$replay_override_sampling",f="$replay_override_linked_flag",p="$replay_override_url_trigger",g="$replay_override_event_trigger",m="$session_is_sampled",y="$session_past_minimum_duration",b="$session_recording_url_trigger_activated_session",w="$session_recording_event_trigger_activated_session",k="$posthog_sr_group_event_trigger_",_="$posthog_sr_group_url_trigger_",S="$posthog_sr_group_sampling_",x="$debug_first_full_snapshot_timestamp",C="$sess_rec_flush_size",M="$stored_person_properties",T="$surveys",I="$sdk_debug_replay_event_trigger_status",R="$sdk_debug_replay_linked_flag_trigger_status",A="$sdk_debug_replay_matched_recording_trigger_groups",E="$sdk_debug_replay_pending_trigger_conditions",L="$sdk_debug_replay_remote_trigger_matching_config",O="$sdk_debug_replay_trigger_groups_count",D="$sdk_debug_replay_url_trigger_status",P="$sdk_debug_rrweb_attached",F="$sdk_debug_rrweb_start_attempted",N="$session_recording_start_reason";function q(t,e){return-1!==t.indexOf(e)}var j=function(t){return t.trim()},B="min_length",H="max_length",U=Object.prototype,z=U.hasOwnProperty,W=U.toString,V=Array.isArray||function(t){return"[object Array]"===W.call(t)},Z=t=>"function"==typeof t,G=t=>t===Object(t)&&!V(t),Q=t=>void 0===t,J=t=>"[object String]"==W.call(t),K=t=>J(t)&&0===t.trim().length,X=t=>null===t,Y=t=>Q(t)||X(t),tt=t=>"[object Number]"==W.call(t)&&t==t,et=t=>"[object Boolean]"===W.call(t),rt=t=>t instanceof FormData;function it(t){return null===t||"object"!=typeof t}function nt(t,e){return{}.toString.call(t)==="[object "+e+"]"}function ot(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return st(t,Error)}}function at(t){return"u">typeof Event&&st(t,Event)}function st(t,e){try{return t instanceof e}catch(t){return!1}}function ut(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),tt(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),ut(null!=n?n:r,e,r,i))}var lt=class{constructor(t){this.C={},this.I=t.I,this.R=ut(t.bucketSize,0,100,t.A),this.O=ut(t.refillRate,0,this.R,t.A),this.F=ut(t.refillInterval,0,864e5,t.A)}N(t,e){var r=Math.floor((e-t.lastAccess)/this.F);r>0&&(t.tokens=Math.min(t.tokens+r*this.O,this.R),t.lastAccess=t.lastAccess+r*this.F)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.N(n,r):this.C[i]=n={tokens:this.R,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}},ht="Mobile",ct="Tablet",dt="Android Tablet",vt="iPad",ft="Apple Watch",pt="Nintendo",gt="PlayStation",mt="Xbox",yt="Nokia",bt="Ouya",wt="Generic "+ht.toLowerCase(),kt="Generic "+ct.toLowerCase(),_t=new RegExp(mt,"i"),St=new RegExp("PlayStation \\w+","i"),xt=new RegExp("Nintendo \\w+","i"),Ct=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(pt,"i"),new RegExp(gt,"i"),new RegExp("Windows","i");var Mt,Tt,It;function Rt(t){return t?t.split("#")[0]:t}function At(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return It&&r.length===Tt?It:(Tt=r.length,It=r.reduce((r,i)=>{Mt||(Mt={});var n=Mt[i];if(n)r[n[0]]=n[1];else for(var o=t(i),a=o.length-1;a>=0;a--){var s,u=null==(s=o[a])?void 0:s.filename,l=e[i];if(u&&l){r[u]=l,Mt[i]=[u,l];break}}return r},{}))}}function Et(t,e,r,i,n){var o={platform:t,filename:e,function:"<anonymous>"===r?"?":r,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return Q(i)||(o.lineno=i),Q(n)||(o.colno=n),o}var Lt=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:"?",r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Ot=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Dt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Pt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ft=(t,e)=>{var r=Ot.exec(t);if(r)return Et(e,r[1],"?",+r[2],+r[3]);var i=Dt.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=Pt.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var o=Lt(i[1]||"?",i[2]);return Et(e,o[1],o[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Nt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jt=(t,e)=>{var r=Nt.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=qt.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],o=r[1]||"?",a=Lt(o,n);return Et(e,n=a[1],o=a[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Bt=/\(error: (.*)\)/;var Ht=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,$t=["fatal","error","warning","log","info","debug"];function Ut(t,e){void 0===e&&(e=40);var r=Object.keys(t);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(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}var zt,Wt="NativeGzipValidationError",Vt=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(Wt,"Native gzip produced invalid output: "+t)},Zt=function(){var t=i(function*(t,e){18>t.size&&Vt("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&Vt("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(zt)return zt;zt=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;zt[t]=e>>>0}return zt})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Vt("invalid-crc");var o=e.length>>>0;n.getUint32(4,!0)!==o&&Vt("invalid-size")});return function(e,r){return t.apply(this,arguments)}}();function Gt(){return Gt=i(function*(t,e,r){void 0===e&&(e=!0);try{var n=(new TextEncoder).encode(t),o=new globalThis.CompressionStream("gzip"),a=o.writable.getWriter(),s=a.write(n).then(()=>a.close()).catch(function(){var t=i(function*(t){try{yield a.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),u=new Response(o.readable).blob(),l=(yield Promise.all([u,s]))[0];return yield Zt(l,n),l}catch(t){if(null!=r&&r.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),Gt.apply(this,arguments)}function Qt(t,e){var r;if(t)return null==(r=t.find(t=>t.type===e))?void 0:r.value}var Jt="0.8.0",Kt={DEBUG:!1,LIB_VERSION:Jt,LIB_NAME:"browser-common",JS_SDK_VERSION:Jt},Xt=function(t,e){var i=(void 0===e?{}:e).debugEnabled,n={q(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r&&(Kt.DEBUG||r.POSTHOG_DEBUG||i)&&!Q(r.console)&&r.console&&("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e])(t,...o)},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Xt(t+" "+e,r)};return n},Yt=Xt("[PostHog.js]"),te=Yt.createLogger;function ee(t,e){if(!Y(t))if(V(t))t.forEach(e);else if(rt(t))t.forEach((t,r)=>e(t,r));else for(var r in t)z.call(t,r)&&e(t[r],r)}var re=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var o in n)void 0!==n[o]&&(t[o]=n[o]);return t};function ie(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}function ne(t,e,r,i){var n=null!=i?i:{},o=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==o&&o,passive:void 0===a||a})}var oe=["localhost","127.0.0.1"],ae=t=>{var e=null==a?void 0:a.createElement("a");return Q(e)?null:(e.href=t,e)};function se(t){var e,i=null==r||null==(e=r.location)?void 0:e.href;return Q(i)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Z(i))return e;try{var n=i(e);return J(n)&&n?n:e}catch(t){return Yt.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,i)}function ue(t){return!!t&&1===t.nodeType}function le(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function he(t){return!!t&&11===t.nodeType&&ue(t.host)}function ce(t){return t?j(t).split(/\s+/):[]}function de(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ce(e)}function ve(t){var e="";return be(t)&&!we(t)&&t.childNodes&&t.childNodes.length&&ee(t.childNodes,function(t){var r;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(r=function(t){return Y(t)?null:j(t).split(/(\s+)/).filter(t=>Ie(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==r?r:"")}),j(e)}var fe=["a","button","form","input","select","textarea","label"];function pe(t){var e=t.parentNode;return!(!e||!ue(e))&&e}var ge=[".ph-no-deadclick",".ph-no-capture"];var me=t=>!t||le(t,"html")||!ue(t),ye=(t,e)=>{if(!r||me(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],o=t;o.parentNode&&!le(o,"body");)if(he(o.parentNode))n.push(o.parentNode.host),o=o.parentNode.host;else{var a=pe(o);if(!a)break;if(e||fe.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var s=r.getComputedStyle(a);s&&"pointer"===s.getPropertyValue("cursor")&&(i=!0)}catch(t){}n.push(a),o=a}return{parentIsUsefulElement:i,targetElementList:n}};function be(t){for(var e=new Set,r=0,i=t;i.parentNode&&!le(i,"body");i=i.parentNode){if(r++>=1e3||e.has(i))return!1;e.add(i);var n=de(i);if(q(n,"ph-sensitive")||q(n,"ph-no-capture"))return!1}if(q(de(t),"ph-include"))return!0;var o=t.type||"";if(J(o))switch(o.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!J(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function we(t){return!!(le(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||le(t,"select")||le(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ke=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}))$"),_e=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Se=[16,15,14,13],xe=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ce=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Me=/[0-9A-Za-z_]/;function Te(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}function Ie(t,e){if(void 0===e&&(e=!0),Y(t))return!1;if(J(t)){if(t=j(t),e?ke.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(_e.lastIndex=0;e=_e.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var o of Se){var a=n+o;if(i.length>=a){var s=i.slice(n,a);if(ke.test(s)&&Te(s))return!0}}}return!1}(t))return!1;if(e?xe.test(t):function(t){var e;for(Ce.lastIndex=0;e=Ce.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Me.test(r)&&Me.test(i)))return!0}return!1}(t))return!1}return!0}function Re(t){var e=ve(t);return Ie(e=(e+" "+Ae(t)).trim())?e:""}function Ae(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ee(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=ve(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ae(t)).trim())}catch(t){Yt.error("[AutoCapture]",t)}}),e}function Ee(t){return t.replace(/"|\\"/g,'\\"')}function Le(t){var e=t.attr__class;if(e)return V(e)?e:ce(e)}var Oe=1e6;function De(t){var e;return Math.min(Oe,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Pe={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Oe,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},Fe=["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"],Ne=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],qe=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],je=t=>{Y(t)||ee(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Fe.includes(e)||qe.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Be=["/s/","/e/","/i/"];function He(t,e,r,i){if(Y(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return J(n)&&(n=parseInt(n)),n>r?"[SessionRecording] "+i+" body too large to record ("+n+" bytes)":t}function $e(t,e){if(Y(t))return t;var r=t;return Ie(r,!1)||(r="[SessionRecording] "+e+" body redacted"),ee(Ne,t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r="[SessionRecording] "+e+" body redacted as might contain: "+t)}),r}var Ue=new WeakSet,ze="disabled",We="sampled",Ve="active",Ze="buffering",Ge="paused",Qe="rrweb_error",Je="trigger_activated",Ke="trigger_pending",Xe="trigger_disabled";function Ye(t,e,r,i,n,o){return 0===e?Xe:(null==t?void 0:t.get_property(r?i+r:n))===o?Je:Ke}function tr(t,e,r){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function er(t){return t.includes("trigger_activated")?Je:t.includes("trigger_pending")?Ke:Xe}function rr(t){var e=new Set(t);switch(e.delete(Xe),e.size){case 0:return Xe;case 1:return Array.from(e)[0];default:return Ke}}var ir=class{constructor(t){this.j=t}triggerStatus(t){return er(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return er(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},nr=class{constructor(t){this.j=t}triggerStatus(t){return rr(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return rr(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},or=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Je}stop(){}},ar=t=>"sessionRecording"in t,sr=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,r;this.B=(ar(t)?G(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(ar(t)?G(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){Yt.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){Yt.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return Ye(this._instance,this.B.length,this.V,_,b,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[D]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=se(this._instance);if(!t)return!1;try{return tr(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=se(this._instance);if(r&&r!==this.W){this.W=r;var i=this.urlBlocked,n=tr(r,this.H,this.U);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=se(this._instance);if(n&&n!==this.W){this.W=n;var o=this.urlBlocked,a=tr(n,this.H,this.U);a&&!o?t():!a&&o&&e();var s=this.G(i)===Je,u=tr(n,this.B,this.$);!s&&u&&r("url",n)}}stop(){this.W=""}},ur=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[R]:t}),t}triggerStatusNoSideEffects(){var t=Ke;return Y(this.linkedFlag)&&(t=Xe),this.linkedFlagSeen&&(t=Je),t}onConfig(t,e){var r;if(this.linkedFlag=(ar(t)?G(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Y(this.linkedFlag)&&!this.linkedFlagSeen){var i=J(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=J(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,r)=>{var o=!1;if(G(r)&&i in r){var a=r[i];o=et(a)?!0===a:n?a===n:!!a}var s=o&&!this.linkedFlagSeen;this.linkedFlagSeen=o,s&&e(i,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},lr=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(ar(t)?G(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return Ye(this._instance,this.K.length,this.V,k,w,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[I]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,r){if(0!==this.K.length){var i=this.X(r)===Je,n=this.K.includes(t);!i&&n&&e("event",t)}}stop(){}},hr=class{constructor(t,e,r){if(this._instance=t,this.group=e,this.Y=new sr(t,e.id),this.tt=new lr(t,e.id),this.et=new ur(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map(t=>t.name),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,r);var o=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new ir(o):new nr(o)}else this.rt=new or}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Ke).map(t=>t.label)}checkEventTriggerConditions(t,e,r){this.tt.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.Y.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r,i="url"===t?_+this.group.id:k+this.group.id;null==(r=this._instance.persistence)||r.register({[i]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function cr(t){if(t.rrwebError)return Qe;if(!t.receivedFlags)return Ze;if(!t.isRecordingEnabled)return ze;if(t.urlTriggerMatching.urlBlocked)return Ge;var e=!0===t.isSampled,r=new ir([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?We:"trigger_activated"===r?Ve:"trigger_pending"===r?Ze:!1===t.isSampled?ze:Ve}function dr(t){if(t.rrwebError)return Qe;if(!t.receivedFlags)return Ze;if(!t.isRecordingEnabled)return ze;if(t.urlTriggerMatching.urlBlocked)return Ge;var e=new nr([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==Xe,i=et(t.isSampled);return r&&"trigger_pending"===e?Ze:r&&"trigger_disabled"===e||i&&!t.isSampled?ze:!0===t.isSampled?We:Ve}function vr(){var t=[];return function(e,r){if(G(r)||V(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function fr(t){var e=JSON.stringify(t,vr());return e?new Blob([e]).size:0}function pr(t){if(X(t))return 4;if(Q(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(V(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=Q(i)||X(i)?4:pr(i)}return e}var n=t,o=2,a=!0;for(var s in n)if({}.hasOwnProperty.call(n,s)){var u=n[s];Q(u)||(a||(o+=1),a=!1,o+=s.length+3+pr(u))}return o;default:return 0}}function gr(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[gr({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),gr({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var mr=Uint8Array,yr=Uint16Array,br=Uint32Array,wr=new mr([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]),kr=new mr([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]),_r=new mr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Sr=function(t,e){for(var r=new yr(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new br(r[30]);for(i=1;30>i;++i)for(var o=r[i];r[i+1]>o;++o)n[o]=o-r[i]<<5|i;return[r,n]},xr=Sr(wr,2),Cr=xr[1];xr[0][28]=258,Cr[258]=28;for(var Mr=Sr(kr,0)[1],Tr=new yr(32768),Ir=0;32768>Ir;++Ir){var Rr=(43690&Ir)>>>1|(21845&Ir)<<1;Tr[Ir]=((65280&(Rr=(61680&(Rr=(52428&Rr)>>>2|(13107&Rr)<<2))>>>4|(3855&Rr)<<4))>>>8|(255&Rr)<<8)>>>1}var Ar=function(t,e,r){for(var i=t.length,n=0,o=new yr(e);i>n;++n)++o[t[n]-1];var a,s=new yr(e);for(n=0;e>n;++n)s[n]=s[n-1]+o[n-1]<<1;if(r){a=new yr(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=s[t[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)a[Tr[c]>>>u]=l}else for(a=new yr(i),n=0;i>n;++n)a[n]=Tr[s[t[n]-1]++]>>>15-t[n];return a},Er=new mr(288);for(Ir=0;144>Ir;++Ir)Er[Ir]=8;for(Ir=144;256>Ir;++Ir)Er[Ir]=9;for(Ir=256;280>Ir;++Ir)Er[Ir]=7;for(Ir=280;288>Ir;++Ir)Er[Ir]=8;var Lr=new mr(32);for(Ir=0;32>Ir;++Ir)Lr[Ir]=5;var Or=Ar(Er,9,0),Dr=Ar(Lr,5,0),Pr=function(t){return(t/8|0)+(7&t&&1)},Fr=function(t,e,r){(null==e||0>e)&&(e=0),(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof yr?yr:t instanceof br?br:mr)(r-e);return i.set(t.subarray(e,r)),i},Nr=function(t,e,r){var i=e/8|0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},qr=function(t,e,r){var i=e/8|0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},jr=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new mr(0),0];if(1==n){var a=new mr(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(t,e){return t.f-e.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=o[0].s;for(i=1;n>i;++i)o[i].s>d&&(d=o[i].s);var v=new yr(d+1),f=Br(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort(function(t,e){return v[e.s]-v[t.s]||t.f-e.f});n>i;++i){var y=o[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new mr(v),f]},Br=function(t,e,r){return-1==t.s?Math.max(Br(t.l,e,r+1),Br(t.r,e,r+1)):e[t.s]=r},Hr=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new yr(++e),i=0,n=t[0],o=1,a=function(t){r[i++]=t},s=1;e>=s;++s)if(t[s]==n&&s!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(n),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(n);o=1,n=t[s]}return[r.subarray(0,i),e]},$r=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Ur=function(t,e,r){var i=r.length,n=Pr(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;i>o;++o)t[n+o+4]=r[o];return 8*(n+4+i)},zr=function(t,e,r,i,n,o,a,s,u,l,h){Nr(e,h++,r),++n[256];for(var c=jr(n,15),d=c[0],v=c[1],f=jr(o,15),p=f[0],g=f[1],m=Hr(d),y=m[0],b=m[1],w=Hr(p),k=w[0],_=w[1],S=new yr(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=jr(S,7),M=C[0],T=C[1],I=19;I>4&&!M[_r[I-1]];--I);var R,A,E,L,O=l+5<<3,D=$r(n,Er)+$r(o,Lr)+a,P=$r(n,d)+$r(o,p)+a+14+3*I+$r(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(D>=O&&P>=O)return Ur(e,h,t.subarray(u,u+l));if(Nr(e,h,1+(D>P)),h+=2,D>P){R=Ar(d,v,0),A=d,E=Ar(p,g,0),L=p;var F=Ar(M,T,0);for(Nr(e,h,b-257),Nr(e,h+5,_-1),Nr(e,h+10,I-4),h+=14,x=0;I>x;++x)Nr(e,h+3*x,M[_r[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)Nr(e,h,F[B=31&j[x]]),h+=M[B],B>15&&(Nr(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else R=Or,A=Er,E=Dr,L=Lr;for(x=0;s>x;++x)if(i[x]>255){var B;qr(e,h,R[257+(B=i[x]>>>18&31)]),h+=A[B+257],B>7&&(Nr(e,h,i[x]>>>23&31),h+=wr[B]);var H=31&i[x];qr(e,h,E[H]),h+=L[H],H>3&&(qr(e,h,i[x]>>>5&8191),h+=kr[H])}else qr(e,h,R[i[x]]),h+=A[i[x]];return qr(e,h,R[256]),h+A[256]},Wr=new br([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Vr=new mr(0),Zr=function(){for(var t=new br(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Gr=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Qr(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Zr[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,o,a,s,u,l=(n=t,o=e,a=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),s=8,function(t,e,r,i,n,o){var a=t.length,s=new mr(i+a+5*(1+Math.floor(a/7e3))+n),u=s.subarray(i,s.length-n),l=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var c=h+65535;a>c?l=Ur(u,l,t.subarray(h,c)):(u[h]=o,l=Ur(u,l,t.subarray(h,a)))}else{for(var d=Wr[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new yr(32768),m=new yr(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new br(25e3),_=new yr(288),S=new yr(32),x=0,C=0,M=(h=0,0),T=0,I=0;a>h;++h){var R=w(h),A=32767&h,E=m[R];if(g[A]=E,m[R]=A,h>=T){var L=a-h;if((x>7e3||M>24576)&&L>423){l=zr(t,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 D=2,P=0,F=f,N=A-E&32767;if(L>2&&R==w(h-N))for(var q=Math.min(v,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=N&&--F&&A!=E;){if(t[h+D]==t[h+D-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>D){if(D=H,P=N,H>q)break;var U=Math.min(N,H-2),z=0;for(O=0;U>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,E=W)}}}N+=(A=E)-(E=g[A])+32768&32767}if(P){k[M++]=268435456|Cr[D]<<18|Mr[P];var Z=31&Cr[D],G=31&Mr[P];C+=wr[Z]+kr[G],++_[257+Z],++S[G],T=h+D,++x}else k[M++]=t[h],++_[t[h]]}}l=zr(t,u,o,k,_,S,C,M,I,h-I,l),o||(l=Ur(u,l,Vr))}return Fr(s,0,i+Pr(l)+n)}(n,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a,s,!u)),h=l.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Gr(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),Gr(l,h-8,r.d()),Gr(l,h-4,i),l}function Jr(t,e){var r="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var n=t[i++];128>n||e?r+=String.fromCharCode(n):224>n?r+=String.fromCharCode((31&n)<<6|63&t[i++]):240>n?r+=String.fromCharCode((15&n)<<12|(63&t[i++])<<6|63&t[i++]):(n=((15&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,r+=String.fromCharCode(55296|n>>10,56320|1023&n))}return r}var Kr=class{constructor(t,e){var r,i,n,o;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,r;this.nt[t]=!0;var i=this.ft(t);null==(e=(r=this.it).onBlockedNode)||e.call(r,t,i)}},this.yt=t=>{var e=this.ft(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.ft=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,r,i,n,o,a,s,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(o=null==(a=t.texts)?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null==(u=t.adds)?void 0:u.length)&&void 0!==s?s:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.bt(e);if(e.attributes){var i,n,o=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var a=o-e.attributes.length;a>0&&(null==(i=(n=this.it).onDroppedAttributeMutations)||i.call(n,a))}var s=this.bt(e);if(0!==s||r===s){if(this.kt)return t;this.ut();var u,l,h=pr(t);return h>this.ht?(null==(u=(l=this.it).onDroppedOversizedMutation)||u.call(l,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new lt({bucketSize:null!==(r=this.it.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,A:Yt}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(o=this.it.bytesRefillRate)&&void 0!==o?o:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var a=this.it.resyncIntervalMs;this.xt=tt(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}};Kt.DEBUG=!1,Kt.LIB_VERSION="1.428.0",Kt.LIB_NAME="web";var Xr=Kt,Yr=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Ct=t.get_property.bind(t),this.Mt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Mt(C,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Ct(C);return G(e=r)&&J(e.sessionId)&&tt(e.size)&&r.sessionId===t?r.size:0}};function ti(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<ut(100*e,0,100,Yt)}function ei(t){return"$survey_response_"+t}function ri(t,e){if(!e)return null;var r=t[ei(e)];return V(r)?[...r]:r}function ii(t,r,i){void 0===t&&(t={});var n={};return r.questions.forEach(e=>{if(!Q(e.originalQuestionIndex)){var r,i=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,o=ri(t,e.id);Q(o)||(n[i]=o)}}),e({$survey_questions:r.questions.map(e=>{var r,n;return{id:e.id,question:null!==(r=null==i?void 0:i[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==r?r:e.question,response:ri(t,e.id)}})},t,n)}function ni(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function oi(t){return"string"==typeof t&&t.trim()?t.trim():null}function ai(t){return t.toLowerCase()}function si(t,e,r){if(!t||!e)return null;var i=ai(e),n=Object.keys(t).find(t=>ai(t)===i);if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var o=i.split("-")[0],a=Object.keys(t).find(t=>ai(t)===o);if(a)return null==r||r.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var ui=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function li(t,r,i){var n,o=si(t.translations,r,i),a=e({},t),s=!1;if(o){var u,l=null==(u=t.translations)?void 0:u[o];if(l)if(null==i||i.info("Applying survey-level translation for language: "+o),Q(l.name)||(a.name=l.name,s=!0),a.appearance){var h=e({},a.appearance);for(var c of ui){var d=l[c];Q(d)||(h[c]=d,s=!0)}a.appearance=h}else(function(t){return ui.some(e=>!Q(t[e]))})(l)&&(s=!0)}var v=t.questions.map(t=>function(t,r,i){var n,o=si(t.translations,r,i);if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=null==(n=t.translations)?void 0:n[o];if(!a)return{question:t,matchedKey:null,hasChanges:!1};var s=e({},t),u=!1;return Q(a.question)||(s.question=a.question,u=!0),Q(a.description)||(s.description=a.description,u=!0),Q(a.buttonText)||(s.buttonText=a.buttonText,u=!0),"link"in s&&!Q(a.link)&&(s.link=a.link,u=!0),"lowerBoundLabel"in s&&!Q(a.lowerBoundLabel)&&(s.lowerBoundLabel=a.lowerBoundLabel,u=!0),"upperBoundLabel"in s&&!Q(a.upperBoundLabel)&&(s.upperBoundLabel=a.upperBoundLabel,u=!0),"choices"in s&&function(t){return V(t.choices)}(a)&&(s.choices=a.choices,u=!0),{question:u?s:t,matchedKey:u?o:null,hasChanges:u}}(t,r,i)),f=v.map(t=>t.question),p=v.some(t=>t.hasChanges),g=null;return o||(g=(null==(n=v.find(t=>t.matchedKey))?void 0:n.matchedKey)||null),p&&(a.questions=f,s=!0,null==i||i.info("Applied question-level translations for language: "+r)),{survey:a,matchedKey:s?o||g:null}}function hi(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}var ci=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},di=t=>t.toLowerCase(),vi={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>ci(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!ci(e,t))),icontains:(t,e)=>e.map(di).some(e=>t.map(di).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(di).every(e=>t.map(di).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{var r=parseFloat(e);return!isNaN(r)&&t.some(t=>r>parseFloat(t))}),lt:(t,e)=>e.some(e=>{var r=parseFloat(e);return!isNaN(r)&&t.some(t=>r<parseFloat(t))})},fi=new Set(["is_not","not_icontains","not_regex"]);function pi(t,e,r){return!t||0===t.length||t.every(t=>{var i,n=null==(i="person"===t.type?r:e)?void 0:i[t.key],o=t.operator||"exact";if(Q(n)||X(n))return fi.has(o);var a=vi[o];return!!a&&!Q(t.value)&&!X(t.value)&&a(V(t.value)?t.value.map(String):[String(t.value)],V(n)?n.map(String):[String(n)])})}var gi=te("[SessionRecording]");function mi(t,e){return e?t:"!"+t}function yi(t,e){return t===e||t!=="!"+e&&null}var bi=class{constructor(t,e,r,i,n,o,a){this._instance=t,this.Y=e,this.tt=r,this.et=i,this.Tt=n,this.It=o,this.Rt=a,this.At=null,this.Et=dr}onRemoteConfig(t){this.At=tt(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new ir([this.tt,this.Y]),this.Et=cr):(this.Lt=new nr([this.tt,this.Y]),this.Et=dr),this._instance.register_for_session({[L]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.Tt("linked_flag_matched",{flag:t,variant:e}),this.Rt()})}getStatus(t){return this.Et({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e,r=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return tt(r)?r:null}checkUrlTriggers(t,e,r,i){this.Y.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.tt.K.length&&Y(this.Ot))return this.Ot=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,r,e)}catch(t){gi.error("Could not activate event trigger",t)}}),this.Ot}makeSamplingDecisions(t){var e,r,i,n=this.At;if(!tt(n))return null==(r=this._instance.persistence)||r.unregister(m),void(null==(i=this._instance.persistence)||i.unregister(d));var o=this._instance.get_property(m),a=this._instance.get_property(d),s=yi(o,t),u=tt(a)&&a!==n,l=Q(a)&&o===t,h=u||l||!et(s),c=h?ti(t,n):s;h&&(c?this.Tt("sampled"):gi.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[m]:mi(t,c),[d]:X(a)&&o===t?null:n})}ensureSamplingDecision(t){tt(this.At)&&(et(yi(this._instance.get_property(m),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(w),null==(e=this._instance.persistence)||e.unregister(b),null==(r=this._instance.persistence)||r.unregister(m),null==(i=this._instance.persistence)||i.unregister(d),null==(n=this._instance.persistence)||n.unregister(y)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Lt)?void 0:e.triggerStatus(t))===Ke}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Ke).map(t=>t.label)}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},wi=class{constructor(t,e,r,i,n){this._instance=t,this.Y=e,this.Tt=r,this.Dt=i,this.Rt=n,this.Pt=[],this.Ft=new Map,this.Nt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.qt(t.triggerGroups),this._instance.register_for_session({[L]:"v2_trigger_groups",[O]:t.triggerGroups.length}),this.Y.onConfig(t)):gi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Qe;if(!t.receivedFlags)return Ze;if(!t.isRecordingEnabled)return ze;if(t.urlTriggerMatching.urlBlocked)return Ge;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return ze;var i=!1,n=!1;for(var o of e){var a=o.triggerStatus(t.sessionId);if("trigger_activated"===a){var s=o.group.id,u=r.get(s);Q(u)?Yt.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:s}):!0===u&&(n=!0)}else"trigger_pending"===a&&(i=!0)}return n?We:i?Ze:ze}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Pt,triggerGroupSamplingResults:this.Ft,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Pt)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;tt(i)&&(X(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.Y.checkUrlBlocklist(e,r);var o=function(i){i.checkUrlTriggerConditions(e,r,e=>{n.jt(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Rt(e))},t)};for(var a of this.Pt)o(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.Ot=t(t=>{var r;if(this.Nt)return gi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Ot)||r.call(this),void(this.Ot=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,n=>{if(i.jt(r,t.properties)){var o=(r.group.conditions.events||[]).filter(e=>e.name===t.event),a=i._instance.get_property(M);o.some(e=>!e.properties||0===e.properties.length||pi(e.properties,t.properties,a))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Rt(n))}},e)};for(var o of this.Pt)n(o)}catch(t){gi.error("Could not activate event trigger for trigger groups",t)}}),this.Ot}makeSamplingDecisions(t){for(var e of this.Pt){var r,i=e.group,n=i.id,o=i.sampleRate,a=S+n,s=this._instance.get_property(a),u=null,l=!1,h=!1,c=!1;if(G(s)){var d=s.sessionId,v=s.sampleRate,f=s.sampled;l="string"==typeof d&&d!==t,h=tt(v)&&v!==o,u=d===t&&tt(v)&&v===o&&et(f)?f:null}else u=s===t||null,l="string"==typeof s&&s!==t,c=s===t;var p=l||h||c||!et(u),g=p?ti(t+n,o):u;p&&this.Dt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:o,isSampled:g}),this.Ft.set(n,g),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:o,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nt=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(m),null==(e=this._instance.persistence)||e.unregister(d),null==(r=this._instance.persistence)||r.unregister(y),this.Pt)){var n,o,a,s=i.group.id;null==(n=this._instance.persistence)||n.unregister(k+s),null==(o=this._instance.persistence)||o.unregister(_+s),null==(a=this._instance.persistence)||a.unregister(S+s)}}updateActiveTriggers(t){var e=[];for(var r of this.Pt){var i=r.group,n=i.id,o="trigger_activated"===r.triggerStatus(t),a=!0===this.Ft.get(n);o&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({[A]:e})}hasPendingTriggers(t){for(var e of this.Pt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Pt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear(),this.Y.stop()}jt(t,e){var r=t.group.conditions.properties;return!r||0===r.length||pi(r,e,this._instance.get_property(M))}qt(t){var e=this;this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear();var r=function(t){var r=new hr(e._instance,t,(r,i)=>{e.Tt("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Rt()});e.Pt.push(r)};for(var i of t)r(i)}},ki=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],_i=1e5,Si=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,xi=[],Ci=()=>!1,Mi="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),Ti="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Ii="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(" "),Ri="Accommodation AdministrativeArea Country Place State".split(" "),Ai={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:Ti,publisher:Ii},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:xi},Offer:{seller:Ii},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:Ii,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Ii,areaServed:Ri,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:xi}},Ei=[["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(" "),Ai.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Ai.Event],[Ii,Ai.Organization],[Ri,Ai.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Ai.Product]];function Li(t,e){return z.call(t,e)?t[e]:void 0}function Oi(t){var e=typeof t;return X(t)||"string"===e||"number"===e||"boolean"===e}function Di(t){return Oi(t)||V(t)&&t.every(Oi)?t:void 0}function Pi(t,e){if("string"==typeof t){var r=t.trim(),i=r.indexOf("#"),n=0>i?r:r.slice(i+1);if(!(!n||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(r)||r.includes("/")||r.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function Fi(t){if(z.call(Ai,t))return Ai[t];for(var e of Ei){var r=e[1];if(e[0].includes(t))return r}}function Ni(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0})}function qi(t,e,r,i){if(V(t)){var n=t.map(t=>qi(t,e,r,i)).filter(t=>!Q(t));return n.length?n:void 0}return ji(t,e,r,i)||void 0}function ji(t,e,r,i){if(!G(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(r))return null;var n=Li(t,"@type"),o=function(t){var e=new Set,r="string"==typeof t?[t]:V(t)?t:[],i=[];for(var n of r)if("string"==typeof n){var o=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=o.length&&Si.test(o)&&!e.has(o)&&(e.add(o),i.push(o),20===i.length))break}return i}(n),a=o.filter(t=>!!Fi(t)&&(!i||!i.length||i.includes(t))),s={};for(var u of Mi){var l="@type"===u?o.length?"string"==typeof n?o[0]:o:void 0:"@id"===u?Pi(Li(t,u),e):Di(Li(t,u));Q(l)||Ni(s,u,l)}for(var h of a){var c=Fi(h);for(var d of Object.keys(c)){var v=Li(t,d),f=c[d];if(!0===f){var p=Di(v);Q(p)||Ni(s,d,p)}else{var g=qi(v,e,r,f);Q(g)||Ni(s,d,g)}}}var m=qi(Li(t,"@graph"),e,r);return Q(m)||Ni(s,"@graph",m),Object.keys(s).length?s:null}function Bi(t,r,i){if(!G(t))return null;var n=Li(t,"@context");if("string"!=typeof n||!/^https?:\/\/schema\.org\/?$/.test(n))return null;var o=ji(t,r,i);return o?e({"@context":"https://schema.org"},o):null}function Hi(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function $i(t,e,r){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!r&&t.matches(r)}catch(t){return!1}}function Ui(t,e,r){for(var i=t;i;){if($i(i,e,r))return!0;var n=i.parentNode;i=i.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function zi(t){return Hi(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Hi)}function Wi(t){return Q(t)?void 0:Math.round(t)}function Vi(t){return G(t)?t.network_timing:t}var Zi,Gi,Qi=te("[SessionRecording]"),Ji=[1,2,3,4,5,6,7,12],Ki=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Xi(){var t;return null==h||null==(t=h.__PosthogExtensions__)?void 0:t.rrweb}function Yi(){var t;return null==(t=Xi())?void 0:t.record}function tn(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,vr())}}function en(t){return Jr(Qr(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new mr(t.length+(t.length>>>1)),i=0,n=function(t){r[i++]=t},o=0;e>o;++o){if(i+5>r.length){var a=new mr(i+8+(e-o<<1));a.set(r),r=a}var s=t.charCodeAt(o);128>s?n(s):2048>s?(n(192|s>>>6),n(128|63&s)):s>55295&&57344>s?(n(240|(s=65536+(1047552&s)|1023&t.charCodeAt(++o))>>>18),n(128|s>>>12&63),n(128|s>>>6&63),n(128|63&s)):(n(224|s>>>12),n(128|s>>>6&63),n(128|63&s))}return Fr(r,0,i)}(tn(t))),!0)}function rn(t){return nn.apply(this,arguments)}function nn(){return nn=i(function*(t){var e=yield function(t,e,r){return Gt.apply(this,arguments)}(tn(t),Xr.DEBUG,{rethrow:!0});return Jr(new Uint8Array(yield e.arrayBuffer()),!0)}),nn.apply(this,arguments)}var on="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,an=!1;function sn(t){return V(t)&&0===t.length?Zi=null!=Zi?Zi:en([]):en(t)}function un(t){return ln.apply(this,arguments)}function ln(){return(ln=i(function*(t){return V(t)&&0===t.length?Zi||(Gi=null!=Gi?Gi:rn([]).then(t=>(Zi=t,t)).catch(t=>{throw Zi=void 0,Gi=void 0,t})):rn(t)})).apply(this,arguments)}function hn(t){return on&&!an&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function cn(t){return{event:t,size:pr(t)}}function dn(t,r){return e({},t,{data:r,cv:"2024-10"})}function vn(t,r){return e({},t,{cv:"2024-10",data:e({},t.data,r)})}function fn(t){try{if(2===t.type)return cn(dn(t,en(t.data)));if(3===t.type&&0===t.data.source)return cn(vn(t,{texts:sn(t.data.texts),attributes:sn(t.data.attributes),removes:sn(t.data.removes),adds:sn(t.data.adds)}));if(3===t.type&&8===t.data.source)return cn(vn(t,{adds:t.data.adds?en(t.data.adds):void 0,removes:t.data.removes?en(t.data.removes):void 0}))}catch(t){Qi.error("could not compress event - will use uncompressed event",t)}return{event:t,size:fr(t)}}function pn(){return pn=i(function*(t){try{if(2===t.type)return cn(dn(t,yield rn(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([un(t.data.texts),un(t.data.attributes),un(t.data.removes),un(t.data.adds)]);return cn(vn(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var r=yield Promise.all([t.data.adds?rn(t.data.adds):void 0,t.data.removes?rn(t.data.removes):void 0]);return cn(vn(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Wt})(e)&&(an=!0),Qi.error("could not compress event asynchronously - trying synchronous compression",e),fn(t)}return{event:t,size:fr(t)}}),pn.apply(this,arguments)}function gn(t,e){return 5===t.type&&t.data.tag===e}function mn(t){return gn(t,"sessionIdle")}function yn(t){return gn(t,"$session_ending")}function bn(t){return gn(t,"$session_starting")}var wn=class{get sessionId(){return this.Bt}get Ht(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get $t(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ut(){return yi(this._instance.get_property(m),this.sessionId)}get At(){var t,e=null==(t=this.zt)?void 0:t.sampleRate;return tt(e)?e:null}get Wt(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.Zt="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Gt=void 0,this.Qt=!1,this.Jt=Date.now(),this.Kt=!1,this.Xt=[],this.Yt="unknown",this.te=0,this.ee=0,this.re=0,this.ie=0,this.ne=!1,this.oe=!1,this.ae=!1,this.se=!1,this.ue=!1,this.le=!1,this.he=!1,this.ce=!1,this.de=!1,this.ve=!1,this.fe=!1,this.pe=!1,this.ge=[],this.me=void 0,this.ye=void 0,this.be=[],this.we=0,this.ke=0,this._e=!1,this.Se=void 0,this.Ot=void 0,this.xe=void 0,this.Ce=void 0,this.Me=void 0,this.Te=(t,e,r)=>{var i,n,o,a;if(r&&(t!==this.Bt||e!==this.Ie)){var s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Bt,l=this.Ie;if(s&&this.Dt("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt,flushed_size:null==(i=this.Re)?void 0:i.currentTrackedSize(u)}),null==(n=this._instance.persistence)||n.unregister(x),this.he=!1,null==(o=Xi())||null==o.resetMaxDepthState||o.resetMaxDepthState(),this.Dt("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Ae(),!(!1===this.Yt&&this.isStarted||this.Bt===t&&this.Ie===e)){var h=this.Bt!==t&&!1!==this.Yt;this.Yt="unknown",this.Ee(h)}s&&this.Dt("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt}),null==(a=this.Vt)||a.makeSamplingDecisions(t)}},this.Le=!1,this.Oe=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[y])===this.Bt},this.De=()=>{var t,e;if(0===this.Pe.data.length)return null;var r=null==(t=this.Pe.data[0])?void 0:t.timestamp,i=null==(e=this.Pe.data[this.Pe.data.length-1])?void 0:e.timestamp;return tt(r)&&tt(i)?i-r:null},this.Fe=()=>{var t,e,r=this.Wt;if(!tt(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Ne;return tt(i)&&i>=0&&r>i}if(this.Oe())return!1;var n,o=this.De();return!!X(o)||r>o||(null==(n=this._instance.persistence)||n.register({[y]:this.Bt}),!1)},this.qe=()=>{"buffering"!==this.status?(this.ne&&this.oe&&this.je&&!this.ae&&this.Be(void 0),this.He(),this.$e()):this.Ue()},this.ze=()=>{this.qe()},this.We=()=>{this.Dt("browser offline",{})},this.Ve=()=>{this.Dt("browser online",{})},this.Ze=()=>{null!=a&&a.visibilityState&&("visible"===a.visibilityState&&(this.je=!0),this.Dt("window "+a.visibilityState,{}))},this.je=null==e||e;var r=this.Ht.checkAndGetSessionAndWindowId(),i=r.windowId;this.Bt=r.sessionId,this.Ie=i,this.et=new ur(this._instance),this.Y=new sr(this._instance),this.tt=new lr(this._instance),this.Pe=this.Ue(),this.Ht.sessionTimeoutMs>this.$t||Qi.warn("session_idle_threshold_ms ("+this.$t+") is greater than the session timeout ("+this.Ht.sessionTimeoutMs+"). Session will never be detected as idle"),this.Re=new Yr(this._instance)}setDocumentWasEverVisible(t){t&&(this.je=!0)}get Ge(){var t,e,r,i,n,o,a,s,u,l=null==(t=this.zt)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.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!==(o=null==h?void 0:h.maskAllInputs)&&void 0!==o?o:null==l?void 0:l.maskAllInputs,d=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a: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 Q(c)&&Q(d)&&Q(v)&&Q(f)?void 0:{maskAllInputs:null==c||c,maskTextSelector:d,blockSelector:v,maskAllElementAttributes:f}}Qe(){var t;if(!this.de){var e=null==(t=this.zt)?void 0:t.masking;if(!Y(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{var i=null==r?void 0:r[t],n=e[t];return!Q(i)&&i!==n});0!==i.length&&(this.de=!0,Qi.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:e}))}}}get Je(){var t;return ut(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,te("canvas recording resolution scale"),1)}get Ke(){var t,e,r,i,n,o,a,s=this._instance.config.session_recording.captureCanvas,u=null==(t=this.zt)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==s?void 0:s.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,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!==(o=null!==(a=null==s?void 0:s.canvasQuality)&&void 0!==a?a:null==u?void 0:u.quality)&&void 0!==o?o:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:l,fps:ut(h,0,12,te("canvas recording fps"),4),quality:ut(c,0,1,te("canvas recording quality"),.4)}}get Xe(){var t,e,r=!(null==(t=this.zt)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:r}get Ye(){var t,e,r,i=null==(t=this.zt)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},o=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),s=Vi(this._instance.config.capture_performance),u=Vi(null==i?void 0:i.capturePerformance),l=!!(et(s)?s:u);return o||a||l?{recordHeaders:o,recordBody:a,recordPerformance:l}:void 0}tr(){var t,r,i=[],n=null==(t=h.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Xe&&i.push(n());var o=null==(r=h.__PosthogExtensions__)||null==(r=r.rrwebPlugins)?void 0:r.getRecordNetworkPlugin;if(this.Ye&&Z(o))if(!oe.includes(s.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Z(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(o(((t,r,i)=>{var n,o={payloadSizeLimitBytes:Pe.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Pe.performanceEntryTypeToObserve],payloadHostDenyList:[...r.payloadHostDenyList||[],...Pe.payloadHostDenyList]},a=!1!==t.session_recording.recordHeaders&&r.recordHeaders,s=!1!==t.session_recording.recordBody&&r.recordBody,u=!1!==t.capture_performance&&r.recordPerformance,l=(n=De(o),t=>(null!=t&&t.requestBody&&(t.requestBody=He(t.requestBody,t.requestHeaders,n,"Request")),null!=t&&t.responseBody&&(t.responseBody=He(t.responseBody,t.responseHeaders,n,"Response")),t)),h=e=>{return l(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=ae(t.name),o=0===e.indexOf("http")?null==(i=ae(e))?void 0:i.pathname:e;"/"===o&&(o="");var a=null==n?void 0:n.pathname.replace(o||"","");if(!(n&&a&&Be.some(t=>0===a.indexOf(t))))return t}})((je((r=e).requestHeaders),je(r.responseHeaders),r),t.api_host,i));var r},c=Z(t.session_recording.maskNetworkRequestFn);return c&&Z(t.session_recording.maskCapturedNetworkRequestFn)&&Yt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(t.session_recording.maskCapturedNetworkRequestFn=r=>{var i=t.session_recording.maskNetworkRequestFn({url:r.name});return!i&&r.isInitial?i:e({},r,{name:null==i?void 0:i.url})}),o.maskRequestFn=Z(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=h(e);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==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return Y(n)&&i?(Ue.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!Q(t))return t.requestBody=$e(t.requestBody,"Request"),t.responseBody=$e(t.responseBody,"Response"),t}(h(t)),e({},Pe,o,{recordHeaders:a,recordBody:s,recordPerformance:u,recordInitialRequests:u,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ye,a)))}else Qi.info("NetworkCapture not started because we are on localhost.");return i}er(t){return this._instance.config.disable_capture_url_hashes?Rt(t):t}rr(t,e){void 0===e&&(e=!1);var r=e?Rt(t):this.er(t),i=this._instance.config.mask_personal_data_properties?[...ki,...this._instance.config.custom_personal_data_properties||[]]:[];return this.ir(function(t,e){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],s=(o||"").split("&"),u=[],l=0;s.length>l;l++){var h=s[l].split("=");V(h)&&(e.includes(h[0])?u.push(h[0]+"=<masked>"):u.push(s[l]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=i&&(c+="#"+i),c}(r,i))}ir(t){var e,r=this._instance.config.session_recording;if(r.maskCapturedNetworkRequestFn){var i,n=r.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==n?void 0:n.name)&&void 0!==i?i:null==n?void 0:n.url}return r.maskNetworkRequestFn?null==(e=r.maskNetworkRequestFn({url:t}))?void 0:e.url:t}nr(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Xt.length?this.Xt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Qi.warn("could not emit queued rrweb event.",e,t),!1}}Dt(t,e){return this.nr(Ki(()=>Yi().addCustomEvent(t,e)))}ar(){var t;return this.Qt&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.Yt}sr(t){if(!this.ar())return!1;try{var e=Yi();return!!e&&(e.addCustomEvent("$json_ld",t),this.ar())}catch(t){return!1}}ur(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.lr)?void 0:e.scan(t)})}hr(){try{if(this._instance.config.capture_pageview||!r)return;var t=new URL(r.location.href),e=this.rr(t.origin+t.pathname+t.search);this.cr!==e&&(this.cr=e,this.Dt("$url_changed",{href:e}))}catch(t){}}dr(){if(this.Xt.length){var t=[...this.Xt];this.Xt=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.nr(t)})}}It(){return this.nr(Ki(()=>Yi().takeFullSnapshot()))}get vr(){var t,e,r;if(null!=(t=this.Vt)&&t.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 tt(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}pr(){if(this.gr&&clearInterval(this.gr),!0!==this.Yt){var t=this.vr;t&&(this.gr=setInterval(()=>{this.It()},t))}}Rt(t){"event"===t&&this.mr(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.pr()}yr(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.lr)||t.scan(),clearInterval(this.gr),Qi.info("recording paused due to URL blocker"),this.Dt("recording paused",{reason:"url blocker"}))}br(){var t;this.Y.urlBlocked&&(null==(t=this.lr)||t.scan(),this.Y.urlBlocked=!1,this.It(),this.ur(),this.pr(),this.Dt("recording resumed",{reason:"left blocked url"}),Qi.info("recording resumed"))}wr(t,e){var r;if("event"===t&&this.mr(),!this.Kt&&null!=(r=this.Vt)&&r.hasPendingTriggers(this.sessionId)){this.Kt=!0;try{var i,n,o="url"===t?b:w;null==(i=this._instance.persistence)||i.register({[o]:this.sessionId}),null==(n=this.Vt)||n.updateActiveTriggers(this.sessionId),this.Rt(),this.$e(),this.Tt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Kt=!1}}}get isStarted(){return!!this.Gt}get zt(){var t=this._instance.get_property(c);if(t){var e;try{e=G(t)?t:JSON.parse(t)}catch(t){return void Qi.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Le){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Qi.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(c))}return e}}kr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,i,n=this.zt;if(n){if(!this.isStarted){var o=!1!==this.Yt&&!this.se;this.Be(o?"no_interaction_since_recording_started":void 0),this.se=!1,this.oe=o,this.ae=!1}this._e&&(this._r(),this.Ue());var s=this.Ht.checkAndGetSessionAndWindowId(),u=s.windowId;this.Bt=s.sessionId,this.Ie=u,null==(e=this._instance.persistence)||e.unregister(x),null!=n&&n.endpoint&&(this.Zt=null==n?void 0:n.endpoint),this.Vt=2===(null==n?void 0:n.version)&&null!=n&&n.triggerGroups&&n.triggerGroups.length>0?new wi(this._instance,this.Y,this.Tt.bind(this),this.Dt.bind(this),this.Rt.bind(this)):new bi(this._instance,this.Y,this.tt,this.et,this.Tt.bind(this),this.It.bind(this),this.Rt.bind(this)),this.Vt.onRemoteConfig(n),null==(i=this.Ot)||i.call(this),this.Ot=this.Vt.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.wr(t,e)),this.kr(v,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(v)}),this.kr(f,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(f)}),this.kr(g,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(g)}),this.kr(p,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(p)}),this.Vt.makeSamplingDecisions(this.sessionId),this.Sr(),this.ue||(ne(r,"beforeunload",this.qe),ne(r,"pagehide",this.ze),ne(r,"offline",this.We),ne(r,"online",this.Ve),ne(a,"visibilitychange",this.Ze),!this.xe&&Z(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&Z(this.Ht.on)?this.Ce=this.Ht.on("forcedIdleReset",()=>{this.Ae(),this.Yt="unknown",this.stop(),this.Me=this.Ht.onSessionId((t,e,r)=>{var i;null==(i=this.Me)||i.call(this),this.Me=void 0,this.Te(t,e,r)})}):Z(this.Ht.on)||Qi.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Y(this.Se)&&(this.Se=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.rr(t.properties.$current_url):"";if(!e)return;this.Dt("$pageview",{href:e})}}catch(t){Qi.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.Tt(t||"recording_initialized"))}else Qi.info("remote config must be stored in persistence before recording can start")}Cr(){var t,e,i,n,o,s;null==r||r.removeEventListener("beforeunload",this.qe),null==r||r.removeEventListener("pagehide",this.ze),null==r||r.removeEventListener("offline",this.We),null==r||r.removeEventListener("online",this.Ve),null==a||a.removeEventListener("visibilitychange",this.Ze),clearInterval(this.gr),this.Mr(),null==(t=this.Se)||t.call(this),this.Se=void 0,null==(e=this.Ot)||e.call(this),this.Ot=void 0,null==(i=this.xe)||i.call(this),this.xe=void 0,null==(n=this.Ce)||n.call(this),this.Ce=void 0,null==(o=this.Me)||o.call(this),this.Me=void 0,null==(s=this.Vt)||s.stop(),this.Tr(),this._r()}_r(){this.ke+=1,this.be=[],this.we=0,this.Ir=void 0,this._e=!1}Tr(){var t,e,r;null==(t=this.Rr)||t.stop(),this.Xt=[],null==(e=this.lr)||e.stop(),this.lr=void 0,this.Qt=!1,null==(r=this.Gt)||r.call(this),this.Gt=void 0}Ar(){if(!this.Ir||0===this.we)return!1;if(this._e)return!0;this._e=!0,this.Er=void 0;var t=this.ke;return this.Mr(),this.Tr(),this.Ir.catch(()=>{}).then(()=>{t===this.ke&&(this._e=!1,this.$e(),this.Ue(),this.Lr(),this.Cr(),Qi.info("stopped"))}).catch(()=>{this._e=!1,this.Lr(),this.Cr(),Qi.info("stopped")}),!0}stop(){if(this.Tr(),this.Le)this.He();else if(this.Ar())return;this.$e(),this.Ue(),this.Lr(),this.Cr(),Qi.info("stopped")}Lr(){this.Be(void 0,{preserveLogDedup:this.Le}),this.oe=!1}flushBeforeIdentityReset(){(this.isStarted||this._e)&&(this.He(),this.$e())}Ee(t){this.Le=!0,this.Jt=Date.now();try{var e;this.stop(),this.Or=void 0,this.Dr=void 0,this.ee=0,this.re=0,this.ie=0,null==(e=Xi())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Le=!1}this.Be(t?"no_interaction_since_session_rotated":void 0),this.oe=!1}Be(t,e){var r=(void 0===e?{}:e).preserveLogDedup,i=void 0!==r&&r;if(this.ne=!Q(t),this.Er=t,Q(t))i||(this.Pr=void 0);else if(!this.Le){var n=this.sessionId+":"+t;n!==this.Pr&&(this.Pr=n,Qi.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}mr(){this.isStarted||(this.se=!0),this.ne&&(this.Be(void 0),this.oe=!1,this.ae&&(this.ae=!1,this.It()),this.Fr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,r=void 0!==e&&e;this.ne=!0,r&&(this.Ue(),this.Tr()),this.Ue(),this.Cr(),this.Ue(),this.Lr(),Qi.info("discarded")}Nr(t,e,r,i,n){var o={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};"disabled"!==this.status?(this.qr(t,i),this.jr(o)):this.Ue()}Br(){try{this.Hr()}catch(t){this.ce||(this.ce=!0,Qi.error("could not track full snapshot cost",t))}}Hr(){var t,e=null==(t=Xi())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Dr&&(this.Dr=e,this.Or&&this.Or.durationMs>=e.durationMs||(this.Or=e),500>e.durationMs||Qi.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}qr(t,e){2!==t.type?3===t.type&&(Q(this.me)||this.me===e||this.ye===e||(this.ye=e,Qi.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.It())):this.me=e}$r(t){t.counted&&t.generation===this.ke&&(this.we=Math.max(0,this.we-1)),t.counted=!1,this.be=this.be.filter(e=>e!==t)}Ur(t,e,r){t.processed||t.generation!==this.ke||(t.processed=!0,this.Nr(t.event,e,r,t.targetSessionId,t.targetWindowId))}zr(t){try{var e=t.event,r=fr(t.event);if(t.compressionEnabled)try{var i=fn(t.event);e=i.event,r=i.size}catch(t){Qi.error("could not process queued compression event - will use uncompressed event",t)}try{this.Ur(t,e,r)}catch(t){Qi.error("could not capture queued compression event",t)}}finally{this.$r(t)}}He(){[...this.be].forEach(t=>{this.zr(t)})}Wr(t,e,r,n){var o=this,a={event:t,compressionEnabled:e,targetSessionId:r,targetWindowId:n,generation:this.ke,processed:!1,counted:!0};this.be.push(a),this.we+=1;var s=function(){var r=i(function*(){try{if(a.processed)return;var r,i;try{var n=e?hn(t)?yield function(t){return pn.apply(this,arguments)}(t):fn(t):{event:t,size:fr(t)};r=n.event,i=n.size}catch(e){Qi.error("could not process queued compression event - will use uncompressed event",e),r=t,i=fr(t)}o.Ur(a,r,i)}finally{o.$r(a)}});return function(){return r.apply(this,arguments)}}();this.Ir=this.Ir?this.Ir.catch(()=>{}).then(s):s()}onRRwebEmit(t){var e,r,i,n,o,a,s,u,l;if(this._instance.sessionManager&&(this.dr(),t&&G(t))){if(4===t.type){var h=this.rr(t.data.href);if(this.cr=h,!h)return;t.data.href=h}else this.hr();if(null==(e=this.Vt)||e.checkUrlTriggers(this.sessionId,()=>this.yr(),()=>this.br(),(t,e)=>this.wr(t,e)),!this.Y.urlBlocked||function(t){return 5===t.type&&"recording paused"===t.data.tag}(t)){var c,d,v;2===t.type&&(null!=(c=Xi())&&null!=c.wasMaxDepthReached&&c.wasMaxDepthReached()&&(this.he=!0),this.Br(),Promise.resolve().then(()=>this.Br()),this.pr(),null==(d=this.Rr)||d.reset(),null==(v=this._instance.persistence)||v.register_once({[x]:t.timestamp},void 0));var f=2===t.type&&(null==(r=this.Vt)?void 0:r.hasPendingTriggers(this.sessionId));f&&this.Vr();var p=this.Rr?this.Rr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&G(e)&&6===e.type&&G(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(p),m=function(t){return yn(t)?t.data.payload:null}(g),y=function(t){return bn(t)?t.data.payload:null}(g),b=function(t){return mn(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=b&&b.sessionId||this.Zr(g),2===t.type&&(this.ge.push([this.Bt,t.timestamp]),this.ge.length>6&&(this.ge=this.ge.slice(-6)));var w=null!==(i=null!==(n=null!==(o=null==m?void 0:m.currentSessionId)&&void 0!==o?o:null==y?void 0:y.nextSessionId)&&void 0!==n?n:null==b?void 0:b.sessionId)&&void 0!==i?i:this.Bt,k=null!==(a=null!==(s=null!==(u=null==m?void 0:m.currentWindowId)&&void 0!==u?u:null==y?void 0:y.nextWindowId)&&void 0!==s?s:null==b?void 0:b.windowId)&&void 0!==a?a:this.Ie;if(!0!==this.Yt||function(t){return mn(t)||yn(t)||bn(t)}(g)){2===g.type&&(this.te=0),b&&(g.timestamp=b.lastActivityTimestamp+b.threshold);var _=this.Qt;this.Qt=!0,f?this.ur(!0):_||this.ur();var S=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.we>0||S&&hn(g))this.Wr(g,S,w,k);else{var C=S?fn(g):{event:g,size:fr(g)};this.Nr(g,C.event,C.size,w,k)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(g)&&this.te++}else!0===this.Yt&&this.te++}}}get status(){return this.Vt?this.Vt.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ut,rrwebError:this.ue,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.zt}):ze}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.It(),this.mr(),this.Tt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[m]:this.sessionId,[d]:null}),this.It(),this.mr(),this.Tt("sampling_overridden")}overrideTrigger(t){this.wr(t),this.mr()}Gr(){try{var t,e=null==r||null==(t=r.location)?void 0:t.href;if(!e)return;var i=this.rr(e);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Mr(){this.Qr&&(clearTimeout(this.Qr),this.Qr=void 0)}Fr(){this.Qr||(this.Qr=setTimeout(()=>{this.$e()},2e3))}Jr(){return this.me!==this.Pe.sessionId&&0!==this.Pe.data.length&&this.Pe.data.every(t=>5===(null==t?void 0:t.type)&&!yn(t)&&!bn(t))}Kr(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Xr(t){if("buffering"!==t)return Q(this.Yr)||this._instance.register_for_session({[E]:[]}),void(this.Yr=void 0);var e=this.Kr();if(0===e.length)return Q(this.Yr)||this._instance.register_for_session({[E]:[]}),void(this.Yr=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.Yr&&(this.Yr=i,this._instance.register_for_session({[E]:e}),Qi.info("buffering: "+r))}$e(){var t;if(this.Mr(),this.ne)return this.Pe;if(this.Jr())return this.Pe.size>943718.4?this.Ue():this.Pe;var e=this.Pe;null==(t=this.Vt)||t.ensureSamplingDecision(this.sessionId);var r=this.Fe(),i=this.status;if(this.Xr(i),"buffering"===i||"paused"===i||"disabled"===i||r)return this.Fr(),this.Pe;if(this.Pe!==e)return this.Pe;if(e.data.length>0){var n,o=this.Gr();gr(e).forEach(t=>{try{var e;null==(e=this.Re)||e.trackSize(t.sessionId,t.size),this.ti({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Xr.LIB_NAME,$lib_version:Xr.LIB_VERSION,$snapshot_host:o})}catch(t){Qi.warn("could not capture snapshot chunk - skipping it",t)}}),null==(n=this.Vt)||n.onFlushComplete()}return this.Ue()}jr(t){var e,r=2+((null==(e=this.Pe)?void 0:e.data.length)||0),i=t.$session_id,n=this.Pe.sessionId!==i;if(n||!0!==this.Yt&&!this.ne&&this.Pe.size+t.$snapshot_bytes+r>943718.4){var o=this.Bt;if(this.Pe=this.$e(),this.Bt!==o)return;n&&this.Pe.data.length>0&&(this.Pe=this.Ue()),this.Pe.sessionId=i,this.Pe.windowId=t.$window_id}this.ne&&(this.ae||this.Pe.size+t.$snapshot_bytes+r>943718.4)?this.ae||(this.ae=!0,this.Pe=this.Ue()):(this.Pe.size+=t.$snapshot_bytes,this.Pe.data.push(t.$snapshot_data),this.Pe.sizes.push(t.$snapshot_bytes),!0===this.Yt||this.ne||this.Fr())}ti(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Zt),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ne(){var t,e,r=null==(t=this.Pe)?void 0:t.data[(null==(e=this.Pe)?void 0:e.data.length)-1],i=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return r?r.timestamp-i:null}Vr(){if(!this.Pe||0===this.Pe.data.length)return this.Ue();for(var t=-1,e=this.Pe.data.length-1;e>=0;e--)if(4===this.Pe.data[e].type){t=e;break}return 0>t?this.Ue():(this.Pe.data=this.Pe.data.slice(t),this.Pe.sizes=this.Pe.sizes.slice(t),this.Pe.size=this.Pe.sizes.reduce((t,e)=>t+e,0),this.Pe)}Ue(){return this.Pe={size:0,data:[],sizes:[],sessionId:this.Bt,windowId:this.Ie},this.Pe}Tt(t,r){this._instance.register_for_session({[N]:t}),Qi.info(t.replace("_"," "),r),"session_id_changed"!==t&&this.Dt("$recording_started",e({reason:t},r))}ei(t){var e;return 3===t.type&&-1!==Ji.indexOf(null==(e=t.data)?void 0:e.source)}Zr(t){var e=this.ei(t);e||!0===this.Yt||t.timestamp-this.Jt>this.$t&&(this.Yt=!0,clearInterval(this.gr),this.Dt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Jt,threshold:this.$t,bufferLength:this.Pe.data.length,bufferSize:this.Pe.size,sessionId:this.Bt,windowId:this.Ie}),this.$e());var r=!1;if(e&&(this.Jt=t.timestamp,this.Yt)){var i="unknown"===this.Yt;this.Yt=!1,i||(this.Dt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.Ht.checkAndGetSessionAndWindowId(!e,t.timestamp),o=n.windowId,a=n.sessionId,s=this.Bt!==a,u=this.Ie!==o;if(this.Ie=o,this.Bt=a,s||u){var l=s&&!1!==this.Yt;l&&(this.Yt="unknown"),this.Ee(l)}else if(e&&this.mr(),r){var h,c=["sampled","active"].includes(this.status)||(null==(h=this.Vt)?void 0:h.hasPendingTriggers(this.sessionId));this.te>0&&c&&this.It(),this.ur(),this.pr()}}Ae(){var t;null==(t=this.Vt)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,o,a,s,u,l=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Xi())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Er,$sdk_debug_replay_internal_buffer_length:this.Pe.data.length,$sdk_debug_replay_internal_buffer_size:this.Pe.size,$sdk_debug_current_session_duration:this.Ne,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(e=this.Re)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ge,$snapshot_max_depth_exceeded:this.he,$sdk_debug_replay_slowest_full_snapshot_ms:Wi(null==(r=this.Or)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Wi(null==(i=this.Or)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Or)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(o=this.Or)?void 0:o.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Or)?void 0:a.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:Wi(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Wi(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Wi(null==(s=Xi())||null==s.getMutationCost||null==(s=s.getMutationCost())?void 0:s.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=Xi())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ee,$sdk_debug_replay_oversized_mutations_dropped:this.re,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ie,$sdk_debug_replay_rrweb_error:this.ue,[P]:!!this.Gt,[F]:this.le}}Sr(){var t;if(!this.Gt){this.le=!0;var i,n,o,s,u={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},l=this._instance.config.session_recording;for(var h of Object.entries(l||{})){var c=h[0],d=h[1];if(c in u)if("maskInputOptions"===c)u.maskInputOptions=e({password:!0},d);else if("sampling"===c){var v=null!=d?d:{},f={};Q(v.mousemove)||(f.mousemove=v.mousemove),Q(v.mouseInteraction)||(f.mouseInteraction=v.mouseInteraction),u.sampling=f}else u[c]=d}!0===(null==l?void 0:l.captureJsonLd)&&!0!==u.slimDOMOptions&&"all"!==u.slimDOMOptions&&(u.slimDOMOptions=e({},u.slimDOMOptions,{script:!0})),this.Ke&&this.Ke.enabled&&(u.recordCanvas=!0,u.sampling=e({},u.sampling,{canvas:this.Ke.fps}),u.dataURLOptions={type:"image/webp",quality:this.Ke.quality},u.canvasResolutionScale=this.Je,u.canvasMasking={configured:()=>{var t;return Z(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Z(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.fe||(this.fe=!0,Qi.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ge&&(u.maskAllInputs=null===(i=this.Ge.maskAllInputs)||void 0===i||i,u.maskTextSelector=null!==(n=this.Ge.maskTextSelector)&&void 0!==n?n:void 0,u.blockSelector=null!==(o=this.Ge.blockSelector)&&void 0!==o?o:void 0,u.maskAllElementAttributes=null!==(s=this.Ge.maskAllElementAttributes)&&void 0!==s&&s),u.maskAllElementAttributes&&u.maskAttributeFn&&(u.maskAttributeFn=void 0,this.ve||(this.ve=!0,Qi.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.Qe();var p=Yi();if(p){this.Rr=null!==(t=this.Rr)&&void 0!==t?t:new Kr(p,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Qi.info(r,{node:e}),this.log("[SessionRecording] "+r,"warn")},onDroppedAttributeMutations:t=>this.ee+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.vr,onDroppedOversizedMutation:t=>{0===this.re&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.re+=1,this.ie+=t},requestFullSnapshot:()=>this.It()});var g=this.tr();if(this.Gt=p(e({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,Qi.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},u)),!this.Gt)return this.ue=!0,void Qi.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==l?void 0:l.captureJsonLd)&&a&&null!=r&&r.MutationObserver&&!this.lr&&(this.lr=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),o=_i,a=function(t,e){var r=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=r&&r.length&&!r.includes("id")?Ci:r=>{var i=t.getElementById(r);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!Ui(i,e.blockClass,e.blockSelector)}}(t,r),s=e=>{try{var s=n();if(!o||!1===s||!e.isConnected||e.ownerDocument!==t||function(t,e){return Ui(t,e.blockClass,e.blockSelector)||Ui(t,e.maskTextClass,e.maskTextSelector)}(e,r))return;var u=function(t,e){if(void 0===e&&(e=Ci),!t||t.length>_i)return null;try{var r=JSON.parse(t),i={remainingNodes:2048,exceeded:!1},n=V(r)?r.map(t=>Bi(t,e,i)):Bi(r,e,i);if(i.exceeded||X(n)||V(n)&&(!n.length||n.some(X)))return null;var o=JSON.stringify(n);return o.length>2e4?null:[n,o]}catch(t){return null}}(e.text,a);if(!u)return void i.delete(e);var l=u[0],h=u[1];if(X(s))return void i.set(e,h);if(i.get(e)!==h){if(h.length>o)return void(o=0);r.emit(l)&&(i.set(e,h),o-=h.length)}}catch(t){return}};try{var u=new e(t=>{try{if(!o||!1===n())return;var e=t=>{for(var e of zi(t))s(e)};for(var r of t)if("childList"===r.type)Hi(r.target)&&s(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&Hi(i)&&s(i)}else"attributes"===r.type&&Hi(r.target)&&s(r.target)}catch(t){return}});return u.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),o&&!1!==n()&&zi(t.documentElement).forEach(t=>{e&&i.delete(t),s(t)})},stop(){return u.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(a,r.MutationObserver,{attributeFilter:u.attributeFilter,blockClass:u.blockClass,blockSelector:u.blockSelector,isRecordedElement:t=>p.mirror.getId(t)>0,maskAllElementAttributes:u.maskAllElementAttributes,maskAttributeFn:u.maskAttributeFn,maskTextClass:u.maskTextClass,maskTextSelector:u.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.ar()},emit:t=>this.sr(t)}),this.Y.isCurrentUrlBlocked()&&this.lr.scan()),this.Jt=Date.now(),this.Yt=et(this.Yt)?this.Yt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.zt),this.Dt("$session_options",{sessionRecordingOptions:u,activePlugins:g.map(t=>null==t?void 0:t.name)}),this.Dt("$posthog_config",{config:this._instance.config})}else Qi.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Dt(t,e)}},kn=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),_n=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),Sn=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),xn=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Cn=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Mn=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),Tn=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function In(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Rn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},An={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},En={};function Ln(t){if(En[t])return En[t];var e=function(t){var e,r,i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Rn?Rn[t]:void 0,n=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),o=t in An?An[t]:void 0,a=Boolean(o&&o.every(t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&a)return En[t]=e.prototype,e.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 e.prototype;var h=l[t].prototype;return h?(function(t){return In(t,"AppleWebKit")&&!In(t,"Chrome")}(navigator.userAgent)&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",t),u=!0),En[t]=h):r}catch(t){return r}finally{!u&&s.parentNode&&document.body.removeChild(s)}}var On={};function Dn(t,e,r){var i,n=t+"."+String(r);if(On[n])return On[n].call(e);var o=Ln(t),a=null===(i=Object.getOwnPropertyDescriptor(o,r))||void 0===i?void 0:i.get;return a?(On[n]=a,a.call(e)):e[r]}var Pn={};function Fn(t,e,r){var i=t+"."+String(r);if(Pn[i])return Pn[i].bind(e);var n=Ln(t)[r];return"function"!=typeof n?e[r]:(Pn[i]=n,n.bind(e))}function Nn(){return Ln("MutationObserver").constructor}function qn(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},o=r(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)});return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=o,()=>{if(t[e]!==o)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],a=r(i);a;){if(a.next===o)return void(a.next=n.next);a=r(i=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var jn={childNodes:t=>Dn("Node",t,"childNodes"),parentNode:t=>Dn("Node",t,"parentNode"),parentElement:t=>Dn("Node",t,"parentElement"),textContent:t=>Dn("Node",t,"textContent"),contains:(t,e)=>Fn("Node",t,"contains")(e),getRootNode:t=>Fn("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Dn("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Dn("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Fn("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Fn("Element",t,"querySelectorAll")(e),mutationObserver:Nn,patch:qn};function Bn(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Hn=0;function $n(){Hn+=1}function Un(){return Hn}function zn(t,e){return(e!==Hn||t>6e4)&&!0}var Wn=0,Vn=0,Zn=0,Gn={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Qn=null,Jn=null,Kn=[],Xn=0,Yn=0,to={slowestBatchMs:0},eo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function ro(t){(Wn+=1)>1||(Gn={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Kn=[],Xn=0,Jn=(t=>t&&t>0?t:null)(t),Vn=Bn(),Zn=Hn)}function io(){return 0===Wn?Qn||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Wn-=1)>0?Gn:(Gn.durationMs=Bn()-Vn,Gn.deferredStylesheetCount=Xn,eo.deferredCount+=Xn,Jn=null,zn(Gn.durationMs,Zn)?Gn:Qn=Gn)}function no(t,e,r){var i=t.length;if(r>=32)return i;for(var n=0;t.length>n;n++){var o=t[n];try{var a=o.cssRules;if(a&&a.length)i+=no(a,e,r+1);else if(e&&o.styleSheet){var s=o.styleSheet;if(!e.has(s)){e.add(s);var u=s.rules||s.cssRules;u&&(i+=no(u,e,r+1))}}}catch(t){}}return i}function oo(t){if(0!==Wn){var e=no(t,null,0);Gn.cssRuleCount+=e,Yn>0&&(Gn.nonDeferrableCssRuleCount+=e)}}function ao(t){Yn+=1;try{return t()}finally{Yn-=1}}function so(t){Wn>0&&(Gn.stylesheetMs+=t)}function uo(t){if(0===Wn||null===Jn)return!1;var e=Gn.cssRuleCount-Gn.nonDeferrableCssRuleCount;return e>=Jn||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),no(e,r,0)}catch(t){return 0}}(t)>Jn}function lo(){eo.failedCount+=1}function ho(t){t>0&&(eo.abandonedCount+=t)}function co(t){return co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(t)}function vo(t,e,r){return(e=function(t){var e=function(t){if("object"!=co(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==co(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fo(t){return t.nodeType===t.ELEMENT_NODE}function po(t){var e=t&&"host"in t&&"mode"in t&&jn.host(t)||null;return Boolean(e&&"shadowRoot"in e&&jn.shadowRoot(e)===t)}function go(t){return"[object ShadowRoot]"==={}.toString.call(t)}function mo(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function yo(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var bo=0;function wo(t){var e=0===bo,r=e?Bn():0;bo+=1;try{var i=t.rules||t.cssRules;if(!i)return null;oo(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),mo(Array.from(i,t=>ko(t,n)).join(""))}catch(t){return null}finally{bo-=1,e&&so(Bn()-r)}}function ko(t,e){if(So(t)){var r;try{r=wo(t.styleSheet)||yo(t)}catch(e){r=t.cssText}try{var i;if(r&&(null===(i=t.styleSheet)||void 0===i?void 0:i.href))return jo(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return xo(t)&&t.selectorText.includes(":")&&(n=_o(n)),e?jo(n,e):n}function _o(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function So(t){return"styleSheet"in t}function xo(t){return"selectorText"in t}var Co=/^-?[A-Za-z_][\w-]*$/,Mo=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function To(t){var e=[],r=!1,i=null,n=new Map;function o(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void o(null)}var s=e[e.length-1];return s.parts.push(t),void(s.index+=1)}if(!n.importRule)return r=!0,void(i=t);a(e[e.length-1],n.importRule,t)}function a(t,e,r){try{var i;try{i=r||yo(e)}catch(t){i=e.cssText}try{var n;i&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(i=jo(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){o(null)}}function s(t){var r=t.rules[t.index];if("sheet"===t.kind&&So(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void a(t,r,null)}if(!function(t,r){try{var i=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(xo(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!Co.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?Co.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Mo.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?jo(i,n):i,fixColons:"sheet"===r.kind&&xo(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var o=r.cssText;"sheet"===t.kind&&xo(r)&&r.selectorText.includes(":")&&(o=_o(o)),t.parts.push(t.sheetHref?jo(o,t.sheetHref):o),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;oo(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var o=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:o,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!So(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some(t=>t.sheet===i))return 0;try{var o=i.rules||i.cssRules;if(!o)return 0;oo(o);var a=i.href;!a&&i.ownerNode&&(a=i.ownerNode.baseURI);var s=Array.from(o);n.set(e,{sheet:i,rules:s,sheetHref:a}),r.push({sheet:i,rules:s,index:0})}catch(t){}};r.length>0;)i()}(o,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=Bn(),a=t>0?t:1;try{for(;!r&&a>0;){var u=e[e.length-1];if(u.rules.length>u.index){a-=1;try{s(u)}catch(t){o(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?_o(h):h}else l=mo(u.parts.join(""))}catch(t){}o(l)}}}catch(t){r=!0,i=null}finally{so(Bn()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}var Io=class{constructor(){vo(this,"idNodeMap",new Map),vo(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),fo(t)){var r=jn.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ro(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,o=t.maskInputFn,a=t.value||"",s=n&&Ao(n);return(r[i.toLowerCase()]||s&&r[s])&&(a=o?o(a,e):"*".repeat(a.length)),a}function Ao(t){return t.toLowerCase()}var Eo=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 Lo(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,o=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==o&&o&&Eo.has(Ao(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var Oo="__rrweb_original__";function Do(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ao(e):null}catch(t){return null}}var Po=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Fo=/^(?:[a-z+]+:)?\/\//i,No=/^www\..*/i,qo=/^(data:)([^,]*),(.*)/i;function jo(t,e){return(t||"").replace(Po,(t,r,i,n,o,a)=>{var s,u=i||o||a,l=r||n||"";if(!u)return t;if(Fo.test(u)||No.test(u))return"url("+l+u+l+")";if(qo.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=e).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var h=e.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 Bo,Ho,$o=new Map,Uo=1,zo=new RegExp("[^a-z0-9-_:]");function Wo(){return Uo++}var Vo=/^[^ \t\n\r\u000c]+/,Zo=/^[, \t\n\r\u000c]+/,Go=new WeakMap;function Qo(t,e){return e&&""!==e.trim()?Jo(t,e):e}function Jo(t,e){var r=Go.get(t);if(r||(r=t.createElement("a"),Go.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Ko(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Xo(t,e,r,i,n,o){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a,s=null===(a=n.sheet)||void 0===a?void 0:a.href;if(s)return s}var u=Qo(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==o?void 0:o.type)||void 0!==(null==o?void 0:o.quality))&&(l=function(t,e,r,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=$o.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;var a=o.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var s=o.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>s.length?s:e;if($o.size>=10){var l=$o.keys().next().value;void 0!==l&&$o.delete(l)}return $o.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,o.type,o.quality)),Ko(l,o)}if("image"===e)return Ko(u,o)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Qo(t,i);return"image"===e&&h.startsWith("data:")?Ko(h,o):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Zo),e.length>r;){var o=i(Vo);if(","===o.slice(-1))o=Qo(t,o.substring(0,o.length-1)),n.push(o);else{var a="";o=Qo(t,o);for(var s=!1;;){var u=e.charAt(r);if(""===u){n.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,n.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?jo(i,Jo(t)):"object"===e&&"data"===r?Qo(t,i):i:Qo(t,i)}function Yo(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function ta(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ta(jn.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&ta(jn.parentNode(t),e,r)}function ea(t,e,r,i){var n;if(fo(t)){if(!jn.childNodes(n=t).length)return!1}else{if(null===jn.parentElement(t))return!1;n=jn.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(ta(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function ra(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var ia=new Map;function na(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function oa(t){return null==t?"":t.toLowerCase()}var aa=!1,sa=!1;function ua(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,o=e.blockSelector,a=e.maskTextClass,s=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,h=e.inlineStylesheet,c=void 0===h||h,d=e.maskInputOptions,v=void 0===d?{}:d,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,b=e.slimDOMOptions,w=e.dataURLOptions,k=void 0===w?{}:w,_=e.inlineImages,S=void 0!==_&&_,x=e.recordCanvas,C=void 0!==x&&x,M=e.canvasMaskingConfigured,T=e.onSerialize,I=e.onIframeLoad,R=e.iframeLoadTimeout,A=void 0===R?5e3:R,E=e.onIframeListenerRegistered,L=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,D=void 0===O?5e3:O,P=e.keepIframeSrcFn,F=void 0===P?()=>!1:P,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,U=void 0===H?50:H,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=U)return sa=!0,aa||(aa=!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;z||(z=ea(t,a,s,void 0===z)),Wn>0&&(Gn.nodeCount+=1);var Z,G=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,o=e.needsMask,a=e.inlineStylesheet,s=e.maskInputOptions,u=void 0===s?{}:s,l=e.maskTextFn,h=e.maskInputFn,c=e.maskAllElementAttributes,d=void 0!==c&&c,v=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,b=e.keepIframeSrcFn,w=e.newlyAddedElement,k=void 0!==w&&w,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Tn.Document,childNodes:[],compatMode:t.compatMode}:{type:Tn.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Tn.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,i=e.inlineStylesheet,n=e.maskInputOptions,o=void 0===n?{}:n,a=e.maskInputFn,s=e.maskAllElementAttributes,u=void 0!==s&&s,l=e.maskAttributeFn,h=e.dataURLOptions,c=void 0===h?{}:h,d=e.inlineImages,v=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,b=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),w=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ao(t.tagName);return zo.test(e)?"div":e}(t),k=new Set,_={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];Yo(w,C.name)||(_[C.name]=Xo(r,w,Ao(C.name),C.value,t,c))}if("link"===w&&i&&!b){var M=t.sheet;if(!M){var T=function(t){return t.href}(t);T&&!(M=na(r,T))&&T.includes(".css")&&(M=na(r,window.location.origin+"/"+T.replace(window.location.href,"")))}var I=null;M&&(uo(M)?Wn>0&&(Kn.push(t),Xn+=1):I=wo(M)),I&&(delete _.rel,delete _.href,_._cssText=I)}if("style"===w&&t.sheet&&!(t.innerText||jn.textContent(t)||"").trim().length){var R=ao(()=>wo(t.sheet));R&&(_._cssText=R)}if("input"===w||"textarea"===w||"select"===w){var A=t.value,E=t.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&A?_.value=Ro({element:t,type:Do(t),tagName:w,value:A,maskInputOptions:o,maskInputFn:a}):E&&(_.checked=E)}if("option"===w&&(t.selected&&!o.select?_.selected=!0:delete _.selected),"dialog"===w&&t.open){try{_.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}k.add("rr_open_mode")}if("canvas"===w&&v&&!(null==f?void 0:f()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((Oo in n?n[Oo]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some(t=>0!==t))return!1}return!0})(t)||(_.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var L=t.toDataURL(c.type,c.quality),O=r.createElement("canvas");O.width=t.width,O.height=t.height,L!==O.toDataURL(c.type,c.quality)&&(_.rr_dataURL=L)}var D,P,F=!1;if("img"===w&&d){Bo||(Bo=r.createElement("canvas"),Ho=Bo.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,r)=>F?Lo({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:l}):r,H=()=>{ra(N,"load",H);try{Bo.width=N.naturalWidth,Bo.height=N.naturalHeight,Ho.drawImage(N,0,0);var t=Bo.toDataURL(c.type,c.quality);_.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(j?_.crossOrigin=B("crossOrigin",j):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H)}if("audio"===w||"video"===w){var U=_;U.rr_mediaState=t.paused?"paused":"played",k.add("rr_mediaState"),U.rr_mediaCurrentTime=t.currentTime,U.rr_mediaPlaybackRate=t.playbackRate,U.rr_mediaMuted=t.muted,U.rr_mediaLoop=t.loop,U.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),b){var z,W,V,Z=t.getBoundingClientRect(),G=Z.width,Q=Z.height,J=Z.left,K=Z.top,X=null===(z=r.defaultView)||void 0===z?void 0:z.getComputedStyle(t);_={class:_.class,rr_width:G+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null===(W=r.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(K+((null===(V=r.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},k.add("rr_width"),k.add("rr_height"),k.add("rr_left"),k.add("rr_top"),X&&(_.rr_position=X.position||"static",k.add("rr_position"),X.transform&&"none"!==X.transform&&(_.rr_transform=X.transform,k.add("rr_transform")),X.display&&X.display.startsWith("inline")&&(_.rr_display=X.display,k.add("rr_display")))}if("iframe"!==w||p(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src),u||l)for(var Y of Object.entries(_)){var tt=Y[0],et=Y[1];"string"!=typeof et&&null!==et||(_[tt]=Lo({element:t,name:tt,value:et,maskAllElementAttributes:u,maskAttributeFn:l,isGenerated:k.has(tt)}))}F=!0;try{customElements.get(w)&&(D=!0)}catch(t){}return{type:Tn.Element,tagName:w,attributes:_,childNodes:[],isSVG:(P=t,Boolean("svg"===P.tagName||P.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:D}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:k,rootId:_});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,i=e.maskTextFn,n=e.rootId,o=jn.parentNode(t),a=o&&o.tagName,s=jn.textContent(t),u="STYLE"===a||void 0,l="SCRIPT"===a||void 0;if(u&&s){try{var h;if(t.nextSibling||t.previousSibling);else if(uo(o.sheet));else if(null===(h=o.sheet)||void 0===h?void 0:h.cssRules){var c=wo(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(s=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}s=jo(s,Jo(e.doc))}return l&&(s="SCRIPT_PLACEHOLDER"),!u&&!l&&s&&r&&(s=i?i(s,jn.parentElement(t)):s.replace(/[\S]/g,"*")),{type:Tn.Text,textContent:s||"",isStyle:u,rootId:n}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:_});case t.CDATA_SECTION_NODE:return{type:Tn.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:Tn.Comment,textContent:jn.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:z,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(t,"not serialized"),null;Z=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===Tn.Comment)return!0;if(t.type===Tn.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e,r;try{r=new URL(t,window.location.href)}catch(t){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(oa(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===oa(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(oa(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&oa(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(oa(t.attributes.property).match(/^(og|twitter|fb):/)||oa(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===oa(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(oa(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(oa(t.attributes.name))||oa(t.attributes.property).match(/^article:/)||oa(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(oa(t.attributes.name)))return!0}}return!1}(G,b)||!V&&G.type===Tn.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Wo();var Q=Object.assign(G,{id:Z});if(i.add(t,Q),-2===Z)return null;T&&T(t);var J=!l;if(Q.type===Tn.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=jn.shadowRoot(t);K&&go(K)&&(Q.isShadowHost=!0)}if((Q.type===Tn.Document||Q.type===Tn.Element)&&J){b.headWhitespace&&Q.type===Tn.Element&&"head"===Q.tagName&&(V=!1);var X={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:z,maskTextClass:a,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:A,onIframeListenerRegistered:E,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:F,depth:B+1,maxDepth:U};if(Q.type===Tn.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var Y of Array.from(jn.childNodes(t))){var tt=ua(Y,X);tt&&Q.childNodes.push(tt)}var et=null;if(fo(t)&&(et=jn.shadowRoot(t)))for(var rt of Array.from(jn.childNodes(et))){var it=ua(rt,X);it&&(go(et)&&(it.isShadow=!0),Q.childNodes.push(it))}}var nt=jn.parentNode(t);if(nt&&po(nt)&&go(nt)&&(Q.isShadow=!0),Q.type===Tn.Element&&"iframe"===Q.tagName){var ot=function(t,e,r){var i,n=()=>{},o=t.contentWindow;if(!o)return n;try{i=o.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),ra(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),s?ra(t,"load",a):(s=!0,ra(t,"load",h))}}var c,d="about:blank";try{c=o.location.href}catch(t){return n}if(c!==d||t.src===d||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),ra(t,"load",a)}}return t.addEventListener("load",a),()=>{ra(t,"load",a)}}(t,()=>{var e=t.contentDocument;if(e&&I){var r=ua(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:z,maskTextClass:a,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:A,onIframeListenerRegistered:E,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:F,depth:B+1,maxDepth:U});r&&I(t,r)}},A);null==E||E(t,ot)}return Q.type===Tn.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,u,l){if(!ia.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var d=new AbortController,g=!1,w=()=>{if(!g){g=!0;try{(()=>{if(L){var e=ua(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:z,maskTextClass:a,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:A,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:F,depth:B,maxDepth:U});e&&L(t,e)}})()}finally{ia.delete(e),d.abort()}}},_=setTimeout(w,l);d.signal.addEventListener("abort",()=>clearTimeout(_),{once:!0}),e.addEventListener("load",w,{signal:d.signal,once:!0}),ia.set(e,d)}}}(t,0,D),Q}function la(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var ha=class t{constructor(){vo(this,"parentElement",null),vo(this,"parentNode",null),vo(this,"ownerDocument",void 0),vo(this,"firstChild",null),vo(this,"lastChild",null),vo(this,"previousSibling",null),vo(this,"nextSibling",null),vo(this,"ELEMENT_NODE",1),vo(this,"TEXT_NODE",3),vo(this,"nodeType",void 0),vo(this,"nodeName",void 0),vo(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function ca(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>da(r,t,e,i)}function da(t,e,r,i){va(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))})}function va(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var fa="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.",pa={map:{},getId(){return console.error(fa),-1},getNode(){return console.error(fa),null},removeNodeFromMap(){console.error(fa)},has(){return console.error(fa),!1},reset(){console.error(fa)}};function ga(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;o>s;s++)a[s]=arguments[s];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,a)):i||!1===r.trailing||(i=setTimeout(()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,a)},l))}}function ma(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout(()=>{try{r.set.call(this,t)}catch(t){}},0),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),()=>ma(t,e,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pa=new Proxy(pa,{get(t,e,r){return"map"===e&&console.error(fa),Reflect.get(t,e,r)}}));var ya=Date.now;function ba(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(e=jn.parentElement(o.body))||void 0===e?void 0:e.scrollLeft)||(null==o||null===(r=o.body)||void 0===r?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(i=jn.parentElement(o.body))||void 0===i?void 0:i.scrollTop)||(null==o||null===(n=o.body)||void 0===n?void 0:n.scrollTop)||0}}function wa(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ka(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function _a(t){return t?t.nodeType===t.ELEMENT_NODE?t:jn.parentElement(t):null}function Sa(t,e,r,i){if(!t)return!1;var n=_a(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ta(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xa(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function Ca(t,e){if(po(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=jn.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Ca(i,e))}function Ma(t){return Boolean(t.changedTouches)}function Ta(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ia(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ra(t){return!!t&&(t instanceof ha&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(jn.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ya=()=>(new Date).getTime());var Aa=class{constructor(){vo(this,"id",1),vo(this,"styleIDMap",new WeakMap),vo(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ea(t){var e,r=null;return"getRootNode"in t&&(null===(e=jn.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&jn.host(jn.getRootNode(t))&&(r=jn.host(jn.getRootNode(t))),r}function La(t){var e=t.ownerDocument;return!!e&&(jn.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ea(r);)r=e;return r}(t);return jn.contains(e,r)}(t))}function Oa(t){return"__ln"in t}var Da,Pa=class{constructor(){vo(this,"length",0),vo(this,"head",null),vo(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Oa(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Oa(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Fa=(t,e)=>t+"@"+e,Na=class{constructor(){vo(this,"frozen",!1),vo(this,"locked",!1),vo(this,"texts",[]),vo(this,"attributes",[]),vo(this,"attributeMap",new WeakMap),vo(this,"generatedAttributes",new WeakMap),vo(this,"removes",[]),vo(this,"mapRemoves",[]),vo(this,"movedMap",{}),vo(this,"addedSet",new Set),vo(this,"movedSet",new Set),vo(this,"droppedSet",new Set),vo(this,"removesSubTreeCache",new Set),vo(this,"mutationCb",void 0),vo(this,"blockClass",void 0),vo(this,"blockSelector",void 0),vo(this,"maskTextClass",void 0),vo(this,"maskTextSelector",void 0),vo(this,"inlineStylesheet",void 0),vo(this,"maskInputOptions",void 0),vo(this,"maskTextFn",void 0),vo(this,"maskInputFn",void 0),vo(this,"maskAllElementAttributes",void 0),vo(this,"maskAttributeFn",void 0),vo(this,"keepIframeSrcFn",void 0),vo(this,"recordCanvas",void 0),vo(this,"canvasMaskingConfigured",void 0),vo(this,"inlineImages",void 0),vo(this,"slimDOMOptions",void 0),vo(this,"dataURLOptions",void 0),vo(this,"doc",void 0),vo(this,"mirror",void 0),vo(this,"iframeManager",void 0),vo(this,"stylesheetManager",void 0),vo(this,"shadowDomManager",void 0),vo(this,"canvasManager",void 0),vo(this,"processedNodeManager",void 0),vo(this,"unattachedDoc",void 0),vo(this,"canvasManagerReleased",!1),vo(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),vo(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,r=Bn(),i=Un();try{this.processBufferedMutations()}finally{t=Bn()-r,e=i,Wn>0||zn(t,null!=e?e:Hn)||t>to.slowestBatchMs&&(to.slowestBatchMs=t)}}}),vo(this,"processBufferedMutations",()=>{for(var t=[],e=new Set,r=new Pa,i=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=jn.parentNode(n);if(o&&La(n)&&"TEXTAREA"!==o.tagName&&!this.isBlockedAtEmission(o)){var a=po(o)?this.mirror.getId(Ea(n)):this.mirror.getId(o),s=i(n);if(-1===a||-1===s)return r.addNode(n);var u=ua(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:t=>{Ta(t,this.mirror)&&this.iframeManager.addIframe(t),Ia(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ra(t)&&!Sa(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(jn.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:a,nextId:s,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)ja(this.removesSubTreeCache,o)&&!this.movedSet.has(jn.parentNode(o))||n(o);for(var a of this.addedSet)Ba(this.droppedSet,a)||ja(this.removesSubTreeCache,a)?Ba(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(jn.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(jn.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=jn.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=jn.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.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,r=jn.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var o,a=n[0],s=n[1];"string"!=typeof s&&null!==s||(e[a]=Lo({element:t.node,name:a,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(o=this.generatedAttributes.get(t.node))||void 0===o?void 0:o.has(a)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&this.mutationCb(g)}),vo(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),vo(this,"genTextAreaValueMutation",t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(jn.childNodes(t),t=>jn.textContent(t)||"").join("");e.attributes.value=Ro({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Do(t),value:r,maskInputFn:this.maskInputFn})}),vo(this,"processMutation",t=>{if(!xa(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=jn.textContent(t.target);Sa(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:ea(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,_a(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,i=t.target,n=t.attributeName,o=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,a=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(i,n,o),s=o?i.getAttributeNS(o,n):t.target.getAttribute(n);if("value"===a){var u=i,l=Do(u);s=Ro({element:u,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:l,value:s,maskInputFn:this.maskInputFn})}if(Sa(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;var h=this.attributeMap.get(t.target),c="IFRAME"===i.tagName&&"src"===a;if(c&&!this.keepIframeSrcFn(s)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===a&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Yo(i.tagName,a)){var d,v=Xo(this.doc,Ao(i.tagName),Ao(a),s,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(s)&&(a="rr_src"),h.attributes[a]=v,null===(d=this.generatedAttributes.get(t.target))||void 0===d||d.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=i.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===a&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(Sa(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{var r=this.mirror.getId(e),i=po(t.target)?this.mirror.getId(jn.host(t.target)):this.mirror.getId(t.target);Sa(t.target,this.blockClass,this.blockSelector,!1)||xa(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(qa(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Ca(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Fa(r,i)]?qa(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!po(t.target)||!go(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),jn.childNodes(i).forEach(t=>r.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))})}}),vo(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xa(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Fa(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Sa(t,this.blockClass,this.blockSelector,!1)||(jn.childNodes(t).forEach(t=>this.genAdds(t)),Ra(t)&&jn.childNodes(jn.shadowRoot(t)).forEach(e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)}))}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}isBlockedAtEmission(t){for(var e=this.blockClass,r=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(r&&(r.lastIndex=0),Sa(t,r||e,this.blockSelector,!0))return!0;var i="getRootNode"in t?jn.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?jn.host(i):null}return!1}};function qa(t,e){for(var r=[e];r.length;){var i=r.pop();t.delete(i),jn.childNodes(i).forEach(t=>r.push(t))}}function ja(t,e,r){return 0!==t.size&&function(t,e){var r=jn.parentNode(e);return!!r&&t.has(r)}(t,e)}function Ba(t,e){if(0===t.size)return!1;for(var r=jn.parentNode(e);r;){if(t.has(r))return!0;r=jn.parentNode(r)}return!1}var Ha=function(t,e){return void 0===e&&(e="rrweb"),Da?function(){try{return t(...arguments)}catch(t){if(Da&&!0===Da(t,e))return;throw t}}:t},$a=[];function Ua(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function za(t,e){var r,i=new Na;i.init(t);try{r=new(Nn())(Ha(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),$a.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function Wa(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,o=t.blockSelector,a=t.sampling,s=new Map,u=t=>{var a=Ua(t);if(a&&!Sa(a,n,o,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var c=ba(r.defaultView);u=c.left,l=c.top}else u=a.scrollLeft,l=a.scrollTop;var d=u+","+l;s.get(h)!==d&&(s.set(h,d),e({id:h,x:u,y:l}))}},l=[ca("scroll",Ha(ga(Ha(t=>u(t)),a.scroll||100)),r)];return"onscrollend"in r&&l.push(ca("scrollend",Ha(u),r)),()=>l.forEach(t=>t())}function Va(t,e){for(var r=$a.length-1;r>=0;r--){var i=$a[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),$a.splice(r,1))}}}var Za=["INPUT","TEXTAREA","SELECT"],Ga=new WeakMap;function Qa(t){return function t(e,r){if(Ya("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ya("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ya("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ya("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function Ja(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Ka(t,e){var r,i,n,o=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:jn.host(e));var a="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(i=e.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,s=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&a&&s?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var t;return null===(t=s.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=s.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{o.adoptStyleSheets(t,n)}catch(t){}return e}}),Ha(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})})):()=>{}}function Xa(t,r){void 0===r&&(r={});var i,n,o=t.doc.defaultView;if(!o)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,o=t.scrollCb,a=t.viewportResizeCb,s=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,c=t.canvasMutationCb,d=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),s(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,r);var a=[],s=Ha(()=>{if(n){n.destroy(),n.reset();var e=$a.indexOf(n);-1!==e&&$a.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),a.forEach(t=>t())});try{if(t.recordDOM){var u=za(t,t.doc);i=u.observer,n=u.buffer}if(a.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var o,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=ga(Ha(t=>{var r=Date.now()-o;e(u.map(t=>(t.timeOffset-=r,t)),t),u=[],o=null}),s),h=Ha(ga(Ha(t=>{var e=Ua(t),r=Ma(t)?t.changedTouches[0]:t,i=r.clientX,a=r.clientY;o||(o=ya()),u.push({x:i,y:a,id:n.getId(e),timeOffset:ya()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?_n.Drag:t instanceof MouseEvent?_n.MouseMove:_n.TouchMove)}),a,{trailing:!1})),c=[ca("mousemove",h,i),ca("touchmove",h,i),ca("drag",h,i)];return Ha(()=>{c.forEach(t=>t())})}(t)),a.push(function(t){var r=t.mouseInteractionCb,i=t.doc,n=t.mirror,o=t.blockClass,a=t.blockSelector,s=t.sampling;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],h=null;return Object.keys(Sn).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t]).forEach(t=>{var s=Ao(t),u=(t=>i=>{var s=Ua(i);if(!Sa(s,o,a,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=xn.Mouse;break;case"touch":u=xn.Touch;break;case"pen":u=xn.Pen}u===xn.Touch&&(Sn[t]===Sn.MouseDown?l="TouchStart":Sn[t]===Sn.MouseUp&&(l="TouchEnd"))}else Ma(i)&&(u=xn.Touch);null!==u?(h=u,(l.startsWith("Touch")&&u===xn.Touch||l.startsWith("Mouse")&&u===xn.Mouse)&&(u=null)):Sn[t]===Sn.Click&&(u=h,h=null);var c=Ma(i)?i.changedTouches[0]:i;if(c){var d=n.getId(s),v=c.clientX,f=c.clientY;Ha(r)(e({type:Sn[l],id:d,x:v,y:f},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(Sn[t]){case Sn.MouseDown:case Sn.MouseUp:s=s.replace("mouse","pointer");break;case Sn.TouchStart:case Sn.TouchEnd:return}l.push(ca(s,u,i))}),Ha(()=>{l.forEach(t=>t())})}(t)),a.push(Wa(t)),a.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,o=-1;return ca("resize",Ha(ga(Ha(()=>{var t=wa(),e=ka();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)}),200)),i)}(t,{win:o})),a.push(function(t){var r=t.inputCb,i=t.doc,n=t.mirror,o=t.blockClass,a=t.blockSelector,s=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,c=t.userTriggeredOnInput;function d(t){var e=Ua(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var d=e&&e.tagName;if(e&&"OPTION"===d&&(e=jn.parentElement(e)),e&&d&&Za.indexOf(d)>=0&&!Sa(e,o,a,!0)&&!(e.classList.contains(s)||u&&e.matches(u))){var f=e.value,p=!1,g=Do(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[d.toLowerCase()]||l[g])&&(f=Ro({element:e,maskInputOptions:l,tagName:d,type:g,value:f,maskInputFn:h})),v(e,c?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach(t=>{if(t!==e){var r=t.value;v(t,c?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}})}}}function v(t,i){var o=Ga.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){Ga.set(t,i);var a=n.getId(t);Ha(r)(e({},i,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>ca(t,Ha(d),i)),p=i.defaultView;if(!p)return()=>{f.forEach(t=>t())};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(t=>ma(t[0],t[1],{set(){Ha(d)({target:this,isTrusted:!1})}},!1,p))),Ha(()=>{f.forEach(t=>t())})}(t)),a.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,o=t.sampling,a=t.doc,s=Ha(t=>ga(Ha(o=>{var a=Ua(o);if(a&&!Sa(a,r,i,!0)){var s=a.currentTime,u=a.volume,l=a.muted,h=a.playbackRate,c=a.loop;e({type:t,id:n.getId(a),currentTime:s,volume:u,muted:l,playbackRate:h,loop:c})}}),o.media||500)),u=[ca("play",s(Mn.Play),a),ca("pause",s(Mn.Pause),a),ca("seeked",s(Mn.Seeked),a),ca("volumechange",s(Mn.VolumeChange),a),ca("ratechange",s(Mn.RateChange),a)];return Ha(()=>{u.forEach(t=>t())})}(t)),t.recordDOM){var l=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},o=t=>{var r,i=e.get(t);if(i){for(;null===(r=i[0])||void 0===r?void 0:r.ready;){var o=i.shift();(null==o?void 0:o.emit)&&n(o.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),o(t)):n(r)}else n(r)},queuePendingMutation(a,s,u){if(!i)return()=>{};var l=e.get(a);l||e.set(a,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,o(a))};try{c=t.setTimeout(f,5e3),d||v?t.clearTimeout(c):r.add(c)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==c&&(t.clearTimeout(c),r.delete(c)),d?e&&n(u):(h.ready=!0,e||(h.emit=void 0),o(a)))}},reset(){i=!1,r.forEach(e=>t.clearTimeout(e)),r.clear(),e.clear()}}}(o);a.push(l.reset),a.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,o=e.win,a=e.mutationQueue;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e);var l=Ja(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&a.queueMutation(e,()=>r({id:h,styleId:c,adds:[{rule:s,index:u}]})),u},"host")}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),o.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,h=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e);var l=Ja(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&a.queueMutation(e,()=>r({id:h,styleId:c,removes:[{index:s}]})),u},"host")}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(u=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=Ja(e,i,n.styleMirror),c=h.id,d=h.styleId;if(!(c&&-1!==c||d&&-1!==d))return u;var v=a.queuePendingMutation(e,()=>r({id:c,styleId:d,replace:s}),()=>{var t=wo(e);null!==t&&r({id:c,styleId:d,replace:t})});try{l.call(u,()=>v(!0),()=>v(!1))}catch(t){v(!1)}}catch(t){}return u},"host")})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e);var l=Ja(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&a.queueMutation(e,()=>r({id:h,styleId:c,replaceSync:s})),u},"host")}));var c={};ts("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(ts("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),ts("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),ts("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(c).forEach(t=>{var e=t[0],o=t[1];d[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[e].insertRule,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ja(e.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...Qa(e),u];a.queueMutation(e.parentStyleSheet,()=>r({id:h,styleId:c,adds:[{rule:s,index:d}]}))}return u},"host")}),o.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ja(e.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...Qa(e),s];a.queueMutation(e.parentStyleSheet,()=>r({id:h,styleId:c,removes:[{index:d}]}))}return u},"host")})}),Ha(()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=h,u&&(o.CSSStyleSheet.prototype.replace=u),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule})})}(t,{win:o,mutationQueue:l})),a.push(Ka(t,t.doc)),a.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,o=t.stylesheetManager,a=e.win,s=e.mutationQueue,u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Ha((t,e,a)=>{var u,l=a[0],h=a[1],c=a[2],d=t.apply(e,a);if(n.has(l))return d;var v=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;o.onCssomSheetMutation(v);var f=Ja(v,i,o.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Qa(e.parentRule);s.queueMutation(v,()=>r({id:p,styleId:g,set:{property:l,value:h,priority:c},index:m}))}return d},"host")});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ha((t,e,a)=>{var u,l=a[0],h=t.apply(e,a);if(n.has(l))return h;var c=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;o.onCssomSheetMutation(c);var d=Ja(c,i,o.styleMirror),v=d.id,f=d.styleId;if(v&&-1!==v||f&&-1!==f){var p=Qa(e.parentRule);s.queueMutation(c,()=>r({id:v,styleId:f,remove:{property:l},index:p}))}return h},"host")}),Ha(()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=l})}(t,{win:o,mutationQueue:l})),t.collectFonts&&a.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var s=qn(r.fonts,"add",function(t){return function(r){return setTimeout(Ha(()=>{var t=o.get(r);t&&(e(t),o.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{i.FontFace=a}),n.push(s),Ha(()=>{n.forEach(t=>t())})}(t))}for(var h of(a.push(function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,o=t.selectionCb,a=!0,s=Ha(()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var s=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),c=h.startContainer,d=h.startOffset,v=h.endContainer,f=h.endOffset;Sa(c,i,n,!0)||Sa(v,i,n,!0)||s.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:s})}});return s(),ca("selectionchange",s)}(t)),a.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?qn(r.customElements,"define",function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}}):()=>{}}(t)),t.plugins))a.push(h.observer(h.callback,o,h.options))}catch(t){try{s()}catch(t){}throw t}return s}function Ya(t){return void 0!==window[t]}function ts(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var es=class{constructor(t){vo(this,"generateIdFn",void 0),vo(this,"iframeRemoteIdToLocalIdMap",new WeakMap),vo(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),o=i||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),o.set(a,e)),a}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,r,i))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,r))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},rs=class{constructor(t){vo(this,"iframes",new WeakMap),vo(this,"crossOriginIframeMap",new WeakMap),vo(this,"crossOriginIframeMirror",new es(Wo)),vo(this,"crossOriginIframeStyleMirror",void 0),vo(this,"crossOriginIframeRootIdMap",new WeakMap),vo(this,"mirror",void 0),vo(this,"mutationCb",void 0),vo(this,"wrappedEmit",void 0),vo(this,"loadListener",void 0),vo(this,"pageHideListener",void 0),vo(this,"stylesheetManager",void 0),vo(this,"recordCrossOriginIframes",void 0),vo(this,"messageHandler",void 0),vo(this,"nestedIframeListeners",new Map),vo(this,"attachedWindows",new WeakMap),vo(this,"attachedDocuments",new WeakMap),vo(this,"attachedIframes",new Map),vo(this,"loadListenerDisposers",new WeakMap),vo(this,"iframeElementsById",new Map),vo(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new es(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>va(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{da(t.win,"pagehide",t.handler)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var o=t.contentWindow;if(this.recordCrossOriginIframes&&o&&!this.nestedIframeListeners.has(o)){var a=this.handleMessage.bind(this);va(()=>{o.addEventListener("message",a),this.nestedIframeListeners.set(o,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(o)})}va(()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}}),null===(r=this.loadListener)||void 0===r||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case kn.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:kn.IncrementalSnapshot,data:{source:_n.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case kn.Meta:case kn.Load:case kn.DomContentLoaded:return!1;case kn.Plugin:return e;case kn.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case kn.IncrementalSnapshot:switch(e.data.source){case _n.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case _n.Drag:case _n.TouchMove:case _n.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case _n.ViewportResize:return!1;case _n.MediaInteraction:case _n.MouseInteraction:case _n.Scroll:case _n.CanvasMutation:case _n.Input:return this.replaceIds(e.data,t,["id"]),e;case _n.StyleSheetRule:case _n.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case _n.Font:return e;case _n.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case _n.AdoptedStyleSheet:var i;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(i=e.data.styles)||void 0===i||i.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===Tn.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach(t=>{var e=this.nestedIframeListeners.get(t);e&&(da(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(da(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 o=this.attachedDocuments.get(r);o&&(o.forEach(t=>{va(()=>this.mirror.removeNodeFromMap(t))}),va(()=>Va(r,o)),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach((e,r)=>{this.mirror.has(r)||t.push(r)}),t.forEach(t=>this.removeIframeById(t))}}reattachIframes(){this.attachedIframes.forEach((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&da(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{da(e,"message",t)}),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(e=>t.add(e.element)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},is=class{constructor(t){vo(this,"shadowDoms",new WeakSet),vo(this,"mutationCb",void 0),vo(this,"scrollCb",void 0),vo(this,"bypassOptions",void 0),vo(this,"mirror",void 0),vo(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){var i,n;if(go(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var o=null!==(i=null===(n=jn.host(t))||void 0===n?void 0:n.ownerDocument)&&void 0!==i?i:r,a=za(e({},this.bypassOptions,{doc:o,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),s=a.observer,u=a.buffer;this.restoreHandlers.push({doc:o,handler(){s.disconnect(),u.destroy(),u.releaseCanvasManager();var t=$a.indexOf(u);-1!==t&&$a.splice(t,1)}}),this.restoreHandlers.push({doc:o,handler:Wa(e({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(jn.host(t))),this.restoreHandlers.push({doc:o,handler:Ka({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:qn(t.prototype,"attachShadow",function(t){return function(i){var n=t.call(this,i),o=jn.shadowRoot(this);return o&&La(this)&&r.addShadowRoot(o,e),n}})})}reset(){this.restoreHandlers.forEach(t=>{var e=t.handler;try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},ns="skip-frame";function os(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var as="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ss="undefined"==typeof Uint8Array?[]:new Uint8Array(256),us=0;64>us;us++)ss[as.charCodeAt(us)]=us;var ls=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=as[r[e]>>2],n+=as[(3&r[e])<<4|r[e+1]>>4],n+=as[(15&r[e+1])<<2|r[e+2]>>6],n+=as[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n},hs=new Map,cs=(t,e,r)=>{if(t&&(fs(t,e)||"object"==typeof t)){var i=function(t,e){var r=hs.get(t);return r||hs.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function ds(t,e,r,i){return t instanceof Array?t.map(t=>ds(t,e,r,i)):null===t?t:t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:ls(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[ds(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[ds(t.data,e,r,i),t.width,t.height]}:fs(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:cs(t,e,r)}:t}var vs=(t,e,r,i)=>t.map(t=>ds(t,e,r,i)),fs=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(r.find(r=>t instanceof e[r]))},ps=["webgl","webgl2"];function gs(t){return"nodeType"in t}function ms(t,r,i,n){var o=[];try{if(n){var a=function(t,r,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return qn(n.prototype,"configure",function(n){return function(o){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||gs(a)&&Sa(a,r,i,!0))return n.call(this,o);gs(a)&&!("__context"in a)&&(a.__context="webgpu");var s=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==s&&o?e({},o,{usage:"number"==typeof o.usage?o.usage|s:s}):o)}})}(t,r,i);a&&o.push(a)}var s=qn(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(e){for(var o=function(t){return"experimental-webgl"===t?"webgl":t}(e),a=arguments.length,s=new Array(a>1?a-1:0),u=1;a>u;u++)s[u-1]=arguments[u];if(!Sa(this,r,i,!0)&&("__context"in this||(this.__context=o),n&&ps.includes(o)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[e,...s])}});o.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(t=>t())}}function ys(t,e,r,i,n,o,a){var s=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=qn(t,u,function(t){return function(){for(var s=arguments.length,l=new Array(s),h=0;s>h;h++)l[h]=arguments[h];var c=t.apply(this,l);if(cs(c,o,this),this.canvas&&"tagName"in this.canvas&&!Sa(this.canvas,i,n,!0)){var d={type:e,property:u,args:vs(l,o,this,a)};r(this.canvas,d)}return c}});s.push(l)}catch(o){var h=ma(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!Sa(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});s.push(h)}};for(var h of u)l(h);return s}var bs='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',ws="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",bs],{type:"text/javascript;charset=utf-8"});function ks(t){var e;try{if(!(e=ws&&(self.URL||self.webkitURL).createObjectURL(ws)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(bs),{name:null==t?void 0:t.name})}}var _s,Ss,xs,Cs=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){vo(this,"pendingCanvasMutations",new Map),vo(this,"rafStamps",{latestId:0,invokeId:null}),vo(this,"mirror",void 0),vo(this,"mutationCb",void 0),vo(this,"resetObservers",void 0),vo(this,"frozen",!1),vo(this,"locked",!1),vo(this,"rafIdTimestamp",null),vo(this,"rafIdFlush",null),vo(this,"refCount",0),vo(this,"torndown",!1),vo(this,"resetFrameDedup",null),vo(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,o=t.blockSelector,a=t.recordCanvas,s=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,n,o,s),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,o,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,e,r,n,o){var a=this;if("OffscreenCanvas"in e){var s,u="number"==typeof o.resolutionScale&&Number.isFinite(o.resolutionScale)?Math.min(1,Math.max(.1,o.resolutionScale)):1,l=ms(e,r,n,!0),h=new Map;try{s=new ks}catch(t){return}var c=!1;s.onerror=()=>{var t;c=!0,cancelAnimationFrame(d),null===(t=s.terminate)||void 0===t||t.call(s),this.resetFrameDedup=null},this.resetFrameDedup=()=>{s.postMessage({resetFrameDedup:!0})},s.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:Cn["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/t,f=0,p=t=>{var l,g;c||(f&&v>t-f||(f=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach(t=>{Sa(t,r,n,!0)||l.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&g(t.shadowRoot)})}catch(t){}},g(e.document),l).forEach(function(){var t=i(function*(t){var e=a.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,i,n=t.getContext(t.__context);if(null==n||null===(r=n.isContextLost)||void 0===r?void 0:r.call(n))return void h.set(e,!1);!1===(null==n||null===(i=n.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var l=t.clientWidth||t.width,c=t.clientHeight||t.height,d=Math.max(1,Math.round(l*u)),v=Math.max(1,Math.round(c*u)),f=function(t,e,r,i,n,o){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return ns}if(void 0!==a){if(!Array.isArray(a)||!a.every(os))return ns;var s=r/n,u=i/o;return a.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*s),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*s)-e,height:Math.ceil((t.y+t.height)*u)-r}})}}}(o.canvasMasking,t,d,v,l,c);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>u?{resizeWidth:d,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:v});s.postMessage({id:e,bitmap:p,width:d,height:v,displayWidth:l,displayHeight:c,dataURLOptions:o.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(d),null===(t=s.terminate)||void 0===t||t.call(s),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ms(t,e,r,!1),o=function(t,e,r,i,n){var o=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var s=qn(e.CanvasRenderingContext2D.prototype,a,function(o){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return Sa(this.canvas,r,i,!0)||setTimeout(()=>{var r=vs(u,e,this,n);t(this.canvas,{type:Cn["2D"],property:a,args:r})},0),o.apply(this,u)}});o.push(s)}catch(n){var u=ma(e.CanvasRenderingContext2D.prototype,a,{set(e){Sa(this.canvas,r,i,!0)||t(this.canvas,{type:Cn["2D"],property:a,args:[e],setter:!0})}});o.push(u)}};for(var u of a)if(s(u))continue;return()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,r,i),a=function(t,e,r,i,n){var o=[];return void 0!==e.WebGLRenderingContext&&o.push(...ys(e.WebGLRenderingContext.prototype,Cn.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&o.push(...ys(e.WebGL2RenderingContext.prototype,Cn.WebGL2,t,r,i,e,n)),()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),o(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,r){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(e);if(i&&-1!==r){var n=i.map(e=>function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(e,t));this.mutationCb({id:r,type:i[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}},Ms=class{constructor(t){var e;vo(this,"trackedLinkElements",new WeakSet),vo(this,"pendingDeferredSheets",new Set),vo(this,"mutationCb",void 0),vo(this,"adoptedStyleSheetCb",void 0),vo(this,"maskAllElementAttributes",void 0),vo(this,"maskAttributeFn",void 0),vo(this,"styleMirror",new Aa),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,i=null;try{(i=t.sheet)&&(r=To(i))}catch(t){}if(!r||!i)return lo(),null;var n=r,o=!1,a={sheet:i,invalidate(){o=!0}};this.pendingDeferredSheets.add(a);var s=!1;return{advance:r=>{if(s)return!0;var u,l,h=Bn(),c=Un(),d=!0;try{if(o)return s=!0,lo(),!0;if(!n.advance(r))return d=!1,!1;s=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(lo(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(lo(),!0)}finally{d&&this.pendingDeferredSheets.delete(a),zn(u=Bn()-h,null!=(l=c)?l:Hn)||(eo.totalMs+=u,u>eo.slowestSliceMs&&(eo.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Lo({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var o=r.styleMirror.add(t);e=o;var a=Bn();try{ao(()=>{try{var e=t.rules||t.cssRules;e&&oo(e)}catch(t){}n.push({styleId:o,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:ko(e,t.href),index:r}))})})}finally{so(Bn()-a)}}i.styleIds.push(e)};for(var a of t)o(a);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),ia.forEach(t=>t.abort()),ia.clear()}trackStylesheetInLinkElement(t){}},Ts=class{constructor(){vo(this,"nodeMap",new WeakMap),vo(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},Is=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Rs,As=document.createElement("iframe");document.body.appendChild(As),Array.from=(null===(Rs=As.contentWindow)||void 0===Rs?void 0:Rs.Array.from)||Array.from,document.body.removeChild(As)}}catch(t){console.debug("Unable to override Array.from",t)}var Es=new Io,Ls=new Set([_n.Mutation,_n.MediaInteraction,_n.StyleSheetRule,_n.CanvasMutation,_n.Font,_n.Log,_n.StyleDeclaration,_n.AdoptedStyleSheet]);function Os(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function Ds(t){var r;void 0===t&&(t={});var i=t,n=i.emit,o=i.checkoutEveryNms,a=i.checkoutEveryNth,s=i.blockClass,u=void 0===s?"rr-block":s,l=i.blockSelector,h=void 0===l?null:l,c=i.ignoreClass,d=void 0===c?"rr-ignore":c,v=i.ignoreSelector,f=void 0===v?null:v,p=i.maskTextClass,g=void 0===p?"rr-mask":p,m=i.maskTextSelector,y=void 0===m?null:m,b=i.inlineStylesheet,w=void 0===b||b,k=i.inlineStylesheetBudgetRules,_=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,M=i.maskTextFn,T=i.maskAllElementAttributes,I=void 0!==T&&T,R=i.maskAttributeFn,A=i.hooks,E=i.packFn,L=i.sampling,O=void 0===L?{}:L,D=i.dataURLOptions,P=void 0===D?{}:D,F=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,H=i.recordCanvas,U=void 0!==H&&H,z=i.recordCrossOriginIframes,W=void 0!==z&&z,V=i.recordAfter,Z=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,G=i.userTriggeredOnInput,Q=void 0!==G&&G,J=i.collectFonts,K=void 0!==J&&J,X=i.inlineImages,Y=void 0!==X&&X,tt=i.plugins,et=i.keepIframeSrcFn,rt=void 0===et?()=>!1:et,it=i.ignoreCSSAttributes,nt=void 0===it?new Set([]):it,ot=i.attributeFilter;Da=i.errorHandler;var at=e({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},P),st=!W||window.parent===window,ut=!1;if(!st)try{window.parent.document&&(ut=!1)}catch(t){ut=!0}if(st&&!n)throw new Error("emit function is required");if(!st&&!ut)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Es.reset();var lt,ht=!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},ct=la(void 0!==x&&x);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var dt,vt,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return E&&!ut&&(t=E(t)),t};_s=(t,e)=>{var r,i=t;if(i.timestamp=ya(),!(null===(r=$a[0])||void 0===r?void 0:r.isFrozen())||i.type===kn.FullSnapshot||i.type===kn.IncrementalSnapshot&&Ls.has(i.data.source)||$a.forEach(t=>t.unfreeze()),st)null==n||n(gt(i),e);else if(ut){var s={type:"rrweb",event:gt(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(s,"*")}if(i.type===kn.FullSnapshot)lt=i,ft=0;else if(i.type===kn.IncrementalSnapshot){if(i.data.source===_n.Mutation&&i.data.isAttachIframe)return;ft++,(a&&ft>=a||o&&i.timestamp-lt.timestamp>o)&&Ss(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var r=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var o=Es.getNode(n.node.id);o&&"IFRAME"===o.nodeName&&i.add(o)}t.removes.forEach(t=>{var e=t.id;if(!r||!r.has(e)){var n=kt.getIframeElementById(e);n&&i.has(n)?kt.forgetIframeId(e):(null==dt||dt(e),kt.removeIframeById(e))}}),null==vt||vt(),kt.cleanupDetachedIframes()}_s({type:kn.IncrementalSnapshot,data:e({source:_n.Mutation},t)})},yt=t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.Scroll},t)}),bt=t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.CanvasMutation},t)}),wt=new Ms({mutationCb:mt,adoptedStyleSheetCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:R}),kt=new rs({mirror:Es,mutationCb:mt,stylesheetManager:wt,recordCrossOriginIframes:W,wrappedEmit:_s});for(var _t of tt||[])_t.getMirror&&_t.getMirror({nodeMirror:Es,crossOriginIframeMirror:kt.crossOriginIframeMirror,crossOriginIframeStyleMirror:kt.crossOriginIframeStyleMirror});var St=new Ts,xt=null==N?void 0:N.configured;xs=new Cs({recordCanvas:U,mutationCb:bt,win:window,blockClass:u,blockSelector:h,mirror:Es,sampling:O.canvas,dataURLOptions:at,resolutionScale:F,canvasMasking:N});var Ct=new is({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:u,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskInputOptions:ht,dataURLOptions:at,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:R,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:Y,sampling:O,slimDOMOptions:ct,iframeManager:kt,stylesheetManager:wt,canvasManager:xs,keepIframeSrcFn:rt,processedNodeManager:St,attributeFilter:ot},mirror:Es});Ss=function(t){if(void 0===t&&(t=!1),B){ro(k);try{_s({type:kn.Meta,data:{href:window.location.href,width:ka(),height:wa()}},t),null==r||r.cancel(),r=void 0,wt.reset(),Ct.init(),$a.forEach(t=>t.lock());var e,i=null;try{i=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new Io:i,o=r.blockClass,a=void 0===o?"rr-block":o,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,R=r.preserveWhiteSpace,A=r.onSerialize,E=r.onIframeLoad,L=r.iframeLoadTimeout,O=r.onIframeListenerRegistered,D=r.onStylesheetLoad,P=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=la(void 0!==T&&T);ro(j);try{return ua(t,{doc:t,mirror:n,blockClass:a,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:R,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:L,onIframeListenerRegistered:O,onStylesheetLoad:D,stylesheetLoadTimeout:P,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{io()}}(document,{mirror:Es,blockClass:u,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskAllInputs:ht,inlineStylesheetBudgetRules:k,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:R,slimDOM:ct,dataURLOptions:at,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:Y,onSerialize(t){Ta(t,Es)&&kt.addIframe(t),Ia(t,Es)&&wt.trackLinkElement(t),Ra(t)&&Ct.addShadowRoot(jn.shadowRoot(t),document)},onIframeLoad(t,e){kt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){kt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){wt.attachLinkElement(t,e)},keepIframeSrcFn:rt})}finally{o=Kn,Kn=[],e=o}if(!i)return console.warn("Failed to snapshot the document");if(_s({type:kn.FullSnapshot,data:{node:i,initialOffset:ba(window)}},t),$a.forEach(t=>t.unlock()),xs.onFullSnapshot(),e.length){var n=function(t,e,r){var i=!1,n=null,o=0,a=null,s=()=>null!==a||t.length>o,u=()=>{var r=t[o];t[o]=null,o+=1,r&&va(()=>{a=e.beginDeferredLinkInlining(r,Es.getId(r))})},l=()=>{if(a){var t=a,e=!0;va(()=>{e=t.advance(200)}),e&&(a=null)}},h=()=>{a||u(),l()},c=t=>{if(n=null,!i){var e=0;do{try{h()}catch(t){null==a||a.discard(),a=null,ho(1)}e+=1}while(!i&&s()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(s()?n=Os(c):r())}};return n=Os(c),{cancel(){i=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;s()&&50>e;){a||u();var c=a;if(c)if(Math.floor(c.remainingRules()/200)+1>50-e)c.discard(),a=null,h+=1;else{try{l()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(s()||h>0){for(var d=h+(null!==a?1:0),v=o;t.length>v;v++)null!==t[v]&&(d+=1);ho(d),null==a||a.discard(),a=null}r()}}}}(e,wt,()=>{r===n&&(r=void 0)});r=n}W&&kt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&wt.adoptStyleSheets(document.adoptedStyleSheets,Es.getId(document))}finally{io()}var o}};try{var Mt=[];for(var Tt of(Mt.push(ca("pagehide",()=>{try{null==r||r.flush()}catch(t){}r=void 0},window)),["visibilitychange","freeze","resume"]))Mt.push(ca(Tt,$n,document));dt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{va(t);var e=Mt.indexOf(t);-1!==e&&Mt.splice(e,1)}),pt.delete(t))},vt=()=>{for(var t of pt){var e=t[0],r=Es.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==dt||dt(e)}catch(t){null==dt||dt(e)}else null==dt||dt(e)}};var It=t=>{var r;return Ha(Xa)({mutationCb:mt,mousemoveCb:(t,e)=>_s({type:kn.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.ViewportResize},t)}),inputCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.Input},t)}),mediaInteractionCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.MediaInteraction},t)}),styleSheetRuleCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.StyleSheetRule},t)}),styleDeclarationCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.Font},t)}),selectionCb(t){_s({type:kn.IncrementalSnapshot,data:e({source:_n.Selection},t)})},customElementCb(t){_s({type:kn.IncrementalSnapshot,data:e({source:_n.CustomElement},t)})},blockClass:u,ignoreClass:d,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:w,sampling:O,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:Y,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:M,maskAllElementAttributes:I,maskAttributeFn:R,keepIframeSrcFn:rt,blockSelector:h,slimDOMOptions:ct,dataURLOptions:at,mirror:Es,iframeManager:kt,stylesheetManager:wt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:xs,ignoreCSSAttributes:nt,attributeFilter:ot,plugins:(null==tt||null===(r=tt.filter(t=>t.observer))||void 0===r?void 0:r.map(t=>({observer:t.observer,options:t.options,callback:e=>_s({type:kn.Plugin,data:{plugin:t.name,payload:e}})})))||[]},A)};kt.addLoadListener(t=>{try{var e=Es.getId(t),r=It(t.contentDocument);if("function"==typeof r&&(Mt.push(r),-1!==e)){var i=pt.get(e);i||pt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}}),kt.addPageHideListener(t=>{var e=Es.getId(t);null==dt||dt(e),Va(t)});var Rt=-1,At=t=>_s({type:kn.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Et=()=>{var t,e,r,i,n=document,o=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=o?Es.getId(o):-1;a!==Rt&&(-1!==Rt&&At({id:Rt,enter:!1}),Rt=a,-1!==a&&At({id:a,enter:!0}))},Lt=()=>{Ss();var t=It(document);"function"==typeof t&&Mt.push(t),Mt.push(ca("fullscreenchange",Et)),Mt.push(ca("webkitfullscreenchange",Et)),Mt.push(ca("mozfullscreenchange",Et)),Mt.push(ca("MSFullscreenChange",Et)),Is=!0};return["interactive","complete"].includes(document.readyState)?Lt():(Mt.push(ca("DOMContentLoaded",()=>{_s({type:kn.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&Lt()})),Mt.push(ca("load",()=>{_s({type:kn.Load,data:{}}),"load"===Z&&Lt()},window))),()=>{try{null==r||r.flush()}catch(t){}r=void 0,Mt.forEach(t=>va(t)),St.destroy(),kt.removeLoadListener(),kt.destroy(),pt.clear(),Ct.reset(),Es.reset(),Is=!1,Da=void 0}}catch(t){console.warn(t)}}function Ps(t){return Ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(t)}function Fs(t,e,r){return(e=function(t){var e=function(t){if("object"!=Ps(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ps(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ps(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Ds.addCustomEvent=(t,e)=>{if(!Is)throw new Error("please add custom event after start recording");_s({type:kn.Custom,data:{tag:t,payload:e}})},Ds.freezePage=()=>{$a.forEach(t=>t.freeze())},Ds.takeFullSnapshot=t=>{if(!Is)throw new Error("please take full snapshot after start recording");Ss(t)},Ds.mirror=Es,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Ns=class{constructor(t){Fs(this,"fileName",void 0),Fs(this,"functionName",void 0),Fs(this,"lineNumber",void 0),Fs(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},qs=/(^|@)\S+:\d+/,js=/^\s*at .*(\S+:\d+|\(native\))/m,Bs=/^(eval@)?(\[native code])?$/,Hs={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(js)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(js)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop());return new Ns({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Bs)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ns({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ns({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;o>n;n+=2){var a=e.exec(r[n]);a&&i.push(new Ns({fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;o>n;n+=2){var a=e.exec(r[n]);a&&i.push(new Ns({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(qs)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Ns({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function $s(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;i.children.length>o;o++){var a=i.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&n.push(a)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Us(t){return Array.isArray(t)}function zs(t){return"object"==typeof t&&null!==t&&!Us(t)}function Ws(t,e){if(0===e)return!0;for(var r of Object.keys(t))if(zs(t[r])&&Ws(t[r],e-1))return!0;return!1}function Vs(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(zs(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||zs(a)&&Ws(a,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var u in e){var l=e[u];s[u]=Us(l)?$s(l.length?l[0]:null):l}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Zs={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 Gs(t,e,r){var i,n=r?Object.assign({},Zs,r):Zs,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var a=0,s=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:Hs.parse(e.error).map(t=>t.toString()),payload:[Vs(r,n.stringifyOptions)]})};e.addEventListener("error",l),u.push(()=>{e.removeEventListener("error",l)});var h=e=>{var r,i;e.reason instanceof Error?i=[Vs("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Vs("Uncaught (in promise)",n.stringifyOptions),Vs(e.reason,n.stringifyOptions)]),t({level:"error",trace:Hs.parse(r).map(t=>t.toString()),payload:i})};e.addEventListener("unhandledrejection",h),u.push(()=>{e.removeEventListener("unhandledrejection",h)})}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach(t=>t())};function d(e,r){var i=this;return e[r]?function(e,o){try{if(!(o in e))return()=>{};var u=e[o],l={next:u},h=(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||s)){s=!0;try{var h=Hs.parse(new Error).map(t=>t.toString()).splice(1),c=("assert"===r?u.slice(1):u).map(t=>Vs(t,n.stringifyOptions));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:c}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Vs("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{s=!1}}})(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return l.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:l}})),e[o]=h,()=>{if(e[o]!==h)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[o],i=t(r);i;){if(i.next===h)return void(i.next=l.next);i=t(r=i.next)}else e[o]=l.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Qs=t=>({name:"rrweb/console@1",observer:Gs,options:t}),Js=()=>{},Ks=t=>{var e;if(Z(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Xs(t,e,r){try{if(!(e in t))return Js;var i={next:t[e]},n=r(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)});return Z(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],o=Ks(r);o;){if(o.next===n)return void(o.next=i.next);o=Ks(r=o.next)}else t[e]=i.next}}catch(t){return Js}}function Ys(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var tu=te("[Recorder]"),eu=t=>"navigation"===t.entryType,ru=t=>"resource"===t.entryType;function iu(t,e){return!!e&&(et(e)||e[t])}function nu(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var ou=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function au(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find(t=>"content-type"===t.toLowerCase()),r=e&&i[e];return t.some(t=>null==r?void 0:r.toLowerCase().includes(t))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!nu(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(ou))return!1;if(et(r))return!0;if(V(r))return n(r);var o=r[e];return et(o)?o:n(o)}function su(t,e,r,i,n,o){return uu.apply(this,arguments)}function uu(){return uu=i(function*(t,e,r,i,n,o){return void 0===o&&(o=0),o>10?(tu.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null):function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),t=>ru(t)&&t.initiatorType===e&&(Q(i)||t.startTime>=i)&&(Q(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*o)),su(t,e,r,i,n,o+1))}),uu.apply(this,arguments)}function lu(t){var e=t.body,r=t.options,i=t.url;if(Y(e))return null;var n=Ys(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(J(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(rt(e))return function(t,e){var r,i;void 0===e&&(e="&");var n=[];return ee(t,function(t,e){Q(t)||Q(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)}),n.join(e)}(e);if(G(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var hu=t=>!X(t)&&("navigation"===t.entryType||"resource"===t.entryType);function cu(t){var r=t.entry,i=t.method,n=t.status,o=t.networkRequest,a=t.isInitial,s=t.start,u=t.end,l=t.url,h=t.initiatorType;s=r?r.startTime:s,u=r?r.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(s||0)),v=[e({},r?r.toJSON():{name:l},{startTime:Q(s)?void 0:Math.round(s),endTime:Q(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(r?r.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if(hu(r))for(var f of r.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(r.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var du=["video/","audio/"];function vu(t){return G(t)&&Z(t.getReader)&&Z(t.tee)}var fu="[SessionReplay] Timeout while trying to read body",pu="[SessionReplay] Failed to read body";function gu(t){return pu+": "+t}function mu(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function yu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var r=setTimeout(()=>e(fu),500);try{t.clone().text().then(t=>e(t),t=>e(gu(t))).finally(()=>clearTimeout(r))}catch(t){clearTimeout(r),e(pu)}})}(t);var r=De(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(mu(r)):function(t,e){return new Promise(r=>{var i,n=!1;function o(){try{var t;null==(t=i)||t.cancel().catch(()=>{})}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),o(),r(t))}var s,u=setTimeout(()=>a(fu),500);try{s=t.clone()}catch(t){return void a(pu)}var l=s.body;if(vu(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a(pu)}var h=[],c=0;!function t(){i.read().then(r=>{var i=r.done,s=r.value;if(n)o();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,c)));else{if(s){if(c+s.byteLength>e)return void a(mu(e));c+=s.byteLength,h.push(s)}t()}},t=>a(gu(t)))}()}else try{s.text().then(t=>a(t),t=>a(gu(t)))}catch(t){a(pu)}})}(t,r)}function bu(){return bu=i(function*(t){var e=t.r,r=t.options,i=Ys(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):yu(e,r)}),bu.apply(this,arguments)}function wu(){return wu=i(function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=du.some(t=>null==o?void 0:o.startsWith(t));if(o&&a)return"Content-Type "+o+" is not supported";var s=Ys(n,i);return s.isHostDenied?s.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return X(i)?yu(e,r):Promise.resolve(i)}),wu.apply(this,arguments)}var ku=null;function _u(t,r,n){if(!("performance"in r))return()=>{};if(ku)return tu.warn("Network observer already initialised, doing nothing"),()=>{};var o=n?Object.assign({},Pe,n):Pe,a=r=>{var i=[],n=!1;r.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=o.maskRequestFn(t);e||(n=!r||(t=>!!t&&Ue.has(t))(r)),r&&i.push(r)}}),i.length>0&&t(e({},r,{requests:i}))},s=function(t,e,r){r.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>eu(t)||ru(t)&&r.initiatorTypes.includes(t.initiatorType)).flatMap(t=>cu({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var i=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>eu(t)||ru(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>cu({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>r.performanceEntryTypeToObserve.includes(t));return i.observe({entryTypes:n}),()=>{i.disconnect()}}(a,r,o),u=()=>{},l=()=>{};return(o.recordHeaders||o.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=iu("request",r.recordHeaders),n=iu("response",r.recordHeaders),o=Xs(e.XMLHttpRequest.prototype,"open",o=>function(a,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=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=c.send.bind(c);c.send=t=>(au({type:"request",headers:g,url:s,recordBody:r.recordBody})&&(p.requestBody=lu({body:t,options:r,url:s})),d=e.performance.now(),y(t));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=e.performance.now();var i={};c.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)}),n&&(p.responseHeaders=i),au({type:"response",headers:i,url:s,recordBody:r.recordBody})&&(p.responseBody=lu({body:c.response,options:r,url:s})),su(e,"xmlhttprequest",f.url,d,v).then(e=>{t({requests:cu({entry:e,method:a,status:null==c?void 0:c.status,networkRequest:p,start:d,end:v,url:s.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};c.addEventListener("readystatechange",w),c.addEventListener("error",b),c.addEventListener("abort",b),c.addEventListener("timeout",b)}catch(t){tu.error("Failed to instrument XHR for network capture",t)}o.call(c,a,s.toString(),u,l,h)});return()=>{o()}}(a,r,o),l=function(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=iu("request",r.recordHeaders),o=iu("response",r.recordHeaders),a=Xs(e,"fetch",a=>function(){var s=i(function*(i,s){var u,l;try{u=new Request(i,s)}catch(t){return tu.error("Failed to instrument fetch for network capture",t),a(i,s)}var h,c,d={};try{try{var v={};u.headers.forEach((t,e)=>{v[e]=t}),n&&(d.requestHeaders=v),!vu(null==s?void 0:s.body)&&au({type:"request",headers:v,url:i,recordBody:r.recordBody})&&(d.requestBody=yield function(t){return bu.apply(this,arguments)}({r:u,options:r,url:i}))}catch(t){tu.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),l=nu(i)?yield a(u):yield a(i,s),c=e.performance.now();try{var f={};l.headers.forEach((t,e)=>{f[e]=t}),o&&(d.responseHeaders=f),au({type:"response",headers:f,url:i,recordBody:r.recordBody})&&(d.responseBody=yield function(t){return wu.apply(this,arguments)}({r:l,options:r,url:i}))}catch(t){tu.error("Failed to record fetch response for network capture",t)}return l}finally{su(e,"fetch",u.url,h,c).then(e=>{var r;t({requests:cu({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:h,end:c,url:u.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return s.apply(this,arguments)}}());return()=>{a()}}(a,r,o)),ku=()=>{s(),u(),l(),ku=null}}var Su,xu,Cu,Mu,Tu,Iu,Ru,Au,Eu,Lu,Ou,Du,Pu,Fu,Nu,qu=t=>({name:"rrweb/network@1",observer:_u,options:t});h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Qs,getRecordNetworkPlugin:qu},h.__PosthogExtensions__.rrweb={record:Ds,version:"v2",wasMaxDepthReached:()=>sa,resetMaxDepthState(){sa=!1,aa=!1},getLastSnapshotCost:()=>Qn,getMutationCost:()=>e({},to),resetSnapshotCostState(){Wn=0,Vn=0,Zn=0,Hn=0,Gn={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Qn=null,Jn=null,Kn=[],Xn=0,Yn=0,to={slowestBatchMs:0},eo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},h.rrweb={record:Ds,version:"v2"},h.rrwebConsoleRecord={getRecordConsolePlugin:Qs},h.getRecordNetworkPlugin=qu,h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.initSessionRecording=(t,e)=>new wn(t,e);var ju,Bu,Hu,$u,Uu={},zu=[],Wu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Vu=Array.isArray;function Zu(t,e){for(var r in e)t[r]=e[r];return t}function Gu(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Qu(t,e,r){var i,n,o,a={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Su.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===a[o]&&(a[o]=t.defaultProps[o]);return Ju(t,a,i,n,null)}function Ju(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Cu:n,__i:-1,__u:0};return null==n&&null!=xu.vnode&&xu.vnode(o),o}function Ku(t){return t.children}function Xu(t,e){this.props=t,this.context=e}function Yu(t,e){if(null==e)return t.__?Yu(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Yu(t):null}function tl(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],o=Zu({},e);o.__v=e.__v+1,xu.vnode&&xu.vnode(o),hl(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?Yu(e):r,!!(32&e.__u),n),o.__v=e.__v,o.__.__k[o.__i]=o,dl(i,o,n),e.__e=e.__=null,o.__e!=r&&el(o)}}function el(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),el(t)}function rl(t){(!t.__d&&(t.__d=!0)&&Mu.push(t)&&!il.__r++||Tu!=xu.debounceRendering)&&((Tu=xu.debounceRendering)||Iu)(il)}function il(){try{for(var t,e=1;Mu.length;)Mu.length>e&&Mu.sort(Ru),t=Mu.shift(),e=Mu.length,tl(t)}finally{Mu.length=il.__r=0}}function nl(t,e,r,i,n,o,a,s,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||zu,b=e.length;for(u=function(t,e,r,i,n){var o,a,s,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),o=0;n>o;o++)null!=(a=e[o])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[o]=Ju(null,a,null,null,null):Vu(a)?a=t.__k[o]=Ju(Ku,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[o]=Ju(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[o]=a,u=o+d,a.__=t,a.__b=t.__b+1,s=null,-1!=(l=a.__i=al(a,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 a.type&&(a.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,a.__u|=4))):t.__k[o]=null;if(c)for(o=0;h>o;o++)null!=(s=r[o])&&!(2&s.__u)&&(s.__e==i&&(i=Yu(s)),pl(s,s));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1!=v.__i&&y[v.__i]||Uu,v.__i=c,g=hl(t,v,d,n,o,a,s,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&fl(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=ol(v,u,t,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 ol(t,e,r,i){var n,o;if("function"==typeof t.type){for(n=t.__k,o=0;n&&n.length>o;o++)n[o]&&(n[o].__=t,e=ol(n[o],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Yu(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function al(t,e,r,i){var n,o,a,s=t.key,u=t.type,l=e[r],h=null!=l&&!(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,o=r+1;n>=0||e.length>o;)if(null!=(l=e[a=0>n?o++:n--])&&!(2&l.__u)&&s==l.key&&u==l.type)return a;return-1}function sl(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Wu.test(e)?r:r+"px"}function ul(t,e,r,i,n){var o,a;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||sl(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||sl(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(Ou,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r[Lu]=i[Lu]:(r[Lu]=Du,t.addEventListener(e,o?Fu:Pu,o)):t.removeEventListener(e,o?Fu:Pu,o);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function ll(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[Eu])e[Eu]=Du++;else if(r[Lu]>e[Eu])return;return r(xu.event?xu.event(e):e)}}}function hl(t,e,r,i,n,o,a,s,u,l){var h,c,d,v,f,p,g,m,y,b,$,w,k,_,S,x,C=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=e.__e=r.__e]),(h=xu.__b)&&h(e);t:if("function"==typeof C){c=a.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],w=h?$?$.props.value:h.__:i,r.__c?m=(d=e.__c=r.__c).__=d.__E:(b?e.__c=d=new C(y,w):(e.__c=d=new Xu(y,w),d.constructor=C,d.render=gl),$&&$.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=Zu({},d.__s)),Zu(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=e,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),e.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){e.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(t){t&&(t.__=e)}),zu.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break t}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=t,d.__e=!1,k=xu.__r,_=0,b)d.state=d.__s,d.__d=!1,k&&k(e),h=d.render(d.props,d.state,d.context),zu.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,k&&k(e),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=Zu(Zu({},i),d.getChildContext())),b&&!v&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Ku&&null==h.key?vl(h.props.children):h,s=nl(t,Vu(S)?S:[S],e,r,i,n,o,a,s,u,l),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(t){if(a.length=c,e.__v=null,u||null!=o)if(t.then){for(e.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=o&&(o[o.indexOf(s)]=null),e.__e=s}else{if(null!=o)for(x=o.length;x--;)Gu(o[x]);cl(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||cl(e);xu.__e(t,e,r)}}else null==o&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=function(t,e,r,i,n,o,a,s,u){var l,h,c,d,v,f,p,g=r.props||Uu,m=e.props,y=e.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!=o)for(l=0;o.length>l;l++)if((v=o[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,o[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),s&&(xu.__m&&xu.__m(e,o),s=!1),o=null}if(null==y)g===m||s&&t.data==m||(t.data=m);else{if(o="textarea"==y&&null!=m.defaultValue?null:o&&Su.call(t.childNodes),!s&&null!=o)for(g={},l=0;t.attributes.length>l;l++)g[(v=t.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||ul(t,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||ul(t,l,v,g[l],n);if(h)s||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),nl("template"==e.type?t.content:t,Vu(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,o,a,o?o[0]:r.__k&&Yu(r,0),s,u),null!=o)for(l=o.length;l--;)Gu(o[l]);s&&"textarea"!=y||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&ul(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&ul(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,o,a,u,l);return(h=xu.diffed)&&h(e),128&e.__u?void 0:s}function cl(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(cl))}function dl(t,e,r){for(var i=0;r.length>i;i++)fl(r[i],r[++i],r[++i]);xu.__c&&xu.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){xu.__e(t,e.__v)}})}function vl(t){return"object"!=typeof t||null==t||t.__b>0?t:Vu(t)?t.map(vl):void 0!==t.constructor?null:Zu({},t)}function fl(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){xu.__e(t,r)}}function pl(t,e,r){var i,n;if(xu.unmount&&xu.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||fl(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){xu.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&pl(i[n],e,r||"function"!=typeof t.type);r||Gu(t.__e),t.__c=t.__=t.__e=void 0}function gl(t,e,r){return this.constructor(t,r)}function ml(t,e,r){var i,n,o,a;e==document&&(e=document.documentElement),xu.__&&xu.__(t,e),n=(i="function"==typeof r)?null:r&&r.__k||e.__k,o=[],a=[],hl(e,t=(!i&&r||e).__k=Qu(Ku,null,[t]),n||Uu,Uu,e.namespaceURI,!i&&r?[r]:n?null:e.firstChild?Su.call(e.childNodes):null,o,!i&&r?r:n?n.__e:e.firstChild,i,a),dl(o,t,a),t.props.children=null}Su=zu.slice,xu={__e(t,e,r,i){for(var n,o,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},Cu=0,Xu.prototype.setState=function(t,e){var r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Zu({},this.state);"function"==typeof t&&(t=t(Zu({},r),this.props)),t&&Zu(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),rl(this))},Xu.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),rl(this))},Xu.prototype.render=Ku,Mu=[],Iu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ru=function(t,e){return t.__v.__b-e.__v.__b},il.__r=0,Au=Math.random().toString(8),Eu="__d"+Au,Lu="__a"+Au,Ou=/(PointerCapture)$|Capture$/i,Du=0,Pu=ll(!1),Fu=ll(!0),Nu=0;var yl=0,bl=[],wl=xu,kl=wl.__b,_l=wl.__r,Sl=wl.diffed,xl=wl.__c,Cl=wl.unmount,Ml=wl.__;function Tl(t,e){wl.__h&&wl.__h(Bu,t,yl||e),yl=0;var r=Bu.__H||(Bu.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Il(t){return yl=1,function(t,e){var r=Tl(ju++,2);if(r.t=t,!r.__c&&(r.__=[jl(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=Bu,!Bu.__f)){var i=function(t,e,i){if(!r.__c.__H)return!0;var o=!1,a=r.__c.props!==t;if(r.__c.__H.__.some(function(t){if(t.__N){o=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}}),n){var s=n.call(this,t,e,i);return o?s||a:s}return!o||a};Bu.__f=!0;var n=Bu.shouldComponentUpdate,o=Bu.componentWillUpdate;Bu.componentWillUpdate=function(t,e,r){if(this.__e){var a=n;n=void 0,i(t,e,r),n=a}o&&o.call(this,t,e,r)},Bu.shouldComponentUpdate=i}return r.__N||r.__}(jl,t)}function Rl(t,e){var r=Tl(ju++,3);!wl.__s&&ql(r.__H,e)&&(r.__=t,r.u=e,Bu.__H.__h.push(r))}function Al(t){return yl=5,El(function(){return{current:t}},[])}function El(t,e){var r=Tl(ju++,7);return ql(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Ll(t){var e,r=Bu.context[t.__c],i=Tl(ju++,9);return i.c=t,r?(null!==(e=i.__)&&void 0!==e||(i.__=!0,r.sub(Bu)),r.props.value):t.__}function Ol(){for(var t;t=bl.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Fl),e.__h.some(Nl),e.__h=[]}catch(r){e.__h=[],wl.__e(r,t.__v)}}}wl.__b=function(t){Bu=null,kl&&kl(t)},wl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ml&&Ml(t,e)},wl.__r=function(t){_l&&_l(t),ju=0;var e=(Bu=t.__c).__H;e&&(Hu===Bu?(e.__h=[],Bu.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Ol(),ju=0)),Hu=Bu},wl.diffed=function(t){Sl&&Sl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==bl.push(e)&&$u===wl.requestAnimationFrame||(($u=wl.requestAnimationFrame)||Pl)(Ol)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Hu=Bu=null},wl.__c=function(t,e){e.some(function(t){try{t.__h.some(Fl),t.__h=t.__h.filter(function(t){return!t.__||Nl(t)})}catch(r){e.some(function(t){t.__h&&(t.__h=[])}),e=[],wl.__e(r,t.__v)}}),xl&&xl(t,e)},wl.unmount=function(t){Cl&&Cl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(t){try{Fl(t)}catch(t){e=t}}),r.__H=void 0,e&&wl.__e(e,r.__v))};var Dl="function"==typeof requestAnimationFrame;function Pl(t){var e,r=function(){clearTimeout(i),Dl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);Dl&&(e=requestAnimationFrame(r))}function Fl(t){var e=Bu,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Bu=e}function Nl(t){var e=Bu;t.__c=t.__(),Bu=e}function ql(t,e){return!t||t.length!==e.length||e.some(function(e,r){return e!==t[r]})}function jl(t,e){return"function"==typeof e?e(t):e}var Bl="tab",Hl="left",$l="center",Ul="right",zl="next_to_trigger",Wl="popover",Vl="widget",Zl="external_survey",Gl="open",Ql="multiple_choice",Jl="single_choice",Kl="rating",Xl="end",Yl="always",th="$survey_id",eh="$survey_name",rh="$survey_iteration",ih="$survey_iteration_start_date",nh="$survey_partially_completed",oh="$survey_submission_id",ah="$survey_completed",sh="$survey_language",uh=te("[Surveys]"),lh=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),hh=t=>lh("seenSurvey_",t),ch=t=>{try{var e=hh(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){uh.error("Failed to persist survey seen state",t)}},dh=[Wl,Vl,"api"];Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return tt(t)&&isFinite(t)&&Math.floor(t)===t});var vh=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,i,n){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||0>e||0>r||0>i||0>n||e>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|r>>>8,o[7]=r,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=n>>>24,o[13]=n>>>16,o[14]=n>>>8,o[15]=n,new t(o)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}},fh=class{generate(){var t=this.generateOrAbort();if(!Q(t))return t;this.ri=0;var e=this.generateOrAbort();if(Q(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),tt(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.ri)this.ri=e,this.ii();else{if(this.ri>=e+1e4)return;this.ni++,this.ni>4398046511103&&(this.ri++,this.ii())}return vh.fromFieldsV7(this.ri,Math.trunc(this.ni/Math.pow(2,30)),this.ni&Math.pow(2,30)-1,this.oi.nextUint32())}ii(){this.ni=1024*this.oi.nextUint32()+(1023&this.oi.nextUint32())}constructor(){this.ri=0,this.ni=0,this.oi=new mh}},ph=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};r&&!Q(r.crypto)&&crypto.getRandomValues&&(ph=t=>crypto.getRandomValues(t));var gh,mh=class{nextUint32(){return this.Pe.length>this.ai||(ph(this.Pe),this.ai=0),this.Pe[this.ai++]}constructor(){this.Pe=new Uint32Array(8),this.ai=1/0}},yh=()=>bh().toString(),bh=()=>(gh||(gh=new fh)).generate(),wh=null,kh={si(){if(!X(wh))return wh;var t=!0;if(Q(r))t=!1;else try{var e="__mplssupport__";kh.ui(e,"xyz"),'"xyz"'!==kh.li(e)&&(t=!1),kh.hi(e)}catch(e){t=!1}return t||Yt.error("localStorage unsupported; falling back to cookie store"),wh=t,t},ci(t){Yt.error("localStorage error: "+t)},li(t){try{return null==r?void 0:r.localStorage.getItem(t)}catch(t){kh.ci(t)}return null},di(t){try{return JSON.parse(kh.li(t))||{}}catch(t){}return null},ui(t,e){try{return null==r||r.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){kh.ci(t)}return!1},hi(t){try{null==r||r.localStorage.removeItem(t)}catch(t){kh.ci(t)}}},_h=te("[Stylesheet Loader]"),Sh=r,xh=a,Ch="#020617",Mh={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:Ul,widgetType:Bl,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:Ch,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Th=[$l,Hl,Ul];function Ih(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Rh(t){var e;void 0===t&&(t=Mh.backgroundColor),"#"===t[0]&&(e=Ih(t)),t.startsWith("rgb")&&(e=t);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"}[t.toLowerCase()];if(r&&(e=Ih(r)),!e)return Ch;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),a=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+a*a*.114)>127.5?Ch:"white"}return Ch}var Ah=(t,r,i)=>{var n=Jh(t),o=xh.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var a=xh.createElement("div");((t,r,i)=>{var n=e({},Mh,i),o=t.style,a=!Th.includes(n.position)||r===Vl&&(null==i?void 0:i.widgetType)===Bl;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),a?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Rh(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",Rh(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Rh(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",Rh(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var s=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=s||n.inputBackground;s||"white"!==n.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||Rh(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(a,t.type,t.appearance),a.className=n;var s=a.attachShadow({mode:"open"}),u=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return Z(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(_h.error("prepare_external_dependency_stylesheet returned null"),null)})(xh,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(r);if(u){var l=s.querySelector("style");l&&s.removeChild(l),s.appendChild(u)}return(i||xh.body).appendChild(a),{shadow:s,isNewlyCreated:!0}},Eh=t=>{var r=t.responses,i=t.survey,n=t.surveySubmissionId,o=t.posthog,a=t.isSurveyCompleted,s=t.properties,u=t.surveyLanguage,l=t.questionSnapshots;o?(ch(i),o.capture("survey sent",e({[eh]:i.name,[th]:i.id,[rh]:i.current_iteration,[ih]:i.current_iteration_start_date,[oh]:n,[ah]:a},u&&{[sh]:u},{sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},ii(r,i,l),s,{$set:{[ni(i,"responded")]:!0}})),a&&(Sh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Qh(i),o.reloadFeatureFlags())):uh.error("[survey sent] event not captured, PostHog instance not found.")},Lh=(t,r,i)=>{return e({[eh]:t.name,[th]:t.id,[rh]:t.current_iteration,[ih]:t.current_iteration_start_date,[nh]:(n=null==r?void 0:r.responses,void 0===n&&(n={}),Object.values(n).some(t=>!Y(t)))},(null==r?void 0:r.surveyLanguage)&&{[sh]:r.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[oh]:null==r?void 0:r.surveySubmissionId},ii(null==r?void 0:r.responses,t,null==r?void 0:r.questionSnapshots));var n},Oh=(t,r,i,n)=>{if(r){if(!i){var o=Zh(t),a=o?o.surveyLanguage:n;r.capture("survey dismissed",e({},Lh(t,o,r),a&&{[sh]:a},{$set:{[ni(t,"dismissed")]:!0}})),Qh(t),ch(t),Sh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else uh.error("[survey dismissed] event not captured, PostHog instance not found.")},Dh=(t,e)=>{if(e){var r=(t=>lh("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Zh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture("survey abandoned",Lh(t,i,e),{transport:"sendBeacon"})}}else uh.error("[survey abandoned] event not captured, PostHog instance not found.")},Ph=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Fh=(t,e)=>t.length===e.length&&t.every((t,r)=>t===e[r])?e.reverse():e,Nh=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},qh=(t,e)=>{var r;return(t=>t.questions.some(t=>{var e;return!(null==(e=t.branching)||!e.type)}))(t)?t.questions:e?null!==(r=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var r=new Map(t.questions.map(t=>[t.id,t])),i=[];for(var n of e){var o=r.get(n);if(!o)return null;i.push(o)}return i})(t,e.questionOrder))&&void 0!==r?r:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Fh(t.questions,Ph(t.questions)):t.questions},jh=t=>function(t){var e;return hi(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}(t)||Gh(t),Bh=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach(function(t){t.__e=!0,rl(t)})},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Nu++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Hh=()=>Ll(Bh),$h=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,o,a,s=Zu({},t.props);for(o in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=void 0===e[o]&&null!=a?a[o]:e[o];return arguments.length>2&&(s.children=arguments.length>3?Su.call(arguments,2):r),Ju(t.type,s,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function Uh(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n,o=se(e);return!!o&&vi[n=null==(i=t.conditions)?void 0:i.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[o])}function zh(t){var e,i;return function(t,e){var i,n,a;if(!t||0===t.length)return!0;if(!u)return!1;var s,l,h,c,d,v,f=(s={userAgentDataPlatform:null==o||null==(i=o.userAgentData)?void 0:i.platform,maxTouchPoints:null==o?void 0:o.maxTouchPoints,screenWidth:null==r||null==(n=r.screen)?void 0:n.width,screenHeight:null==r||null==(a=r.screen)?void 0:a.height,devicePixelRatio:null==r?void 0:r.devicePixelRatio},(v=function(t){return xt.test(t)?pt:St.test(t)?gt:_t.test(t)?mt:new RegExp(bt,"i").test(t)?bt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?vt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ft:Ct.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(yt,"i").test(t)?yt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(ht).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":dt:new RegExp("(pda|Mobile)","i").test(t)?wt:new RegExp(ct,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?kt:""}(u))===vt||v===dt||"Kobo"===v||"Kindle Fire"===v||v===kt?ct:v===pt||v===mt||v===gt||v===bt?"Console":v===ft?"Wearable":v?ht:"Android"===(null==s?void 0:s.userAgentDataPlatform)&&(null!==(l=null==s?void 0:s.maxTouchPoints)&&void 0!==l?l:0)>0?600>Math.min(null!==(h=null==s?void 0:s.screenWidth)&&void 0!==h?h:0,null!==(c=null==s?void 0:s.screenHeight)&&void 0!==c?c:0)/(null!==(d=null==s?void 0:s.devicePixelRatio)&&void 0!==d?d:1)?ht:ct:"Desktop");return vi[null!=e?e:"icontains"](t,[f])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}var Wh=t=>lh("inProgressSurvey_",t),Vh=(t,e)=>{try{localStorage.setItem(Wh(t),JSON.stringify(e))}catch(t){uh.error("Error setting in-progress survey state in localStorage",t)}},Zh=t=>{try{var e=localStorage.getItem(Wh(t));if(e)return JSON.parse(e)}catch(t){uh.error("Error getting in-progress survey state from localStorage",t)}return null},Gh=t=>{var e=Zh(t);return!Y(null==e?void 0:e.surveySubmissionId)},Qh=t=>{try{localStorage.removeItem(Wh(t))}catch(t){uh.error("Error clearing in-progress survey state from localStorage",t)}};function Jh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Kh(t,e,r){if(void 0===e&&(e=Ul),t===Zl)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Hl:return{left:"30px"};case $l:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Vl&&r===Bl?"60px":"30px"}}}var Xh=0;function Yh(t,e,r,i,n,o){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?a=e[s]:u[s]=e[s];var l={type:t,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xh,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return xu.vnode&&xu.vnode(l),l}var tc=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),ec=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),rc=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),ic=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),nc=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),oc=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Yh("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"})}),ac=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Yh("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"})}),sc=Yh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Yh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Yh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Yh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Yh("g",{mask:"url(#mask0_2415_6911)",children:[Yh("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"}),Yh("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"}),Yh("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"}),Yh("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"}),Yh("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"}),Yh("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"})]})]}),Yh("defs",{children:Yh("clipPath",{id:"clip0_2415_6911",children:Yh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function uc(t){var e=t.urlParams,r=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return Yh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",sc]})}function lc(t){var e=t.text,i=t.submitDisabled,n=t.appearance,o=t.onSubmit,a=t.link,s=t.onPreviewSubmit,u=t.skipSubmitButton,l=t.canGoBack,h=t.onBack,c=Ll(Bh).isPreviewMode,d=!!l&&!!h,v=!u&&Yh("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==r||r.open(a)),c?null==s||s():o()},children:e});return Yh("div",{className:"bottom-section",children:[d?Yh("div",{className:"form-buttons form-buttons-with-back",children:[Yh("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),v]}):v,!n.whiteLabel&&Yh(uc,{urlParams:{utm_source:"survey-footer"}})]})}function hc(t){var e=t.question,r=t.forceDisableHtml;return Yh("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Yh(e.type===Gl?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&$h({component:Qu("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function cc(t){var e,r,i;return Yh("button",{className:"form-cancel",onClick:t.onClick,disabled:Ll(Bh).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},r=(void 0===e?{}:e).fill,i=void 0===r?"currentColor":r,Yh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Yh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Yh("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:i})]}))})}var dc=r;function vc(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,o=t.appearance,a=t.onClose,s=Ll(Bh).isPopup;return Rl(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return ne(dc,"keydown",t),()=>{dc.removeEventListener("keydown",t)}},[a]),Yh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==o.hideCancelButton&&Yh(cc,{onClick:()=>a()}),Yh("h3",{className:"thank-you-message-header",children:e}),r&&$h({component:Qu("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),s&&Yh(lc,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>a()})]})}function fc(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,o=t.appearance,a=t.onStart,s=Ll(Bh),u=s.onPreviewSubmit,l=s.onPopupSurveyDismissed;return Yh("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s.isPopup&&!0!==o.hideCancelButton&&Yh(cc,{onClick:()=>l()}),e&&Yh("h3",{className:"intro-screen-header",children:e}),r&&$h({component:Qu("p",{className:"intro-screen-body"}),children:r,renderAsHtml:!n&&"text"!==i}),Yh(lc,{text:o.introScreenButtonText||"Get started",submitDisabled:!1,appearance:o,onSubmit:a,onPreviewSubmit:()=>u(null)})]})}var pc=t=>V(t)&&t.every(t=>J(t));function gc(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,o=t.onPreviewSubmit,a=t.displayQuestionIndex,s=t.initialValue,u=t.canGoBack,l=t.onBack,h=Hh().isPreviewMode,c=Al(null),d=Il(()=>J(s)?s:""),v=d[0],f=d[1],p=null==i?void 0:i.disableAutofocus;Rl(()=>{p||setTimeout(()=>{var t;h||null==(t=c.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+a,m=El(()=>function(t,e,r){var i,n,o=t.trim();if(!r&&""===o)return"This field is required";if(""===o)return!1;if(e&&e.length>0)for(var a of e)switch(a.type){case B:if(void 0!==a.value&&a.value>o.length)return null!==(i=a.errorMessage)&&void 0!==i?i:"Please enter at least "+a.value+" characters";break;case H:if(void 0!==a.value&&o.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(v,e.validation,e.optional),[v,e.validation,e.optional]),y=Qt(e.validation,B),b=Qt(e.validation,H),w=El(()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b),[y,b]),k=()=>{m||n(v.trim())},_=()=>{m||o(v.trim())};return Yh(Ku,{children:[Yh("div",{className:"question-container",children:[Yh(hc,{question:e,forceDisableHtml:r,htmlFor:g}),Yh("textarea",{ref:c,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?_():k())},value:v}),w&&Yh("div",{className:"validation-hint",children:w})]}),Yh(lc,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:k,onPreviewSubmit:_,canGoBack:u,onBack:l})]})}function mc(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,o=t.canGoBack,a=t.onBack;return Yh(Ku,{children:[Yh("div",{className:"question-container",children:Yh(hc,{question:e,forceDisableHtml:t.forceDisableHtml})}),Yh(lc,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:o,onBack:a})]})}function yc(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,o=t.appearance,a=t.onSubmit,s=t.onPreviewSubmit,u=t.initialValue,l=t.canGoBack,h=t.onBack,c=r.scale,d=10===r.scale?0:1,v=Il(()=>tt(u)?u:V(u)&&u.length>0&&tt(parseInt(u[0]))?parseInt(u[0]):J(u)&&tt(parseInt(u))?parseInt(u):null),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=Hh().isPreviewMode,y=t=>m?s(t):a(t);return Yh(Ku,{children:[Yh("div",{className:"question-container",children:[Yh(hc,{question:r,forceDisableHtml:i}),Yh("div",{className:"rating-section",children:[Yh("div",{className:"rating-options",children:["emoji"===r.display&&Yh("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=xc[r.scale])?void 0:e.map((t,e)=>Yh("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e))}),"number"===r.display&&Yh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(c-d+1)+", minmax(0, 1fr))"},children:Cc(r.scale).map((t,e)=>Yh(bc,{displayQuestionIndex:n,active:f===t,appearance:o,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e))})]}),!g&&Yh("div",{className:"rating-text",children:[Yh("div",{children:r.lowerBoundLabel}),Yh("div",{children:r.upperBoundLabel})]})]})]}),Yh(lc,{text:r.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:X(f)&&!r.optional,appearance:o,onSubmit:()=>a(f),onPreviewSubmit:()=>s(f),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:h})]})}function bc(t){var e=t.num,r=t.setActiveNumber;return Yh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function wc(t){var r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,o=t.appearance,a=t.onSubmit,s=t.onPreviewSubmit,u=t.initialValue,l=t.canGoBack,h=t.onBack,c=Al(null),d=El(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=Fh(e,Ph(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(r),[r]),v=Il(()=>((t,e)=>J(t)||pc(t)?t:e===Jl?null:[])(u,r.type)),f=v[0],p=v[1],g=Il(()=>((t,e)=>{if(J(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(pc(t)){var r=t.find(t=>!e.includes(t));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,d)),m=g[0],y=g[1],b=Hh().isPreviewMode,w=r.type===Jl,k=r.type===Ql,_=r.skipSubmitButton&&w&&!r.hasOpenChoice,S=(t,r)=>{if(r){var i=!m.isSelected;return y(t=>e({},t,{isSelected:i,inputValue:i?t.inputValue:""})),w&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=c.current)?void 0:t.focus()},75))}if(w)return p(t),y(t=>e({},t,{isSelected:!1,inputValue:""})),void(_&&(a(t),b&&s(t)));k&&V(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var r=t.currentTarget.value;y(t=>e({},t,{inputValue:r})),w&&p(r)},C=t=>{t.stopPropagation(),"Enter"!==t.key||M()||(t.preventDefault(),T()),"Escape"===t.key&&(t.preventDefault(),y(t=>e({},t,{isSelected:!1,inputValue:""})),w&&p(null))},M=()=>!(r.optional||!X(f)&&(!V(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),T=()=>{m.isSelected&&k?V(f)&&(b?s([...f,m.inputValue]):a([...f,m.inputValue])):b?s(f):a(f)};return Yh(Ku,{children:[Yh("div",{className:"question-container",children:[Yh(hc,{question:r,forceDisableHtml:i}),Yh("fieldset",{className:"multiple-choice-options limit-height",children:[Yh("legend",{className:"sr-only",children:k?" Select all that apply":" Select one"}),d.map((t,e)=>{var i=!!r.hasOpenChoice&&e===r.choices.length-1,o="surveyQuestion"+n+"Choice"+e,a=o+"Open",s=i?m.isSelected:w?f===t:V(f)&&f.includes(t);return Yh("label",{className:i?"choice-option-open":"",children:[Yh("div",{className:"response-choice",children:[Yh("input",{type:w?"radio":"checkbox",name:o,checked:s,onChange:()=>S(t,i),id:o,"aria-controls":a}),Yh("span",{children:i?t+":":t})]}),i&&Yh("input",{type:"text",ref:c,id:a,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},e)})]})]}),Yh(lc,{text:r.buttonText||"Submit",submitDisabled:M(),appearance:o,onSubmit:T,onPreviewSubmit:T,skipSubmitButton:_,canGoBack:l,onBack:h})]})}var kc=[1,2,3,4,5],_c=[1,2,3,4,5,6,7],Sc=[0,1,2,3,4,5,6,7,8,9,10],xc={2:[oc,ac],3:[rc,ec,tc],5:[ic,rc,ec,tc,nc]};function Cc(t){switch(t){case 5:default:return kc;case 7:return _c;case 10:return Sc}}var Mc=te("[Surveys]");function Tc(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Xl:o;if(n.branching.type===Xl)return Xl;if("specific_question"===n.branching.type){if(Number.isInteger(n.branching.index))return n.branching.index}else if("response_based"===n.branching.type){if(n.type===Jl){var a,s=n.choices.indexOf(""+r);if(-1===s&&n.hasOpenChoice&&(s=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(s)){var u=n.branching.responseValues[s];return Number.isInteger(u)?u:u===Xl?Xl:o}}else if(n.type===Kl){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(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===Xl?Xl:o}}return o}return Mc.warn("Falling back to next question index due to unexpected branching type"),o}var Ic=te("[SurveyTranslations]");function Rc(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=oi(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var o=function(t){return t&&"object"==typeof t&&"language"in t?oi(t.language):null}(r);if(o)return null==e||e.info("Using person property language: "+o),o;var a=oi(i);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Z(t.get_property)?t.get_property(M):void 0,locale:navigator.language||navigator.userLanguage},Ic)}(e);if(!r)return Ic.info("No user language detected"),{survey:t,language:null};var i=li(t,r,Ic);return{survey:i.survey,language:i.matchedKey}}var Ac=r,Ec=a,Lc="ph:show_survey_widget",Oc="PHWidgetSurveyClickListener";function Dc(t,e){try{var r=t.getBoundingClientRect(),i=Ac.innerHeight,n=Ac.innerWidth,o=r.left+r.width/2-e/2;o+e>n-20&&(o=n-e-20),20>o&&(o=20);var a=i-r.bottom,s=250>a&&r.top>a;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:o+"px",right:"auto",bottom:s?i-r.top+12+"px":"auto",zIndex:Mh.zIndex}}catch(t){return uh.warn("Failed to calculate trigger position:",t),null}}var Pc=class{constructor(t){var r=this;this.fi=new Map,this.pi=new Map,this.gi=new Map,this.mi=new Set,this.yi=null,this.bi=!1,this.wi=null,this.ki=null,this.Si=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(T);if(t)for(var e of t)Gh(e)&&Dh(e,this._posthog)},this.handlePopoverSurvey=function(t,i,n){var o,a,s,u,l,h=(void 0===n?{}:n).resumeDelayFromActivation,c=void 0!==h&&h,d=r.xi(t),v=d.survey,f=d.language;r.yi=f,r.Si=null,r.Ci=i;var p=r.Mi(v,i);r.Ti(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&r.Ii(p,y,m,f);if(!b||null!=(o=p.appearance)&&o.displayThankYouMessage){r.Ri(p);var w={};if((null==(a=p.appearance)?void 0:a.position)===zl&&null!=(s=p.appearance)&&s.widgetSelector){var k,_=Ec.querySelector(p.appearance.widgetSelector);_&&(w=Dc(_,parseInt((null==(k=p.appearance)?void 0:k.maxWidth)||Mh.maxWidth))||{})}var S=(null==(u=p.appearance)?void 0:u.surveyPopupDelaySeconds)||0,x=Ah(p,r._posthog).shadow;r.gi.set(x,x.host);var C={posthog:r._posthog,survey:p,removeSurveyFromFocus:r.Ai,properties:m,style:w,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(r.Si=C,0>=S)return r.bi=!0,ml(Yh(Bc,e({},C)),x);var M=()=>{if(!r.Ei(p))return uh.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),r.Ai(p);(()=>{r.bi=!0;var n=r.xi(t),o=n.survey,a=n.language;r.yi=a;var s=r.Mi(o,i),u=e({},C,{survey:s,surveyLanguage:a});r.Si=u,ml(Yh(Bc,e({},u,{survey:e({},s,{appearance:e({},s.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},T=c?null==(l=r._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(p.id):void 0,I=tt(T)?Math.max(0,Date.now()-T):0,R=Math.max(0,1e3*S-I);if(0>=R)return M();var A=Ac.setTimeout(()=>{r.fi.delete(p.id),M()},R);r.fi.set(p.id,A)}},this.Li=t=>{var e=this.xi(t),r=e.survey,i=e.language,n=Ah(r,this._posthog),o=n.shadow,a=n.isNewlyCreated;this.gi.set(o,o.host),a&&ml(Yh($c,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),o)},this.Oi=t=>{var e=this.pi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Oc),this.pi.delete(t),uh.info("Removed click listener for survey "+t))},this.Di=t=>{this.Pi(t)||(this.Fi(t),this.Oi(t.id))},this.Pi=t=>{try{var e;return!(null==(e=Ec.querySelector(Jh(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ni=(t,e)=>{var r=Ec.querySelector(e),i=this.pi.get(t.id);if(r){if(this.Li(t),i){if(r===i.element)return;uh.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Oi(t.id)}if(!r.hasAttribute(Oc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===zl?Dc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Mh.maxWidth)):{};Ac.dispatchEvent(new CustomEvent(Lc,{detail:{surveyId:t.id,position:n}}))};ne(r,"click",n),r.setAttribute(Oc,"true"),this.pi.set(t.id,{element:r,listener:n,survey:t}),uh.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.Di(t)},this.renderPopover=t=>{var e=this.xi(t),r=e.survey,i=e.language,n=Ah(r,this._posthog).shadow;this.gi.set(n,n.host),ml(Yh(Bc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Ai,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.xi(t),o=n.survey,a=n.language,s=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(s=this.qi(o,a,r)),ml(Yh(Bc,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Ai,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:a}),e)},this.getActiveMatchingSurveys=function(t,e){var i;void 0===e&&(e=!1),null==(i=r._posthog)||null==(i=i.surveys)||i.getSurveys(e=>{t(e.filter(t=>r.Ei(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),r.getActiveMatchingSurveys(t=>{var e=t.filter(t=>t.type===Wl||t.type===Vl),i=new Set(e.map(t=>t.id));for(var n of Array.from(r.fi.keys()))i.has(n)||r.cancelSurvey(n);var o=r.ji(e),a=new Set;o.forEach(t=>{if(t.type===Vl){var e,i,n,o;if((null==(e=t.appearance)?void 0:e.widgetType)===Bl)return void r.Li(t);"selector"===(null==(i=t.appearance)?void 0:i.widgetType)&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),r.Ni(t,null==(o=t.appearance)?void 0:o.widgetSelector))}X(r.Bi)&&t.type===Wl&&r.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),r.pi.forEach(t=>{var e=t.survey;a.has(e.id)||r.Di(e)})},t)},this.Ri=t=>{X(this.Bi)||uh.error("Survey "+this.Bi+" already in focus. Cannot add survey "+t.id+"."),this.Bi=t.id},this.Ai=t=>{this.Bi!==t.id&&uh.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Ti(t.id),this.Bi=null,this.yi=null,this.bi=!1,this.Si=null,this.Ci=void 0,this.Fi(t)},this._posthog=t,this.Bi=null,this.wi=()=>this.Hi(),ne(Ac,"languagechange",this.wi),this.ki=t.onFeatureFlags(()=>this.Hi())}Hi(){var t;if(!X(this.Bi)){var r=null==(t=this._posthog.get_property(T))?void 0:t.find(t=>t.id===this.Bi);if(r){var i=this.xi(r),n=i.survey,o=i.language;if(o!==this.yi&&(this.yi=o,this.bi)){var a=this.Mi(n,this.Ci),s=Ah(a,this._posthog).shadow;ml(Yh(Bc,e({},this.Si,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Ai,surveyLanguage:o})),s)}}}}get $i(){var t,e,r;return null!==(t=null==(e=(r=this._posthog).getExtension)?void 0:e.call(r,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Mi(t,r){return null!=r&&r.position||null!=r&&r.selector?e({},t,{appearance:e({},t.appearance,r.position&&{position:r.position},r.selector&&{widgetSelector:r.selector})}):t}Ti(t){var e=this.fi.get(t);e&&(clearTimeout(e),this.fi.delete(t))}cancelSurvey(t){this.fi.has(t)&&(uh.info("Cancelled pending survey "+t),this.Ti(t),this.Bi===t&&(this.Bi=null,this.yi=null,this.bi=!1,this.Si=null,this.Ci=void 0))}setAutomaticDisplayDispose(t){this.Ui=t}dispose(){var t;null==(t=this.Ui)||t.call(this),this.Ui=void 0,this.wi&&(Ac.removeEventListener("languagechange",this.wi),this.wi=null),this.ki&&(this.ki(),this.ki=null),this.fi.forEach((t,e)=>this.Ti(e)),this.pi.forEach((t,e)=>this.Oi(e)),this.gi.forEach((t,e)=>{ml(null,e),null==t||t.remove()}),this.gi.clear(),this.Bi=null}ji(t){return t.sort((t,e)=>{var r,i,n=Gh(t),o=Gh(e);if(n&&!o)return-1;if(!n&&o)return 1;var a=t.schedule===Yl,s=e.schedule===Yl;return a&&!s?1:!a&&s?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)})}xi(t){return Rc(t,this._posthog)}qi(t,e,r){if(this.mi.has(t.id))return!1;var i=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};for(var n of i.split("&")){var o=n.split("="),a=o[0],s=o[1];if(a&&!Q(s)){var u=decodeURIComponent(a),l=decodeURIComponent(s);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}(Ac.location.search).params;if(0===Object.keys(i).length)return!1;uh.info("[Survey Prefill] Detected URL prefill parameters");var n=this.zi(t,i,e);return!!n&&(this.Wi(t,n,r,e),this.mi.add(t.id),n.isSurveyCompleted)}Wi(t,e,r,i){var n=e.responses,o=e.submissionId,a=e.isSurveyCompleted,s=e.skippedResponses;(Object.keys(s).length>0&&t.enable_partial_responses||a)&&Eh({responses:a?n:s,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:a,properties:r,surveyLanguage:i})}Ii(t,e,r,i){var n={};for(var o of Object.entries(e)){var a=o[1];n[parseInt(o[0])]=V(a)?a.map(String):[String(a)]}uh.info("[Survey] Processing initial responses");var s=this.zi(t,n,i);return!!s&&(this.Wi(t,s,r,i),s.isSurveyCompleted)}zi(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach((t,i)=>{if(e[i]&&t.id){var n=e[i],o=ei(t.id);try{switch(t.type){case Jl:if(!t.choices||0===t.choices.length)return void Yt.warn("[Survey Prefill] Question "+i+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Yt.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=t.choices[a];break;case Ql:if(!t.choices||0===t.choices.length)return void Yt.warn("[Survey Prefill] Question "+i+" has no choices");var s=n.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===s.length)return void Yt.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(s.map(e=>t.choices[e]))];s.length>u.length&&Yt.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=u;break;case Kl:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void Yt.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=l;break;default:Yt.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Yt.error("[Survey Prefill] Error converting q"+i+":",t)}}}),r}(t,e);if(0===Object.keys(i).length)return uh.warn("[Survey Prefill] No valid responses after conversion"),null;var n=yh(),o=function(t,e,r){for(var i=0,n={},o=[],a=t.questions.length+1,s=0;t.questions.length>i&&a>s&&(s++,e.includes(i));){var u=t.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=ei(u.id);Q(r[l])||(n[l]=r[l])}o.push(i);var h=Tc(t,i,u.id?r[ei(u.id)]:null);if(h===Xl)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:o};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:o}}(t,Object.keys(e).map(t=>parseInt(t,10)),i),a=o.startQuestionIndex,s=o.skippedResponses,u=o.skippedIndices,l=a>=t.questions.length;return Vh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,questionOrder:Nh(t.questions),visitedIndices:u,surveyLanguage:r}),uh.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:l,skippedResponses:s}}catch(t){return uh.error("[Survey Prefill] Error handling prefill:",t),null}}Vi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=this.$i,i=!(null==r||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==r?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),i&&n}Zi(t){return!t.conditions||Uh(t,this._posthog)&&zh(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==xh||!xh.querySelector(t.conditions.selector))}(t)}Gi(t){var e;return jh(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this.$i)&&e.hasLoadedFlags?{satisfied:this.Vi(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!function(t){return!(!t.start_date||t.end_date)}(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!dh.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.Vi(t.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.Vi(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var o,a=this.Gi(t);return a.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=Math.abs((new Date).getTime()-r.getTime());return Math.ceil(i/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,kh.li("lastSeenSurveyDate"))?(t=>!!kh.li(hh(t))&&!jh(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(o=a.reason)&&void 0!==o?o:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.Qi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}Qi(t){var e;return!hi(t)&&!function(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}Ji(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every(t=>{var e=t.value;return!t.key||!e||this.Vi(e)})}Ei(t){return this.checkSurveyEligibility(t).eligible&&this.Zi(t)&&this.Qi(t)&&this.Ji(t)}Fi(t){try{var e=Ec.querySelector(Jh(t,!0));null!=e&&e.shadowRoot&&(ml(null,e.shadowRoot),this.gi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){uh.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Ri,removeSurveyFromFocus:this.Ai,surveyInFocus:this.Bi,surveyTimeouts:this.fi,handleWidget:this.Li,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ni,sortSurveysByAppearanceDelay:this.ji,checkFlags:this.Ji.bind(this),isSurveyFeatureFlagEnabled:this.Vi.bind(this),onLanguageChange:this.Hi.bind(this),currentLanguage:this.yi,surveyIsRendered:this.bi}}};function Fc(t,e){if(Ec&&Ac){var r,i=new Pc(t);if(t.config.disable_surveys_automatic_display)return uh.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return uh.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Q(r)&&(r=setInterval(()=>{i.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{Q(r)||(clearInterval(r),r=void 0)};n();var a=()=>{Ec.hidden?o():(i.callSurveysAndEvaluateDisplayLogic(!1),n())};return ne(Ec,"visibilitychange",a),i.setAutomaticDisplayDispose(()=>{o(),Ec.removeEventListener("visibilitychange",a)}),i}}function Nc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,o=t.isPreviewMode,a=void 0!==o&&o,s=t.posthog;Rl(()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===Vl,o=Uh(e,s),a=(null==(t=e.appearance)?void 0:t.widgetType)===Bl&&r;if(!o)return uh.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);a&&(uh.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};ne(Ac,"popstate",r),ne(Ac,"hashchange",r);var o=Ac.history.pushState,u=Ac.history.replaceState;return Ac.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];o.apply(this,e),r()},Ac.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];u.apply(this,e),r()},()=>{Ac.removeEventListener("popstate",r),Ac.removeEventListener("hashchange",r),Ac.history.pushState=o,Ac.history.replaceState=u}}},[a,e,i,n,s])}var qc=200;function jc(t){switch(void 0===t&&(t="right"),t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Bc(t){var r,i,n,o,a,s,u,l,h,c,d,v,f=t.survey,p=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,w=t.removeSurveyFromFocus,k=void 0===w?()=>{}:w,_=t.isPopup,S=void 0===_||_,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,M=t.onPreviewBack,T=void 0===M?()=>{}:M,I=t.onPopupSurveyDismissed,R=void 0===I?()=>{}:I,A=t.onCloseConfirmationMessage,E=void 0===A?()=>{}:A,L=t.properties,O=t.isSurveyCompleted,D=t.skipShownEvent,P=t.surveyLanguage,F=Al(null),N=Number.isInteger(b),q=function(t,r,i,n,o,a,s,u,l){var h=Il(n||0===i||t.type===Zl),c=h[0],d=h[1],v=Il(!1),f=v[0],p=v[1],g=Al(!1),m=()=>{var e=()=>{a&&o(t),d(!1)};if(!g.current){var r=null==s?void 0:s.current;r?(g.current=!0,r.style.transition="opacity "+qc+"ms ease-out",r.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Rl(()=>{if(r){if(!n){var o,a=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return m();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&(o&&clearTimeout(o),o=setTimeout(m,5e3))}},s=()=>{if(Uh(t,r)){d(!0),Ac.dispatchEvent(new Event("PHSurveyShown")),u||r.capture("survey shown",e({[eh]:t.name,[th]:t.id,[rh]:t.current_iteration,[ih]:t.current_iteration_start_date},l&&{[sh]:l},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};ne(Ac,"PHSurveyClosed",y),ne(Ac,"PHSurveySent",a);var h=i>0?setTimeout(s,i):void 0;return Q(h)&&s(),()=>{Q(h)||clearTimeout(h),Q(o)||clearTimeout(o),Ac.removeEventListener("PHSurveyClosed",y),Ac.removeEventListener("PHSurveySent",a)}}}else uh.error("usePopupVisibility hook called without a PostHog instance.")},[]),Nc({survey:t,removeSurveyFromFocus:o,setSurveyVisible:d,isPreviewMode:n,posthog:r}),{isPopupVisible:c,isSurveySent:f,setIsPopupVisible:d,hidePopupWithAnimation:m}}(f,g,null!=(r=f.appearance)&&r.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,N,k,S,F,D,P),j=q.isPopupVisible,B=q.hidePopupWithAnimation,H=q.isSurveySent||b===f.questions.length||!0===O,U=Il(!1),z=U[0],W=U[1],V=El(()=>!!Zh(f),[f]),Z=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(n=f.appearance)&&n.introScreenDescription),G=N?-1===b:!(null==(o=f.appearance)||!o.displayIntroScreen)&&Z&&!z&&!V,J=El(()=>{var t,e=(null==(t=Zh(f))?void 0:t.surveySubmissionId)||yh();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){P?Oh(f,g,N,P):Oh(f,g,N),R()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:T,posthog:g,properties:L,surveyLanguage:P}},[N,b,S,g,f,R,C,T,L,P]);return j?Yh(Bh.Provider,{value:J,children:Yh("div",{className:"ph-survey",style:e({},Kh(f.type,null==(a=f.appearance)?void 0:a.position,null==(s=f.appearance)?void 0:s.widgetType),y),ref:F,children:H?Yh(vc,{header:(null==(u=f.appearance)?void 0:u.thankYouMessageHeader)||"Thank you!",description:(null==(l=f.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(h=f.appearance)?void 0:h.thankYouMessageDescriptionContentType,appearance:f.appearance||Mh,onClose(){B(),E()}}):G?Yh(fc,{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||Mh,onStart:()=>W(!0)}):Yh(Hc,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Hc(t){var r,i,n=t.survey,o=t.forceDisableHtml,a=t.posthog,s=El(()=>{var t=Zh(n);if(!t)return null;var e=tt(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&n.questions.length>t.lastQuestionIndex?t:(Qh(n),null)},[n]),u=Il(()=>(null!=s&&s.responses&&uh.info("Survey is already in progress, filling in initial responses"),(null==s?void 0:s.responses)||{})),l=u[0],h=u[1],c=Ll(Bh),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=Il(()=>{var t=null==s?void 0:s.lastQuestionIndex,e=tt(t)&&t>=0&&n.questions.length>t?t:0;return tt(d)&&d>=0?d:e}),_=k[0],S=k[1],x=Il(()=>{var t;return(null!==(t=null==s?void 0:s.visitedIndices)&&void 0!==t?t:[]).filter(t=>t>=0&&n.questions.length>t)}),C=x[0],M=x[1],T=Il(()=>{var t,e;return null!==(t=null==(e=Zh(n))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),I=T[0],R=T[1],A=El(()=>Nh(qh(n,s)),[n.id,s]),E=El(()=>{if(!A||new Set(A).size!==A.length)return qh(n,s);var t=new Map(n.questions.map(t=>[t.id,t])),e=A.map(e=>t.get(e)).filter(t=>!!t);return e.length===A.length?e:n.questions},[A,n.questions,n,s]);Rl(()=>{!y||Q(d)||0>d||S(d)},[d,y]);var L=!(null==(r=n.appearance)||!r.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),O=E.at(_);return O?Yh("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&Yh(cc,{onClick(){v()}}),Yh("div",{className:"survey-box","data-question-index":_,children:Uc({question:O,forceDisableHtml:o,displayQuestionIndex:_,appearance:n.appearance||Mh,onSubmit:t=>(t=>{var r=t.res,i=t.displayQuestionIndex,o=t.questionId;if(a)if(o){var s=ei(o),u=e({},l,{[s]:r});h(u);var c=E[i],d=null!=c&&c.id?e({},I,{[c.id]:c.question}):I;R(d);var v=Tc(n,i,r),f=v===Xl,p=[...C,i];if(f||(M(p),S(v),Vh(n,{surveySubmissionId:m,responses:u,lastQuestionIndex:v,questionOrder:Nh(E),visitedIndices:p,surveyLanguage:w,questionSnapshots:d})),n.enable_partial_responses||f){var g=new Set(p.map(t=>{var e;return null==(e=E[t])?void 0:e.id}).filter(t=>!!t).map(t=>ei(t)));Eh({responses:Object.fromEntries(Object.entries(u).filter(t=>g.has(t[0]))),survey:n,surveySubmissionId:m,isSurveyCompleted:f,posthog:a,properties:b,surveyLanguage:w,questionSnapshots:d})}}else uh.error("onNextButtonClick called without a questionId.");else uh.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:_,questionId:O.id}),onPreviewSubmit:p,initialValue:O.id?l[ei(O.id)]:void 0,canGoBack:L,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);M(e),S(t),Vh(n,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:Nh(E),visitedIndices:e,surveyLanguage:w,questionSnapshots:I})}}})})]}):null}function $c(t){var e,r,i,n,o,a,s,u=t.survey,l=t.forceDisableHtml,h=t.posthog,c=t.readOnly,d=t.surveyLanguage,v=Il(!0),f=v[0],p=v[1],g=Il(!1),m=g[0],y=g[1],b=Il({}),w=b[0],k=b[1],_=Al(void 0),S=()=>{y(!m)};if(Rl(()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&k({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(uh.info("Received show event for feedback button survey "+u.id),k(r.detail.position||{}),S())};return ne(Ac,Lc,e),()=>{Q(_.current)||(clearTimeout(_.current),_.current=void 0),Ac.removeEventListener(Lc,e)}}}else uh.error("FeedbackWidget called without a PostHog instance.")},[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Nc({survey:u,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{u.schedule!==Yl&&p(!1),Q(_.current)||clearTimeout(_.current),_.current=setTimeout(()=>{_.current=void 0,y(!1)},200)};return Yh(Ku,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Yh("button",{className:"ph-survey-widget-tab "+("top"===(null==(o=u.appearance)?void 0:o.tabPosition)?"widget-tab-top":""),onClick:S,disabled:c,style:jc(null==(a=u.appearance)?void 0:a.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),m&&Yh(Bc,{posthog:h,survey:u,forceDisableHtml:l,style:w,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:d})]})}var Uc=t=>{var r=t.question,i=t.displayQuestionIndex,n=t.onSubmit,o=t.onPreviewSubmit,a={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){o(t)},onSubmit(t){n(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(r.type){case Gl:return Qu(gc,e({},a,{question:r,key:r.id}));case"link":return Qu(mc,e({},a,{question:r,key:r.id}));case Kl:return Qu(yc,e({},a,{question:r,key:r.id}));case Jl:case Ql:return Qu(wc,e({},a,{question:r,key:r.id}));default:return uh.error("Unsupported question type: "+r.type),null}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.generateSurveys=Fc,h.extendPostHogWithSurveys=Fc;var zc=1e4,Wc=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),Vc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return Wc(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,o=Math.min(t.length,r.remaining-2);o>n;){var a=Math.ceil((n+o)/2);JSON.stringify(t.slice(0,a)).length>r.remaining?o=a-1:n=a}return Wc(e,JSON.stringify(t.slice(0,n)),r)},Zc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Gc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},Qc=(t,e,r)=>{if(!r.truncated)if(G(t)){if(r.seen.has(t))return void Gc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Qc(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else Gc(e,t,r)},Jc=function(t,e,r,i,n,o){if(void 0===n&&(n=!1),!Zc(t))return!n||Wc(e,"null",r);if(X(t)||(t=>{try{return tt(t)||et(t)}catch(t){return!1}})(t))return Wc(e,JSON.stringify(t),r);if("string"==typeof t)return Vc(t,e,r);if(!G(t)&&!V(t))return Wc(e,JSON.stringify(t),r);if(i.has(t))return Vc("[Circular]",e,r);i.add(t);try{var a=t.toJSON;if(Z(a))return Jc(a.call(t),e,r,i,n)}catch(t){}try{var s={}.toString.call(t);if("[object String]"===s)return Vc(String(t.valueOf()),e,r);if("[object Number]"===s||"[object Boolean]"===s)return Wc(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var u={};try{for(var l in t)({}).hasOwnProperty.call(t,l)&&(u[l]=t[l])}catch(t){}try{u.name=t.name}catch(t){}try{u.message=t.message}catch(t){}try{u.stack=t.stack}catch(t){}return Jc(u,e,r,i,n,o)}if(V(t)){if(!Wc(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Wc(e,",",r))return!1;var c=void 0;try{c=t[h]}catch(t){c=void 0}if(!Jc(c,e,r,i,!0))return!1}return Wc(e,"]",r)}if(!Wc(e,"{",r))return!1;var d=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(o)try{Qc(f,v,o)}catch(t){}if(Zc(f)){var p=(d?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!Wc(e,p,r))return!1;var b=e.length,w=Jc(f,e,r,i,!1),k=r.truncated;if(e.length!==b){if(d=!1,!w)return!1}else if(e.length=g,r.remaining=m,r.truncated=w?y:k,!w)return!1}}}catch(t){}return Wc(e,"}",r)},Kc=(t,e)=>{for(var r=[],i={remaining:e,truncated:!1},n=G(t[0])?{result:{},keysRemaining:50,sizeRemaining:zc,truncated:!1,seen:new WeakSet([t[0]])}:void 0,o=0;t.length>o&&(0>=o||Wc(r," ",i))&&Jc(t[o],r,i,new WeakSet,!1,0===o?n:void 0);o++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}},Xc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Yc=t=>"canCapture"in t,td=t=>Yc(t)?t.canCapture?t.getExtension("logs"):void 0:t.is_capturing()?t.logs:void 0;h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.logs={initializeLogs(t){var r=t,i=[],n={host:h.location.host},o=!1,a=function(t){var a=h.console[t];i.push(Xs(h.console,t,i=>{var s=(i=>function(){for(var a=!1,s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];try{var c=r;if(u.length>0&&!o&&c){var d=td(c);if(d){o=!0,a=!0;var v=Kc(u,zc),f=v.body,p=v.attributes,g=e({},n,v.truncated?{body_truncated:"true"}:{});((t,e,r)=>{if(Yc(t))e.captureConsoleLog(r);else{var i=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var r=Number(e[1]),i=Number(e[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"}})(t.version),n=i?e[i]:void 0;Z(n)&&n.call(e,r)}})(c,d,{level:Xc[t],body:f,attributes:e({"log.source":"console."+t},g,p)})}}}catch(t){}finally{a&&(o=!1),i.apply(h.console,u)}})(i);return s.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(a),s}))};for(var s of Object.keys(Xc))a(s);return()=>{r=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,r){var i=td(t);if(i)for(var n of r)try{var o=Kc(n.args,zc);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:Xc[n.level],body:o.body,attributes:e({"log.source":"console."+n.level,host:h.location.host},o.truncated?{body_truncated:"true"}:{},o.attributes)},n.context,n.occurredAtMs)}catch(t){}}},te("[Error tracking]");var ed=te("[ExceptionAutocapture]"),rd=new class{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var e=this;return i(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&V(r.stacktrace.frames)&&(r.stacktrace.frames=yield e.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,r){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,r)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?r.skipFirstLines:0),r.chunkIdMap)),e({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map(t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return i(function*(){var r=t;for(var i of e.modifiers)r=yield i(r);return r})()}convertToExceptionList(t,r){var i,n,o,a={type:t.type,value:t.value,mechanism:{type:null!==(i=r.type)&&void 0!==i?i:"generic",handled:null===(n=r.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(a.stacktrace={type:"raw",frames:t.stack});var s=[a];return null!=t.cause&&s.push(...this.convertToExceptionList(t.cause,e({},r,{handled:!0}))),s}buildParsingContext(t){var e;return{chunkIdMap:At(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,r,i){void 0===i&&(i=0);var n=(e,i)=>{if(4>=i){var n=this.buildCoercingContext(t,r,i);return this.applyCoercers(e,n)}};return e({},r,{syntheticException:0==i?r.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}([new class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=J(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return nt(t,"DOMException")}isDOMError(t){return nt(t,"DOMError")}},new class{match(t){return nt(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!at(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return it(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}},new class{match(t){return!!nt(t,"ErrorEvent")&&(null!=t.error||this.Ki(t))}coerce(t,r){var i;if(null!=t.error)return r.apply(t.error);var n=r.apply(t.message);return e({},n,{stack:null!==(i=this.Xi(t))&&void 0!==i?i:n.stack,synthetic:!0})}Ki(t){return J(t.message)&&t.message.length>0}Xi(t){var e,r,i=t,n=null!==(e=i.lineno)&&void 0!==e?e:0,o=null!==(r=i.colno)&&void 0!==r?r:0;if(J(i.filename)&&0!==i.filename.length&&0!==n)return"Error\n at "+i.filename+":"+n+":"+o}},new class{match(t){return ot(t)}coerce(t,e){var r,i=this.getStack(t),n=void 0===i;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=i?i:null==(r=e.syntheticException)?void 0:r.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}},new class{match(t){return at(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Ut(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(r=this.getStack(t))&&void 0!==r?r:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(at(t))return t.constructor.name;var e="name"in t?t.name:void 0;return J(e)&&!K(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Ut(t)}isSeverityLevel(t){return J(t)&&!K(t)&&$t.indexOf(t)>=0}getStack(t){try{return J(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:J(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(ot(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},new class{match(t){return"string"==typeof t}coerce(t,e){var r,i=this.getInfos(t),n=i[0],o=i[1];return{type:null!=n?n:"Error",value:null!=o?o:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Ht);return i&&(e=i[1],r=i[2]),[e,r]}},new class{match(t){return it(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;r>n;n++)i[n-1]=arguments[n];return function(r,n){void 0===n&&(n=0);for(var o=[],a=r.split("\n"),s=n;a.length>s;s++){var u=a[s];if(1024>=u.length){var l=Bt.test(u)?u.replace(Bt,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){o.push(c);break}}if(o.length>=50)break}}}return function(t){if(!t.length)return[];var r=Array.from(t);return r.reverse(),r.slice(0,50).map(t=>{return e({},t,{filename:t.filename||(i=r,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(o)}}("web:javascript",Ft,jt)),id=(t,e)=>{try{return t()}catch(t){return e}},nd=(t,e)=>id(()=>t(e()),void 0),od=t=>id(()=>Z(t)&&Z(t.call),!1),ad=(t,e)=>id(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),sd=(t,e,r)=>{id(()=>{var r;null==(r=t[e])||delete r.__POSTHOG_INSTRUMENTED__},void 0),id(()=>{t[e]=r},void 0)},ud=t=>{var e=r;e||ed.info("window not available, cannot wrap onerror");var i=id(()=>e.onerror,void 0);return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return nd(t,()=>rd.buildFromUnknown((t=>{var e=t[0],r=t[1],i=t[2],n=t[3],o=t[4];if(null!=o)return o;if(J(e)&&J(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:r,lineno:i,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}})),!!od(i)&&null!==(e=i(...n))&&void 0!==e&&e},ad(e,"onerror"),()=>sd(e,"onerror",i)},ld=function(t,e){void 0===e&&(e=!1);var i=r;i||ed.info("window not available, cannot wrap onUnhandledRejection");var n=id(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(r){var i;return nd(t,()=>rd.buildFromUnknown(r,{mechanism:{handled:!1}})),od(n)?null!==(i=n(r))&&void 0!==i&&i:e},ad(i,"onunhandledrejection"),()=>sd(i,"onunhandledrejection",n)},hd={wrapOnError:ud,wrapUnhandledRejection:ld,wrapConsoleError(t){var e=console;e||ed.info("console not available, cannot wrap console.error");var r=id(()=>e.error,void 0);return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;e>n;n++)i[n]=arguments[n];nd(t,()=>{var t;t=1==i.length?i[0]:i.join(" ");var e=i.find(t=>t instanceof Error);return rd.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),od(r)&&r(...i)},ad(e,"error"),()=>sd(e,"error",r)}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.errorWrappingFunctions=hd,h.posthogErrorWrappingFunctions=hd;var cd=(t,e)=>{if(Z(null==t?void 0:t.capture)){var r=null==e?void 0:e.autocaptureExceptions,i=!X(r)&&"object"==typeof r&&V(r.errors_to_ignore)?r.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){ed.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t},[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){ed.error("Failed to capture exception for a legacy client",t)}};ud(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),ld(n,!0)}};h.extendPostHogWithExceptionAutoCapture=cd,h.extendPostHogWithExceptionAutocapture=cd;var dd="X-POSTHOG-SESSION-ID",vd="X-POSTHOG-WINDOW-ID",fd="X-POSTHOG-DISTINCT-ID",pd=[dd,vd,fd],gd=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],md=(t,e)=>({}.hasOwnProperty.call(t,e)),yd=t=>"object"==typeof t&&!X(t)||Z(t),bd=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),wd=t=>{try{var e;return bd(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==r||null==(e=r.location)?void 0:e.href).toString()}catch(t){return}},kd=(t,e,r,i,n)=>{var o;try{o=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(V(t)&&!t.includes(o))return!1;var a=!1;if(r){var s=r.checkAndGetSessionAndWindowId(!0),u=s.windowId;n.set(dd,s.sessionId),n.set(vd,u),a=!0}var l=(t=>Z(t)?t():t)(e);return l&&"$posthog_cookieless"!==l&&(n.set(fd,l),a=!0),a};h.__PosthogExtensions__=h.__PosthogExtensions__||{};var _d={_patchFetch:(t,i,n)=>Xs(r,"fetch",r=>function(o,a){var s=arguments.length>1?[o,a]:[o],u=s;try{var l=wd(o);if(l)if(bd(o)){var h=new Request(o,a);kd(t,i,n,h.url,h.headers),u=[h]}else{var c=new Headers(yd(a)?a.headers:void 0);if(kd(t,i,n,l,c)){var d=((t,r)=>{if(Q(t)||X(t))return{headers:r};if(yd(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:r,writable:!0}),n}return new Proxy({headers:r},{get:(t,e)=>md(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>md(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),gd.forEach(t=>{t in i&&e.add(t)}),Array.from(e)},getOwnPropertyDescriptor(t,r){var n=Reflect.getOwnPropertyDescriptor(t,r);if(n)return n;if("string"==typeof r&&gd.includes(r)&&r in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,r,i)}};var o=Reflect.getOwnPropertyDescriptor(i,r);return o?e({},o,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(a,c);d&&(u=[o,d])}}}catch(t){u=s}return r.apply(this,u)}),_patchXHR:(t,e,i)=>Xs(r.XMLHttpRequest.prototype,"open",r=>function(n,o,a,s,u){void 0===a&&(a=!0);var l=this,h=new Headers,c=wd(o);c&&kd(t,e,i,c,h);var d=r.call(l,n,o,a,s,u);return pd.forEach(t=>{var e=h.get(t);if(e)try{l.setRequestHeader(t,e)}catch(t){}}),d})};h.__PosthogExtensions__.tracingHeadersPatchFns=_d,h.postHogTracingHeadersPatchFns=_d,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var r=this.length-1;r>=0;r--){var i=this[r];if(t.call(e,i,r,this))return i}},writable:!0,enumerable:!1,configurable:!0});var Sd=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}},xd=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Cd=t=>{if("loading"===document.readyState)return"loading";var e=xd();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Md=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Td=t=>{var e="";try{for(;9!==(null==(r=t)?void 0:r.nodeType);){var r,i,n=t,o=n.id?"#"+n.id:[Md(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(e.length+o.length>99)return e||o;if(e=e?o+">"+e:o,n.id)break;t=n.parentNode}}catch(t){}return e},Id=new WeakMap;function Rd(t,e){var r=Id.get(e);return r||Id.set(e,r=new WeakMap),r.get(t)||r.set(t,new e),r.get(t)}var Ad,Ed=-1,Ld=()=>Ed,Od=t=>{addEventListener("pageshow",e=>{e.persisted&&(Ed=e.timeStamp,t(e))},!0)},Dd=(t,e,r,i)=>{var n,o;return a=>{e.value>=0&&(a||i)&&((o=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Pd=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Fd=()=>{var t,e;return null!==(t=null==(e=xd())?void 0:e.activationStart)&&void 0!==t?t:0},Nd=-1,qd=new Set,jd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Bd=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of qd)e();isFinite(Nd)||(Nd="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Bd,!0))}},Hd=function(t){if(void 0===t&&(t=!1),t&&(Nd=1/0),0>Nd){var e,r,i=Fd();Nd=null!==(e=document.prerendering||null==(r=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=i))?void 0:r.startTime)&&void 0!==e?e:jd(),addEventListener("visibilitychange",Bd,!0),addEventListener("prerenderingchange",Bd,!0),Od(()=>{setTimeout(()=>{Nd=jd()})})}return{get firstHiddenTime(){return Nd},onHidden(t){qd.add(t)}}},$d=function(t,e,r,i,n,o,a){void 0===e&&(e=-1),void 0===i&&(i=0);var s=xd(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>Ld()?s&&(document.prerendering||Fd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:o||(null==s?void 0:s.name),navigationStartTime:a||0}},Ud=function(t,r,i){void 0===i&&(i={});try{var n=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(n.length>0){var o=new PerformanceObserver(t=>{queueMicrotask(()=>{var e=t.getEntries();n.length>1&&e.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),r(e)})});for(var a of n)o.observe(e({type:a,buffered:!0},i));return o}}catch(t){}},zd=t=>{var e,r;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(r=globalThis.PerformanceSoftNavigation)||null==(r=r.prototype)?void 0:r.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Wd=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Vd=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Zd=class{constructor(){this.u=void 0}},Gd=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Qd=[1800,3e3],Jd=function(t,e){void 0===e&&(e={});var r=zd(e);Gd(()=>{var i,n=Rd(e,Zd),o=Hd(),a=$d("FCP"),s=Ud(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),o.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Fd(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,i(!0)))});s&&(i=Dd(t,a,Qd,e.reportAllChanges),Od(r=>{a=$d("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ld()),i=Dd(t,a,Qd,e.reportAllChanges),Pd(()=>{a.value=performance.now()-r.timeStamp,i(!0)})})),r&&Ud(["soft-navigation"],r=>{r.forEach(r=>{n.u&&r.navigationId&&Wd(n.u,r),a=$d("FCP",Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0),"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Dd(t,a,Qd,e.reportAllChanges))(!0)})},e)})},Kd=[.1,.25],Xd=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],Yd=function(t,e){void 0===e&&(e={});var r=Rd(e=Object.assign({},e),Sd),i=new WeakMap;r.t=t=>{var r;if(null!=t&&null!=(r=t.sources)&&r.length){var n=Xd(t.sources),o=null==n?void 0:n.node;if(o){var a,s=null!==(a=null==e.generateTarget?void 0:e.generateTarget(o))&&void 0!==a?a:Td(o);i.set(n,s)}}},function(t,e){void 0===e&&(e={});var r=Hd();Jd(Vd(()=>{var i,n=$d("CLS",0),o=Rd(e,Sd),a=(r,a,s,u,l)=>{n=$d("CLS",0,r,a,s,u,l),o.o=0,i=Dd(t,n,Kd,e.reportAllChanges)},s=function(t){void 0===t&&(t=!1),o.o>n.value&&(n.value=o.o,n.entries=o.i),i(t)},u=t=>{s(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},l=t=>{for(var e of t)"soft-navigation"!==e.entryType?o.l(e):u(e);s()},h=["layout-shift"];zd(e)&&h.push("soft-navigation");var c=Ud(h,l);c&&(i=Dd(t,n,Kd,e.reportAllChanges),r.onHidden(()=>{l(c.takeRecords()),i(!0)}),Od(()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Ld()),Pd(i)}),setTimeout(i))}))}(e=>{t((t=>{var e={};if(t.entries.length){var r,n=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(null!=n&&null!=(r=n.sources)&&r.length){var o=Xd(n.sources);o&&(e={largestShiftTarget:i.get(o),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:o,largestShiftEntry:n,loadState:Cd(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},tv=function(t,e){void 0===e&&(e={});var r=Rd(e=Object.assign({},e),Zd);zd(e)&&(r.u=new Map),Jd(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Cd(Ld())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var i=xd(),n=t.entries.at(-1);if(i){var o=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:o,firstByteToFCP:t.value-o,loadState:Cd(t.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var a,s=null==(a=r.u)?void 0:a.get(t.navigationId);s&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:s})}return Object.assign(t,{attribution:e})})(e))},e)},ev=0,rv=1/0,iv=0,nv=t=>{for(var e of t)e.interactionId&&(rv=Math.min(rv,e.interactionId),iv=Math.max(iv,e.interactionId),ev=iv?(iv-rv)/7+1:0)},ov=()=>{var t;return Ad?ev:null!==(t=performance.interactionCount)&&void 0!==t?t:0},av=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return ov()-this.h}D(){this.h=ov(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),r=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[r]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var r=this.v.at(-1),i=this.p.get(t.interactionId);if(i||10>this.v.length||t.duration>r.k){var n;if(i?t.duration>i.k?(i.entries=[t],i.k=t.duration):t.duration===i.k&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.p.set((i={id:t.interactionId,entries:[t],k:t.duration}).id,i),this.v.push(i)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10)for(var o of this.v.splice(10))this.p.delete(o.id);null==(n=this.M)||n.call(this,i)}}}},sv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Vd(t),o=-1,a=()=>{i(o),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),o=r(()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()},{timeout:e})}},uv=[200,500],lv=function(t,r){void 0===r&&(r={});var i=Rd(r=Object.assign({},r),av),n=[],o=[],a=0,s=new WeakMap,u=new WeakMap,l=!1,h=()=>{l||(sv(c),l=!0)},c=()=>{var t=new Set(i.v.map(t=>s.get(t.entries[0]))),e=o.length-10;o=o.filter((r,i)=>i>=e||t.has(r));var r=new Set;for(var u of o)for(var h of d(u.startTime,u.processingEnd))r.add(h);n=n.filter(t=>t.startTime>a||r.has(t)),l=!1};i.m=t=>{var e,i=t.startTime+t.duration;a=Math.max(a,t.processingEnd);for(var n=o.length-1;n>=0;n--){var u=o[n];if(8>=Math.abs(i-u.renderTime)){(e=u).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),r.includeProcessedEventEntries&&e.entries.push(t);break}}e||o.push(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:r.includeProcessedEventEntries?[t]:[]}),t.interactionId&&s.set(t,e),h()},i.M=t=>{if(!u.get(t)){var e,i=null==(e=t.entries.find(t=>t.target))?void 0:e.target;if(i){var n,o=null!==(n=null==r.generateTarget?void 0:r.generateTarget(i))&&void 0!==n?n:Td(i);u.set(t,o)}else{var a,s=null==(a=t.entries.find(t=>t.targetSelector))?void 0:a.targetSelector;s&&u.set(t,s)}}};var d=(t,e)=>{var r=[];for(var i of n)if(i.startTime+i.duration>=t){if(i.startTime>e)break;r.push(i)}return r};Ud(["long-animation-frame"],t=>{n=n.concat(t),h()},r),function(t,r){if(void 0===r&&(r={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Hd();Gd(()=>{var n;"interactionCount"in performance||Ad||(Ad=Ud(["event"],nv,{durationThreshold:0}));var o,a=$d("INP"),s=Rd(r,av),u=(e,i,n,u,l)=>{s.D(),a=$d("INP",-1,e,i,n,u,l),o=Dd(t,a,uv,r.reportAllChanges)},l=()=>{var t=s.S(a.navigationType);t&&t.k!==a.value&&(a.value=t.k,a.entries=t.entries,o())},h=t=>{l(),o(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=function(t,e){void 0===e&&(e=!1),sv(()=>{for(var r of t)"soft-navigation"!==r.entryType?s.l(r):h(r);l(),e&&o(!0)})},d=["event","first-input"];zd(r)&&d.push("soft-navigation");var v=Ud(d,c,e({},r,{durationThreshold:null!==(n=r.durationThreshold)&&void 0!==n?n:40}));o=Dd(t,a,uv,r.reportAllChanges),v&&(i.onHidden(()=>{c(v.takeRecords(),!0)}),Od(()=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ld())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Cd(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=s.get(r),o=Math.max(n.processingStart,r.startTime),a=Math.max(r.startTime+r.duration,o),l=Math.min(n.processingEnd,a),h=n.entries.sort((t,e)=>t.processingStart-e.processingStart),c=d(r.startTime,l),v=i.p.get(r.interactionId),f={interactionTarget:u.get(v),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:a,processedEventEntries:h,longAnimationFrameEntries:c,inputDelay:o-r.startTime,processingDuration:l-o,presentationDelay:a-l,loadState:Cd(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var r=t.interactionTime,i=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&r&&i){var n,o,a=t.inputDelay,s=t.processingDuration,u=0,l=0,h=0,c=0;for(var d of t.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&&(o=r+a>v.startTime?"input-delay":r+a+s>v.startTime?"processing-duration":"presentation-delay",n=v,c=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=r+a+s&&(h=i-y),n&&o&&(t.longestScript={entry:n,subpart:o,intersectingDuration:c}),t.totalScriptDuration=u,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=h,t.totalUnattributedDuration=i-r-u-l-h}})(f),Object.assign(t,{attribution:f})})(e))},r)},hv=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],cv=50,dv=[];Ud(["resource"],t=>{for(var e of t)dv.push(e),dv.length>cv&&dv.shift()});var vv=function(t,r){void 0===r&&(r={}),null!=(r=Object.assign({},r)).resourceBufferSize&&(cv=r.resourceBufferSize);var i=Rd(r,hv),n=new WeakMap;zd(r)&&(i.u=new Map),i.m=t=>{var e=t.element;if(e){var i,o=null!==(i=null==r.generateTarget?void 0:r.generateTarget(e))&&void 0!==i?i:Td(e);n.set(t,o)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var r=!1,i=zd(e);Gd(()=>{var n,o=Hd(),a=$d("LCP"),s=Rd(e,hv),u=(i,s,u,l,h)=>{a=$d("LCP",-1,i,s,u,l,h),n=Dd(t,a,$,e.reportAllChanges),r=!1,"soft-navigation"===i&&(o=Hd(!0))},l=t=>{s.u&&t.navigationId&&Wd(s.u,t),r||n(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))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-Fd(),0),s.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!a.navigationId)continue;if("interactionId"in v&&v.interactionId!=a.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])}o.firstHiddenTime>c&&(a.value=u,a.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=Ud(c,h);if(d){n=Dd(t,a,$,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=a.id;sv(()=>{if(!r){if(!i)for(var t of(d.disconnect(),v))removeEventListener(t,f,{capture:!0});e===a.id&&(r=!0,n(!0))}})}};for(var p of v)addEventListener(p,f,{capture:!0});Od(i=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ld()),n=Dd(t,a,$,e.reportAllChanges),Pd(()=>{a.value=performance.now()-i.timeStamp,r=!0,n(!0)})})}})}(r=>{t((t=>{var r={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var o,a,s,u,l,h,c=t.entries.at(-1),d=c.url&&(dv.findLast(t=>t.name===c.url)||performance.getEntriesByType("resource").findLast(t=>t.name===c.url));r.target=n.get(c),r.lcpEntry=c,c.url&&(r.url=c.url),d&&(r.lcpResourceEntry=d);var v=0,f=0;if("soft-navigation"!==t.navigationType?(v=null!==(o=null==(a=h=xd())?void 0:a.activationStart)&&void 0!==o?o:0,f=null!==(s=null==(u=h)?void 0:u.responseStart)&&void 0!==s?s:0):(v=t.navigationStartTime||0,h=null==(l=i.u)?void 0:l.get(t.navigationId)),h){var p=Math.max(0,f-v),g=Math.max(p,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));r=e({},r,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:r})})(r))},r)},fv=-1,pv=()=>fv,gv=t=>{addEventListener("pageshow",e=>{e.persisted&&(fv=e.timeStamp,t(e))},!0)},mv=(t,e,r,i)=>{var n,o;return a=>{e.value>=0&&(a||i)&&((o=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},yv=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},bv=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},wv=()=>{var t,e;return null!==(t=null==(e=bv())?void 0:e.activationStart)&&void 0!==t?t:0},kv=-1,_v=new Set,Sv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,xv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of _v)e();isFinite(kv)||(kv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",xv,!0))}},Cv=function(t){if(void 0===t&&(t=!1),t&&(kv=1/0),0>kv){var e,r,i=wv();kv=null!==(e=document.prerendering||null==(r=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=i))?void 0:r.startTime)&&void 0!==e?e:Sv(),addEventListener("visibilitychange",xv,!0),addEventListener("prerenderingchange",xv,!0),gv(()=>{setTimeout(()=>{kv=Sv()})})}return{get firstHiddenTime(){return kv},onHidden(t){_v.add(t)}}},Mv=function(t,e,r,i,n,o,a){void 0===e&&(e=-1),void 0===i&&(i=0);var s=bv(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>pv()?s&&(document.prerendering||wv()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:o||(null==s?void 0:s.name),navigationStartTime:a||0}},Tv=new WeakMap;function Iv(t,e){var r=Tv.get(e);return r||Tv.set(e,r=new WeakMap),r.get(t)||r.set(t,new e),r.get(t)}var Rv,Av=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}},Ev=function(t,r,i){void 0===i&&(i={});try{var n=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(n.length>0){var o=new PerformanceObserver(t=>{queueMicrotask(()=>{var e=t.getEntries();n.length>1&&e.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),r(e)})});for(var a of n)o.observe(e({type:a,buffered:!0},i));return o}}catch(t){}},Lv=t=>{var e,r;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(r=globalThis.PerformanceSoftNavigation)||null==(r=r.prototype)?void 0:r.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Ov=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Dv=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Pv=class{constructor(){this.l=void 0}},Fv=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Nv=[1800,3e3],qv=function(t,e){void 0===e&&(e={});var r=Lv(e);Fv(()=>{var i,n=Iv(e,Pv),o=Cv(),a=Mv("FCP"),s=Ev(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),o.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-wv(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,i(!0)))});s&&(i=mv(t,a,Nv,e.reportAllChanges),gv(r=>{a=Mv("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,pv()),i=mv(t,a,Nv,e.reportAllChanges),yv(()=>{a.value=performance.now()-r.timeStamp,i(!0)})})),r&&Ev(["soft-navigation"],r=>{r.forEach(r=>{n.l&&r.navigationId&&Ov(n.l,r),a=Mv("FCP",Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0),"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=mv(t,a,Nv,e.reportAllChanges))(!0)})},e)})},jv=[.1,.25],Bv=function(t,e){void 0===e&&(e={});var r=Cv();qv(Dv(()=>{var i,n=Mv("CLS",0),o=Iv(e,Av),a=(r,a,s,u,l)=>{n=Mv("CLS",0,r,a,s,u,l),o.i=0,i=mv(t,n,jv,e.reportAllChanges)},s=function(t){void 0===t&&(t=!1),o.i>n.value&&(n.value=o.i,n.entries=o.o),i(t)},u=t=>{s(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},l=t=>{for(var e of t)"soft-navigation"!==e.entryType?o.h(e):u(e);s()},h=["layout-shift"];Lv(e)&&h.push("soft-navigation");var c=Ev(h,l);c&&(i=mv(t,n,jv,e.reportAllChanges),r.onHidden(()=>{l(c.takeRecords()),i(!0)}),gv(()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,pv()),yv(i)}),setTimeout(i))}))},Hv=0,$v=1/0,Uv=0,zv=t=>{for(var e of t)e.interactionId&&($v=Math.min($v,e.interactionId),Uv=Math.max(Uv,e.interactionId),Hv=Uv?(Uv-$v)/7+1:0)},Wv=()=>{var t;return Rv?Hv:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Vv=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Wv()-this.u}M(){this.u=Wv(),this.v.length=0,this.m.clear()}L(t){var e=this._(),r=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[r]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var r=this.v.at(-1),i=this.m.get(t.interactionId);if(i||10>this.v.length||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.m.set((i={id:t.interactionId,entries:[t],P:t.duration}).id,i),this.v.push(i)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10)for(var o of this.v.splice(10))this.m.delete(o.id);null==(n=this.T)||n.call(this,i)}}}},Zv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Dv(t),o=-1,a=()=>{i(o),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),o=r(()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()},{timeout:e})}},Gv=[200,500],Qv=function(t,r){if(void 0===r&&(r={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Cv();Fv(()=>{var n;"interactionCount"in performance||Rv||(Rv=Ev(["event"],zv,{durationThreshold:0}));var o,a=Mv("INP"),s=Iv(r,Vv),u=(e,i,n,u,l)=>{s.M(),a=Mv("INP",-1,e,i,n,u,l),o=mv(t,a,Gv,r.reportAllChanges)},l=()=>{var t=s.L(a.navigationType);t&&t.P!==a.value&&(a.value=t.P,a.entries=t.entries,o())},h=t=>{l(),o(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=function(t,e){void 0===e&&(e=!1),Zv(()=>{for(var r of t)"soft-navigation"!==r.entryType?s.h(r):h(r);l(),e&&o(!0)})},d=["event","first-input"];Lv(r)&&d.push("soft-navigation");var v=Ev(d,c,e({},r,{durationThreshold:null!==(n=r.durationThreshold)&&void 0!==n?n:40}));o=mv(t,a,Gv,r.reportAllChanges),v&&(i.onHidden(()=>{c(v.takeRecords(),!0)}),gv(()=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,pv())}))})}},Jv=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},Kv=[2500,4e3],Xv=function(t,e){void 0===e&&(e={});var r=!1,i=Lv(e);Fv(()=>{var n,o=Cv(),a=Mv("LCP"),s=Iv(e,Jv),u=(i,s,u,l,h)=>{a=Mv("LCP",-1,i,s,u,l,h),n=mv(t,a,Kv,e.reportAllChanges),r=!1,"soft-navigation"===i&&(o=Cv(!0))},l=t=>{s.l&&t.navigationId&&Ov(s.l,t),r||n(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))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-wv(),0),s.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!a.navigationId)continue;if("interactionId"in v&&v.interactionId!=a.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])}o.firstHiddenTime>c&&(a.value=u,a.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=mv(t,a,Kv,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=a.id;Zv(()=>{if(!r){if(!i)for(var t of(d.disconnect(),v))removeEventListener(t,f,{capture:!0});e===a.id&&(r=!0,n(!0))}})}};for(var p of v)addEventListener(p,f,{capture:!0});gv(i=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,pv()),n=mv(t,a,Kv,e.reportAllChanges),yv(()=>{a.value=performance.now()-i.timeStamp,r=!0,n(!0)})})}})},Yv={onLCP:vv,onCLS:Yd,onFCP:tv,onINP:lv,withoutAttribution:{onLCP:Xv,onCLS:Bv,onFCP:qv,onINP:Qv}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Yv,h.__PosthogExtensions__.postHogWebVitalsCallbacks=Yv,h.postHogWebVitalsCallbacks=Yv;var tf={onLCP:Xv,onCLS:Bv,onFCP:qv,onINP:Qv};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=tf,h.__PosthogExtensions__.postHogWebVitalsCallbacks=tf,h.postHogWebVitalsCallbacks=tf,h.__PosthogExtensions__.loadWebVitalsCallbacks=()=>tf;var ef={onLCP:vv,onCLS:Yd,onFCP:tv,onINP:lv,withoutAttribution:{onLCP:Xv,onCLS:Bv,onFCP:qv,onINP:Qv}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=ef,h.__PosthogExtensions__.postHogWebVitalsCallbacks=ef,h.postHogWebVitalsCallbacks=ef;var rf={onLCP:Xv,onCLS:Bv,onFCP:qv,onINP:Qv};function nf(t,e){return e.length>t?e.slice(0,t)+"...":e}function of(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ue(e));return e}function af(t,i){var n,o,a=i.e,s=i.maskAllElementAttributes,u=i.maskAllText,l=i.elementAttributeIgnoreList,h=i.elementsChainAsString,c=i.disableCaptureUrlHashes;if(!ue(t))return{props:{}};for(var d=[t],v=new Set([t]),f=t;f.parentNode&&!le(f,"body")&&1e3>d.length;)if(he(f.parentNode)){var p=f.parentNode.host;if(v.has(p))break;v.add(p),d.push(p),f=p}else{if(!ue(f.parentNode))break;if(v.has(f.parentNode))break;v.add(f.parentNode),d.push(f.parentNode),f=f.parentNode}var g,m,y,b=[],w={},k=!1,_=!1;if(ee(d,t=>{var e=be(t);if(le(t,"a")){var r=t.getAttribute("href");k=!!(e&&r&&Ie(r))&&(c?Rt(r):r)}q(de(t),"ph-no-capture")&&(_=!0),b.push(function(t,e,r,i,n){void 0===n&&(n=!1);var o=t.tagName.toLowerCase(),a={tag_name:o};fe.indexOf(o)>-1&&!r&&(a.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?nf(1024,Re(t)):nf(1024,ve(t)));var s=de(t);s.length>0&&(a.classes=s.filter(function(t){return""!==t})),ee(t.attributes,function(r){var o;if((!we(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Ie(r.value)&&(!J(o=r.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){var s=r.value;"class"===r.name&&(s=ce(s).join(" ")),a["attr__"+r.name]=nf(1024,"href"===r.name&&n?Rt(s):s)}});for(var u=1,l=1,h=t;h=of(h);)u++,h.tagName===t.tagName&&l++;return a.nth_child=u,a.nth_of_type=l,a}(t,s,u,l,c)),ee(function(t){if(!be(t))return{};var e={};return ee(t.attributes,function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Ie(i)&&(e[r]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(w,e)||(w[e]=t)})}),_)return{props:{},explicitNoCapture:_};if(u||(b[0].$el_text=le(t,"a")||le(t,"button")?Re(t):ve(t)),k){var S,x;b[0].attr__href=k;var C=null==(S=ae(k))?void 0:S.host,M=null==r||null==(x=r.location)?void 0:x.host;C&&M&&C!==M&&(g=k)}return{props:re((m=a.type,{$event_type:m,$ce_version:1}),h?{}:{$elements:b},{$elements_chain:(y=b,V(y)?function(t){return t.map(t=>{var r,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var a=e({},t.text?{text:t.text}:{},{"nth-child":null!==(r=t.nth_child)&&void 0!==r?r:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),s={};return ie(a).sort((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0])).forEach(t=>{var e=t[1];return s[Ee(t[0].toString())]=Ee(e.toString())}),(n+=":")+ie(s).map(t=>t[0]+'="'+t[1]+'"').join("")}).join(";")}(function(t){return t.map(t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Le(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ie(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>i.attributes[t[0]]=t[1]),i})}(y)):"")},null!=(n=b[0])&&n.$el_text?{$el_text:null==(o=b[0])?void 0:o.$el_text}:{},g&&"click"===a.type?{$external_click_url:g}:{},w)}}h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=rf,h.__PosthogExtensions__.postHogWebVitalsCallbacks=rf,h.postHogWebVitalsCallbacks=rf,h.__PosthogExtensions__.loadWebVitalsCallbacks=()=>rf,te("[AutoCapture]");var sf={};function uf(t,r){var i=function(t){var e;return Q(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}(t);return i?e({node:i,originalEvent:t,timestamp:Date.now()},r):null}function lf(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function hf(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var cf="canvas,video,audio,embed,object";function df(t,e){return tt(t)&&t>=e}function vf(t){return t>=0&&1e3>t?t:void 0}function ff(t,e){return e?vf(t-e):void 0}var pf=class{Yi(t){var e,r,i,n,o,a,s,u,l=this.tn((null==t?void 0:t.__onCapture)||this.en.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:l.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:l.capture_dead_swipes,swipe_threshold_px:null!==(s=null==t?void 0:t.swipe_threshold_px)&&void 0!==s?s:l.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(u=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==u?u:l.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(t,e){this.instance=t,this.rn=[],this.nn=0,this.tn=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.an=t=>{var e=uf(t,{type:"click"});X(e)||this.sn(e)||this.un(e),this.ln()},this.hn=()=>{var t=Date.now();this.cn=t,t%50==0&&this.rn.forEach(e=>{Q(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.dn=()=>{this.vn=Date.now()},this.Ze=()=>{var t=Date.now();this.fn=t,this.pn("visibilityChangedDelayMs",t)},this.gn=()=>{var t=Date.now();this.mn=t,this.pn("focusChangedDelayMs",t)},this.yn=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[0]:void 0;this.bn=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.wn=()=>{this.bn=void 0},this.kn=t=>{var e,r=this.bn;if(this.bn=void 0,!Q(r)&&this._n.max_dead_swipes_per_page_load>this.nn){var i=t,n=null==(e=i.changedTouches)?void 0:e[0];if(n){var o=n.clientX-r.x,s=n.clientY-r.y,u=o*o+s*s,l=this._n.swipe_threshold_px;if(u>=l*l&&![this.cn,this.Sn,this.vn].some(t=>tt(t)&&t>=r.timestamp)){var h;if(this.xn()&&(null!==(h=null==a||null==a.elementsFromPoint?void 0:a.elementsFromPoint(r.x,r.y))&&void 0!==h?h:[]).some(t=>null==t.matches?void 0:t.matches(cf)))return;var c=uf(i,{type:"swipe",swipeDirection:lf(o,s),swipeDistancePx:Math.round(Math.sqrt(u))});X(c)||this.sn(c)||this.un(c),this.ln()}}}},this._n=this.Yi(e),this._onCapture=this._n.__onCapture}start(t){this.Cn(),this.Mn(),this.Tn(),this.In(),this.Rn(),this.An(t),this._n.capture_dead_swipes&&this.En()}An(t){if(!this.Ln){var e=function(t){return function(t,e){var i=sf[t];if(i)return i;var n=e[t];if((t=>Z(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==r||!r.Zone))return sf[t]=n.bind(e);var o=e.document;if(o&&Z(o.createElement)){var a,s=!1;try{(a=o.createElement("iframe")).hidden=!0,o.head.appendChild(a);var u,l,h=a.contentWindow;h&&h[t]&&(n=h[t],"MutationObserver"===t&&function(t){return q(t,"AppleWebKit")&&!q(t,"Chrome")}(null!==(u=null==(l=e.navigator)?void 0:l.userAgent)&&void 0!==u?u:"")&&(a.classList.add("rr-block","ph-no-capture"),s=!0))}catch(e){Yt.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var c;!s&&null!=(c=a)&&c.parentNode&&a.parentNode.removeChild(a)}}return n&&Z(n)?sf[t]=n.bind(e):n}("MutationObserver",t)}(h);this.Ln=new e(t=>{this.On(t)}),this.Ln.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Ln)||t.disconnect(),this.Ln=void 0,h.removeEventListener("click",this.an),h.removeEventListener("scroll",this.hn,{capture:!0}),h.removeEventListener("selectionchange",this.dn),h.removeEventListener("touchstart",this.yn,{capture:!0}),h.removeEventListener("touchend",this.kn,{capture:!0}),h.removeEventListener("touchcancel",this.wn,{capture:!0}),null==a||a.removeEventListener("visibilitychange",this.Ze),h.removeEventListener("blur",this.gn),h.removeEventListener("focus",this.gn),this.bn=void 0}On(t){this.Sn=Date.now()}Cn(){ne(h,"click",this.an)}un(t){t.visibilityChangedDelayMs=ff(t.timestamp,this.fn),t.focusChangedDelayMs=ff(t.timestamp,this.mn),this.rn.push(t)}ln(){this.rn.length&&Q(this.Dn)&&(this.Dn=h.setTimeout(()=>{this.Pn()},1e3))}Mn(){ne(h,"scroll",this.hn,{capture:!0})}Tn(){ne(h,"selectionchange",this.dn)}In(){ne(a,"visibilitychange",this.Ze)}Rn(){ne(h,"blur",this.gn),ne(h,"focus",this.gn)}pn(t,e){this.rn.forEach(r=>{var i=vf(e-r.timestamp);tt(i)&&(Q(r[t])||r[t]>i)&&(r[t]=i)})}En(){ne(h,"touchstart",this.yn,{capture:!0,passive:!0}),ne(h,"touchend",this.kn,{capture:!0,passive:!0}),ne(h,"touchcancel",this.wn,{capture:!0,passive:!0})}xn(){var t=Q(this.Fn)||tt(this.Sn)&&this.Sn>this.Fn;return(Q(this.Nn)||t)&&(this.Fn=Date.now(),this.Nn=!(null==a||!a.querySelector(cf))),!!this.Nn}sn(t){return!t||("swipe"===t.type?this.qn(t):this.jn(t))}qn(t){return!(!((e=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||null!=e.closest&&e.closest(".toolbar-global-fade-container")))&&!this.rn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!le(t.node,"html")&&ue(t.node)&&function(t,e){var i;if(!r||me(t))return!1;var n=et(e)?ge:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ge;return!function(t,e){if(Q(e))return!0;var r,i=function(t){if(e.some(e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e)))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}(ye(t,!1).targetElementList,n)}(t.node,{css_selector_ignorelist:this._n.css_selector_ignorelist}));var e}jn(t){return!(this._n.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.qn(t)||(i=t.node,!(!r||me(i))&&ye(i,!1).targetElementList.some(t=>le(t,"a")));var e,i}Pn(){if(this.rn.length){clearTimeout(this.Dn),this.Dn=void 0;var t=this.rn;for(var e of(this.rn=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Sn&&this.Sn>=e.timestamp?this.Sn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.vn&&this.vn>=e.timestamp?this.vn-e.timestamp:void 0;var i=df(e.scrollDelayMs,this._n.scroll_threshold_ms),n=df(e.selectionChangedDelayMs,this._n.selection_change_threshold_ms),o=df(e.mutationDelayMs,this._n.mutation_threshold_ms),a=df(e.absoluteDelayMs,1.1*this._n.mutation_threshold_ms),s=tt(e.scrollDelayMs)&&this._n.scroll_threshold_ms>e.scrollDelayMs,u=tt(e.mutationDelayMs)&&this._n.mutation_threshold_ms>e.mutationDelayMs,l=tt(e.selectionChangedDelayMs)&&this._n.selection_change_threshold_ms>e.selectionChangedDelayMs,h=tt(e.visibilityChangedDelayMs),c=tt(e.focusChangedDelayMs);if(!(s||u||l||h||c))if(i||o||a||n){var d=hf(e);if("$dead_swipe"===d){if(this.nn>=this._n.max_dead_swipes_per_page_load)continue;this.nn++}this._onCapture(e,{[d+"_last_mutation_timestamp"]:this.Sn,[d+"_event_timestamp"]:e.timestamp,[d+"_scroll_timeout"]:i,[d+"_mutation_timeout"]:o,[d+"_absolute_timeout"]:a,[d+"_selection_changed_timeout"]:n,[d+"_visibility_changed_timeout"]:!1})}else this._n.mutation_threshold_ms>e.absoluteDelayMs&&this.rn.push(e)}this.ln()}}en(t,r){var i=hf(t);this.instance.capture(i,e({},r,af(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._n.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[i+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new pf(t,e)}()}();
|
|
1
|
+
!function(){var t=["type"];function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},e.apply(null,arguments)}function r(t,e,r,i,n,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(i,n)}function i(t){return function(){var e=this,i=arguments;return new Promise(function(n,o){var a=t.apply(e,i);function s(t){r(a,n,o,s,u,"next",t)}function u(t){r(a,n,o,s,u,"throw",t)}s(void 0)})}}!function(){var r="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:r,o=null==n?void 0:n.navigator,a=null==n?void 0:n.document,s=null==n?void 0:n.location;null!=n&&n.XMLHttpRequest&&new n.XMLHttpRequest;var u=null==o?void 0:o.userAgent,l="undefined"!=typeof globalThis?globalThis:r;l&&"undefined"==typeof self&&(l.self=l),l&&"undefined"==typeof File&&(l.File=function(){});var h=null!=r?r:{},c="$session_recording_remote_config",d="$replay_sample_rate",v="$replay_override_sampling",f="$replay_override_linked_flag",p="$replay_override_url_trigger",g="$replay_override_event_trigger",m="$session_is_sampled",y="$session_past_minimum_duration",b="$session_recording_url_trigger_activated_session",w="$session_recording_event_trigger_activated_session",k="$posthog_sr_group_event_trigger_",_="$posthog_sr_group_url_trigger_",S="$posthog_sr_group_sampling_",x="$debug_first_full_snapshot_timestamp",C="$sess_rec_flush_size",M="$stored_person_properties",T="$surveys",I="$sdk_debug_replay_event_trigger_status",R="$sdk_debug_replay_linked_flag_trigger_status",A="$sdk_debug_replay_matched_recording_trigger_groups",E="$sdk_debug_replay_pending_trigger_conditions",L="$sdk_debug_replay_remote_trigger_matching_config",O="$sdk_debug_replay_trigger_groups_count",D="$sdk_debug_replay_url_trigger_status",P="$sdk_debug_rrweb_attached",F="$sdk_debug_rrweb_start_attempted",N="$session_recording_start_reason";function q(t,e){return-1!==t.indexOf(e)}var j=function(t){return t.trim()},B="min_length",H="max_length",U=Object.prototype,z=U.hasOwnProperty,W=U.toString,V=Array.isArray||function(t){return"[object Array]"===W.call(t)},Z=t=>"function"==typeof t,G=t=>t===Object(t)&&!V(t),Q=t=>void 0===t,J=t=>"[object String]"==W.call(t),K=t=>J(t)&&0===t.trim().length,X=t=>null===t,Y=t=>Q(t)||X(t),tt=t=>"[object Number]"==W.call(t)&&t==t,et=t=>"[object Boolean]"===W.call(t),rt=t=>t instanceof FormData;function it(t){return null===t||"object"!=typeof t}function nt(t,e){return{}.toString.call(t)==="[object "+e+"]"}function ot(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return st(t,Error)}}function at(t){return"u">typeof Event&&st(t,Event)}function st(t,e){try{return t instanceof e}catch(t){return!1}}function ut(t,e,r,i,n){return e>r&&(i.warn("min cannot be greater than max."),e=r),tt(t)?t>r?(i.warn(" cannot be greater than max: "+r+". Using max value instead."),r):e>t?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(i.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+n),ut(null!=n?n:r,e,r,i))}var lt=class{constructor(t){this.C={},this.I=t.I,this.R=ut(t.bucketSize,0,100,t.A),this.O=ut(t.refillRate,0,this.R,t.A),this.F=ut(t.refillInterval,0,864e5,t.A)}N(t,e){var r=Math.floor((e-t.lastAccess)/this.F);r>0&&(t.tokens=Math.min(t.tokens+r*this.O,this.R),t.lastAccess=t.lastAccess+r*this.F)}consumeRateLimit(t){var e,r=Date.now(),i=String(t),n=this.C[i];return n?this.N(n,r):this.C[i]=n={tokens:this.R,lastAccess:r},0===n.tokens||(n.tokens--,0===n.tokens&&(null==(e=this.I)||e.call(this,t)),0===n.tokens)}stop(){this.C={}}},ht="Mobile",ct="Tablet",dt="Android Tablet",vt="iPad",ft="Apple Watch",pt="Nintendo",gt="PlayStation",mt="Xbox",yt="Nokia",bt="Ouya",wt="Generic "+ht.toLowerCase(),kt="Generic "+ct.toLowerCase(),_t=new RegExp(mt,"i"),St=new RegExp("PlayStation \\w+","i"),xt=new RegExp("Nintendo \\w+","i"),Ct=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(pt,"i"),new RegExp(gt,"i"),new RegExp("Windows","i");var Mt,Tt,It;function Rt(t){return t?t.split("#")[0]:t}function At(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return It&&r.length===Tt?It:(Tt=r.length,It=r.reduce((r,i)=>{Mt||(Mt={});var n=Mt[i];if(n)r[n[0]]=n[1];else for(var o=t(i),a=o.length-1;a>=0;a--){var s,u=null==(s=o[a])?void 0:s.filename,l=e[i];if(u&&l){r[u]=l,Mt[i]=[u,l];break}}return r},{}))}}function Et(t,e,r,i,n){var o={platform:t,filename:e,function:"<anonymous>"===r?"?":r,in_app:!!e&&!e.startsWith("webkit-masked-url://")&&"<anonymous>"!==e};return Q(i)||(o.lineno=i),Q(n)||(o.colno=n),o}var Lt=(t,e)=>{var r=-1!==t.indexOf("safari-extension"),i=-1!==t.indexOf("safari-web-extension");return r||i?[-1!==t.indexOf("@")?t.split("@")[0]:"?",r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},Ot=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Dt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Pt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ft=(t,e)=>{var r=Ot.exec(t);if(r)return Et(e,r[1],"?",+r[2],+r[3]);var i=Dt.exec(t);if(i){if(i[2]&&0===i[2].indexOf("eval")){var n=Pt.exec(i[2]);n&&(i[2]=n[1],i[3]=n[2],i[4]=n[3])}var o=Lt(i[1]||"?",i[2]);return Et(e,o[1],o[0],i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},Nt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,qt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,jt=(t,e)=>{var r=Nt.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var i=qt.exec(r[3]);i&&(r[1]=r[1]||"eval",r[3]=i[1],r[4]=i[2],r[5]="")}var n=r[3],o=r[1]||"?",a=Lt(o,n);return Et(e,n=a[1],o=a[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Bt=/\(error: (.*)\)/;var Ht=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,$t=["fatal","error","warning","log","info","debug"];function Ut(t,e){void 0===e&&(e=40);var r=Object.keys(t);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(e>=n.length)return i===r.length?n:n.length>e?n.slice(0,e)+"...":n}return""}var zt,Wt="NativeGzipValidationError",Vt=t=>{throw function(t,e){var r=new Error(e);try{Object.defineProperty(r,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return r}(Wt,"Native gzip produced invalid output: "+t)},Zt=function(){var t=i(function*(t,e){18>t.size&&Vt("too-short");var r,i=new Uint8Array(yield t.slice(0,10).arrayBuffer());(2>(r=i).length||31!==r[0]||139!==r[1]||8!==i[2])&&Vt("invalid-header");var n=new DataView(yield t.slice(t.size-8).arrayBuffer());n.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(zt)return zt;zt=[];for(var t=0;256>t;t++){for(var e=t,r=0;8>r;r++)e=1&e?3988292384^e>>>1:e>>>1;zt[t]=e>>>0}return zt})(),r=4294967295,i=0;t.length>i;i++)r=e[255&(r^t[i])]^r>>>8;return(4294967295^r)>>>0})(e)&&Vt("invalid-crc");var o=e.length>>>0;n.getUint32(4,!0)!==o&&Vt("invalid-size")});return function(e,r){return t.apply(this,arguments)}}();function Gt(){return Gt=i(function*(t,e,r){void 0===e&&(e=!0);try{var n=(new TextEncoder).encode(t),o=new globalThis.CompressionStream("gzip"),a=o.writable.getWriter(),s=a.write(n).then(()=>a.close()).catch(function(){var t=i(function*(t){try{yield a.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),u=new Response(o.readable).blob(),l=(yield Promise.all([u,s]))[0];return yield Zt(l,n),l}catch(t){if(null!=r&&r.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),Gt.apply(this,arguments)}function Qt(t,e){var r;if(t)return null==(r=t.find(t=>t.type===e))?void 0:r.value}var Jt="0.8.1",Kt={DEBUG:!1,LIB_VERSION:Jt,LIB_NAME:"browser-common",JS_SDK_VERSION:Jt},Xt=function(t,e){var i=(void 0===e?{}:e).debugEnabled,n={q(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r&&(Kt.DEBUG||r.POSTHOG_DEBUG||i)&&!Q(r.console)&&r.console&&("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e])(t,...o)},debug(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];n.q("error",...e)},critical(){for(var e=arguments.length,r=new Array(e),i=0;e>i;i++)r[i]=arguments[i];console.error(t,...r)},uninitializedWarning(t){n.error("You must initialize PostHog before calling "+t)},createLogger:(e,r)=>Xt(t+" "+e,r)};return n},Yt=Xt("[PostHog.js]"),te=Yt.createLogger;function ee(t,e){if(!Y(t))if(V(t))t.forEach(e);else if(rt(t))t.forEach((t,r)=>e(t,r));else for(var r in t)z.call(t,r)&&e(t[r],r)}var re=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;e>i;i++)r[i-1]=arguments[i];for(var n of r)for(var o in n)void 0!==n[o]&&(t[o]=n[o]);return t};function ie(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i}function ne(t,e,r,i){var n=null!=i?i:{},o=n.capture,a=n.passive;null==t||t.addEventListener(e,r,{capture:void 0!==o&&o,passive:void 0===a||a})}var oe=["localhost","127.0.0.1"],ae=t=>{var e=null==a?void 0:a.createElement("a");return Q(e)?null:(e.href=t,e)};function se(t){var e,i=null==r||null==(e=r.location)?void 0:e.href;return Q(i)?void 0:function(t,e){var r,i=null==t||null==(r=t.config)?void 0:r.get_current_url;if(!Z(i))return e;try{var n=i(e);return J(n)&&n?n:e}catch(t){return Yt.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,i)}function ue(t){return!!t&&1===t.nodeType}function le(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function he(t){return!!t&&11===t.nodeType&&ue(t.host)}function ce(t){return t?j(t).split(/\s+/):[]}function de(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return ce(e)}function ve(t){var e="";return be(t)&&!we(t)&&t.childNodes&&t.childNodes.length&&ee(t.childNodes,function(t){var r;(function(t){return!!t&&3===t.nodeType})(t)&&t.textContent&&(e+=null!==(r=function(t){return Y(t)?null:j(t).split(/(\s+)/).filter(t=>Ie(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}(t.textContent))&&void 0!==r?r:"")}),j(e)}var fe=["a","button","form","input","select","textarea","label"];function pe(t){var e=t.parentNode;return!(!e||!ue(e))&&e}var ge=[".ph-no-deadclick",".ph-no-capture"];var me=t=>!t||le(t,"html")||!ue(t),ye=(t,e)=>{if(!r||me(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,n=[t],o=t;o.parentNode&&!le(o,"body");)if(he(o.parentNode))n.push(o.parentNode.host),o=o.parentNode.host;else{var a=pe(o);if(!a)break;if(e||fe.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var s=r.getComputedStyle(a);s&&"pointer"===s.getPropertyValue("cursor")&&(i=!0)}catch(t){}n.push(a),o=a}return{parentIsUsefulElement:i,targetElementList:n}};function be(t){for(var e=new Set,r=0,i=t;i.parentNode&&!le(i,"body");i=i.parentNode){if(r++>=1e3||e.has(i))return!1;e.add(i);var n=de(i);if(q(n,"ph-sensitive")||q(n,"ph-no-capture"))return!1}if(q(de(t),"ph-include"))return!0;var o=t.type||"";if(J(o))switch(o.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!J(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function we(t){return!!(le(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||le(t,"select")||le(t,"textarea")||"true"===t.getAttribute("contenteditable"))}var ke=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}))$"),_e=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,Se=[16,15,14,13],xe=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),Ce=new RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),Me=/[0-9A-Za-z_]/;function Te(t){for(var e=0,r=!1,i=t.length-1;i>=0;i--){var n=t.charCodeAt(i)-48;r&&(n*=2)>9&&(n-=9),e+=n,r=!r}return e%10==0}function Ie(t,e){if(void 0===e&&(e=!0),Y(t))return!1;if(J(t)){if(t=j(t),e?ke.test((t||"").replace(/[- ]/g,"")):function(t){var e;for(_e.lastIndex=0;e=_e.exec(t);){var r=e[2];if(r)for(var i=r.replace(/[- ]/g,""),n=0;i.length>n;n++)for(var o of Se){var a=n+o;if(i.length>=a){var s=i.slice(n,a);if(ke.test(s)&&Te(s))return!0}}}return!1}(t))return!1;if(e?xe.test(t):function(t){var e;for(Ce.lastIndex=0;e=Ce.exec(t);){var r=e[1],i=e[3];if(!(r&&i&&Me.test(r)&&Me.test(i)))return!0}return!1}(t))return!1}return!0}function Re(t){var e=ve(t);return Ie(e=(e+" "+Ae(t)).trim())?e:""}function Ae(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ee(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var i=ve(t);e=(e+" "+i).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ae(t)).trim())}catch(t){Yt.error("[AutoCapture]",t)}}),e}function Ee(t){return t.replace(/"|\\"/g,'\\"')}function Le(t){var e=t.attr__class;if(e)return V(e)?e:ce(e)}var Oe=1e6;function De(t){var e;return Math.min(Oe,null!==(e=t.payloadSizeLimitBytes)&&void 0!==e?e:1e6)}var Pe={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:t=>t,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:Oe,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},Fe=["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"],Ne=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],qe=["auth","token","secret","session","api-key","apikey","api_key","credential","password","passwd","cookie","csrf","xsrf"],je=t=>{Y(t)||ee(Object.keys(t),e=>{(t=>{var e=t.toLowerCase();return Fe.includes(e)||qe.some(t=>e.includes(t))})(e)&&(t[e]="redacted")})},Be=["/s/","/e/","/i/"];function He(t,e,r,i){if(Y(t))return t;var n=(null==e?void 0:e["content-length"])||function(t){return new Blob([t]).size}(t);return J(n)&&(n=parseInt(n)),n>r?"[SessionRecording] "+i+" body too large to record ("+n+" bytes)":t}function $e(t,e){if(Y(t))return t;var r=t;return Ie(r,!1)||(r="[SessionRecording] "+e+" body redacted"),ee(Ne,t=>{var i,n;null!=(i=r)&&i.length&&-1!==(null==(n=r)?void 0:n.indexOf(t))&&(r="[SessionRecording] "+e+" body redacted as might contain: "+t)}),r}var Ue=new WeakSet,ze="disabled",We="sampled",Ve="active",Ze="buffering",Ge="paused",Qe="rrweb_error",Je="trigger_activated",Ke="trigger_pending",Xe="trigger_disabled";function Ye(t,e,r,i,n,o){return 0===e?Xe:(null==t?void 0:t.get_property(r?i+r:n))===o?Je:Ke}function tr(t,e,r){return e.some(e=>{var i;return"regex"===e.matching&&(null!==(i=null==r?void 0:r.get(e.url))&&void 0!==i?i:new RegExp(e.url)).test(t)})}function er(t){return t.includes("trigger_activated")?Je:t.includes("trigger_pending")?Ke:Xe}function rr(t){var e=new Set(t);switch(e.delete(Xe),e.size){case 0:return Xe;case 1:return Array.from(e)[0];default:return Ke}}var ir=class{constructor(t){this.j=t}triggerStatus(t){return er(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return er(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},nr=class{constructor(t){this.j=t}triggerStatus(t){return rr(this.j.map(e=>e.triggerStatus(t)))}triggerStatusNoSideEffects(t){return rr(this.j.map(e=>e.triggerStatusNoSideEffects(t)))}stop(){this.j.forEach(t=>t.stop())}},or=class{triggerStatus(){return this.triggerStatusNoSideEffects()}triggerStatusNoSideEffects(){return Je}stop(){}},ar=t=>"sessionRecording"in t,sr=class{constructor(t,e){this._instance=t,this.B=[],this.H=[],this.$=new Map,this.U=new Map,this.W="",this.urlBlocked=!1,this.V=e}onConfig(t){var e,r;this.B=(ar(t)?G(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.urlTriggers:[]:null==t?void 0:t.urlTriggers)||[],this.H=(ar(t)?G(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.urlBlocklist:[]:null==t?void 0:t.urlBlocklist)||[],this.Z()}Z(){for(var t of(this.$.clear(),this.U.clear(),this.B))if("regex"===t.matching&&!this.$.has(t.url))try{this.$.set(t.url,new RegExp(t.url))}catch(e){Yt.error("Invalid URL trigger regex pattern:",t.url,e)}for(var e of this.H)if("regex"===e.matching&&!this.U.has(e.url))try{this.U.set(e.url,new RegExp(e.url))}catch(t){Yt.error("Invalid URL blocklist regex pattern:",e.url,t)}}onRemoteConfig(t){this.onConfig(t)}G(t){return Ye(this._instance,this.B.length,this.V,_,b,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[D]:e}),e}triggerStatusNoSideEffects(t){return this.G(t)}isCurrentUrlBlocked(){var t=se(this._instance);if(!t)return!1;try{return tr(t,this.H,this.U)}catch(t){return!0}}checkUrlBlocklist(t,e){var r=se(this._instance);if(r&&r!==this.W){this.W=r;var i=this.urlBlocked,n=tr(r,this.H,this.U);i&&n||(n&&!i?t():!n&&i&&e())}}checkUrlTriggerConditions(t,e,r,i){var n=se(this._instance);if(n&&n!==this.W){this.W=n;var o=this.urlBlocked,a=tr(n,this.H,this.U);a&&!o?t():!a&&o&&e();var s=this.G(i)===Je,u=tr(n,this.B,this.$);!s&&u&&r("url",n)}}stop(){this.W=""}},ur=class{constructor(t){this._instance=t,this.linkedFlag=null,this.linkedFlagSeen=!1,this.J=()=>{}}triggerStatus(){var t=this.triggerStatusNoSideEffects();return this._instance.register_for_session({[R]:t}),t}triggerStatusNoSideEffects(){var t=Ke;return Y(this.linkedFlag)&&(t=Xe),this.linkedFlagSeen&&(t=Je),t}onConfig(t,e){var r;if(this.linkedFlag=(ar(t)?G(t.sessionRecording)?null==(r=t.sessionRecording)?void 0:r.linkedFlag:null:null==t?void 0:t.linkedFlag)||null,!Y(this.linkedFlag)&&!this.linkedFlagSeen){var i=J(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=J(this.linkedFlag)?null:this.linkedFlag.variant;this.J=this._instance.onFeatureFlags((t,r)=>{var o=!1;if(G(r)&&i in r){var a=r[i];o=et(a)?!0===a:n?a===n:!!a}var s=o&&!this.linkedFlagSeen;this.linkedFlagSeen=o,s&&e(i,n)})}}onRemoteConfig(t,e){this.onConfig(t,e)}stop(){this.J()}},lr=class{constructor(t,e){this._instance=t,this.K=[],this.V=e}onConfig(t){var e;this.K=(ar(t)?G(t.sessionRecording)?null==(e=t.sessionRecording)?void 0:e.eventTriggers:[]:null==t?void 0:t.eventTriggers)||[]}onRemoteConfig(t){this.onConfig(t)}X(t){return Ye(this._instance,this.K.length,this.V,k,w,t)}triggerStatus(t){var e=this.triggerStatusNoSideEffects(t);return this._instance.register_for_session({[I]:e}),e}triggerStatusNoSideEffects(t){return this.X(t)}checkEventTriggerConditions(t,e,r){if(0!==this.K.length){var i=this.X(r)===Je,n=this.K.includes(t);!i&&n&&e("event",t)}}stop(){}},hr=class{constructor(t,e,r){if(this._instance=t,this.group=e,this.Y=new sr(t,e.id),this.tt=new lr(t,e.id),this.et=new ur(t),e.conditions.events&&e.conditions.events.length>0||e.conditions.urls&&e.conditions.urls.length>0||e.conditions.flag){var i=(e.conditions.events||[]).map(t=>t.name),n={urlTriggers:e.conditions.urls||[],eventTriggers:i,linkedFlag:e.conditions.flag||null,urlBlocklist:[]};this.Y.onConfig(n),this.tt.onConfig(n),this.et.onConfig(n,r);var o=[this.tt,this.Y,this.et];this.rt="any"===e.conditions.matchType?new ir(o):new nr(o)}else this.rt=new or}triggerStatus(t){return this.rt.triggerStatus(t)}triggerStatusNoSideEffects(t){return this.rt.triggerStatusNoSideEffects(t)}getPendingTriggerConditions(t){return"trigger_pending"!==this.triggerStatusNoSideEffects(t)?[]:[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Ke).map(t=>t.label)}checkEventTriggerConditions(t,e,r){this.tt.checkEventTriggerConditions(t,e,r)}checkUrlTriggerConditions(t,e,r,i){this.Y.checkUrlTriggerConditions(t,e,r,i)}activateTrigger(t,e){var r,i="url"===t?_+this.group.id:k+this.group.id;null==(r=this._instance.persistence)||r.register({[i]:e})}stop(){this.Y.stop(),this.tt.stop(),this.et.stop()}};function cr(t){if(t.rrwebError)return Qe;if(!t.receivedFlags)return Ze;if(!t.isRecordingEnabled)return ze;if(t.urlTriggerMatching.urlBlocked)return Ge;var e=!0===t.isSampled,r=new ir([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId);return e?We:"trigger_activated"===r?Ve:"trigger_pending"===r?Ze:!1===t.isSampled?ze:Ve}function dr(t){if(t.rrwebError)return Qe;if(!t.receivedFlags)return Ze;if(!t.isRecordingEnabled)return ze;if(t.urlTriggerMatching.urlBlocked)return Ge;var e=new nr([t.eventTriggerMatching,t.urlTriggerMatching,t.linkedFlagMatching]).triggerStatus(t.sessionId),r=e!==Xe,i=et(t.isSampled);return r&&"trigger_pending"===e?Ze:r&&"trigger_disabled"===e||i&&!t.isSampled?ze:!0===t.isSampled?We:Ve}function vr(){var t=[];return function(e,r){if(G(r)||V(r)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?"[Circular]":(t.push(r),r)}return r}}function fr(t){var e=JSON.stringify(t,vr());return e?new Blob([e]).size:0}function pr(t){if(X(t))return 4;if(Q(t))return 0;switch(typeof t){case"string":return t.length+2;case"number":return String(t).length;case"boolean":return t?4:5;case"object":if(V(t)){for(var e=2,r=0;t.length>r;r++){r>0&&(e+=1);var i=t[r];e+=Q(i)||X(i)?4:pr(i)}return e}var n=t,o=2,a=!0;for(var s in n)if({}.hasOwnProperty.call(n,s)){var u=n[s];Q(u)||(a||(o+=1),a=!1,o+=s.length+3+pr(u))}return o;default:return 0}}function gr(t,e){if(void 0===e&&(e=6606028.8),t.size>=e&&t.data.length>1){var r=Math.floor(t.data.length/2),i=t.sizes.slice(0,r),n=t.sizes.slice(r);return[gr({size:i.reduce((t,e)=>t+e,0),data:t.data.slice(0,r),sizes:i,sessionId:t.sessionId,windowId:t.windowId}),gr({size:n.reduce((t,e)=>t+e,0),data:t.data.slice(r),sizes:n,sessionId:t.sessionId,windowId:t.windowId})].flatMap(t=>t)}return[t]}var mr=Uint8Array,yr=Uint16Array,br=Uint32Array,wr=new mr([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]),kr=new mr([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]),_r=new mr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Sr=function(t,e){for(var r=new yr(31),i=0;31>i;++i)r[i]=e+=1<<t[i-1];var n=new br(r[30]);for(i=1;30>i;++i)for(var o=r[i];r[i+1]>o;++o)n[o]=o-r[i]<<5|i;return[r,n]},xr=Sr(wr,2),Cr=xr[1];xr[0][28]=258,Cr[258]=28;for(var Mr=Sr(kr,0)[1],Tr=new yr(32768),Ir=0;32768>Ir;++Ir){var Rr=(43690&Ir)>>>1|(21845&Ir)<<1;Tr[Ir]=((65280&(Rr=(61680&(Rr=(52428&Rr)>>>2|(13107&Rr)<<2))>>>4|(3855&Rr)<<4))>>>8|(255&Rr)<<8)>>>1}var Ar=function(t,e,r){for(var i=t.length,n=0,o=new yr(e);i>n;++n)++o[t[n]-1];var a,s=new yr(e);for(n=0;e>n;++n)s[n]=s[n-1]+o[n-1]<<1;if(r){a=new yr(1<<e);var u=15-e;for(n=0;i>n;++n)if(t[n])for(var l=n<<4|t[n],h=e-t[n],c=s[t[n]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)a[Tr[c]>>>u]=l}else for(a=new yr(i),n=0;i>n;++n)a[n]=Tr[s[t[n]-1]++]>>>15-t[n];return a},Er=new mr(288);for(Ir=0;144>Ir;++Ir)Er[Ir]=8;for(Ir=144;256>Ir;++Ir)Er[Ir]=9;for(Ir=256;280>Ir;++Ir)Er[Ir]=7;for(Ir=280;288>Ir;++Ir)Er[Ir]=8;var Lr=new mr(32);for(Ir=0;32>Ir;++Ir)Lr[Ir]=5;var Or=Ar(Er,9,0),Dr=Ar(Lr,5,0),Pr=function(t){return(t/8|0)+(7&t&&1)},Fr=function(t,e,r){(null==e||0>e)&&(e=0),(null==r||r>t.length)&&(r=t.length);var i=new(t instanceof yr?yr:t instanceof br?br:mr)(r-e);return i.set(t.subarray(e,r)),i},Nr=function(t,e,r){var i=e/8|0;t[i]|=r<<=7&e,t[i+1]|=r>>>8},qr=function(t,e,r){var i=e/8|0;t[i]|=r<<=7&e,t[i+1]|=r>>>8,t[i+2]|=r>>>16},jr=function(t,e){for(var r=[],i=0;t.length>i;++i)t[i]&&r.push({s:i,f:t[i]});var n=r.length,o=r.slice();if(!n)return[new mr(0),0];if(1==n){var a=new mr(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(t,e){return t.f-e.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=o[0].s;for(i=1;n>i;++i)o[i].s>d&&(d=o[i].s);var v=new yr(d+1),f=Br(r[h-1],v,0);if(f>e){i=0;var p=0,g=f-e,m=1<<g;for(o.sort(function(t,e){return v[e.s]-v[t.s]||t.f-e.f});n>i;++i){var y=o[i].s;if(e>=v[y])break;p+=m-(1<<f-v[y]),v[y]=e}for(p>>>=g;p>0;){var b=o[i].s;e>v[b]?p-=1<<e-v[b]++-1:++i}for(;i>=0&&p;--i){var w=o[i].s;v[w]==e&&(--v[w],++p)}f=e}return[new mr(v),f]},Br=function(t,e,r){return-1==t.s?Math.max(Br(t.l,e,r+1),Br(t.r,e,r+1)):e[t.s]=r},Hr=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new yr(++e),i=0,n=t[0],o=1,a=function(t){r[i++]=t},s=1;e>=s;++s)if(t[s]==n&&s!=e)++o;else{if(!n&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(n),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(n);o=1,n=t[s]}return[r.subarray(0,i),e]},$r=function(t,e){for(var r=0,i=0;e.length>i;++i)r+=t[i]*e[i];return r},Ur=function(t,e,r){var i=r.length,n=Pr(e+2);t[n]=255&i,t[n+1]=i>>>8,t[n+2]=255^t[n],t[n+3]=255^t[n+1];for(var o=0;i>o;++o)t[n+o+4]=r[o];return 8*(n+4+i)},zr=function(t,e,r,i,n,o,a,s,u,l,h){Nr(e,h++,r),++n[256];for(var c=jr(n,15),d=c[0],v=c[1],f=jr(o,15),p=f[0],g=f[1],m=Hr(d),y=m[0],b=m[1],w=Hr(p),k=w[0],_=w[1],S=new yr(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=jr(S,7),M=C[0],T=C[1],I=19;I>4&&!M[_r[I-1]];--I);var R,A,E,L,O=l+5<<3,D=$r(n,Er)+$r(o,Lr)+a,P=$r(n,d)+$r(o,p)+a+14+3*I+$r(S,M)+(2*S[16]+3*S[17]+7*S[18]);if(D>=O&&P>=O)return Ur(e,h,t.subarray(u,u+l));if(Nr(e,h,1+(D>P)),h+=2,D>P){R=Ar(d,v,0),A=d,E=Ar(p,g,0),L=p;var F=Ar(M,T,0);for(Nr(e,h,b-257),Nr(e,h+5,_-1),Nr(e,h+10,I-4),h+=14,x=0;I>x;++x)Nr(e,h+3*x,M[_r[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)Nr(e,h,F[B=31&j[x]]),h+=M[B],B>15&&(Nr(e,h,j[x]>>>5&127),h+=j[x]>>>12)}}else R=Or,A=Er,E=Dr,L=Lr;for(x=0;s>x;++x)if(i[x]>255){var B;qr(e,h,R[257+(B=i[x]>>>18&31)]),h+=A[B+257],B>7&&(Nr(e,h,i[x]>>>23&31),h+=wr[B]);var H=31&i[x];qr(e,h,E[H]),h+=L[H],H>3&&(qr(e,h,i[x]>>>5&8191),h+=kr[H])}else qr(e,h,R[i[x]]),h+=A[i[x]];return qr(e,h,R[256]),h+A[256]},Wr=new br([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Vr=new mr(0),Zr=function(){for(var t=new br(256),e=0;256>e;++e){for(var r=e,i=9;--i;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t}(),Gr=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function Qr(t,e){void 0===e&&(e={});var r=function(){var t=4294967295;return{p(e){for(var r=t,i=0;e.length>i;++i)r=Zr[255&r^e[i]]^r>>>8;t=r},d(){return 4294967295^t}}}(),i=t.length;r.p(t);var n,o,a,s,u,l=(n=t,o=e,a=function(t){return 10+(t.filename&&t.filename.length+1||0)}(e),s=8,function(t,e,r,i,n,o){var a=t.length,s=new mr(i+a+5*(1+Math.floor(a/7e3))+n),u=s.subarray(i,s.length-n),l=0;if(!e||8>a)for(var h=0;a>=h;h+=65535){var c=h+65535;a>c?l=Ur(u,l,t.subarray(h,c)):(u[h]=o,l=Ur(u,l,t.subarray(h,a)))}else{for(var d=Wr[e-1],v=d>>>13,f=8191&d,p=(1<<r)-1,g=new yr(32768),m=new yr(p+1),y=Math.ceil(r/3),b=2*y,w=function(e){return(t[e]^t[e+1]<<y^t[e+2]<<b)&p},k=new br(25e3),_=new yr(288),S=new yr(32),x=0,C=0,M=(h=0,0),T=0,I=0;a>h;++h){var R=w(h),A=32767&h,E=m[R];if(g[A]=E,m[R]=A,h>=T){var L=a-h;if((x>7e3||M>24576)&&L>423){l=zr(t,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 D=2,P=0,F=f,N=A-E&32767;if(L>2&&R==w(h-N))for(var q=Math.min(v,L)-1,j=Math.min(32767,h),B=Math.min(258,L);j>=N&&--F&&A!=E;){if(t[h+D]==t[h+D-N]){for(var H=0;B>H&&t[h+H]==t[h+H-N];++H);if(H>D){if(D=H,P=N,H>q)break;var U=Math.min(N,H-2),z=0;for(O=0;U>O;++O){var W=h-N+O+32768&32767,V=W-g[W]+32768&32767;V>z&&(z=V,E=W)}}}N+=(A=E)-(E=g[A])+32768&32767}if(P){k[M++]=268435456|Cr[D]<<18|Mr[P];var Z=31&Cr[D],G=31&Mr[P];C+=wr[Z]+kr[G],++_[257+Z],++S[G],T=h+D,++x}else k[M++]=t[h],++_[t[h]]}}l=zr(t,u,o,k,_,S,C,M,I,h-I,l),o||(l=Ur(u,l,Vr))}return Fr(s,0,i+Pr(l)+n)}(n,null==o.level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a,s,!u)),h=l.length;return function(t,e){var r=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&Gr(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),r){t[3]=8;for(var i=0;r.length>=i;++i)t[i+10]=r.charCodeAt(i)}}(l,e),Gr(l,h-8,r.d()),Gr(l,h-4,i),l}function Jr(t,e){var r="";if(!e&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i=0;t.length>i;){var n=t[i++];128>n||e?r+=String.fromCharCode(n):224>n?r+=String.fromCharCode((31&n)<<6|63&t[i++]):240>n?r+=String.fromCharCode((15&n)<<12|(63&t[i++])<<6|63&t[i++]):(n=((15&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,r+=String.fromCharCode(55296|n>>10,56320|1023&n))}return r}var Kr=class{constructor(t,e){var r,i,n,o;void 0===e&&(e={}),this._rrweb=t,this.it=e,this.nt={},this.ot=Date.now(),this.st=-1/0,this.ut=()=>{var t=Date.now(),e=t-this.ot;e>0?(this.ht=Math.min(this.ct,this.ht+e/1e3*this.dt),this.ot=t):this.ot=t},this.vt=t=>{if(!this.nt[t]){var e,r;this.nt[t]=!0;var i=this.ft(t);null==(e=(r=this.it).onBlockedNode)||e.call(r,t,i)}},this.yt=t=>{var e=this.ft(t);if("svg"!==(null==e?void 0:e.nodeName)&&e instanceof Element){var r=e.closest("svg");if(r)return[this._rrweb.mirror.getId(r),r]}return[t,e]},this.ft=t=>this._rrweb.mirror.getNode(t),this.bt=t=>{var e,r,i,n,o,a,s,u;return(null!==(e=null==(r=t.removes)?void 0:r.length)&&void 0!==e?e:0)+(null!==(i=null==(n=t.attributes)?void 0:n.length)&&void 0!==i?i:0)+(null!==(o=null==(a=t.texts)?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null==(u=t.adds)?void 0:u.length)&&void 0!==s?s:0)},this.throttleMutations=t=>{if(3!==t.type||0!==t.data.source)return t;var e=t.data,r=this.bt(e);if(e.attributes){var i,n,o=e.attributes.length;e.attributes=e.attributes.filter(t=>{var e=this.yt(t.id)[0];return!this.wt.consumeRateLimit(e)&&t});var a=o-e.attributes.length;a>0&&(null==(i=(n=this.it).onDroppedAttributeMutations)||i.call(n,a))}var s=this.bt(e);if(0!==s||r===s){if(this.kt)return t;this.ut();var u,l,h=pr(t);return h>this.ht?(null==(u=(l=this.it).onDroppedOversizedMutation)||u.call(l,h),void this._t()):(this.ht-=h,t)}},this._t=()=>{if(!this.St){var t=Math.max(0,this.xt-(Date.now()-this.st));this.St=setTimeout(()=>{var t,e;this.St=void 0,this.st=Date.now(),null==(t=(e=this.it).requestFullSnapshot)||t.call(e)},t)}},this.wt=new lt({bucketSize:null!==(r=this.it.bucketSize)&&void 0!==r?r:100,refillRate:null!==(i=this.it.refillRate)&&void 0!==i?i:10,refillInterval:1e3,I:this.vt,A:Yt}),this.ct=null!==(n=this.it.bytesBucketSize)&&void 0!==n?n:0,this.dt=null!==(o=this.it.bytesRefillRate)&&void 0!==o?o:25600,this.kt=!Number.isFinite(this.ct)||0>=this.ct,this.ht=this.ct;var a=this.it.resyncIntervalMs;this.xt=tt(a)&&Number.isFinite(a)&&a>0?a:3e5}reset(){this.nt={},this.St&&(clearTimeout(this.St),this.St=void 0),this.st=Date.now()}stop(){this.wt.stop(),this.reset(),this.ht=this.ct,this.ot=Date.now(),this.st=-1/0}};Kt.DEBUG=!1,Kt.LIB_VERSION="1.428.1",Kt.LIB_NAME="web";var Xr=Kt,Yr=class{constructor(t){if(!t.persistence)throw new Error("it is not valid to not have persistence and be this far into setting up the application");this.Ct=t.get_property.bind(t),this.Mt=t.persistence.set_property.bind(t.persistence)}trackSize(t,e){this.Mt(C,{sessionId:t,size:this.currentTrackedSize(t)+e})}currentTrackedSize(t){var e,r=this.Ct(C);return G(e=r)&&J(e.sessionId)&&tt(e.size)&&r.sessionId===t?r.size:0}};function ti(t,e){return function(t){for(var e=0,r=0;t.length>r;r++)e=(e<<5)-e+t.charCodeAt(r),e|=0;return Math.abs(e)}(t)%100<ut(100*e,0,100,Yt)}function ei(t){return"$survey_response_"+t}function ri(t,e){if(!e)return null;var r=t[ei(e)];return V(r)?[...r]:r}function ii(t,r,i){void 0===t&&(t={});var n={};return r.questions.forEach(e=>{if(!Q(e.originalQuestionIndex)){var r,i=0===(r=e.originalQuestionIndex)?"$survey_response":"$survey_response_"+r,o=ri(t,e.id);Q(o)||(n[i]=o)}}),e({$survey_questions:r.questions.map(e=>{var r,n;return{id:e.id,question:null!==(r=null==i?void 0:i[null!==(n=e.id)&&void 0!==n?n:""])&&void 0!==r?r:e.question,response:ri(t,e.id)}})},t,n)}function ni(t,e){var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r}function oi(t){return"string"==typeof t&&t.trim()?t.trim():null}function ai(t){return t.toLowerCase()}function si(t,e,r){if(!t||!e)return null;var i=ai(e),n=Object.keys(t).find(t=>ai(t)===i);if(n)return null==r||r.debug("Found exact translation match: "+n),n;if(i.includes("-")){var o=i.split("-")[0],a=Object.keys(t).find(t=>ai(t)===o);if(a)return null==r||r.debug("Found base language translation match: "+a+" (from "+e+")"),a}return null}var ui=["thankYouMessageHeader","thankYouMessageDescription","thankYouMessageCloseButtonText","introScreenHeader","introScreenDescription","introScreenButtonText","submitButtonText","backButtonText"];function li(t,r,i){var n,o=si(t.translations,r,i),a=e({},t),s=!1;if(o){var u,l=null==(u=t.translations)?void 0:u[o];if(l)if(null==i||i.info("Applying survey-level translation for language: "+o),Q(l.name)||(a.name=l.name,s=!0),a.appearance){var h=e({},a.appearance);for(var c of ui){var d=l[c];Q(d)||(h[c]=d,s=!0)}a.appearance=h}else(function(t){return ui.some(e=>!Q(t[e]))})(l)&&(s=!0)}var v=t.questions.map(t=>function(t,r,i){var n,o=si(t.translations,r,i);if(!o)return{question:t,matchedKey:null,hasChanges:!1};var a=null==(n=t.translations)?void 0:n[o];if(!a)return{question:t,matchedKey:null,hasChanges:!1};var s=e({},t),u=!1;return Q(a.question)||(s.question=a.question,u=!0),Q(a.description)||(s.description=a.description,u=!0),Q(a.buttonText)||(s.buttonText=a.buttonText,u=!0),"link"in s&&!Q(a.link)&&(s.link=a.link,u=!0),"lowerBoundLabel"in s&&!Q(a.lowerBoundLabel)&&(s.lowerBoundLabel=a.lowerBoundLabel,u=!0),"upperBoundLabel"in s&&!Q(a.upperBoundLabel)&&(s.upperBoundLabel=a.upperBoundLabel,u=!0),"choices"in s&&function(t){return V(t.choices)}(a)&&(s.choices=a.choices,u=!0),{question:u?s:t,matchedKey:u?o:null,hasChanges:u}}(t,r,i)),f=v.map(t=>t.question),p=v.some(t=>t.hasChanges),g=null;return o||(g=(null==(n=v.find(t=>t.matchedKey))?void 0:n.matchedKey)||null),p&&(a.questions=f,s=!0,null==i||i.info("Applied question-level translations for language: "+r)),{survey:a,matchedKey:s?o||g:null}}function hi(t){var e;return!(null==(e=t.conditions)||null==(e=e.events)||null==(e=e.values)||!e.length)}var ci=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},di=t=>t.toLowerCase(),vi={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>ci(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!ci(e,t))),icontains:(t,e)=>e.map(di).some(e=>t.map(di).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(di).every(e=>t.map(di).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{var r=parseFloat(e);return!isNaN(r)&&t.some(t=>r>parseFloat(t))}),lt:(t,e)=>e.some(e=>{var r=parseFloat(e);return!isNaN(r)&&t.some(t=>r<parseFloat(t))})},fi=new Set(["is_not","not_icontains","not_regex"]);function pi(t,e,r){return!t||0===t.length||t.every(t=>{var i,n=null==(i="person"===t.type?r:e)?void 0:i[t.key],o=t.operator||"exact";if(Q(n)||X(n))return fi.has(o);var a=vi[o];return!!a&&!Q(t.value)&&!X(t.value)&&a(V(t.value)?t.value.map(String):[String(t.value)],V(n)?n.map(String):[String(n)])})}var gi=te("[SessionRecording]");function mi(t,e){return e?t:"!"+t}function yi(t,e){return t===e||t!=="!"+e&&null}var bi=class{constructor(t,e,r,i,n,o,a){this._instance=t,this.Y=e,this.tt=r,this.et=i,this.Tt=n,this.It=o,this.Rt=a,this.At=null,this.Et=dr}onRemoteConfig(t){this.At=tt(t.sampleRate)?t.sampleRate:null,"any"===t.triggerMatchType?(this.Lt=new ir([this.tt,this.Y]),this.Et=cr):(this.Lt=new nr([this.tt,this.Y]),this.Et=dr),this._instance.register_for_session({[L]:t.triggerMatchType}),this.Y.onConfig(t),this.tt.onConfig(t),this.et.onConfig(t,(t,e)=>{this.Tt("linked_flag_matched",{flag:t,variant:e}),this.Rt()})}getStatus(t){return this.Et({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId})}getMinimumDuration(t){var e,r=null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.minimumDurationMilliseconds;return tt(r)?r:null}checkUrlTriggers(t,e,r,i){this.Y.checkUrlTriggerConditions(e,r,i,t)}setupEventTriggerListeners(t,e,r){if(0!==this.tt.K.length&&Y(this.Ot))return this.Ot=t(t=>{try{this.tt.checkEventTriggerConditions(t.event,r,e)}catch(t){gi.error("Could not activate event trigger",t)}}),this.Ot}makeSamplingDecisions(t){var e,r,i,n=this.At;if(!tt(n))return null==(r=this._instance.persistence)||r.unregister(m),void(null==(i=this._instance.persistence)||i.unregister(d));var o=this._instance.get_property(m),a=this._instance.get_property(d),s=yi(o,t),u=tt(a)&&a!==n,l=Q(a)&&o===t,h=u||l||!et(s),c=h?ti(t,n):s;h&&(c?this.Tt("sampled"):gi.warn("Sample rate ("+n+") has determined that this sessionId ("+t+") will not be sent to the server.")),null==(e=this._instance.persistence)||e.register({[m]:mi(t,c),[d]:X(a)&&o===t?null:n})}ensureSamplingDecision(t){tt(this.At)&&(et(yi(this._instance.get_property(m),t))||this.makeSamplingDecisions(t))}onFlushComplete(){}clearConditionalRecordingPersistence(){var t,e,r,i,n;null==(t=this._instance.persistence)||t.unregister(w),null==(e=this._instance.persistence)||e.unregister(b),null==(r=this._instance.persistence)||r.unregister(m),null==(i=this._instance.persistence)||i.unregister(d),null==(n=this._instance.persistence)||n.unregister(y)}updateActiveTriggers(t){}hasPendingTriggers(t){var e;return(null==(e=this.Lt)?void 0:e.triggerStatus(t))===Ke}getPendingTriggerConditions(t){return[{label:"URL condition not matched",status:this.Y.triggerStatusNoSideEffects(t)},{label:"event condition not matched",status:this.tt.triggerStatusNoSideEffects(t)},{label:"linked flag condition not matched",status:this.et.triggerStatusNoSideEffects()}].filter(t=>t.status===Ke).map(t=>t.label)}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.tt.stop(),this.Y.stop(),this.et.stop()}},wi=class{constructor(t,e,r,i,n){this._instance=t,this.Y=e,this.Tt=r,this.Dt=i,this.Rt=n,this.Pt=[],this.Ft=new Map,this.Nt=!1}onRemoteConfig(t){t.triggerGroups&&0!==t.triggerGroups.length?(this.qt(t.triggerGroups),this._instance.register_for_session({[L]:"v2_trigger_groups",[O]:t.triggerGroups.length}),this.Y.onConfig(t)):gi.warn("[V2Strategy] No trigger groups configured")}getStatus(t){return function(t){if(t.rrwebError)return Qe;if(!t.receivedFlags)return Ze;if(!t.isRecordingEnabled)return ze;if(t.urlTriggerMatching.urlBlocked)return Ge;var e=t.triggerGroupMatchers,r=t.triggerGroupSamplingResults;if(0===e.length)return ze;var i=!1,n=!1;for(var o of e){var a=o.triggerStatus(t.sessionId);if("trigger_activated"===a){var s=o.group.id,u=r.get(s);Q(u)?Yt.warn("[V2 Triggers] Group activated but no sampling decision found",{groupId:s}):!0===u&&(n=!0)}else"trigger_pending"===a&&(i=!0)}return n?We:i?Ze:ze}({receivedFlags:!0,isRecordingEnabled:!0,isSampled:t.isSampled,rrwebError:t.rrwebError,urlTriggerMatching:t.urlTriggerMatching,eventTriggerMatching:t.eventTriggerMatching,linkedFlagMatching:t.linkedFlagMatching,sessionId:t.sessionId,triggerGroupMatchers:this.Pt,triggerGroupSamplingResults:this.Ft,minimumDuration:this.getMinimumDuration(t.sessionId)})}getMinimumDuration(t){var e=null;for(var r of this.Pt)if("trigger_activated"===r.triggerStatus(t)){var i=r.group.minDurationMs;tt(i)&&(X(e)||e>i)&&(e=i)}return e}checkUrlTriggers(t,e,r,i){var n=this;this.Y.checkUrlBlocklist(e,r);var o=function(i){i.checkUrlTriggerConditions(e,r,e=>{n.jt(i,void 0)&&(i.activateTrigger(e,t),n.updateActiveTriggers(t),n.Rt(e))},t)};for(var a of this.Pt)o(a)}setupEventTriggerListeners(t,e,r){var i=this;return this.Ot=t(t=>{var r;if(this.Nt)return gi.info("[SessionRecorder] Stopping trigger checks - initial buffer flushed"),null==(r=this.Ot)||r.call(this),void(this.Ot=void 0);try{var n=function(r){r.checkEventTriggerConditions(t.event,n=>{if(i.jt(r,t.properties)){var o=(r.group.conditions.events||[]).filter(e=>e.name===t.event),a=i._instance.get_property(M);o.some(e=>!e.properties||0===e.properties.length||pi(e.properties,t.properties,a))&&(r.activateTrigger(n,e),i.updateActiveTriggers(e),i.Rt(n))}},e)};for(var o of this.Pt)n(o)}catch(t){gi.error("Could not activate event trigger for trigger groups",t)}}),this.Ot}makeSamplingDecisions(t){for(var e of this.Pt){var r,i=e.group,n=i.id,o=i.sampleRate,a=S+n,s=this._instance.get_property(a),u=null,l=!1,h=!1,c=!1;if(G(s)){var d=s.sessionId,v=s.sampleRate,f=s.sampled;l="string"==typeof d&&d!==t,h=tt(v)&&v!==o,u=d===t&&tt(v)&&v===o&&et(f)?f:null}else u=s===t||null,l="string"==typeof s&&s!==t,c=s===t;var p=l||h||c||!et(u),g=p?ti(t+n,o):u;p&&this.Dt("triggerGroupSamplingDecisionMade",{group_id:n,group_name:i.name,sampleRate:o,isSampled:g}),this.Ft.set(n,g),null==(r=this._instance.persistence)||r.register({[a]:{sessionId:t,sampleRate:o,sampled:g}})}this.updateActiveTriggers(t)}ensureSamplingDecision(t){}onFlushComplete(){this.Nt=!0}clearConditionalRecordingPersistence(){var t,e,r;for(var i of(null==(t=this._instance.persistence)||t.unregister(m),null==(e=this._instance.persistence)||e.unregister(d),null==(r=this._instance.persistence)||r.unregister(y),this.Pt)){var n,o,a,s=i.group.id;null==(n=this._instance.persistence)||n.unregister(k+s),null==(o=this._instance.persistence)||o.unregister(_+s),null==(a=this._instance.persistence)||a.unregister(S+s)}}updateActiveTriggers(t){var e=[];for(var r of this.Pt){var i=r.group,n=i.id,o="trigger_activated"===r.triggerStatus(t),a=!0===this.Ft.get(n);o&&e.push({id:n,name:i.name,matched:!0,sampled:a})}this._instance.register_for_session({[A]:e})}hasPendingTriggers(t){for(var e of this.Pt)if("trigger_pending"===e.triggerStatus(t))return!0;return!1}getPendingTriggerConditions(t){return this.Pt.flatMap(e=>"trigger_pending"!==e.triggerStatusNoSideEffects(t)?[]:e.getPendingTriggerConditions(t).map(t=>'trigger group "'+e.group.name+'": '+t))}stop(){var t;null==(t=this.Ot)||t.call(this),this.Ot=void 0,this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear(),this.Y.stop()}jt(t,e){var r=t.group.conditions.properties;return!r||0===r.length||pi(r,e,this._instance.get_property(M))}qt(t){var e=this;this.Pt.forEach(t=>t.stop()),this.Pt=[],this.Ft.clear();var r=function(t){var r=new hr(e._instance,t,(r,i)=>{e.Tt("linked_flag_matched",{flag:r,variant:i,group_id:t.id,group_name:t.name}),e.Rt()});e.Pt.push(r)};for(var i of t)r(i)}},ki=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],_i=1e5,Si=/^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$/,xi=[],Ci=()=>!1,Mi="@type @id actionStatus availability bestRating contentRating encodingFormat eventAttendanceMode eventStatus highPrice inLanguage isAccessibleForFree isFamilyFriendly itemCondition itemListOrder lowPrice maximumAttendeeCapacity nonprofitStatus numberOfItems offerCount position price priceCurrency priceValidUntil publicAccess ratingCount ratingValue reviewCount smokingAllowed worstRating".split(" "),Ti="Action BorrowAction ReadAction SearchAction SeekToAction SolveMathAction WatchAction".split(" "),Ii="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(" "),Ri="Accommodation AdministrativeArea Country Place State".split(" "),Ai={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:Ti,publisher:Ii},Event:{startDate:!0,endDate:!0,previousStartDate:!0,aggregateRating:["AggregateRating"],offers:["AggregateOffer","Offer"]},ItemList:{itemListElement:["ListItem"]},ListItem:{item:xi},Offer:{seller:Ii},Organization:{name:!0,legalName:!0,foundingDate:!0,dissolutionDate:!0,aggregateRating:["AggregateRating"],brand:["Brand"]},Place:{aggregateRating:["AggregateRating"]},Product:{name:!0,sku:!0,mpn:!0,gtin:!0,gtin8:!0,gtin12:!0,gtin13:!0,gtin14:!0,productID:!0,productGroupID:!0,asin:!0,model:!0,category:!0,color:!0,material:!0,pattern:!0,size:!0,productionDate:!0,releaseDate:!0,brand:["Brand","Organization"],manufacturer:Ii,offers:["Offer","AggregateOffer"],aggregateRating:["AggregateRating"]},Service:{name:!0,serviceType:!0,category:!0,provider:Ii,areaServed:Ri,offers:["AggregateOffer","Offer"],aggregateRating:["AggregateRating"]},OfferCatalog:{name:!0,itemListElement:xi}},Ei=[["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(" "),Ai.CreativeWork],["BroadcastEvent BusinessEvent EducationEvent Festival MusicEvent SportsEvent TheaterEvent".split(" "),Ai.Event],[Ii,Ai.Organization],[Ri,Ai.Place],["Car IndividualProduct ProductGroup ProductModel".split(" "),Ai.Product]];function Li(t,e){return z.call(t,e)?t[e]:void 0}function Oi(t){var e=typeof t;return X(t)||"string"===e||"number"===e||"boolean"===e}function Di(t){return Oi(t)||V(t)&&t.every(Oi)?t:void 0}function Pi(t,e){if("string"==typeof t){var r=t.trim(),i=r.indexOf("#"),n=0>i?r:r.slice(i+1);if(!(!n||0>i&&(/^[a-z][a-z\d+.-]*:/i.test(r)||r.includes("/")||r.includes("?"))))try{return e(n)?n:void 0}catch(t){return}}}function Fi(t){if(z.call(Ai,t))return Ai[t];for(var e of Ei){var r=e[1];if(e[0].includes(t))return r}}function Ni(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0})}function qi(t,e,r,i){if(V(t)){var n=t.map(t=>qi(t,e,r,i)).filter(t=>!Q(t));return n.length?n:void 0}return ji(t,e,r,i)||void 0}function ji(t,e,r,i){if(!G(t)||!function(t){return t.remainingNodes?(t.remainingNodes--,!0):(t.exceeded=!0,!1)}(r))return null;var n=Li(t,"@type"),o=function(t){var e=new Set,r="string"==typeof t?[t]:V(t)?t:[],i=[];for(var n of r)if("string"==typeof n){var o=n.replace(/^https?:\/\/schema\.org\//,"");if(100>=o.length&&Si.test(o)&&!e.has(o)&&(e.add(o),i.push(o),20===i.length))break}return i}(n),a=o.filter(t=>!!Fi(t)&&(!i||!i.length||i.includes(t))),s={};for(var u of Mi){var l="@type"===u?o.length?"string"==typeof n?o[0]:o:void 0:"@id"===u?Pi(Li(t,u),e):Di(Li(t,u));Q(l)||Ni(s,u,l)}for(var h of a){var c=Fi(h);for(var d of Object.keys(c)){var v=Li(t,d),f=c[d];if(!0===f){var p=Di(v);Q(p)||Ni(s,d,p)}else{var g=qi(v,e,r,f);Q(g)||Ni(s,d,g)}}}var m=qi(Li(t,"@graph"),e,r);return Q(m)||Ni(s,"@graph",m),Object.keys(s).length?s:null}function Bi(t,r,i){if(!G(t))return null;var n=Li(t,"@context");if("string"!=typeof n||!/^https?:\/\/schema\.org\/?$/.test(n))return null;var o=ji(t,r,i);return o?e({"@context":"https://schema.org"},o):null}function Hi(t){var e;return"SCRIPT"===t.nodeName&&"application/ld+json"===(null==(e=t.getAttribute("type"))?void 0:e.trim().toLowerCase())}function $i(t,e,r){if("string"==typeof e?t.classList.contains(e):e&&Array.from(t.classList).some(t=>(e.lastIndex=0,e.test(t))))return!0;try{return!!r&&t.matches(r)}catch(t){return!1}}function Ui(t,e,r){for(var i=t;i;){if($i(i,e,r))return!0;var n=i.parentNode;i=i.parentElement||(n&&n.nodeType===n.DOCUMENT_FRAGMENT_NODE?n.host:null)}return!1}function zi(t){return Hi(t)?[t]:t.nodeType!==t.ELEMENT_NODE?[]:Array.from(t.querySelectorAll("script")).filter(Hi)}function Wi(t){return Q(t)?void 0:Math.round(t)}function Vi(t){return G(t)?t.network_timing:t}var Zi,Gi,Qi=te("[SessionRecording]"),Ji=[1,2,3,4,5,6,7,12],Ki=t=>({rrwebMethod:t,enqueuedAt:Date.now(),attempt:1});function Xi(){var t;return null==h||null==(t=h.__PosthogExtensions__)?void 0:t.rrweb}function Yi(){var t;return null==(t=Xi())?void 0:t.record}function tn(t){try{return JSON.stringify(t)}catch(e){return JSON.stringify(t,vr())}}function en(t){return Jr(Qr(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new mr(t.length+(t.length>>>1)),i=0,n=function(t){r[i++]=t},o=0;e>o;++o){if(i+5>r.length){var a=new mr(i+8+(e-o<<1));a.set(r),r=a}var s=t.charCodeAt(o);128>s?n(s):2048>s?(n(192|s>>>6),n(128|63&s)):s>55295&&57344>s?(n(240|(s=65536+(1047552&s)|1023&t.charCodeAt(++o))>>>18),n(128|s>>>12&63),n(128|s>>>6&63),n(128|63&s)):(n(224|s>>>12),n(128|s>>>6&63),n(128|63&s))}return Fr(r,0,i)}(tn(t))),!0)}function rn(t){return nn.apply(this,arguments)}function nn(){return nn=i(function*(t){var e=yield function(t,e,r){return Gt.apply(this,arguments)}(tn(t),Xr.DEBUG,{rethrow:!0});return Jr(new Uint8Array(yield e.arrayBuffer()),!0)}),nn.apply(this,arguments)}var on="undefined"!=typeof globalThis&&"CompressionStream"in globalThis&&"TextEncoder"in globalThis&&"Response"in globalThis&&"function"==typeof Response.prototype.blob,an=!1;function sn(t){return V(t)&&0===t.length?Zi=null!=Zi?Zi:en([]):en(t)}function un(t){return ln.apply(this,arguments)}function ln(){return(ln=i(function*(t){return V(t)&&0===t.length?Zi||(Gi=null!=Gi?Gi:rn([]).then(t=>(Zi=t,t)).catch(t=>{throw Zi=void 0,Gi=void 0,t})):rn(t)})).apply(this,arguments)}function hn(t){return on&&!an&&function(t){return 2===t.type||3===t.type&&(0===t.data.source||8===t.data.source)}(t)}function cn(t){return{event:t,size:pr(t)}}function dn(t,r){return e({},t,{data:r,cv:"2024-10"})}function vn(t,r){return e({},t,{cv:"2024-10",data:e({},t.data,r)})}function fn(t){try{if(2===t.type)return cn(dn(t,en(t.data)));if(3===t.type&&0===t.data.source)return cn(vn(t,{texts:sn(t.data.texts),attributes:sn(t.data.attributes),removes:sn(t.data.removes),adds:sn(t.data.adds)}));if(3===t.type&&8===t.data.source)return cn(vn(t,{adds:t.data.adds?en(t.data.adds):void 0,removes:t.data.removes?en(t.data.removes):void 0}))}catch(t){Qi.error("could not compress event - will use uncompressed event",t)}return{event:t,size:fr(t)}}function pn(){return pn=i(function*(t){try{if(2===t.type)return cn(dn(t,yield rn(t.data)));if(3===t.type&&0===t.data.source){var e=yield Promise.all([un(t.data.texts),un(t.data.attributes),un(t.data.removes),un(t.data.adds)]);return cn(vn(t,{texts:e[0],attributes:e[1],removes:e[2],adds:e[3]}))}if(3===t.type&&8===t.data.source){var r=yield Promise.all([t.data.adds?rn(t.data.adds):void 0,t.data.removes?rn(t.data.removes):void 0]);return cn(vn(t,{adds:r[0],removes:r[1]}))}}catch(e){return(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return(t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""))(t)||e===Wt})(e)&&(an=!0),Qi.error("could not compress event asynchronously - trying synchronous compression",e),fn(t)}return{event:t,size:fr(t)}}),pn.apply(this,arguments)}function gn(t,e){return 5===t.type&&t.data.tag===e}function mn(t){return gn(t,"sessionIdle")}function yn(t){return gn(t,"$session_ending")}function bn(t){return gn(t,"$session_starting")}var wn=class{get sessionId(){return this.Bt}get Ht(){if(!this._instance.sessionManager)throw new Error("[SessionRecording] must be started with a valid sessionManager.");return this._instance.sessionManager}get $t(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get Ut(){return yi(this._instance.get_property(m),this.sessionId)}get At(){var t,e=null==(t=this.zt)?void 0:t.sampleRate;return tt(e)?e:null}get Wt(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getMinimumDuration(this.sessionId))&&void 0!==t?t:null}constructor(t,e){this._instance=t,this.Zt="/s/",this._forceAllowLocalhostNetworkCapture=!1,this.Gt=void 0,this.Qt=!1,this.Jt=Date.now(),this.Kt=!1,this.Xt=[],this.Yt="unknown",this.te=0,this.ee=0,this.re=0,this.ie=0,this.ne=!1,this.oe=!1,this.ae=!1,this.se=!1,this.ue=!1,this.le=!1,this.he=!1,this.ce=!1,this.de=!1,this.ve=!1,this.fe=!1,this.pe=!1,this.ge=[],this.me=void 0,this.ye=void 0,this.be=[],this.we=0,this.ke=0,this._e=!1,this.Se=void 0,this.Ot=void 0,this.xe=void 0,this.Ce=void 0,this.Me=void 0,this.Te=(t,e,r)=>{var i,n,o,a;if(r&&(t!==this.Bt||e!==this.Ie)){var s=!r.noSessionId&&(r.activityTimeout||r.sessionPastMaximumLength),u=this.Bt,l=this.Ie;if(s&&this.Dt("$session_ending",{currentSessionId:u,currentWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt,flushed_size:null==(i=this.Re)?void 0:i.currentTrackedSize(u)}),null==(n=this._instance.persistence)||n.unregister(x),this.he=!1,null==(o=Xi())||null==o.resetMaxDepthState||o.resetMaxDepthState(),this.Dt("$session_id_change",{sessionId:t,windowId:e,changeReason:r}),this.Ae(),!(!1===this.Yt&&this.isStarted||this.Bt===t&&this.Ie===e)){var h=this.Bt!==t&&!1!==this.Yt;this.Yt="unknown",this.Ee(h)}s&&this.Dt("$session_starting",{previousSessionId:u,previousWindowId:l,nextSessionId:t,nextWindowId:e,changeReason:r,lastActivityTimestamp:this.Jt}),null==(a=this.Vt)||a.makeSamplingDecisions(t)}},this.Le=!1,this.Oe=()=>{var t;return(null==(t=this._instance.persistence)?void 0:t.props[y])===this.Bt},this.De=()=>{var t,e;if(0===this.Pe.data.length)return null;var r=null==(t=this.Pe.data[0])?void 0:t.timestamp,i=null==(e=this.Pe.data[this.Pe.data.length-1])?void 0:e.timestamp;return tt(r)&&tt(i)?i-r:null},this.Fe=()=>{var t,e,r=this.Wt;if(!tt(r))return!1;if(null===(t=null==(e=this._instance.config.session_recording)?void 0:e.strictMinimumDuration)||void 0===t||!t){var i=this.Ne;return tt(i)&&i>=0&&r>i}if(this.Oe())return!1;var n,o=this.De();return!!X(o)||r>o||(null==(n=this._instance.persistence)||n.register({[y]:this.Bt}),!1)},this.qe=()=>{"buffering"!==this.status?(this.ne&&this.oe&&this.je&&!this.ae&&this.Be(void 0),this.He(),this.$e()):this.Ue()},this.ze=()=>{this.qe()},this.We=()=>{this.Dt("browser offline",{})},this.Ve=()=>{this.Dt("browser online",{})},this.Ze=()=>{null!=a&&a.visibilityState&&("visible"===a.visibilityState&&(this.je=!0),this.Dt("window "+a.visibilityState,{}))},this.je=null==e||e;var r=this.Ht.checkAndGetSessionAndWindowId(),i=r.windowId;this.Bt=r.sessionId,this.Ie=i,this.et=new ur(this._instance),this.Y=new sr(this._instance),this.tt=new lr(this._instance),this.Pe=this.Ue(),this.Ht.sessionTimeoutMs>this.$t||Qi.warn("session_idle_threshold_ms ("+this.$t+") is greater than the session timeout ("+this.Ht.sessionTimeoutMs+"). Session will never be detected as idle"),this.Re=new Yr(this._instance)}setDocumentWasEverVisible(t){t&&(this.je=!0)}get Ge(){var t,e,r,i,n,o,a,s,u,l=null==(t=this.zt)?void 0:t.masking,h={maskAllInputs:null==(e=this._instance.config.session_recording)?void 0:e.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!==(o=null==h?void 0:h.maskAllInputs)&&void 0!==o?o:null==l?void 0:l.maskAllInputs,d=null!==(a=null==h?void 0:h.maskTextSelector)&&void 0!==a?a: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 Q(c)&&Q(d)&&Q(v)&&Q(f)?void 0:{maskAllInputs:null==c||c,maskTextSelector:d,blockSelector:v,maskAllElementAttributes:f}}Qe(){var t;if(!this.de){var e=null==(t=this.zt)?void 0:t.masking;if(!Y(e)){var r=this._instance.config.session_recording,i=["maskAllInputs","maskTextSelector","blockSelector","maskAllElementAttributes"].filter(t=>{var i=null==r?void 0:r[t],n=e[t];return!Q(i)&&i!==n});0!==i.length&&(this.de=!0,Qi.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:e}))}}}get Je(){var t;return ut(null==(t=this._instance.config.session_recording.canvasCapture)?void 0:t.resolutionScale,.1,1,te("canvas recording resolution scale"),1)}get Ke(){var t,e,r,i,n,o,a,s=this._instance.config.session_recording.captureCanvas,u=null==(t=this.zt)?void 0:t.canvasRecording,l=null!==(e=null!==(r=null==s?void 0:s.recordCanvas)&&void 0!==r?r:null==u?void 0:u.enabled)&&void 0!==e&&e,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!==(o=null!==(a=null==s?void 0:s.canvasQuality)&&void 0!==a?a:null==u?void 0:u.quality)&&void 0!==o?o:.4;if("string"==typeof c){var d=parseFloat(c);c=isNaN(d)?.4:d}return{enabled:l,fps:ut(h,0,12,te("canvas recording fps"),4),quality:ut(c,0,1,te("canvas recording quality"),.4)}}get Xe(){var t,e,r=!(null==(t=this.zt)||!t.consoleLogRecordingEnabled);return null!==(e=this._instance.config.enable_recording_console_log)&&void 0!==e?e:r}get Ye(){var t,e,r,i=null==(t=this.zt)?void 0:t.networkPayloadCapture,n={recordHeaders:null==(e=this._instance.config.session_recording)?void 0:e.recordHeaders,recordBody:null==(r=this._instance.config.session_recording)?void 0:r.recordBody},o=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),a=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),s=Vi(this._instance.config.capture_performance),u=Vi(null==i?void 0:i.capturePerformance),l=!!(et(s)?s:u);return o||a||l?{recordHeaders:o,recordBody:a,recordPerformance:l}:void 0}tr(){var t,r,i=[],n=null==(t=h.__PosthogExtensions__)||null==(t=t.rrwebPlugins)?void 0:t.getRecordConsolePlugin;n&&this.Xe&&i.push(n());var o=null==(r=h.__PosthogExtensions__)||null==(r=r.rrwebPlugins)?void 0:r.getRecordNetworkPlugin;if(this.Ye&&Z(o))if(!oe.includes(s.hostname)||this._forceAllowLocalhostNetworkCapture){var a=Z(this._instance.requestRouter.isIngestionEndpoint)?this._instance.requestRouter.isIngestionEndpoint.bind(this._instance.requestRouter):void 0;i.push(o(((t,r,i)=>{var n,o={payloadSizeLimitBytes:Pe.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Pe.performanceEntryTypeToObserve],payloadHostDenyList:[...r.payloadHostDenyList||[],...Pe.payloadHostDenyList]},a=!1!==t.session_recording.recordHeaders&&r.recordHeaders,s=!1!==t.session_recording.recordBody&&r.recordBody,u=!1!==t.capture_performance&&r.recordPerformance,l=(n=De(o),t=>(null!=t&&t.requestBody&&(t.requestBody=He(t.requestBody,t.requestHeaders,n,"Request")),null!=t&&t.responseBody&&(t.responseBody=He(t.responseBody,t.responseHeaders,n,"Response")),t)),h=e=>{return l(((t,e,r)=>{var i;if(null==r||!r(t.name)){var n=ae(t.name),o=0===e.indexOf("http")?null==(i=ae(e))?void 0:i.pathname:e;"/"===o&&(o="");var a=null==n?void 0:n.pathname.replace(o||"","");if(!(n&&a&&Be.some(t=>0===a.indexOf(t))))return t}})((je((r=e).requestHeaders),je(r.responseHeaders),r),t.api_host,i));var r},c=Z(t.session_recording.maskNetworkRequestFn);return c&&Z(t.session_recording.maskCapturedNetworkRequestFn)&&Yt.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),c&&(t.session_recording.maskCapturedNetworkRequestFn=r=>{var i=t.session_recording.maskNetworkRequestFn({url:r.name});return!i&&r.isInitial?i:e({},r,{name:null==i?void 0:i.url})}),o.maskRequestFn=Z(t.session_recording.maskCapturedNetworkRequestFn)?e=>{var r=h(e);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==t.session_recording.maskCapturedNetworkRequestFn?void 0:t.session_recording.maskCapturedNetworkRequestFn(r);return Y(n)&&i?(Ue.add(i),i):null!=n?n:void 0}}:t=>function(t){if(!Q(t))return t.requestBody=$e(t.requestBody,"Request"),t.responseBody=$e(t.responseBody,"Response"),t}(h(t)),e({},Pe,o,{recordHeaders:a,recordBody:s,recordPerformance:u,recordInitialRequests:u,streamNetworkBody:!0===t.session_recording.streamNetworkBody})})(this._instance.config,this.Ye,a)))}else Qi.info("NetworkCapture not started because we are on localhost.");return i}er(t){return this._instance.config.disable_capture_url_hashes?Rt(t):t}rr(t,e){void 0===e&&(e=!1);var r=e?Rt(t):this.er(t),i=this._instance.config.mask_personal_data_properties?[...ki,...this._instance.config.custom_personal_data_properties||[]]:[];return this.ir(function(t,e){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],s=(o||"").split("&"),u=[],l=0;s.length>l;l++){var h=s[l].split("=");V(h)&&(e.includes(h[0])?u.push(h[0]+"=<masked>"):u.push(s[l]))}var c=a;return null!=o&&(c+="?"+u.join("&")),null!=i&&(c+="#"+i),c}(r,i))}ir(t){var e,r=this._instance.config.session_recording;if(r.maskCapturedNetworkRequestFn){var i,n=r.maskCapturedNetworkRequestFn({name:t});return null!==(i=null==n?void 0:n.name)&&void 0!==i?i:null==n?void 0:n.url}return r.maskNetworkRequestFn?null==(e=r.maskNetworkRequestFn({url:t}))?void 0:e.url:t}nr(t){try{return t.rrwebMethod(),!0}catch(e){return 10>this.Xt.length?this.Xt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt+1,rrwebMethod:t.rrwebMethod}):Qi.warn("could not emit queued rrweb event.",e,t),!1}}Dt(t,e){return this.nr(Ki(()=>Yi().addCustomEvent(t,e)))}ar(){var t;return this.Qt&&!0===(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)&&!this.Y.urlBlocked&&!0!==this.Yt}sr(t){if(!this.ar())return!1;try{var e=Yi();return!!e&&(e.addCustomEvent("$json_ld",t),this.ar())}catch(t){return!1}}ur(t){void 0===t&&(t=!1),Promise.resolve().then(()=>{var e;return null==(e=this.lr)?void 0:e.scan(t)})}hr(){try{if(this._instance.config.capture_pageview||!r)return;var t=new URL(r.location.href),e=this.rr(t.origin+t.pathname+t.search);this.cr!==e&&(this.cr=e,this.Dt("$url_changed",{href:e}))}catch(t){}}dr(){if(this.Xt.length){var t=[...this.Xt];this.Xt=[],t.forEach(t=>{Date.now()-t.enqueuedAt>2e3||this.nr(t)})}}It(){return this.nr(Ki(()=>Yi().takeFullSnapshot()))}get vr(){var t,e,r;if(null!=(t=this.Vt)&&t.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 tt(n)&&Number.isFinite(n)&&n>=1e3&&36e5>=n?n:6e4}return null!==(e=null==(r=this._instance.config.session_recording)?void 0:r.full_snapshot_interval_millis)&&void 0!==e?e:3e5}pr(){if(this.gr&&clearInterval(this.gr),!0!==this.Yt){var t=this.vr;t&&(this.gr=setInterval(()=>{this.It()},t))}}Rt(t){"event"===t&&this.mr(),!this.Y.urlBlocked&&["sampled","active"].includes(this.status)&&this.pr()}yr(){var t;this.Y.urlBlocked||(this.Y.urlBlocked=!0,null==(t=this.lr)||t.scan(),clearInterval(this.gr),Qi.info("recording paused due to URL blocker"),this.Dt("recording paused",{reason:"url blocker"}))}br(){var t;this.Y.urlBlocked&&(null==(t=this.lr)||t.scan(),this.Y.urlBlocked=!1,this.It(),this.ur(),this.pr(),this.Dt("recording resumed",{reason:"left blocked url"}),Qi.info("recording resumed"))}wr(t,e){var r;if("event"===t&&this.mr(),!this.Kt&&null!=(r=this.Vt)&&r.hasPendingTriggers(this.sessionId)){this.Kt=!0;try{var i,n,o="url"===t?b:w;null==(i=this._instance.persistence)||i.register({[o]:this.sessionId}),null==(n=this.Vt)||n.updateActiveTriggers(this.sessionId),this.Rt(),this.$e(),this.Tt(t+"_trigger_matched",{["url"===t?"matchedUrl":"matchedEvent"]:e})}finally{this.Kt=!1}}}get isStarted(){return!!this.Gt}get zt(){var t=this._instance.get_property(c);if(t){var e;try{e=G(t)?t:JSON.parse(t)}catch(t){return void Qi.warn("persisted remote config for session recording is invalid and will be ignored",t)}if(!this.isStarted&&!this.Le){var r,i,n=null!==(r=e.cache_timestamp)&&void 0!==r?r:Date.now();if(Date.now()-n>36e5)return Qi.info("persisted remote config for session recording is stale and will be ignored",{cacheTimestamp:n,persistedConfig:t}),void(null==(i=this._instance.persistence)||i.unregister(c))}return e}}kr(t,e,r){this._instance.get_property(t)&&(e(),r())}start(t){var e,i,n=this.zt;if(n){if(!this.isStarted){var o=!1!==this.Yt&&!this.se;this.Be(o?"no_interaction_since_recording_started":void 0),this.se=!1,this.oe=o,this.ae=!1}this._e&&(this._r(),this.Ue());var s=this.Ht.checkAndGetSessionAndWindowId(),u=s.windowId;this.Bt=s.sessionId,this.Ie=u,null==(e=this._instance.persistence)||e.unregister(x),null!=n&&n.endpoint&&(this.Zt=null==n?void 0:n.endpoint),this.Vt=2===(null==n?void 0:n.version)&&null!=n&&n.triggerGroups&&n.triggerGroups.length>0?new wi(this._instance,this.Y,this.Tt.bind(this),this.Dt.bind(this),this.Rt.bind(this)):new bi(this._instance,this.Y,this.tt,this.et,this.Tt.bind(this),this.It.bind(this),this.Rt.bind(this)),this.Vt.onRemoteConfig(n),null==(i=this.Ot)||i.call(this),this.Ot=this.Vt.setupEventTriggerListeners(this._instance.on.bind(this._instance,"eventCaptured"),this.sessionId,(t,e)=>this.wr(t,e)),this.kr(v,()=>{this.overrideSampling()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(v)}),this.kr(f,()=>{this.overrideLinkedFlag()},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(f)}),this.kr(g,()=>{this.overrideTrigger("event")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(g)}),this.kr(p,()=>{this.overrideTrigger("url")},()=>{var t;return null==(t=this._instance.persistence)?void 0:t.unregister(p)}),this.Vt.makeSamplingDecisions(this.sessionId),this.Sr(),this.ue||(ne(r,"beforeunload",this.qe),ne(r,"pagehide",this.ze),ne(r,"offline",this.We),ne(r,"online",this.Ve),ne(a,"visibilitychange",this.Ze),!this.xe&&Z(this.Ht.onSessionId)&&(this.xe=this.Ht.onSessionId(this.Te)),!this.Ce&&Z(this.Ht.on)?this.Ce=this.Ht.on("forcedIdleReset",()=>{this.Ae(),this.Yt="unknown",this.stop(),this.Me=this.Ht.onSessionId((t,e,r)=>{var i;null==(i=this.Me)||i.call(this),this.Me=void 0,this.Te(t,e,r)})}):Z(this.Ht.on)||Qi.warn("bundled core has no SessionIdManager.on (requires posthog-js >= 1.268.6); recording will start but skip forced-idle-reset handling"),Y(this.Se)&&(this.Se=this._instance.on("eventCaptured",t=>{try{if("$pageview"===t.event){var e=null!=t&&t.properties.$current_url?this.rr(t.properties.$current_url):"";if(!e)return;this.Dt("$pageview",{href:e})}}catch(t){Qi.error("Could not add $pageview to rrweb session",t)}})),"active"===this.status&&this.Tt(t||"recording_initialized"))}else Qi.info("remote config must be stored in persistence before recording can start")}Cr(){var t,e,i,n,o,s;null==r||r.removeEventListener("beforeunload",this.qe),null==r||r.removeEventListener("pagehide",this.ze),null==r||r.removeEventListener("offline",this.We),null==r||r.removeEventListener("online",this.Ve),null==a||a.removeEventListener("visibilitychange",this.Ze),clearInterval(this.gr),this.Mr(),null==(t=this.Se)||t.call(this),this.Se=void 0,null==(e=this.Ot)||e.call(this),this.Ot=void 0,null==(i=this.xe)||i.call(this),this.xe=void 0,null==(n=this.Ce)||n.call(this),this.Ce=void 0,null==(o=this.Me)||o.call(this),this.Me=void 0,null==(s=this.Vt)||s.stop(),this.Tr(),this._r()}_r(){this.ke+=1,this.be=[],this.we=0,this.Ir=void 0,this._e=!1}Tr(){var t,e,r;null==(t=this.Rr)||t.stop(),this.Xt=[],null==(e=this.lr)||e.stop(),this.lr=void 0,this.Qt=!1,null==(r=this.Gt)||r.call(this),this.Gt=void 0}Ar(){if(!this.Ir||0===this.we)return!1;if(this._e)return!0;this._e=!0,this.Er=void 0;var t=this.ke;return this.Mr(),this.Tr(),this.Ir.catch(()=>{}).then(()=>{t===this.ke&&(this._e=!1,this.$e(),this.Ue(),this.Lr(),this.Cr(),Qi.info("stopped"))}).catch(()=>{this._e=!1,this.Lr(),this.Cr(),Qi.info("stopped")}),!0}stop(){if(this.Tr(),this.Le)this.He();else if(this.Ar())return;this.$e(),this.Ue(),this.Lr(),this.Cr(),Qi.info("stopped")}Lr(){this.Be(void 0,{preserveLogDedup:this.Le}),this.oe=!1}flushBeforeIdentityReset(){(this.isStarted||this._e)&&(this.He(),this.$e())}Ee(t){this.Le=!0,this.Jt=Date.now();try{var e;this.stop(),this.Or=void 0,this.Dr=void 0,this.ee=0,this.re=0,this.ie=0,null==(e=Xi())||null==e.resetSnapshotCostState||e.resetSnapshotCostState(),this.start("session_id_changed")}finally{this.Le=!1}this.Be(t?"no_interaction_since_session_rotated":void 0),this.oe=!1}Be(t,e){var r=(void 0===e?{}:e).preserveLogDedup,i=void 0!==r&&r;if(this.ne=!Q(t),this.Er=t,Q(t))i||(this.Pr=void 0);else if(!this.Le){var n=this.sessionId+":"+t;n!==this.Pr&&(this.Pr=n,Qi.info("holding buffer: "+t+". nothing is uploaded until the user interacts with the page"))}}mr(){this.isStarted||(this.se=!0),this.ne&&(this.Be(void 0),this.oe=!1,this.ae&&(this.ae=!1,this.It()),this.Fr())}discard(t){var e=(void 0===t?{}:t).discardProducerEvents,r=void 0!==e&&e;this.ne=!0,r&&(this.Ue(),this.Tr()),this.Ue(),this.Cr(),this.Ue(),this.Lr(),Qi.info("discarded")}Nr(t,e,r,i,n){var o={$snapshot_bytes:r,$snapshot_data:e,$session_id:i,$window_id:n};"disabled"!==this.status?(this.qr(t,i),this.jr(o)):this.Ue()}Br(){try{this.Hr()}catch(t){this.ce||(this.ce=!0,Qi.error("could not track full snapshot cost",t))}}Hr(){var t,e=null==(t=Xi())||null==t.getLastSnapshotCost?void 0:t.getLastSnapshotCost();e&&e!==this.Dr&&(this.Dr=e,this.Or&&this.Or.durationMs>=e.durationMs||(this.Or=e),500>e.durationMs||Qi.warn("full snapshot was slow, the page may have been unresponsive while it ran",{durationMs:Math.round(e.durationMs),stylesheetMs:Math.round(e.stylesheetMs),nodeCount:e.nodeCount,cssRuleCount:e.cssRuleCount,nonDeferrableCssRuleCount:e.nonDeferrableCssRuleCount,deferredStylesheetCount:e.deferredStylesheetCount}))}qr(t,e){2!==t.type?3===t.type&&(Q(this.me)||this.me===e||this.ye===e||(this.ye=e,Qi.info("incremental snapshot for a session with no full snapshot - requesting one",{sessionId:e}),this.It())):this.me=e}$r(t){t.counted&&t.generation===this.ke&&(this.we=Math.max(0,this.we-1)),t.counted=!1,this.be=this.be.filter(e=>e!==t)}Ur(t,e,r){t.processed||t.generation!==this.ke||(t.processed=!0,this.Nr(t.event,e,r,t.targetSessionId,t.targetWindowId))}zr(t){try{var e=t.event,r=fr(t.event);if(t.compressionEnabled)try{var i=fn(t.event);e=i.event,r=i.size}catch(t){Qi.error("could not process queued compression event - will use uncompressed event",t)}try{this.Ur(t,e,r)}catch(t){Qi.error("could not capture queued compression event",t)}}finally{this.$r(t)}}He(){[...this.be].forEach(t=>{this.zr(t)})}Wr(t,e,r,n){var o=this,a={event:t,compressionEnabled:e,targetSessionId:r,targetWindowId:n,generation:this.ke,processed:!1,counted:!0};this.be.push(a),this.we+=1;var s=function(){var r=i(function*(){try{if(a.processed)return;var r,i;try{var n=e?hn(t)?yield function(t){return pn.apply(this,arguments)}(t):fn(t):{event:t,size:fr(t)};r=n.event,i=n.size}catch(e){Qi.error("could not process queued compression event - will use uncompressed event",e),r=t,i=fr(t)}o.Ur(a,r,i)}finally{o.$r(a)}});return function(){return r.apply(this,arguments)}}();this.Ir=this.Ir?this.Ir.catch(()=>{}).then(s):s()}onRRwebEmit(t){var e,r,i,n,o,a,s,u,l;if(this._instance.sessionManager&&(this.dr(),t&&G(t))){if(4===t.type){var h=this.rr(t.data.href);if(this.cr=h,!h)return;t.data.href=h}else this.hr();if(null==(e=this.Vt)||e.checkUrlTriggers(this.sessionId,()=>this.yr(),()=>this.br(),(t,e)=>this.wr(t,e)),!this.Y.urlBlocked||function(t){return 5===t.type&&"recording paused"===t.data.tag}(t)){var c,d,v;2===t.type&&(null!=(c=Xi())&&null!=c.wasMaxDepthReached&&c.wasMaxDepthReached()&&(this.he=!0),this.Br(),Promise.resolve().then(()=>this.Br()),this.pr(),null==(d=this.Rr)||d.reset(),null==(v=this._instance.persistence)||v.register_once({[x]:t.timestamp},void 0));var f=2===t.type&&(null==(r=this.Vt)?void 0:r.hasPendingTriggers(this.sessionId));f&&this.Vr();var p=this.Rr?this.Rr.throttleMutations(t):t;if(p){var g=function(t){var e=t;if(e&&G(e)&&6===e.type&&G(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var r=[],i=0;e.data.payload.payload.length>i;i++)r.push(e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?e.data.payload.payload[i].slice(0,2e3)+"...[truncated]":e.data.payload.payload[i]);return e.data.payload.payload=r,t}return t}(p),m=function(t){return yn(t)?t.data.payload:null}(g),y=function(t){return bn(t)?t.data.payload:null}(g),b=function(t){return mn(t)?t.data.payload:null}(g);m||y?null!=m&&m.lastActivityTimestamp&&(g.timestamp=m.lastActivityTimestamp):null!=b&&b.sessionId||this.Zr(g),2===t.type&&(this.ge.push([this.Bt,t.timestamp]),this.ge.length>6&&(this.ge=this.ge.slice(-6)));var w=null!==(i=null!==(n=null!==(o=null==m?void 0:m.currentSessionId)&&void 0!==o?o:null==y?void 0:y.nextSessionId)&&void 0!==n?n:null==b?void 0:b.sessionId)&&void 0!==i?i:this.Bt,k=null!==(a=null!==(s=null!==(u=null==m?void 0:m.currentWindowId)&&void 0!==u?u:null==y?void 0:y.nextWindowId)&&void 0!==s?s:null==b?void 0:b.windowId)&&void 0!==a?a:this.Ie;if(!0!==this.Yt||function(t){return mn(t)||yn(t)||bn(t)}(g)){2===g.type&&(this.te=0),b&&(g.timestamp=b.lastActivityTimestamp+b.threshold);var _=this.Qt;this.Qt=!0,f?this.ur(!0):_||this.ur();var S=null===(l=this._instance.config.session_recording.compress_events)||void 0===l||l;if(this.we>0||S&&hn(g))this.Wr(g,S,w,k);else{var C=S?fn(g):{event:g,size:fr(g)};this.Nr(g,C.event,C.size,w,k)}}else(function(t){return 2===t.type||4===t.type||3===t.type&&9!==t.data.source})(g)&&this.te++}else!0===this.Yt&&this.te++}}}get status(){return this.Vt?this.Vt.getStatus({instance:this._instance,sessionId:this.sessionId,isSampled:this.Ut,rrwebError:this.ue,urlTriggerMatching:this.Y,eventTriggerMatching:this.tt,linkedFlagMatching:this.et,remoteConfig:this.zt}):ze}log(t,e){var r;void 0===e&&(e="log"),null==(r=this._instance.sessionRecording)||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:e,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}overrideLinkedFlag(){this.et.linkedFlagSeen=!0,this.It(),this.mr(),this.Tt("linked_flag_overridden")}overrideSampling(){var t;null==(t=this._instance.persistence)||t.register({[m]:this.sessionId,[d]:null}),this.It(),this.mr(),this.Tt("sampling_overridden")}overrideTrigger(t){this.wr(t),this.mr()}Gr(){try{var t,e=null==r||null==(t=r.location)?void 0:t.href;if(!e)return;var i=this.rr(e);if(!i)return;return new URL(i).hostname||void 0}catch(t){return}}Mr(){this.Qr&&(clearTimeout(this.Qr),this.Qr=void 0)}Fr(){this.Qr||(this.Qr=setTimeout(()=>{this.$e()},2e3))}Jr(){return this.me!==this.Pe.sessionId&&0!==this.Pe.data.length&&this.Pe.data.every(t=>5===(null==t?void 0:t.type)&&!yn(t)&&!bn(t))}Kr(){var t,e;return null!==(t=null==(e=this.Vt)?void 0:e.getPendingTriggerConditions(this.sessionId))&&void 0!==t?t:[]}Xr(t){if("buffering"!==t)return Q(this.Yr)||this._instance.register_for_session({[E]:[]}),void(this.Yr=void 0);var e=this.Kr();if(0===e.length)return Q(this.Yr)||this._instance.register_for_session({[E]:[]}),void(this.Yr=void 0);var r=e.join(", "),i=this.sessionId+":"+r;i!==this.Yr&&(this.Yr=i,this._instance.register_for_session({[E]:e}),Qi.info("buffering: "+r))}$e(){var t;if(this.Mr(),this.ne)return this.Pe;if(this.Jr())return this.Pe.size>943718.4?this.Ue():this.Pe;var e=this.Pe;null==(t=this.Vt)||t.ensureSamplingDecision(this.sessionId);var r=this.Fe(),i=this.status;if(this.Xr(i),"buffering"===i||"paused"===i||"disabled"===i||r)return this.Fr(),this.Pe;if(this.Pe!==e)return this.Pe;if(e.data.length>0){var n,o=this.Gr();gr(e).forEach(t=>{try{var e;null==(e=this.Re)||e.trackSize(t.sessionId,t.size),this.ti({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId,$lib:Xr.LIB_NAME,$lib_version:Xr.LIB_VERSION,$snapshot_host:o})}catch(t){Qi.warn("could not capture snapshot chunk - skipping it",t)}}),null==(n=this.Vt)||n.onFlushComplete()}return this.Ue()}jr(t){var e,r=2+((null==(e=this.Pe)?void 0:e.data.length)||0),i=t.$session_id,n=this.Pe.sessionId!==i;if(n||!0!==this.Yt&&!this.ne&&this.Pe.size+t.$snapshot_bytes+r>943718.4){var o=this.Bt;if(this.Pe=this.$e(),this.Bt!==o)return;n&&this.Pe.data.length>0&&(this.Pe=this.Ue()),this.Pe.sessionId=i,this.Pe.windowId=t.$window_id}this.ne&&(this.ae||this.Pe.size+t.$snapshot_bytes+r>943718.4)?this.ae||(this.ae=!0,this.Pe=this.Ue()):(this.Pe.size+=t.$snapshot_bytes,this.Pe.data.push(t.$snapshot_data),this.Pe.sizes.push(t.$snapshot_bytes),!0===this.Yt||this.ne||this.Fr())}ti(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.Zt),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}get Ne(){var t,e,r=null==(t=this.Pe)?void 0:t.data[(null==(e=this.Pe)?void 0:e.data.length)-1],i=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return r?r.timestamp-i:null}Vr(){if(!this.Pe||0===this.Pe.data.length)return this.Ue();for(var t=-1,e=this.Pe.data.length-1;e>=0;e--)if(4===this.Pe.data[e].type){t=e;break}return 0>t?this.Ue():(this.Pe.data=this.Pe.data.slice(t),this.Pe.sizes=this.Pe.sizes.slice(t),this.Pe.size=this.Pe.sizes.reduce((t,e)=>t+e,0),this.Pe)}Ue(){return this.Pe={size:0,data:[],sizes:[],sessionId:this.Bt,windowId:this.Ie},this.Pe}Tt(t,r){this._instance.register_for_session({[N]:t}),Qi.info(t.replace("_"," "),r),"session_id_changed"!==t&&this.Dt("$recording_started",e({reason:t},r))}ei(t){var e;return 3===t.type&&-1!==Ji.indexOf(null==(e=t.data)?void 0:e.source)}Zr(t){var e=this.ei(t);e||!0===this.Yt||t.timestamp-this.Jt>this.$t&&(this.Yt=!0,clearInterval(this.gr),this.Dt("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.Jt,threshold:this.$t,bufferLength:this.Pe.data.length,bufferSize:this.Pe.size,sessionId:this.Bt,windowId:this.Ie}),this.$e());var r=!1;if(e&&(this.Jt=t.timestamp,this.Yt)){var i="unknown"===this.Yt;this.Yt=!1,i||(this.Dt("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}var n=this.Ht.checkAndGetSessionAndWindowId(!e,t.timestamp),o=n.windowId,a=n.sessionId,s=this.Bt!==a,u=this.Ie!==o;if(this.Ie=o,this.Bt=a,s||u){var l=s&&!1!==this.Yt;l&&(this.Yt="unknown"),this.Ee(l)}else if(e&&this.mr(),r){var h,c=["sampled","active"].includes(this.status)||(null==(h=this.Vt)?void 0:h.hasPendingTriggers(this.sessionId));this.te>0&&c&&this.It(),this.ur(),this.pr()}}Ae(){var t;null==(t=this.Vt)||t.clearConditionalRecordingPersistence()}get sdkDebugProperties(){var t,e,r,i,n,o,a,s,u,l=this.Ht.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp,h=null==(t=Xi())||null==t.getDeferredStylesheetStats?void 0:t.getDeferredStylesheetStats();return{$recording_status:this.status,$sdk_debug_replay_flush_hold_reason:this.Er,$sdk_debug_replay_internal_buffer_length:this.Pe.data.length,$sdk_debug_replay_internal_buffer_size:this.Pe.size,$sdk_debug_current_session_duration:this.Ne,$sdk_debug_session_start:l,$sdk_debug_replay_flushed_size:null==(e=this.Re)?void 0:e.currentTrackedSize(this.sessionId),$sdk_debug_replay_full_snapshots:this.ge,$snapshot_max_depth_exceeded:this.he,$sdk_debug_replay_slowest_full_snapshot_ms:Wi(null==(r=this.Or)?void 0:r.durationMs),$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms:Wi(null==(i=this.Or)?void 0:i.stylesheetMs),$sdk_debug_replay_slowest_full_snapshot_nodes:null==(n=this.Or)?void 0:n.nodeCount,$sdk_debug_replay_slowest_full_snapshot_css_rules:null==(o=this.Or)?void 0:o.cssRuleCount,$sdk_debug_replay_slowest_full_snapshot_css_rules_non_deferrable:null==(a=this.Or)?void 0:a.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:Wi(null==h?void 0:h.totalMs),$sdk_debug_replay_deferred_stylesheet_slowest_slice_ms:Wi(null==h?void 0:h.slowestSliceMs),$sdk_debug_replay_slowest_mutation_batch_ms:Wi(null==(s=Xi())||null==s.getMutationCost||null==(s=s.getMutationCost())?void 0:s.slowestBatchMs),$sdk_debug_replay_discarded_duration_samples:null==(u=Xi())||null==u.getDiscardedDurationSamples?void 0:u.getDiscardedDurationSamples(),$sdk_debug_replay_throttled_mutations_dropped:this.ee,$sdk_debug_replay_oversized_mutations_dropped:this.re,$sdk_debug_replay_oversized_mutation_bytes_dropped:this.ie,$sdk_debug_replay_rrweb_error:this.ue,[P]:!!this.Gt,[F]:this.le}}Sr(){var t;if(!this.Gt){this.le=!0;var i,n,o,s,u={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},l=this._instance.config.session_recording;for(var h of Object.entries(l||{})){var c=h[0],d=h[1];if(c in u)if("maskInputOptions"===c)u.maskInputOptions=e({password:!0},d);else if("sampling"===c){var v=null!=d?d:{},f={};Q(v.mousemove)||(f.mousemove=v.mousemove),Q(v.mouseInteraction)||(f.mouseInteraction=v.mouseInteraction),u.sampling=f}else u[c]=d}!0===(null==l?void 0:l.captureJsonLd)&&!0!==u.slimDOMOptions&&"all"!==u.slimDOMOptions&&(u.slimDOMOptions=e({},u.slimDOMOptions,{script:!0})),this.Ke&&this.Ke.enabled&&(u.recordCanvas=!0,u.sampling=e({},u.sampling,{canvas:this.Ke.fps}),u.dataURLOptions={type:"image/webp",quality:this.Ke.quality},u.canvasResolutionScale=this.Je,u.canvasMasking={configured:()=>{var t;return Z(null==(t=this._instance.config.session_recording)||null==(t=t.canvasCapture)?void 0:t.maskRegionsFn)},regionsFn:t=>{var e,r=null==(e=this._instance.config.session_recording)||null==(e=e.canvasCapture)?void 0:e.maskRegionsFn;if(Z(r))try{var i;return null!==(i=r(t))&&void 0!==i?i:null}catch(t){return this.fe||(this.fe=!0,Qi.warn("canvasCapture.maskRegionsFn threw, canvas frames will be skipped",t)),null}}}),this.Ge&&(u.maskAllInputs=null===(i=this.Ge.maskAllInputs)||void 0===i||i,u.maskTextSelector=null!==(n=this.Ge.maskTextSelector)&&void 0!==n?n:void 0,u.blockSelector=null!==(o=this.Ge.blockSelector)&&void 0!==o?o:void 0,u.maskAllElementAttributes=null!==(s=this.Ge.maskAllElementAttributes)&&void 0!==s&&s),u.maskAllElementAttributes&&u.maskAttributeFn&&(u.maskAttributeFn=void 0,this.ve||(this.ve=!0,Qi.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.Qe();var p=Yi();if(p){this.Rr=null!==(t=this.Rr)&&void 0!==t?t:new Kr(p,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(t,e)=>{var r="Too many mutations on node '"+t+"'. Rate limiting. This could be due to SVG animations or something similar";Qi.info(r,{node:e}),this.log("[SessionRecording] "+r,"warn")},onDroppedAttributeMutations:t=>this.ee+=t,bytesRefillRate:this._instance.config.session_recording.__mutationBytesRefillRate,bytesBucketSize:this._instance.config.session_recording.__mutationBytesBucketSize,resyncIntervalMs:this.vr,onDroppedOversizedMutation:t=>{0===this.re&&this.log("[SessionRecording] Dropped an oversized DOM mutation to keep the recording playable. The recording will resync with a full snapshot.","warn"),this.re+=1,this.ie+=t},requestFullSnapshot:()=>this.It()});var g=this.tr();if(this.Gt=p(e({emit:t=>{this.onRRwebEmit(t)},plugins:g,errorHandler:(t,e)=>"rrweb"===e&&(this.pe||(this.pe=!0,Qi.error("rrweb internal error - recording will continue but may be incomplete",t)),!0)},u)),!this.Gt)return this.ue=!0,void Qi.error("rrweb failed to start - Loss of recording data is possible. Check the browser console for rrweb errors.");this.ue=!1,!0===(null==l?void 0:l.captureJsonLd)&&a&&null!=r&&r.MutationObserver&&!this.lr&&(this.lr=function(t,e,r){var i=new WeakMap,n=r.getCaptureState||(()=>!0),o=_i,a=function(t,e){var r=e.attributeFilter;return e.maskAllElementAttributes||e.maskAttributeFn||null!=r&&r.length&&!r.includes("id")?Ci:r=>{var i=t.getElementById(r);return!!i&&"SCRIPT"!==i.nodeName&&(!e.isRecordedElement||e.isRecordedElement(i))&&!Ui(i,e.blockClass,e.blockSelector)}}(t,r),s=e=>{try{var s=n();if(!o||!1===s||!e.isConnected||e.ownerDocument!==t||function(t,e){return Ui(t,e.blockClass,e.blockSelector)||Ui(t,e.maskTextClass,e.maskTextSelector)}(e,r))return;var u=function(t,e){if(void 0===e&&(e=Ci),!t||t.length>_i)return null;try{var r=JSON.parse(t),i={remainingNodes:2048,exceeded:!1},n=V(r)?r.map(t=>Bi(t,e,i)):Bi(r,e,i);if(i.exceeded||X(n)||V(n)&&(!n.length||n.some(X)))return null;var o=JSON.stringify(n);return o.length>2e4?null:[n,o]}catch(t){return null}}(e.text,a);if(!u)return void i.delete(e);var l=u[0],h=u[1];if(X(s))return void i.set(e,h);if(i.get(e)!==h){if(h.length>o)return void(o=0);r.emit(l)&&(i.set(e,h),o-=h.length)}}catch(t){return}};try{var u=new e(t=>{try{if(!o||!1===n())return;var e=t=>{for(var e of zi(t))s(e)};for(var r of t)if("childList"===r.type)Hi(r.target)&&s(r.target),r.addedNodes.forEach(e);else if("characterData"===r.type){var i=r.target.parentNode;i&&Hi(i)&&s(i)}else"attributes"===r.type&&Hi(r.target)&&s(r.target)}catch(t){return}});return u.observe(t,{attributes:!0,attributeFilter:["type"],characterData:!0,childList:!0,subtree:!0}),{scan(e){void 0===e&&(e=!1),o&&!1!==n()&&zi(t.documentElement).forEach(t=>{e&&i.delete(t),s(t)})},stop(){return u.disconnect()}}}catch(t){return{scan(){},stop(){}}}}(a,r.MutationObserver,{attributeFilter:u.attributeFilter,blockClass:u.blockClass,blockSelector:u.blockSelector,isRecordedElement:t=>p.mirror.getId(t)>0,maskAllElementAttributes:u.maskAllElementAttributes,maskAttributeFn:u.maskAttributeFn,maskTextClass:u.maskTextClass,maskTextSelector:u.maskTextSelector,getCaptureState:()=>{var t;return!0!==(null==(t=this._instance.config.session_recording)?void 0:t.captureJsonLd)||this.Y.urlBlocked||this.Y.isCurrentUrlBlocked()?null:this.ar()},emit:t=>this.sr(t)}),this.Y.isCurrentUrlBlocked()&&this.lr.scan()),this.Jt=Date.now(),this.Yt=et(this.Yt)?this.Yt:"unknown",this.tryAddCustomEvent("$remote_config_received",this.zt),this.Dt("$session_options",{sessionRecordingOptions:u,activePlugins:g.map(t=>null==t?void 0:t.name)}),this.Dt("$posthog_config",{config:this._instance.config})}else Qi.error("_startRecorder was called but rrwebRecord is not available. This indicates something has gone wrong.")}}tryAddCustomEvent(t,e){return this.Dt(t,e)}},kn=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}({}),_n=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}({}),Sn=function(t){return t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t}({}),xn=function(t){return t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t}({}),Cn=function(t){return t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t}({}),Mn=function(t){return t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t}({}),Tn=function(t){return t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t}({});function In(t,e){return-1!==t.indexOf(e)}"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Rn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot"],MutationObserver:[]},An={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:["querySelector","querySelectorAll"],MutationObserver:["constructor"]},En={};function Ln(t){if(En[t])return En[t];var e=function(t){var e,r,i=null===(e=globalThis)||void 0===e||null===(e=e.Zone)||void 0===e||null===(r=e.__symbol__)||void 0===r?void 0:r.call(e,t);return i&&globalThis[i]?globalThis[i]:void 0}(t)||globalThis[t],r=e.prototype,i=t in Rn?Rn[t]:void 0,n=Boolean(i&&i.every(t=>{var e;return Boolean(null===(e=Object.getOwnPropertyDescriptor(r,t))||void 0===e||null===(e=e.get)||void 0===e?void 0:e.toString().includes("[native code]"))})),o=t in An?An[t]:void 0,a=Boolean(o&&o.every(t=>{var e;return"function"==typeof r[t]&&(null===(e=r[t])||void 0===e?void 0:e.toString().includes("[native code]"))}));if(n&&a)return En[t]=e.prototype,e.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 e.prototype;var h=l[t].prototype;return h?(function(t){return In(t,"AppleWebKit")&&!In(t,"Chrome")}(navigator.userAgent)&&(s.classList.add("rr-block","ph-no-capture"),s.setAttribute("__rrwebUntaintedPrototype",t),u=!0),En[t]=h):r}catch(t){return r}finally{!u&&s.parentNode&&document.body.removeChild(s)}}var On={};function Dn(t,e,r){var i,n=t+"."+String(r);if(On[n])return On[n].call(e);var o=Ln(t),a=null===(i=Object.getOwnPropertyDescriptor(o,r))||void 0===i?void 0:i.get;return a?(On[n]=a,a.call(e)):e[r]}var Pn={};function Fn(t,e,r){var i=t+"."+String(r);if(Pn[i])return Pn[i].bind(e);var n=Ln(t)[r];return"function"!=typeof n?e[r]:(Pn[i]=n,n.bind(e))}function Nn(){return Ln("MutationObserver").constructor}function qn(t,e,r){try{if(!(e in t))return()=>{};var i=t[e],n={next:i},o=r(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return n.next.apply(this,e)});return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:i},__rrweb_layer__:{enumerable:!1,value:n}})),t[e]=o,()=>{if(t[e]!==o)for(var r=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},i=t[e],a=r(i);a;){if(a.next===o)return void(a.next=n.next);a=r(i=a.next)}else t[e]=n.next}}catch(t){return()=>{}}}var jn={childNodes:t=>Dn("Node",t,"childNodes"),parentNode:t=>Dn("Node",t,"parentNode"),parentElement:t=>Dn("Node",t,"parentElement"),textContent:t=>Dn("Node",t,"textContent"),contains:(t,e)=>Fn("Node",t,"contains")(e),getRootNode:t=>Fn("Node",t,"getRootNode")(),host:t=>t&&"host"in t?Dn("ShadowRoot",t,"host"):null,styleSheets:t=>t.styleSheets,shadowRoot:t=>t&&"shadowRoot"in t?Dn("Element",t,"shadowRoot"):null,querySelector:(t,e)=>Fn("Element",t,"querySelector")(e),querySelectorAll:(t,e)=>Fn("Element",t,"querySelectorAll")(e),mutationObserver:Nn,patch:qn};function Bn(){try{if("undefined"!=typeof performance&&performance.now)return performance.now()}catch(t){}return Date.now()}var Hn=0;function $n(){Hn+=1}function Un(){return Hn}function zn(t,e){return(e!==Hn||t>6e4)&&!0}var Wn=0,Vn=0,Zn=0,Gn={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Qn=null,Jn=null,Kn=[],Xn=0,Yn=0,to={slowestBatchMs:0},eo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0};function ro(t){(Wn+=1)>1||(Gn={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Kn=[],Xn=0,Jn=(t=>t&&t>0?t:null)(t),Vn=Bn(),Zn=Hn)}function io(){return 0===Wn?Qn||{durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0}:(Wn-=1)>0?Gn:(Gn.durationMs=Bn()-Vn,Gn.deferredStylesheetCount=Xn,eo.deferredCount+=Xn,Jn=null,zn(Gn.durationMs,Zn)?Gn:Qn=Gn)}function no(t,e,r){var i=t.length;if(r>=32)return i;for(var n=0;t.length>n;n++){var o=t[n];try{var a=o.cssRules;if(a&&a.length)i+=no(a,e,r+1);else if(e&&o.styleSheet){var s=o.styleSheet;if(!e.has(s)){e.add(s);var u=s.rules||s.cssRules;u&&(i+=no(u,e,r+1))}}}catch(t){}}return i}function oo(t){if(0!==Wn){var e=no(t,null,0);Gn.cssRuleCount+=e,Yn>0&&(Gn.nonDeferrableCssRuleCount+=e)}}function ao(t){Yn+=1;try{return t()}finally{Yn-=1}}function so(t){Wn>0&&(Gn.stylesheetMs+=t)}function uo(t){if(0===Wn||null===Jn)return!1;var e=Gn.cssRuleCount-Gn.nonDeferrableCssRuleCount;return e>=Jn||e+function(t){try{var e=t&&(t.rules||t.cssRules);if(!e)return 0;var r=new WeakSet;return r.add(t),no(e,r,0)}catch(t){return 0}}(t)>Jn}function lo(){eo.failedCount+=1}function ho(t){t>0&&(eo.abandonedCount+=t)}function co(t){return co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(t)}function vo(t,e,r){return(e=function(t){var e=function(t){if("object"!=co(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=co(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==co(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fo(t){return t.nodeType===t.ELEMENT_NODE}function po(t){var e=t&&"host"in t&&"mode"in t&&jn.host(t)||null;return Boolean(e&&"shadowRoot"in e&&jn.shadowRoot(e)===t)}function go(t){return"[object ShadowRoot]"==={}.toString.call(t)}function mo(t){return t.includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}function yo(t){var e=t.cssText;if(3>e.split('"').length)return e;var r=["@import","url("+JSON.stringify(t.href)+")"];return""===t.layerName?r.push("layer"):t.layerName&&r.push("layer("+t.layerName+")"),t.supportsText&&r.push("supports("+t.supportsText+")"),t.media.length&&r.push(t.media.mediaText),r.join(" ")+";"}var bo=0;function wo(t){var e=0===bo,r=e?Bn():0;bo+=1;try{var i=t.rules||t.cssRules;if(!i)return null;oo(i);var n=t.href;return!n&&t.ownerNode&&(n=t.ownerNode.baseURI),mo(Array.from(i,t=>ko(t,n)).join(""))}catch(t){return null}finally{bo-=1,e&&so(Bn()-r)}}function ko(t,e){if(So(t)){var r;try{r=wo(t.styleSheet)||yo(t)}catch(e){r=t.cssText}try{var i;if(r&&(null===(i=t.styleSheet)||void 0===i?void 0:i.href))return jo(r,t.styleSheet.href)}catch(t){}return r}var n=t.cssText;return xo(t)&&t.selectorText.includes(":")&&(n=_o(n)),e?jo(n,e):n}function _o(t){return t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")}function So(t){return"styleSheet"in t}function xo(t){return"selectorText"in t}var Co=/^-?[A-Za-z_][\w-]*$/,Mo=/^-?[A-Za-z_][\w-]*(\.-?[A-Za-z_][\w-]*)*$/;function To(t){var e=[],r=!1,i=null,n=new Map;function o(t){var n=e.pop();if("group"===n.kind){if(null===t){for(;e.length>0&&"group"===e[e.length-1].kind;)e.pop();return void o(null)}var s=e[e.length-1];return s.parts.push(t),void(s.index+=1)}if(!n.importRule)return r=!0,void(i=t);a(e[e.length-1],n.importRule,t)}function a(t,e,r){try{var i;try{i=r||yo(e)}catch(t){i=e.cssText}try{var n;i&&(null===(n=e.styleSheet)||void 0===n?void 0:n.href)&&(i=jo(i,e.styleSheet.href))}catch(t){}i&&t.parts.push(i),t.index+=1}catch(t){o(null)}}function s(t){var r=t.rules[t.index];if("sheet"===t.kind&&So(r)){var i=n.get(r);return null===i?(t.parts.push(r.cssText),void(t.index+=1)):i?void e.push({kind:"sheet",sheet:i.sheet,rules:i.rules,sheetHref:i.sheetHref,index:0,parts:[],importRule:r}):void a(t,r,null)}if(!function(t,r){try{var i=function(t){var e=t;if(!e.cssRules||0===e.cssRules.length)return null;if(e.media&&"string"==typeof e.media.mediaText)return"@media "+e.media.mediaText+" {";if(xo(t)){if("number"==typeof e.type&&1!==e.type)return null;var r=e.style?e.style.cssText:"";return t.selectorText+" {"+(r?" "+r:"")}if("containerName"in e)return"string"!=typeof e.containerQuery||e.containerName&&!Co.test(e.containerName)?null:"@container "+(e.containerName?e.containerName+" ":"")+e.containerQuery+" {";if("string"==typeof e.conditionText){var i="";try{var n;i=(null===(n=t.constructor)||void 0===n?void 0:n.name)||""}catch(t){return null}return""===i||"Object"===i||"CSSSupportsRule"===i?"@supports "+e.conditionText+" {":null}return"string"==typeof e.name?"keyText"in e.cssRules[0]?Co.test(e.name)?"@keyframes "+e.name+" {":null:""===e.name?"@layer {":Mo.test(e.name)?"@layer "+e.name+" {":null:null}(t);if(null===i)return!1;var n=r.sheetHref;return e.push({kind:"group",rules:Array.from(t.cssRules),sheetHref:n,index:0,parts:[],prelude:n?jo(i,n):i,fixColons:"sheet"===r.kind&&xo(t)&&t.selectorText.includes(":")}),!0}catch(t){return!1}}(r,t)){var o=r.cssText;"sheet"===t.kind&&xo(r)&&r.selectorText.includes(":")&&(o=_o(o)),t.parts.push(t.sheetHref?jo(o,t.sheetHref):o),t.index+=1}}return function(t){try{var r=t.rules||t.cssRules;if(!r)return!1;oo(r);var i=t.href;!i&&t.ownerNode&&(i=t.ownerNode.baseURI);var o=Array.from(r);return e.push({kind:"sheet",sheet:t,rules:o,sheetHref:i,index:0,parts:[],importRule:null}),function(t,e){for(var r=[{sheet:e,rules:t,index:0}],i=function(){var t=r[r.length-1];if(t.index>=t.rules.length)return r.pop(),0;var e=t.rules[t.index];if(t.index+=1,!So(e)||n.has(e))return 0;var i=null;try{i=e.styleSheet}catch(t){return n.set(e,null),0}if(!i||r.some(t=>t.sheet===i))return 0;try{var o=i.rules||i.cssRules;if(!o)return 0;oo(o);var a=i.href;!a&&i.ownerNode&&(a=i.ownerNode.baseURI);var s=Array.from(o);n.set(e,{sheet:i,rules:s,sheetHref:a}),r.push({sheet:i,rules:s,index:0})}catch(t){}};r.length>0;)i()}(o,t),!0}catch(t){return!1}}(t)||(r=!0),{advance(t){if(r)return!0;var n=Bn(),a=t>0?t:1;try{for(;!r&&a>0;){var u=e[e.length-1];if(u.rules.length>u.index){a-=1;try{s(u)}catch(t){o(null)}}else{var l=null;try{if("group"===u.kind){var h=u.prelude+u.parts.join("")+"}";l=u.fixColons?_o(h):h}else l=mo(u.parts.join(""))}catch(t){}o(l)}}}catch(t){r=!0,i=null}finally{so(Bn()-n)}return r},text:()=>r?i:null,remainingRules(){if(r)return 0;var t=0;for(var i of e)t+=i.rules.length-i.index;return t}}}var Io=class{constructor(){vo(this,"idNodeMap",new Map),vo(this,"nodeMetaMap",new WeakMap)}getId(t){var e,r;return t&&null!==(e=null===(r=this.getMeta(t))||void 0===r?void 0:r.id)&&void 0!==e?e:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){var e=this.getId(t);if(this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t)),fo(t)){var r=jn.shadowRoot(t);r&&this.removeNodeFromMap(r),"IFRAME"===t.nodeName&&t.contentDocument&&this.removeNodeFromMap(t.contentDocument)}}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){this.idNodeMap.set(e.id,t),this.nodeMetaMap.set(t,e)}replace(t,e){var r=this.getNode(t);if(r){var i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(e,i)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ro(t){var e=t.element,r=t.maskInputOptions,i=t.tagName,n=t.type,o=t.maskInputFn,a=t.value||"",s=n&&Ao(n);return(r[i.toLowerCase()]||s&&r[s])&&(a=o?o(a,e):"*".repeat(a.length)),a}function Ao(t){return t.toLowerCase()}var Eo=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 Lo(t){var e=t.element,r=t.name,i=t.value,n=t.maskAttributeFn,o=t.isGenerated;return i?t.maskAllElementAttributes?void 0!==o&&o&&Eo.has(Ao(r))?i:"*".repeat(i.length):n?n(r,i,e):i:i}var Oo="__rrweb_original__";function Do(t){try{var e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?Ao(e):null}catch(t){return null}}var Po=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Fo=/^(?:[a-z+]+:)?\/\//i,No=/^www\..*/i,qo=/^(data:)([^,]*),(.*)/i;function jo(t,e){return(t||"").replace(Po,(t,r,i,n,o,a)=>{var s,u=i||o||a,l=r||n||"";if(!u)return t;if(Fo.test(u)||No.test(u))return"url("+l+u+l+")";if(qo.test(u))return"url("+l+u+l+")";if("/"===u[0])return"url("+l+(((s=e).indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+u)+l+")";var h=e.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 Bo,Ho,$o=new Map,Uo=1,zo=new RegExp("[^a-z0-9-_:]");function Wo(){return Uo++}var Vo=/^[^ \t\n\r\u000c]+/,Zo=/^[, \t\n\r\u000c]+/,Go=new WeakMap;function Qo(t,e){return e&&""!==e.trim()?Jo(t,e):e}function Jo(t,e){var r=Go.get(t);if(r||(r=t.createElement("a"),Go.set(t,r)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return r.setAttribute("href",e),r.href}function Ko(t,e){return(null==e?void 0:e.maxBase64ImageLength)?function(t,e){return e&&t.length>e?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxkZWZzPgogICAgPHBhdHRlcm4gaWQ9InN0cmlwZXMiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+CiAgICAgIDxyZWN0IHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iYmxhY2siLz4KICAgICAgPHBhdGggZD0iTTggMEgxNkwwIDE2VjhMOCAwWiIgZmlsbD0iIzJEMkQyRCIvPgogICAgICA8cGF0aCBkPSJNMTYgOFYxNkg4TDE2IDhaIiBmaWxsPSIjMkQyRDJEIi8+CiAgICA8L3BhdHRlcm4+CiAgPC9kZWZzPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjc3RyaXBlcykiLz4KPC9zdmc+Cg==":t}(t,e.maxBase64ImageLength):t}function Xo(t,e,r,i,n,o){if(!i)return i;if("src"===r||"href"===r&&("use"!==e||"#"!==i[0])){if("link"===e&&n){var a,s=null===(a=n.sheet)||void 0===a?void 0:a.href;if(s)return s}var u=Qo(t,i);if(u.startsWith("data:")){if("img"===e&&n){var l=u;return((null==o?void 0:o.type)||void 0!==(null==o?void 0:o.quality))&&(l=function(t,e,r,i){if(1e5>e.length)return e;if(!t.complete||0===t.naturalWidth)return e;if(t.naturalWidth>4096||t.naturalHeight>4096)return e;var n=$o.get(e);if(n&&n.type===r&&n.quality===i)return n.result;try{var o=document.createElement("canvas");o.width=t.naturalWidth,o.height=t.naturalHeight;var a=o.getContext("2d");if(!a)return e;a.drawImage(t,0,0);var s=o.toDataURL(r||"image/webp",null!=i?i:.4),u=e.length>s.length?s:e;if($o.size>=10){var l=$o.keys().next().value;void 0!==l&&$o.delete(l)}return $o.set(e,{type:r,quality:i,result:u}),u}catch(t){return e}}(n,u,o.type,o.quality)),Ko(l,o)}if("image"===e)return Ko(u,o)}return u}if("xlink:href"===r&&"#"!==i[0]){var h=Qo(t,i);return"image"===e&&h.startsWith("data:")?Ko(h,o):h}return"background"!==r||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===r?function(t,e){if(""===e.trim())return e;var r=0;function i(t){var i,n=t.exec(e.substring(r));return n?(r+=(i=n[0]).length,i):""}for(var n=[];i(Zo),e.length>r;){var o=i(Vo);if(","===o.slice(-1))o=Qo(t,o.substring(0,o.length-1)),n.push(o);else{var a="";o=Qo(t,o);for(var s=!1;;){var u=e.charAt(r);if(""===u){n.push((o+a).trim());break}if(s)")"===u&&(s=!1);else{if(","===u){r+=1,n.push((o+a).trim());break}"("===u&&(s=!0)}a+=u,r+=1}}}return n.join(", ")}(t,i):"style"===r?jo(i,Jo(t)):"object"===e&&"data"===r?Qo(t,i):i:Qo(t,i)}function Yo(t,e,r){return("video"===t||"audio"===t)&&"autoplay"===e}function ta(t,e,r){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!r&&ta(jn.parentNode(t),e,r);for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;return!!r&&ta(jn.parentNode(t),e,r)}function ea(t,e,r,i){var n;if(fo(t)){if(!jn.childNodes(n=t).length)return!1}else{if(null===jn.parentElement(t))return!1;n=jn.parentElement(t)}try{if("string"==typeof e){if(i){if(n.closest("."+e))return!0}else if(n.classList.contains(e))return!0}else if(ta(n,e,i))return!0;if(r)if(i){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(t){}return!1}function ra(t,e,r){var i=t.removeEventListener;"function"==typeof i&&i.call(t,e,r)}var ia=new Map;function na(t,e){return Array.from(t.styleSheets).find(t=>t.href===e)}function oa(t){return null==t?"":t.toLowerCase()}var aa=!1,sa=!1;function ua(t,e){var r=e.doc,i=e.mirror,n=e.blockClass,o=e.blockSelector,a=e.maskTextClass,s=e.maskTextSelector,u=e.skipChild,l=void 0!==u&&u,h=e.inlineStylesheet,c=void 0===h||h,d=e.maskInputOptions,v=void 0===d?{}:d,f=e.maskTextFn,p=e.maskInputFn,g=e.maskAllElementAttributes,m=void 0!==g&&g,y=e.maskAttributeFn,b=e.slimDOMOptions,w=e.dataURLOptions,k=void 0===w?{}:w,_=e.inlineImages,S=void 0!==_&&_,x=e.recordCanvas,C=void 0!==x&&x,M=e.canvasMaskingConfigured,T=e.onSerialize,I=e.onIframeLoad,R=e.iframeLoadTimeout,A=void 0===R?5e3:R,E=e.onIframeListenerRegistered,L=e.onStylesheetLoad,O=e.stylesheetLoadTimeout,D=void 0===O?5e3:O,P=e.keepIframeSrcFn,F=void 0===P?()=>!1:P,N=e.newlyAddedElement,q=void 0!==N&&N,j=e.depth,B=void 0===j?0:j,H=e.maxDepth,U=void 0===H?50:H,z=e.needsMask,W=e.preserveWhiteSpace,V=void 0===W||W;if(B>=U)return sa=!0,aa||(aa=!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;z||(z=ea(t,a,s,void 0===z)),Wn>0&&(Gn.nodeCount+=1);var Z,G=function(t,e){var r=e.doc,i=e.blockClass,n=e.blockSelector,o=e.needsMask,a=e.inlineStylesheet,s=e.maskInputOptions,u=void 0===s?{}:s,l=e.maskTextFn,h=e.maskInputFn,c=e.maskAllElementAttributes,d=void 0!==c&&c,v=e.maskAttributeFn,f=e.dataURLOptions,p=void 0===f?{}:f,g=e.inlineImages,m=e.recordCanvas,y=e.canvasMaskingConfigured,b=e.keepIframeSrcFn,w=e.newlyAddedElement,k=void 0!==w&&w,_=function(t,e){if(e.hasNode(t)){var r=e.getId(t);return 1===r?void 0:r}}(r,e.mirror);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:Tn.Document,childNodes:[],compatMode:t.compatMode}:{type:Tn.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:Tn.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:_};case t.ELEMENT_NODE:return function(t,e){for(var r=e.doc,i=e.inlineStylesheet,n=e.maskInputOptions,o=void 0===n?{}:n,a=e.maskInputFn,s=e.maskAllElementAttributes,u=void 0!==s&&s,l=e.maskAttributeFn,h=e.dataURLOptions,c=void 0===h?{}:h,d=e.inlineImages,v=e.recordCanvas,f=e.canvasMaskingConfigured,p=e.keepIframeSrcFn,g=e.newlyAddedElement,m=void 0!==g&&g,y=e.rootId,b=function(t,e,r){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(var i=t.classList.length;i--;)if(e.test(t.classList[i]))return!0;if(r)return t.matches(r)}catch(t){}return!1}(t,e.blockClass,e.blockSelector),w=function(t){if(t instanceof HTMLFormElement)return"form";var e=Ao(t.tagName);return zo.test(e)?"div":e}(t),k=new Set,_={},S=t.attributes.length,x=0;S>x;x++){var C=t.attributes[x];Yo(w,C.name)||(_[C.name]=Xo(r,w,Ao(C.name),C.value,t,c))}if("link"===w&&i&&!b){var M=t.sheet;if(!M){var T=function(t){return t.href}(t);T&&!(M=na(r,T))&&T.includes(".css")&&(M=na(r,window.location.origin+"/"+T.replace(window.location.href,"")))}var I=null;M&&(uo(M)?Wn>0&&(Kn.push(t),Xn+=1):I=wo(M)),I&&(delete _.rel,delete _.href,_._cssText=I)}if("style"===w&&t.sheet&&!(t.innerText||jn.textContent(t)||"").trim().length){var R=ao(()=>wo(t.sheet));R&&(_._cssText=R)}if("input"===w||"textarea"===w||"select"===w){var A=t.value,E=t.checked;"radio"!==_.type&&"checkbox"!==_.type&&"submit"!==_.type&&"button"!==_.type&&A?_.value=Ro({element:t,type:Do(t),tagName:w,value:A,maskInputOptions:o,maskInputFn:a}):E&&(_.checked=E)}if("option"===w&&(t.selected&&!o.select?_.selected=!0:delete _.selected),"dialog"===w&&t.open){try{_.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"}catch(t){_.rr_open_mode="modal",_.ph_rr_could_not_detect_modal=!0}k.add("rr_open_mode")}if("canvas"===w&&v&&!(null==f?void 0:f()))if("2d"===t.__context)(function(t){var e=t.getContext("2d");if(!e)return!0;for(var r=0;t.width>r;r+=50)for(var i=0;t.height>i;i+=50){var n=e.getImageData;if(new Uint32Array((Oo in n?n[Oo]:n).call(e,r,i,Math.min(50,t.width-r),Math.min(50,t.height-i)).data.buffer).some(t=>0!==t))return!1}return!0})(t)||(_.rr_dataURL=t.toDataURL(c.type,c.quality));else if(!("__context"in t)){var L=t.toDataURL(c.type,c.quality),O=r.createElement("canvas");O.width=t.width,O.height=t.height,L!==O.toDataURL(c.type,c.quality)&&(_.rr_dataURL=L)}var D,P,F=!1;if("img"===w&&d){Bo||(Bo=r.createElement("canvas"),Ho=Bo.getContext("2d"));var N=t,q=N.currentSrc||N.getAttribute("src")||"<unknown-src>",j=N.crossOrigin,B=(e,r)=>F?Lo({element:t,name:e,value:r,maskAllElementAttributes:u,maskAttributeFn:l}):r,H=()=>{ra(N,"load",H);try{Bo.width=N.naturalWidth,Bo.height=N.naturalHeight,Ho.drawImage(N,0,0);var t=Bo.toDataURL(c.type,c.quality);_.rr_dataURL=B("rr_dataURL",t)}catch(t){if("anonymous"!==N.crossOrigin)return N.crossOrigin="anonymous",void(N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H));console.warn("Cannot inline img src="+q+"! Error: "+t)}"anonymous"===N.crossOrigin&&(j?_.crossOrigin=B("crossOrigin",j):N.removeAttribute("crossorigin"))};N.complete&&0!==N.naturalWidth?H():N.addEventListener("load",H)}if("audio"===w||"video"===w){var U=_;U.rr_mediaState=t.paused?"paused":"played",k.add("rr_mediaState"),U.rr_mediaCurrentTime=t.currentTime,U.rr_mediaPlaybackRate=t.playbackRate,U.rr_mediaMuted=t.muted,U.rr_mediaLoop=t.loop,U.rr_mediaVolume=t.volume}if(m||(t.scrollLeft&&(_.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(_.rr_scrollTop=t.scrollTop)),b){var z,W,V,Z=t.getBoundingClientRect(),G=Z.width,Q=Z.height,J=Z.left,K=Z.top,X=null===(z=r.defaultView)||void 0===z?void 0:z.getComputedStyle(t);_={class:_.class,rr_width:G+"px",rr_height:Q+"px",rr_left:Math.floor(J+((null===(W=r.defaultView)||void 0===W?void 0:W.scrollX)||0))+"px",rr_top:Math.floor(K+((null===(V=r.defaultView)||void 0===V?void 0:V.scrollY)||0))+"px"},k.add("rr_width"),k.add("rr_height"),k.add("rr_left"),k.add("rr_top"),X&&(_.rr_position=X.position||"static",k.add("rr_position"),X.transform&&"none"!==X.transform&&(_.rr_transform=X.transform,k.add("rr_transform")),X.display&&X.display.startsWith("inline")&&(_.rr_display=X.display,k.add("rr_display")))}if("iframe"!==w||p(_.src)||(t.contentDocument||(_.rr_src=_.src),delete _.src),u||l)for(var Y of Object.entries(_)){var tt=Y[0],et=Y[1];"string"!=typeof et&&null!==et||(_[tt]=Lo({element:t,name:tt,value:et,maskAllElementAttributes:u,maskAttributeFn:l,isGenerated:k.has(tt)}))}F=!0;try{customElements.get(w)&&(D=!0)}catch(t){}return{type:Tn.Element,tagName:w,attributes:_,childNodes:[],isSVG:(P=t,Boolean("svg"===P.tagName||P.ownerSVGElement)||void 0),needBlock:b,rootId:y,isCustom:D}}(t,{doc:r,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:u,maskInputFn:h,maskAllElementAttributes:d,maskAttributeFn:v,dataURLOptions:p,inlineImages:g,recordCanvas:m,canvasMaskingConfigured:y,keepIframeSrcFn:b,newlyAddedElement:k,rootId:_});case t.TEXT_NODE:return function(t,e){var r=e.needsMask,i=e.maskTextFn,n=e.rootId,o=jn.parentNode(t),a=o&&o.tagName,s=jn.textContent(t),u="STYLE"===a||void 0,l="SCRIPT"===a||void 0;if(u&&s){try{var h;if(t.nextSibling||t.previousSibling);else if(uo(o.sheet));else if(null===(h=o.sheet)||void 0===h?void 0:h.cssRules){var c=wo(o.sheet);c&&!/(?:^|[\s;{}])-?[a-zA-Z][\w-]*\s*:\s*;/.test(c)&&(s=c)}}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,t)}s=jo(s,Jo(e.doc))}return l&&(s="SCRIPT_PLACEHOLDER"),!u&&!l&&s&&r&&(s=i?i(s,jn.parentElement(t)):s.replace(/[\S]/g,"*")),{type:Tn.Text,textContent:s||"",isStyle:u,rootId:n}}(t,{doc:r,needsMask:o,maskTextFn:l,rootId:_});case t.CDATA_SECTION_NODE:return{type:Tn.CDATA,textContent:"",rootId:_};case t.COMMENT_NODE:return{type:Tn.Comment,textContent:jn.textContent(t)||"",rootId:_};default:return!1}}(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:z,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(t,"not serialized"),null;Z=i.hasNode(t)?i.getId(t):function(t,e){if(e.comment&&t.type===Tn.Comment)return!0;if(t.type===Tn.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel&&"script"===t.attributes.as||"modulepreload"===t.attributes.rel)||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===function(t){var e,r;try{r=new URL(t,window.location.href)}catch(t){return null}var i=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(e=null==i?void 0:i[1])&&void 0!==e?e:null}(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(oa(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===oa(t.attributes.name)||["icon","apple-touch-icon","shortcut icon"].includes(oa(t.attributes.rel)))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&oa(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(oa(t.attributes.property).match(/^(og|twitter|fb):/)||oa(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===oa(t.attributes.name)))return!0;if(e.headMetaRobots&&["robots","googlebot","bingbot"].includes(oa(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&(["author","generator","framework","publisher","progid"].includes(oa(t.attributes.name))||oa(t.attributes.property).match(/^article:/)||oa(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&["google-site-verification","yandex-verification","csrf-token","p:domain_verify","verify-v1","verification","shopify-checkout-api-token"].includes(oa(t.attributes.name)))return!0}}return!1}(G,b)||!V&&G.type===Tn.Text&&!G.isStyle&&!G.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Wo();var Q=Object.assign(G,{id:Z});if(i.add(t,Q),-2===Z)return null;T&&T(t);var J=!l;if(Q.type===Tn.Element){J=J&&!Q.needBlock,delete Q.needBlock;var K=jn.shadowRoot(t);K&&go(K)&&(Q.isShadowHost=!0)}if((Q.type===Tn.Document||Q.type===Tn.Element)&&J){b.headWhitespace&&Q.type===Tn.Element&&"head"===Q.tagName&&(V=!1);var X={doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:z,maskTextClass:a,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:A,onIframeListenerRegistered:E,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:F,depth:B+1,maxDepth:U};if(Q.type===Tn.Element&&"textarea"===Q.tagName&&void 0!==Q.attributes.value);else for(var Y of Array.from(jn.childNodes(t))){var tt=ua(Y,X);tt&&Q.childNodes.push(tt)}var et=null;if(fo(t)&&(et=jn.shadowRoot(t)))for(var rt of Array.from(jn.childNodes(et))){var it=ua(rt,X);it&&(go(et)&&(it.isShadow=!0),Q.childNodes.push(it))}}var nt=jn.parentNode(t);if(nt&&po(nt)&&go(nt)&&(Q.isShadow=!0),Q.type===Tn.Element&&"iframe"===Q.tagName){var ot=function(t,e,r){var i,n=()=>{},o=t.contentWindow;if(!o)return n;try{i=o.document.readyState}catch(t){return n}var a=()=>e();if("complete"!==i){var s=!1,u=null,l=()=>{s||(s=!0,null!==u&&(clearTimeout(u),u=null),ra(t,"load",h),t.addEventListener("load",a),e())},h=()=>l();return u=setTimeout(l,r),t.addEventListener("load",h),()=>{null!==u&&(clearTimeout(u),u=null),s?ra(t,"load",a):(s=!0,ra(t,"load",h))}}var c,d="about:blank";try{c=o.location.href}catch(t){return n}if(c!==d||t.src===d||""===t.src){var v=setTimeout(e,0);return t.addEventListener("load",a),()=>{clearTimeout(v),ra(t,"load",a)}}return t.addEventListener("load",a),()=>{ra(t,"load",a)}}(t,()=>{var e=t.contentDocument;if(e&&I){var r=ua(e,{doc:e,mirror:i,blockClass:n,blockSelector:o,needsMask:z,maskTextClass:a,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:A,onIframeListenerRegistered:E,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:F,depth:B+1,maxDepth:U});r&&I(t,r)}},A);null==E||E(t,ot)}return Q.type===Tn.Element&&"link"===Q.tagName&&"stylesheet"===Q.attributes.rel&&function(e,u,l){if(!ia.has(e)){var h;try{h=e.sheet}catch(t){return}if(!h){var d=new AbortController,g=!1,w=()=>{if(!g){g=!0;try{(()=>{if(L){var e=ua(t,{doc:r,mirror:i,blockClass:n,blockSelector:o,needsMask:z,maskTextClass:a,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:A,onStylesheetLoad:L,stylesheetLoadTimeout:D,keepIframeSrcFn:F,depth:B,maxDepth:U});e&&L(t,e)}})()}finally{ia.delete(e),d.abort()}}},_=setTimeout(w,l);d.signal.addEventListener("abort",()=>clearTimeout(_),{once:!0}),e.addEventListener("load",w,{signal:d.signal,once:!0}),ia.set(e,d)}}}(t,0,D),Q}function la(t){return!0===t||"all"===t?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===t,headMetaDescKeywords:"all"===t,headTitleMutations:"all"===t}:!1===t?{}:t}var ha=class t{constructor(){vo(this,"parentElement",null),vo(this,"parentNode",null),vo(this,"ownerDocument",void 0),vo(this,"firstChild",null),vo(this,"lastChild",null),vo(this,"previousSibling",null),vo(this,"nextSibling",null),vo(this,"ELEMENT_NODE",1),vo(this,"TEXT_NODE",3),vo(this,"nodeType",void 0),vo(this,"nodeName",void 0),vo(this,"RRNodeType",void 0)}get childNodes(){for(var t=[],e=this.firstChild;e;)t.push(e),e=e.nextSibling;return t}contains(e){if(!(e instanceof t))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function ca(t,e,r){void 0===r&&(r=document);var i={capture:!0,passive:!0};return r.addEventListener(t,e,i),()=>da(r,t,e,i)}function da(t,e,r,i){va(()=>{var n=t.removeEventListener;"function"==typeof n&&(void 0!==i?n.call(t,e,r,i):n.call(t,e,r))})}function va(t){try{t()}catch(t){if(!(t instanceof DOMException&&"SecurityError"===t.name))throw t}}var fa="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.",pa={map:{},getId(){return console.error(fa),-1},getNode(){return console.error(fa),null},removeNodeFromMap(){console.error(fa)},has(){return console.error(fa),!1},reset(){console.error(fa)}};function ga(t,e,r){void 0===r&&(r={});var i=null,n=0;return function(){for(var o=arguments.length,a=new Array(o),s=0;o>s;s++)a[s]=arguments[s];var u=Date.now();n||!1!==r.leading||(n=u);var l=e-(u-n),h=this;0>=l||l>e?(i&&(clearTimeout(i),i=null),n=u,t.apply(h,a)):i||!1===r.trailing||(i=setTimeout(()=>{n=!1===r.leading?0:Date.now(),i=null,t.apply(h,a)},l))}}function ma(t,e,r,i,n){void 0===n&&(n=window);var o=n.Object.getOwnPropertyDescriptor(t,e);return n.Object.defineProperty(t,e,i?r:{set(t){if(setTimeout(()=>{try{r.set.call(this,t)}catch(t){}},0),o&&o.set){if(o.get)try{o.get.call(this)}catch(t){return}o.set.call(this,t)}}}),()=>ma(t,e,o||{},!0)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(pa=new Proxy(pa,{get(t,e,r){return"map"===e&&console.error(fa),Reflect.get(t,e,r)}}));var ya=Date.now;function ba(t){var e,r,i,n,o=t.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null===(e=jn.parentElement(o.body))||void 0===e?void 0:e.scrollLeft)||(null==o||null===(r=o.body)||void 0===r?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null===(i=jn.parentElement(o.body))||void 0===i?void 0:i.scrollTop)||(null==o||null===(n=o.body)||void 0===n?void 0:n.scrollTop)||0}}function wa(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ka(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function _a(t){return t?t.nodeType===t.ELEMENT_NODE?t:jn.parentElement(t):null}function Sa(t,e,r,i){if(!t)return!1;var n=_a(t);if(!n)return!1;try{if("string"==typeof e){if(n.classList.contains(e))return!0;if(i&&null!==n.closest("."+e))return!0}else if(ta(n,e,i))return!0}catch(t){}if(r){if(n.matches(r))return!0;if(i&&null!==n.closest(r))return!0}return!1}function xa(t,e,r){return!("TITLE"!==t.tagName||!r.headTitleMutations)||-2===e.getId(t)}function Ca(t,e){if(po(t))return!1;var r=e.getId(t);if(!e.has(r))return!0;var i=jn.parentNode(t);return(!i||i.nodeType!==t.DOCUMENT_NODE)&&(!i||Ca(i,e))}function Ma(t){return Boolean(t.changedTouches)}function Ta(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function Ia(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function Ra(t){return!!t&&(t instanceof ha&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(jn.shadowRoot(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(ya=()=>(new Date).getTime());var Aa=class{constructor(){vo(this,"id",1),vo(this,"styleIDMap",new WeakMap),vo(this,"idStyleMap",new Map)}getId(t){var e;return null!==(e=this.styleIDMap.get(t))&&void 0!==e?e:-1}has(t){return this.styleIDMap.has(t)}add(t,e){return this.has(t)?this.getId(t):(r=void 0===e?this.id++:e,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r);var r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Ea(t){var e,r=null;return"getRootNode"in t&&(null===(e=jn.getRootNode(t))||void 0===e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&jn.host(jn.getRootNode(t))&&(r=jn.host(jn.getRootNode(t))),r}function La(t){var e=t.ownerDocument;return!!e&&(jn.contains(e,t)||function(t){var e=t.ownerDocument;if(!e)return!1;var r=function(t){for(var e,r=t;e=Ea(r);)r=e;return r}(t);return jn.contains(e,r)}(t))}function Oa(t){return"__ln"in t}var Da,Pa=class{constructor(){vo(this,"length",0),vo(this,"head",null),vo(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");for(var e=this.head,r=0;t>r;r++)e=(null==e?void 0:e.next)||null;return e}addNode(t){var e={value:t,previous:null,next:null};if(t.__ln=e,t.previousSibling&&Oa(t.previousSibling)){var r=t.previousSibling.__ln.next;e.next=r,e.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=e,r&&(r.previous=e)}else if(t.nextSibling&&Oa(t.nextSibling)&&t.nextSibling.__ln.previous){var i=t.nextSibling.__ln.previous;e.previous=i,e.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){var e=t.__ln;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}},Fa=(t,e)=>t+"@"+e,Na=class{constructor(){vo(this,"frozen",!1),vo(this,"locked",!1),vo(this,"texts",[]),vo(this,"attributes",[]),vo(this,"attributeMap",new WeakMap),vo(this,"generatedAttributes",new WeakMap),vo(this,"removes",[]),vo(this,"mapRemoves",[]),vo(this,"movedMap",{}),vo(this,"addedSet",new Set),vo(this,"movedSet",new Set),vo(this,"droppedSet",new Set),vo(this,"removesSubTreeCache",new Set),vo(this,"mutationCb",void 0),vo(this,"blockClass",void 0),vo(this,"blockSelector",void 0),vo(this,"maskTextClass",void 0),vo(this,"maskTextSelector",void 0),vo(this,"inlineStylesheet",void 0),vo(this,"maskInputOptions",void 0),vo(this,"maskTextFn",void 0),vo(this,"maskInputFn",void 0),vo(this,"maskAllElementAttributes",void 0),vo(this,"maskAttributeFn",void 0),vo(this,"keepIframeSrcFn",void 0),vo(this,"recordCanvas",void 0),vo(this,"canvasMaskingConfigured",void 0),vo(this,"inlineImages",void 0),vo(this,"slimDOMOptions",void 0),vo(this,"dataURLOptions",void 0),vo(this,"doc",void 0),vo(this,"mirror",void 0),vo(this,"iframeManager",void 0),vo(this,"stylesheetManager",void 0),vo(this,"shadowDomManager",void 0),vo(this,"canvasManager",void 0),vo(this,"processedNodeManager",void 0),vo(this,"unattachedDoc",void 0),vo(this,"canvasManagerReleased",!1),vo(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),vo(this,"emit",()=>{if(!this.frozen&&!this.locked){var t,e,r=Bn(),i=Un();try{this.processBufferedMutations()}finally{t=Bn()-r,e=i,Wn>0||zn(t,null!=e?e:Hn)||t>to.slowestBatchMs&&(to.slowestBatchMs=t)}}}),vo(this,"processBufferedMutations",()=>{for(var t=[],e=new Set,r=new Pa,i=t=>{for(var e=t,r=-2;-2===r;)r=(e=e&&e.nextSibling)&&this.mirror.getId(e);return r},n=n=>{var o=jn.parentNode(n);if(o&&La(n)&&"TEXTAREA"!==o.tagName&&!this.isBlockedAtEmission(o)){var a=po(o)?this.mirror.getId(Ea(n)):this.mirror.getId(o),s=i(n);if(-1===a||-1===s)return r.addNode(n);var u=ua(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:t=>{Ta(t,this.mirror)&&this.iframeManager.addIframe(t),Ia(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),Ra(t)&&!Sa(t,this.blockClass,this.blockSelector,!0)&&this.shadowDomManager.addShadowRoot(jn.shadowRoot(t),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onIframeListenerRegistered:(t,e)=>{this.iframeManager.registerLoadListenerDisposer(t,e)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)}});u&&(t.push({parentId:a,nextId:s,node:u}),e.add(u.id))}};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(var o of this.movedSet)ja(this.removesSubTreeCache,o)&&!this.movedSet.has(jn.parentNode(o))||n(o);for(var a of this.addedSet)Ba(this.droppedSet,a)||ja(this.removesSubTreeCache,a)?Ba(this.movedSet,a)?n(a):this.droppedSet.add(a):n(a);for(var s=null;r.length;){var u=null;if(s){var l=this.mirror.getId(jn.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(jn.parentNode(d.value));if(-1===i(d.value))continue;if(-1!==v){u=d;break}var f=jn.parentNode(d.value);if(f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var p=jn.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.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.node,r=jn.parentNode(e);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.filter(t=>!this.isBlockedAtEmission(t.node)).map(t=>{var e=t.attributes;if(!this.maskAllElementAttributes&&!this.maskAttributeFn&&"string"==typeof e.style){var r=JSON.stringify(t.styleDiff),i=JSON.stringify(t._unchangedStyles);e.style.length>r.length&&(r+i).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}if(this.maskAllElementAttributes||this.maskAttributeFn)for(var n of Object.entries(e)){var o,a=n[0],s=n[1];"string"!=typeof s&&null!==s||(e[a]=Lo({element:t.node,name:a,value:s,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn,isGenerated:null===(o=this.generatedAttributes.get(t.node))||void 0===o?void 0:o.has(a)}))}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.generatedAttributes=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},(g.texts.length||g.attributes.length||g.removes.length||g.adds.length)&&this.mutationCb(g)}),vo(this,"bufferBelongsToIframe",t=>this.doc===t.contentDocument),vo(this,"genTextAreaValueMutation",t=>{var e=this.attributeMap.get(t);e||(this.attributes.push(e={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t,e));var r=Array.from(jn.childNodes(t),t=>jn.textContent(t)||"").join("");e.attributes.value=Ro({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Do(t),value:r,maskInputFn:this.maskInputFn})}),vo(this,"processMutation",t=>{if(!xa(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":var e=jn.textContent(t.target);Sa(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:ea(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,_a(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break;case"attributes":var r,i=t.target,n=t.attributeName,o=null!==(r=t.attributeNamespace)&&void 0!==r?r:null,a=function(t,e,r){if(!r)return e;var i=t.getAttributeNodeNS(r,e);if(i)return i.name;if("http://www.w3.org/1999/xlink"===r)return"xlink:"+e;if("http://www.w3.org/XML/1998/namespace"===r)return"xml:"+e;if("http://www.w3.org/2000/xmlns/"===r)return"xmlns"===e?e:"xmlns:"+e;var n=t.lookupPrefix(r);return n?n+":"+e:e}(i,n,o),s=o?i.getAttributeNS(o,n):t.target.getAttribute(n);if("value"===a){var u=i,l=Do(u);s=Ro({element:u,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:l,value:s,maskInputFn:this.maskInputFn})}if(Sa(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;var h=this.attributeMap.get(t.target),c="IFRAME"===i.tagName&&"src"===a;if(c&&!this.keepIframeSrcFn(s)&&i.contentDocument)return;if(h||(this.attributes.push(h={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}}),this.attributeMap.set(t.target,h)),"type"===a&&"INPUT"===i.tagName&&"password"===(t.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Yo(i.tagName,a)){var d,v=Xo(this.doc,Ao(i.tagName),Ao(a),s,i,this.dataURLOptions);if(c&&!this.keepIframeSrcFn(s)&&(a="rr_src"),h.attributes[a]=v,null===(d=this.generatedAttributes.get(t.target))||void 0===d||d.delete(a),"style"===a){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}var f=this.unattachedDoc.createElement("span"),p=i.style;for(var g of(t.oldValue&&(f.style.cssText=t.oldValue),Array.from(p))){var m=p.getPropertyValue(g),y=p.getPropertyPriority(g);m!==f.style.getPropertyValue(g)||y!==f.style.getPropertyPriority(g)?h.styleDiff[g]=""===y?m:[m,y]:h._unchangedStyles[g]=[m,y]}for(var b of Array.from(f.style))""===p.getPropertyValue(b)&&(h.styleDiff[b]=!1)}else if("open"===a&&"DIALOG"===i.tagName){h.attributes.rr_open_mode=i.matches("dialog:modal")?"modal":"non-modal";var w=this.generatedAttributes.get(t.target);w||this.generatedAttributes.set(t.target,w=new Set),w.add("rr_open_mode")}}break;case"childList":if(Sa(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{var r=this.mirror.getId(e),i=po(t.target)?this.mirror.getId(jn.host(t.target)):this.mirror.getId(t.target);Sa(t.target,this.blockClass,this.blockSelector,!1)||xa(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(qa(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===r||Ca(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[Fa(r,i)]?qa(this.movedSet,e):(this.removes.push({parentId:i,id:r,isShadow:!(!po(t.target)||!go(t.target))||void 0}),function(t,e){for(var r=[t];r.length;){var i=r.pop();e.has(i)||(e.add(i),jn.childNodes(i).forEach(t=>r.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))})}}),vo(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)){if(this.addedSet.has(t))return this.addedSet.delete(t),void this.addedSet.add(t);if(!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(xa(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);var r=null;e&&this.mirror.hasNode(e)&&(r=this.mirror.getId(e)),r&&-1!==r&&(this.movedMap[Fa(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Sa(t,this.blockClass,this.blockSelector,!1)||(jn.childNodes(t).forEach(t=>this.genAdds(t)),Ra(t)&&jn.childNodes(jn.shadowRoot(t)).forEach(e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)}))}}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","maskAllElementAttributes","maskAttributeFn","keepIframeSrcFn","recordCanvas","canvasMaskingConfigured","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]}),this.canvasManager.acquire()}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.releaseCanvasManager()}releaseCanvasManager(){this.canvasManagerReleased||(this.canvasManagerReleased=!0,this.canvasManager.reset())}bufferDoc(){return this.doc}destroy(){for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift())}isBlockedAtEmission(t){for(var e=this.blockClass,r=e&&"string"!=typeof e&&(e.global||e.sticky)?new RegExp(e):null;t;){if(r&&(r.lastIndex=0),Sa(t,r||e,this.blockSelector,!0))return!0;var i="getRootNode"in t?jn.getRootNode(t):null;t=(null==i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?jn.host(i):null}return!1}};function qa(t,e){for(var r=[e];r.length;){var i=r.pop();t.delete(i),jn.childNodes(i).forEach(t=>r.push(t))}}function ja(t,e,r){return 0!==t.size&&function(t,e){var r=jn.parentNode(e);return!!r&&t.has(r)}(t,e)}function Ba(t,e){if(0===t.size)return!1;for(var r=jn.parentNode(e);r;){if(t.has(r))return!0;r=jn.parentNode(r)}return!1}var Ha=function(t,e){return void 0===e&&(e="rrweb"),Da?function(){try{return t(...arguments)}catch(t){if(Da&&!0===Da(t,e))return;throw t}}:t},$a=[];function Ua(t){try{if("composedPath"in t){var e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch(t){}return t&&t.target}function za(t,e){var r,i=new Na;i.init(t);try{r=new(Nn())(Ha(i.processMutations.bind(i)));var n={attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0};return t.attributeFilter&&t.attributeFilter.length>0&&(n.attributeFilter=t.attributeFilter),r.observe(e,n),$a.push(i),{observer:r,buffer:i}}catch(t){try{null==r||r.disconnect(),i.destroy(),i.reset()}catch(t){}throw t}}function Wa(t){var e=t.scrollCb,r=t.doc,i=t.mirror,n=t.blockClass,o=t.blockSelector,a=t.sampling,s=new Map,u=t=>{var a=Ua(t);if(a&&!Sa(a,n,o,!0)){var u,l,h=i.getId(a);if(a===r&&r.defaultView){var c=ba(r.defaultView);u=c.left,l=c.top}else u=a.scrollLeft,l=a.scrollTop;var d=u+","+l;s.get(h)!==d&&(s.set(h,d),e({id:h,x:u,y:l}))}},l=[ca("scroll",Ha(ga(Ha(t=>u(t)),a.scroll||100)),r)];return"onscrollend"in r&&l.push(ca("scrollend",Ha(u),r)),()=>l.forEach(t=>t())}function Va(t,e){for(var r=$a.length-1;r>=0;r--){var i=$a[r];if(i){var n=i.bufferBelongsToIframe(t);!n&&e&&e.has(i.bufferDoc())&&(n=!0),n&&(i.reset(),$a.splice(r,1))}}}var Za=["INPUT","TEXTAREA","SELECT"],Ga=new WeakMap;function Qa(t){return function t(e,r){if(Ya("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ya("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ya("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ya("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var i=Array.from(e.parentRule.cssRules).indexOf(e);return r.unshift(i),t(e.parentRule,r)}if(e.parentStyleSheet){var n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);r.unshift(n)}return r}(t,[])}function Ja(t,e,r){var i,n;return t?(t.ownerNode?i=e.getId(t.ownerNode):n=r.getId(t),{styleId:n,id:i}):{}}function Ka(t,e){var r,i,n,o=t.stylesheetManager;n=t.mirror.getId("#document"===e.nodeName?e:jn.host(e));var a="#document"===e.nodeName?null===(r=e.defaultView)||void 0===r?void 0:r.Document:null===(i=e.ownerDocument)||void 0===i||null===(i=i.defaultView)||void 0===i?void 0:i.ShadowRoot,s=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==n&&-1!==n&&a&&s?(Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var t;return null===(t=s.get)||void 0===t?void 0:t.call(this)},set(t){var e;try{var r;e=null===(r=s.set)||void 0===r?void 0:r.call(this,t)}catch(t){if(t&&"object"==typeof t&&"NotAllowedError"===t.name)return;throw t}if(null!==n&&-1!==n)try{o.adoptStyleSheets(t,n)}catch(t){}return e}}),Ha(()=>{Object.defineProperty(e,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})})):()=>{}}function Xa(t,r){void 0===r&&(r={});var i,n,o=t.doc.defaultView;if(!o)return()=>{};!function(t,e){var r=t.mutationCb,i=t.mousemoveCb,n=t.mouseInteractionCb,o=t.scrollCb,a=t.viewportResizeCb,s=t.inputCb,u=t.mediaInteractionCb,l=t.styleSheetRuleCb,h=t.styleDeclarationCb,c=t.canvasMutationCb,d=t.fontCb,v=t.selectionCb,f=t.customElementCb;t.mutationCb=function(){e.mutation&&e.mutation(...arguments),r(...arguments)},t.mousemoveCb=function(){e.mousemove&&e.mousemove(...arguments),i(...arguments)},t.mouseInteractionCb=function(){e.mouseInteraction&&e.mouseInteraction(...arguments),n(...arguments)},t.scrollCb=function(){e.scroll&&e.scroll(...arguments),o(...arguments)},t.viewportResizeCb=function(){e.viewportResize&&e.viewportResize(...arguments),a(...arguments)},t.inputCb=function(){e.input&&e.input(...arguments),s(...arguments)},t.mediaInteractionCb=function(){e.mediaInteaction&&e.mediaInteaction(...arguments),u(...arguments)},t.styleSheetRuleCb=function(){e.styleSheetRule&&e.styleSheetRule(...arguments),l(...arguments)},t.styleDeclarationCb=function(){e.styleDeclaration&&e.styleDeclaration(...arguments),h(...arguments)},t.canvasMutationCb=function(){e.canvasMutation&&e.canvasMutation(...arguments),c(...arguments)},t.fontCb=function(){e.font&&e.font(...arguments),d(...arguments)},t.selectionCb=function(){e.selection&&e.selection(...arguments),v(...arguments)},t.customElementCb=function(){e.customElement&&e.customElement(...arguments),f(...arguments)}}(t,r);var a=[],s=Ha(()=>{if(n){n.destroy(),n.reset();var e=$a.indexOf(n);-1!==e&&$a.splice(e,1)}t.shadowDomManager.resetForDoc(t.doc),null==i||i.disconnect(),a.forEach(t=>t())});try{if(t.recordDOM){var u=za(t,t.doc);i=u.observer,n=u.buffer}if(a.push(function(t){var e=t.mousemoveCb,r=t.sampling,i=t.doc,n=t.mirror;if(!1===r.mousemove)return()=>{};var o,a="number"==typeof r.mousemove?r.mousemove:50,s="number"==typeof r.mousemoveCallback?r.mousemoveCallback:500,u=[],l=ga(Ha(t=>{var r=Date.now()-o;e(u.map(t=>(t.timeOffset-=r,t)),t),u=[],o=null}),s),h=Ha(ga(Ha(t=>{var e=Ua(t),r=Ma(t)?t.changedTouches[0]:t,i=r.clientX,a=r.clientY;o||(o=ya()),u.push({x:i,y:a,id:n.getId(e),timeOffset:ya()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?_n.Drag:t instanceof MouseEvent?_n.MouseMove:_n.TouchMove)}),a,{trailing:!1})),c=[ca("mousemove",h,i),ca("touchmove",h,i),ca("drag",h,i)];return Ha(()=>{c.forEach(t=>t())})}(t)),a.push(function(t){var r=t.mouseInteractionCb,i=t.doc,n=t.mirror,o=t.blockClass,a=t.blockSelector,s=t.sampling;if(!1===s.mouseInteraction)return()=>{};var u=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,l=[],h=null;return Object.keys(Sn).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==u[t]).forEach(t=>{var s=Ao(t),u=(t=>i=>{var s=Ua(i);if(!Sa(s,o,a,!0)){var u=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":u=xn.Mouse;break;case"touch":u=xn.Touch;break;case"pen":u=xn.Pen}u===xn.Touch&&(Sn[t]===Sn.MouseDown?l="TouchStart":Sn[t]===Sn.MouseUp&&(l="TouchEnd"))}else Ma(i)&&(u=xn.Touch);null!==u?(h=u,(l.startsWith("Touch")&&u===xn.Touch||l.startsWith("Mouse")&&u===xn.Mouse)&&(u=null)):Sn[t]===Sn.Click&&(u=h,h=null);var c=Ma(i)?i.changedTouches[0]:i;if(c){var d=n.getId(s),v=c.clientX,f=c.clientY;Ha(r)(e({type:Sn[l],id:d,x:v,y:f},null!==u&&{pointerType:u}))}}})(t);if(window.PointerEvent)switch(Sn[t]){case Sn.MouseDown:case Sn.MouseUp:s=s.replace("mouse","pointer");break;case Sn.TouchStart:case Sn.TouchEnd:return}l.push(ca(s,u,i))}),Ha(()=>{l.forEach(t=>t())})}(t)),a.push(Wa(t)),a.push(function(t,e){var r=t.viewportResizeCb,i=e.win,n=-1,o=-1;return ca("resize",Ha(ga(Ha(()=>{var t=wa(),e=ka();n===t&&o===e||(r({width:Number(e),height:Number(t)}),n=t,o=e)}),200)),i)}(t,{win:o})),a.push(function(t){var r=t.inputCb,i=t.doc,n=t.mirror,o=t.blockClass,a=t.blockSelector,s=t.ignoreClass,u=t.ignoreSelector,l=t.maskInputOptions,h=t.maskInputFn,c=t.userTriggeredOnInput;function d(t){var e=Ua(t),r=t.isTrusted,n=i.defaultView;if(!e||!n||e instanceof n.HTMLElement){var d=e&&e.tagName;if(e&&"OPTION"===d&&(e=jn.parentElement(e)),e&&d&&Za.indexOf(d)>=0&&!Sa(e,o,a,!0)&&!(e.classList.contains(s)||u&&e.matches(u))){var f=e.value,p=!1,g=Do(e)||"";"radio"===g||"checkbox"===g?p=e.checked:(l[d.toLowerCase()]||l[g])&&(f=Ro({element:e,maskInputOptions:l,tagName:d,type:g,value:f,maskInputFn:h})),v(e,c?{text:f,isChecked:p,userTriggered:r}:{text:f,isChecked:p});var m=e.name;"radio"===g&&m&&p&&i.querySelectorAll('input[type="radio"][name="'+m+'"]').forEach(t=>{if(t!==e){var r=t.value;v(t,c?{text:r,isChecked:!p,userTriggered:!1}:{text:r,isChecked:!p})}})}}}function v(t,i){var o=Ga.get(t);if(!o||o.text!==i.text||o.isChecked!==i.isChecked){Ga.set(t,i);var a=n.getId(t);Ha(r)(e({},i,{id:a}))}}var f=("last"===t.sampling.input?["change"]:["input","change"]).map(t=>ca(t,Ha(d),i)),p=i.defaultView;if(!p)return()=>{f.forEach(t=>t())};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(t=>ma(t[0],t[1],{set(){Ha(d)({target:this,isTrusted:!1})}},!1,p))),Ha(()=>{f.forEach(t=>t())})}(t)),a.push(function(t){var e=t.mediaInteractionCb,r=t.blockClass,i=t.blockSelector,n=t.mirror,o=t.sampling,a=t.doc,s=Ha(t=>ga(Ha(o=>{var a=Ua(o);if(a&&!Sa(a,r,i,!0)){var s=a.currentTime,u=a.volume,l=a.muted,h=a.playbackRate,c=a.loop;e({type:t,id:n.getId(a),currentTime:s,volume:u,muted:l,playbackRate:h,loop:c})}}),o.media||500)),u=[ca("play",s(Mn.Play),a),ca("pause",s(Mn.Pause),a),ca("seeked",s(Mn.Seeked),a),ca("volumechange",s(Mn.VolumeChange),a),ca("ratechange",s(Mn.RateChange),a)];return Ha(()=>{u.forEach(t=>t())})}(t)),t.recordDOM){var l=function(t){var e=new Map,r=new Set,i=!0,n=t=>{if(i)try{t()}catch(t){}},o=t=>{var r,i=e.get(t);if(i){for(;null===(r=i[0])||void 0===r?void 0:r.ready;){var o=i.shift();(null==o?void 0:o.emit)&&n(o.emit)}0===i.length&&e.delete(t)}};return{queueMutation(t,r){if(t){var i=e.get(t);i?(i.push({emit:r,ready:!0}),o(t)):n(r)}else n(r)},queuePendingMutation(a,s,u){if(!i)return()=>{};var l=e.get(a);l||e.set(a,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,o(a))};try{c=t.setTimeout(f,5e3),d||v?t.clearTimeout(c):r.add(c)}catch(t){f()}return e=>{!v&&i&&(v=!0,void 0!==c&&(t.clearTimeout(c),r.delete(c)),d?e&&n(u):(h.ready=!0,e||(h.emit=void 0),o(a)))}},reset(){i=!1,r.forEach(e=>t.clearTimeout(e)),r.clear(),e.clear()}}}(o);a.push(l.reset),a.push(function(t,e){var r=t.styleSheetRuleCb,i=t.mirror,n=t.stylesheetManager,o=e.win,a=e.mutationQueue;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e);var l=Ja(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&a.queueMutation(e,()=>r({id:h,styleId:c,adds:[{rule:s,index:u}]})),u},"host")}),o.CSSStyleSheet.prototype.addRule=function(t,e,r){return void 0===r&&(r=this.cssRules.length),o.CSSStyleSheet.prototype.insertRule.apply(this,[t+" { "+e+" }",r])};var u,l,h=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(h,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e);var l=Ja(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&a.queueMutation(e,()=>r({id:h,styleId:c,removes:[{index:s}]})),u},"host")}),o.CSSStyleSheet.prototype.removeRule=function(t){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},o.CSSStyleSheet.prototype.replace&&(u=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);try{var l=null==u?void 0:u.then;if(e.ownerNode||!u||"function"!=typeof l)return u;n.onCssomSheetMutation(e);var h=Ja(e,i,n.styleMirror),c=h.id,d=h.styleId;if(!(c&&-1!==c||d&&-1!==d))return u;var v=a.queuePendingMutation(e,()=>r({id:c,styleId:d,replace:s}),()=>{var t=wo(e);null!==t&&r({id:c,styleId:d,replace:t})});try{l.call(u,()=>v(!0),()=>v(!1))}catch(t){v(!1)}}catch(t){}return u},"host")})),o.CSSStyleSheet.prototype.replaceSync&&(l=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e);var l=Ja(e,i,n.styleMirror),h=l.id,c=l.styleId;return(h&&-1!==h||c&&-1!==c)&&a.queueMutation(e,()=>r({id:h,styleId:c,replaceSync:s})),u},"host")}));var c={};ts("CSSGroupingRule")?c.CSSGroupingRule=o.CSSGroupingRule:(ts("CSSMediaRule")&&(c.CSSMediaRule=o.CSSMediaRule),ts("CSSConditionRule")&&(c.CSSConditionRule=o.CSSConditionRule),ts("CSSSupportsRule")&&(c.CSSSupportsRule=o.CSSSupportsRule));var d={};return Object.entries(c).forEach(t=>{var e=t[0],o=t[1];d[e]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(d[e].insertRule,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ja(e.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...Qa(e),u];a.queueMutation(e.parentStyleSheet,()=>r({id:h,styleId:c,adds:[{rule:s,index:d}]}))}return u},"host")}),o.prototype.deleteRule=new Proxy(d[e].deleteRule,{apply:Ha((t,e,o)=>{var s=o[0],u=t.apply(e,o);n.onCssomSheetMutation(e.parentStyleSheet);var l=Ja(e.parentStyleSheet,i,n.styleMirror),h=l.id,c=l.styleId;if(e.parentStyleSheet&&(h&&-1!==h||c&&-1!==c)){var d=[...Qa(e),s];a.queueMutation(e.parentStyleSheet,()=>r({id:h,styleId:c,removes:[{index:d}]}))}return u},"host")})}),Ha(()=>{o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=h,u&&(o.CSSStyleSheet.prototype.replace=u),l&&(o.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(t=>{var e=t[0],r=t[1];r.prototype.insertRule=d[e].insertRule,r.prototype.deleteRule=d[e].deleteRule})})}(t,{win:o,mutationQueue:l})),a.push(Ka(t,t.doc)),a.push(function(t,e){var r=t.styleDeclarationCb,i=t.mirror,n=t.ignoreCSSAttributes,o=t.stylesheetManager,a=e.win,s=e.mutationQueue,u=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(u,{apply:Ha((t,e,a)=>{var u,l=a[0],h=a[1],c=a[2],d=t.apply(e,a);if(n.has(l))return d;var v=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;o.onCssomSheetMutation(v);var f=Ja(v,i,o.styleMirror),p=f.id,g=f.styleId;if(p&&-1!==p||g&&-1!==g){var m=Qa(e.parentRule);s.queueMutation(v,()=>r({id:p,styleId:g,set:{property:l,value:h,priority:c},index:m}))}return d},"host")});var l=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:Ha((t,e,a)=>{var u,l=a[0],h=t.apply(e,a);if(n.has(l))return h;var c=null===(u=e.parentRule)||void 0===u?void 0:u.parentStyleSheet;o.onCssomSheetMutation(c);var d=Ja(c,i,o.styleMirror),v=d.id,f=d.styleId;if(v&&-1!==v||f&&-1!==f){var p=Qa(e.parentRule);s.queueMutation(c,()=>r({id:v,styleId:f,remove:{property:l},index:p}))}return h},"host")}),Ha(()=>{a.CSSStyleDeclaration.prototype.setProperty=u,a.CSSStyleDeclaration.prototype.removeProperty=l})}(t,{win:o,mutationQueue:l})),t.collectFonts&&a.push(function(t){var e=t.fontCb,r=t.doc,i=r.defaultView;if(!i)return()=>{};var n=[],o=new WeakMap,a=i.FontFace;i.FontFace=function(t,e,r){var i=new a(t,e,r);return o.set(i,{family:t,buffer:"string"!=typeof e,descriptors:r,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),i};var s=qn(r.fonts,"add",function(t){return function(r){return setTimeout(Ha(()=>{var t=o.get(r);t&&(e(t),o.delete(r))}),0),t.apply(this,[r])}});return n.push(()=>{i.FontFace=a}),n.push(s),Ha(()=>{n.forEach(t=>t())})}(t))}for(var h of(a.push(function(t){var e=t.doc,r=t.mirror,i=t.blockClass,n=t.blockSelector,o=t.selectionCb,a=!0,s=Ha(()=>{var t=e.getSelection();if(!(!t||a&&(null==t?void 0:t.isCollapsed))){a=t.isCollapsed||!1;for(var s=[],u=t.rangeCount||0,l=0;u>l;l++){var h=t.getRangeAt(l),c=h.startContainer,d=h.startOffset,v=h.endContainer,f=h.endOffset;Sa(c,i,n,!0)||Sa(v,i,n,!0)||s.push({start:r.getId(c),startOffset:d,end:r.getId(v),endOffset:f})}o({ranges:s})}});return s(),ca("selectionchange",s)}(t)),a.push(function(t){var e=t.customElementCb,r=t.doc.defaultView;return r&&r.customElements?qn(r.customElements,"define",function(t){return function(r,i,n){try{e({define:{name:r}})}catch(t){console.warn("Custom element callback failed for "+r)}return t.apply(this,[r,i,n])}}):()=>{}}(t)),t.plugins))a.push(h.observer(h.callback,o,h.options))}catch(t){try{s()}catch(t){}throw t}return s}function Ya(t){return void 0!==window[t]}function ts(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}var es=class{constructor(t){vo(this,"generateIdFn",void 0),vo(this,"iframeRemoteIdToLocalIdMap",new WeakMap),vo(this,"iframeLocalIdToRemoteIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,r,i){if(0>e)return e;var n=r||this.getRemoteIdToLocalIdMap(t),o=i||this.getLocalIdToRemoteIdMap(t),a=n.get(e);return void 0===a&&(a=this.generateIdFn(),n.set(e,a),o.set(a,e)),a}getIds(t,e){var r=this.getRemoteIdToLocalIdMap(t),i=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getId(t,e,r,i))}getRemoteId(t,e,r){var i;return"number"!=typeof e||0>e?e:null!==(i=(r||this.getLocalIdToRemoteIdMap(t)).get(e))&&void 0!==i?i:-1}getRemoteIds(t,e){var r=this.getLocalIdToRemoteIdMap(t);return e.map(e=>this.getRemoteId(t,e,r))}reset(t){if(!t)return this.iframeRemoteIdToLocalIdMap=new WeakMap,void(this.iframeLocalIdToRemoteIdMap=new WeakMap);this.iframeRemoteIdToLocalIdMap.delete(t),this.iframeLocalIdToRemoteIdMap.delete(t)}getRemoteIdToLocalIdMap(t){var e=this.iframeRemoteIdToLocalIdMap.get(t);return e||this.iframeRemoteIdToLocalIdMap.set(t,e=new Map),e}getLocalIdToRemoteIdMap(t){var e=this.iframeLocalIdToRemoteIdMap.get(t);return e||this.iframeLocalIdToRemoteIdMap.set(t,e=new Map),e}},rs=class{constructor(t){vo(this,"iframes",new WeakMap),vo(this,"crossOriginIframeMap",new WeakMap),vo(this,"crossOriginIframeMirror",new es(Wo)),vo(this,"crossOriginIframeStyleMirror",void 0),vo(this,"crossOriginIframeRootIdMap",new WeakMap),vo(this,"mirror",void 0),vo(this,"mutationCb",void 0),vo(this,"wrappedEmit",void 0),vo(this,"loadListener",void 0),vo(this,"pageHideListener",void 0),vo(this,"stylesheetManager",void 0),vo(this,"recordCrossOriginIframes",void 0),vo(this,"messageHandler",void 0),vo(this,"nestedIframeListeners",new Map),vo(this,"attachedWindows",new WeakMap),vo(this,"attachedDocuments",new WeakMap),vo(this,"attachedIframes",new Map),vo(this,"loadListenerDisposers",new WeakMap),vo(this,"iframeElementsById",new Map),vo(this,"pageHideHandlers",new WeakMap),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new es(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.messageHandler=this.handleMessage.bind(this),this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}registerLoadListenerDisposer(t,e){var r=this.loadListenerDisposers.get(t);r||this.loadListenerDisposers.set(t,r=new Set),r.add(e);var i=this.mirror.getId(t);-1!==i&&this.iframeElementsById.set(i,t)}getIframeElementById(t){var e,r,i;return null!==(e=null!==(r=null===(i=this.attachedIframes.get(t))||void 0===i?void 0:i.element)&&void 0!==r?r:this.iframeElementsById.get(t))&&void 0!==e?e:null}forgetIframeId(t){this.attachedIframes.delete(t),this.iframeElementsById.delete(t)}disposeLoadListeners(t){var e=this.loadListenerDisposers.get(t);e&&(e.forEach(t=>va(t)),this.loadListenerDisposers.delete(t))}removePageHideListener(t){var e=this.pageHideHandlers.get(t);e&&(e.forEach(t=>{da(t.win,"pagehide",t.handler)}),this.pageHideHandlers.delete(t))}addLoadListener(t){this.loadListener=t}addPageHideListener(t){this.pageHideListener=t}removeLoadListener(){this.loadListener=void 0}trackIframeContent(t,e){var r=this.mirror.getId(t);return this.attachedIframes.set(r,{element:t,content:e}),r}attachIframe(t,e){var r,i=this.trackIframeContent(t,e);if(t.contentDocument){var n=this.attachedDocuments.get(t);n||this.attachedDocuments.set(t,n=new Set),n.add(t.contentDocument)}this.mutationCb({adds:[{parentId:i,nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0});var o=t.contentWindow;if(this.recordCrossOriginIframes&&o&&!this.nestedIframeListeners.has(o)){var a=this.handleMessage.bind(this);va(()=>{o.addEventListener("message",a),this.nestedIframeListeners.set(o,a);var e=this.attachedWindows.get(t);e||this.attachedWindows.set(t,e=new Set),e.add(o)})}va(()=>{var e=t.contentWindow;if(e){var r=this.pageHideHandlers.get(t);if(r)for(var i of r)if(i.win===e)return;var n=()=>{var e;null===(e=this.pageHideListener)||void 0===e||e.call(this,t),t.contentDocument&&this.mirror.removeNodeFromMap(t.contentDocument)};e.addEventListener("pagehide",n),r||this.pageHideHandlers.set(t,r=new Set),r.add({win:e,handler:n})}}),null===(r=this.loadListener)||void 0===r||r.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){var e=t;if("rrweb"===e.data.type&&e.origin===e.data.origin&&t.source){var r=this.crossOriginIframeMap.get(t.source);if(r){var i=this.transformCrossOriginEvent(r,e.data.event);i&&this.wrappedEmit(i,e.data.isCheckout)}}}transformCrossOriginEvent(t,e){switch(e.type){case kn.FullSnapshot:this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);var r=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,r),this.patchRootIdOnNode(e.data.node,r),this.trackIframeContent(t,e.data.node),{timestamp:e.timestamp,type:kn.IncrementalSnapshot,data:{source:_n.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case kn.Meta:case kn.Load:case kn.DomContentLoaded:return!1;case kn.Plugin:return e;case kn.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case kn.IncrementalSnapshot:switch(e.data.source){case _n.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);var r=this.crossOriginIframeRootIdMap.get(t);r&&this.patchRootIdOnNode(e.node,r)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case _n.Drag:case _n.TouchMove:case _n.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case _n.ViewportResize:return!1;case _n.MediaInteraction:case _n.MouseInteraction:case _n.Scroll:case _n.CanvasMutation:case _n.Input:return this.replaceIds(e.data,t,["id"]),e;case _n.StyleSheetRule:case _n.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case _n.Font:return e;case _n.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case _n.AdoptedStyleSheet:var i;return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null===(i=e.data.styles)||void 0===i||i.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,r,i){for(var n of i)(Array.isArray(e[n])||"number"==typeof e[n])&&(e[n]=Array.isArray(e[n])?t.getIds(r,e[n]):t.getId(r,e[n]));return e}replaceIds(t,e,r){return this.replace(this.crossOriginIframeMirror,t,e,r)}replaceStyleIds(t,e,r){return this.replace(this.crossOriginIframeStyleMirror,t,e,r)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===Tn.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}removeIframeById(t){var e=this.attachedIframes.get(t),r=(null==e?void 0:e.element)||this.iframeElementsById.get(t)||this.mirror.getNode(t);if(this.iframeElementsById.delete(t),r){var i=r.contentWindow,n=this.attachedWindows.get(r);n&&(n.forEach(t=>{var e=this.nestedIframeListeners.get(t);e&&(da(t,"message",e),this.nestedIframeListeners.delete(t)),this.crossOriginIframeMap.delete(t)}),this.attachedWindows.delete(r)),i&&this.nestedIframeListeners.has(i)&&(da(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 o=this.attachedDocuments.get(r);o&&(o.forEach(t=>{va(()=>this.mirror.removeNodeFromMap(t))}),va(()=>Va(r,o)),this.attachedDocuments.delete(r))}e&&this.attachedIframes.delete(t)}cleanupDetachedIframes(){if(0!==this.attachedIframes.size){var t=[];this.attachedIframes.forEach((e,r)=>{this.mirror.has(r)||t.push(r)}),t.forEach(t=>this.removeIframeById(t))}}reattachIframes(){this.attachedIframes.forEach((t,e)=>{var r=t.content;this.mirror.has(e)?this.mutationCb({adds:[{parentId:e,nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}):this.attachedIframes.delete(e)})}destroy(){this.recordCrossOriginIframes&&da(window,"message",this.messageHandler),this.nestedIframeListeners.forEach((t,e)=>{da(e,"message",t)}),this.nestedIframeListeners.clear();var t=new Set;this.iframeElementsById.forEach(e=>t.add(e)),this.attachedIframes.forEach(e=>t.add(e.element)),t.forEach(t=>{this.disposeLoadListeners(t),this.removePageHideListener(t)}),this.crossOriginIframeMirror.reset(),this.crossOriginIframeStyleMirror.reset(),this.attachedIframes.clear(),this.crossOriginIframeMap=new WeakMap,this.iframes=new WeakMap,this.crossOriginIframeRootIdMap=new WeakMap,this.loadListenerDisposers=new WeakMap,this.pageHideHandlers=new WeakMap,this.attachedDocuments=new WeakMap,this.attachedWindows=new WeakMap,this.iframeElementsById=new Map}},is=class{constructor(t){vo(this,"shadowDoms",new WeakSet),vo(this,"mutationCb",void 0),vo(this,"scrollCb",void 0),vo(this,"bypassOptions",void 0),vo(this,"mirror",void 0),vo(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){var i,n;if(go(t)&&!this.shadowDoms.has(t)){this.shadowDoms.add(t);var o=null!==(i=null===(n=jn.host(t))||void 0===n?void 0:n.ownerDocument)&&void 0!==i?i:r,a=za(e({},this.bypassOptions,{doc:o,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t),s=a.observer,u=a.buffer;this.restoreHandlers.push({doc:o,handler(){s.disconnect(),u.destroy(),u.releaseCanvasManager();var t=$a.indexOf(u);-1!==t&&$a.splice(t,1)}}),this.restoreHandlers.push({doc:o,handler:Wa(e({},this.bypassOptions,{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))}),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(jn.host(t))),this.restoreHandlers.push({doc:o,handler:Ka({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t)})},0)}}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){var r=this;this.restoreHandlers.push({doc:e,handler:qn(t.prototype,"attachShadow",function(t){return function(i){var n=t.call(this,i),o=jn.shadowRoot(this);return o&&La(this)&&r.addShadowRoot(o,e),n}})})}reset(){this.restoreHandlers.forEach(t=>{var e=t.handler;try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}resetForDoc(t){var e=[];for(var r of this.restoreHandlers)if(r.doc===t)try{r.handler()}catch(t){}else e.push(r);this.restoreHandlers=e}},ns="skip-frame";function os(t){if("object"!=typeof t||null===t)return!1;var e=t.y,r=t.width,i=t.height;return Number.isFinite(t.x)&&Number.isFinite(e)&&Number.isFinite(r)&&Number.isFinite(i)&&r>=0&&i>=0}for(var as="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ss="undefined"==typeof Uint8Array?[]:new Uint8Array(256),us=0;64>us;us++)ss[as.charCodeAt(us)]=us;var ls=function(t){var e,r=new Uint8Array(t),i=r.length,n="";for(e=0;i>e;e+=3)n+=as[r[e]>>2],n+=as[(3&r[e])<<4|r[e+1]>>4],n+=as[(15&r[e+1])<<2|r[e+2]>>6],n+=as[63&r[e+2]];return i%3==2?n=n.substring(0,n.length-1)+"=":i%3==1&&(n=n.substring(0,n.length-2)+"=="),n},hs=new Map,cs=(t,e,r)=>{if(t&&(fs(t,e)||"object"==typeof t)){var i=function(t,e){var r=hs.get(t);return r||hs.set(t,r=new Map),r.has(e)||r.set(e,[]),r.get(e)}(r,t.constructor.name),n=i.indexOf(t);return-1===n&&(n=i.length,i.push(t)),n}};function ds(t,e,r,i){return t instanceof Array?t.map(t=>ds(t,e,r,i)):null===t?t:t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray?{rr_type:t.constructor.name,args:[Object.values(t)]}:t instanceof ArrayBuffer?{rr_type:t.constructor.name,base64:ls(t)}:t instanceof DataView?{rr_type:t.constructor.name,args:[ds(t.buffer,e,r,i),t.byteOffset,t.byteLength]}:t instanceof HTMLImageElement?{rr_type:t.constructor.name,src:t.src}:t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL(i.type,i.quality)}:t instanceof ImageData?{rr_type:t.constructor.name,args:[ds(t.data,e,r,i),t.width,t.height]}:fs(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:cs(t,e,r)}:t}var vs=(t,e,r,i)=>t.map(t=>ds(t,e,r,i)),fs=(t,e)=>{var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(r.find(r=>t instanceof e[r]))},ps=["webgl","webgl2"];function gs(t){return"nodeType"in t}function ms(t,r,i,n){var o=[];try{if(n){var a=function(t,r,i){var n=t.GPUCanvasContext;if((null==n?void 0:n.prototype)&&"function"==typeof n.prototype.configure)return qn(n.prototype,"configure",function(n){return function(o){var a=function(t){var e=t.canvas;return e&&"object"==typeof e?e:null}(this);if(!a||gs(a)&&Sa(a,r,i,!0))return n.call(this,o);gs(a)&&!("__context"in a)&&(a.__context="webgpu");var s=function(t){var e=t.GPUTextureUsage;return e?e.COPY_SRC|e.RENDER_ATTACHMENT:null}(t);return n.call(this,null!==s&&o?e({},o,{usage:"number"==typeof o.usage?o.usage|s:s}):o)}})}(t,r,i);a&&o.push(a)}var s=qn(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(e){for(var o=function(t){return"experimental-webgl"===t?"webgl":t}(e),a=arguments.length,s=new Array(a>1?a-1:0),u=1;a>u;u++)s[u-1]=arguments[u];if(!Sa(this,r,i,!0)&&("__context"in this||(this.__context=o),n&&ps.includes(o)))if(s[0]&&"object"==typeof s[0]){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0});return t.apply(this,[e,...s])}});o.push(s)}catch(t){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(t=>t())}}function ys(t,e,r,i,n,o,a){var s=[],u=Object.getOwnPropertyNames(t),l=function(u){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))return 0;try{if("function"!=typeof t[u])return 0;var l=qn(t,u,function(t){return function(){for(var s=arguments.length,l=new Array(s),h=0;s>h;h++)l[h]=arguments[h];var c=t.apply(this,l);if(cs(c,o,this),this.canvas&&"tagName"in this.canvas&&!Sa(this.canvas,i,n,!0)){var d={type:e,property:u,args:vs(l,o,this,a)};r(this.canvas,d)}return c}});s.push(l)}catch(o){var h=ma(t,u,{set(t){this.canvas&&"tagName"in this.canvas&&!Sa(this.canvas,i,n,!0)&&r(this.canvas,{type:e,property:u,args:[t],setter:!0})}});s.push(h)}};for(var h of u)l(h);return s}var bs='(function() {\n\t//#region ../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/base64-arraybuffer/1.0.2/f63fa6b5c318cf1c9f6bdd1d4292ad2f15f76f2ec78475025a2d44070e896fe9/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n\tvar chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\tvar lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n\tfor (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n\tvar encode = function(arraybuffer) {\n\t\tvar bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n\t\tfor (i = 0; i < len; i += 3) {\n\t\t\tbase64 += chars[bytes[i] >> 2];\n\t\t\tbase64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t\t\tbase64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t\t\tbase64 += chars[bytes[i + 2] & 63];\n\t\t}\n\t\tif (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n\t\telse if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n\t\treturn base64;\n\t};\n\t//#endregion\n\t//#region ../rrweb/src/record/workers/image-bitmap-data-url-worker.ts\n\tconst lastFingerprintMap = /* @__PURE__ */ new Map();\n\tconst transparentFingerprintMap = /* @__PURE__ */ new Map();\n\tconst lastSentAtMap = /* @__PURE__ */ new Map();\n\tconst PROVIDER_KEYFRAME_INTERVAL_MS = 3e4;\n\tfunction hashPixels(data) {\n\t\tconst view = new Uint32Array(data.buffer, data.byteOffset, data.byteLength >>> 2);\n\t\tlet primaryHash = 2166136261;\n\t\tlet secondaryHash = 2654435769;\n\t\tfor (let i = 0; i < view.length; i++) {\n\t\t\tprimaryHash ^= view[i];\n\t\t\tprimaryHash = Math.imul(primaryHash, 16777619);\n\t\t\tsecondaryHash ^= view[i];\n\t\t\tsecondaryHash = Math.imul(secondaryHash, 2246822507);\n\t\t}\n\t\treturn `${(primaryHash >>> 0).toString(16)}:${(secondaryHash >>> 0).toString(16)}`;\n\t}\n\tfunction frameFingerprint(width, height, data) {\n\t\treturn `${width}x${height}:${hashPixels(data)}`;\n\t}\n\tfunction transparentFingerprint(width, height) {\n\t\tconst pixelCount = width * height;\n\t\tlet hash = transparentFingerprintMap.get(pixelCount);\n\t\tif (hash === void 0) {\n\t\t\thash = hashPixels(new Uint8ClampedArray(pixelCount * 4));\n\t\t\ttransparentFingerprintMap.set(pixelCount, hash);\n\t\t}\n\t\treturn `${width}x${height}:${hash}`;\n\t}\n\tconst worker = self;\n\tlet reusableCanvas = null;\n\tlet reusableCtx = null;\n\tworker.onmessage = async function(e) {\n\t\tif ("resetFrameDedup" in e.data) {\n\t\t\tlastFingerprintMap.clear();\n\t\t\treturn;\n\t\t}\n\t\tif ("OffscreenCanvas" in globalThis) {\n\t\t\tconst { id, bitmap, width, height, displayWidth, displayHeight, dataURLOptions, maskRegions } = e.data;\n\t\t\ttry {\n\t\t\t\tif (!reusableCanvas || reusableCanvas.width !== width || reusableCanvas.height !== height) {\n\t\t\t\t\treusableCanvas = new OffscreenCanvas(width, height);\n\t\t\t\t\treusableCtx = reusableCanvas.getContext("2d", { willReadFrequently: true });\n\t\t\t\t}\n\t\t\t\tconst ctx = reusableCtx;\n\t\t\t\tctx.clearRect(0, 0, width, height);\n\t\t\t\tctx.drawImage(bitmap, 0, 0);\n\t\t\t\tbitmap.close();\n\t\t\t\tif (maskRegions) {\n\t\t\t\t\tctx.fillStyle = "black";\n\t\t\t\t\tfor (const region of maskRegions) ctx.fillRect(region.x, region.y, region.width, region.height);\n\t\t\t\t}\n\t\t\t\tconst fingerprint = frameFingerprint(width, height, ctx.getImageData(0, 0, width, height).data);\n\t\t\t\tif (fingerprint === (lastFingerprintMap.get(id) ?? transparentFingerprint(width, height))) {\n\t\t\t\t\tconst lastSentAt = lastSentAtMap.get(id);\n\t\t\t\t\tif (!(maskRegions !== void 0 && lastSentAt !== void 0 && Date.now() - lastSentAt >= PROVIDER_KEYFRAME_INTERVAL_MS)) return worker.postMessage({ id });\n\t\t\t\t}\n\t\t\t\tconst blob = await reusableCanvas.convertToBlob(dataURLOptions);\n\t\t\t\tconst arrayBuffer = await blob.arrayBuffer();\n\t\t\t\tworker.postMessage({\n\t\t\t\t\tid,\n\t\t\t\t\ttype: blob.type,\n\t\t\t\t\tbase64: encode(arrayBuffer),\n\t\t\t\t\tdisplayWidth,\n\t\t\t\t\tdisplayHeight\n\t\t\t\t});\n\t\t\t\tlastFingerprintMap.set(id, fingerprint);\n\t\t\t\tlastSentAtMap.set(id, Date.now());\n\t\t\t} catch {\n\t\t\t\tworker.postMessage({ id });\n\t\t\t}\n\t\t} else {\n\t\t\te.data.bitmap.close();\n\t\t\treturn worker.postMessage({ id: e.data.id });\n\t\t}\n\t};\n\t//#endregion\n})();\n',ws="undefined"!=typeof self&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",bs],{type:"text/javascript;charset=utf-8"});function ks(t){var e;try{if(!(e=ws&&(self.URL||self.webkitURL).createObjectURL(ws)))throw"";var r=new Worker(e,{name:null==t?void 0:t.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),r}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(bs),{name:null==t?void 0:t.name})}}var _s,Ss,xs,Cs=class{onFullSnapshot(){var t;null===(t=this.resetFrameDedup)||void 0===t||t.call(this)}acquire(){this.refCount+=1}reset(){this.refCount>0&&(this.refCount-=1),this.refCount>0||this.teardown()}teardown(){this.torndown||(this.torndown=!0,this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers(),null!==this.rafIdTimestamp&&(cancelAnimationFrame(this.rafIdTimestamp),this.rafIdTimestamp=null),null!==this.rafIdFlush&&(cancelAnimationFrame(this.rafIdFlush),this.rafIdFlush=null))}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){vo(this,"pendingCanvasMutations",new Map),vo(this,"rafStamps",{latestId:0,invokeId:null}),vo(this,"mirror",void 0),vo(this,"mutationCb",void 0),vo(this,"resetObservers",void 0),vo(this,"frozen",!1),vo(this,"locked",!1),vo(this,"rafIdTimestamp",null),vo(this,"rafIdFlush",null),vo(this,"refCount",0),vo(this,"torndown",!1),vo(this,"resetFrameDedup",null),vo(this,"processMutation",(t,e)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});var e=t.sampling,r=void 0===e?"all":e,i=t.win,n=t.blockClass,o=t.blockSelector,a=t.recordCanvas,s=t.dataURLOptions,u=t.resolutionScale,l=t.canvasMasking;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,n,o,s),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,n,o,{dataURLOptions:s,resolutionScale:u,canvasMasking:l})}initCanvasFPSObserver(t,e,r,n,o){var a=this;if("OffscreenCanvas"in e){var s,u="number"==typeof o.resolutionScale&&Number.isFinite(o.resolutionScale)?Math.min(1,Math.max(.1,o.resolutionScale)):1,l=ms(e,r,n,!0),h=new Map;try{s=new ks}catch(t){return}var c=!1;s.onerror=()=>{var t;c=!0,cancelAnimationFrame(d),null===(t=s.terminate)||void 0===t||t.call(s),this.resetFrameDedup=null},this.resetFrameDedup=()=>{s.postMessage({resetFrameDedup:!0})},s.onmessage=t=>{var e=t.data.id;if(h.set(e,!1),"base64"in t.data){var r=t.data,i=r.displayWidth,n=r.displayHeight;this.mutationCb({id:e,type:Cn["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/t,f=0,p=t=>{var l,g;c||(f&&v>t-f||(f=t,(l=[],g=t=>{try{t.querySelectorAll("canvas").forEach(t=>{Sa(t,r,n,!0)||l.push(t)}),t.querySelectorAll("*").forEach(t=>{t.shadowRoot&&g(t.shadowRoot)})}catch(t){}},g(e.document),l).forEach(function(){var t=i(function*(t){var e=a.mirror.getId(t);if(!h.get(e)&&0!==t.width&&0!==t.height){h.set(e,!0);try{if(["webgl","webgl2"].includes(t.__context)){var r,i,n=t.getContext(t.__context);if(null==n||null===(r=n.isContextLost)||void 0===r?void 0:r.call(n))return void h.set(e,!1);!1===(null==n||null===(i=n.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}var l=t.clientWidth||t.width,c=t.clientHeight||t.height,d=Math.max(1,Math.round(l*u)),v=Math.max(1,Math.round(c*u)),f=function(t,e,r,i,n,o){if(t&&"function"==typeof t.regionsFn){var a;try{a=t.regionsFn(e)}catch(t){return ns}if(void 0!==a){if(!Array.isArray(a)||!a.every(os))return ns;var s=r/n,u=i/o;return a.filter(t=>t.width>0&&t.height>0).map(t=>{var e=Math.floor(t.x*s),r=Math.floor(t.y*u);return{x:e,y:r,width:Math.ceil((t.x+t.width)*s)-e,height:Math.ceil((t.y+t.height)*u)-r}})}}}(o.canvasMasking,t,d,v,l,c);if("skip-frame"===f)return void h.set(e,!1);var p=yield createImageBitmap(t,1>u?{resizeWidth:d,resizeHeight:v,resizeQuality:"medium"}:{resizeWidth:d,resizeHeight:v});s.postMessage({id:e,bitmap:p,width:d,height:v,displayWidth:l,displayHeight:c,dataURLOptions:o.dataURLOptions,maskRegions:f},[p])}catch(t){h.set(e,!1)}}});return function(e){return t.apply(this,arguments)}}())),d=requestAnimationFrame(p))};d=requestAnimationFrame(p),this.resetObservers=()=>{var t;l(),cancelAnimationFrame(d),null===(t=s.terminate)||void 0===t||t.call(s),this.resetFrameDedup=null}}}initCanvasMutationObserver(t,e,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var n=ms(t,e,r,!1),o=function(t,e,r,i,n){var o=[],a=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype),s=function(a){try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[a])return 1;var s=qn(e.CanvasRenderingContext2D.prototype,a,function(o){return function(){for(var s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];return Sa(this.canvas,r,i,!0)||setTimeout(()=>{var r=vs(u,e,this,n);t(this.canvas,{type:Cn["2D"],property:a,args:r})},0),o.apply(this,u)}});o.push(s)}catch(n){var u=ma(e.CanvasRenderingContext2D.prototype,a,{set(e){Sa(this.canvas,r,i,!0)||t(this.canvas,{type:Cn["2D"],property:a,args:[e],setter:!0})}});o.push(u)}};for(var u of a)if(s(u))continue;return()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,r,i),a=function(t,e,r,i,n){var o=[];return void 0!==e.WebGLRenderingContext&&o.push(...ys(e.WebGLRenderingContext.prototype,Cn.WebGL,t,r,i,e,n)),void 0!==e.WebGL2RenderingContext&&o.push(...ys(e.WebGL2RenderingContext.prototype,Cn.WebGL2,t,r,i,e,n)),()=>{o.forEach(t=>t())}}(this.processMutation.bind(this),t,e,r,i);this.resetObservers=()=>{n(),o(),a()}}startPendingCanvasMutationFlusher(){this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){var t=e=>{this.rafStamps.latestId=e,this.rafIdTimestamp=requestAnimationFrame(t)};this.rafIdTimestamp=requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{var r=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,r)}),this.rafIdFlush=requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,r){if(!this.frozen&&!this.locked){var i=this.pendingCanvasMutations.get(e);if(i&&-1!==r){var n=i.map(e=>function(t,e){if(null==t)return{};var r={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(-1!==e.indexOf(i))continue;r[i]=t[i]}return r}(e,t));this.mutationCb({id:r,type:i[0].type,commands:n}),this.pendingCanvasMutations.delete(e)}}}},Ms=class{constructor(t){var e;vo(this,"trackedLinkElements",new WeakSet),vo(this,"pendingDeferredSheets",new Set),vo(this,"mutationCb",void 0),vo(this,"adoptedStyleSheetCb",void 0),vo(this,"maskAllElementAttributes",void 0),vo(this,"maskAttributeFn",void 0),vo(this,"styleMirror",new Aa),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb,this.maskAllElementAttributes=null!==(e=t.maskAllElementAttributes)&&void 0!==e&&e,this.maskAttributeFn=t.maskAttributeFn}attachLinkElement(t,e){"_cssText"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}beginDeferredLinkInlining(t,e){if(-1===e||!t.isConnected)return null;var r=null,i=null;try{(i=t.sheet)&&(r=To(i))}catch(t){}if(!r||!i)return lo(),null;var n=r,o=!1,a={sheet:i,invalidate(){o=!0}};this.pendingDeferredSheets.add(a);var s=!1;return{advance:r=>{if(s)return!0;var u,l,h=Bn(),c=Un(),d=!0;try{if(o)return s=!0,lo(),!0;if(!n.advance(r))return d=!1,!1;s=!0;var v=n.text();if(!t.isConnected)return!0;var f=null;try{f=t.sheet}catch(t){}return f!==i?(lo(),!0):v?(this.emitCssTextMutation(t,e,v),!0):(lo(),!0)}finally{d&&this.pendingDeferredSheets.delete(a),zn(u=Bn()-h,null!=(l=c)?l:Hn)||(eo.totalMs+=u,u>eo.slowestSliceMs&&(eo.slowestSliceMs=u))}},remainingRules:()=>n.remainingRules(),discard:()=>{this.pendingDeferredSheets.delete(a)}}}onCssomSheetMutation(t){if(t&&0!==this.pendingDeferredSheets.size)for(var e of this.pendingDeferredSheets)e.sheet===t&&(this.pendingDeferredSheets.delete(e),e.invalidate())}inlineDeferredLinkElement(t,e){var r;null===(r=this.beginDeferredLinkInlining(t,e))||void 0===r||r.advance(1/0)}emitCssTextMutation(t,e,r){this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e,attributes:{_cssText:Lo({element:t,name:"_cssText",value:r,maskAllElementAttributes:this.maskAllElementAttributes,maskAttributeFn:this.maskAttributeFn})}}]})}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){var r=this;if(0!==t.length){var i={id:e,styleIds:[]},n=[],o=function(t){var e;if(r.styleMirror.has(t))e=r.styleMirror.getId(t);else{var o=r.styleMirror.add(t);e=o;var a=Bn();try{ao(()=>{try{var e=t.rules||t.cssRules;e&&oo(e)}catch(t){}n.push({styleId:o,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:ko(e,t.href),index:r}))})})}finally{so(Bn()-a)}}i.styleIds.push(e)};for(var a of t)o(a);n.length>0&&(i.styles=n),this.adoptedStyleSheetCb(i)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet,this.pendingDeferredSheets.clear(),ia.forEach(t=>t.abort()),ia.clear()}trackStylesheetInLinkElement(t){}},Ts=class{constructor(){vo(this,"nodeMap",new WeakMap),vo(this,"active",!1)}inOtherBuffer(t,e){var r=this.nodeMap.get(t);return r&&Array.from(r).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}},Is=!1;try{if(2!==Array.from([1],t=>2*t)[0]){var Rs,As=document.createElement("iframe");document.body.appendChild(As),Array.from=(null===(Rs=As.contentWindow)||void 0===Rs?void 0:Rs.Array.from)||Array.from,document.body.removeChild(As)}}catch(t){console.debug("Unable to override Array.from",t)}var Es=new Io,Ls=new Set([_n.Mutation,_n.MediaInteraction,_n.StyleSheetRule,_n.CanvasMutation,_n.Font,_n.Log,_n.StyleDeclaration,_n.AdoptedStyleSheet]);function Os(t){var e=window;if("function"==typeof e.requestIdleCallback){var r=e.requestIdleCallback(t,{timeout:2e3});return{cancel(){var t;return null===(t=e.cancelIdleCallback)||void 0===t?void 0:t.call(e,r)}}}var i=setTimeout(t,250);return{cancel:()=>clearTimeout(i)}}function Ds(t){var r;void 0===t&&(t={});var i=t,n=i.emit,o=i.checkoutEveryNms,a=i.checkoutEveryNth,s=i.blockClass,u=void 0===s?"rr-block":s,l=i.blockSelector,h=void 0===l?null:l,c=i.ignoreClass,d=void 0===c?"rr-ignore":c,v=i.ignoreSelector,f=void 0===v?null:v,p=i.maskTextClass,g=void 0===p?"rr-mask":p,m=i.maskTextSelector,y=void 0===m?null:m,b=i.inlineStylesheet,w=void 0===b||b,k=i.inlineStylesheetBudgetRules,_=i.maskAllInputs,S=i.maskInputOptions,x=i.slimDOMOptions,C=i.maskInputFn,M=i.maskTextFn,T=i.maskAllElementAttributes,I=void 0!==T&&T,R=i.maskAttributeFn,A=i.hooks,E=i.packFn,L=i.sampling,O=void 0===L?{}:L,D=i.dataURLOptions,P=void 0===D?{}:D,F=i.canvasResolutionScale,N=i.canvasMasking,q=i.mousemoveWait,j=i.recordDOM,B=void 0===j||j,H=i.recordCanvas,U=void 0!==H&&H,z=i.recordCrossOriginIframes,W=void 0!==z&&z,V=i.recordAfter,Z=void 0===V?"DOMContentLoaded"===t.recordAfter?t.recordAfter:"load":V,G=i.userTriggeredOnInput,Q=void 0!==G&&G,J=i.collectFonts,K=void 0!==J&&J,X=i.inlineImages,Y=void 0!==X&&X,tt=i.plugins,et=i.keepIframeSrcFn,rt=void 0===et?()=>!1:et,it=i.ignoreCSSAttributes,nt=void 0===it?new Set([]):it,ot=i.attributeFilter;Da=i.errorHandler;var at=e({type:"image/webp",quality:.4,maxBase64ImageLength:1048576},P),st=!W||window.parent===window,ut=!1;if(!st)try{window.parent.document&&(ut=!1)}catch(t){ut=!0}if(st&&!n)throw new Error("emit function is required");if(!st&&!ut)return()=>{};void 0!==q&&void 0===O.mousemove&&(O.mousemove=q),Es.reset();var lt,ht=!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},ct=la(void 0!==x&&x);!function(t){void 0===t&&(t=window),"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=[].forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=[].forEach)}();var dt,vt,ft=0,pt=new Map,gt=t=>{for(var e of tt||[])e.eventProcessor&&(t=e.eventProcessor(t));return E&&!ut&&(t=E(t)),t};_s=(t,e)=>{var r,i=t;if(i.timestamp=ya(),!(null===(r=$a[0])||void 0===r?void 0:r.isFrozen())||i.type===kn.FullSnapshot||i.type===kn.IncrementalSnapshot&&Ls.has(i.data.source)||$a.forEach(t=>t.unfreeze()),st)null==n||n(gt(i),e);else if(ut){var s={type:"rrweb",event:gt(i),origin:window.location.origin,isCheckout:e};window.parent.postMessage(s,"*")}if(i.type===kn.FullSnapshot)lt=i,ft=0;else if(i.type===kn.IncrementalSnapshot){if(i.data.source===_n.Mutation&&i.data.isAttachIframe)return;ft++,(a&&ft>=a||o&&i.timestamp-lt.timestamp>o)&&Ss(!0)}};var mt=t=>{if(t.removes&&t.removes.length>0){var r=t.adds.length>0?new Set(t.adds.map(t=>t.node.id)):null,i=new Set;if(t.adds.length>0)for(var n of t.adds){var o=Es.getNode(n.node.id);o&&"IFRAME"===o.nodeName&&i.add(o)}t.removes.forEach(t=>{var e=t.id;if(!r||!r.has(e)){var n=kt.getIframeElementById(e);n&&i.has(n)?kt.forgetIframeId(e):(null==dt||dt(e),kt.removeIframeById(e))}}),null==vt||vt(),kt.cleanupDetachedIframes()}_s({type:kn.IncrementalSnapshot,data:e({source:_n.Mutation},t)})},yt=t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.Scroll},t)}),bt=t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.CanvasMutation},t)}),wt=new Ms({mutationCb:mt,adoptedStyleSheetCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.AdoptedStyleSheet},t)}),maskAllElementAttributes:I,maskAttributeFn:R}),kt=new rs({mirror:Es,mutationCb:mt,stylesheetManager:wt,recordCrossOriginIframes:W,wrappedEmit:_s});for(var _t of tt||[])_t.getMirror&&_t.getMirror({nodeMirror:Es,crossOriginIframeMirror:kt.crossOriginIframeMirror,crossOriginIframeStyleMirror:kt.crossOriginIframeStyleMirror});var St=new Ts,xt=null==N?void 0:N.configured;xs=new Cs({recordCanvas:U,mutationCb:bt,win:window,blockClass:u,blockSelector:h,mirror:Es,sampling:O.canvas,dataURLOptions:at,resolutionScale:F,canvasMasking:N});var Ct=new is({mutationCb:mt,scrollCb:yt,bypassOptions:{blockClass:u,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskInputOptions:ht,dataURLOptions:at,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:R,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:Y,sampling:O,slimDOMOptions:ct,iframeManager:kt,stylesheetManager:wt,canvasManager:xs,keepIframeSrcFn:rt,processedNodeManager:St,attributeFilter:ot},mirror:Es});Ss=function(t){if(void 0===t&&(t=!1),B){ro(k);try{_s({type:kn.Meta,data:{href:window.location.href,width:ka(),height:wa()}},t),null==r||r.cancel(),r=void 0,wt.reset(),Ct.init(),$a.forEach(t=>t.lock());var e,i=null;try{i=function(t,e){var r=e||{},i=r.mirror,n=void 0===i?new Io:i,o=r.blockClass,a=void 0===o?"rr-block":o,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,R=r.preserveWhiteSpace,A=r.onSerialize,E=r.onIframeLoad,L=r.iframeLoadTimeout,O=r.onIframeListenerRegistered,D=r.onStylesheetLoad,P=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=la(void 0!==T&&T);ro(j);try{return ua(t,{doc:t,mirror:n,blockClass:a,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:R,onSerialize:A,onIframeLoad:E,iframeLoadTimeout:L,onIframeListenerRegistered:O,onStylesheetLoad:D,stylesheetLoadTimeout:P,keepIframeSrcFn:N,newlyAddedElement:!1,maxDepth:q})}finally{io()}}(document,{mirror:Es,blockClass:u,blockSelector:h,maskTextClass:g,maskTextSelector:y,inlineStylesheet:w,maskAllInputs:ht,inlineStylesheetBudgetRules:k,maskTextFn:M,maskInputFn:C,maskAllElementAttributes:I,maskAttributeFn:R,slimDOM:ct,dataURLOptions:at,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:Y,onSerialize(t){Ta(t,Es)&&kt.addIframe(t),Ia(t,Es)&&wt.trackLinkElement(t),Ra(t)&&Ct.addShadowRoot(jn.shadowRoot(t),document)},onIframeLoad(t,e){kt.attachIframe(t,e),Ct.observeAttachShadow(t)},onIframeListenerRegistered(t,e){kt.registerLoadListenerDisposer(t,e)},onStylesheetLoad(t,e){wt.attachLinkElement(t,e)},keepIframeSrcFn:rt})}finally{o=Kn,Kn=[],e=o}if(!i)return console.warn("Failed to snapshot the document");if(_s({type:kn.FullSnapshot,data:{node:i,initialOffset:ba(window)}},t),$a.forEach(t=>t.unlock()),xs.onFullSnapshot(),e.length){var n=function(t,e,r){var i=!1,n=null,o=0,a=null,s=()=>null!==a||t.length>o,u=()=>{var r=t[o];t[o]=null,o+=1,r&&va(()=>{a=e.beginDeferredLinkInlining(r,Es.getId(r))})},l=()=>{if(a){var t=a,e=!0;va(()=>{e=t.advance(200)}),e&&(a=null)}},h=()=>{a||u(),l()},c=t=>{if(n=null,!i){var e=0;do{try{h()}catch(t){null==a||a.discard(),a=null,ho(1)}e+=1}while(!i&&s()&&(t?!t.didTimeout&&t.timeRemaining()>5:10>e));i||(s()?n=Os(c):r())}};return n=Os(c),{cancel(){i=!0,null==a||a.discard(),a=null,null==n||n.cancel(),n=null},flush(){if(!i){i=!0,null==n||n.cancel(),n=null;for(var e=0,h=0;s()&&50>e;){a||u();var c=a;if(c)if(Math.floor(c.remainingRules()/200)+1>50-e)c.discard(),a=null,h+=1;else{try{l()}catch(t){null==a||a.discard(),a=null,h+=1}e+=1}}if(s()||h>0){for(var d=h+(null!==a?1:0),v=o;t.length>v;v++)null!==t[v]&&(d+=1);ho(d),null==a||a.discard(),a=null}r()}}}}(e,wt,()=>{r===n&&(r=void 0)});r=n}W&&kt.reattachIframes(),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&wt.adoptStyleSheets(document.adoptedStyleSheets,Es.getId(document))}finally{io()}var o}};try{var Mt=[];for(var Tt of(Mt.push(ca("pagehide",()=>{try{null==r||r.flush()}catch(t){}r=void 0},window)),["visibilitychange","freeze","resume"]))Mt.push(ca(Tt,$n,document));dt=t=>{var e=pt.get(t);e&&(e.forEach(t=>{va(t);var e=Mt.indexOf(t);-1!==e&&Mt.splice(e,1)}),pt.delete(t))},vt=()=>{for(var t of pt){var e=t[0],r=Es.getNode(e);if(r)try{r.contentDocument&&r.contentDocument.defaultView||null==dt||dt(e)}catch(t){null==dt||dt(e)}else null==dt||dt(e)}};var It=t=>{var r;return Ha(Xa)({mutationCb:mt,mousemoveCb:(t,e)=>_s({type:kn.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.MouseInteraction},t)}),scrollCb:yt,viewportResizeCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.ViewportResize},t)}),inputCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.Input},t)}),mediaInteractionCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.MediaInteraction},t)}),styleSheetRuleCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.StyleSheetRule},t)}),styleDeclarationCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.StyleDeclaration},t)}),canvasMutationCb:bt,fontCb:t=>_s({type:kn.IncrementalSnapshot,data:e({source:_n.Font},t)}),selectionCb(t){_s({type:kn.IncrementalSnapshot,data:e({source:_n.Selection},t)})},customElementCb(t){_s({type:kn.IncrementalSnapshot,data:e({source:_n.CustomElement},t)})},blockClass:u,ignoreClass:d,ignoreSelector:f,maskTextClass:g,maskTextSelector:y,maskInputOptions:ht,inlineStylesheet:w,sampling:O,recordDOM:B,recordCanvas:U,canvasMaskingConfigured:xt,inlineImages:Y,userTriggeredOnInput:Q,collectFonts:K,doc:t,maskInputFn:C,maskTextFn:M,maskAllElementAttributes:I,maskAttributeFn:R,keepIframeSrcFn:rt,blockSelector:h,slimDOMOptions:ct,dataURLOptions:at,mirror:Es,iframeManager:kt,stylesheetManager:wt,shadowDomManager:Ct,processedNodeManager:St,canvasManager:xs,ignoreCSSAttributes:nt,attributeFilter:ot,plugins:(null==tt||null===(r=tt.filter(t=>t.observer))||void 0===r?void 0:r.map(t=>({observer:t.observer,options:t.options,callback:e=>_s({type:kn.Plugin,data:{plugin:t.name,payload:e}})})))||[]},A)};kt.addLoadListener(t=>{try{var e=Es.getId(t),r=It(t.contentDocument);if("function"==typeof r&&(Mt.push(r),-1!==e)){var i=pt.get(e);i||pt.set(e,i=new Set),i.add(r)}}catch(t){console.warn(t)}}),kt.addPageHideListener(t=>{var e=Es.getId(t);null==dt||dt(e),Va(t)});var Rt=-1,At=t=>_s({type:kn.Custom,data:{tag:"rrweb/fullscreen",payload:t}}),Et=()=>{var t,e,r,i,n=document,o=null!==(t=null!==(e=null!==(r=null!==(i=n.fullscreenElement)&&void 0!==i?i:n.webkitFullscreenElement)&&void 0!==r?r:n.mozFullScreenElement)&&void 0!==e?e:n.msFullscreenElement)&&void 0!==t?t:null,a=o?Es.getId(o):-1;a!==Rt&&(-1!==Rt&&At({id:Rt,enter:!1}),Rt=a,-1!==a&&At({id:a,enter:!0}))},Lt=()=>{Ss();var t=It(document);"function"==typeof t&&Mt.push(t),Mt.push(ca("fullscreenchange",Et)),Mt.push(ca("webkitfullscreenchange",Et)),Mt.push(ca("mozfullscreenchange",Et)),Mt.push(ca("MSFullscreenChange",Et)),Is=!0};return["interactive","complete"].includes(document.readyState)?Lt():(Mt.push(ca("DOMContentLoaded",()=>{_s({type:kn.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&Lt()})),Mt.push(ca("load",()=>{_s({type:kn.Load,data:{}}),"load"===Z&&Lt()},window))),()=>{try{null==r||r.flush()}catch(t){}r=void 0,Mt.forEach(t=>va(t)),St.destroy(),kt.removeLoadListener(),kt.destroy(),pt.clear(),Ct.reset(),Es.reset(),Is=!1,Da=void 0}}catch(t){console.warn(t)}}function Ps(t){return Ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(t)}function Fs(t,e,r){return(e=function(t){var e=function(t){if("object"!=Ps(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Ps(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ps(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Ds.addCustomEvent=(t,e)=>{if(!Is)throw new Error("please add custom event after start recording");_s({type:kn.Custom,data:{tag:t,payload:e}})},Ds.freezePage=()=>{$a.forEach(t=>t.freeze())},Ds.takeFullSnapshot=t=>{if(!Is)throw new Error("please take full snapshot after start recording");Ss(t)},Ds.mirror=Es,"Mobile".toLowerCase(),"Tablet".toLowerCase(),new RegExp("Xbox","i"),new RegExp("Nintendo","i"),new RegExp("PlayStation","i"),new RegExp("Windows","i"),Date,Date;var Ns=class{constructor(t){Fs(this,"fileName",void 0),Fs(this,"functionName",void 0),Fs(this,"lineNumber",void 0),Fs(this,"columnNumber",void 0),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}toString(){var t=this.lineNumber||"",e=this.columnNumber||"";return this.functionName?this.functionName+" ("+this.fileName+":"+t+":"+e+")":this.fileName+":"+t+":"+e}},qs=/(^|@)\S+:\d+/,js=/^\s*at .*(\S+:\d+|\(native\))/m,Bs=/^(eval@)?(\[native code])?$/,Hs={parse(t){return t?void 0!==t.stacktrace||void 0!==t["opera#sourceloc"]?this.parseOpera(t):t.stack&&t.stack.match(js)?this.parseV8OrIE(t):t.stack?this.parseFFOrSafari(t):[]:[]},extractLocation(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));if(!e)throw new Error("Cannot parse given url: "+t);return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE(t){return t.stack.split("\n").filter(function(t){return!!t.match(js)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=e.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(e=r?e.replace(r[0],""):e).split(/\s+/).slice(1),n=this.extractLocation(r?r[1]:i.pop());return new Ns({functionName:i.join(" ")||void 0,fileName:["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseFFOrSafari(t){return t.stack.split("\n").filter(function(t){return!t.match(Bs)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new Ns({functionName:t});var e=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=t.match(e),i=r&&r[1]?r[1]:void 0,n=this.extractLocation(t.replace(e,""));return new Ns({functionName:i,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)},parseOpera(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,r=t.message.split("\n"),i=[],n=2,o=r.length;o>n;n+=2){var a=e.exec(r[n]);a&&i.push(new Ns({fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera10(t){for(var e=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=t.stacktrace.split("\n"),i=[],n=0,o=r.length;o>n;n+=2){var a=e.exec(r[n]);a&&i.push(new Ns({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return i},parseOpera11(t){return t.stack.split("\n").filter(function(t){return!!t.match(qs)&&!t.match(/^Error created at/)},this).map(function(t){var e=t.split("@"),r=this.extractLocation(e.pop());return new Ns({functionName:(e.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,fileName:r[0],lineNumber:r[1],columnNumber:r[2]})},this)}};function $s(t){if(!t||!t.outerHTML)return"";for(var e="";t.parentElement;){var r=t.localName;if(!r)break;r=r.toLowerCase();var i=t.parentElement,n=[];if(i.children&&i.children.length>0)for(var o=0;i.children.length>o;o++){var a=i.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===r&&n.push(a)}n.length>1&&(r+=":eq("+n.indexOf(t)+")"),e=r+(e?">"+e:""),t=i}return e}function Us(t){return Array.isArray(t)}function zs(t){return"object"==typeof t&&null!==t&&!Us(t)}function Ws(t,e){if(0===e)return!0;for(var r of Object.keys(t))if(zs(t[r])&&Ws(t[r],e-1))return!0;return!1}function Vs(t,e){var r={numOfKeysLimit:50,depthOfLimit:4};Object.assign(r,e);var i=[],n=[];return JSON.stringify(t,function(t,e){if(i.length>0){var o=i.indexOf(this);~o?i.splice(o+1):i.push(this),~o?n.splice(o,1/0,t):n.push(t),~i.indexOf(e)&&(e=i[0]===e?"[Circular ~]":"[Circular ~."+n.slice(0,i.indexOf(e)).join(".")+"]")}else i.push(e);if(null===e)return e;if(void 0===e)return"undefined";if(zs(a=e)&&Object.keys(a).length>r.numOfKeysLimit||"function"==typeof a||zs(a)&&Ws(a,r.depthOfLimit))return function(t){var e=t.toString();return r.stringLengthLimit&&e.length>r.stringLengthLimit&&(e=e.slice(0,r.stringLengthLimit)+"..."),e}(e);var a;if("bigint"==typeof e)return e.toString()+"n";if(e instanceof Event){var s={};for(var u in e){var l=e[u];s[u]=Us(l)?$s(l.length?l[0]:null):l}return s}return e instanceof Node?e instanceof HTMLElement?e?e.outerHTML:"":e.nodeName:e instanceof Error?e.stack?e.stack+"\nEnd of stack for Error object":e.name+": "+e.message:e})}var Zs={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 Gs(t,e,r){var i,n=r?Object.assign({},Zs,r):Zs,o=n.logger;if(!o)return()=>{};i="string"==typeof o?e[o]:o;var a=0,s=!1,u=[];if(n.level.includes("error")){var l=e=>{var r=e.message;t({level:"error",trace:Hs.parse(e.error).map(t=>t.toString()),payload:[Vs(r,n.stringifyOptions)]})};e.addEventListener("error",l),u.push(()=>{e.removeEventListener("error",l)});var h=e=>{var r,i;e.reason instanceof Error?i=[Vs("Uncaught (in promise) "+(r=e.reason).name+": "+r.message,n.stringifyOptions)]:(r=new Error,i=[Vs("Uncaught (in promise)",n.stringifyOptions),Vs(e.reason,n.stringifyOptions)]),t({level:"error",trace:Hs.parse(r).map(t=>t.toString()),payload:i})};e.addEventListener("unhandledrejection",h),u.push(()=>{e.removeEventListener("unhandledrejection",h)})}for(var c of n.level)u.push(d(i,c));return()=>{u.forEach(t=>t())};function d(e,r){var i=this;return e[r]?function(e,o){try{if(!(o in e))return()=>{};var u=e[o],l={next:u},h=(e=>function(){for(var o=arguments.length,u=new Array(o),l=0;o>l;l++)u[l]=arguments[l];if(e.apply(i,u),!("assert"===r&&u[0]||s)){s=!0;try{var h=Hs.parse(new Error).map(t=>t.toString()).splice(1),c=("assert"===r?u.slice(1):u).map(t=>Vs(t,n.stringifyOptions));a++,n.lengthThreshold>a?t({level:r,trace:h,payload:c}):a===n.lengthThreshold&&t({level:"warn",trace:[],payload:[Vs("The number of log records reached the threshold.")]})}catch(t){e("rrweb logger error:",t,...u)}finally{s=!1}}})(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return l.next.apply(this,e)});return"function"==typeof h&&(h.prototype=h.prototype||{},Object.defineProperties(h,{__rrweb_original__:{enumerable:!1,value:u},__rrweb_layer__:{enumerable:!1,value:l}})),e[o]=h,()=>{if(e[o]!==h)for(var t=t=>{var e;return"function"==typeof t?null!==(e=t.__rrweb_layer__)&&void 0!==e?e:t.__posthog_layer__:void 0},r=e[o],i=t(r);i;){if(i.next===h)return void(i.next=l.next);i=t(r=i.next)}else e[o]=l.next}}catch(t){return()=>{}}}(e,r):()=>{}}}var Qs=t=>({name:"rrweb/console@1",observer:Gs,options:t}),Js=()=>{},Ks=t=>{var e;if(Z(t))return null!==(e=t.__posthog_layer__)&&void 0!==e?e:t.__rrweb_layer__};function Xs(t,e,r){try{if(!(e in t))return Js;var i={next:t[e]},n=r(function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];return i.next.apply(this,e)});return Z(n)&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:i}})),t[e]=n,()=>{if(t[e]!==n)for(var r=t[e],o=Ks(r);o;){if(o.next===n)return void(o.next=i.next);o=Ks(r=o.next)}else t[e]=i.next}}catch(t){return Js}}function Ys(t,e){var r,i=function(t){try{return"string"==typeof t?new URL(t).hostname:"url"in t?new URL(t.url).hostname:t.hostname}catch(t){return null}}(t),n={hostname:i,isHostDenied:!1};if(null==(r=e.payloadHostDenyList)||!r.length||null==i||!i.trim().length)return n;for(var o of e.payloadHostDenyList)if(i.endsWith(o))return{hostname:i,isHostDenied:!0};return n}var tu=te("[Recorder]"),eu=t=>"navigation"===t.entryType,ru=t=>"resource"===t.entryType;function iu(t,e){return!!e&&(et(e)||e[t])}function nu(t){if("undefined"==typeof Request)return!1;if(t instanceof Request)return!0;try{return"[object Request]"==={}.toString.call(t)}catch(t){return!1}}var ou=["image/","video/","audio/","font/","application/octet-stream","application/pdf","application/zip","application/wasm"];function au(t){var e=t.type,r=t.recordBody,i=t.headers;function n(t){var e=Object.keys(i).find(t=>"content-type"===t.toLowerCase()),r=e&&i[e];return t.some(t=>null==r?void 0:r.toLowerCase().includes(t))}if(!r)return!1;if(function t(e){try{return"string"==typeof e?e.startsWith("blob:"):e instanceof URL?"blob:"===e.protocol:!!nu(e)&&t(e.url)}catch(t){return!1}}(t.url))return!1;if(n(ou))return!1;if(et(r))return!0;if(V(r))return n(r);var o=r[e];return et(o)?o:n(o)}function su(t,e,r,i,n,o){return uu.apply(this,arguments)}function uu(){return uu=i(function*(t,e,r,i,n,o){return void 0===o&&(o=0),o>10?(tu.warn("Failed to get performance entry for request",{url:r,initiatorType:e}),null):function(t,e){for(var r=t.length-1;r>=0;r-=1)if(e(t[r]))return t[r]}(t.performance.getEntriesByName(r),t=>ru(t)&&t.initiatorType===e&&(Q(i)||t.startTime>=i)&&(Q(n)||n>=t.startTime))||(yield new Promise(t=>setTimeout(t,50*o)),su(t,e,r,i,n,o+1))}),uu.apply(this,arguments)}function lu(t){var e=t.body,r=t.options,i=t.url;if(Y(e))return null;var n=Ys(i,r);if(n.isHostDenied)return n.hostname+" is in deny list";if(J(e))return e;if((t=>"u">typeof Document&&t instanceof Document)(e))return e.textContent;if(rt(e))return function(t,e){var r,i;void 0===e&&(e="&");var n=[];return ee(t,function(t,e){Q(t)||Q(e)||"undefined"===e||(r=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),i=encodeURIComponent(e),n[n.length]=i+"="+r)}),n.join(e)}(e);if(G(e))try{return JSON.stringify(e)}catch(t){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(e)}var hu=t=>!X(t)&&("navigation"===t.entryType||"resource"===t.entryType);function cu(t){var r=t.entry,i=t.method,n=t.status,o=t.networkRequest,a=t.isInitial,s=t.start,u=t.end,l=t.url,h=t.initiatorType;s=r?r.startTime:s,u=r?r.responseEnd:u;var c=Math.floor(Date.now()-performance.now()),d=Math.floor(c+(s||0)),v=[e({},r?r.toJSON():{name:l},{startTime:Q(s)?void 0:Math.round(s),endTime:Q(u)?void 0:Math.round(u),timeOrigin:c,timestamp:d,method:i,initiatorType:h||(r?r.initiatorType:void 0),status:n,requestHeaders:o.requestHeaders,requestBody:o.requestBody,responseHeaders:o.responseHeaders,responseBody:o.responseBody,isInitial:a})];if(hu(r))for(var f of r.serverTiming||[])v.push({timeOrigin:c,timestamp:d,startTime:Math.round(r.startTime),name:f.name,duration:f.duration,entryType:"serverTiming"});return v}var du=["video/","audio/"];function vu(t){return G(t)&&Z(t.getReader)&&Z(t.tee)}var fu="[SessionReplay] Timeout while trying to read body",pu="[SessionReplay] Failed to read body";function gu(t){return pu+": "+t}function mu(t){return"[SessionReplay] Body too large to record (> "+t+" bytes)"}function yu(t,e){if(!e.streamNetworkBody)return function(t){return new Promise(e=>{var r=setTimeout(()=>e(fu),500);try{t.clone().text().then(t=>e(t),t=>e(gu(t))).finally(()=>clearTimeout(r))}catch(t){clearTimeout(r),e(pu)}})}(t);var r=De(e);return function(t,e){try{var r,i=null==(r=t.headers)||null==r.get?void 0:r.get("content-length");if(!i)return!1;var n=parseInt(i,10);return Number.isFinite(n)&&n>e}catch(t){return!1}}(t,r)?Promise.resolve(mu(r)):function(t,e){return new Promise(r=>{var i,n=!1;function o(){try{var t;null==(t=i)||t.cancel().catch(()=>{})}catch(t){}}function a(t){n||(n=!0,clearTimeout(u),o(),r(t))}var s,u=setTimeout(()=>a(fu),500);try{s=t.clone()}catch(t){return void a(pu)}var l=s.body;if(vu(l)&&"undefined"!=typeof TextDecoder){try{i=l.getReader()}catch(t){return void a(pu)}var h=[],c=0;!function t(){i.read().then(r=>{var i=r.done,s=r.value;if(n)o();else if(i)a((new TextDecoder).decode(function(t,e){var r=new Uint8Array(e),i=0;for(var n of t)r.set(n,i),i+=n.byteLength;return r}(h,c)));else{if(s){if(c+s.byteLength>e)return void a(mu(e));c+=s.byteLength,h.push(s)}t()}},t=>a(gu(t)))}()}else try{s.text().then(t=>a(t),t=>a(gu(t)))}catch(t){a(pu)}})}(t,r)}function bu(){return bu=i(function*(t){var e=t.r,r=t.options,i=Ys(t.url,r);return i.isHostDenied?Promise.resolve(i.hostname+" is in deny list"):yu(e,r)}),bu.apply(this,arguments)}function wu(){return wu=i(function*(t){var e=t.r,r=t.options,i=function(t){var e,r=t.r,i=t.options,n=t.url;if("chunked"===r.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null==(e=r.headers.get("Content-Type"))?void 0:e.toLowerCase(),a=du.some(t=>null==o?void 0:o.startsWith(t));if(o&&a)return"Content-Type "+o+" is not supported";var s=Ys(n,i);return s.isHostDenied?s.hostname+" is in deny list":null}({r:e,options:r,url:t.url});return X(i)?yu(e,r):Promise.resolve(i)}),wu.apply(this,arguments)}var ku=null;function _u(t,r,n){if(!("performance"in r))return()=>{};if(ku)return tu.warn("Network observer already initialised, doing nothing"),()=>{};var o=n?Object.assign({},Pe,n):Pe,a=r=>{var i=[],n=!1;r.requests.forEach(t=>{var e="serverTiming"===t.entryType;if(!e||!n){var r=o.maskRequestFn(t);e||(n=!r||(t=>!!t&&Ue.has(t))(r)),r&&i.push(r)}}),i.length>0&&t(e({},r,{requests:i}))},s=function(t,e,r){r.recordInitialRequests&&t({requests:e.performance.getEntries().filter(t=>eu(t)||ru(t)&&r.initiatorTypes.includes(t.initiatorType)).flatMap(t=>cu({entry:t,method:void 0,status:void 0,networkRequest:{},isInitial:!0})),isInitial:!0});var i=new e.PerformanceObserver(e=>{t({requests:e.getEntries().filter(t=>eu(t)||ru(t)&&r.initiatorTypes.includes(t.initiatorType)&&(t=>!r.recordBody&&!r.recordHeaders||"xmlhttprequest"!==t.initiatorType&&"fetch"!==t.initiatorType)(t)).flatMap(t=>cu({entry:t,method:void 0,status:void 0,networkRequest:{}}))})}),n=PerformanceObserver.supportedEntryTypes.filter(t=>r.performanceEntryTypeToObserve.includes(t));return i.observe({entryTypes:n}),()=>{i.disconnect()}}(a,r,o),u=()=>{},l=()=>{};return(o.recordHeaders||o.recordBody)&&(u=function(t,e,r){if(!r.initiatorTypes.includes("xmlhttprequest"))return()=>{};var i=iu("request",r.recordHeaders),n=iu("response",r.recordHeaders),o=Xs(e.XMLHttpRequest.prototype,"open",o=>function(a,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=(t,e)=>(g[t]=e,m(t,e)),i&&(p.requestHeaders=g);var y=c.send.bind(c);c.send=t=>(au({type:"request",headers:g,url:s,recordBody:r.recordBody})&&(p.requestBody=lu({body:t,options:r,url:s})),d=e.performance.now(),y(t));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=e.performance.now();var i={};c.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(t=>{var e=t.split(": "),r=e.shift(),n=e.join(": ");r&&(i[r]=n)}),n&&(p.responseHeaders=i),au({type:"response",headers:i,url:s,recordBody:r.recordBody})&&(p.responseBody=lu({body:c.response,options:r,url:s})),su(e,"xmlhttprequest",f.url,d,v).then(e=>{t({requests:cu({entry:e,method:a,status:null==c?void 0:c.status,networkRequest:p,start:d,end:v,url:s.toString(),initiatorType:"xmlhttprequest"})})}).catch(()=>{})}};c.addEventListener("readystatechange",w),c.addEventListener("error",b),c.addEventListener("abort",b),c.addEventListener("timeout",b)}catch(t){tu.error("Failed to instrument XHR for network capture",t)}o.call(c,a,s.toString(),u,l,h)});return()=>{o()}}(a,r,o),l=function(t,e,r){if(!r.initiatorTypes.includes("fetch"))return()=>{};var n=iu("request",r.recordHeaders),o=iu("response",r.recordHeaders),a=Xs(e,"fetch",a=>function(){var s=i(function*(i,s){var u,l;try{u=new Request(i,s)}catch(t){return tu.error("Failed to instrument fetch for network capture",t),a(i,s)}var h,c,d={};try{try{var v={};u.headers.forEach((t,e)=>{v[e]=t}),n&&(d.requestHeaders=v),!vu(null==s?void 0:s.body)&&au({type:"request",headers:v,url:i,recordBody:r.recordBody})&&(d.requestBody=yield function(t){return bu.apply(this,arguments)}({r:u,options:r,url:i}))}catch(t){tu.error("Failed to record fetch request for network capture",t)}h=e.performance.now(),l=nu(i)?yield a(u):yield a(i,s),c=e.performance.now();try{var f={};l.headers.forEach((t,e)=>{f[e]=t}),o&&(d.responseHeaders=f),au({type:"response",headers:f,url:i,recordBody:r.recordBody})&&(d.responseBody=yield function(t){return wu.apply(this,arguments)}({r:l,options:r,url:i}))}catch(t){tu.error("Failed to record fetch response for network capture",t)}return l}finally{su(e,"fetch",u.url,h,c).then(e=>{var r;t({requests:cu({entry:e,method:u.method,status:null==(r=l)?void 0:r.status,networkRequest:d,start:h,end:c,url:u.url,initiatorType:"fetch"})})}).catch(()=>{})}});return function(t,e){return s.apply(this,arguments)}}());return()=>{a()}}(a,r,o)),ku=()=>{s(),u(),l(),ku=null}}var Su,xu,Cu,Mu,Tu,Iu,Ru,Au,Eu,Lu,Ou,Du,Pu,Fu,Nu,qu=t=>({name:"rrweb/network@1",observer:_u,options:t});h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Qs,getRecordNetworkPlugin:qu},h.__PosthogExtensions__.rrweb={record:Ds,version:"v2",wasMaxDepthReached:()=>sa,resetMaxDepthState(){sa=!1,aa=!1},getLastSnapshotCost:()=>Qn,getMutationCost:()=>e({},to),resetSnapshotCostState(){Wn=0,Vn=0,Zn=0,Hn=0,Gn={durationMs:0,stylesheetMs:0,nodeCount:0,cssRuleCount:0,nonDeferrableCssRuleCount:0,deferredStylesheetCount:0},Qn=null,Jn=null,Kn=[],Xn=0,Yn=0,to={slowestBatchMs:0},eo={deferredCount:0,failedCount:0,abandonedCount:0,totalMs:0,slowestSliceMs:0}}},h.rrweb={record:Ds,version:"v2"},h.rrwebConsoleRecord={getRecordConsolePlugin:Qs},h.getRecordNetworkPlugin=qu,h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.initSessionRecording=(t,e)=>new wn(t,e);var ju,Bu,Hu,$u,Uu={},zu=[],Wu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Vu=Array.isArray;function Zu(t,e){for(var r in e)t[r]=e[r];return t}function Gu(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Qu(t,e,r){var i,n,o,a={};for(o in e)"key"==o?i=e[o]:"ref"==o?n=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Su.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===a[o]&&(a[o]=t.defaultProps[o]);return Ju(t,a,i,n,null)}function Ju(t,e,r,i,n){var o={type:t,props:e,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++Cu:n,__i:-1,__u:0};return null==n&&null!=xu.vnode&&xu.vnode(o),o}function Ku(t){return t.children}function Xu(t,e){this.props=t,this.context=e}function Yu(t,e){if(null==e)return t.__?Yu(t.__,t.__i+1):null;for(var r;t.__k.length>e;e++)if(null!=(r=t.__k[e])&&null!=r.__e)return r.__e;return"function"==typeof t.type?Yu(t):null}function tl(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,i=[],n=[],o=Zu({},e);o.__v=e.__v+1,xu.vnode&&xu.vnode(o),hl(t.__P,o,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,i,null==r?Yu(e):r,!!(32&e.__u),n),o.__v=e.__v,o.__.__k[o.__i]=o,dl(i,o,n),e.__e=e.__=null,o.__e!=r&&el(o)}}function el(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),el(t)}function rl(t){(!t.__d&&(t.__d=!0)&&Mu.push(t)&&!il.__r++||Tu!=xu.debounceRendering)&&((Tu=xu.debounceRendering)||Iu)(il)}function il(){try{for(var t,e=1;Mu.length;)Mu.length>e&&Mu.sort(Ru),t=Mu.shift(),e=Mu.length,tl(t)}finally{Mu.length=il.__r=0}}function nl(t,e,r,i,n,o,a,s,u,l,h){var c,d,v,f,p,g,m,y=i&&i.__k||zu,b=e.length;for(u=function(t,e,r,i,n){var o,a,s,u,l,h=r.length,c=h,d=0;for(t.__k=new Array(n),o=0;n>o;o++)null!=(a=e[o])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=t.__k[o]=Ju(null,a,null,null,null):Vu(a)?a=t.__k[o]=Ju(Ku,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=t.__k[o]=Ju(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[o]=a,u=o+d,a.__=t,a.__b=t.__b+1,s=null,-1!=(l=a.__i=al(a,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 a.type&&(a.__u|=4)):l!=u&&(l==u-1?d--:l==u+1?d++:(l>u?d--:d++,a.__u|=4))):t.__k[o]=null;if(c)for(o=0;h>o;o++)null!=(s=r[o])&&!(2&s.__u)&&(s.__e==i&&(i=Yu(s)),pl(s,s));return i}(r,e,y,u,b),c=0;b>c;c++)null!=(v=r.__k[c])&&(d=-1!=v.__i&&y[v.__i]||Uu,v.__i=c,g=hl(t,v,d,n,o,a,s,u,l,h),f=v.__e,v.ref&&d.ref!=v.ref&&(d.ref&&fl(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=ol(v,u,t,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 ol(t,e,r,i){var n,o;if("function"==typeof t.type){for(n=t.__k,o=0;n&&n.length>o;o++)n[o]&&(n[o].__=t,e=ol(n[o],e,r,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=Yu(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function al(t,e,r,i){var n,o,a,s=t.key,u=t.type,l=e[r],h=null!=l&&!(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,o=r+1;n>=0||e.length>o;)if(null!=(l=e[a=0>n?o++:n--])&&!(2&l.__u)&&s==l.key&&u==l.type)return a;return-1}function sl(t,e,r){"-"==e[0]?t.setProperty(e,null==r?"":r):t[e]=null==r?"":"number"!=typeof r||Wu.test(e)?r:r+"px"}function ul(t,e,r,i,n){var o,a;t:if("style"==e)if("string"==typeof r)t.style.cssText=r;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)r&&e in r||sl(t.style,e,"");if(r)for(e in r)i&&r[e]==i[e]||sl(t.style,e,r[e])}else if("o"==e[0]&&"n"==e[1])o=e!=(e=e.replace(Ou,"$1")),a=e.toLowerCase(),e=a in t||"onFocusOut"==e||"onFocusIn"==e?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?i?r[Lu]=i[Lu]:(r[Lu]=Du,t.addEventListener(e,o?Fu:Pu,o)):t.removeEventListener(e,o?Fu:Pu,o);else{if("http://www.w3.org/2000/svg"==n)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==r?"":r;break t}catch(t){}"function"==typeof r||(null==r||!1===r&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==r?"":r))}}function ll(t){return function(e){if(this.l){var r=this.l[e.type+t];if(null==e[Eu])e[Eu]=Du++;else if(r[Lu]>e[Eu])return;return r(xu.event?xu.event(e):e)}}}function hl(t,e,r,i,n,o,a,s,u,l){var h,c,d,v,f,p,g,m,y,b,$,w,k,_,S,x,C=e.type;if(void 0!==e.constructor)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=e.__e=r.__e]),(h=xu.__b)&&h(e);t:if("function"==typeof C){c=a.length;try{if(y=e.props,b=C.prototype&&C.prototype.render,$=(h=C.contextType)&&i[h.__c],w=h?$?$.props.value:h.__:i,r.__c?m=(d=e.__c=r.__c).__=d.__E:(b?e.__c=d=new C(y,w):(e.__c=d=new Xu(y,w),d.constructor=C,d.render=gl),$&&$.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=Zu({},d.__s)),Zu(d.__s,C.getDerivedStateFromProps(y,d.__s))),f=d.props,p=d.state,d.__v=e,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),e.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)){e.__v!=r.__v&&(d.props=y,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(t){t&&(t.__=e)}),zu.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break t}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=t,d.__e=!1,k=xu.__r,_=0,b)d.state=d.__s,d.__d=!1,k&&k(e),h=d.render(d.props,d.state,d.context),zu.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,k&&k(e),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=Zu(Zu({},i),d.getChildContext())),b&&!v&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(f,p)),S=null!=h&&h.type===Ku&&null==h.key?vl(h.props.children):h,s=nl(t,Vu(S)?S:[S],e,r,i,n,o,a,s,u,l),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(t){if(a.length=c,e.__v=null,u||null!=o)if(t.then){for(e.__u|=u?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;null!=o&&(o[o.indexOf(s)]=null),e.__e=s}else{if(null!=o)for(x=o.length;x--;)Gu(o[x]);cl(e)}else e.__e=r.__e,!e.__k&&r.__k&&(e.__k=r.__k),t.then||cl(e);xu.__e(t,e,r)}}else null==o&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=function(t,e,r,i,n,o,a,s,u){var l,h,c,d,v,f,p,g=r.props||Uu,m=e.props,y=e.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!=o)for(l=0;o.length>l;l++)if((v=o[l])&&"setAttribute"in v==!!y&&(y?v.localName==y:3==v.nodeType)){t=v,o[l]=null;break}if(null==t){if(null==y)return document.createTextNode(m);t=document.createElementNS(n,y,m.is&&m),s&&(xu.__m&&xu.__m(e,o),s=!1),o=null}if(null==y)g===m||s&&t.data==m||(t.data=m);else{if(o="textarea"==y&&null!=m.defaultValue?null:o&&Su.call(t.childNodes),!s&&null!=o)for(g={},l=0;t.attributes.length>l;l++)g[(v=t.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||ul(t,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||ul(t,l,v,g[l],n);if(h)s||c&&(h.__html==c.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(c&&(t.innerHTML=""),nl("template"==e.type?t.content:t,Vu(d)?d:[d],e,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,o,a,o?o[0]:r.__k&&Yu(r,0),s,u),null!=o)for(l=o.length;l--;)Gu(o[l]);s&&"textarea"!=y||(l="value","progress"==y&&null==f?t.removeAttribute("value"):null!=f&&(f!==t[l]||"progress"==y&&!f||"option"==y&&f!=g[l])&&ul(t,l,f,g[l],n),l="checked",null!=p&&p!=t[l]&&ul(t,l,p,g[l],n))}return t}(r.__e,e,r,i,n,o,a,u,l);return(h=xu.diffed)&&h(e),128&e.__u?void 0:s}function cl(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(cl))}function dl(t,e,r){for(var i=0;r.length>i;i++)fl(r[i],r[++i],r[++i]);xu.__c&&xu.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){xu.__e(t,e.__v)}})}function vl(t){return"object"!=typeof t||null==t||t.__b>0?t:Vu(t)?t.map(vl):void 0!==t.constructor?null:Zu({},t)}function fl(t,e,r){try{if("function"==typeof t){var i="function"==typeof t.__u;i&&t.__u(),i&&null==e||(t.__u=t(e))}else t.current=e}catch(t){xu.__e(t,r)}}function pl(t,e,r){var i,n;if(xu.unmount&&xu.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||fl(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){xu.__e(t,e)}i.base=i.__P=i.__n=null}if(i=t.__k)for(n=0;i.length>n;n++)i[n]&&pl(i[n],e,r||"function"!=typeof t.type);r||Gu(t.__e),t.__c=t.__=t.__e=void 0}function gl(t,e,r){return this.constructor(t,r)}function ml(t,e,r){var i,n,o,a;e==document&&(e=document.documentElement),xu.__&&xu.__(t,e),n=(i="function"==typeof r)?null:r&&r.__k||e.__k,o=[],a=[],hl(e,t=(!i&&r||e).__k=Qu(Ku,null,[t]),n||Uu,Uu,e.namespaceURI,!i&&r?[r]:n?null:e.firstChild?Su.call(e.childNodes):null,o,!i&&r?r:n?n.__e:e.firstChild,i,a),dl(o,t,a),t.props.children=null}Su=zu.slice,xu={__e(t,e,r,i){for(var n,o,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((o=n.constructor)&&null!=o.getDerivedStateFromError&&(n.setState(o.getDerivedStateFromError(t)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,i||{}),a=n.__d),a)return n.__E=n}catch(e){t=e}throw t}},Cu=0,Xu.prototype.setState=function(t,e){var r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Zu({},this.state);"function"==typeof t&&(t=t(Zu({},r),this.props)),t&&Zu(r,t),null!=t&&this.__v&&(e&&this._sb.push(e),rl(this))},Xu.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),rl(this))},Xu.prototype.render=Ku,Mu=[],Iu="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ru=function(t,e){return t.__v.__b-e.__v.__b},il.__r=0,Au=Math.random().toString(8),Eu="__d"+Au,Lu="__a"+Au,Ou=/(PointerCapture)$|Capture$/i,Du=0,Pu=ll(!1),Fu=ll(!0),Nu=0;var yl=0,bl=[],wl=xu,kl=wl.__b,_l=wl.__r,Sl=wl.diffed,xl=wl.__c,Cl=wl.unmount,Ml=wl.__;function Tl(t,e){wl.__h&&wl.__h(Bu,t,yl||e),yl=0;var r=Bu.__H||(Bu.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Il(t){return yl=1,function(t,e){var r=Tl(ju++,2);if(r.t=t,!r.__c&&(r.__=[jl(void 0,e),function(t){var e=r.__N?r.__N[0]:r.__[0],i=r.t(e,t);e!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=Bu,!Bu.__f)){var i=function(t,e,i){if(!r.__c.__H)return!0;var o=!1,a=r.__c.props!==t;if(r.__c.__H.__.some(function(t){if(t.__N){o=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(a=!0)}}),n){var s=n.call(this,t,e,i);return o?s||a:s}return!o||a};Bu.__f=!0;var n=Bu.shouldComponentUpdate,o=Bu.componentWillUpdate;Bu.componentWillUpdate=function(t,e,r){if(this.__e){var a=n;n=void 0,i(t,e,r),n=a}o&&o.call(this,t,e,r)},Bu.shouldComponentUpdate=i}return r.__N||r.__}(jl,t)}function Rl(t,e){var r=Tl(ju++,3);!wl.__s&&ql(r.__H,e)&&(r.__=t,r.u=e,Bu.__H.__h.push(r))}function Al(t){return yl=5,El(function(){return{current:t}},[])}function El(t,e){var r=Tl(ju++,7);return ql(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Ll(t){var e,r=Bu.context[t.__c],i=Tl(ju++,9);return i.c=t,r?(null!==(e=i.__)&&void 0!==e||(i.__=!0,r.sub(Bu)),r.props.value):t.__}function Ol(){for(var t;t=bl.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Fl),e.__h.some(Nl),e.__h=[]}catch(r){e.__h=[],wl.__e(r,t.__v)}}}wl.__b=function(t){Bu=null,kl&&kl(t)},wl.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ml&&Ml(t,e)},wl.__r=function(t){_l&&_l(t),ju=0;var e=(Bu=t.__c).__H;e&&(Hu===Bu?(e.__h=[],Bu.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&Ol(),ju=0)),Hu=Bu},wl.diffed=function(t){Sl&&Sl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==bl.push(e)&&$u===wl.requestAnimationFrame||(($u=wl.requestAnimationFrame)||Pl)(Ol)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Hu=Bu=null},wl.__c=function(t,e){e.some(function(t){try{t.__h.some(Fl),t.__h=t.__h.filter(function(t){return!t.__||Nl(t)})}catch(r){e.some(function(t){t.__h&&(t.__h=[])}),e=[],wl.__e(r,t.__v)}}),xl&&xl(t,e)},wl.unmount=function(t){Cl&&Cl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(t){try{Fl(t)}catch(t){e=t}}),r.__H=void 0,e&&wl.__e(e,r.__v))};var Dl="function"==typeof requestAnimationFrame;function Pl(t){var e,r=function(){clearTimeout(i),Dl&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(r,35);Dl&&(e=requestAnimationFrame(r))}function Fl(t){var e=Bu,r=t.__c;"function"==typeof r&&(t.__c=void 0,r()),Bu=e}function Nl(t){var e=Bu;t.__c=t.__(),Bu=e}function ql(t,e){return!t||t.length!==e.length||e.some(function(e,r){return e!==t[r]})}function jl(t,e){return"function"==typeof e?e(t):e}var Bl="tab",Hl="left",$l="center",Ul="right",zl="next_to_trigger",Wl="popover",Vl="widget",Zl="external_survey",Gl="open",Ql="multiple_choice",Jl="single_choice",Kl="rating",Xl="end",Yl="always",th="$survey_id",eh="$survey_name",rh="$survey_iteration",ih="$survey_iteration_start_date",nh="$survey_partially_completed",oh="$survey_submission_id",ah="$survey_completed",sh="$survey_language",uh=te("[Surveys]"),lh=(t,e)=>""+t+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e),hh=t=>lh("seenSurvey_",t),ch=t=>{try{var e=hh(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){uh.error("Failed to persist survey seen state",t)}},dh=[Wl,Vl,"api"];Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return tt(t)&&isFinite(t)&&Math.floor(t)===t});var vh=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,i,n){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(n)||0>e||0>r||0>i||0>n||e>0xffffffffffff||r>4095||i>1073741823||n>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|r>>>8,o[7]=r,o[8]=128|i>>>24,o[9]=i>>>16,o[10]=i>>>8,o[11]=i,o[12]=n>>>24,o[13]=n>>>16,o[14]=n>>>8,o[15]=n,new t(o)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var r=this.bytes[e]-t.bytes[e];if(0!==r)return Math.sign(r)}return 0}},fh=class{generate(){var t=this.generateOrAbort();if(!Q(t))return t;this.ri=0;var e=this.generateOrAbort();if(Q(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),tt(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.ri)this.ri=e,this.ii();else{if(this.ri>=e+1e4)return;this.ni++,this.ni>4398046511103&&(this.ri++,this.ii())}return vh.fromFieldsV7(this.ri,Math.trunc(this.ni/Math.pow(2,30)),this.ni&Math.pow(2,30)-1,this.oi.nextUint32())}ii(){this.ni=1024*this.oi.nextUint32()+(1023&this.oi.nextUint32())}constructor(){this.ri=0,this.ni=0,this.oi=new mh}},ph=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};r&&!Q(r.crypto)&&crypto.getRandomValues&&(ph=t=>crypto.getRandomValues(t));var gh,mh=class{nextUint32(){return this.Pe.length>this.ai||(ph(this.Pe),this.ai=0),this.Pe[this.ai++]}constructor(){this.Pe=new Uint32Array(8),this.ai=1/0}},yh=()=>bh().toString(),bh=()=>(gh||(gh=new fh)).generate(),wh=null,kh={si(){if(!X(wh))return wh;var t=!0;if(Q(r))t=!1;else try{var e="__mplssupport__";kh.ui(e,"xyz"),'"xyz"'!==kh.li(e)&&(t=!1),kh.hi(e)}catch(e){t=!1}return t||Yt.error("localStorage unsupported; falling back to cookie store"),wh=t,t},ci(t){Yt.error("localStorage error: "+t)},li(t){try{return null==r?void 0:r.localStorage.getItem(t)}catch(t){kh.ci(t)}return null},di(t){try{return JSON.parse(kh.li(t))||{}}catch(t){}return null},ui(t,e){try{return null==r||r.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){kh.ci(t)}return!1},hi(t){try{null==r||r.localStorage.removeItem(t)}catch(t){kh.ci(t)}}},_h=te("[Stylesheet Loader]"),Sh=r,xh=a,Ch="#020617",Mh={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:Ul,widgetType:Bl,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:Ch,scrollbarThumbColor:"var(--ph-survey-border-color)",scrollbarTrackColor:"var(--ph-survey-background-color)"},Th=[$l,Hl,Ul];function Ih(t){if(t.startsWith("#")){var e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?"rgb("+parseInt(e.slice(0,2),16)+","+parseInt(e.slice(2,4),16)+","+parseInt(e.slice(4,6),16)+")":"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function Rh(t){var e;void 0===t&&(t=Mh.backgroundColor),"#"===t[0]&&(e=Ih(t)),t.startsWith("rgb")&&(e=t);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"}[t.toLowerCase()];if(r&&(e=Ih(r)),!e)return Ch;var i=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(i){var n=parseInt(i[1]),o=parseInt(i[2]),a=parseInt(i[3]);return Math.sqrt(n*n*.299+o*o*.587+a*a*.114)>127.5?Ch:"white"}return Ch}var Ah=(t,r,i)=>{var n=Jh(t),o=xh.querySelector("."+n);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};var a=xh.createElement("div");((t,r,i)=>{var n=e({},Mh,i),o=t.style,a=!Th.includes(n.position)||r===Vl&&(null==i?void 0:i.widgetType)===Bl;o.setProperty("--ph-survey-font-family",function(t){if("inherit"===t)return"inherit";var e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?t+", "+e:"-apple-system, "+e}(n.fontFamily)),o.setProperty("--ph-survey-box-padding",n.boxPadding),o.setProperty("--ph-survey-max-width",n.maxWidth),o.setProperty("--ph-survey-z-index",n.zIndex),o.setProperty("--ph-survey-border-color",n.borderColor),a?(o.setProperty("--ph-survey-border-radius",n.borderRadius),o.setProperty("--ph-survey-border-bottom","1.5px solid var(--ph-survey-border-color)")):(o.setProperty("--ph-survey-border-bottom","none"),o.setProperty("--ph-survey-border-radius",n.borderRadius+" "+n.borderRadius+" 0 0")),o.setProperty("--ph-survey-background-color",n.backgroundColor),o.setProperty("--ph-survey-box-shadow",n.boxShadow),o.setProperty("--ph-survey-disabled-button-opacity",n.disabledButtonOpacity),o.setProperty("--ph-survey-submit-button-color",n.submitButtonColor),o.setProperty("--ph-survey-submit-button-text-color",(null==i?void 0:i.submitButtonTextColor)||Rh(n.submitButtonColor)),o.setProperty("--ph-survey-rating-bg-color",n.ratingButtonColor),o.setProperty("--ph-survey-rating-active-bg-color",n.ratingButtonActiveColor),o.setProperty("--ph-survey-rating-active-text-color",Rh(n.ratingButtonActiveColor)),o.setProperty("--ph-survey-text-primary-color",(null==i?void 0:i.textColor)||Rh(n.backgroundColor)),o.setProperty("--ph-survey-text-subtle-color",n.textSubtleColor),o.setProperty("--ph-widget-color",n.widgetColor),o.setProperty("--ph-widget-text-color",Rh(n.widgetColor)),o.setProperty("--ph-widget-z-index",n.zIndex);var s=(null==i?void 0:i.inputBackground)||(null==i?void 0:i.inputBackgroundColor),u=s||n.inputBackground;s||"white"!==n.backgroundColor||(u="#f8f8f8"),o.setProperty("--ph-survey-input-background",u);var l=(null==i?void 0:i.inputTextColor)||Rh(u);o.setProperty("--ph-survey-input-text-color",l),o.setProperty("--ph-survey-rating-text-color",l),o.setProperty("--ph-survey-scrollbar-thumb-color",n.scrollbarThumbColor),o.setProperty("--ph-survey-scrollbar-track-color",n.scrollbarTrackColor),o.setProperty("--ph-survey-outline-color",n.outlineColor)})(a,t.type,t.appearance),a.className=n;var s=a.attachShadow({mode:"open"}),u=function(t){var e=((t,e,r)=>{var i=t.createElement("style");i.innerText=e;var n=(t=>{var e;return Z(t)?t:null==t||null==(e=t.config)?void 0:e.prepare_external_dependency_stylesheet})(r);return n&&(i=n(i)),i||(_h.error("prepare_external_dependency_stylesheet returned null"),null)})(xh,':host{--ph-survey-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-survey-box-padding:20px 24px;--ph-survey-max-width:300px;--ph-survey-z-index:calc(2147480000 + 3645);--ph-survey-border-color:#dcdcdc;--ph-survey-border-bottom:1.5px solid var(--ph-survey-border-color);--ph-survey-border-radius:10px;--ph-survey-background-color:#eeeded;--ph-survey-box-shadow:0 4px 12px #00000026;--ph-survey-submit-button-color:black;--ph-survey-submit-button-text-color:white;--ph-survey-rating-bg-color:white;--ph-survey-rating-text-color:#020617;--ph-survey-rating-active-bg-color:black;--ph-survey-rating-active-text-color:white;--ph-survey-text-primary-color:#020617;--ph-survey-text-subtle-color:#939393;--ph-widget-color:#e0a045;--ph-widget-text-color:white;--ph-survey-scrollbar-thumb-color:var(--ph-survey-border-color);--ph-survey-scrollbar-track-color:var(--ph-survey-background-color);--ph-survey-outline-color:#3b82f6cc;--ph-survey-input-background:white;--ph-survey-input-text-color:#020617;--ph-survey-disabled-button-opacity:.6}.ph-survey{min-width:300px;width:var(--ph-survey-max-width);max-width:85%;z-index:var(--ph-survey-z-index);height:fit-content;margin:0;position:fixed;bottom:0}.ph-survey h3,.ph-survey p{margin:0}.ph-survey *{box-sizing:border-box;font-family:var(--ph-survey-font-family);color:var(--ph-survey-text-primary-color)}.ph-survey textarea,.ph-survey input[type=text],.ph-survey .multiple-choice-options label{color:var(--ph-survey-input-text-color);background:var(--ph-survey-input-background);border:1.5px solid var(--ph-survey-border-color);border-radius:4px;padding:10px;transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey textarea,.ph-survey input[type=text]{transition:border-color .2s ease-out,box-shadow .2s ease-out,transform .15s ease-out}.ph-survey input{margin:0}.ph-survey textarea:focus,.ph-survey textarea:focus-visible,.ph-survey input[type=text]:focus,.ph-survey input[type=text]:focus-visible,.ph-survey .form-submit:focus,.ph-survey .form-submit:focus-visible,.ph-survey input[type=checkbox]:focus,.ph-survey input[type=radio]:focus,.ph-survey input[type=checkbox]:focus-visible,.ph-survey input[type=radio]:focus-visible{outline:1.5px solid var(--ph-survey-outline-color);border-color:var(--ph-survey-rating-active-bg-color);outline-offset:2px}.ph-survey textarea:focus:not(:focus-visible),.ph-survey input[type=text]:focus:not(:focus-visible),.ph-survey button:focus:not(:focus-visible),.ph-survey input[type=checkbox]:focus:not(:focus-visible),.ph-survey input[type=radio]:focus:not(:focus-visible){outline:none}.ph-survey textarea:hover:not(:focus),.ph-survey input[type=text]:hover:not(:focus){border-color:var(--ph-survey-rating-active-bg-color)}@media (max-width:768px){.ph-survey textarea,.ph-survey input[type=text]{font-size:1rem}}.ph-survey .multiple-choice-options label,.ph-survey .rating-options-number,.ph-survey .form-cancel,.ph-survey input[type=checkbox],.ph-survey input[type=radio]{border:1.5px solid var(--ph-survey-border-color)}.ph-survey label,.ph-survey input[type=checkbox],.ph-survey input[type=radio],.ph-survey .ratings-emoji,.ph-survey .ratings-number,.ph-survey .footer-branding,.ph-survey .form-cancel,.ph-survey .form-submit{transition:all .2s ease-out}@media (prefers-reduced-motion:no-preference){.ph-survey button:active,.ph-survey input[type=checkbox]:active,.ph-survey input[type=radio]:active,.ph-survey label:active{transition-duration:.1s}}.ph-survey-widget-tab{background:var(--ph-widget-color);color:var(--ph-widget-text-color);text-align:center;cursor:pointer;z-index:var(--ph-survey-z-index);border:none;border-radius:3px 3px 0 0;padding:10px 12px;transition:padding .2s ease-out;position:fixed}.ph-survey-widget-tab:hover:not(.widget-tab-top){padding-bottom:16px}.ph-survey-widget-tab.widget-tab-top{border-radius:0 0 3px 3px}.ph-survey-widget-tab.widget-tab-top:hover{padding-top:16px}@keyframes ph-survey-fade-in{0%{opacity:0}to{opacity:1}}.survey-box{flex-direction:column;gap:16px;display:flex}.bottom-section{flex-direction:column;gap:8px;display:flex}.thank-you-message-header~.bottom-section,.intro-screen-header~.bottom-section{padding-top:16px}.question-container,.thank-you-message,.intro-screen{flex-direction:column;gap:8px;display:flex}.survey-question{font-size:14px;font-weight:500}.survey-question-description{opacity:.8;padding-top:4px;font-size:13px}.survey-question-description,.thank-you-message-body,.intro-screen-body{word-wrap:break-word;overflow-wrap:break-word}:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) img,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) video,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) iframe,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) embed,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) object,:is(.survey-question-description,.thank-you-message-body,.intro-screen-body) svg{max-width:100%;height:auto}.question-textarea-wrapper{flex-direction:column;display:flex}.survey-form{animation:.3s ease-out forwards ph-survey-fade-in}.survey-form,.thank-you-message,.intro-screen{text-align:left;width:100%;z-index:var(--ph-survey-z-index);border:1.5px solid var(--ph-survey-border-color);border-bottom:var(--ph-survey-border-bottom);background:var(--ph-survey-background-color);border-radius:var(--ph-survey-border-radius);box-shadow:var(--ph-survey-box-shadow);padding:var(--ph-survey-box-padding);margin:0;position:relative}.survey-form textarea,.survey-form input[type=text]{min-width:100%}.survey-form textarea:focus,.survey-form textarea:focus-visible{box-shadow:0 4px 12px #00000014}.survey-form textarea:focus:not(:focus-visible){box-shadow:none}.survey-box .question-header--empty~.multiple-choice-options,.survey-box .question-header--empty~textarea{margin-top:0}.multiple-choice-options{border:none;flex-direction:column;gap:8px;margin:0;padding:1px 0;font-size:14px;display:flex}.multiple-choice-options label,.multiple-choice-options .response-choice{color:inherit;align-items:center;gap:8px;display:flex}.multiple-choice-options label{cursor:pointer;font-size:13px}.multiple-choice-options label:hover:not(:has(input:checked)){border-color:var(--ph-survey-text-subtle-color);box-shadow:0 2px 8px #00000014}.multiple-choice-options label:has(input:checked){border-color:var(--ph-survey-rating-active-bg-color);box-shadow:0 1px 4px #0000000d}.multiple-choice-options label.choice-option-open{flex-wrap:wrap}.multiple-choice-options label span{color:inherit}.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ph-survey-input-background);cursor:pointer;z-index:1;border-radius:3px;flex-shrink:0;width:1rem;height:1rem;transition:all .2s cubic-bezier(.4,0,.2,1),transform .15s ease-out;position:relative}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):focus{transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):hover{border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1.05)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):active{transform:scale(.95)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked{background:var(--ph-survey-rating-active-bg-color);border-color:var(--ph-survey-rating-active-bg-color);transform:scale(1)}:is(.multiple-choice-options input[type=checkbox],.multiple-choice-options input[type=radio]):checked:hover{transform:scale(1.05)}.multiple-choice-options input[type=checkbox]:checked:after{border:solid var(--ph-survey-rating-active-text-color);border-width:0 2px 2px 0;width:4px;height:8px;animation:.2s ease-out .1s forwards ph-survey-checkmark-reveal;left:4px;transform:rotate(45deg)scale(0)}.multiple-choice-options input[type=radio]:checked:after{background:var(--ph-survey-rating-active-text-color);border-radius:50%;width:6px;height:6px;animation:.15s ease-out 50ms forwards ph-survey-radio-reveal;top:5px;left:5px;transform:scale(0)}.multiple-choice-options input[type=checkbox]:checked:after,.multiple-choice-options input[type=radio]:checked:after{content:"";box-sizing:content-box;position:absolute}.multiple-choice-options input[type=radio]{border-radius:50%}.multiple-choice-options input[type=radio]:checked{border:none}:is(.multiple-choice-options input[type=checkbox]:checked,.multiple-choice-options input[type=radio]:checked)~*{font-weight:700}.multiple-choice-options .choice-option-open input[type=text]::placeholder{color:var(--ph-survey-text-subtle-color);font-weight:400}.rating-options-emoji{justify-content:space-between;display:flex}.rating-options-emoji-2{justify-content:space-around}.ratings-emoji{opacity:.5;background-color:#0000;border:none;padding:0;font-size:16px}.ratings-emoji:hover{cursor:pointer;opacity:1;transform:scale(1.15)}.ratings-emoji.rating-active{opacity:1}.ratings-emoji svg{fill:var(--ph-survey-text-primary-color);transition:fill .2s ease-out}.rating-options-number{border-radius:6px;grid-auto-columns:1fr;grid-auto-flow:column;display:grid;overflow:hidden}.rating-options-number .ratings-number{border-right:1px solid var(--ph-survey-border-color);text-align:center;cursor:pointer;color:var(--ph-survey-rating-text-color);border-top:none;border-bottom:none;border-left:none;font-weight:700}.rating-options-number .ratings-number:last-of-type{border-right:0}.rating-options-number .ratings-number.rating-active{background:var(--ph-survey-rating-active-bg-color);color:var(--ph-survey-rating-active-text-color)}.ratings-number{background-color:var(--ph-survey-rating-bg-color);border:none;padding:8px 0}.ratings-number .rating-active{background-color:var(--ph-survey-rating-active-bg-color)}.ratings-number{cursor:pointer}@media (hover:hover) and (pointer:fine){.ratings-number:hover:not(.rating-active){background-color:color-mix(in srgb, var(--ph-survey-rating-active-bg-color) 14%, var(--ph-survey-rating-bg-color))}}.rating-text{opacity:.7;flex-direction:row;justify-content:space-between;font-size:11px;display:flex}.form-buttons{flex-direction:row;gap:8px;width:100%;display:flex}.form-buttons-with-back>.form-submit{flex:auto;min-width:0}.form-submit{text-align:center;cursor:pointer;user-select:none;background:var(--ph-survey-submit-button-color);color:var(--ph-survey-submit-button-text-color);border:none;border-radius:6px;min-width:100%;padding:12px;font-weight:700;box-shadow:0 2px #0000000b}.form-submit:not([disabled]):hover{transform:scale(1.02);box-shadow:0 4px 8px #0000001a}.form-submit:not([disabled]):active{transform:scale(.98);box-shadow:0 1px 2px #0000000d}.form-submit[disabled]{opacity:var(--ph-survey-disabled-button-opacity);cursor:not-allowed}.form-back{text-align:center;cursor:pointer;user-select:none;color:var(--ph-survey-text-primary-color);border:1.5px solid var(--ph-survey-border-color);background:0 0;border-radius:6px;flex:none;padding:12px 16px;font-weight:600}.form-back:hover{transform:scale(1.02)}.form-back:active{transform:scale(.98)}.validation-hint{opacity:.7;margin-top:4px;font-size:12px}.form-cancel{cursor:pointer;background:#fff;border-radius:100%;padding:12px;line-height:0;position:absolute;top:0;right:0;transform:translate(50%,-50%)}.form-cancel:hover{opacity:.7;transform:translate(50%,-50%)scale(1.1)}.footer-branding{opacity:.6;justify-content:center;align-items:center;gap:4px;font-size:11px;font-weight:500;text-decoration:none;display:flex}.footer-branding:hover{opacity:1}.footer-branding a{text-decoration:none}.thank-you-message{text-align:center}.thank-you-message-header{margin:10px 0 0}.thank-you-message-body{opacity:.8;font-size:14px}.intro-screen{text-align:center;animation:.3s ease-out forwards ph-survey-fade-in}.intro-screen-header{margin:10px 0 0}.intro-screen-body{opacity:.8;font-size:14px}.limit-height{scrollbar-width:thin;scrollbar-color:var(--ph-survey-scrollbar-thumb-color) var(--ph-survey-scrollbar-track-color);max-height:256px;overflow:hidden auto}.limit-height::-webkit-scrollbar{width:8px}.limit-height::-webkit-scrollbar-track{background:var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb{background-color:var(--ph-survey-scrollbar-thumb-color);border:2px solid var(--ph-survey-scrollbar-track-color);border-radius:4px}.limit-height::-webkit-scrollbar-thumb:hover{background-color:var(--ph-survey-text-subtle-color)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.ph-survey *{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@keyframes ph-survey-checkmark-reveal{0%{opacity:0;transform:rotate(45deg)scale(0)}50%{opacity:1;transform:rotate(45deg)scale(1.2)}to{opacity:1;transform:rotate(45deg)scale(1)}}@keyframes ph-survey-radio-reveal{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.3)}to{opacity:1;transform:scale(1)}}',t);return null==e||e.setAttribute("data-ph-survey-style","true"),e}(r);if(u){var l=s.querySelector("style");l&&s.removeChild(l),s.appendChild(u)}return(i||xh.body).appendChild(a),{shadow:s,isNewlyCreated:!0}},Eh=t=>{var r=t.responses,i=t.survey,n=t.surveySubmissionId,o=t.posthog,a=t.isSurveyCompleted,s=t.properties,u=t.surveyLanguage,l=t.questionSnapshots;o?(ch(i),o.capture("survey sent",e({[eh]:i.name,[th]:i.id,[rh]:i.current_iteration,[ih]:i.current_iteration_start_date,[oh]:n,[ah]:a},u&&{[sh]:u},{sessionRecordingUrl:null==o.get_session_replay_url?void 0:o.get_session_replay_url()},ii(r,i,l),s,{$set:{[ni(i,"responded")]:!0}})),a&&(Sh.dispatchEvent(new CustomEvent("PHSurveySent",{detail:{surveyId:i.id}})),Qh(i),o.reloadFeatureFlags())):uh.error("[survey sent] event not captured, PostHog instance not found.")},Lh=(t,r,i)=>{return e({[eh]:t.name,[th]:t.id,[rh]:t.current_iteration,[ih]:t.current_iteration_start_date,[nh]:(n=null==r?void 0:r.responses,void 0===n&&(n={}),Object.values(n).some(t=>!Y(t)))},(null==r?void 0:r.surveyLanguage)&&{[sh]:r.surveyLanguage},{sessionRecordingUrl:null==i.get_session_replay_url?void 0:i.get_session_replay_url(),[oh]:null==r?void 0:r.surveySubmissionId},ii(null==r?void 0:r.responses,t,null==r?void 0:r.questionSnapshots));var n},Oh=(t,r,i,n)=>{if(r){if(!i){var o=Zh(t),a=o?o.surveyLanguage:n;r.capture("survey dismissed",e({},Lh(t,o,r),a&&{[sh]:a},{$set:{[ni(t,"dismissed")]:!0}})),Qh(t),ch(t),Sh.dispatchEvent(new CustomEvent("PHSurveyClosed",{detail:{surveyId:t.id}}))}}else uh.error("[survey dismissed] event not captured, PostHog instance not found.")},Dh=(t,e)=>{if(e){var r=(t=>lh("abandonedSurvey_",t))(t);try{if("true"===localStorage.getItem(r))return}catch(t){return}var i=Zh(t);if(i){try{localStorage.setItem(r,"true")}catch(t){}e.capture("survey abandoned",Lh(t,i,e),{transport:"sendBeacon"})}}else uh.error("[survey abandoned] event not captured, PostHog instance not found.")},Ph=t=>t.map(t=>({sort:Math.floor(10*Math.random()),value:t})).sort((t,e)=>t.sort-e.sort).map(t=>t.value),Fh=(t,e)=>t.length===e.length&&t.every((t,r)=>t===e[r])?e.reverse():e,Nh=t=>{var e=t.map(t=>t.id);return e.every(t=>!!t)?e:void 0},qh=(t,e)=>{var r;return(t=>t.questions.some(t=>{var e;return!(null==(e=t.branching)||!e.type)}))(t)?t.questions:e?null!==(r=((t,e)=>{if(!e||e.length!==t.questions.length)return null;var r=new Map(t.questions.map(t=>[t.id,t])),i=[];for(var n of e){var o=r.get(n);if(!o)return null;i.push(o)}return i})(t,e.questionOrder))&&void 0!==r?r:t.questions:t.appearance&&t.appearance.shuffleQuestions&&!t.enable_partial_responses?Fh(t.questions,Ph(t.questions)):t.questions},jh=t=>function(t){var e;return hi(t)&&!(null==(e=t.conditions)||null==(e=e.events)||!e.repeatedActivation)||"always"===t.schedule}(t)||Gh(t),Bh=function(t){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&r.forEach(function(t){t.__e=!0,rl(t)})},this.sub=function(t){r.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){r&&r.delete(t),e&&e.call(t)}}),t.children}return e.__c="__cC"+Nu++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e,e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null}),Hh=()=>Ll(Bh),$h=t=>{var e=t.children,r=t.style;return function(t,e,r){var i,n,o,a,s=Zu({},t.props);for(o in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)"key"==o?i=e[o]:"ref"==o?n=e[o]:s[o]=void 0===e[o]&&null!=a?a[o]:e[o];return arguments.length>2&&(s.children=arguments.length>3?Su.call(arguments,2):r),Ju(t.type,s,i||t.key,n||t.ref,null)}(t.component,t.renderAsHtml?{dangerouslySetInnerHTML:{__html:e},style:r}:{children:e,style:r})};function Uh(t,e){var r,i;if(null==(r=t.conditions)||!r.url)return!0;var n,o=se(e);return!!o&&vi[n=null==(i=t.conditions)?void 0:i.urlMatchType,null!=n?n:"icontains"]([t.conditions.url],[o])}function zh(t){var e,i;return function(t,e){var i,n,a;if(!t||0===t.length)return!0;if(!u)return!1;var s,l,h,c,d,v,f=(s={userAgentDataPlatform:null==o||null==(i=o.userAgentData)?void 0:i.platform,maxTouchPoints:null==o?void 0:o.maxTouchPoints,screenWidth:null==r||null==(n=r.screen)?void 0:n.width,screenHeight:null==r||null==(a=r.screen)?void 0:a.height,devicePixelRatio:null==r?void 0:r.devicePixelRatio},(v=function(t){return xt.test(t)?pt:St.test(t)?gt:_t.test(t)?mt:new RegExp(bt,"i").test(t)?bt:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?vt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ft:Ct.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(yt,"i").test(t)?yt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(ht).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":dt:new RegExp("(pda|Mobile)","i").test(t)?wt:new RegExp(ct,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?kt:""}(u))===vt||v===dt||"Kobo"===v||"Kindle Fire"===v||v===kt?ct:v===pt||v===mt||v===gt||v===bt?"Console":v===ft?"Wearable":v?ht:"Android"===(null==s?void 0:s.userAgentDataPlatform)&&(null!==(l=null==s?void 0:s.maxTouchPoints)&&void 0!==l?l:0)>0?600>Math.min(null!==(h=null==s?void 0:s.screenWidth)&&void 0!==h?h:0,null!==(c=null==s?void 0:s.screenHeight)&&void 0!==c?c:0)/(null!==(d=null==s?void 0:s.devicePixelRatio)&&void 0!==d?d:1)?ht:ct:"Desktop");return vi[null!=e?e:"icontains"](t,[f])}(null==(e=t.conditions)?void 0:e.deviceTypes,null==(i=t.conditions)?void 0:i.deviceTypesMatchType)}var Wh=t=>lh("inProgressSurvey_",t),Vh=(t,e)=>{try{localStorage.setItem(Wh(t),JSON.stringify(e))}catch(t){uh.error("Error setting in-progress survey state in localStorage",t)}},Zh=t=>{try{var e=localStorage.getItem(Wh(t));if(e)return JSON.parse(e)}catch(t){uh.error("Error getting in-progress survey state from localStorage",t)}return null},Gh=t=>{var e=Zh(t);return!Y(null==e?void 0:e.surveySubmissionId)},Qh=t=>{try{localStorage.removeItem(Wh(t))}catch(t){uh.error("Error clearing in-progress survey state from localStorage",t)}};function Jh(t,e){void 0===e&&(e=!1);var r="PostHogSurvey-"+t.id;return e?"."+r:r}function Kh(t,e,r){if(void 0===e&&(e=Ul),t===Zl)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case Hl:return{left:"30px"};case $l:return{left:"50%",transform:"translateX(-50%)"};default:return{right:t===Vl&&r===Bl?"60px":"30px"}}}var Xh=0;function Yh(t,e,r,i,n,o){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?a=e[s]:u[s]=e[s];var l={type:t,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xh,__i:-1,__u:0,__source:n,__self:o};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return xu.vnode&&xu.vnode(l),l}var tc=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),ec=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),rc=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),ic=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),nc=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Yh("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"})}),oc=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Yh("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"})}),ac=Yh("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 0 24 24",width:"48",children:Yh("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"})}),sc=Yh("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Yh("g",{"clip-path":"url(#clip0_2415_6911)",children:[Yh("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Yh("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Yh("g",{mask:"url(#mask0_2415_6911)",children:[Yh("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"}),Yh("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"}),Yh("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"}),Yh("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"}),Yh("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"}),Yh("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"})]})]}),Yh("defs",{children:Yh("clipPath",{id:"clip0_2415_6911",children:Yh("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function uc(t){var e=t.urlParams,r=e?Object.entries(e).map(t=>{var e=t[1];return encodeURIComponent(t[0])+"="+encodeURIComponent(e)}).join("&"):"";return Yh("a",{href:"https://posthog.com/surveys"+(r?"?"+r:""),target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",sc]})}function lc(t){var e=t.text,i=t.submitDisabled,n=t.appearance,o=t.onSubmit,a=t.link,s=t.onPreviewSubmit,u=t.skipSubmitButton,l=t.canGoBack,h=t.onBack,c=Ll(Bh).isPreviewMode,d=!!l&&!!h,v=!u&&Yh("button",{className:"form-submit",disabled:i,"aria-label":"Submit survey",type:"button",onClick(){a&&(null==r||r.open(a)),c?null==s||s():o()},children:e});return Yh("div",{className:"bottom-section",children:[d?Yh("div",{className:"form-buttons form-buttons-with-back",children:[Yh("button",{className:"form-back",type:"button","aria-label":"Go to previous question",onClick:h,children:n.backButtonText||"Back"}),v]}):v,!n.whiteLabel&&Yh(uc,{urlParams:{utm_source:"survey-footer"}})]})}function hc(t){var e=t.question,r=t.forceDisableHtml;return Yh("div",{class:e.question||e.description?"question-header":"question-header question-header--empty",children:[Yh(e.type===Gl?"label":"h3",{className:"survey-question",htmlFor:t.htmlFor,children:e.question}),e.description&&$h({component:Qu("p",{className:"survey-question-description"}),children:e.description,renderAsHtml:!r&&"text"!==e.descriptionContentType})]})}function cc(t){var e,r,i;return Yh("button",{className:"form-cancel",onClick:t.onClick,disabled:Ll(Bh).isPreviewMode,"aria-label":"Close survey",type:"button",children:(e={fill:"black"},r=(void 0===e?{}:e).fill,i=void 0===r?"currentColor":r,Yh("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Yh("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Yh("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:i})]}))})}var dc=r;function vc(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,o=t.appearance,a=t.onClose,s=Ll(Bh).isPopup;return Rl(()=>{var t=t=>{"Enter"!==t.key&&"Escape"!==t.key||(t.preventDefault(),a())};return ne(dc,"keydown",t),()=>{dc.removeEventListener("keydown",t)}},[a]),Yh("div",{className:"thank-you-message",role:"status",tabIndex:0,"aria-atomic":"true",children:[s&&!0!==o.hideCancelButton&&Yh(cc,{onClick:()=>a()}),Yh("h3",{className:"thank-you-message-header",children:e}),r&&$h({component:Qu("p",{className:"thank-you-message-body"}),children:r,renderAsHtml:!n&&"text"!==i}),s&&Yh(lc,{text:o.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:o,onSubmit:()=>a()})]})}function fc(t){var e=t.header,r=t.description,i=t.contentType,n=t.forceDisableHtml,o=t.appearance,a=t.onStart,s=Ll(Bh),u=s.onPreviewSubmit,l=s.onPopupSurveyDismissed;return Yh("div",{className:"intro-screen",role:"status",tabIndex:0,"aria-atomic":"true",children:[s.isPopup&&!0!==o.hideCancelButton&&Yh(cc,{onClick:()=>l()}),e&&Yh("h3",{className:"intro-screen-header",children:e}),r&&$h({component:Qu("p",{className:"intro-screen-body"}),children:r,renderAsHtml:!n&&"text"!==i}),Yh(lc,{text:o.introScreenButtonText||"Get started",submitDisabled:!1,appearance:o,onSubmit:a,onPreviewSubmit:()=>u(null)})]})}var pc=t=>V(t)&&t.every(t=>J(t));function gc(t){var e=t.question,r=t.forceDisableHtml,i=t.appearance,n=t.onSubmit,o=t.onPreviewSubmit,a=t.displayQuestionIndex,s=t.initialValue,u=t.canGoBack,l=t.onBack,h=Hh().isPreviewMode,c=Al(null),d=Il(()=>J(s)?s:""),v=d[0],f=d[1],p=null==i?void 0:i.disableAutofocus;Rl(()=>{p||setTimeout(()=>{var t;h||null==(t=c.current)||t.focus()},100)},[h,p]);var g="surveyQuestion"+a,m=El(()=>function(t,e,r){var i,n,o=t.trim();if(!r&&""===o)return"This field is required";if(""===o)return!1;if(e&&e.length>0)for(var a of e)switch(a.type){case B:if(void 0!==a.value&&a.value>o.length)return null!==(i=a.errorMessage)&&void 0!==i?i:"Please enter at least "+a.value+" characters";break;case H:if(void 0!==a.value&&o.length>a.value)return null!==(n=a.errorMessage)&&void 0!==n?n:"Please enter no more than "+a.value+" characters"}return!1}(v,e.validation,e.optional),[v,e.validation,e.optional]),y=Qt(e.validation,B),b=Qt(e.validation,H),w=El(()=>function(t,e){var r=1===t?void 0:t;return r&&e?"Enter "+r+"-"+e+" characters":r?"Enter at least "+r+" "+(1===r?"character":"characters"):e?"Maximum "+e+" "+(1===e?"character":"characters"):void 0}(y,b),[y,b]),k=()=>{m||n(v.trim())},_=()=>{m||o(v.trim())};return Yh(Ku,{children:[Yh("div",{className:"question-container",children:[Yh(hc,{question:e,forceDisableHtml:r,htmlFor:g}),Yh("textarea",{ref:c,id:g,rows:4,placeholder:null==i?void 0:i.placeholder,minLength:y,maxLength:b,onInput(t){f(t.currentTarget.value),t.stopPropagation()},onKeyDown(t){t.stopPropagation(),"Enter"!==t.key||!t.metaKey&&!t.ctrlKey||m||(t.preventDefault(),h?_():k())},value:v}),w&&Yh("div",{className:"validation-hint",children:w})]}),Yh(lc,{text:e.buttonText||"Submit",submitDisabled:!!m,appearance:i,onSubmit:k,onPreviewSubmit:_,canGoBack:u,onBack:l})]})}function mc(t){var e=t.question,r=t.appearance,i=t.onSubmit,n=t.onPreviewSubmit,o=t.canGoBack,a=t.onBack;return Yh(Ku,{children:[Yh("div",{className:"question-container",children:Yh(hc,{question:e,forceDisableHtml:t.forceDisableHtml})}),Yh(lc,{text:e.buttonText||"Submit",submitDisabled:!1,link:e.link,appearance:r,onSubmit:()=>i("link clicked"),onPreviewSubmit:()=>n("link clicked"),canGoBack:o,onBack:a})]})}function yc(t){var e,r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,o=t.appearance,a=t.onSubmit,s=t.onPreviewSubmit,u=t.initialValue,l=t.canGoBack,h=t.onBack,c=r.scale,d=10===r.scale?0:1,v=Il(()=>tt(u)?u:V(u)&&u.length>0&&tt(parseInt(u[0]))?parseInt(u[0]):J(u)&&tt(parseInt(u))?parseInt(u):null),f=v[0],p=v[1],g="emoji"===r.display&&2===r.scale,m=Hh().isPreviewMode,y=t=>m?s(t):a(t);return Yh(Ku,{children:[Yh("div",{className:"question-container",children:[Yh(hc,{question:r,forceDisableHtml:i}),Yh("div",{className:"rating-section",children:[Yh("div",{className:"rating-options",children:["emoji"===r.display&&Yh("div",{className:"rating-options-emoji"+(g?" rating-options-emoji-2":""),children:null==(e=xc[r.scale])?void 0:e.map((t,e)=>Yh("button",{"aria-label":"Rate "+(e+1),className:"ratings-emoji question-"+n+"-rating-"+e+" "+(e+1===f?"rating-active":""),value:e+1,type:"button",onClick(){var t=e+1;p(t),r.skipSubmitButton&&y(t)},children:t},e))}),"number"===r.display&&Yh("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat("+(c-d+1)+", minmax(0, 1fr))"},children:Cc(r.scale).map((t,e)=>Yh(bc,{displayQuestionIndex:n,active:f===t,appearance:o,num:t,setActiveNumber(t){p(t),r.skipSubmitButton&&y(t)}},e))})]}),!g&&Yh("div",{className:"rating-text",children:[Yh("div",{children:r.lowerBoundLabel}),Yh("div",{children:r.upperBoundLabel})]})]})]}),Yh(lc,{text:r.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:X(f)&&!r.optional,appearance:o,onSubmit:()=>a(f),onPreviewSubmit:()=>s(f),skipSubmitButton:r.skipSubmitButton,canGoBack:l,onBack:h})]})}function bc(t){var e=t.num,r=t.setActiveNumber;return Yh("button",{"aria-label":"Rate "+e,className:"ratings-number question-"+t.displayQuestionIndex+"-rating-"+e+" "+(t.active?"rating-active":""),type:"button",onClick(){r(e)},children:e})}function wc(t){var r=t.question,i=t.forceDisableHtml,n=t.displayQuestionIndex,o=t.appearance,a=t.onSubmit,s=t.onPreviewSubmit,u=t.initialValue,l=t.canGoBack,h=t.onBack,c=Al(null),d=El(()=>(t=>{if(!t.shuffleOptions)return t.choices;var e=t.choices,r="";t.hasOpenChoice&&(r=e.pop());var i=Fh(e,Ph(e));return t.hasOpenChoice&&(t.choices.push(r),i.push(r)),i})(r),[r]),v=Il(()=>((t,e)=>J(t)||pc(t)?t:e===Jl?null:[])(u,r.type)),f=v[0],p=v[1],g=Il(()=>((t,e)=>{if(J(t)&&!e.includes(t))return{isSelected:!0,inputValue:t};if(pc(t)){var r=t.find(t=>!e.includes(t));if(r)return{isSelected:!0,inputValue:r}}return{isSelected:!1,inputValue:""}})(u,d)),m=g[0],y=g[1],b=Hh().isPreviewMode,w=r.type===Jl,k=r.type===Ql,_=r.skipSubmitButton&&w&&!r.hasOpenChoice,S=(t,r)=>{if(r){var i=!m.isSelected;return y(t=>e({},t,{isSelected:i,inputValue:i?t.inputValue:""})),w&&p(""),void(i&&setTimeout(()=>{var t;return null==(t=c.current)?void 0:t.focus()},75))}if(w)return p(t),y(t=>e({},t,{isSelected:!1,inputValue:""})),void(_&&(a(t),b&&s(t)));k&&V(f)&&(f.includes(t)?p(f.filter(e=>e!==t)):p([...f,t]))},x=t=>{t.stopPropagation();var r=t.currentTarget.value;y(t=>e({},t,{inputValue:r})),w&&p(r)},C=t=>{t.stopPropagation(),"Enter"!==t.key||M()||(t.preventDefault(),T()),"Escape"===t.key&&(t.preventDefault(),y(t=>e({},t,{isSelected:!1,inputValue:""})),w&&p(null))},M=()=>!(r.optional||!X(f)&&(!V(f)||m.isSelected||0!==f.length)&&(!m.isSelected||""!==m.inputValue.trim())),T=()=>{m.isSelected&&k?V(f)&&(b?s([...f,m.inputValue]):a([...f,m.inputValue])):b?s(f):a(f)};return Yh(Ku,{children:[Yh("div",{className:"question-container",children:[Yh(hc,{question:r,forceDisableHtml:i}),Yh("fieldset",{className:"multiple-choice-options limit-height",children:[Yh("legend",{className:"sr-only",children:k?" Select all that apply":" Select one"}),d.map((t,e)=>{var i=!!r.hasOpenChoice&&e===r.choices.length-1,o="surveyQuestion"+n+"Choice"+e,a=o+"Open",s=i?m.isSelected:w?f===t:V(f)&&f.includes(t);return Yh("label",{className:i?"choice-option-open":"",children:[Yh("div",{className:"response-choice",children:[Yh("input",{type:w?"radio":"checkbox",name:o,checked:s,onChange:()=>S(t,i),id:o,"aria-controls":a}),Yh("span",{children:i?t+":":t})]}),i&&Yh("input",{type:"text",ref:c,id:a,name:"question"+n+"Open",value:m.inputValue,onKeyDown:C,onInput:x,onClick(e){m.isSelected||S(t,!0),e.stopPropagation()},"aria-label":t+" - please specify"})]},e)})]})]}),Yh(lc,{text:r.buttonText||"Submit",submitDisabled:M(),appearance:o,onSubmit:T,onPreviewSubmit:T,skipSubmitButton:_,canGoBack:l,onBack:h})]})}var kc=[1,2,3,4,5],_c=[1,2,3,4,5,6,7],Sc=[0,1,2,3,4,5,6,7,8,9,10],xc={2:[oc,ac],3:[rc,ec,tc],5:[ic,rc,ec,tc,nc]};function Cc(t){switch(t){case 5:default:return kc;case 7:return _c;case 10:return Sc}}var Mc=te("[Surveys]");function Tc(t,e,r){var i,n=t.questions[e],o=e+1;if(null==(i=n.branching)||!i.type)return e===t.questions.length-1?Xl:o;if(n.branching.type===Xl)return Xl;if("specific_question"===n.branching.type){if(Number.isInteger(n.branching.index))return n.branching.index}else if("response_based"===n.branching.type){if(n.type===Jl){var a,s=n.choices.indexOf(""+r);if(-1===s&&n.hasOpenChoice&&(s=n.choices.length-1),null!=(a=n.branching)&&null!=(a=a.responseValues)&&a.hasOwnProperty(s)){var u=n.branching.responseValues[s];return Number.isInteger(u)?u:u===Xl?Xl:o}}else if(n.type===Kl){var l;if("number"!=typeof r||!Number.isInteger(r))throw new Error("The response type must be an integer");var h=function(t,e){if(2===e){if(1>t||t>2)throw new Error("The response must be in range 1-2");return 1===t?"positive":"negative"}if(3===e){if(1>t||t>3)throw new Error("The response must be in range 1-3");return 1===t?"negative":2===t?"neutral":"positive"}if(5===e){if(1>t||t>5)throw new Error("The response must be in range 1-5");return t>2?3===t?"neutral":"positive":"negative"}if(7===e){if(1>t||t>7)throw new Error("The response must be in range 1-7");return t>3?4===t?"neutral":"positive":"negative"}if(10===e){if(0>t||t>10)throw new Error("The response must be in range 0-10");return t>6?t>8?"promoters":"passives":"detractors"}throw new Error("The scale must be one of: 2, 3, 5, 7, 10")}(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===Xl?Xl:o}}return o}return Mc.warn("Falling back to next question index due to unexpected branching type"),o}var Ic=te("[SurveyTranslations]");function Rc(t,e){var r=function(t){return function(t,e){var r=t.storedPersonProperties,i=t.locale,n=oi(t.overrideLanguage);if(n)return null==e||e.info("Using override display language: "+n),n;var o=function(t){return t&&"object"==typeof t&&"language"in t?oi(t.language):null}(r);if(o)return null==e||e.info("Using person property language: "+o),o;var a=oi(i);return a?(null==e||e.info("Using detected locale: "+a),a):(null==e||e.info("No user language detected"),null)}({overrideLanguage:t.config.override_display_language,storedPersonProperties:Z(t.get_property)?t.get_property(M):void 0,locale:navigator.language||navigator.userLanguage},Ic)}(e);if(!r)return Ic.info("No user language detected"),{survey:t,language:null};var i=li(t,r,Ic);return{survey:i.survey,language:i.matchedKey}}var Ac=r,Ec=a,Lc="ph:show_survey_widget",Oc="PHWidgetSurveyClickListener";function Dc(t,e){try{var r=t.getBoundingClientRect(),i=Ac.innerHeight,n=Ac.innerWidth,o=r.left+r.width/2-e/2;o+e>n-20&&(o=n-e-20),20>o&&(o=20);var a=i-r.bottom,s=250>a&&r.top>a;return{position:"fixed",top:s?"auto":r.bottom+12+"px",left:o+"px",right:"auto",bottom:s?i-r.top+12+"px":"auto",zIndex:Mh.zIndex}}catch(t){return uh.warn("Failed to calculate trigger position:",t),null}}var Pc=class{constructor(t){var r=this;this.fi=new Map,this.pi=new Map,this.gi=new Map,this.mi=new Set,this.yi=null,this.bi=!1,this.wi=null,this.ki=null,this.Si=null,this.handlePageUnload=()=>{var t=this._posthog.get_property(T);if(t)for(var e of t)Gh(e)&&Dh(e,this._posthog)},this.handlePopoverSurvey=function(t,i,n){var o,a,s,u,l,h=(void 0===n?{}:n).resumeDelayFromActivation,c=void 0!==h&&h,d=r.xi(t),v=d.survey,f=d.language;r.yi=f,r.Si=null,r.Ci=i;var p=r.Mi(v,i);r.Ti(p.id);var g=null!=i?i:{},m=g.properties,y=g.initialResponses,b=!(!y||0>=Object.keys(y).length)&&r.Ii(p,y,m,f);if(!b||null!=(o=p.appearance)&&o.displayThankYouMessage){r.Ri(p);var w={};if((null==(a=p.appearance)?void 0:a.position)===zl&&null!=(s=p.appearance)&&s.widgetSelector){var k,_=Ec.querySelector(p.appearance.widgetSelector);_&&(w=Dc(_,parseInt((null==(k=p.appearance)?void 0:k.maxWidth)||Mh.maxWidth))||{})}var S=(null==(u=p.appearance)?void 0:u.surveyPopupDelaySeconds)||0,x=Ah(p,r._posthog).shadow;r.gi.set(x,x.host);var C={posthog:r._posthog,survey:p,removeSurveyFromFocus:r.Ai,properties:m,style:w,isSurveyCompleted:b,skipShownEvent:null==i?void 0:i.skipShownEvent,surveyLanguage:f};if(r.Si=C,0>=S)return r.bi=!0,ml(Yh(Bc,e({},C)),x);var M=()=>{if(!r.Ei(p))return uh.info("Survey "+p.id+" no longer eligible when its display delay elapsed; not displaying"),r.Ai(p);(()=>{r.bi=!0;var n=r.xi(t),o=n.survey,a=n.language;r.yi=a;var s=r.Mi(o,i),u=e({},C,{survey:s,surveyLanguage:a});r.Si=u,ml(Yh(Bc,e({},u,{survey:e({},s,{appearance:e({},s.appearance,{surveyPopupDelaySeconds:0})})})),x)})()},T=c?null==(l=r._posthog.surveys)||null==(l=l._surveyEventReceiver)||null==l.getActivationTimestamp?void 0:l.getActivationTimestamp(p.id):void 0,I=tt(T)?Math.max(0,Date.now()-T):0,R=Math.max(0,1e3*S-I);if(0>=R)return M();var A=Ac.setTimeout(()=>{r.fi.delete(p.id),M()},R);r.fi.set(p.id,A)}},this.Li=t=>{var e=this.xi(t),r=e.survey,i=e.language,n=Ah(r,this._posthog),o=n.shadow,a=n.isNewlyCreated;this.gi.set(o,o.host),a&&ml(Yh($c,{posthog:this._posthog,survey:r,surveyLanguage:i},t.id),o)},this.Oi=t=>{var e=this.pi.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(Oc),this.pi.delete(t),uh.info("Removed click listener for survey "+t))},this.Di=t=>{this.Pi(t)||(this.Fi(t),this.Oi(t.id))},this.Pi=t=>{try{var e;return!(null==(e=Ec.querySelector(Jh(t,!0)))||null==(e=e.shadowRoot)||!e.querySelector(".ph-survey"))}catch(t){return!1}},this.Ni=(t,e)=>{var r=Ec.querySelector(e),i=this.pi.get(t.id);if(r){if(this.Li(t),i){if(r===i.element)return;uh.info("Selector element changed for survey "+t.id+". Re-attaching listener."),this.Oi(t.id)}if(!r.hasAttribute(Oc)){var n=e=>{var r,i;e.stopPropagation();var n=(null==(r=t.appearance)?void 0:r.position)===zl?Dc(e.currentTarget,parseInt((null==(i=t.appearance)?void 0:i.maxWidth)||Mh.maxWidth)):{};Ac.dispatchEvent(new CustomEvent(Lc,{detail:{surveyId:t.id,position:n}}))};ne(r,"click",n),r.setAttribute(Oc,"true"),this.pi.set(t.id,{element:r,listener:n,survey:t}),uh.info("Attached click listener for feedback button survey "+t.id)}}else i&&this.Di(t)},this.renderPopover=t=>{var e=this.xi(t),r=e.survey,i=e.language,n=Ah(r,this._posthog).shadow;this.gi.set(n,n.host),ml(Yh(Bc,{posthog:this._posthog,survey:r,removeSurveyFromFocus:this.Ai,surveyLanguage:i}),n)},this.renderSurvey=(t,e,r)=>{var i,n=this.xi(t),o=n.survey,a=n.language,s=!1;null!=(i=this._posthog.config)&&null!=(i=i.surveys)&&i.prefillFromUrl&&(s=this.qi(o,a,r)),ml(Yh(Bc,{posthog:this._posthog,survey:o,removeSurveyFromFocus:this.Ai,isPopup:!1,properties:r,isSurveyCompleted:s,surveyLanguage:a}),e)},this.getActiveMatchingSurveys=function(t,e){var i;void 0===e&&(e=!1),null==(i=r._posthog)||null==(i=i.surveys)||i.getSurveys(e=>{t(e.filter(t=>r.Ei(t)))},e)},this.callSurveysAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),r.getActiveMatchingSurveys(t=>{var e=t.filter(t=>t.type===Wl||t.type===Vl),i=new Set(e.map(t=>t.id));for(var n of Array.from(r.fi.keys()))i.has(n)||r.cancelSurvey(n);var o=r.ji(e),a=new Set;o.forEach(t=>{if(t.type===Vl){var e,i,n,o;if((null==(e=t.appearance)?void 0:e.widgetType)===Bl)return void r.Li(t);"selector"===(null==(i=t.appearance)?void 0:i.widgetType)&&null!=(n=t.appearance)&&n.widgetSelector&&(a.add(t.id),r.Ni(t,null==(o=t.appearance)?void 0:o.widgetSelector))}X(r.Bi)&&t.type===Wl&&r.handlePopoverSurvey(t,void 0,{resumeDelayFromActivation:!0})}),r.pi.forEach(t=>{var e=t.survey;a.has(e.id)||r.Di(e)})},t)},this.Ri=t=>{X(this.Bi)||uh.error("Survey "+this.Bi+" already in focus. Cannot add survey "+t.id+"."),this.Bi=t.id},this.Ai=t=>{this.Bi!==t.id&&uh.error("Survey "+t.id+" is not in focus. Cannot remove survey "+t.id+"."),this.Ti(t.id),this.Bi=null,this.yi=null,this.bi=!1,this.Si=null,this.Ci=void 0,this.Fi(t)},this._posthog=t,this.Bi=null,this.wi=()=>this.Hi(),ne(Ac,"languagechange",this.wi),this.ki=t.onFeatureFlags(()=>this.Hi())}Hi(){var t;if(!X(this.Bi)){var r=null==(t=this._posthog.get_property(T))?void 0:t.find(t=>t.id===this.Bi);if(r){var i=this.xi(r),n=i.survey,o=i.language;if(o!==this.yi&&(this.yi=o,this.bi)){var a=this.Mi(n,this.Ci),s=Ah(a,this._posthog).shadow;ml(Yh(Bc,e({},this.Si,{posthog:this._posthog,survey:a,removeSurveyFromFocus:this.Ai,surveyLanguage:o})),s)}}}}get $i(){var t,e,r;return null!==(t=null==(e=(r=this._posthog).getExtension)?void 0:e.call(r,"featureFlags"))&&void 0!==t?t:this._posthog.featureFlags}Mi(t,r){return null!=r&&r.position||null!=r&&r.selector?e({},t,{appearance:e({},t.appearance,r.position&&{position:r.position},r.selector&&{widgetSelector:r.selector})}):t}Ti(t){var e=this.fi.get(t);e&&(clearTimeout(e),this.fi.delete(t))}cancelSurvey(t){this.fi.has(t)&&(uh.info("Cancelled pending survey "+t),this.Ti(t),this.Bi===t&&(this.Bi=null,this.yi=null,this.bi=!1,this.Si=null,this.Ci=void 0))}setAutomaticDisplayDispose(t){this.Ui=t}dispose(){var t;null==(t=this.Ui)||t.call(this),this.Ui=void 0,this.wi&&(Ac.removeEventListener("languagechange",this.wi),this.wi=null),this.ki&&(this.ki(),this.ki=null),this.fi.forEach((t,e)=>this.Ti(e)),this.pi.forEach((t,e)=>this.Oi(e)),this.gi.forEach((t,e)=>{ml(null,e),null==t||t.remove()}),this.gi.clear(),this.Bi=null}ji(t){return t.sort((t,e)=>{var r,i,n=Gh(t),o=Gh(e);if(n&&!o)return-1;if(!n&&o)return 1;var a=t.schedule===Yl,s=e.schedule===Yl;return a&&!s?1:!a&&s?-1:((null==(r=t.appearance)?void 0:r.surveyPopupDelaySeconds)||0)-((null==(i=e.appearance)?void 0:i.surveyPopupDelaySeconds)||0)})}xi(t){return Rc(t,this._posthog)}qi(t,e,r){if(this.mi.has(t.id))return!1;var i=function(t){var e={},r=!1,i=t.replace(/^\?/,"");if(!i)return{params:e,autoSubmit:r};for(var n of i.split("&")){var o=n.split("="),a=o[0],s=o[1];if(a&&!Q(s)){var u=decodeURIComponent(a),l=decodeURIComponent(s);if("auto_submit"!==u||"true"!==l){var h=u.match(/^q(\d+)$/);if(h){var c=parseInt(h[1],10);e[c]||(e[c]=[]),e[c].push(l)}}else r=!0}}return{params:e,autoSubmit:r}}(Ac.location.search).params;if(0===Object.keys(i).length)return!1;uh.info("[Survey Prefill] Detected URL prefill parameters");var n=this.zi(t,i,e);return!!n&&(this.Wi(t,n,r,e),this.mi.add(t.id),n.isSurveyCompleted)}Wi(t,e,r,i){var n=e.responses,o=e.submissionId,a=e.isSurveyCompleted,s=e.skippedResponses;(Object.keys(s).length>0&&t.enable_partial_responses||a)&&Eh({responses:a?n:s,survey:t,surveySubmissionId:o,posthog:this._posthog,isSurveyCompleted:a,properties:r,surveyLanguage:i})}Ii(t,e,r,i){var n={};for(var o of Object.entries(e)){var a=o[1];n[parseInt(o[0])]=V(a)?a.map(String):[String(a)]}uh.info("[Survey] Processing initial responses");var s=this.zi(t,n,i);return!!s&&(this.Wi(t,s,r,i),s.isSurveyCompleted)}zi(t,e,r){try{var i=function(t,e){var r={};return t.questions.forEach((t,i)=>{if(e[i]&&t.id){var n=e[i],o=ei(t.id);try{switch(t.type){case Jl:if(!t.choices||0===t.choices.length)return void Yt.warn("[Survey Prefill] Question "+i+" has no choices");var a=parseInt(n[0],10);if(isNaN(a)||0>a||a>=t.choices.length)return void Yt.warn("[Survey Prefill] Invalid choice index for q"+i+": "+n[0]);r[o]=t.choices[a];break;case Ql:if(!t.choices||0===t.choices.length)return void Yt.warn("[Survey Prefill] Question "+i+" has no choices");var s=n.map(t=>parseInt(t,10)).filter(e=>!isNaN(e)&&e>=0&&t.choices.length>e);if(0===s.length)return void Yt.warn("[Survey Prefill] No valid choices for q"+i);var u=[...new Set(s.map(e=>t.choices[e]))];s.length>u.length&&Yt.warn("[Survey Prefill] Removed duplicate choices for q"+i),r[o]=u;break;case Kl:var l=parseInt(n[0],10),h=t.scale||10;if(isNaN(l)||0>l||l>h)return void Yt.warn("[Survey Prefill] Invalid rating for q"+i+": "+n[0]+" (scale: 0-"+h+")");r[o]=l;break;default:Yt.info("[Survey Prefill] Question type "+t.type+" does not support prefill")}}catch(t){Yt.error("[Survey Prefill] Error converting q"+i+":",t)}}}),r}(t,e);if(0===Object.keys(i).length)return uh.warn("[Survey Prefill] No valid responses after conversion"),null;var n=yh(),o=function(t,e,r){for(var i=0,n={},o=[],a=t.questions.length+1,s=0;t.questions.length>i&&a>s&&(s++,e.includes(i));){var u=t.questions[i];if(!u||!("skipSubmitButton"in u)||!u.skipSubmitButton)break;if(u.id){var l=ei(u.id);Q(r[l])||(n[l]=r[l])}o.push(i);var h=Tc(t,i,u.id?r[ei(u.id)]:null);if(h===Xl)return{startQuestionIndex:t.questions.length,skippedResponses:n,skippedIndices:o};i=h}return{startQuestionIndex:i,skippedResponses:n,skippedIndices:o}}(t,Object.keys(e).map(t=>parseInt(t,10)),i),a=o.startQuestionIndex,s=o.skippedResponses,u=o.skippedIndices,l=a>=t.questions.length;return Vh(t,{surveySubmissionId:n,responses:i,lastQuestionIndex:a,questionOrder:Nh(t.questions),visitedIndices:u,surveyLanguage:r}),uh.info("[Survey Prefill] Stored prefilled responses in localStorage"),{responses:i,submissionId:n,startQuestionIndex:a,isSurveyCompleted:l,skippedResponses:s}}catch(t){return uh.error("[Survey Prefill] Error handling prefill:",t),null}}Vi(t,e){if(void 0===e&&(e=void 0),!t)return!0;var r=this.$i,i=!(null==r||!r.isFeatureEnabled(t,{send_event:!t.startsWith("survey-targeting-")})),n=!0;return e&&(n=(null==r?void 0:r.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),i&&n}Zi(t){return!t.conditions||Uh(t,this._posthog)&&zh(t)&&function(t){var e;return null==(e=t.conditions)||!e.selector||!(null==xh||!xh.querySelector(t.conditions.selector))}(t)}Gi(t){var e;return jh(t)?{satisfied:!0}:!t.internal_targeting_flag_key||!function(t){var e;return"recurring"===t.schedule||(null!==(e=t.current_iteration)&&void 0!==e?e:0)>0}(t)||null!=(e=this.$i)&&e.hasLoadedFlags?{satisfied:this.Vi(t.internal_targeting_flag_key)}:{satisfied:!1,reason:"Feature flags have not loaded yet; deferring internal targeting flag check"}}checkSurveyEligibility(t){var e,r,i={eligible:!0,reason:void 0};if(!function(t){return!(!t.start_date||t.end_date)}(t))return i.eligible=!1,i.reason="Survey is not running. It was completed on "+t.end_date,i;if(!dh.includes(t.type))return i.eligible=!1,i.reason="Surveys of type "+t.type+" are never eligible to be shown in the app",i;var n=null==(e=t.conditions)?void 0:e.linkedFlagVariant;if(!this.Vi(t.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.Vi(t.targeting_flag_key))return i.eligible=!1,i.reason="Survey targeting feature flag is not enabled",i;var o,a=this.Gi(t);return a.satisfied?function(t,e){if(!t||!e)return!0;var r="string"==typeof e?new Date(e):e,i=Math.abs((new Date).getTime()-r.getTime());return Math.ceil(i/864e5)>t}(null==(r=t.conditions)?void 0:r.seenSurveyWaitPeriodInDays,kh.li("lastSeenSurveyDate"))?(t=>!!kh.li(hh(t))&&!jh(t))(t)?(i.eligible=!1,i.reason="Survey has already been seen and it can't be activated again",i):i:(i.eligible=!1,i.reason="Survey wait period has not passed",i):(i.eligible=!1,i.reason=null!==(o=a.reason)&&void 0!==o?o:"Survey internal targeting flag is not enabled and survey cannot activate repeatedly and survey is not in progress",i)}checkSurveyRenderability(t){var e=this.checkSurveyEligibility(t);return e.eligible&&!this.Qi(t)?{eligible:!1,reason:"Survey event/action trigger has not been fired yet"}:e}Qi(t){var e;return!hi(t)&&!function(t){var e;return!(null==(e=t.conditions)||null==(e=e.actions)||null==(e=e.values)||!e.length)}(t)||!(null==(e=this._posthog.surveys)||null==(e=e._surveyEventReceiver)||null==(e=e.getSurveys())||!e.includes(t.id))}Ji(t){var e;return null==(e=t.feature_flag_keys)||!e.length||t.feature_flag_keys.every(t=>{var e=t.value;return!t.key||!e||this.Vi(e)})}Ei(t){return this.checkSurveyEligibility(t).eligible&&this.Zi(t)&&this.Qi(t)&&this.Ji(t)}Fi(t){try{var e=Ec.querySelector(Jh(t,!0));null!=e&&e.shadowRoot&&(ml(null,e.shadowRoot),this.gi.delete(e.shadowRoot)),null==e||e.remove()}catch(e){uh.warn("Failed to remove survey "+t.id+" from DOM:",e)}}getTestAPI(){return{addSurveyToFocus:this.Ri,removeSurveyFromFocus:this.Ai,surveyInFocus:this.Bi,surveyTimeouts:this.fi,handleWidget:this.Li,handlePopoverSurvey:this.handlePopoverSurvey,manageWidgetSelectorListener:this.Ni,sortSurveysByAppearanceDelay:this.ji,checkFlags:this.Ji.bind(this),isSurveyFeatureFlagEnabled:this.Vi.bind(this),onLanguageChange:this.Hi.bind(this),currentLanguage:this.yi,surveyIsRendered:this.bi}}};function Fc(t,e){if(Ec&&Ac){var r,i=new Pc(t);if(t.config.disable_surveys_automatic_display)return uh.info("Surveys automatic display is disabled. Skipping call surveys and evaluate display logic."),i;if(!1===e)return uh.info("There are no surveys to load or Surveys is disabled in the project settings."),i;i.callSurveysAndEvaluateDisplayLogic(!0);var n=()=>{Q(r)&&(r=setInterval(()=>{i.callSurveysAndEvaluateDisplayLogic(!1)},1e3))},o=()=>{Q(r)||(clearInterval(r),r=void 0)};n();var a=()=>{Ec.hidden?o():(i.callSurveysAndEvaluateDisplayLogic(!1),n())};return ne(Ec,"visibilitychange",a),i.setAutomaticDisplayDispose(()=>{o(),Ec.removeEventListener("visibilitychange",a)}),i}}function Nc(t){var e=t.survey,r=t.removeSurveyFromFocus,i=void 0===r?()=>{}:r,n=t.setSurveyVisible,o=t.isPreviewMode,a=void 0!==o&&o,s=t.posthog;Rl(()=>{var t;if(!a&&null!=(t=e.conditions)&&t.url){var r=()=>{var t,r=e.type===Vl,o=Uh(e,s),a=(null==(t=e.appearance)?void 0:t.widgetType)===Bl&&r;if(!o)return uh.info("Hiding survey "+e.id+" because URL does not match"),n(!1),i(e);a&&(uh.info("Showing survey "+e.id+" because it is a feedback button tab and URL matches"),n(!0))};ne(Ac,"popstate",r),ne(Ac,"hashchange",r);var o=Ac.history.pushState,u=Ac.history.replaceState;return Ac.history.pushState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];o.apply(this,e),r()},Ac.history.replaceState=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];u.apply(this,e),r()},()=>{Ac.removeEventListener("popstate",r),Ac.removeEventListener("hashchange",r),Ac.history.pushState=o,Ac.history.replaceState=u}}},[a,e,i,n,s])}var qc=200;function jc(t){switch(void 0===t&&(t="right"),t){case"top":return{top:"0",left:"50%",transform:"translateX(-50%)"};case"left":return{top:"50%",left:"0",transform:"rotate(90deg) translateY(-100%)",transformOrigin:"left top"};case"bottom":return{bottom:"0",left:"50%",transform:"translateX(-50%)"};default:return{top:"50%",right:"0",transform:"rotate(-90deg) translateY(-100%)",transformOrigin:"right top"}}}function Bc(t){var r,i,n,o,a,s,u,l,h,c,d,v,f=t.survey,p=t.forceDisableHtml,g=t.posthog,m=t.style,y=void 0===m?{}:m,b=t.previewPageIndex,w=t.removeSurveyFromFocus,k=void 0===w?()=>{}:w,_=t.isPopup,S=void 0===_||_,x=t.onPreviewSubmit,C=void 0===x?()=>{}:x,M=t.onPreviewBack,T=void 0===M?()=>{}:M,I=t.onPopupSurveyDismissed,R=void 0===I?()=>{}:I,A=t.onCloseConfirmationMessage,E=void 0===A?()=>{}:A,L=t.properties,O=t.isSurveyCompleted,D=t.skipShownEvent,P=t.surveyLanguage,F=Al(null),N=Number.isInteger(b),q=function(t,r,i,n,o,a,s,u,l){var h=Il(n||0===i||t.type===Zl),c=h[0],d=h[1],v=Il(!1),f=v[0],p=v[1],g=Al(!1),m=()=>{var e=()=>{a&&o(t),d(!1)};if(!g.current){var r=null==s?void 0:s.current;r?(g.current=!0,r.style.transition="opacity "+qc+"ms ease-out",r.style.opacity="0",setTimeout(()=>{g.current=!1,e()},250)):e()}},y=e=>{e.detail.surveyId===t.id&&m()};return Rl(()=>{if(r){if(!n){var o,a=e=>{var r,i;if(e.detail.surveyId===t.id){if(null==(r=t.appearance)||!r.displayThankYouMessage)return m();p(!0),null!=(i=t.appearance)&&i.autoDisappear&&(o&&clearTimeout(o),o=setTimeout(m,5e3))}},s=()=>{if(Uh(t,r)){d(!0),Ac.dispatchEvent(new Event("PHSurveyShown")),u||r.capture("survey shown",e({[eh]:t.name,[th]:t.id,[rh]:t.current_iteration,[ih]:t.current_iteration_start_date},l&&{[sh]:l},{sessionRecordingUrl:null==r.get_session_replay_url?void 0:r.get_session_replay_url()}));try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(t){}}};ne(Ac,"PHSurveyClosed",y),ne(Ac,"PHSurveySent",a);var h=i>0?setTimeout(s,i):void 0;return Q(h)&&s(),()=>{Q(h)||clearTimeout(h),Q(o)||clearTimeout(o),Ac.removeEventListener("PHSurveyClosed",y),Ac.removeEventListener("PHSurveySent",a)}}}else uh.error("usePopupVisibility hook called without a PostHog instance.")},[]),Nc({survey:t,removeSurveyFromFocus:o,setSurveyVisible:d,isPreviewMode:n,posthog:r}),{isPopupVisible:c,isSurveySent:f,setIsPopupVisible:d,hidePopupWithAnimation:m}}(f,g,null!=(r=f.appearance)&&r.surveyPopupDelaySeconds?1e3*f.appearance.surveyPopupDelaySeconds:0,N,k,S,F,D,P),j=q.isPopupVisible,B=q.hidePopupWithAnimation,H=q.isSurveySent||b===f.questions.length||!0===O,U=Il(!1),z=U[0],W=U[1],V=El(()=>!!Zh(f),[f]),Z=!!(null!=(i=f.appearance)&&i.introScreenHeader||null!=(n=f.appearance)&&n.introScreenDescription),G=N?-1===b:!(null==(o=f.appearance)||!o.displayIntroScreen)&&Z&&!z&&!V,J=El(()=>{var t,e=(null==(t=Zh(f))?void 0:t.surveySubmissionId)||yh();return{isPreviewMode:N,previewPageIndex:b,onPopupSurveyDismissed(){P?Oh(f,g,N,P):Oh(f,g,N),R()},isPopup:S||!1,surveySubmissionId:e,onPreviewSubmit:C,onPreviewBack:T,posthog:g,properties:L,surveyLanguage:P}},[N,b,S,g,f,R,C,T,L,P]);return j?Yh(Bh.Provider,{value:J,children:Yh("div",{className:"ph-survey",style:e({},Kh(f.type,null==(a=f.appearance)?void 0:a.position,null==(s=f.appearance)?void 0:s.widgetType),y),ref:F,children:H?Yh(vc,{header:(null==(u=f.appearance)?void 0:u.thankYouMessageHeader)||"Thank you!",description:(null==(l=f.appearance)?void 0:l.thankYouMessageDescription)||"",forceDisableHtml:!!p,contentType:null==(h=f.appearance)?void 0:h.thankYouMessageDescriptionContentType,appearance:f.appearance||Mh,onClose(){B(),E()}}):G?Yh(fc,{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||Mh,onStart:()=>W(!0)}):Yh(Hc,{survey:f,forceDisableHtml:!!p,posthog:g})})}):null}function Hc(t){var r,i,n=t.survey,o=t.forceDisableHtml,a=t.posthog,s=El(()=>{var t=Zh(n);if(!t)return null;var e=tt(t.lastQuestionIndex);return!e||e&&t.lastQuestionIndex>=0&&n.questions.length>t.lastQuestionIndex?t:(Qh(n),null)},[n]),u=Il(()=>(null!=s&&s.responses&&uh.info("Survey is already in progress, filling in initial responses"),(null==s?void 0:s.responses)||{})),l=u[0],h=u[1],c=Ll(Bh),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=Il(()=>{var t=null==s?void 0:s.lastQuestionIndex,e=tt(t)&&t>=0&&n.questions.length>t?t:0;return tt(d)&&d>=0?d:e}),_=k[0],S=k[1],x=Il(()=>{var t;return(null!==(t=null==s?void 0:s.visitedIndices)&&void 0!==t?t:[]).filter(t=>t>=0&&n.questions.length>t)}),C=x[0],M=x[1],T=Il(()=>{var t,e;return null!==(t=null==(e=Zh(n))?void 0:e.questionSnapshots)&&void 0!==t?t:{}}),I=T[0],R=T[1],A=El(()=>Nh(qh(n,s)),[n.id,s]),E=El(()=>{if(!A||new Set(A).size!==A.length)return qh(n,s);var t=new Map(n.questions.map(t=>[t.id,t])),e=A.map(e=>t.get(e)).filter(t=>!!t);return e.length===A.length?e:n.questions},[A,n.questions,n,s]);Rl(()=>{!y||Q(d)||0>d||S(d)},[d,y]);var L=!(null==(r=n.appearance)||!r.allowGoBack)&&(y?(null!=d?d:0)>0:C.length>0),O=E.at(_);return O?Yh("form",{className:"survey-form",name:"surveyForm",children:[f&&!0!==(null==(i=n.appearance)?void 0:i.hideCancelButton)&&Yh(cc,{onClick(){v()}}),Yh("div",{className:"survey-box","data-question-index":_,children:Uc({question:O,forceDisableHtml:o,displayQuestionIndex:_,appearance:n.appearance||Mh,onSubmit:t=>(t=>{var r=t.res,i=t.displayQuestionIndex,o=t.questionId;if(a)if(o){var s=ei(o),u=e({},l,{[s]:r});h(u);var c=E[i],d=null!=c&&c.id?e({},I,{[c.id]:c.question}):I;R(d);var v=Tc(n,i,r),f=v===Xl,p=[...C,i];if(f||(M(p),S(v),Vh(n,{surveySubmissionId:m,responses:u,lastQuestionIndex:v,questionOrder:Nh(E),visitedIndices:p,surveyLanguage:w,questionSnapshots:d})),n.enable_partial_responses||f){var g=new Set(p.map(t=>{var e;return null==(e=E[t])?void 0:e.id}).filter(t=>!!t).map(t=>ei(t)));Eh({responses:Object.fromEntries(Object.entries(u).filter(t=>g.has(t[0]))),survey:n,surveySubmissionId:m,isSurveyCompleted:f,posthog:a,properties:b,surveyLanguage:w,questionSnapshots:d})}}else uh.error("onNextButtonClick called without a questionId.");else uh.error("onNextButtonClick called without a PostHog instance.")})({res:t,displayQuestionIndex:_,questionId:O.id}),onPreviewSubmit:p,initialValue:O.id?l[ei(O.id)]:void 0,canGoBack:L,onBack(){if(y)g();else if(0!==C.length){var t=C[C.length-1],e=C.slice(0,-1);M(e),S(t),Vh(n,{surveySubmissionId:m,responses:l,lastQuestionIndex:t,questionOrder:Nh(E),visitedIndices:e,surveyLanguage:w,questionSnapshots:I})}}})})]}):null}function $c(t){var e,r,i,n,o,a,s,u=t.survey,l=t.forceDisableHtml,h=t.posthog,c=t.readOnly,d=t.surveyLanguage,v=Il(!0),f=v[0],p=v[1],g=Il(!1),m=g[0],y=g[1],b=Il({}),w=b[0],k=b[1],_=Al(void 0),S=()=>{y(!m)};if(Rl(()=>{var t;if(h){if(!c){"tab"===(null==(t=u.appearance)?void 0:t.widgetType)&&k({top:"50%",bottom:"auto"});var e=t=>{var e,r=t;(null==(e=r.detail)?void 0:e.surveyId)===u.id&&(uh.info("Received show event for feedback button survey "+u.id),k(r.detail.position||{}),S())};return ne(Ac,Lc,e),()=>{Q(_.current)||(clearTimeout(_.current),_.current=void 0),Ac.removeEventListener(Lc,e)}}}else uh.error("FeedbackWidget called without a PostHog instance.")},[h,c,u.id,null==(e=u.appearance)?void 0:e.widgetType,null==(r=u.appearance)?void 0:r.widgetSelector,null==(i=u.appearance)?void 0:i.borderColor]),Nc({survey:u,setSurveyVisible:p,posthog:h}),!f)return null;var x=()=>{u.schedule!==Yl&&p(!1),Q(_.current)||clearTimeout(_.current),_.current=setTimeout(()=>{_.current=void 0,y(!1)},200)};return Yh(Ku,{children:["tab"===(null==(n=u.appearance)?void 0:n.widgetType)&&Yh("button",{className:"ph-survey-widget-tab "+("top"===(null==(o=u.appearance)?void 0:o.tabPosition)?"widget-tab-top":""),onClick:S,disabled:c,style:jc(null==(a=u.appearance)?void 0:a.tabPosition),children:(null==(s=u.appearance)?void 0:s.widgetLabel)||""}),m&&Yh(Bc,{posthog:h,survey:u,forceDisableHtml:l,style:w,onPopupSurveyDismissed:x,onCloseConfirmationMessage:x,surveyLanguage:d})]})}var Uc=t=>{var r=t.question,i=t.displayQuestionIndex,n=t.onSubmit,o=t.onPreviewSubmit,a={forceDisableHtml:t.forceDisableHtml,appearance:t.appearance,onPreviewSubmit(t){o(t)},onSubmit(t){n(t)},initialValue:t.initialValue,displayQuestionIndex:i,canGoBack:t.canGoBack,onBack:t.onBack};switch(r.type){case Gl:return Qu(gc,e({},a,{question:r,key:r.id}));case"link":return Qu(mc,e({},a,{question:r,key:r.id}));case Kl:return Qu(yc,e({},a,{question:r,key:r.id}));case Jl:case Ql:return Qu(wc,e({},a,{question:r,key:r.id}));default:return uh.error("Unsupported question type: "+r.type),null}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.generateSurveys=Fc,h.extendPostHogWithSurveys=Fc;var zc=1e4,Wc=(t,e,r)=>r.remaining>0?e.length>r.remaining?(t.push(e.slice(0,r.remaining)),r.remaining=0,r.truncated=!0,!1):(t.push(e),r.remaining-=e.length,!0):(r.truncated=!0,!1),Vc=(t,e,r)=>{var i=JSON.stringify(t);if(r.remaining>=i.length)return Wc(e,i,r);if(r.truncated=!0,2>r.remaining)return!1;for(var n=0,o=Math.min(t.length,r.remaining-2);o>n;){var a=Math.ceil((n+o)/2);JSON.stringify(t.slice(0,a)).length>r.remaining?o=a-1:n=a}return Wc(e,JSON.stringify(t.slice(0,n)),r)},Zc=t=>void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t&&"bigint"!=typeof t,Gc=(t,e,r)=>{if(!r.truncated){if(r.keysRemaining-=1,r.sizeRemaining-=String(e).length+t.length,0>=r.keysRemaining||0>=r.sizeRemaining)return r.truncated=!0,void(r.result.attributes_truncated=!0);r.result[t]=e}},Qc=(t,e,r)=>{if(!r.truncated)if(G(t)){if(r.seen.has(t))return void Gc(e||"circular","[Circular]",r);r.seen.add(t);try{for(var i in t)try{if(!{}.hasOwnProperty.call(t,i))continue;if(Qc(t[i],e?e+"."+i:i,r),r.truncated)return}catch(t){continue}}catch(t){}}else Gc(e,t,r)},Jc=function(t,e,r,i,n,o){if(void 0===n&&(n=!1),!Zc(t))return!n||Wc(e,"null",r);if(X(t)||(t=>{try{return tt(t)||et(t)}catch(t){return!1}})(t))return Wc(e,JSON.stringify(t),r);if("string"==typeof t)return Vc(t,e,r);if(!G(t)&&!V(t))return Wc(e,JSON.stringify(t),r);if(i.has(t))return Vc("[Circular]",e,r);i.add(t);try{var a=t.toJSON;if(Z(a))return Jc(a.call(t),e,r,i,n)}catch(t){}try{var s={}.toString.call(t);if("[object String]"===s)return Vc(String(t.valueOf()),e,r);if("[object Number]"===s||"[object Boolean]"===s)return Wc(e,JSON.stringify(t.valueOf()),r)}catch(t){}if(t instanceof Error){var u={};try{for(var l in t)({}).hasOwnProperty.call(t,l)&&(u[l]=t[l])}catch(t){}try{u.name=t.name}catch(t){}try{u.message=t.message}catch(t){}try{u.stack=t.stack}catch(t){}return Jc(u,e,r,i,n,o)}if(V(t)){if(!Wc(e,"[",r))return!1;for(var h=0;t.length>h;h++){if(h>0&&!Wc(e,",",r))return!1;var c=void 0;try{c=t[h]}catch(t){c=void 0}if(!Jc(c,e,r,i,!0))return!1}return Wc(e,"]",r)}if(!Wc(e,"{",r))return!1;var d=!0;try{for(var v in t)if({}.hasOwnProperty.call(t,v)){if(0>=r.remaining)return r.truncated=!0,!1;var f=void 0;try{f=t[v]}catch(t){continue}if(o)try{Qc(f,v,o)}catch(t){}if(Zc(f)){var p=(d?"":",")+JSON.stringify(v)+":";if(p.length>=r.remaining)return r.truncated=!0,!1;var g=e.length,m=r.remaining,y=r.truncated;if(!Wc(e,p,r))return!1;var b=e.length,w=Jc(f,e,r,i,!1),k=r.truncated;if(e.length!==b){if(d=!1,!w)return!1}else if(e.length=g,r.remaining=m,r.truncated=w?y:k,!w)return!1}}}catch(t){}return Wc(e,"}",r)},Kc=(t,e)=>{for(var r=[],i={remaining:e,truncated:!1},n=G(t[0])?{result:{},keysRemaining:50,sizeRemaining:zc,truncated:!1,seen:new WeakSet([t[0]])}:void 0,o=0;t.length>o&&(0>=o||Wc(r," ",i))&&Jc(t[o],r,i,new WeakSet,!1,0===o?n:void 0);o++);return{body:r.join("")+(i.truncated?"...":""),truncated:i.truncated,attributes:(null==n?void 0:n.result)||{}}},Xc={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"},Yc=t=>"canCapture"in t,td=t=>Yc(t)?t.canCapture?t.getExtension("logs"):void 0:t.is_capturing()?t.logs:void 0;h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.logs={initializeLogs(t){var r=t,i=[],n={host:h.location.host},o=!1,a=function(t){var a=h.console[t];i.push(Xs(h.console,t,i=>{var s=(i=>function(){for(var a=!1,s=arguments.length,u=new Array(s),l=0;s>l;l++)u[l]=arguments[l];try{var c=r;if(u.length>0&&!o&&c){var d=td(c);if(d){o=!0,a=!0;var v=Kc(u,zc),f=v.body,p=v.attributes,g=e({},n,v.truncated?{body_truncated:"true"}:{});((t,e,r)=>{if(Yc(t))e.captureConsoleLog(r);else{var i=(t=>{var e=/^1\.(\d+)\.(\d+)$/.exec(t);if(e){var r=Number(e[1]),i=Number(e[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"}})(t.version),n=i?e[i]:void 0;Z(n)&&n.call(e,r)}})(c,d,{level:Xc[t],body:f,attributes:e({"log.source":"console."+t},g,p)})}}}catch(t){}finally{a&&(o=!1),i.apply(h.console,u)}})(i);return s.__rrweb_original__=(t=>{for(;null!=(e=t)&&e.__rrweb_original__;){var e;t=t.__rrweb_original__}return t})(a),s}))};for(var s of Object.keys(Xc))a(s);return()=>{r=void 0,i.forEach(t=>t())}},replayConsoleBuffer(t,r){var i=td(t);if(i)for(var n of r)try{var o=Kc(n.args,zc);null==i.captureBufferedConsoleLog||i.captureBufferedConsoleLog({level:Xc[n.level],body:o.body,attributes:e({"log.source":"console."+n.level,host:h.location.host},o.truncated?{body_truncated:"true"}:{},o.attributes)},n.context,n.occurredAtMs)}catch(t){}}},te("[Error tracking]");var ed=te("[ExceptionAutocapture]"),rd=new class{constructor(t,e,r){void 0===r&&(r=[]),this.coercers=t,this.stackParser=e,this.modifiers=r}buildFromUnknown(t,e){void 0===e&&(e={});var r=e&&e.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,e,0).apply(t),n=this.buildParsingContext(e),o=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var e=this;return i(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&V(r.stacktrace.frames)&&(r.stacktrace.frames=yield e.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var e;return{type:"Error",value:"Unknown error",stack:null==(e=t.syntheticException)?void 0:e.stack,synthetic:!0}}parseStacktrace(t,r){var i,n;return null!=t.cause&&(i=this.parseStacktrace(t.cause,r)),""!=t.stack&&null!=t.stack&&(n=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?r.skipFirstLines:0),r.chunkIdMap)),e({},t,{cause:i,stack:n})}applyChunkIds(t,e){return t.map(t=>(t.filename&&e&&(t.chunk_id=e[t.filename]),t))}applyCoercers(t,e){for(var r of this.coercers)if(r.match(t))return r.coerce(t,e);return this.coerceFallback(e)}applyModifiers(t){var e=this;return i(function*(){var r=t;for(var i of e.modifiers)r=yield i(r);return r})()}convertToExceptionList(t,r){var i,n,o,a={type:t.type,value:t.value,mechanism:{type:null!==(i=r.type)&&void 0!==i?i:"generic",handled:null===(n=r.handled)||void 0===n||n,synthetic:null!==(o=t.synthetic)&&void 0!==o&&o}};t.stack&&(a.stacktrace={type:"raw",frames:t.stack});var s=[a];return null!=t.cause&&s.push(...this.convertToExceptionList(t.cause,e({},r,{handled:!0}))),s}buildParsingContext(t){var e;return{chunkIdMap:At(this.stackParser),skipFirstLines:null!==(e=t.skipFirstLines)&&void 0!==e?e:1}}buildCoercingContext(t,r,i){void 0===i&&(i=0);var n=(e,i)=>{if(4>=i){var n=this.buildCoercingContext(t,r,i);return this.applyCoercers(e,n)}};return e({},r,{syntheticException:0==i?r.syntheticException:void 0,mechanism:t,apply:t=>n(t,i),next:t=>n(t,i+1)})}}([new class{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,e){var r=J(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?e.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var e=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?e+": "+t.message:e}isDOMException(t){return nt(t,"DOMException")}isDOMError(t){return nt(t,"DOMError")}},new class{match(t){return nt(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!at(t))return!1;try{var e=t.detail;return null!=e&&"object"==typeof e&&"reason"in e}catch(t){return!1}}coerce(t,e){var r,i=this.getUnhandledRejectionReason(t);return it(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}:e.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&null!=t.detail&&"object"==typeof t.detail&&"reason"in t.detail)return t.detail.reason}catch(t){}return t}},new class{match(t){return!!nt(t,"ErrorEvent")&&(null!=t.error||this.Ki(t))}coerce(t,r){var i;if(null!=t.error)return r.apply(t.error);var n=r.apply(t.message);return e({},n,{stack:null!==(i=this.Xi(t))&&void 0!==i?i:n.stack,synthetic:!0})}Ki(t){return J(t.message)&&t.message.length>0}Xi(t){var e,r,i=t,n=null!==(e=i.lineno)&&void 0!==e?e:0,o=null!==(r=i.colno)&&void 0!==r?r:0;if(J(i.filename)&&0!==i.filename.length&&0!==n)return"Error\n at "+i.filename+":"+n+":"+o}},new class{match(t){return ot(t)}coerce(t,e){var r,i=this.getStack(t),n=void 0===i;return{type:this.getType(t),value:this.getMessage(t,e),stack:null!=i?i:null==(r=e.syntheticException)?void 0:r.stack,cause:t.cause?e.next(t.cause):void 0,synthetic:n}}getType(t){return t.name||t.constructor.name}getMessage(t,e){var r=t.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}},new class{match(t){return at(t)}coerce(t,e){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+Ut(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}},new class{match(t){return"object"==typeof t&&null!==t}coerce(t,e){var r,i,n=this.getErrorPropertyFromObject(t);return n?e.apply(n):{type:this.getType(t),value:this.getValue(t),stack:null!==(r=this.getStack(t))&&void 0!==r?r:null==(i=e.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){if(at(t))return t.constructor.name;var e="name"in t?t.name:void 0;return J(e)&&!K(e)?e:"Error"}getValue(t){if("name"in t&&"string"==typeof t.name){var e="'"+t.name+"' captured as exception";return"message"in t&&"string"==typeof t.message&&(e+=" with message: '"+t.message+"'"),e}if("message"in t&&"string"==typeof t.message)return t.message;var r=this.getObjectClassName(t);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Ut(t)}isSeverityLevel(t){return J(t)&&!K(t)&&$t.indexOf(t)>=0}getStack(t){try{return J(t.stacktrace)&&t.stacktrace.length>0?t.stacktrace:J(t.stack)&&t.stack.length>0?t.stack:void 0}catch(t){return}}getErrorPropertyFromObject(t){for(var e in t)if({}.hasOwnProperty.call(t,e)){var r=t[e];if(ot(r))return r}}getObjectClassName(t){try{var e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch(t){return}}},new class{match(t){return"string"==typeof t}coerce(t,e){var r,i=this.getInfos(t),n=i[0],o=i[1];return{type:null!=n?n:"Error",value:null!=o?o:t,stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(t){var e="Error",r=t,i=t.match(Ht);return i&&(e=i[1],r=i[2]),[e,r]}},new class{match(t){return it(t)}coerce(t,e){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:null==(r=e.syntheticException)?void 0:r.stack,synthetic:!0}}}],function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;r>n;n++)i[n-1]=arguments[n];return function(r,n){void 0===n&&(n=0);for(var o=[],a=r.split("\n"),s=n;a.length>s;s++){var u=a[s];if(1024>=u.length){var l=Bt.test(u)?u.replace(Bt,"$1"):u;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,t);if(c){o.push(c);break}}if(o.length>=50)break}}}return function(t){if(!t.length)return[];var r=Array.from(t);return r.reverse(),r.slice(0,50).map(t=>{return e({},t,{filename:t.filename||(i=r,i[i.length-1]||{}).filename,function:t.function||"?"});var i})}(o)}}("web:javascript",Ft,jt)),id=(t,e)=>{try{return t()}catch(t){return e}},nd=(t,e)=>id(()=>t(e()),void 0),od=t=>id(()=>Z(t)&&Z(t.call),!1),ad=(t,e)=>id(()=>{t[e].__POSTHOG_INSTRUMENTED__=!0},void 0),sd=(t,e,r)=>{id(()=>{var r;null==(r=t[e])||delete r.__POSTHOG_INSTRUMENTED__},void 0),id(()=>{t[e]=r},void 0)},ud=t=>{var e=r;e||ed.info("window not available, cannot wrap onerror");var i=id(()=>e.onerror,void 0);return e.onerror=function(){for(var e,r=arguments.length,n=new Array(r),o=0;r>o;o++)n[o]=arguments[o];return nd(t,()=>rd.buildFromUnknown((t=>{var e=t[0],r=t[1],i=t[2],n=t[3],o=t[4];if(null!=o)return o;if(J(e)&&J(r)&&r.length>0&&"undefined"!=typeof ErrorEvent)try{return new ErrorEvent("error",{message:e,filename:r,lineno:i,colno:n})}catch(t){return e}return e})(n),{mechanism:{handled:!1}})),!!od(i)&&null!==(e=i(...n))&&void 0!==e&&e},ad(e,"onerror"),()=>sd(e,"onerror",i)},ld=function(t,e){void 0===e&&(e=!1);var i=r;i||ed.info("window not available, cannot wrap onUnhandledRejection");var n=id(()=>i.onunhandledrejection,void 0);return i.onunhandledrejection=function(r){var i;return nd(t,()=>rd.buildFromUnknown(r,{mechanism:{handled:!1}})),od(n)?null!==(i=n(r))&&void 0!==i&&i:e},ad(i,"onunhandledrejection"),()=>sd(i,"onunhandledrejection",n)},hd={wrapOnError:ud,wrapUnhandledRejection:ld,wrapConsoleError(t){var e=console;e||ed.info("console not available, cannot wrap console.error");var r=id(()=>e.error,void 0);return e.error=function(){for(var e=arguments.length,i=new Array(e),n=0;e>n;n++)i[n]=arguments[n];nd(t,()=>{var t;t=1==i.length?i[0]:i.join(" ");var e=i.find(t=>t instanceof Error);return rd.buildFromUnknown(e||t,{mechanism:{handled:!1},syntheticException:new Error("PostHog syntheticException"),skipFirstLines:2})}),od(r)&&r(...i)},ad(e,"error"),()=>sd(e,"error",r)}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.errorWrappingFunctions=hd,h.posthogErrorWrappingFunctions=hd;var cd=(t,e)=>{if(Z(null==t?void 0:t.capture)){var r=null==e?void 0:e.autocaptureExceptions,i=!X(r)&&"object"==typeof r&&V(r.errors_to_ignore)?r.errors_to_ignore.reduce((t,e)=>{try{t.push(new RegExp(e))}catch(t){ed.error("Ignoring invalid legacy exception exclusion rule",e,t)}return t},[]):[],n=e=>{try{null==t.capture||t.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0})}catch(t){ed.error("Failed to capture exception for a legacy client",t)}};ud(t=>{i.some(e=>t.$exception_list.some(t=>e.test(t.value||"")))||n(t)}),ld(n,!0)}};h.extendPostHogWithExceptionAutoCapture=cd,h.extendPostHogWithExceptionAutocapture=cd;var dd="X-POSTHOG-SESSION-ID",vd="X-POSTHOG-WINDOW-ID",fd="X-POSTHOG-DISTINCT-ID",pd=[dd,vd,fd],gd=["attributionReporting","body","browsingTopics","cache","credentials","dispatcher","duplex","integrity","keepalive","method","mode","priority","redirect","referrer","referrerPolicy","signal","window"],md=(t,e)=>({}.hasOwnProperty.call(t,e)),yd=t=>"object"==typeof t&&!X(t)||Z(t),bd=t=>"undefined"!=typeof Request&&(t instanceof Request||"[object Request]"==={}.toString.call(t)),wd=t=>{try{var e;return bd(t)?t.url:new URL(t instanceof URL?t.toString():String(t),null==r||null==(e=r.location)?void 0:e.href).toString()}catch(t){return}},kd=(t,e,r,i,n)=>{var o;try{o=new URL(i).hostname}catch(t){return!1}if(!t)return!1;if(V(t)&&!t.includes(o))return!1;var a=!1;if(r){var s=r.checkAndGetSessionAndWindowId(!0),u=s.windowId;n.set(dd,s.sessionId),n.set(vd,u),a=!0}var l=(t=>Z(t)?t():t)(e);return l&&"$posthog_cookieless"!==l&&(n.set(fd,l),a=!0),a};h.__PosthogExtensions__=h.__PosthogExtensions__||{};var _d={_patchFetch:(t,i,n)=>Xs(r,"fetch",r=>function(o,a){var s=arguments.length>1?[o,a]:[o],u=s;try{var l=wd(o);if(l)if(bd(o)){var h=new Request(o,a);kd(t,i,n,h.url,h.headers),u=[h]}else{var c=new Headers(yd(a)?a.headers:void 0);if(kd(t,i,n,l,c)){var d=((t,r)=>{if(Q(t)||X(t))return{headers:r};if(yd(t)){var i=t;if("undefined"==typeof Proxy||"undefined"==typeof Reflect){var n=Object.create(i);return Object.defineProperty(n,"headers",{configurable:!0,enumerable:!0,value:r,writable:!0}),n}return new Proxy({headers:r},{get:(t,e)=>md(t,e)?Reflect.get(t,e):Reflect.get(i,e,i),has:(t,e)=>md(t,e)||e in i,ownKeys(t){var e=new Set(Reflect.ownKeys(t));return Reflect.ownKeys(i).forEach(t=>e.add(t)),gd.forEach(t=>{t in i&&e.add(t)}),Array.from(e)},getOwnPropertyDescriptor(t,r){var n=Reflect.getOwnPropertyDescriptor(t,r);if(n)return n;if("string"==typeof r&&gd.includes(r)&&r in i)return{configurable:!0,enumerable:!0,get(){return Reflect.get(i,r,i)}};var o=Reflect.getOwnPropertyDescriptor(i,r);return o?e({},o,{configurable:!0}):void 0},getPrototypeOf:()=>Object.getPrototypeOf(i)})}})(a,c);d&&(u=[o,d])}}}catch(t){u=s}return r.apply(this,u)}),_patchXHR:(t,e,i)=>Xs(r.XMLHttpRequest.prototype,"open",r=>function(n,o,a,s,u){void 0===a&&(a=!0);var l=this,h=new Headers,c=wd(o);c&&kd(t,e,i,c,h);var d=r.call(l,n,o,a,s,u);return pd.forEach(t=>{var e=h.get(t);if(e)try{l.setRequestHeader(t,e)}catch(t){}}),d})};h.__PosthogExtensions__.tracingHeadersPatchFns=_d,h.postHogTracingHeadersPatchFns=_d,"function"!=typeof[].at&&Object.defineProperty(Array.prototype,"at",{value(t){var e=this.length,r=Math.trunc(t)||0;return 0>r&&(r+=e),0>r||r>=e?void 0:this[r]},writable:!0,enumerable:!1,configurable:!0}),"function"!=typeof[].findLast&&Object.defineProperty(Array.prototype,"findLast",{value(t,e){for(var r=this.length-1;r>=0;r--){var i=this[r];if(t.call(e,i,r,this))return i}},writable:!0,enumerable:!1,configurable:!0});var Sd=class{constructor(){this.t=void 0,this.o=0,this.i=[]}l(t){var e;if(!t.hadRecentInput){var r=this.i[0],i=this.i.at(-1);this.o&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),null==(e=this.t)||e.call(this,t)}}},xd=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Cd=t=>{if("loading"===document.readyState)return"loading";var e=xd();if(e){if(e.domInteractive>t)return"loading";if(0===e.domContentLoadedEventStart||e.domContentLoadedEventStart>t)return"dom-interactive";if(0===e.domComplete||e.domComplete>t)return"dom-content-loaded"}return"complete"},Md=t=>{var e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,"")},Td=t=>{var e="";try{for(;9!==(null==(r=t)?void 0:r.nodeType);){var r,i,n=t,o=n.id?"#"+n.id:[Md(n),...Array.from(null!==(i=n.classList)&&void 0!==i?i:[]).sort()].join(".");if(e.length+o.length>99)return e||o;if(e=e?o+">"+e:o,n.id)break;t=n.parentNode}}catch(t){}return e},Id=new WeakMap;function Rd(t,e){var r=Id.get(e);return r||Id.set(e,r=new WeakMap),r.get(t)||r.set(t,new e),r.get(t)}var Ad,Ed=-1,Ld=()=>Ed,Od=t=>{addEventListener("pageshow",e=>{e.persisted&&(Ed=e.timeStamp,t(e))},!0)},Dd=(t,e,r,i)=>{var n,o;return a=>{e.value>=0&&(a||i)&&((o=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},Pd=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},Fd=()=>{var t,e;return null!==(t=null==(e=xd())?void 0:e.activationStart)&&void 0!==t?t:0},Nd=-1,qd=new Set,jd=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Bd=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of qd)e();isFinite(Nd)||(Nd="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",Bd,!0))}},Hd=function(t){if(void 0===t&&(t=!1),t&&(Nd=1/0),0>Nd){var e,r,i=Fd();Nd=null!==(e=document.prerendering||null==(r=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=i))?void 0:r.startTime)&&void 0!==e?e:jd(),addEventListener("visibilitychange",Bd,!0),addEventListener("prerenderingchange",Bd,!0),Od(()=>{setTimeout(()=>{Nd=jd()})})}return{get firstHiddenTime(){return Nd},onHidden(t){qd.add(t)}}},$d=function(t,e,r,i,n,o,a){void 0===e&&(e=-1),void 0===i&&(i=0);var s=xd(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>Ld()?s&&(document.prerendering||Fd()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:o||(null==s?void 0:s.name),navigationStartTime:a||0}},Ud=function(t,r,i){void 0===i&&(i={});try{var n=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(n.length>0){var o=new PerformanceObserver(t=>{queueMicrotask(()=>{var e=t.getEntries();n.length>1&&e.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),r(e)})});for(var a of n)o.observe(e({type:a,buffered:!0},i));return o}}catch(t){}},zd=t=>{var e,r;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(r=globalThis.PerformanceSoftNavigation)||null==(r=r.prototype)?void 0:r.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Wd=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Vd=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Zd=class{constructor(){this.u=void 0}},Gd=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Qd=[1800,3e3],Jd=function(t,e){void 0===e&&(e={});var r=zd(e);Gd(()=>{var i,n=Rd(e,Zd),o=Hd(),a=$d("FCP"),s=Ud(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),o.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-Fd(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,i(!0)))});s&&(i=Dd(t,a,Qd,e.reportAllChanges),Od(r=>{a=$d("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ld()),i=Dd(t,a,Qd,e.reportAllChanges),Pd(()=>{a.value=performance.now()-r.timeStamp,i(!0)})})),r&&Ud(["soft-navigation"],r=>{r.forEach(r=>{n.u&&r.navigationId&&Wd(n.u,r),a=$d("FCP",Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0),"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=Dd(t,a,Qd,e.reportAllChanges))(!0)})},e)})},Kd=[.1,.25],Xd=t=>t.find(t=>{var e;return 1===(null==(e=t.node)?void 0:e.nodeType)})||t[0],Yd=function(t,e){void 0===e&&(e={});var r=Rd(e=Object.assign({},e),Sd),i=new WeakMap;r.t=t=>{var r;if(null!=t&&null!=(r=t.sources)&&r.length){var n=Xd(t.sources),o=null==n?void 0:n.node;if(o){var a,s=null!==(a=null==e.generateTarget?void 0:e.generateTarget(o))&&void 0!==a?a:Td(o);i.set(n,s)}}},function(t,e){void 0===e&&(e={});var r=Hd();Jd(Vd(()=>{var i,n=$d("CLS",0),o=Rd(e,Sd),a=(r,a,s,u,l)=>{n=$d("CLS",0,r,a,s,u,l),o.o=0,i=Dd(t,n,Kd,e.reportAllChanges)},s=function(t){void 0===t&&(t=!1),o.o>n.value&&(n.value=o.o,n.entries=o.i),i(t)},u=t=>{s(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},l=t=>{for(var e of t)"soft-navigation"!==e.entryType?o.l(e):u(e);s()},h=["layout-shift"];zd(e)&&h.push("soft-navigation");var c=Ud(h,l);c&&(i=Dd(t,n,Kd,e.reportAllChanges),r.onHidden(()=>{l(c.takeRecords()),i(!0)}),Od(()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,Ld()),Pd(i)}),setTimeout(i))}))}(e=>{t((t=>{var e={};if(t.entries.length){var r,n=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(null!=n&&null!=(r=n.sources)&&r.length){var o=Xd(n.sources);o&&(e={largestShiftTarget:i.get(o),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:o,largestShiftEntry:n,loadState:Cd(n.startTime)})}}return Object.assign(t,{attribution:e})})(e))},e)},tv=function(t,e){void 0===e&&(e={});var r=Rd(e=Object.assign({},e),Zd);zd(e)&&(r.u=new Map),Jd(e=>{t((t=>{var e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:Cd(Ld())};if("soft-navigation"!==t.navigationType){if(t.entries.length){var i=xd(),n=t.entries.at(-1);if(i){var o=Math.max(0,i.responseStart-(i.activationStart||0));e={timeToFirstByte:o,firstByteToFCP:t.value-o,loadState:Cd(t.entries[0].startTime),navigationEntry:i,fcpEntry:n}}}}else{var a,s=null==(a=r.u)?void 0:a.get(t.navigationId);s&&(e={timeToFirstByte:0,firstByteToFCP:t.value,loadState:"complete",navigationEntry:s})}return Object.assign(t,{attribution:e})})(e))},e)},ev=0,rv=1/0,iv=0,nv=t=>{for(var e of t)e.interactionId&&(rv=Math.min(rv,e.interactionId),iv=Math.max(iv,e.interactionId),ev=iv?(iv-rv)/7+1:0)},ov=()=>{var t;return Ad?ev:null!==(t=performance.interactionCount)&&void 0!==t?t:0},av=class{constructor(){this.h=0,this.v=[],this.p=new Map,this.m=void 0,this.M=void 0}T(){return ov()-this.h}D(){this.h=ov(),this.v.length=0,this.p.clear()}S(t){var e=this.T(),r=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[r]:{k:8,id:-1,entries:[]}}l(t){var e;if(null!=(e=this.m)&&e.call(this,t),t.interactionId){var r=this.v.at(-1),i=this.p.get(t.interactionId);if(i||10>this.v.length||t.duration>r.k){var n;if(i?t.duration>i.k?(i.entries=[t],i.k=t.duration):t.duration===i.k&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.p.set((i={id:t.interactionId,entries:[t],k:t.duration}).id,i),this.v.push(i)),this.v.sort((t,e)=>e.k-t.k),this.v.length>10)for(var o of this.v.splice(10))this.p.delete(o.id);null==(n=this.M)||n.call(this,i)}}}},sv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Vd(t),o=-1,a=()=>{i(o),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),o=r(()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()},{timeout:e})}},uv=[200,500],lv=function(t,r){void 0===r&&(r={});var i=Rd(r=Object.assign({},r),av),n=[],o=[],a=0,s=new WeakMap,u=new WeakMap,l=!1,h=()=>{l||(sv(c),l=!0)},c=()=>{var t=new Set(i.v.map(t=>s.get(t.entries[0]))),e=o.length-10;o=o.filter((r,i)=>i>=e||t.has(r));var r=new Set;for(var u of o)for(var h of d(u.startTime,u.processingEnd))r.add(h);n=n.filter(t=>t.startTime>a||r.has(t)),l=!1};i.m=t=>{var e,i=t.startTime+t.duration;a=Math.max(a,t.processingEnd);for(var n=o.length-1;n>=0;n--){var u=o[n];if(8>=Math.abs(i-u.renderTime)){(e=u).startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd),r.includeProcessedEventEntries&&e.entries.push(t);break}}e||o.push(e={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:i,entries:r.includeProcessedEventEntries?[t]:[]}),t.interactionId&&s.set(t,e),h()},i.M=t=>{if(!u.get(t)){var e,i=null==(e=t.entries.find(t=>t.target))?void 0:e.target;if(i){var n,o=null!==(n=null==r.generateTarget?void 0:r.generateTarget(i))&&void 0!==n?n:Td(i);u.set(t,o)}else{var a,s=null==(a=t.entries.find(t=>t.targetSelector))?void 0:a.targetSelector;s&&u.set(t,s)}}};var d=(t,e)=>{var r=[];for(var i of n)if(i.startTime+i.duration>=t){if(i.startTime>e)break;r.push(i)}return r};Ud(["long-animation-frame"],t=>{n=n.concat(t),h()},r),function(t,r){if(void 0===r&&(r={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Hd();Gd(()=>{var n;"interactionCount"in performance||Ad||(Ad=Ud(["event"],nv,{durationThreshold:0}));var o,a=$d("INP"),s=Rd(r,av),u=(e,i,n,u,l)=>{s.D(),a=$d("INP",-1,e,i,n,u,l),o=Dd(t,a,uv,r.reportAllChanges)},l=()=>{var t=s.S(a.navigationType);t&&t.k!==a.value&&(a.value=t.k,a.entries=t.entries,o())},h=t=>{l(),o(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=function(t,e){void 0===e&&(e=!1),sv(()=>{for(var r of t)"soft-navigation"!==r.entryType?s.l(r):h(r);l(),e&&o(!0)})},d=["event","first-input"];zd(r)&&d.push("soft-navigation");var v=Ud(d,c,e({},r,{durationThreshold:null!==(n=r.durationThreshold)&&void 0!==n?n:40}));o=Dd(t,a,uv,r.reportAllChanges),v&&(i.onHidden(()=>{c(v.takeRecords(),!0)}),Od(()=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ld())}))})}}(e=>{t((t=>{if(0===t.entries.length){var e={processedEventEntries:[],longAnimationFrameEntries:[],inputDelay:0,processingDuration:0,presentationDelay:t.value,loadState:Cd(t.navigationStartTime||0)};return Object.assign(t,{attribution:e})}var r=t.entries[0],n=s.get(r),o=Math.max(n.processingStart,r.startTime),a=Math.max(r.startTime+r.duration,o),l=Math.min(n.processingEnd,a),h=n.entries.sort((t,e)=>t.processingStart-e.processingStart),c=d(r.startTime,l),v=i.p.get(r.interactionId),f={interactionTarget:u.get(v),interactionType:r.name.startsWith("key")?"keyboard":"pointer",interactionTime:r.startTime,nextPaintTime:a,processedEventEntries:h,longAnimationFrameEntries:c,inputDelay:o-r.startTime,processingDuration:l-o,presentationDelay:a-l,loadState:Cd(r.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return((t,e)=>{var r=t.interactionTime,i=t.nextPaintTime;if(null!=(e=t.longAnimationFrameEntries)&&e.length&&r&&i){var n,o,a=t.inputDelay,s=t.processingDuration,u=0,l=0,h=0,c=0;for(var d of t.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&&(o=r+a>v.startTime?"input-delay":r+a+s>v.startTime?"processing-duration":"presentation-delay",n=v,c=p)}}var m=t.longAnimationFrameEntries.at(-1),y=m?m.startTime+m.duration:0;y>=r+a+s&&(h=i-y),n&&o&&(t.longestScript={entry:n,subpart:o,intersectingDuration:c}),t.totalScriptDuration=u,t.totalStyleAndLayoutDuration=l,t.totalPaintDuration=h,t.totalUnattributedDuration=i-r-u-l-h}})(f),Object.assign(t,{attribution:f})})(e))},r)},hv=class{constructor(){this.m=void 0,this.u=void 0}l(t){var e;null==(e=this.m)||e.call(this,t)}},$=[2500,4e3],cv=50,dv=[];Ud(["resource"],t=>{for(var e of t)dv.push(e),dv.length>cv&&dv.shift()});var vv=function(t,r){void 0===r&&(r={}),null!=(r=Object.assign({},r)).resourceBufferSize&&(cv=r.resourceBufferSize);var i=Rd(r,hv),n=new WeakMap;zd(r)&&(i.u=new Map),i.m=t=>{var e=t.element;if(e){var i,o=null!==(i=null==r.generateTarget?void 0:r.generateTarget(e))&&void 0!==i?i:Td(e);n.set(t,o)}else t.id&&n.set(t,"#"+t.id)},function(t,e){void 0===e&&(e={});var r=!1,i=zd(e);Gd(()=>{var n,o=Hd(),a=$d("LCP"),s=Rd(e,hv),u=(i,s,u,l,h)=>{a=$d("LCP",-1,i,s,u,l,h),n=Dd(t,a,$,e.reportAllChanges),r=!1,"soft-navigation"===i&&(o=Hd(!0))},l=t=>{s.u&&t.navigationId&&Wd(s.u,t),r||n(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))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-Fd(),0),s.l(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!a.navigationId)continue;if("interactionId"in v&&v.interactionId!=a.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])}o.firstHiddenTime>c&&(a.value=u,a.entries=h,n())}else l(r)},c=["largest-contentful-paint"];i&&c.push("interaction-contentful-paint","soft-navigation");var d=Ud(c,h);if(d){n=Dd(t,a,$,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=a.id;sv(()=>{if(!r){if(!i)for(var t of(d.disconnect(),v))removeEventListener(t,f,{capture:!0});e===a.id&&(r=!0,n(!0))}})}};for(var p of v)addEventListener(p,f,{capture:!0});Od(i=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,Ld()),n=Dd(t,a,$,e.reportAllChanges),Pd(()=>{a.value=performance.now()-i.timeStamp,r=!0,n(!0)})})}})}(r=>{t((t=>{var r={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){var o,a,s,u,l,h,c=t.entries.at(-1),d=c.url&&(dv.findLast(t=>t.name===c.url)||performance.getEntriesByType("resource").findLast(t=>t.name===c.url));r.target=n.get(c),r.lcpEntry=c,c.url&&(r.url=c.url),d&&(r.lcpResourceEntry=d);var v=0,f=0;if("soft-navigation"!==t.navigationType?(v=null!==(o=null==(a=h=xd())?void 0:a.activationStart)&&void 0!==o?o:0,f=null!==(s=null==(u=h)?void 0:u.responseStart)&&void 0!==s?s:0):(v=t.navigationStartTime||0,h=null==(l=i.u)?void 0:l.get(t.navigationId)),h){var p=Math.max(0,f-v),g=Math.max(p,d?(d.requestStart||d.startTime)-v:0),m=Math.min(t.value,Math.max(g,d?d.responseEnd-v:0));r=e({},r,{timeToFirstByte:p,resourceLoadDelay:g-p,resourceLoadDuration:m-g,elementRenderDelay:t.value-m,navigationEntry:h})}}return Object.assign(t,{attribution:r})})(r))},r)},fv=-1,pv=()=>fv,gv=t=>{addEventListener("pageshow",e=>{e.persisted&&(fv=e.timeStamp,t(e))},!0)},mv=(t,e,r,i)=>{var n,o;return a=>{e.value>=0&&(a||i)&&((o=e.value-(null!=n?n:0))||void 0===n)&&(n=e.value,e.delta=o,e.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(e.value,r),t(e))}},yv=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},bv=()=>{var t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},wv=()=>{var t,e;return null!==(t=null==(e=bv())?void 0:e.activationStart)&&void 0!==t?t:0},kv=-1,_v=new Set,Sv=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,xv=t=>{if("hidden"===document.visibilityState){if("visibilitychange"===t.type)for(var e of _v)e();isFinite(kv)||(kv="visibilitychange"===t.type?t.timeStamp:0,removeEventListener("prerenderingchange",xv,!0))}},Cv=function(t){if(void 0===t&&(t=!1),t&&(kv=1/0),0>kv){var e,r,i=wv();kv=null!==(e=document.prerendering||null==(r=globalThis.performance.getEntriesByType("visibility-state").find(t=>"hidden"===t.name&&t.startTime>=i))?void 0:r.startTime)&&void 0!==e?e:Sv(),addEventListener("visibilitychange",xv,!0),addEventListener("prerenderingchange",xv,!0),gv(()=>{setTimeout(()=>{kv=Sv()})})}return{get firstHiddenTime(){return kv},onHidden(t){_v.add(t)}}},Mv=function(t,e,r,i,n,o,a){void 0===e&&(e=-1),void 0===i&&(i=0);var s=bv(),u=(null==s?void 0:s.navigationId)||0,l="navigate";return r?l=r:0>pv()?s&&(document.prerendering||wv()>0?l="prerender":document.wasDiscarded?l="restore":s.type&&(l=s.type.replace(/_/g,"-"))):l="back-forward-cache",{name:t,value:e,rating:"good",delta:0,entries:[],id:"v6-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12),navigationType:l,navigationId:i||u,navigationInteractionId:n,navigationURL:o||(null==s?void 0:s.name),navigationStartTime:a||0}},Tv=new WeakMap;function Iv(t,e){var r=Tv.get(e);return r||Tv.set(e,r=new WeakMap),r.get(t)||r.set(t,new e),r.get(t)}var Rv,Av=class{constructor(){this.t=void 0,this.i=0,this.o=[]}h(t){var e;if(!t.hadRecentInput){var r=this.o[0],i=this.o.at(-1);this.i&&r&&i&&1e3>t.startTime-i.startTime&&5e3>t.startTime-r.startTime?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),null==(e=this.t)||e.call(this,t)}}},Ev=function(t,r,i){void 0===i&&(i={});try{var n=t.filter(t=>PerformanceObserver.supportedEntryTypes.includes(t));if(n.length>0){var o=new PerformanceObserver(t=>{queueMicrotask(()=>{var e=t.getEntries();n.length>1&&e.sort((t,e)=>t.startTime+t.duration-(e.startTime+e.duration)),r(e)})});for(var a of n)o.observe(e({type:a,buffered:!0},i));return o}}catch(t){}},Lv=t=>{var e,r;return(null==(e=globalThis.PerformanceObserver)||null==(e=e.supportedEntryTypes)?void 0:e.includes("soft-navigation"))&&"function"==typeof(null==(r=globalThis.PerformanceSoftNavigation)||null==(r=r.prototype)?void 0:r.getLargestInteractionContentfulPaint)&&t&&t.reportSoftNavs},Ov=(t,e)=>{if(t.set(e.navigationId,e),t.size>2){var r=t.keys().next().value;void 0!==r&&t.delete(r)}},Dv=t=>{var e=!1;return()=>{e||(t(),e=!0)}},Pv=class{constructor(){this.l=void 0}},Fv=t=>{document.prerendering?addEventListener("prerenderingchange",t,!0):t()},Nv=[1800,3e3],qv=function(t,e){void 0===e&&(e={});var r=Lv(e);Fv(()=>{var i,n=Iv(e,Pv),o=Cv(),a=Mv("FCP"),s=Ev(["paint"],t=>{for(var e of t)"first-contentful-paint"===e.name&&(s.disconnect(),o.firstHiddenTime>e.startTime&&(a.value=Math.max(e.startTime-wv(),0),a.entries.push(e),a.navigationId=e.navigationId||a.navigationId,i(!0)))});s&&(i=mv(t,a,Nv,e.reportAllChanges),gv(r=>{a=Mv("FCP",-1,"back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,pv()),i=mv(t,a,Nv,e.reportAllChanges),yv(()=>{a.value=performance.now()-r.timeStamp,i(!0)})})),r&&Ev(["soft-navigation"],r=>{r.forEach(r=>{n.l&&r.navigationId&&Ov(n.l,r),a=Mv("FCP",Math.max((r.presentationTime||r.paintTime||0)-r.startTime,0),"soft-navigation",r.navigationId,r.interactionId,r.name,r.startTime),(i=mv(t,a,Nv,e.reportAllChanges))(!0)})},e)})},jv=[.1,.25],Bv=function(t,e){void 0===e&&(e={});var r=Cv();qv(Dv(()=>{var i,n=Mv("CLS",0),o=Iv(e,Av),a=(r,a,s,u,l)=>{n=Mv("CLS",0,r,a,s,u,l),o.i=0,i=mv(t,n,jv,e.reportAllChanges)},s=function(t){void 0===t&&(t=!1),o.i>n.value&&(n.value=o.i,n.entries=o.o),i(t)},u=t=>{s(!0),a("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},l=t=>{for(var e of t)"soft-navigation"!==e.entryType?o.h(e):u(e);s()},h=["layout-shift"];Lv(e)&&h.push("soft-navigation");var c=Ev(h,l);c&&(i=mv(t,n,jv,e.reportAllChanges),r.onHidden(()=>{l(c.takeRecords()),i(!0)}),gv(()=>{a("back-forward-cache",n.navigationId,n.navigationInteractionId,n.navigationURL,pv()),yv(i)}),setTimeout(i))}))},Hv=0,$v=1/0,Uv=0,zv=t=>{for(var e of t)e.interactionId&&($v=Math.min($v,e.interactionId),Uv=Math.max(Uv,e.interactionId),Hv=Uv?(Uv-$v)/7+1:0)},Wv=()=>{var t;return Rv?Hv:null!==(t=performance.interactionCount)&&void 0!==t?t:0},Vv=class{constructor(){this.u=0,this.v=[],this.m=new Map,this.p=void 0,this.T=void 0}_(){return Wv()-this.u}M(){this.u=Wv(),this.v.length=0,this.m.clear()}L(t){var e=this._(),r=Math.min(this.v.length-1,Math.floor(e/50));return!e||-1!==r||"soft-navigation"!==t&&"back-forward-cache"!==t?this.v[r]:{P:8,id:-1,entries:[]}}h(t){var e;if(null!=(e=this.p)&&e.call(this,t),t.interactionId){var r=this.v.at(-1),i=this.m.get(t.interactionId);if(i||10>this.v.length||t.duration>r.P){var n;if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(this.m.set((i={id:t.interactionId,entries:[t],P:t.duration}).id,i),this.v.push(i)),this.v.sort((t,e)=>e.P-t.P),this.v.length>10)for(var o of this.v.splice(10))this.m.delete(o.id);null==(n=this.T)||n.call(this,i)}}}},Zv=t=>{var e="requestIdleCallback"in globalThis?1e3:0,r=globalThis.requestIdleCallback||setTimeout,i=globalThis.cancelIdleCallback||clearTimeout;if("hidden"===document.visibilityState)t();else{var n=Dv(t),o=-1,a=()=>{i(o),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),o=r(()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()},{timeout:e})}},Gv=[200,500],Qv=function(t,r){if(void 0===r&&(r={}),globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype){var i=Cv();Fv(()=>{var n;"interactionCount"in performance||Rv||(Rv=Ev(["event"],zv,{durationThreshold:0}));var o,a=Mv("INP"),s=Iv(r,Vv),u=(e,i,n,u,l)=>{s.M(),a=Mv("INP",-1,e,i,n,u,l),o=mv(t,a,Gv,r.reportAllChanges)},l=()=>{var t=s.L(a.navigationType);t&&t.P!==a.value&&(a.value=t.P,a.entries=t.entries,o())},h=t=>{l(),o(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime)},c=function(t,e){void 0===e&&(e=!1),Zv(()=>{for(var r of t)"soft-navigation"!==r.entryType?s.h(r):h(r);l(),e&&o(!0)})},d=["event","first-input"];Lv(r)&&d.push("soft-navigation");var v=Ev(d,c,e({},r,{durationThreshold:null!==(n=r.durationThreshold)&&void 0!==n?n:40}));o=mv(t,a,Gv,r.reportAllChanges),v&&(i.onHidden(()=>{c(v.takeRecords(),!0)}),gv(()=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,pv())}))})}},Jv=class{constructor(){this.p=void 0,this.l=void 0}h(t){var e;null==(e=this.p)||e.call(this,t)}},Kv=[2500,4e3],Xv=function(t,e){void 0===e&&(e={});var r=!1,i=Lv(e);Fv(()=>{var n,o=Cv(),a=Mv("LCP"),s=Iv(e,Jv),u=(i,s,u,l,h)=>{a=Mv("LCP",-1,i,s,u,l,h),n=mv(t,a,Kv,e.reportAllChanges),r=!1,"soft-navigation"===i&&(o=Cv(!0))},l=t=>{s.l&&t.navigationId&&Ov(s.l,t),r||n(!0),u("soft-navigation",t.navigationId,t.interactionId,t.name,t.startTime);var e=null==t.getLargestInteractionContentfulPaint?void 0:t.getLargestInteractionContentfulPaint();e&&h([e])},h=t=>{for(var r of(e.reportAllChanges||i||(t=t.slice(-1)),t))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-wv(),0),s.h(r),h=[r];else if("interaction-contentful-paint"===r.entryType){var d,v=r;if(!a.navigationId)continue;if("interactionId"in v&&v.interactionId!=a.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])}o.firstHiddenTime>c&&(a.value=u,a.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=mv(t,a,Kv,e.reportAllChanges);var v=["keydown","click","visibilitychange"],f=t=>{if(t.isTrusted&&!r){var e=a.id;Zv(()=>{if(!r){if(!i)for(var t of(d.disconnect(),v))removeEventListener(t,f,{capture:!0});e===a.id&&(r=!0,n(!0))}})}};for(var p of v)addEventListener(p,f,{capture:!0});gv(i=>{u("back-forward-cache",a.navigationId,a.navigationInteractionId,a.navigationURL,pv()),n=mv(t,a,Kv,e.reportAllChanges),yv(()=>{a.value=performance.now()-i.timeStamp,r=!0,n(!0)})})}})},Yv={onLCP:vv,onCLS:Yd,onFCP:tv,onINP:lv,withoutAttribution:{onLCP:Xv,onCLS:Bv,onFCP:qv,onINP:Qv}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution-soft-navs"]=Yv,h.__PosthogExtensions__.postHogWebVitalsCallbacks=Yv,h.postHogWebVitalsCallbacks=Yv;var tf={onLCP:Xv,onCLS:Bv,onFCP:qv,onINP:Qv};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-soft-navs"]=tf,h.__PosthogExtensions__.postHogWebVitalsCallbacks=tf,h.postHogWebVitalsCallbacks=tf,h.__PosthogExtensions__.loadWebVitalsCallbacks=()=>tf;var ef={onLCP:vv,onCLS:Yd,onFCP:tv,onINP:lv,withoutAttribution:{onLCP:Xv,onCLS:Bv,onFCP:qv,onINP:Qv}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals-with-attribution"]=ef,h.__PosthogExtensions__.postHogWebVitalsCallbacks=ef,h.postHogWebVitalsCallbacks=ef;var rf={onLCP:Xv,onCLS:Bv,onFCP:qv,onINP:Qv};function nf(t,e){return e.length>t?e.slice(0,t)+"...":e}function of(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do{e=e.previousSibling}while(e&&!ue(e));return e}function af(t,i){var n,o,a=i.e,s=i.maskAllElementAttributes,u=i.maskAllText,l=i.elementAttributeIgnoreList,h=i.elementsChainAsString,c=i.disableCaptureUrlHashes;if(!ue(t))return{props:{}};for(var d=[t],v=new Set([t]),f=t;f.parentNode&&!le(f,"body")&&1e3>d.length;)if(he(f.parentNode)){var p=f.parentNode.host;if(v.has(p))break;v.add(p),d.push(p),f=p}else{if(!ue(f.parentNode))break;if(v.has(f.parentNode))break;v.add(f.parentNode),d.push(f.parentNode),f=f.parentNode}var g="click"===a.type&&"http://www.w3.org/2000/svg"===t.namespaceURI?d.findIndex(t=>le(t,"button")||le(t,"a")):-1;g>0&&(u=u||d.slice(0,g+1).some(t=>!be(t)||we(t)));var m,y,b,w=[],k={},_=!1,S=!1;if(ee(d,t=>{var e=be(t);if(le(t,"a")){var r=t.getAttribute("href");_=!!(e&&r&&Ie(r))&&(c?Rt(r):r)}q(de(t),"ph-no-capture")&&(S=!0),w.push(function(t,e,r,i,n){void 0===n&&(n=!1);var o=t.tagName.toLowerCase(),a={tag_name:o};fe.indexOf(o)>-1&&!r&&(a.$el_text="a"===o.toLowerCase()||"button"===o.toLowerCase()?nf(1024,Re(t)):nf(1024,ve(t)));var s=de(t);s.length>0&&(a.classes=s.filter(function(t){return""!==t})),ee(t.attributes,function(r){var o;if((!we(t)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==i||!i.includes(r.name))&&!e&&Ie(r.value)&&(!J(o=r.name)||"_ngcontent"!==o.substring(0,10)&&"_nghost"!==o.substring(0,7))){var s=r.value;"class"===r.name&&(s=ce(s).join(" ")),a["attr__"+r.name]=nf(1024,"href"===r.name&&n?Rt(s):s)}});for(var u=1,l=1,h=t;h=of(h);)u++,h.tagName===t.tagName&&l++;return a.nth_child=u,a.nth_of_type=l,a}(t,s,u,l,c)),ee(function(t){if(!be(t))return{};var e={};return ee(t.attributes,function(t){if(t.name&&0===t.name.indexOf("data-ph-capture-attribute")){var r=t.name.replace("data-ph-capture-attribute-",""),i=t.value;r&&i&&Ie(i)&&(e[r]=i)}}),e}(t),(t,e)=>{({}).hasOwnProperty.call(k,e)||(k[e]=t)})}),S)return{props:{},explicitNoCapture:S};if(g>0&&(t=d[g],w.splice(0,g)),u||(w[0].$el_text=le(t,"a")||le(t,"button")?Re(t):ve(t)),_){var x,C;w[0].attr__href=_;var M=null==(x=ae(_))?void 0:x.host,T=null==r||null==(C=r.location)?void 0:C.host;M&&T&&M!==T&&(m=_)}return{props:re((y=a.type,{$event_type:y,$ce_version:1}),h?{}:{$elements:w},{$elements_chain:(b=w,V(b)?function(t){return t.map(t=>{var r,i,n="";if(t.tag_name&&(n+=t.tag_name),t.attr_class)for(var o of(t.attr_class.sort(),t.attr_class))n+="."+o.replace(/"/g,"");var a=e({},t.text?{text:t.text}:{},{"nth-child":null!==(r=t.nth_child)&&void 0!==r?r:0,"nth-of-type":null!==(i=t.nth_of_type)&&void 0!==i?i:0},t.href?{href:t.href}:{},t.attr_id?{attr_id:t.attr_id}:{},t.attributes),s={};return ie(a).sort((t,e)=>function(t,e){return e>t?-1:t>e?1:0}(t[0],e[0])).forEach(t=>{var e=t[1];return s[Ee(t[0].toString())]=Ee(e.toString())}),(n+=":")+ie(s).map(t=>t[0]+'="'+t[1]+'"').join("")}).join(";")}(function(t){return t.map(t=>{var e,r,i={text:null==(e=t.$el_text)?void 0:e.slice(0,400),tag_name:t.tag_name,href:null==(r=t.attr__href)?void 0:r.slice(0,2048),attr_class:Le(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return ie(t).filter(t=>0===t[0].indexOf("attr__")).forEach(t=>i.attributes[t[0]]=t[1]),i})}(b)):"")},null!=(n=w[0])&&n.$el_text?{$el_text:null==(o=w[0])?void 0:o.$el_text}:{},m&&"click"===a.type?{$external_click_url:m}:{},k),target:t}}h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor=h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor||{},h.__PosthogExtensions__.postHogWebVitalsCallbacksByFlavor["web-vitals"]=rf,h.__PosthogExtensions__.postHogWebVitalsCallbacks=rf,h.postHogWebVitalsCallbacks=rf,h.__PosthogExtensions__.loadWebVitalsCallbacks=()=>rf,te("[AutoCapture]");var sf={};function uf(t,r){var i=function(t){var e;return Q(t.target)?t.srcElement||null:null!=(e=t.target)&&e.shadowRoot?t.composedPath()[0]||null:t.target||null}(t);return i?e({node:i,originalEvent:t,timestamp:Date.now()},r):null}function lf(t,e){return Math.abs(t)<Math.abs(e)?0>e?"up":"down":0>t?"left":"right"}function hf(t){return"swipe"===t.type?"$dead_swipe":"$dead_click"}var cf="canvas,video,audio,embed,object";function df(t,e){return tt(t)&&t>=e}function vf(t){return t>=0&&1e3>t?t:void 0}function ff(t,e){return e?vf(t-e):void 0}var pf=class{Yi(t){var e,r,i,n,o,a,s,u,l=this.tn((null==t?void 0:t.__onCapture)||this.en.bind(this));return{element_attribute_ignorelist:null!==(e=null==t?void 0:t.element_attribute_ignorelist)&&void 0!==e?e:l.element_attribute_ignorelist,scroll_threshold_ms:null!==(r=null==t?void 0:t.scroll_threshold_ms)&&void 0!==r?r:l.scroll_threshold_ms,selection_change_threshold_ms:null!==(i=null==t?void 0:t.selection_change_threshold_ms)&&void 0!==i?i:l.selection_change_threshold_ms,mutation_threshold_ms:null!==(n=null==t?void 0:t.mutation_threshold_ms)&&void 0!==n?n:l.mutation_threshold_ms,capture_clicks_with_modifier_keys:null!==(o=null==t?void 0:t.capture_clicks_with_modifier_keys)&&void 0!==o?o:l.capture_clicks_with_modifier_keys,capture_dead_swipes:null!==(a=null==t?void 0:t.capture_dead_swipes)&&void 0!==a?a:l.capture_dead_swipes,swipe_threshold_px:null!==(s=null==t?void 0:t.swipe_threshold_px)&&void 0!==s?s:l.swipe_threshold_px,max_dead_swipes_per_page_load:null!==(u=null==t?void 0:t.max_dead_swipes_per_page_load)&&void 0!==u?u:l.max_dead_swipes_per_page_load,css_selector_ignorelist:null==t?void 0:t.css_selector_ignorelist,__onCapture:l.__onCapture}}constructor(t,e){this.instance=t,this.rn=[],this.nn=0,this.tn=t=>({element_attribute_ignorelist:[],scroll_threshold_ms:100,selection_change_threshold_ms:100,mutation_threshold_ms:2500,capture_clicks_with_modifier_keys:!1,capture_dead_swipes:!0,swipe_threshold_px:30,max_dead_swipes_per_page_load:10,__onCapture:t}),this.an=t=>{var e=uf(t,{type:"click"});X(e)||this.sn(e)||this.un(e),this.ln()},this.hn=()=>{var t=Date.now();this.cn=t,t%50==0&&this.rn.forEach(e=>{Q(e.scrollDelayMs)&&(e.scrollDelayMs=t-e.timestamp)})},this.dn=()=>{this.vn=Date.now()},this.Ze=()=>{var t=Date.now();this.fn=t,this.pn("visibilityChangedDelayMs",t)},this.gn=()=>{var t=Date.now();this.mn=t,this.pn("focusChangedDelayMs",t)},this.yn=t=>{var e=t.touches,r=1===(null==e?void 0:e.length)?e[0]:void 0;this.bn=r?{x:r.clientX,y:r.clientY,timestamp:Date.now()}:void 0},this.wn=()=>{this.bn=void 0},this.kn=t=>{var e,r=this.bn;if(this.bn=void 0,!Q(r)&&this._n.max_dead_swipes_per_page_load>this.nn){var i=t,n=null==(e=i.changedTouches)?void 0:e[0];if(n){var o=n.clientX-r.x,s=n.clientY-r.y,u=o*o+s*s,l=this._n.swipe_threshold_px;if(u>=l*l&&![this.cn,this.Sn,this.vn].some(t=>tt(t)&&t>=r.timestamp)){var h;if(this.xn()&&(null!==(h=null==a||null==a.elementsFromPoint?void 0:a.elementsFromPoint(r.x,r.y))&&void 0!==h?h:[]).some(t=>null==t.matches?void 0:t.matches(cf)))return;var c=uf(i,{type:"swipe",swipeDirection:lf(o,s),swipeDistancePx:Math.round(Math.sqrt(u))});X(c)||this.sn(c)||this.un(c),this.ln()}}}},this._n=this.Yi(e),this._onCapture=this._n.__onCapture}start(t){this.Cn(),this.Mn(),this.Tn(),this.In(),this.Rn(),this.An(t),this._n.capture_dead_swipes&&this.En()}An(t){if(!this.Ln){var e=function(t){return function(t,e){var i=sf[t];if(i)return i;var n=e[t];if((t=>Z(t)&&-1!==t.toString().indexOf("[native code]"))(n)&&(null==r||!r.Zone))return sf[t]=n.bind(e);var o=e.document;if(o&&Z(o.createElement)){var a,s=!1;try{(a=o.createElement("iframe")).hidden=!0,o.head.appendChild(a);var u,l,h=a.contentWindow;h&&h[t]&&(n=h[t],"MutationObserver"===t&&function(t){return q(t,"AppleWebKit")&&!q(t,"Chrome")}(null!==(u=null==(l=e.navigator)?void 0:l.userAgent)&&void 0!==u?u:"")&&(a.classList.add("rr-block","ph-no-capture"),s=!0))}catch(e){Yt.warn("Could not create sandbox iframe for "+t+" check, bailing to assignableWindow."+t+": ",e)}finally{var c;!s&&null!=(c=a)&&c.parentNode&&a.parentNode.removeChild(a)}}return n&&Z(n)?sf[t]=n.bind(e):n}("MutationObserver",t)}(h);this.Ln=new e(t=>{this.On(t)}),this.Ln.observe(t,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}}stop(){var t;null==(t=this.Ln)||t.disconnect(),this.Ln=void 0,h.removeEventListener("click",this.an),h.removeEventListener("scroll",this.hn,{capture:!0}),h.removeEventListener("selectionchange",this.dn),h.removeEventListener("touchstart",this.yn,{capture:!0}),h.removeEventListener("touchend",this.kn,{capture:!0}),h.removeEventListener("touchcancel",this.wn,{capture:!0}),null==a||a.removeEventListener("visibilitychange",this.Ze),h.removeEventListener("blur",this.gn),h.removeEventListener("focus",this.gn),this.bn=void 0}On(t){this.Sn=Date.now()}Cn(){ne(h,"click",this.an)}un(t){t.visibilityChangedDelayMs=ff(t.timestamp,this.fn),t.focusChangedDelayMs=ff(t.timestamp,this.mn),this.rn.push(t)}ln(){this.rn.length&&Q(this.Dn)&&(this.Dn=h.setTimeout(()=>{this.Pn()},1e3))}Mn(){ne(h,"scroll",this.hn,{capture:!0})}Tn(){ne(h,"selectionchange",this.dn)}In(){ne(a,"visibilitychange",this.Ze)}Rn(){ne(h,"blur",this.gn),ne(h,"focus",this.gn)}pn(t,e){this.rn.forEach(r=>{var i=vf(e-r.timestamp);tt(i)&&(Q(r[t])||r[t]>i)&&(r[t]=i)})}En(){ne(h,"touchstart",this.yn,{capture:!0,passive:!0}),ne(h,"touchend",this.kn,{capture:!0,passive:!0}),ne(h,"touchcancel",this.wn,{capture:!0,passive:!0})}xn(){var t=Q(this.Fn)||tt(this.Sn)&&this.Sn>this.Fn;return(Q(this.Nn)||t)&&(this.Fn=Date.now(),this.Nn=!(null==a||!a.querySelector(cf))),!!this.Nn}sn(t){return!t||("swipe"===t.type?this.qn(t):this.jn(t))}qn(t){return!(!((e=t.node)instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||null!=e.closest&&e.closest(".toolbar-global-fade-container")))&&!this.rn.some(e=>e.type===t.type&&e.node===t.node&&1e3>Math.abs(e.timestamp-t.timestamp))&&!le(t.node,"html")&&ue(t.node)&&function(t,e){var i;if(!r||me(t))return!1;var n=et(e)?ge:null!==(i=null==e?void 0:e.css_selector_ignorelist)&&void 0!==i?i:ge;return!function(t,e){if(Q(e))return!0;var r,i=function(t){if(e.some(e=>function(t,e){var r=t.matches||t.matchesSelector||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.oMatchesSelector;try{return!!r&&r.call(t,e)}catch(t){return!1}}(t,e)))return{v:!0}};for(var n of t)if(r=i(n))return r.v;return!1}(ye(t,!1).targetElementList,n)}(t.node,{css_selector_ignorelist:this._n.css_selector_ignorelist}));var e}jn(t){return!(this._n.capture_clicks_with_modifier_keys||(e=t.originalEvent,!(e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)))||!!this.qn(t)||(i=t.node,!(!r||me(i))&&ye(i,!1).targetElementList.some(t=>le(t,"a")));var e,i}Pn(){if(this.rn.length){clearTimeout(this.Dn),this.Dn=void 0;var t=this.rn;for(var e of(this.rn=[],t)){var r;e.mutationDelayMs=null!==(r=e.mutationDelayMs)&&void 0!==r?r:this.Sn&&this.Sn>=e.timestamp?this.Sn-e.timestamp:void 0,e.absoluteDelayMs=Date.now()-e.timestamp,e.selectionChangedDelayMs=this.vn&&this.vn>=e.timestamp?this.vn-e.timestamp:void 0;var i=df(e.scrollDelayMs,this._n.scroll_threshold_ms),n=df(e.selectionChangedDelayMs,this._n.selection_change_threshold_ms),o=df(e.mutationDelayMs,this._n.mutation_threshold_ms),a=df(e.absoluteDelayMs,1.1*this._n.mutation_threshold_ms),s=tt(e.scrollDelayMs)&&this._n.scroll_threshold_ms>e.scrollDelayMs,u=tt(e.mutationDelayMs)&&this._n.mutation_threshold_ms>e.mutationDelayMs,l=tt(e.selectionChangedDelayMs)&&this._n.selection_change_threshold_ms>e.selectionChangedDelayMs,h=tt(e.visibilityChangedDelayMs),c=tt(e.focusChangedDelayMs);if(!(s||u||l||h||c))if(i||o||a||n){var d=hf(e);if("$dead_swipe"===d){if(this.nn>=this._n.max_dead_swipes_per_page_load)continue;this.nn++}this._onCapture(e,{[d+"_last_mutation_timestamp"]:this.Sn,[d+"_event_timestamp"]:e.timestamp,[d+"_scroll_timeout"]:i,[d+"_mutation_timeout"]:o,[d+"_absolute_timeout"]:a,[d+"_selection_changed_timeout"]:n,[d+"_visibility_changed_timeout"]:!1})}else this._n.mutation_threshold_ms>e.absoluteDelayMs&&this.rn.push(e)}this.ln()}}en(t,r){var i=hf(t);this.instance.capture(i,e({},r,af(t.node,{e:t.originalEvent,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this._n.element_attribute_ignorelist,elementsChainAsString:!1,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}).props,{[i+"_scroll_delay_ms"]:t.scrollDelayMs,[i+"_mutation_delay_ms"]:t.mutationDelayMs,[i+"_absolute_delay_ms"]:t.absoluteDelayMs,[i+"_selection_changed_delay_ms"]:t.selectionChangedDelayMs,[i+"_visibility_changed_delay_ms"]:t.visibilityChangedDelayMs,[i+"_focus_changed_delay_ms"]:t.focusChangedDelayMs,$dead_swipe_direction:t.swipeDirection,$dead_swipe_distance_px:t.swipeDistancePx}),{timestamp:new Date(t.timestamp)})}};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.initDeadClicksAutocapture=(t,e)=>new pf(t,e)}()}();
|
|
2
2
|
//# sourceMappingURL=all-external-dependencies.js.map
|