dexto 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/analytics/index.d.ts.map +1 -1
  2. package/dist/analytics/index.js +1 -2
  3. package/dist/webui/.next/standalone/{packages/webui/.next/static/chunks/656-5a9f6405badf66a8.js → .next/static/chunks/369-7a58b346e80ec351.js} +2 -2
  4. package/dist/webui/.next/standalone/.next/static/chunks/419-6d7f485f58886e5b.js +1 -0
  5. package/dist/webui/.next/standalone/.next/static/chunks/560-551d60414365cdc4.js +1 -0
  6. package/dist/webui/.next/standalone/.next/static/chunks/854-7ae94d6609222f8e.js +1 -0
  7. package/dist/webui/.next/standalone/.next/static/chunks/app/chat/[sessionId]/page-df2b9ed4c466c348.js +1 -0
  8. package/dist/webui/.next/standalone/.next/static/chunks/app/layout-f4d136d139162fab.js +1 -0
  9. package/dist/webui/.next/standalone/.next/static/chunks/app/page-d0ab5e22f0d14271.js +1 -0
  10. package/dist/webui/.next/standalone/package.json +3 -2
  11. package/dist/webui/.next/standalone/packages/webui/.next/BUILD_ID +1 -1
  12. package/dist/webui/.next/standalone/packages/webui/.next/app-build-manifest.json +13 -10
  13. package/dist/webui/.next/standalone/packages/webui/.next/build-manifest.json +2 -2
  14. package/dist/webui/.next/standalone/packages/webui/.next/prerender-manifest.json +3 -3
  15. package/dist/webui/.next/standalone/packages/webui/.next/required-server-files.json +1 -1
  16. package/dist/webui/.next/standalone/packages/webui/.next/server/app/_not-found/page.js +2 -2
  17. package/dist/webui/.next/standalone/packages/webui/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/dist/webui/.next/standalone/packages/webui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/dist/webui/.next/standalone/packages/webui/.next/server/app/chat/[sessionId]/page.js +2 -2
  20. package/dist/webui/.next/standalone/packages/webui/.next/server/app/chat/[sessionId]/page.js.nft.json +1 -1
  21. package/dist/webui/.next/standalone/packages/webui/.next/server/app/chat/[sessionId]/page_client-reference-manifest.js +1 -1
  22. package/dist/webui/.next/standalone/packages/webui/.next/server/app/page.js +2 -2
  23. package/dist/webui/.next/standalone/packages/webui/.next/server/app/page.js.nft.json +1 -1
  24. package/dist/webui/.next/standalone/packages/webui/.next/server/app/page_client-reference-manifest.js +1 -1
  25. package/dist/webui/.next/standalone/packages/webui/.next/server/app/playground/page.js +3 -3
  26. package/dist/webui/.next/standalone/packages/webui/.next/server/app/playground/page.js.nft.json +1 -1
  27. package/dist/webui/.next/standalone/packages/webui/.next/server/app/playground/page_client-reference-manifest.js +1 -1
  28. package/dist/webui/.next/standalone/packages/webui/.next/server/chunks/1.js +4 -4
  29. package/dist/webui/.next/standalone/packages/webui/.next/server/chunks/695.js +1 -0
  30. package/dist/webui/.next/standalone/packages/webui/.next/server/chunks/{426.js → 710.js} +2 -2
  31. package/dist/webui/.next/standalone/packages/webui/.next/server/pages/500.html +1 -1
  32. package/dist/webui/.next/standalone/packages/webui/.next/server/server-reference-manifest.json +1 -1
  33. package/dist/webui/.next/{static/chunks/656-5a9f6405badf66a8.js → standalone/packages/webui/.next/static/chunks/369-7a58b346e80ec351.js} +2 -2
  34. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/419-6d7f485f58886e5b.js +1 -0
  35. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/560-551d60414365cdc4.js +1 -0
  36. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/854-7ae94d6609222f8e.js +1 -0
  37. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/app/chat/[sessionId]/page-df2b9ed4c466c348.js +1 -0
  38. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/app/layout-f4d136d139162fab.js +1 -0
  39. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/app/page-d0ab5e22f0d14271.js +1 -0
  40. package/dist/webui/.next/standalone/packages/webui/package.json +3 -1
  41. package/dist/webui/.next/standalone/packages/webui/server.js +1 -1
  42. package/dist/webui/.next/{standalone/.next/static/chunks/656-5a9f6405badf66a8.js → static/chunks/369-7a58b346e80ec351.js} +2 -2
  43. package/dist/webui/.next/static/chunks/419-6d7f485f58886e5b.js +1 -0
  44. package/dist/webui/.next/static/chunks/560-551d60414365cdc4.js +1 -0
  45. package/dist/webui/.next/static/chunks/854-7ae94d6609222f8e.js +1 -0
  46. package/dist/webui/.next/static/chunks/app/chat/[sessionId]/page-df2b9ed4c466c348.js +1 -0
  47. package/dist/webui/.next/static/chunks/app/layout-f4d136d139162fab.js +1 -0
  48. package/dist/webui/.next/static/chunks/app/page-d0ab5e22f0d14271.js +1 -0
  49. package/dist/webui/package.json +3 -1
  50. package/package.json +3 -3
  51. package/dist/webui/.next/standalone/.next/static/chunks/419-a07413b585273a24.js +0 -1
  52. package/dist/webui/.next/standalone/.next/static/chunks/854-232126f3c77e6c0b.js +0 -1
  53. package/dist/webui/.next/standalone/.next/static/chunks/app/chat/[sessionId]/page-a695b09e6bac5274.js +0 -1
  54. package/dist/webui/.next/standalone/.next/static/chunks/app/layout-f4a6ee5a028899d1.js +0 -1
  55. package/dist/webui/.next/standalone/.next/static/chunks/app/page-d1f127a0cac96246.js +0 -1
  56. package/dist/webui/.next/standalone/packages/webui/.next/server/chunks/43.js +0 -1
  57. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/419-a07413b585273a24.js +0 -1
  58. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/854-232126f3c77e6c0b.js +0 -1
  59. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/app/chat/[sessionId]/page-a695b09e6bac5274.js +0 -1
  60. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/app/layout-f4a6ee5a028899d1.js +0 -1
  61. package/dist/webui/.next/standalone/packages/webui/.next/static/chunks/app/page-d1f127a0cac96246.js +0 -1
  62. package/dist/webui/.next/static/chunks/419-a07413b585273a24.js +0 -1
  63. package/dist/webui/.next/static/chunks/854-232126f3c77e6c0b.js +0 -1
  64. package/dist/webui/.next/static/chunks/app/chat/[sessionId]/page-a695b09e6bac5274.js +0 -1
  65. package/dist/webui/.next/static/chunks/app/layout-f4a6ee5a028899d1.js +0 -1
  66. package/dist/webui/.next/static/chunks/app/page-d1f127a0cac96246.js +0 -1
  67. /package/dist/webui/.next/standalone/.next/static/{b_pyEEg2sitTwMzZWW7vE → IXh4cVyOAx6rg0D8ivJp6}/_buildManifest.js +0 -0
  68. /package/dist/webui/.next/standalone/.next/static/{b_pyEEg2sitTwMzZWW7vE → IXh4cVyOAx6rg0D8ivJp6}/_ssgManifest.js +0 -0
  69. /package/dist/webui/.next/standalone/packages/webui/.next/static/{b_pyEEg2sitTwMzZWW7vE → IXh4cVyOAx6rg0D8ivJp6}/_buildManifest.js +0 -0
  70. /package/dist/webui/.next/standalone/packages/webui/.next/static/{b_pyEEg2sitTwMzZWW7vE → IXh4cVyOAx6rg0D8ivJp6}/_ssgManifest.js +0 -0
  71. /package/dist/webui/.next/static/{b_pyEEg2sitTwMzZWW7vE → IXh4cVyOAx6rg0D8ivJp6}/_buildManifest.js +0 -0
  72. /package/dist/webui/.next/static/{b_pyEEg2sitTwMzZWW7vE → IXh4cVyOAx6rg0D8ivJp6}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[560],{826:(e,t,i)=>{var r=i(5438);i.o(r,"useRouter")&&i.d(t,{useRouter:function(){return r.useRouter}})},8187:(e,t,i)=>{i.d(t,{Ay:()=>nn});var r="undefined"!=typeof window?window:void 0,s="undefined"!=typeof globalThis?globalThis:r,n=Array.prototype,a=n.forEach,o=n.indexOf,l=null==s?void 0:s.navigator,c=null==s?void 0:s.document,u=null==s?void 0:s.location,h=null==s?void 0:s.fetch,d=null!=s&&s.XMLHttpRequest&&"withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:void 0,p=null==s?void 0:s.AbortController,g=null==l?void 0:l.userAgent,_=null!=r?r:{},v={DEBUG:!1,LIB_VERSION:"1.281.0"};function f(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){f(n,r,s,a,o,"next",e)}function o(e){f(n,r,s,a,o,"throw",e)}a(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(null,arguments)}function b(e,t){if(null==e)return{};var i={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var w=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function E(e,t){return -1!==e.indexOf(t)}var x=function(e){return e.trim()},k=function(e){return e.replace(/^\$/,"")},S=Array.isArray,P=Object.prototype,$=P.hasOwnProperty,F=P.toString,I=S||function(e){return"[object Array]"===F.call(e)},C=e=>"function"==typeof e,O=e=>e===Object(e)&&!I(e),R=e=>{if(O(e)){for(var t in e)if($.call(e,t))return!1;return!0}return!1},T=e=>void 0===e,M=e=>"[object String]"==F.call(e),A=e=>M(e)&&0===e.trim().length,L=e=>null===e,D=e=>T(e)||L(e),N=e=>"[object Number]"==F.call(e),j=e=>"[object Boolean]"===F.call(e),U=e=>E(w,e);function q(e){return null===e||"object"!=typeof e}function H(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function B(e){return!T(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var V=[!0,"true",1,"1","yes"],W=e=>E(V,e),G=[!1,"false",0,"0","no"];function z(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),N(e)?e>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),z(s||i,t,i,r))}class Y{constructor(e){this.t={},this.i=e.i,this.o=z(e.bucketSize,0,100,e.h),this.m=z(e.refillRate,0,this.o,e.h),this.S=z(e.refillInterval,0,864e5,e.h)}$(e,t){var i=Math.floor((t-e.lastAccess)/this.S);if(i>0){var r=i*this.m;e.tokens=Math.min(e.tokens+r,this.o),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.t[r];return s?this.$(s,i):(s={tokens:this.o,lastAccess:i},this.t[r]=s),0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.i)||t.call(this,e)),0===s.tokens)}stop(){this.t={}}}var X,J,Z,K=e=>e instanceof Error;function Q(e,t,i,r){var s={platform:"web:javascript",filename:e,function:"<anonymous>"===t?"?":t,in_app:!0};return T(i)||(s.lineno=i),T(r)||(s.colno=r),s}var ee=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},et=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ei=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,er=/\((\S*)(?::(\d+))(?::(\d+))\)/,es=e=>{var t=et.exec(e);if(t){var[,i,r,s]=t;return Q(i,"?",+r,+s)}var n=ei.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var a=er.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}var[o,l]=ee(n[1]||"?",n[2]);return Q(l,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},en=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ea=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,eo=e=>{var t=en.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=ea.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}var r=t[3],s=t[1]||"?";return[s,r]=ee(s,r),Q(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},el=/\(error: (.*)\)/;class ec{constructor(e,t,i){void 0===e&&(e=[]),void 0===t&&(t=[]),void 0===i&&(i=[]),this.coercers=e,this.modifiers=i,this.stackParser=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(e,i){void 0===i&&(i=0);for(var r=[],s=e.split("\n"),n=i;n<s.length;n++){var a=s[n];if(!(a.length>1024)){var o=el.test(a)?a.replace(el,"$1"):a;if(!o.match(/\S*Error: /)){for(var l of t){var c=l(o);if(c){r.push(c);break}}if(r.length>=50)break}}}if(!r.length)return[];var u=Array.from(r);return u.reverse(),u.slice(0,50).map(e=>y({},e,{filename:e.filename||(u[u.length-1]||{}).filename,function:e.function||"?"}))}}(...t)}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&I(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,+!!e.synthetic),t.chunkIdMap)),y({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(r=t.handled)||r,synthetic:null!=(s=e.synthetic)&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return Z&&i.length===J||(J=i.length,Z=i.reduce((i,r)=>{X||(X={});var s=X[r];if(s)i[s[0]]=s[1];else for(var n=e(r),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,c=t[r];if(l&&c){i[l]=c,X[r]=[l,c];break}}return i},{})),Z}}(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(r<=4){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}class eu{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=M(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return H(e,"DOMException")}isDOMError(e){return H(e,"DOMError")}}class eh{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class ed{constructor(){}match(e){return H(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var ep=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class eg{match(e){return"string"==typeof e}coerce(e,t){var i,[r,s]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(ep);return r&&(t=r[1],i=r[2]),[t,i]}}var e_=["fatal","error","warning","log","info","debug"];function ev(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");if(!(s.length>t))return r===i.length||s.length<=t?s:s.slice(0,t)+"..."}return""}class ef{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return B(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+ev(e)}isSeverityLevel(e){return M(e)&&!A(e)&&e_.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(K(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class em{match(e){return B(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+ev(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class ey{match(e){return q(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class eb{match(e){return H(e,"PromiseRejectionEvent")}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return q(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){if(q(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var ew=e=>{var t={k:function(t){if(r&&(v.DEBUG||_.POSTHOG_DEBUG)&&!T(r.console)&&r.console){for(var i=("__rrweb_original__"in r.console[t])?r.console[t].__rrweb_original__:r.console[t],s=arguments.length,n=Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];i(e,...n)}},info:function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];t.k("log",...i)},warn:function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];t.k("warn",...i)},error:function(){for(var e=arguments.length,i=Array(e),r=0;r<e;r++)i[r]=arguments[r];t.k("error",...i)},critical:function(){for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning:e=>{t.error("You must initialize PostHog before calling "+e)},createLogger:t=>ew(e+" "+t)};return t},eE=ew("[PostHog.js]"),ex=eE.createLogger,ek=ex("[ExternalScriptsLoader]"),eS=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return ek.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==c?void 0:c.querySelectorAll("script");if(r){for(var s,n=0;n<r.length;n++)if(s=function(){if(r[n].src===t){var e=r[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return s.v}var a=()=>{if(!c)return i("document not found");var r=c.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");var s,n=c.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):c.body.appendChild(r)};null!=c&&c.body?a():null==c||c.addEventListener("DOMContentLoaded",a)};_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var r="/static/"+t+".js?v="+e.version;"remote-config"===t&&(r="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5));var s=e.requestRouter.endpointFor("assets",r);eS(e,s,i)},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);eS(e,r,i)};var eP={};function e$(e,t,i){if(I(e)){if(a&&e.forEach===a)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(r in e&&t.call(i,e[r],r)===eP)return}}}function eF(e,t,i){if(!D(e)){if(I(e))return e$(e,t,i);if(e instanceof FormData){for(var r of e.entries())if(t.call(i,r[1],r[0])===eP)return}else for(var s in e)if($.call(e,s)&&t.call(i,e[s],s)===eP)return}}var eI=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return e$(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},eC=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return e$(i,function(t){e$(t,function(t){e.push(t)})}),e};function eO(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var eR=function(e){try{return e()}catch(e){return}},eT=function(e){return function(){try{for(var t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){eE.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),eE.critical(e)}}},eM=function(e){var t={};return eF(e,function(e,i){(M(e)&&e.length>0||N(e))&&(t[i]=e)}),t},eA=["herokuapp.com","vercel.app","netlify.app"];function eL(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function eD(e,t,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}var eN="$people_distinct_id",ej="__alias",eU="__timers",eq="$autocapture_disabled_server_side",eH="$heatmaps_enabled_server_side",eB="$exception_capture_enabled_server_side",eV="$error_tracking_suppression_rules",eW="$error_tracking_capture_extension_exceptions",eG="$web_vitals_enabled_server_side",ez="$dead_clicks_enabled_server_side",eY="$web_vitals_allowed_metrics",eX="$session_recording_remote_config",eJ="$sesid",eZ="$session_is_sampled",eK="$enabled_feature_flags",eQ="$early_access_features",e0="$feature_flag_details",e1="$stored_person_properties",e2="$stored_group_properties",e3="$surveys",e5="$surveys_activated",e8="$flag_call_reported",e6="$user_state",e4="$client_session_props",e7="$capture_rate_limit",e9="$initial_campaign_params",te="$initial_referrer_info",tt="$initial_person_info",ti="$epp",tr="__POSTHOG_TOOLBAR__",ts="$posthog_cookieless",tn=[eN,ej,"__cmpns",eU,"$session_recording_enabled_server_side",eH,eJ,eK,eV,e6,eQ,e0,e2,e1,e3,e8,e4,e7,e9,te,ti,tt];function ta(e){return e instanceof Element&&(e.id===tr||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function to(e){return!!e&&1===e.nodeType}function tl(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function tc(e){return!!e&&3===e.nodeType}function tu(e){return!!e&&11===e.nodeType}function th(e){return e?x(e).split(/\s+/):[]}function td(e){var t=null==r?void 0:r.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function tp(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return th(t)}function tg(e){return D(e)?null:x(e).split(/(\s+)/).filter(e=>tO(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function t_(e){var t="";return tx(e)&&!tk(e)&&e.childNodes&&e.childNodes.length&&eF(e.childNodes,function(e){var i;tc(e)&&e.textContent&&(t+=null!=(i=tg(e.textContent))?i:"")}),x(t)}function tv(e){var t;return T(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var tf=["a","button","form","input","select","textarea","label"];function tm(e,t){if(T(t))return!0;var i,r=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function ty(e){var t=e.parentNode;return!(!t||!to(t))&&t}var tb=[".ph-no-rageclick",".ph-no-capture"],tw=e=>!e||tl(e,"html")||!to(e),tE=(e,t)=>{if(!r||tw(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],n=e;n.parentNode&&!tl(n,"body");)if(tu(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var a=ty(n);if(!a)break;if(t||tf.indexOf(a.tagName.toLowerCase())>-1)i=!0;else{var o=r.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}s.push(a),n=a}return{parentIsUsefulElement:i,targetElementList:s}};function tx(e){for(var t=e;t.parentNode&&!tl(t,"body");t=t.parentNode){var i=tp(t);if(E(i,"ph-sensitive")||E(i,"ph-no-capture"))return!1}if(E(tp(e),"ph-include"))return!0;var r=e.type||"";if(M(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!(M(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function tk(e){return!!(tl(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||tl(e,"select")||tl(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var tS="(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})",tP=RegExp("^(?:"+tS+")$"),t$=new RegExp(tS),tF="\\d{3}-?\\d{2}-?\\d{4}",tI=RegExp("^("+tF+")$"),tC=RegExp("("+tF+")");function tO(e,t){return void 0===t&&(t=!0),!(D(e)||M(e)&&(e=x(e),(t?tP:t$).test((e||"").replace(/[- ]/g,""))||(t?tI:tC).test(e)))&&!0}function tR(e){var t=t_(e);return tO(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&eF(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=t_(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){eE.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function tT(e){return e.replace(/"|\\"/g,'\\"')}class tM{constructor(){this.clicks=[]}isRageClick(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var tA="$copy_autocapture",tL=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),tD=e=>{var t=null==c?void 0:c.createElement("a");return T(t)?null:(t.href=e,t)},tN=function(e,t){void 0===t&&(t="&");var i,r,s=[];return eF(e,function(e,t){T(e)||T(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),r=encodeURIComponent(t),s[s.length]=r+"="+i)}),s.join(t)},tj=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var n=r[s].split("=");if(n[0]===t){i=n;break}}if(!I(i)||i.length<2)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){eE.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},tU=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",n=r[1],a=s.split("?"),o=a[1],l=a[0],c=(o||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");I(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=o&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},tq=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},tH=ex("[AutoCapture]");function tB(e,t){return t.length>e?t.slice(0,e)+"...":t}class tV{constructor(e){this.P=!1,this.T=null,this.rageclicks=new tM,this.R=!1,this.instance=e,this.I=null}get C(){var e,t,i=O(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}O(){if(this.isBrowserSupported()){if(r&&c){var e=e=>{e=e||(null==r?void 0:r.event);try{this.F(e)}catch(e){tH.error("Failed to capture event",e)}};if(eD(c,"submit",e,{capture:!0}),eD(c,"change",e,{capture:!0}),eD(c,"click",e,{capture:!0}),this.C.capture_copied_text){var t=e=>{e=e||(null==r?void 0:r.event),this.F(e,tA)};eD(c,"copy",t,{capture:!0}),eD(c,"cut",t,{capture:!0})}}}else tH.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.O(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[eq]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var t,i=[];return null==(t=this.I)||t.forEach(t=>{var r=null==c?void 0:c.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[eq];if(L(this.T)&&!j(i)&&!this.instance.M())return!1;var r=null!=(t=this.T)?t:!!i;return!!this.instance.config.autocapture&&!r}F(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=tv(e);tc(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&function(e,t){if(!r||tw(e)||!1===(i=j(t)?!!t&&tb:null!=(s=null==t?void 0:t.css_selector_ignorelist)?s:tb))return!1;var i,s,{targetElementList:n}=tE(e,!1);return!tm(n,i)}(s,this.instance.config.rageclick)&&this.F(e,"$rageclick");var n=t===tA;if(s&&function(e,t,i,s,n){if(void 0===i&&(i=void 0),!r||tw(e)||null!=(a=i)&&a.url_allowlist&&!td(i.url_allowlist)||null!=(o=i)&&o.url_ignorelist&&td(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var a,o,l,c,u=i.dom_event_allowlist;if(u&&!u.some(e=>t.type===e))return!1}var{parentIsUsefulElement:h,targetElementList:d}=tE(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(T(i))return!0;var r,s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(r=s(n))return r.v;return!1}(d,i)||!tm(d,null==(c=i)?void 0:c.css_selector_allowlist))return!1;var p=r.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(tf.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.C,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=function(e,t){for(var i,s,{e:n,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!tl(h,"body");)tu(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],g={},_=!1,v=!1;if(eF(u,e=>{var t=tx(e);"a"===e.tagName.toLowerCase()&&(_=e.getAttribute("href"),_=t&&_&&tO(_)&&_),E(tp(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,r){var s=e.tagName.toLowerCase(),n={tag_name:s};tf.indexOf(s)>-1&&!i&&("a"===s.toLowerCase()||"button"===s.toLowerCase()?n.$el_text=tB(1024,tR(e)):n.$el_text=tB(1024,t_(e)));var a=tp(e);a.length>0&&(n.classes=a.filter(function(e){return""!==e})),eF(e.attributes,function(i){var s;if((!tk(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&tO(i.value)&&(!M(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=th(a).join(" ")),n["attr__"+i.name]=tB(1024,a)}});for(var o=1,l=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!to(t));return t}(c);)o++,c.tagName===e.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}(e,a,o,l)),eI(g,function(e){if(!tx(e))return{};var t={};return eF(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&tO(r)&&(t[i]=r)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=tR(e):p[0].$el_text=t_(e)),_){p[0].attr__href=_;var f,m,b=null==(f=tD(_))?void 0:f.host,w=null==r||null==(m=r.location)?void 0:m.host;b&&w&&b!==w&&(d=_)}return{props:eI({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,r,s={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?I(t)?t:th(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return eO(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s}).map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return eO(n).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return a[tT(t.toString())]=tT(i.toString())}),r+=":",r+=eO(a).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=p[0])&&i.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.C.element_attribute_ignorelist,elementsChainAsString:this.R});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===tA){var c,u=tg(null==r||null==(c=r.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=h}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return C(null==c?void 0:c.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return N(e)&&isFinite(e)&&Math.floor(e)===e});var tW="0123456789abcdef";class tG{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/0x10000000000,s[1]=e/0x100000000,s[2]=e/0x1000000,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new tG(s)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+tW.charAt(this.bytes[t]>>>4)+tW.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new tG(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class tz{constructor(){this.A=0,this.D=0,this.j=new tJ}generate(){var e=this.generateOrAbort();if(T(e)){this.A=0;var t=this.generateOrAbort();if(T(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>0x3ffffffffff&&(this.A++,this.L())}return tG.fromFieldsV7(this.A,Math.trunc(this.D/0x40000000),0x3fffffff&this.D,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var tY,tX=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};r&&!T(r.crypto)&&crypto.getRandomValues&&(tX=e=>crypto.getRandomValues(e));class tJ{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(tX(this.N),this.U=0),this.N[this.U++]}}var tZ=()=>tK().toString(),tK=()=>(tY||(tY=new tz)).generate(),tQ="",t0=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,t1={H:()=>!!c,B:function(e){eE.error("cookieStore error: "+e)},q:function(e){if(c){try{for(var t=e+"=",i=c.cookie.split(";").filter(e=>e.length),r=0;r<i.length;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},W:function(e){var t;try{t=JSON.parse(t1.q(e))||{}}catch(e){}return t},G:function(e,t,i,r,s){if(c)try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=c),tQ)return tQ;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+tZ();!tQ&&r--;){var n=i.slice(r).join("."),a=s+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(s)&&(t.cookie=a+";max-age=0",tQ=n)}return tQ}(e);if(!i){var r,s=(r=e.match(t0))?r[0]:"";s!==i&&eE.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(c.location.hostname,r);if(i){var l=new Date;l.setTime(l.getTime()+24*i*36e5),n="; expires="+l.toUTCString()}s&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&eE.warn("cookieStore warning: large cookie, len="+u.length),c.cookie=u,u}catch(e){return}},V:function(e,t){if(null!=c&&c.cookie)try{t1.G(e,"",-1,t)}catch(e){return}}},t2=null,t3={H:function(){if(!L(t2))return t2;var e=!0;if(T(r))e=!1;else try{var t="__mplssupport__";t3.G(t,"xyz"),'"xyz"'!==t3.q(t)&&(e=!1),t3.V(t)}catch(t){e=!1}return e||eE.error("localStorage unsupported; falling back to cookie store"),t2=e,e},B:function(e){eE.error("localStorage error: "+e)},q:function(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){t3.B(e)}return null},W:function(e){try{return JSON.parse(t3.q(e))||{}}catch(e){}return null},G:function(e,t){try{null==r||r.localStorage.setItem(e,JSON.stringify(t))}catch(e){t3.B(e)}},V:function(e){try{null==r||r.localStorage.removeItem(e)}catch(e){t3.B(e)}}},t5=["distinct_id",eJ,eZ,ti,tt],t8=y({},t3,{W:function(e){try{var t={};try{t=t1.W(e)||{}}catch(e){}var i=eI(t,JSON.parse(t3.q(e)||"{}"));return t3.G(e,i),i}catch(e){}return null},G:function(e,t,i,r,s,n){try{t3.G(e,t,void 0,void 0,n);var a={};t5.forEach(e=>{t[e]&&(a[e]=t[e])}),Object.keys(a).length&&t1.G(e,a,i,r,s,n)}catch(e){t3.B(e)}},V:function(e,t){try{null==r||r.localStorage.removeItem(e),t1.V(e,t)}catch(e){t3.B(e)}}}),t6={},t4={H:function(){return!0},B:function(e){eE.error("memoryStorage error: "+e)},q:function(e){return t6[e]||null},W:function(e){return t6[e]||null},G:function(e,t){t6[e]=t},V:function(e){delete t6[e]}},t7=null,t9={H:function(){if(!L(t7))return t7;if(t7=!0,T(r))t7=!1;else try{var e="__support__";t9.G(e,"xyz"),'"xyz"'!==t9.q(e)&&(t7=!1),t9.V(e)}catch(e){t7=!1}return t7},B:function(e){eE.error("sessionStorage error: ",e)},q:function(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){t9.B(e)}return null},W:function(e){try{return JSON.parse(t9.q(e))||null}catch(e){}return null},G:function(e,t){try{null==r||r.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){t9.B(e)}},V:function(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){t9.B(e)}}},ie=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class it{constructor(e){this._instance=e}get C(){return this._instance.config}get consent(){return this.J()?ie.DENIED:this.K}isOptedOut(){return"always"===this.C.cookieless_mode||this.consent===ie.DENIED||this.consent===ie.PENDING&&(this.C.opt_out_capturing_by_default||"on_reject"===this.C.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ie.DENIED}optInOut(e){this.Y.G(this.X,+!!e,this.C.cookie_expiration,this.C.cross_subdomain_cookie,this.C.secure_cookie)}reset(){this.Y.V(this.X,this.C.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return W(e)?ie.GRANTED:E(G,e)?ie.DENIED:ie.PENDING}get Y(){if(!this.Z){var e=this.C.opt_out_capturing_persistence_type;this.Z="localStorage"===e?t3:t1;var t="localStorage"===e?t1:t3;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(W(t.q(this.X))),t.V(this.X,this.C.cross_subdomain_cookie))}return this.Z}J(){return!!this.C.respect_dnt&&!!eL([null==l?void 0:l.doNotTrack,null==l?void 0:l.msDoNotTrack,_.doNotTrack],e=>W(e))}}var ii=ex("[Dead Clicks]"),ir=()=>!0,is=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(ez)),r=e.instance.config.capture_dead_clicks;return j(r)?r:i};class ia{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[ez]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it(()=>{this.et()})}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?ii.error("failed to load script",t):e()})}et(){var e;if(c){if(!this.tt&&null!=(e=_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=O(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(c),ii.info("starting...")}}else ii.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,ii.info("stopping..."))}}var io=ex("[ExceptionAutocapture]");class il{constructor(e){var t,i,s;this.rt=()=>{var e;if(r&&this.isEnabled&&null!=(e=_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.C.capture_unhandled_errors&&(this.st=t(this.captureException.bind(this))),!this.nt&&this.C.capture_unhandled_rejections&&(this.nt=i(this.captureException.bind(this))),!this.ot&&this.C.capture_console_errors&&(this.ot=s(this.captureException.bind(this)))}catch(e){io.error("failed to start",e),this.lt()}}},this._instance=e,this.ut=!(null==(t=this._instance.persistence)||!t.props[eB]),this.C=this.ht(),this.dt=new Y({refillRate:null!=(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,h:io}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return O(e)?t=y({},t,e):(T(e)?this.ut:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.C.capture_console_errors||this.C.capture_unhandled_errors||this.C.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(io.info("enabled"),this.it(this.rt))}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return io.error("failed to load script",t);e()})}lt(){var e,t,i;null==(e=this.st)||e.call(this),this.st=void 0,null==(t=this.nt)||t.call(this),this.nt=void 0,null==(i=this.ot)||i.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ut=!!t,this.C=this.ht(),this._instance.persistence&&this._instance.persistence.register({[eB]:this.ut}),this.startIfEnabled()}captureException(e){var t,i,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.dt.consumeRateLimit(r)?io.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}function ic(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);return C(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch(e){return()=>{}}}class iu{constructor(e){var t;this._instance=e,this.vt=(null==r||null==(t=r.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(eE.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,eE.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(r&&r.history){var i=this;null!=(e=r.history.pushState)&&e.__posthog_wrapped__||ic(r.history,"pushState",e=>function(t,r,s){e.call(this,t,r,s),i.ft("pushState")}),null!=(t=r.history.replaceState)&&t.__posthog_wrapped__||ic(r.history,"replaceState",e=>function(t,r,s){e.call(this,t,r,s),i.ft("replaceState")}),this.gt()}}ft(e){try{var t,i=null==r||null==(t=r.location)?void 0:t.pathname;if(!i)return;i!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.vt=i}catch(t){eE.error("Error capturing "+e+" pageview",t)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};eD(r,"popstate",e),this.ct=()=>{r&&r.removeEventListener("popstate",e)}}}}var ih=ex("[SegmentIntegration]"),id="posthog-js";function ip(e,t){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{if(!("*"===n||n.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var o,l,c,u,h,d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null==(o=t.exception)?void 0:o.values)||[],g=p.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(h=p[0])?void 0:h.type,$sentry_tags:t.tags};return i&&r&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),a&&e.exceptions.sendExceptionEvent(_),t}}class ig{constructor(e,t,i,r,s,n){this.name=id,this.setupOnce=function(a){a(ip(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}var i_=null!=r&&r.location?tq(r.location.hash,"__posthog")||tq(location.hash,"state"):null,iv="_postHogToolbarParams",im=ex("[Toolbar]"),iy=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(iy||{});class ib{constructor(e){this.instance=e}_t(e){_.ph_toolbar_state=e}yt(){var e;return null!=(e=_.ph_toolbar_state)?e:iy.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),!r||!c)return!1;e=null!=e?e:r.location,i=null!=i?i:r.history;try{if(!t){try{r.localStorage.setItem("test","test"),r.localStorage.removeItem("test")}catch(e){return!1}t=null==r?void 0:r.localStorage}var s,n=i_||tq(e.hash,"__posthog")||tq(e.hash,"state"),a=n?eR(()=>JSON.parse(atob(decodeURIComponent(n))))||eR(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(iv)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch(e){return!1}}bt(e){var t=_.ph_load_toolbar||_.ph_load_editor;!D(t)&&C(t)?t(e,this.instance):im.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==c||!c.getElementById(tr));if(!r||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(r.localStorage.setItem(iv,JSON.stringify(y({},n,{source:void 0}))),this.yt()===iy.LOADED)?this.bt(n):this.yt()===iy.UNINITIALIZED&&(this._t(iy.LOADING),null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return im.error("[Toolbar] Failed to load",e),void this._t(iy.UNINITIALIZED);this._t(iy.LOADED),this.bt(n)}),eD(r,"turbolinks:load",()=>{this._t(iy.UNINITIALIZED),this.loadToolbar(n)})),!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var iw=ex("[TracingHeaders]");class iE{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var e,t;T(this.xt)&&(null==(e=_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),T(this.St)&&(null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return iw.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):(null==(e=this.xt)||e.call(this),null==(t=this.St)||t.call(this),this.xt=void 0,this.St=void 0)}}var ix="Mobile",ik="Android",iS="Tablet",iP=ik+" "+iS,i$="iPad",iF="Apple",iI=iF+" Watch",iC="Safari",iO="BlackBerry",iR="Samsung",iT=iR+"Browser",iM=iR+" Internet",iA="Chrome",iL=iA+" OS",iD=iA+" iOS",iN="Internet Explorer",ij=iN+" "+ix,iU="Opera",iq=iU+" Mini",iH="Edge",iB="Microsoft "+iH,iV="Firefox",iW=iV+" iOS",iG="Nintendo",iz="PlayStation",iY="Xbox",iX=ik+" "+ix,iJ=ix+" "+iC,iZ="Windows",iK=iZ+" Phone",iQ="Nokia",i0="Ouya",i1="Generic",i2=i1+" "+ix.toLowerCase(),i3=i1+" "+iS.toLowerCase(),i5="Konqueror",i8="(\\d+(\\.\\d+)?)",i6=RegExp("Version/"+i8),i4=RegExp(iY,"i"),i7=RegExp(iz+" \\w+","i"),i9=RegExp(iG+" \\w+","i"),re=RegExp(iO+"|PlayBook|BB10","i"),rt={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},ri=function(e,t){let i;return t=t||"",E(e," OPR/")&&E(e,"Mini")?iq:E(e," OPR/")?iU:re.test(e)?iO:E(e,"IE"+ix)||E(e,"WPDesktop")?ij:E(e,iT)?iM:E(e,iH)||E(e,"Edg/")?iB:E(e,"FBIOS")?"Facebook "+ix:E(e,"UCWEB")||E(e,"UCBrowser")?"UC Browser":E(e,"CriOS")?iD:E(e,"CrMo")||E(e,iA)?iA:E(e,ik)&&E(e,iC)?iX:E(e,"FxiOS")?iW:E(e.toLowerCase(),i5.toLowerCase())?i5:(i=t)&&E(i,iF)||E(e,iC)&&!E(e,iA)&&!E(e,ik)?E(e,ix)?iJ:iC:E(e,iV)?iV:E(e,"MSIE")||E(e,"Trident/")?iN:E(e,"Gecko")?iV:""},rr={[ij]:[RegExp("rv:"+i8)],[iB]:[RegExp(iH+"?\\/"+i8)],[iA]:[RegExp("("+iA+"|CrMo)\\/"+i8)],[iD]:[RegExp("CriOS\\/"+i8)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+i8)],[iC]:[i6],[iJ]:[i6],[iU]:[RegExp("(Opera|OPR)\\/"+i8)],[iV]:[RegExp(iV+"\\/"+i8)],[iW]:[RegExp("FxiOS\\/"+i8)],[i5]:[RegExp("Konqueror[:/]?"+i8,"i")],[iO]:[RegExp(iO+" "+i8),i6],[iX]:[RegExp("android\\s"+i8,"i")],[iM]:[RegExp(iT+"\\/"+i8)],[iN]:[RegExp("(rv:|MSIE )"+i8)],Mozilla:[RegExp("rv:"+i8)]},rs=function(e,t){var i=rr[ri(e,t)];if(T(i))return null;for(var r=0;r<i.length;r++){var s=i[r],n=e.match(s);if(n)return parseFloat(n[n.length-2])}return null},rn=[[RegExp(iY+"; "+iY+" (.*?)[);]","i"),e=>[iY,e&&e[1]||""]],[RegExp(iG,"i"),[iG,""]],[RegExp(iz,"i"),[iz,""]],[re,[iO,""]],[RegExp(iZ,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[iK,""];if(new RegExp(ix).test(t)&&!/IEMobile\b/.test(t))return[iZ+" "+ix,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=rt[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[iZ,r]}return[iZ,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=T(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ik+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ik+")","i"),e=>e&&e[2]?[ik,[e[2],e[3],e[4]||"0"].join(".")]:[ik,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[iL,""]],[/Linux|debian/i,["Linux",""]]],ra=function(e){return i9.test(e)?iG:i7.test(e)?iz:i4.test(e)?iY:RegExp(i0,"i").test(e)?i0:RegExp("("+iK+"|WPDesktop)","i").test(e)?iK:/iPad/.test(e)?i$:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?iI:re.test(e)?iO:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(iQ,"i").test(e)?iQ:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(ix).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ik:iP:ik:RegExp("(pda|"+ix+")","i").test(e)?i2:RegExp(iS,"i").test(e)&&!RegExp(iS+" pc","i").test(e)?i3:""},ro="https?://(.*)",rl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rc=eC(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rl),ru="<masked>",rh=["li_fat_id"];function rd(e,t,i){if(!c)return{};var r,s=t?eC([],rl,i||[]):[],n=rp(tU(c.URL,s,ru),e);return eI((r={},eF(rh,function(e){var t=t1.q(e);r[e]=t||null}),r),n)}function rp(e,t){var i=rc.concat(t||[]),r={};return eF(i,function(t){var i=tj(e,t);r[t]=i||null}),r}function rg(e){var t=e?0===e.search(ro+"google.([^/?]*)")?"google":0===e.search(ro+"bing.com")?"bing":0===e.search(ro+"yahoo.com")?"yahoo":0===e.search(ro+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!L(t)){i.$search_engine=t;var r=c?tj(c.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function r_(){return navigator.language||navigator.userLanguage}function rv(){return(null==c?void 0:c.referrer)||"$direct"}function rf(e,t){var i=e?eC([],rl,t||[]):[],r=null==u?void 0:u.href.substring(0,1e3);return{r:rv().substring(0,1e3),u:r?tU(r,i,ru):void 0}}function rm(e){var t,{r:i,u:r}=e,s={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=tD(i))?void 0:t.host};if(r){s.$current_url=r;var n=tD(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname,eI(s,rp(r))}return i&&eI(s,rg(i)),s}function ry(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rb=ex("[Web Vitals]");class rw{constructor(e){var t;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(T(i))rb.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.Tt();T(r)||(D(null==e?void 0:e.name)||D(null==e?void 0:e.value)?rb.error("Invalid metric received",e):this.Rt&&e.value>=this.Rt?rb.error("Ignoring metric with value >= "+this.Rt,e):(this.N.url!==r&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),T(this.N.url)&&(this.N.url=r),this.N.firstMetricTimestamp=T(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.N.metrics.push(y({},e,{$current_url:r,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var e,t,i,r,s=_.__PosthogExtensions__;T(s)||T(s.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=s.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.Pt.bind(this)),this.P=!0):rb.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!(null==(t=this._instance.persistence)||!t.props[eG]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=O(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return T(i)?(null==(t=this._instance.persistence)?void 0:t.props[eY])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(O(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=O(this._instance.config.capture_performance)&&N(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return rb.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=O(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:j(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return j(t)?t:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(rb.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=O(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=O(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[eG]:t}),this._instance.persistence.register({[eY]:i})),this.Et=t,this.startIfEnabled()}it(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks&&e(),null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"web-vitals",t=>{t?rb.error("failed to load script",t):e()})}Tt(){var e=r?r.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties;return tU(e,t?eC([],rl,i||[]):[],ru)}rb.error("Could not determine current URL")}}var rE=ex("[Heatmaps]");function rx(e){return O(e)&&"clientX"in e&&"clientY"in e&&N(e.clientX)&&N(e.clientY)}class rk{constructor(e){var t;this.rageclicks=new tM,this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!(null==(t=this.instance.persistence)||!t.props[eH])}get flushIntervalMilliseconds(){var e=5e3;return O(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return T(this.instance.config.capture_heatmaps)?T(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.P||(rE.info("starting..."),this.Ct(),this.Ot());else{var e;clearInterval(null!=(e=this.It)?e:void 0),this.Ft(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[eH]:t}),this.Et=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Mt(e){this.At(e.originalEvent,"deadclick")}Ot(){this.It&&clearInterval(this.It),this.It="visible"===(null==c?void 0:c.visibilityState)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ct(){r&&c&&(this.jt=this.Dt.bind(this),eD(r,"beforeunload",this.jt),this.Lt=e=>this.At(e||(null==r?void 0:r.event)),eD(c,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||(null==r?void 0:r.event)),eD(c,"mousemove",this.Nt,{capture:!0}),this.zt=new ia(this.instance,ir,this.Mt.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ot.bind(this),eD(c,"visibilitychange",this.Ht),this.P=!0)}Ft(){var e;r&&c&&(this.jt&&r.removeEventListener("beforeunload",this.jt),this.Lt&&c.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&c.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&c.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),null==(e=this.zt)||e.stop(),this.P=!1)}qt(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var s=e;s&&to(s)&&!tl(s,"body")&&s!==i;){if(E(t,null==r?void 0:r.getComputedStyle(s).position))return!0;s=ty(s)}return!1}(tv(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}At(e,t){var i;if(void 0===t&&(t="click"),!ta(e.target)&&rx(e)){var r=this.qt(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Wt(y({},r,{type:"rageclick"})),this.Wt(r)}}Ut(e){!ta(e.target)&&rx(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout(()=>{this.Wt(this.qt(e,"mousemove"))},500))}Wt(e){if(r){var t=r.location.href,i=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=tU(t,i?eC([],rl,s||[]):[],ru);this.N=this.N||{},this.N[n]||(this.N[n]=[]),this.N[n].push(e)}}Dt(){this.N&&!R(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class rS{constructor(e){this._instance=e}doPageView(e,t){var i,s=this.Gt(e,t);return this.Vt={pathname:null!=(i=null==r?void 0:r.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Gt(e,null==(t=this.Vt)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Vt)?void 0:e.pageViewId}}Gt(e,t){var i=this.Vt;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:a,maxScrollY:o,maxContentHeight:l,lastContentY:c,maxContentY:u}=s;if(!(T(n)||T(a)||T(o)||T(l)||T(c)||T(u))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:z(a/n,0,1,eE),d=n<=1?1:z(o/n,0,1,eE),p=l<=1?1:z(c/l,0,1,eE),g=l<=1?1:z(u/l,0,1,eE);r=eI(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var rP=Uint8Array,r$=Uint16Array,rF=Uint32Array,rI=new rP([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]),rC=new rP([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]),rO=new rP([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rR=function(e,t){for(var i=new r$(31),r=0;r<31;++r)i[r]=t+=1<<e[r-1];var s=new rF(i[30]);for(r=1;r<30;++r)for(var n=i[r];n<i[r+1];++n)s[n]=n-i[r]<<5|r;return[i,s]},rT=rR(rI,2),rM=rT[0],rA=rT[1];rM[28]=258,rA[258]=28;for(var rL=rR(rC,0)[1],rD=new r$(32768),rN=0;rN<32768;++rN){var rj=(43690&rN)>>>1|(21845&rN)<<1;rj=(61680&(rj=(52428&rj)>>>2|(13107&rj)<<2))>>>4|(3855&rj)<<4,rD[rN]=((65280&rj)>>>8|(255&rj)<<8)>>>1}var rU=function(e,t,i){for(var r=e.length,s=0,n=new r$(t);s<r;++s)++n[e[s]-1];var a,o=new r$(t);for(s=0;s<t;++s)o[s]=o[s-1]+n[s-1]<<1;if(i){a=new r$(1<<t);var l=15-t;for(s=0;s<r;++s)if(e[s])for(var c=s<<4|e[s],u=t-e[s],h=o[e[s]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)a[rD[h]>>>l]=c}else for(a=new r$(r),s=0;s<r;++s)a[s]=rD[o[e[s]-1]++]>>>15-e[s];return a},rq=new rP(288);for(rN=0;rN<144;++rN)rq[rN]=8;for(rN=144;rN<256;++rN)rq[rN]=9;for(rN=256;rN<280;++rN)rq[rN]=7;for(rN=280;rN<288;++rN)rq[rN]=8;var rH=new rP(32);for(rN=0;rN<32;++rN)rH[rN]=5;var rB=rU(rq,9,0),rV=rU(rH,5,0),rW=function(e){return(e/8|0)+(7&e&&1)},rG=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof r$?r$:e instanceof rF?rF:rP)(i-t);return r.set(e.subarray(t,i)),r},rz=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8},rY=function(e,t,i){i<<=7&t;var r=t/8|0;e[r]|=i,e[r+1]|=i>>>8,e[r+2]|=i>>>16},rX=function(e,t){for(var i=[],r=0;r<e.length;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new rP(0),0];if(1==s){var a=new rP(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=s-1;)o=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(r=1;r<s;++r)n[r].s>d&&(d=n[r].s);var p=new r$(d+1),g=rJ(i[u-1],p,0);if(g>t){r=0;var _=0,v=g-t,f=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r<s;++r){var m=n[r].s;if(!(p[m]>t))break;_+=f-(1<<g-p[m]),p[m]=t}for(_>>>=v;_>0;){var y=n[r].s;p[y]<t?_-=1<<t-p[y]++-1:++r}for(;r>=0&&_;--r){var b=n[r].s;p[b]==t&&(--p[b],++_)}g=t}return[new rP(p),g]},rJ=function(e,t,i){return -1==e.s?Math.max(rJ(e.l,t,i+1),rJ(e.r,t,i+1)):t[e.s]=i},rZ=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new r$(++t),r=0,s=e[0],n=1,a=function(e){i[r++]=e},o=1;o<=t;++o)if(e[o]==s&&o!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=e[o]}return[i.subarray(0,r),t]},rK=function(e,t){for(var i=0,r=0;r<t.length;++r)i+=e[r]*t[r];return i},rQ=function(e,t,i){var r=i.length,s=rW(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;n<r;++n)e[s+n+4]=i[n];return 8*(s+4+r)},r0=function(e,t,i,r,s,n,a,o,l,c,u){rz(t,u++,i),++s[256];for(var h=rX(s,15),d=h[0],p=h[1],g=rX(n,15),_=g[0],v=g[1],f=rZ(d),m=f[0],y=f[1],b=rZ(_),w=b[0],E=b[1],x=new r$(19),k=0;k<m.length;++k)x[31&m[k]]++;for(k=0;k<w.length;++k)x[31&w[k]]++;for(var S=rX(x,7),P=S[0],$=S[1],F=19;F>4&&!P[rO[F-1]];--F);var I,C,O,R,T=c+5<<3,M=rK(s,rq)+rK(n,rH)+a,A=rK(s,d)+rK(n,_)+a+14+3*F+rK(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(T<=M&&T<=A)return rQ(t,u,e.subarray(l,l+c));if(rz(t,u,1+(A<M)),u+=2,A<M){I=rU(d,p,0),C=d,O=rU(_,v,0),R=_;var L=rU(P,$,0);for(rz(t,u,y-257),rz(t,u+5,E-1),rz(t,u+10,F-4),u+=14,k=0;k<F;++k)rz(t,u+3*k,P[rO[k]]);u+=3*F;for(var D=[m,w],N=0;N<2;++N){var j=D[N];for(k=0;k<j.length;++k){var U=31&j[k];rz(t,u,L[U]),u+=P[U],U>15&&(rz(t,u,j[k]>>>5&127),u+=j[k]>>>12)}}}else I=rB,C=rq,O=rV,R=rH;for(k=0;k<o;++k)if(r[k]>255){rY(t,u,I[(U=r[k]>>>18&31)+257]),u+=C[U+257],U>7&&(rz(t,u,r[k]>>>23&31),u+=rI[U]);var q=31&r[k];rY(t,u,O[q]),u+=R[q],q>3&&(rY(t,u,r[k]>>>5&8191),u+=rC[q])}else rY(t,u,I[r[k]]),u+=C[r[k]];return rY(t,u,I[256]),u+C[256]},r1=new rF([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),r2=function(){for(var e=new rF(256),t=0;t<256;++t){for(var i=t,r=9;--r;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),r3=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},r5=function(e){var t,i,r,s,n="";for(t=i=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<r;s++){var a=e.charCodeAt(s),o=null;a<128?i++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),L(o)||(i>t&&(n+=e.substring(t,i)),n+=o,t=i=s+1)}return i>t&&(n+=e.substring(t,e.length)),n},r8=!!d||!!h,r6="text/plain",r4=function(e,t,i){void 0===i&&(i=!0);var r,[s,n]=e.split("?"),a=y({},t),o=null!=(r=null==n?void 0:n.split("&").map(e=>{var t,[r,s]=e.split("="),n=i&&null!=(t=a[r])?t:s;return delete a[r],r+"="+n}))?r:[],l=tN(a);return l&&o.push(l),s+"?"+o.join("&")},r7=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),r9=e=>{var{data:t,compression:i}=e;if(t){if(i===tL.GZipJS){var r=new Blob([function(e,t){void 0===t&&(t={});var i=(s=0xffffffff,{p:function(e){for(var t=s,i=0;i<e.length;++i)t=r2[255&t^e[i]]^t>>>8;s=t},d:function(){return 0xffffffff^s}}),r=e.length;i.p(e);var s,n,a,o,l=(n=t,a=10+((o=t).filename&&o.filename.length+1||0),function(e,t,i,r,s,n){var a=e.length,o=new rP(r+a+5*(1+Math.floor(a/7e3))+8),l=o.subarray(r,o.length-s),c=0;if(!t||a<8)for(var u=0;u<=a;u+=65535){var h=u+65535;h<a?c=rQ(l,c,e.subarray(u,h)):(l[u]=n,c=rQ(l,c,e.subarray(u,a)))}else{for(var d=r1[t-1],p=d>>>13,g=8191&d,_=(1<<i)-1,v=new r$(32768),f=new r$(_+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&_},w=new rF(25e3),E=new r$(288),x=new r$(32),k=0,S=0,P=(u=0,0),$=0,F=0;u<a;++u){var I=b(u),C=32767&u,O=f[I];if(v[C]=O,f[I]=C,$<=u){var R=a-u;if((k>7e3||P>24576)&&R>423){c=r0(e,l,0,w,E,x,S,P,F,u-F,c),P=k=S=0,F=u;for(var T=0;T<286;++T)E[T]=0;for(T=0;T<30;++T)x[T]=0}var M=2,A=0,L=g,D=C-O&32767;if(R>2&&I==b(u-D))for(var N=Math.min(p,R)-1,j=Math.min(32767,u),U=Math.min(258,R);D<=j&&--L&&C!=O;){if(e[u+M]==e[u+M-D]){for(var q=0;q<U&&e[u+q]==e[u+q-D];++q);if(q>M){if(M=q,A=D,q>N)break;var H=Math.min(D,q-2),B=0;for(T=0;T<H;++T){var V=u-D+T+32768&32767,W=V-v[V]+32768&32767;W>B&&(B=W,O=V)}}}D+=(C=O)-(O=v[C])+32768&32767}if(A){w[P++]=0x10000000|rA[M]<<18|rL[A];var G=31&rA[M],z=31&rL[A];S+=rI[G]+rC[z],++E[257+G],++x[z],$=u+M,++k}else w[P++]=e[u],++E[e[u]]}}c=r0(e,l,n,w,E,x,S,P,F,u-F,c)}return rG(o,0,r+rW(c)+s)}(e,null==n.level?6:n.level,null==n.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+n.mem,a,8,!0)),c=l.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&r3(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;r<=i.length;++r)e[r+10]=i.charCodeAt(r)}}(l,t),r3(l,c-8,i.d()),r3(l,c-4,r),l}(function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new rP(e.length+(e.length>>>1)),s=0,n=function(e){r[s++]=e},a=0;a<i;++a){if(s+5>r.length){var o=new rP(s+8+(i-a<<1));o.set(r),r=o}var l=e.charCodeAt(a);l<128?n(l):(l<2048?n(192|l>>>6):(l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return rG(r,0,s)}(r7(t)),{mtime:0})],{type:r6});return{contentType:r6,body:r,estimatedSize:r.size}}if(i===tL.Base64){var s=(e=>"data="+encodeURIComponent("string"==typeof e?e:r7(e)))(function(e){var t,i,r,s,n,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=0,l=0,c="",u=[];if(!e)return e;e=r5(e);do t=(n=e.charCodeAt(o++)<<16|e.charCodeAt(o++)<<8|e.charCodeAt(o++))>>18&63,i=n>>12&63,r=n>>6&63,s=63&n,u[l++]=a.charAt(t)+a.charAt(i)+a.charAt(r)+a.charAt(s);while(o<e.length);switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(r7(t)));return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var n=r7(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},se=[];h&&se.push({transport:"fetch",method:e=>{var t,i,{contentType:r,body:s,estimatedSize:n}=null!=(t=r9(e))?t:{},a=new Headers;eF(e.headers,function(e,t){a.append(t,e)}),r&&a.append("Content-Type",r);var o=e.url,l=null;if(p){var c=new p;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}h(o,y({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&52428.8>(n||0),body:s,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){eE.error(e)}null==e.callback||e.callback(r)})).catch(t=>{eE.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),d&&se.push({transport:"XHR",method:e=>{var t,i=new d;i.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=null!=(t=r9(e))?t:{};eF(e.headers,function(e,t){i.setRequestHeader(t,e)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(s)}}),null!=l&&l.sendBeacon&&se.push({transport:"sendBeacon",method:e=>{var t=r4(e.url,{beacon:"1"});try{var i,{contentType:r,body:s}=null!=(i=r9(e))?i:{},n="string"==typeof s?new Blob([s],{type:r}):s;l.sendBeacon(t,n)}catch(e){}}});var st=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function si(e,t,i){return r7({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var sr={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>st(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!st(t,e))),icontains:(e,t)=>t.map(ss).some(t=>e.map(ss).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ss).every(t=>e.map(ss).every(e=>!t.includes(e)))},ss=e=>e.toLowerCase(),sn=ex("[Error tracking]");class sa{constructor(e){var t,i;this.Jt=[],this.Kt=new ec([new eu,new eb,new ed,new eh,new em,new ef,new eg,new ey],[es,eo]),this._instance=e,this.Jt=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(eV))?t:[]}onRemoteConfig(e){var t,i,r,s=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.Jt=s,this._instance.persistence&&this._instance.persistence.register({[eV]:this.Jt,[eW]:n})}get Yt(){var e,t=!!this._instance.get_property(eW),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Kt.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Xt(t)){if(this.Qt(t))return void sn.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(t))return void sn.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(t))return void sn.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var{type:i,value:r}=t;return M(i)&&i.length>0&&e.$exception_types.push(i),M(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.Jt.some(e=>{var i=e.values.map(e=>{var i,r=sr[e.operator],s=I(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return s.length>0&&r(s,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}Zt(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ti(e){if(e.length>0){var t,i,r,s,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(r=null==a||null==(s=a.filename)?void 0:s.includes("posthog.com/static"))&&r}return!1}Xt(e){return!D(e)&&I(e)}}var so=ex("[FeatureFlags]"),sl="$active_feature_flags",sc="$override_feature_flags",su="$feature_flag_payloads",sh="$override_feature_flag_payloads",sd="$feature_flag_request_id",sp=e=>{var t={};for(var[i,r]of eO(e||{}))r&&(t[i]=r);return t},sg=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({});class s_{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||so.error("Invalid evaluation environment found:",e,"Expected non-empty string"),t}):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(e0),t=this._instance.get_property(sc),i=this._instance.get_property(sh);if(!i&&!t)return e||{};var r=eI({},e||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=r[s],l=null==t?void 0:t[s],c=T(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,u=T(l)?o.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[s],d=y({},o,{enabled:c,variant:c?null!=u?u:null==o?void 0:o.variant:void 0});c!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),u!==(null==o?void 0:o.variant)&&(d.original_variant=null==o?void 0:o.variant),h&&(d.metadata=y({},null==o?void 0:o.metadata,{payload:h,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),r[s]=d}return this.ii||(so.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ii=!0),r}getFlagVariants(){var e=this._instance.get_property(eK),t=this._instance.get_property(sc);if(!t)return e||{};for(var i=eI({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this.ii||(so.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(su),t=this._instance.get_property(sh);if(!t)return e||{};for(var i=eI({},e||{}),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this.ii||(so.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout(()=>{this.di()},5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}di(e){var t;if(this.vi(),!this._instance.M())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(e1)||{}),group_properties:this._instance.get_property(e2)};(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var r=this._instance.config.__preview_remote_config,s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",n=this._instance.requestRouter.endpointFor("api",(r?"/flags/?v=2":"/flags/?v=2&config=true")+s);r&&(i.timezone=ry()),this.ri=!0,this._instance.ci({method:"POST",url:n,data:i,compression:this._instance.config.disable_compression?void 0:tL.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,r,s,n=!0;200===e.statusCode&&(this.ni||(this.$anon_distinct_id=void 0),n=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi(null!=(s=e.json)?s:{})),(!i.disable_flags||this.ni)&&((this.ai=!n,e.json&&null!=(r=e.json.quotaLimited)&&r.includes(sg.FeatureFlags))?so.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(i.disable_flags||this.receivedFeatureFlags(null!=(t=e.json)?t:{},n),this.ni&&(this.ni=!1,this.di())))}})}}getFeatureFlag(e,t){if(void 0===t&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,s=this._instance.get_property(sd)||void 0,n=this._instance.get_property(e8)||{};if((t.send_event||!("send_event"in t))&&(!(e in n)||!n[e].includes(r))){I(n[e])?n[e].push(r):n[e]=[r],null==(l=this._instance.persistence)||l.register({[e8]:n});var a=this.getFeatureFlagDetails(e),o={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:s,$feature_flag_bootstrapped_response:(null==(c=this._instance.config.bootstrap)||null==(c=c.featureFlags)?void 0:c[e])||null,$feature_flag_bootstrapped_payload:(null==(u=this._instance.config.bootstrap)||null==(u=u.featureFlagPayloads)?void 0:u[e])||null,$used_bootstrap_value:!this.ai};T(null==a||null==(h=a.metadata)?void 0:h.version)||(o.$feature_flag_version=a.metadata.version);var l,c,u,h,d,p,g,_,v,f,m=null!=(d=null==a||null==(p=a.reason)?void 0:p.description)?d:null==a||null==(g=a.reason)?void 0:g.code;m&&(o.$feature_flag_reason=m),null!=a&&null!=(_=a.metadata)&&_.id&&(o.$feature_flag_id=a.metadata.id),T(null==a?void 0:a.original_variant)&&T(null==a?void 0:a.original_enabled)||(o.$feature_flag_original_response=T(a.original_variant)?a.original_enabled:a.original_variant),null!=a&&null!=(v=a.metadata)&&v.original_payload&&(o.$feature_flag_original_payload=null==a||null==(f=a.metadata)?void 0:f.original_payload),this._instance.capture("$feature_flag_called",o)}return i}so.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(r.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:tL.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var r,s=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return T(i)?void 0:!!i}so.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),s=this.getFlagsWithDetails();!function(e,t,i,r,s){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var n,a=((n=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(n).map(e=>{var t;return[e,null!=(t=n[e].variant)?t:n[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(n).filter(e=>n[e].enabled).filter(e=>{var t;return null==(t=n[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))):so.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),o=a.flags,l=a.featureFlags,c=a.featureFlagPayloads;if(l){var u=e.requestId;if(I(l)){so.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var d=0;d<l.length;d++)h[l[d]]=!0;t&&t.register({[sl]:l,[eK]:h})}else{var p=l,g=c,_=o;e.errorsWhileComputingFlags&&(p=y({},i,p),g=y({},r,g),_=y({},s,_)),t&&t.register(y({[sl]:Object.keys(sp(p)),[eK]:p||{},[su]:g||{},[e0]:_||{}},u?{[sd]:u}:{}))}}}(e,this._instance.persistence,i,r,s),this.pi(t)}}override(e,t){void 0===t&&(t=!1),so.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return so.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(sc),this._instance.persistence.unregister(sh),void this.pi();if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.ii=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(sc);else if(e.flags)if(I(e.flags)){for(var i={},r=0;r<e.flags.length;r++)i[e.flags[r]]=!0;this._instance.persistence.register({[sc]:i})}else this._instance.persistence.register({[sc]:e.flags})}return"payloads"in e&&(!1===e.payloads?this._instance.persistence.unregister(sh):e.payloads&&this._instance.persistence.register({[sh]:e.payloads})),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:t,flagVariants:i}=this.gi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this._instance.get_property(eQ)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=y({},this.getFlagVariants(),{[e]:t});null==(r=this._instance.persistence)||r.register({[sl]:Object.keys(sp(o)),[eK]:o}),this.pi()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this._instance.get_property(eQ),s=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+s),method:"GET",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(eQ),null==(r=this._instance.persistence)||r.register({[eQ]:s}),e(s)}}})}gi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}pi(e){var{flags:t,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(e1)||{};this._instance.register({[e1]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(e1)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(e2)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[e2]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(e2)||{};this._instance.register({[e2]:y({},t,{[e]:{}})})}else this._instance.unregister(e2)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var sv=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class sf{constructor(e,t){this.C=e,this.props={},this.mi=!1,this.yi=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&eE.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wi}bi(e){-1===sv.indexOf(e.persistence.toLowerCase())&&(eE.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&t3.H()?t3:"localstorage+cookie"===t&&t8.H()?t8:"sessionstorage"===t&&t9.H()?t9:"memory"===t?t4:"cookie"===t?t1:t8.H()?t8:t1}properties(){var e={};return eF(this.props,function(t,i){if(i===eK&&O(t))for(var r,s=Object.keys(t),n=0;n<s.length;n++)e["$feature/"+s[n]]=t[s[n]];else r=!1,(L(tn)?r:o&&tn.indexOf===o?-1!=tn.indexOf(i):(eF(tn,function(e){if(r||(r=e===i))return eP}),r))||(e[i]=t)}),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=eI({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.C.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(O(e)){T(t)&&(t="None"),this.xi=T(i)?this.$i:i;var r=!1;if(eF(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(O(e)){this.xi=T(t)?this.$i:t;var i=!1;if(eF(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.props[r]=t,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=rd(this.C.custom_campaign_params,this.C.mask_personal_data_properties,this.C.custom_personal_data_properties);R(eM(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=null==c?void 0:c.referrer)?rg(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rv(),$referring_domain:null!=c&&c.referrer&&(null==(e=tD(c.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[e9]||this.props[te]||this.register_once({[tt]:rf(this.C.mask_personal_data_properties,this.C.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};eF([te,e9],t=>{var i=this.props[t];i&&eF(i,function(t,i){e["$initial_"+k(i)]=t})});var t,i,r=this.props[tt];return r&&eI(e,(t=rm(r),i={},eF(t,function(e,t){i["$initial_"+k(t)]=e}),i)),e}safe_merge(e){return eF(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.bi(e),s=this.props;this.clear(),this.Y=r,this.props=s,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[eU]||{};i[e]=t,this.props[eU]=i,this.save()}remove_event_timer(e){var t=(this.props[eU]||{})[e];return T(t)||(delete this.props[eU][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}(function(e){e.Button="button",e.Tab="tab",e.Selector="selector"})({}),function(e){e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger"}({});var sm=function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e}({}),sy=(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}({}),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}({}),function(e){e.Once="once",e.Recurring="recurring",e.Always="always"}({}),function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({})),sb=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),sw=function(e){return e.Popover="popover",e.Inline="inline",e}({});class sE{constructor(){this.ki={},this.ki={}}on(e,t){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(t),()=>{this.ki[e]=this.ki[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.ki[e]||[])i(t);for(var r of this.ki["*"]||[])r(e,t)}}class sx{constructor(e){this.Pi=new sE,this.Ti=(e,t)=>this.Ri(e,t)&&this.Ii(e,t)&&this.Ci(e,t),this.Ri=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Oi=new Set,this.Fi=new Set}init(){var e,t;T(null==(e=this._instance)?void 0:e.Mi)||null==(t=this._instance)||t.Mi((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!T(null==(t=this._instance)?void 0:t.Mi)&&(e.forEach(e=>{var t,i;null==(t=this.Fi)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Oi)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Oi.has(e)||this.Oi.has(null==t?void 0:t.event))&&this.Fi&&(null==(i=this.Fi)?void 0:i.size)>0&&this.Fi.forEach(e=>{this.Ai(t,e)&&this.Pi.emit("actionCaptured",e.name)})}Di(e){this.onAction("actionCaptured",t=>e(t))}Ai(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,t){return this.Pi.on(e,t)}Ii(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!sx.ji(r,null==t?void 0:t.url,(null==t?void 0:t.url_matching)||"contains"))return!1}return!0}static ji(e,t,i){switch(i){case"regex":return!!r&&st(e,t);case"exact":return t===e;case"contains":return st(e,sx.Li(t).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}static Li(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ci(e,t){if((null!=t&&t.href||null!=t&&t.tag_name||null!=t&&t.text)&&!this.Ni(e).some(e=>!(null!=t&&t.href&&!sx.ji(e.href||"",null==t?void 0:t.href,(null==t?void 0:t.href_matching)||"exact"))&&(null==t||!t.tag_name||e.tag_name===(null==t?void 0:t.tag_name))&&!(null!=t&&t.text&&!sx.ji(e.text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact")&&!sx.ji(e.$el_text||"",null==t?void 0:t.text,(null==t?void 0:t.text_matching)||"exact"))))return!1;if(null!=t&&t.selector){var i,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(!r||!r.includes(null==t?void 0:t.selector))return!1}return!0}Ni(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}var sk=ex("[Surveys]"),sS="seenSurvey_",sP=e=>{var t=""+sS+e.id;return e.current_iteration&&e.current_iteration>0&&(t=""+sS+e.id+"_"+e.current_iteration),t},s$=[sm.Popover,sm.Widget,sm.API],sF={ignoreConditions:!1,ignoreDelay:!1,displayType:sw.Popover};class sI{constructor(e){this._instance=e,this.Ui=new Map,this.zi=new Map}register(e){var t;T(null==(t=this._instance)?void 0:t.Mi)||(this.Hi(e),this.Bi(e))}Bi(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.qi&&(this.qi=new sx(this._instance),this.qi.init(),this.qi.Di(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.qi)||s.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.zi.get(t.name);i&&i.push(e.id),this.zi.set(t.name,i||[e.id])}}))}))}Hi(e){var t;0!==e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}).length&&(null==(t=this._instance)||t.Mi((e,t)=>{this.onEvent(e,t)}),e.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||t.forEach(t=>{if(t&&t.name){var i=this.Ui.get(t.name);i&&i.push(e.id),this.Ui.set(t.name,i||[e.id])}})}))}onEvent(e,t){var i,r,s=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[e5])||[];if(sy.SHOWN===e&&t&&s.length>0){sk.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:s});var n,a=null==t||null==(n=t.properties)?void 0:n.$survey_id;if(a){var o=s.indexOf(a);o>=0&&(s.splice(o,1),this.Wi(s))}}else if(this.Ui.has(e)){sk.info("survey event name matched",{event:e,eventPayload:t,surveys:this.Ui.get(e)});var l=[];null==(r=this._instance)||r.getSurveys(t=>{l=t.filter(t=>{var i;return null==(i=this.Ui.get(e))?void 0:i.includes(t.id)})});var c=l.filter(i=>{var r,s=null==(r=i.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.find(t=>t.name===e);return!!s&&(!s.propertyFilters||Object.entries(s.propertyFilters).every(e=>{var i,[r,s]=e,n=null==t||null==(i=t.properties)?void 0:i[r];if(T(n)||L(n))return!1;var a=[String(n)],o=sr[s.operator];return o?o(s.values,a):(sk.warn("Unknown property comparison operator: "+s.operator),!1)}))});this.Wi(s.concat(c.map(e=>e.id)||[]))}}onAction(e){var t,i=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[e5])||[];this.zi.has(e)&&this.Wi(i.concat(this.zi.get(e)||[]))}Wi(e){var t;sk.info("updating activated surveys",{activatedSurveys:e}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[e5]:[...new Set(e)]})}getSurveys(){var e;return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[e5])||[]}getEventToSurveys(){return this.Ui}Gi(){return this.qi}}class sC{constructor(e){this.Vi=void 0,this._surveyManager=null,this.Ji=!1,this.Ki=!1,this.Yi=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(D(t))return sk.warn("Flags not loaded yet. Not loading surveys.");var i=I(t);this.Vi=i?t.length>0:t,sk.info("flags response received, isSurveysEnabled: "+this.Vi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(sS)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.Ki)sk.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)sk.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())sk.info("Not loading surveys in cookieless mode without consent.");else{var e=null==_?void 0:_.__PosthogExtensions__;if(e){if(!T(this.Vi)||this._instance.config.advanced_enable_surveys){var t=this.Vi||this._instance.config.advanced_enable_surveys;this.Ki=!0;try{var i=e.generateSurveys;if(i)return void this.Xi(i,t);var r=e.loadExternalDependency;if(!r)return void this.Qi("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.Qi("Could not load surveys script",i):this.Xi(e.generateSurveys,t)})}catch(e){throw this.Qi("Error initializing surveys",e),e}finally{this.Ki=!1}}}else sk.error("PostHog Extensions not found.")}}Xi(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new sI(this._instance),sk.info("Surveys loaded successfully"),this.Zi({isLoaded:!0})}Qi(e,t){sk.error(e,t),this.Zi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yi.push(e),this._surveyManager&&this.Zi({isLoaded:!0}),()=>{this.Yi=this.Yi.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return sk.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(e3);if(i&&!t)return e(i,{isLoaded:!0});if(this.Ji)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ji=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{this.Ji=!1;var i=t.statusCode;if(200!==i||!t.json){var r="Surveys API could not be loaded, status: "+i;return sk.error(r),e([],{isLoaded:!1,error:r})}var s,n,a=t.json.surveys||[],o=a.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});return o.length>0&&(null==(n=this._surveyEventReceiver)||n.register(o)),null==(s=this._instance.persistence)||s.register({[e3]:a}),e(a,{isLoaded:!0})}})}catch(e){throw this.Ji=!1,e}}Zi(e){for(var t of this.Yi)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){sk.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!D(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);sk.warn("init was not called")}te(e){var t=null;return this.getSurveys(i=>{var r;t=null!=(r=i.find(t=>t.id===e))?r:null}),t}ie(e){if(D(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.te(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(D(this._surveyManager))return sk.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ie(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return D(this._surveyManager)?(sk.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!=(r=t.find(t=>t.id===e))?r:null;if(s){var n=this.ie(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){var i;if(D(this._surveyManager))sk.warn("init was not called");else{var r="string"==typeof e?this.te(e):e;if(null!=r&&r.id)if(s$.includes(r.type)){var s=null==c?void 0:c.querySelector(t);if(s)return null!=(i=r.appearance)&&i.surveyPopupDelaySeconds?(sk.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;sk.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,s),sk.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,s);sk.warn("Survey element not found")}else sk.warn("Surveys of type "+r.type+" cannot be rendered in the app");else sk.warn("Survey not found")}}displaySurvey(e,t){var i;if(D(this._surveyManager))sk.warn("init was not called");else{var r=this.te(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=y({},r,{appearance:y({},r.appearance,{surveyPopupDelaySeconds:0})})),!1===t.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void sk.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==sw.Inline?this._surveyManager.handlePopoverSurvey(s):this.renderSurvey(s,t.selector)}else sk.warn("Survey not found")}}}var sO=ex("[RateLimiter]");class sR{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{sO.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sO.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.captureEventsPerSecond=(null==(t=e.config.rate_limiting)?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null==(i=e.config.rate_limiting)?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,r,s=(new Date).getTime(),n=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(e7))?t:{tokens:this.captureEventsBurstLimit,last:s};n.tokens+=(s-n.last)/1e3*this.captureEventsPerSecond,n.last=s,n.tokens>this.captureEventsBurstLimit&&(n.tokens=this.captureEventsBurstLimit);var a=n.tokens<1;return a||e||(n.tokens=Math.max(0,n.tokens-1)),!a||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,null==(r=this.instance.persistence)||r.set_property(e7,n),{isRateLimited:a,remainingTokens:n.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var sT=ex("[RemoteConfig]");class sM{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}ee(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(sT.error("PostHog Extensions not found. Cannot load remote config."),e())}re(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return sT.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.M())return void sT.warn("Remote config is disabled. Falling back to local config.");this.ee(e=>{if(!e)return sT.info("No config found after loading remote JS config. Falling back to JSON."),void this.re(e=>{this.fi(e)});this.fi(e)})}catch(e){sT.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):sT.info("__preview_remote_config is disabled. Logging config instead",e):sT.error("Failed to fetch remote config from PostHog.")}}class sA{constructor(e,t){this.se=!0,this.ne=[],this.oe=z((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,eE.createLogger("flush interval"),3e3),this.ae=e}enqueue(e){this.ne.push(e),this.le||this.ue()}unload(){this.he();var e=Object.values(this.ne.length>0?this.de():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.ae(y({},e,{transport:"sendBeacon"}))})}enable(){this.se=!1,this.ue()}ue(){var e=this;this.se||(this.le=setTimeout(()=>{if(this.he(),this.ne.length>0){var t=this.de();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&I(r.data)&&eF(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.ae(r)}()}},this.oe))}he(){clearTimeout(this.le),this.le=void 0}de(){var e={};return eF(this.ne,t=>{var i,r=(t?t.batchKey:null)||t.url;T(e[r])&&(e[r]=y({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.ne=[],e}}var sL=["retriesPerformedSoFar"];class sD{constructor(e){this.ve=!1,this.ce=3e3,this.ne=[],this._instance=e,this.ne=[],this.fe=!0,!T(r)&&"onLine"in r.navigator&&(this.fe=r.navigator.onLine,this.pe=()=>{this.fe=!0,this.Dt()},this.ge=()=>{this.fe=!1},eD(r,"online",this.pe),eD(r,"offline",this.ge))}get length(){return this.ne.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=b(e,sL);N(t)&&t>0&&(i.url=r4(i.url,{retry_count:t})),this._instance.ci(y({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this._e(y({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}_e(e){var t,i,r,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var n=(r=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,s)))-t/2),Math.ceil(i+r)),a=Date.now()+n;this.ne.push({retryAt:a,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),eE.warn(o),this.ve||(this.ve=!0,this.me())}me(){if(this.ye&&clearTimeout(this.ye),0===this.ne.length)return this.ve=!1,void(this.ye=void 0);this.ye=setTimeout(()=>{this.fe&&this.ne.length>0&&this.Dt(),this.me()},this.ce)}Dt(){var e=Date.now(),t=[],i=this.ne.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.ne=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.ye&&(clearTimeout(this.ye),this.ye=void 0),this.ve=!1,T(r)||(this.pe&&(r.removeEventListener("online",this.pe),this.pe=void 0),this.ge&&(r.removeEventListener("offline",this.ge),this.ge=void 0)),this.ne))try{this._instance.ci(y({},e,{transport:"sendBeacon"}))}catch(e){eE.error(e)}this.ne=[]}}class sN{constructor(e){this.be=()=>{this.we||(this.we={});var e,t,i,r,s=this.scrollElement(),n=this.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,o=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.we.lastScrollY=Math.ceil(n),this.we.maxScrollY=Math.max(n,null!=(e=this.we.maxScrollY)?e:0),this.we.maxScrollHeight=Math.max(a,null!=(t=this.we.maxScrollHeight)?t:0),this.we.lastContentY=o,this.we.maxContentY=Math.max(o,null!=(i=this.we.maxContentY)?i:0),this.we.maxContentHeight=Math.max(l,null!=(r=this.we.maxContentHeight)?r:0)},this._instance=e}getContext(){return this.we}resetContext(){var e=this.we;return setTimeout(this.be,0),e}startMeasuringScrollPosition(){eD(r,"scroll",this.be,{capture:!0}),eD(r,"scrollend",this.be,{capture:!0}),eD(r,"resize",this.be)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==r?void 0:r.document.documentElement;for(var e of I(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var t=null==r?void 0:r.document.querySelector(e);if(t)return t}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return r&&(r.scrollY||r.pageYOffset||r.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return r&&(r.scrollX||r.pageXOffset||r.document.documentElement.scrollLeft)||0}}var sj=e=>rf(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class sU{constructor(e,t,i,r){this.xe=e=>{var t=this.Se();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ee(this._instance)};this.$e.register({[e4]:i})}},this._instance=e,this.ke=t,this.$e=i,this.Ee=r||sj,this.ke.onSessionId(this.xe)}Se(){return this.$e.props[e4]}getSetOnceProps(){var e,t=null==(e=this.Se())?void 0:e.props;return t?"r"in t?rm(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return eF(eM(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+k(i)]=t}),e}}var sq=ex("[SessionId]");class sH{on(e,t){return this.Pe.on(e,t)}constructor(e,t,i){if(this.Te=[],this.Re=void 0,this.Pe=new sE,this.Ie=(e,t)=>Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.C=e.config,this.$e=e.persistence,this.Ce=void 0,this.Oe=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Fe=t||tZ,this.Me=i||tZ;var r,s=this.C.persistence_name||this.C.token,n=this.C.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*z(n,60,36e3,sq.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ae(),this.De="ph_"+s+"_window_id",this.je="ph_"+s+"_primary_window_exists",this.Le()){var a=t9.W(this.De),o=t9.W(this.je);a&&!o?this.Ce=a:t9.V(this.De),t9.G(this.je,!0)}if(null!=(r=this.C.bootstrap)&&r.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.C.bootstrap.sessionID);this.Ne(this.C.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){sq.error("Invalid sessionID in bootstrap",e)}this.Ue()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return T(this.Te)&&(this.Te=[]),this.Te.push(e),this.Oe&&e(this.Oe,this.Ce),()=>{this.Te=this.Te.filter(t=>t!==e)}}Le(){return"memory"!==this.C.persistence&&!this.$e.wi&&t9.H()}ze(e){e!==this.Ce&&(this.Ce=e,this.Le()&&t9.G(this.De,e))}He(){return this.Ce?this.Ce:this.Le()?t9.W(this.De):null}Ne(e,t,i){e===this.Oe&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Oe=e,this.$e.register({[eJ]:[t,e,i]}))}Be(){if(this.Oe&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Oe,this._sessionStartTimestamp];var e=this.$e.props[eJ];return I(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ne(null,null,null)}destroy(){clearTimeout(this.qe),this.qe=void 0,this.Re&&r&&(r.removeEventListener("beforeunload",this.Re,{capture:!1}),this.Re=void 0),this.Te=[]}Ue(){this.Re=()=>{this.Le()&&t9.V(this.je)},eD(r,"beforeunload",this.Re,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.C.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[r,s,n]=this.Be(),a=this.He(),o=N(n)&&n>0&&Math.abs(i-n)>864e5,l=!1,c=!s,u=!e&&this.Ie(i,r);c||u||o?(s=this.Fe(),a=this.Me(),sq.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}}),n=i,l=!0):a||(a=this.Me(),l=!0);var h=0===r||!e||o?i:r,d=0===n?(new Date).getTime():n;return this.ze(a),this.Ne(s,h,d),e||this.Ae(),l&&this.Te.forEach(e=>e(s,a,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}:void 0)),{sessionId:s,windowId:a,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}:void 0,lastActivityTimestamp:r}}Ae(){clearTimeout(this.qe),this.qe=setTimeout(()=>{var[e]=this.Be();if(this.Ie((new Date).getTime(),e)){var t=this.Oe;this.resetSessionId(),this.Pe.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var sB=["$set_once","$set"],sV=ex("[SiteApps]");class sW{constructor(e){this._instance=e,this.We=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ge(e,t){if(t){var i=this.globalsForEvent(t);this.We.push(i),this.We.length>1e3&&(this.We=this.We.slice(10))}}get siteAppLoaders(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Mi(this.Ge.bind(this));this.Ve=()=>{e(),this.We=[],this.Ve=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,r,s,n,a,o,l={},c=this._instance.get_property("$groups")||[];for(var[u,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:h};var{$set_once:d,$set:p}=e;return{event:y({},b(e,sB),{properties:y({},e.properties,p?{$set:y({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:y({},null!=(r=null==(s=e.properties)?void 0:s.$set_once)?r:{},d)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.We.length&&(sV.info("Processing "+this.We.length+" events for site app with id "+e.id),this.We.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Ve)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,sV.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{s(e)}});n&&(t.processEvent=n),r=!0}catch(t){sV.error("Error while initializing PostHog app with config id "+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){sV.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Je(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Ke(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){sV.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Je(),void this._instance.on("eventCaptured",e=>this.Ke(e))):void sV.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Ve)||i.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var n=function(e){var t;_["__$$ph_site_app_"+e]=s._instance,null==(t=_.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,o,t=>{if(t)return sV.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else sV.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var sG=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],sz=function(e,t){if(!e)return!1;var i=e.toLowerCase();return sG.concat(t||[]).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},sY=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&sz(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>sz(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},sX=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),sJ="i.posthog.com";class sZ{constructor(e){this.Ye={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+sJ,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ye[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=sX.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=sX.EU:this.Ye[this.apiHost]=sX.CUSTOM),this.Ye[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if(this.region===sX.CUSTOM)return this.apiHost+t;var i=sJ+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var sK={icontains:(e,t)=>!!r&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!r&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!r&&st(t.href,e),not_regex:(e,t)=>!!r&&!st(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class sQ{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{sQ.Xe("retrieved web experiments from the server"),t.Qe=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Qe&&(sQ.Xe("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Qe)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);M(r)&&e.variants[r]&&t.Ze(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];sQ.tr(n)&&t.Ze(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())sQ.Xe("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(D(this.Qe))return this.Qe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();sQ.Xe("applying feature flags",e),e.forEach(e=>{var t;if(this.Qe&&null!=(t=this.Qe)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.Qe)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.Ze(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=sQ.getWindowLocation();if(null!=e&&e.search){var t=tj(null==e?void 0:e.search,"__experiment_id"),i=tj(null==e?void 0:e.search,"__experiment_variant");t&&i&&(sQ.Xe("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.ir(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}ir(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(sQ.Xe("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Ze(r[0].name,t,r[0].variants[t].transforms))}static tr(e){return!D(e.conditions)&&sQ.er(e)&&sQ.rr(e)}static er(e){if(D(e.conditions)||D(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,r,s,n=sQ.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||sK[null!=(r=null==(s=e.conditions)?void 0:s.urlMatchType)?r:"icontains"](e.conditions.url,n))}static getWindowLocation(){return null==r?void 0:r.location}static rr(e){if(D(e.conditions)||D(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rd();if(t.utm_source){var i,r,s,n,a,o,l,c,u,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,g=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==t.utm_term;return h&&p&&g&&d}return!1}static Xe(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];eE.info("[WebExperiments] "+e,i)}Ze(e,t,i){this._is_bot()?sQ.Xe("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){sQ.Xe("applying transform of variant "+t+" for experiment "+e+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):sQ.Xe("Control variants leave the page unmodified.")}_is_bot(){return l&&this._instance?sY(l,this._instance.config.custom_blocked_useragents):void 0}}var s0=ex("[PostHog ExternalIntegrations]"),s1={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class s2{constructor(e){this._instance=e}it(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return s0.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,r,n;!s||null!=(i=_.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.it(s1[e],()=>{var i;null==(i=_.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!s&&null!=(r=_.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]&&(null==(n=_.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[r,s]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(r)}}var s3="[SessionRecording]",s5=ex(s3);class s8{get started(){var e;return!(null==(e=this.sr)||!e.isStarted)}get status(){return this.sr?this.sr.status:this.nr&&!this.ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.nr=!1,this.lr=void 0,this._instance=e,!this._instance.sessionManager)throw s5.error("started without valid sessionManager"),Error(s3+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw Error(s3+' cannot be used with cookieless_mode="always"')}get ar(){var e,t=!(null==(e=this._instance.get_property(eX))||!e.enabled),i=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return r&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.ar||null==(t=this.sr)||!t.isStarted){var i=!T(Object.assign)&&!T(Array.from);this.ar&&i?(this.ur(e),s5.info("starting")):this.stopRecording()}}ur(e){var t,i,r;this.ar&&(null!=_&&null!=(t=_.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=_.__PosthogExtensions__)&&i.initSessionRecording?this.hr(e):null==(r=_.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.dr,t=>{if(t)return s5.error("could not load recorder",t);this.hr(e)}))}stopRecording(){var e,t;null==(e=this.lr)||e.call(this),this.lr=void 0,null==(t=this.sr)||t.stop()}vr(){var e;null==(e=this._instance.persistence)||e.unregister(eZ)}cr(e){if(this._instance.persistence){var t,i,r=this._instance.persistence,s=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,s=D(i)?null:parseFloat(i);D(s)&&this.vr();var n=null==t?void 0:t.minimumDurationMilliseconds;r.register({[eX]:y({enabled:!!t},t,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:s,minimumDurationMilliseconds:T(n)?null:n,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};s(),null==(t=this.lr)||t.call(this),this.lr=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.cr(e),this.nr=!0,this.startIfEnabledOrStop()):this.nr=!0:s5.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.sr)&&i.log?this.sr.log(e,t):s5.warn("log called before recorder was ready")}get dr(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(eX);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}hr(e){var t,i;if(null==(t=_.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.sr||(this.sr=null==(i=_.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.sr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.sr.start(e)}onRRwebEmit(e){var t;null==(t=this.sr)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e;null==(e=this.sr)||e.overrideLinkedFlag()}overrideSampling(){var e;null==(e=this.sr)||e.overrideSampling()}overrideTrigger(e){var t;null==(t=this.sr)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.sr)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.sr)||!i.tryAddCustomEvent(e,t))}}var s6={},s4=()=>{},s7="posthog",s9=!r8&&-1===(null==g?void 0:g.indexOf("MSIE"))&&-1===(null==g?void 0:g.indexOf("Mozilla")),ne=e=>{var t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!M(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of eA)if(i===r)return!1;return!0}(null==c?void 0:c.location),persistence:"localStorage+cookie",persistence_name:"",loaded:s4,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:"2025-05-24"!==e||"history_change",capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",debug:u&&M(null==u?void 0:u.search)&&-1!==u.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(t=r.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;eE.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:s4,__preview_eager_load_replay:!1}},nt=e=>{var t={};T(e.process_person)||(t.person_profiles=e.process_person),T(e.xhr_headers)||(t.request_headers=e.xhr_headers),T(e.cookie_name)||(t.persistence_name=e.cookie_name),T(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),T(e.store_google)||(t.save_campaign_params=e.store_google),T(e.verbose)||(t.debug=e.verbose);var i=eI({},t,e);return I(e.property_blacklist)&&(T(e.property_denylist)?i.property_denylist=e.property_blacklist:I(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:eE.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class ni{constructor(){this.__forceAllowLocalhost=!1}get pr(){return this.__forceAllowLocalhost}set pr(e){eE.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nr{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new ni,this.gr=!1,this.version=v.LIB_VERSION,this._r=new sE,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ne(),this.SentryIntegration=ig,this.sentryIntegration=e=>(function(e,t){var i=ip(e,t);return{name:id,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.mr=!1,this.yr=null,this.br=null,this.wr=null,this.featureFlags=new s_(this),this.toolbar=new ib(this),this.scrollManager=new sN(this),this.pageViewManager=new rS(this),this.surveys=new sC(this),this.experiments=new sQ(this),this.exceptions=new sa(this),this.rateLimiter=new sR(this),this.requestRouter=new sZ(this),this.consent=new it(this),this.externalIntegrations=new s2(this),this.people={set:(e,t,i)=>{var r=M(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=M(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>eE.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==s7){var r,s=null!=(r=s6[i])?r:new nr;return s._init(e,t,i),s6[i]=s,s6[s7][i]=s,s}return this._init(e,t,i)}_init(e,t,i){if(void 0===t&&(t={}),T(e)||A(e))return eE.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Sr(t.debug),this.Er=t,this.$r=[],t.person_profiles&&(this.br=t.person_profiles),this.set_config(eI({},ne(t.defaults),nt(t),{name:i,token:e})),this.config.on_xhr_error&&eE.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:tL.GZipJS;var s=this.kr();this.persistence=new sf(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sf(y({},this.config,{persistence:"sessionStorage"}),s);var n=y({},this.persistence.props),a=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Pr=new sA(e=>this.Tr(e),this.config.request_queue_config),this.Rr=new sD(this),this.__request_queue=[];var o="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(o||(this.sessionManager=new sH(this),this.sessionPropsManager=new sU(this,this.sessionManager,this.persistence)),new iE(this).startIfEnabledOrStop(),this.siteApps=new sW(this),null==(l=this.siteApps)||l.init(),o||(this.sessionRecording=new s8(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new tV(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new rk(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new rw(this),this.exceptionObserver=new il(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new ia(this,is),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new iu(this),this.historyAutocapture.startIfEnabled(),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&eE.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:n,s:a}),void 0!==(null==(c=t.bootstrap)?void 0:c.distinctID)){var l,c,u,h,d=this.config.get_device_id(tZ()),p=null!=(u=t.bootstrap)&&u.isIdentifiedID?d:t.bootstrap.distinctID;this.persistence.set_property(e6,null!=(h=t.bootstrap)&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:p})}if(this.Ir()){var g,_,f=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlags)||{}).filter(e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])}).reduce((e,i)=>{var r;return e[i]=(null==(r=t.bootstrap)||null==(r=r.featureFlags)?void 0:r[i])||!1,e},{}),m=Object.keys((null==(_=t.bootstrap)?void 0:_.featureFlagPayloads)||{}).filter(e=>f[e]).reduce((e,i)=>{var r,s;return null!=(r=t.bootstrap)&&null!=(r=r.featureFlagPayloads)&&r[i]&&(e[i]=null==(s=t.bootstrap)||null==(s=s.featureFlagPayloads)?void 0:s[i]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:f,featureFlagPayloads:m})}if(o)this.register_once({distinct_id:ts,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(tZ());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(e6,"anonymous")}return eD(r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||tZ();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(e6,"identified")),t()},s=i.user();"then"in s&&C(s.then)?s.then(e=>r(e)):r(s)}(e,()=>{var r;i.register((Promise&&Promise.resolve||ih.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(ih.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(ih.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,"$pageview"),identify:e=>r(e,"$identify"),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Cr()):this.Cr(),C(this.config._onCapture)&&this.config._onCapture!==s4&&(eE.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&eE.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}fi(e){var t,i,r,s,n,a,o,l;if(!c||!c.body)return eE.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.fi(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=E(e.supportedCompression,tL.GZipJS)?tL.GZipJS:E(e.supportedCompression,tL.Base64)?tL.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.br?this.br:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(r=this.sessionRecording)||r.onRemoteConfig(e),null==(s=this.autocapture)||s.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),null==(a=this.webVitalsAutocapture)||a.onRemoteConfig(e),null==(o=this.exceptionObserver)||o.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(l=this.deadClicksAutocapture)||l.onRemoteConfig(e)}Cr(){try{this.config.loaded(this)}catch(e){eE.critical("`loaded` function failed",e)}this.Or(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.Fr()},1),new sM(this).load(),this.featureFlags.flags()}Or(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Pr)||e.enable())}_dom_loaded(){this.is_capturing()&&e$(this.__request_queue,e=>this.Tr(e)),this.__request_queue=[],this.Or()}_handle_unload(){var e,t;this.config.request_batching?(this.Mr()&&this.capture("$pageleave"),null==(e=this.Pr)||e.unload(),null==(t=this.Rr)||t.unload()):this.Mr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(s9?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=r4(e.url,{ip:+!!this.config.ip}),e.headers=y({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,s=y({},e);s.timeout=s.timeout||6e4,s.url=r4(s.url,{_:(new Date).getTime().toString(),ver:v.LIB_VERSION,compression:s.compression});var n=null!=(t=s.transport)?t:"fetch",a=se.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),o=null!=(i=null==(r=eL(a,e=>e.transport===n))?void 0:r.method)?i:a[0].method;if(!o)throw Error("No available transport method");o(s)})(y({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(r=this.config).on_request_error)||i.call(r,t)),null==e.callback||e.callback(t)}}))))}Tr(e){this.Rr?this.Rr.retriableRequest(e):this.ci(e)}_execute_array(e){var t,i=[],r=[],s=[];e$(e,e=>{e&&(I(t=e[0])?s.push(e):C(e)?e.call(this):I(e)&&"alias"===t?i.push(e):I(e)&&-1!==t.indexOf("capture")&&C(this[t])?s.push(e):r.push(e))});var n=function(e,t){e$(e,function(e){if(I(e[0])){var i=t;eF(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(r,this),n(s,this)}Ir(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Pr){if(this.is_capturing())if(!T(e)&&M(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.isRateLimited){null!=t&&t.$current_url&&!M(null==t?void 0:t.$current_url)&&(eE.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var n=new Date,a=(null==i?void 0:i.timestamp)||n,o=tZ(),l={uuid:o,event:e,properties:this.calculateEventProperties(e,t||{},a,o)};s&&(l.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(l.$set=null==i?void 0:i.$set);var c,u=this.Ar(null==i?void 0:i.$set_once);if(u&&(l.$set_once=u),(h=l,d=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,p=e=>M(e)&&!L(d)?e.slice(0,d):e,g=new Set,l=function e(t,i){var r;return t!==Object(t)?p?p(t,i):t:g.has(t)?void 0:(g.add(t),I(t)?(r=[],e$(t,t=>{r.push(e(t))})):(r={},eF(t,(t,i)=>{g.has(t)||(r[i]=e(t,i))})),r)}(h)).timestamp=a,T(null==i?void 0:i.timestamp)||(l.properties.$event_time_override_provided=!0,l.properties.$event_time_override_system_time=n),e===sy.DISMISSED||e===sy.SENT){var h,d,p,g,_,v,f,m=null==t?void 0:t[sb.SURVEY_ID],b=null==t?void 0:t[sb.SURVEY_ITERATION];c={id:m,current_iteration:b},localStorage.getItem(sP(c))||localStorage.setItem(sP(c),"true"),l.$set=y({},l.$set,{[(_={id:m,current_iteration:b},f="$survey_"+(v=e===sy.SENT?"responded":"dismissed")+"/"+_.id,_.current_iteration&&_.current_iteration>0&&(f="$survey_"+v+"/"+_.id+"/"+_.current_iteration),f)]:!0})}var w=y({},l.properties.$set,l.$set);if(R(w)||this.setPersonPropertiesForFlags(w),!D(this.config.before_send)){var E=this.Dr(l);if(!E)return;l=E}this._r.emit("eventCaptured",l);var x={method:"POST",url:null!=(r=null==i?void 0:i._url)?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:l,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.Tr(x):this.Pr.enqueue(x),l}eE.critical("This capture call is ignored due to client rate limiting.")}}else eE.error("No event name provided to posthog.capture")}else eE.uninitializedWarning("posthog.capture")}Mi(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a,o=n?void 0:this.persistence.remove_event_timer(e),l=y({},t);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),"$snapshot"===e){var h=y({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=h.distinct_id,(!M(l.distinct_id)&&!N(l.distinct_id)||A(l.distinct_id))&&eE.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,p=function(e,t){if(!g)return{};var i,s,n=e?eC([],rl,t||[]):[],[a,o]=function(e){for(var t=0;t<rn.length;t++){var[i,r]=rn[t],s=i.exec(e),n=s&&(C(r)?r(s,e):r);if(n)return n}return["",""]}(g);return eI(eM({$os:a,$os_version:o,$browser:ri(g,navigator.vendor),$device:ra(g),$device_type:(s=ra(g))===i$||s===iP||"Kobo"===s||"Kindle Fire"===s||s===i3?iS:s===iG||s===iY||s===iz||s===i0?"Console":s===iI?"Wearable":s?ix:"Desktop",$timezone:ry(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:tU(null==u?void 0:u.href,n,ru),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:g.length>1e3?g.substring(0,997)+"...":g,$browser_version:rs(g,navigator.vendor),$browser_language:r_(),$browser_language_prefix:"string"==typeof(i=r_())?i.split("-")[0]:void 0,$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHeight,$viewport_width:null==r?void 0:r.innerWidth,$lib:"web",$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:_,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());l.$session_id=_,l.$window_id=f}this.sessionPropsManager&&eI(l,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&eI(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=null==(a=this.Rr)?void 0:a.length}catch(e){l.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===sX.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),d="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),l=eI(l,d),"$pageview"===e&&c&&(l.title=c.title),!T(o)){var m=i.getTime()-o;l.$duration=parseFloat((m/1e3).toFixed(3))}g&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=eI({},p,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),I(this.config.property_denylist)?eF(this.config.property_denylist,function(e){delete l[e]}):eE.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(eE.error("sanitize_properties is deprecated. Use before_send instead"),l=b(l,e));var w=this.jr();return l.$process_person_profile=w,w&&!n&&this.Lr("_calculate_event_properties"),l}Ar(e){if(!this.persistence||!this.jr()||this.gr)return e;var t,i=eI({},this.persistence.get_initial_props(),(null==(t=this.sessionPropsManager)?void 0:t.getSetOnceProps())||{},e||{}),r=this.config.sanitize_properties;return r&&(eE.error("sanitize_properties is deprecated. Use before_send instead"),i=r(i,"$set_once")),this.gr=!0,R(i)?void 0:i}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Nr(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._r.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=sF),this.surveys.displaySurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return eE.uninitializedWarning("posthog.identify");if(N(e)&&(e=e.toString(),eE.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))eE.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==ts){if(this.Lr("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(ej)&&(this.unregister(ej),this.register({distinct_id:e}));var s="anonymous"===(this.persistence.get_property(e6)||"anonymous");e!==r&&s?(this.persistence.set_property(e6,"identified"),this.setPersonPropertiesForFlags(y({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.wr=si(e,t,i),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(e8))}}else eE.critical('The string "'+ts+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else eE.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Lr("posthog.setPersonProperties")){var i=si(this.get_distinct_id(),e,t);this.wr!==i?(this.setPersonPropertiesForFlags(y({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.wr=i):eE.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Lr("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===t||i||this.reloadFeatureFlags()}}else eE.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Lr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(eE.info("reset"),!this.__loaded)return eE.uninitializedWarning("posthog.reset");var t,i,r,s,n=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(r=this.persistence)||r.set_property(e6,"anonymous"),null==(s=this.sessionManager)||s.resetSessionId(),this.wr=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ts,$device_id:null},"");else{var a=this.config.get_device_id(tZ());this.register_once({distinct_id:a,$device_id:e?a:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var s,n=null!=(s=e.timestampLookBack)?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(e,t){return e===this.get_property(eN)?(eE.critical("Attempting to create alias for existing People user - aborting."),-2):this.Lr("posthog.alias")?(T(t)&&(t=this.get_distinct_id()),e!==t?(this.Nr(ej,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(eE.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(O(e)){eI(this.config,nt(e));var i,r,s,n,a,o=this.kr();null==(i=this.persistence)||i.update_config(this.config,t,o),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sf(y({},this.config,{persistence:"sessionStorage"}),o);var l=this.Sr(this.config.debug);j(l)&&(this.config.debug=l),j(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,t3.H()&&t3.G("ph_debug","true"),eE.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(v.DEBUG=!1,t3.H()&&t3.V("ph_debug"))),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(n=this.heatmaps)||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ur(),null==(a=this.externalIntegrations)||a.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,r,s,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},r,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:s7;return t!==s7&&(t=s7+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(e6))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(e6))}jr(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&R(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[ej])&&(null==(t=this.persistence)||null==(t=t.props)||!t[ti]))}Mr(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.jr()||this.Lr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Lr(e){return"never"===this.config.person_profiles?(eE.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Nr(ti,!0),!0)}kr(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}Ur(){var e,t,i,r,s=this.kr();return(null==(e=this.persistence)?void 0:e.wi)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.wi)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){if("always"!==this.config.cookieless_mode){var t,i;"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),null==(t=this.sessionManager)||t.destroy(),this.sessionManager=new sH(this),this.persistence&&(this.sessionPropsManager=new sU(this,this.sessionManager,this.persistence)),this.sessionRecording=new s8(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Ur(),this.Or(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(T(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(i=null==e?void 0:e.captureEventName)?i:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Fr()}else eE.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Ur(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ts,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(t=this.sessionRecording)||t.stopRecording(),this.sessionRecording=void 0,this.Fr())):eE.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===ie.GRANTED?"granted":e===ie.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Ur()}_is_bot(){return l?sY(l,this.config.custom_blocked_useragents):void 0}Fr(){c&&("visible"===c.visibilityState?this.mr||(this.mr=!0,this.capture("$pageview",{title:c.title},{send_instantly:!0}),this.yr&&(c.removeEventListener("visibilitychange",this.yr),this.yr=null)):this.yr||(this.yr=this.Fr.bind(this),eD(c,"visibilitychange",this.yr)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==r||r.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}M(){var e,t,i,r,s=this.Er||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(eE.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in s&&!T(s[e]),r=t in s&&!T(s[t]),i?s[e]:!!r&&(eE&&eE.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}Dr(e){if(D(this.config.before_send))return e;var t=I(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(D(i=r(i))){var s="Event '"+e.event+"' was rejected in beforeSend function";return U(e.event)?eE.warn(s+". This can cause unexpected behavior."):eE.info(s),null}i.properties&&!R(i.properties)||eE.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return null==(e=this.pageViewManager.Vt)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Sr(e){var t=j(e)&&!e,i=t3.H()&&"true"===t3.q("ph_debug");return!t&&(!!i||e)}}!function(e,t){for(var i=0;i<t.length;i++)e.prototype[t[i]]=eT(e.prototype[t[i]])}(nr,["identify"]);var ns,nn=(ns=s6[s7]=new nr,function(){function e(){e.done||(e.done=!0,s9=!1,eF(s6,function(e){e._dom_loaded()}))}null!=c&&c.addEventListener?"complete"===c.readyState?e():eD(c,"DOMContentLoaded",e,{capture:!1}):r&&eE.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),ns)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[854],{1175:(e,t,o)=>{o.d(t,{AnalyticsProvider:()=>l,useAnalyticsContext:()=>c});var n=o(5801),r=o(5789),s=o(8187);let a=(0,r.createContext)(void 0);function i(){var e;return null!=(e=window.__DEXTO_ANALYTICS__)?e:null}function l(e){let{children:t}=e,[o,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=i();if(!e){l(!1),u(!0);return}try{s.Ay.init(e.posthogKey,{api_host:e.posthogHost,person_profiles:"identified_only",loaded:t=>{t.identify(e.distinctId),l(!0),u(!0)},autocapture:!1,capture_pageview:!1,disable_session_recording:!0,disable_surveys:!0,opt_out_capturing_by_default:!1})}catch(e){console.error("Failed to initialize analytics:",e),l(!1),u(!0)}return()=>{try{s.Ay.reset()}catch(e){}}},[]),(0,n.jsx)(a.Provider,{value:{capture:(e,t)=>{if(o&&c)try{var n,r,a,l;s.Ay.capture(e,{...{app:"dexto-webui",app_version:null!=(l=null==(n=i())?void 0:n.appVersion)?l:"unknown",browser:null==(r=navigator.userAgent.split(" ").pop())?void 0:r.split("/")[0],browser_version:null==(a=navigator.userAgent.split(" ").pop())?void 0:a.split("/")[1],os:navigator.platform,screen_width:window.screen.width,screen_height:window.screen.height},...t})}catch(e){console.error("Failed to capture analytics event:",e)}},enabled:o,isReady:c},children:t})}function c(){let e=(0,r.useContext)(a);if(!e)throw Error("useAnalyticsContext must be used within an AnalyticsProvider");return e}},1236:(e,t,o)=>{o.d(t,{kz:()=>m,EQ:()=>y,j0:()=>g,PI:()=>p,P2:()=>f,KU:()=>d,Y_:()=>w});var n=o(5789);let r=["apikey","api_key","token","access_token","refresh_token","password","secret"],s=["base64","filedata","file_data","imagedata","image_data","audiodata","audio_data","data"],a=[/\bsk-[A-Za-z0-9]{20,}\b/g,/\bBearer\s+[A-Za-z0-9\-_.=]+\b/gi,/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,/\beyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]*/g],i="[REDACTED]",l="[REDACTED_CIRCULAR]";function c(e){return e instanceof Error?e:e&&"object"==typeof e?"message"in e&&"string"==typeof e.message?Error(e.message,{cause:e}):"error"in e&&"string"==typeof e.error?Error(e.error,{cause:e}):"details"in e&&"string"==typeof e.details?Error(e.details,{cause:e}):"description"in e&&"string"==typeof e.description?Error(e.description,{cause:e}):Error(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;try{if("bigint"==typeof e)return e.toString();let o=function e(t){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakSet;if("string"==typeof t){let e=t;for(let t of a)e=e.replace(t,i);return e}if(Array.isArray(t))return o.has(t)?l:(o.add(t),t.map(t=>e(t,o)));if(t&&"object"==typeof t){if(o.has(t))return l;o.add(t);let n={};for(let[a,l]of Object.entries(t))if(r.includes(a.toLowerCase()))n[a]=i;else{let r=function(e,t,o){var n;if("string"!=typeof e)return e;let r=t.toLowerCase();return(s.includes(r)||"data"===r&&o&&("mimeType"in o||"filename"in o||"fileName"in o))&&(n=e).length>1e3&&/^[A-Za-z0-9+/=]{1000,}$/.test(n.substring(0,1e3))?"".concat("[FILE_DATA_TRUNCATED]"," (").concat(e.length," chars)"):e}(l,a,t);n[a]=e(r,o)}return n}return t}(e),n=JSON.stringify(o,(e,t)=>t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:"bigint"==typeof t?t.toString():t),c="…(truncated)",u=Number.isFinite(t)&&t>0?Math.floor(t):1e3;if("string"==typeof n){if(n.length<=u)return n;let e=Math.max(0,u-c.length);return"".concat(n.slice(0,e)).concat(c)}return String(e)}catch(t){try{return String(e)}catch(e){return"[Unserializable value]"}}}(e)):"string"==typeof e?Error(e,{cause:e}):Error(String(e),{cause:e})}var u=o(1754);function d(e){return"object"==typeof e&&null!==e&&"error"in e}function f(e){return"object"==typeof e&&null!==e&&"content"in e&&Array.isArray(e.content)}function p(e){return"object"==typeof e&&null!==e&&"type"in e&&"text"===e.type}function g(e){return"object"==typeof e&&null!==e&&"type"in e&&"image"===e.type}function m(e){return"object"==typeof e&&null!==e&&"type"in e&&"audio"===e.type}function y(e){return"object"==typeof e&&null!==e&&"type"in e&&"file"===e.type}let h=()=>"msg-".concat(Date.now(),"-").concat(Math.random().toString(36).substring(2,9));function w(e,t){let o=(0,u.st)(),r=(0,n.useRef)(o),s=(0,n.useRef)(null),[a,i]=(0,n.useState)([]),l=(0,n.useRef)(null),[d,f]=(0,n.useState)("connecting"),[p,g]=(0,n.useState)(!1),[m,y]=(0,n.useState)(null),w=(0,n.useRef)(!1),v=(0,n.useRef)(new Map);(0,n.useEffect)(()=>{r.current=o},[o]);let b=(0,n.useRef)(t);(0,n.useEffect)(()=>{b.current=t},[t]);let _=(0,n.useCallback)(e=>{if(!e)return!1;let t=b.current,o=t?t():null;return!!o&&e===o},[]);(0,n.useEffect)(()=>{let t=new globalThis.WebSocket(e);return s.current=t,t.onopen=()=>f("open"),t.onclose=()=>f("closed"),t.onerror=e=>{f("closed"),y({id:h(),message:"Connection error. Please try again.",timestamp:Date.now(),context:"websocket"})},t.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch(t){let e=c(t);console.error("[useChat] WebSocket message parse error: ".concat(e.message),{error:e});return}let o=t.data||{};switch(t.event){case"chunk":{if(!_(o.sessionId))return;g(!0);let e="string"==typeof o.content?o.content:"";if(!e)break;let t=o.type;i(o=>{if("reasoning"===t){let t=o[o.length-1];if(t&&"assistant"===t.role){let n={...t,reasoning:(t.reasoning||"")+e,createdAt:Date.now()};return[...o.slice(0,-1),n]}return[...o,{id:h(),role:"assistant",content:"",reasoning:e,createdAt:Date.now()}]}{let t=o[o.length-1];if(t&&"assistant"===t.role){let n="string"==typeof t.content?t.content:"",r={...t,content:n+e,createdAt:Date.now()};return[...o.slice(0,-1),r]}return[...o,{id:h(),role:"assistant",content:e,createdAt:Date.now()}]}});break}case"response":{if(!_(o.sessionId))return;g(!1);let e="string"==typeof o.text?o.text:"",t="string"==typeof o.reasoning?o.reasoning:void 0,n=o&&"object"==typeof o.tokenUsage?o.tokenUsage:void 0,r="string"==typeof o.model?o.model:void 0,s="string"==typeof o.provider?o.provider:void 0,a="string"==typeof o.router?o.router:void 0,l="string"==typeof o.sessionId?o.sessionId:void 0;i(o=>{let i=o[o.length-1];if(i&&"assistant"===i.role){let c="string"==typeof e?e:"",u={...i,content:c,tokenUsage:n,reasoning:t,model:r,provider:s,router:a,createdAt:Date.now(),sessionId:null!=l?l:i.sessionId};return[...o.slice(0,-1),u]}return[...o,{id:h(),role:"assistant",content:e,createdAt:Date.now(),tokenUsage:n,reasoning:t,model:r,provider:s,router:a,sessionId:l}]}),window.dispatchEvent(new CustomEvent("dexto:response",{detail:{text:e,sessionId:l,reasoning:t,tokenUsage:n,model:r,timestamp:Date.now()}}));break}case"conversationReset":if(!_(o.sessionId))return;g(!1),i([]),l.current=null,v.current.clear();break;case"toolCall":{if(!_(o.sessionId))return;let e=o.toolName,t=o.args,n=o.callId;i(o=>{let r=o.length,s=[...o,{id:h(),role:"tool",content:null,toolName:e,toolArgs:t,toolCallId:n,createdAt:Date.now()}];return n&&v.current.set(n,r),s});break}case"toolResult":{var n,s,a,u;if(!_(o.sessionId))return;let e=o.toolName,t=o.sanitized,l=null!=(u=null!=(a=null!=(s=null==t||null==(n=t.meta)?void 0:n.toolCallId)?s:"string"==typeof o.toolCallId?o.toolCallId:void 0)?a:"string"==typeof o.callId?o.callId:void 0)?u:"string"==typeof o.id?o.id:void 0,c=o.rawResult,d="boolean"==typeof o.success?o.success:void 0,f=null!=t?t:c,p=o.sessionId;p&&e&&r.current.trackToolCalled({toolName:e,success:!1!==d,sessionId:p});let g=f,m=e=>{var t,o,n,r,s,a;if("object"==typeof e&&null!==e&&"image"===e.type){let r=null!=(n=null!=(o=null!=(t=e.data)?t:e.base64)?o:e.image)?n:e.url;if(r)return{type:"image",image:r,...e.mimeType?{mimeType:e.mimeType}:{}}}if("object"==typeof e&&null!==e&&"audio"===e.type){let t=null!=(a=null!=(s=null!=(r=e.data)?r:e.base64)?s:e.audio)?a:e.url;if(t&&e.mimeType)return{type:"file",data:t,mimeType:e.mimeType,...e.filename?{filename:e.filename}:{}}}if("object"==typeof e&&null!==e&&"resource"===e.type){let t=e.resource;if((null==t?void 0:t.text)&&t.mimeType)return t.mimeType.startsWith("image/")?{type:"image",image:t.text,mimeType:t.mimeType}:{type:"file",data:t.text,mimeType:t.mimeType,...t.title?{filename:t.title}:{}}}return"object"==typeof e&&null!==e&&"file"===e.type?{type:"file",data:e.data,mimeType:e.mimeType,...e.filename?{filename:e.filename}:{}}:"object"==typeof e&&null!==e&&"text"===e.type?{type:"text",text:e.text}:"string"==typeof e?{type:"text",text:e}:{type:"text",text:JSON.stringify(e)}};if(t&&Array.isArray(t.content)&&!1!==d){let e=t.content.map(m);g={...t,content:e}}else if(f&&Array.isArray(f.content)){let e=f.content.map(m);g={...f,content:e}}!1===d&&c&&(g=c),i(o=>{let n=-1;if(l&&v.current.has(l)?(n=v.current.get(l),v.current.delete(l)):n=o.findIndex(t=>"tool"===t.role&&void 0===t.toolResult&&t.toolName===e),-1!==n&&n<o.length){let e={...o[n],toolResult:g,toolResultMeta:null==t?void 0:t.meta,toolResultSuccess:d};return[...o.slice(0,n),e,...o.slice(n+1)]}return console.warn("No matching tool call found for result of ".concat(e).concat(l?" (callId: ".concat(l,")"):"")),o});break}case"toolConfirmationResponse":break;case"error":{let e;if(!_(o.sessionId))return;if(g(!1),w.current){w.current=!1;break}if((null==o?void 0:o.context)==="user_cancelled")break;let t=c(o).message;if(o.context){if("string"==typeof o.context)e=o.context;else if("object"==typeof o.context){let t=o.context;e=t.plugin?"plugin:".concat(t.plugin):t.scope?String(t.scope):"error"}}y({id:h(),message:t,timestamp:Date.now(),context:e,recoverable:o.recoverable,sessionId:o.sessionId,anchorMessageId:l.current||void 0,detailedIssues:Array.isArray(o.issues)?o.issues:[]});break}case"resourceCacheInvalidated":console.log("\uD83D\uDCBE Resource cache invalidated via WebSocket:",o),window.dispatchEvent(new CustomEvent("dexto:resourceCacheInvalidated",{detail:{resourceUri:o.resourceUri,serverName:o.serverName,action:o.action,timestamp:Date.now()}}));break;case"mcpPromptsListChanged":console.log("✨ Prompts list changed via WebSocket:",o),window.dispatchEvent(new CustomEvent("dexto:mcpPromptsListChanged",{detail:{serverName:o.serverName,prompts:o.prompts,timestamp:Date.now()}}));break;case"mcpToolsListChanged":console.log("\uD83D\uDD27 Tools list changed via WebSocket:",o),window.dispatchEvent(new CustomEvent("dexto:mcpToolsListChanged",{detail:{serverName:o.serverName,tools:o.tools,timestamp:Date.now()}}));break;case"mcpResourceUpdated":console.log("\uD83D\uDCCB Resource updated via WebSocket:",o),window.dispatchEvent(new CustomEvent("dexto:mcpResourceUpdated",{detail:{serverName:o.serverName,resourceUri:o.resourceUri,timestamp:Date.now()}}));break;case"sessionTitleUpdated":{let e=e=>"object"==typeof e&&null!==e,t=e(o)&&"string"==typeof o.sessionId?o.sessionId:void 0,n=e(o)&&"string"==typeof o.title?o.title:void 0;t&&n&&window.dispatchEvent(new CustomEvent("dexto:sessionTitleUpdated",{detail:{sessionId:t,title:n,timestamp:Date.now()}}))}}},()=>{t.close()}},[e]);let k=(0,n.useCallback)(function(e,t,o,n){var r;let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if((null==(r=s.current)?void 0:r.readyState)===globalThis.WebSocket.OPEN){s.current.send(JSON.stringify({type:"message",content:e,imageData:t,fileData:o,sessionId:n,stream:a})),g(!0);let r=h();l.current=r,i(s=>[...s,{id:r,role:"user",content:e,createdAt:Date.now(),sessionId:n,imageData:t,fileData:o}]),window.dispatchEvent(new CustomEvent("dexto:message",{detail:{content:e,sessionId:n,timestamp:Date.now()}}))}else y({id:h(),message:"Cannot send message: connection is not open",timestamp:Date.now(),context:"websocket",recoverable:!0})},[]),C=(0,n.useCallback)(e=>{var t;(null==(t=s.current)?void 0:t.readyState)===globalThis.WebSocket.OPEN&&s.current.send(JSON.stringify({type:"reset",sessionId:e})),i([]),y(null),l.current=null,v.current.clear(),g(!1)},[]),E=(0,n.useCallback)(e=>{var t;(null==(t=s.current)?void 0:t.readyState)===globalThis.WebSocket.OPEN&&s.current.send(JSON.stringify({type:"cancel",sessionId:e})),g(!1),v.current.clear(),w.current=!0},[]),x=(0,n.useCallback)(()=>{y(null)},[]);return{messages:a,status:d,sendMessage:k,reset:C,setMessages:i,websocket:s.current,processing:p,cancel:E,activeError:m,clearError:x}}},1754:(e,t,o)=>{o.d(t,{st:()=>n.useAnalytics}),o(1175);var n=o(6097)},6097:(e,t,o)=>{o.d(t,{useAnalytics:()=>a});var n=o(5789),r=o(1175);let s="dexto_first_message_sent";function a(){let{capture:e,enabled:t,isReady:o}=(0,r.useAnalyticsContext)(),a=(0,n.useRef)({}),i=(0,n.useCallback)(o=>{if(t)try{let t=o.sessionId;if(a.current[t]=(a.current[t]||0)+1,function(){try{return!localStorage.getItem(s)}catch(e){return!1}}()){let t={provider:o.provider,model:o.model,hasImage:o.hasImage,hasFile:o.hasFile,messageLength:o.messageLength};e("dexto_webui_first_message",t);try{localStorage.setItem(s,"true")}catch(e){}}let n={...o,messageCount:a.current[t]};e("dexto_webui_message_sent",n)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),l=(0,n.useCallback)(o=>{if(t)try{e("dexto_webui_session_created",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),c=(0,n.useCallback)(o=>{if(t)try{e("dexto_webui_session_switched",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),u=(0,n.useCallback)(o=>{if(t)try{a.current[o.sessionId]=0,e("dexto_webui_conversation_reset",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),d=(0,n.useCallback)(o=>{if(t)try{e("dexto_webui_agent_switched",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),f=(0,n.useCallback)(o=>{if(t)try{e("dexto_webui_tool_called",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),p=(0,n.useCallback)(o=>{if(t)try{e("dexto_webui_llm_switched",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),g=(0,n.useCallback)(o=>{if(t)try{e("dexto_webui_file_uploaded",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),m=(0,n.useCallback)(o=>{if(t)try{e("dexto_webui_image_uploaded",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]),y=(0,n.useCallback)(o=>{if(t)try{e("dexto_webui_mcp_server_connected",o)}catch(e){console.warn("Analytics tracking failed:",e)}},[e,t]);return{capture:e,enabled:t,isReady:o,trackMessageSent:i,trackSessionCreated:l,trackSessionSwitched:c,trackConversationReset:u,trackAgentSwitched:d,trackToolCalled:f,trackLLMSwitched:p,trackFileUploaded:g,trackImageUploaded:m,trackMCPServerConnected:y}}},9401:(e,t,o)=>{function n(){let e=parseInt(window.location.port||"3000",10),t=window.__DEXTO_API_PORT__?parseInt(window.__DEXTO_API_PORT__,10):e+1,o="https:"===window.location.protocol?"https:":"http:";return"".concat(o,"//").concat(window.location.hostname,":").concat(t)}function r(){let e=parseInt(window.location.port||"3000",10),t=window.__DEXTO_API_PORT__?parseInt(window.__DEXTO_API_PORT__,10):e+1,o="https:"===window.location.protocol?"wss:":"ws:";return"".concat(o,"//").concat(window.location.hostname,":").concat(t)}o.d(t,{e:()=>n,m:()=>r})},9752:(e,t,o)=>{function n(e){return(null==e?void 0:e.startsWith("audio/"))?"audio":(null==e?void 0:e.startsWith("video/"))?"video":"binary"}function r(e){return(null==e?void 0:e.startsWith("image/"))?"image":(null==e?void 0:e.startsWith("audio/"))?"audio":(null==e?void 0:e.startsWith("video/"))?"video":"binary"}o.d(t,{h:()=>r,t:()=>n})},9854:(e,t,o)=>{o.d(t,{ChatProvider:()=>d,v:()=>f});var n=o(5801),r=o(5789),s=o(826),a=o(1236),i=o(9401),l=o(9752),c=o(1754);let u=(0,r.createContext)(void 0);function d(e){let{children:t}=e,o=(0,s.useRouter)(),d=(0,c.st)(),f=(0,i.m)(),[p,g]=(0,r.useState)(null),[m,y]=(0,r.useState)(!0),[h,w]=(0,r.useState)(!0),[v,b]=(0,r.useState)(!1),[_,k]=(0,r.useState)(!1),{messages:C,sendMessage:E,status:x,reset:A,setMessages:S,websocket:I,activeError:T,clearError:R,processing:N,cancel:D}=(0,a.Y_)(f,()=>p),[L,j]=(0,r.useState)(null),P=(0,r.useCallback)(async e=>{try{let t=void 0!==e?e:p,o=t?"".concat((0,i.e)(),"/api/llm/current?sessionId=").concat(t):"".concat((0,i.e)(),"/api/llm/current"),n=await fetch(o);if(n.ok){let e=await n.json(),t=e.config||e;j({provider:t.provider,model:t.model,displayName:t.displayName,router:t.router,baseURL:t.baseURL})}}catch(e){}},[p]);(0,r.useEffect)(()=>{L||P()},[L,P]);let{greeting:O}=function(e){let[t,o]=(0,r.useState)(null),[n,s]=(0,r.useState)(!1),[a,l]=(0,r.useState)(null),[c,u]=(0,r.useState)(0),d=(0,r.useCallback)(async t=>{s(!0),l(null);try{var n;let r=e?"".concat((0,i.e)(),"/api/greeting?sessionId=").concat(encodeURIComponent(e)):"".concat((0,i.e)(),"/api/greeting"),s=await fetch(r,{signal:t});if(!s.ok){let e="Failed to fetch greeting: HTTP ".concat(s.status," ").concat(s.statusText);o(null),l(e);return}let a=await s.json();o(null!=(n=a.greeting)?n:null)}catch(t){if((null==t?void 0:t.name)==="AbortError")return;let e=t instanceof Error?t.message:"Failed to fetch greeting";l(e),console.error("Error fetching greeting: ".concat(e))}finally{s(!1)}},[e]);return(0,r.useEffect)(()=>{let e=new AbortController,{signal:t}=e;return d(t),()=>e.abort()},[d,c]),(0,r.useEffect)(()=>{let e=()=>{u(e=>e+1)};return window.addEventListener("dexto:agentSwitched",e),()=>{window.removeEventListener("dexto:agentSwitched",e)}},[]),{greeting:t,isLoading:n,error:a}}(p),U=(0,r.useCallback)(async()=>{var e;let t,o=await fetch("".concat((0,i.e)(),"/api/sessions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!o.ok)throw Error("Failed to create session: ".concat(o.status," ").concat(o.statusText));let n=await o.text();if(!n.trim())throw Error("Empty response from session creation");try{t=JSON.parse(n)}catch(e){throw console.error("Failed to parse session creation response:",e),Error("Invalid response from session creation")}if(!(null==(e=t.session)?void 0:e.id))throw Error("Session ID not found in server response");let r=t.session.id;return d.trackSessionCreated({sessionId:r,trigger:"first_message"}),r},[d]),W=(0,r.useCallback)(async(e,t,n)=>{let r=p;if(!r&&m){if(_)return;try{k(!0),r=await U(),g(r),y(!1),o.replace("/chat/".concat(r)),await P(r)}catch(e){console.error("Failed to create session:",e);return}finally{k(!1)}}if(r){E(e,t,n,r,h);let o=(null==L?void 0:L.provider)||"unknown",s=(null==L?void 0:L.model)||"unknown";d.trackMessageSent({sessionId:r,provider:o,model:s,hasImage:!!t,hasFile:!!n,messageLength:e.length})}else console.error("No session available for sending message")},[E,p,m,_,U,h,P,o,d,L]),F=(0,r.useCallback)(()=>{if(p){let e=C.filter(e=>e.sessionId===p).length;d.trackConversationReset({sessionId:p,messageCount:e}),A(p)}},[A,p,d,C]),z=(0,r.useCallback)(async e=>{try{let t,o=await fetch("".concat((0,i.e)(),"/api/sessions/").concat(e,"/history"));if(!o.ok){if(404===o.status)return void S([]);throw Error("Failed to load session history")}let n=await o.text();if(!n.trim())return void S(t=>t.some(t=>t.sessionId===e)?t:[]);try{t=JSON.parse(n)}catch(e){console.error("Failed to parse session history response:",e),S([]);return}let r=t.history||[],s=[],a=new Map;for(let t=0;t<r.length;t++){let o=r[t],n={id:"session-".concat(e,"-").concat(t),role:o.role,content:o.content,createdAt:Date.now()-(r.length-t)*1e3,sessionId:e,tokenUsage:o.tokenUsage,reasoning:o.reasoning,model:o.model,router:o.router,provider:o.provider},i=e=>{let t=[];for(let r of e){var o,n;if("image"===r.type&&"string"==typeof r.image&&r.image.startsWith("@blob:")){let e=r.image.substring(1);t.push({uri:e,kind:"image",mimeType:null!=(o=r.mimeType)?o:"image/jpeg"})}if("file"===r.type&&"string"==typeof r.data&&r.data.startsWith("@blob:")){let e=r.data.substring(1),o=null!=(n=r.mimeType)?n:"application/octet-stream",s=(0,l.h)(o);t.push({uri:e,kind:s,mimeType:o,...r.filename?{filename:r.filename}:{}})}}return t.length>0?t:void 0};if("assistant"===o.role){o.content&&s.push(n),o.toolCalls&&o.toolCalls.length>0&&o.toolCalls.forEach((o,n)=>{var i,l;let c={};if(null==o?void 0:o.function)try{c=JSON.parse(o.function.arguments||"{}")}catch(e){console.warn("Failed to parse toolCall arguments for ".concat((null==(l=o.function)?void 0:l.name)||"unknown",": ").concat(e)),c={}}let u=(null==(i=o.function)?void 0:i.name)||"unknown",d={id:"session-".concat(e,"-").concat(t,"-tool-").concat(n),role:"tool",content:null,createdAt:Date.now()-(r.length-t)*1e3+n,sessionId:e,toolName:u,toolArgs:c,toolResult:void 0,toolResultMeta:void 0,toolResultSuccess:void 0};"string"==typeof o.id&&o.id.length>0&&a.set(o.id,s.length),s.push(d)});continue}if("tool"===o.role){let e="string"==typeof o.toolCallId?o.toolCallId:void 0,r="string"==typeof o.name?o.name:"unknown",l=Array.isArray(o.content)?o.content:"string"==typeof o.content?[{type:"text",text:o.content}]:[],c=i(l),u={content:l,...c?{resources:c}:{},meta:{toolName:r,toolCallId:null!=e?e:"tool-".concat(t),..."boolean"==typeof o.success?{success:o.success}:{}}};if(e&&a.has(e)){let t=a.get(e);s[t]={...s[t],toolResult:u,toolResultMeta:u.meta,toolResultSuccess:"boolean"==typeof o.success?o.success:void 0}}else s.push({...n,role:"tool",content:null,toolName:r,toolArgs:"object"==typeof o.args?o.args:void 0,toolResult:u,toolResultMeta:u.meta,toolResultSuccess:"boolean"==typeof o.success?o.success:void 0});continue}s.push(n)}S(t=>t.some(t=>t.sessionId===e)?t:s)}catch(e){console.error("Error loading session history:",e),S([])}},[S,P]),M=(0,r.useCallback)(async e=>{if(e!==p&&!v){b(!0);try{d.trackSessionSwitched({fromSessionId:p,toSessionId:e}),g(e),y(!1),await z(e),await P(e)}catch(e){throw console.error("Error switching session:",e),e}finally{b(!1)}}},[p,v,z,P,d]),J=(0,r.useCallback)(()=>{g(null),y(!0),S([])},[S]);return(0,r.useEffect)(()=>{let e=e=>{var t;let o=(null==e?void 0:e.detail)||{};if(null==(t=o.config)?void 0:t.llm){let e=o.config.llm;j({provider:e.provider,model:e.model,router:e.router,baseURL:e.baseURL})}},t=e=>{console.log("Servers changed:",e.detail)},o=e=>{let{sessionId:t}=e.detail||{};t===p&&S([])};return window.addEventListener("dexto:configChanged",e),window.addEventListener("dexto:serversChanged",t),window.addEventListener("dexto:conversationReset",o),()=>{window.removeEventListener("dexto:configChanged",e),window.removeEventListener("dexto:serversChanged",t),window.removeEventListener("dexto:conversationReset",o)}},[p,S]),(0,n.jsx)(u.Provider,{value:{messages:C,sendMessage:W,status:x,reset:F,currentSessionId:p,switchSession:M,loadSessionHistory:z,isWelcomeState:m,returnToWelcome:J,isStreaming:h,setStreaming:w,websocket:I,currentLLM:L,refreshCurrentLLM:P,processing:N,cancel:D,activeError:T,clearError:R,greeting:O},children:t})}function f(){let e=(0,r.useContext)(u);if(!e)throw Error("useChatContext must be used within a ChatProvider");return e}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[827],{},_=>{_.O(0,[614,560,369,854,804,419,760,845,358],()=>_(_.s=9419)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{94:()=>{},191:(e,n,t)=>{"use strict";t.d(n,{SpeechReset:()=>s});var i=t(5789);function s(){return(0,i.useEffect)(()=>{let e=()=>{try{"speechSynthesis"in window&&window.speechSynthesis.cancel()}catch(e){}};e();let n=()=>{"hidden"===document.visibilityState&&e()};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e),document.removeEventListener("visibilitychange",n)}},[]),null}},3145:e=>{e.exports={style:{fontFamily:"'Geist Mono', 'Geist Mono Fallback'",fontStyle:"normal"},className:"__className_9a8899",variable:"__variable_9a8899"}},5509:(e,n,t)=>{Promise.resolve().then(t.t.bind(t,6819,23)),Promise.resolve().then(t.t.bind(t,3145,23)),Promise.resolve().then(t.t.bind(t,94,23)),Promise.resolve().then(t.bind(t,9854)),Promise.resolve().then(t.bind(t,191)),Promise.resolve().then(t.bind(t,6097)),Promise.resolve().then(t.bind(t,1175))},6819:e=>{e.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_188709",variable:"__variable_188709"}}},e=>{e.O(0,[137,33,560,854,760,845,358],()=>e(e.s=5509)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{},_=>{_.O(0,[614,560,369,854,804,419,760,845,358],()=>_(_.s=9419)),_N_E=_.O()}]);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexto/webui",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "next dev",
@@ -9,6 +9,7 @@
9
9
  "lint": "eslint -c eslint.config.mjs . --ext .ts,.tsx"
10
10
  },
11
11
  "dependencies": {
12
+ "@dexto/analytics": "workspace:*",
12
13
  "@dexto/core": "workspace:*",
13
14
  "@monaco-editor/react": "^4.7.0",
14
15
  "@radix-ui/react-checkbox": "^1.3.1",
@@ -27,6 +28,7 @@
27
28
  "highlight.js": "^11.11.1",
28
29
  "lucide-react": "^0.507.0",
29
30
  "next": "15.5.2",
31
+ "posthog-js": "^1.281.0",
30
32
  "react": "^19.0.0",
31
33
  "react-dom": "^19.0.0",
32
34
  "react-markdown": "^10.1.0",
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
9
9
  const hostname = process.env.HOSTNAME || '0.0.0.0'
10
10
 
11
11
  let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
12
- const nextConfig = {"env":{},"eslint":{"ignoreDuringBuilds":true},"typescript":{"ignoreBuildErrors":false,"tsconfigPath":"tsconfig.json"},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":60,"formats":["image/webp"],"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","remotePatterns":[],"unoptimized":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"amp":{"canonicalBase":""},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"serverRuntimeConfig":{},"publicRuntimeConfig":{},"reactProductionProfiling":false,"reactStrictMode":true,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/dexto/dexto","allowedDevOrigins":["http://localhost:3000","http://10.1.1.57:3000"],"experimental":{"useSkewCookie":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":4294967294}},"cacheHandlers":{},"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"serverSourceMaps":false,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"clientSegmentCache":false,"clientParamParsing":false,"dynamicOnHover":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","middlewarePrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"viewTransition":false,"routerBFCache":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"cacheComponents":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"devtoolSegmentExplorer":true,"browserDebugInfoInTerminal":false,"optimizeRouterScrolling":false,"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","turbopack":{"root":"/home/runner/work/dexto/dexto"}}
12
+ const nextConfig = {"env":{},"eslint":{"ignoreDuringBuilds":true},"typescript":{"ignoreBuildErrors":false,"tsconfigPath":"tsconfig.json"},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":60,"formats":["image/webp"],"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","remotePatterns":[],"unoptimized":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"amp":{"canonicalBase":""},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"serverRuntimeConfig":{},"publicRuntimeConfig":{},"reactProductionProfiling":false,"reactStrictMode":true,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/dexto/dexto","allowedDevOrigins":["http://localhost:3000","http://10.1.0.207:3000"],"experimental":{"useSkewCookie":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":4294967294}},"cacheHandlers":{},"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"serverSourceMaps":false,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"clientSegmentCache":false,"clientParamParsing":false,"dynamicOnHover":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","middlewarePrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"viewTransition":false,"routerBFCache":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"cacheComponents":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"devtoolSegmentExplorer":true,"browserDebugInfoInTerminal":false,"optimizeRouterScrolling":false,"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","turbopack":{"root":"/home/runner/work/dexto/dexto"}}
13
13
 
14
14
  process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
15
15