!function(){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(r){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var e in n)({}).hasOwnProperty.call(n,e)&&(r[e]=n[e])}return r},r.apply(null,arguments)}var t="undefined"!=typeof window?window:void 0,n="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(n.self=n),"undefined"==typeof File&&(n.File=function(){}),null!=n&&n.XMLHttpRequest&&new n.XMLHttpRequest;var e=null!=t?t:{},i={}.toString,o=Array.isArray||function(r){return"[object Array]"===i.call(r)},a=r=>r===Object(r)&&!o(r),f=(r,t,n)=>n.remaining>0?t.length>n.remaining?(r.push(t.slice(0,n.remaining)),n.remaining=0,n.truncated=!0,!1):(r.push(t),n.remaining-=t.length,!0):(n.truncated=!0,!1),u=(r,t,n)=>{var e=JSON.stringify(r);if(n.remaining>=e.length)return f(t,e,n);if(n.truncated=!0,2>n.remaining)return!1;for(var i=0,o=Math.min(r.length,n.remaining-2);o>i;){var a=Math.ceil((i+o)/2);JSON.stringify(r.slice(0,a)).length>n.remaining?o=a-1:i=a}return f(t,JSON.stringify(r.slice(0,i)),n)},c=r=>void 0!==r&&"function"!=typeof r&&"symbol"!=typeof r&&"bigint"!=typeof r,v=function(r,t,n,e,d){if(void 0===d&&(d=!1),!c(r))return!d||f(t,"null",n);if(null===r||(r=>{try{return"[object Number]"==i.call(t=r)&&t==t||(r=>"[object Boolean]"===i.call(r))(r)}catch(r){return!1}var t})(r))return f(t,JSON.stringify(r),n);if("string"==typeof r)return u(r,t,n);if(!a(r)&&!o(r))return f(t,JSON.stringify(r),n);if(e.has(r))return u("[Circular]",t,n);e.add(r);try{var l=r.toJSON;if("function"==typeof l)return v(l.call(r),t,n,e,d)}catch(r){}try{var y={}.toString.call(r);if("[object String]"===y)return u(String(r.valueOf()),t,n);if("[object Number]"===y||"[object Boolean]"===y)return f(t,JSON.stringify(r.valueOf()),n)}catch(r){}if(r instanceof Error){var s={};try{for(var b in r)({}).hasOwnProperty.call(r,b)&&(s[b]=r[b])}catch(r){}try{s.name=r.name}catch(r){}try{s.message=r.message}catch(r){}try{s.stack=r.stack}catch(r){}return v(s,t,n,e,d)}if(o(r)){if(!f(t,"[",n))return!1;for(var h=0;r.length>h;h++){if(h>0&&!f(t,",",n))return!1;var w=void 0;try{w=r[h]}catch(r){w=void 0}if(!v(w,t,n,e,!0))return!1}return f(t,"]",n)}if(!f(t,"{",n))return!1;var S=!0;try{for(var g in r)if({}.hasOwnProperty.call(r,g)){if(0>=n.remaining)return n.truncated=!0,!1;var p=void 0;try{p=r[g]}catch(r){continue}if(c(p)){var m=(S?"":",")+JSON.stringify(g)+":";if(m.length>=n.remaining)return n.truncated=!0,!1;var O=t.length,j=n.remaining,N=n.truncated;if(!f(t,m,n))return!1;var J=t.length,T=v(p,t,n,e,!1),A=n.truncated;if(t.length!==J){if(S=!1,!T)return!1}else if(t.length=O,n.remaining=j,n.truncated=T?N:A,!T)return!1}}}catch(r){}return f(t,"}",n)},d=function(r,t,n,e,i,o){if(void 0===t&&(t=""),void 0===n&&(n={}),void 0===e&&(e=50),void 0===i&&(i=1e4),void 0===o&&(o=new WeakSet),o.has(r))return n[t||"circular"]="[Circular]",n;o.add(r);try{for(var f in r)try{if(!{}.hasOwnProperty.call(r,f))continue;var u=r[f],c=t?t+"."+f:f;if(a(u))d(u,c,n,e,i,o);else{if(e-=1,i-=String(u).length,i-=c.length,0>=e||0>=i)return void(n.attributes_truncated=!0);n[c]=u}}catch(r){continue}}catch(r){}return n},l={debug:"debug",log:"info",warn:"warn",error:"error",info:"info"};e.__PosthogExtensions__=e.__PosthogExtensions__||{},e.__PosthogExtensions__.logs={initializeLogs(t){var n={host:e.location.host};if(t.sessionManager){var{windowId:i,sessionStartTimestamp:o,lastActivityTimestamp:u}=t.sessionManager.checkAndGetSessionAndWindowId(!0);n=r({},n,{"window.id":i,sessionStartTimestamp:o.toString(),lastActivityTimestamp:u.toString()})}var c=function(i){var o;e.console[i]=(o=e.console[i],function(){for(var u=arguments.length,c=new Array(u),y=0;u>y;y++)c[y]=arguments[y];try{if(c.length>0&&t.is_capturing()){var s,{body:b,truncated:h}=((r,t)=>{for(var n=[],e={remaining:1e4,truncated:!1},i=0;r.length>i&&(0>=i||f(n," ",e))&&v(r[i],n,e,new WeakSet);i++);return{body:n.join("")+(e.truncated?"...":""),truncated:e.truncated}})(c),w=r({},n,h?{body_truncated:"true"}:{});null==(s=t.logs)||s.le({level:l[i],body:b,attributes:r({"log.source":"console."+i},w,a(c[0])?d(c[0]):{})})}}catch(r){}finally{o.apply(e.console,c)}})};for(var y of Object.keys(l))c(y)}}}();
//# sourceMappingURL=logs.js.map
