!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)},u=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),a=(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 u=Math.ceil((i+o)/2);JSON.stringify(r.slice(0,u)).length>n.remaining?o=u-1:i=u}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=(r,t,n)=>{if(!n.truncated){if(n.keysRemaining-=1,n.sizeRemaining-=String(t).length+r.length,0>=n.keysRemaining||0>=n.sizeRemaining)return n.truncated=!0,void(n.result.attributes_truncated=!0);n.result[r]=t}},l=(r,t,n)=>{if(!n.truncated)if(u(r)){if(n.seen.has(r))return void v(t||"circular","[Circular]",n);n.seen.add(r);try{for(var e in r)try{if(!{}.hasOwnProperty.call(r,e))continue;if(l(r[e],t?t+"."+e:e,n),n.truncated)return}catch(r){continue}}catch(r){}}else v(t,r,n)},y=function(r,t,n,e,v,d){if(void 0===v&&(v=!1),!c(r))return!v||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 a(r,t,n);if(!u(r)&&!o(r))return f(t,JSON.stringify(r),n);if(e.has(r))return a("[Circular]",t,n);e.add(r);try{var b=r.toJSON;if("function"==typeof b)return y(b.call(r),t,n,e,v)}catch(r){}try{var s={}.toString.call(r);if("[object String]"===s)return a(String(r.valueOf()),t,n);if("[object Number]"===s||"[object Boolean]"===s)return f(t,JSON.stringify(r.valueOf()),n)}catch(r){}if(r instanceof Error){var h={};try{for(var g in r)({}).hasOwnProperty.call(r,g)&&(h[g]=r[g])}catch(r){}try{h.name=r.name}catch(r){}try{h.message=r.message}catch(r){}try{h.stack=r.stack}catch(r){}return y(h,t,n,e,v,d)}if(o(r)){if(!f(t,"[",n))return!1;for(var S=0;r.length>S;S++){if(S>0&&!f(t,",",n))return!1;var O=void 0;try{O=r[S]}catch(r){O=void 0}if(!y(O,t,n,e,!0))return!1}return f(t,"]",n)}if(!f(t,"{",n))return!1;var j=!0;try{for(var w in r)if({}.hasOwnProperty.call(r,w)){if(0>=n.remaining)return n.truncated=!0,!1;var p=void 0;try{p=r[w]}catch(r){continue}if(d)try{l(p,w,d)}catch(r){}if(c(p)){var N=(j?"":",")+JSON.stringify(w)+":";if(N.length>=n.remaining)return n.truncated=!0,!1;var J=t.length,m=n.remaining,k=n.truncated;if(!f(t,N,n))return!1;var A=t.length,z=y(p,t,n,e,!1),B=n.truncated;if(t.length!==A){if(j=!1,!z)return!1}else if(t.length=J,n.remaining=m,n.truncated=z?k:B,!z)return!1}}}catch(r){}return f(t,"}",n)},d={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},i=function(i){var o;e.console[i]=(o=e.console[i],function(){for(var a=arguments.length,c=new Array(a),v=0;a>v;v++)c[v]=arguments[v];try{if(c.length>0&&t.is_capturing()){var l,{body:b,truncated:s,attributes:h}=((r,t)=>{for(var n=[],e={remaining:1e4,truncated:!1},i=u(r[0])?{result:{},keysRemaining:50,sizeRemaining:1e4,truncated:!1,seen:new WeakSet([r[0]])}:void 0,o=0;r.length>o&&(0>=o||f(n," ",e))&&y(r[o],n,e,new WeakSet,!1,0===o?i:void 0);o++);return{body:n.join("")+(e.truncated?"...":""),truncated:e.truncated,attributes:(null==i?void 0:i.result)||{}}})(c),g=r({},n,s?{body_truncated:"true"}:{});null==(l=t.logs)||l.le({level:d[i],body:b,attributes:r({"log.source":"console."+i},g,h)})}}catch(r){}finally{o.apply(e.console,c)}})};for(var o of Object.keys(d))i(o)}}}();
//# sourceMappingURL=logs.js.map
