@mcpjam/inspector 3.9.2 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/dead-clicks-autocapture-ApmbuFvM.js +2 -0
- package/dist/client/assets/error-reporting-C8so6E8C.js +92 -0
- package/dist/client/assets/exception-autocapture-BqHgtpgn.js +3 -0
- package/dist/client/assets/highlighted-body-OFNGDK62-Lg-8-zC8.js +2 -0
- package/dist/client/assets/index-BYEarR7W.css +1 -0
- package/dist/client/assets/index-BireMI1y.js +11 -0
- package/dist/client/assets/{jszip.min-DbrVI1cf.js → jszip.min-DkflbHVD.js} +2 -2
- package/dist/client/assets/{index-CgVx6LGA.js → mermaid-GHXKKRXX-DooOqFNN.js} +433 -530
- package/dist/client/assets/mermaid-GHXKKRXX-zqdNpMJm.css +1 -0
- package/dist/client/assets/{posthog-recorder-Jn9DbeVC.js → posthog-recorder-Cqdsd7mu.js} +2 -2
- package/dist/client/assets/surveys-Bn96AwyI.js +2 -0
- package/dist/client/assets/web-vitals-D6VtlfDg.js +2 -0
- package/dist/client/index.html +2 -2
- package/dist/server/{chunk-TGJCY2WD.js → chunk-3I6NEQHV.js} +2 -2
- package/dist/server/harness-install-cli.js +1 -1
- package/dist/server/index.js +3899 -1242
- package/package.json +3 -3
- package/dist/client/assets/dead-clicks-autocapture-IiM_E33e.js +0 -2
- package/dist/client/assets/exception-autocapture-ho2DsZUp.js +0 -3
- package/dist/client/assets/highlighted-body-OFNGDK62-CL4BGpKx.js +0 -2
- package/dist/client/assets/index-DIFWovxF.css +0 -1
- package/dist/client/assets/surveys-DGrFiWaS.js +0 -2
- package/dist/client/assets/web-vitals-BAEPtyOe.js +0 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import{a as lp}from"./index-BireMI1y.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"3.11.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="77a1c2fa-953f-4f1a-a9b0-7711b6386586",e._sentryDebugIdIdentifier="sentry-dbid-77a1c2fa-953f-4f1a-a9b0-7711b6386586")}catch{}})();var tt=[],Le=[],up=Uint8Array,si="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var tn=0,dp=si.length;tn<dp;++tn)tt[tn]=si[tn],Le[si.charCodeAt(tn)]=tn;Le[45]=62;Le[95]=63;function hp(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function pp(e,t,n){return(t+n)*3/4-n}function ts(e){var t,n=hp(e),r=n[0],s=n[1],i=new up(pp(e,r,s)),o=0,a=s>0?r-4:r,c;for(c=0;c<a;c+=4)t=Le[e.charCodeAt(c)]<<18|Le[e.charCodeAt(c+1)]<<12|Le[e.charCodeAt(c+2)]<<6|Le[e.charCodeAt(c+3)],i[o++]=t>>16&255,i[o++]=t>>8&255,i[o++]=t&255;return s===2&&(t=Le[e.charCodeAt(c)]<<2|Le[e.charCodeAt(c+1)]>>4,i[o++]=t&255),s===1&&(t=Le[e.charCodeAt(c)]<<10|Le[e.charCodeAt(c+1)]<<4|Le[e.charCodeAt(c+2)]>>2,i[o++]=t>>8&255,i[o++]=t&255),i}function fp(e){return tt[e>>18&63]+tt[e>>12&63]+tt[e>>6&63]+tt[e&63]}function gp(e,t,n){for(var r,s=[],i=t;i<n;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),s.push(fp(r));return s.join("")}function ns(e){for(var t,n=e.length,r=n%3,s=[],i=16383,o=0,a=n-r;o<a;o+=i)s.push(gp(e,o,o+i>a?a:o+i));return r===1?(t=e[n-1],s.push(tt[t>>2]+tt[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],s.push(tt[t>>10]+tt[t>>4&63]+tt[t<<2&63]+"=")),s.join("")}function ME(e){if(e===void 0)return{};if(!ql(e))throw new Error(`The arguments to a Convex function must be an object. Received: ${e}`);return e}function zE(e){if(typeof e>"u")throw new Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");if(typeof e!="string")throw new Error(`Invalid deployment address: found ${e}".`);if(!(e.startsWith("http:")||e.startsWith("https:")))throw new Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);try{new URL(e)}catch{throw new Error(`Invalid deployment address: "${e}" is not a valid URL. If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}if(e.endsWith(".convex.site"))throw new Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`)}function ql(e){const t=typeof e=="object",n=Object.getPrototypeOf(e),r=n===null||n===Object.prototype||n?.constructor?.name==="Object";return t&&r}const Bl=!0,Tn=BigInt("-9223372036854775808"),Do=BigInt("9223372036854775807"),Di=BigInt("0"),mp=BigInt("8"),_p=BigInt("256");function Hl(e){return Number.isNaN(e)||!Number.isFinite(e)||Object.is(e,-0)}function vp(e){e<Di&&(e-=Tn+Tn);let t=e.toString(16);t.length%2===1&&(t="0"+t);const n=new Uint8Array(new ArrayBuffer(8));let r=0;for(const s of t.match(/.{2}/g).reverse())n.set([parseInt(s,16)],r++),e>>=mp;return ns(n)}function yp(e){const t=ts(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);let n=Di,r=Di;for(const s of t)n+=BigInt(s)*_p**r,r++;return n>Do&&(n+=Tn+Tn),n}function bp(e){if(e<Tn||Do<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);const t=new ArrayBuffer(8);return new DataView(t).setBigInt64(0,e,!0),ns(new Uint8Array(t))}function wp(e){const t=ts(e);if(t.byteLength!==8)throw new Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);return new DataView(t.buffer).getBigInt64(0,!0)}const Sp=DataView.prototype.setBigInt64?bp:vp,Ep=DataView.prototype.getBigInt64?wp:yp,Ca=1024;function Vl(e){if(e.length>Ca)throw new Error(`Field name ${e} exceeds maximum field name length ${Ca}.`);if(e.startsWith("$"))throw new Error(`Field name ${e} starts with a '$', which is reserved.`);for(let t=0;t<e.length;t+=1){const n=e.charCodeAt(t);if(n<32||n>=127)throw new Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`)}}function Na(e){if(e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string")return e;if(Array.isArray(e))return e.map(r=>Na(r));if(typeof e!="object")throw new Error(`Unexpected type of ${e}`);const t=Object.entries(e);if(t.length===1){const r=t[0][0];if(r==="$bytes"){if(typeof e.$bytes!="string")throw new Error(`Malformed $bytes field on ${e}`);return ts(e.$bytes).buffer}if(r==="$integer"){if(typeof e.$integer!="string")throw new Error(`Malformed $integer field on ${e}`);return Ep(e.$integer)}if(r==="$float"){if(typeof e.$float!="string")throw new Error(`Malformed $float field on ${e}`);const s=ts(e.$float);if(s.byteLength!==8)throw new Error(`Received ${s.byteLength} bytes, expected 8 for $float`);const o=new DataView(s.buffer).getFloat64(0,Bl);if(!Hl(o))throw new Error(`Float ${o} should be encoded as a number`);return o}if(r==="$set")throw new Error("Received a Set which is no longer supported as a Convex type.");if(r==="$map")throw new Error("Received a Map which is no longer supported as a Convex type.")}const n={};for(const[r,s]of Object.entries(e))Vl(r),n[r]=Na(s);return n}const La=16384;function sr(e){const t=JSON.stringify(e,(n,r)=>r===void 0?"undefined":typeof r=="bigint"?`${r.toString()}n`:r);if(t.length>La){const n="[...truncated]";let r=La-n.length;const s=t.codePointAt(r-1);return s!==void 0&&s>65535&&(r-=1),t.substring(0,r)+n}return t}function Fi(e,t,n,r){if(e===void 0){const o=n&&` (present at path ${n} in original object ${sr(t)})`;throw new Error(`undefined is not a valid Convex value${o}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`)}if(e===null)return e;if(typeof e=="bigint"){if(e<Tn||Do<e)throw new Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);return{$integer:Sp(e)}}if(typeof e=="number")if(Hl(e)){const o=new ArrayBuffer(8);return new DataView(o).setFloat64(0,e,Bl),{$float:ns(new Uint8Array(o))}}else return e;if(typeof e=="boolean"||typeof e=="string")return e;if(e instanceof ArrayBuffer)return{$bytes:ns(new Uint8Array(e))};if(Array.isArray(e))return e.map((o,a)=>Fi(o,t,n+`[${a}]`));if(e instanceof Set)throw new Error(ii(n,"Set",[...e],t));if(e instanceof Map)throw new Error(ii(n,"Map",[...e],t));if(!ql(e)){const o=e?.constructor?.name,a=o?`${o} `:"";throw new Error(ii(n,a,e,t))}const s={},i=Object.entries(e);i.sort(([o,a],[c,l])=>o===c?0:o<c?-1:1);for(const[o,a]of i)a!==void 0&&(Vl(o),s[o]=Fi(a,t,n+`.${o}`));return s}function ii(e,t,n,r){return e?`${t}${sr(n)} is not a supported Convex type (present at path ${e} in original object ${sr(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.`:`${t}${sr(n)} is not a supported Convex type.`}function DE(e){return Fi(e,e,"")}var kp=Object.defineProperty,Tp=(e,t,n)=>t in e?kp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oi=(e,t,n)=>Tp(e,typeof t!="symbol"?t+"":t,n),Ma,za;const Op=Symbol.for("ConvexError");class Ip extends(za=Error,Ma=Op,za){constructor(t){super(typeof t=="string"?t:sr(t)),oi(this,"name","ConvexError"),oi(this,"data"),oi(this,Ma,!0),this.data=t}}const Ap=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ir="8.55.1",De=globalThis;function Rs(e,t,n){const r=n||De,s=r.__SENTRY__=r.__SENTRY__||{},i=s[ir]=s[ir]||{};return i[e]||(i[e]=t())}const Cs=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Pp="Sentry Logger ",Da=["debug","info","warn","error","log","assert","trace"],Fa={};function Gl(e){if(!("console"in De))return e();const t=De.console,n={},r=Object.keys(Fa);r.forEach(s=>{const i=Fa[s];n[s]=t[s],t[s]=i});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function xp(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Cs?Da.forEach(n=>{t[n]=(...r)=>{e&&Gl(()=>{De.console[n](`${Pp}[${n}]:`,...r)})}}):Da.forEach(n=>{t[n]=()=>{}}),t}const Vt=Rs("logger",xp),Wl=50,$p="?",ja=/\(error: (.*)\)/,Ua=/captureMessage|captureException/;function Rp(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(`
|
|
2
|
+
`);for(let a=r;a<o.length;a++){const c=o[a];if(c.length>1024)continue;const l=ja.test(c)?c.replace(ja,"$1"):c;if(!l.match(/\S*Error: /)){for(const u of t){const d=u(l);if(d){i.push(d);break}}if(i.length>=Wl+s)break}}return Cp(i.slice(s))}}function FE(e){return Array.isArray(e)?Rp(...e):e}function Cp(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Ar(t).function||"")&&t.pop(),t.reverse(),Ua.test(Ar(t).function||"")&&(t.pop(),Ua.test(Ar(t).function||"")&&t.pop()),t.slice(0,Wl).map(n=>({...n,filename:n.filename||Ar(t).filename,function:n.function||$p}))}function Ar(e){return e[e.length-1]||{}}const ai="<anonymous>";function Np(e){try{return!e||typeof e!="function"?ai:e.name||ai}catch{return ai}}function jE(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Sr(){return Fo(De),De}function Fo(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||ir,t[ir]=t[ir]||{}}const Jl=Object.prototype.toString;function Lp(e){switch(Jl.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ns(e,Error)}}function Mn(e,t){return Jl.call(e)===`[object ${t}]`}function UE(e){return Mn(e,"ErrorEvent")}function ZE(e){return Mn(e,"DOMError")}function qE(e){return Mn(e,"DOMException")}function rs(e){return Mn(e,"String")}function Mp(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function BE(e){return e===null||Mp(e)||typeof e!="object"&&typeof e!="function"}function jo(e){return Mn(e,"Object")}function zp(e){return typeof Event<"u"&&Ns(e,Event)}function Dp(e){return typeof Element<"u"&&Ns(e,Element)}function Fp(e){return Mn(e,"RegExp")}function Uo(e){return!!(e&&e.then&&typeof e.then=="function")}function jp(e){return jo(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Ns(e,t){try{return e instanceof t}catch{return!1}}function Yl(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}const wn=De,Up=80;function Zp(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let l;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||Up;for(;n&&i++<r&&(l=qp(n,u),!(l==="html"||i>1&&o+s.length*c+l.length>=d));)s.push(l),o+=l.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function qp(e,t){const n=e,r=[];if(!n||!n.tagName)return"";if(wn.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t&&t.length?t.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(s&&s.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&rs(o)){const a=o.split(/\s+/);for(const c of a)r.push(`.${c}`)}}const i=["aria-label","type","name","title","alt"];for(const o of i){const a=n.getAttribute(o);a&&r.push(`[${o}="${a}"]`)}return r.join("")}function HE(){try{return wn.document.location.href}catch{return""}}function VE(e){return wn.document&&wn.document.querySelector?wn.document.querySelector(e):null}function GE(e){if(!wn.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function or(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function WE(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{Yl(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Bp(e,t,n=!1){return rs(e)?Fp(t)?t.test(e):rs(t)?n?e===t:e.includes(t):!1:!1}function JE(e,t=[],n=!1){return t.some(r=>Bp(e,r,n))}function YE(e,t,n){if(!(t in e))return;const r=e[t],s=n(r);typeof s=="function"&&Hp(s,r);try{e[t]=s}catch{Cs&&Vt.log(`Failed to replace method "${t}" in object`,e)}}function On(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Cs&&Vt.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Hp(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,On(e,"__sentry_original__",t)}catch{}}function KE(e){return e.__sentry_original__}function Kl(e){if(Lp(e))return{message:e.message,name:e.name,stack:e.stack,...qa(e)};if(zp(e)){const t={type:e.type,target:Za(e.target),currentTarget:Za(e.currentTarget),...qa(e)};return typeof CustomEvent<"u"&&Ns(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Za(e){try{return Dp(e)?Zp(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function qa(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function XE(e,t=40){const n=Object.keys(Kl(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return or(r,t);for(let s=n.length;s>0;s--){const i=n.slice(0,s).join(", ");if(!(i.length>t))return s===n.length?i:or(i,t)}return""}function We(e){return ji(e,new Map)}function ji(e,t){if(Vp(e)){const n=t.get(e);if(n!==void 0)return n;const r={};t.set(e,r);for(const s of Object.getOwnPropertyNames(e))typeof e[s]<"u"&&(r[s]=ji(e[s],t));return r}if(Array.isArray(e)){const n=t.get(e);if(n!==void 0)return n;const r=[];return t.set(e,r),e.forEach(s=>{r.push(ji(s,t))}),r}return e}function Vp(e){if(!jo(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}const Xl=1e3;function Zo(){return Date.now()/Xl}function Gp(){const{performance:e}=De;if(!e||!e.now)return Zo;const t=Date.now()-e.now(),n=e.timeOrigin==null?t:e.timeOrigin;return()=>(n+e.now())/Xl}const qo=Gp(),QE=(()=>{const{performance:e}=De;if(!e||!e.now)return;const t=3600*1e3,n=e.now(),r=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=s<t,o=e.timing&&e.timing.navigationStart,c=typeof o=="number"?Math.abs(o+n-r):t,l=c<t;return i||l?s<=c?e.timeOrigin:o:r})();function It(){const e=De,t=e.crypto||e.msCrypto;let n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function Ql(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function ek(e){const{message:t,event_id:n}=e;if(t)return t;const r=Ql(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function tk(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function Wp(e,t){const n=Ql(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const i={...s&&s.data,...t.data};n.mechanism.data=i}}function nk(e){if(Jp(e))return!0;try{On(e,"__sentry_captured__",!0)}catch{}return!1}function Jp(e){try{return e.__sentry_captured__}catch{}}var lt;(function(e){e[e.PENDING=0]="PENDING";const n=1;e[e.RESOLVED=n]="RESOLVED";const r=2;e[e.REJECTED=r]="REJECTED"})(lt||(lt={}));function rk(e){return new Qe(t=>{t(e)})}function sk(e){return new Qe((t,n)=>{n(e)})}class Qe{constructor(t){Qe.prototype.__init.call(this),Qe.prototype.__init2.call(this),Qe.prototype.__init3.call(this),Qe.prototype.__init4.call(this),this._state=lt.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}then(t,n){return new Qe((r,s)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Qe((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,t&&t()},o=>{i=!0,s=o,t&&t()}).then(()=>{if(i){r(s);return}n(s)})})}__init(){this._resolve=t=>{this._setResult(lt.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(lt.REJECTED,t)}}__init3(){this._setResult=(t,n)=>{if(this._state===lt.PENDING){if(Uo(n)){n.then(this._resolve,this._reject);return}this._state=t,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===lt.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===lt.RESOLVED&&n[1](this._value),this._state===lt.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Yp(e){const t=qo(),n={sid:It(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Xp(n)};return e&&Ls(n,e),n}function Ls(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||qo(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:It()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Kp(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Ls(e,n)}function Xp(e){return We({sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}function ss(){return It()}function In(){return It().substring(16)}function Ms(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&t&&Object.keys(t).length===0)return e;const r={...e};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=Ms(r[s],t[s],n-1));return r}const Ui="_sentrySpan";function Ba(e,t){t?On(e,Ui,t):delete e[Ui]}function Zi(e){return e[Ui]}const Qp=100;class Bo{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:ss(),spanId:In()}}clone(){const t=new Bo;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,Ba(t,Zi(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ls(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,[r,s]=n instanceof xt?[n.getScopeData(),n.getRequestSession()]:jo(n)?[t,t.requestSession]:[],{tags:i,extra:o,user:a,contexts:c,level:l,fingerprint:u=[],propagationContext:d}=r||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),l&&(this._level=l),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),s&&(this._requestSession=s),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Ba(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ss()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:Qp;if(r<=0)return this;const s={timestamp:Zo(),...t};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Zi(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Ms(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:In(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n&&n.event_id?n.event_id:It();if(!this._client)return Vt.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=r&&r.event_id?r.event_id:It();if(!this._client)return Vt.warn("No client configured on scope - will not capture message!"),s;const i=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:s},this),s}captureEvent(t,n){const r=n&&n.event_id?n.event_id:It();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Vt.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}const xt=Bo;function ef(){return Rs("defaultCurrentScope",()=>new xt)}function tf(){return Rs("defaultIsolationScope",()=>new xt)}class nf{constructor(t,n){let r;t?r=t:r=new xt;let s;n?s=n:s=new xt,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return Uo(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function An(){const e=Sr(),t=Fo(e);return t.stack=t.stack||new nf(ef(),tf())}function rf(e){return An().withScope(e)}function sf(e,t){const n=An();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Ha(e){return An().withScope(()=>e(An().getIsolationScope()))}function of(){return{withIsolationScope:Ha,withScope:rf,withSetScope:sf,withSetIsolationScope:(e,t)=>Ha(t),getCurrentScope:()=>An().getScope(),getIsolationScope:()=>An().getIsolationScope()}}function zs(e){const t=Fo(e);return t.acs?t.acs:of()}function Ct(){const e=Sr();return zs(e).getCurrentScope()}function Xt(){const e=Sr();return zs(e).getIsolationScope()}function af(){return Rs("globalScope",()=>new xt)}function ik(...e){const t=Sr(),n=zs(t);if(e.length===2){const[r,s]=e;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(e[0])}function Er(){return Ct().getClient()}function ok(e){const t=e.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:s}=t;return We({trace_id:n,span_id:r,parent_span_id:s})}const cf="_sentryMetrics";function lf(e){const t=e[cf];if(!t)return;const n={};for(const[,[r,s]]of t)(n[r]||(n[r]=[])).push(We(s));return n}const uf="sentry.source",df="sentry.sample_rate",hf="sentry.op",pf="sentry.origin",ak="sentry.idle_span_finish_reason",ck="sentry.measurement_unit",lk="sentry.measurement_value",uk="sentry.custom_span_name",dk="sentry.profile_id",hk="sentry.exclusive_time",ff=0,eu=1,Ae=2;function gf(e){if(e<400&&e>=100)return{code:eu};if(e>=400&&e<500)switch(e){case 401:return{code:Ae,message:"unauthenticated"};case 403:return{code:Ae,message:"permission_denied"};case 404:return{code:Ae,message:"not_found"};case 409:return{code:Ae,message:"already_exists"};case 413:return{code:Ae,message:"failed_precondition"};case 429:return{code:Ae,message:"resource_exhausted"};case 499:return{code:Ae,message:"cancelled"};default:return{code:Ae,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:Ae,message:"unimplemented"};case 503:return{code:Ae,message:"unavailable"};case 504:return{code:Ae,message:"deadline_exceeded"};default:return{code:Ae,message:"internal_error"}}return{code:Ae,message:"unknown_error"}}function pk(e,t){e.setAttribute("http.response.status_code",t);const n=gf(t);n.message!=="unknown_error"&&e.setStatus(n)}const tu="sentry-",mf=/^sentry-/,_f=8192;function nu(e){const t=vf(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,i])=>{if(s.match(mf)){const o=s.slice(tu.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function fk(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,s])=>(s&&(n[`${tu}${r}`]=s),n),{});return yf(t)}function vf(e){if(!(!e||!rs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Va(n);return Object.entries(r).forEach(([s,i])=>{t[s]=i}),t},{}):Va(e)}function Va(e){return e.split(",").map(t=>t.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function yf(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${t},${i}`;return o.length>_f?(Cs&&Vt.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):o},"")}const bf=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function wf(e){if(!e)return;const t=e.match(bf);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function gk(e,t){const n=wf(e),r=nu(t);if(!n||!n.traceId)return{traceId:ss(),spanId:In()};const{traceId:s,parentSpanId:i,parentSampled:o}=n,a=In();return{traceId:s,parentSpanId:i,spanId:a,sampled:o,dsc:r||{}}}function Sf(e=ss(),t=In(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}const mk=0,Ef=1;let Ga=!1;function _k(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:a}=Ds(e);return We({parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:o,origin:a})}function kf(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:Ds(e).parent_span_id,i=r?In():t;return We({parent_span_id:s,span_id:i,trace_id:n})}function vk(e){const{traceId:t,spanId:n}=e.spanContext(),r=Ho(e);return Sf(t,n,r)}function Wa(e){return typeof e=="number"?Ja(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Ja(e.getTime()):qo()}function Ja(e){return e>9999999999?e/1e3:e}function Ds(e){if(Of(e))return e.getSpanJSON();try{const{spanId:t,traceId:n}=e.spanContext();if(Tf(e)){const{attributes:r,startTime:s,name:i,endTime:o,parentSpanId:a,status:c}=e;return We({span_id:t,trace_id:n,data:r,description:i,parent_span_id:a,start_timestamp:Wa(s),timestamp:Wa(o)||void 0,status:If(c),op:r[hf],origin:r[pf],_metrics_summary:lf(e)})}return{span_id:t,trace_id:n}}catch{return{}}}function Tf(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Of(e){return typeof e.getSpanJSON=="function"}function Ho(e){const{traceFlags:t}=e.spanContext();return t===Ef}function If(e){if(!(!e||e.code===ff))return e.code===eu?"ok":e.message||"unknown_error"}const Gt="_sentryChildSpans",qi="_sentryRootSpan";function yk(e,t){const n=e[qi]||e;On(t,qi,n),e[Gt]?e[Gt].add(t):On(e,Gt,new Set([t]))}function bk(e,t){e[Gt]&&e[Gt].delete(t)}function wk(e){const t=new Set;function n(r){if(!t.has(r)&&Ho(r)){t.add(r);const s=r[Gt]?Array.from(r[Gt]):[];for(const i of s)n(i)}}return n(e),Array.from(t)}function ru(e){return e[qi]||e}function Sk(){const e=Sr(),t=zs(e);return t.getActiveSpan?t.getActiveSpan():Zi(Ct())}function Ek(){Ga||(Gl(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),Ga=!0)}function Af(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=Er(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}const Vo="production",su="_frozenDsc";function kk(e,t){On(e,su,t)}function iu(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s=We({environment:n.environment||Vo,release:n.release,public_key:r,trace_id:e});return t.emit("createDsc",s),s}function Tk(e,t){const n=t.getPropagationContext();return n.dsc||iu(n.traceId,e)}function Pf(e){const t=Er();if(!t)return{};const n=ru(e),r=n[su];if(r)return r;const s=n.spanContext().traceState,i=s&&s.get("sentry.dsc"),o=i&&nu(i);if(o)return o;const a=iu(e.spanContext().traceId,t),c=Ds(n),l=c.data||{},u=l[df];u!=null&&(a.sample_rate=`${u}`);const d=l[uf],h=c.description;return d!=="url"&&h&&(a.transaction=h),Af()&&(a.sampled=String(Ho(n))),t.emit("createDsc",a,n),a}function xf(){const e=typeof WeakSet=="function",t=e?new WeakSet:[];function n(s){if(e)return t.has(s)?!0:(t.add(s),!1);for(let i=0;i<t.length;i++)if(t[i]===s)return!0;return t.push(s),!1}function r(s){if(e)t.delete(s);else for(let i=0;i<t.length;i++)if(t[i]===s){t.splice(i,1);break}}return[n,r]}function wt(e,t=100,n=1/0){try{return Bi("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function $f(e,t=3,n=100*1024){const r=wt(e,t);return Lf(r)>n?$f(e,t-1,n):r}function Bi(e,t,n=1/0,r=1/0,s=xf()){const[i,o]=s;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=Rf(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(i(t))return"[Circular ~]";const l=t;if(l&&typeof l.toJSON=="function")try{const p=l.toJSON();return Bi("",p,c-1,r,s)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=Kl(t);for(const p in h){if(!Object.prototype.hasOwnProperty.call(h,p))continue;if(d>=r){u[p]="[MaxProperties ~]";break}const g=h[p];u[p]=Bi(p,g,c-1,r,s),d++}return o(t),u}function Rf(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Yl(t))return"[VueViewModel]";if(jp(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Np(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Cf(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Cf(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Nf(e){return~-encodeURI(e).split(/%..|./).length}function Lf(e){return Nf(JSON.stringify(e))}function Hi(e,t,n,r=0){return new Qe((s,i)=>{const o=e[r];if(t===null||typeof o!="function")s(t);else{const a=o({...t},n);Ap&&o.id&&a===null&&Vt.log(`Event processor "${o.id}" dropped event`),Uo(a)?a.then(c=>Hi(e,c,n,r+1).then(s)).then(null,i):Hi(e,a,n,r+1).then(s).then(null,i)}})}let Pr,Ya,xr;function Mf(e){const t=De._sentryDebugIds;if(!t)return{};const n=Object.keys(t);return xr&&n.length===Ya||(Ya=n.length,xr=n.reduce((r,s)=>{Pr||(Pr={});const i=Pr[s];if(i)r[i[0]]=i[1];else{const o=e(s);for(let a=o.length-1;a>=0;a--){const c=o[a],l=c&&c.filename,u=t[s];if(l&&u){r[l]=u,Pr[s]=[l,u];break}}}return r},{})),xr}function zf(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;Df(e,t),r&&Uf(e,r),Zf(e,n),Ff(e,s),jf(e,i)}function Ka(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:l,eventProcessors:u,attachments:d,propagationContext:h,transactionName:p,span:g}=t;$r(e,"extra",n),$r(e,"tags",r),$r(e,"user",s),$r(e,"contexts",i),e.sdkProcessingMetadata=Ms(e.sdkProcessingMetadata,a,2),o&&(e.level=o),p&&(e.transactionName=p),g&&(e.span=g),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function $r(e,t,n){e[t]=Ms(e[t],n,1)}function Df(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=t,c=We(n);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});const l=We(r);l&&Object.keys(l).length&&(e.tags={...l,...e.tags});const u=We(s);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=We(i);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),o&&(e.level=o),a&&e.type!=="transaction"&&(e.transaction=a)}function Ff(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function jf(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Uf(e,t){e.contexts={trace:kf(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Pf(t),...e.sdkProcessingMetadata};const n=ru(t),r=Ds(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Zf(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}function Ok(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||It(),timestamp:t.timestamp||Zo()},l=n.integrations||e.integrations.map(v=>v.name);qf(c,e),Vf(c,l),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&Bf(c,e.stackParser);const u=Wf(r,n.captureContext);n.mechanism&&Wp(c,n.mechanism);const d=s?s.getEventProcessors():[],h=af().getScopeData();if(i){const v=i.getScopeData();Ka(h,v)}if(u){const v=u.getScopeData();Ka(h,v)}const p=[...n.attachments||[],...h.attachments];p.length&&(n.attachments=p),zf(c,h);const g=[...d,...h.eventProcessors];return Hi(g,c,n).then(v=>(v&&Hf(v),typeof o=="number"&&o>0?Gf(v,o,a):v))}function qf(e,t){const{environment:n,release:r,dist:s,maxValueLength:i=250}=t;e.environment=e.environment||n||Vo,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s),e.message&&(e.message=or(e.message,i));const o=e.exception&&e.exception.values&&e.exception.values[0];o&&o.value&&(o.value=or(o.value,i));const a=e.request;a&&a.url&&(a.url=or(a.url,i))}function Bf(e,t){const n=Mf(t);try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{n&&s.filename&&(s.debug_id=n[s.filename])})})}catch{}}function Hf(e){const t={};try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?t[s.abs_path]=s.debug_id:s.filename&&(t[s.filename]=s.debug_id),delete s.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([r,s])=>{n.push({type:"sourcemap",code_file:r,debug_id:s})})}function Vf(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Gf(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(s=>({...s,...s.data&&{data:wt(s.data,t,n)}}))},...e.user&&{user:wt(e.user,t,n)},...e.contexts&&{contexts:wt(e.contexts,t,n)},...e.extra&&{extra:wt(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=wt(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(s=>({...s,...s.data&&{data:wt(s.data,t,n)}}))),e.contexts&&e.contexts.flags&&r.contexts&&(r.contexts.flags=wt(e.contexts.flags,3,n)),r}function Wf(e,t){if(!t)return e;const n=e?e.clone():new xt;return n.update(t),n}function Jf(e){if(e)return Yf(e)?{captureContext:e}:Xf(e)?{captureContext:e}:e}function Yf(e){return e instanceof xt||typeof e=="function"}const Kf=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function Xf(e){return Object.keys(e).some(t=>Kf.includes(t))}function Qf(e,t){return Ct().captureException(e,Jf(t))}function Ik(e,t){const n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return Ct().captureMessage(e,n,r)}function Ak(e,t){return Ct().captureEvent(e,t)}function Pk(e,t){Xt().setContext(e,t)}function xk(e,t){Xt().setTag(e,t)}function $k(e){Xt().setUser(e)}function Rk(){const e=Er();return!!e&&e.getOptions().enabled!==!1&&!!e.getTransport()}function Ck(e){Xt().addEventProcessor(e)}function Nk(e){const t=Er(),n=Xt(),r=Ct(),{release:s,environment:i=Vo}=t&&t.getOptions()||{},{userAgent:o}=De.navigator||{},a=Yp({release:s,environment:i,user:r.getUser()||n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession();return c&&c.status==="ok"&&Ls(c,{status:"exited"}),ou(),n.setSession(a),r.setSession(a),a}function ou(){const e=Xt(),t=Ct(),n=t.getSession()||e.getSession();n&&Kp(n),au(),e.setSession(),t.setSession()}function au(){const e=Xt(),t=Ct(),n=Er(),r=t.getSession()||e.getSession();r&&n&&n.captureSession(r)}function Lk(e=!1){if(e){ou();return}au()}var m=typeof window<"u"?window:void 0,le=typeof globalThis<"u"?globalThis:m;typeof self>"u"&&(le.self=le),typeof File>"u"&&(le.File=function(){});var xe=le?.navigator,P=le?.document,he=le?.location,Vi=le?.fetch,Gi=le!=null&&le.XMLHttpRequest&&"withCredentials"in new le.XMLHttpRequest?le.XMLHttpRequest:void 0,Xa=le?.AbortController,eg=le?.CompressionStream,Ee=xe?.userAgent,N=m??{},Qa="1.369.0",we={DEBUG:!1,LIB_VERSION:Qa,LIB_NAME:"web",JS_SDK_VERSION:Qa};function ec(e,t,n,r,s,i,o){try{var a=e[i](o),c=a.value}catch(l){return void n(l)}a.done?t(c):Promise.resolve(c).then(r,s)}function He(e){return function(){var t=this,n=arguments;return new Promise((function(r,s){var i=e.apply(t,n);function o(c){ec(i,r,s,o,a,"next",c)}function a(c){ec(i,r,s,o,a,"throw",c)}o(void 0)}))}}function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(null,arguments)}function cu(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function lu(){return(lu=He((function*(e,t,n){t===void 0&&(t=!0);try{var r=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(r).blob()}catch(s){if(n!=null&&n.rethrow)throw s;return t&&console.error("Failed to gzip compress data",s),null}}))).apply(this,arguments)}var tg=["$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"],ng=["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"],tc=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return ng.concat(t).some((r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1}))};function F(e,t){return e.indexOf(t)!==-1}var Fs=function(e){return e.trim()},Wi=function(e){return e.replace(/^\$/,"")},uu=Object.prototype,du=uu.hasOwnProperty,js=uu.toString,Z=Array.isArray||function(e){return js.call(e)==="[object Array]"},ut=e=>typeof e=="function",ce=e=>e===Object(e)&&!Z(e),pn=e=>{if(ce(e)){for(var t in e)if(du.call(e,t))return!1;return!0}return!1},R=e=>e===void 0,oe=e=>js.call(e)=="[object String]",Jr=e=>oe(e)&&e.trim().length===0,pt=e=>e===null,j=e=>R(e)||pt(e),Ye=e=>js.call(e)=="[object Number]"&&e==e,ln=e=>Ye(e)&&e>0,rt=e=>js.call(e)==="[object Boolean]",rg=e=>e instanceof FormData,sg=e=>F(tg,e);function hu(e){return e===null||typeof e!="object"}function is(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Go(e){return typeof Event<"u"&&(function(t,n){try{return t instanceof n}catch{return!1}})(e,Event)}var ig=[!0,"true",1,"1","yes"],ci=e=>F(ig,e),og=[!1,"false",0,"0","no"];function st(e,t,n,r,s){return t>n&&(r.warn("min cannot be greater than max."),t=n),Ye(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(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: "+n+", fallback: "+s),st(s||n,t,n,r))}class ag{constructor(t){this.Pt={},this.Dt=t.Dt,this.jt=st(t.bucketSize,0,100,t.qt),this.$t=st(t.refillRate,0,this.jt,t.qt),this.Vt=st(t.refillInterval,0,864e5,t.qt)}Ht(t,n){var r=Math.floor((n-t.lastAccess)/this.Vt);r>0&&(t.tokens=Math.min(t.tokens+r*this.$t,this.jt),t.lastAccess=t.lastAccess+r*this.Vt)}consumeRateLimit(t){var n,r=Date.now(),s=String(t),i=this.Pt[s];return i?this.Ht(i,r):this.Pt[s]=i={tokens:this.jt,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.Dt)==null||n.call(this,t)),i.tokens===0)}stop(){this.Pt={}}}var Rr,nc,li,$e="Mobile",os="iOS",dt="Android",Pn="Tablet",pu=dt+" "+Pn,fu="iPad",gu="Apple",mu=gu+" Watch",ar="Safari",xn="BlackBerry",_u="Samsung",vu=_u+"Browser",yu=_u+" Internet",Wt="Chrome",cg=Wt+" OS",bu=Wt+" "+os,Wo="Internet Explorer",wu=Wo+" "+$e,Jo="Opera",lg=Jo+" Mini",Yo="Edge",Su="Microsoft "+Yo,Sn="Firefox",Eu=Sn+" "+os,fr="Nintendo",gr="PlayStation",En="Xbox",ku=dt+" "+$e,Tu=$e+" "+ar,Jn="Windows",Ji=Jn+" Phone",rc="Nokia",Yi="Ouya",Ou="Generic",ug=Ou+" "+$e.toLowerCase(),Iu=Ou+" "+Pn.toLowerCase(),Ki="Konqueror",ye="(\\d+(\\.\\d+)?)",ui=new RegExp("Version/"+ye),dg=new RegExp(En,"i"),hg=new RegExp(gr+" \\w+","i"),pg=new RegExp(fr+" \\w+","i"),Ko=new RegExp(xn+"|PlayBook|BB10","i"),fg={"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"},Au=function(e,t){return t=t||"",F(e," OPR/")&&F(e,"Mini")?lg:F(e," OPR/")?Jo:Ko.test(e)?xn:F(e,"IE"+$e)||F(e,"WPDesktop")?wu:F(e,vu)?yu:F(e,Yo)||F(e,"Edg/")?Su:F(e,"FBIOS")?"Facebook "+$e:F(e,"UCWEB")||F(e,"UCBrowser")?"UC Browser":F(e,"CriOS")?bu:F(e,"CrMo")||F(e,Wt)?Wt:F(e,dt)&&F(e,ar)?ku:F(e,"FxiOS")?Eu:F(e.toLowerCase(),Ki.toLowerCase())?Ki:((n,r)=>r&&F(r,gu)||(function(s){return F(s,ar)&&!F(s,Wt)&&!F(s,dt)})(n))(e,t)?F(e,$e)?Tu:ar:F(e,Sn)?Sn:F(e,"MSIE")||F(e,"Trident/")?Wo:F(e,"Gecko")?Sn:""},gg={[wu]:[new RegExp("rv:"+ye)],[Su]:[new RegExp(Yo+"?\\/"+ye)],[Wt]:[new RegExp("("+Wt+"|CrMo)\\/"+ye)],[bu]:[new RegExp("CriOS\\/"+ye)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ye)],[ar]:[ui],[Tu]:[ui],[Jo]:[new RegExp("(Opera|OPR)\\/"+ye)],[Sn]:[new RegExp(Sn+"\\/"+ye)],[Eu]:[new RegExp("FxiOS\\/"+ye)],[Ki]:[new RegExp("Konqueror[:/]?"+ye,"i")],[xn]:[new RegExp(xn+" "+ye),ui],[ku]:[new RegExp("android\\s"+ye,"i")],[yu]:[new RegExp(vu+"\\/"+ye)],[Wo]:[new RegExp("(rv:|MSIE )"+ye)],Mozilla:[new RegExp("rv:"+ye)]},mg=function(e,t){var n=Au(e,t),r=gg[n];if(R(r))return null;for(var s=0;r.length>s;s++){var i=e.match(r[s]);if(i)return parseFloat(i[i.length-2])}return null},sc=[[new RegExp(En+"; "+En+" (.*?)[);]","i"),e=>[En,e&&e[1]||""]],[new RegExp(fr,"i"),[fr,""]],[new RegExp(gr,"i"),[gr,""]],[Ko,[xn,""]],[new RegExp(Jn,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Ji,""];if(new RegExp($e).test(t)&&!/IEMobile\b/.test(t))return[Jn+" "+$e,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=fg[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Jn,r]}return[Jn,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[os,[e[3],e[4],e[5]||"0"].join(".")]:[os,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=R(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+dt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+dt+")","i"),e=>e&&e[2]?[dt,[e[2],e[3],e[4]||"0"].join(".")]:[dt,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[cg,""]],[/Linux|debian/i,["Linux",""]]],ic=function(e){return pg.test(e)?fr:hg.test(e)?gr:dg.test(e)?En:new RegExp(Yi,"i").test(e)?Yi:new RegExp("("+Ji+"|WPDesktop)","i").test(e)?Ji:/iPad/.test(e)?fu:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?mu:Ko.test(e)?xn:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(rc,"i").test(e)?rc:/(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($e).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)?dt:pu:new RegExp("(pda|"+$e+")","i").test(e)?ug:new RegExp(Pn,"i").test(e)&&!new RegExp(Pn+" pc","i").test(e)?Iu:""},_g=e=>e instanceof Error;function vg(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return li&&n.length===nc||(nc=n.length,li=n.reduce(((r,s)=>{Rr||(Rr={});var i=Rr[s];if(i)r[i[0]]=i[1];else for(var o=e(s),a=o.length-1;a>=0;a--){var c=o[a],l=c?.filename,u=t[s];if(l&&u){r[l]=u,Rr[s]=[l,u];break}}return r}),{})),li}}class yg{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,n,0).apply(t),i=this.buildParsingContext(n),o=this.parseStacktrace(s,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return He((function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Z(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t}))()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,s;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(s=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),O({},t,{cause:r,stack:s})}applyChunkIds(t,n){return t.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return He((function*(){var r=t;for(var s of n.modifiers)r=yield s(r);return r}))()}convertToExceptionList(t,n){var r,s,i,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(s=n.handled)===null||s===void 0||s,synthetic:(i=t.synthetic)!==null&&i!==void 0&&i}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return t.cause!=null&&a.push(...this.convertToExceptionList(t.cause,O({},n,{handled:!0}))),a}buildParsingContext(t){var n;return{chunkIdMap:vg(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var s=(i,o)=>{if(4>=o){var a=this.buildCoercingContext(t,n,o);return this.applyCoercers(i,a)}};return O({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:i=>s(i,r),next:i=>s(i,r+1)})}}var $n="?";function Xi(e,t,n,r,s){var i={platform:e,filename:t,function:n==="<anonymous>"?$n:n,in_app:!0};return R(r)||(i.lineno=r),R(s)||(i.colno=s),i}var Pu=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:$n,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},bg=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wg=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Sg=/\((\S*)(?::(\d+))(?::(\d+))\)/,Eg=(e,t)=>{var n=bg.exec(e);if(n){var[,r,s,i]=n;return Xi(t,r,$n,+s,+i)}var o=wg.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=Sg.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[c,l]=Pu(o[1]||$n,o[2]);return Xi(t,l,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},kg=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Tg=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Og=(e,t)=>{var n=kg.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Tg.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var s=n[3],i=n[1]||$n;return[i,s]=Pu(i,s),Xi(t,s,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},oc=/\(error: (.*)\)/;class Ig{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=oe(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return is(t,"DOMException")}isDOMError(t){return is(t,"DOMError")}}class Ag{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class Pg{constructor(){}match(t){return is(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r;return n.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var xg=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class $g{match(t){return typeof t=="string"}coerce(t,n){var r,[s,i]=this.getInfos(t);return{type:s??"Error",value:i??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,s=t.match(xg);return s&&(n=s[1],r=s[2]),[n,r]}}var Rg=["fatal","error","warning","log","info","debug"];function xu(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var s=n.slice(0,r).join(", ");if(t>=s.length)return r===n.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class Cg{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,s=this.getErrorPropertyFromObject(t);return s?n.apply(s):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return Go(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+xu(t)}isSeverityLevel(t){return oe(t)&&!Jr(t)&&Rg.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if({}.hasOwnProperty.call(t,n)){var r=t[n];if(_g(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class Ng{match(t){return Go(t)}coerce(t,n){var r,s=t.constructor.name;return{type:s,value:s+" captured as exception with keys: "+xu(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Lg{match(t){return hu(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Mg{match(t){return is(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!Go(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,s=this.getUnhandledRejectionReason(t);return hu(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(s)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var $u=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={C(s){if(m&&(we.DEBUG||N.POSTHOG_DEBUG||n)&&!R(m.console)&&m.console){for(var i=("__rrweb_original__"in m.console[s])?m.console[s].__rrweb_original__:m.console[s],o=arguments.length,a=new Array(o>1?o-1:0),c=1;o>c;c++)a[c-1]=arguments[c];i(e,...a)}},info(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.C("log",...i)},warn(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.C("warn",...i)},error(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];r.C("error",...i)},critical(){for(var s=arguments.length,i=new Array(s),o=0;s>o;o++)i[o]=arguments[o];console.error(e,...i)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,i)=>$u(e+" "+s,i)};return r},x=$u("[PostHog.js]"),X=x.createLogger,zg=X("[ExternalScriptsLoader]"),Cr=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return zg.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=P?.querySelectorAll("script");if(r){for(var s,i=function(){if(r[o].src===t){var c=r[o];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(l=>{c.__posthog_loading_callback_fired=!0,n(void 0,l)})),c.onerror=l=>n(l),{v:void 0})}},o=0;r.length>o;o++)if(s=i())return s.v}var a=()=>{if(!P)return n("document not found");var c=P.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=t,c.onload=d=>{c.__posthog_loading_callback_fired=!0,n(void 0,d)},c.onerror=d=>n(d),e.config.prepare_external_dependency_script&&(c=e.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")P.head.appendChild(c);else{var l,u=P.querySelectorAll("body > script");u.length>0?(l=u[0].parentNode)==null||l.insertBefore(c,u[0]):P.body.appendChild(c)}};P!=null&&P.body?a():P?.addEventListener("DOMContentLoaded",a)};N.__PosthogExtensions__=N.__PosthogExtensions__||{},N.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!=="remote-config")if(e._resolvedSdkVersion){var r=e.requestRouter.endpointFor("assets","/static/"+e._resolvedSdkVersion+"/"+t+".js");Cr(e,r,n)}else{var s="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var i=3e5;s=s+"&t="+Math.floor(Date.now()/i)*i}var o=e.requestRouter.endpointFor("assets",s);Cr(e,o,n)}else{var a=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Cr(e,a,n)}},N.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Cr(e,r,n)};var Ru="$people_distinct_id",as="$device_id",Yn="__alias",Kn="__timers",ac="$autocapture_disabled_server_side",Qi="$heatmaps_enabled_server_side",cc="$exception_capture_enabled_server_side",eo="$error_tracking_suppression_rules",lc="$error_tracking_capture_extension_exceptions",uc="$web_vitals_enabled_server_side",Cu="$dead_clicks_enabled_server_side",dc="$product_tours_enabled_server_side",hc="$web_vitals_allowed_metrics",Nr="$session_recording_remote_config",cs="$sesid",Nu="$session_is_sampled",fn="$enabled_feature_flags",Xn="$early_access_features",to="$feature_flag_details",Qn="$stored_person_properties",jt="$stored_group_properties",no="$surveys",cr="$flag_call_reported",ro="$flag_call_reported_session_id",so="$feature_flag_errors",ls="$feature_flag_evaluated_at",Be="$user_state",io="$client_session_props",oo="$capture_rate_limit",ao="$initial_campaign_params",co="$initial_referrer_info",us="$initial_person_info",ds="$epp",Lu="__POSTHOG_TOOLBAR__",Lr="$posthog_cookieless",Dg=[Ru,Yn,"__cmpns",Kn,"$session_recording_enabled_server_side",Qi,cs,fn,eo,Be,Xn,to,jt,Qn,no,cr,ro,so,ls,io,oo,ao,co,ds,us],Xo="PostHog loadExternalDependency extension not found.",ct="on_reject",Ve="always",nn="anonymous",rn="identified",lo="identified_only",hs="visibilitychange",ps="beforeunload",un="$pageview",di="$pageleave",hi="$identify",pc="$groupidentify";function Mr(e,t){Z(e)&&e.forEach(t)}function Y(e,t){if(!j(e))if(Z(e))e.forEach(t);else if(rg(e))e.forEach(((r,s)=>t(r,s)));else for(var n in e)du.call(e,n)&&t(e[n],n)}var se=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var s of n)for(var i in s)s[i]!==void 0&&(e[i]=s[i]);return e};function Yr(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var fc=function(e){try{return e()}catch{return}},Fg=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(s){x.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),x.critical(s)}}},Qo=function(e){var t={};return Y(e,(function(n,r){(oe(n)&&n.length>0||Ye(n))&&(t[r]=n)})),t},jg=["herokuapp.com","vercel.app","netlify.app"];function Ug(e){var t=e?.hostname;if(!oe(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of jg)if(n===r)return!1;return!0}function ie(e,t,n,r){var{capture:s=!1,passive:i=!0}=r??{};e?.addEventListener(t,n,{capture:s,passive:i})}function Mu(e){return e.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ye(e)&&isFinite(e)&&Math.floor(e)===e});class fs{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,s){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||0>t||0>n||0>r||0>s||t>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/Math.pow(2,8),i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=s>>>24,i[13]=s>>>16,i[14]=s>>>8,i[15]=s,new fs(i)}toString(){for(var t="",n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new fs(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;16>n;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Zg{constructor(){this.I=0,this.S=0,this.k=new qg}generate(){var t=this.generateOrAbort();if(R(t)){this.I=0;var n=this.generateOrAbort();if(R(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.I)this.I=t,this.A();else{if(this.I>=t+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return fs.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var gc,zu=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};m&&!R(m.crypto)&&crypto.getRandomValues&&(zu=e=>crypto.getRandomValues(e));class qg{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(zu(this.T),this.N=0),this.T[this.N++]}}var Tt=()=>Bg().toString(),Bg=()=>(gc||(gc=new Zg)).generate(),Fn="",Hg=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,nt={Ut:()=>!!P,Yt(e){x.error("cookieStore error: "+e)},Gt(e){if(P){try{for(var t=e+"=",n=P.cookie.split(";").filter((i=>i.length)),r=0;n.length>r;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}},Wt(e){var t;try{t=JSON.parse(nt.Gt(e))||{}}catch{}return t},Xt(e,t,n,r,s){if(P)try{var i="",o="",a=(function(u,d){if(d){var h=(function(g,f){if(f===void 0&&(f=P),Fn)return Fn;if(!f||["localhost","127.0.0.1"].includes(g))return"";for(var v=g.split("."),E=Math.min(v.length,8),I="dmn_chk_"+Tt();!Fn&&E--;){var S=v.slice(E).join("."),w=I+"=1;domain=."+S+";path=/";f.cookie=w+";max-age=3",f.cookie.includes(I)&&(f.cookie=w+";max-age=0",Fn=S)}return Fn})(u);if(!h){var p=(g=>{var f=g.match(Hg);return f?f[0]:""})(u);p!==h&&x.info("Warning: cookie subdomain discovery mismatch",p,h),h=p}return h?"; domain=."+h:""}return""})(P.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+864e5*n),i="; expires="+c.toUTCString()}s&&(o="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&x.warn("cookieStore warning: large cookie, len="+l.length),P.cookie=l,l}catch{return}},Jt(e,t){if(P!=null&&P.cookie)try{nt.Xt(e,"",-1,t)}catch{return}}},pi=null,ee={Ut(){if(!pt(pi))return pi;var e=!0;if(R(m))e=!1;else try{var t="__mplssupport__";ee.Xt(t,"xyz"),ee.Gt(t)!=='"xyz"'&&(e=!1),ee.Jt(t)}catch{e=!1}return e||x.error("localStorage unsupported; falling back to cookie store"),pi=e,e},Yt(e){x.error("localStorage error: "+e)},Gt(e){try{return m?.localStorage.getItem(e)}catch(t){ee.Yt(t)}return null},Wt(e){try{return JSON.parse(ee.Gt(e))||{}}catch{}return null},Xt(e,t){try{m?.localStorage.setItem(e,JSON.stringify(t))}catch(n){ee.Yt(n)}},Jt(e){try{m?.localStorage.removeItem(e)}catch(t){ee.Yt(t)}}},Vg=[as,"distinct_id",cs,Nu,ds,us,Be],zr={},Gg={Ut:()=>!0,Yt(e){x.error("memoryStorage error: "+e)},Gt:e=>zr[e]||null,Wt:e=>zr[e]||null,Xt(e,t){zr[e]=t},Jt(e){delete zr[e]}},Mt=null,pe={Ut(){if(!pt(Mt))return Mt;if(Mt=!0,R(m))Mt=!1;else try{var e="__support__";pe.Xt(e,"xyz"),pe.Gt(e)!=='"xyz"'&&(Mt=!1),pe.Jt(e)}catch{Mt=!1}return Mt},Yt(e){x.error("sessionStorage error: ",e)},Gt(e){try{return m?.sessionStorage.getItem(e)}catch(t){pe.Yt(t)}return null},Wt(e){try{return JSON.parse(pe.Gt(e))||null}catch{}return null},Xt(e,t){try{m?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){pe.Yt(n)}},Jt(e){try{m?.sessionStorage.removeItem(e)}catch(t){pe.Yt(t)}}};class Wg{constructor(t){this._instance=t}get Rt(){return this._instance.config}get consent(){return this.Kt()?0:this.Qt}isOptedOut(){return this.Rt.cookieless_mode===Ve||this.consent===0||this.consent===-1&&(this.Rt.opt_out_capturing_by_default||this.Rt.cookieless_mode===ct)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}optInOut(t){this.ti.Xt(this.ei,t?1:0,this.Rt.cookie_expiration,this.Rt.cross_subdomain_cookie,this.Rt.secure_cookie)}reset(){this.ti.Jt(this.ei,this.Rt.cross_subdomain_cookie)}get ei(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get Qt(){var t=this.ti.Gt(this.ei);return ci(t)?1:F(og,t)?0:-1}get ti(){var t=this.Rt.opt_out_capturing_persistence_type,n=t==="localStorage"?ee:nt;if(!this.ii||this.ii!==n){this.ii=n;var r=t==="localStorage"?nt:ee;r.Gt(this.ei)&&(this.ii.Gt(this.ei)||this.optInOut(ci(r.Gt(this.ei))),r.Jt(this.ei,this.Rt.cross_subdomain_cookie))}return this.ii}Kt(){return!!this.Rt.respect_dnt&&[xe?.doNotTrack,xe?.msDoNotTrack,N.doNotTrack].some((t=>ci(t)))}}var Dr=X("[Dead Clicks]"),Jg=()=>!0,Yg=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(Cu)),r=e.instance.config.capture_dead_clicks;return rt(r)?r:!!ce(r)||n};class mc{get lazyLoadedDeadClicksAutocapture(){return this.ri}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[Cu]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ni((()=>{this.si()})):this.stop()}ni(t){var n,r;(n=N.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=N.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(s=>{s?Dr.error("failed to load script",s):t()}))}si(){var t;if(P){if(!this.ri&&(t=N.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=ce(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.ri=N.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.ri.start(P),Dr.info("starting...")}}else Dr.error("`document` not found. Cannot start.")}stop(){this.ri&&(this.ri.stop(),this.ri=void 0,Dr.info("stopping..."))}}var fi=X("[SegmentIntegration]"),Du="posthog-js";function Fu(e,t){var{organization:n,projectId:r,prefix:s,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return a=>{var c,l,u,d,h;if(i!=="*"&&!i.includes(a.level)||!e.__loaded)return a;a.tags||(a.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());a.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var g,f=((c=a.exception)==null?void 0:c.values)||[],v=f.map((I=>O({},I,{stacktrace:I.stacktrace?O({},I.stacktrace,{type:"raw",frames:(I.stacktrace.frames||[]).map((S=>O({},S,{platform:"web:javascript"})))}):void 0}))),E={$exception_message:((l=f[0])==null?void 0:l.value)||a.message,$exception_type:(u=f[0])==null?void 0:u.type,$exception_level:a.level,$exception_list:v,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((d=f[0])==null?void 0:d.value)||a.message,$sentry_exception_type:(h=f[0])==null?void 0:h.type,$sentry_tags:a.tags};return n&&r&&(E.$sentry_url=(s||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),o&&((g=e.exceptions)==null||g.sendExceptionEvent(E)),a}}class Kg{constructor(t,n,r,s,i,o){this.name=Du,this.setupOnce=function(a){a(Fu(t,{organization:n,projectId:r,prefix:s,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}}class _c{constructor(t){this.oi=(n,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength)&&(x.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:s}),this.ai=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.li()}li(){var t;this.ui=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.oi)}destroy(){var t;(t=this.ui)==null||t.call(this),this.ui=void 0}doPageView(t,n){var r,s=this.hi(t,n);return this.ai={pathname:(r=m?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var n;return this.hi(t,(n=this.ai)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.ai)==null?void 0:t.pageViewId}}hi(t,n){var r=this.ai;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:c,maxContentHeight:l,lastContentY:u,maxContentY:d}=i;if(!(R(o)||R(a)||R(c)||R(l)||R(u)||R(d))){o=Math.ceil(o),a=Math.ceil(a),c=Math.ceil(c),l=Math.ceil(l),u=Math.ceil(u),d=Math.ceil(d);var h=o>1?st(a/o,0,1,x):1,p=o>1?st(c/o,0,1,x):1,g=l>1?st(u/l,0,1,x):1,f=l>1?st(d/l,0,1,x):1;s=se(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),s}}var gs=e=>{var t=P?.createElement("a");return R(t)?null:(t.href=e,t)},ms=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var i=r[s].split("=");if(i[0]===t){n=i;break}}if(!Z(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{x.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},mr=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[1],i=(r[0]||"").split("?"),o=i[1],a=i[0],c=(o||"").split("&"),l=[],u=0;c.length>u;u++){var d=c[u].split("=");Z(d)&&(t.includes(d[0])?l.push(d[0]+"="+n):l.push(c[u]))}var h=a;return o!=null&&(h+="?"+l.join("&")),s!=null&&(h+="#"+s),h},_s=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Fr="https?://(.*)",Rn=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Xg=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Rn],_r="<masked>",Qg=["li_fat_id"];function ju(e,t,n){if(!P)return{};var r,s=t?[...Rn,...n||[]]:[],i=Uu(mr(P.URL,s,_r),e),o=(r={},Y(Qg,(function(a){var c=nt.Gt(a);r[a]=c||null})),r);return se(o,i)}function Uu(e,t){var n=Xg.concat(t||[]),r={};return Y(n,(function(s){var i=ms(e,s);r[s]=i||null})),r}function Zu(e){var t=(function(i){return i?i.search(Fr+"google.([^/?]*)")===0?"google":i.search(Fr+"bing.com")===0?"bing":i.search(Fr+"yahoo.com")===0?"yahoo":i.search(Fr+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!pt(t)){r.$search_engine=t;var s=P?ms(P.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function vc(){return navigator.language||navigator.userLanguage}var vs="$direct";function qu(){return P?.referrer||vs}function Bu(e,t){var n=e?[...Rn,...t||[]]:[],r=he?.href.substring(0,1e3);return{r:qu().substring(0,1e3),u:r?mr(r,n,_r):void 0}}function Hu(e){var t,{r:n,u:r}=e,s={$referrer:n,$referring_domain:n==null?void 0:n==vs?vs:(t=gs(n))==null?void 0:t.host};if(r){s.$current_url=r;var i=gs(r);s.$host=i?.host,s.$pathname=i?.pathname;var o=Uu(r);se(s,o)}if(n){var a=Zu(n);se(s,a)}return s}function Vu(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function em(){try{return new Date().getTimezoneOffset()}catch{return}}var tm=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class gi{constructor(t,n){this.Rt=t,this.props={},this.ci=!1,this.di=(r=>{var s="";return r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+s+"_posthog"})(t),this.ti=this.vi(t),this.load(),t.debug&&x.info("Persistence loaded",t.persistence,O({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.fi}vi(t){tm.indexOf(t.persistence.toLowerCase())===-1&&(x.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(s){s===void 0&&(s=[]);var i=[...Vg,...s];return O({},ee,{Wt(o){try{var a={};try{a=nt.Wt(o)||{}}catch{}var c=se(a,JSON.parse(ee.Gt(o)||"{}"));return ee.Xt(o,c),c}catch{}return null},Xt(o,a,c,l,u,d){try{ee.Xt(o,a,void 0,void 0,d);var h={};i.forEach((p=>{a[p]&&(h[p]=a[p])})),Object.keys(h).length&&nt.Xt(o,h,c,l,u,d)}catch(p){ee.Yt(p)}},Jt(o,a){try{m?.localStorage.removeItem(o),nt.Jt(o,a)}catch(c){ee.Yt(c)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&ee.Ut()?ee:r==="localstorage+cookie"&&n.Ut()?n:r==="sessionstorage"&&pe.Ut()?pe:r==="memory"?Gg:r==="cookie"?nt:n.Ut()?n:nt}pi(t){var n=t??this.Rt.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[ls];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return Y(this.props,((n,r)=>{if(r===fn&&ce(n)){if(!this.pi())for(var s=Object.keys(n),i=0;s.length>i;i++)t["$feature/"+s[i]]=n[s[i]]}else Dg.indexOf(r)===-1&&(t[r]=n)})),t}load(){if(!this.fi){var t=this.ti.Wt(this.di);t&&(this.props=se({},t))}}save(){this.fi||this.ti.Xt(this.di,this.props,this.gi,this.mi,this.yi,this.Rt.debug)}remove(){this.ti.Jt(this.di,!1),this.ti.Jt(this.di,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(ce(t)){R(n)&&(n="None"),this.gi=R(r)?this.bi:r;var s=!1;if(Y(t,((i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=i,s=!0)})),s)return this.save(),!0}return!1}register(t,n){if(ce(t)){this.gi=R(n)?this.bi:n;var r=!1;if(Y(t,((s,i)=>{t.hasOwnProperty(i)&&this.props[i]!==s&&(this.props[i]=s,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.ci){var t=ju(this.Rt.custom_campaign_params,this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties);pn(Qo(t))||this.register(t),this.ci=!0}}update_search_keyword(){var t;this.register((t=P?.referrer)?Zu(t):{})}update_referrer_info(){var t;this.register_once({$referrer:qu(),$referring_domain:P!=null&&P.referrer&&((t=gs(P.referrer))==null?void 0:t.host)||vs},void 0)}set_initial_person_info(){this.props[ao]||this.props[co]||this.register_once({[us]:Bu(this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Y([co,ao],(o=>{var a=this.props[o];a&&Y(a,(function(c,l){t["$initial_"+Wi(l)]=c}))}));var n,r,s=this.props[us];if(s){var i=(n=Hu(s),r={},Y(n,(function(o,a){r["$initial_"+Wi(a)]=o})),r);se(t,i)}return t}safe_merge(t){return Y(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.bi=this.gi=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((o,a)=>{if(o.length!==a.length)return!1;var c=[...o].sort(),l=[...a].sort();return c.every(((u,d)=>u===l[d]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var s=this.vi(t),i=this.props;this.clear(),this.ti=s,this.props=i,this.save()}}set_disabled(t){this.fi=t,this.fi?this.remove():this.save()}set_cross_subdomain(t){t!==this.mi&&(this.mi=t,this.remove(),this.save())}set_secure(t){t!==this.yi&&(this.yi=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Kn]||{};r[t]=n,this.props[Kn]=r,this.save()}remove_event_timer(t){var n=(this.props[Kn]||{})[t];return R(n)||(delete this.props[Kn][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var jn={Activation:"events",Cancellation:"cancelEvents"},mi={Popover:"popover",API:"api",Widget:"widget"},er={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},_i={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},uo={Popover:"popover",Inline:"inline"},nm={SHOWN:"product tour shown"},yc={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},bc=X("[RateLimiter]");class rm{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((s=>{bc.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void bc.warn('could not rate limit - continuing. Error: "'+s?.message+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,s;t===void 0&&(t=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:o}=this,a=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(oo))!==null&&n!==void 0?n:{tokens:i,last:a};c.tokens+=(a-c.last)/1e3*o,c.last=a,c.tokens>i&&(c.tokens=i);var l=1>c.tokens;return l||t||(c.tokens=Math.max(0,c.tokens-1)),!l||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,(s=this.instance.persistence)==null||s.set_property(oo,c),{isRateLimited:l,remainingTokens:c.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Un=X("[RemoteConfig]");class Gu{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=N._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}wi(t){var n,r;(n=N.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=N.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Ii(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){t(n.json)}})}load(){try{if(this.remoteConfig)return Un.info("Using preloaded remote config",this.remoteConfig),this.Ci(this.remoteConfig),void this.Si();if(this._instance.ki())return void Un.warn("Remote config is disabled. Falling back to local config.");this.wi((t=>{if(!t)return Un.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ii((n=>{this.Ci(n),this.Si()}));this.Ci(t),this.Si()}))}catch(t){Un.error("Error loading remote config",t)}}stop(){this.xi&&(clearInterval(this.xi),this.xi=void 0)}refresh(){this._instance.ki()||P?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}Si(){var t;if(!this.xi){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.xi=setInterval((()=>{this.refresh()}),n))}}Ci(t){var n;t||Un.error("Failed to fetch remote config from PostHog."),this._instance.Ci(t??{}),t?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var et={GZipJS:"gzip-js",Base64:"base64"},ze=Uint8Array,ke=Uint16Array,Cn=Uint32Array,ea=new ze([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]),ta=new ze([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]),wc=new ze([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Wu=function(e,t){for(var n=new ke(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var s=new Cn(n[30]);for(r=1;30>r;++r)for(var i=n[r];n[r+1]>i;++i)s[i]=i-n[r]<<5|r;return[n,s]},Ju=Wu(ea,2),ho=Ju[1];Ju[0][28]=258,ho[258]=28;for(var Sc=Wu(ta,0)[1],Yu=new ke(32768),K=0;32768>K;++K){var sn=(43690&K)>>>1|(21845&K)<<1;Yu[K]=((65280&(sn=(61680&(sn=(52428&sn)>>>2|(13107&sn)<<2))>>>4|(3855&sn)<<4))>>>8|(255&sn)<<8)>>>1}var lr=function(e,t,n){for(var r=e.length,s=0,i=new ke(t);r>s;++s)++i[e[s]-1];var o,a=new ke(t);for(s=0;t>s;++s)a[s]=a[s-1]+i[s-1]<<1;for(o=new ke(r),s=0;r>s;++s)o[s]=Yu[a[e[s]-1]++]>>>15-e[s];return o},Kt=new ze(288);for(K=0;144>K;++K)Kt[K]=8;for(K=144;256>K;++K)Kt[K]=9;for(K=256;280>K;++K)Kt[K]=7;for(K=280;288>K;++K)Kt[K]=8;var ys=new ze(32);for(K=0;32>K;++K)ys[K]=5;var sm=lr(Kt,9),im=lr(ys,5),Ku=function(e){return(e/8>>0)+(7&e&&1)},Xu=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof ke?ke:e instanceof Cn?Cn:ze)(n-t);return r.set(e.subarray(t,n)),r},at=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Zn=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},vi=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var s=n.length,i=n.slice();if(!s)return[new ze(0),0];if(s==1){var o=new ze(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(y,$){return y.f-$.f})),n.push({s:-1,f:25001});var a=n[0],c=n[1],l=0,u=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=s-1;)a=n[n[d].f>n[l].f?l++:d++],c=n[l!=u&&n[d].f>n[l].f?l++:d++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};var h=i[0].s;for(r=1;s>r;++r)i[r].s>h&&(h=i[r].s);var p=new ke(h+1),g=po(n[u-1],p,0);if(g>t){r=0;var f=0,v=g-t,E=1<<v;for(i.sort((function(y,$){return p[$.s]-p[y.s]||y.f-$.f}));s>r;++r){var I=i[r].s;if(t>=p[I])break;f+=E-(1<<g-p[I]),p[I]=t}for(f>>>=v;f>0;){var S=i[r].s;t>p[S]?f-=1<<t-p[S]++-1:++r}for(;r>=0&&f;--r){var w=i[r].s;p[w]==t&&(--p[w],++f)}g=t}return[new ze(p),g]},po=function(e,t,n){return e.s==-1?Math.max(po(e.l,t,n+1),po(e.r,t,n+1)):t[e.s]=n},Ec=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ke(++t),r=0,s=e[0],i=1,o=function(c){n[r++]=c},a=1;t>=a;++a)if(e[a]==s&&a!=t)++i;else{if(!s&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(s),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(s);i=1,s=e[a]}return[n.subarray(0,r),t]},qn=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},fo=function(e,t,n){var r=n.length,s=Ku(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 i=0;r>i;++i)e[s+i+4]=n[i];return 8*(s+4+r)},kc=function(e,t,n,r,s,i,o,a,c,l,u){at(t,u++,n),++s[256];for(var d=vi(s,15),h=d[0],p=d[1],g=vi(i,15),f=g[0],v=g[1],E=Ec(h),I=E[0],S=E[1],w=Ec(f),y=w[0],$=w[1],k=new ke(19),b=0;I.length>b;++b)k[31&I[b]]++;for(b=0;y.length>b;++b)k[31&y[b]]++;for(var T=vi(k,7),L=T[0],M=T[1],D=19;D>4&&!L[wc[D-1]];--D);var q,B,ae,de,Se=l+5<<3,re=qn(s,Kt)+qn(i,ys)+o,_e=qn(s,h)+qn(i,f)+o+14+3*D+qn(k,L)+(2*k[16]+3*k[17]+7*k[18]);if(re>=Se&&_e>=Se)return fo(t,u,e.subarray(c,c+l));if(at(t,u,1+(re>_e)),u+=2,re>_e){q=lr(h,p),B=h,ae=lr(f,v),de=f;var Re=lr(L,M);for(at(t,u,S-257),at(t,u+5,$-1),at(t,u+10,D-4),u+=14,b=0;D>b;++b)at(t,u+3*b,L[wc[b]]);u+=3*D;for(var Ce=[I,y],ot=0;2>ot;++ot){var Ie=Ce[ot];for(b=0;Ie.length>b;++b)at(t,u,Re[je=31&Ie[b]]),u+=L[je],je>15&&(at(t,u,Ie[b]>>>5&127),u+=Ie[b]>>>12)}}else q=sm,B=Kt,ae=im,de=ys;for(b=0;a>b;++b)if(r[b]>255){var je;Zn(t,u,q[257+(je=r[b]>>>18&31)]),u+=B[je+257],je>7&&(at(t,u,r[b]>>>23&31),u+=ea[je]);var Ue=31&r[b];Zn(t,u,ae[Ue]),u+=de[Ue],Ue>3&&(Zn(t,u,r[b]>>>5&8191),u+=ta[Ue])}else Zn(t,u,q[r[b]]),u+=B[r[b]];return Zn(t,u,q[256]),u+B[256]},om=new Cn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),am=(function(){for(var e=new Cn(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),yi=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function cm(e,t){t===void 0&&(t={});var n=(function(){var d=4294967295;return{p(h){for(var p=d,g=0;h.length>g;++g)p=am[255&p^h[g]]^p>>>8;d=p},d(){return 4294967295^d}}})(),r=e.length;n.p(e);var s,i,o,a,c,l=(a=10+((s=t).filename&&s.filename.length+1||0),c=8,(function(d,h,p,g,f,v){var E=d.length,I=new ze(g+E+5*(1+Math.floor(E/7e3))+f),S=I.subarray(g,I.length-f),w=0;if(!h||8>E)for(var y=0;E>=y;y+=65535){var $=y+65535;E>$?w=fo(S,w,d.subarray(y,$)):(S[y]=!0,w=fo(S,w,d.subarray(y,E)))}else{for(var k=om[h-1],b=k>>>13,T=8191&k,L=(1<<p)-1,M=new ke(32768),D=new ke(L+1),q=Math.ceil(p/3),B=2*q,ae=function(ri){return(d[ri]^d[ri+1]<<q^d[ri+2]<<B)&L},de=new Cn(25e3),Se=new ke(288),re=new ke(32),_e=0,Re=0,Ce=(y=0,0),ot=0,Ie=0;E>y;++y){var je=ae(y),Ue=32767&y,en=D[je];if(M[Ue]=en,D[je]=Ue,y>=ot){var Or=E-y;if((_e>7e3||Ce>24576)&&Or>423){w=kc(d,S,0,de,Se,re,Re,Ce,Ie,y-Ie,w),Ce=_e=Re=0,Ie=y;for(var Ze=0;286>Ze;++Ze)Se[Ze]=0;for(Ze=0;30>Ze;++Ze)re[Ze]=0}var Lt=2,Ir=0,sp=T,gt=Ue-en&32767;if(Or>2&&je==ae(y-gt))for(var ip=Math.min(b,Or)-1,op=Math.min(32767,y),ap=Math.min(258,Or);op>=gt&&--sp&&Ue!=en;){if(d[y+Lt]==d[y+Lt-gt]){for(var mt=0;ap>mt&&d[y+mt]==d[y+mt-gt];++mt);if(mt>Lt){if(Lt=mt,Ir=gt,mt>ip)break;var cp=Math.min(gt,mt-2),Pa=0;for(Ze=0;cp>Ze;++Ze){var ni=y-gt+Ze+32768&32767,xa=ni-M[ni]+32768&32767;xa>Pa&&(Pa=xa,en=ni)}}}gt+=(Ue=en)-(en=M[Ue])+32768&32767}if(Ir){de[Ce++]=268435456|ho[Lt]<<18|Sc[Ir];var $a=31&ho[Lt],Ra=31&Sc[Ir];Re+=ea[$a]+ta[Ra],++Se[257+$a],++re[Ra],ot=y+Lt,++_e}else de[Ce++]=d[y],++Se[d[y]]}}w=kc(d,S,!0,de,Se,re,Re,Ce,Ie,y-Ie,w)}return Xu(I,0,g+Ku(w)+f)})(i=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+o.mem,a,c)),u=l.length;return(function(d,h){var p=h.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>h.level?4:h.level==9?2:0,d[9]=3,h.mtime!=0&&yi(d,4,Math.floor(new Date(h.mtime||Date.now())/1e3)),p){d[3]=8;for(var g=0;p.length>=g;++g)d[g+10]=p.charCodeAt(g)}})(l,t),yi(l,u-8,n.d()),yi(l,u-4,r),l}var lm=!!Gi||!!Vi,Qu="text/plain",Tc=!1,Us=function(e,t,n){var r;n===void 0&&(n=!0);var[s,i]=e.split("?"),o=O({},t),a=(r=i?.split("&").map((l=>{var u,[d,h]=l.split("="),p=n&&(u=o[d])!==null&&u!==void 0?u:h;return delete o[d],d+"="+p})))!==null&&r!==void 0?r:[],c=(function(l,u){var d,h;u===void 0&&(u="&");var p=[];return Y(l,(function(g,f){R(g)||R(f)||f==="undefined"||(d=encodeURIComponent((v=>v instanceof File)(g)?g.name:g.toString()),h=encodeURIComponent(f),p[p.length]=h+"="+d)})),p.join(u)})(o);return c&&a.push(c),s+"?"+a.join("&")},gn=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),bi=e=>{if(e.zt)return e.zt;var{data:t,compression:n}=e;if(t){if(n===et.GZipJS){var r=cm((function(a,c){var l=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var u=new ze(a.length+(a.length>>>1)),d=0,h=function(v){u[d++]=v},p=0;l>p;++p){if(d+5>u.length){var g=new ze(d+8+(l-p<<1));g.set(u),u=g}var f=a.charCodeAt(p);128>f?h(f):2048>f?(h(192|f>>>6),h(128|63&f)):f>55295&&57344>f?(h(240|(f=65536+(1047552&f)|1023&a.charCodeAt(++p))>>>18),h(128|f>>>12&63),h(128|f>>>6&63),h(128|63&f)):(h(224|f>>>12),h(128|f>>>6&63),h(128|63&f))}return Xu(u,0,d)})(gn(t)),{mtime:0});return{contentType:Qu,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===et.Base64){var s=(function(a){return a&&btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,((c,l)=>String.fromCharCode(parseInt(l,16)))))})(gn(t)),i=(a=>"data="+encodeURIComponent(typeof a=="string"?a:gn(a)))(s);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=gn(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},um=(function(){var e=He((function*(t){var n=gn(t.data),r=yield(function(i,o,a){return lu.apply(this,arguments)})(n,we.DEBUG,{rethrow:!0});if(!r)return t;var s=yield r.arrayBuffer();return O({},t,{zt:{contentType:Qu,body:s,estimatedSize:s.byteLength}})}));return function(t){return e.apply(this,arguments)}})(),Oc=(e,t)=>Us(e,{_:new Date().getTime().toString(),ver:we.JS_SDK_VERSION,compression:t}),Kr=[];Vi&&Kr.push({transport:"fetch",method(e){var t,n,{contentType:r,body:s,estimatedSize:i}=(t=bi(e))!==null&&t!==void 0?t:{},o=new Headers;Y(e.headers,(function(u,d){o.append(d,u)})),r&&o.append("Content-Type",r);var a=e.url,c=null;if(Xa){var l=new Xa;c={signal:l.signal,timeout:setTimeout((()=>l.abort()),e.timeout)}}Vi(a,O({method:e?.method||"GET",headers:o,keepalive:e.method==="POST"&&52428.8>(i||0),body:s,signal:(n=c)==null?void 0:n.signal},e.fetchOptions)).then((u=>u.text().then((d=>{var h={statusCode:u.status,text:d};if(u.status===200)try{h.json=JSON.parse(d)}catch(p){x.error(p)}e.callback==null||e.callback(h)})))).catch((u=>{x.error(u),e.callback==null||e.callback({statusCode:0,error:u})})).finally((()=>c?clearTimeout(c.timeout):null))}}),Gi&&Kr.push({transport:"XHR",method(e){var t,n=new Gi;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=(t=bi(e))!==null&&t!==void 0?t:{};Y(e.headers,(function(i,o){n.setRequestHeader(o,i)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var i={statusCode:n.status,text:n.responseText};if(n.status===200)try{i.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(i)}},n.send(s)}}),xe!=null&&xe.sendBeacon&&Kr.push({transport:"sendBeacon",method(e){var t=Us(e.url,{beacon:"1"});try{var n,{contentType:r,body:s}=(n=bi(e))!==null&&n!==void 0?n:{};if(!s)return;var i=s instanceof Blob?s:new Blob([s],{type:r});xe.sendBeacon(t,i)}catch{}}});var go=3e3;class dm{constructor(t,n){this.Ti=!0,this.Ai=[],this.Ei=st(n?.flush_interval_ms||go,250,5e3,x.createLogger("flush interval"),go),this.Ri=t}enqueue(t){this.Ai.push(t),this.Ni||this.Mi()}unload(){this.Fi();var t=this.Ai.length>0?this.Oi():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Ri(O({},r,{transport:"sendBeacon"}))}))}enable(){this.Ti=!1,this.Mi()}Mi(){var t=this;this.Ti||(this.Ni=setTimeout((()=>{if(this.Fi(),this.Ai.length>0){var n=this.Oi(),r=function(){var i=n[s],o=new Date().getTime();i.data&&Z(i.data)&&Y(i.data,(a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp})),t.Ri(i)};for(var s in n)r()}}),this.Ei))}Fi(){clearTimeout(this.Ni),this.Ni=void 0}Oi(){var t={};return Y(this.Ai,(n=>{var r,s=n,i=(s?s.batchKey:null)||s.url;R(t[i])&&(t[i]=O({},s,{data:[]})),(r=t[i].data)==null||r.push(s.data)})),this.Ai=[],t}}var hm=["retriesPerformedSoFar"];class pm{constructor(t){this.Pi=!1,this.Li=3e3,this.Ai=[],this._instance=t,this.Ai=[],this.Di=!0,!R(m)&&"onLine"in m.navigator&&(this.Di=m.navigator.onLine,this.Bi=()=>{this.Di=!0,this.ji()},this.qi=()=>{this.Di=!1},ie(m,"online",this.Bi),ie(m,"offline",this.qi))}get length(){return this.Ai.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=cu(t,hm);ln(n)&&(r.url=Us(r.url,{retry_count:n})),this._instance._send_request(O({},r,{callback:s=>{s.statusCode===200||s.statusCode>=400&&500>s.statusCode||(n??0)>=10?r.callback==null||r.callback(s):this.Zi(O({retriesPerformedSoFar:n},r))}}))}Zi(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(o){var a=3e3*Math.pow(2,o),c=a/2,l=Math.min(18e5,a),u=Math.random()-.5;return Math.ceil(l+u*(l-c))})(n),s=Date.now()+r;this.Ai.push({retryAt:s,requestOptions:t});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),x.warn(i),this.Pi||(this.Pi=!0,this.$i())}$i(){if(this.Vi&&clearTimeout(this.Vi),this.Ai.length===0)return this.Pi=!1,void(this.Vi=void 0);this.Vi=setTimeout((()=>{this.Di&&this.Ai.length>0&&this.ji(),this.$i()}),this.Li)}ji(){var t=Date.now(),n=[],r=this.Ai.filter((i=>t>i.retryAt||(n.push(i),!1)));if(this.Ai=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:t}of(this.Vi&&(clearTimeout(this.Vi),this.Vi=void 0),this.Pi=!1,R(m)||(this.Bi&&(m.removeEventListener("online",this.Bi),this.Bi=void 0),this.qi&&(m.removeEventListener("offline",this.qi),this.qi=void 0)),this.Ai))try{this._instance._send_request(O({},t,{transport:"sendBeacon"}))}catch(n){x.error(n)}this.Ai=[]}}class fm{constructor(t){this.Hi=()=>{var n,r,s,i;this.zi||(this.zi={});var o=this.scrollElement(),a=this.scrollY(),c=o?Math.max(0,o.scrollHeight-o.clientHeight):0,l=a+(o?.clientHeight||0),u=o?.scrollHeight||0;this.zi.lastScrollY=Math.ceil(a),this.zi.maxScrollY=Math.max(a,(n=this.zi.maxScrollY)!==null&&n!==void 0?n:0),this.zi.maxScrollHeight=Math.max(c,(r=this.zi.maxScrollHeight)!==null&&r!==void 0?r:0),this.zi.lastContentY=l,this.zi.maxContentY=Math.max(l,(s=this.zi.maxContentY)!==null&&s!==void 0?s:0),this.zi.maxContentHeight=Math.max(u,(i=this.zi.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=t}get Ui(){return this._instance.config.scroll_root_selector}getContext(){return this.zi}resetContext(){var t=this.zi;return setTimeout(this.Hi,0),t}startMeasuringScrollPosition(){ie(m,"scroll",this.Hi,{capture:!0}),ie(m,"scrollend",this.Hi,{capture:!0}),ie(m,"resize",this.Hi)}scrollElement(){if(!this.Ui)return m?.document.documentElement;var t=Z(this.Ui)?this.Ui:[this.Ui];for(var n of t){var r=m?.document.querySelector(n);if(r)return r}}scrollY(){if(this.Ui){var t=this.scrollElement();return t&&t.scrollTop||0}return m&&(m.scrollY||m.pageYOffset||m.document.documentElement.scrollTop)||0}scrollX(){if(this.Ui){var t=this.scrollElement();return t&&t.scrollLeft||0}return m&&(m.scrollX||m.pageXOffset||m.document.documentElement.scrollLeft)||0}}var gm=e=>Bu(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties);class Ic{constructor(t,n,r,s){this.Yi=i=>{var o=this.Gi();if(!o||o.sessionId!==i){var a={sessionId:i,props:this.Wi(this._instance)};this.Xi.register({[io]:a})}},this._instance=t,this.Ji=n,this.Xi=r,this.Wi=s||gm,this.Ji.onSessionId(this.Yi)}Gi(){return this.Xi.props[io]}getSetOnceProps(){var t,n=(t=this.Gi())==null?void 0:t.props;return n?"r"in n?Hu(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Y(Qo(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+Wi(r)]=n})),t}}class na{constructor(){this.Ki={}}on(t,n){return this.Ki[t]||(this.Ki[t]=[]),this.Ki[t].push(n),()=>{this.Ki[t]=this.Ki[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.Ki[t]||[])r(n);for(var s of this.Ki["*"]||[])s(t,n)}}var wi=X("[SessionId]");class Ac{on(t,n){return this.Qi.on(t,n)}constructor(t,n,r){var s;if(this.tr=[],this.er=void 0,this.Qi=new na,this.ir=(l,u)=>!(!ln(l)||!ln(u))&&Math.abs(l-u)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Ve)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rt=t.config,this.Xi=t.persistence,this.rr=void 0,this.nr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.sr=n||Tt,this.ar=r||Tt;var i=this.Rt.persistence_name||this.Rt.token;if(this._sessionTimeoutMs=1e3*st(this.Rt.session_idle_timeout_seconds||1800,60,36e3,wi.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+i+"_window_id",this.hr="ph_"+i+"_primary_window_exists",this.cr()){var o=pe.Wt(this.ur),a=pe.Wt(this.hr);o&&!a?this.rr=o:pe.Jt(this.ur),pe.Xt(this.hr,!0)}if((s=this.Rt.bootstrap)!=null&&s.sessionID)try{var c=(l=>{var u=this.Rt.bootstrap.sessionID.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})();this.dr(this.Rt.bootstrap.sessionID,new Date().getTime(),c)}catch(l){wi.error("Invalid sessionID in bootstrap",l)}this.vr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return R(this.tr)&&(this.tr=[]),this.tr.push(t),this.nr&&t(this.nr,this.rr),()=>{this.tr=this.tr.filter((n=>n!==t))}}cr(){return this.Rt.persistence!=="memory"&&!this.Xi.fi&&pe.Ut()}pr(t){t!==this.rr&&(this.rr=t,this.cr()&&pe.Xt(this.ur,t))}gr(){return this.rr?this.rr:this.cr()?pe.Wt(this.ur):null}dr(t,n,r){t===this.nr&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.nr=t,this.Xi.register({[cs]:[n,t,r]}))}mr(){var t=this.Xi.props[cs];return Z(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.dr(null,null,null)}destroy(){clearTimeout(this.yr),this.yr=void 0,this.er&&m&&(m.removeEventListener(ps,this.er,{capture:!1}),this.er=void 0),this.tr=[]}vr(){this.er=()=>{this.cr()&&pe.Jt(this.hr)},ie(m,ps,this.er,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.Rt.cookieless_mode===Ve)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[s,i,o]=this.mr(),a=this.gr(),c=ln(o)&&Math.abs(r-o)>864e5,l=!1,u=!i,d=!u&&!t&&this.ir(r,s);u||d||c?(i=this.sr(),a=this.ar(),wi.info("new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:c}}),o=r,l=!0):a||(a=this.ar(),l=!0);var h=ln(s)&&t&&!c?s:r,p=ln(o)?o:new Date().getTime();return this.pr(a),this.dr(i,h,p),t||this.lr(),l&&this.tr.forEach((g=>g(i,a,l?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:c}:void 0))),{sessionId:i,windowId:a,sessionStartTimestamp:p,changeReason:l?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:s}}lr(){clearTimeout(this.yr),this.yr=setTimeout((()=>{var[t]=this.mr();if(this.ir(new Date().getTime(),t)){var n=this.nr;this.resetSessionId(),this.Qi.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var ed=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&tc(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((s=>tc(s?.brand,t))))return!0}catch{}return!!e.webdriver},bs=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function Pc(e,t,n){return gn({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var td={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>bs(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!bs(n,r))))),icontains:(e,t)=>t.map(jr).some((n=>e.map(jr).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(jr).every((n=>e.map(jr).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((s=>r>parseFloat(s)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((s=>r<parseFloat(s)))}))},jr=e=>e.toLowerCase();function nd(e,t){return!e||Object.entries(e).every((n=>{var[r,s]=n,i=t?.[r];if(R(i)||pt(i))return!1;var o=[String(i)],a=td[s.operator];return!!a&&a(s.values,o)}))}var mo="custom",xc="i.posthog.com";class mm{constructor(t){this.br={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+xc,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.br[this.apiHost]||(this.br[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":mo),this.br[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===mo)return this.apiHost+n;var r=xc+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var G=X("[Surveys]"),_o="seenSurvey_",_m=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},$c=e=>((t,n)=>{var r=""+_o+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+_o+n.id+"_"+n.current_iteration),r})(0,e),vm=[mi.Popover,mi.Widget,mi.API],ym={ignoreConditions:!1,ignoreDelay:!1,displayType:uo.Popover},bm=X("[PostHog ExternalIntegrations]"),wm={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Sm{constructor(t){this._instance=t}ni(t,n){var r;(r=N.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(s=>{if(s)return bm.error("failed to load script",s);n()}))}startIfEnabledOrStop(){var t=this,n=function(o){var a,c,l;!s||(a=N.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||t.ni(wm[o],(()=>{var u;(u=N.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.start(t._instance)})),!s&&(c=N.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[o]&&((l=N.__PosthogExtensions__)==null||(l=l.integrations)==null||(l=l[o])==null||l.stop())};for(var[r,s]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(r)}}}var on,ur={},Si=0,vo=()=>{},Rc='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Bn="Surveys module not available",Cc="sanitize_properties is deprecated. Use before_send instead",rd="Invalid value for property_denylist config: ",Em=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,dn="posthog",sd=!lm&&Ee?.indexOf("MSIE")===-1&&Ee?.indexOf("Mozilla")===-1,Nc=e=>{var t;return O({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ug(P?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:vo,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:he&&oe(he?.search)&&he.search.indexOf("__posthog_debug=true")!==-1||!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_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(m==null||(t=m.location)==null?void 0:t.protocol)==="https:",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,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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){x.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:lo,before_send:void 0,request_queue_config:{flush_interval_ms:go},error_tracking:{},_onCapture:vo,__preview_eager_load_replay:!1},(n=>({rageclick:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},km=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],Lc=e=>{var t={};for(var[n,r]of km)R(e[n])||(t[r]=e[n]);var s=se({},t,e);return Z(e.property_blacklist)&&(R(e.property_denylist)?s.property_denylist=e.property_blacklist:Z(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:x.error(rd+e.property_denylist)),s};class Tm{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(t){x.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Me{_r(t,n){if(t){var r=this.Ir.indexOf(t);r!==-1&&this.Ir.splice(r,1)}return this.Ir.push(n),n.initialize==null||n.initialize(),n}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new Tm,this.Cr=!1,this.version=we.LIB_VERSION,this.Sr=new na,this.Ir=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Nc(),this.SentryIntegration=Kg,this.sentryIntegration=r=>(function(s,i){var o=Fu(s,i);return{name:Du,processEvent:a=>o(a)}})(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.kr=!1,this.Tr=null,this.Ar=null,this.Er=null,this.scrollManager=new fm(this),this.pageViewManager=new _c(this),this.rateLimiter=new rm(this),this.requestRouter=new mm(this),this.consent=new Wg(this),this.externalIntegrations=new Sm(this);var n=(t=Me.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,s,i)=>{var o=oe(r)?{[r]:s}:r;this.setPersonProperties(o),i?.({})},set_once:(r,s,i)=>{var o=oe(r)?{[r]:s}:r;this.setPersonProperties(void 0,o),i?.({})}},this.on("eventCaptured",(r=>x.info('send "'+r?.event+'"',r)))}init(t,n,r){if(r&&r!==dn){var s,i=(s=ur[r])!==null&&s!==void 0?s:new Me;return i._init(t,n,r),ur[r]=i,ur[dn][r]=i,i}return this._init(t,n,r)}_init(t,n,r){var s,i,o,a;if(n===void 0&&(n={}),R(t)||Jr(t))return x.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={},n.debug=this.Rr(n.debug),this.Nr=n,this.Mr=[],n.person_profiles?this.Ar=n.person_profiles:n.process_person&&(this.Ar=n.process_person),this.set_config(se({},Nc(n.defaults),Lc(n),{name:r,token:t})),this.config.on_xhr_error&&x.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:et.GZipJS;var c=this.Fr();this.persistence=new gi(this.config,c),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new gi(O({},this.config,{persistence:"sessionStorage"}),c);var l=O({},this.persistence.props),u=O({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Or=new dm((w=>this.Pr(w)),this.config.request_queue_config),this.Lr=new pm(this),this.__request_queue=[];var d=this.config.cookieless_mode===Ve||this.config.cookieless_mode===ct&&this.consent.isExplicitlyOptedOut();d||(this.sessionManager=new Ac(this),this.sessionPropsManager=new Ic(this,this.sessionManager,this.persistence));var h=(s=N._POSTHOG_REMOTE_CONFIG)==null||(s=s[this.config.token])==null?void 0:s.config,p=h==null||(i=h.sdkVersion)==null?void 0:i.resolved;if(p&&(Em.test(p)?this._resolvedSdkVersion=p:x.warn("Ignoring invalid preloaded sdkVersion.resolved from remote config: "+p)),this.config.__preview_deferred_init_extensions?(x.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(d)}),0)):(x.info("Initializing extensions synchronously"),this.Dr(d)),we.DEBUG=we.DEBUG||this.config.debug,we.DEBUG&&x.info("Starting in debug mode",{this:this,config:n,thisC:O({},this.config),p:l,s:u}),!this.config.identity_distinct_id||(o=n.bootstrap)!=null&&o.distinctID||(n.bootstrap=O({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((a=n.bootstrap)==null?void 0:a.distinctID)!==void 0){var g=n.bootstrap.distinctID,f=this.get_distinct_id(),v=this.persistence.get_property(Be);if(n.bootstrap.isIdentifiedID&&f!=null&&f!==g&&v===nn)this.identify(g);else if(n.bootstrap.isIdentifiedID&&f!=null&&f!==g&&v===rn)x.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var E=this.config.get_device_id(Tt()),I=n.bootstrap.isIdentifiedID?E:g;this.persistence.set_property(Be,n.bootstrap.isIdentifiedID?rn:nn),this.register({distinct_id:g,$device_id:I})}}if(d)this.register_once({distinct_id:Lr,$device_id:null},"");else if(!this.get_distinct_id()){var S=this.config.get_device_id(Tt());this.register_once({distinct_id:S,$device_id:S},""),this.persistence.set_property(Be,nn)}return ie(m,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?(function(w,y){var $=w.config.segment;if(!$)return y();(function(k,b){var T=k.config.segment;if(!T)return b();var L=D=>{var q=()=>D.anonymousId()||Tt();k.config.get_device_id=q,D.id()&&(k.register({distinct_id:D.id(),$device_id:q()}),k.persistence.set_property(Be,rn)),b()},M=T.user();"then"in M&&ut(M.then)?M.then(L):L(M)})(w,(()=>{$.register((k=>{Promise&&Promise.resolve||fi.warn("This browser does not have Promise support, and can not use the segment integration");var b=(T,L)=>{if(!L)return T;T.event.userId||T.event.anonymousId===k.get_distinct_id()||(fi.info("No userId set, resetting PostHog"),k.reset()),T.event.userId&&T.event.userId!==k.get_distinct_id()&&(fi.info("UserId set, identifying with PostHog"),k.identify(T.event.userId));var M=k.calculateEventProperties(L,T.event.properties);return T.event.properties=Object.assign({},M,T.event.properties),T};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:T=>b(T,T.event.event),page:T=>b(T,un),identify:T=>b(T,hi),screen:T=>b(T,"$screen")}})(w)).then((()=>{y()}))}))})(this,(()=>this.Br())):this.Br(),ut(this.config._onCapture)&&this.config._onCapture!==vo&&(x.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(w=>this.config._onCapture(w.event,w)))),this.config.ip&&x.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}Dr(t){var n,r,s,i,o,a,c,l=performance.now(),u=O({},Me.__defaultExtensionClasses,this.config.__extensionClasses),d=[];u.featureFlags&&this.Ir.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new u.featureFlags(this)),u.exceptions&&this.Ir.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new u.exceptions(this)),u.historyAutocapture&&this.Ir.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Ir.push(new u.tracingHeaders(this)),u.siteApps&&this.Ir.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.Ir.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||d.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.Ir.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Ir.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new u.surveys(this)),u.logs&&this.Ir.push(this.logs=(i=this.logs)!==null&&i!==void 0?i:new u.logs(this)),u.conversations&&this.Ir.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new u.conversations(this)),u.productTours&&this.Ir.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Ir.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Ir.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Ir.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Ir.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,Yg)),u.toolbar&&this.Ir.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new u.toolbar(this)),u.experiments&&this.Ir.push(this.experiments=(c=this.experiments)!==null&&c!==void 0?c:new u.experiments(this)),this.Ir.forEach((h=>{h.initialize&&d.push((()=>{h.initialize==null||h.initialize()}))})),d.push((()=>{if(this.jr){var h=this.jr;this.jr=void 0,this.Ci(h)}})),this.qr(d,l)}qr(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.qr(t,n)}),0);var r=t.shift();if(r)try{r()}catch(i){x.error("Error initializing extension:",i)}}var s=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:s}),this.config.__preview_deferred_init_extensions&&x.info("PostHog extensions initialized ("+s+"ms)")}Ci(t){var n;if(!P||!P.body)return x.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Ci(t)}),500);this.config.__preview_deferred_init_extensions&&(this.jr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=F(t.supportedCompression,et.GZipJS)?et.GZipJS:F(t.supportedCompression,et.Base64)?et.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ar?this.Ar:lo}),this.Ir.forEach((r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t)))}Br(){try{this.config.loaded(this)}catch(r){x.critical("`loaded` function failed",r)}if(this.Zr(),this.config.internal_or_test_user_hostname&&he!=null&&he.hostname){var t=he.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode===Ve)&&this.$r()}),1),this.Vr=new Gu(this),this.Vr.load()}Zr(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Or)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Mr(this.__request_queue,(t=>this.Pr(t))),this.__request_queue=[],this.Zr()}_handle_unload(){var t,n,r,s;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Hr()&&this.capture(di),(n=this.logs)==null||n.flushLogs("sendBeacon"),(r=this.Or)==null||r.unload(),(s=this.Lr)==null||s.unload()):this.Hr()&&this.capture(di,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(sd?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Us(t.url,{ip:this.config.ip?1:0}),t.headers=O({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,s,i,o=O({},n);o.timeout=o.timeout||6e4,o.url=Oc(o.url,o.compression);var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",c=Kr.filter((u=>!o.disableTransport||!u.transport||!o.disableTransport.includes(u.transport))),l=(s=(i=(function(u,d){for(var h=0;u.length>h;h++)if(u[h].transport===a)return u[h]})(c))==null?void 0:i.method)!==null&&s!==void 0?s:c[0].method;if(!l)throw new Error("No available transport method");a!=="sendBeacon"&&o.data&&o.compression===et.GZipJS&&eg&&!Tc?um(o).then((u=>{l(u)})).catch((u=>{if((d=>!(!d||typeof d!="object")&&("name"in d?String(d.name):"")==="NotReadableError")(u))return Tc=!0,void l(O({},o,{compression:void 0,url:Oc(n.url,void 0)}));l(o)})):l(o)})(O({},t,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,n),t.callback==null||t.callback(n)}}))))}Pr(t){this.Lr?this.Lr.retriableRequest(t):this._send_request(t)}_execute_array(t){Si++;try{var n,r=[],s=[],i=[];Mr(t,(a=>{a&&(Z(n=a[0])?i.push(a):ut(a)?a.call(this):Z(a)&&n==="alias"?r.push(a):Z(a)&&n.indexOf("capture")!==-1&&ut(this[n])?i.push(a):s.push(a))}));var o=function(a,c){Mr(a,(function(l){if(Z(l[0])){var u=c;Y(l,(function(d){u=u[d[0]].apply(u,d.slice(1))}))}else c[l[0]].apply(c,l.slice(1))}))};o(r,this),o(s,this),o(i,this)}finally{Si--}}push(t){if(Si>0&&Z(t)&&oe(t[0])){var n=Me.prototype[t[0]];ut(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var s,i,o,a,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Or){if(this.is_capturing())if(!R(t)&&oe(t)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(u==null||!u.isRateLimited){n!=null&&n.$current_url&&!oe(n?.$current_url)&&(x.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.zr||x.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),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 d=new Date,h=r?.timestamp||d,p=Tt(),g={uuid:p,event:t,properties:this.calculateEventProperties(t,n||{},h,p)};t===un&&this.config.__preview_capture_bot_pageviews&&l&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),u&&(g.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),r?.$set&&(g.$set=r?.$set);var f,v=this.Ur(r?.$set_once,t!==pc,t===hi);if(v&&(g.$set_once=v),r!=null&&r._noTruncate||(i=this.config.properties_string_max_length,o=g,a=k=>oe(k)?k.slice(0,i):k,c=new Set,g=(function k(b,T){return b!==Object(b)?a?a(b):b:c.has(b)?void 0:(c.add(b),Z(b)?(L=[],Mr(b,(M=>{L.push(k(M))}))):(L={},Y(b,((M,D)=>{c.has(M)||(L[D]=k(M))}))),L);var L})(o)),g.timestamp=h,R(r?.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),t===er.DISMISSED||t===er.SENT){var E=n?.[_i.SURVEY_ID],I=n?.[_i.SURVEY_ITERATION];f={id:E,current_iteration:I},localStorage.getItem($c(f))||localStorage.setItem($c(f),"true"),g.$set=O({},g.$set,{[_m({id:E,current_iteration:I},t===er.SENT?"responded":"dismissed")]:!0})}else t===er.SHOWN&&(g.$set=O({},g.$set,{[_i.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===nm.SHOWN){var S=n?.[yc.TOUR_TYPE];S&&(g.$set=O({},g.$set,{[yc.TOUR_LAST_SEEN_DATE+"/"+S]:new Date().toISOString()}))}var w=O({},g.properties.$set,g.$set);if(pn(w)||this.setPersonPropertiesForFlags(w),!j(this.config.before_send)){var y=this.Yr(g);if(!y)return;g=y}this.Sr.emit("eventCaptured",g);var $={method:"POST",url:(s=r?._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:g,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Pr($):this.Or.enqueue($),g}x.critical("This capture call is ignored due to client rate limiting.")}}else x.error("No event name provided to posthog.capture")}else x.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,s,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=i?void 0:this.persistence.remove_event_timer(t),a=O({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode==Ve||this.config.cookieless_mode==ct&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),t==="$snapshot"){var c=O({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=c.distinct_id,(!oe(a.distinct_id)&&!Ye(a.distinct_id)||Jr(a.distinct_id))&&x.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,u=(function(E,I){var S,w,y,$;if(!Ee)return{};var k,b,T,L,M,D,q,B,ae=E?[...Rn,...I||[]]:[],[de,Se]=(function(re){for(var _e=0;sc.length>_e;_e++){var[Re,Ce]=sc[_e],ot=Re.exec(re),Ie=ot&&(ut(Ce)?Ce(ot,re):Ce);if(Ie)return Ie}return["",""]})(Ee);return se(Qo({$os:de,$os_version:Se,$browser:Au(Ee,navigator.vendor),$device:ic(Ee),$device_type:(b=Ee,T={userAgentDataPlatform:(S=navigator)==null||(S=S.userAgentData)==null?void 0:S.platform,maxTouchPoints:(w=navigator)==null?void 0:w.maxTouchPoints,screenWidth:m==null||(y=m.screen)==null?void 0:y.width,screenHeight:m==null||($=m.screen)==null?void 0:$.height,devicePixelRatio:m?.devicePixelRatio},B=ic(b),B===fu||B===pu||B==="Kobo"||B==="Kindle Fire"||B===Iu?Pn:B===fr||B===En||B===gr||B===Yi?"Console":B===mu?"Wearable":B?$e:T?.userAgentDataPlatform==="Android"&&((L=T?.maxTouchPoints)!==null&&L!==void 0?L:0)>0?600>Math.min((M=T?.screenWidth)!==null&&M!==void 0?M:0,(D=T?.screenHeight)!==null&&D!==void 0?D:0)/((q=T?.devicePixelRatio)!==null&&q!==void 0?q:1)?$e:Pn:"Desktop"),$timezone:Vu(),$timezone_offset:em()}),{$current_url:mr(he?.href,ae,_r),$host:he?.host,$pathname:he?.pathname,$raw_user_agent:Ee.length>1e3?Ee.substring(0,997)+"...":Ee,$browser_version:mg(Ee,navigator.vendor),$browser_language:vc(),$browser_language_prefix:(k=vc(),typeof k=="string"?k.split("-")[0]:void 0),$screen_height:m?.screen.height,$screen_width:m?.screen.width,$viewport_height:m?.innerHeight,$viewport_width:m?.innerWidth,$lib:we.LIB_NAME,$lib_version:we.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:d,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime());a.$session_id=d,a.$window_id=h}this.sessionPropsManager&&se(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&se(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(p=this.Lr)==null?void 0:p.length}catch(E){a.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===mo&&(a.$lib_custom_api_host=this.config.api_host),l=t!==un||i?t!==di||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=se(a,l),t===un&&P&&(a.title=P.title),!R(o)){var g=r.getTime()-o;a.$duration=parseFloat((g/1e3).toFixed(3))}Ee&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=se({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Z(this.config.property_denylist)?Y(this.config.property_denylist,(function(E){delete a[E]})):x.error(rd+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var f=this.config.sanitize_properties;f&&(x.error(Cc),a=f(a,t));var v=this.Gr();return a.$process_person_profile=v,v&&!i&&this.Wr("_calculate_event_properties"),a}Ur(t,n,r){var s;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.Gr()||this.Cr&&!r)return t;var i=this.persistence.get_initial_props(),o=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),a=se({},i,o||{},t||{}),c=this.config.sanitize_properties;return c&&(x.error(Cc),a=c(a,"$set_once")),n&&(this.Cr=!0),pn(a)?void 0:a}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var s;(s=this.persistence)==null||s.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}Xr(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var s;(s=this.featureFlags)==null||s.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var s;return n===void 0&&(n=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Sr.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Bn}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:Bn})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:Bn})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=ym),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:Bn}}canRenderSurveyAsync(t,n){var r,s;return n===void 0&&(n=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Bn})}Jr(t){return!t||Jr(t)?(x.critical("Unique user id has not been set in posthog.identify"),!1):t===Lr?(x.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(x.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return x.uninitializedWarning("posthog.identify");if(Ye(t)&&(t=t.toString(),x.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Jr(t)&&this.Wr("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:t}),this.get_property(as)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),t!==s&&t!==this.get_property(Yn)&&(this.unregister(Yn),this.register({distinct_id:t}));var i,o=(this.persistence.get_property(Be)||nn)===nn;t!==s&&o?(this.persistence.set_property(Be,rn),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(hi,{distinct_id:t,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Er=Pc(t,n,r),(i=this.featureFlags)==null||i.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),t!==s&&(this.reloadFeatureFlags(),this.unregister(cr))}}setPersonProperties(t,n){if((t||n)&&this.Wr("posthog.setPersonProperties")){var r=Pc(this.get_distinct_id(),t,n);this.Er!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Er=r):x.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var s=this.getGroups(),i=s[t]!==n;if(i&&this.resetGroupPropertiesForFlags(t),this.register({$groups:O({},s,{[t]:n})}),i||r){var o={$group_type:t,$group_key:n};r&&(o.$group_set=r),this.capture(pc,o)}r&&this.setGroupPropertiesForFlags({[t]:r}),i&&!r&&this.reloadFeatureFlags()}else x.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.Wr("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,s,i,o,a,c,l;if(x.info("reset"),!this.__loaded)return x.uninitializedWarning("posthog.reset");var u=this.get_property(as);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(s=this.surveys)==null||s.reset(),(i=this.Vr)==null||i.stop(),(o=this.featureFlags)==null||o.reset(),(a=this.conversations)==null||a.reset(),(c=this.persistence)==null||c.set_property(Be,nn),(l=this.sessionManager)==null||l.resetSessionId(),this.Er=null,this.config.cookieless_mode===Ve)this.register_once({distinct_id:Lr,$device_id:null},"");else{var d=this.config.get_device_id(Tt());this.register_once({distinct_id:d,$device_id:t?d:u},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,n){var r;this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)==null||r.Kr()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.Qr()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var i,o=(i=t.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return s}alias(t,n){return t===this.get_property(Ru)?(x.critical("Attempting to create alias for existing People user - aborting."),-2):this.Wr("posthog.alias")?(R(n)&&(n=this.get_distinct_id()),t!==n?(this.Xr(Yn,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(x.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=O({},this.config);if(ce(t)){var r,s,i,o,a,c,l,u,d;se(this.config,Lc(t));var h=this.Fr();(r=this.persistence)==null||r.update_config(this.config,n,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new gi(O({},this.config,{persistence:"sessionStorage"}),h);var p=this.Rr(this.config.debug);rt(p)&&(this.config.debug=p),rt(this.config.debug)&&(this.config.debug?(we.DEBUG=!0,ee.Ut()&&ee.Xt("ph_debug",!0),x.info("set_config",{config:t,oldConfig:n,newConfig:O({},this.config)})):(we.DEBUG=!1,ee.Ut()&&ee.Jt("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(l=this.deadClicksAutocapture)==null||l.startIfEnabledOrStop(),(u=this.surveys)==null||u.loadIfEnabled(),this.tn(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){we.LIB_NAME=t,we.LIB_VERSION=n}startSessionRecording(t){var n,r,s,i,o,a=t===!0,c={sampling:a||!(t==null||!t.sampling),linked_flag:a||!(t==null||!t.linked_flag),url_trigger:a||!(t==null||!t.url_trigger),event_trigger:a||!(t==null||!t.event_trigger)};Object.values(c).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),c.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),c.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),c.url_trigger&&((i=this.sessionRecording)==null||i.overrideTrigger("url")),c.event_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(O({},s,n))}}captureLog(t){var n;(n=this.logs)==null||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)==null?void 0:n.logger)!==null&&t!==void 0?t:Me.en}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:dn;return n!==dn&&(n=dn+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(Be))===rn||((n=this.sessionPersistence)==null?void 0:n.get_property(Be))===rn}Gr(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===lo&&!this._isIdentified()&&pn(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Yn])&&((n=this.persistence)==null||(n=n.props)==null||!n[ds]))}Hr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Wr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Wr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Wr(t){return this.config.person_profiles==="never"?(x.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Xr(ds,!0),!0)}Fr(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ct)}tn(){var t,n,r,s,i=this.Fr();return((t=this.persistence)==null?void 0:t.fi)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.fi)!==i&&((s=this.sessionPersistence)==null||s.set_disabled(i)),i}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==Ve){if(this.config.cookieless_mode===ct&&this.consent.isExplicitlyOptedOut()){var r,s,i,o,a;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=new Ac(this),this.pageViewManager=new _c(this),this.persistence&&(this.sessionPropsManager=new Ic(this,this.sessionManager,this.persistence));var c=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(a=Me.__defaultExtensionClasses)==null?void 0:a.sessionRecording;c&&(this.sessionRecording=this._r(this.sessionRecording,new c(this)))}var l,u;this.consent.optInOut(!0),this.tn(),this.Zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==ct&&((l=this.surveys)==null||l.loadIfEnabled()),(R(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((u=t?.captureEventName)!==null&&u!==void 0?u:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$r()}else x.warn(Rc)}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!==Ve?(this.config.cookieless_mode===ct&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.tn(),this.config.cookieless_mode===ct&&(this.register({distinct_id:Lr,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.$r())):x.warn(Rc)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Ve||(this.config.cookieless_mode===ct?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.tn()}_is_bot(){return xe?ed(xe,this.config.custom_blocked_useragents):void 0}$r(){P&&(P.visibilityState==="visible"?this.kr||(this.kr=!0,this.capture(un,{title:P.title},{send_instantly:!0}),this.Tr&&(P.removeEventListener(hs,this.Tr),this.Tr=null)):this.Tr||(this.Tr=this.$r.bind(this),ie(P,hs,this.Tr)))}debug(t){t===!1?(m?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(m?.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}))}ki(){var t,n,r,s,i,o,a=this.Nr||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(x.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):(r="advanced_disable_decide",s=x,i=(n="advanced_disable_flags")in(t=a)&&!j(t[n]),o=r in t&&!j(t[r]),i?t[n]:!!o&&(s&&s.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]))}Yr(t){if(j(this.config.before_send))return t;var n=Z(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var s of n){if(r=s(r),j(r)){var i="Event '"+t.event+"' was rejected in beforeSend function";return sg(t.event)?x.warn(i+". This can cause unexpected behavior."):x.info(i),null}r.properties&&!pn(r.properties)||x.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.ai)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Rr(t){var n=rt(t)&&!t,r=ee.Ut()&&ee.Gt("ph_debug")==="true";return!n&&(!!r||t)}}function Mc(e){return e instanceof Element&&(e.id===Lu||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function Zs(e){return!!e&&e.nodeType===1}function At(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function id(e){return!!e&&e.nodeType===3}function od(e){return!!e&&e.nodeType===11}function ra(e){return e?Fs(e).split(/\s+/):[]}function zc(e){var t=m?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function ws(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 ra(t)}function ad(e){return j(e)?null:Fs(e).split(/(\s+)/).filter((t=>dr(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function vr(e){var t="";return bo(e)&&!ld(e)&&e.childNodes&&e.childNodes.length&&Y(e.childNodes,(function(n){var r;id(n)&&n.textContent&&(t+=(r=ad(n.textContent))!==null&&r!==void 0?r:"")})),Fs(t)}function Dc(e){return R(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}Me.__defaultExtensionClasses={},Me.en={trace:on=()=>{},debug:on,info:on,warn:on,error:on,fatal:on},(function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=Fg(e.prototype[t[n]])})(Me,["identify"]);var sa=["a","button","form","input","select","textarea","label"];function Fc(e,t){if(R(t))return!0;var n,r=function(i){if(t.some((o=>i.matches(o))))return{v:!0}};for(var s of e)if(n=r(s))return n.v;return!1}function cd(e){var t=e.parentNode;return!(!t||!Zs(t))&&t}var Om=["next","previous","prev",">","<"],jc=[".ph-no-rageclick",".ph-no-capture"],yo=e=>!e||At(e,"html")||!Zs(e),Uc=(e,t)=>{if(!m||yo(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],s=e;s.parentNode&&!At(s,"body");)if(od(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;else{var i=cd(s);if(!i)break;if(t||sa.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var o=m.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(i),s=i}return{parentIsUsefulElement:n,targetElementList:r}};function bo(e){for(var t=e;t.parentNode&&!At(t,"body");t=t.parentNode){var n=ws(t);if(F(n,"ph-sensitive")||F(n,"ph-no-capture"))return!1}if(F(ws(e),"ph-include"))return!0;var r=e.type||"";if(oe(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!oe(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 ld(e){return!!(At(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||At(e,"select")||At(e,"textarea")||e.getAttribute("contenteditable")==="true")}var ud="(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})",Im=new RegExp("^(?:"+ud+")$"),Am=new RegExp(ud),dd="\\d{3}-?\\d{2}-?\\d{4}",Pm=new RegExp("^("+dd+")$"),xm=new RegExp("("+dd+")");function dr(e,t){return t===void 0&&(t=!0),!(j(e)||oe(e)&&(e=Fs(e),(t?Im:Am).test((e||"").replace(/[- ]/g,""))||(t?Pm:xm).test(e)))}function Zc(e){var t=vr(e);return dr(t=(t+" "+hd(e)).trim())?t:""}function hd(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Y(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=vr(n);t=(t+" "+s).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+hd(n)).trim())}catch(i){x.error("[AutoCapture]",i)}})),t}function qc(e){return e.replace(/"|\\"/g,'\\"')}function $m(e){var t=e.attr__class;return t?Z(t)?t:ra(t):void 0}class Bc{constructor(t){this.disabled=t===!1;var n=ce(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(t-s.x)+Math.abs(n-s.y)<this.thresholdPx&&this.timeoutMs>r-s.timestamp){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var Ei="$copy_autocapture",Hc=X("[AutoCapture]");function ki(e,t){return t.length>e?t.slice(0,e)+"...":t}function Rm(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Zs(t));return t}function Cm(e,t){for(var n,r,{e:s,maskAllElementAttributes:i,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:c}=t,l=[e],u=e;u.parentNode&&!At(u,"body");)od(u.parentNode)?(l.push(u.parentNode.host),u=u.parentNode.host):(l.push(u.parentNode),u=u.parentNode);var d,h,p=[],g={},f=!1,v=!1;if(Y(l,(y=>{var $=bo(y);y.tagName.toLowerCase()==="a"&&(f=y.getAttribute("href"),f=$&&f&&dr(f)&&f),F(ws(y),"ph-no-capture")&&(v=!0),p.push((function(b,T,L,M){var D=b.tagName.toLowerCase(),q={tag_name:D};sa.indexOf(D)>-1&&!L&&(q.$el_text=D.toLowerCase()==="a"||D.toLowerCase()==="button"?ki(1024,Zc(b)):ki(1024,vr(b)));var B=ws(b);B.length>0&&(q.classes=B.filter((function(re){return re!==""}))),Y(b.attributes,(function(re){var _e;if((!ld(b)||["name","id","class","aria-label"].indexOf(re.name)!==-1)&&(M==null||!M.includes(re.name))&&!T&&dr(re.value)&&(!oe(_e=re.name)||_e.substring(0,10)!=="_ngcontent"&&_e.substring(0,7)!=="_nghost")){var Re=re.value;re.name==="class"&&(Re=ra(Re).join(" ")),q["attr__"+re.name]=ki(1024,Re)}}));for(var ae=1,de=1,Se=b;Se=Rm(Se);)ae++,Se.tagName===b.tagName&&de++;return q.nth_child=ae,q.nth_of_type=de,q})(y,i,o,a));var k=(function(b){if(!bo(b))return{};var T={};return Y(b.attributes,(function(L){if(L.name&&L.name.indexOf("data-ph-capture-attribute")===0){var M=L.name.replace("data-ph-capture-attribute-",""),D=L.value;M&&D&&dr(D)&&(T[M]=D)}})),T})(y);se(g,k)})),v)return{props:{},explicitNoCapture:v};if(o||(p[0].$el_text=e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?Zc(e):vr(e)),f){var E,I;p[0].attr__href=f;var S=(E=gs(f))==null?void 0:E.host,w=m==null||(I=m.location)==null?void 0:I.host;S&&w&&S!==w&&(d=f)}return{props:se({$event_type:s.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:(h=p,(function(y){return y.map(($=>{var k,b,T="";if($.tag_name&&(T+=$.tag_name),$.attr_class)for(var L of($.attr_class.sort(),$.attr_class))T+="."+L.replace(/"/g,"");var M=O({},$.text?{text:$.text}:{},{"nth-child":(k=$.nth_child)!==null&&k!==void 0?k:0,"nth-of-type":(b=$.nth_of_type)!==null&&b!==void 0?b:0},$.href?{href:$.href}:{},$.attr_id?{attr_id:$.attr_id}:{},$.attributes),D={};return Yr(M).sort(((q,B)=>{var[ae]=q,[de]=B;return ae.localeCompare(de)})).forEach((q=>{var[B,ae]=q;return D[qc(B.toString())]=qc(ae.toString())})),(T+=":")+Yr(D).map((q=>{var[B,ae]=q;return B+'="'+ae+'"'})).join("")})).join(";")})((function(y){return y.map(($=>{var k,b,T={text:(k=$.$el_text)==null?void 0:k.slice(0,400),tag_name:$.tag_name,href:(b=$.attr__href)==null?void 0:b.slice(0,2048),attr_class:$m($),attr_id:$.attr__id,nth_child:$.nth_child,nth_of_type:$.nth_of_type,attributes:{}};return Yr($).filter((L=>{var[M]=L;return M.indexOf("attr__")===0})).forEach((L=>{var[M,D]=L;return T.attributes[M]=D})),T}))})(h)))},(n=p[0])!=null&&n.$el_text?{$el_text:(r=p[0])==null?void 0:r.$el_text}:{},d&&s.type==="click"?{$external_click_url:d}:{},g)}}var Hn=X("[ExceptionAutocapture]");function Vc(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],s=n(r);return ut(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}var Nm=X("[TracingHeaders]"),_t=X("[Web Vitals]"),Gc=9e5,Wc="disabled",Jc="lazy_loading",Vn="awaiting_config",Ur="missing_config";X("[SessionRecording]"),X("[SessionRecording]");var wo="[SessionRecording]",vt=X(wo),Lm=X("[Heatmaps]");function Yc(e){return ce(e)&&"clientX"in e&&"clientY"in e&&Ye(e.clientX)&&Ye(e.clientY)}var Kc=X("[Product Tours]"),Ti="ph_product_tours",Mm=["$set_once","$set"],yt=X("[SiteApps]"),Xc="Error while initializing PostHog app with config id ";function an(e,t,n){if(j(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class zm{constructor(t){this.rn=new na,this.nn=(n,r)=>this.sn(n,r)&&this.an(n,r)&&this.ln(n,r)&&this.un(n,r),this.sn=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=t,this.hn=new Set,this.cn=new Set}init(){var t,n;R((t=this._instance)==null?void 0:t._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook(((r,s)=>{this.on(r,s)}))}register(t){var n,r;if(!R((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((o=>{var a,c;(a=this.cn)==null||a.add(o),(c=o.steps)==null||c.forEach((l=>{var u;(u=this.hn)==null||u.add(l?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var s,i=new Set;t.forEach((o=>{var a;(a=o.steps)==null||a.forEach((c=>{c!=null&&c.selector&&i.add(c?.selector)}))})),(s=this._instance)==null||s.autocapture.setElementSelectors(i)}}on(t,n){var r;n!=null&&t.length!=0&&(this.hn.has(t)||this.hn.has(n?.event))&&this.cn&&((r=this.cn)==null?void 0:r.size)>0&&this.cn.forEach((s=>{this.dn(n,s)&&this.rn.emit("actionCaptured",s.name)}))}vn(t){this.onAction("actionCaptured",(n=>t(n)))}dn(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.nn(t,r))return!0;return!1}onAction(t,n){return this.rn.on(t,n)}an(t,n){if(n!=null&&n.url){var r,s=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!an(s,n.url,n.url_matching||"contains"))return!1}return!0}ln(t,n){return!!this.fn(t,n)&&!!this.pn(t,n)&&!!this.gn(t,n)}fn(t,n){var r;if(n==null||!n.href)return!0;var s=this.mn(t);if(s.length>0)return s.some((a=>an(a.href,n.href,n.href_matching||"exact")));var i,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&an((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}pn(t,n){var r;if(n==null||!n.text)return!0;var s=this.mn(t);if(s.length>0)return s.some((l=>an(l.text,n.text,n.text_matching||"exact")||an(l.$el_text,n.text,n.text_matching||"exact")));var i,o,a,c=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(i=(function(l){for(var u,d=[],h=/(?::|")text="(.*?)"/g;!j(u=h.exec(l));)d.includes(u[1])||d.push(u[1]);return d})(c),o=n.text,a=n.text_matching||"exact",i.some((l=>an(l,o,a))))}gn(t,n){var r,s;if(n==null||!n.selector)return!0;var i=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(t==null||(s=t.properties)==null?void 0:s.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}mn(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t?.properties.$elements}un(t,n){return n==null||!n.properties||n.properties.length===0||nd(n.properties.reduce(((r,s)=>{var i=Z(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:i,operator:s.operator||"exact"},r}),{}),t?.properties)}}class Dm{constructor(t){this._instance=t,this.yn=new Map,this.bn=new Map,this.wn=new Map}_n(t,n){return!!t&&nd(t.propertyFilters,n?.properties)}In(t,n){var r=new Map;return t.forEach((s=>{var i;(i=s.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(s.id),r.set(o.name,a)}}))})),r}Cn(t,n,r){var s=(r===jn.Activation?this.yn:this.bn).get(t),i=[];return this.Sn((o=>{i=o.filter((a=>s?.includes(a.id)))})),i.filter((o=>{var a,c=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find((l=>l.name===t));return this._n(c,n)}))}register(t){var n;R((n=this._instance)==null?void 0:n._addCaptureHook)||(this.kn(t),this.xn(t))}xn(t){var n=t.filter((r=>{var s,i;return((s=r.conditions)==null?void 0:s.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.Tn==null&&(this.Tn=new zm(this._instance),this.Tn.init(),this.Tn.vn((r=>{this.onAction(r)}))),n.forEach((r=>{var s,i,o,a,c;r.conditions&&(s=r.conditions)!=null&&s.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.Tn)==null||a.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((l=>{if(l&&l.name){var u=this.wn.get(l.name);u&&u.push(r.id),this.wn.set(l.name,u||[r.id])}})))})))}kn(t){var n,r=t.filter((i=>{var o,a;return((o=i.conditions)==null?void 0:o.events)&&((a=i.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0})),s=t.filter((i=>{var o,a;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((a=i.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0}));r.length===0&&s.length===0||((n=this._instance)==null||n._addCaptureHook(((i,o)=>{this.onEvent(i,o)})),this.yn=this.In(t,jn.Activation),this.bn=this.In(t,jn.Cancellation))}onEvent(t,n){var r,s=this.re(),i=this.An(),o=this.En(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[i])||[];if(o===t&&n&&a.length>0){var c,l;s.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:a});var u=(n==null||(c=n.properties)==null?void 0:c.$survey_id)||(n==null||(l=n.properties)==null?void 0:l.$product_tour_id);if(u){var d=a.indexOf(u);0>d||(a.splice(d,1),this.Rn(a))}}else{if(this.bn.has(t)){var h=this.Cn(t,n,jn.Cancellation);h.length>0&&(s.info("cancel event matched, cancelling items",{event:t,itemsToCancel:h.map((g=>g.id))}),h.forEach((g=>{var f=a.indexOf(g.id);0>f||a.splice(f,1),this.Nn(g.id)})),this.Rn(a))}if(this.yn.has(t)){s.info("event name matched",{event:t,eventPayload:n,items:this.yn.get(t)});var p=this.Cn(t,n,jn.Activation);this.Rn(a.concat(p.map((g=>g.id))||[]))}}}onAction(t){var n,r=this.An(),s=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.wn.has(t)&&this.Rn(s.concat(this.wn.get(t)||[]))}Rn(t){var n,r=this.re(),s=this.An(),i=[...new Set(t)].filter((o=>!this.Mn(o)));r.info("updating activated items",{activatedItems:i}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[s]:i})}getActivatedIds(){var t,n=this.An();return((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[]}getEventToItemsMap(){return this.yn}Fn(){return this.Tn}}class Fm extends Dm{constructor(t){super(t)}An(){return"$surveys_activated"}En(){return er.SHOWN}Sn(t){var n;(n=this._instance)==null||n.getSurveys(t)}Nn(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}re(){return G}Mn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Oi="SDK is not enabled or survey functionality is not yet loaded",Qc="Disabled. Not loading surveys.",jm=m!=null&&m.location?_s(m.location.hash,"__posthog")||_s(location.hash,"state"):null,el="_postHogToolbarParams",tl=X("[Toolbar]"),ve=X("[FeatureFlags]"),zt=X("[FeatureFlags]",{debugEnabled:!0}),Ii=`" failed. Feature flags didn't load in time.`,Ai="$active_feature_flags",bt="$override_feature_flags",nl="$feature_flag_payloads",Gn="$override_feature_flag_payloads",rl="$feature_flag_request_id",sl=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},il=e=>{var t={};for(var[n,r]of Yr(e||{}))r&&(t[n]=r);return t},Pi=X("[Error tracking]"),ol="Refusing to render web experiment since the viewer is a likely bot",Um={icontains:(e,t)=>!!m&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!m&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!m&&bs(t.href,e),not_regex:(e,t)=>!!m&&!bs(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class ge{get Rt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((s=>{ge.On("retrieved web experiments from the server"),n.Pn=new Map,s.forEach((i=>{if(i.feature_flag_key){var o;n.Pn&&(ge.On("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.Pn)==null||o.set(i.feature_flag_key,i));var a=n._instance.getFeatureFlag(i.feature_flag_key);oe(a)&&i.variants[a]&&n.Ln(i.name,a,i.variants[a].transforms)}else if(i.variants)for(var c in i.variants){var l=i.variants[c];ge.Dn(l)&&n.Ln(i.name,c,l.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())ge.On(ol);else if(!this.Rt.disable_web_experiments){if(j(this.Pn))return this.Pn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ge.On("applying feature flags",t),t.forEach((n=>{var r;if(this.Pn&&(r=this.Pn)!=null&&r.has(n)){var s,i=this._instance.getFeatureFlag(n),o=(s=this.Pn)==null?void 0:s.get(n);i&&o!=null&&o.variants[i]&&this.Ln(o.name,i,o.variants[i].transforms)}}))}}previewWebExperiment(){var t=ge.getWindowLocation();if(t!=null&&t.search){var n=ms(t?.search,"__experiment_id"),r=ms(t?.search,"__experiment_variant");n&&r&&(ge.On("previewing web experiments "+n+" && "+r),this.getWebExperiments((s=>{this.Bn(parseInt(n),r,s)}),!1,!0))}}loadIfEnabled(){this.Rt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.Rt.disable_web_experiments&&!r)return t([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Rt.token),method:"GET",callback:i=>t(i.statusCode===200&&i.json&&i.json.experiments||[])})}Bn(t,n,r){var s=r.filter((i=>i.id===t));s&&s.length>0&&(ge.On("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.Ln(s[0].name,n,s[0].variants[n].transforms))}static Dn(t){return!j(t.conditions)&&ge.jn(t)&&ge.qn(t)}static jn(t){var n;if(j(t.conditions)||j((n=t.conditions)==null?void 0:n.url))return!0;var r,s,i,o=ge.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||Um[(s=(i=t.conditions)==null?void 0:i.urlMatchType)!==null&&s!==void 0?s:"icontains"](t.conditions.url,o))}static getWindowLocation(){return m?.location}static qn(t){var n;if(j(t.conditions)||j((n=t.conditions)==null?void 0:n.utm))return!0;var r=ju();if(r.utm_source){var s,i,o,a,c,l,u,d,h=(s=t.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((i=t.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,p=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,g=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_medium||((l=t.conditions)==null||(l=l.utm)==null?void 0:l.utm_medium)==r.utm_medium,f=(u=t.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return h&&g&&f&&p}return!1}static On(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];x.info("[WebExperiments] "+t,r)}Ln(t,n,r){this._is_bot()?ge.On(ol):n!=="control"?r.forEach((s=>{if(s.selector){var i;ge.On("applying transform of variant "+n+" for experiment "+t+" ",s);var o=(i=document)==null?void 0:i.querySelectorAll(s.selector);o?.forEach((a=>{var c=a;s.html&&(c.innerHTML=s.html),s.css&&c.setAttribute("style",s.css)}))}})):ge.On("Control variants leave the page unmodified.")}_is_bot(){return xe&&this._instance?ed(xe,this.Rt.custom_blocked_useragents):void 0}}var Ne=X("[Conversations]"),Dt="Conversations not available yet.",pd={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Zm=pd.info;function fd(e){if(rt(e))return{boolValue:e};if(Ye(e))return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(typeof e=="string")return{stringValue:e};if(Z(e))return{arrayValue:{values:e.map((t=>fd(t)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function al(e){var t=[];for(var n in e){var r=e[n];pt(r)||R(r)||t.push({key:n,value:fd(r)})}return t}var qs={featureFlags:class{constructor(e){this.Zn=!1,this.$n=!1,this.Vn=!1,this.Hn=!1,this.zn=!1,this.Un=!1,this.Yn=!1,this.Gn=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Rt(){return this._instance.config}get Xi(){return this._instance.persistence}Wn(e){return this._instance.get_property(e)}Xn(){var e,t;return(e=(t=this.Xi)==null?void 0:t.pi(this.Rt.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}Jn(){return!!this.Xn()&&(this.Gn||this.Vn||(this.Gn=!0,ve.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Kn(){var e,t=(e=this.Rt.evaluation_contexts)!==null&&e!==void 0?e:this.Rt.evaluation_environments;return!this.Rt.evaluation_environments||this.Rt.evaluation_contexts||this.Yn||(ve.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Yn=!0),t!=null&&t.length?t.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||ve.error("Invalid evaluation context found:",n,"Expected non-empty string"),r})):[]}Qn(){return this.Kn().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var s,i,o=(s=(i=n.bootstrap)==null?void 0:i.featureFlagPayloads)!==null&&s!==void 0?s:{},a=Object.keys(r).filter((l=>!!r[l])).reduce(((l,u)=>(l[u]=r[u]||!1,l)),{}),c=Object.keys(o).filter((l=>a[l])).reduce(((l,u)=>(o[u]&&(l[u]=o[u]),l)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:c})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},s=n!=null&&n.merge?this.getFlagPayloads():{},i=O({},r,e),o=O({},s,t),a={};for(var[c,l]of Object.entries(i)){var u=typeof l=="string";a[c]={key:c,enabled:!!u||!!l,variant:u?l:void 0,reason:void 0,metadata:R(o?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:o[c]}}}this.receivedFeatureFlags({flags:a})}get hasLoadedFlags(){return this.$n}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Wn(to),t=this.Wn(bt),n=this.Wn(Gn);if(!n&&!t)return e||{};var r=se({},e||{}),s=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var i of s){var o,a,c=r[i],l=t?.[i],u=R(l)?(o=c?.enabled)!==null&&o!==void 0&&o:!!l,d=R(l)?c.variant:typeof l=="string"?l:void 0,h=n?.[i],p=O({},c,{enabled:u,variant:u?d??c?.variant:void 0});u!==c?.enabled&&(p.original_enabled=c?.enabled),d!==c?.variant&&(p.original_variant=c?.variant),h&&(p.metadata=O({},c?.metadata,{payload:h,original_payload:c==null||(a=c.metadata)==null?void 0:a.payload})),r[i]=p}return this.Zn||(ve.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Zn=!0),r}getFlagVariants(){var e=this.Wn(fn),t=this.Wn(bt);if(!t)return e||{};for(var n=se({},e),r=Object.keys(t),s=0;r.length>s;s++)n[r[s]]=t[r[s]];return this.Zn||(ve.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Zn=!0),n}getFlagPayloads(){var e=this.Wn(nl),t=this.Wn(Gn);if(!t)return e||{};for(var n=se({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)n[r[s]]=t[r[s]];return this.Zn||(ve.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Zn=!0),n}reloadFeatureFlags(){this.Hn||this.Rt.advanced_disable_feature_flags||this.ts||(this._instance.Sr.emit("featureFlagsReloading",!0),this.ts=setTimeout((()=>{this.es()}),5))}rs(){clearTimeout(this.ts),this.ts=void 0}ensureFlagsLoaded(){this.$n||this.Vn||this.ts||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Hn=e}es(e){var t;if(this.rs(),!this._instance.ki())if(this.Vn)this.zn=!0;else{var n=this.Rt.token,r=this.Wn(as),s={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:O({},((t=this.Xi)==null?void 0:t.get_initial_props())||{},this.Wn(Qn)||{}),group_properties:this.Wn(jt),timezone:Vu()};pt(r)||R(r)||(s.$device_id=r),(e!=null&&e.disableFlags||this.Rt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Qn()&&(s.evaluation_contexts=this.Kn());var i=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Rt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Vn=!0,this._instance._send_request({method:"POST",url:i,data:s,compression:this.Rt.disable_compression?void 0:et.Base64,timeout:this.Rt.feature_flag_request_timeout_ms,callback:o=>{var a,c,l,u=!0;if(o.statusCode===200&&(this.zn||(this.$anon_distinct_id=void 0),u=!1),this.Vn=!1,!s.disable_flags||this.zn){this.Un=!u;var d=[];o.error?o.error instanceof Error?d.push(o.error.name==="AbortError"?"timeout":"connection_error"):d.push("unknown_error"):o.statusCode!==200&&d.push("api_error_"+o.statusCode),(a=o.json)!=null&&a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var h,p=!((c=o.json)==null||(c=c.quotaLimited)==null||!c.includes("feature_flags"));p&&d.push("quota_limited"),(l=this.Xi)==null||l.register({[so]:d}),p?ve.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."):(s.disable_flags||this.receivedFeatureFlags((h=o.json)!==null&&h!==void 0?h:{},u,{partialResponse:!!this.Rt.advanced_only_evaluate_survey_feature_flags}),this.zn&&(this.zn=!1,this.es()))}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.Un)if(this.$n||this.getFlags()&&this.getFlags().length>0){if(!this.Jn()){var r=this.getFeatureFlagResult(e,t);return(n=r?.variant)!==null&&n!==void 0?n:r?.enabled}}else ve.warn('getFeatureFlag for key "'+e+Ii)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.Un)if(this.$n||this.getFlags()&&this.getFlags().length>0){if(!this.Jn()){var n=this.getFlagVariants(),r=e in n,s=n[e],i=this.getFlagPayloads()[e],o=String(s),a=this.Wn(rl)||void 0,c=this.Wn(ls)||void 0,l=this.Wn(cr)||{};if(this.Rt.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),h=this.Wn(ro);d&&d!==h&&(l={},(u=this.Xi)==null||u.register({[cr]:l,[ro]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in l)||!l[e].includes(o))){var p,g,f,v,E,I,S,w,y,$;Z(l[e])?l[e].push(o):l[e]=[o],(p=this.Xi)==null||p.register({[cr]:l});var k=this.getFeatureFlagDetails(e),b=[...(g=this.Wn(so))!==null&&g!==void 0?g:[]];R(s)&&b.push("flag_missing");var T={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:i||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((f=this.Rt.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[e])||null,$feature_flag_bootstrapped_payload:((v=this.Rt.bootstrap)==null||(v=v.featureFlagPayloads)==null?void 0:v[e])||null,$used_bootstrap_value:!this.Un};R(k==null||(E=k.metadata)==null?void 0:E.version)||(T.$feature_flag_version=k.metadata.version);var L,M=(I=k==null||(S=k.reason)==null?void 0:S.description)!==null&&I!==void 0?I:k==null||(w=k.reason)==null?void 0:w.code;M&&(T.$feature_flag_reason=M),k!=null&&(y=k.metadata)!=null&&y.id&&(T.$feature_flag_id=k.metadata.id),R(k?.original_variant)&&R(k?.original_enabled)||(T.$feature_flag_original_response=R(k.original_variant)?k.original_enabled:k.original_variant),k!=null&&($=k.metadata)!=null&&$.original_payload&&(T.$feature_flag_original_payload=k==null||(L=k.metadata)==null?void 0:L.original_payload),b.length&&(T.$feature_flag_error=b.join(",")),this._instance.capture("$feature_flag_called",T)}if(r){var D=i;if(!R(i))try{D=JSON.parse(i)}catch{}return{key:e,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:D}}}}else ve.warn('getFeatureFlagResult for key "'+e+Ii)}getRemoteConfigPayload(e,t){var n=this.Rt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Qn()&&(r.evaluation_contexts=this.Kn()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Rt.disable_compression?void 0:et.Base64,timeout:this.Rt.feature_flag_request_timeout_ms,callback(s){var i,o=(i=s.json)==null?void 0:i.featureFlagPayloads;t(o?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.Un){if(this.$n||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return R(n)?void 0:!!n}ve.warn('isFeatureEnabled for key "'+e+Ii)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,n){if(this.Xi){this.$n=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(o,a,c,l,u,d){c===void 0&&(c={}),l===void 0&&(l={}),u===void 0&&(u={});var h=(b=>{var T=b.flags;return T?(b.featureFlags=Object.fromEntries(Object.keys(T).map((L=>{var M;return[L,(M=T[L].variant)!==null&&M!==void 0?M:T[L].enabled]}))),b.featureFlagPayloads=Object.fromEntries(Object.keys(T).filter((L=>T[L].enabled)).filter((L=>{var M;return(M=T[L].metadata)==null?void 0:M.payload})).map((L=>{var M;return[L,(M=T[L].metadata)==null?void 0:M.payload]})))):ve.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),b})(o),p=h.flags,g=h.featureFlags,f=h.featureFlagPayloads;if(g){var v=o.requestId,E=o.evaluatedAt;if(Z(g)){ve.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var I={};if(g)for(var S=0;g.length>S;S++)I[g[S]]=!0;a&&a.register({[Ai]:g,[fn]:I})}else{var w=g,y=f,$=p;if(d!=null&&d.partialResponse)w=O({},c,w),y=O({},l,y),$=O({},u,$);else if(o.errorsWhileComputingFlags)if(p){var k=new Set(Object.keys(p).filter((b=>{var T;return!((T=p[b])!=null&&T.failed)})));w=O({},c,Object.fromEntries(Object.entries(w).filter((b=>{var[T]=b;return k.has(T)})))),y=O({},l,Object.fromEntries(Object.entries(y||{}).filter((b=>{var[T]=b;return k.has(T)})))),$=O({},u,Object.fromEntries(Object.entries($||{}).filter((b=>{var[T]=b;return k.has(T)}))))}else w=O({},c,w),y=O({},l,y),$=O({},u,$);a&&a.register(O({[Ai]:Object.keys(il(w)),[fn]:w||{},[nl]:y||{},[to]:$||{}},v?{[rl]:v}:{},E?{[ls]:E}:{}))}}})(e,this.Xi,r,s,i,n),t||(this.Gn=!1),this.ns(t)}}override(e,t){t===void 0&&(t=!1),ve.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Xi)return ve.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this.Xi.unregister(bt),this.Xi.unregister(Gn),this.ns(),zt.info("All overrides cleared");if(Z(e)){var t=sl(e);return this.Xi.register({[bt]:t}),this.ns(),zt.info("Flag overrides set",{flags:e})}if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.Zn=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.Xi.unregister(bt),zt.info("Flag overrides cleared");else if(r.flags){if(Z(r.flags)){var s=sl(r.flags);this.Xi.register({[bt]:s})}else this.Xi.register({[bt]:r.flags});zt.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.Xi.unregister(Gn),zt.info("Payload overrides cleared")):r.payloads&&(this.Xi.register({[Gn]:r.payloads}),zt.info("Payload overrides set",{payloads:r.payloads}))),void this.ns()}if(e&&typeof e=="object")return this.Xi.register({[bt]:e}),this.ns(),zt.info("Flag overrides set",{flags:e});ve.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.$n){var{flags:t,flagVariants:n}=this.ss();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,s=(this.Wn(Xn)||[]).find((c=>c.flagKey===e)),i={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:i};s&&(o.$early_access_feature_name=s.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(i,!1);var a=O({},this.getFlagVariants(),{[e]:t});(r=this.Xi)==null||r.register({[Ai]:Object.keys(il(a)),[fn]:a}),this.ns()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.Wn(Xn),s=n?"&"+n.map((i=>"stage="+i)).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Rt.token+s),method:"GET",callback:i=>{var o,a;if(i.json){var c=i.json.earlyAccessFeatures;return(o=this.Xi)==null||o.unregister(Xn),(a=this.Xi)==null||a.register({[Xn]:c}),e(c)}}})}ss(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((n=>t[n])),flagVariants:Object.keys(t).filter((n=>t[n])).reduce(((n,r)=>(n[r]=t[r],n)),{})}}ns(e){var{flags:t,flagVariants:n}=this.ss();this.featureFlagEventHandlers.forEach((r=>r(t,n,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.Wn(Qn)||{},r=e?.$set||(e!=null&&e.$set_once?{}:e),s=e?.$set_once,i={};if(s)for(var o in s)({}).hasOwnProperty.call(s,o)&&(o in n||(i[o]=s[o]));this._instance.register({[Qn]:O({},n,i,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Qn)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.Wn(jt)||{};Object.keys(n).length!==0&&Object.keys(n).forEach((r=>{n[r]=O({},n[r],e[r]),delete e[r]})),this._instance.register({[jt]:O({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Wn(jt)||{};this._instance.register({[jt]:O({},t,{[e]:{}})})}else this._instance.unregister(jt)}reset(){this.$n=!1,this.Vn=!1,this.Hn=!1,this.zn=!1,this.Un=!1,this.$anon_distinct_id=void 0,this.rs(),this.Zn=!1}}},qm={sessionRecording:class{get Rt(){return this._instance.config}get Xi(){return this._instance.persistence}get started(){var e;return!((e=this.os)==null||!e.isStarted)}get status(){var e,t;return this.ls===Vn||this.ls===Ur?this.ls:(e=(t=this.os)==null?void 0:t.status)!==null&&e!==void 0?e:this.ls}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ls=Wc,this.us=void 0,this._instance=e,!this._instance.sessionManager)throw vt.error("started without valid sessionManager"),new Error(wo+" started without valid sessionManager. This is a bug.");if(this.Rt.cookieless_mode===Ve)throw new Error(wo+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get hs(){var e,t=!((e=this._instance.get_property(Nr))==null||!e.enabled),n=!this.Rt.disable_session_recording,r=this.Rt.disable_session_recording||this._instance.consent.isOptedOut();return m&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.hs||(t=this.os)==null||!t.isStarted){var n=!R(Object.assign)&&!R(Array.from);this.hs&&n?(this.cs(e),vt.info("starting")):(this.ls=Wc,this.stopRecording())}}cs(e){var t,n,r;this.hs&&(this.ls!==Vn&&this.ls!==Ur&&(this.ls=Jc),N!=null&&(t=N.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=N.__PosthogExtensions__)!=null&&n.initSessionRecording?this.ds(e):(r=N.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.vs,(s=>{if(s)return vt.error("could not load recorder",s);this.ds(e)})))}stopRecording(){var e,t;(e=this.us)==null||e.call(this),this.us=void 0,(t=this.os)==null||t.stop()}fs(){var e,t;(e=this.us)==null||e.call(this),this.us=void 0,(t=this.os)==null||t.discard()}ps(){var e;(e=this.Xi)==null||e.unregister(Nu)}gs(e,t){if(j(e))return null;var n,r=Ye(e)?e:parseFloat(e);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(vt.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}ys(e){if(this.Xi){var t,n,r=this.Xi,s=()=>{var i,o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.gs((i=this.Rt.session_recording)==null?void 0:i.sampleRate,"session_recording.sampleRate"),c=this.gs(o?.sampleRate,"remote config sampleRate"),l=a??c;j(l)&&this.ps();var u=o?.minimumDurationMilliseconds;r.register({[Nr]:O({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:O({capturePerformance:e.capturePerformance},o?.networkPayloadCapture),canvasRecording:{enabled:o?.recordCanvas,fps:o?.canvasFps,quality:o?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:R(u)?null:u,endpoint:o?.endpoint,triggerMatchType:o?.triggerMatchType,masking:o?.masking,urlTriggers:o?.urlTriggers,version:o?.version,triggerGroups:o?.triggerGroups})})};s(),(t=this.us)==null||t.call(this),this.us=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.ys(e),void this.fs()):(this.ys(e),void this.startIfEnabledOrStop()):(this.ls===Vn&&(this.ls=Ur,vt.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.os)!=null&&n.log?this.os.log(e,t):vt.warn("log called before recorder was ready")}get vs(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Nr);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}bs(){var e,t=this._instance.get_property(Nr);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return 36e5>=Date.now()-n}ds(e){var t,n;if((t=N.__PosthogExtensions__)==null||!t.initSessionRecording)return vt.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0});if(this.os||(this.os=(n=N.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.os._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.bs())return this.ls===Ur||this.ls===Vn?void 0:(this.ls=Vn,vt.info("persisted remote config is stale, requesting fresh config before starting"),void new Gu(this._instance).load());this.ls=Jc,this.os.start(e)}onRRwebEmit(e){var t;(t=this.os)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.os||(t=this.Xi)==null||t.register({$replay_override_linked_flag:!0}),(e=this.os)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.os||(t=this.Xi)==null||t.register({$replay_override_sampling:!0}),(e=this.os)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.os||(n=this.Xi)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.os)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.os)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.os)==null||!n.tryAddCustomEvent(e,t))}}},Bm={autocapture:class{constructor(e){this.ws=!1,this._s=null,this.Is=!1,this.instance=e,this.rageclicks=new Bc(e.config.rageclick),this.Cs=null}initialize(){this.startIfEnabled()}get Rt(){var e,t,n=ce(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}Ss(){if(this.isBrowserSupported()){if(m&&P){var e=n=>{n=n||m?.event;try{this.ks(n)}catch(r){Hc.error("Failed to capture event",r)}};if(ie(P,"submit",e,{capture:!0}),ie(P,"change",e,{capture:!0}),ie(P,"click",e,{capture:!0}),this.Rt.capture_copied_text){var t=n=>{this.ks(n=n||m?.event,Ei)};ie(P,"copy",t,{capture:!0}),ie(P,"cut",t,{capture:!0})}}}else Hc.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ws&&(this.Ss(),this.ws=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Is=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[ac]:!!e.autocapture_opt_out}),this._s=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Cs=e}getElementSelectors(e){var t,n=[];return(t=this.Cs)==null||t.forEach((r=>{var s=P?.querySelectorAll(r);s?.forEach((i=>{e===i&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[ac];if(pt(this._s)&&!rt(n)&&!this.instance.ki())return!1;var r=(t=this._s)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!r}ks(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=Dc(e);id(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&(function(d,h){if(!m||yo(d))return!1;var p,g,f;if(rt(h)?(p=!!h&&jc,g=void 0):(p=(f=h?.css_selector_ignorelist)!==null&&f!==void 0?f:jc,g=h?.content_ignorelist),p===!1)return!1;var{targetElementList:v}=Uc(d,!1);return!(function(E,I){if(E===!1||R(E))return!1;var S;if(E===!0)S=Om;else{if(!Z(E))return!1;if(E.length>10)return x.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;S=E.map((w=>w.toLowerCase()))}return I.some((w=>{var{safeText:y,ariaLabel:$}=w;return S.some((k=>y.includes(k)||$.includes(k)))}))})(g,v.map((E=>{var I;return{safeText:vr(E).toLowerCase(),ariaLabel:((I=E.getAttribute("aria-label"))==null?void 0:I.toLowerCase().trim())||""}})))&&!Fc(v,p)})(r,this.instance.config.rageclick)&&this.ks(e,"$rageclick");var s=t===Ei;if(r&&(function(d,h,p,g,f){var v,E,I,S;if(p===void 0&&(p=void 0),!m||yo(d)||(v=p)!=null&&v.url_allowlist&&!zc(p.url_allowlist)||(E=p)!=null&&E.url_ignorelist&&zc(p.url_ignorelist))return!1;if((I=p)!=null&&I.dom_event_allowlist){var w=p.dom_event_allowlist;if(w&&!w.some((T=>h.type===T)))return!1}var{parentIsUsefulElement:y,targetElementList:$}=Uc(d,g);if(!(function(T,L){var M=L?.element_allowlist;if(R(M))return!0;var D,q=function(ae){if(M.some((de=>ae.tagName.toLowerCase()===de)))return{v:!0}};for(var B of T)if(D=q(B))return D.v;return!1})($,p)||!Fc($,(S=p)==null?void 0:S.css_selector_allowlist))return!1;var k=m.getComputedStyle(d);if(k&&k.getPropertyValue("cursor")==="pointer"&&h.type==="click")return!0;var b=d.tagName.toLowerCase();switch(b){case"html":return!1;case"form":return(f||["submit"]).indexOf(h.type)>=0;case"input":case"select":case"textarea":return(f||["change","click"]).indexOf(h.type)>=0;default:return y?(f||["click"]).indexOf(h.type)>=0:(f||["click"]).indexOf(h.type)>=0&&(sa.indexOf(b)>-1||d.getAttribute("contenteditable")==="true")}})(r,e,this.Rt,s,s?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=Cm(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rt.element_attribute_ignorelist,elementsChainAsString:this.Is});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(i.$element_selectors=a),t===Ei){var c,l=ad(m==null||(c=m.getSelection())==null?void 0:c.toString()),u=e.type||"clipboard";if(!l)return!1;i.$selected_content=l,i.$copy_type=u}return this.instance.capture(t,i),!0}}}isBrowserSupported(){return ut(P?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.xs=(m==null||(t=m.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(x.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ts&&this.Ts(),this.Ts=void 0,x.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(m&&m.history){var n=this;(e=m.history.pushState)!=null&&e.__posthog_wrapped__||Vc(m.history,"pushState",(r=>function(s,i,o){r.call(this,s,i,o),n.As("pushState")})),(t=m.history.replaceState)!=null&&t.__posthog_wrapped__||Vc(m.history,"replaceState",(r=>function(s,i,o){r.call(this,s,i,o),n.As("replaceState")})),this.Es()}}As(e){try{var t,n=m==null||(t=m.location)==null?void 0:t.pathname;if(!n)return;n!==this.xs&&this.isEnabled&&this._instance.capture(un,{navigation_type:e}),this.xs=n}catch(r){x.error("Error capturing "+e+" pageview",r)}}Es(){if(!this.Ts){var e=()=>{this.As("popstate")};ie(m,"popstate",e),this.Ts=()=>{m&&m.removeEventListener("popstate",e)}}}},heatmaps:class{get Rt(){return this.instance.config}constructor(e){var t;this.Rs=!1,this.ws=!1,this.Ns=null,this.instance=e,this.Rs=!((t=this.instance.persistence)==null||!t.props[Qi]),this.rageclicks=new Bc(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return ce(this.Rt.capture_heatmaps)&&this.Rt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Rt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return j(this.Rt.capture_heatmaps)?j(this.Rt.enable_heatmaps)?this.Rs:this.Rt.enable_heatmaps:this.Rt.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ws)return;Lm.info("starting..."),this.Ms(),this.Tt()}else{var e;clearInterval((e=this.Ns)!==null&&e!==void 0?e:void 0),this.Fs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Qi]:t}),this.Rs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Os(e){this.wt(e.originalEvent,"deadclick")}Tt(){this.Ns&&clearInterval(this.Ns),this.Ns=P?.visibilityState==="visible"?setInterval(this.ji.bind(this),this.flushIntervalMilliseconds):null}Ms(){m&&P&&(this.Ps=this.ji.bind(this),ie(m,ps,this.Ps),this.Ls=e=>this.wt(e||m?.event),ie(P,"click",this.Ls,{capture:!0}),this.Ds=e=>this.Bs(e||m?.event),ie(P,"mousemove",this.Ds,{capture:!0}),this.js=new mc(this.instance,Jg,this.Os.bind(this)),this.js.startIfEnabledOrStop(),this.qs=this.Tt.bind(this),ie(P,hs,this.qs),this.ws=!0)}Fs(){var e;m&&P&&(this.Ps&&m.removeEventListener(ps,this.Ps),this.Ls&&P.removeEventListener("click",this.Ls,{capture:!0}),this.Ds&&P.removeEventListener("mousemove",this.Ds,{capture:!0}),this.qs&&P.removeEventListener(hs,this.qs),clearTimeout(this.Zs),(e=this.js)==null||e.stop(),this.ws=!1)}$s(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),i=(function(o,a,c){for(var l=o;l&&Zs(l)&&!At(l,"body");){if(l===c)return!1;if(F(a,m?.getComputedStyle(l).position))return!0;l=cd(l)}return!1})(Dc(e),["fixed","sticky"],s);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:t}}wt(e,t){var n;if(t===void 0&&(t="click"),!Mc(e.target)&&Yc(e)){var r=this.$s(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Vs(O({},r,{type:"rageclick"})),this.Vs(r)}}Bs(e){!Mc(e.target)&&Yc(e)&&(clearTimeout(this.Zs),this.Zs=setTimeout((()=>{this.Vs(this.$s(e,"mousemove"))}),500))}Vs(e){if(m){var t=m.location.href,n=this.Rt.custom_personal_data_properties,r=this.Rt.mask_personal_data_properties?[...Rn,...n||[]]:[],s=mr(t,r,_r);this.T=this.T||{},this.T[s]||(this.T[s]=[]),this.T[s].push(e)}}ji(){this.T&&!pn(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:mc,webVitalsAutocapture:class{constructor(e){var t;this.Rs=!1,this.ws=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Hs=()=>{clearTimeout(this.zs),this.T.metrics.length!==0&&(this._instance.capture("$web_vitals",this.T.metrics.reduce(((n,r)=>O({},n,{["$web_vitals_"+r.name+"_event"]:O({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.nt=n=>{var r,s=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(R(s))_t.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.Us();R(i)||(j(n?.name)||j(n?.value)?_t.error("Invalid metric received",n):!this.Ys||this.Ys>n.value?(this.T.url!==i&&(this.Hs(),this.zs=setTimeout(this.Hs,this.flushToCaptureTimeoutMs)),R(this.T.url)&&(this.T.url=i),this.T.firstMetricTimestamp=R(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.T.metrics.push(O({},n,{$current_url:i,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.Hs()):_t.error("Ignoring metric with value >= "+this.Ys,n))}},this.Gs=()=>{if(!this.ws){var n,r,s,i,o=N.__PosthogExtensions__;R(o)||R(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:s,onINP:i}=o.postHogWebVitalsCallbacks),n&&r&&s&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.nt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.nt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.nt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.nt.bind(this)),this.ws=!0):_t.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Rs=!((t=this._instance.persistence)==null||!t.props[uc]),this.startIfEnabled()}get Ws(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=ce(this.Ws)?(e=this.Ws)==null?void 0:e.web_vitals_allowed_metrics:void 0;return j(n)?((t=this._instance.persistence)==null?void 0:t.props[hc])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(ce(this.Ws)?this.Ws.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=ce(this.Ws)?this.Ws.web_vitals_attribution:void 0;return e!=null&&e}get Ys(){var e=ce(this.Ws)&&Ye(this.Ws.__web_vitals_max_value)?this.Ws.__web_vitals_max_value:Gc;return e>0&&6e4>=e?Gc:e}get isEnabled(){var e=he?.protocol;if(e!=="http:"&&e!=="https:")return _t.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=ce(this.Ws)?this.Ws.web_vitals:rt(this.Ws)?this.Ws:void 0;return rt(t)?t:this.Rs}startIfEnabled(){this.isEnabled&&!this.ws&&(_t.info("enabled, starting..."),this.ni(this.Gs))}onRemoteConfig(e){if("capturePerformance"in e){var t=ce(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=ce(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[uc]:t}),this._instance.persistence.register({[hc]:n})),this.Rs=t,this.startIfEnabled()}}ni(e){var t,n;(t=N.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=N.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(r=>{r?_t.error("failed to load script",r):e()}))}Us(){var e=m?m.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...Rn,...t||[]]:[];return mr(e,n,_r)}_t.error("Could not determine current URL")}}},Hm={exceptionObserver:class{constructor(e){var t,n,r;this.Gs=()=>{var s;if(m&&this.isEnabled&&(s=N.__PosthogExtensions__)!=null&&s.errorWrappingFunctions){var i=N.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=N.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=N.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Xs&&this.Rt.capture_unhandled_errors&&(this.Xs=i(this.captureException.bind(this))),!this.Js&&this.Rt.capture_unhandled_rejections&&(this.Js=o(this.captureException.bind(this))),!this.Ks&&this.Rt.capture_console_errors&&(this.Ks=a(this.captureException.bind(this)))}catch(c){Hn.error("failed to start",c),this.Qs()}}},this._instance=e,this.eo=!((t=this._instance.persistence)==null||!t.props[cc]),this.io=new ag({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,qt:Hn}),this.Rt=this.ro(),this.startIfEnabledOrStop()}ro(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ce(e)?t=O({},t,e):(R(e)?this.eo:e)&&(t=O({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Rt.capture_console_errors||this.Rt.capture_unhandled_errors||this.Rt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Hn.info("enabled"),this.Qs(),this.ni(this.Gs)):this.Qs()}ni(e){var t,n;(t=N.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=N.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Hn.error("failed to load script",r);e()}))}Qs(){var e,t,n;(e=this.Xs)==null||e.call(this),this.Xs=void 0,(t=this.Js)==null||t.call(this),this.Js=void 0,(n=this.Ks)==null||n.call(this),this.Ks=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.eo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[cc]:this.eo}),this.Rt=this.ro(),this.startIfEnabledOrStop())}onConfigChange(){this.Rt=this.ro()}captureException(e){var t,n,r,s=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.io.consumeRateLimit(s)?Hn.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.no=[],this.so=new yg([new Ig,new Mg,new Pg,new Ag,new Ng,new Cg,new $g,new Lg],(function(r){for(var s=arguments.length,i=new Array(s>1?s-1:0),o=1;s>o;o++)i[o-1]=arguments[o];return function(a,c){c===void 0&&(c=0);for(var l=[],u=a.split(`
|
|
3
|
+
`),d=c;u.length>d;d++){var h=u[d];if(1024>=h.length){var p=oc.test(h)?h.replace(oc,"$1"):h;if(!p.match(/\S*Error: /)){for(var g of i){var f=g(p,r);if(f){l.push(f);break}}if(l.length>=50)break}}}return(function(v){if(!v.length)return[];var E=Array.from(v);return E.reverse(),E.slice(0,50).map((I=>{return O({},I,{filename:I.filename||(S=E,S[S.length-1]||{}).filename,function:I.function||$n});var S}))})(l)}})("web:javascript",Eg,Og)),this._instance=e,this.no=(t=(n=this._instance.persistence)==null?void 0:n.get_property(eo))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var s=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],i=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.no=s,this._instance.persistence&&this._instance.persistence.register({[eo]:this.no,[lc]:i})}}get oo(){var e,t=!!this._instance.get_property(lc),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.so.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ao(t)){if(this.lo(t))return void Pi.info("Skipping exception capture because a suppression rule matched");if(!this.oo&&this.uo(t))return void Pi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ho(t))return void Pi.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",zr:!0})}lo(e){if(e.length===0)return!1;var t=e.reduce(((n,r)=>{var{type:s,value:i}=r;return oe(s)&&s.length>0&&n.$exception_types.push(s),oe(i)&&i.length>0&&n.$exception_values.push(i),n}),{$exception_types:[],$exception_values:[]});return this.no.some((n=>{var r=n.values.map((s=>{var i,o=td[s.operator],a=Z(s.value)?s.value:[s.value],c=(i=t[s.key])!==null&&i!==void 0?i:[];return a.length>0&&o(a,c)}));return n.type==="OR"?r.some(Boolean):r.every(Boolean)}))}uo(e){return e.flatMap((t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}ho(e){if(e.length>0){var t,n,r,s,i=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],o=i[i.length-1];return(r=o==null||(s=o.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}ao(e){return!j(e)&&Z(e)}}},Vm=O({productTours:class{get Xi(){return this._instance.persistence}constructor(e){this.co=null,this.do=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.Xi&&this.Xi.register({[dc]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.co||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(dc)||this.ni((()=>this.vo()))}ni(e){var t,n;(t=N.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=N.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?Kc.error("Could not load product tours script",r):e()}))}vo(){var e;!this.co&&(e=N.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.co=N.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Z(this.do)||t){var n=this.Xi;if(n){var r=n.props[Ti];if(Z(r)&&!t)return this.do=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:s=>{var i=s.statusCode;if(i!==200||!s.json){var o="Product Tours API could not be loaded, status: "+i;return Kc.error(o),void e([],{isLoaded:!1,error:o})}var a=Z(s.json.product_tours)?s.json.product_tours:[];this.do=a,n&&n.register({[Ti]:a}),e(a,{isLoaded:!0})}})}else e(this.do,{isLoaded:!0})}getActiveProductTours(e){j(this.co)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.co.getActiveProductTours(e)}showProductTour(e){var t;(t=this.co)==null||t.showTourById(e)}previewTour(e){this.co?this.co.previewTour(e):this.ni((()=>{var t;this.vo(),(t=this.co)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.co)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.co)==null||e.nextStep()}previousStep(){var e;(e=this.co)==null||e.previousStep()}clearCache(){var e;this.do=null,(e=this.Xi)==null||e.unregister(Ti)}resetTour(e){var t;(t=this.co)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.co)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.co)==null||t.cancelPendingTour(e)}}},qs),Gm={siteApps:class{constructor(e){this._instance=e,this.fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}po(e,t){if(t){var n=this.globalsForEvent(t);this.fo.push(n),this.fo.length>1e3&&(this.fo=this.fo.slice(10))}}get siteAppLoaders(){var e;return(e=N._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.po.bind(this));this.mo=()=>{e(),this.fo=[],this.mo=void 0}}}globalsForEvent(e){var t,n,r,s,i,o,a;if(!e)throw new Error("Event payload is required");var c={},l=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[d,h]of Object.entries(u))c[d]={id:l[d],type:d,properties:h};var{$set_once:p,$set:g}=e;return{event:O({},cu(e,Mm),{properties:O({},e.properties,g?{$set:O({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},g)}:{},p?{$set_once:O({},(r=(s=e.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},p)}:{}),elements_chain:(i=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(a=e.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.fo.length&&(yt.info("Processing "+this.fo.length+" events for site app with id "+e.id),this.fo.forEach((a=>t.processEvent==null?void 0:t.processEvent(a))),t.processedBuffer=!0),Object.values(this.apps).every((a=>a.processedBuffer||a.errored))&&((o=this.mo)==null||o.call(this))},r=!1,s=o=>{t.errored=!o,t.loaded=!0,yt.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:i}=e.init({posthog:this._instance,callback(o){s(o)}});i&&(t.processEvent=i),r=!0}catch(o){yt.error(Xc+e.id,o),s(!1)}if(r&&t.loaded)try{n()}catch(o){yt.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}yo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}bo(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){yt.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,s=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.yo(),void this._instance.on("eventCaptured",(c=>this.bo(c)))):void yt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.mo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(c){var l;N["__$$ph_site_app_"+c]=s._instance,(l=N.__PosthogExtensions__)==null||l.loadSiteApp==null||l.loadSiteApp(s._instance,a,(u=>{if(u)return yt.error(Xc+c,u)}))};for(var{id:o,url:a}of e.siteApps)i(o)}else yt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Wm={tracingHeaders:class{constructor(e){this.wo=void 0,this._o=void 0,this.Gs=()=>{var t,n;R(this.wo)&&((t=N.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),R(this._o)&&((n=N.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ni(e){var t,n;(t=N.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=N.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return Nm.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.ni(this.Gs):((e=this.wo)==null||e.call(this),(t=this._o)==null||t.call(this),this.wo=void 0,this._o=void 0)}}},Jm=O({surveys:class{get Rt(){return this._instance.config}constructor(e){this.Io=void 0,this._surveyManager=null,this.Co=!1,this.So=[],this.ko=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Rt.disable_surveys){var t=e.surveys;if(j(t))return G.warn("Flags not loaded yet. Not loading surveys.");var n=Z(t);this.Io=n?t.length>0:t,G.info("flags response received, isSurveysEnabled: "+this.Io),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(_o)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach((r=>localStorage.removeItem(r)))}loadIfEnabled(){if(!this._surveyManager)if(this.Co)G.info("Already initializing surveys, skipping...");else if(this.Rt.disable_surveys)G.info(Qc);else if(this.Rt.cookieless_mode&&this._instance.consent.isOptedOut())G.info("Not loading surveys in cookieless mode without consent.");else{var e=N?.__PosthogExtensions__;if(e){if(!R(this.Io)||this.Rt.advanced_enable_surveys){var t=this.Io||this.Rt.advanced_enable_surveys;this.Co=!0;try{var n=e.generateSurveys;if(n)return void this.xo(n,t);var r=e.loadExternalDependency;if(!r)return void this.To(Xo);r(this._instance,"surveys",(s=>{s||!e.generateSurveys?this.To("Could not load surveys script",s):this.xo(e.generateSurveys,t)}))}catch(s){throw this.To("Error initializing surveys",s),s}finally{this.Co=!1}}}else G.error("PostHog Extensions not found.")}}xo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Fm(this._instance),G.info("Surveys loaded successfully"),this.Ao({isLoaded:!0})}To(e,t){G.error(e,t),this.Ao({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.So.push(e),this._surveyManager&&this.Ao({isLoaded:!0}),()=>{this.So=this.So.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Rt.disable_surveys)return G.info(Qc),e([]);var n,r=this._instance.get_property(no);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.ko?this.ko.then((s=>{var{surveys:i,context:o}=s;return e(i,o)})):(typeof Promise<"u"&&(this.ko=new Promise((s=>{n=s}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Rt.token),method:"GET",timeout:this.Rt.surveys_request_timeout_ms,callback:s=>{var i;this.ko=null;var o=s.statusCode;if(o!==200||!s.json){var a="Surveys API could not be loaded, status: "+o;G.error(a);var c={isLoaded:!1,error:a};return e([],c),void(n==null||n({surveys:[],context:c}))}var l,u=s.json.surveys||[],d=u.filter((p=>(function(g){return!(!g.start_date||g.end_date)})(p)&&((function(g){var f;return!((f=g.conditions)==null||(f=f.events)==null||(f=f.values)==null||!f.length)})(p)||(function(g){var f;return!((f=g.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)})(p))));d.length>0&&((l=this._surveyEventReceiver)==null||l.register(d)),(i=this._instance.persistence)==null||i.register({[no]:u});var h={isLoaded:!0};e(u,h),n?.({surveys:u,context:h})}}))}Ao(e){for(var t of this.So)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){G.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!j(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);G.warn("init was not called")}Eo(e){var t=null;return this.getSurveys((n=>{var r;t=(r=n.find((s=>s.id===e)))!==null&&r!==void 0?r:null})),t}Ro(e){if(j(this._surveyManager))return{eligible:!1,reason:Oi};var t=typeof e=="string"?this.Eo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(j(this._surveyManager))return G.warn("init was not called"),{visible:!1,disabledReason:Oi};var t=this.Ro(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return j(this._surveyManager)?(G.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:Oi})):new Promise((n=>{this.getSurveys((r=>{var s,i=(s=r.find((a=>a.id===e)))!==null&&s!==void 0?s:null;if(i){var o=this.Ro(i);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,n){var r;if(j(this._surveyManager))G.warn("init was not called");else{var s=typeof e=="string"?this.Eo(e):e;if(s!=null&&s.id)if(vm.includes(s.type)){var i=P?.querySelector(t);if(i)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(G.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var o,a;G.info("Rendering survey "+s.id+" with delay of "+((o=s.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(s,i,n),G.info("Survey "+s.id+" rendered")}),1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,i,n);G.warn("Survey element not found")}else G.warn("Surveys of type "+s.type+" cannot be rendered in the app");else G.warn("Survey not found")}}displaySurvey(e,t){var n;if(j(this._surveyManager))G.warn("init was not called");else{var r=this.Eo(e);if(r){var s=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=O({},r,{appearance:O({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==uo.Popover&&t.initialResponses&&G.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var i=this.canRenderSurvey(r);if(!i.visible)return void G.warn("Survey is not eligible to be displayed: ",i.disabledReason)}t.displayType!==uo.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else G.warn("Survey not found")}}cancelPendingSurvey(e){j(this._surveyManager)?G.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},qs),Ym={toolbar:class{constructor(e){this.instance=e}No(e){N.ph_toolbar_state=e}Mo(){var e;return(e=N.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),Mu(this.instance.config)||!m||!P)return!1;e=e??m.location,n=n??m.history;try{if(!t){try{m.localStorage.setItem("test","test"),m.localStorage.removeItem("test")}catch{return!1}t=m?.localStorage}var r,s=jm||_s(e.hash,"__posthog")||_s(e.hash,"state"),i=s?fc((()=>JSON.parse(atob(decodeURIComponent(s)))))||fc((()=>JSON.parse(decodeURIComponent(s)))):null;return i&&i.action==="ph_authorize"?((r=i).source="url",r&&Object.keys(r).length>0&&(i.desiredHash?e.hash=i.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(el)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Fo(e){var t=N.ph_load_toolbar||N.ph_load_editor;!j(t)&&ut(t)?t(e,this.instance):tl.warn("No toolbar load function found")}loadToolbar(e){var t=!(P==null||!P.getElementById(Lu));if(!m||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=O({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(m.localStorage.setItem(el,JSON.stringify(O({},r,{source:void 0}))),this.Mo()===2)this.Fo(r);else if(this.Mo()===0){var s;this.No(1),(s=N.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",(i=>{if(i)return tl.error("[Toolbar] Failed to load",i),void this.No(0);this.No(2),this.Fo(r)})),ie(m,"turbolinks:load",(()=>{this.No(0),this.loadToolbar(r)}))}return!0}Oo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},Km=O({experiments:ge},qs),Xm={conversations:class{constructor(e){this.Po=void 0,this._conversationsManager=null,this.Lo=!1,this.Do=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;j(t)||(rt(t)?this.Po=t:(this.Po=t.enabled,this.Do=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Po=void 0,this.Do=null}loadIfEnabled(){if(!(this._conversationsManager||this.Lo||this._instance.config.disable_conversations||Mu(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=N?.__PosthogExtensions__;if(e&&!R(this.Po)&&this.Po)if(this.Do&&this.Do.token){this.Lo=!0;try{var t=e.initConversations;if(t)return this.Bo(t),void(this.Lo=!1);var n=e.loadExternalDependency;if(!n)return void this.jo(Xo);n(this._instance,"conversations",(r=>{r||!e.initConversations?this.jo("Could not load conversations script",r):this.Bo(e.initConversations),this.Lo=!1}))}catch(r){this.jo("Error initializing conversations",r),this.Lo=!1}}else Ne.error("Conversations enabled but missing token in remote config.")}}Bo(e){if(this.Do)try{this._conversationsManager=e(this.Do,this._instance),Ne.info("Conversations loaded successfully")}catch(t){this.jo("Error completing conversations initialization",t)}else Ne.error("Cannot complete initialization: remote config is null")}jo(e,t){Ne.error(e,t),this._conversationsManager=null,this.Lo=!1}show(){this._conversationsManager?this._conversationsManager.show():Ne.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Po===!0&&!pt(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return He((function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(Ne.warn(Dt),null)}))()}getMessages(e,t){var n=this;return He((function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(Ne.warn(Dt),null)}))()}markAsRead(e){var t=this;return He((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Ne.warn(Dt),null)}))()}getTickets(e){var t=this;return He((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Ne.warn(Dt),null)}))()}requestRestoreLink(e){var t=this;return He((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Ne.warn(Dt),null)}))()}restoreFromToken(e){var t=this;return He((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Ne.warn(Dt),null)}))()}restoreFromUrlToken(){var e=this;return He((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Ne.warn(Dt),null)}))()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}Kr(){var e;(e=this._conversationsManager)==null||e.setIdentity()}Qr(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},Qm={logs:class{constructor(e){var t;this.qo=!1,this.Zo=!1,this.qt=X("[logs]"),this.$o=[],this.Vo=0,this.Ho=0,this.zo=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.qo=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!j(n)&&n&&(this.qo=!0,this.loadIfEnabled())}reset(){this.$o=[],this.Ni&&(clearTimeout(this.Ni),this.Ni=void 0),this.Vo=0,this.Ho=0,this.zo=!1}loadIfEnabled(){if(this.qo&&!this.Zo){var e=N?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(n=>{var r;n||(r=e.logs)==null||!r.initializeLogs?this.qt.error("Could not load logs script",n):(e.logs.initializeLogs(this._instance),this.Zo=!0)})):this.qt.error(Xo)}else this.qt.error("PostHog Extensions not found.")}}captureLog(e){var t,n,r,s,i,o;if(this._instance.is_capturing())if(e&&e.body){var a=(t=(n=this._instance.config.logs)==null?void 0:n.flushIntervalMs)!==null&&t!==void 0?t:3e3,c=(r=(s=this._instance.config.logs)==null?void 0:s.maxLogsPerInterval)!==null&&r!==void 0?r:1e3,l=Date.now();if(a>l-this.Ho||(this.Ho=l,this.Vo=0,this.zo=!1),c>this.Vo){this.Vo++;var u=(function(d,h){var p=d.level||"info",{text:g,number:f}=pd[p]||Zm,v=String(Date.now())+"000000",E={};h.distinctId&&(E.posthogDistinctId=h.distinctId),h.sessionId&&(E.sessionId=h.sessionId),h.currentUrl&&(E["url.full"]=h.currentUrl),h.activeFeatureFlags&&h.activeFeatureFlags.length>0&&(E.feature_flags=h.activeFeatureFlags);var I=O({},E,d.attributes||{}),S={timeUnixNano:v,observedTimeUnixNano:v,severityNumber:f,severityText:g,body:{stringValue:d.body},attributes:al(I)};return d.trace_id&&(S.traceId=d.trace_id),d.span_id&&(S.spanId=d.span_id),R(d.trace_flags)||(S.flags=d.trace_flags),S})(e,this.Uo());this.$o.push({record:u}),((i=(o=this._instance.config.logs)==null?void 0:o.maxBufferSize)!==null&&i!==void 0?i:100)>this.$o.length?this.Yo():this.flushLogs()}else this.zo||(this.qt.warn("captureLog dropping logs: exceeded "+c+" logs per "+a+"ms"),this.zo=!0)}else this.qt.warn("captureLog requires a body")}get logger(){return this.Go||(this.Go={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Go}flushLogs(e){if(this.Ni&&(clearTimeout(this.Ni),this.Ni=void 0),this.$o.length!==0){var t=this.$o;this.$o=[];var n=this._instance.config.logs,r=O({"service.name":n?.serviceName||"unknown_service"},n?.environment&&{"deployment.environment":n.environment},n?.serviceVersion&&{"service.version":n.serviceVersion},n?.resourceAttributes),s=(function(o,a){return{resourceLogs:[{resource:{attributes:al(a)},scopeLogs:[{scope:{name:we.LIB_NAME},logRecords:o}]}]}})(t.map((o=>o.record)),r),i=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Pr({method:"POST",url:i,data:s,compression:"best-available",batchKey:"logs",transport:e})}}Yo(){var e,t;this.Ni||(this.Ni=setTimeout((()=>{this.Ni=void 0,this.flushLogs()}),(e=(t=this._instance.config.logs)==null?void 0:t.flushIntervalMs)!==null&&e!==void 0?e:3e3))}Uo(){var e,t={lib:we.LIB_NAME};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(N!=null&&(e=N.location)!=null&&e.href&&(t.currentUrl=N.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}},e_=O({},qs,qm,Bm,Hm,Vm,Gm,Jm,Wm,Ym,Km,Xm,Qm);Me.__defaultExtensionClasses=O({},e_);var cl,t_=(cl=ur[dn]=new Me,(function(){function e(){e.done||(e.done=!0,sd=!1,Y(ur,(function(t){t._dom_loaded()})))}P!=null&&P.addEventListener?P.readyState==="complete"?e():ie(P,"DOMContentLoaded",e,{capture:!1}):m&&x.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),cl);function gd(e){if(!(e instanceof Ip))return!1;const t=e.data;return typeof t=="object"&&t!==null&&t.kind==="forbidden"}const n_="2026-08-19",r_="https://docs.claude.com/en/docs/mcp",s_=["directory","verification","submission","review-criteria","authentication","lazy-authentication","enterprise-managed-auth","troubleshooting","mcp-apps/cross-compatibility","mcp-apps/external-links","mcp-apps/troubleshooting","mcp-apps/design-guidelines"],i_={},o_=s_.map(e=>({page:e,url:`${r_}/${e}`,revision:i_[e]??null,snapshotDate:n_})),a_=Object.freeze(Object.fromEntries(o_.map(e=>[e.page,e])));function St(e,t){const n=a_[e];return{page:n.page,section:t,url:n.url,revision:n.revision,snapshotDate:n.snapshotDate}}St("review-criteria","§Tool quality"),St("review-criteria","§Tool quality"),St("review-criteria","§Usefulness"),St("authentication","§Consent"),St("submission","§Listing"),St("review-criteria","§Safety"),St("mcp-apps/design-guidelines","§Content");const ll="2026-08-19",ul="https://developers.openai.com/plugins",md=["quickstart","app-guidelines","reference","changelog","plan/use-case","plan/tools","concepts/plugins","concepts/skills","concepts/ui-guidelines","build/plugins","build/skills","build/mcp-server","build/chatgpt-ui","build/auth","build/monetization","build/examples","deploy/connect-chatgpt","deploy/submission","deploy/submission-errors","deploy/troubleshooting","guides/optimize-metadata","guides/submit-claude-plugin","guides/product-checkout-conversion-spec"],_d=[{page:"help/plugins-in-chatgpt-and-codex",url:"https://help.openai.com/en/articles/20001256-plugins-in-chatgpt-and-codex"},{page:"help/submitting-apps-to-the-chatgpt-app-directory",url:"https://help.openai.com/en/articles/20001040-submitting-apps-to-the-chatgpt-app-directory"}];[...md,..._d.map(e=>e.page)];const dl={},c_=[...md.map(e=>({page:e,url:`${ul}/${e}`,revisionUrl:`${ul}/${e}.md`,format:"markdown",revision:dl[e]??null,snapshotDate:ll})),..._d.map(e=>({page:e.page,url:e.url,revisionUrl:e.url,format:"html",revision:dl[e.page]??null,snapshotDate:ll}))],l_=Object.freeze(Object.fromEntries(c_.map(e=>[e.page,e])));function Ke(e,t){const n=l_[e];return{page:n.page,section:t,url:n.url,revision:n.revision,snapshotDate:n.snapshotDate}}Ke("guides/optimize-metadata","§Tool descriptions"),Ke("plan/tools","§Naming"),Ke("plan/tools","§Naming"),Ke("app-guidelines","§Listing quality"),Ke("app-guidelines","§Listing quality"),Ke("app-guidelines","§Listing quality"),Ke("app-guidelines","§Predictable side effects"),Ke("build/auth","§Consent");const Ft={nameMaxLength:100,taglineMaxLength:55,descriptionMaxLength:2e3,categoriesMin:1,categoriesMax:5,screenshotsMin:3,screenshotsMax:5};St("directory","Host profile constants");function _(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=o.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){const h=u[d];h in a||(a[h]=l[h].bind(a))}}const s=n?.Parent??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function o(a){var c;const l=n?.Parent?new i:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class kn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vd extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const yd={};function $t(e){return yd}function bd(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function So(e,t){return typeof t=="bigint"?t.toString():t}function Bs(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ia(e){return e==null}function oa(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function u_(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c?.[1]&&(s=Number.parseInt(c[1]))}const i=n>s?n:s,o=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return o%a/10**i}const hl=Symbol("evaluating");function U(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==hl)return r===void 0&&(r=hl,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Qt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Nt(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function pl(e){return JSON.stringify(e)}function d_(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const wd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function yr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const h_=Bs(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Nn(e){if(yr(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(yr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Sd(e){return Nn(e)?{...e}:Array.isArray(e)?[...e]:e}const p_=new Set(["string","number","symbol"]);function Ln(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ft(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function C(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function f_(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const g_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function m_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i=Nt(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return Qt(this,"shape",o),o},checks:[]});return ft(e,i)}function __(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=Nt(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Qt(this,"shape",o),o},checks:[]});return ft(e,i)}function v_(e,t){if(!Nn(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(i,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Nt(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Qt(this,"shape",i),i}});return ft(e,s)}function y_(e,t){if(!Nn(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Nt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Qt(this,"shape",r),r}});return ft(e,n)}function b_(e,t){const n=Nt(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Qt(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ft(e,n)}function w_(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Nt(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return Qt(this,"shape",c),c},checks:[]});return ft(t,o)}function S_(e,t,n){const r=Nt(t._zod.def,{get shape(){const s=t._zod.def.shape,i={...s};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(i[o]=new e({type:"nonoptional",innerType:s[o]}))}else for(const o in s)i[o]=new e({type:"nonoptional",innerType:s[o]});return Qt(this,"shape",i),i}});return ft(t,r)}function mn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Bt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Zr(e){return typeof e=="string"?e:e?.message}function Rt(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=Zr(e.inst?._zod.def?.error?.(e))??Zr(t?.error?.(e))??Zr(n.customError?.(e))??Zr(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function aa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function br(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Ed=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,So,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kd=_("$ZodError",Ed),Td=_("$ZodError",Ed,{Parent:Error});function E_(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function k_(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(o=>r({issues:o}));else if(i.code==="invalid_key")r({issues:i.issues});else if(i.code==="invalid_element")r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let o=n,a=0;for(;a<i.path.length;){const c=i.path[a];a===i.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(i))):o[c]=o[c]||{_errors:[]},o=o[c],a++}}};return r(e),n}const ca=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new kn;if(o.issues.length){const a=new(s?.Err??e)(o.issues.map(c=>Rt(c,i,$t())));throw wd(a,s?.callee),a}return o.value},la=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(s?.Err??e)(o.issues.map(c=>Rt(c,i,$t())));throw wd(a,s?.callee),a}return o.value},Hs=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new kn;return i.issues.length?{success:!1,error:new(e??kd)(i.issues.map(o=>Rt(o,s,$t())))}:{success:!0,data:i.value}},T_=Hs(Td),Vs=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(o=>Rt(o,s,$t())))}:{success:!0,data:i.value}},O_=Vs(Td),I_=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ca(e)(t,n,s)},A_=e=>(t,n,r)=>ca(e)(t,n,r),P_=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return la(e)(t,n,s)},x_=e=>async(t,n,r)=>la(e)(t,n,r),$_=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Hs(e)(t,n,s)},R_=e=>(t,n,r)=>Hs(e)(t,n,r),C_=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Vs(e)(t,n,s)},N_=e=>async(t,n,r)=>Vs(e)(t,n,r),L_=/^[cC][^\s-]{8,}$/,M_=/^[0-9a-z]+$/,z_=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,D_=/^[0-9a-vA-V]{20}$/,F_=/^[A-Za-z0-9]{27}$/,j_=/^[a-zA-Z0-9_-]{21}$/,U_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Z_=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,q_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,B_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function H_(){return new RegExp(B_,"u")}const V_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,G_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,W_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,J_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Y_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Od=/^[A-Za-z0-9_-]*$/,K_=/^\+[1-9]\d{6,14}$/,Id="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",X_=new RegExp(`^${Id}$`);function Ad(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Q_(e){return new RegExp(`^${Ad(e)}$`)}function ev(e){const t=Ad({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Id}T(?:${r})$`)}const tv=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},nv=/^-?\d+$/,Pd=/^-?\d+(?:\.\d+)?$/,rv=/^(?:true|false)$/i,sv=/^null$/i,iv=/^undefined$/i,ov=/^[^A-Z]*$/,av=/^[^a-z]*$/,Oe=_("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),xd={number:"number",bigint:"bigint",object:"date"},$d=_("$ZodCheckLessThan",(e,t)=>{Oe.init(e,t);const n=xd[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rd=_("$ZodCheckGreaterThan",(e,t)=>{Oe.init(e,t);const n=xd[typeof t.value];e._zod.onattach.push(r=>{const s=r._zod.bag,i=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cv=_("$ZodCheckMultipleOf",(e,t)=>{Oe.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):u_(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),lv=_("$ZodCheckNumberFormat",(e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=g_[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=s,a.maximum=i,n&&(a.pattern=nv)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),uv=_("$ZodCheckMaxLength",(e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ia(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const o=aa(s);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),dv=_("$ZodCheckMinLength",(e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ia(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const o=aa(s);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),hv=_("$ZodCheckLengthEquals",(e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!ia(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,i=s.length;if(i===t.length)return;const o=aa(s),a=i>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Gs=_("$ZodCheckStringFormat",(e,t)=>{var n,r;Oe.init(e,t),e._zod.onattach.push(s=>{const i=s._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),pv=_("$ZodCheckRegex",(e,t)=>{Gs.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fv=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ov),Gs.init(e,t)}),gv=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=av),Gs.init(e,t)}),mv=_("$ZodCheckIncludes",(e,t)=>{Oe.init(e,t);const n=Ln(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),_v=_("$ZodCheckStartsWith",(e,t)=>{Oe.init(e,t);const n=new RegExp(`^${Ln(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),vv=_("$ZodCheckEndsWith",(e,t)=>{Oe.init(e,t);const n=new RegExp(`.*${Ln(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),yv=_("$ZodCheckOverwrite",(e,t)=>{Oe.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class bv{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
4
|
+
`).filter(o=>o),s=Math.min(...r.map(o=>o.length-o.trimStart().length)),i=r.map(o=>o.slice(s)).map(o=>" ".repeat(this.indent*2)+o);for(const o of i)this.content.push(o)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,s.join(`
|
|
5
|
+
`))}}const wv={major:4,minor:3,patch:6},H=_("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wv;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const i of s._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(o,a,c)=>{let l=mn(o),u;for(const d of a){if(d._zod.def.when){if(!d._zod.def.when(o))continue}else if(l)continue;const h=o.issues.length,p=d._zod.check(o);if(p instanceof Promise&&c?.async===!1)throw new kn;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,o.issues.length!==h&&(l||(l=mn(o,h)))});else{if(o.issues.length===h)continue;l||(l=mn(o,h))}}return u?u.then(()=>o):o},i=(o,a,c)=>{if(mn(o))return o.aborted=!0,o;const l=s(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new kn;return l.then(u=>e._zod.parse(u,c))}return e._zod.parse(l,c)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const l=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>i(u,o,a)):i(l,o,a)}const c=e._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new kn;return c.then(l=>s(l,r,a))}return s(c,r,a)}}U(e,"~standard",()=>({validate:s=>{try{const i=T_(e,s);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return O_(e,s).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ua=_("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??tv(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Q=_("$ZodStringFormat",(e,t)=>{Gs.init(e,t),ua.init(e,t)}),Sv=_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Z_),Q.init(e,t)}),Ev=_("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=fl(r))}else t.pattern??(t.pattern=fl());Q.init(e,t)}),kv=_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=q_),Q.init(e,t)}),Tv=_("$ZodURL",(e,t)=>{Q.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ov=_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=H_()),Q.init(e,t)}),Iv=_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=j_),Q.init(e,t)}),Av=_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=L_),Q.init(e,t)}),Pv=_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=M_),Q.init(e,t)}),xv=_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=z_),Q.init(e,t)}),$v=_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=D_),Q.init(e,t)}),Rv=_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=F_),Q.init(e,t)}),Cv=_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ev(t)),Q.init(e,t)}),Nv=_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=X_),Q.init(e,t)}),Lv=_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Q_(t)),Q.init(e,t)}),Mv=_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=U_),Q.init(e,t)}),zv=_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=V_),Q.init(e,t),e._zod.bag.format="ipv4"}),Dv=_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=G_),Q.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Fv=_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=W_),Q.init(e,t)}),jv=_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=J_),Q.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,i]=r;if(!i)throw new Error;const o=Number(i);if(`${o}`!==i)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Cd(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Uv=_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Y_),Q.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Cd(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Zv(e){if(!Od.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Cd(n)}const qv=_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Od),Q.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Zv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Bv=_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=K_),Q.init(e,t)});function Hv(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Vv=_("$ZodJWT",(e,t)=>{Q.init(e,t),e._zod.check=n=>{Hv(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Nd=_("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??Pd,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Gv=_("$ZodNumberFormat",(e,t)=>{lv.init(e,t),Nd.init(e,t)}),Wv=_("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=rv,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Jv=_("$ZodUndefined",(e,t)=>{H.init(e,t),e._zod.pattern=iv,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,r)=>{const s=n.value;return typeof s>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:s,inst:e}),n}}),Yv=_("$ZodNull",(e,t)=>{H.init(e,t),e._zod.pattern=sv,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const s=n.value;return s===null||n.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),n}}),Kv=_("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=n=>n}),Xv=_("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=n=>n}),Qv=_("$ZodNever",(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function gl(e,t,n){e.issues.length&&t.issues.push(...Bt(n,e.issues)),t.value[n]=e.value}const ey=_("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let o=0;o<s.length;o++){const a=s[o],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?i.push(c.then(l=>gl(l,n,o))):gl(c,n,o)}return i.length?Promise.all(i).then(()=>n):n}});function Ss(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...Bt(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Ld(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=f_(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Md(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,l=c.def.type,u=c.optout==="optional";for(const d in t){if(a.has(d))continue;if(l==="never"){o.push(d);continue}const h=c.run({value:t[d],issues:[]},r);h instanceof Promise?e.push(h.then(p=>Ss(p,n,d,t,u))):Ss(h,n,d,t,u)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const ty=_("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Bs(()=>Ld(t));U(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const d of u.values)c[l].add(d)}}return c});const s=yr,i=t.catchall;let o;e._zod.parse=(a,c)=>{o??(o=r.value);const l=a.value;if(!s(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const u=[],d=o.shape;for(const h of o.keys){const p=d[h],g=p._zod.optout==="optional",f=p._zod.run({value:l[h],issues:[]},c);f instanceof Promise?u.push(f.then(v=>Ss(v,a,h,l,g))):Ss(f,a,h,l,g)}return i?Md(u,l,a,c,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),ny=_("$ZodObjectJIT",(e,t)=>{ty.init(e,t);const n=e._zod.parse,r=Bs(()=>Ld(t)),s=h=>{const p=new bv(["shape","payload","ctx"]),g=r.value,f=S=>{const w=pl(S);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};p.write("const input = payload.value;");const v=Object.create(null);let E=0;for(const S of g.keys)v[S]=`key_${E++}`;p.write("const newResult = {};");for(const S of g.keys){const w=v[S],y=pl(S),k=h[S]?._zod?.optout==="optional";p.write(`const ${w} = ${f(S)};`),k?p.write(`
|
|
6
|
+
if (${w}.issues.length) {
|
|
7
|
+
if (${y} in input) {
|
|
8
|
+
payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
|
|
9
|
+
...iss,
|
|
10
|
+
path: iss.path ? [${y}, ...iss.path] : [${y}]
|
|
11
|
+
})));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (${w}.value === undefined) {
|
|
16
|
+
if (${y} in input) {
|
|
17
|
+
newResult[${y}] = undefined;
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
newResult[${y}] = ${w}.value;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
`):p.write(`
|
|
24
|
+
if (${w}.issues.length) {
|
|
25
|
+
payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
|
|
26
|
+
...iss,
|
|
27
|
+
path: iss.path ? [${y}, ...iss.path] : [${y}]
|
|
28
|
+
})));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (${w}.value === undefined) {
|
|
32
|
+
if (${y} in input) {
|
|
33
|
+
newResult[${y}] = undefined;
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
newResult[${y}] = ${w}.value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");const I=p.compile();return(S,w)=>I(h,S,w)};let i;const o=yr,a=!yd.jitless,l=a&&h_.value,u=t.catchall;let d;e._zod.parse=(h,p)=>{d??(d=r.value);const g=h.value;return o(g)?a&&l&&p?.async===!1&&p.jitless!==!0?(i||(i=s(t.shape)),h=i(h,p),u?Md([],g,h,p,d,e):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),h)}});function ml(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!mn(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>Rt(o,r,$t())))}),t)}const zd=_("$ZodUnion",(e,t)=>{H.init(e,t),U(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),U(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),U(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),U(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>oa(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const c of t.options){const l=c._zod.run({value:s.value,issues:[]},i);if(l instanceof Promise)a.push(l),o=!0;else{if(l.issues.length===0)return l;a.push(l)}}return o?Promise.all(a).then(c=>ml(c,s,e,i)):ml(a,s,e,i)}}),ry=_("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,zd.init(e,t);const n=e._zod.parse;U(e._zod,"propValues",()=>{const s={};for(const i of t.options){const o=i._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[a,c]of Object.entries(o)){s[a]||(s[a]=new Set);for(const l of c)s[a].add(l)}}return s});const r=Bs(()=>{const s=t.options,i=new Map;for(const o of s){const a=o._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,o)}}return i});e._zod.parse=(s,i)=>{const o=s.value;if(!yr(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const a=r.value.get(o?.[t.discriminator]);return a?a._zod.run(s,i):t.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),sy=_("$ZodIntersection",(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([c,l])=>_l(n,c,l)):_l(n,i,o)}});function Eo(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Nn(e)&&Nn(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of r){const o=Eo(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=Eo(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _l(e,t,n){const r=new Map;let s;for(const a of t.issues)if(a.code==="unrecognized_keys"){s??(s=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const i=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&s&&e.issues.push({...s,keys:i}),mn(e))return e;const o=Eo(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const iy=_("$ZodTuple",(e,t)=>{H.init(e,t);const n=t.items;e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const o=[],a=[...n].reverse().findIndex(u=>u._zod.optin!=="optional"),c=a===-1?0:n.length-a;if(!t.rest){const u=i.length>n.length,d=i.length<c-1;if(u||d)return r.issues.push({...u?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let l=-1;for(const u of n){if(l++,l>=i.length&&l>=c)continue;const d=u._zod.run({value:i[l],issues:[]},s);d instanceof Promise?o.push(d.then(h=>qr(h,r,l))):qr(d,r,l)}if(t.rest){const u=i.slice(n.length);for(const d of u){l++;const h=t.rest._zod.run({value:d,issues:[]},s);h instanceof Promise?o.push(h.then(p=>qr(p,r,l))):qr(h,r,l)}}return o.length?Promise.all(o).then(()=>r):r}});function qr(e,t,n){e.issues.length&&t.issues.push(...Bt(n,e.issues)),t.value[n]=e.value}const oy=_("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Nn(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);const u=t.valueType._zod.run({value:s[l],issues:[]},r);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&n.issues.push(...Bt(l,d.issues)),n.value[l]=d.value})):(u.issues.length&&n.issues.push(...Bt(l,u.issues)),n.value[l]=u.value)}let c;for(const l in s)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(s)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Pd.test(a)&&c.issues.length){const d=t.keyType._zod.run({value:Number(a),issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){t.mode==="loose"?n.value[a]=s[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Rt(d,r,$t())),input:a,path:[a],inst:e});continue}const u=t.valueType._zod.run({value:s[a],issues:[]},r);u instanceof Promise?i.push(u.then(d=>{d.issues.length&&n.issues.push(...Bt(a,d.issues)),n.value[c.value]=d.value})):(u.issues.length&&n.issues.push(...Bt(a,u.issues)),n.value[c.value]=u.value)}}return i.length?Promise.all(i).then(()=>n):n}}),ay=_("$ZodEnum",(e,t)=>{H.init(e,t);const n=bd(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>p_.has(typeof s)).map(s=>typeof s=="string"?Ln(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),cy=_("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Ln(r):r?Ln(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),ly=_("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new vd(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new kn;return n.value=s,n}});function vl(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Dd=_("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",U(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),U(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oa(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>vl(i,n.value)):vl(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),uy=_("$ZodExactOptional",(e,t)=>{Dd.init(e,t),U(e._zod,"values",()=>t.innerType._zod.values),U(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),dy=_("$ZodNullable",(e,t)=>{H.init(e,t),U(e._zod,"optin",()=>t.innerType._zod.optin),U(e._zod,"optout",()=>t.innerType._zod.optout),U(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${oa(n.source)}|null)$`):void 0}),U(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),hy=_("$ZodDefault",(e,t)=>{H.init(e,t),e._zod.optin="optional",U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>yl(i,t)):yl(s,t)}});function yl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const py=_("$ZodPrefault",(e,t)=>{H.init(e,t),e._zod.optin="optional",U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),fy=_("$ZodNonOptional",(e,t)=>{H.init(e,t),U(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>bl(i,e)):bl(s,e)}});function bl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const gy=_("$ZodCatch",(e,t)=>{H.init(e,t),U(e._zod,"optin",()=>t.innerType._zod.optin),U(e._zod,"optout",()=>t.innerType._zod.optout),U(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Rt(o,r,$t()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Rt(i,r,$t()))},input:n.value}),n.issues=[]),n)}}),my=_("$ZodPipe",(e,t)=>{H.init(e,t),U(e._zod,"values",()=>t.in._zod.values),U(e._zod,"optin",()=>t.in._zod.optin),U(e._zod,"optout",()=>t.out._zod.optout),U(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Br(o,t.in,r)):Br(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>Br(i,t.out,r)):Br(s,t.out,r)}});function Br(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const _y=_("$ZodReadonly",(e,t)=>{H.init(e,t),U(e._zod,"propValues",()=>t.innerType._zod.propValues),U(e._zod,"values",()=>t.innerType._zod.values),U(e._zod,"optin",()=>t.innerType?._zod?.optin),U(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(wl):wl(s)}});function wl(e){return e.value=Object.freeze(e.value),e}const vy=_("$ZodLazy",(e,t)=>{H.init(e,t),U(e._zod,"innerType",()=>t.getter()),U(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),U(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),U(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),U(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),yy=_("$ZodCustom",(e,t)=>{Oe.init(e,t),H.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>Sl(i,n,r,e));Sl(s,n,r,e)}});function Sl(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(br(s))}}var El;class by{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function wy(){return new by}(El=globalThis).__zod_globalRegistry??(El.__zod_globalRegistry=wy());const tr=globalThis.__zod_globalRegistry;function Sy(e,t){return new e({type:"string",...C(t)})}function Ey(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...C(t)})}function kl(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...C(t)})}function ky(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...C(t)})}function Ty(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(t)})}function Oy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(t)})}function Iy(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(t)})}function Ay(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...C(t)})}function Py(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...C(t)})}function xy(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(t)})}function $y(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...C(t)})}function Ry(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(t)})}function Cy(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...C(t)})}function Ny(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...C(t)})}function Ly(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(t)})}function My(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(t)})}function zy(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(t)})}function Dy(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(t)})}function Fy(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(t)})}function jy(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...C(t)})}function Uy(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...C(t)})}function Zy(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...C(t)})}function qy(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...C(t)})}function By(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(t)})}function Hy(e,t){return new e({type:"string",format:"date",check:"string_format",...C(t)})}function Vy(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...C(t)})}function Gy(e,t){return new e({type:"string",format:"duration",check:"string_format",...C(t)})}function Wy(e,t){return new e({type:"number",checks:[],...C(t)})}function Jy(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...C(t)})}function Yy(e,t){return new e({type:"boolean",...C(t)})}function Ky(e,t){return new e({type:"undefined",...C(t)})}function Xy(e,t){return new e({type:"null",...C(t)})}function Qy(e){return new e({type:"any"})}function eb(e){return new e({type:"unknown"})}function tb(e,t){return new e({type:"never",...C(t)})}function Tl(e,t){return new $d({check:"less_than",...C(t),value:e,inclusive:!1})}function xi(e,t){return new $d({check:"less_than",...C(t),value:e,inclusive:!0})}function Ol(e,t){return new Rd({check:"greater_than",...C(t),value:e,inclusive:!1})}function $i(e,t){return new Rd({check:"greater_than",...C(t),value:e,inclusive:!0})}function Il(e,t){return new cv({check:"multiple_of",...C(t),value:e})}function Fd(e,t){return new uv({check:"max_length",...C(t),maximum:e})}function Es(e,t){return new dv({check:"min_length",...C(t),minimum:e})}function jd(e,t){return new hv({check:"length_equals",...C(t),length:e})}function nb(e,t){return new pv({check:"string_format",format:"regex",...C(t),pattern:e})}function rb(e){return new fv({check:"string_format",format:"lowercase",...C(e)})}function sb(e){return new gv({check:"string_format",format:"uppercase",...C(e)})}function ib(e,t){return new mv({check:"string_format",format:"includes",...C(t),includes:e})}function ob(e,t){return new _v({check:"string_format",format:"starts_with",...C(t),prefix:e})}function ab(e,t){return new vv({check:"string_format",format:"ends_with",...C(t),suffix:e})}function zn(e){return new yv({check:"overwrite",tx:e})}function cb(e){return zn(t=>t.normalize(e))}function lb(){return zn(e=>e.trim())}function ub(){return zn(e=>e.toLowerCase())}function db(){return zn(e=>e.toUpperCase())}function hb(){return zn(e=>d_(e))}function pb(e,t,n){return new e({type:"array",element:t,...C(n)})}function fb(e,t,n){const r=C(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function gb(e,t,n){return new e({type:"custom",check:"custom",fn:t,...C(n)})}function mb(e){const t=_b(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(br(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(br(s))}},e(n.value,n)));return t}function _b(e,t){const n=new Oe({check:"custom",...C(t)});return n._zod.check=e,n}function ks(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??tr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function J(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,u);else{const h=o.schema,p=t.processors[s.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);p(e,t,h,u)}const d=e._zod.parent;d&&(o.ref||(o.ref=d),J(d,t,u),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io==="input"&&be(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ts(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const c=r.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}const s=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(o[0])?.id,h=e.external.uri??(g=>g);if(d)return{ref:h(d)};const p=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=p,{defId:p,ref:`${h("__shared")}#/${a}/${p}`}}if(o[1]===n)return{ref:"#"};const l=`#/${a}/`,u=o[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:c,defId:l}=s(o);a.def={...a.schema},l&&(a.defId=l);const u=a.schema;for(const d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
40
|
+
|
|
41
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){i(o);continue}if(e.external){const l=e.external.registry.get(o[0])?.id;if(t!==o[0]&&l){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(a.cycle){i(o);continue}if(a.count>1&&e.reused==="ref"){i(o);continue}}}function Os(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const a=e.seen.get(o);if(a.ref===null)return;const c=a.def??a.schema,l={...c},u=a.ref;if(a.ref=null,u){r(u);const h=e.seen.get(u),p=h.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,l),o._zod.parent===u)for(const f in c)f==="$ref"||f==="allOf"||f in l||delete c[f];if(p.$ref&&h.def)for(const f in c)f==="$ref"||f==="allOf"||f in h.def&&JSON.stringify(c[f])===JSON.stringify(h.def[f])&&delete c[f]}const d=o._zod.parent;if(d&&d!==u){r(d);const h=e.seen.get(d);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const p in c)p==="$ref"||p==="allOf"||p in h.def&&JSON.stringify(c[p])===JSON.stringify(h.def[p])&&delete c[p]}e.override({zodSchema:o,jsonSchema:c,path:a.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const o of e.seen.entries()){const a=o[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Is(t,"input",e.processors),output:Is(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function be(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return be(r.element,n);if(r.type==="set")return be(r.valueType,n);if(r.type==="lazy")return be(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return be(r.innerType,n);if(r.type==="intersection")return be(r.left,n)||be(r.right,n);if(r.type==="record"||r.type==="map")return be(r.keyType,n)||be(r.valueType,n);if(r.type==="pipe")return be(r.in,n)||be(r.out,n);if(r.type==="object"){for(const s in r.shape)if(be(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(be(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(be(s,n))return!0;return!!(r.rest&&be(r.rest,n))}return!1}const vb=(e,t={})=>n=>{const r=ks({...n,processors:t});return J(e,r),Ts(r,e),Os(r,e)},Is=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=ks({...s??{},target:i,io:t,processors:n});return J(e,o),Ts(o,e),Os(o,e)},yb={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ud=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),a&&(s.format=yb[a]??a,s.format===""&&delete s.format,a==="time"&&delete s.format),l&&(s.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?s.pattern=u[0].source:u.length>1&&(s.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Zd=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?s.type="integer":s.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=u,s.exclusiveMinimum=!0):s.exclusiveMinimum=u),typeof i=="number"&&(s.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete s.minimum:delete s.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=l,s.exclusiveMaximum=!0):s.exclusiveMaximum=l),typeof o=="number"&&(s.maximum=o,typeof l=="number"&&t.target!=="draft-04"&&(l<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof c=="number"&&(s.multipleOf=c)},qd=(e,t,n,r)=>{n.type="boolean"},bb=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},wb=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Bd=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Hd=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Sb=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Vd=(e,t,n,r)=>{n.not={}},Gd=(e,t,n,r)=>{},Wd=(e,t,n,r)=>{},Eb=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Jd=(e,t,n,r)=>{const s=e._zod.def,i=bd(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},Yd=(e,t,n,r)=>{const s=e._zod.def,i=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},kb=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Tb=(e,t,n,r)=>{const s=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");s.type="string",s.pattern=i.source},Ob=(e,t,n,r)=>{const s=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:c}=e._zod.bag;o!==void 0&&(i.minLength=o),a!==void 0&&(i.maxLength=a),c?c.length===1?(i.contentMediaType=c[0],Object.assign(s,i)):(Object.assign(s,i),s.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(s,i)},Ib=(e,t,n,r)=>{n.type="boolean"},Kd=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ab=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Xd=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Pb=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},xb=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Qd=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof a=="number"&&(s.maxItems=a),s.type="array",s.items=J(i.element,t,{...r,path:[...r.path,"items"]})},eh=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const l in o)s.properties[l]=J(o[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{const u=i.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(s.required=Array.from(c)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=J(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},th=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((a,c)=>J(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=o:n.anyOf=o},nh=(e,t,n,r)=>{const s=e._zod.def,i=J(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=J(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c},rh=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="array";const o=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((h,p)=>J(h,t,{...r,path:[...r.path,o,p]})),l=i.rest?J(i.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=c,l&&(s.items=l)):t.target==="openapi-3.0"?(s.items={anyOf:c},l&&s.items.anyOf.push(l),s.minItems=c.length,l||(s.maxItems=c.length)):(s.items=c,l&&(s.additionalItems=l));const{minimum:u,maximum:d}=e._zod.bag;typeof u=="number"&&(s.minItems=u),typeof d=="number"&&(s.maxItems=d)},sh=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,c=o._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){const u=J(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const d of c)s.patternProperties[d.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=J(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=J(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const l=o._zod.values;if(l){const u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(s.required=u)}},ih=(e,t,n,r)=>{const s=e._zod.def,i=J(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},oh=(e,t,n,r)=>{const s=e._zod.def;J(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},ah=(e,t,n,r)=>{const s=e._zod.def;J(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},ch=(e,t,n,r)=>{const s=e._zod.def;J(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},lh=(e,t,n,r)=>{const s=e._zod.def;J(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},uh=(e,t,n,r)=>{const s=e._zod.def,i=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;J(i,t,r);const o=t.seen.get(e);o.ref=i},dh=(e,t,n,r)=>{const s=e._zod.def;J(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},$b=(e,t,n,r)=>{const s=e._zod.def;J(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},da=(e,t,n,r)=>{const s=e._zod.def;J(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},hh=(e,t,n,r)=>{const s=e._zod.innerType;J(s,t,r);const i=t.seen.get(e);i.ref=s},Al={string:Ud,number:Zd,boolean:qd,bigint:bb,symbol:wb,null:Bd,undefined:Hd,void:Sb,never:Vd,any:Gd,unknown:Wd,date:Eb,enum:Jd,literal:Yd,nan:kb,template_literal:Tb,file:Ob,success:Ib,custom:Kd,function:Ab,transform:Xd,map:Pb,set:xb,array:Qd,object:eh,union:th,intersection:nh,tuple:rh,record:sh,nullable:ih,nonoptional:oh,default:ah,prefault:ch,catch:lh,pipe:uh,readonly:dh,promise:$b,optional:da,lazy:hh};function Mk(e,t){if("_idmap"in e){const r=e,s=ks({...t,processors:Al}),i={};for(const c of r._idmap.entries()){const[l,u]=c;J(u,s)}const o={},a={registry:r,uri:t?.uri,defs:i};s.external=a;for(const c of r._idmap.entries()){const[l,u]=c;Ts(s,u),o[l]=Os(s,u)}if(Object.keys(i).length>0){const c=s.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:i}}return{schemas:o}}const n=ks({...t,processors:Al});return J(e,n),Ts(n,e),Os(n,e)}const Rb=_("ZodISODateTime",(e,t)=>{Cv.init(e,t),te.init(e,t)});function Cb(e){return By(Rb,e)}const Nb=_("ZodISODate",(e,t)=>{Nv.init(e,t),te.init(e,t)});function Lb(e){return Hy(Nb,e)}const Mb=_("ZodISOTime",(e,t)=>{Lv.init(e,t),te.init(e,t)});function zb(e){return Vy(Mb,e)}const Db=_("ZodISODuration",(e,t)=>{Mv.init(e,t),te.init(e,t)});function Fb(e){return Gy(Db,e)}const jb=(e,t)=>{kd.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>k_(e,n)},flatten:{value:n=>E_(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,So,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,So,2)}},isEmpty:{get(){return e.issues.length===0}}})},Fe=_("ZodError",jb,{Parent:Error}),Ub=ca(Fe),Zb=la(Fe),qb=Hs(Fe),Bb=Vs(Fe),Hb=I_(Fe),Vb=A_(Fe),Gb=P_(Fe),Wb=x_(Fe),Jb=$_(Fe),Yb=R_(Fe),Kb=C_(Fe),Xb=N_(Fe),V=_("ZodType",(e,t)=>(H.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Is(e,"input"),output:Is(e,"output")}}),e.toJSONSchema=vb(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Nt(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>ft(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Ub(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>qb(e,n,r),e.parseAsync=async(n,r)=>Zb(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Bb(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Hb(e,n,r),e.decode=(n,r)=>Vb(e,n,r),e.encodeAsync=async(n,r)=>Gb(e,n,r),e.decodeAsync=async(n,r)=>Wb(e,n,r),e.safeEncode=(n,r)=>Jb(e,n,r),e.safeDecode=(n,r)=>Yb(e,n,r),e.safeEncodeAsync=async(n,r)=>Kb(e,n,r),e.safeDecodeAsync=async(n,r)=>Xb(e,n,r),e.refine=(n,r)=>e.check(Gw(n,r)),e.superRefine=n=>e.check(Ww(n)),e.overwrite=n=>e.check(zn(n)),e.optional=()=>$l(e),e.exactOptional=()=>Nw(e),e.nullable=()=>Rl(e),e.nullish=()=>$l(Rl(e)),e.nonoptional=n=>jw(e,n),e.array=()=>Ge(e),e.or=n=>Tw([e,n]),e.and=n=>Aw(e,n),e.transform=n=>Io(e,vh(n)),e.default=n=>zw(e,n),e.prefault=n=>Fw(e,n),e.catch=n=>Zw(e,n),e.pipe=n=>Io(e,n),e.readonly=()=>Hw(e),e.describe=n=>{const r=e.clone();return tr.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return tr.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return tr.get(e);const r=e.clone();return tr.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),ph=_("_ZodString",(e,t)=>{ua.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Ud(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(nb(...r)),e.includes=(...r)=>e.check(ib(...r)),e.startsWith=(...r)=>e.check(ob(...r)),e.endsWith=(...r)=>e.check(ab(...r)),e.min=(...r)=>e.check(Es(...r)),e.max=(...r)=>e.check(Fd(...r)),e.length=(...r)=>e.check(jd(...r)),e.nonempty=(...r)=>e.check(Es(1,...r)),e.lowercase=r=>e.check(rb(r)),e.uppercase=r=>e.check(sb(r)),e.trim=()=>e.check(lb()),e.normalize=(...r)=>e.check(cb(...r)),e.toLowerCase=()=>e.check(ub()),e.toUpperCase=()=>e.check(db()),e.slugify=()=>e.check(hb())}),Qb=_("ZodString",(e,t)=>{ua.init(e,t),ph.init(e,t),e.email=n=>e.check(Ey(ew,n)),e.url=n=>e.check(Ay(tw,n)),e.jwt=n=>e.check(qy(mw,n)),e.emoji=n=>e.check(Py(nw,n)),e.guid=n=>e.check(kl(Pl,n)),e.uuid=n=>e.check(ky(Hr,n)),e.uuidv4=n=>e.check(Ty(Hr,n)),e.uuidv6=n=>e.check(Oy(Hr,n)),e.uuidv7=n=>e.check(Iy(Hr,n)),e.nanoid=n=>e.check(xy(rw,n)),e.guid=n=>e.check(kl(Pl,n)),e.cuid=n=>e.check($y(sw,n)),e.cuid2=n=>e.check(Ry(iw,n)),e.ulid=n=>e.check(Cy(ow,n)),e.base64=n=>e.check(jy(pw,n)),e.base64url=n=>e.check(Uy(fw,n)),e.xid=n=>e.check(Ny(aw,n)),e.ksuid=n=>e.check(Ly(cw,n)),e.ipv4=n=>e.check(My(lw,n)),e.ipv6=n=>e.check(zy(uw,n)),e.cidrv4=n=>e.check(Dy(dw,n)),e.cidrv6=n=>e.check(Fy(hw,n)),e.e164=n=>e.check(Zy(gw,n)),e.datetime=n=>e.check(Cb(n)),e.date=n=>e.check(Lb(n)),e.time=n=>e.check(zb(n)),e.duration=n=>e.check(Fb(n))});function W(e){return Sy(Qb,e)}const te=_("ZodStringFormat",(e,t)=>{Q.init(e,t),ph.init(e,t)}),ew=_("ZodEmail",(e,t)=>{kv.init(e,t),te.init(e,t)}),Pl=_("ZodGUID",(e,t)=>{Sv.init(e,t),te.init(e,t)}),Hr=_("ZodUUID",(e,t)=>{Ev.init(e,t),te.init(e,t)}),tw=_("ZodURL",(e,t)=>{Tv.init(e,t),te.init(e,t)}),nw=_("ZodEmoji",(e,t)=>{Ov.init(e,t),te.init(e,t)}),rw=_("ZodNanoID",(e,t)=>{Iv.init(e,t),te.init(e,t)}),sw=_("ZodCUID",(e,t)=>{Av.init(e,t),te.init(e,t)}),iw=_("ZodCUID2",(e,t)=>{Pv.init(e,t),te.init(e,t)}),ow=_("ZodULID",(e,t)=>{xv.init(e,t),te.init(e,t)}),aw=_("ZodXID",(e,t)=>{$v.init(e,t),te.init(e,t)}),cw=_("ZodKSUID",(e,t)=>{Rv.init(e,t),te.init(e,t)}),lw=_("ZodIPv4",(e,t)=>{zv.init(e,t),te.init(e,t)}),uw=_("ZodIPv6",(e,t)=>{Dv.init(e,t),te.init(e,t)}),dw=_("ZodCIDRv4",(e,t)=>{Fv.init(e,t),te.init(e,t)}),hw=_("ZodCIDRv6",(e,t)=>{jv.init(e,t),te.init(e,t)}),pw=_("ZodBase64",(e,t)=>{Uv.init(e,t),te.init(e,t)}),fw=_("ZodBase64URL",(e,t)=>{qv.init(e,t),te.init(e,t)}),gw=_("ZodE164",(e,t)=>{Bv.init(e,t),te.init(e,t)}),mw=_("ZodJWT",(e,t)=>{Vv.init(e,t),te.init(e,t)}),fh=_("ZodNumber",(e,t)=>{Nd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Zd(e,r,s),e.gt=(r,s)=>e.check(Ol(r,s)),e.gte=(r,s)=>e.check($i(r,s)),e.min=(r,s)=>e.check($i(r,s)),e.lt=(r,s)=>e.check(Tl(r,s)),e.lte=(r,s)=>e.check(xi(r,s)),e.max=(r,s)=>e.check(xi(r,s)),e.int=r=>e.check(xl(r)),e.safe=r=>e.check(xl(r)),e.positive=r=>e.check(Ol(0,r)),e.nonnegative=r=>e.check($i(0,r)),e.negative=r=>e.check(Tl(0,r)),e.nonpositive=r=>e.check(xi(0,r)),e.multipleOf=(r,s)=>e.check(Il(r,s)),e.step=(r,s)=>e.check(Il(r,s)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function As(e){return Wy(fh,e)}const _w=_("ZodNumberFormat",(e,t)=>{Gv.init(e,t),fh.init(e,t)});function xl(e){return Jy(_w,e)}const vw=_("ZodBoolean",(e,t)=>{Wv.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>qd(e,n,r)});function Ut(e){return Yy(vw,e)}const yw=_("ZodUndefined",(e,t)=>{Jv.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Hd(e,n)});function zk(e){return Ky(yw,e)}const bw=_("ZodNull",(e,t)=>{Yv.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Bd(e,n,r)});function Dk(e){return Xy(bw,e)}const ww=_("ZodAny",(e,t)=>{Kv.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Gd()});function Fk(){return Qy(ww)}const Sw=_("ZodUnknown",(e,t)=>{Xv.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Wd()});function ko(){return eb(Sw)}const Ew=_("ZodNever",(e,t)=>{Qv.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Vd(e,n,r)});function gh(e){return tb(Ew,e)}const kw=_("ZodArray",(e,t)=>{ey.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Qd(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(Es(n,r)),e.nonempty=n=>e.check(Es(1,n)),e.max=(n,r)=>e.check(Fd(n,r)),e.length=(n,r)=>e.check(jd(n,r)),e.unwrap=()=>e.element});function Ge(e,t){return pb(kw,e,t)}const ha=_("ZodObject",(e,t)=>{ny.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eh(e,n,r,s),U(e,"shape",()=>t.shape),e.keyof=()=>Ot(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ko()}),e.loose=()=>e.clone({...e._zod.def,catchall:ko()}),e.strict=()=>e.clone({...e._zod.def,catchall:gh()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>v_(e,n),e.safeExtend=n=>y_(e,n),e.merge=n=>b_(e,n),e.pick=n=>m_(e,n),e.omit=n=>__(e,n),e.partial=(...n)=>w_(yh,e,n[0]),e.required=(...n)=>S_(bh,e,n[0])});function Jt(e,t){const n={type:"object",shape:e??{},...C(t)};return new ha(n)}function jk(e,t){return new ha({type:"object",shape:e,catchall:gh(),...C(t)})}function Uk(e,t){return new ha({type:"object",shape:e,catchall:ko(),...C(t)})}const mh=_("ZodUnion",(e,t)=>{zd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>th(e,n,r,s),e.options=t.options});function Tw(e,t){return new mh({type:"union",options:e,...C(t)})}const Ow=_("ZodDiscriminatedUnion",(e,t)=>{mh.init(e,t),ry.init(e,t)});function Zk(e,t,n){return new Ow({type:"union",options:t,discriminator:e,...C(n)})}const Iw=_("ZodIntersection",(e,t)=>{sy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>nh(e,n,r,s)});function Aw(e,t){return new Iw({type:"intersection",left:e,right:t})}const Pw=_("ZodTuple",(e,t)=>{iy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>rh(e,n,r,s),e.rest=n=>e.clone({...e._zod.def,rest:n})});function qk(e,t,n){const r=t instanceof H,s=r?n:t,i=r?t:null;return new Pw({type:"tuple",items:e,rest:i,...C(s)})}const _h=_("ZodRecord",(e,t)=>{oy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>sh(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function To(e,t,n){return new _h({type:"record",keyType:e,valueType:t,...C(n)})}function xw(e,t,n){const r=ft(e);return r._zod.values=void 0,new _h({type:"record",keyType:r,valueType:t,...C(n)})}const Oo=_("ZodEnum",(e,t)=>{ay.init(e,t),V.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Jd(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Oo({...t,checks:[],...C(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new Oo({...t,checks:[],...C(s),entries:i})}});function Ot(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Oo({type:"enum",entries:n,...C(t)})}const $w=_("ZodLiteral",(e,t)=>{cy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Yd(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Bk(e,t){return new $w({type:"literal",values:Array.isArray(e)?e:[e],...C(t)})}const Rw=_("ZodTransform",(e,t)=>{ly.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Xd(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new vd(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(br(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(br(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function vh(e){return new Rw({type:"transform",transform:e})}const yh=_("ZodOptional",(e,t)=>{Dd.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>da(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function $l(e){return new yh({type:"optional",innerType:e})}const Cw=_("ZodExactOptional",(e,t)=>{uy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>da(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Nw(e){return new Cw({type:"optional",innerType:e})}const Lw=_("ZodNullable",(e,t)=>{dy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ih(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Rl(e){return new Lw({type:"nullable",innerType:e})}const Mw=_("ZodDefault",(e,t)=>{hy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ah(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zw(e,t){return new Mw({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Sd(t)}})}const Dw=_("ZodPrefault",(e,t)=>{py.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ch(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Fw(e,t){return new Dw({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Sd(t)}})}const bh=_("ZodNonOptional",(e,t)=>{fy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>oh(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function jw(e,t){return new bh({type:"nonoptional",innerType:e,...C(t)})}const Uw=_("ZodCatch",(e,t)=>{gy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>lh(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Zw(e,t){return new Uw({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const qw=_("ZodPipe",(e,t)=>{my.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>uh(e,n,r,s),e.in=t.in,e.out=t.out});function Io(e,t){return new qw({type:"pipe",in:e,out:t})}const Bw=_("ZodReadonly",(e,t)=>{_y.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>dh(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Hw(e){return new Bw({type:"readonly",innerType:e})}const Vw=_("ZodLazy",(e,t)=>{vy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>hh(e,n,r,s),e.unwrap=()=>e._zod.def.getter()});function Hk(e){return new Vw({type:"lazy",getter:e})}const pa=_("ZodCustom",(e,t)=>{yy.init(e,t),V.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Kd(e,n)});function Vk(e,t){return fb(pa,e??(()=>!0),t)}function Gw(e,t={}){return gb(pa,e,t)}function Ww(e){return mb(e)}function Gk(e,t={}){const n=new pa({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...C(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Wk(e,t){return Io(vh(e),t)}const Jw=["oauth-dcr","oauth-cimd","oauth-preregistered","static-header","authless","custom-connection"],Yw=["no-user-data","processes-user-data","stores-user-data","shares-with-third-parties"],Kw=["ownsOrIsAuthorizedForService","accurateDataHandlingDisclosure","compliesWithUsagePolicies","noProhibitedContent","maintainsSecurityPractices","respondsToSecurityReports","keepsListingAccurate"],Vr=W().url().refine(e=>e.startsWith("https://"),{message:"must be an https:// URL"}),Xw=Jt({url:W().min(1),mimeType:W().min(1),widthPx:As().int().positive(),heightPx:As().int().positive(),prompt:W().min(1)});Jt({name:W().min(1).max(Ft.nameMaxLength),tagline:W().min(1).max(Ft.taglineMaxLength),description:W().min(1).max(Ft.descriptionMaxLength),categories:Ge(W().min(1)).min(Ft.categoriesMin).max(Ft.categoriesMax),slug:W().min(1).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/,"must be a lowercase kebab-case slug"),documentationUrl:Vr,privacyPolicyUrl:Vr,supportUrl:Vr,iconUrl:Vr,declaredAuthMode:Ot(Jw),dataHandling:Ge(Ot(Yw)).min(1),screenshots:Ge(Xw).min(Ft.screenshotsMin).max(Ft.screenshotsMax),attestations:To(Ot(Kw),Ut())});const Ri={maxCompressedBytes:100*1024*1024,maxUncompressedBytes:512*1024*1024,maxEntries:5e3},Xe={nameMaxLength:100,displayNameMaxLength:100,shortDescriptionMaxLength:255,descriptionMaxLength:2e3,defaultPromptMaxLength:255,toolNameMaxLength:64,skillNameMaxLength:64},Qw=["productivity","education","developer-tools","design","writing","research","data-analysis","marketing","sales","finance","health","travel","entertainment"],Ci={minEdgePx:48,maxEdgePx:4096,maxBytes:5*1024*1024},cn={maxSkillMarkdownBytes:256*1024,maxPageBytes:1024*1024,maxSkillTotalBytes:5*1024*1024,maxImportedTotalBytes:8*1024*1024,maxSkills:5,maxPagesPerSkill:10},Cl={successCount:5,failureCount:3};Ke("deploy/submission","Host profile constants");const A=e=>Ke("deploy/submission-errors",e),e0=[{id:"archive-too-large",category:"package-archive",severity:"blocking",message:"The uploaded archive exceeds the maximum compressed size.",limit:{name:"archiveLimits.maxCompressedBytes",value:Ri.maxCompressedBytes},source:A("§Shared package checks → Archive size")},{id:"archive-expands-too-large",category:"package-archive",severity:"blocking",message:"The archive's contents exceed the maximum uncompressed size when expanded.",limit:{name:"archiveLimits.maxUncompressedBytes",value:Ri.maxUncompressedBytes},source:A("§Shared package checks → Archive size")},{id:"archive-too-many-entries",category:"package-archive",severity:"blocking",message:"The archive contains more entries than the maximum allowed.",limit:{name:"archiveLimits.maxEntries",value:Ri.maxEntries},source:A("§Shared package checks → Entry count")},{id:"archive-encrypted-entry",category:"package-archive",severity:"blocking",message:"The archive contains an encrypted entry, which cannot be scanned.",source:A("§Shared package checks → Archive integrity")},{id:"archive-path-traversal",category:"package-archive",severity:"blocking",message:"An entry path escapes the package root via a `..` segment.",source:A("§Shared package checks → Entry paths")},{id:"archive-absolute-path",category:"package-archive",severity:"blocking",message:"An entry path is absolute rather than package-relative.",source:A("§Shared package checks → Entry paths")},{id:"archive-backslash-path",category:"package-archive",severity:"blocking",message:"An entry path uses a backslash separator.",source:A("§Shared package checks → Entry paths")},{id:"archive-empty-path-segment",category:"package-archive",severity:"blocking",message:"An entry path contains an empty or `.` segment.",source:A("§Shared package checks → Entry paths")},{id:"archive-path-whitespace",category:"package-archive",severity:"blocking",message:"An entry path has leading or trailing whitespace.",source:A("§Shared package checks → Entry paths")},{id:"archive-path-control-character",category:"package-archive",severity:"blocking",message:"An entry path contains a control character or NUL byte.",source:A("§Shared package checks → Entry paths")},{id:"archive-duplicate-path",category:"package-archive",severity:"blocking",message:"Two entries normalize to the same path, including case-insensitive collisions.",source:A("§Shared package checks → Entry paths")},{id:"archive-symlink-entry",category:"package-archive",severity:"blocking",message:"The archive contains a symlink or hardlink entry.",source:A("§Shared package checks → Archive integrity")},{id:"manifest-missing",category:"package-manifest",severity:"blocking",message:"The package contains no plugin manifest.",source:A("§Shared package checks → Manifest")},{id:"manifest-invalid-json",category:"package-manifest",severity:"blocking",message:"The plugin manifest is not valid JSON.",source:A("§Shared package checks → Manifest")},{id:"manifest-name-missing",category:"package-manifest",severity:"blocking",message:"The manifest declares no plugin name.",source:A("§Shared package checks → Manifest")},{id:"manifest-name-too-long",category:"package-manifest",severity:"blocking",message:"The manifest's plugin name exceeds the maximum length.",limit:{name:"fieldLimits.nameMaxLength",value:Xe.nameMaxLength},source:A("§Shared package checks → Manifest")},{id:"manifest-version-invalid",category:"package-manifest",severity:"blocking",message:"The manifest's version is not a valid semantic version.",source:A("§Shared package checks → Manifest")},{id:"interface-display-name-missing",category:"package-manifest",severity:"blocking",message:"The OpenAI interface document declares no display name.",source:A("§Listing fields → Interface")},{id:"interface-display-name-too-long",category:"package-manifest",severity:"blocking",message:"The interface display name exceeds the maximum length.",limit:{name:"fieldLimits.displayNameMaxLength",value:Xe.displayNameMaxLength},source:A("§Listing fields → Interface")},{id:"interface-short-description-too-long",category:"package-manifest",severity:"blocking",message:"The interface short description exceeds the maximum length.",limit:{name:"fieldLimits.shortDescriptionMaxLength",value:Xe.shortDescriptionMaxLength},source:A("§Listing fields → Interface")},{id:"interface-default-prompt-too-long",category:"package-manifest",severity:"blocking",message:"The interface default prompt exceeds the maximum length.",limit:{name:"fieldLimits.defaultPromptMaxLength",value:Xe.defaultPromptMaxLength},source:A("§Listing fields → Interface")},{id:"interface-brand-color-invalid",category:"package-manifest",severity:"blocking",message:"The brand color is not a six-digit hex value.",source:A("§Listing fields → Interface")},{id:"interface-brand-color-low-contrast",category:"package-manifest",severity:"blocking",message:"The brand color does not meet the minimum contrast ratio against both the light and dark backgrounds.",source:A("§Listing fields → Interface")},{id:"interface-yaml-invalid",category:"package-manifest",severity:"blocking",message:"The OpenAI interface document is not valid YAML.",source:A("§Listing fields → Interface")},{id:"interface-unsupported-text",category:"package-manifest",severity:"blocking",message:"A text field contains control characters or Unicode line/paragraph separators.",source:A("§Listing fields → Text")},{id:"skill-metadata-missing",category:"package-skills",severity:"blocking",message:"A skill directory contains no SKILL.md.",source:A("§Skills → Structure")},{id:"skill-frontmatter-invalid",category:"package-skills",severity:"blocking",message:"A skill's SKILL.md frontmatter is missing or malformed.",source:A("§Skills → Frontmatter")},{id:"skill-name-missing",category:"package-skills",severity:"blocking",message:"A skill's frontmatter declares no name.",source:A("§Skills → Frontmatter")},{id:"skill-name-too-long",category:"package-skills",severity:"blocking",message:"A skill name exceeds the maximum length.",limit:{name:"fieldLimits.skillNameMaxLength",value:Xe.skillNameMaxLength},source:A("§Skills → Frontmatter")},{id:"skill-description-missing",category:"package-skills",severity:"blocking",message:"A skill's frontmatter declares no description.",source:A("§Skills → Frontmatter")},{id:"skill-name-collision",category:"package-skills",severity:"blocking",message:"Two skills in the package declare the same name.",source:A("§Skills → Structure")},{id:"asset-unsupported-type",category:"package-assets",severity:"blocking",message:"An image is not one of the accepted formats.",source:A("§Images → Format")},{id:"asset-too-large",category:"package-assets",severity:"blocking",message:"An image exceeds the maximum file size.",limit:{name:"imageConstraints.maxBytes",value:Ci.maxBytes},source:A("§Images → Size")},{id:"asset-too-small",category:"package-assets",severity:"blocking",message:"An image is smaller than the minimum edge length.",limit:{name:"imageConstraints.minEdgePx",value:Ci.minEdgePx},source:A("§Images → Dimensions")},{id:"asset-too-big-dimensions",category:"package-assets",severity:"blocking",message:"An image exceeds the maximum edge length.",limit:{name:"imageConstraints.maxEdgePx",value:Ci.maxEdgePx},source:A("§Images → Dimensions")},{id:"asset-not-square",category:"package-assets",severity:"blocking",message:"An image is not square.",source:A("§Images → Dimensions")},{id:"asset-undecodable",category:"package-assets",severity:"blocking",message:"An image's dimensions could not be read from its bytes.",source:A("§Images → Format")},{id:"asset-svg-malformed",category:"package-assets",severity:"blocking",message:"An SVG is not well-formed XML or has no `svg` root element.",source:A("§Images → SVG")},{id:"asset-svg-no-dimensions",category:"package-assets",severity:"blocking",message:"An SVG declares neither a numeric width/height pair nor a numeric viewBox.",source:A("§Images → SVG")},{id:"asset-missing",category:"package-assets",severity:"blocking",message:"An asset referenced by the manifest is absent from the package.",source:A("§Images → Format")},{id:"listing-category-unknown",category:"listing-fields",severity:"blocking",message:"The listing names a category outside the supported set.",source:A("§Listing fields → Categories")},{id:"listing-description-too-long",category:"listing-fields",severity:"blocking",message:"The listing description exceeds the maximum length.",limit:{name:"fieldLimits.descriptionMaxLength",value:Xe.descriptionMaxLength},source:A("§Listing fields → Description")},{id:"listing-promotional-metadata",category:"listing-fields",severity:"blocking",message:"Listing metadata contains promotional language, pricing claims, or ranking claims.",source:A("§Listing fields → Description")},{id:"listing-privacy-policy-missing",category:"listing-fields",severity:"blocking",message:"The listing declares no privacy policy URL.",source:A("§Listing fields → Links")},{id:"listing-support-url-missing",category:"listing-fields",severity:"blocking",message:"The listing declares no support URL.",source:A("§Listing fields → Links")},{id:"mcp-endpoint-not-https",category:"mcp-server",severity:"blocking",message:"The MCP endpoint is not served over HTTPS.",source:A("§MCP tools → Endpoint")},{id:"mcp-endpoint-unreachable",category:"mcp-server",severity:"blocking",message:"The MCP endpoint could not be reached during the scan.",source:A("§MCP tools → Endpoint")},{id:"mcp-tool-name-too-long",category:"mcp-server",severity:"blocking",message:"A tool name exceeds the maximum length.",limit:{name:"fieldLimits.toolNameMaxLength",value:Xe.toolNameMaxLength},source:A("§MCP tools → Metadata")},{id:"mcp-tool-description-missing",category:"mcp-server",severity:"blocking",message:"A tool declares no description.",source:A("§MCP tools → Metadata")},{id:"mcp-tool-annotations-missing",category:"mcp-server",severity:"blocking",message:"A tool is missing one or more of the required annotation hints.",source:A("§MCP tools → Annotations")},{id:"mcp-tool-schema-invalid",category:"mcp-server",severity:"blocking",message:"A tool's input or output schema is not a valid JSON Schema object.",source:A("§MCP tools → Schemas")},{id:"mcp-domain-not-verified",category:"mcp-server",severity:"blocking",message:"The MCP server's domain has not completed domain verification.",source:A("§MCP tools → Domain verification")},{id:"mcp-csp-domain-missing",category:"mcp-server",severity:"blocking",message:"A UI resource loads from a domain absent from the declared content security policy.",source:A("§MCP tools → Content security policy")},{id:"mcp-ui-domain-missing",category:"mcp-server",severity:"blocking",message:"A UI resource declares no `_meta.ui.domain`.",source:A("§MCP tools → UI resources")},{id:"mcp-ui-domain-duplicate",category:"mcp-server",severity:"blocking",message:"Two UI resources declare the same `_meta.ui.domain`.",source:A("§MCP tools → UI resources")},{id:"mcp-ui-mime-invalid",category:"mcp-server",severity:"blocking",message:"A UI resource does not declare the plugin UI MIME profile.",source:A("§MCP tools → UI resources")},{id:"mcp-skill-too-many",category:"mcp-skills",severity:"blocking",message:"The server advertises more importable skills than the maximum.",limit:{name:"mcpSkillLimits.maxSkills",value:cn.maxSkills},source:A("§Skills → Imported from MCP")},{id:"mcp-skill-markdown-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's markdown exceeds the maximum size.",limit:{name:"mcpSkillLimits.maxSkillMarkdownBytes",value:cn.maxSkillMarkdownBytes},source:A("§Skills → Imported from MCP")},{id:"mcp-skill-page-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's supporting page exceeds the maximum size.",limit:{name:"mcpSkillLimits.maxPageBytes",value:cn.maxPageBytes},source:A("§Skills → Imported from MCP")},{id:"mcp-skill-too-many-pages",category:"mcp-skills",severity:"blocking",message:"An imported skill has more supporting pages than the maximum.",limit:{name:"mcpSkillLimits.maxPagesPerSkill",value:cn.maxPagesPerSkill},source:A("§Skills → Imported from MCP")},{id:"mcp-skill-total-too-large",category:"mcp-skills",severity:"blocking",message:"An imported skill's total footprint exceeds the maximum.",limit:{name:"mcpSkillLimits.maxSkillTotalBytes",value:cn.maxSkillTotalBytes},source:A("§Skills → Imported from MCP")},{id:"mcp-skills-total-too-large",category:"mcp-skills",severity:"blocking",message:"The imported skills exceed the maximum combined size.",limit:{name:"mcpSkillLimits.maxImportedTotalBytes",value:cn.maxImportedTotalBytes},source:A("§Skills → Imported from MCP")},{id:"mcp-skill-digest-mismatch",category:"mcp-skills",severity:"blocking",message:"An imported skill's declared digest does not match the resource served for it.",source:A("§Skills → Imported from MCP")},{id:"mcp-skill-frontmatter-mismatch",category:"mcp-skills",severity:"blocking",message:"An imported skill's listing metadata disagrees with its SKILL.md frontmatter.",source:A("§Skills → Imported from MCP")},{id:"mcp-skill-scan-failed",category:"mcp-skills",severity:"blocking",message:"The skill scan failed, so the draft's imported skills were not updated.",source:A("§Skills → Imported from MCP")},{id:"review-success-tests-missing",category:"review-materials",severity:"blocking",message:"Fewer successful test cases were supplied than required.",limit:{name:"submissionTestCases.successCount",value:Cl.successCount},source:A("§Review materials → Test cases")},{id:"review-failure-tests-missing",category:"review-materials",severity:"blocking",message:"Fewer graceful-failure test cases were supplied than required.",limit:{name:"submissionTestCases.failureCount",value:Cl.failureCount},source:A("§Review materials → Test cases")},{id:"review-demo-credentials-missing",category:"review-materials",severity:"blocking",message:"The submission authenticates users but supplies no reviewer demo credentials.",source:A("§Review materials → Demo access")},{id:"review-demo-recording-missing",category:"review-materials",severity:"blocking",message:"No demo recording was supplied.",source:A("§Review materials → Demo access")},{id:"review-release-notes-missing",category:"review-materials",severity:"blocking",message:"An updated submission supplies no release notes.",source:A("§Review materials → Release notes")},{id:"review-attestation-missing",category:"review-materials",severity:"blocking",message:"A required policy attestation was not affirmed.",source:A("§Review materials → Attestations")},{id:"review-identity-not-verified",category:"review-materials",severity:"blocking",message:"The submitting account has not completed identity verification.",source:A("§Review materials → Account")},{id:"review-write-permission-missing",category:"review-materials",severity:"blocking",message:"The submitting account lacks the app-write permission.",source:A("§Review materials → Account")},{id:"review-geography-missing",category:"review-materials",severity:"blocking",message:"The submission declares no country availability.",source:A("§Review materials → Availability")},{id:"review-annotation-justification-missing",category:"review-materials",severity:"advisory",message:"A tool annotated as destructive or open-world carries no justification for review.",source:A("§Review materials → Test cases")},{id:"review-scan-stale",category:"review-materials",severity:"blocking",message:"The draft's scan predates the current server contract; re-run Scan Tools.",source:A("§MCP tools → Scan")},{id:"exclusion-mcp-servers-in-skills-only",category:"exclusions",severity:"blocking",message:"A skills-only submission declares MCP servers, which that shape excludes.",source:A("§Shared package checks → Excluded content")},{id:"exclusion-app-config-in-public-package",category:"exclusions",severity:"blocking",message:"The package contains an `.app.json`, which maps registered connections for local or workspace use and is excluded from a public submission.",source:A("§Shared package checks → Excluded content")},{id:"exclusion-screenshots-without-ui",category:"exclusions",severity:"blocking",message:"Screenshots were supplied for a submission that renders no UI template.",source:A("§Images → Screenshots")},{id:"exclusion-bundle-in-mcp-only",category:"exclusions",severity:"blocking",message:"An MCP-only submission supplies a package archive.",source:A("§Shared package checks → Excluded content")},{id:"exclusion-unsupported-surface",category:"exclusions",severity:"blocking",message:"The package contains a surface the plugin directory does not support.",source:A("§Shared package checks → Excluded content")}];Object.freeze(Object.fromEntries(e0.map(e=>[e.id,e])));const t0=["ownsOrIsAuthorizedForService","accurateDataDisclosure","compliesWithUsagePolicies","noProhibitedContent","maintainsSecurityPractices","respondsToSecurityReports","keepsListingAccurate"],n0=["none","account-identifiers","user-content","usage-analytics","payment-information","location","health","shared-with-third-parties"],r0=["in-submission-form","shared-out-of-band","not-required-authless"],Ni=W().url().refine(e=>e.startsWith("https://"),{message:"must be an https:// URL"}),Nl=Jt({prompt:W().min(1),expectation:W().min(1)}),s0=Jt({reference:W().min(1),mimeType:W().min(1),widthPx:As().int().positive(),heightPx:As().int().positive(),prompt:W().min(1)});Jt({name:W().min(1).max(Xe.nameMaxLength),shortDescription:W().min(1).max(Xe.shortDescriptionMaxLength),description:W().min(1).max(Xe.descriptionMaxLength),categories:Ge(Ot(Qw)).min(1),privacyPolicyUrl:Ni,supportUrl:Ni,documentationUrl:Ni.optional(),testCases:Jt({successful:Ge(Nl),gracefulFailure:Ge(Nl)}),demoCredentials:Jt({provided:Ut(),delivery:Ot(r0)}),demoRecordingProvided:Ut(),screenshots:Ge(s0).default([]),releaseNotes:W().min(1).optional(),identityVerified:Ut(),accountPermissions:Ge(W().min(1)).default([]),availableCountries:Ge(W().length(2)).default([]),dataResidencyEligible:Ut().optional(),privacyPolicyDataTypes:Ge(Ot(n0)).default([]),annotationJustifications:To(W(),W().min(1)).default({}),frameDomainExplanations:To(W(),W().min(1)).default({}),domainVerificationToken:W().min(1).optional(),lastScanAt:W().datetime().optional(),hasPublishedVersion:Ut().optional(),attestations:xw(Ot(t0),Ut())});new TextDecoder("utf-8",{fatal:!1});const fa=Symbol.for("yaml.alias"),i0=Symbol.for("yaml.document"),Yt=Symbol.for("yaml.map"),wh=Symbol.for("yaml.pair"),ga=Symbol.for("yaml.scalar"),kr=Symbol.for("yaml.seq"),it=Symbol.for("yaml.node.type"),Dn=e=>!!e&&typeof e=="object"&&e[it]===fa,Ws=e=>!!e&&typeof e=="object"&&e[it]===i0,Sh=e=>!!e&&typeof e=="object"&&e[it]===Yt,fe=e=>!!e&&typeof e=="object"&&e[it]===wh,ue=e=>!!e&&typeof e=="object"&&e[it]===ga,ma=e=>!!e&&typeof e=="object"&&e[it]===kr;function Pe(e){if(e&&typeof e=="object")switch(e[it]){case Yt:case kr:return!0}return!1}function me(e){if(e&&typeof e=="object")switch(e[it]){case fa:case Yt:case ga:case kr:return!0}return!1}const Eh=e=>(ue(e)||Pe(e))&&!!e.anchor,Zt=Symbol("break visit"),o0=Symbol("skip children"),hr=Symbol("remove node");function Js(e,t){const n=a0(t);Ws(e)?_n(null,e.contents,n,Object.freeze([e]))===hr&&(e.contents=null):_n(null,e,n,Object.freeze([]))}Js.BREAK=Zt;Js.SKIP=o0;Js.REMOVE=hr;function _n(e,t,n,r){const s=c0(e,t,n,r);if(me(s)||fe(s))return l0(e,r,s),_n(e,s,n,r);if(typeof s!="symbol"){if(Pe(t)){r=Object.freeze(r.concat(t));for(let i=0;i<t.items.length;++i){const o=_n(i,t.items[i],n,r);if(typeof o=="number")i=o-1;else{if(o===Zt)return Zt;o===hr&&(t.items.splice(i,1),i-=1)}}}else if(fe(t)){r=Object.freeze(r.concat(t));const i=_n("key",t.key,n,r);if(i===Zt)return Zt;i===hr&&(t.key=null);const o=_n("value",t.value,n,r);if(o===Zt)return Zt;o===hr&&(t.value=null)}}return s}function a0(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function c0(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Sh(t))return n.Map?.(e,t,r);if(ma(t))return n.Seq?.(e,t,r);if(fe(t))return n.Pair?.(e,t,r);if(ue(t))return n.Scalar?.(e,t,r);if(Dn(t))return n.Alias?.(e,t,r)}function l0(e,t,n){const r=t[t.length-1];if(Pe(r))r.items[e]=n;else if(fe(r))e==="key"?r.key=n:r.value=n;else if(Ws(r))r.contents=n;else{const s=Dn(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}function kh(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function nr(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let s=0,i=r.length;s<i;++s){const o=r[s],a=nr(e,r,String(s),o);a===void 0?delete r[s]:a!==o&&(r[s]=a)}else if(r instanceof Map)for(const s of Array.from(r.keys())){const i=r.get(s),o=nr(e,r,s,i);o===void 0?r.delete(s):o!==i&&r.set(s,o)}else if(r instanceof Set)for(const s of Array.from(r)){const i=nr(e,r,s,s);i===void 0?r.delete(s):i!==s&&(r.delete(s),r.add(i))}else for(const[s,i]of Object.entries(r)){const o=nr(e,r,s,i);o===void 0?delete r[s]:o!==i&&(r[s]=o)}return e.call(t,n,r)}function Je(e,t,n){if(Array.isArray(e))return e.map((r,s)=>Je(r,String(s),n));if(e&&typeof e.toJSON=="function"){if(!n||!Eh(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=i=>{r.res=i,delete n.onCreate};const s=e.toJSON(t,n);return n.onCreate&&n.onCreate(s),s}return typeof e=="bigint"&&!n?.keep?Number(e):e}class _a{constructor(t){Object.defineProperty(this,it,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:s,reviver:i}={}){if(!Ws(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Je(this,"",o);if(typeof s=="function")for(const{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?nr(i,{"":a},"",a):a}}class u0 extends _a{constructor(t){super(fa),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Js(t,{Node:(i,o)=>{(Dn(o)||Eh(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let s;for(const i of r){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:s,maxAliasCount:i}=n,o=this.resolve(s,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(o);if(a||(Je(o,null,n),a=r.get(o)),a?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Xr(s,o,r)),a.count*a.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,n,r){const s=`*${this.source}`;if(t){if(kh(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}}function Xr(e,t,n){if(Dn(t)){const r=t.resolve(e),s=n&&r&&n.get(r);return s?s.count*s.aliasCount:0}else if(Pe(t)){let r=0;for(const s of t.items){const i=Xr(e,s,n);i>r&&(r=i)}return r}else if(fe(t)){const r=Xr(e,t.key,n),s=Xr(e,t.value,n);return Math.max(r,s)}return 1}const Th=e=>!e||typeof e!="function"&&typeof e!="object";class ne extends _a{constructor(t){super(ga),this.value=t}toJSON(t,n){return n?.keep?this.value:Je(this.value,t,n)}toString(){return String(this.value)}}ne.BLOCK_FOLDED="BLOCK_FOLDED";ne.BLOCK_LITERAL="BLOCK_LITERAL";ne.PLAIN="PLAIN";ne.QUOTE_DOUBLE="QUOTE_DOUBLE";ne.QUOTE_SINGLE="QUOTE_SINGLE";function d0(e,t,n){return n.find(r=>r.identify?.(e)&&!r.format)}function Ps(e,t,n){if(Ws(e)&&(e=e.contents),me(e))return e;if(fe(e)){const d=n.schema[Yt].createNode?.(n.schema,null,n);return d.items.push(e),d}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=n;let c;if(r&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=s(e)),new u0(c.anchor);c={anchor:null,node:null},a.set(e,c)}let l=d0(e,t,o.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const d=new ne(e);return c&&(c.node=d),d}l=e instanceof Map?o[Yt]:Symbol.iterator in Object(e)?o[kr]:o[Yt]}i&&(i(l),delete n.onTagObj);const u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,e,n):new ne(e);return l.default||(u.tag=l.tag),c&&(c.node=u),u}function Ll(e,t,n){let r=n;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=r,r=o}else r=new Map([[i,r]])}return Ps(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const h0=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Oh extends _a{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>me(r)||fe(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(h0(t))this.add(n);else{const[r,...s]=t,i=this.get(r,!0);if(Pe(i))i.addIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ll(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const s=this.get(n,!0);if(Pe(s))return s.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...s]=t,i=this.get(r,!0);return s.length===0?!n&&ue(i)?i.value:i:Pe(i)?i.getIn(s,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!fe(n))return!1;const r=n.value;return r==null||t&&ue(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const s=this.get(n,!0);return Pe(s)?s.hasIn(r):!1}setIn(t,n){const[r,...s]=t;if(s.length===0)this.set(r,n);else{const i=this.get(r,!0);if(Pe(i))i.setIn(s,n);else if(i===void 0&&this.schema)this.set(r,Ll(this.schema,s,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${s}`)}}}const p0=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function wr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const vn=(e,t,n)=>e.endsWith(`
|
|
42
|
+
`)?wr(n,t):n.includes(`
|
|
43
|
+
`)?`
|
|
44
|
+
`+wr(n,t):(e.endsWith(" ")?"":" ")+n,Ih="flow",Ao="block",Qr="quoted";function Ys(e,t,n="flow",{indentAtStart:r,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<i&&(i=0);const c=Math.max(1+i,1+s-t.length);if(e.length<=c)return e;const l=[],u={};let d=s-t.length;typeof r=="number"&&(r>s-Math.max(2,i)?l.push(0):d=s-r);let h,p,g=!1,f=-1,v=-1,E=-1;n===Ao&&(f=Ml(e,f,t.length),f!==-1&&(d=f+c));for(let S;S=e[f+=1];){if(n===Qr&&S==="\\"){switch(v=f,e[f+1]){case"x":f+=3;break;case"u":f+=5;break;case"U":f+=9;break;default:f+=1}E=f}if(S===`
|
|
45
|
+
`)n===Ao&&(f=Ml(e,f,t.length)),d=f+t.length+c,h=void 0;else{if(S===" "&&p&&p!==" "&&p!==`
|
|
46
|
+
`&&p!==" "){const w=e[f+1];w&&w!==" "&&w!==`
|
|
47
|
+
`&&w!==" "&&(h=f)}if(f>=d)if(h)l.push(h),d=h+c,h=void 0;else if(n===Qr){for(;p===" "||p===" ";)p=S,S=e[f+=1],g=!0;const w=f>E+1?f-2:v-1;if(u[w])return e;l.push(w),u[w]=!0,d=w+c,h=void 0}else g=!0}p=S}if(g&&a&&a(),l.length===0)return e;o&&o();let I=e.slice(0,l[0]);for(let S=0;S<l.length;++S){const w=l[S],y=l[S+1]||e.length;w===0?I=`
|
|
48
|
+
${t}${e.slice(0,y)}`:(n===Qr&&u[w]&&(I+=`${e[w]}\\`),I+=`
|
|
49
|
+
${t}${e.slice(w+1,y)}`)}return I}function Ml(e,t,n){let r=t,s=t+1,i=e[s];for(;i===" "||i===" ";)if(t<s+n)i=e[++t];else{do i=e[++t];while(i&&i!==`
|
|
50
|
+
`);r=t,s=t+1,i=e[s]}return r}const Ks=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Xs=e=>/^(%|---|\.\.\.)/m.test(e);function f0(e,t,n){if(!t||t<0)return!1;const r=t-n,s=e.length;if(s<=r)return!1;for(let i=0,o=0;i<s;++i)if(e[i]===`
|
|
51
|
+
`){if(i-o>r)return!0;if(o=i+1,s-o<=r)return!1}return!0}function pr(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(Xs(e)?" ":"");let o="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{o+=n.slice(a,c);const u=n.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<s)c+=1;else{for(o+=n.slice(a,c)+`
|
|
52
|
+
|
|
53
|
+
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
54
|
+
`,c+=2;o+=i,n[c+2]===" "&&(o+="\\"),c+=1,a=c+1}break;default:c+=1}return o=a?o+n.slice(a):n,r?o:Ys(o,i,Qr,Ks(t,!1))}function Po(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
55
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return pr(e,t);const n=t.indent||(Xs(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
56
|
+
${n}`)+"'";return t.implicitKey?r:Ys(r,n,Ih,Ks(t,!1))}function yn(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=pr;else{const s=e.includes('"'),i=e.includes("'");s&&!i?r=Po:i&&!s?r=pr:r=n?Po:pr}return r(e,t)}let xo;try{xo=new RegExp(`(^|(?<!
|
|
57
|
+
))
|
|
58
|
+
+(?!
|
|
59
|
+
|$)`,"g")}catch{xo=/\n+(?!\n|$)/g}function es({comment:e,type:t,value:n},r,s,i){const{blockQuote:o,commentString:a,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return yn(n,r);const l=r.indent||(r.forceBlockIndent||Xs(n)?" ":""),u=o==="literal"?!0:o==="folded"||t===ne.BLOCK_FOLDED?!1:t===ne.BLOCK_LITERAL?!0:!f0(n,c,l.length);if(!n)return u?`|
|
|
60
|
+
`:`>
|
|
61
|
+
`;let d,h;for(h=n.length;h>0;--h){const y=n[h-1];if(y!==`
|
|
62
|
+
`&&y!==" "&&y!==" ")break}let p=n.substring(h);const g=p.indexOf(`
|
|
63
|
+
`);g===-1?d="-":n===p||g!==p.length-1?(d="+",i&&i()):d="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
64
|
+
`&&(p=p.slice(0,-1)),p=p.replace(xo,`$&${l}`));let f=!1,v,E=-1;for(v=0;v<n.length;++v){const y=n[v];if(y===" ")f=!0;else if(y===`
|
|
65
|
+
`)E=v;else break}let I=n.substring(0,E<v?E+1:v);I&&(n=n.substring(I.length),I=I.replace(/\n+/g,`$&${l}`));let w=(f?l?"2":"1":"")+d;if(e&&(w+=" "+a(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!u){const y=n.replace(/\n+/g,`
|
|
66
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`);let $=!1;const k=Ks(r,!0);o!=="folded"&&t!==ne.BLOCK_FOLDED&&(k.onOverflow=()=>{$=!0});const b=Ys(`${I}${y}${p}`,l,Ao,k);if(!$)return`>${w}
|
|
67
|
+
${l}${b}`}return n=n.replace(/\n+/g,`$&${l}`),`|${w}
|
|
68
|
+
${l}${I}${n}${p}`}function g0(e,t,n,r){const{type:s,value:i}=e,{actualString:o,implicitKey:a,indent:c,indentStep:l,inFlow:u}=t;if(a&&i.includes(`
|
|
69
|
+
`)||u&&/[[\]{},]/.test(i))return yn(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
|
|
70
|
+
`)?yn(i,t):es(e,t,n,r);if(!a&&!u&&s!==ne.PLAIN&&i.includes(`
|
|
71
|
+
`))return es(e,t,n,r);if(Xs(i)){if(c==="")return t.forceBlockIndent=!0,es(e,t,n,r);if(a&&c===l)return yn(i,t)}const d=i.replace(/\n+/g,`$&
|
|
72
|
+
${c}`);if(o){const h=f=>f.default&&f.tag!=="tag:yaml.org,2002:str"&&f.test?.test(d),{compat:p,tags:g}=t.doc.schema;if(g.some(h)||p?.some(h))return yn(i,t)}return a?d:Ys(d,c,Ih,Ks(t,!1))}function m0(e,t,n,r){const{implicitKey:s,inFlow:i}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==ne.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ne.QUOTE_DOUBLE);const c=u=>{switch(u){case ne.BLOCK_FOLDED:case ne.BLOCK_LITERAL:return s||i?yn(o.value,t):es(o,t,n,r);case ne.QUOTE_DOUBLE:return pr(o.value,t);case ne.QUOTE_SINGLE:return Po(o.value,t);case ne.PLAIN:return g0(o,t,n,r);default:return null}};let l=c(a);if(l===null){const{defaultKeyType:u,defaultStringType:d}=t.options,h=s&&u||d;if(l=c(h),l===null)throw new Error(`Unsupported default string type ${h}`)}return l}function _0(e,t){const n=Object.assign({blockQuote:!0,commentString:p0,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function v0(e,t){if(t.tag){const s=e.filter(i=>i.tag===t.tag);if(s.length>0)return s.find(i=>i.format===t.format)??s[0]}let n,r;if(ue(t)){r=t.value;let s=e.filter(i=>i.identify?.(r));if(s.length>1){const i=s.filter(o=>o.test);i.length>0&&(s=i)}n=s.find(i=>i.format===t.format)??s.find(i=>!i.format)}else r=t,n=e.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function y0(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const s=[],i=(ue(e)||Pe(e))&&e.anchor;i&&kh(i)&&(n.add(i),s.push(`&${i}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(r.directives.tagString(o)),s.join(" ")}function xs(e,t,n,r){if(fe(e))return e.toString(t,n,r);if(Dn(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=me(e)?e:t.doc.createNode(e,{onTagObj:c=>s=c});s??(s=v0(t.doc.schema.tags,i));const o=y0(i,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(i,t,n,r):ue(i)?m0(i,t,n,r):i.toString(t,n,r);return o?ue(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
73
|
+
${t.indent}${a}`:a}function b0({key:e,value:t},n,r,s){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n;let h=me(e)&&e.comment||null;if(d){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Pe(e)||!me(e)&&typeof e=="object"){const k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let p=!d&&(!e||h&&t==null&&!n.inFlow||Pe(e)||(ue(e)?e.type===ne.BLOCK_FOLDED||e.type===ne.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!i),indent:a+c});let g=!1,f=!1,v=xs(e,n,()=>g=!0,()=>f=!0);if(!p&&!n.inFlow&&v.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(i||t==null)return g&&r&&r(),v===""?"?":p?`? ${v}`:v}else if(i&&!d||t==null&&p)return v=`? ${v}`,h&&!g?v+=vn(v,n.indent,l(h)):f&&s&&s(),v;g&&(h=null),p?(h&&(v+=vn(v,n.indent,l(h))),v=`? ${v}
|
|
74
|
+
${a}:`):(v=`${v}:`,h&&(v+=vn(v,n.indent,l(h))));let E,I,S;me(t)?(E=!!t.spaceBefore,I=t.commentBefore,S=t.comment):(E=!1,I=null,S=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!h&&ue(t)&&(n.indentAtStart=v.length+1),f=!1,!u&&c.length>=2&&!n.inFlow&&!p&&ma(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const y=xs(t,n,()=>w=!0,()=>f=!0);let $=" ";if(h||E||I){if($=E?`
|
|
75
|
+
`:"",I){const k=l(I);$+=`
|
|
76
|
+
${wr(k,n.indent)}`}y===""&&!n.inFlow?$===`
|
|
77
|
+
`&&S&&($=`
|
|
78
|
+
|
|
79
|
+
`):$+=`
|
|
80
|
+
${n.indent}`}else if(!p&&Pe(t)){const k=y[0],b=y.indexOf(`
|
|
81
|
+
`),T=b!==-1,L=n.inFlow??t.flow??t.items.length===0;if(T||!L){let M=!1;if(T&&(k==="&"||k==="!")){let D=y.indexOf(" ");k==="&"&&D!==-1&&D<b&&y[D+1]==="!"&&(D=y.indexOf(" ",D+1)),(D===-1||b<D)&&(M=!0)}M||($=`
|
|
82
|
+
${n.indent}`)}}else(y===""||y[0]===`
|
|
83
|
+
`)&&($="");return v+=$+y,n.inFlow?w&&r&&r():S&&!w?v+=vn(v,n.indent,l(S)):f&&s&&s(),v}function w0(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Gr="<<",Li={identify:e=>e===Gr||typeof e=="symbol"&&e.description===Gr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ne(Symbol(Gr)),{addToJSMap:Ah}),stringify:()=>Gr},S0=(e,t)=>(Li.identify(t)||ue(t)&&(!t.type||t.type===ne.PLAIN)&&Li.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Li.tag&&n.default);function Ah(e,t,n){const r=Ph(e,n);if(ma(r))for(const s of r.items)Mi(e,t,s);else if(Array.isArray(r))for(const s of r)Mi(e,t,s);else Mi(e,t,r)}function Mi(e,t,n){const r=Ph(e,n);if(!Sh(r))throw new Error("Merge sources must be maps or map aliases");const s=r.toJSON(null,e,Map);for(const[i,o]of s)t instanceof Map?t.has(i)||t.set(i,o):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Ph(e,t){return e&&Dn(t)?t.resolve(e.doc,e):t}function xh(e,t,{key:n,value:r}){if(me(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(S0(e,n))Ah(e,t,r);else{const s=Je(n,"",e);if(t instanceof Map)t.set(s,Je(r,s,e));else if(t instanceof Set)t.add(s);else{const i=E0(n,s,e),o=Je(r,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}function E0(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(me(e)&&n?.doc){const r=_0(n.doc,{});r.anchors=new Set;for(const i of n.anchors.keys())r.anchors.add(i.anchor);r.inFlow=!0,r.inStringifyKey=!0;const s=e.toString(r);if(!n.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),w0(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}function va(e,t,n){const r=Ps(e,void 0,n),s=Ps(t,void 0,n);return new ht(r,s)}class ht{constructor(t,n=null){Object.defineProperty(this,it,{value:wh}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return me(n)&&(n=n.clone(t)),me(r)&&(r=r.clone(t)),new ht(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return xh(n,r,this)}toString(t,n,r){return t?.doc?b0(this,t,n,r):JSON.stringify(this)}}function $h(e,t,n){return(t.inFlow??e.flow?T0:k0)(e,t,n)}function k0({comment:e,items:t},n,{blockItemPrefix:r,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:i,type:null});let d=!1;const h=[];for(let g=0;g<t.length;++g){const f=t[g];let v=null;if(me(f))!d&&f.spaceBefore&&h.push(""),$s(n,h,f.commentBefore,d),f.comment&&(v=f.comment);else if(fe(f)){const I=me(f.key)?f.key:null;I&&(!d&&I.spaceBefore&&h.push(""),$s(n,h,I.commentBefore,d))}d=!1;let E=xs(f,u,()=>v=null,()=>d=!0);v&&(E+=vn(E,i,l(v))),d&&v&&(d=!1),h.push(r+E)}let p;if(h.length===0)p=s.start+s.end;else{p=h[0];for(let g=1;g<h.length;++g){const f=h[g];p+=f?`
|
|
84
|
+
${c}${f}`:`
|
|
85
|
+
`}}return e?(p+=`
|
|
86
|
+
`+wr(l(e),c),a&&a()):d&&o&&o(),p}function T0({items:e},t,{flowChars:n,itemIndent:r}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;r+=i;const c=Object.assign({},t,{indent:r,inFlow:!0,type:null});let l=!1,u=0;const d=[];for(let g=0;g<e.length;++g){const f=e[g];let v=null;if(me(f))f.spaceBefore&&d.push(""),$s(t,d,f.commentBefore,!1),f.comment&&(v=f.comment);else if(fe(f)){const I=me(f.key)?f.key:null;I&&(I.spaceBefore&&d.push(""),$s(t,d,I.commentBefore,!1),I.comment&&(l=!0));const S=me(f.value)?f.value:null;S?(S.comment&&(v=S.comment),S.commentBefore&&(l=!0)):f.value==null&&I?.comment&&(v=I.comment)}v&&(l=!0);let E=xs(f,c,()=>v=null);l||(l=d.length>u||E.includes(`
|
|
87
|
+
`)),g<e.length-1?E+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=d.reduce((I,S)=>I+S.length+2,2)+(E.length+2)>t.options.lineWidth)),l&&(E+=",")),v&&(E+=vn(E,r,a(v))),d.push(E),u=d.length}const{start:h,end:p}=n;if(d.length===0)return h+p;if(!l){const g=d.reduce((f,v)=>f+v.length+2,2);l=t.options.lineWidth>0&&g>t.options.lineWidth}if(l){let g=h;for(const f of d)g+=f?`
|
|
88
|
+
${i}${s}${f}`:`
|
|
89
|
+
`;return`${g}
|
|
90
|
+
${s}${p}`}else return`${h}${o}${d.join(" ")}${o}${p}`}function $s({indent:e,options:{commentString:t}},n,r,s){if(r&&s&&(r=r.replace(/^\n+/,"")),r){const i=wr(t(r),e);n.push(i.trimStart())}}function Ht(e,t){const n=ue(t)?t.value:t;for(const r of e)if(fe(r)&&(r.key===t||r.key===n||ue(r.key)&&r.key.value===n))return r}class hn extends Oh{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Yt,t),this.items=[]}static from(t,n,r){const{keepUndefined:s,replacer:i}=r,o=new this(t),a=(c,l)=>{if(typeof i=="function")l=i.call(n,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(va(c,l,r))};if(n instanceof Map)for(const[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;fe(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new ht(t,t?.value):r=new ht(t.key,t.value);const s=Ht(this.items,r.key),i=this.schema?.sortMapEntries;if(s){if(!n)throw new Error(`Key ${r.key} already set`);ue(s.value)&&Th(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(a=>i(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=Ht(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=Ht(this.items,t)?.value;return(!n&&ue(s)?s.value:s)??void 0}has(t){return!!Ht(this.items,t)}set(t,n){this.add(new ht(t,n),!0)}toJSON(t,n,r){const s=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(s);for(const i of this.items)xh(n,s,i);return s}toString(t,n,r){if(!t)return JSON.stringify(this);for(const s of this.items)if(!fe(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),$h(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}class Rh extends Oh{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(kr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Wr(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Wr(t);if(typeof r!="number")return;const s=this.items[r];return!n&&ue(s)?s.value:s}has(t){const n=Wr(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Wr(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[r];ue(s)&&Th(n)?s.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let s=0;for(const i of this.items)r.push(Je(i,String(s++),n));return r}toString(t,n,r){return t?$h(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let a of n){if(typeof s=="function"){const c=n instanceof Set?a:String(o++);a=s.call(n,c,a)}i.items.push(Ps(a,void 0,r))}}return i}}function Wr(e){let t=ue(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}function O0(e,t,n){const{replacer:r}=n,s=new Rh(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(va(a,c,n))}return s}class ya extends Rh{constructor(){super(),this.add=hn.prototype.add.bind(this),this.delete=hn.prototype.delete.bind(this),this.get=hn.prototype.get.bind(this),this.has=hn.prototype.has.bind(this),this.set=hn.prototype.set.bind(this),this.tag=ya.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const s of this.items){let i,o;if(fe(s)?(i=Je(s.key,"",n),o=Je(s.value,i,n)):i=Je(s,"",n),r.has(i))throw new Error("Ordered maps must not include duplicate keys");r.set(i,o)}return r}static from(t,n,r){const s=O0(t,n,r),i=new this;return i.items=s.items,i}}ya.tag="tag:yaml.org,2002:omap";class ba extends hn{constructor(t){super(t),this.tag=ba.tag}add(t){let n;fe(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new ht(t.key,null):n=new ht(t,null),Ht(this.items,n.key)||this.items.push(n)}get(t,n){const r=Ht(this.items,t);return!n&&fe(r)?ue(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Ht(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new ht(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:s}=r,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof s=="function"&&(o=s.call(n,o,o)),i.items.push(va(o,null,r));return i}}ba.tag="tag:yaml.org,2002:set";new Set("0123456789ABCDEFabcdef");new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");new Set(",[]{}");new Set(` ,[]{}
|
|
91
|
+
\r `);const I0=["verified","refuted","unverifiable"],A0=["oauth2-dcr","oauth2-cimd","oauth2-preregistered","api-key","none"],P0=["omit","fixed","challenge","all-supported"],x0=["none","client_secret_basic","client_secret_post"],$0=["callTool","sendFollowUpMessage","setWidgetState","requestDisplayMode","notifyIntrinsicHeight","openExternal","setOpenInAppUrl","requestModal","uploadFile","selectFiles","getFileDownloadUrl","requestCheckout","requestClose"];new Set($0);const R0=["availableDisplayModes","toolInputPartial","toolCancelled","hostContextChanged","resourceTeardown","toolInfo","openLinks","serverTools","serverResources","logging","updateModelContext","message","sandboxPermissions","cspFrameDomains","cspBaseUriDomains","cspConnectDomains","cspResourceDomains","resourceCacheTtl","toolResult","resourcePrefersBorder","downloadFile","requestTeardown","safeAreaInsets","widgetDisplayModeRequests"];new Set(R0);const C0=["inline","fullscreen","pip"];new Set(C0);const zl=["mode","originAllowlist"];new Set(zl),new Set(zl);const N0=["profileVersion","sendsResourceIndicator","oauthSpecVersion","protocolVersionPinning","dcrIdentity","authModel","extensions"];new Set(N0);const L0=["profileVersion","sendsResourceIndicator","oauthSpecVersion","protocolVersionPinning","dcrIdentity","authModel","scopeRequest","tokenEndpointAuthMethod","extensions"];new Set(L0);new Set(P0);new Set(x0);const M0=["status","value","source","capturedAt","reason"];new Set(M0);new Set(I0);new Set(A0);const z0=["clientName","redirectUris","userAgent"];new Set(z0);const D0=/^[A-Za-z]:[\\/]/,F0=/[\u0000-\u001f\u007f]/,j0=new TextEncoder;function U0(e){return j0.encode(e).length}function Z0(e){let t=e.length;for(;t>0;){const n=e[t-1];if(n!=="."&&n!==" ")break;t-=1}return e.slice(0,t)}function Ch(e){if(typeof e!="string"||e.length===0)return{ok:!1,code:"PATH_EMPTY",message:"path is empty"};if(e.includes("\0"))return{ok:!1,code:"PATH_NUL_BYTE",message:"path contains a NUL byte"};if(F0.test(e))return{ok:!1,code:"PATH_INVALID_CHARACTER",message:"path contains control characters"};if(e.startsWith("/")||e.startsWith("\\")||D0.test(e))return{ok:!1,code:"PATH_ABSOLUTE",message:`absolute paths are not allowed: "${e}"`};const t=e.replace(/\\/g,"/").split("/").filter(n=>n!==""&&n!==".");for(const n of t){if(n==="..")return{ok:!1,code:"PATH_TRAVERSAL",message:`path traversal ("..") is not allowed: "${e}"`};if(n.includes(":"))return{ok:!1,code:"PATH_INVALID_CHARACTER",message:`path segments must not contain ":" (drive prefix / alternate data stream): "${e}"`};const r=Z0(n);if(r===""||r==="."||r==="..")return{ok:!1,code:"PATH_INVALID_CHARACTER",message:`path segment "${n}" is not portable (empty or dot name after trailing dot/space stripping)`}}return t.length===0?{ok:!1,code:"PATH_EMPTY",message:"path is empty"}:{ok:!0,path:t.join("/").normalize("NFC")}}function q0(e){return e.normalize("NFKC").toLowerCase()}function Jk(e,t){return t===e||t.startsWith(`${e}/`)}function Yk(e,t){const n=Ch(t);return n.ok?{ok:!0,path:n.path}:n.code==="PATH_ABSOLUTE"||n.code==="PATH_TRAVERSAL"?{ok:!1,code:"PATH_ESCAPES_ROOT",message:`referenced path escapes the bundle root: "${t}"`}:n}function Kk(e,t,n){e.length>t.maxEntries&&n.error("BUNDLE_TOO_MANY_ENTRIES",`bundle has ${e.length} entries; the limit is ${t.maxEntries}`);const r=new Set,s=new Map,i=[];let o=0,a=!1;for(const c of e){if(c.kind==="symlink"||c.kind==="hardlink"){n.error("PATH_LINK_ENTRY",`${c.kind} entries are not allowed`,{path:c.path});continue}const l=Ch(c.path);if(!l.ok){n.error(l.code,l.message,{path:c.path});continue}const u=l.path;if(U0(u)>t.maxPathBytes){n.error("PATH_TOO_LONG",`path exceeds ${t.maxPathBytes} bytes`,{path:u});continue}if(u.split("/").length>t.maxPathDepth){n.error("PATH_TOO_DEEP",`path exceeds nesting depth ${t.maxPathDepth}`,{path:u});continue}if(r.has(u)){n.error("PATH_DUPLICATE",`duplicate normalized path: "${u}"`,{path:c.path});continue}r.add(u);const d=q0(u),h=s.get(d);if(h!==void 0){n.error("PATH_CASE_COLLISION",`"${u}" collides with "${h}" on case-insensitive filesystems`,{path:u});continue}if(s.set(d,u),c.kind!=="directory"){if(!Number.isFinite(c.size)||c.size<0){n.error("FILE_SIZE_MISMATCH","entry declares an invalid size",{path:u});continue}if(c.size>t.maxFileBytes){n.error("FILE_TOO_LARGE",`file exceeds the per-file limit of ${t.maxFileBytes} bytes`,{path:u});continue}o+=c.size,!a&&o>t.maxTotalBytes&&(a=!0,n.error("BUNDLE_TOO_LARGE",`total uncompressed content exceeds ${t.maxTotalBytes} bytes`)),i.push({sourcePath:c.path,path:u,size:c.size})}}return i.sort((c,l)=>c.path<l.path?-1:c.path>l.path?1:0),i}new TextDecoder("utf-8",{fatal:!1});const B0=new Set(["access_token","refresh_token","id_token","client_secret","code","code_verifier","authorization_code","authorization","state","cookie","set_cookie","api_key"]),H0=[/^authorization$/i,/^proxy-authorization$/i,/^cookie$/i,/^set-cookie$/i,/^x-api-key$/i,/^api-key$/i,/^apikey$/i,/^x-auth-token$/i,/^x-csrf-token$/i,/^x-session-token$/i,/^x-access-token$/i,/^x-refresh-token$/i,/^x-client-secret$/i,/^x-credential$/i];function wa(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^a-zA-Z0-9]+/g,"_").toLowerCase()}const V0=["_type","_types","_endpoint","_endpoints","_supported","_method","_methods","_uri","_uris","_url","_urls","_alg","_algs","_values","_in"];function G0(e){return V0.some(t=>e.endsWith(t))}function Sa(e){return B0.has(e)?!0:G0(e)?!1:/(^|_)(token|secret|password|credential|cookie|auth)(_|$)/.test(e)||/(^|_)api_?key(_|$)/.test(e)}function W0(e){return Sa(wa(e))}function J0(e){const t=wa(e);return Sa(t)||H0.some(n=>n.test(e))}function Y0(e){return Sa(wa(e))}function Ea(e){return typeof e!="string"||e.length<=8?"[redacted]":`${e.slice(0,4)}...[redacted]...${e.slice(-2)}`}const Nh="client_secret|access_token|refresh_token|id_token|code_verifier|code|assertion|password|api[-_]?key|token|secret|state",Lh=new RegExp(`(^|[^\\w-])((?:[\\w-]*[_-])?(?:${Nh}))=[^&\\s"'<>]+`,"gi"),Mh=`(?:(?:[\\w-]*[_-])?(?:${Nh}))`,K0=new RegExp(`("${Mh}"\\s*:\\s*)"(?:\\\\.|[^"\\\\])*"`,"gi"),X0=new RegExp(`("${Mh}"\\s*:\\s*)"(?:\\\\[\\s\\S]?|[^"\\\\])*$`,"gi"),Q0=500,eS=4e3,tS="client[-_]?secret|access[-_]?token|refresh[-_]?token|id[-_]?token|code[-_]?verifier",nS=new RegExp(`\\b((?:[\\w-]*[_-])?(?:${tS}))(\\s*[:=]\\s*)("(?:\\\\.|[^"\\\\])*"|[^&\\s"'<>,;]+)`,"gi");function zh(e){const t=e.replace(/[.,;:!?)\]}]+$/,"");return!/^[a-z]{1,20}$/.test(t)}function rS(e,t,n,r){return zh(r)?`${t}${n}[redacted]`:e}function Dh(e,t={}){const n=t.maxScanned??eS,r=t.maxLength??Q0,s=e.length>n,o=(s?e.slice(0,n):e).replace(/([a-z][a-z0-9+.-]*:\/\/)[^\s/?#]*@/gi,"$1[redacted]@").replace(/(^|[\s(<"'])[^\s/@:]+:[^\s/]+@(?=[\w.-]+)/g,"$1[redacted]@").replace(nS,(c,l,u,d)=>`${l}${u}${d.startsWith('"')?'"[redacted]"':"[redacted]"}`).replace(Lh,"$1$2=[redacted]").replace(/\b((?:proxy-)?authorization\s*[:=]\s*)(bearer|basic)\s+\S+/gi,"$1$2 [redacted]").replace(/\b(bearer|basic)(\s+)(\S+)/gi,rS).replace(K0,'$1"[redacted]"');return(s?o.replace(X0,'$1"[redacted]').replace(/([a-z][a-z0-9+.-]*:\/\/)[^\s/?#]*$/gi,"$1[redacted]"):o).slice(0,r)}function sS(e){if(!e)return;if(typeof e=="string"){const n=e.trim();if(!n)return;if(n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]"))try{const i=JSON.parse(n);if(typeof i=="object"&&i!==null&&!Array.isArray(i)){const o=Object.entries(i).flatMap(([a,c])=>typeof c=="string"?[[a,c]]:typeof c=="number"||typeof c=="boolean"?[[a,String(c)]]:[]);return o.length>0?Object.fromEntries(o):void 0}}catch{}const r=new URLSearchParams(n),s=Object.fromEntries(r.entries());return Object.keys(s).length>0?s:void 0}if(typeof e!="object"||e===null||Array.isArray(e))return;const t=Object.entries(e).flatMap(([n,r])=>typeof r=="string"?[[n,r]]:typeof r=="number"||typeof r=="boolean"?[[n,String(r)]]:[]);return t.length>0?Object.fromEntries(t):void 0}function iS(e){return Object.keys(e).every(t=>t.length<=64&&/^[A-Za-z0-9_.\-[\]]+$/.test(t))}const oS=3;function aS(e,t){return/^https?:\/\//i.test(e)?t>=oS?"[redacted]":Fh(e,t+1):e.replace(Lh,"$1$2=[redacted]")}function Fh(e,t=0){try{const n=new URL(e);n.username="",n.password="";let r=!1;const s=new URLSearchParams;for(const[i,o]of n.searchParams.entries()){const a=Y0(i)?"[redacted]":aS(o,t);r||=a!==o,s.append(i,a)}return r&&(n.search=s.toString()),n.hash&&(n.hash="#[redacted]"),n.toString()}catch{return Dh(e)}}function jh(e){const t=e.trim();if(!t)return e;if(/^https?:\/\//i.test(t))return Fh(t);if(t.includes("=")||t.includes("&")||t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")){const r=sS(t);if(r&&iS(r))return $o(r)}return Dh(t)}function $o(e){return Array.isArray(e)?e.map(t=>$o(t)):typeof e=="string"?jh(e):!e||typeof e!="object"?e:Object.fromEntries(Object.entries(e).map(([t,n])=>W0(t)?[t,Ea(n)]:[t,$o(n)]))}function cS(e){const t=jh(e);return typeof t=="string"?t:Ea(e)}function Xk(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>J0(t)?[t,Ea(n)]:[t,cS(n)]))}function Qk(e){const t=typeof e.callbackState=="string"&&e.callbackState.length>0;return e.issuedState?{statePresent:t,stateMatched:t&&e.callbackState===e.issuedState}:{statePresent:t}}function lS(e){return Ro(e,[])}function Ro(e,t){return Array.isArray(e)?e.map(n=>Ro(n,t)):!e||typeof e!="object"?typeof e=="string"?uS(e):e:Object.fromEntries(Object.entries(e).map(([n,r])=>[n,hS(n,r,t)?"[REDACTED]":Ro(r,[...t,n])]))}function uS(e){return e.replace(/\b(authorization|proxy-authorization|cookie|set-cookie)\s*:\s*[^\r\n]*/giu,(t,n)=>`${n}: [REDACTED]`).replace(/\bBearer(\s+)(\S+)/giu,dS).replace(/\b(access_token|refresh_token|client_secret|id_token|code|code_verifier|accessToken|refreshToken|clientSecret|idToken|codeVerifier)=([^&\s]+)/giu,"$1=[REDACTED]").replace(/(["']?(?:access_token|refresh_token|client_secret|id_token|code|code_verifier|accessToken|refreshToken|clientSecret|idToken|codeVerifier)["']?\s*:\s*["'])[^"']*(["'])/giu,"$1[REDACTED]$2")}function dS(e,t,n){return/^[A-Za-z_][A-Za-z0-9_-]*=/u.test(n)?e:zh(n)?`Bearer${t}[REDACTED]`:e}function hS(e,t,n){const r=e.toLowerCase().replace(/[^a-z0-9]/gu,"");return r==="code"?fS(t,n):r==="authorization"||r==="proxyauthorization"||r==="cookie"||r==="setcookie"?!0:(r==="codeverifier"||r==="accesstoken"||r.endsWith("accesstoken")||r==="refreshtoken"||r.endsWith("refreshtoken")||r==="clientsecret"||r.endsWith("clientsecret")||r==="idtoken"||r.endsWith("idtoken"))&&pS(t)||r==="apikey"||r==="xapikey"}function pS(e){return typeof e=="string"&&e.length>0}function fS(e,t){return t[t.length-1]==="error"||t[t.length-1]==="snapshotError"||typeof e!="string"||/^[A-Z0-9_:-]+$/u.test(e)?!1:e.length>0}const gS="ERA_NEGOTIATION_FAILED";function mS(e){return!!e&&typeof e=="object"&&e.code===gS}function _S(e){const t=new Set;let n=e;for(;mS(n)&&!t.has(n);){t.add(n);const r=n.data,i=(r&&typeof r=="object"?r.cause:void 0)??n.cause;if(i===void 0||i===n)break;n=i}return n}const qe={ParseError:-32700,InvalidRequest:-32600,MethodNotFound:-32601,InvalidParams:-32602,InternalError:-32603,HeaderMismatch:-32020,MissingRequiredClientCapability:-32021,UnsupportedProtocolVersion:-32022,ConnectionClosed:-32e3,UrlElicitationRequired:-32042},vS={UnsupportedProtocolVersion:-32004},yS="/troubleshooting/error-codes",Dl={"jsonrpc/internal_error":"user_server","jsonrpc/invalid_response_format":"user_server","jsonrpc/parse_error":"ambiguous","jsonrpc/method_not_found":"ambiguous","jsonrpc/invalid_params":"ambiguous","jsonrpc/unsupported_protocol_version":"ambiguous","provider/invalid_tool_name":"ambiguous","oauth/well_known_unreachable":"ambiguous","transport/socket_hang_up":"ambiguous","transport/econnrefused":"user_config","transport/enotfound":"user_config","auth/http_401":"user_config","auth/http_403":"user_config","auth/missing_bearer":"user_config","auth/insufficient_scope":"user_config","auth/oauth_refresh_failed":"user_config","auth/consent_required":"user_config","oauth/invalid_client":"user_config","oauth/invalid_grant":"user_config","oauth/redirect_mismatch":"user_config","provider/auth_error":"user_config","provider/quota":"user_config","provider/mcpjam_limit":"user_config","provider/mcpjam_platform_budget":"user_config","account/suspended":"user_config","provider/mcpjam_limit_daily":"user_config","provider/mcpjam_limit_monthly":"user_config","server/rate_limited":"user_server","jsonrpc/missing_required_client_capability":"user_config","jsonrpc/url_elicitation_required":"user_config","sdk/stateless_requires_http":"user_config","sdk/protocol_version_pin_unsupported":"user_config","sdk/not_yet_supported_in_stateless":"mcpjam","sdk/paginated_tool_header_discovery_unsupported":"mcpjam","oauth/no_bearer_challenge":"ambiguous","oauth/non_compliant_challenge":"user_server","auth/authorization_server_unreachable":"ambiguous","auth/proxy_rejected":"ambiguous","jsonrpc/connection_closed":"ambiguous","jsonrpc/request_timeout":"ambiguous","transport/etimedout":"ambiguous","transport/econnreset":"ambiguous","transport/eai_again":"ambiguous","transport/fetch_failed":"ambiguous","transport/undici":"ambiguous","jsonrpc/invalid_request":"ambiguous","jsonrpc/header_mismatch":"ambiguous","internal/unknown":"ambiguous","provider/empty_response":"ambiguous"};function z(e,t,n,r,s,i,o="error"){return{slug:e,title:t,oneLine:n,likelyCauses:r,nextSteps:s,docsAnchor:`${yS}#${i}`,severity:o,...Dl[e]?{origin:Dl[e]}:{}}}const Co={"jsonrpc/parse_error":z("jsonrpc/parse_error","Parse error (-32700)","The MCP wire contained JSON the inspector could not parse as JSON-RPC.",["The server emitted invalid JSON on the response channel.","A proxy or middleware mangled the response body.","Server emitted log output on stdout instead of stderr (STDIO transport).","The inspector sent malformed JSON and the server returned a parse error."],["Check the server's stdout/stderr for unintended log output.","Use the inspector's Traffic Log to inspect the raw response."],"parse-error"),"jsonrpc/invalid_request":z("jsonrpc/invalid_request","Invalid request (-32600)","The server rejected the payload as not a well-formed JSON-RPC request.",["Client sent a request shape the server's MCP runtime does not accept.","Outdated server SDK that disagrees with the protocol version advertised."],["Verify the negotiated MCP protocol version.","Update the server's MCP SDK."],"invalid-request"),"jsonrpc/method_not_found":z("jsonrpc/method_not_found","Method not found (-32601)","The server does not implement the JSON-RPC method that was called.",["The server hasn't implemented the requested MCP method.","Client and server are on incompatible MCP protocol versions.","The capability you expected was not advertised in `initialize`."],["Check the server's advertised capabilities in the connection info.","Confirm the protocol version negotiated at `initialize`."],"method-not-found"),"jsonrpc/invalid_params":z("jsonrpc/invalid_params","Invalid params (-32602)","The server rejected the request parameters.",["Required field is missing from the call.","Field type does not match the tool's input schema.","Server-side validator is stricter than the published schema."],["Re-check the tool's input schema in the Tools tab.","Compare your call payload against the schema in the inspector."],"invalid-params"),"jsonrpc/internal_error":z("jsonrpc/internal_error","Internal error (-32603)","The server hit an unexpected error while handling the request.",["Unhandled exception inside the server's tool/resource/prompt handler.","Downstream dependency (database, API) failed during the call."],["Check the server's logs around the time of the error.","Retry the request once the server is healthy."],"internal-error"),"jsonrpc/invalid_response_format":z("jsonrpc/invalid_response_format","Invalid response format (-32603)","The server replied, but the result was not a valid MCP tool, resource, or prompt payload.",["The handler returned a string or custom object instead of the MCP result shape (usually `{ content: [...] }`)."],["Inspect the result in the Traffic Log and compare it to the MCP result shape.",'Return `{ content: [{ type: "text", text: "..." }] }` from the handler, or the matching resource/prompt result.'],"invalid-response-format"),"jsonrpc/connection_closed":z("jsonrpc/connection_closed","Connection closed (-32000)","The underlying transport closed before the response could be delivered.",["STDIO server process exited or crashed mid-request.","HTTP server dropped the streaming connection.","Network blip between the inspector and the server."],["Restart the server and reconnect.","Check the server logs for a crash or exit message."],"connection-closed"),"jsonrpc/request_timeout":z("jsonrpc/request_timeout","Request timed out (-32001)","The server did not respond within the configured request timeout.",["Server is overloaded or stuck on the operation.","Long-running tool call exceeds the inspector's per-request timeout.","Network latency between client and server."],["Increase the per-server request timeout in the Servers tab.","Use MCP `tasks/*` for operations that legitimately run long."],"request-timeout"),"jsonrpc/header_mismatch":z("jsonrpc/header_mismatch","Protocol header mismatch (-32020)","The server returned an `MCP-Protocol-Version` header that does not match what the client negotiated.",["Server is enforcing a different protocol version than the one negotiated at `initialize`.","A proxy stripped or rewrote the `MCP-Protocol-Version` header."],["Verify the server's protocol-version pinning in the connection settings.","If you set an explicit protocol version per server, ensure it matches what the server advertises."],"header-mismatch"),"jsonrpc/unsupported_protocol_version":z("jsonrpc/unsupported_protocol_version","Unsupported protocol version (-32022)","The server does not support any protocol version this inspector offered.",["Server pinned to a newer MCP draft your inspector build does not understand.","Server pinned to a legacy version this build dropped support for."],["Update the inspector to a newer build.","Check the supported versions list in the server's `server/discover` result (modern) or `initialize` response (legacy)."],"unsupported-protocol-version"),"jsonrpc/missing_required_client_capability":z("jsonrpc/missing_required_client_capability","Missing required client capability (-32021)","The server refused the request because the client did not advertise a capability the operation requires.",["A server-initiated input request (elicitation, sampling) needs a client capability MCPJam did not declare.","The connection advertised a capability set the server considers insufficient for this operation."],["Enable the required client capability in the connection's Client settings.","Check the server's documentation for which client capabilities it requires."],"missing-required-client-capability"),"jsonrpc/url_elicitation_required":z("jsonrpc/url_elicitation_required","URL elicitation required (-32042)","The server needs the user to visit an external URL to complete the operation.",["Server requested a URL elicitation (OAuth, payment, confirmation).","Operation cannot proceed until the user opens the URL in a browser."],["Open the elicited URL and complete the flow.","Re-issue the request after the external step completes."],"url-elicitation-required","warning"),"transport/econnrefused":z("transport/econnrefused","Connection refused","Nothing is listening on the host and port the server URL points at.",["Server isn't running.","Port number is wrong in the server URL.","Server is bound to a different interface (e.g. only `127.0.0.1` but you're connecting via the LAN IP)."],["Start the server.","Double-check the URL's host and port.","For Docker/containers, confirm the port is published to your host."],"econnrefused"),"transport/econnreset":z("transport/econnreset","Connection reset","The remote side closed the TCP connection abruptly.",["Server process crashed mid-request.","Intermediate proxy or load balancer dropped the connection.","Server hit an OS-level resource limit."],["Inspect the server logs for a crash.","Retry the request."],"econnreset"),"transport/etimedout":z("transport/etimedout","Connection timed out","The OS-level TCP connection attempt did not complete in time.",["Wrong host/port in the server URL.","Firewall is silently dropping packets.","Server is overloaded and never accepted the connection."],["Verify the URL is reachable from your machine (e.g. `curl`).","Check firewall / VPN rules."],"etimedout"),"transport/enotfound":z("transport/enotfound","Host not found","DNS lookup failed for the server's hostname.",["Hostname is misspelled in the URL.","DNS resolver is misconfigured.","You're offline."],["Confirm the hostname in the URL is correct.","Try resolving the host with `nslookup` or `dig`."],"enotfound"),"transport/eai_again":z("transport/eai_again","Temporary DNS failure","DNS resolution failed with a transient error.",["Local DNS resolver is overloaded or restarting.","Upstream DNS server is briefly unavailable."],["Wait a few seconds and retry.","Switch to a different DNS resolver if this persists."],"eai-again","warning"),"transport/undici":z("transport/undici","HTTP transport error","The underlying HTTP client (undici / fetch) reported a low-level transport failure.",["Server closed the connection mid-response.","TLS handshake failed.","Socket-level error during streaming."],["Inspect the Traffic Log for the failed request.","Verify the server's TLS certificate is valid."],"undici-transport-error"),"transport/fetch_failed":z("transport/fetch_failed","Fetch failed","The HTTP request never produced a response.",["Server is unreachable (offline, wrong URL, blocked by firewall).","TLS handshake failed (self-signed cert, expired cert).","Mixed-content block (HTTPS page calling HTTP endpoint in browser)."],["Open the URL in a browser to confirm it loads.","If self-signed, install the certificate or switch to a trusted one."],"fetch-failed"),"transport/socket_hang_up":z("transport/socket_hang_up","Socket hang up","The server closed the connection without sending a response.",["Server crashed or restarted during the request.","Reverse proxy timed the request out."],["Retry the request.","Check server-side logs for the crash."],"socket-hang-up"),"auth/http_401":z("auth/http_401","Unauthorized (401)","The server requires authentication that wasn't provided or is no longer valid.",["Missing or expired bearer token.","OAuth access token expired and refresh failed.","Server changed its required authentication scheme."],["Re-authenticate using the Reconnect button on the server card.","If using OAuth, run through the OAuth flow again from Servers."],"unauthorized-401"),"auth/http_403":z("auth/http_403","Forbidden (403)","You authenticated successfully but lack permission for the operation.",["OAuth scopes granted don't cover the requested operation.","Server-side ACL blocks this account."],["Re-run OAuth and request the additional scopes if the server allows.","Ask the server admin to grant the necessary permissions."],"forbidden-403"),"auth/oauth_refresh_failed":z("auth/oauth_refresh_failed","OAuth token refresh failed","An expired OAuth access token could not be refreshed.",["Refresh token was revoked.","Refresh token expired.","Server returned `invalid_grant` to the refresh attempt."],["Click Reconnect on the server card to run a fresh OAuth flow."],"oauth-refresh-failed"),"auth/consent_required":z("auth/consent_required","Sign-in required","This server needs your permission before it can connect.",["Reconnect ran without opening the sign-in prompt, so no OAuth token exists for this server yet."],["Click Reconnect and approve the request in the window that opens."],"consent-required","warning"),"auth/missing_bearer":z("auth/missing_bearer","Missing bearer token","The API call did not include the required `Authorization: Bearer ...` header.",["Inspector session expired.","Sign-in token failed to attach to the request."],["Refresh the page and sign in again."],"missing-bearer"),"auth/insufficient_scope":z("auth/insufficient_scope","Insufficient scope (403)","The server reported insufficient_scope: the grant does not cover this operation.",["The authorization did not request the scopes the server now requires.","The server added a scope requirement after the grant was issued."],["Re-authorize and grant the scopes the server names in its challenge."],"insufficient-scope"),"auth/authorization_server_unreachable":z("auth/authorization_server_unreachable","Authorization server unreachable","The stored token could not be refreshed because the authorization server was unreachable or did not return a usable response.",["The authorization server is down or slow.","The refresh request could not leave the network it was made from."],["Retry in a minute; if it persists, check the authorization server's status.","Reconnect the server to obtain a fresh token once the authorization server is reachable."],"authorization-server-unreachable","warning"),"auth/proxy_rejected":z("auth/proxy_rejected","HTML access rejection (403)","The response was HTTP 403 with an HTML content type and no authentication challenge; a proxy or firewall may be involved.",["An IP allowlist or WAF blocks the address the request came from.","A corporate proxy or SSO portal intercepted the request."],["Allow MCPJam's egress addresses, or the address you connect from, on the server's firewall.","Open the server URL in a browser from the same network to see what answers."],"proxy-rejected"),"oauth/no_bearer_challenge":z("oauth/no_bearer_challenge","401 without a Bearer challenge","The response was HTTP 401 without a Bearer challenge. This response did not explain how to authorize.",["The server or an intermediary omitted a Bearer challenge.","The server expects a static API key and does not implement OAuth."],["Check OAuth discovery, including the well-known metadata fallback supported by newer MCP versions.","If the server expects an API key, configure it as a header on the server instead of OAuth."],"no-bearer-challenge"),"oauth/non_compliant_challenge":z("oauth/non_compliant_challenge","Bearer challenge on the wrong status","The response reported invalid_token with HTTP 403; MCP requires HTTP 401 for an invalid or expired token.",["The server maps every authorization failure to 403.","A gateway rewrites the server's 401 to 403."],["Re-authorize the server to replace the rejected token.","Report the status mismatch to the server author; invalid-token recovery expects HTTP 401."],"non-compliant-challenge","warning"),"oauth/invalid_grant":z("oauth/invalid_grant","OAuth: invalid grant","The OAuth server rejected the authorization code or refresh token.",["Authorization code was already redeemed.","Refresh token was revoked.","Authorization code expired (typical lifetime ~60s)."],["Start the OAuth flow again from the server card."],"oauth-invalid-grant"),"oauth/invalid_client":z("oauth/invalid_client","OAuth: invalid client","The OAuth server does not recognize the client credentials.",["Client was deleted on the authorization server.","Dynamic registration cache is stale.","`client_id` was rotated server-side."],["Re-register the client (Reconnect from the server card triggers DCR if supported)."],"oauth-invalid-client"),"oauth/redirect_mismatch":z("oauth/redirect_mismatch","OAuth: redirect URI mismatch","The redirect URI in the request does not match the one registered with the OAuth server.",["Authorization server requires the inspector's callback URL to be registered explicitly.","Server's allow-list is wrong."],["Add the inspector's callback URL to the OAuth server's allowed redirects.","Verify the inspector's base URL hasn't changed."],"oauth-redirect-mismatch"),"oauth/well_known_unreachable":z("oauth/well_known_unreachable","OAuth metadata unreachable","The OAuth `.well-known` discovery endpoint could not be fetched.",["Authorization server is down.","Wrong issuer URL.","CORS blocks the discovery request from the browser."],["Confirm the issuer URL in the server config.","Open the `.well-known/openid-configuration` (or `oauth-authorization-server`) URL in a browser."],"oauth-well-known-unreachable"),"sdk/not_yet_supported_in_stateless":z("sdk/not_yet_supported_in_stateless","Operation not supported on stateless transport","The inspector's stateless HTTP transport does not yet implement this MCP operation.",["Operation requires a server-initiated channel (subscriptions, MRTR) the stateless preview transport hasn't wired up yet."],["Switch the server to the legacy stateful transport in its protocol-mode toggle."],"not-yet-supported-in-stateless","warning"),"sdk/stateless_requires_http":z("sdk/stateless_requires_http","Stateless transport requires HTTP","Stateless mode can only be used with an HTTP-transport server, not STDIO.",["You enabled the stateless protocol toggle on a stdio server."],["Disable the stateless toggle for stdio servers."],"stateless-requires-http"),"sdk/protocol_version_pin_unsupported":z("sdk/protocol_version_pin_unsupported","Server doesn't support the pinned protocol version","This connection is pinned to one MCP protocol version, and the server does not offer it.",["The client profile you're emulating pins a protocol version this server hasn't adopted — a host set to the latest revision against a server that still speaks a 2025 one.","A per-server protocol override left pinned to a version the server dropped or never shipped."],["Set the protocol version to Automatic to negotiate whatever the server does support.","Or pick the version the server advertises — `server/discover` (modern) or the `initialize` response (legacy) lists them."],"protocol-version-pin-unsupported"),"sdk/paginated_tool_header_discovery_unsupported":z("sdk/paginated_tool_header_discovery_unsupported","Paginated tool discovery not supported with header overrides","Paginated tools discovery cannot run alongside per-request header overrides on this transport.",["Conflicting combination of progressive tool discovery + per-server header overrides."],["Disable progressive tool discovery for this server, or move headers into the server config."],"paginated-tool-and-header-discovery-unsupported","warning"),"provider/invalid_tool_name":z("provider/invalid_tool_name","Provider rejected the tool name","An LLM provider rejected a tool name (Anthropic's strict tool-name validator is the most common source).",["Tool name contains characters or length the provider does not allow.","Two attached servers expose tools whose namespaced names collide after sanitization."],["Rename the offending tool on the server.","Detach one of the colliding servers from the chat surface."],"provider-invalid-tool-name"),"provider/auth_error":z("provider/auth_error","Provider authentication error","Your LLM provider rejected the API key for this request.",["Key is missing.","Key is invalid or revoked.","Key is for a different environment (project, region)."],["Add or update your API key under Settings → LLM Providers.","Verify the key in the provider's dashboard."],"provider-auth-error"),"provider/mcpjam_limit_daily":z("provider/mcpjam_limit_daily","Out of MCPJam credits","Your organization's daily MCPJam credits are used up. They reset tomorrow.",["Chat, evals and swarm generation all draw on one daily bucket, shared across the organization."],["On Free, upgrade for a larger monthly allowance and access to top-ups. On eligible paid plans, buy shared credits to continue testing.","Wait for the daily allowance to reset.","Your own API key covers supported model inference. MCPJam features can still require credits; Swarm generation and persona turns always do."],"out-of-mcpjam-credits","warning"),"provider/mcpjam_limit_monthly":z("provider/mcpjam_limit_monthly","Out of MCPJam credits","Your organization's available MCPJam credits are used up for this billing period.",["Paid plans include a monthly credit allowance shared across the organization. It renews with the billing period."],["On Free, upgrade for a larger monthly allowance and access to top-ups. On eligible paid plans, buy shared credits to continue testing.","Wait for the billing period to renew.","Your own API key covers supported model inference. MCPJam features can still require credits; Swarm generation and persona turns always do."],"out-of-mcpjam-credits","warning"),"provider/mcpjam_platform_budget":z("provider/mcpjam_platform_budget","MCPJam shared free allowance unavailable","The shared free allowance is exhausted or temporarily paused.",["This limit applies across free usage, not just your account."],["Wait until the supplied reset time, if present.","Use purchased credits or your own provider key for chat."],"mcpjam-platform-budget","warning"),"account/suspended":z("account/suspended","Account suspended","This account has been suspended by MCPJam.",["Support has suspended this account."],["Contact founders@mcpjam.com for support."],"account-suspended","warning"),"provider/mcpjam_limit":z("provider/mcpjam_limit","Out of MCPJam credits","Your organization is out of MCPJam credits, so this request could not continue.",["Chat, evals and swarm generation all draw on the same MCPJam allowance."],["On Free, upgrade for a larger monthly allowance and access to top-ups. On eligible paid plans, buy shared credits to continue testing.","Wait for the allowance to reset.","Your own API key covers supported model inference. MCPJam features can still require credits; Swarm generation and persona turns always do."],"out-of-mcpjam-credits","warning"),"provider/quota":z("provider/quota","Provider quota / rate limit","Your LLM provider rejected the request because you hit a rate limit or quota.",["Daily/monthly quota exhausted.","Per-minute rate limit exceeded.","Free tier limits hit."],["Wait for the limit window to reset.","Upgrade your provider plan.","Switch to a different provider in Settings."],"provider-quota","warning"),"server/rate_limited":z("server/rate_limited","MCP server rate limit","The MCP server rejected the request with HTTP 429 (too many requests).",["The server enforces its own per-client rate limit.","An upstream API the server calls is throttling it.","A burst of tool calls exceeded what the server allows."],["Wait for the server's limit window to reset, then retry.","Reduce concurrency or the number of tool calls in the run.","Check the server's own rate-limit documentation or logs."],"server-rate-limited","warning"),"provider/empty_response":z("provider/empty_response","Model returned no response","The model returned no response, so the turn could not complete.",["The model request ended without usable content."],["Rerun the affected cases. If this recurs, report it with the run details."],"model-empty-response"),"internal/unknown":z("internal/unknown","Unknown error","An error occurred that the inspector could not classify.",["Unhandled error path.","New error class the inspector hasn't been taught about yet."],["Open the details panel and copy the raw message.","File an issue with the raw message so we can add it to the catalog."],"unknown-error")};function Uh(e,t=0){if(!e||typeof e!="object"||t>3)return;const n=e.code,r=typeof n=="string"?n:void 0;if(r!==void 0&&bS(r))return r;const s=e.cause;if(s!==void 0&&s!==e){const i=Uh(s,t+1);if(i!==void 0)return i}return r}function bS(e){return wS.has(e)||e.startsWith("UND_ERR_")}const wS=new Set(["ECONNREFUSED","ECONNRESET","EAI_AGAIN","ENETDOWN","ENETUNREACH","ENOTFOUND","EPIPE","ETIMEDOUT","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_SOCKET"]);function SS(e){return!!e&&typeof e=="object"&&typeof e.slug=="string"&&typeof e.title=="string"&&typeof e.oneLine=="string"&&typeof e.docsAnchor=="string"&&typeof e.severity=="string"&&typeof e.rawMessage=="string"&&Array.isArray(e.likelyCauses)&&Array.isArray(e.nextSteps)}function Qs(e){const t=lS(e);return typeof t=="string"?t:String(e)}function ES(e){if(!e||typeof e!="object")return;const t=e.name;return typeof t=="string"?t:void 0}function ka(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;if(e==null)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function Zh(e){if(!e||typeof e!="object")return;const t=e.code;if(typeof t=="number"&&Number.isFinite(t))return t;const n=e.error;if(n&&typeof n=="object"){const r=n.code;if(typeof r=="number"&&Number.isFinite(r))return r}}function kS(e){if(!e||typeof e!="object")return;const t=e.code;return typeof t=="string"?t:void 0}function TS(e){if(!e||typeof e!="object")return;const t=e.statusCode;if(typeof t=="number")return t;const n=e.status;if(typeof n=="number")return n}function qh(e){return Co[e]??Co["internal/unknown"]}const Fl=200;function OS(e){const t=e.replace(/\s+/g," ").trim();return t.length<=Fl?t:`${t.slice(0,Fl-1).trimEnd()}…`}function Bh(e,t,n){return t!=="internal/unknown"||!n?e:{...e,oneLine:OS(n)}}const IS=["Backend step returned no content (stream error or empty response)","Backend step returned no messages (stream error or empty response)"];function AS(e){if(/NotYetSupportedInStateless/i.test(e))return"sdk/not_yet_supported_in_stateless";if(/StatelessRequiresHttpTransport/i.test(e))return"sdk/stateless_requires_http";if(/PaginatedToolHeaderDiscoveryUnsupported/i.test(e))return"sdk/paginated_tool_header_discovery_unsupported";if(/which this client is pinned to/i.test(e))return"sdk/protocol_version_pin_unsupported"}const PS={[qe.ParseError]:"jsonrpc/parse_error",[qe.InvalidRequest]:"jsonrpc/invalid_request",[qe.MethodNotFound]:"jsonrpc/method_not_found",[qe.InvalidParams]:"jsonrpc/invalid_params",[qe.InternalError]:"jsonrpc/internal_error",[qe.ConnectionClosed]:"jsonrpc/connection_closed",[qe.HeaderMismatch]:"jsonrpc/header_mismatch",[qe.MissingRequiredClientCapability]:"jsonrpc/missing_required_client_capability",[qe.UnsupportedProtocolVersion]:"jsonrpc/unsupported_protocol_version",[vS.UnsupportedProtocolVersion]:"jsonrpc/unsupported_protocol_version",[qe.UrlElicitationRequired]:"jsonrpc/url_elicitation_required"};function xS(e){return/header[^a-z]*mismatch/i.test(e)||/MCP-Protocol-Version/i.test(e)?"jsonrpc/header_mismatch":"jsonrpc/request_timeout"}const $S=/^(?:MCP error -32603:\s*)?invalid response format$/i;function Hh(e){return $S.test(e.trim())}function RS(e){return Hh(e)?"jsonrpc/invalid_response_format":"jsonrpc/internal_error"}function Vh(e){const t=e.toUpperCase();switch(t){case"ECONNREFUSED":return"transport/econnrefused";case"ECONNRESET":return"transport/econnreset";case"ETIMEDOUT":return"transport/etimedout";case"ENOTFOUND":return"transport/enotfound";case"EAI_AGAIN":return"transport/eai_again";default:return t.startsWith("UND_ERR_")?"transport/undici":void 0}}function CS(e){const t=e.toLowerCase();if(/\bsocket\s+hang\s+up\b/i.test(e))return"transport/socket_hang_up";for(const n of e.matchAll(/\b(E[A-Z]{2,}(?:_[A-Z]+)*|UND_ERR_[A-Z_]+)\b/g)){const r=Vh(n[1]);if(r)return r}if(/\bfetch\s+failed\b/i.test(e))return"transport/fetch_failed";if(/\bgetaddrinfo\b/i.test(e))return"transport/enotfound";if(/\bconnection\s+(?:refused|reset|closed|timed?\s*out|aborted|error|failed)\b/i.test(e)||/\b(?:failed|unable)\s+to\s+connect\b/i.test(e))return t.includes("refused")?"transport/econnrefused":t.includes("reset")?"transport/econnreset":t.includes("timed out")||t.includes("timeout")?"transport/etimedout":t.includes("closed")?"jsonrpc/connection_closed":"transport/fetch_failed";if(/Invalid tool name/i.test(e))return"provider/invalid_tool_name";if(Hh(e))return"jsonrpc/invalid_response_format"}function NS(e){const t=MS(e);if(!t)return;const n=LS(e)??(typeof t.error=="string"?t.error:typeof t.error_code=="string"?t.error_code:void 0);if(n)switch(n.toLowerCase()){case"invalid_grant":return"oauth/invalid_grant";case"invalid_client":return"oauth/invalid_client";case"invalid_redirect_uri":case"redirect_uri_mismatch":return"oauth/redirect_mismatch";default:return}}function LS(e){if(!e||typeof e!="object"||e.name!=="OAuthResponseError")return;const t=e.code;return typeof t=="string"&&t?t:void 0}function MS(e){if(!e||typeof e!="object")return;const t="body"in e?e.body:"data"in e?e.data:e;if(!(!t||typeof t!="object"))return t}function Gh(e){if(!(e instanceof Error))return;const t=e.cause;if(!t||typeof t!="object")return;const n=typeof t.name=="string"?t.name:"Error",r=typeof t.message=="string"?Qs(t.message):"";if(r)return{name:n,message:r}}const jl={AUTH_ERROR:"auth/http_401",OAUTH_REQUIRED:"auth/http_401"};function zS(e){const t=ES(e);if(t==="MCPAuthError"||t==="UnauthorizedError")return"auth/http_401";const n=kS(e);if(n&&jl[n])return jl[n]}function Ul(e){if(e===401)return"auth/http_401";if(e===403)return"auth/http_403";if(e===429)return"provider/quota"}function DS(e){if(/(?:^|[^\w.:])401\b/.test(e))return"auth/http_401";if(/(?:^|[^\w.:])403\b/.test(e))return"auth/http_403";if(/(?:^|[^\w.:])429\b|too many requests/i.test(e))return"provider/quota"}function FS(e){const t=ka(e),n=e&&typeof e=="object"?e:null,r=n?.data?.code??n?.code;if(r==="platform_free_budget_exhausted")return{slug:"provider/mcpjam_platform_budget",rawCode:r};if(r==="account_suspended")return{slug:"account/suspended",rawCode:r};if(IS.some(p=>t.startsWith(p)))return{slug:"provider/empty_response"};const s=AS(t);if(s)return{slug:s};const i=zS(e);if(i)return{slug:i};const o=Zh(e);if(o!==void 0){if(o===-32001)return{slug:xS(t),rawCode:o};if(o===qe.InternalError)return{slug:RS(t),rawCode:o};const p=PS[o];if(p)return{slug:p,rawCode:o};const g=Ul(o);if(g)return{slug:g,rawCode:o}}const a=Uh(e);if(a){const p=Vh(a);if(p)return{slug:p,rawCode:a}}if(/missing\s+(?:or\s+invalid\s+)?bearer/i.test(t)||/bearer\s+token\s+(?:is\s+)?required/i.test(t))return{slug:"auth/missing_bearer"};if(/\bout of MCPJam credits\b/i.test(t))return{slug:"provider/mcpjam_limit"};const c=VS(t);if(c)return{slug:c};const l=Wh(e);if(l!==void 0){const p=Ul(l);if(p)return{slug:p,rawCode:l}}const u=NS(e);if(u)return{slug:u};const d=DS(t);if(d)return{slug:d};if(/refresh\s+token/i.test(t)&&/(failed|invalid|expired|revoked)/i.test(t))return{slug:"auth/oauth_refresh_failed"};if(/consent\s+is\s+required/i.test(t)||/^\s*reauthenticate\b[\s\S]*\bto\s+continue\b/i.test(t))return{slug:"auth/consent_required"};const h=CS(t);return h?{slug:h}:/well[-_]?known/i.test(t)&&/(unreachable|fail|404)/i.test(t)?{slug:"oauth/well_known_unreachable"}:{slug:"internal/unknown"}}function Wh(e){const t=new Set;let n=e;for(let r=0;r<5&&n&&typeof n=="object"&&!t.has(n);r++){t.add(n);const s=TS(n);if(s!==void 0)return s;const i=Zh(n);if(i!==void 0&&i>=100&&i<=599)return i;if(n.name==="UnauthorizedError")return 401;const o=_S(n);n=o!==n?o:n.cause}}function jS(e,t,n){return e}const US=new Set(["user_server","user_config","mcpjam","ambiguous"]);function ZS(e){return typeof e=="string"&&US.has(e)}function qS(e){const t=e?.origin;return ZS(t)?t:"ambiguous"}function Jh(e,t,n){return e}function BS(e,t){return e}function HS(e,t){try{const n=Qs(ka(e)),r=void 0,s=r?{slug:r}:FS(e),i=BS(s.slug,t),o=s.rawCode??(r?Wh(e):void 0),a=Jh(jS(Bh(qh(i),i,n),i,t),i,t),c=Gh(e);return{...a,rawMessage:n,...o!==void 0?{rawCode:o}:{},...c?{cause:c}:{}}}catch{return Yh(e,"Unknown")}}function eT(e,t,n){try{const r=Jh(qh(e),e,n),s=t!==void 0?Qs(ka(t)):"",i=Gh(t);return{...r,rawMessage:s,...i?{cause:i}:{}}}catch{return Yh(t,"")}}function Yh(e,t){const n=Co["internal/unknown"];let r=t;try{const s=e instanceof Error?e.message:String(e??t);r=Qs(s)}catch{r=t}return{...Bh(n,"internal/unknown",r),rawMessage:r}}function VS(e){const t=/\b(daily|monthly)\s+mcpjam[\w\s-]{0,40}model limit/i.exec(e);if(t)return t[1].toLowerCase()==="monthly"?"provider/mcpjam_limit_monthly":"provider/mcpjam_limit_daily";if(/mcpjam[\w\s-]{0,40}model limit/i.test(e))return"provider/mcpjam_limit"}const GS=["timeout","network","upstream_status","bad_json","bad_payload","provisioning"],WS=/^[A-Z][A-Z0-9_]{1,63}$/;function JS(e){return typeof e=="string"&&GS.includes(e)}function YS(e){if(!e||typeof e!="object")return;const{reason:t,upstreamStatus:n,networkCode:r}=e;if(!JS(t))return;const s={reason:t};return typeof n=="number"&&Number.isInteger(n)&&n>=100&&n<=599&&(s.upstreamStatus=n),typeof r=="string"&&WS.test(r)&&(s.networkCode=r),s}const Kh="mcpjam_guest_session_v1",No="mcpjam_guest_activated",ei=300*1e3;let Te=null,Et=null,kt=null,qt=null,Xh=!1,Pt=0;const Lo=new Set,KS=600*1e3;let bn=null,Wn=null;function Qh(){for(const e of Lo)e()}function ep(e){Wn!==null&&(clearTimeout(Wn),Wn=null),bn=e,e&&(Wn=setTimeout(()=>{Wn=null,bn===e&&ep(null)},Math.max(0,e.until-Date.now()))),Qh()}function XS(){return bn&&bn.until<=Date.now()&&(bn=null),bn}function ti(e){const t=Te?.guestId??null;Te=e;const n=Te?.guestId??null;t!==n&&Qh()}function tT(e){return Lo.add(e),()=>{Lo.delete(e)}}function nT(e){if(e)try{localStorage.getItem(No)!==e&&localStorage.setItem(No,e)}catch{}}function rT(e){if(!e)return!1;try{return localStorage.getItem(No)===e}catch{return!1}}function QS(){if(typeof window>"u")return;const e=window.__MCP_GUEST_BOOTSTRAP__;try{delete window.__MCP_GUEST_BOOTSTRAP__}catch{window.__MCP_GUEST_BOOTSTRAP__=void 0}e&&(typeof e.token!="string"||e.token.length===0||typeof e.expiresAt!="number"||typeof e.guestId!="string"||e.guestId.length===0||e.expiresAt-ei<=Date.now()||(Te={guestId:e.guestId,token:e.token,expiresAt:e.expiresAt}))}QS();function Ta(){if(Xh)return null;try{const e=localStorage.getItem(Kh);if(!e)return null;const t=JSON.parse(e);return typeof t.token=="string"&&t.token.length>0?t.token:null}catch{return null}}function Zl(){try{localStorage.removeItem(Kh)}catch{}Xh=!0}class rr extends Error{status;upstreamFailure;constructor(t,n,r){super(t),this.name="GuestSessionRequestError",this.status=n,this.upstreamFailure=r}}class tp extends rr{retryAfterMs;constructor(t){super("guest-session creation refused (429)"),this.name="GuestSessionRefusedError",this.retryAfterMs=t}}const eE=1e3;async function tE(e){if(typeof e.json!="function")return;let t;try{const n=await Promise.race([e.json(),new Promise(r=>{t=setTimeout(()=>r(void 0),eE)})]);return YS(n?.details)}catch{return}finally{t!==void 0&&clearTimeout(t)}}function nE(e){if(!e)return"";const t=e.networkCode??(e.upstreamStatus!==void 0?String(e.upstreamStatus):void 0);return` (${e.reason}${t?` ${t}`:""})`}function rE(e){const t=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(t)&&t>0?t*1e3:KS}async function Oa(e,t){const n={mode:e};t&&(n.legacyToken=t);let r;try{r=await fetch("/api/web/guest-session",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new rr(i instanceof Error?i.message:"network error")}if(r.status===204)return t&&Zl(),null;if(r.status===429)throw new tp(rE(r.headers?.get?.("retry-after")));if(!r.ok){const i=await tE(r);throw new rr(`guest-session request failed: ${r.status} ${r.statusText}${nE(i)}`,r.status,i)}let s;try{s=await r.json()}catch(i){throw new rr(`guest-session response was not valid JSON: ${i instanceof Error?i.message:String(i)}`)}if(typeof s?.token!="string"||typeof s?.expiresAt!="number")throw new rr("guest-session response missing token or expiresAt");return t&&Zl(),s}async function sE(){if(Te&&Te.expiresAt-ei>Date.now())return Te;if(XS())return null;if(Et)return Et;const e=Ta(),t=Pt;let n=Promise.resolve(null);return n=(async()=>{try{const r=await Oa("lookup_or_create",e);return r&&t===Pt&&ti(r),r}catch(r){if(r instanceof tp)return ep({until:Date.now()+r.retryAfterMs}),null;throw console.error("Failed to create guest session:",r),r}finally{Et===n&&(Et=null)}})(),Et=n,n.catch(()=>{}),Et}async function iE(){try{return await sE()}catch{return null}}async function sT(){return(await iE())?.token??null}function Mo(){return Te&&Te.expiresAt-ei>Date.now()?Te:null}async function oE(){if(Te&&Te.expiresAt-ei>Date.now())return Te.token;if(kt)return(await kt)?.token??null;const e=Ta(),t=Pt;let n=Promise.resolve(null);return n=(async()=>{try{const s=await Oa("lookup_only",e);return s&&t===Pt&&ti(s),s}finally{kt===n&&(kt=null)}})(),kt=n,(await kt)?.token??null}async function iT(){const e=Mo();if(e?.guestId)return e.guestId;try{await oE()}catch{return null}return Mo()?.guestId??null}function aE(){Pt+=1,ti(null),Et=null,kt=null,qt=null}async function oT(){let e=!1;try{const t=await fetch("/api/web/guest-session/revoke",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(t.ok)try{e=(await t.json())?.revoked===!0}catch{e=!1}}catch(t){console.error("Failed to revoke guest session:",t)}finally{aE()}return e}async function aT(){try{const e=await fetch("/api/web/guest-session/promotion-proof",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}});if(e.status===204||!e.ok)return null;const t=await e.json();return typeof t.token=="string"&&t.token.length>0?t.token:null}catch(e){return console.error("Failed to fetch guest promotion proof:",e),null}}async function cE(){if(qt)return(await qt)?.token??null;Pt+=1;const e=Pt;Te=null,Et=null,kt=null,qt=(async()=>{try{const t=Ta(),n=await Oa("lookup_or_create",t);return n&&e===Pt&&ti(n),n}catch(t){throw console.error("Failed to refresh guest session:",t),t}})(),qt.catch(()=>{});try{return(await qt)?.token??null}finally{qt=null}}async function cT(){try{return await cE()}catch{return null}}const np=new Set(["caniuse.dev","www.caniuse.dev"]),lE=new Set(["score.mcpjam.com","www.score.mcpjam.com"]),uE=new Set([...np,...lE]),lT="https://app.mcpjam.com";function dE(e){return np.has(e.toLowerCase())}function uT(e=typeof window>"u"?void 0:window.location.hostname){return!!e&&dE(e)}const hE="phc_dTOPniyUNU2kD8Jx8yHMXSqiZHM8I91uWopTMX6EBE9",pE="https://us.i.posthog.com";function fE(){return typeof window<"u"&&window.location?.origin?.startsWith("http")?`${window.location.origin}/tlm`:pE}function gE(){const e=Mo()?.guestId;return e?{bootstrap:{distinctID:e,isIdentifiedID:!1}}:{}}const mE=["/results/","/conformance/shared/","/evals/shared/"];function rp(e){let t=e;for(const n of mE){const r=n.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&");t=t.replace(new RegExp(`(${r})[^/?#]+`,"g"),"$1[redacted]")}return t=t.replace(/(\/organizations\/)[^/?#]+/g,"$1[redacted]"),t}const _E=new Set(["Load failed","Failed to fetch","NetworkError when attempting to fetch resource."]),vE=/^'TypeError' captured as exception with message: '([\s\S]*)'$/;function yE(e){const t=vE.exec(e.value),n=t?t[1]:e.type==="TypeError"?e.value:void 0;return n===void 0?!1:_E.has(n)||n.startsWith("Failed to fetch (")&&n.endsWith(")")}const bE=1e4;function wE(e){const t=e.$exception_list;if(!(Array.isArray(t)&&t.some(i=>typeof i?.value=="string"&&yE(i))))return;const r=lp();if(!r)return;const s=Date.now()-r.at;s>bE||(e.failed_request=`${r.method} ${rp(r.target)}`,e.failed_request_age_ms=s)}function SE(e,t){for(const n of["$current_url","$referrer","$pathname","$session_entry_url","$session_entry_pathname","$session_entry_referrer","$initial_current_url","$initial_pathname","$initial_referrer"])typeof e[n]=="string"&&(e[n]=rp(e[n]));return t==="$exception"&&wE(e),e}const EE=uE,dT=!1;function Tr(){return kE()}function kE(){return typeof window<"u"&&window.isElectron===!0}const TE="data-ph-no-capture",OE={maskAllInputs:!0,maskInputOptions:{password:!0},maskTextSelector:`[${TE}]`};function Ia(e=typeof window>"u"?void 0:window.location?.pathname){return!!e&&(e.startsWith("/results/")||e.startsWith("/conformance/shared/")||e.startsWith("/evals/shared/"))}function IE(){return Tr()&&!Ia()}let zi=!1;function hT(e,t){try{if(!Tr())return;if(Ia(t)){e.sessionRecordingStarted?.()&&(zi=!0),e.stopSessionRecording?.();return}zi&&(zi=!1,e.startSessionRecording?.())}catch{}}function AE(e=typeof window>"u"?void 0:window.location?.hostname){const t=!!e&&EE.has(e.toLowerCase());return{capture_pageview:t?"history_change":!1,capture_pageleave:t}}const PE={api_host:fE(),ui_host:"https://us.posthog.com",...gE(),...AE(),person_profiles:"always",sanitize_properties:SE,capture_dead_clicks:!0,get capture_exceptions(){return Tr()},get disable_session_recording(){return!IE()},session_recording:OE,loaded:e=>{e.register({environment:"production",platform:zo(),version:"3.11.0",deployment:"self_hosted",source:"client"}),e.setPersonPropertiesForFlags?.({local_browser_security_version:"1",deployment:"self_hosted",platform:zo()})}},pT=()=>hE,fT=()=>PE;function zo(){if(window?.isElectron){const t=navigator.userAgent.toLowerCase();return t.includes("mac")||t.includes("darwin")?"mac":t.includes("win")?"win":"electron"}return"npm"}function xE(){return"production"}function gT(e){const t=xE();return{location:e,platform:zo(),environment:t}}function $E(e){try{if(typeof e!="object"||e===null)return;const t=e.normalized;return SS(t)?t:void 0}catch{return}}function RE(e,t){try{if(!Tr()||gd(e))return!1;const n=$E(e)??HS(e),r=qS(n);return r!=="mcpjam"?!1:(Aa(e,{...t,extra:{...t.extra??{},slug:n.slug,origin:r}}),!0)}catch{return!1}}function CE(e){if(e instanceof Error)return e;try{return new Error(typeof e=="string"?e:JSON.stringify(e))}catch{return new Error(String(e))}}function Aa(e,t){if(gd(e))return;const n=CE(e);try{Qf(n,{level:t.level??"error",tags:{source:t.source},...t.extra?{extra:t.extra}:{}})}catch{}try{Tr()&&!Ia()&&t_.captureException(n,{source:t.source,level:t.level??"error",...t.extra??{}})}catch{}}function NE(e,t,n){Aa(e,{source:n?`react_boundary:${n}`:"react_boundary",extra:{componentStack:t?.componentStack??void 0,boundary:n??"unnamed"}})}const mT=Object.freeze(Object.defineProperty({__proto__:null,reportBoundaryError:NE,reportCaught:Aa,reportPossiblyOurFailure:RE},Symbol.toStringTag,{value:"Module"}));export{ak as $,hf as A,pf as B,Ip as C,Cs as D,Ef as E,Wa as F,De as G,uf as H,hk as I,dk as J,lf as K,If as L,Er as M,Ct as N,wk as O,uk as P,_k as Q,ik as R,Ae as S,mk as T,Sr as U,zs as V,yk as W,kk as X,df as Y,Ba as Z,Zi as _,Sk as a,Fh as a$,bk as a0,Zo as a1,It as a2,nk as a3,BE as a4,Ls as a5,rk as a6,Qe as a7,Ok as a8,ok as a9,Qf as aA,UE as aB,ZE as aC,qE as aD,zp as aE,$f as aF,XE as aG,QE as aH,Zp as aI,GE as aJ,rs as aK,Rp as aL,$p as aM,WE as aN,Nk as aO,Lk as aP,Ak as aQ,HE as aR,FE as aS,Ck as aT,Pk as aU,gk as aV,VE as aW,Dh as aX,$o as aY,Q0 as aZ,Xk as a_,Tk as aa,sk as ab,Mp as ac,Uo as ad,jo as ae,ir as af,Rk as ag,vk as ah,fk as ai,bf as aj,Sf as ak,KE as al,ek as am,JE as an,Ns as ao,or as ap,Da as aq,YE as ar,Fa as as,jE as at,pk as au,tu as av,Lp as aw,Hp as ax,tk as ay,Wp as az,ru as b,aE as b$,NE as b0,t_ as b1,gT as b2,gd as b3,Aa as b4,rp as b5,Tw as b6,W as b7,As as b8,Uk as b9,HS as bA,eT as bB,SS as bC,RE as bD,Ik as bE,IE as bF,Tr as bG,Ia as bH,qS as bI,Yk as bJ,Kk as bK,Jk as bL,Qk as bM,sS as bN,qk as bO,Fk as bP,VS as bQ,zh as bR,iE as bS,lT as bT,dT as bU,Mo as bV,uT as bW,zo as bX,hT as bY,$k as bZ,xk as b_,Jt as ba,Bk as bb,ko as bc,Ot as bd,Ge as be,Aw as bf,To as bg,Ut as bh,Wk as bi,$l as bj,Cb as bk,Zk as bl,Vk as bm,Dk as bn,T_ as bo,zk as bp,gh as bq,sT as br,cT as bs,tT as bt,XS as bu,Bb as bv,Mk as bw,Gk as bx,Hk as by,jk as bz,DE as c,sE as c0,cE as c1,YS as c2,nT as c3,iT as c4,rT as c5,aT as c6,oT as c7,fT as c8,pT as c9,mT as ca,Ap as d,On as e,ns as f,Np as g,ss as h,In as i,Na as j,Ho as k,Vt as l,Af as m,Xt as n,Gl as o,ME as p,We as q,wt as r,Ds as s,ts as t,Pf as u,zE as v,Ek as w,ck as x,lk as y,qo as z};
|
|
92
|
+
//# sourceMappingURL=error-reporting-C8so6E8C.js.map
|