1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,596672,124955,e=>{"use strict";function t(e){return function(t){let i=t??this;if(!i)throw TypeError(`${e.kind||e.name} type guard requires an error object`);return!!e.kind&&"object"==typeof i&&null!==i&&"constructor"in i&&i.constructor?.kind===e.kind||i instanceof e}}var i=class e extends Error{static kind="ClerkError";clerkError=!0;code;longMessage;docsUrl;cause;get name(){return this.constructor.name}constructor(t){super(new.target.formatMessage(new.target.kind,t.message,t.code,t.docsUrl),{cause:t.cause}),Object.setPrototypeOf(this,e.prototype),this.code=t.code,this.docsUrl=t.docsUrl,this.longMessage=t.longMessage,this.cause=t.cause}toString(){return`[${this.name}] 2Message:${this.message}`}static formatMessage(e,t,i,r){let s="Clerk:",n=RegExp(s.replace(" ","\\s*"),"i");return t=t.replace(n,""),t=`${s} ${t.trim()} 3 4(code="${i}") 5 6`,r&&(t+=` 7 8Docs: ${r}`),t}},r=class e extends i{static kind="ClerkRuntimeError";clerkRuntimeError=!0;constructor(t,i){super({...i,message:t}),Object.setPrototypeOf(this,e.prototype)}};let s=t(r);e.s(["a",0,t,"i",0,function(e){return t(i)(e)||!!e&&"object"==typeof e&&"clerkError"in e&&!0===e.clerkError},"n",0,s,"r",0,i,"t",0,r],124955);var n=class{static kind="ClerkAPIError";code;message;longMessage;meta;constructor(e){const t={code:e.code,message:e.message,longMessage:e.long_message,meta:{paramName:e.meta?.param_name,sessionId:e.meta?.session_id,emailAddresses:e.meta?.email_addresses,identifiers:e.meta?.identifiers,zxcvbn:e.meta?.zxcvbn,plan:e.meta?.plan,isPlanUpgradePossible:e.meta?.is_plan_upgrade_possible,seatsQuantityToAdd:e.meta?.seats_quantity_to_add,seatsQuantity:e.meta?.seats_quantity}};this.code=t.code,this.message=t.message,this.longMessage=t.longMessage,this.meta=t.meta}};let a=t(n);var o=class e extends i{static kind="ClerkAPIResponseError";status;clerkTraceId;retryAfter;errors;constructor(t,i){const{data:r,status:s,clerkTraceId:a,retryAfter:o}=i;super({...i,message:t,code:"api_response_error"}),Object.setPrototypeOf(this,e.prototype),this.status=s,this.clerkTraceId=a,this.retryAfter=o,this.errors=(r||[]).map(e=>new n(e))}toString(){let e=`[${this.name}] 9Message:${this.message} 10Status:${this.status} 11Serialized errors: ${this.errors.map(e=>JSON.stringify(e))}`;return this.clerkTraceId&&(e+=` 12Clerk Trace ID: ${this.clerkTraceId}`),e}static formatMessage(e,t,i,r){return t}};let l=t(o);var u=class e extends o{static kind="MissingExpiredTokenError";static ERROR_CODE="missing_expired_token";static STATUS=422;static is(t){return l(t)&&t.status===e.STATUS&&t.errors.length>0&&t.errors[0].code===e.ERROR_CODE}},c=class e extends r{static kind="ClerkOfflineError";static ERROR_CODE="clerk_offline";constructor(t){super(t,{code:e.ERROR_CODE}),Object.setPrototypeOf(this,e.prototype)}static is(t){return null!=t&&(t instanceof e||s(t)&&t.code===e.ERROR_CODE)}};let h=Object.freeze({InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invali
12d. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})",InvalidPublishableKeyErrorMessage:"The publishableKey passed to Clerk is invalid. You can get your Publishable key at https://dashboard.clerk.com/last-active?path=api-keys. (key={{key}})",MissingPublishableKeyErrorMessage:"Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingSecretKeyErrorMessage:"Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.",MissingClerkProvider:"{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider"});var d=class e extends Error{code;constructor(t){super(t),this.code=t,this.name="EmailLinkError",Object.setPrototypeOf(this,e.prototype)}},p=class extends r{code;constructor(e,t){super(e,t),this.code=t.code}};let f=new Set(["user_banned","user_deactivated"]);function g(e){return"code"in e&&[4001,32602,32603].includes(e.code)&&"message"in e}e.s(["C",0,l,"D",0,n,"E",0,function(e=[]){return e.length>0?e.map(e=>new n(e)):[]},"O",0,a,"S",0,o,"T",0,function(e){return new n(e)},"_",0,{Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"},"a",0,function(e){return"EmailLinkError"===e.name},"b",0,c,"c",0,function(e){return(`${e.message}${e.name}`||"").toLowerCase().replace(/\s+/g,"").includes("networkerror")},"d",0,function(e){return s(e)&&"reverification_cancelled"===e.code},"f",0,function(e){let t=e?.status,i=Array.isArray(e?.errors)&&e.errors.some(e=>f.has(e?.code));return 401===t||422===t||403===t&&i},"g",0,d,"h",0,p,"i",0,function(e){return["captcha_invalid","captcha_not_enabled","captcha_missing_token"].includes(e.errors[0].code)},"l",0,function(e){return l(e)&&e.errors?.[0]?.code==="form_password_compromised"},"m",0,function(e){return l(e)&&e.errors?.[0]?.code==="user_locked"},"n",0,function(e){return e?.status===429},"o",0,function(e){return l(e)||g(e)||s(e)},"p",0,function(e){let t=e?.status;return e?.errors?.[0]?.code==="authentication_invalid"&&401===t},"r",0,function(e){let t=e?.status;return!!t&&t>=400&&t<500},"s",0,g,"t",0,function(e){for(let[t,i]of Object.entries({isClerkAPIResponseError:l,isClerkRuntimeError:s}))Object.assign(e,{[t]:i});return e},"u",0,function(e){return l(e)&&e.errors?.[0]?.code==="form_password_pwned"},"v",0,{Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"},"w",0,function(e){return{code:e?.code||"",message:e?.message||"",long_message:e?.longMessage,meta:{param_name:e?.meta?.paramName,session_id:e?.meta?.sessionId,email_addresses:e?.meta?.emailAddresses,identifiers:e?.meta?.identifiers,zxcvbn:e?.meta?.zxcvbn,plan:e?.meta?.plan,is_plan_upgrade_possible:e?.meta?.isPlanUpgradePossible,seats_quantity_to_add:e?.meta?.seatsQuantityToAdd,seats_quantity:e?.meta?.seatsQuantity}}},"x",0,u,"y",0,function({packageName:e,customMessages:t}){let i=e;function r(e,t){if(!t)return`${i}: ${e}`;let r=e;for(let i of e.matchAll(/{{([a-zA-Z0-9-_]+)}}/g)){let e=(t[i[1]]||"").toString();r=r.replace(`{{${i[1]}}}`,e)}return`${i}: ${r}`}let s={...h,...t};return{setPackageName({packageName:e}){return"string"==typeof e&&(i=e),this},setMessages({customMessages:e}){return Object.assign(s,e||{}),this},throwInvalidPublishableKeyError(e){throw Error(r(s.InvalidPublishableKeyErrorMessage,e))},throwInvalidProxyUrl(e){throw Error(r(s.InvalidProxyUrlErrorMessage,e))},throwMissingPublishableKeyError(){throw Error(r(s.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(r(s.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(e){throw Error(r(s.MissingClerkProvider,e))},throw(e){throw Error(r(e))}}}],596672)},800421,556027,111059,e=>{"use strict";let t="reverification-error";e.s(["isReverificationHint",0,e=>e&&"object"==typeof e&&"clerk_error"in e&&e.clerk_error?.type==="forbidden"&&e.clerk_error?.reason===t,"reverificationError",0,e=>({clerk_error:{type:"forbidden",reason:t,metadata:{reverification:e}}})],800421);let i={strict_mfa:{afterMinutes:10,level:"multi_factor"},strict:{afterMinutes:10,level:"second_factor"},moderate:{afterMinutes:60,level:"second_factor"},lax:{afterMinutes:1440,level:"second_factor"}},r=new Set(["first_factor","second_factor","multi_factor"]),s=new Set(["strict_mfa","strict","moderate","lax"]),n=new Set(["o","org","organization"]),a=new Set(["u","user"]),o=e=>"number"==typeof e&&Number.isFinite(e)&&(-1===e||e>=0),l=(e,t)=>
12{let{org:i,user:r}=u(e),[s,o]=t.split(":"),l=void 0!==o,c=o||s;if(l&&!n.has(s)&&!a.has(s))throw Error(`Invalid scope: ${s}`);if(l){if(n.has(s))return i.includes(c);if(a.has(s))return r.includes(c)}return[...i,...r].includes(c)},u=e=>{let t=[],i=[];if(!e)return{org:t,user:i};let r=e.split(",");for(let e=0;e<r.length;e++){let s=r[e].trim(),n=s.indexOf(":");if(-1===n)throw Error(`Invalid claim element (missing colon): ${s}`);let a=s.slice(0,n),o=s.slice(n+1);"o"===a?t.push(o):"u"===a?i.push(o):("ou"===a||"uo"===a)&&(t.push(o),i.push(o))}return{org:t,user:i}},c=e=>{let t,n;if(!e)return!1;let a="string"==typeof e&&s.has(e),o="object"==typeof e&&(t=e.level,r.has(t))&&"number"==typeof(n=e.afterMinutes)&&n>0;return(!!a||!!o)&&(e=>"string"==typeof e?i[e]:e).bind(null,e)};e.s(["createCheckAuthorization",0,e=>t=>{let i;return!!e.userId&&(i=[((e,t)=>{let{orgId:i,orgRole:r,orgPermissions:s}=t,n=void 0!==e.role,a=void 0!==e.permission;if(!n&&!a)return"skip";if(n&&"string"!=typeof e.role||a&&"string"!=typeof e.permission||!i)return"fail";if(n&&("string"!=typeof r||!r||r.replace(/^(org:)*/,"org:")!==e.role.replace(/^(org:)*/,"org:")))return"fail";if(a&&(!Array.isArray(s)||!s.includes(e.permission.replace(/^(org:)*/,"org:"))))return"fail";return"pass"})(t,e),((e,t)=>{let{features:i,plans:r}=t,s=void 0!==e.feature,n=void 0!==e.plan;if(!s&&!n)return"skip";if(s&&"string"!=typeof e.feature||n&&"string"!=typeof e.plan)return"fail";if(s){if("string"!=typeof i||!i)return"fail";try{if(!l(i,e.feature))return"fail"}catch{return"fail"}}if(n){if("string"!=typeof r||!r)return"fail";try{if(!l(r,e.plan))return"fail"}catch{return"fail"}}return"pass"})(t,e),((e,{factorVerificationAge:t})=>{if(void 0===e.reverification)return"skip";if(!t||!Array.isArray(t)||2!==t.length||!o(t[0])||!o(t[1]))return"fail";let i=c(e.reverification);if(!i)return"fail";let{level:r,afterMinutes:s}=i(),[n,a]=t;if(-1===n&&-1===a)return"fail";let l=-1!==n&&s>n,u=-1!==a&&s>a;switch(r){case"first_factor":return l?"pass":"fail";case"second_factor":if(-1===a)return l?"pass":"fail";return u?"pass":"fail";case"multi_factor":if(-1===a)return l?"pass":"fail";if(-1===n)return"fail";return l&&u?"pass":"fail"}})(t,e)]).some(e=>"pass"===e)&&i.every(e=>"pass"===e||"skip"===e)},"resolveAuthState",0,({authObject:{sessionId:e,sessionStatus:t,userId:i,actor:r,orgId:s,orgRole:n,orgSlug:a,signOut:o,getToken:l,has:u,sessionClaims:c},options:{treatPendingAsSignedOut:h=!0}})=>void 0===e&&void 0===i?{actor:void 0,getToken:l,has:()=>!1,isLoaded:!1,isSignedIn:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,sessionClaims:void 0,sessionId:e,signOut:o,userId:i}:null===e&&null===i?{actor:null,getToken:l,has:()=>!1,isLoaded:!0,isSignedIn:!1,orgId:null,orgRole:null,orgSlug:null,sessionClaims:null,sessionId:e,signOut:o,userId:i}:h&&"pending"===t?{actor:null,getToken:l,has:()=>!1,isLoaded:!0,isSignedIn:!1,orgId:null,orgRole:null,orgSlug:null,sessionClaims:null,sessionId:null,
12signOut:o,userId:null}:e&&c&&i&&s&&n?{actor:r||null,getToken:l,has:u,isLoaded:!0,isSignedIn:!0,orgId:s,orgRole:n,orgSlug:a||null,sessionClaims:c,sessionId:e,signOut:o,userId:i}:e&&c&&i&&!s?{actor:r||null,getToken:l,has:u,isLoaded:!0,isSignedIn:!0,orgId:null,orgRole:null,orgSlug:null,sessionClaims:c,sessionId:e,signOut:o,userId:i}:void 0,"validateReverificationConfig",0,c],556027);let h=e=>{let t=e.userId,i=e.user,r=e.sessionId,s=e.sessionStatus,n=e.sessionClaims;return{userId:t,user:i,sessionId:r,session:e.session,sessionStatus:s,sessionClaims:n,organization:e.organization,orgId:e.orgId,orgRole:e.orgRole,orgPermissions:e.orgPermissions,orgSlug:e.orgSlug,actor:e.actor,factorVerificationAge:e.factorVerificationAge}};e.s(["deriveFromSsrInitialState",0,h,"deriveState",0,(e,t,i)=>{var r;let s,n,a,o,l,u,c,d,p,f,g,v,m;return!e&&i?h(i):(s=(r=t).user?r.user.id:r.user,n=r.user,a=r.session?r.session.id:r.session,o=r.session,l=r.session?.status,u=r.session?r.session.lastActiveToken?.jwt?.claims:null,c=r.session?r.session.factorVerificationAge:null,d=o?.actor,p=r.organization,f=r.organization?r.organization.id:r.organization,g=p?.slug,m=(v=p?n?.organizationMemberships?.find(e=>e.organization.id===f):p)?v.permissions:v,{userId:s,user:n,sessionId:a,session:o,sessionStatus:l,sessionClaims:u,organization:p,orgId:f,orgRole:v?v.role:v,orgSlug:g,orgPermissions:m,actor:d,factorVerificationAge:c})}],111059)},112690,284975,280204,e=>{"use strict";let t,i,r,s,n,a,o,l,u,c,h;var d,p,f=e.i(800421),g=e.i(556027),v=e.i(111059),m=e.i(124955),_=e.i(596672),y=e.i(247167),b=e.i(838297),w=e.i(581720),S=e.i(862366);let E=Symbol.for("@clerk/shared.telemetryNoticeShown"),k=["Attention: Clerk collects telemetry data from its SDKs when connected to development instances.","The data collected is used to inform Clerk's product roadmap.","To learn more, including how to opt-out from the telemetry program, visit: https://clerk.com/docs/telemetry."];var x=class{#e;#t=864e5;constructor(e){this.#e=e}isEventThrottled(e){let t=Date.now(),i=this.#i(e),r=this.#e.getItem(i);return!!r&&!(t-r>this.#t)||(this.#e.setItem(i,t),!1)}#i(e){let{sk:t,pk:i,payload:r,...s}=e,n={...r,...s};return JSON.stringify(Object.keys({...r,...s}).sort().map(e=>n[e]))}},T=class{#r="clerk_telemetry_throttler";getItem(e){return this.#s()[e]}setItem(e,t){try{let i=this.#s();i[e]=t,localStorage.setItem(this.#r,JSON.stringify(i))}catch(e){e instanceof DOMException&&("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&localStorage.length>0&&localStorage.removeItem(this.#r)}}removeItem(e){try{let t=this.#s();delete t[e],localStorage.setItem(this.#r,JSON.stringify(t))}catch{}}#s(){try{let e=localStorage.getItem(this.#r);if(!e)return{};return JSON.parse(e)}catch{return{}}}static isSupported(){return"u">typeof window&&!!window.localStorage}},O=class{#e=new Map;#n=1e4;getItem(e){return this.#e.size>this.#n?void this.#e.clear():this.#e.get(e)}setItem(e,t){this.#e.set(e,t)}removeItem(e){this.#e.delete(e)}};let P=new Set(["error","warn","info","debug","trace"]);var C=class{#a;#o;#l={};#u=[];#c=null;constructor(e){this.#a={maxBufferSize:e.maxBufferSize??5,samplingRate:e.samplingRate??1,perEventSampling:e.perEventSampling??!0,disabled:e.disabled??!1,debug:e.debug??!1,endpoint:"https://clerk-telemetry.com"},!e.clerkVersion&&"u"<typeof window?this.#l.clerkVersion="":this.#l.clerkVersion=e.clerkVersion??"",this.#l.sdk=e.sdk,this.#l.sdkVersion=e.sdkVersion,this.#l.publishableKey=e.publishableKey??"";const t=(0,b.parsePublishableKey)(e.publishableKey);t&&(this.#l.instanceType=t.instanceType),e.secretKey&&(this.#l.secretKey=e.secretKey.substring(0,16));const i=T.isSupported()?new T:new O;this.#o=new x(i),function(e={}){if(!e.skip)try{if("u">typeof window||void 0!==globalThis.EdgeRuntime||void 0!==y.default&&y.default.env&&w.t.some(e=>(0,S.isTruthy)(y.default.env[e]))||globalThis[E])return;if("u">typeof console&&"function"==typeof console.log){for(let e of k)console.log(e);console.log("")}globalThis[E]=!0}catch{}}({skip:!this.isEnabled})}get isEnabled(){return!("development"!==this.#l.instanceType||this.#a.disabled||void 0!==y.default&&y.default.env&&(0,S.isTruthy)(y.default.env.CLERK_TELEMETRY_DISABLED)||"u">typeof window&&window?.navigator?.webdriver)}get isDebug(){return this.#a.debug||void 0!==y.default&&y.default.env&&(0,S.isTruthy)(y.default.env.CLERK_TELEMETRY_DEBUG)}record(e){try{let t=this.#h(e.event,e.payload);if(this.#d(t.event,t),!this.#p(t,e.eventSamplingRate))return;this.#u.push({kind:"event",value:t}),this.#f()}catch(e){console.error("[clerk/telemetry] Error recording telemetry event",e)}}recordLog(e){try{if(!this.#g(e))return;let t="string"==typeof e?.level&&P.has(e.level),i="string"==typeof e?.message&&e.message.trim().length>0,r=null,s=e?.timestamp;if("number"==typeof s||"string"==typeof s){let e=new Date(s);Number.isNaN(e.getTime())||(r=e)}if(!t||!i||null===r){this.isDebug&&"u">typeof console&&console.warn("[clerk/telemetry] Dropping invalid telemetry log entry",{levelIsValid:t,messageIsValid:i,timestampIsValid:null!==r});return}let n=this.#v(),a={sdk:n.name,sdkv:n.version,cv:this.#l.clerkVersion??"",lvl:e.level,msg:e.message,ts:r.toISOString(),pk:this.#l.publishableKey||null,payload:this.#m(e.context)};this.#u.push({kind:"log",value:a}),this.#f()}catch(e){console.error("[clerk/telemetry] Error recording telemetry log entry",e)}}#p(e,t){return this.isEnabled&&!this.isDebug&&this.#_(e,t)}#g(e){return!0}#_(e,t){let i=Math.random();return!!(i<=this.#a.samplingRate&&(!1===this.#a.perEventSampling||void 0===t||i<=t))&&!this.#o.isEventThrottled(e)}
vendor: 1,066 bytes, line 12
12#f(){if("u"<typeof window)return void this.#y();if(this.#u.length>=this.#a.maxBufferSize){this.#c&&("u">typeof cancelIdleCallback?cancelIdleCallback(Number(this.#c)):clearTimeout(Number(this.#c))),this.#y();return}this.#c||("requestIdleCallback"in window?this.#c=requestIdleCallback(()=>{this.#y(),this.#c=null}):this.#c=setTimeout(()=>{this.#y(),this.#c=null},0))}#y(){let e=[...this.#u];if(this.#u=[],this.#c=null,0===e.length)return;let t=e.filter(e=>"event"===e.kind).map(e=>e.value),i=e.filter(e=>"log"===e.kind).map(e=>e.value);t.length>0&&fetch(new URL("/v1/event",this.#a.endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({events:t})}).catch(()=>void 0),i.length>0&&fetch(new URL("/v1/logs",this.#a.endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({logs:i})}).catch(()=>void 0)}#d(e,t){this.isDebug&&(void 0!==console.groupCollapsed?(console.groupCollapsed("[clerk/telemetry]",e),console.log(t),console.groupEnd()):console.log("[clerk/telemetry]",e,t))}
12#v(){let e={name:this.#l.sdk,version:this.#l.sdkVersion};if("u">typeof window){let t=window;if(t.Clerk){let i=t.Clerk;if("object"==typeof i&&null!==i&&"constructor"in i&&"function"==typeof i.constructor&&i.constructor.sdkMetadata){let{name:t,version:r}=i.constructor.sdkMetadata;void 0!==t&&(e.name=t),void 0!==r&&(e.version=r)}}}return e}#h(e,t){let i=this.#v();return{event:e,cv:this.#l.clerkVersion??"",it:this.#l.instanceType??"",sdk:i.name,sdkv:i.version,...this.#l.publishableKey?{pk:this.#l.publishableKey}:{},...this.#l.secretKey?{sk:this.#l.secretKey}:{},payload:t}}#m(e){if(null==e||"object"!=typeof e)return null;try{let t=JSON.parse(JSON.stringify(e));if(t&&"object"==typeof t&&!Array.isArray(t))return t;return null}catch{return null}}};let I="COMPONENT_MOUNTED",M=new Set(["SignIn","SignUp"]);function R(e){return M.has(e)?1:.1}function F(e){return function(t,i,r){return{event:e,eventSamplingRate:e===I?R(t):.1,payload:{component:t,appearanceProp:!!i?.appearance,theme:!!i?.appearance?.theme,elements:!!i?.appearance?.elements,variables:!!i?.appearance?.variables,...r}}}}function D(e,t){return{event:"METHOD_CALLED",eventSamplingRate:.1,payload:{method:e,...t}}}let A="THEME_USAGE";function N(e){return"string"==typeof e?e:"object"==typeof e&&null!==e&&"name"in e&&"string"==typeof e.name?e.name:void 0}e.s(["a",0,D,"c",0,function(e,t,i){return F(I)(e,t,i)},"i",0,function(e){return{event:"FRAMEWORK_METADATA",eventSamplingRate:.1,payload:e}},"l",0,function(e,t,i){return F("COMPONENT_OPENED")(e,t,i)},"n",0,A,"o",0,function(e,t,i={},r=1){return{event:"FLOW_STEP_MOUNTED",eventSamplingRate:r,payload:{flow:e,step:t,metadata:i}}},"r",0,function(e){return{event:A,eventSamplingRate:1,payload:function(e){let t;if(!e||"object"!=typeof e)return{};let i=e.theme;if(!i)return{};if(Array.isArray(i))for(let e of i){let i=N(e);if(i){t=i;break}}else t=N(i);return{themeName:t}}(e)}},"s",0,function(e,t={}){return{event:I,eventSamplingRate:R(e),payload:{component:e,...t}}},"t",0,1,"u",0,C],284975);var $=e.i(273370),L=e.i(271645),q=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},z=new class extends q{#b;#w;#S;constructor(){super(),this.#S=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#w||this.setEventListener(this.#S)}onUnsubscribe(){this.hasListeners()||(this.#w?.(),this.#w=void 0)}setEventListener(e){this.#S=e,this.#w?.(),this.#w=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#b!==e&&(this.#b=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#b?this.#b:globalThis.document?.visibilityState!=="hidden"}},U={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},j=new class{#E=U;#k=!1;setTimeoutProvider(e){this.#E=e}setTimeout(e,t){return this.#E.setTimeout(e,t)}clearTimeout(e){this.#E.clearTimeout(e)}setInterval(e,t){return this.#E.setInterval(e,t)}clearInterval(e){this.#E.clearInterval(e)}},V="u"<typeof window||"Deno"in globalThis;function W(){}function H(e){return"number"==typeof e&&e>=0&&e!==1/0}function G(e,t){return Math.max(e+(t||0)-Date.now(),0)}function B(e,t){return"function"==typeof e?e(t):e}function Z(e,t){return"function"==typeof e?e(t):e}function K(e,t){let{type:i="all",exact:r,fetchStatus:s,predicate:n,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==Y(a,t.options))return!1}else if(!X(t.queryKey,a))return!1}if("all"!==i){let e=t.isActive();if("active"===i&&!e||"inactive"===i&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!s||s===t.state.fetchStatus)&&(!n||!!n(t))}function Q(e,t){let{exact:i,status:r,predicate:s,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(i){if(J(t.options.mutationKey)!==J(n))return!1}else if(!X(t.options.mutationKey,n))return!1}return(!r||t.state.status===r)&&(!s||!!s(t))}function Y(e,t){return(t?.queryKeyHashFn||J)(e)}function J(e){return JSON.stringify(e,(e,t)=>er(t)?Object.keys(t).sort().reduce((e,i)=>(e[i]=t[i],e),{}):t)}function X(e,t){if(e===t)return!0;
12if(typeof e!=typeof t)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(Array.isArray(e)&&Array.isArray(t)){for(let i=0;i<t.length;i++)if(!X(e[i],t[i]))return!1;return!0}for(let i of Object.keys(t))if(!X(e[i],t[i]))return!1;return!0}return!1}var ee=Object.prototype.hasOwnProperty;function et(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(e[i]!==t[i])return!1;return!0}function ei(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function er(e){if(!es(e))return!1;let t=e.constructor;if(void 0===t)return!0;let i=t.prototype;return!!es(i)&&!!i.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function es(e){return"[object Object]"===Object.prototype.toString.call(e)}function en(e,t,i){return"function"==typeof i.structuralSharing?i.structuralSharing(e,t):!1!==i.structuralSharing?function e(t,i,r=0){if(t===i)return t;if(r>500)return i;let s=ei(t)&&ei(i);if(!s&&!(er(t)&&er(i)))return i;let n=(s?t:Object.keys(t)).length,a=s?i:Object.keys(i),o=a.length,l=s?Array(o):{},u=0;for(let c=0;c<o;c++){let o=s?c:a[c],h=t[o],d=i[o];if(h===d){l[o]=h,(s?c<n:ee.call(t,o))&&u++;continue}if(null===h||null===d||"object"!=typeof h||"object"!=typeof d){l[o]=d;continue}let p=e(h,d,r+1);l[o]=p,p===h&&u++}return n===o&&u===n?t:l}(e,t):t}function ea(e,t,i=0){let r=[...e,t];return i&&r.length>i?r.slice(1):r}function eo(e,t,i=0){let r=[t,...e];return i&&r.length>i?r.slice(0,-1):r}var el=Symbol();function eu(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==el?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}var ec=(i=()=>V,{isServer:()=>i(),setIsServer(e){i=e}}),eh=(r=[],s=0,n=e=>{e()},a=e=>{e()},o=function(e){setTimeout(e,0)},{batch:e=>{let t;s++;try{t=e()}finally{let e;--s||(e=r,r=[],e.length&&o(()=>{a(()=>{e.forEach(e=>{n(e)})})}))}return t},batchCalls:e=>(...t)=>{l(()=>{e(...t)})},schedule:l=e=>{s?r.push(e):o(()=>{n(e)})},setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{a=e},setScheduler:e=>{o=e}}),ed=new class extends q{#x=!0;#w;#S;constructor(){super(),this.#S=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#w||this.setEventListener(this.#S)}onUnsubscribe(){this.hasListeners()||(this.#w?.(),this.#w=void 0)}setEventListener(e){this.#S=e,this.#w?.(),this.#w=e(this.setOnline.bind(this))}setOnline(e){this.#x!==e&&(this.#x=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#x}};function ep(){let e,t,i=new Promise((i,r)=>{e=i,t=r});function r(e){Object.assign(i,e),delete i.resolve,delete i.reject}return i.status="pending",i.catch(()=>{}),i.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},i.reject=e=>{r({status:"rejected",reason:e}),t(e)},i}function ef(e){return Math.min(1e3*2**e,3e4)}function eg(e){return(e??"online")!=="online"||ed.isOnline()}var ev=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function em(e){let t,i=!1,r=0,s=ep(),n=()=>z.isFocused()&&("always"===e.networkMode||ed.isOnline())&&e.canRun(),a=()=>eg(e.networkMode)&&e.canRun(),o=e=>{"pending"===s.status&&(t?.(),s.resolve(e))},l=e=>{"pending"===s.status&&(t?.(),s.reject(e))},u=()=>new Promise(i=>{t=e=>{("pending"!==s.status||n())&&i(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===s.status&&e.onContinue?.()}),c=()=>{let t;if("pending"!==s.status)return;let a=0===r?e.initialPromise:void 0;try{t=a??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(o).catch(t=>{if("pending"!==s.status)return;let a=e.retry??3*!ec.isServer(),o=e.retryDelay??ef,h="function"==typeof o?o(r,t):o,d=!0===a||"number"==typeof a&&r<a||"function"==typeof a&&a(r,t);i||!d?l(t):(r++,e.onFail?.(r,t),new Promise(e=>{j.setTimeout(e,h)}).then(()=>n()?void 0:u()).then(()=>{i?l(t):c()}))})};return{promise:s,status:()=>s.status,cancel:t=>{if("pending"===s.status){let i=new ev(t);l(i),e.onCancel?.(i)}},continue:()=>(t?.(),s),cancelRetry:()=>{i=!0},continueRetry:()=>{i=!1},canStart:a,start:()=>(a()?c():u().then(c),s)}}var e_=class{#T;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),H(this.gcTime)&&(this.#T=j.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ec.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#T&&(j.clearTimeout(this.#T),this.#T=void 0)}};function ey(e,{pages:t,pageParams:i}
vendor: 6,439 bytes, line 12
12){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,i[r],i):void 0}function eb(e,{pages:t,pageParams:i}){return t.length>0?e.getPreviousPageParam?.(t[0],t,i[0],i):void 0}var ew=class extends e_{#O;#P;#C;#e;#I;#M;#R;#F;constructor(e){super(),this.#F=!1,this.#R=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#I=e.client,this.#e=this.#I.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#P=ek(this.options),this.state=e.state??this.#P,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#O}get promise(){return this.#M?.promise}setOptions(e){if(this.options={...this.#R,...e},e?._type&&(this.#O=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=ek(this.options);void 0!==e.data&&(this.setState(eE(e.data,e.dataUpdatedAt)),this.#P=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#e.remove(this)}setData(e,t){let i=en(this.state.data,e,this.options);return this.#D({data:i,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),i}setState(e){this.#D({type:"setState",state:e})}cancel(e){let t=this.#M?.promise;return this.#M?.cancel(e),t?t.then(W).catch(W):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#P}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==Z(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===el||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===B(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!G(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#M?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#M?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#M&&(this.#F||this.#A()?this.#M.cancel({revert:!0}):this.#M.cancelRetry()),this.scheduleGc()),this.#e.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#A(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#D({type:"invalidate"})}async fetch(e,t){var i;let r;if("idle"!==this.state.fetchStatus&&this.#M?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#M)return this.#M.continueRetry(),this.#M.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#F=!0,s.signal)})},a=()=>{let e,i=eu(this.options,t),r=(n(e={client:this.#I,queryKey:this.queryKey,meta:this.meta}),e);return(this.#F=!1,this.options.persister)?this.options.persister(i,r,this):i(r)},o=(n(r={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#I,state:this.state,fetchFn:a}),r),l="infinite"===this.#O?(i=this.options.pages,{onFetch:(e,t)=>{let r=e.options,s=e.fetchOptions?.meta?.fetchMore?.direction,n=e.state.data?.pages||[],a=e.state.data?.pageParams||[],o={pages:[],pageParams:[]},l=0,u=async()=>{let t=!1,u=eu(e.options,e.fetchOptions),c=async(i,r,s)=>{if(t)return Promise.reject(e.signal.reason);if(null==r&&i.pages.length)return Promise.resolve(i);let n=(()=>{var i,n;let a,o,l={client:e.client,queryKey:e.queryKey,pageParam:r,direction:s?"backward":"forward",meta:e.options.meta};return i=()=>e.signal,n=()=>t=!0,o=!1,Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(a??=i(),o||(o=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),l})(),a=await u(n),{maxPages:o}=e.options,l=s?eo:ea;return{pages:l(i.pages,a,o),pageParams:l(i.pageParams,r,o)}};if(s&&n.length){let e="backward"===s,t={pages:n,pageParams:a},i=(e?eb:ey)(r,t);o=await c(t,i,e)}else{let e=i??n.length;do{let e=0===l?a[0]??r.initialPageParam:ey(r,o);if(l>0&&null==e)break;o=await c(o,e),l++}while(l<e)}return o};e.options.persister?e.fetchFn=()=>e.options.persister?.(u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t):e.fetchFn=u}}):this.options.behavior;l?.onFetch(o,this),this.#C=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#D({type:"fetch",meta:o.fetchOptions?.meta}),this.#M=em({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof ev&&e.revert&&this.setState({...this.#C,fetchStatus:"idle"}),s.abort()},onFail:(e,t)=>{this.#D({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#D({type:"pause"})},onContinue:()=>{this.#D({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#M.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#e.config.onSuccess?.(e,this),this.#e.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ev){if(e.silent)return this.#M.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#D({type:"error",error:e}),this.#e.config.onError?.(e,this),this.#e.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#D(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...eS(t.data,this.options),fetchMeta:e.meta??null};case"success":let i={...t,...eE(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#C=e.manual?i:void 0,i;case"error":let r=e.error;
12return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),eh.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#e.notify({query:this,type:"updated",action:e})})}};function eS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eg(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function eE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ek(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,i=void 0!==t,r=i?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:i?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var ex=class extends q{constructor(e,t){super(),this.options=t,this.#I=e,this.#N=null,this.#$=ep(),this.bindMethods(),this.setOptions(t)}#I;#L=void 0;#q=void 0;#z=void 0;#U;#j;#$;#N;#V;#W;#H;#G;#B;#Z;#K=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#L.addObserver(this),eT(this.#L,this.options)?this.#Q():this.updateResult(),this.#Y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return eO(this.#L,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return eO(this.#L,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#J(),this.#X(),this.#L.removeObserver(this)}setOptions(e){let t=this.options,i=this.#L;if(this.options=this.#I.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof Z(this.options.enabled,this.#L))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#ee(),this.#L.setOptions(this.options),t._defaulted&&!et(this.options,t)&&this.#I.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#L,observer:this});let r=this.hasListeners();r&&eP(this.#L,i,this.options,t)&&this.#Q(),this.updateResult(),r&&(this.#L!==i||Z(this.options.enabled,this.#L)!==Z(t.enabled,this.#L)||B(this.options.staleTime,this.#L)!==B(t.staleTime,this.#L))&&this.#et();let s=this.#ei();r&&(this.#L!==i||Z(this.options.enabled,this.#L)!==Z(t.enabled,this.#L)||s!==this.#Z)&&this.#er(s)}getOptimisticResult(e){var t,i;let r=this.#I.getQueryCache().build(this.#I,e),s=this.createResult(r,e);return t=this,i=s,et(t.getCurrentResult(),i)||(this.#z=s,this.#j=this.options,this.#U=this.#L.state),s}getCurrentResult(){return this.#z}trackResult(e,t){return new Proxy(e,{get:(e,i)=>(this.trackProp(i),t?.(i),"promise"===i&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#$.status||this.#$.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,i))})}trackProp(e){this.#K.add(e)}getCurrentQuery(){return this.#L}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#I.defaultQueryOptions(e),i=this.#I.getQueryCache().build(this.#I,t);return i.fetch().then(()=>this.createResult(i,t))}fetch(e){return this.#Q({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#z))}#Q(e){this.#ee();let t=this.#L.fetch(this.options,e);return e?.throwOnError||(t=t.catch(W)),t}#et(){this.#J();let e=B(this.options.staleTime,this.#L);if(ec.isServer()||this.#z.isStale||!H(e))return;let t=G(this.#z.dataUpdatedAt,e);this.#G=j.setTimeout(()=>{this.#z.isStale||this.updateResult()},t+1)}#ei(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#L):this.options.refetchInterval)??!1}#er(e){this.#X(),this.#Z=e,!ec.isServer()&&!1!==Z(this.options.enabled,this.#L)&&H(this.#Z)&&0!==this.#Z&&(this.#B=j.setInterval(()=>
12{(this.options.refetchIntervalInBackground||z.isFocused())&&this.#Q()},this.#Z))}#Y(){this.#et(),this.#er(this.#ei())}#J(){void 0!==this.#G&&(j.clearTimeout(this.#G),this.#G=void 0)}#X(){void 0!==this.#B&&(j.clearInterval(this.#B),this.#B=void 0)}createResult(e,t){let i,r=this.#L,s=this.options,n=this.#z,a=this.#U,o=this.#j,l=e!==r?e.state:this.#q,{state:u}=e,c={...u},h=!1;if(t._optimisticResults){let i=this.hasListeners(),n=!i&&eT(e,t),a=i&&eP(e,r,t,s);(n||a)&&(c={...c,...eS(u.data,e.options)}),"isRestoring"===t._optimisticResults&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:p,status:f}=c;i=c.data;let g=!1;if(void 0!==t.placeholderData&&void 0===i&&"pending"===f){let e;n?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=n.data,g=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#H?.state.data,this.#H):t.placeholderData,void 0!==e&&(f="success",i=en(n?.data,e,t),h=!0)}if(t.select&&void 0!==i&&!g)if(n&&i===a?.data&&t.select===this.#V)i=this.#W;else try{this.#V=t.select,i=t.select(i),i=en(n?.data,i,t),this.#W=i,this.#N=null}catch(e){this.#N=e}this.#N&&(d=this.#N,i=this.#W,p=Date.now(),f="error");let v="fetching"===c.fetchStatus,m="pending"===f,_="error"===f,y=m&&v,b=void 0!==i,w={status:f,fetchStatus:c.fetchStatus,isPending:m,isSuccess:"success"===f,isError:_,isInitialLoading:y,isLoading:y,data:i,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:p,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:c.dataUpdateCount>l.dataUpdateCount||c.errorUpdateCount>l.errorUpdateCount,isFetching:v,isRefetching:v&&!m,isLoadingError:_&&!b,isPaused:"paused"===c.fetchStatus,isPlaceholderData:h,isRefetchError:_&&b,isStale:eC(e,t),refetch:this.refetch,promise:this.#$,isEnabled:!1!==Z(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==w.data,i="error"===w.status&&!t,s=e=>{i?e.reject(w.error):t&&e.resolve(w.data)},n=()=>{s(this.#$=w.promise=ep())},a=this.#$;switch(a.status){case"pending":e.queryHash===r.queryHash&&s(a);break;case"fulfilled":(i||w.data!==a.value)&&n();break;case"rejected":i&&w.error===a.reason||n()}}return w}updateResult(){let e=this.#z,t=this.createResult(this.#L,this.options);if(this.#U=this.#L.state,this.#j=this.options,void 0!==this.#U.data&&(this.#H=this.#L),et(t,e))return;this.#z=t;let i=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,i="function"==typeof t?t():t;if("all"===i||!i&&!this.#K.size)return!0;let r=new Set(i??this.#K);return this.options.throwOnError&&r.add("error"),Object.keys(this.#z).some(t=>this.#z[t]!==e[t]&&r.has(t))};this.#es({listeners:i()})}#ee(){let e=this.#I.getQueryCache().build(this.#I,this.options);if(e===this.#L)return;let t=this.#L;this.#L=e,this.#q=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#Y()}#es(e){eh.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#z)}),this.#I.getQueryCache().notify({query:this.#L,type:"observerResultsUpdated"})})}};function eT(e,t){return!1!==Z(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==Z(t.retryOnMount,e))||void 0!==e.state.data&&eO(e,t,t.refetchOnMount)}function eO(e,t,i){if(!1!==Z(t.enabled,e)&&"static"!==B(t.staleTime,e)){let r="function"==typeof i?i(e):i;return"always"===r||!1!==r&&eC(e,t)}return!1}function eP(e,t,i,r){return(e!==t||!1===Z(r.enabled,e))&&(!i.suspense||"error"!==e.state.status)&&eC(e,i)}function eC(e,t){return!1!==Z(t.enabled,e)&&e.isStaleByTime(B(t.staleTime,e))}var eI=class extends ex{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var i,r;let{state:s}=e,n=super.createResult(e,t),{isFetching:a,isRefetching:o,isError:l,isRefetchError:u}
vendor: 4,202 bytes, line 12
12=n,c=s.fetchMeta?.fetchMore?.direction,h=l&&"forward"===c,d=a&&"forward"===c,p=l&&"backward"===c,f=a&&"backward"===c;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:!!(i=s.data)&&null!=ey(t,i),hasPreviousPage:!!(r=s.data)&&!!t.getPreviousPageParam&&null!=eb(t,r),isFetchNextPageError:h,isFetchingNextPage:d,isFetchPreviousPageError:p,isFetchingPreviousPage:f,isRefetchError:u&&!h&&!p,isRefetching:o&&!d&&!f}}},eM=class extends q{constructor(e={}){super(),this.config=e,this.#en=new Map}#en;build(e,t,i){let r=t.queryKey,s=t.queryHash??Y(r,t),n=this.get(s);return n||(n=new ew({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(n)),n}add(e){this.#en.has(e.queryHash)||(this.#en.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#en.get(e.queryHash);t&&(e.destroy(),t===e&&this.#en.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){eh.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#en.get(e)}getAll(){return[...this.#en.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>K(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>K(e,t)):t}notify(e){eh.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){eh.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){eh.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},eR=class extends e_{#I;#ea;#eo;#M;constructor(e){super(),this.#I=e.client,this.mutationId=e.mutationId,this.#eo=e.mutationCache,this.#ea=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#ea.includes(e)||(this.#ea.push(e),this.clearGcTimeout(),this.#eo.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#ea=this.#ea.filter(t=>t!==e),this.scheduleGc(),this.#eo.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#ea.length||("pending"===this.state.status?this.scheduleGc():this.#eo.remove(this))}continue(){return this.#M?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#D({type:"continue"})},i={client:this.#I,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#M=em({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#D({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#D({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#eo.canRun(this)});let r="pending"===this.state.status,s=!this.#M.canStart();try{if(r)t();else{this.#D({type:"pending",variables:e,isPaused:s}),this.#eo.config.onMutate&&await this.#eo.config.onMutate(e,this,i);let t=await this.options.onMutate?.(e,i);t!==this.state.context&&this.#D({type:"pending",context:t,variables:e,isPaused:s})}let n=await this.#M.start();return await this.#eo.config.onSuccess?.(n,e,this.state.context,this,i),await this.options.onSuccess?.(n,e,this.state.context,i),await this.#eo.config.onSettled?.(n,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(n,null,e,this.state.context,i),this.#D({type:"success",data:n}),n}catch(t){try{await this.#eo.config.onError?.(t,e,this.state.context,this,i)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,i)}catch(e){Promise.reject(e)}try{await this.#eo.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,i)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,i)}catch(e){Promise.reject(e)}throw this.#D({type:"error",error:t}),t}finally{this.#eo.runNext(this)}}#D(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};
12case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),eh.batch(()=>{this.#ea.forEach(t=>{t.onMutationUpdate(e)}),this.#eo.notify({mutation:this,type:"updated",action:e})})}},eF=class extends q{constructor(e={}){super(),this.config=e,this.#el=new Set,this.#eu=new Map,this.#ec=0}#el;#eu;#ec;build(e,t,i){let r=new eR({client:e,mutationCache:this,mutationId:++this.#ec,options:e.defaultMutationOptions(t),state:i});return this.add(r),r}add(e){this.#el.add(e);let t=eD(e);if("string"==typeof t){let i=this.#eu.get(t);i?i.push(e):this.#eu.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#el.delete(e)){let t=eD(e);if("string"==typeof t){let i=this.#eu.get(t);if(i)if(i.length>1){let t=i.indexOf(e);-1!==t&&i.splice(t,1)}else i[0]===e&&this.#eu.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=eD(e);if("string"!=typeof t)return!0;{let i=this.#eu.get(t),r=i?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=eD(e);if("string"!=typeof t)return Promise.resolve();{let i=this.#eu.get(t)?.find(t=>
vendor: 4,812 bytes, line 12
12t!==e&&t.state.isPaused);return i?.continue()??Promise.resolve()}}clear(){eh.batch(()=>{this.#el.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#el.clear(),this.#eu.clear()})}getAll(){return Array.from(this.#el)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Q(t,e))}findAll(e={}){return this.getAll().filter(t=>Q(e,t))}notify(e){eh.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return eh.batch(()=>Promise.all(e.map(e=>e.continue().catch(W))))}};function eD(e){return e.options.scope?.id}var eA=class{#eh;#eo;#R;#ed;#ep;#ef;#eg;#ev;constructor(e={}){this.#eh=e.queryCache||new eM,this.#eo=e.mutationCache||new eF,this.#R=e.defaultOptions||{},this.#ed=new Map,this.#ep=new Map,this.#ef=0}mount(){this.#ef++,1===this.#ef&&(this.#eg=z.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#eh.onFocus())}),this.#ev=ed.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#eh.onOnline())}))}unmount(){this.#ef--,0===this.#ef&&(this.#eg?.(),this.#eg=void 0,this.#ev?.(),this.#ev=void 0)}isFetching(e){return this.#eh.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#eo.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#eh.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),i=this.#eh.build(this,t),r=i.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(B(t.staleTime,i))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#eh.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,i){let r=this.defaultQueryOptions({queryKey:e}),s=this.#eh.get(r.queryHash),n=s?.state.data,a="function"==typeof t?t(n):t;if(void 0!==a)return this.#eh.build(this,r).setData(a,{...i,manual:!0})}setQueriesData(e,t,i){return eh.batch(()=>this.#eh.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,i)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#eh.get(t.queryHash)?.state}removeQueries(e){let t=this.#eh;eh.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let i=this.#eh;return eh.batch(()=>(i.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let i={revert:!0,...t};return Promise.all(eh.batch(()=>this.#eh.findAll(e).map(e=>e.cancel(i)))).then(W).catch(W)}invalidateQueries(e,t={}){return eh.batch(()=>(this.#eh.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let i={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(eh.batch(()=>this.#eh.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,i);return i.throwOnError||(t=t.catch(W)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(W)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let i=this.#eh.build(this,t);return i.isStaleByTime(B(t.staleTime,i))?i.fetch(t):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(W).catch(W)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(W).catch(W)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ed.isOnline()?this.#eo.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#eh}getMutationCache(){return this.#eo}getDefaultOptions(){return this.#R}setDefaultOptions(e){this.#R=e}setQueryDefaults(e,t){this.#ed.set(J(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#ed.values()],i={};return t.forEach(t=>{X(e,t.queryKey)&&Object.assign(i,t.defaultOptions)}),i}setMutationDefaults(e,t){this.#ep.set(J(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#ep.values()],i={};return t.forEach(t=>{X(e,t.mutationKey)&&Object.assign(i,t.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#R.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Y(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===el&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#R.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#eh.clear(),this.#eo.clear()}},eN=Object.prototype.hasOwnProperty;function e$(e,t,i){for(i of e.keys())if(eL(i,t))return i}function eL(e,t){var i,r,s;if(e===t)return!0;
12if(e&&t&&(i=e.constructor)===t.constructor){if(i===Date)return e.getTime()===t.getTime();if(i===RegExp)return e.toString()===t.toString();if(i===Array){if((r=e.length)===t.length)for(;r--&&eL(e[r],t[r]););return -1===r}if(i===Set){if(e.size!==t.size)return!1;for(r of e)if((s=r)&&"object"==typeof s&&!(s=e$(t,s))||!t.has(s))return!1;return!0}if(i===Map){if(e.size!==t.size)return!1;for(r of e)if((s=r[0])&&"object"==typeof s&&!(s=e$(t,s))||!eL(r[1],t.get(s)))return!1;return!0}if(i===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(i===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return -1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return -1===r}if(!i||"object"==typeof e){for(i in r=0,e)if(eN.call(e,i)&&++r&&!eN.call(t,i)||!(i in t)||!eL(e[i],t[i]))return!1;return Object.keys(t).length===r}}return e!=e&&t!=t}function eq(e,t){if(!e)throw"string"==typeof t?Error(t):Error(`${t.displayName} not found`)}let ez=(e,t)=>{let{assertCtxFn:i=eq}=t||{},r=L.default.createContext(void 0);return r.displayName=e,[r,()=>{let t=L.default.useContext(r);return i(t,`${e} not found`),t.value},()=>{let e=L.default.useContext(r);return e?e.value:{}}]},[eU,ej]=ez("ClerkInstanceContext"),[eV,eW]=ez("InitialStateContext");function eH({children:e,initialState:t}){let[i]=(0,L.useState)(t),r=L.default.useMemo(()=>({value:i}),[i]);return L.default.createElement(eV.Provider,{value:r},e)}function eG(){let e=eW();if(e instanceof Promise)if("use"in L.default&&"function"==typeof L.default.use)return L.default.use(e);else throw Error("initialState cannot be a promise if React version is less than 19");return e}L.default.createContext({});let[eB,eZ]=ez("CheckoutContext"),eK=({children:e,...t})=>L.default.createElement(eB.Provider,{value:{value:t}},e);function eQ(e){if(!L.default.useContext(eU)){if("function"==typeof e)return void e();throw Error(`${e} can only be used within the <ClerkProvider /> component. 13 14Possible fixes: 151. Ensure that the <ClerkProvider /> is correctly wrapping your application where this component is used. 162. Check for multiple versions of the \`@clerk/shared\` package in your project. Use a tool like \`npm ls @clerk/shared\` to identify multiple versions, and update your dependencies to only rely on one. 17 18Learn more: https://clerk.com/docs/components/clerk-provider`.trim())}}function eY(e){return{queryKey:[e.stablePrefix,e.authenticated,e.tracked,e.untracked],invalidationKey:[e.stablePrefix,e.authenticated,e.tracked],stableKey:e.stablePrefix,authenticated:e.authenticated}}function eJ(e){if(e)return function(e){return e}}let eX=!1,e0=u=new Proxy(function(){},{get(e,t){if("then"!==t)return"toString"===t?()=>"[ClerkMockQueryClient]":t===Symbol.toPrimitive?()=>0:u},apply:()=>u,construct:()=>u,has:()=>!1,set:()=>!1}),e1=()=>{let e=function(){if("u">typeof window)return eX||(t=new eA,eX=!0),t}();return[e??e0,!!e]};function e2(e,t){let[i,r]=e1(),s=r?i.defaultQueryOptions(e):e;s._optimisticResults="optimistic";let n=L.useMemo(()=>new t(i,s),[i]),a=n.getOptimisticResult(s),o=!1!==e.subscribed;return(L.useSyncExternalStore(L.useCallback(e=>{let t=o?n.subscribe(eh.batchCalls(e)):W;return n.updateResult(),t},[n,o]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),L.useEffect(()=>{n.setOptions(s)},[s,n]),r)?s.notifyOnChangeProps?a:n.trackResult(a):{data:void 0,error:null,isLoading:!1!==e.enabled,isFetching:!1,status:"pending"}}function e3(e){var t;let i,r,{isSignedOut:s,stableKeys:n,authenticated:a=!0,onCleanup:o}=e,l=(0,L.useRef)(n),[u]=e1(),c=(t=!s,i=(0,L.useRef)(t),r=(0,L.useRef)(null),i.current!==t&&(r.current=i.current,i.current=t),r.current);(0,L.useEffect)(()=>{!0===a&&c&&!0===s&&(u.removeQueries({predicate:e=>{let[t,i]=e.queryKey;return!0===i&&"string"==typeof t&&(Array.isArray(l.current)?l.current.includes(t):l.current===t)}}),o?.())},[a,s,c,u])}let e6=(e,t)=>{let i="boolean"==typeof e&&e,r=(0,L.useRef)(i?t.initialPage:e?.initialPage??t.initialPage),s=(0,L.useRef)(i?t.pageSize:e?.pageSize??t.pageSize),n={};for(let r of Object.keys(t))n[r]=i?t[r]:e?.[r]??t[r];return{...n,initialPage:r.current,pageSize:s.current}},e4=e=>{let t,{fetcher:i,config:r,keys:s}
vendor: 7,048 bytes, line 18
18=e,[n,a]=(0,L.useState)(r.initialPage??1),o=(0,L.useRef)(r.initialPage??1),l=(0,L.useRef)(r.pageSize??10),u=r.enabled??!0,c=r.isSignedIn,h=r.infinite??!1,d="cache"===r.__experimental_mode,p=r.keepPreviousData??!1,[f]=e1(),g=u&&!!i&&!d&&!1!==c,[v,m]=(0,L.useState)(0),_=(0,L.useCallback)(e=>{m(e)},[]),y=(0,L.useMemo)(()=>{let[e,t,i,r]=s.queryKey;return[e,t,i,{...r,args:{...r.args,initialPage:n,pageSize:l.current}}]},[s.queryKey,n]),b=e2({queryKey:y,queryFn:({queryKey:e})=>{let{args:t}=e[3];if(i)return i(t)},staleTime:6e4,enabled:g&&!h,placeholderData:eJ(p)},ex),w=(0,L.useMemo)(()=>{let[e,t,i,r]=s.queryKey;return[e+"-inf",t,i,r]},[s.queryKey]),S=e2({queryKey:w,initialPageParam:r.initialPage??1,getNextPageParam:(e,t,i)=>{let s=e?.total_count??0;return(t.length+(r.initialPage?r.initialPage-1:0))*(r.pageSize??10)<s?i+1:void 0},queryFn:({pageParam:e,queryKey:t})=>{let{args:r}=t[3];if(i)return i({...r,initialPage:e,pageSize:l.current})},staleTime:6e4,enabled:g&&h},eI);e3({isSignedOut:!1===c,authenticated:s.authenticated,stableKeys:[t=s.stableKey,`${t}-inf`],onCleanup:()=>{a(o.current),Promise.resolve().then(()=>_(e=>e+1))}});let{data:E,count:k,page:x}=(0,L.useMemo)(()=>{if(h){let e=f.getQueryData(w),t=g?S.data?.pages??e?.pages??[]:e?.pages??[],i=Array.isArray(t)?t.filter(Boolean):[];return{data:i.map(e=>e?.data).flat().filter(Boolean)??[],count:i[i.length-1]?.total_count??0,page:i.length>0?i.length:o.current}}let e=g?b.data??f.getQueryData(y):f.getQueryData(y);return{data:Array.isArray(e?.data)?e.data:[],count:"number"==typeof e?.total_count?e.total_count:0,page:n}},[g,v,h,S.data?.pages,b.data,f,w,y,n]),T=(0,L.useCallback)(e=>{if(h){let t=Math.max(0,"function"==typeof e?e(x):e),i=f.getQueryData(w);t-(S.data?.pages??i?.pages??[]).length>0&&S.fetchNextPage({cancelRefetch:!1});return}return a(e)},[S,x,h,f,w]),O=h?S.isLoading:b.isLoading,P=h?S.isFetching:b.isFetching,C=(h?S.error:b.error)??null,I=(0,L.useCallback)(()=>{h?S.fetchNextPage({cancelRefetch:!1}):a(e=>Math.max(0,e+1))},[S,h]),M=(0,L.useCallback)(()=>{h||a(e=>Math.max(0,e-1))},[h]),R=(o.current-1)*l.current,F=Math.ceil((k-R)/l.current),D=h?!!S.hasNextPage:k-R>x*l.current,A=h?!!S.hasPreviousPage:(x-1)*l.current>R;return{data:E,count:k,error:C,isLoading:O,isFetching:P,isError:!!C,page:x,pageCount:F,fetchPage:T,fetchNext:I,fetchPrevious:M,hasNextPage:D,hasPreviousPage:A,revalidate:async()=>{await f.invalidateQueries({queryKey:s.invalidationKey});let[e,...t]=s.invalidationKey;return f.invalidateQueries({queryKey:[e+"-inf",...t]})},setData:e=>(h?(f.setQueryData(w,(t={})=>{let i=Array.isArray(t?.pages)?t.pages:[],r="function"==typeof e?e(i):e;return{...t,pages:r}}),_(e=>e+1)):(f.setQueryData(y,(t={data:[],total_count:0})=>"function"==typeof e?e(t):e),_(e=>e+1)),Promise.resolve())}};function e5(){let e=ej(),t=eG(),i=(0,L.useCallback)(()=>t?.user,[t?.user]);return(0,L.useSyncExternalStore)((0,L.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,L.useCallback)(()=>e.loaded&&e.__internal_lastEmittedResources?e.__internal_lastEmittedResources.user:i(),[e,i]),i)}let e8="useOAuthConsent";function e7(){let e=ej(),t=eG(),i=(0,L.useCallback)(()=>t?.organization,[t?.organization]);return(0,L.useSyncExternalStore)((0,L.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,L.useCallback)(()=>e.loaded&&e.__internal_lastEmittedResources?e.__internal_lastEmittedResources.organization:i(),[e,i]),i)}function e9(){let e=ej(),t=eG(),i=(0,L.useCallback)(()=>t?(0,v.deriveFromSsrInitialState)(t)?.session:void 0,[t]);return(0,L.useSyncExternalStore)((0,L.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,L.useCallback)(()=>e.loaded&&e.__internal_lastEmittedResources?e.__internal_lastEmittedResources.session:i(),[e,i]),i)}let te=()=>(eQ("useClerk"),ej());function tt(e){let t=te(),i=(0,L.useRef)(!1);(0,L.useEffect)(()=>{i.current||(i.current=!0,t.__internal_attemptToEnableEnvironmentSetting?.({for:"organizations",caller:e}))},[t,e])}let ti={data:void 0,count:void 0,error:void 0,isLoading:!1,isFetching:!1,isError:!1,page:void 0,pageCount:void 0,fetchPage:void 0,fetchNext:void 0,fetchPrevious:void 0,hasNextPage:!1,hasPreviousPage:!1,revalidate:void 0,setData:void 0},tr="useOrganizationCreationDefaults",ts={data:void 0,count:void 0,error:void 0,isLoading:!1,isFetching:!1,isError:!1,page:void 0,pageCount:void 0,fetchPage:void 0,fetchNext:void 0,fetchPrevious:void 0,hasNextPage:!1,hasPreviousPage:!1,revalidate:void 0,setData:void 0},tn="u">typeof window?L.default.useLayoutEffect:L.default.useEffect,ta="useSession",to,tl=()=>to,tu="useSessionList",tc="useUser";function th(){eQ(tc);let e=e5();return(ej().telemetry?.record(D(tc)),void 0===e)?{isLoaded:!1,isSignedIn:void 0,user:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:e}}async function td(e){try{let t=await e;if(t instanceof Response)return t.json();return t}catch(e){if((0,_.C)(e)&&e.errors.find(({code:e})=>"session_reverification_required"===e))return(0,f.reverificationError)();throw e}}function tp(e){let t=ej(),i=e?.enabled??!0,r=t.__internal_environment,s=e5(),n=e7(),a=r?.commerceSettings.billing.user.enabled,o=r?.commerceSettings.billing.organization.enabled,l=e?.for==="organization"?o:e?.for==="user"?a:a||o,u=e?.for==="organization",c=!(e?.authenticated??!0)||(!u||!!n?.id)&&!!s?.id;return l&&i&&t.loaded&&c}function tf({hookName:e,resourceType:t,useFetcher:i,options:r}){return function(s){let{for:n,enabled:a,...o}=s||{},l=n||"user";eQ(e);let u=i(l),c=e6(o,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,__experimental_mode:void 0}),h=ej(),d=e5(),p=e7();h.telemetry?.record(D(e));let f="organization"===l,g=tp({for:l,enabled:a,authenticated:!r?.unauthenticated}),v=void 0===o?void 0:{initialPage:c.initialPage,pageSize:c.pageSize,...r?.unauthenticated?{}:f?{orgId:p?.id}:{}},m=!!v&&h.loaded&&!!g;return e4({fetcher:u,config:{keepPreviousData:c.keepPreviousData,infinite:c.infinite,enabled:m,...r?.unauthenticated?{}:{isSignedIn:null!==d},__experimental_mode:c.__experimental_mode,initialPage:c.initialPage,pageSize:c.pageSize},keys:eY({stablePrefix:t,authenticated:!r?.unauthenticated,tracked:r?.unauthenticated?{for:l}:{userId:d?.id,...f?{orgId:p?.id}:{}},untracked:{args:v}})})}}tf({hookName:"useStatements",resourceType:"billing-statements",useFetcher:()=>{let e=ej();if(e.loaded)return e.billing.getStatements}}),tf({hookName:"usePaymentAttempts",resourceType:"billing-payment-attempts",useFetcher:()=>{let e=ej();if(e.loaded)return e.billing.getPaymentAttempts}}),tf({hookName:"usePaymentMethods",resourceType:"billing-payment-methods",useFetcher:e=>{let t=e7(),i=e5();return"organization"===e?t?.getPaymentMethods:i?.getPaymentMethods}}),tf({hookName:"usePlans",resourceType:"billing-plans",useFetcher:e=>{let t=ej();if(t.loaded)return i=>t.billing.getPlans({...i,for:e})},options:{unauthenticated:!0}});let tg=e=>{let t=(0,L.useRef)(e);return(0,L.useEffect)(()=>{t.current=e},[e]),t.current},tv=(e,t,i)=>{let r=!!i,s=(0,L.useRef)(i);(0,L.useEffect)(()=>{s.current=i},[i]),(0,L.useEffect)(()=>
18{if(!r||!e)return()=>{};let i=(...e)=>{s.current&&s.current(...e)};return e.on(t,i),()=>{e.off(t,i)}},[r,t,e,s])},tm=L.default.createContext(null);tm.displayName="ElementsContext";let t_=(e,t)=>{if(!e)throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);return e},ty=({stripe:e,options:t,children:i})=>{let r=L.default.useMemo(()=>tS(e),[e]),[s,n]=L.default.useState(()=>({stripe:"sync"===r.tag?r.stripe:null,elements:"sync"===r.tag?r.stripe.elements(t):null}));L.default.useEffect(()=>{let e=!0,i=e=>{n(i=>i.stripe?i:{stripe:e,elements:e.elements(t)})};return"async"!==r.tag||s.stripe?"sync"!==r.tag||s.stripe||i(r.stripe):r.stripePromise.then(t=>{t&&e&&i(t)}),()=>{e=!1}},[r,s,t]);let a=tg(e);L.default.useEffect(()=>{null!==a&&a!==e&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[a,e]);let o=tg(t);return L.default.useEffect(()=>{if(!s.elements)return;let e=tT(t,o,["clientSecret","fonts"]);e&&s.elements.update(e)},[t,o,s.elements]),L.default.createElement(tm.Provider,{value:s},i)},tb="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",tw=(e,t=tb)=>{if(null===e||tx(e))return e;throw Error(t)},tS=(e,t=tb)=>{if(tk(e))return{tag:"async",stripePromise:Promise.resolve(e).then(e=>tw(e,t))};let i=tw(e,t);return null===i?{tag:"empty"}:{tag:"sync",stripe:i}},tE=e=>null!==e&&"object"==typeof e,tk=e=>tE(e)&&"function"==typeof e.then,tx=e=>tE(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment,tT=(e,t,i)=>tE(e)?Object.keys(e).reduce((r,s)=>{let n=!tE(t)||!tP(e[s],t[s]);return i.includes(s)?(n&&console.warn(`Unsupported prop change: options.${s} is not a mutable property.`),r):n?{...r||{},[s]:e[s]}:r},null):null,tO="[object Object]",tP=(e,t)=>{if(!tE(e)||!tE(t))return e===t;let i=Array.isArray(e);if(i!==Array.isArray(t))return!1;let r=Object.prototype.toString.call(e)===tO;if(r!==(Object.prototype.toString.call(t)===tO))return!1;if(!r&&!i)return e===t;let s=Object.keys(e),n=Object.keys(t);if(s.length!==n.length)return!1;let a={};for(let e=0;e<s.length;e+=1)a[s[e]]=!0;for(let e=0;e<n.length;e+=1)a[n[e]]=!0;let o=Object.keys(a);return o.length===s.length&&o.every(i=>tP(e[i],t[i]))},tC=e=>t_(L.default.useContext(tm),e),tI=(d="payment",p="u"<typeof window,c=`${d.charAt(0).toUpperCase()+d.slice(1)}Element`,(h=p?e=>{tC(`mounts <${c}>`);let{id:t,className:i}=e;return L.default.createElement("div",{id:t,className:i})}:({id:e,className:t,fallback:i,options:r={},onBlur:s,onFocus:n,onReady:a,onChange:o,onEscape:l,onClick:u,onLoadError:h,onLoaderStart:p,onNetworksChange:f,onConfirm:g,onCancel:v,onShippingAddressChange:m,onShippingRateChange:_})=>{let y,b=tC(`mounts <${c}>`),w="elements"in b?b.elements:null,[S,E]=L.default.useState(null),k=L.default.useRef(null),x=L.default.useRef(null),[T,O]=(0,L.useState)(!1);tv(S,"blur",s),tv(S,"focus",n),tv(S,"escape",l),tv(S,"click",u),tv(S,"loaderror",h),tv(S,"loaderstart",p),tv(S,"networkschange",f),tv(S,"confirm",g),tv(S,"cancel",v),tv(S,"shippingaddresschange",m),tv(S,"shippingratechange",_),tv(S,"change",o),a&&(y=()=>{O(!0),a(S)}),tv(S,"ready",y),L.default.useLayoutEffect(()=>{if(null===k.current&&null!==x.current&&w){let e=null;w&&(e=w.create(d,r)),k.current=e,E(e),e&&e.mount(x.current)}},[w,r]);let P=tg(r);return L.default.useEffect(()=>{if(!k.current)return;let e=tT(r,P,["paymentRequest"]);e&&"update"in k.current&&k.current.update(e)},[r,P]),L.default.useLayoutEffect(()=>()=>{if(k.current&&"function"==typeof k.current.destroy)try{k.current.destroy(),k.current=null}catch{}},[]),L.default.createElement(L.default.Fragment,null,!T&&i,L.default.createElement("div",{id:e,style:{height:T?"unset":"0px",visibility:T?"visible":"hidden"},className:t,ref:x}))}).displayName=c,h.__elementType=d,h),[tM,tR]=ez("PaymentElementContext"),[tF,tD]=ez("StripeUtilsContext"),tA=({children:e})=>{let t=(()=>{let{stripe:e}=tC("calls useStripe()");return e})(),i=(()=>{let{elements:e}=t_(L.default.useContext(tm),"calls useElements()");return e})();return L.default.createElement(tF.Provider,{value:{value:{stripe:t,elements:i}}},e)},tN=({children:e})=>L.default.createElement(tF.Provider,{value:{value:{}}},e),t$=({children:e,...t})=>{let i=((e="user")=>{let t,i=(t=te(),e2({queryKey:["clerk-stripe-sdk"],queryFn:async()=>({loadStripe:await t.__internal_loadStripeJs()}),staleTime:1/0,refetchOnWindowFocus:!1,placeholderData:eJ(!0)},ex).data??null),r=te().__internal_environment,{initializedPaymentMethod:s,initializePaymentMethod:n}=function(e){let{for:t}=e??{},i=e7(),r=e5(),s="organization"===t?i:r,n=tp(e),a="billing-payment-method-initialize",o=(0,L.useMemo)(()=>[a,!0,{resourceId:s?.id},{}],[s?.id]),l=!!s?.id&&n;e3({isSignedOut:null===r,authenticated:!0,stableKeys:a});let u=e2({queryKey:o,queryFn:async()=>
18{if(s)return s.initializePaymentMethod({gateway:"stripe"})},enabled:l,staleTime:6e4,refetchOnWindowFocus:!1,placeholderData:eJ(l)},ex),[c]=e1(),h=(0,L.useCallback)(async()=>{if(!s)return;let e=await s.initializePaymentMethod({gateway:"stripe"});return c.setQueryData(o,e),e},[c,o,s]);return{initializedPaymentMethod:u.data??void 0,initializePaymentMethod:h}}({for:e}),a=r?.commerceSettings.billing.stripePublishableKey??void 0;return{stripe:function(e){let{stripeClerkLibs:t,externalGatewayId:i,stripePublishableKey:r}=e,s=(0,L.useMemo)(()=>["stripe-sdk",{externalGatewayId:i,stripePublishableKey:r}],[i,r]),n=tp({authenticated:!0});return e2({queryKey:s,queryFn:()=>t&&i&&r?t.loadStripe(r,{stripeAccount:i}):null,enabled:!!(t&&i&&r)&&n,staleTime:6e4,refetchOnWindowFocus:!1,placeholderData:eJ(!0)},ex).data}({stripeClerkLibs:i,externalGatewayId:s?.externalGatewayId,stripePublishableKey:a}),initializePaymentMethod:n,externalClientSecret:s?.externalClientSecret,paymentMethodOrder:s?.paymentMethodOrder}})(t.for),[r,s]=(0,L.useState)(!1);return L.default.createElement(tM.Provider,{value:{value:{...t,...i,setIsPaymentElementReady:s,isPaymentElementReady:r}}},e)},tL=e=>{let{stripe:t,externalClientSecret:i,stripeAppearance:r}=tR(),s=(()=>{let e=te(),t="en";try{t=e.__internal_getOption("localization")?.locale||"en"}catch{}return t.split("-")[0]})();return t&&i?L.default.createElement(ty,{key:i,stripe:t,options:{loader:"never",clientSecret:i,appearance:{variables:r},locale:s}},L.default.createElement(tA,null,e.children)):L.default.createElement(tN,null,e.children)},tq=()=>{throw Error("Clerk: Unable to submit, Stripe libraries are not yet loaded. Be sure to check `isFormReady` before calling `submit`.")},[tz,,tU]=ez("PortalProvider"),tj=({children:e,getContainer:t})=>{let i=L.default.useMemo(()=>({value:{getContainer:t}}),[t]);return L.default.createElement(tz.Provider,{value:i},e)};tj.displayName="UNSAFE_PortalProvider",e.s(["ClerkContextProvider",0,function(e){let t=e.clerk;if(t||function(){throw Error("ClerkJS: Clerk instance not found. Make sure Clerk is initialized before using any Clerk components.")}(),e.initialState instanceof Promise&&!("use"in L.default&&"function"==typeof L.default.use))throw Error("initialState cannot be a promise if React version is less than 19");let i=L.default.useMemo(()=>({value:t}),[e.clerkStatus]);return L.default.createElement(eH,{initialState:e.initialState},L.default.createElement(eU.Provider,{value:i},L.default.createElement(eK,{value:void 0},e.children)))},"InitialStateProvider",0,eH,"UNSAFE_PortalProvider",0,tj,"__experimental_CheckoutProvider",0,eK,"__experimental_PaymentElement",0,({fallback:e})=>{let{setIsPaymentElementReady:t,paymentMethodOrder:i,checkout:r,stripe:s,externalClientSecret:n,paymentDescription:a,for:o}=tR(),l=te().__internal_environment,u=(0,L.useMemo)(()=>{if(r&&r.totals&&r.plan)return{recurringPaymentRequest:{paymentDescription:a||"",managementURL:"organization"===o?l?.displayConfig.organizationProfileUrl||"":l?.displayConfig.userProfileUrl||"",regularBilling:{amount:r.totals.totalDueNow?.amount||r.totals.grandTotal.amount,label:r.plan.name,recurringPaymentIntervalUnit:"annual"===r.planPeriod?"year":"month"}}}},[r,a,o,l]),c=(0,L.useMemo)(()=>({layout:{type:"tabs",defaultCollapsed:!1},paymentMethodOrder:i,applePay:u}),[u,i]),h=(0,L.useCallback)(()=>{t(!0)},[t]);return s&&n?L.default.createElement(tI,{fallback:e,onReady:h,options:c}):L.default.createElement(L.default.Fragment,null,e)},"__experimental_PaymentElementProvider",0,({children:e,...t})=>L.default.createElement(t$,t,L.default.createElement(tL,null,e)),"__experimental_useCheckout",0,e=>{let t=eZ(),{for:i,planId:r,planPeriod:s,seatsQuantity:n,priceId:a}=e||t,o=e7(),{isLoaded:l,user:u}=th(),c=ej();if(null===u&&l)throw Error('Clerk: Ensure that `useCheckout` is inside a component wrapped with `<Show when="signed-in" />`.');if(l&&"organization"===i&&null===o)throw Error("Clerk: Ensure your flow checks for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object");let h=(0,L.useCallback)(()=>c.__experimental_checkout({planId:r,planPeriod:s,for:i,seatsQuantity:n,priceId:a}),[u?.id,o?.id,r,s,i,n,a]),d=(0,L.useCallback)(e=>c.loaded?c.__internal_state.__internal_effect(()=>{h(),e()}):()=>{},[h,c.loaded,c.__internal_state]),p=(0,L.useCallback)(()=>h(),[h]);
18return(0,L.useSyncExternalStore)(d,p,p)},"__experimental_usePaymentElement",0,()=>{let{isPaymentElementReady:e,initializePaymentMethod:t}=tR(),{stripe:i,elements:r}=tD(),{externalClientSecret:s}=tR(),n=(0,L.useCallback)(async()=>{if(!i||!r)return tq();let{setupIntent:e,error:t}=await i.confirmSetup({elements:r,confirmParams:{return_url:window.location.href},redirect:"if_required"});return t?{data:null,error:{gateway:"stripe",error:{code:t.code,message:t.message,type:t.type}}}:{data:{gateway:"stripe",paymentToken:e.payment_method},error:null}},[i,r]),a=(0,L.useCallback)(async()=>{if(!i||!r)return tq();await t()},[i,r,t]),o=!!(i&&s);return o?{submit:n,reset:a,isFormReady:e,provider:{name:"stripe"},isProviderReady:o}:{submit:tq,reset:tq,isFormReady:!1,provider:void 0,isProviderReady:!1}},"__internal_useSessionBase",0,e9,"isDeeplyEqual",0,eL,"useAPIKeys",0,function(e){eQ("useAPIKeys");let t=e6(e,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,subject:"",query:"",enabled:!0}),i=ej();i.telemetry?.record(D("useAPIKeys"));let r={initialPage:t.initialPage,pageSize:t.pageSize,...t.subject?{subject:t.subject}:{},...t.query?{query:t.query}:{}},s=(t.enabled??!0)&&i.loaded;return e4({fetcher:i.apiKeys?.getAll?e=>i.apiKeys.getAll({...e,subject:t.subject}):void 0,config:{keepPreviousData:t.keepPreviousData,infinite:t.infinite,enabled:s,isSignedIn:null!==i.user,initialPage:t.initialPage,pageSize:t.pageSize},keys:eY({stablePrefix:"apiKeys",authenticated:!0,tracked:{subject:t.subject},untracked:{args:r}})})},"useAssertWrappedByClerkProvider",0,eQ,"useClerk",0,te,"useClerkInstanceContext",0,ej,"useInitialStateContext",0,eG,"useOAuthConsent",0,function(e){eQ(e8);let{oauthClientId:t,scope:i,redirectUri:r,keepPreviousData:s=!0,enabled:n=!0}=e,a=ej(),o=e5(),l=(t??"").trim();a.telemetry?.record(D(e8));let{queryKey:u}=function(e){let{userId:t,oauthClientId:i,scope:r,redirectUri:s}=e;return(0,L.useMemo)(()=>eY({stablePrefix:"oauthConsentInfo",authenticated:!0,tracked:{userId:t??null},untracked:{args:{oauthClientId:i,...void 0!==r&&{scope:r},...void 0!==s&&{redirectUri:s}}}}),[t,i,r,s])}({userId:o?.id??null,oauthClientId:l,scope:i,redirectUri:r}),c=l.length>0,h=!!o&&c&&n&&a.loaded,d=e2({queryKey:u,queryFn:()=>{var e,t;return e=a,t={oauthClientId:l,scope:i,redirectUri:r},e.oauthApplication.getConsentInfo(t)},enabled:h,placeholderData:eJ(s&&h)},ex);return{data:d.data,error:d.error??null,isLoading:d.isLoading,isFetching:d.isFetching}},"useOrganization",0,function(e){var t,i;let{domains:r,membershipRequests:s,memberships:n,invitations:a}=e||{};eQ("useOrganization"),tt("useOrganization");let o=e7(),l=e9(),u=e6(r,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,enrollmentMode:void 0}),c=e6(s,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),h=e6(n,{initialPage:1,pageSize:10,role:void 0,keepPreviousData:!1,infinite:!1,query:void 0}),d=e6(a,{initialPage:1,pageSize:10,status:["pending"],keepPreviousData:!1,infinite:!1}),p=ej();p.telemetry?.record(D("useOrganization"));let f=void 0===r?void 0:{initialPage:u.initialPage,pageSize:u.pageSize,enrollmentMode:u.enrollmentMode},g=void 0===s?void 0:{initialPage:c.initialPage,pageSize:c.pageSize,status:c.status},v=void 0===n?void 0:{initialPage:h.initialPage,pageSize:h.pageSize,role:h.role,query:h.query},m=void 0===a?void 0:{initialPage:d.initialPage,pageSize:d.pageSize,status:d.status},_=e4({fetcher:o?.getDomains,config:{keepPreviousData:u.keepPreviousData,infinite:u.infinite,enabled:!!f,isSignedIn:null!==o,initialPage:u.initialPage,pageSize:u.pageSize},keys:eY({stablePrefix:"domains",authenticated:!0,tracked:{organizationId:o?.id},untracked:{args:f}})}),y=e4({fetcher:o?.getMembershipRequests,config:{keepPreviousData:c.keepPreviousData,infinite:c.infinite,enabled:!!g,isSignedIn:null!==o,initialPage:c.initialPage,pageSize:c.pageSize},keys:eY({stablePrefix:"membershipRequests",authenticated:!0,tracked:{organizationId:o?.id},untracked:{args:g}})}),b=e4({fetcher:o?.getMemberships,config:{keepPreviousData:h.keepPreviousData,infinite:h.infinite,enabled:!!v,isSignedIn:null!==o,initialPage:h.initialPage,pageSize:h.pageSize},keys:eY({stablePrefix:"memberships",authenticated:!0,tracked:{organizationId:o?.id},untracked:{args:v}})}),w=e4({fetcher:o?.getInvitations,config:{keepPreviousData:d.keepPreviousData,infinite:d.infinite,enabled:!!m,isSignedIn:null!==o,initialPage:d.initialPage,pageSize:d.pageSize},keys:eY({stablePrefix:"invitations",authenticated:!0,tracked:{organizationId:o?.id},untracked:{args:m}})});return void 0===o?{isLoaded:!1,organization:void 0,membership:void 0,domains:ti,membershipRequests:ti,memberships:ti,invitations:ti}:null===o?{isLoaded:!0,organization:null,membership:null,domains:null,membershipRequests:null,memberships:null,invitations:null}:!p.loaded&&o?{isLoaded:!0,organization:o,membership:void 0,domains:ti,membershipRequests:ti,memberships:ti,invitations:ti}:{isLoaded:p.loaded,organization:o,membership:(t=l.user.organizationMemberships,i=o.id,t.find(e=>e.organization.id===i)),domains:_,membershipRequests:y,memberships:b,invitations:w}},"useOrganizationCreationDefaults",0,function(e={}){eQ(tr);let{keepPreviousData:t=!0,enabled:i=!0}=e,r=ej(),s=e5(),n=r.__internal_environment?.organizationSettings?.organizationCreationDefaults?.enabled??!1;r.telemetry?.record(D(tr));let{queryKey:a}=function(e){let{userId:t}=e;return(0,L.useMemo)(()=>eY({stablePrefix:"organizationCreationDefaults",authenticated:!!t,tracked:{userId:t??null},untracked:{args:{}}}),[t])}({userId:s?.id??null}),o=!!s&&i&&n&&r.loaded,l=e2({queryKey:a,queryFn:s?.getOrganizationCreationDefaults,enabled:o,placeholderData:eJ(t)},ex);return{data:l.data,error:l.error??null,isLoading:l.isLoading,isFetching:l.isFetching}},"useOrganizationList",0,function(e){let{userMemberships:t,userInvitations:i,userSuggestions:r}=e||{};eQ("useOrganizationList"),tt("useOrganizationList");let s=e6(t,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1}),n=e6(i,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),a=e6(r,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),o=ej(),l=e5();o.telemetry?.record(D("useOrganizationList"));let u=void 0===t?void 0:{initialPage:s.initialPage,pageSize:s.pageSize},c=void 0===i?void 0:{initialPage:n.initialPage,pageSize:n.pageSize,status:n.status},h=void 0===r?void 0:{initialPage:a.initialPage,pageSize:a.pageSize,status:a.status},d=!!(o.loaded&&l),p=e4({fetcher:l?.getOrganizationMemberships,config:{keepPreviousData:s.keepPreviousData,infinite:s.infinite,enabled:!!u,isSignedIn:null!==l,initialPage:s.initialPage,pageSize:s.pageSize},keys:eY({stablePrefix:"userMemberships",authenticated:!0,tracked:{userId:l?.id},untracked:{args:u}})}),f=e4({fetcher:l?.getOrganizationInvitations,config:{keepPreviousData:n.keepPreviousData,infinite:n.infinite,enabled:!!c,isSignedIn:null!==l,initialPage:n.initialPage,pageSize:n.pageSize},keys:eY({stablePrefix:"userInvitations",authenticated:!0,tracked:{userId:l?.id},untracked:{args:c}})}),g=e4({fetcher:l?.getOrganizationSuggestions,config:{keepPreviousData:a.keepPreviousData,infinite:a.infinite,enabled:!!h,isSignedIn:null!==l,initialPage:a.initialPage,pageSize:a.pageSize},keys:eY({stablePrefix:"userSuggestions",authenticated:!0,tracked:{userId:l?.id},untracked:{args:h}})});return d?{isLoaded:d,setActive:o.setActive,createOrganization:o.createOrganization,userMemberships:p,userInvitations:f,userSuggestions:g}
18:{isLoaded:!1,createOrganization:void 0,setActive:void 0,userMemberships:ts,userInvitations:ts,userSuggestions:ts}},"usePortalRoot",0,()=>{let e=tU();return e&&"getContainer"in e&&e.getContainer?e.getContainer:()=>null},"useReverification",0,(e,t)=>{let{__internal_openReverification:i,telemetry:r}=te(),s=(0,L.useRef)(e),n=(0,L.useRef)(t);return r?.record(D("useReverification",{onNeedsReverification:!!t?.onNeedsReverification})),tn(()=>{s.current=e,n.current=t}),(0,L.useCallback)((...e)=>{var t;return(t={openUIComponent:i,telemetry:r,...n.current},function(e){return async(...i)=>{let r=await td(e(...i));if((0,f.isReverificationHint)(r)){let s=(0,$.t)(),n=(0,g.validateReverificationConfig)(r.clerk_error.metadata?.reverification),a=n?n().level:void 0,o=()=>{s.reject(new m.t("User cancelled attempted verification",{code:"reverification_cancelled"}))},l=()=>{s.resolve(!0)};void 0===t.onNeedsReverification?t.openUIComponent?.({level:a,afterVerification:l,afterVerificationCancelled:o}):t.onNeedsReverification({cancel:o,complete:l,level:a}),await s.promise,r=await td(e(...i))}return r}})(s.current)(...e)},[i,r])},"useSession",0,()=>{eQ(ta);let e=e9(),t=ej();return(t.telemetry?.record(D(ta)),void 0===e)?{isLoaded:!1,isSignedIn:void 0,session:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,session:null}:{isLoaded:!0,isSignedIn:t.isSignedIn,session:e}},"useSessionList",0,()=>{let e;eQ(tu);let t=ej(),i=(e=ej(),(0,L.useSyncExternalStore)((0,L.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,L.useCallback)(()=>{if(e.loaded&&e.__internal_lastEmittedResources)return e.__internal_lastEmittedResources.client},[e]),tl));return(ej().telemetry?.record(D(tu)),i)?{isLoaded:!0,sessions:i.sessions,setActive:t.setActive}:{isLoaded:!1,sessions:void 0,setActive:void 0}},"useUser",0,th],280204),e.s(["h",0,th],112690)},676461,e=>{"use strict";var t=e.i(112690);e.s(["useUser",()=>t.h])},603480,632729,e=>{"use strict";let t;class i extends Error{}class r extends i{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class s extends i{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class n extends i{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class a extends i{}class o extends i{constructor(e){super(`Invalid unit ${e}`)}}class l extends i{}class u extends i{constructor(){super("Zone is an abstract class")}}let c="numeric",h="short",d="long",p={year:c,month:c,day:c},f={year:c,month:h,day:c},g={year:c,month:h,day:c,weekday:h},v={year:c,month:d,day:c},m={year:c,month:d,day:c,weekday:d},_={hour:c,minute:c},y={hour:c,minute:c,second:c},b={hour:c,minute:c,second:c,timeZoneName:h},w={hour:c,minute:c,second:c,timeZoneName:d},S={hour:c,minute:c,hourCycle:"h23"},E={hour:c,minute:c,second:c,hourCycle:"h23"},k={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:h},x={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:d},T={year:c,month:c,day:c,hour:c,minute:c},O={year:c,month:c,day:c,hour:c,minute:c,second:c},P={year:c,month:h,day:c,hour:c,minute:c},C={year:c,month:h,day:c,hour:c,minute:c,second:c},I={year:c,month:h,day:c,weekday:h,hour:c,minute:c},M={year:c,month:d,day:c,hour:c,minute:c,timeZoneName:h},R={year:c,month:d,day:c,hour:c,minute:c,second:c,timeZoneName:h},F={year:c,month:d,day:c,weekday:d,hour:c,minute:c,timeZoneName:d},D={year:c,month:d,day:c,weekday:d,hour:c,minute:c,second:c,timeZoneName:d};class A{get type(){throw new u}get name(){throw new u}get ianaName(){return this.name}get isUniversal(){throw new u}offsetName(e,t){throw new u}formatOffset(e,t){throw new u}offset(e){throw new u}equals(e){throw new u}get isValid(){throw new u}}let N=null;class $ extends A{static get instance(){return null===N&&(N=new $),N}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return e2(e,t,i)}formatOffset(e,t){return e5(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let L=new Map,q={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6},z=new Map;class U extends A{static create(e){let t=z.get(e);
18return void 0===t&&z.set(e,t=new U(e)),t}static resetCache(){z.clear(),L.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=U.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return e2(e,t,i,this.name)}formatOffset(e,t){return e5(this.offset(e),t)}offset(e){var t;let i;if(!this.valid)return NaN;let r=new Date(e);if(isNaN(r))return NaN;let s=(t=this.name,void 0===(i=L.get(t))&&(i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),L.set(t,i)),i),[n,a,o,l,u,c,h]=s.formatToParts?function(e,t){let i=e.formatToParts(t),r=[];for(let e=0;e<i.length;e++){let{type:t,value:s}=i[e],n=q[t];"era"===t?r[n]=s:eA(n)||(r[n]=parseInt(s,10))}return r}(s,r):function(e,t){let i=e.format(t).replace(/\u200E/g,""),[,r,s,n,a,o,l,u]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i);return[n,r,s,a,o,l,u]}(s,r);"BC"===l&&(n=-Math.abs(n)+1);let d=eJ({year:n,month:a,day:o,hour:24===u?0:u,minute:c,second:h,millisecond:0}),p=+r,f=p%1e3;return(d-(p-=f>=0?f:1e3+f))/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let j={},V=new Map;function W(e,t={}){let i=JSON.stringify([e,t]),r=V.get(i);return void 0===r&&(r=new Intl.DateTimeFormat(e,t),V.set(i,r)),r}let H=new Map,G=new Map,B=null,Z=new Map;function K(e){let t=Z.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Z.set(e,t)),t}let Q=new Map;function Y(e,t,i,r){let s=e.listingMode();return"error"===s?null:"en"===s?i(t):r(t)}class J{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:r,floor:s,...n}=i;if(!t||Object.keys(n).length>0){const t={useGrouping:!1,...i};i.padTo>0&&(t.minimumIntegerDigits=i.padTo),this.inf=function(e,t={}){let i=JSON.stringify([e,t]),r=H.get(i);return void 0===r&&(r=new Intl.NumberFormat(e,t),H.set(i,r)),r}(e,t)}}format(e){if(!this.inf)return eW(this.floor?Math.floor(e):eZ(e,3),this.padTo);{let t=this.floor?Math.floor(e):e;return this.inf.format(t)}}}class X{constructor(e,t,i){let r;if(this.opts=i,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=-1*(e.offset/60),i=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&U.create(i).valid?(r=i,this.dt=e):(r="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,r=e.zone.name):(r="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||r,this.dtf=W(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"!==e.type)return e;{let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ee{constructor(e,t,i){this.opts={style:"long",...i},!t&&eL()&&(this.rtf=function(e,t={}){let{base:i,...r}=t,s=JSON.stringify([e,r]),n=G.get(s);return void 0===n&&(n=new Intl.RelativeTimeFormat(e,t),G.set(s,n)),n}(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,i="always",r=!1){let s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},n=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===i&&n){let i="days"===e;switch(t){case 1:return i?"tomorrow":`next ${s[e][0]}`;case -1:return i?"yesterday":`last ${s[e][0]}`;case 0:return i?"today":`this ${s[e][0]}`}}let a=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,u=s[e],c=r?l?u[1]:u[2]||u[1]:l?s[e][0]:e;return a?`${o} ${c} ago`:`in ${o} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}let et={firstDay:1,minimalDays:4,weekend:[6,7]};class ei{static fromOpts(e){return ei.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,r,s=!1){let n=e||eb.defaultLocale;return new ei(n||(s?"en-US":B||(B=new Intl.DateTimeFormat().resolvedOptions().locale)),t||eb.defaultNumberingSystem,i||eb.defaultOutputCalendar,ej(r)||eb.defaultWeekSettings,n)}static resetCache(){B=null,V.clear(),H.clear(),G.clear(),Z.clear(),Q.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:r}={}){return ei.create(e,t,i,r)}constructor(e,t,i,r,s){const[n,a,o]=function(e){let t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));let i=e.indexOf("-u-");if(-1===i)return[e];{let t,r;try{t=W(e).resolvedOptions(),r=e}catch(n){let s=e.substring(0,i);t=W(s).resolvedOptions(),r=s}let{numberingSystem:s,calendar:n}=t;return[r,s,n]}}(e);this.locale=n,this.numberingSystem=t||a||null,this.outputCalendar=i||o||null,this.weekSettings=r,this.intl=function(e,t,i){return(i||t)&&(e.includes("-u-")||(e+="-u"),i&&(e+=`-ca-${i}`),t&&(e+=`-nu-${t}`)),e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return null==this.fastNumbersCached&&(this.fastNumbersCached=(!this.numberingSystem||"latn"===this.numberingSystem)&&("latn"===this.numberingSystem||!this.locale||this.locale.startsWith("en")||"latn"===K(this.locale).numberingSystem)),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(null===this.numberingSystem||"latn"===this.numberingSystem)&&(null===this.outputCalendar||"gregory"===this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?ei.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,ej(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Y(this,e,tt,()=>{let i="ja"===this.intl||this.intl.startsWith("ja-"),r=(t&=!i)?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";if(!this.monthsCache[s][e]){let t=i?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,"month");this.monthsCache[s][e]=function(e){let t=[];for(let i=1;i<=12;i++){let r=iZ.utc(2009,i,1);t.push(e(r))}return t}(t)}return this.monthsCache[s][e]})}weekdays(e,t=!1){return Y(this,e,tn,()=>{let i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){let t=[];for(let i=1;i<=7;i++){let r=iZ.utc(2016,11,13+i);t.push(e(r))}return t}(e=>this.extract(e,i,"weekday"))),this.weekdaysCache[r][e]})}meridiems(){return Y(this,void 0,()=>ta,()=>{if(!this.meridiemCache){let e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[iZ.utc(2016,11,13,9),iZ.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Y(this,e,tc,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[iZ.utc(-40,1,1),iZ.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]}
18)}extract(e,t,i){let r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===i);return r?r.value:null}numberFormatter(e={}){return new J(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new X(e,this.intl,t)}relFormatter(e={}){return new ee(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){let i=JSON.stringify([e,t]),r=j[i];return r||(r=new Intl.ListFormat(e,t),j[i]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||K(this.intl).locale.startsWith("en-us")}getWeekSettings(){if(this.weekSettings)return this.weekSettings;if(!eq())return et;var e=this.locale;let t=Q.get(e);if(!t){let i=new Intl.Locale(e);"minimalDays"in(t="getWeekInfo"in i?i.getWeekInfo():i.weekInfo)||(t={...et,...t}),Q.set(e,t)}return t}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let er=null;class es extends A{static get utcInstance(){return null===er&&(er=new es(0)),er}static instance(e){return 0===e?es.utcInstance:new es(e)}static parseSpecifier(e){if(e){let t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new es(e3(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${e5(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${e5(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return e5(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class en extends A{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ea(e,t){if(eA(e)||null===e)return t;if(e instanceof A)return e;if("string"==typeof e){let i=e.toLowerCase();return"default"===i?t:"local"===i||"system"===i?$.instance:"utc"===i||"gmt"===i?es.utcInstance:es.parseSpecifier(i)||U.create(e)}if(eN(e))return es.instance(e);if("object"==typeof e&&"offset"in e&&"function"==typeof e.offset)return e;else return new en(e)}let eo={arab:"[Ù -Ù©]",arabext:"[Û°-Û¹]",bali:"[á-á]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[ï¼-ï¼]",gujr:"[૦-૯]",hanidec:"[ã|ä¸|äº|ä¸|å|äº|å
|ä¸|å
«|ä¹]",khmr:"[á -á©]",knda:"[೦-೯]",laoo:"[à»-à»]",limb:"[á¥-á¥]",mlym:"[൦-൯]",mong:"[á -á ]",mymr:"[á-á]",orya:"[à¦-à¯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[à¹-à¹]",tibt:"[༠-༩]",latn:"\\d"},el={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},eu=eo.hanidec.replace(/[\[|\]]/g,"").split(""),ec=new Map;function eh({numberingSystem:e},t=""){let i=e||"latn",r=ec.get(i);void 0===r&&(r=new Map,ec.set(i,r));let s=r.get(t);return void 0===s&&(s=RegExp(`${eo[i]}${t}`),r.set(t,s)),s}let ed=()=>Date.now(),ep="system",ef=null,eg=null,ev=null,em=60,e_,ey=null;class eb{static get now(){return ed}static set now(e){ed=e}static set defaultZone(e){ep=e}static get defaultZone(){return ea(ep,$.instance)}static get defaultLocale(){return ef}static set defaultLocale(e){ef=e}static get defaultNumberingSystem(){return eg}static set defaultNumberingSystem(e){eg=e}
18static get defaultOutputCalendar(){return ev}static set defaultOutputCalendar(e){ev=e}static get defaultWeekSettings(){return ey}static set defaultWeekSettings(e){ey=ej(e)}static get twoDigitCutoffYear(){return em}static set twoDigitCutoffYear(e){em=e%100}static get throwOnInvalid(){return e_}static set throwOnInvalid(e){e_=e}static resetCaches(){ei.resetCache(),U.resetCache(),iZ.resetCache(),ec.clear()}}class ew{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}let eS=[0,31,59,90,120,151,181,212,243,273,304,334],eE=[0,31,60,91,121,152,182,213,244,274,305,335];function ek(e,t){return new ew("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function ex(e,t,i){let r=new Date(Date.UTC(e,t-1,i));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let s=r.getUTCDay();return 0===s?7:s}function eT(e,t){let i=eK(e)?eE:eS,r=i.findIndex(e=>e<t),s=t-i[r];return{month:r+1,day:s}}function eO(e,t){return(e-t+7)%7+1}function eP(e,t=4,i=1){let{year:r,month:s,day:n}=e,a=n+(eK(r)?eE:eS)[s-1],o=eO(ex(r,s,n),i),l=Math.floor((a-o+14-t)/7),u;return l<1?l=e0(u=r-1,t,i):l>e0(r,t,i)?(u=r+1,l=1):u=r,{weekYear:u,weekNumber:l,weekday:o,...e8(e)}}function eC(e,t=4,i=1){let{weekYear:r,weekNumber:s,weekday:n}=e,a=eO(ex(r,1,t),i),o=eQ(r),l=7*s+n-a-7+t,u;l<1?l+=eQ(u=r-1):l>o?(u=r+1,l-=eQ(r)):u=r;let{month:c,day:h}=eT(u,l);return{year:u,month:c,day:h,...e8(e)}}function eI(e){let{year:t,month:i,day:r}=e,s=r+(eK(t)?eE:eS)[i-1];return{year:t,ordinal:s,...e8(e)}}function eM(e){let{year:t,ordinal:i}=e,{month:r,day:s}=eT(t,i);return{year:t,month:r,day:s,...e8(e)}}function eR(e,t){if(!(!eA(e.localWeekday)||!eA(e.localWeekNumber)||!eA(e.localWeekYear)))return{minDaysInFirstWeek:4,startOfWeek:1};if(!eA(e.weekday)||!eA(e.weekNumber)||!eA(e.weekYear))throw new a("Cannot mix locale-based week fields with ISO-based week fields");return eA(e.localWeekday)||(e.weekday=e.localWeekday),eA(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),eA(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}function eF(e){let t=e$(e.year),i=eV(e.month,1,12),r=eV(e.day,1,eY(e.year,e.month));return t?i?!r&&ek("day",e.day):ek("month",e.month):ek("year",e.year)}function eD(e){let{hour:t,minute:i,second:r,millisecond:s}=e,n=eV(t,0,23)||24===t&&0===i&&0===r&&0===s,a=eV(i,0,59),o=eV(r,0,59),l=eV(s,0,999);return n?a?o?!l&&ek("millisecond",s):ek("second",r):ek("minute",i):ek("hour",t)}function eA(e){return void 0===e}function eN(e){return"number"==typeof e}function e$(e){return"number"==typeof e&&e%1==0}function eL(){try{return"u">typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function eq(){try{return"u">typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function ez(e,t,i){if(0!==e.length)return e.reduce((e,r)=>{let s=[t(r),r];return e&&i(e[0],s[0])===e[0]?e:s},null)[1]}function eU(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ej(e){if(null==e)return null;if("object"!=typeof e)throw new l("Week settings must be an object");if(!eV(e.firstDay,1,7)||!eV(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!eV(e,1,7)))throw new l("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function eV(e,t,i){return e$(e)&&e>=t&&e<=i}function eW(e,t=2){return e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0")}function eH(e){if(!eA(e)&&null!==e&&""!==e)return parseInt(e,10)}function eG(e){if(!eA(e)&&null!==e&&""!==e)return parseFloat(e)}function eB(e){if(!eA(e)&&null!==e&&""!==e)return Math.floor(1e3*parseFloat("0."+e))}
18function eZ(e,t,i="round"){let r=10**t;switch(i){case"expand":return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case"trunc":return Math.trunc(e*r)/r;case"round":return Math.round(e*r)/r;case"floor":return Math.floor(e*r)/r;case"ceil":return Math.ceil(e*r)/r;default:throw RangeError(`Value rounding ${i} is out of range`)}}function eK(e){return e%4==0&&(e%100!=0||e%400==0)}function eQ(e){return eK(e)?366:365}function eY(e,t){var i;let r=(i=t-1)-12*Math.floor(i/12)+1;return 2===r?eK(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function eJ(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function eX(e,t,i){return-eO(ex(e,1,t),i)+t-1}function e0(e,t=4,i=1){let r=eX(e,t,i),s=eX(e+1,t,i);return(eQ(e)-r+s)/7}function e1(e){return e>99?e:e>eb.twoDigitCutoffYear?1900+e:2e3+e}function e2(e,t,i,r=null){let s=new Date(e),n={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(n.timeZone=r);let a={timeZoneName:t,...n},o=new Intl.DateTimeFormat(i,a).formatToParts(s).find(e=>"timezonename"===e.type.toLowerCase());return o?o.value:null}function e3(e,t){let i=parseInt(e,10);Number.isNaN(i)&&(i=0);let r=parseInt(t,10)||0,s=i<0||Object.is(i,-0)?-r:r;return 60*i+s}function e6(e){let t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new l(`Invalid unit value ${e}`);return t}function e4(e,t){let i={};for(let r in e)if(eU(e,r)){let s=e[r];if(null==s)continue;i[t(r)]=e6(s)}return i}function e5(e,t){let i=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${eW(i,2)}:${eW(r,2)}`;case"narrow":return`${s}${i}${r>0?`:${r}`:""}`;case"techie":return`${s}${eW(i,2)}${eW(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function e8(e){return["hour","minute","second","millisecond"].reduce((t,i)=>(t[i]=e[i],t),{})}let e7=["January","February","March","April","May","June","July","August","September","October","November","December"],e9=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],te=["J","F","M","A","M","J","J","A","S","O","N","D"];function tt(e){switch(e){case"narrow":return[...te];case"short":return[...e9];case"long":return[...e7];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}let ti=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],tr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ts=["M","T","W","T","F","S","S"];function tn(e){switch(e){case"narrow":return[...ts];case"short":return[...tr];case"long":return[...ti];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}let ta=["AM","PM"],to=["Before Christ","Anno Domini"],tl=["BC","AD"],tu=["B","A"];function tc(e){switch(e){case"narrow":return[...tu];case"short":return[...tl];case"long":return[...to];default:return null}}function th(e,t){let i="";for(let r of e)r.literal?i+=r.val:i+=t(r.val);return i}let td={D:p,DD:f,DDD:v,DDDD:m,t:_,tt:y,ttt:b,tttt:w,T:S,TT:E,TTT:k,TTTT:x,f:T,ff:P,fff:M,ffff:F,F:O,FF:C,FFF:R,FFFF:D};class tp{static create(e,t={}){return new tp(e,t)}static parseFormat(e){let t=null,i="",r=!1,s=[];for(let n=0;n<e.length;n++){let a=e.charAt(n);"'"===a?((i.length>0||r)&&s.push({literal:r||/^\s+$/.test(i),val:""===i?"'":i}),t=null,i="",r=!r):r||a===t?i+=a:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=a,t=a)}return i.length>0&&s.push({literal:r||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return td[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}
18num(e,t=0,i){if(this.opts.forceSimple)return eW(e,t);let r={...this.opts};return t>0&&(r.padTo=t),i&&(r.signDisplay=i),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){let i="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=(t,i)=>this.loc.extract(e,t,i),n=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",a=(t,r)=>i?tt(t)[e.month-1]:s(r?{month:t}:{month:t,day:"numeric"},"month"),o=(t,r)=>i?tn(t)[e.weekday-1]:s(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),l=t=>{let i=tp.macroTokenToFormatOpts(t);return i?this.formatWithSystemDefault(e,i):t},u=t=>i?tc(t)[e.year<0?0:1]:s({era:t},"era"),c=t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return n({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return n({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return n({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return i?ta[e.hour<12?0:1]:s({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return r?s({day:"numeric"},"day"):this.num(e.day);case"dd":return r?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return o("short",!0);case"cccc":return o("long",!0);case"ccccc":return o("narrow",!0);case"EEE":return o("short",!1);case"EEEE":return o("long",!1);case"EEEEE":return o("narrow",!1);case"L":return r?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return r?s({month:"numeric"},"month"):this.num(e.month);case"MM":return r?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return r?s({year:"numeric"},"year"):this.num(e.year);case"yy":return r?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return u("short");case"GG":return u("long");case"GGGGG":return u("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(t)}};return th(tp.parseFormat(t),c)}formatDurationFromString(e,t){let i="negativeLargestOnly"===this.opts.signMode?-1:1,r=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},s=(e,t)=>s=>{let n=r(s);if(!n)return s;{let r,a=t.isNegativeDuration&&n!==t.largestUnit?i:1;return r="negativeLargestOnly"===this.opts.signMode&&n!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(n)*a,s.length,r)}},n=tp.parseFormat(t),a=n.reduce((e,{literal:t,val:i})=>t?e:e.concat(i),[]),o=e.shiftTo(...a.map(r).filter(e=>e)),l={isNegativeDuration:o<0,largestUnit:Object.keys(o.values)[0]};return th(n,s(o,l))}}let tf=/[A-Za-z_+-]{1,256}
18(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function tg(...e){let t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function tv(...e){return t=>e.reduce(([e,i,r],s)=>{let[n,a,o]=s(t,r);return[{...e,...n},a||i,o]},[{},null,1]).slice(0,2)}function tm(e,...t){if(null==e)return[null,null];for(let[i,r]of t){let t=i.exec(e);if(t)return r(t)}return[null,null]}function t_(...e){return(t,i)=>{let r,s={};for(r=0;r<e.length;r++)s[e[r]]=eH(t[i+r]);return[s,null,i+r]}}let ty=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,tb=`(?:${ty.source}?(?:\\[(${tf.source})\\])?)?`,tw=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,tS=RegExp(`${tw.source}${tb}`),tE=RegExp(`(?:[Tt]${tS.source})?`),tk=t_("weekYear","weekNumber","weekDay"),tx=t_("year","ordinal"),tT=RegExp(`${tw.source} ?(?:${ty.source}|(${tf.source}))?`),tO=RegExp(`(?: ${tT.source})?`);function tP(e,t,i){let r=e[t];return eA(r)?i:eH(r)}function tC(e,t){return[{hours:tP(e,t,0),minutes:tP(e,t+1,0),seconds:tP(e,t+2,0),milliseconds:eB(e[t+3])},null,t+4]}function tI(e,t){let i=!e[t]&&!e[t+1],r=e3(e[t+1],e[t+2]);return[{},i?null:es.instance(r),t+3]}function tM(e,t){return[{},e[t]?U.create(e[t]):null,t+1]}let tR=RegExp(`^T?${tw.source}$`),tF=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function tD(e){let[t,i,r,s,n,a,o,l,u]=e,c="-"===t[0],h=l&&"-"===l[0],d=(e,t=!1)=>void 0!==e&&(t||e&&c)?-e:e;return[{years:d(eG(i)),months:d(eG(r)),weeks:d(eG(s)),days:d(eG(n)),hours:d(eG(a)),minutes:d(eG(o)),seconds:d(eG(l),"-0"===l),milliseconds:d(eB(u),h)}]}let tA={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function tN(e,t,i,r,s,n,a){let o={year:2===t.length?e1(eH(t)):eH(t),month:e9.indexOf(i)+1,day:eH(r),hour:eH(s),minute:eH(n)};return a&&(o.second=eH(a)),e&&(o.weekday=e.length>3?ti.indexOf(e)+1:tr.indexOf(e)+1),o}let t$=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function tL(e){let[,t,i,r,s,n,a,o,l,u,c,h]=e;return[tN(t,s,r,i,n,a,o),new es(l?tA[l]:u?0:e3(c,h))]}let tq=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,tz=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,tU=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function tj(e){let[,t,i,r,s,n,a,o]=e;return[tN(t,s,r,i,n,a,o),es.utcInstance]}function tV(e){let[,t,i,r,s,n,a,o]=e;return[tN(t,o,i,r,s,n,a),es.utcInstance]}let tW=tg(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,tE),tH=tg(/(\d{4})-?W(\d\d)(?:-?(\d))?/,tE),tG=tg(/(\d{4})-?(\d{3})/,tE),tB=tg(tS),tZ=tv(function(e,t){return[{year:tP(e,t),month:tP(e,t+1,1),day:tP(e,t+2,1)},null,t+3]},tC,tI,tM),tK=tv(tk,tC,tI,tM),tQ=tv(tx,tC,tI,tM),tY=tv(tC,tI,tM),tJ=tv(tC),tX=tg(/(\d{4})-(\d\d)-(\d\d)/,tO),t0=tg(tT),t1=tv(tC,tI,tM),t2="Invalid Duration",t3={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},t6={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...t3},t4={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:0x1e18558,milliseconds:31556952e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:7889238,milliseconds:7889238e3},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...t3},t5=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],t8=t5.slice(0).reverse();function t7(e,t,i=!1){return new ii({values:i?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix})}function t9(e,t){let i=t.milliseconds??0;for(let r of t8.slice(1))t[r]&&(i+=t[r]*e[r].milliseconds);return i}function ie(e,t){let i=0>t9(e,t)?-1:1;t5.reduceRight((r,s)=>{if(eA(t[s]))return r;if(r){let n=t[r]*i,a=e[s][r],o=Math.floor(n/a);t[s]+=o*i,t[r]-=o*a*i}return s},null),t5.reduce((i,r)=>{if(eA(t[r]))return i;if(i){let s=t[i]%1;t[i]-=s,t[r]+=s*e[i][r]}return r},null)}function it(e){let t={};for(let[i,r]of Object.entries(e))0!==r&&(t[i]=r);return t}class ii{constructor(e){const t="longterm"===e.conversionAccuracy;let i=t?t4:t6;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||ei.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return ii.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new l(`Duration.fromObject: argument expected to be an object, got ${null===e?"null":typeof e}`);return new ii({values:e4(e,ii.normalizeUnit),loc:ei.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(eN(e))return ii.fromMillis(e);if(ii.isDuration(e))return e;if("object"==typeof e)return ii.fromObject(e);throw new l(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){let[i]=tm(e,[tF,tD]);return i?ii.fromObject(i,t):ii.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){let[i]=tm(e,[tR,tJ]);return i?ii.fromObject(i,t):ii.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}
18static invalid(e,t=null){if(!e)throw new l("need to specify a reason the Duration is invalid");let i=e instanceof ew?e:new ew(e,t);if(!eb.throwOnInvalid)return new ii({invalid:i});throw new n(i)}static normalizeUnit(e){let t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new o(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let i={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?tp.create(this.loc,i).formatDurationFromString(this,e):t2}toHuman(e={}){if(!this.isValid)return t2;let t=!1!==e.showZeros,i=t5.map(i=>{let r=this.values[i];return eA(r)||0===r&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(i)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),(0!==this.months||0!==this.quarters)&&(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),(0!==this.hours||0!==this.minutes||0!==this.seconds||0!==this.milliseconds)&&(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),(0!==this.seconds||0!==this.milliseconds)&&(e+=eZ(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},iZ.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?t9(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;let t=ii.fromDurationLike(e),i={};for(let e of t5)(eU(t.values,e)||eU(this.values,e))&&(i[e]=t.get(e)+this.get(e));return t7(this,{values:i},!0)}minus(e){if(!this.isValid)return this;let t=ii.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let i of Object.keys(this.values))t[i]=e6(e(this.values[i],i));return t7(this,{values:t},!0)}get(e){return this[ii.normalizeUnit(e)]}set(e){return this.isValid?t7(this,{values:{...this.values,...e4(e,ii.normalizeUnit)}}):this}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:r}={}){return t7(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:i})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return ie(this.matrix,e),t7(this,{values:e},!0)}rescale(){return this.isValid?t7(this,{values:it(this.normalize().shiftToAll().toObject())},!0):this}shiftTo(...e){let t;if(!this.isValid||0===e.length)return this;e=e.map(e=>ii.normalizeUnit(e));let i={},r={},s=this.toObject();for(let n of t5)if(e.indexOf(n)>=0){t=n;let e=0;for(let t in r)e+=this.matrix[t][n]*r[t],r[t]=0;eN(s[n])&&(e+=s[n]);let a=Math.trunc(e);i[n]=a,r[n]=(1e3*e-1e3*a)/1e3}else eN(s[n])&&(r[n]=s[n]);for(let e in r)0!==r[e]&&(i[t]+=e===t?r[e]:r[e]/this.matrix[t][e]);return ie(this.matrix,i),t7(this,{values:i},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return t7(this,{values:e},!0)}removeZeros(){return this.isValid?t7(this,{values:it(this.values)},!0):this}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;for(let r of t5){var t,i;if(t=this.values[r],i=e.values[r],void 0===t||0===t?void 0!==i&&0!==i:t!==i)return!1}return!0}}let ir="Invalid Interval";class is{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}
18static invalid(e,t=null){if(!e)throw new l("need to specify a reason the Interval is invalid");let i=e instanceof ew?e:new ew(e,t);if(!eb.throwOnInvalid)return new is({invalid:i});throw new s(i)}static fromDateTimes(e,t){var i,r;let s=iK(e),n=iK(t),a=(i=s,r=n,i&&i.isValid?r&&r.isValid?r<i?is.invalid("end before start",`The end of an interval must be after its start, but you had start=${i.toISO()} and end=${r.toISO()}`):null:is.invalid("missing or invalid end"):is.invalid("missing or invalid start"));return null==a?new is({start:s,end:n}):a}static after(e,t){let i=ii.fromDurationLike(t),r=iK(e);return is.fromDateTimes(r,r.plus(i))}static before(e,t){let i=ii.fromDurationLike(t),r=iK(e);return is.fromDateTimes(r.minus(i),r)}static fromISO(e,t){let[i,r]=(e||"").split("/",2);if(i&&r){let e,s,n,a;try{s=(e=iZ.fromISO(i,t)).isValid}catch(e){s=!1}try{a=(n=iZ.fromISO(r,t)).isValid}catch(e){a=!1}if(s&&a)return is.fromDateTimes(e,n);if(s){let i=ii.fromISO(r,t);if(i.isValid)return is.after(e,i)}else if(a){let e=ii.fromISO(i,t);if(e.isValid)return is.before(n,e)}}return is.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){let i;if(!this.isValid)return NaN;let r=this.start.startOf(e,t);return Math.floor((i=(i=t?.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end).startOf(e,t)).diff(r,e).get(e))+(i.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&this.s<=e&&this.e>e}set({start:e,end:t}={}){return this.isValid?is.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];let t=e.map(iK).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),i=[],{s:r}=this,s=0;for(;r<this.e;){let e=t[s]||this.e,n=+e>+this.e?this.e:e;i.push(is.fromDateTimes(r,n)),r=n,s+=1}return i}splitBy(e){let t=ii.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let{s:i}=this,r=1,s,n=[];for(;i<this.e;){let e=this.start.plus(t.mapUnits(e=>e*r));s=+e>+this.e?this.e:e,n.push(is.fromDateTimes(i,s)),i=s,r+=1}return n}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e==+e.s}abutsEnd(e){return!!this.isValid&&+e.e==+this.s}engulfs(e){return!!this.isValid&&this.s<=e.s&&this.e>=e.e}equals(e){return!!this.isValid&&!!e.isValid&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;let t=this.s>e.s?this.s:e.s,i=this.e<e.e?this.e:e.e;return t>=i?null:is.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;let t=this.s<e.s?this.s:e.s,i=this.e>e.e?this.e:e.e;return is.fromDateTimes(t,i)}static merge(e){let[t,i]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],i)=>t?t.overlaps(i)||t.abutsStart(i)?[e,t.union(i)]:[e.concat([t]),i]:[e,i],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0,r=[],s=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]);for(let e of Array.prototype.concat(...s).sort((e,t)=>e.time-t.time))1===(i+="s"===e.type?1:-1)?t=e.time:(t&&+t!=+e.time&&r.push(is.fromDateTimes(t,e.time)),t=null);return is.merge(r)}difference(...e){return is.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} â ${this.e.toISO()})`:ir}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}
18toLocaleString(e=p,t={}){return this.isValid?tp.create(this.s.loc.clone(t),e).formatInterval(this):ir}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ir}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ir}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ir}toFormat(e,{separator:t=" â "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ir}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ii.invalid(this.invalidReason)}mapEndpoints(e){return is.fromDateTimes(e(this.s),e(this.e))}}class ia{static hasDST(e=eb.defaultZone){let t=iZ.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return U.isValidZone(e)}static normalizeZone(e){return ea(e,eb.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||ei.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||ei.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||ei.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:r=null,outputCalendar:s="gregory"}={}){return(r||ei.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:r=null,outputCalendar:s="gregory"}={}){return(r||ei.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:r=null}={}){return(r||ei.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:r=null}={}){return(r||ei.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ei.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return ei.create(t,null,"gregory").eras(e)}static features(){return{relative:eL(),localeWeek:eq()}}}function io(e,t){let i=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=i(t)-i(e);return Math.floor(ii.fromMillis(r).as("days"))}function il(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(!isNaN(t))return t;t="";for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);if(-1!==e[i].search(eo.hanidec))t+=eu.indexOf(e[i]);else for(let e in el){let[i,s]=el[e];r>=i&&r<=s&&(t+=r-i)}}return parseInt(t,10)}(e))}}let iu=String.fromCharCode(160),ic=`[ ${iu}]`,ih=RegExp(ic,"g");function id(e){return e.replace(/\./g,"\\.?").replace(ih,ic)}function ip(e){return e.replace(/\./g,"").replace(ih," ").toLowerCase()}function ig(e,t){return null===e?null:{regex:RegExp(e.map(id).join("|")),deser:([i])=>e.findIndex(e=>ip(i)===ip(e))+t}}function iv(e,t){return{regex:e,deser:([,e,t])=>e3(e,t),groups:t}}function im(e){return{regex:e,deser:([e])=>e}}
18let i_={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}},iy=null;function ib(e,t){return Array.prototype.concat(...e.map(e=>(function(e,t){if(e.literal)return e;let i=iE(tp.macroTokenToFormatOpts(e.val),t);return null==i||i.includes(void 0)?e:i})(e,t)))}class iw{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=ib(tp.parseFormat(t),e),this.units=this.tokens.map(t=>{let i,r,s,n,a,o,l,u,c,h,d,p,f;return i=eh(e),r=eh(e,"{2}"),s=eh(e,"{3}"),n=eh(e,"{4}"),a=eh(e,"{6}"),o=eh(e,"{1,2}"),l=eh(e,"{1,3}"),u=eh(e,"{1,6}"),c=eh(e,"{1,9}"),h=eh(e,"{2,4}"),d=eh(e,"{4,6}"),p=e=>({regex:RegExp(e.val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")),deser:([e])=>e,literal:!0}),(f=(f=>{if(t.literal)return p(f);switch(f.val){case"G":return ig(e.eras("short"),0);case"GG":return ig(e.eras("long"),0);case"y":return il(u);case"yy":case"kk":return il(h,e1);case"yyyy":case"kkkk":return il(n);case"yyyyy":return il(d);case"yyyyyy":return il(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return il(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return il(r);case"MMM":return ig(e.months("short",!0),1);case"MMMM":return ig(e.months("long",!0),1);case"LLL":return ig(e.months("short",!1),1);case"LLLL":return ig(e.months("long",!1),1);case"o":case"S":return il(l);case"ooo":case"SSS":return il(s);case"u":return im(c);case"uu":return im(o);case"uuu":case"E":case"c":return il(i);case"a":return ig(e.meridiems(),0);case"EEE":return ig(e.weekdays("short",!1),1);case"EEEE":return ig(e.weekdays("long",!1),1);case"ccc":return ig(e.weekdays("short",!0),1);case"cccc":return ig(e.weekdays("long",!0),1);case"Z":case"ZZ":return iv(RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return iv(RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return im(/[a-z_+-/]{1,256}?/i);case" ":return im(/[^\S\n\r]/);default:return p(f)}})(t)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"}).token=t,f}),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=function(e){let t=e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"");return[`^${t}$`,e]}(this.units);this.regex=RegExp(e,"i"),this.handlers=t}}explainFromTokens(e){if(!this.isValid)return{input:e,tokens:this.tokens,invalidReason:this.invalidReason};{let t,i,[r,s]=function(e,t,i){let r=e.match(t);if(!r)return[r,{}];{let e={},t=1;for(let s in i)if(eU(i,s)){let n=i[s],a=n.groups?n.groups+1:1;!n.literal&&n.token&&(e[n.token.val[0]]=n.deser(r.slice(t,t+a))),t+=a}return[r,e]}}
18(e,this.regex,this.handlers),[n,o,l]=s?(i=null,eA(s.z)||(i=U.create(s.z)),eA(s.Z)||(i||(i=new es(s.Z)),t=s.Z),eA(s.q)||(s.M=(s.q-1)*3+1),eA(s.h)||(s.h<12&&1===s.a?s.h+=12:12===s.h&&0===s.a&&(s.h=0)),0===s.G&&s.y&&(s.y=-s.y),eA(s.u)||(s.S=eB(s.u)),[Object.keys(s).reduce((e,t)=>{let i=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(t);return i&&(e[i]=s[t]),e},{}),i,t]):[null,null,void 0];if(eU(s,"a")&&eU(s,"H"))throw new a("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:r,matches:s,result:n,zone:o,specificOffset:l}}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function iS(e,t,i){return new iw(e,i).explainFromTokens(t)}function iE(e,t){if(!e)return null;let i=tp.create(t,e).dtFormatter((iy||(iy=iZ.fromMillis(0x16a2e5618e3)),iy)),r=i.formatToParts(),s=i.resolvedOptions();return r.map(t=>(function(e,t,i){let{type:r,value:s}=e;if("literal"===r){let e=/^\s+$/.test(s);return{literal:!e,val:e?" ":s}}let n=t[r],a=r;"hour"===r&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":i.hour12?"hour12":"hour24");let o=i_[a];if("object"==typeof o&&(o=o[n]),o)return{literal:!1,val:o}})(t,e,s))}let ik="Invalid DateTime";function ix(e){return new ew("unsupported zone",`the zone "${e.name}" is not supported`)}function iT(e){return null===e.weekData&&(e.weekData=eP(e.c)),e.weekData}function iO(e){return null===e.localWeekData&&(e.localWeekData=eP(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function iP(e,t){let i={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new iZ({...i,...t,old:i})}function iC(e,t,i){let r=e-60*t*1e3,s=i.offset(r);if(t===s)return[r,t];r-=(s-t)*6e4;let n=i.offset(r);return s===n?[r,s]:[e-60*Math.min(s,n)*1e3,Math.max(s,n)]}function iI(e,t){let i=new Date(e+=60*t*1e3);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function iM(e,t){let i=e.o,r=e.c.year+Math.trunc(t.years),s=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),n={...e.c,year:r,month:s,day:Math.min(e.c.day,eY(r,s))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},a=ii.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),[o,l]=iC(eJ(n),i,e.zone);return 0!==a&&(o+=a,l=e.zone.offset(o)),{ts:o,o:l}}function iR(e,t,i,r,s,n){let{setZone:a,zone:o}=i;if((!e||0===Object.keys(e).length)&&!t)return iZ.invalid(new ew("unparsable",`the input "${s}" can't be parsed as ${r}`));{let r=iZ.fromObject(e,{...i,zone:t||o,specificOffset:n});return a?r:r.setZone(o)}}function iF(e,t,i=!0){return e.isValid?tp.create(ei.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(e,t):null}function iD(e,t,i){let r=e.c.year>9999||e.c.year<0,s="";if(r&&e.c.year>=0&&(s+="+"),s+=eW(e.c.year,r?6:4),"year"===i)return s;if(t){if(s+="-",s+=eW(e.c.month),"month"===i)return s;s+="-"}else if(s+=eW(e.c.month),"month"===i)return s;return s+eW(e.c.day)}function iA(e,t,i,r,s,n,a){let o=!i||0!==e.c.millisecond||0!==e.c.second,l="";switch(a){case"day":case"month":case"year":break;default:if(l+=eW(e.c.hour),"hour"===a)break;if(t){if(l+=":",l+=eW(e.c.minute),"minute"===a)break;o&&(l+=":",l+=eW(e.c.second))}else{if(l+=eW(e.c.minute),"minute"===a)break;o&&(l+=eW(e.c.second))}if("second"===a)break;o&&(!r||0!==e.c.millisecond)&&(l+=".",l+=eW(e.c.millisecond,3))}return s&&(e.isOffsetFixed&&0===e.offset&&!n?l+="Z":e.o<0?(l+="-",l+=eW(Math.trunc(-e.o/60)),l+=":",l+=eW(Math.trunc(-e.o%60))):(l+="+",l+=eW(Math.trunc(e.o/60)),l+=":",l+=eW(Math.trunc(e.o%60)))),n&&(l+="["+e.zone.ianaName+"]"),l}let iN={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},i$={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},iL={ordinal:1,hour:0,minute:0,second:0,millisecond:0},iq=["year","month","day","hour","minute","second","millisecond"],iz=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],iU=["year","ordinal","hour","minute","second","millisecond"];function ij(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new o(e);return t}function iV(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ij(e)}}function iW(e,i){let r,s,n=ea(i.zone,eb.defaultZone);if(!n.isValid)return iZ.invalid(ix(n));let a=ei.fromObject(i);if(eA(e.year))r=eb.now();else{for(let t of iq)eA(e[t])&&(e[t]=iN[t]);let i=eF(e)||eD(e);if(i)return iZ.invalid(i);let a=function(e){if(void 0===t&&(t=eb.now()),"iana"!==e.type)return e.offset(t);let i=e.name,r=iB.get(i);return void 0===r&&(r=e.offset(t),iB.set(i,r)),r}(n);[r,s]=iC(eJ(e),a,n)}
18return new iZ({ts:r,zone:n,loc:a,o:s})}function iH(e,t,i){let r=!!eA(i.round)||i.round,s=eA(i.rounding)?"trunc":i.rounding,n=(e,n)=>(e=eZ(e,r||i.calendary?0:2,i.calendary?"round":s),t.loc.clone(i).relFormatter(i).format(e,n)),a=r=>i.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(i.unit)return n(a(i.unit),i.unit);for(let e of i.units){let t=a(e);if(Math.abs(t)>=1)return n(t,e)}return n(e>t?-0:0,i.units[i.units.length-1])}function iG(e){let t={},i;return e.length>0&&"object"==typeof e[e.length-1]?(t=e[e.length-1],i=Array.from(e).slice(0,e.length-1)):i=Array.from(e),[t,i]}let iB=new Map;class iZ{constructor(e){const t=e.zone||eb.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ew("invalid input"):null)||(t.isValid?null:ix(t));this.ts=eA(e.ts)?eb.now():e.ts;let r=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,s]=[e.old.c,e.old.o];else{const n=eN(e.o)&&!e.old?e.o:t.offset(this.ts);r=(i=Number.isNaN((r=iI(this.ts,n)).year)?new ew("invalid input"):null)?null:r,s=i?null:n}this._zone=t,this.loc=e.loc||ei.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=r,this.o=s,this.isLuxonDateTime=!0}static now(){return new iZ({})}static local(){let[e,t]=iG(arguments),[i,r,s,n,a,o,l]=t;return iW({year:i,month:r,day:s,hour:n,minute:a,second:o,millisecond:l},e)}static utc(){let[e,t]=iG(arguments),[i,r,s,n,a,o,l]=t;return e.zone=es.utcInstance,iW({year:i,month:r,day:s,hour:n,minute:a,second:o,millisecond:l},e)}static fromJSDate(e,t={}){let i="[object Date]"===Object.prototype.toString.call(e)?e.valueOf():NaN;if(Number.isNaN(i))return iZ.invalid("invalid input");let r=ea(t.zone,eb.defaultZone);return r.isValid?new iZ({ts:i,zone:r,loc:ei.fromObject(t)}):iZ.invalid(ix(r))}static fromMillis(e,t={}){if(eN(e))if(e<-864e13||e>864e13)return iZ.invalid("Timestamp out of range");else return new iZ({ts:e,zone:ea(t.zone,eb.defaultZone),loc:ei.fromObject(t)});throw new l(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(eN(e))return new iZ({ts:1e3*e,zone:ea(t.zone,eb.defaultZone),loc:ei.fromObject(t)});throw new l("fromSeconds requires a numerical input")}static fromObject(e,t={}){var i;let r,s;e=e||{};let n=ea(t.zone,eb.defaultZone);if(!n.isValid)return iZ.invalid(ix(n));let o=ei.fromObject(t),l=e4(e,iV),{minDaysInFirstWeek:u,startOfWeek:c}=eR(l,o),h=eb.now(),d=eA(t.specificOffset)?n.offset(h):t.specificOffset,p=!eA(l.ordinal),f=!eA(l.year),g=!eA(l.month)||!eA(l.day),v=f||g,m=l.weekYear||l.weekNumber;if((v||p)&&m)throw new a("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(g&&p)throw new a("Can't mix ordinal dates with month/day");let _=m||l.weekday&&!v,y,b,w=iI(h,d);_?(y=iz,b=i$,w=eP(w,u,c)):p?(y=iU,b=iL,w=eI(w)):(y=iq,b=iN);let S=!1;for(let e of y)eA(l[e])?S?l[e]=b[e]:l[e]=w[e]:S=!0;let E=(_?function(e,t=4,i=1){let r=e$(e.weekYear),s=eV(e.weekNumber,1,e0(e.weekYear,t,i)),n=eV(e.weekday,1,7);return r?s?!n&&ek("weekday",e.weekday):ek("week",e.weekNumber):ek("weekYear",e.weekYear)}(l,u,c):p?(r=e$(l.year),s=eV(l.ordinal,1,eQ(l.year)),r?!s&&ek("ordinal",l.ordinal):ek("year",l.year)):eF(l))||eD(l);if(E)return iZ.invalid(E);let[k,x]=(i=_?eC(l,u,c):p?eM(l):l,iC(eJ(i),d,n)),T=new iZ({ts:k,zone:n,o:x,loc:o});return l.weekday&&v&&e.weekday!==T.weekday?iZ.invalid("mismatched weekday",`you can't specify both a weekday of ${l.weekday} and a date of ${T.toISO()}`):T.isValid?T:iZ.invalid(T.invalid)}static fromISO(e,t={}){let[i,r]=tm(e,[tW,tZ],[tH,tK],[tG,tQ],[tB,tY]);return iR(i,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){let[i,r]=tm(e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim(),[t$,tL]);return iR(i,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){let[i,r]=tm(e,[tq,tj],[tz,tj],[tU,tV]);return iR(i,r,t,"HTTP",t)}static fromFormat(e,t,i={}){if(eA(e)||eA(t))throw new l("fromFormat requires an input string and a format");let{locale:r=null,numberingSystem:s=null}=i,[n,a,o,u]=function(e,t,i){let{result:r,zone:s,specificOffset:n,invalidReason:a}=iS(e,t,i);return[r,s,n,a]}(ei.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0}),e,t);return u?iZ.invalid(u):iR(n,a,i,`format ${t}`,e,o)}static fromString(e,t,i={}){return iZ.fromFormat(e,t,i)}static fromSQL(e,t={}){let[i,r]=tm(e,[tX,tZ],[t0,t1]);return iR(i,r,t,"SQL",e)}
18static invalid(e,t=null){if(!e)throw new l("need to specify a reason the DateTime is invalid");let i=e instanceof ew?e:new ew(e,t);if(!eb.throwOnInvalid)return new iZ({invalid:i});throw new r(i)}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let i=iE(e,ei.fromObject(t));return i?i.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return ib(tp.parseFormat(e),ei.fromObject(t)).map(e=>e.val).join("")}static resetCache(){t=void 0,iB.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?iT(this).weekYear:NaN}get weekNumber(){return this.isValid?iT(this).weekNumber:NaN}get weekday(){return this.isValid?iT(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?iO(this).weekday:NaN}get localWeekNumber(){return this.isValid?iO(this).weekNumber:NaN}get localWeekYear(){return this.isValid?iO(this).weekYear:NaN}get ordinal(){return this.isValid?eI(this.c).ordinal:NaN}get monthShort(){return this.isValid?ia.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ia.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ia.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ia.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=eJ(this.c),t=this.zone.offset(e-864e5),i=this.zone.offset(e+864e5),r=this.zone.offset(e-6e4*t),s=this.zone.offset(e-6e4*i);if(r===s)return[this];let n=e-6e4*r,a=e-6e4*s,o=iI(n,r),l=iI(a,s);return o.hour===l.hour&&o.minute===l.minute&&o.second===l.second&&o.millisecond===l.millisecond?[iP(this,{ts:n}),iP(this,{ts:a})]:[this]}get isInLeapYear(){return eK(this.year)}get daysInMonth(){return eY(this.year,this.month)}get daysInYear(){return this.isValid?eQ(this.year):NaN}get weeksInWeekYear(){return this.isValid?e0(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?e0(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:i,calendar:r}=tp.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(es.instance(e),t)}toLocal(){return this.setZone(eb.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if((e=ea(e,eb.defaultZone)).equals(this.zone))return this;{if(!e.isValid)return iZ.invalid(ix(e));let s=this.ts;if(t||i){var r;let t=e.offset(this.ts),i=this.toObject();[s]=(r=e,iC(eJ(i),t,r))}return iP(this,{ts:s,zone:e})}}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){return iP(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i})})}setLocale(e){return this.reconfigure({locale:e})}set(e){var t,i,r;let s;if(!this.isValid)return this;let n=e4(e,iV),{minDaysInFirstWeek:o,startOfWeek:l}=eR(n,this.loc),u=!eA(n.weekYear)||!eA(n.weekNumber)||!eA(n.weekday),c=!eA(n.ordinal),h=!eA(n.year),d=!eA(n.month)||!eA(n.day),p=n.weekYear||n.weekNumber;if((h||d||c)&&p)throw new a("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new a("Can't mix ordinal dates with month/day");u?s=eC({...eP(this.c,o,l),...n},o,l):eA(n.ordinal)?(s={...this.toObject(),...n},eA(n.day)&&(s.day=Math.min(eY(s.year,s.month),s.day))):s=eM({...eI(this.c),...n});let[f,g]=(t=s,i=this.o,r=this.zone,iC(eJ(t),i,r));return iP(this,{ts:f,o:g})}plus(e){return this.isValid?iP(this,iM(this,ii.fromDurationLike(e))):this}minus(e){return this.isValid?iP(this,iM(this,ii.fromDurationLike(e).negate())):this}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let i={},r=ii.normalizeUnit(e);switch(r){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0}if("weeks"===r)if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(i.weekNumber=this.weekNumber-1),i.weekday=e}else i.weekday=1;return"quarters"===r&&(i.month=(Math.ceil(this.month/3)-1)*3+1),this.set(i)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?tp.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ik}
18toLocaleString(e=p,t={}){return this.isValid?tp.create(this.loc.clone(t),e).formatDateTime(this):ik}toLocaleParts(e={}){return this.isValid?tp.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:r=!0,extendedZone:s=!1,precision:n="milliseconds"}={}){if(!this.isValid)return null;n=ij(n);let a="extended"===e,o=iD(this,a,n);return iq.indexOf(n)>=3&&(o+="T"),o+=iA(this,a,t,i,r,s,n)}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?iD(this,"extended"===e,ij(t)):null}toISOWeekDate(){return iF(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:r=!1,extendedZone:s=!1,format:n="extended",precision:a="milliseconds"}={}){return this.isValid?(a=ij(a),(r&&iq.indexOf(a)>=3?"T":"")+iA(this,"extended"===n,t,e,i,s,a)):null}toRFC2822(){return iF(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return iF(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?iD(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(i&&(r+=" "),t?r+="z":e&&(r+="ZZ")),iF(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ik}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return ii.invalid("created by diffing an invalid DateTime");let r={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=(Array.isArray(t)?t:[t]).map(ii.normalizeUnit),n=e.valueOf()>this.valueOf(),a=function(e,t,i,r){let[s,n,a,o]=function(e,t,i){let r,s,n={},a=e;for(let[o,l]of[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],["months",(e,t)=>t.month-e.month+(t.year-e.year)*12],["weeks",(e,t)=>{let i=io(e,t);return(i-i%7)/7}],["days",io]])i.indexOf(o)>=0&&(r=o,n[o]=l(e,t),(s=a.plus(n))>t?(n[o]--,(e=a.plus(n))>t&&(s=e,n[o]--,e=a.plus(n))):e=s);return[e,n,s,r]}(e,t,i),l=t-s,u=i.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===u.length&&(a<t&&(a=s.plus({[o]:1})),a!==s&&(n[o]=(n[o]||0)+l/(a-s)));let c=ii.fromObject(n,r);return u.length>0?ii.fromMillis(l,r).shiftTo(...u).plus(c):c}(n?this:e,n?e:this,s,r);return n?a.negate():a}diffNow(e="milliseconds",t={}){return this.diff(iZ.now(),e,t)}until(e){return this.isValid?is.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;let r=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=r&&r<=s.endOf(t,i)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;let t=e.base||iZ.fromObject({},{zone:this.zone}),i=e.padding?this<t?-e.padding:e.padding:0,r=["years","months","days","hours","minutes","seconds"],s=e.unit;return Array.isArray(e.unit)&&(r=e.unit,s=void 0),iH(t,this.plus(i),{...e,numeric:"always",units:r,unit:s})}toRelativeCalendar(e={}){return this.isValid?iH(e.base||iZ.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(iZ.isDateTime))throw new l("min requires all arguments be DateTimes");return ez(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(iZ.isDateTime))throw new l("max requires all arguments be DateTimes");return ez(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){let{locale:r=null,numberingSystem:s=null}=i;return iS(ei.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,i={}){return iZ.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){let{locale:i=null,numberingSystem:r=null}=t;return new iw(ei.fromOpts({locale:i,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(e,t,i={}){if(eA(e)||eA(t))throw new l("fromFormatParser requires an input string and a format parser");let{locale:r=null,numberingSystem:s=null}=i,n=ei.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0});if(!n.equals(t.locale))throw new l(`fromFormatParser called with a locale of ${n}, but the format parser was created for ${t.locale}`);let{result:a,zone:o,specificOffset:u,invalidReason:c}=t.explainFromTokens(e);return c?iZ.invalid(c):iR(a,o,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return p}static get DATE_MED(){return f}static get DATE_MED_WITH_WEEKDAY(){return g}static get DATE_FULL(){return v}static get DATE_HUGE(){return m}static get TIME_SIMPLE(){return _}static get TIME_WITH_SECONDS(){return y}static get TIME_WITH_SHORT_OFFSET(){return b}static get TIME_WITH_LONG_OFFSET(){return w}static get TIME_24_SIMPLE(){return S}static get TIME_24_WITH_SECONDS(){return E}static get TIME_24_WITH_SHORT_OFFSET(){return k}static get TIME_24_WITH_LONG_OFFSET(){return x}static get DATETIME_SHORT(){return T}static get DATETIME_SHORT_WITH_SECONDS(){return O}static get DATETIME_MED(){return P}static get DATETIME_MED_WITH_SECONDS(){return C}static get DATETIME_MED_WITH_WEEKDAY(){return I}static get DATETIME_FULL(){return M}static get DATETIME_FULL_WITH_SECONDS(){return R}static get DATETIME_HUGE(){return F}static get DATETIME_HUGE_WITH_SECONDS(){return D}}function iK(e){if(iZ.isDateTime(e))return e;if(e&&e.valueOf&&eN(e.valueOf()))return iZ.fromJSDate(e);if(e&&"object"==typeof e)return iZ.fromObject(e);throw new l(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.s(["DateTime",0,iZ,"Info",0,ia],632729);let iQ=e.i(817154).TimezoneEnum.EasternTime;function iY(e,t="MM/dd/yyyy"){if(!e)return"";try{let i=iZ.fromISO(e.toString());if(!i.isValid){let i=new Date(e.toString()),r=iZ.fromJSDate(i);if(!r.isValid)return"";return r.toFormat(t)}return i.toFormat(t)}catch(e){return console.error("Error formatting date:",e),""}}function iJ(e){if(!e)return null;let t=iZ.fromISO(e,{setZone:!0});return t.isValid?t:null}e.s(["DEFAULT_TIMEZONE",0,iQ,"formatDateOnly",0,iY,"formatFilterDateBound",0,function(e,t="MM/dd/yyyy"){if(!e)return"";let i=iJ(e);return i?i.toFormat(t):iY(e,t)},"formatForBackend",0,function(e){if(!e)return"";try{let t;if("string"==typeof e)t=iZ.fromISO(e);else{if(!(e instanceof Date))return"";t=iZ.fromJSDate(e)}if(!t.isValid)return console.error("Invalid date for backend formatting:",e),"";return t.toUTC().toISO()||""}catch(e){return console.error("Error formatting date for backend:",e),""}},"formatRelativeTime",0,function(e,t){if(!e)return"";try{return iZ.fromISO(e.toString(),{zone:t}).toRelative()||""}catch(i){console.error(`Error formatting relative time in timezone ${t}:`,i);try{return iZ.fromISO(e.toString()).toRelative()||""}catch{return""}}},"formatTimestampWithTimezone",0,function(e,t,i="MM/dd/yyyy h:mm a ZZZZ"){if(!e&&0!==e)return"";try{let r;if(!(r="number"==typeof e?iZ.fromMillis(e,{zone:t}):e instanceof Date?iZ.fromJSDate(e,{zone:t}):iZ.fromISO(e,{zone:t})).isValid){let i=new Date(e);r=iZ.fromJSDate(i,{zone:t})}if(!r.isValid)return console.error(`Invalid date: ${e}`),"";return r.toFormat(i)}
18catch(e){return console.error(`Error formatting date in timezone ${t}:`,e),""}},"getTimezoneAbbreviation",0,function(e,t){if(!e)return"";try{return(t?iZ.fromISO(t.toString(),{zone:e}):iZ.now().setZone(e)).offsetNameShort||""}catch(t){return console.error(`Error getting timezone abbreviation for ${e}:`,t),""}},"isToday",0,function(e,t){if(!e)return!1;try{let i=iZ.fromISO(e.toString(),{zone:t}),r=iZ.now().setZone(t);return i.hasSame(r,"day")}catch(e){return console.error(`Error checking if date is today in timezone ${t}:`,e),!1}},"parseFilterDateBound",0,iJ,"resolveUserTimezone",0,function(e){if(!e)return iQ;if(e.resolvedTimezone)return e.resolvedTimezone;let t=e.primaryAgency?.timezone,i=e.organization?.timezone;return t||i||iQ},"toTimezone",0,function(e,t){return"number"==typeof e?iZ.fromMillis(e,{zone:t}):e instanceof Date?iZ.fromJSDate(e,{zone:t}):iZ.fromISO(e,{zone:t})}],603480)},209073,974449,334875,848468,e=>{"use strict";var t=e.i(700737);e.s(["green",()=>t.default],974449);var t=t,i=e.i(337602);e.s(["grey",()=>i.default],334875);var i=i,r=e.i(692015);e.s(["lightBlue",()=>r.default],848468);var r=r,s=e.i(157504),s=s;let n=(0,e.i(591772).createTheme)({typography:{fontFamily:"ProximaNova,Arial,Helvetica,sans-serif",button:{textTransform:"none"},h1:{fontSize:"2rem",fontWeight:600,margin:"0 0 2.5rem 0"},h3:{fontSize:"1.5rem",fontWeight:400,lineHeight:"2rem",color:r.default[400]},navigation:{fontSize:"14px",fontWeight:600,lineHeight:"175%",letterSpacing:"0.009375em",color:"rgba(0, 0, 0, 0.87)"},navigationSubtitle:{fontSize:"14px",fontWeight:400,lineHeight:"143%",letterSpacing:"0.012142em",color:"rgba(0, 0, 0, 0.87)",paddingRight:0},orgSwitcher:{color:"#000",fontSize:"14px",fontWeight:400,lineHeight:"107%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},orgSwitcherSubtitle:{color:"#000",fontSize:"12px",fontWeight:275,lineHeight:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},competencyReportNumber:{color:"#37474F",fontSize:"35px",fontWeight:600,lineHeight:"123.5%",letterSpacing:"0.49px"},competencyReportText:{color:"#37474F",opacity:.5,fontSize:"24px",fontWeight:400,lineHeight:"123.5%",letterSpacing:"0.38px"}},palette:{primary:{main:"#00B7E5",light:r.default[200],dark:r.default[600],contrastText:"#fff"},secondary:{main:t.default[500],light:t.default[300],dark:t.default[700],contrastText:"#fff"},info:{main:i.default[800],light:i.default[500],dark:i.default[900],contrastText:"#fff"},purple:{main:s.default[700],light:s.default[300],dark:s.default[800],contrastText:"#fff"},common:{black:"#000",white:"#fff"}},components:{MuiAppBar:{styleOverrides:{root:{boxShadow:"none"}}},MuiTypography:{defaultProps:{variantMapping:{navigation:"span"}}},MuiCard:{styleOverrides:{root:{borderRadius:"10px",padding:"32px 24px",boxShadow:"0px 4px 22px 0px #9F9F9F26"}}},MuiChip:{styleOverrides:{root:{"& .MuiChip-label:empty":{paddingLeft:0}}}},MuiButton:{styleOverrides:{root:{boxShadow:"none","&:hover":{boxShadow:"none"}},contained:{textTransform:"uppercase",fontWeight:"bold"},outlined:{textTransform:"uppercase",fontWeight:"bold"}}},MuiSkeleton:{styleOverrides:{root:{backgroundColor:"#E4ECF2",borderRadius:"16px"},circular:{borderRadius:"50%"},text:{borderRadius:"8px"},rectangular:{borderRadius:"8px"}}}}});e.s(["default",0,n,"theme",0,n],209073)},556624,e=>{"use strict";e.i(247167);var t,i,r,s,n={},a=function(){if(t)return n;t=1,n.parse=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");var r={},s=e.length;if(s<2)return r;var n=t&&t.decode||c,a=0,o=0,h=0;do{if(-1===(o=e.indexOf("=",a)))break;if(-1===(h=e.indexOf(";",a)))h=s;else if(o>h){a=e.lastIndexOf(";",o-1)+1;continue}var d=l(e,a,o),p=u(e,o,d),f=e.slice(d,p);if(!i.call(r,f)){var g=l(e,o+1,h),v=u(e,h,g);34===e.charCodeAt(g)&&34===e.charCodeAt(v-1)&&(g++,v--);var m=e.slice(g,v);r[f]=function(e,t){try{return t(e)}catch(t){return e}}(m,n)}a=h+1}while(a<s)return r},n.serialize=function(t,i,n){var l=n&&n.encode||encodeURIComponent;if("function"!=typeof l)throw TypeError("option encode is invalid");
18if(!r.test(t))throw TypeError("argument name is invalid");var u=l(i);if(!s.test(u))throw TypeError("argument val is invalid");var c=t+"="+u;if(!n)return c;if(null!=n.maxAge){var h=Math.floor(n.maxAge);if(!isFinite(h))throw TypeError("option maxAge is invalid");c+="; Max-Age="+h}if(n.domain){if(!a.test(n.domain))throw TypeError("option domain is invalid");c+="; Domain="+n.domain}if(n.path){if(!o.test(n.path))throw TypeError("option path is invalid");c+="; Path="+n.path}if(n.expires){var d,p=n.expires;if(d=p,"[object Date]"!==e.call(d)||isNaN(p.valueOf()))throw TypeError("option expires is invalid");c+="; Expires="+p.toUTCString()}if(n.httpOnly&&(c+="; HttpOnly"),n.secure&&(c+="; Secure"),n.partitioned&&(c+="; Partitioned"),n.priority)switch("string"==typeof n.priority?n.priority.toLowerCase():n.priority){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(n.sameSite)switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"none":c+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return c};var e=Object.prototype.toString,i=Object.prototype.hasOwnProperty,r=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,s=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/;function l(e,t,i){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<i)return i}function u(e,t,i){for(;t>i;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return i}
18function c(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}return n}();function o(e,t={}){var i;let r=(i=e)&&"j"===i[0]&&":"===i[1]?i.substr(2):i;if(!t.doNotParse)try{return JSON.parse(r)}catch(e){}return e}var l=e.i(271645);let u=l.createContext(new class t{constructor(t,i={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;let e=this.cookies;this.cookies=a.parse(document.cookie),this._checkChanges(e)};const r="u"<typeof document?"":document.cookie;this.cookies=function(e){return"string"==typeof e?a.parse(e):"object"==typeof e&&null!==e?e:{}}(t||r),this.defaultSetOptions=i,this.HAS_DOCUMENT_COOKIE=function(){let t=e.g.TEST_HAS_DOCUMENT_COOKIE;return"boolean"==typeof t?t:"object"==typeof document&&"string"==typeof document.cookie}()}_emitChange(e){for(let t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)}_checkChanges(e){new Set(Object.keys(e).concat(Object.keys(this.cookies))).forEach(t=>{e[t]!==this.cookies[t]&&this._emitChange({name:t,value:o(this.cookies[t])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(e,t={}){return t.doNotUpdate||this.update(),o(this.cookies[e],t)}getAll(e={}){e.doNotUpdate||this.update();let t={};for(let i in this.cookies)t[i]=o(this.cookies[i],e);return t}set(e,t,i){i=i?Object.assign(Object.assign({},this.defaultSetOptions),i):this.defaultSetOptions;let r="string"==typeof t?t:JSON.stringify(t);this.cookies=Object.assign(Object.assign({},this.cookies),{[e]:r}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=a.serialize(e,r,i)),this._emitChange({name:e,value:t,options:i})}remove(e,t){let i=t=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=a.serialize(e,"",i)),this._emitChange({name:e,value:void 0,options:t})}addChangeListener(e){this.changeListeners.push(e),this.HAS_DOCUMENT_COOKIE&&1===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(e){let t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1),this.HAS_DOCUMENT_COOKIE&&0===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}),{Provider:c,Consumer:h}=u;l.Component,"function"==typeof SuppressedError&&SuppressedError;var d={exports:{}},p={};!function(){if(!s){s=1;var e=(r||(r=1,d.exports=function(){if(i)return p;i=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,_=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var i=e.$$typeof;switch(i){case t:switch(e=e.type){case u:case c:case s:case a:case n:case d:return e;default:switch(e=e&&e.$$typeof){case l:case h:case v:case g:case o:return e;default:return i}}case r:return i}}}function S(e){return w(e)===c}return p.AsyncMode=u,p.ConcurrentMode=c,p.ContextConsumer=l,p.ContextProvider=o,p.Element=t,p.ForwardRef=h,p.Fragment=s,p.Lazy=v,p.Memo=g,p.Portal=r,p.Profiler=a,p.StrictMode=n,p.Suspense=d,p.isAsyncMode=function(e){return S(e)||w(e)===u},p.isConcurrentMode=S,p.isContextConsumer=function(e){return w(e)===l},p.isContextProvider=function(e){return w(e)===o},p.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},p.isForwardRef=function(e){return w(e)===h},p.isFragment=function(e){return w(e)===s},p.isLazy=function(e){return w(e)===v},p.isMemo=function(e){return w(e)===g},p.isPortal=function(e){return w(e)===r},p.isProfiler=function(e){return w(e)===a},p.isStrictMode=function(e){return w(e)===n},p.isSuspense=function(e){return w(e)===d},p.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===c||e===a||e===n||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===g||e.$$typeof===o||e.$$typeof===l||e.$$typeof===h||e.$$typeof===_||e.$$typeof===y||e.$$typeof===b||e.$$typeof===m)},p.typeOf=w,p}
18()),d.exports),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[e.Memo]=a;Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype}}(),e.s(["useCookies",0,function(e,t){let i=(0,l.useContext)(u);if(!i)throw Error("Missing <CookiesProvider>");let r=Object.assign(Object.assign({},{doNotUpdate:!0}),t),[s,n]=(0,l.useState)(()=>i.getAll(r));return"u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement&&(0,l.useLayoutEffect)(()=>{function t(){let t=i.getAll(r);(function(e,t,i){if(!e)return!0;for(let r of e)if(t[r]!==i[r])return!0;return!1})(e||null,t,s)&&n(t)}return i.addChangeListener(t),()=>{i.removeChangeListener(t)}},[i,s]),[s,(0,l.useMemo)(()=>i.set.bind(i),[i]),(0,l.useMemo)(()=>i.remove.bind(i),[i]),(0,l.useMemo)(()=>i.update.bind(i),[i])]}],556624)},342691,662269,e=>{"use strict";var t=e.i(271645);let i=(0,t.createContext)(null);e.s(["UserContext",0,i,"useUser",0,()=>{let e=(0,t.useContext)(i);if(!e)throw Error("useUser must be used within a UserProvider");return e}],662269),e.s([],342691)},612603,415541,e=>{"use strict";var t=e.i(843476),i=e.i(271645),r=e.i(556624);e.i(342691);var s=e.i(662269),n=e.i(817154),a=e.i(603480);function o(e){let t=e.settings.authProviders.find(e=>"clerk"===e.type)||{};return e.clerkId=t?.externalId||"",e}let l={_id:"default",code:"en",name:"English",threeLetterCode:"eng",nativeName:"English",imageUrl:"",status:"active",textDirection:"ltr"};function u(e){let t=e.data||{},i=e.data?.organization?o(e.data.organization):{},r=e.data?.organizations.map(o)||[],s=e.data?.agencies||[],u=e.data?.primaryAgency||{},c=e.data?.activeAgency||{},h=e.data?.settings||{},d={Global:e.data?.permissionMap?.Global||e.data?.permissionMap?.global||[],Organization:e.data?.permissionMap?.Organization||e.data?.permissionMap?.organization||[],Agency:e.data?.permissionMap?.Agency||e.data?.permissionMap?.agency||[],User:e.data?.permissionMap?.User||e.data?.permissionMap?.user||[]},p=e.data?.roleLevel||n.LevelType.UserLevel;h?.primaryLanguage||(h.primaryLanguage=l,h.languages=[l]);let f=u?.timezone||i?.timezone||a.DEFAULT_TIMEZONE;return{...t,roleLevel:p,org_name:i.name,org_slug:i.shortname,organization:i,organizations:r,agencies:s,permissionMap:d,settings:h,primaryAgency:u,primaryAgencyId:u._id,activeAgency:c,isEvaluator:e.data?.isEvaluator||!1,resolvedTimezone:f}}e.s(["formatCurrentUserResponse",0,u,"getDisplayName",0,function(e){return e?.profile?.firstName||e?.profile?.lastName?`${e?.profile?.firstName} ${e?.profile?.lastName}`.trim():"N/A"}],415541);let c=(0,i.createContext)(null);e.s(["DataProvider",0,({children:e,newApiUrl:n})=>{let[a,o]=(0,i.useState)(null),[l,h]=(0,i.useState)(""),[d,p]=(0,i.useState)([]),[f]=(0,r.useCookies)(["i18next"]);(0,i.useEffect)(()=>{(async()=>{let e=n?`${n}api/competency/v1/users/me`:"/api/competency/v1/users/me",t=await fetch(e,{method:"GET",credentials:"include"});o(u(await t.json()))})()},[n]),(0,i.useEffect)(()=>{h(f.i18next||"en")},[f]),(0,i.useEffect)(()=>{(async()=>{try{let e=n?`${n}api/competency/v1/languages`:"/api/competency/v1/languages",t=await fetch(e,{method:"GET",credentials:"include"}),i=await t.json();i.data?.forEach(e=>{switch(e.code){case"en":e.flagCode="us";break;case"zh":e.flagCode="cn";break;case"yue":e.flagCode="hk";break;case"bn":e.flagCode="bd";break;default:e.flagCode=e.code}}),p(i.data||[])}catch(e){console.error("Error fetching languages:",e),p([])}})()},[n]);let g=async(e,t)=>{let i=n?`${n}api/competency/v1/users/${e}/settings/profile`:`/api/competency/v1/users/${e}/settings/profile`,r=await fetch(i,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return(await r.json()).data};return(0,t.jsx)(s.UserContext.Provider,{value:a,children:(0,t.jsx)(c.Provider,{value:{currentLanguage:l,languagesList:d,updateUserLanguage:g},children:e})})},"LanguageContext",0,c,"useLanguage",0,()=>{let e=(0,i.useContext)(c);if(!e)throw Error("useLanguage must be used within a DataProvider");return e}],612603)},69733,e=>{"use strict";var t=e.i(843476),i=e.i(271645);let r={hostname:"",legacyHostname:"",legacyUrl:"",domain:"",apiUrl:"",userApiUrl:"",reportsApiUrl:"",assignmentsApiUrl:"",reportsApiPrefix:"/v1",posthogKey:"",posthogHost:"https://app.posthog.com",posthogEnabled:"false",intercomAppId:"",surveyjsLicenseKey:"",roleBasedMiddlewareEnabled:"false",loadingDelayEnabled:"false",loadingDelayDuration:"2500",samEnabled:"false",clerkSignInUrl:"/sign-in"},s=(0,i.createContext)(null);e.s(["DEFAULT_RUNTIME_CONFIG",0,r,"RuntimeConfigProvider",0,({config:e,children:i})=>(0,t.jsx)(s.Provider,{value:e,children:i}),"useRuntimeConfig",0,()=>(0,i.useContext)(s)??r])},563429,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.regionAPIs=void 0,i.regionAPIs=new Map([["us","https://api-iam.intercom.io"],["eu","https://api-iam.eu.intercom.io"],["ap","https://api-iam.au.intercom.io"]])},865600,(e,t,i)=>{"use strict";var r=e.e&&e.e.__awaiter||function(e,t,i,r){return new(i||(i=Prom
18ise))(function(s,n){function a(e){try{l(r.next(e))}catch(e){n(e)}}function o(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(i,"__esModule",{value:!0}),i.ref=i.init=void 0;let s="_intercom_npm_loader",n=function(){n.loaderQueue(arguments)};n.q=[],n.loaderQueue=function(e){n.q.push(e)};let a=function(){var e,t,i=document;if(!i.getElementById(s)){var r=i.createElement("script");r.type="text/javascript",r.async=!0,r.id=s,r.src="https://widget.intercom.io/widget/"+(null==(e=window.intercomSettings)?void 0:e.app_id);var n=i.getElementsByTagName("script")[0];null==(t=n.parentNode)||t.insertBefore(r,n)}},o=()=>"complete"===document.readyState||"interactive"===document.readyState;i.init=()=>r(void 0,void 0,void 0,function*(){var e=window,t=e.Intercom;e.intercomSettings&&(e.intercomSettings.installation_type="npm-package"),"function"==typeof t?(t("reattach_activator"),t("update",e.intercomSettings)):(e.Intercom=n,o()?a():(document.addEventListener("readystatechange",function(){o()&&a()}),e.attachEvent?e.attachEvent("onload",a):e.addEventListener("load",a,!1)))}),i.ref=void 0},338431,(e,t,i)=>{"use strict";var r=e.e&&e.e.__rest||function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)0>t.indexOf(r[s])&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(i[r[s]]=e[r[s]]);return i};Object.defineProperty(i,"__esModule",{value:!0}),i.onUserEmailSupplied=i.showConversation=i.showTicket=i.startChecklist=i.startSurvey=i.showNews=i.showArticle=i.startTour=i.getVisitorId=i.trackEvent=i.onUnreadCountChange=i.onShow=i.onHide=i.showNewMessage=i.showMessages=i.showSpace=i.show=i.hide=i.update=i.shutdown=i.boot=i.Intercom=void 0;let s=e.r(563429),n=e.r(865600),a=(e,...t)=>{window.Intercom?window.Intercom(e,...t):console.warn("Please ensure Intercom is setup and running on client-side!")};i.Intercom=e=>{if("object"!=typeof e)return void console.warn("Intercom initialiser called with invalid parameters.");let{region:t="us"}=e,i=r(e,["region"]);"u">typeof window&&!n.ref&&(window.intercomSettings=Object.assign(Object.assign({},i),{api_base:s.regionAPIs.get(t)}),(0,n.init)())},i.default=i.Intercom,i.boot=e=>a("boot",e),i.shutdown=()=>a("shutdown"),i.update=e=>a("update",e),i.hide=()=>a("hide"),i.show=()=>a("show"),i.showSpace=e=>a("showSpace",e),i.showMessages=()=>a("showMessages"),i.showNewMessage=e=>a("showNewMessage",e),i.onHide=e=>a("onHide",e),i.onShow=e=>a("onShow",e),i.onUnreadCountChange=e=>a("onUnreadCountChange",e),i.trackEvent=(...e)=>a("trackEvent",...e),i.getVisitorId=()=>a("getVisitorId"),i.startTour=e=>a("startTour",e),i.showArticle=e=>a("showArticle",e),i.showNews=e=>a("showNews",e),i.startSurvey=e=>a("startSurvey",e),i.startChecklist=e=>a("startChecklist",e),i.showTicket=e=>a("showTicket",e),i.showConversation=e=>a("showConversation",e),i.onUserEmailSupplied=e=>a("onUserEmailSupplied",e)},604570,e=>{"use strict";var t,i="u">typeof window?window:void 0,r="u">typeof globalThis?globalThis:i;"u"<typeof self&&(r.self=r),"u"<typeof File&&(r.File=function(){});var s=null==r?void 0:r.navigator,n=null==r?void 0:r.document,a=null==r?void 0:r.location,o=null==r?void 0:r.fetch,l=null!=r&&r.XMLHttpRequest&&"withCredentials"in new r.XMLHttpRequest?r.XMLHttpRequest:void 0,u=null==r?void 0:r.AbortController,c=null==r?void 0:r.CompressionStream,h=null==s?void 0:s.userAgent,d=null!=i?i:{},p="1.387.0",f={DEBUG:!1,LIB_VERSION:p,LIB_NAME:"web",JS_SDK_VERSION:p};function g(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function v(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){g(n,r,s,a,o,"next",e)}function o(e){g(n,r,s,a,o,"throw",e)}a(void 0)})}}function m(){return(m=Object.assign.bind()).apply(null,arguments)}function _(e,t){if(null==e)return{};var i={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var y,b,w,S=((y={}).GZipJS="gzip-js",y.Base64="base64",y),E=["$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"],k=["token"],x="NativeGzipValidationError",T=e=>e.length>=2&&31===e[0]&&139===e[1],O=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),P=e=>
18{var t=Error("Native gzip produced invalid output: "+e);throw t.name=x,t},C=(b=v(function*(e,t){18>e.size&&P("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));T(i)&&8===i[2]||P("invalid-header");var r=new DataView((yield e.slice(e.size-8).arrayBuffer()));r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(w)return w;w=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;w[e]=t>>>0}return w})(),i=0xffffffff,r=0;e.length>r;r++)i=t[255&(i^e[r])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&P("invalid-crc");var s=t.length>>>0;r.getUint32(4,!0)!==s&&P("invalid-size")}),function(e,t){return b.apply(this,arguments)});function I(){return(I=v(function*(e,t,i){void 0===t&&(t=!0);try{var r,s=(new TextEncoder).encode(e),n=new CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(s).then(()=>a.close()).catch((r=v(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return r.apply(this,arguments)})),l=new Response(n.readable).blob(),[u]=yield Promise.all([l,o]);return yield C(u,s),u}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var M=["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"],R=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return M.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function F(e,t){return -1!==e.indexOf(t)}var D=function(e){return e.trim()},A=function(e){return e.replace(/^\$/,"")},N=Object.prototype,$=N.hasOwnProperty,L=N.toString,q=Array.isArray||function(e){return"[object Array]"===L.call(e)},z=e=>"function"==typeof e,U=e=>e===Object(e)&&!q(e),j=e=>{if(U(e)){for(var t in e)if($.call(e,t))return!1;return!0}return!1},V=e=>void 0===e,W=e=>"[object String]"==L.call(e),H=e=>W(e)&&0===e.trim().length,G=e=>null===e,B=e=>V(e)||G(e),Z=e=>"[object Number]"==L.call(e)&&e==e,K=e=>Z(e)&&e>0,Q=e=>"[object Boolean]"===L.call(e),Y=e=>F(E,e),J=e=>F(k,e);function X(e){return null===e||"object"!=typeof e}function ee(e,t){return({}).toString.call(e)==="[object "+t+"]"}function et(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var ei=[!0,"true",1,"1","yes"],er=[!1,"false",0,"0","no"];function es(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),Z(e)?e>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):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: "+i+", fallback: "+s),es(s||i,t,i,r))}class en{constructor(e){this.$t={},this.zt=e.zt,this.Gt=es(e.bucketSize,0,100,e.Zt),this.Qt=es(e.refillRate,0,this.Gt,e.Zt),this.Jt=es(e.refillInterval,0,864e5,e.Zt)}Kt(e,t){var i=Math.floor((t-e.lastAccess)/this.Jt);i>0&&(e.tokens=Math.min(e.tokens+i*this.Qt,this.Gt),e.lastAccess=e.lastAccess+i*this.Jt)}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.$t[r];return s?this.Kt(s,i):this.$t[r]=s={tokens:this.Gt,lastAccess:i},0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.zt)||t.call(this,e)),0===s.tokens)}
18stop(){this.$t={}}}var ea,eo,el,eu="Mobile",ec="Android",eh="Tablet",ed=ec+" "+eh,ep="iPad",ef="Apple",eg=ef+" Watch",ev="Safari",em="BlackBerry",e_="Samsung",ey=e_+"Browser",eb=e_+" Internet",ew="Chrome",eS=ew+" OS",eE=ew+" iOS",ek="Internet Explorer",ex=ek+" "+eu,eT="Opera",eO=eT+" Mini",eP="Edge",eC="Microsoft "+eP,eI="Firefox",eM=eI+" iOS",eR="Nintendo",eF="PlayStation",eD="Xbox",eA=ec+" "+eu,eN=eu+" "+ev,e$="Windows",eL=e$+" Phone",eq="Nokia",ez="Ouya",eU="Generic",ej=eU+" "+eu.toLowerCase(),eV=eU+" "+eh.toLowerCase(),eW="Konqueror",eH="Oculus Browser",eG="Vivaldi",eB="Yandex",eZ="Whale",eK="DuckDuckGo",eQ="Pale Moon",eY="Waterfox",eJ="Brave",eX="Google Search App",e0="(\\d+(\\.\\d+)?)",e1=RegExp("Version/"+e0),e2=RegExp(eD,"i"),e3=RegExp(eF+" \\w+","i"),e6=RegExp(eR+" \\w+","i"),e4=RegExp(em+"|PlayBook|BB10","i"),e5={"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"},e8=function(e,t,i,r){var s;return t=t||"",(null!=i&&i.brave?eJ:null)||(null!=r&&r.detectGoogleSearchApp&&F(e,"GSA/")?eX:F(e," OPR/")&&F(e,"Mini")?eO:F(e," OPR/")?eT:e4.test(e)?em:F(e,"IE"+eu)||F(e,"WPDesktop")?ex:F(e,"OculusBrowser")?eH:F(e,ey)?eb:F(e,eP)||F(e,"Edg/")?eC:F(e,eG+"/")?eG:F(e,"YaBrowser/")?eB:F(e,eZ+"/")?eZ:F(e,eK+"/")||F(e,"Ddg/")?eK:F(e,"FBIOS")?"Facebook "+eu:F(e,"UCWEB")||F(e,"UCBrowser")?"UC Browser":F(e,"CriOS")?eE:F(e,"CrMo")||F(e,ew)?ew:F(e,ec)&&F(e,ev)?eA:F(e,"FxiOS")?eM:F(e.toLowerCase(),eW.toLowerCase())?eW:F(e,eJ+"/")?eJ:(s=t)&&F(s,ef)||F(e,ev)&&!F(e,ew)&&!F(e,ec)?F(e,eu)?eN:ev:F(e,"PaleMoon/")?eQ:F(e,eY+"/")?eY:F(e,eI)?eI:F(e,"MSIE")||F(e,"Trident/")?ek:F(e,"Gecko")?eI:"")},e7={[ex]:[RegExp("rv:"+e0)],[eC]:[RegExp(eP+"?\\/"+e0)],[ew]:[RegExp("("+ew+"|CrMo)\\/"+e0)],[eE]:[RegExp("CriOS\\/"+e0)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e0)],[ev]:[e1],[eN]:[e1],[eT]:[RegExp("(Opera|OPR)\\/"+e0)],[eI]:[RegExp(eI+"\\/"+e0)],[eM]:[RegExp("FxiOS\\/"+e0)],[eW]:[RegExp("Konqueror[:/]?"+e0,"i")],[em]:[RegExp(em+" "+e0),e1],[eA]:[RegExp("android\\s"+e0,"i")],[eb]:[RegExp(ey+"\\/"+e0)],[eH]:[RegExp("OculusBrowser\\/"+e0)],[eG]:[RegExp(eG+"\\/"+e0)],[eB]:[RegExp("YaBrowser\\/"+e0)],[eZ]:[RegExp(eZ+"\\/"+e0)],[eJ]:[RegExp(eJ+"\\/"+e0)],[eK]:[RegExp("(DuckDuckGo|Ddg)\\/"+e0)],[eQ]:[RegExp("PaleMoon\\/"+e0)],[eY]:[RegExp(eY+"\\/"+e0)],[eX]:[RegExp("GSA\\/"+e0)],[ek]:[RegExp("(rv:|MSIE )"+e0)],Mozilla:[RegExp("rv:"+e0)]},e9=function(e,t,i,r){var s=e7[e8(e,t,i,r)];if(V(s))return null;for(var n=0;s.length>n;n++){var a=e.match(s[n]);if(a)return parseFloat(a[a.length-2])}return null},te=[[RegExp(eD+"; "+eD+" (.*?)[);]","i"),e=>[eD,e&&e[1]||""]],[RegExp(eR,"i"),[eR,""]],[RegExp(eF,"i"),[eF,""]],[e4,[em,""]],[RegExp(e$,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eL,""];if(new RegExp(eu).test(t)&&!/IEMobile\b/.test(t))return[e$+" "+eu,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=e5[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[e$,r]}return[e$,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=V(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ec+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ec+")","i"),e=>e&&e[2]?[ec,[e[2],e[3],e[4]||"0"].join(".")]:[ec,""]],[/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/,[eS,""]],[/Linux|debian/i,["Linux",""]]],tt=function(e){return e6.test(e)?eR:e3.test(e)?eF:e2.test(e)?eD:RegExp(ez,"i").test(e)?ez:RegExp("("+eL+"|WPDesktop)","i").test(e)?eL:/iPad/.test(e)?ep:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?eg:e4.test(e)?em:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eq,"i").test(e)?eq:/(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(eu).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)?ec:ed:RegExp("(pda|"+eu+")","i").test(e)?ej:RegExp(eh,"i").test(e)&&!RegExp(eh+" pc","i").test(e)?eV:""},ti=e=>e instanceof Error,tr={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}},ts=tr.info;function tn(e){var t=[];for(var i in e){var r=e[i];G(r)||V(r)||t.push({key:i,value:function e(t){if(Q(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(q(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(r)})}return t}class ta{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(t),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return v(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&q(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
18pFirstLines:0),t.chunkIdMap)),m({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return v(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(r=t.handled)||r,synthetic:null!=(s=e.synthetic)&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,m({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return el&&i.length===eo||(eo=i.length,el=i.reduce((i,r)=>{ea||(ea={});var s=ea[r];if(s)i[s[0]]=s[1];else for(var n=e(r),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[r];if(l&&u){i[l]=u,ea[r]=[l,u];break}}return i},{})),el}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return m({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}function to(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return V(r)||(n.lineno=r),V(s)||(n.colno=s),n}var tl=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},tu=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,th=/\((\S*)(?::(\d+))(?::(\d+))\)/,td=(e,t)=>{var i=tu.exec(e);if(i){var[,r,s,n]=i;return to(t,r,"?",+s,+n)}var a=tc.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var o=th.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,u]=tl(a[1]||"?",a[2]);return to(t,u,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},tp=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tf=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tg=(e,t)=>{var i=tp.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=tf.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var s=i[3],n=i[1]||"?";return[n,s]=tl(n,s),to(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tv=/\(error: (.*)\)/;class tm{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=W(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return ee(e,"DOMException")}isDOMError(e){return ee(e,"DOMError")}}class t_{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class ty{match(e){return ee(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var tb=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tw{match(e){return"string"==typeof e}coerce(e,t){var i,[r,s]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(tb);return r&&(t=r[1],i=r[2]),[t,i]}}var tS=["fatal","error","warning","log","info","debug"];function tE(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");
18if(t>=s.length)return r===i.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class tk{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return et(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tE(e)}isSeverityLevel(e){return W(e)&&!H(e)&&tS.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(ti(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tx{match(e){return et(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tE(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tT{match(e){return X(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tO{match(e){return ee(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!et(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return X(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var tP="$message",tC="$timestamp",tI=new Set([tP,tC]),tM={enabled:!0,max_bytes:32768};function tR(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tM.enabled,max_bytes:function(e,t){if(!Z(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tM.max_bytes)}:m({},tM)}class tF{constructor(e){this.Yt=[],this.Xt=0,this.qt=tR(e)}setConfig(e){this.qt=tR(e),this.er()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,(e,i)=>{if("bigint"==typeof i)return i.toString();if("function"!=typeof i&&"symbol"!=typeof i){if(i instanceof Date)return i.toISOString();if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&"object"==typeof i){if(t.has(i))return"[Circular]";t.add(i)}return i}})}catch(e){return}}(e);if(t)try{var i=JSON.parse(t);if(!U(i))return;var r=i[tP],s=i[tC];if(!W(r)||0===r.trim().length||!W(s)&&!Z(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,r=0;t.length>r;r++)"%"===t[r]?(i+=1,r+=2):i+=1;return i}(t.json);i>this.qt.max_bytes||(this.Yt.push({step:t.step,bytes:i}),this.Xt+=i,this.er())}}getAttachable(){return this.Yt.map(e=>e.step)}clear(){this.Yt=[],this.Xt=0}size(){return this.Yt.length}er(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var e=this.Yt.shift();e&&(this.Xt-=e.bytes)}}}var tD=function(e,t){var{debugEnabled:r}=void 0===t?{}:t,s={k(t){if(i&&(f.DEBUG||d.POSTHOG_DEBUG||r)&&!V(i.console)&&i.console){for(var s=("__rrweb_original__"in i.console[t])?i.console[t].__rrweb_original__:i.console[t],n=arguments.length,a=Array(n>1?n-1:0),o=1;n>o;o++)a[o-1]=arguments[o];s(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("error",...t)},critical(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tD(e+" "+t,i)};return s},tA=tD("[PostHog.js]"),tN=tA.createLogger,t$=tN("[ExternalScriptsLoader]"),tL=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return t$.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==n?void 0:n.querySelectorAll("script");
18if(r){for(var s,a=0;r.length>a;a++)if(s=function(){if(r[a].src===t){var e=r[a];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return s.v}var o=()=>{if(!n)return i("document not found");var r=n.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)n.head.appendChild(r);else{var s,a=n.querySelectorAll("body > script");a.length>0?null==(s=a[0].parentNode)||s.insertBefore(r,a[0]):n.body.appendChild(r)}};null!=n&&n.body?o():null==n||n.addEventListener("DOMContentLoaded",o)};d.__PosthogExtensions__=d.__PosthogExtensions__||{},d.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var r;if(e.config.strict_script_versioning)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var s="/static/"+t+".js?v="+e.version;"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5)),r=e.requestRouter.endpointFor("assets",s)}tL(e,r,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tL(e,n,i)}},d.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);tL(e,r,i)};var tq="$people_distinct_id",tz="$device_id",tU="__alias",tj="__timers",tV="$autocapture_disabled_server_side",tW="$heatmaps_enabled_server_side",tH="$exception_capture_enabled_server_side",tG="$error_tracking_suppression_rules",tB="$error_tracking_capture_extension_exceptions",tZ="$web_vitals_enabled_server_side",tK="$dead_clicks_enabled_server_side",tQ="$product_tours_enabled_server_side",tY="$web_vitals_allowed_metrics",tJ="$session_recording_remote_config",tX="$replay_sample_rate",t0="$replay_override_sampling",t1="$replay_override_linked_flag",t2="$replay_override_url_trigger",t3="$replay_override_event_trigger",t6="$sesid",t4="$session_is_sampled",t5="$enabled_feature_flags",t8="$active_feature_flags",t7="$early_access_features",t9="$feature_flag_details",ie="$feature_flag_payloads",it="$feature_flag_request_id",ii="$override_feature_flags",ir="$override_feature_flag_payloads",is="$stored_person_properties",ia="$stored_group_properties",io="$surveys",il="$surveys_loaded_at",iu="$surveys_activated",ic="ph_product_tours",ih="$flag_call_reported",id="$flag_call_reported_session_id",ip="$feature_flag_errors",ig="$feature_flag_evaluated_at",iv="$user_state",im="$client_session_props",i_="$capture_rate_limit",iy="$initial_campaign_params",ib="$initial_referrer_info",iw="$initial_person_info",iS="$epp",iE="__POSTHOG_TOOLBAR__",ik="$posthog_cookieless",ix="$sdk_debug_extensions_init_method",iT="$sdk_debug_extensions_init_time_ms",iO="$sdk_debug_recording_script_not_loaded",iP="PostHog loadExternalDependency extension not found.",iC="on_reject",iI="always",iM="anonymous",iR="identified",iF="identified_only",iD="visibilitychange",iA="beforeunload",iN="$pageview",i$="$pageleave",iL="$identify",iq="$groupidentify";function iz(e,t){q(e)&&e.forEach(t)}function iU(e,t){if(!B(e))if(q(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)$.call(e,i)&&t(e[i],i)}var ij=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(e[n]=s[n]);return e};function iV(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var iW=function(e){try{return e()}catch(e){return}},iH=function(e){return function(){try{for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){tA.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tA.critical(e)}}},iG=function(e){var t={};return iU(e,function(e,i){(W(e)&&e.length>0||Z(e))&&(t[i]=e)}),t},iB=["herokuapp.com","vercel.app","netlify.app"];function iZ(e,t,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}function iK(e){return"ph_toolbar_internal"===e.name}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Z(e)&&isFinite(e)&&Math.floor(e)===e});class iQ{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>t||0>i||0>r||e>0xffffffffffff||t>4095||i>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/0x10000000000,s[1]=e/0x100000000,s[2]=e/0x1000000,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new iQ(s)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new iQ(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class iY{constructor(){this.S=0,this.C=0,this.I=new i0}generate(){var e=this.generateOrAbort();if(V(e)){this.S=0;var t=this.generateOrAbort();if(V(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.T();else{if(this.S>=e+1e4)return;this.C++,this.C>0x3ffffffffff&&(this.S++,this.T())}return iQ.fromFieldsV7(this.S,Math.trunc(this.C/0x40000000),0x3fffffff&this.C,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var iJ,iX=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw 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};i&&!V(i.crypto)&&crypto.getRandomValues&&(iX=e=>crypto.getRandomValues(e));class i0{constructor(){this.M=new Uint32Array(8),this.R=1/0}nextUint32(){return this.M.length>this.R||(iX(this.M),this.R=0),this.M[this.R++]}}var i1=()=>i2().toString(),i2=()=>(iJ||(iJ=new iY)).generate(),i3="",i6=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,i4={O:()=>!!n,D(e){tA.error("cookieStore error: "+e)},A(e){if(n){try{for(var t=e+"=",i=n.cookie.split(";").filter(e=>e.length),r=0;i.length>r;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},F(e){var t;try{t=JSON.parse(i4.A(e))||{}}catch(e){}return t},N(e,t,i,r,s){if(!n)return!1;try{var a="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=n),i3)return i3;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+i1();!i3&&r--;){var a=i.slice(r).join("."),o=s+"=1;domain=."+a+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",i3=a)}return i3}(e);if(!i){var r,s=(r=e.match(i6))?r[0]:"";s!==i&&tA.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(n.location.hostname,r);
18if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),a="; expires="+u.toUTCString()}s&&(o="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+a+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&tA.warn("cookieStore warning: large cookie, len="+c.length),n.cookie=c,!0}catch(e){return!1}},q(e,t){if(null!=n&&n.cookie)try{i4.N(e,"",-1,t)}catch(e){return}}},i5=null,i8={O(){if(!G(i5))return i5;var e=!0;if(V(i))e=!1;else try{var t="__mplssupport__";i8.N(t,"xyz"),'"xyz"'!==i8.A(t)&&(e=!1),i8.q(t)}catch(t){e=!1}return e||tA.error("localStorage unsupported; falling back to cookie store"),i5=e,e},D(e){tA.error("localStorage error: "+e)},A(e){try{return null==i?void 0:i.localStorage.getItem(e)}catch(e){i8.D(e)}return null},F(e){try{return JSON.parse(i8.A(e))||{}}catch(e){}return null},N(e,t){try{return null==i||i.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){i8.D(e)}return!1},q(e){try{null==i||i.localStorage.removeItem(e)}catch(e){i8.D(e)}}},i7=[tz,"distinct_id",t6,t4,iS,iw,iv],i9={},re={O:()=>!0,D(e){tA.error("memoryStorage error: "+e)},A:e=>i9[e]||null,F:e=>i9[e]||null,N:(e,t)=>(i9[e]=t,!0),q(e){delete i9[e]}},rt=null,ri={O(){if(!G(rt))return rt;if(rt=!0,V(i))rt=!1;else try{var e="__support__";ri.N(e,"xyz"),'"xyz"'!==ri.A(e)&&(rt=!1),ri.q(e)}catch(e){rt=!1}return rt},D(e){tA.error("sessionStorage error: ",e)},A(e){try{return null==i?void 0:i.sessionStorage.getItem(e)}catch(e){ri.D(e)}return null},F(e){try{return JSON.parse(ri.A(e))||null}catch(e){}return null},N(e,t){try{return null==i||i.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){ri.D(e)}return!1},q(e){try{null==i||i.sessionStorage.removeItem(e)}catch(e){ri.D(e)}}};class rr{constructor(e){this._instance=e}get qt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.qt.cookieless_mode===iI||this.isRejected()||-1===this.consent&&this.qt.cookieless_mode===iC}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.qt.opt_out_capturing_by_default}optInOut(e){this.nr.N(this.sr,+!!e,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get ir(){var e=this.nr.A(this.sr);return F(ei,e)?1:F(er,e)?0:-1}get nr(){var e=this.qt.opt_out_capturing_persistence_type,t="localStorage"===e?i8:i4;if(!this.ar||this.ar!==t){this.ar=t;var i="localStorage"===e?i4:i8;i.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(F(ei,i.A(this.sr))),i.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[null==s?void 0:s.doNotTrack,null==s?void 0:s.msDoNotTrack,d.doNotTrack].some(e=>F(ei,e))}}function rs(e){return e instanceof Element&&(e.id===iE||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function rn(e){return!!e&&1===e.nodeType}function ra(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ro(e){return!!e&&3===e.nodeType}function rl(e){return!!e&&11===e.nodeType&&rn(e.host)}function ru(e){return e?D(e).split(/\s+/):[]}function rc(e){var t=null==i?void 0:i.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function rh(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 ru(t)}function rd(e){return B(e)?null:D(e).split(/(\s+)/).filter(e=>rD(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rp(e){var t="";return rT(e)&&!rO(e)&&e.childNodes&&e.childNodes.length&&iU(e.childNodes,function(e){var i;ro(e)&&e.textContent&&(t+=null!=(i=rd(e.textContent))?i:"")}),D(t)}function rf(e){var t;return V(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rg=["a","button","form","input","select","textarea","label"];function rv(e,t){if(V(t))return!0;var i,r=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function rm(e){var t=e.parentNode;return!(!t||!rn(t))&&t}var r_=["next","previous","prev",">","<"],ry=[...r_,"+","-","â","â"],rb=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,rw=[".ph-no-rageclick",".ph-no-capture"],rS=["","text","search","email","password","url","tel","number"];function rE(e,t){if(!i||rk(e)||(Q(t)?(s=!!t&&rw,n=void 0,a=!1):(s=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:rw,n=null==t?void 0:t.content_ignorelist,a=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===s)||a&&!(!(r=e)||!rn(r))&&(ra(r,"textarea")||(ra(r,"input")?F(rS,(r.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(r))))return!1;var r,s,n,a,o,l,{targetElementList:u}=rx(e,!1);return!function(e,t){var i;if(!1===e||V(e))return!1;if(!0===e)i=r_;else{if(!q(e))return!1;if(e.length>10)return tA.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:r}=e;return i.some(e=>rb(t,e)||rb(r,e))})}(n,u.map(e=>{var t;return{safeText:rp(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rv(u,s)}var rk=e=>!e||ra(e,"html")||!rn(e),rx=(e,t)=>{if(!i||rk(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,s=[e],n=e;n.parentNode&&!ra(n,"body");)if(rl(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var a=rm(n);if(!a)break;if(t||rg.indexOf(a.tagName.toLowerCase())>-1)r=!0;else{var o=i.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(r=!0)}s.push(a),n=a}return{parentIsUsefulElement:r,targetElementList:s}};function rT(e){for(var t=e;t.parentNode&&!ra(t,"body");t=t.parentNode){var i=rh(t);if(F(i,"ph-sensitive")||F(i,"ph-no-capture"))return!1}if(F(rh(e),"ph-include"))return!0;var r=e.type||"";if(W(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}
18var s=e.name||e.id||"";return!W(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 rO(e){return!!(ra(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ra(e,"select")||ra(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rP="(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})",rC=RegExp("^(?:"+rP+")$"),rI=new RegExp(rP),rM="\\d{3}-?\\d{2}-?\\d{4}",rR=RegExp("^("+rM+")$"),rF=RegExp("("+rM+")");function rD(e,t){return void 0===t&&(t=!0),!(B(e)||W(e)&&(e=D(e),(t?rC:rI).test((e||"").replace(/[- ]/g,""))||(t?rR:rF).test(e)))&&!0}function rA(e){var t=rp(e);return rD(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&iU(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=rp(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tA.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rN(e){return e.replace(/"|\\"/g,'\\"')}var r$=tN("[Dead Clicks]"),rL=()=>!0,rq=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(tK)),r=e.instance.config.capture_dead_clicks;return Q(r)?r:!!U(r)||i};class rz{get lazyLoadedDeadClicksAutocapture(){return this.lr}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[tK]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ur(()=>{this.hr()}):this.stop()}ur(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?r$.error("failed to load script",t):e()})}hr(){var e;if(n){if(!this.lr&&null!=(e=d.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=U(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.lr=d.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.lr.start(n),r$.info("starting...")}}else r$.error("`document` not found. Cannot start.")}stop(){this.lr&&(this.lr.stop(),this.lr=void 0,r$.info("stopping..."))}}var rU=tN("[SegmentIntegration]"),rj="posthog-js";function rV(e,t){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var o=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=o,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,c,h,d,p,f=(null==(l=t.exception)?void 0:l.values)||[],g=f.map(e=>m({},e,{stacktrace:e.stacktrace?m({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>m({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(u=f[0])?void 0:u.value)||t.message,$exception_type:null==(c=f[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:t.tags};return i&&r&&(v.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),a&&(null==(p=e.exceptions)||p.sendExceptionEvent(v)),t}}class rW{constructor(e,t,i,r,s,n){this.name=rj,this.setupOnce=function(a){a(rV(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class rH{constructor(e){this.cr=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(tA.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){var e;this.pr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.cr)}destroy(){var e;null==(e=this.pr)||e.call(this),this.pr=void 0}doPageView(e,t){var r,s=this.gr(e,t);return this.dr={pathname:null!=(r=null==i?void 0:i.location.pathname)?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.gr(e,null==(t=this.dr)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.dr)?void 0:e.pageViewId}}gr(e,t){var i=this.dr;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:a,maxScrollY:o,maxContentHeight:l,lastContentY:u,maxContentY:c}=s;if(!(V(n)||V(a)||V(o)||V(l)||V(u)||V(c))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var h=n>1?es(a/n,0,1,tA):1,d=n>
181?es(o/n,0,1,tA):1,p=l>1?es(u/l,0,1,tA):1,f=l>1?es(c/l,0,1,tA):1;r=ij(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:f})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var rG=["flags","surveys"],rB={[tq]:{exposure:"hidden"},[tU]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[tj]:{exposure:"hidden"},[tV]:{exposure:"event"},[tW]:{exposure:"hidden"},[tH]:{exposure:"event"},[tG]:{exposure:"hidden"},[tB]:{exposure:"event"},[tZ]:{exposure:"event"},[tK]:{exposure:"event"},[tQ]:{exposure:"hidden"},[tY]:{exposure:"event"},[tJ]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[t6]:{exposure:"hidden"},[t4]:{exposure:"event"},[tX]:{exposure:"event",shouldSkipFromEventProperties:e=>G(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[t5]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!U(e))return{};for(var t={},i=Object.keys(e),r=0;i.length>r;r++)t["$feature/"+i[r]]=e[i[r]];return t}},[t8]:{exposure:"event",storageGroup:"flags"},[t7]:{exposure:"hidden"},[t9]:{exposure:"hidden",storageGroup:"flags"},[ie]:{exposure:"event",storageGroup:"flags"},[it]:{exposure:"event",storageGroup:"flags",volatile:!0},[ii]:{exposure:"event"},[ir]:{exposure:"hidden"},[is]:{exposure:"hidden"},[ia]:{exposure:"hidden"},[io]:{exposure:"hidden",storageGroup:"surveys"},[il]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iu]:{exposure:"event"},[ic]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ih]:{exposure:"hidden"},[id]:{exposure:"hidden"},[ip]:{exposure:"hidden"},[ig]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iv]:{exposure:"hidden"},[im]:{exposure:"hidden"},[i_]:{exposure:"hidden"},[iy]:{exposure:"hidden"},[ib]:{exposure:"hidden"},[iw]:{exposure:"hidden"},[iS]:{exposure:"hidden"}
18,[t0]:{exposure:"event"},[t1]:{exposure:"event"},[t2]:{exposure:"event"},[t3]:{exposure:"event"},[ix]:{exposure:"event"},[iT]:{exposure:"event"},[iO]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rZ=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rK=e=>{var t=rB[e];if(t)return t;for(var[i,r]of rZ)if(0===e.indexOf(i))return r},rQ=e=>{var t=null==n?void 0:n.createElement("a");return V(t)?null:(t.href=e,t)},rY=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split("=");if(n[0]===t){i=n;break}}if(!q(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){tA.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rJ=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[1],n=(r[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],c=0;l.length>c;c++){var h=l[c].split("=");q(h)&&(t.includes(h[0])?u.push(h[0]+"="+i):u.push(l[c]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=s&&(d+="#"+s),d},rX=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},r0="https?://(.*)",r1=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],r2=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...r1],r3="<masked>",r6=["li_fat_id"];function r4(e,t,i){if(!n)return{};var r,s=t?[...r1,...i||[]]:[],a=r5(rJ(n.URL,s,r3),e);return ij((r={},iU(r6,function(e){var t=i4.A(e);r[e]=t||null}),r),a)}function r5(e,t){var i=r2.concat(t||[]),r={};return iU(i,function(t){var i=rY(e,t);r[t]=i||null}),r}function r8(e){var t=e?0===e.search(r0+"google.([^/?]*)")?"google":0===e.search(r0+"bing.com")?"bing":0===e.search(r0+"yahoo.com")?"yahoo":0===e.search(r0+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!G(t)){i.$search_engine=t;var r=n?rY(n.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function r7(){return navigator.language||navigator.userLanguage}var r9="$direct";function se(){return(null==n?void 0:n.referrer)||r9}function st(e,t){var i=e?[...r1,...t||[]]:[],r=null==a?void 0:a.href.substring(0,1e3);return{r:se().substring(0,1e3),u:r?rJ(r,i,r3):void 0}}function si(e){var t,{r:i,u:r}=e,s={$referrer:i,$referring_domain:null==i?void 0:i==r9?r9:null==(t=rQ(i))?void 0:t.host};if(r){s.$current_url=r;var n=rQ(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname,ij(s,r5(r))}return i&&ij(s,r8(i)),s}function sr(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var ss={flags:ig,surveys:il},sn=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sa="main";class so{constructor(e,t,r){if(void 0===r&&(r=!0),this.mr={},this.yr=!1,this.br=!1,this.qt=e,this._r=r,this.props={},this.wr=!1,this.kr=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.nr=this.Sr(e),this.br=this.Cr(e),this.load(),e.debug&&tA.info("Persistence loaded",e.persistence,m({},this.props)),this.update_config(e,e,t),this.save(),i){var s=()=>this.flush();iZ(i,"beforeunload",s,{capture:!1}),iZ(i,"pagehide",s,{capture:!1})}}Ir(){var e,t=null==(e=this.qt)?void 0:e.persistence_save_debounce_ms;return Z(t)&&t>0?t:0}isDisabled(){return!!this.Tr}Sr(e){-1===sn.indexOf(e.persistence.toLowerCase())&&(tA.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");
18var t,r,s,n,a=(t=e.cookie_persisted_properties||[],r=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===r&&(r=!1),s=[...i7,...t],m({},i8,{F(e){try{var t={};try{t=i4.F(e)||{}}catch(e){}var i,s=JSON.parse(i8.A(e)||"{}");if(r){var n={};for(var a in t){var o=t[a];G(o)||""===o||(n[a]=o)}i=ij(s,n)}else i=ij(t,s);return i8.N(e,i),i}catch(e){}return null},N(e,t,i,r,n,a){var o=i8.N(e,t,void 0,void 0,a);try{var l={};s.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&i4.N(e,l,i,r,n,a)}catch(e){i8.D(e)}return o},q(e,t){try{null==i||i.localStorage.removeItem(e),i4.q(e,t)}catch(e){i8.D(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&i8.O()?(n=i8,o=!0):"localstorage+cookie"===l&&a.O()?(n=a,o=!0):"sessionstorage"===l&&ri.O()?n=ri:"memory"===l?n=re:"cookie"===l?n=i4:a.O()?(n=a,o=!0):n=i4,this.yr=o,n}Er(e){return this.kr+"__"+e}Cr(e){return this.yr&&!!e.split_storage}Mr(e){var t=null!=e?e:this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[ig];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return iU(this.props,(t,i)=>{var r=rK(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,i===t5?()=>this.Mr():()=>!1))return;r.transformToEventProperties&&ij(e,r.transformToEventProperties(t))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,()=>!1))return;e[i]=t}}),e}load(){if(!this.Tr){var e=this.nr.F(this.kr);e&&(this.props=ij({},e)),this.br&&this.Rr()}}Rr(){for(var e of rG){var t=i8.F(this.Er(e));if(t&&!j(t)){var i=this.Pr(e);i.persisted=!0,this.Or(e)||(i.fingerprint=this.Lr(t,e)),this.Fr(e,t)||ij(this.props,t)}}}Or(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rK(t))?void 0:i.storageGroup)===e})}Fr(e,t){var i=ss[e];if(!i)return!1;var r=t[i],s=this.props[i];return Z(r)&&Z(s)&&s>r}refreshKey(e){var t;if(!this.Tr){var i=this.br?null==(t=rK(e))?void 0:t.storageGroup:void 0,r=i?i8.F(this.Er(i)):this.nr.F(this.kr);if(r&&e in r)this.Ar(e,r[e]);else{if(i){var s=this.nr.F(this.kr);if(s&&e in s)return void this.Ar(e,s[e])}this.Nr(e)}}}save(){if(!this.Tr){var e=this.Ir();e>0?V(this.Dr)&&(this.Dr=setTimeout(()=>{this.Dr=void 0,this.$r()},e)):this.$r()}}flush(){V(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0,this.$r())}$r(){this.Tr||(this.br?this.qr():this.jr(this.nr,this.kr,this.props,sa))}qr(){var{main:e,groups:t}=this.Br();for(var i of(this.jr(this.nr,this.kr,e,sa),rG)){var r,s=t[i];(!j(s)||null!=(r=this.mr[i])&&r.persisted)&&this.jr(i8,this.Er(i),s,i)}}Br(){var e={},t={};for(var i of rG)t[i]={};return iU(this.props,(i,r)=>{var s,n=null==(s=rK(r))?void 0:s.storageGroup;n?t[n][r]=i:e[r]=i}),{main:e,groups:t}}Lr(e,t){if(t===sa)return JSON.stringify(e)+"|"+this.Hr+"|"+this.Ur+"|"+this.zr;var i={};return iU(e,(e,t)=>{var r;i[t]=null!=(r=rK(t))&&r.volatile?"__volatile__":e}),JSON.stringify(i)}jr(e,t,i,r){var s,n=this.Pr(r);if(r===sa||n.dirty||V(n.fingerprint)){try{if((s=this.Lr(i,r))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e.N(t,i,this.Hr,this.Ur,this.zr,this.qt.debug)?(n.dirty=!1,r!==sa&&(n.persisted=!0),V(s)||(n.fingerprint=s)):this.qt.debug&&tA.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(V(this.Dr)||(clearTimeout(this.Dr),this.Dr=void 0),this.nr.q(this.kr,!1),this.nr.q(this.kr,!0),!t&&this._r)for(var i of rG)i8.q(this.Er(i));t?delete this.mr[sa]:this.mr={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(U(e)){V(t)&&(t="None"),this.Hr=V(i)?this.Vr:i;var r=!1;if(iU(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Ar(i,e),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(U(e)){this.Hr=V(t)?this.Vr:t;var i=!1;if(iU(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Ar(r,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Nr(e),this.save())}update_campaign_params(){if(!this.wr){var e=r4(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);j(iG(e))||this.register(e),this.wr=!0}}update_search_keyword(){var e;this.register((e=null==n?void 0:n.referrer)?r8(e):{})}update_referrer_info(){var e;this.register_once({$referrer:se(),$referring_domain:null!=n&&n.referrer&&(null==(e=rQ(n.referrer))?void 0:e.host)||r9},void 0)}set_initial_person_info(){this.props[iy]||this.props[ib]||this.register_once({[iw]:st(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};iU([ib,iy],t=>{var i=this.props[t];i&&iU(i,function(t,i){e["$initial_"+A(i)]=t})});var t,i,r=this.props[iw];return r&&ij(e,(t=si(r),i={},iU(t,function(e,t){i["$initial_"+A(t)]=e}),i)),e}safe_merge(e){return iU(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.Vr=this.Hr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=r?this.Sr(e):this.nr,n=this.Cr(e);if(r||n!==this.br){var a=this.props;this.clear(),this.nr=s,this.br=n,this.props=a,this.save()}}set_disabled(e){this.Tr=e,this.Tr?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ur&&(this.Ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.zr&&(this.zr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[tj]||{};i[e]=t,this.Ar(tj,i),this.save()}remove_event_timer(e){var t=this.props[tj]||{},i=t[e];return V(i)||(delete t[e],this.Ar(tj,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Ar(e,t),this.save()}Ar(e,t){var i;this.props[e]=t,null!=(i=rK(e))&&i.volatile||this.Wr(e)}Nr(e){delete this.props[e],this.Wr(e)}Wr(e){var t,i=null==(t=rK(e))?void 0:t.storageGroup;i&&(this.Pr(i).dirty=!0)}Pr(e){return this.mr[e]||(this.mr[e]={})}}var sl={Activation:"events",Cancellation:"cancelEvents"},su={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},sc={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},sh={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_
18START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},sd={Popover:"popover",Inline:"inline"},sp={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},sf={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},sg=tN("[RateLimiter]");class sv{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{sg.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sg.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,r,{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(i_))?t:{tokens:s,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>s&&(o.tokens=s);var l=1>o.tokens;return l||e||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(i_,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var sm=tN("[RemoteConfig]");class s_{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=d._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Gr(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Zr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return sm.info("Using preloaded remote config",this.remoteConfig),this.Qr(this.remoteConfig),void this.Jr();if(this._instance.Kr())return void sm.warn("Remote config is disabled. Falling back to local config.");this.Gr(e=>{e?(this.Qr(e),this.Jr()):(sm.info("No config found after loading remote JS config. Falling back to JSON."),this.Zr(e=>{this.Qr(e),this.Jr()}))})}catch(e){sm.error("Error loading remote config",e)}}stop(){this.Yr&&(clearInterval(this.Yr),this.Yr=void 0)}
18refresh(){!this._instance.Kr()&&n&&"hidden"!==n.visibilityState&&this._instance.reloadFeatureFlags()}Jr(){var e;if(!this.Yr){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.Yr=setInterval(()=>{this.refresh()},t))}}Qr(e){var t;e||sm.error("Failed to fetch remote config from PostHog."),this._instance.Qr(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var sy={GZipJS:"gzip-js",Base64:"base64"},sb=Uint8Array,sw=Uint16Array,sS=Uint32Array,sE=new sb([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]),sk=new sb([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]),sx=new sb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sT=function(e,t){for(var i=new sw(31),r=0;31>r;++r)i[r]=t+=1<<e[r-1];var s=new sS(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},sO=sT(sE,2),sP=sO[1];sO[0][28]=258,sP[258]=28;for(var sC=sT(sk,0)[1],sI=new sw(32768),sM=0;32768>sM;++sM){var sR=(43690&sM)>>>1|(21845&sM)<<1;sI[sM]=((65280&(sR=(61680&(sR=(52428&sR)>>>2|(13107&sR)<<2))>>>4|(3855&sR)<<4))>>>8|(255&sR)<<8)>>>1}var sF=function(e,t,i){for(var r=e.length,s=0,n=new sw(t);r>s;++s)++n[e[s]-1];var a,o=new sw(t);for(s=0;t>s;++s)o[s]=o[s-1]+n[s-1]<<1;if(i){a=new sw(1<<t);var l=15-t;for(s=0;r>s;++s)if(e[s])for(var u=s<<4|e[s],c=t-e[s],h=o[e[s]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)a[sI[h]>>>l]=u}else for(a=new sw(r),s=0;r>s;++s)a[s]=sI[o[e[s]-1]++]>>>15-e[s];return a},sD=new sb(288);for(sM=0;144>sM;++sM)sD[sM]=8;for(sM=144;256>sM;++sM)sD[sM]=9;for(sM=256;280>sM;++sM)sD[sM]=7;for(sM=280;288>sM;++sM)sD[sM]=8;var sA=new sb(32);for(sM=0;32>sM;++sM)sA[sM]=5;var sN=sF(sD,9,0),s$=sF(sA,5,0),sL=function(e){return(e/8|0)+(7&e&&1)},sq=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof sw?sw:e instanceof sS?sS:sb)(i-t);return r.set(e.subarray(t,i)),r},sz=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8},sU=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8,e[r+2]|=i>>>16},sj=function(e,t){for(var i=[],r=0;e.length>r;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new sb(0),0];if(1==s){var a=new sb(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,c=1,h=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=s-1;)o=i[i[h].f>i[u].f?u++:h++],l=i[u!=c&&i[h].f>i[u].f?u++:h++],i[c++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(r=1;s>r;++r)n[r].s>d&&(d=n[r].s);var p=new sw(d+1),f=sV(i[c-1],p,0);if(f>t){r=0;var g=0,v=f-t,m=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s>r;++r){var _=n[r].s;if(t>=p[_])break;g+=m-(1<<f-p[_]),p[_]=t}for(g>>>=v;g>0;){var y=n[r].s;t>p[y]?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=n[r].s;p[b]==t&&(--p[b],++g)}f=t}return[new sb(p),f]},sV=function(e,t,i){return -1==e.s?Math.max(sV(e.l,t,i+1),sV(e.r,t,i+1)):t[e.s]=i},sW=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new sw(++t),r=0,s=e[0],n=1,a=function(e){i[r++]=e},o=1;t>=o;++o)if(e[o]==s&&o!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=e[o]}return[i.subarray(0,r),t]},sH=function(e,t){for(var i=0,r=0;t.length>r;++r)i+=e[r]*t[r];return i},sG=function(e,t,i){var r=i.length,s=sL(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;r>n;++n)e[s+n+4]=i[n];return 8*(s+4+r)},sB=function(e,t,i,r,s,n,a,o,l,u,c){sz(t,c++,i),++s[256];for(var h=sj(s,15),d=h[0],p=h[1],f=sj(n,15),g=f[0],v=f[1],m=sW(d),_=m[0],y=m[1],b=sW(g),w=b[0],S=b[1],E=new sw(19),k=0;_.length>k;++k)E[31&_[k]]++;for(k=0;w.length>k;++k)E[31&w[k]]++;for(var x=sj(E,7),T=x[0],O=x[1],P=19;P>4&&!T[sx[P-1]];--P);var C,I,M,R,F=u+5<<3,D=sH(s,sD)+sH(n,sA)+a,A=sH(s,d)+sH(n,g)+a+14+3*P+sH(E,T)+(2*E[16]+3*E[17]+7*E[18]);if(D>=F&&A>=F)return sG(t,c,e.subarray(l,l+u));if(sz(t,c,1+(D>A)),c+=2,D>A){C=sF(d,p,0),I=d,M=sF(g,v,0),R=g;var N=sF(T,O,0);for(sz(t,c,y-257),sz(t,c+5,S-1),sz(t,c+10,P-4),c+=14,k=0;P>k;++k)sz(t,c+3*k,T[sx[k]]);c+=3*P;for(var $=[_,w],L=0;2>L;++L){var q=$[L];for(k=0;q.length>k;++k)sz(t,c,N[z=31&q[k]]),c+=T[z],z>15&&(sz(t,c,q[k]>>>5&127),c+=q[k]>>>12)}}else C=sN,I=sD,M=s$,R=sA;for(k=0;o>k;++k)if(r[k]>255){sU(t,c,C[257+(z=r[k]>>>18&31)]),c+=I[z+257],z>7&&(sz(t,c,r[k]>>>23&31),c+=sE[z]);var z,U=31&r[k];sU(t,c,M[U]),c+=R[U],U>3&&(sU(t,c,r[k]>>>5&8191),c+=sk[U])}else sU(t,c,C[r[k]]),c+=I[r[k]];return sU(t,c,C[256]),c+I[256]},sZ=new sS([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sK=function(){for(var e=new sS(256),t=0;256>t;++t){for(var i=t,r=9;--r;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),sQ=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},sY=!!l||!!o,sJ="text/plain",sX=!1,s0=function(e,t,i){void 0===i&&(i=!0);var r,s,n,a,o,[l,u]=e.split("?"),c=m({},t),h=null!=(o=null==u?void 0:u.split("&").map(e=>{var t,[r,s]=e.split("="),n=i&&null!=(t=c[r])?t:s;return delete c[r],r+"="+n}))?o:[],d=(void 0===r&&(r="&"),a=[],iU(c,function(e,t){V(e)||V(t)||"undefined"===t||(s=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+s)}),a.join(r));return d&&h.push(d),l+"?"+h.join("&")},s1=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),s2=e=>{if(e.tr)return e.tr;var{data:t,compression:i}=e;if(t){if(i===sy.GZipJS){var r,s,n,a,o,l,u,c,h=(r=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new sb(e.length+(e.length>>>1)),r=0,s=function(e){i[r++]=e},n=0;t>n;++n){if(r+5>i.length){var a=new sb(r+8+(t-n<<1));a.set(i),i=a}var o=e.charCodeAt(n);128>o?s(o):(2048>o?s(192|o>>>6):(o>55295&&57344>o?(s(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++n))>>>18),s(128|o>>>12&63)):s(224|o>>>12),s(128|o>>>6&63)),s(128|63&o))}return sq(i,0,r)}(s1(t)),s={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=sK[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},o=r.length,a.p(r),c=(l=10+(s.filename&&s.filename.length+1||0),u=function(e,t,i,r){var s=e.length,n=new sb(r+s+5*(1+Math.floor(s/7e3))+8),a=n.subarray(r,n.length-8),o=0;if(!t||8>s)for(var l=0;s>=l;l+=65535){var u=l+65535;s>u?o=sG(a,o,e.subarray(l,u)):(a[l]=!0,o=sG(a,o,e.subarray(l,s)))}else{for(var c=sZ[t-1],h=c>>>13,d=8191&c,p=(1<<i)-1,f=new sw(32768),g=new sw(p+1),v=Math.ceil(i/3),m=2*v,_=function(t){return(e[t]^e[t+1]<<v^e[t+2]<<m)&p},y=new sS(25e3),b=new sw(288),w=new sw(32),S=0,E=0,k=(l=0,0),x=0,T=0;s>l;++l){var O=_(l),P=32767&l,C=g[O];if(f[P]=C,g[O]=P,l>=x){var I=s-l;if((S>7e3||k>24576)&&I>423){o=sB(e,a,0,y,b,w,E,k,T,l-T,o),k=S=E=0,T=l;for(var M=0;286>M;++M)b[M]=0;for(M=0;30>M;++M)w[M]=0}var R=2,F=0,D=d,A=P-C&32767;if(I>2&&O==_(l-A))for(var N=Math.min(h,I)-1,$=Math.min(32767,l),L=Math.min(258,I);$>=A&&--D&&P!=C;){if(e[l+R]==e[l+R-A]){for(var q=0;L>q&&e[l+q]==e[l+q-A];++q);if(q>R){if(R=q,F=A,q>N)break;var z=Math.min(A,q-2),U=0;for(M=0;z>M;++M){var j=l-A+M+32768&32767,V=j-f[j]+32768&32767;V>U&&(U=V,C=j)}}}A+=(P=C)-(C=f[P])+32768&32767}if(F){y[k++]=0x10000000|sP[R]<<18|sC[F];var W=31&sP[R],H=31&sC[F];E+=sE[W]+sk[H],++b[257+W],++w[H],x=l+R,++S}else y[k++]=e[l],++b[e[l]]}}o=sB(e,a,!0,y,b,w,E,k,T,l-T,o)}return sq(n,0,r+sL(o)+8)}(r,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,l)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&sQ(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;i.length>=r;++r)e[r+10]=i.charCodeAt(r)}}(u,s),sQ(u,c-8,a.d()),sQ(u,c-4,o),u);return{contentType:sJ,body:h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),estimatedSize:h.byteLength}}if(i===sy.Base64){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=s1(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>
18String.fromCharCode(parseInt(t,16)))):d)?e:s1(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var f=s1(t);return{contentType:"application/json",body:f,estimatedSize:new Blob([f]).size}}},s3=e=>{var t,i,r,s=s2(e);return!s||(i=e.compression,r=rY(e.url,"compression"),i!==S.GZipJS&&r!==S.GZipJS&&"gzip"!==r)||((t=s.body)instanceof ArrayBuffer?T(new Uint8Array(t)):ArrayBuffer.isView(t)&&T(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:s}:(sX=!0,{url:((e,t)=>{var[i,r]=e.split("#"),[s,n]=i.split("?");if(!n)return e;var a=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")})(e.url,"compression"),encodedBody:s2(m({},e,{compression:void 0,tr:void 0}))})},s6=(nE=v(function*(e){var t=s1(e.data),i=yield function(e,t,i){return I.apply(this,arguments)}(t,f.DEBUG,{rethrow:!0});if(!i)return e;var r=yield i.arrayBuffer();return m({},e,{tr:{contentType:sJ,body:r,estimatedSize:r.byteLength}})}),function(e){return nE.apply(this,arguments)}),s4=(e,t)=>s0(e,{_:(new Date).getTime().toString(),ver:f.JS_SDK_VERSION,compression:t}),s5=[];o&&s5.push({transport:"fetch",method(e){var t,{url:i,encodedBody:r}=s3(e),{contentType:s,body:n,estimatedSize:a}=null!=r?r:{},l=new Headers;iU(e.headers,function(e,t){l.append(t,e)}),s&&l.append("Content-Type",s);var c=null;if(u){var h=new u;c={signal:h.signal,timeout:setTimeout(()=>h.abort(),e.timeout)}}o(i,m({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&52428.8>(a||0),body:n,signal:null==(t=c)?void 0:t.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){tA.error(e)}null==e.callback||e.callback(r)})).catch(t=>{tA.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>c?clearTimeout(c.timeout):null)}}),l&&s5.push({transport:"XHR",method(e){var t=new l,{url:i,encodedBody:r}=s3(e);t.open(e.method||"GET",i,!0);var{contentType:s,body:n}=null!=r?r:{};iU(e.headers,function(e,i){t.setRequestHeader(i,e)}),s&&t.setRequestHeader("Content-Type",s),e.timeout&&(t.timeout=e.timeout),t.onreadystatechange=()=>{if(4===t.readyState){var i={statusCode:t.status,text:t.responseText};if(200===t.status)try{i.json=JSON.parse(t.responseText)}catch(e){}null==e.callback||e.callback(i)}},t.send(n)}}),null!=s&&s.sendBeacon&&s5.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:i}=s3(e),r=s0(t,{beacon:"1"}),{contentType:n,body:a}=null!=i?i:{};if(!a)return;var o=a instanceof Blob?a:new Blob([a],{type:n});s.sendBeacon(r,o)}catch(e){}}});class s8{constructor(e,t){this.Xr=!0,this.ei=[],this.ti=es((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tA.createLogger("flush interval"),3e3),this.ri=e}enqueue(e){this.ei.push(e),this.ii||this.ni()}unload(){this.si();var e=Object.values(this.ei.length>0?this.oi():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.ri(m({},e,{transport:"sendBeacon"}))})}enable(){this.Xr=!1,this.ni()}ni(){var e=this;this.Xr||(this.ii=setTimeout(()=>{if(this.si(),this.ei.length>0){var t=this.oi();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&q(r.data)&&iU(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.ri(r)}()}},this.ti))}si(){clearTimeout(this.ii),this.ii=void 0}oi(){var e={};return iU(this.ei,t=>{var i,r=(t?t.batchKey:null)||t.url;V(e[r])&&(e[r]=m({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.ei=[],e}}var s7=["retriesPerformedSoFar"];class s9{constructor(e){this.ai=!1,this.li=3e3,this.ei=[],this._instance=e,this.ei=[],this.ui=!0,!V(i)&&"onLine"in i.navigator&&(this.ui=i.navigator.onLine,this.hi=()=>{this.ui=!0,this.ci()},this.di=()=>{this.ui=!1},iZ(i,"online",this.hi),iZ(i,"offline",this.di))}get length(){return this.ei.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=_(e,s7);K(t)&&(i.url=s0(i.url,{retry_count:t})),this._instance._send_request(m({},i,{callback:e=>{200===e.statusCode||e.statusCode>=400&&500>e.statusCode||(null!=t?t:0)>=10?null==i.callback||i.callback(e):this.vi(m({retriesPerformedSoFar:t},i))}}))}vi(e){var t,i,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var s=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,r)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+s;this.ei.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+s;navigator.onLine||(a+=" (Browser is offline)"),tA.warn(a),this.ai||(this.ai=!0,this.fi())}fi(){(this.pi&&clearTimeout(this.pi),0===this.ei.length)?(this.ai=!1,this.pi=void 0):this.pi=setTimeout(()=>{this.ui&&this.ei.length>0&&this.ci(),this.fi()},this.li)}ci(){var e=Date.now(),t=[],i=this.ei.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.ei=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.pi&&(clearTimeout(this.pi),this.pi=void 0),this.ai=!1,V(i)||(this.hi&&(i.removeEventListener("online",this.hi),this.hi=void 0),this.di&&(i.removeEventListener("offline",this.di),this.di=void 0)),this.ei))try{this._instance._send_request(m({},e,{transport:"sendBeacon"}))}catch(e){tA.error(e)}this.ei=[]}}class ne{constructor(e){this.gi=()=>{this.mi||(this.mi={});var e,t,i,r,s=this.scrollElement(),n=this.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,o=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.mi.lastScrollY=Math.ceil(n),this.mi.maxScrollY=Math.max(n,null!=(e=this.mi.maxScrollY)?e:0),this.mi.maxScrollHeight=Math.max(a,null!=(t=this.mi.maxScrollHeight)?t:0),this.mi.lastContentY=o,this.mi.maxContentY=Math.max(o,null!=(i=this.mi.maxContentY)?i:0),this.mi.maxContentHeight=Math.max(l,null!=(r=this.mi.maxContentHeight)?r:0)},this._instance=e}get yi(){return this._instance.config.scroll_root_selector}getContext(){return this.mi}resetContext(){var e=this.mi;return setTimeout(this.gi,0),e}startMeasuringScrollPosition(){iZ(i,"scroll",this.gi,{capture:!0}),iZ(i,"scrollend",this.gi,{capture:!0}),iZ(i,"resize",this.gi)}scrollElement(){if(!this.yi)return null==i?void 0:i.document.documentElement;for(var e of q(this.yi)?this.yi:[this.yi]){var t=null==i?void 0:i.document.querySelector(e);
18if(t)return t}}bi(e){if(this.yi){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return i?"y"===e?i.scrollY||i.pageYOffset||i.document.documentElement.scrollTop||0:i.scrollX||i.pageXOffset||i.document.documentElement.scrollLeft||0:0}scrollY(){return this.bi("y")}scrollX(){return this.bi("x")}}var nt=e=>st(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class ni{constructor(e,t,i,r){this.wi=e=>{var t=this.xi();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.ki(this._instance)};this.Si.register({[im]:i})}},this._instance=e,this.Ci=t,this.Si=i,this.ki=r||nt,this.Ci.onSessionId(this.wi)}xi(){return this.Si.props[im]}getSetOnceProps(){var e,t=null==(e=this.xi())?void 0:e.props;return t?"r"in t?si(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return iU(iG(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+A(i)]=t}),e}}class nr{constructor(){this.Ii={}}on(e,t){return this.Ii[e]||(this.Ii[e]=[]),this.Ii[e].push(t),()=>{this.Ii[e]=this.Ii[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Ii[e]||[])i(t);for(var r of this.Ii["*"]||[])r(e,t)}}var ns=tN("[SessionId]");class nn{on(e,t){return this.Ti.on(e,t)}constructor(e,t,i){if(this.Ei=null,this.Mi=[],this.Ri=void 0,this.Pi=!1,this.Ti=new nr,this.Oi=(e,t)=>!(!K(e)||!K(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===iI)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=e.config,this.Si=e.persistence,this.Li=void 0,this.Fi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ai=t||i1,this.Ni=i||i1;var r,s=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*es(this.qt.session_idle_timeout_seconds||1800,60,36e3,ns.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Di(),this.$i="ph_"+s+"_window_id",this.qi="ph_"+s+"_primary_window_exists",this.ji()){var n=ri.F(this.$i),a=ri.F(this.qi);n&&!a?this.Li=n:ri.q(this.$i),ri.N(this.qi,!0)}if(null!=(r=this.qt.bootstrap)&&r.sessionID)try{var o=(e=>{var t=this.qt.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.Bi(this.qt.bootstrap.sessionID,(new Date).getTime(),o)}catch(e){ns.error("Invalid sessionID in bootstrap",e)}this.Hi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return V(this.Mi)&&(this.Mi=[]),this.Mi.push(e),this.Fi&&e(this.Fi,this.Li),()=>{this.Mi=this.Mi.filter(t=>t!==e)}}ji(){return"memory"!==this.qt.persistence&&!this.Si.Tr&&ri.O()}Ui(e){e!==this.Li&&(this.Li=e,this.ji()&&ri.N(this.$i,e))}zi(){return this.Li?this.Li:this.ji()?ri.F(this.$i):null}Vi(e){var t=this.Ei;return!G(t)&&!G(e)&&5e3>Math.abs(e-t)}Bi(e,t,i){var r=t!==this._sessionActivityTimestamp,s=e===this.Fi&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Fi=e,s&&!r||s&&this.Vi(t)||(this.Ei=t,this.Si.register({[t6]:[t,e,i]}))}Wi(){var e,t=null==(e=this.qt)?void 0:e.persistence_save_debounce_ms;return K(t)&&t>0}Gi(){this.Wi()?this.Si.refreshKey(t6):(this.Si.flush(),this.Si.load())}Zi(){var e;if(!G(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ei){this.Gi();var[,t,i]=this.Qi();t===this.Fi&&i===this._sessionStartTimestamp&&(this.Ei=this._sessionActivityTimestamp,this.Si.register({[t6]:[this._sessionActivityTimestamp,null!=(e=this.Fi)?e:null,this._sessionStartTimestamp]}),this.Si.flush())}}Ji(){var[e]=this.Qi();return Math.max(K(e)?e:0,K(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Ki(e){return this.Gi(),this.Oi(e,this.Ji())}Qi(){var e=this.Si.props[t6];return q(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ei=null,clearTimeout(this.Yi),this.Yi=void 0,this.Bi(null,null,null)}destroy(){this.Pi=!0,this.Zi(),clearTimeout(this.Yi),this.Yi=void 0,this.Ri&&i&&(i.removeEventListener(iA,this.Ri,{capture:!1}),this.Ri=void 0),this.Mi=[]}Hi(){this.Ri=()=>{this.Zi(),this.ji()&&ri.q(this.qi)},iZ(i,iA,this.Ri,{capture:!1})}
18checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.qt.cookieless_mode===iI)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[,r,s]=this.Qi(),n=this.Ji(),a=this.zi(),o=K(s)&&Math.abs(i-s)>864e5,l=!1,u=!1,c=!r,h=r,d=!c&&!e&&this.Oi(i,n);d&&((d=this.Ki(i))||ns.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.Qi()),c||d||o?(r=this.Ai(),a=this.Ni(),ns.info("new session ID generated",{sessionId:r,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:o}}),s=i,l=!0):(a||(a=this.Ni(),l=!0),(u=r!==h)&&(ns.info("adopted cross-tab session id",{sessionId:r,windowId:a}),l=!0));var p=K(n)&&e&&!o?n:i,f=K(s)?s:(new Date).getTime();this.Ui(a),this.Bi(r,p,f),e||this.Di();var g={noSessionId:c,activityTimeout:d,sessionPastMaximumLength:o,crossTabAdoption:u};return l&&this.Mi.forEach(e=>e(r,a,g)),{sessionId:r,windowId:a,sessionStartTimestamp:f,changeReason:l?g:void 0,lastActivityTimestamp:n}}Di(){this.Pi||(clearTimeout(this.Yi),this.Yi=setTimeout(()=>{if(!this.Pi)if(this.Ki((new Date).getTime())){var e=this.Fi;this.resetSessionId(),this.Ti.emit("forcedIdleReset",{idleSessionId:e})}else this.Di()},1.1*this.sessionTimeoutMs))}}var na=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&R(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>R(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},no=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function nl(e,t,i){return s1({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var nu={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>no(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!no(t,e))),icontains:(e,t)=>t.map(nc).some(t=>e.map(nc).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(nc).every(t=>e.map(nc).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})},nc=e=>e.toLowerCase();function nh(e,t){return!e||Object.entries(e).every(e=>{var[i,r]=e,s=null==t?void 0:t[i];if(V(s)||G(s))return!1;var n=[String(s)],a=nu[r.operator];return!!a&&a(r.values,n)})}var nd="custom",np="i.posthog.com",nf=/^\/static\//;class ng{constructor(e){this.Xi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+np,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Xi[this.apiHost]||(this.Xi[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":nd),this.Xi[this.apiHost]}en(e){if(nf.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var i=this.en(t);if(i)return""+i+t}if(this.region===nd)return this.apiHost+t;var r=np+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var nv=tN("[Surveys]"),nm="seenSurvey_",n_=[su.Popover,su.Widget,su.API],ny={ignoreConditions:!1,ignoreDelay:!1,displayType:sd.Popover},nb=tN("[PostHog ExternalIntegrations]"),nw={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nS{constructor(e){this._instance=e}ur(e,t){var i;null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nb.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,r,n;!s||null!=(i=d.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.ur(nw[e],()=>{var i;null==(i=d.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!s&&null!=(r=d.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]&&(null==(n=d.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[r,s]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(r)}}var nE,nk,nx={},nT=0,nO=()=>{}
18,nP='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',nC="Surveys module not available",nI="sanitize_properties is deprecated. Use before_send instead",nM="Invalid value for property_denylist config: ",nR="posthog",nF=!sY&&-1===(null==h?void 0:h.indexOf("MSIE"))&&-1===(null==h?void 0:h.indexOf("Mozilla")),nD=e=>{var t;return m({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!W(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of iB)if(i===r)return!1;return!0}(null==n?void 0:n.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nO,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:a&&W(null==a?void 0:a.search)&&-1!==a.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==i||null==(t=i.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,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(e){tA.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:iF,before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nO},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:ry,ignore_text_selection:!0}
18:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e)})},nA=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],nN=e=>{var t={};for(var[i,r]of nA)V(e[i])||(t[r]=e[i]);var s=ij({},t,e),n=e.__preview_external_dependency_versioned_paths;return V(n)||(V(e.strict_script_versioning)&&(s.strict_script_versioning=!!n),W(n)&&V(e.asset_host)&&(s.asset_host=n)),q(e.property_blacklist)&&(V(e.property_denylist)?s.property_denylist=e.property_blacklist:q(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:tA.error(nM+e.property_denylist)),s};class n${constructor(){this.__forceAllowLocalhost=!1}get tn(){return this.__forceAllowLocalhost}set tn(e){tA.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class nL{rn(e,t){if(e){var i=this.nn.indexOf(e);-1!==i&&this.nn.splice(i,1)}return this.nn.push(t),null==t.initialize||t.initialize(),t}sn(){return this.config.cookieless_mode===iI||this.config.cookieless_mode===iC&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new n$,this.an=!1,this.version=f.LIB_VERSION,this.ln=new nr,this.nn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nD(),this.SentryIntegration=rW,this.sentryIntegration=e=>{var t;return t=rV(this,e),{name:rj,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.un=!1,this.hn=null,this.cn=null,this.dn=null,this.scrollManager=new ne(this),this.pageViewManager=new rH(this),this.rateLimiter=new sv(this),this.requestRouter=new ng(this),this.consent=new rr(this),this.externalIntegrations=new nS(this);var e,t=null!=(e=nL.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var r=W(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=W(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>tA.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==nR){var r,s=null!=(r=nx[i])?r:new nL;return s._init(e,t,i),nx[i]=s,nx[nR][i]=s,s}return this._init(e,t,i)}_init(e,t,r){void 0===t&&(t={});var s,n,a=W(e)?e.trim():"";if(!a)return tA.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.vn(t.debug),this.fn=t,this.pn=[],t.person_profiles?this.cn=t.person_profiles:t.process_person&&(this.cn=t.process_person);var o=nD(t.defaults),l=nN(t),u=ij({},o,l,{name:r,token:a});U(o.rageclick)&&U(l.rageclick)&&(u.rageclick=ij({},o.rageclick,l.rageclick)),this.set_config(u),this.config.on_xhr_error&&tA.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:sy.GZipJS;var c=this.gn();this.persistence=new so(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new so(m({},this.config,{persistence:"sessionStorage"}),c,!1);var h=m({},this.persistence.props),d=m({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.mn=new s8(e=>this.yn(e),this.config.request_queue_config),this.bn=new s9(this),this.__request_queue=[];var p=this.sn();if(p||(this.sessionManager=new nn(this),this.sessionPropsManager=new ni(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tA.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this._n(p)},0)):(tA.info("Initializing extensions synchronously"),this._n(p)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&tA.info("Starting in debug mode",{this:this,config:t,thisC:m({},this.config),p:h,s:d}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=m({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
18)),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var g=t.bootstrap.distinctID,v=this.get_distinct_id(),_=this.persistence.get_property(iv);if(t.bootstrap.isIdentifiedID&&null!=v&&v!==g&&_===iM)this.identify(g);else if(t.bootstrap.isIdentifiedID&&null!=v&&v!==g&&_===iR)tA.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 y=this.config.get_device_id(i1()),b=t.bootstrap.isIdentifiedID?y:g;this.persistence.set_property(iv,t.bootstrap.isIdentifiedID?iR:iM),this.register({distinct_id:g,$device_id:b})}}if(p)this.register_once({distinct_id:ik,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(i1());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(iv,iM)}return iZ(i,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||i1();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(iv,iR)),t()},s=i.user();"then"in s&&z(s.then)?s.then(r):r(s)}(e,()=>{var r;i.register((Promise&&Promise.resolve||rU.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rU.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rU.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,iN),identify:e=>r(e,iL),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.wn()):this.wn(),z(this.config._onCapture)&&this.config._onCapture!==nO&&(tA.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tA.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}_n(e){var t,i,r,s,n,a,o,l=performance.now(),u=m({},nL.__defaultExtensionClasses,this.config.__extensionClasses),c=[];u.featureFlags&&this.nn.push(this.featureFlags=null!=(t=this.featureFlags)?t:new u.featureFlags(this)),u.exceptions&&this.nn.push(this.exceptions=null!=(i=this.exceptions)?i:new u.exceptions(this)),u.historyAutocapture&&this.nn.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.nn.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.nn.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.nn.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.nn.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.nn.push(this.surveys=null!=(r=this.surveys)?r:new u.surveys(this)),u.logs&&this.nn.push(this.logs=null!=(s=this.logs)?s:new u.logs(this)),u.conversations&&this.nn.push(this.conversations=null!=(n=this.conversations)?n:new u.conversations(this)),u.productTours&&this.nn.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.nn.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.nn.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.nn.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.nn.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,rq)),u.toolbar&&this.nn.push(this.toolbar=null!=(a=this.toolbar)?a:new u.toolbar(this)),u.experiments&&this.nn.push(this.experiments=null!=(o=this.experiments)?o:new u.experiments(this)),this.nn.forEach(e
18=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.xn){var e=this.xn;this.xn=void 0,this.Qr(e)}}),this.kn(c,l)}kn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.kn(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tA.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({[ix]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iT]:r}),this.config.__preview_deferred_init_extensions&&tA.info("PostHog extensions initialized ("+r+"ms)")}Qr(e){var t;n&&n.body?(this.config.__preview_deferred_init_extensions&&(this.xn=e),this.Sn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=F(e.supportedCompression,sy.GZipJS)?sy.GZipJS:F(e.supportedCompression,sy.Base64)?sy.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.cn?this.cn:iF}),this.nn.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))):(tA.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.Qr(e)},500))}wn(){try{this.config.loaded(this)}catch(e){tA.critical("`loaded` function failed",e)}if(this.Cn(),this.config.internal_or_test_user_hostname&&null!=a&&a.hostname){var e=a.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.sn())&&this.In()},1),this.Tn=new s_(this),this.Tn.load()}Cn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.mn)||e.enable())}_dom_loaded(){this.is_capturing()&&iz(this.__request_queue,e=>this.yn(e)),this.__request_queue=[],this.Cn()}_handle_unload(){var e,t,i,r;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.En()&&this.capture(i$),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(i=this.mn)||i.unload(),null==(r=this.bn)||r.unload()):this.En()&&this.capture(i$,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(nF?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.skipIPParam||(e.url=s0(e.url,{ip:+!!this.config.ip})),e.headers=m({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(V(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,s=m({},e);s.timeout=s.timeout||6e4,s.url=s4(s.url,s.compression);var n=null!=(t=s.transport)?t:"fetch",a=s5.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),o=null!=(i=null==(r=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===n)return e[t]}(a))?void 0:r.method)?i:a[0].method;if(!o)throw Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===sy.GZipJS&&c&&!sX?s6(s).then(e=>{o(e)}).catch(t=>{O(t)?(sX=!0,o(m({},s,{compression:void 0,url:s4(e.url,void 0)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return O(e)||t===x})(t)&&(sX=!0),o(s))}):o(s)})(m({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,t),null==e.callback||e.callback(t)}}))))}yn(e){this.bn?this.bn.retriableRequest(e):this._send_request(e)}_execute_array(e){nT++;try{var t,i=[],r=[],s=[];iz(e,e=>{if(e)if(q(t=e[0]))s.push(e);else if(z(e))try{e.call(this)}catch(t){tA.error("Error executing queued PostHog call",e,t)}else q(e)&&"alias"===t?i.push(e):q(e)&&-1!==t.indexOf("capture")&&z(this[t])?s.push(e):r.push(e)});var n=function(e,t){iz(e,function(e){try{if(q(e[0])){var i=t;iU(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tA.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(r,this),n(s,this)}finally{nT--}}push(e){if(nT>0&&q(e)&&W(e[0])){var t=nL.prototype[e[0]];z(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r,s,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.mn){if(this.is_capturing())if(!V(e)&&W(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!W(null==t?void 0:t.$current_url)&&(tA.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.Mn||tA.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 c=new Date,h=(null==i?void 0:i.timestamp)||c,d=(null==i?void 0:i.uuid)||i1(),p={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},h,d)};e===iN&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==i?void 0:i.$set)&&(p.$set=null==i?void 0:i.$set);var f=null==i?void 0:i.$unset;f&&(p.$unset=f);var g,v,_,y=this.Rn(null==i?void 0:i.$set_once,e!==iq,e===iL);if(y&&(p.$set_once=y),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=p,a=e=>W(e)?e.slice(0,s):e,o=new Set,p=function e(t,i){var r;return t!==Object(t)?a?a(t):t:o.has(t)?void 0:(o.add(t),q(t)?(r=[],iz(t,t=>{r.push(e(t))})):(r={},iU(t,(t,i)=>{o.has(t)||(r[i]=e(t,i))}
18)),r)}(n)),p.timestamp=h,V(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=c),e===sc.DISMISSED||e===sc.SENT){var b=null==t?void 0:t[sh.SURVEY_ID],w=null==t?void 0:t[sh.SURVEY_ITERATION];(e=>{try{var t,i=(t=""+nm+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+nm+e.id+"_"+e.current_iteration),t);if(localStorage.getItem(i))return;localStorage.setItem(i,"true")}catch(e){nv.error("Failed to persist survey seen state",e)}})({id:b,current_iteration:w}),p.$set=m({},p.$set,{[(g={id:b,current_iteration:w},_="$survey_"+(v=e===sc.SENT?"responded":"dismissed")+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(_="$survey_"+v+"/"+g.id+"/"+g.current_iteration),_)]:!0})}else e===sc.SHOWN&&(p.$set=m({},p.$set,{[sh.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===sp.SHOWN){var S=null==t?void 0:t[sf.TOUR_TYPE];S&&(p.$set=m({},p.$set,{[sf.TOUR_LAST_SEEN_DATE+"/"+S]:(new Date).toISOString()}))}var E=m({},p.properties.$set,p.$set);if(j(E)||this.setPersonPropertiesForFlags(E),!B(this.config.before_send)){var k=this.Pn(p);if(!k)return;p=k}this.ln.emit("eventCaptured",p);var x={method:"POST",url:null!=(r=null==i?void 0:i._url)?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.yn(x):this.mn.enqueue(x),p}tA.critical("This capture call is ignored due to client rate limiting.")}}else tA.error("No event name provided to posthog.capture")}else tA.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,r,s,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var l,u=o?void 0:this.persistence.remove_event_timer(e),c=m({},t);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.sn()&&(c.$cookieless_mode=!0),"$snapshot"===e){var d=m({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=d.distinct_id,(!W(c.distinct_id)&&!Z(c.distinct_id)||H(c.distinct_id))&&tA.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var p,g=function(e,t,r){if(!h)return{};var s,n,o,l,u,c,d,p,g,v,m,_,y=e?[...r1,...t||[]]:[],[b,w]=function(e){for(var t=0;te.length>t;t++){var[i,r]=te[t],s=i.exec(e),n=s&&(z(r)?r(s,e):r);if(n)return n}return["",""]}(h),S=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},E={detectGoogleSearchApp:r},k=ij(iG({$os:b,$os_version:w,$browser:e8(h,navigator.vendor,S,E),$device:tt(h),$device_type:(d={userAgentDataPlatform:null==(s=navigator)||null==(s=s.userAgentData)?void 0:s.platform,maxTouchPoints:null==(n=navigator)?void 0:n.maxTouchPoints,screenWidth:null==i||null==(o=i.screen)?void 0:o.width,screenHeight:null==i||null==(l=i.screen)?void 0:l.height,devicePixelRatio:null==i?void 0:i.devicePixelRatio},(_=tt(h))===ep||_===ed||"Kobo"===_||"Kindle Fire"===_||_===eV?eh:_===eR||_===eD||_===eF||_===ez?"Console":_===eg?"Wearable":_?eu:"Android"===(null==d?void 0:d.userAgentDataPlatform)&&(null!=(p=null==d?void 0:d.maxTouchPoints)?p:0)>0?600>Math.min(null!=(g=null==d?void 0:d.screenWidth)?g:0,null!=(v=null==d?void 0:d.screenHeight)?v:0)/(null!=(m=null==d?void 0:d.devicePixelRatio)?m:1)?eu:eh:"Desktop"),$timezone:sr(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rJ(null==a?void 0:a.href,y,r3),$host:null==a?void 0:a.host,$pathname:null==a?void 0:a.pathname,$raw_user_agent:h.length>1e3?h.substring(0,997)+"...":h,$browser_version:e9(h,navigator.vendor,S,E),$browser_language:r7(),$browser_language_prefix:"string"==typeof(c=r7())?c.split("-")[0]:void 0,$screen_height:null==i?void 0:i.screen.height,$screen_width:null==i?void 0:i.screen.width,$viewport_height:null==i?void 0:i.innerHeight,$viewport_width:null==i?void 0:i.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f.SDK_DIST_CHANNEL&&(k.$sdk_dist_channel=f.SDK_DIST_CHANNEL),k}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app);if(this.sessionManager){var{sessionId:v,windowId:_}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());c.$session_id=v,c.$window_id=_}this.sessionPropsManager&&ij(c,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&ij(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=null==(l=this.bn)?void 0:l.length}catch(e){c.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nd&&(c.$lib_custom_api_host=this.config.api_host),p=e!==iN||o?e!==i$||o?this.pageViewM
18anager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),c=ij(c,p),e===iN&&n&&(c.title=n.title),!V(u)){var y=r.getTime()-u;c.$duration=parseFloat((y/1e3).toFixed(3))}h&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=ij({},g,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),q(this.config.property_denylist)?iU(this.config.property_denylist,function(e){delete c[e]}):tA.error(nM+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tA.error(nI),c=b(c,e));var w=this.On();return c.$process_person_profile=w,w&&!o&&this.Ln("_calculate_event_properties"),c}Rn(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.On()||this.an&&!i)return e;var r,s=ij({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tA.error(nI),s=n(s,"$set_once")),t&&(this.an=!0),j(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Fn(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var r;null==(r=this.featureFlags)||r.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.ln.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:nC}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:nC})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:nC})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=ny),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:nC}}canRenderSurveyAsync(e,t){var i,r;return void 0===t&&(t=!1),null!=(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:nC})}An(e){return!e||H(e)?(tA.critical("Unique user id has not been set in posthog.identify"),!1):e===ik?(tA.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(tA.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return tA.uninitializedWarning("posthog.identify");if(Z(e)&&(e=e.toString(),tA.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.An(e)&&this.Ln("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tz)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(tU)&&(this.unregister(tU),this.register({distinct_id:e}));var s,n=(this.persistence.get_property(iv)||iM)===iM;e!==r&&n?(this.persistence.set_property(iv,iR),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(iL,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.dn=nl(e,t,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(ih))}}setPersonProperties(e,t){if((e||t)&&this.Ln("posthog.setPersonProperties")){var i=nl(this.get_distinct_id(),e,t);this.dn!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.dn=i):tA.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(q(e)?e:[e]).filter(e=>W(e)&&e.length>0);0!==i.length&&this.Ln("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.dn=null)}group(e,t,i){if(e&&t){var r=this.getGroups(),s=r[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:m({},r,{[e]:t})}),s||i){var n={$group_type:e,$group_key:t};
18i&&(n.$group_set=i),this.capture(iq,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else tA.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.Ln("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(tA.info("reset"),!this.__loaded)return tA.uninitializedWarning("posthog.reset");var t,i,r,s,n,a,o,l,u,c=this.get_property(tz),h=this.get_property(tJ);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),V(h)||null==(u=this.persistence)||u.register({[tJ]:h}),null==(r=this.surveys)||r.reset(),null==(s=this.Tn)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(a=this.conversations)||a.reset(),null==(o=this.persistence)||o.set_property(iv,iM),null==(l=this.sessionManager)||l.resetSessionId(),this.dn=null,this.config.cookieless_mode===iI)this.register_once({distinct_id:ik,$device_id:null},"");else{var d=this.config.get_device_id(i1());this.register_once({distinct_id:d,$device_id:e?d:c},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.Nn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Dn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var s,n=null!=(s=e.timestampLookBack)?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(e,t){return e===this.get_property(tq)?(tA.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ln("posthog.alias")?(V(t)&&(t=this.get_distinct_id()),e!==t?(this.Fn(tU,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tA.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=m({},this.config);if(U(e)){ij(this.config,nN(e));var i,r,s,n,a,o,l,u,c,h,d,p=this.gn();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new so(m({},this.config,{persistence:"sessionStorage"}),p,!1);var g=this.vn(this.config.debug);Q(g)&&(this.config.debug=g),Q(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,i8.O()&&i8.N("ph_debug",!0),tA.info("set_config",{config:e,oldConfig:t,newConfig:m({},this.config)})):(f.DEBUG=!1,i8.O()&&i8.q("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this.$n(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,i,r,s,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(m({},r,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:nL.qn}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:nR;return t!==nR&&(t=nR+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iv))===iR||(null==(t=this.sessionPersistence)?void 0:t.get_property(iv))===iR}On(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iF&&!this._isIdentified()&&j(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tU])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iS]))}En(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.On()||this.Ln("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Ln("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Ln(e){return"never"===this.config.person_profiles?(tA.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Fn(iS,!0),!0)}gn(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==iC)}$n(){var e,t,i,r,s=this.gn();return(null==(e=this.persistence)?void 0:e.Tr)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.Tr)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iI){if(this.sn()){this.reset(!0),null==(s=this.sessionManager)||s.destroy(),null==(n=this.pageViewM
18anager)||n.destroy(),this.sessionManager=new nn(this),this.pageViewManager=new rH(this),this.persistence&&(this.sessionPropsManager=new ni(this,this.sessionManager,this.persistence));var i,r,s,n,a,o,l,u,c=null!=(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)?a:null==(l=nL.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this.rn(this.sessionRecording,new c(this)),this.Sn&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.Sn)))}this.consent.optInOut(!0),this.$n(),this.Cn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iC&&(null==(i=this.surveys)||i.loadIfEnabled()),(V(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(r=null==e?void 0:e.captureEventName)?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.In()}else tA.warn(nP)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iI?(this.config.cookieless_mode===iC&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.$n(),this.config.cookieless_mode===iC&&(this.register({distinct_id:ik,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.In(),this.Cn())):tA.warn(nP)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===iI||(this.config.cookieless_mode===iC?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.$n()}_is_bot(){return s?na(s,this.config.custom_blocked_useragents):void 0}In(){n&&("visible"===n.visibilityState?this.un||(this.un=!0,this.capture(iN,{title:n.title},{send_instantly:!0}),this.hn&&(n.removeEventListener(iD,this.hn),this.hn=null)):this.hn||(this.hn=this.In.bind(this),iZ(n,iD,this.hn)))}debug(e){!1===e?(null==i||i.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==i||i.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}))}Kr(){var e,t,i,r,s=this.fn||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(tA.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in s&&!B(s[e]),r=t in s&&!B(s[t]),i?s[e]:!!r&&(tA&&tA.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}Pn(e){if(B(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(J),r=q(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var n of r){if(B(s=n(s))){var a="Event '"+e.event+"' was rejected in beforeSend function";return Y(e.event)?tA.warn(a+". This can cause unexpected behavior."):tA.info(a),null}s.properties&&!j(s.properties)||tA.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(s.properties&&B(s.properties[o]))return tA.warn("Event '"+e.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return null==(e=this.pageViewManager.dr)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}vn(e){var t=Q(e)&&!e,i=i8.O()&&"true"===i8.A("ph_debug");return!t&&(!!i||e)}}nL.__defaultExtensionClasses={},nL.qn={trace:nk=()=>{},debug:nk,info:nk,warn:nk,error:nk,fatal:nk},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=iH(e.prototype[t[i]])}(nL,["identify"]);
18class nq{constructor(e){this.disabled=!1===e;var t=U(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var nz="$copy_autocapture",nU=tN("[AutoCapture]");function nj(e,t){return t.length>e?t.slice(0,e)+"...":t}var nV=tN("[ExceptionAutocapture]"),nW=tN("[TracingHeaders]"),nH=tN("[Web Vitals]"),nG="disabled",nB="lazy_loading",nZ="awaiting_config",nK="missing_config";tN("[SessionRecording]"),tN("[SessionRecording]");var nQ="[SessionRecording]",nY=tN(nQ),nJ=tN("[Heatmaps]");function nX(e){return U(e)&&"clientX"in e&&"clientY"in e&&Z(e.clientX)&&Z(e.clientY)}var n0=tN("[Product Tours]"),n1=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(tQ))},n2=["$set_once","$set"],n3=tN("[SiteApps]"),n6="Error while initializing PostHog app with config id ";function n4(e,t,i){if(B(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class n5{constructor(e){this.jn=new nr,this.Bn=(e,t)=>this.Hn(e,t)&&this.Un(e,t)&&this.zn(e,t)&&this.Vn(e,t),this.Hn=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Wn=new Set,this.Gn=new Set}init(){var e,t;V(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!V(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.Gn)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Wn)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Wn.has(e)||this.Wn.has(null==t?void 0:t.event))&&this.Gn&&(null==(i=this.Gn)?void 0:i.size)>0&&this.Gn.forEach(e=>{this.Zn(t,e)&&this.jn.emit("actionCaptured",e.name)})}Qn(e){this.onAction("actionCaptured",t=>e(t))}Zn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Bn(e,i))return!0;return!1}onAction(e,t){return this.jn.on(e,t)}Un(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!n4(r,t.url,t.url_matching||"contains"))return!1}return!0}zn(e,t){return!!this.Jn(e,t)&&!!this.Kn(e,t)&&!!this.Yn(e,t)}Jn(e,t){if(null==t||!t.href)return!0;var i=this.Xn(e);if(i.length>0)return i.some(e=>n4(e.href,t.href,t.href_matching||"exact"));var r,s,n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!n&&n4((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}Kn(e,t){if(null==t||!t.text)return!0;var i=this.Xn(e);if(i.length>0)return i.some(e=>n4(e.text,t.text,t.text_matching||"exact")||n4(e.$el_text,t.text,t.text_matching||"exact"));var r,s,n,a,o=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!o&&(s=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!B(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",s.some(e=>n4(e,n,a)))}Yn(e,t){if(null==t||!t.selector)return!0;var i,r,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=s&&s.includes(t.selector))return!0;var n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}Xn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Vn(e,t){return null==t||!t.properties||0===t.properties.length||nh(t.properties.reduce((e,t)=>
18{var i=q(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class n8{constructor(e){this._instance=e,this.es=new Map,this.ts=new Map,this.rs=new Map}ns(e,t){return!!e&&nh(e.propertyFilters,null==t?void 0:t.properties)}ss(e,t){var i=new Map;return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null!=t&&t.name){var r=i.get(t.name)||[];r.push(e.id),i.set(t.name,r)}})}),i}os(e,t,i){var r=(i===sl.Activation?this.es:this.ts).get(e),s=[];return this.ls(e=>{s=e.filter(e=>null==r?void 0:r.includes(e.id))}),s.filter(r=>{var s,n=null==(s=r.conditions)||null==(s=s[i])||null==(s=s.values)?void 0:s.find(t=>t.name===e);return this.ns(n,t)})}register(e){var t;V(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.us(e),this.hs(e))}hs(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.cs&&(this.cs=new n5(this._instance),this.cs.init(),this.cs.Qn(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.cs)||s.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.rs.get(t.name);i&&i.push(e.id),this.rs.set(t.name,i||[e.id])}}))}))}us(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});0===i.length&&0===r.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.es=this.ss(e,sl.Activation),this.ts=this.ss(e,sl.Cancellation))}onEvent(e,t){var i,r=this.le(),s=this.ds(),n=this.vs(),a=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[s])||[];if(n===e&&t&&a.length>0){r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:a});var o,l,u=(null==t||null==(o=t.properties)?void 0:o.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(u){var c=a.indexOf(u);0>c||(a.splice(c,1),this.fs(a))}}else{if(this.ts.has(e)){var h=this.os(e,t,sl.Cancellation);h.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:h.map(e=>e.id)}),h.forEach(e=>{var t=a.indexOf(e.id);0>t||a.splice(t,1),this.ps(e.id)}),this.fs(a))}if(this.es.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.es.get(e)});var d=this.os(e,t,sl.Activation);this.fs(a.concat(d.map(e=>e.id)||[]))}}}onAction(e){var t,i=this.ds(),r=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[i])||[];this.rs.has(e)&&this.fs(r.concat(this.rs.get(e)||[]))}fs(e){var t=this.le(),i=[...new Set(e)].filter(e=>!this.gs(e));t.info("updating activated items",{activatedItems:i}),this.ys(i)}getActivatedIds(){var e,t=this.ds();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.es}bs(){return this.cs}}class n7 extends n8{constructor(e){super(e)}ds(){return iu}vs(){return sc.SHOWN}ls(e){var t;null==(t=this._instance)||t.getSurveys(e)}ps(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}le(){return nv}ys(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iu]:e})}gs(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var n9="SDK is not enabled or survey functionality is not yet loaded",ae="Disabled. Not loading surveys.",at=null!=i&&i.location?rX(i.location.hash,"__posthog")||rX(location.hash,"state"):null,ai="_postHogToolbarParams",ar=tN("[Toolbar]"),as=tN("[FeatureFlags]"),an=tN("[FeatureFlags]",{debugEnabled:!0}),aa="\" failed. Feature flags didn't load in time.",ao=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},al=e=>{var t={};for(var[i,r]of iV(e||{}))r&&(t[i]=r);return t},au=tN("[Error tracking]"),ac="Refusing to render web experiment since the viewer is a likely bot",ah={icontains:(e,t)=>!!i&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!i&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!i&&no(t.href,e),not_regex:(e,t)=>!!i&&!no(t.href,e),exact:(e,t)=>
18t.href===e,is_not:(e,t)=>t.href!==e};class ad{get qt(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{ad._s("retrieved web experiments from the server"),t.ws=new Map,e.forEach(e=>{if(e.feature_flag_key){t.ws&&(ad._s("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.ws)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);W(r)&&e.variants[r]&&t.xs(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];ad.ks(n)&&t.xs(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())ad._s(ac);else if(!this.qt.disable_web_experiments){if(B(this.ws))return this.ws=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ad._s("applying feature flags",e),e.forEach(e=>{var t;if(this.ws&&null!=(t=this.ws)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.ws)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.xs(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=ad.getWindowLocation();if(null!=e&&e.search){var t=rY(null==e?void 0:e.search,"__experiment_id"),i=rY(null==e?void 0:e.search,"__experiment_variant");t&&i&&(ad._s("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Ss(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.qt.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qt.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Ss(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(ad._s("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.xs(r[0].name,t,r[0].variants[t].transforms))}static ks(e){return!B(e.conditions)&&ad.Cs(e)&&ad.Is(e)}static Cs(e){if(B(e.conditions)||B(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,r,s,n=ad.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||ah[null!=(r=null==(s=e.conditions)?void 0:s.urlMatchType)?r:"icontains"](e.conditions.url,n))}
18static getWindowLocation(){return null==i?void 0:i.location}static Is(e){if(B(e.conditions)||B(null==(i=e.conditions)?void 0:i.utm))return!0;var t=r4();if(t.utm_source){var i,r,s,n,a,o,l,u,c,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,f=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return h&&p&&f&&d}return!1}static _s(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];tA.info("[WebExperiments] "+e,i)}xs(e,t,i){this._is_bot()?ad._s(ac):"control"!==t?i.forEach(i=>{if(i.selector){ad._s("applying transform of variant "+t+" for experiment "+e+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):ad._s("Control variants leave the page unmodified.")}_is_bot(){return s&&this._instance?na(s,this.qt.custom_blocked_useragents):void 0}}var ap=tN("[Conversations]"),af="Conversations not available yet.",ag={featureFlags:class{constructor(e){this.Ts=!1,this.Es=!1,this.Ms=!1,this.Rs=!1,this.Ps=!1,this.Os=!1,this.Ls=!1,this.Fs=!1,this._instance=e,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get Si(){return this._instance.persistence}As(e){return this._instance.get_property(e)}Ns(){var e,t;return null!=(e=null==(t=this.Si)?void 0:t.Mr(this.qt.feature_flag_cache_ttl_ms))&&e}Ds(){return!!this.Ns()&&(this.Fs||this.Ms||(this.Fs=!0,as.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}$s(){var e,t=null!=(e=this.qt.evaluation_contexts)?e:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.Ls||(as.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Ls=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||as.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}qs(){return this.$s().length>0}js(){var e=this.qt.flag_keys;if(!V(e)){if(q(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||as.error("Invalid flag key found:",e,"Expected non-empty string"),t});as.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:i}=this._instance,r=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(r).length){var s,n,a=null!=(s=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?s:{},o=Object.keys(r).filter(e=>!!r[e]).reduce((e,t)=>(e[t]=r[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(a[t]&&(e[t]=a[t]),e),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var r=null!=i&&i.merge?this.getFlagVariants():{},s=null!=i&&i.merge?this.getFlagPayloads():{},n=m({},r,e),a=m({},s,t),o={};for(var[l,u]of Object.entries(n)){var c="string"==typeof u;o[l]={key:l,enabled:!!c||!!u,variant:c?u:void 0,reason:void 0,metadata:V(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.receivedFeatureFlags({flags:o})}get hasLoadedFlags(){return this.Es}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.As(t9),t=this.As(ii),i=this.As(ir);if(!i&&!t)return e||{};var r=ij({},e||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=r[s],l=null==t?void 0:t[s],u=V(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,c=V(l)?o.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[s],d=m({},o,{enabled:u,variant:u?null!=c?c:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),c!==(null==o?void 0:o.variant)&&(
18d.original_variant=null==o?void 0:o.variant),h&&(d.metadata=m({},null==o?void 0:o.metadata,{payload:h,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),r[s]=d}return this.Ts||(as.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.Ts=!0),r}getFlagVariants(){var e=this.As(t5),t=this.As(ii);if(!t)return e||{};for(var i=ij({},e),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.Ts||(as.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Ts=!0),i}getFlagPayloads(){var e=this.As(ie),t=this.As(ir);if(!t)return e||{};for(var i=ij({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.Ts||(as.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Ts=!0),i}reloadFeatureFlags(){this.Rs||this.qt.advanced_disable_feature_flags||this.Bs||(this._instance.ln.emit("featureFlagsReloading",!0),this.Bs=setTimeout(()=>{this.Hs()},5))}Us(){clearTimeout(this.Bs),this.Bs=void 0}ensureFlagsLoaded(){this.Es||this.Ms||this.Bs||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Rs=e}Hs(e){var t;if(this.Us(),!this._instance.Kr())if(this.Ms)this.Ps=!0;else{var i=this.qt.token,r=this.As(tz),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:m({},(null==(t=this.Si)?void 0:t.get_initial_props())||{},this.As(is)||{}),group_properties:this.As(ia),timezone:sr()};G(r)||V(r)||(s.$device_id=r),(null!=e&&e.disableFlags||this.qt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.qs()&&(s.evaluation_contexts=this.$s());var n=this.js();V(n)||(s.flag_keys=n);var a=!!this.qt.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Ms=!0,this._instance._send_request({method:"POST",url:o,data:s,skipIPParam:!0,compression:this.qt.disable_compression?void 0:sy.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,n=!0;if(200===e.statusCode&&(this.Ps||(this.$anon_distinct_id=void 0),n=!1),this.Ms=!1,!s.disable_flags||this.Ps){this.Os=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(u&&o.push("quota_limited"),null==(r=this.Si)||r.register({[ip]:o}),u)?as.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(null!=(l=e.json)?l:{},n,{partialResponse:a}),this.Ps&&(this.Ps=!1,this.Hs()))}}})}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.Os)if(this.Es||this.getFlags()&&this.getFlags().length>0){if(!this.Ds()){var r=this.getFeatureFlagResult(e,t);return null!=(i=null==r?void 0:r.variant)?i:null==r?void 0:r.enabled}}else as.warn('getFeatureFlag for key "'+e+aa)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.Os)if(this.Es||this.getFlags()&&this.getFlags().length>0){if(!this.Ds()){var i=this.getFlagVariants(),r=e in i,s=i[e],n=this.getFlagPayloads()[e],a=String(s),o=this.As(it)||void 0,l=this.As(ig)||void 0,u=this.As(ih)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var c,h=this._instance.get_session_id(),d=this.As(id);h&&h!==d&&(u={},null==(c=this.Si)||c.register({[ih]:u,[id]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(a))){q(u[e])?u[e].push(a):u[e]=[a],null==(v=this.Si)||v.register({[ih]:u});var p=this.getFeatureFlagDetails(e),f=[...null!=(m=this.As(ip))?m:[]];V(s)&&f.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(_=this.qt.bootstrap)||null==(_=_.featureFlags)?void 0:_[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.qt.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.Os};V(null==p||null==(b=p.metadata)?void 0:b.version)||(g.$feature_flag_version=p.metadata.version);var v,m,_,y,b,w,S,E,k,x,T,O=null!=(w=null==p||null==(S=p.reason)?void 0:S.description)?w:null==p||null==(E=p.reason)?void 0:E.
18code;O&&(g.$feature_flag_reason=O),null!=p&&null!=(k=p.metadata)&&k.id&&(g.$feature_flag_id=p.metadata.id),V(null==p?void 0:p.original_variant)&&V(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=V(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(x=p.metadata)&&x.original_payload&&(g.$feature_flag_original_payload=null==p||null==(T=p.metadata)?void 0:T.original_payload),f.length&&(g.$feature_flag_error=f.join(",")),this._instance.capture("$feature_flag_called",g)}if(r){var P=n;if(!V(n))try{P=JSON.parse(n)}catch(e){}return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:P}}}}else as.warn('getFeatureFlagResult for key "'+e+aa)}getRemoteConfigPayload(e,t){var i=this.qt.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.qs()&&(r.evaluation_contexts=this.$s());var s=this.js();V(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,skipIPParam:!0,compression:this.qt.disable_compression?void 0:sy.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback(i){var r,s=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.Os){if(this.Es||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return V(i)?void 0:!!i}as.warn('isFeatureEnabled for key "'+e+aa)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.Si){this.Es=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,r,s,n){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var a,o=((a=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(a).map(e=>{var t;return[e,null!=(t=a[e].variant)?t:a[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(a).filter(e=>a[e].enabled).filter(e=>{var t;return null==(t=a[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=a[e].metadata)?void 0:t.payload]}))):as.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=o.flags,u=o.featureFlags,c=o.featureFlagPayloads;if(u){var h=e.requestId,d=e.evaluatedAt;if(q(u)){as.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var f=0;u.length>f;f++)p[u[f]]=!0;t&&t.register({[t8]:u,[t5]:p})}else{var g=u,v=c,_=l;if(null!=n&&n.partialResponse)g=m({},i,g),v=m({},r,v),_=m({},s,_);else if(e.errorsWhileComputingFlags)if(l){var y=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));g=m({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return y.has(t)}))),v=m({},r,Object.fromEntries(Object.entries(v||{}).filter(e=>{var[t]=e;return y.has(t)}))),_=m({},s,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return y.has(t)})))}else g=m({},i,g),v=m({},r,v),_=m({},s,_);t&&t.register(m({[t8]:Object.keys(al(g)),[t5]:g||{},[ie]:v||{},[t9]:_||{}},h?{[it]:h}:{},d?{[ig]:d}:{}))}}}(e,this.Si,r,s,n,i),t||(this.Fs=!1),this.zs(t)}}override(e,t){void 0===t&&(t=!1),as.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Si)return as.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.Si.unregister(ii),this.Si.unregister(ir),this.zs(),an.info("All overrides cleared");if(q(e)){var t,i=ao(e);return this.Si.register({[ii]:i}),this.zs(),an.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.Ts=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.Si.unregister(ii),an.info("Flag overrides cleared");else if(e.flags){if(q(e.flags)){var r=ao(e.flags);this.Si.register({[ii]:r})}else this.Si.register({[ii]:e.flags});an.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.Si.unregister(ir),an.info("Payload overrides cleared")):e.payloads&&(this.Si.register({[ir]:e.payloads}),an.info("Payload overrides set",{payloads:e.payloads}))),void this.zs()}if(e&&"object"==typeof e)return this.Si.register({[ii]:e}),this.zs(),an.info("Flag overrides set",{flags:e});as.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Es){var{flags:t,flagVariants:i}=this.Vs();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this.As(t7)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=m({},this.getFlagVariants(),{[e]:t});null==(r=this.Si)||r.register({[t8]:Object.keys(al(o)),[t5]:o}),this.zs()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this.As(t7),s=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.qt.token+s),method:"GET",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this.Si)||i.unregister(t7),null==(r=this.Si)||r.register({[t7]:s}),e(s)}}})}Vs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}zs(e){var{flags:t,flagVariants:i}=this.Vs();
18this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.As(is)||{},r=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,n={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(n[a]=s[a]));this._instance.register({[is]:m({},i,n,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=m({},this.As(is)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[is]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(is),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.As(ia)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=m({},i[t],e[t]),delete e[t]}),this._instance.register({[ia]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.As(ia)||{};this._instance.register({[ia]:m({},t,{[e]:{}})})}else this._instance.unregister(ia)}reset(){this.Es=!1,this.Ms=!1,this.Rs=!1,this.Ps=!1,this.Os=!1,this.$anon_distinct_id=void 0,this.Us(),this.Ts=!1}}},av=m({productTours:class{get Si(){return this._instance.persistence}constructor(e){this.ia=null,this.na=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,i;if(this.Si&&this.Si.register({[tQ]:!!e.productTours}),!n1(this._instance))return!this.ia&&B(null==(t=this.Si)?void 0:t.props[ic])||n0.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.ia)||i.stop(),this.ia=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.ia&&n1(this._instance)&&this.ur(()=>this.sa())}ur(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?n0.error("Could not load product tours script",t):e()})}sa(){var e;!this.ia&&null!=(e=d.__PosthogExtensions__)&&e.generateProductTours&&(this.ia=d.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!q(this.na)||t){var i=this.Si;if(i){var r=i.props[ic];if(q(r)&&!t)return this.na=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:t=>{if(n1(this._instance)){var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return n0.error(s),void e([],{isLoaded:!1,error:s})}var n=q(t.json.product_tours)?t.json.product_tours:[];this.na=n,i&&i.register({[ic]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.na,{isLoaded:!0})}getActiveProductTours(e){B(this.ia)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.ia.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.ia)||t.showTourById(e)}previewTour(e){this.ia?this.ia.previewTour(e):this.ur(()=>{var t;this.sa(),null==(t=this.ia)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.ia)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.ia)||e.nextStep()}previousStep(){var e;null==(e=this.ia)||e.previousStep()}clearCache(){var e;this.na=null,null==(e=this.Si)||e.unregister(ic)}resetTour(e){var t;null==(t=this.ia)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.ia)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.ia)||t.cancelPendingTour(e)}}},ag),am=m({surveys:class{get qt(){return this._instance.config}constructor(e){this.ga=void 0,this._surveyManager=null,this.ma=!1,this.ya=[],this.ba=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qt.disable_surveys){var t=e.surveys;if(B(t))return nv.warn("Flags not loaded yet. Not loading surveys.");var i=q(t);this.ga=i?t.length>0:t,nv.info("flags response received, isSurveysEnabled: "+this.ga),this.loadIfEnabled()}}reset(){try{localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(nm)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}
18e.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.ma)nv.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)nv.info(ae);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())nv.info("Not loading surveys in cookieless mode without consent.");else{var e=null==d?void 0:d.__PosthogExtensions__;if(e){if(!V(this.ga)||this.qt.advanced_enable_surveys){var t=this.ga||this.qt.advanced_enable_surveys;this.ma=!0;try{var i=e.generateSurveys;if(i)return void this._a(i,t);var r=e.loadExternalDependency;if(!r)return void this.wa(iP);r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.wa("Could not load surveys script",i):this._a(e.generateSurveys,t)})}catch(e){throw this.wa("Error initializing surveys",e),e}finally{this.ma=!1}}}else nv.error("PostHog Extensions not found.")}}_a(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new n7(this._instance),nv.info("Surveys loaded successfully"),this.xa({isLoaded:!0})}wa(e,t){nv.error(e,t),this.xa({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ya.push(e),this._surveyManager&&this.xa({isLoaded:!0}),()=>{this.ya=this.ya.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.qt.disable_surveys)return nv.info(ae),e([]);var i,r=this._instance.get_property(io);if(r&&!t)return e(r,{isLoaded:!0});"u">typeof Promise&&this.ba?this.ba.then(t=>{var{surveys:i,context:r}=t;return e(i,r)}):("u">typeof Promise&&(this.ba=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qt.token),method:"GET",timeout:this.qt.surveys_request_timeout_ms,callback:t=>{this.ba=null;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;nv.error(s);var n={isLoaded:!1,error:s};return e([],n),void(null==i||i({surveys:[],context:n}))}var a,o,l=t.json.surveys||[],u=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(a=this._instance.persistence)||a.register({[io]:l,[il]:Date.now()});var c={isLoaded:!0};e(l,c),null==i||i({surveys:l,context:c})}}))}xa(e){for(var t of this.ya)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){nv.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!B(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);nv.warn("init was not called")}ka(e){var t=null;return this.getSurveys(i=>{var r;t=null!=(r=i.find(t=>t.id===e))?r:null}),t}Sa(e){if(B(this._surveyManager))return{eligible:!1,reason:n9};var t="string"==typeof e?this.ka(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(B(this._surveyManager))return nv.warn("init was not called"),{visible:!1,disabledReason:n9};var t=this.Sa(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return B(this._surveyManager)?(nv.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:n9})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!=(r=t.find(t=>t.id===e))?r:null;if(s){var n=this.Sa(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(B(this._surveyManager))nv.warn("init was not called");else{var s="string"==typeof e?this.ka(e):e;if(null!=s&&s.id)if(n_.includes(s.type)){var a=null==n?void 0:n.querySelector(t);if(a)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(nv.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;nv.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,a,i),nv.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,a,i);nv.warn("Survey element not found")}else nv.warn("Surveys of type "+s.type+" cannot be rendered in the app");else nv.warn("Survey not found")}}displaySurvey(e,t){var i;if(B(this._surveyManager))nv.warn("init was not called");else{var r=this.ka(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=m({},r,{appearance:m({},r.appearance,{surveyPopupDelaySeconds:0})}
18)),t.displayType!==sd.Popover&&t.initialResponses&&nv.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void nv.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==sd.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else nv.warn("Survey not found")}}cancelPendingSurvey(e){B(this._surveyManager)?nv.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},ag),a_=m({experiments:ad},ag),ay=m({},ag,{sessionRecording:class{get qt(){return this._instance.config}get Si(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Ws)||!e.isStarted)}get status(){var e,t;return this.Gs===nZ||this.Gs===nK?this.Gs:null!=(e=null==(t=this.Ws)?void 0:t.status)?e:this.Gs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Gs=nG,this.Zs=void 0,this._instance=e,!this._instance.sessionManager)throw nY.error("started without valid sessionManager"),Error(nQ+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===iI)throw Error(nQ+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Qs(){var e,t=!(null==(e=this._instance.get_property(tJ))||!e.enabled),r=!this.qt.disable_session_recording,s=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return i&&t&&r&&!s}startIfEnabledOrStop(e){var t;if(!this.Qs||null==(t=this.Ws)||!t.isStarted){var i=!V(Object.assign)&&!V(Array.from);this.Qs&&i?(this.Js(e),nY.info("starting")):(this.Gs=nG,this.stopRecording())}}Js(e){var t,i,r;this.Qs&&(this.Gs!==nZ&&this.Gs!==nK&&(this.Gs=nB),null!=d&&null!=(t=d.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=d.__PosthogExtensions__)&&i.initSessionRecording?this.Ks(e):null==(r=d.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Ys,t=>{if(t)return nY.error("could not load recorder",t);this.Ks(e)}))}stopRecording(){var e,t;null==(e=this.Zs)||e.call(this),this.Zs=void 0,null==(t=this.Ws)||t.stop()}Xs(){var e,t;null==(e=this.Zs)||e.call(this),this.Zs=void 0,null==(t=this.Ws)||t.discard()}eo(){var e,t;null==(e=this.Si)||e.unregister(t4),null==(t=this.Si)||t.unregister(tX)}ro(e,t){if(B(e))return null;var i=Z(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(nY.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}io(e){if(this.Si){var t,i,r=this.Si,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.ro(null==(t=this.qt.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.ro(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:n;B(a)&&this.eo();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[tJ]:m({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:m({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:V(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.Zs)||t.call(this),this.Zs=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.io(e),void this.Xs()):(this.io(e),void this.startIfEnabledOrStop()):(this.Gs===nZ&&(this.Gs=nK,nY.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.Ws)&&i.log?this.Ws.log(e,t):nY.warn("log called before recorder was ready")}get Ys(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(tJ);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}no(){var e,t,i=this._instance.get_property(tJ);if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}
18catch(e){return nY.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var r=null!=(e=t.cache_timestamp)?e:Date.now();return 36e5>=Date.now()-r}Ks(e){var t,i;if(null==(t=d.__PosthogExtensions__)||!t.initSessionRecording)return nY.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iO]:!0});if(this.Ws||(this.Ws=null==(i=d.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Ws._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.no()){if(this.Gs===nK||this.Gs===nZ)return;return this.Gs=nZ,nY.info("persisted remote config is stale, requesting fresh config before starting"),void new s_(this._instance).load()}this.Gs=nB,this.Ws.start(e)}onRRwebEmit(e){var t;null==(t=this.Ws)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Ws||null==(t=this.Si)||t.register({[t1]:!0}),null==(e=this.Ws)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Ws||null==(t=this.Si)||t.register({[t0]:!0}),null==(e=this.Ws)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Ws||null==(i=this.Si)||i.register({["url"===e?t2:t3]:!0}),null==(t=this.Ws)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Ws)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Ws)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.so=!1,this.oo=null,this.ao=!1,this.instance=e,this.rageclicks=new nq(e.config.rageclick),this.lo=null}initialize(){this.startIfEnabled()}get qt(){var e,t,i=U(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}uo(){if(this.isBrowserSupported()){if(i&&n){var e=e=>{e=e||(null==i?void 0:i.event);try{this.ho(e)}catch(e){nU.error("Failed to capture event",e)}};if(iZ(n,"submit",e,{capture:!0}),iZ(n,"change",e,{capture:!0}),iZ(n,"click",e,{capture:!0}),this.qt.capture_copied_text){var t=e=>{e=e||(null==i?void 0:i.event);try{this.ho(e,nz)}catch(e){nU.error("Failed to capture copy/cut event",e)}};iZ(n,"copy",t,{capture:!0}),iZ(n,"cut",t,{capture:!0})}}}else nU.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.so&&(this.uo(),this.so=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.ao=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tV]:!!e.autocapture_opt_out}),this.oo=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.lo=e}getElementSelectors(e){var t,i=[];return null==(t=this.lo)||t.forEach(t=>{var r=null==n?void 0:n.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[tV];if(G(this.oo)&&!Q(i)&&!this.instance.Kr())return!1;var r=null!=(t=this.oo)?t:!!i;return!!this.instance.config.autocapture&&!r}ho(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,s=rf(e);ro(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&rE(s,this.instance.config.rageclick)&&this.ho(e,"$rageclick");var n=t===nz;if(s&&function(e,t,r,s,n){if(void 0===r&&(r=void 0),!i||rk(e)||null!=(a=r)&&a.url_allowlist&&!rc(r.url_allowlist)||null!=(o=r)&&o.url_ignorelist&&rc(r.url_ignorelist))return!1;if(null!=(l=r)&&l.dom_event_allowlist){var a,o,l,u,c=r.dom_event_allowlist;if(c&&!c.some(e=>t.type===e))return!1}var{parentIsUsefulElement:h,targetElementList:d}=rx(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(V(i))return!0;var r,s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(r=s(n))return r.v;return!1}(d,r)||!rv(d,null==(u=r)?void 0:u.css_selector_allowlist))return!1;var p=i.getComputedStyle(e);
18if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(rg.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.qt,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=function(e,t){var r,s,{e:n,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:u}=t;if(!rn(e))return{props:{}};for(var c=[e],h=e;h.parentNode&&!ra(h,"body");)if(rl(h.parentNode))c.push(h.parentNode.host),h=h.parentNode.host;else{if(!rn(h.parentNode))break;c.push(h.parentNode),h=h.parentNode}var d,p=[],f={},g=!1,v=!1;if(iU(c,e=>{var t=rT(e);if(ra(e,"a")){var i=e.getAttribute("href");g=t&&!!i&&rD(i)&&i}F(rh(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,r){var s=e.tagName.toLowerCase(),n={tag_name:s};rg.indexOf(s)>-1&&!i&&(n.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?nj(1024,rA(e)):nj(1024,rp(e)));var a=rh(e);a.length>0&&(n.classes=a.filter(function(e){return""!==e})),iU(e.attributes,function(i){var s;if((!rO(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&rD(i.value)&&(!W(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var a=i.value;"class"===i.name&&(a=ru(a).join(" ")),n["attr__"+i.name]=nj(1024,a)}});for(var o=1,l=1,u=e;u=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!rn(t))return t}(u);)o++,u.tagName===e.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}(e,a,o,l)),ij(f,function(e){if(!rT(e))return{};var t={};return iU(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&rD(r)&&(t[i]=r)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(o||(p[0].$el_text=ra(e,"a")||ra(e,"button")?rA(e):rp(e)),g){p[0].attr__href=g;var _,y,b=null==(_=rQ(g))?void 0:_.host,w=null==i||null==(y=i.location)?void 0:y.host;b&&w&&b!==w&&(d=g)}return{props:ij({$event_type:n.type,$ce_version:1},u?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,r,s={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?q(t)?t:ru(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return iV(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s}).map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=m({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return iV(n).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return a[rN(t.toString())]=rN(i.toString())}),(r+=":")+iV(a).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(r=p[0])&&r.$el_text?{$el_text:null==(s=p[0])?void 0:s.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},f)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.ao});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===nz){var u,c=rd(null==i||null==(u=i.getSelection())?void 0:u.toString()),h=e.type||"clipboard";if(!c)return!1;a.$selected_content=c,a.$copy_type=h}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return z(null==n?void 0:n.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.co=(null==i||null==(t=i.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tA.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.do&&this.do(),this.do=void 0,tA.info("History API monitoring stopped")}monitorHistoryChanges(){i&&i.history&&(this.vo("pushState"),this.vo("replaceState"),this.fo())}vo(e){var t;if(i&&(null==(t=i.history[e])||!t.__posthog_wrapped__)){var r=this;!function(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);z(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s}catch(e){return()=>{}}}(i.history,e,t=>function(i,s,n){t.call(this,i,s,n),r.po(e)})}}po(e){try{var t,r=null==i||null==(t=i.location)?void 0:t.pathname;if(!r)return;r!==this.co&&this.isEnabled&&this._instance.capture(iN,{navigation_type:e}),this.co=r}catch(t){tA.error("Error capturing "+e+" pageview",t)}}fo(){if(!this.do){var e=()=>{this.po("popstate")};iZ(i,"popstate",e),this.do=()=>{i&&i.removeEventListener("popstate",e)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(e){var t;this.mo=!1,this.so=!1,this.yo=null,this.instance=e,this.mo=!(null==(t=this.instance.persistence)||!t.props[tW]),this.rageclicks=new nq(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return U(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(e=this.qt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return B(this.qt.capture_heatmaps)?B(this.qt.enable_heatmaps)?this.mo:this.qt.enable_heatmaps:!1!==this.qt.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.so||(nJ.info("starting..."),this.bo(),this.At());else{var e;clearInterval(null!=(e=this.yo)?e:void 0),this._o(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tW]:t}),this.mo=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}wo(e){this.Mt(e.originalEvent,"deadclick")}At(){this.yo&&clearInterval(this.yo),this.yo="visible"===(null==n?void 0:n.visibilityState)?setInterval(this.ci.bind(this),this.flushIntervalMilliseconds):null}bo(){i&&n&&(this.xo=this.ci.bind(this),iZ(i,iA,this.xo),this.ko=e=>this.Mt(e||(null==i?void 0:i.event)),iZ(n,"click",this.ko,{capture:!0}),this.So=e=>this.Co(e||(null==i?void 0:i.event)),iZ(n,"mousemove",this.So,{capture:!0}),this.Io=new rz(this.instance,rL,this.wo.bind(this)),this.Io.startIfEnabledOrStop(),this.To=this.At.bind(this),iZ(n,iD,this.To),this.so=!0)}_o(){var e;i&&n&&(this.xo&&i.removeEventListener(iA,this.xo),this.ko&&n.removeEventListener("click",this.ko,{capture:!0}),this.So&&n.removeEventListener("mousemove",this.So,{capture:!0}),this.To&&n.removeEventListener(iD,this.To),clearTimeout(this.Eo),null==(e=this.Io)||e.stop(),this.so=!1)}Mo(e,t){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,r){for(var s=e;s&&rn(s)&&!ra(s,"body")&&s!==r;){if(F(t,null==i?void 0:i.getComputedStyle(s).position))return!0;s=rm(s)}return!1}(rf(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:r),target_fixed:a,type:t}}Mt(e,t){var i;if(void 0===t&&(t="click"),!rs(e.target)&&nX(e)){var r=this.Mo(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rE(rf(e),this.instance.config.rageclick)&&this.Ro(m({},r,{type:"rageclick"})),this.Ro(r)}}Co(e){!rs(e.target)&&nX(e)&&(clearTimeout(this.Eo),this.Eo=setTimeout(()=>{this.Ro(this.Mo(e,"mousemove"))},500))}Ro(e){if(i){var t=i.location.href,r=this.qt.custom_personal_data_properties,s=rJ(t,this.qt.mask_personal_data_properties?[...r1,...r||[]]:[],r3);this.M=this.M||{},this.M[s]||(this.M[s]=[]),this.M[s].push(e)}}ci(){this.M&&!j(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rz,webVitalsAutocapture:class{constructor(e){var t;this.mo=!1,this.so=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Po=()=>{clearTimeout(this.Oo),0!==this.M.metrics.length&&(this._instance.capture("$web_vitals",this.M.metrics.reduce((e,t)=>
18m({},e,{["$web_vitals_"+t.name+"_event"]:m({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=e=>{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,i=this.Lo();if(!V(i))if(B(null==e?void 0:e.name)||B(null==e?void 0:e.value))nH.error("Invalid metric received",e);else if(!this.Fo||this.Fo>e.value){this.M.url!==i&&(this.Po(),this.Oo=setTimeout(this.Po,this.flushToCaptureTimeoutMs)),V(this.M.url)&&(this.M.url=i),this.M.firstMetricTimestamp=V(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var r=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=m({},e,{$current_url:i,timestamp:Date.now()});V(r)||(s.$session_id=r.sessionId,s.$window_id=r.windowId),this.M.metrics.push(s),this.M.metrics.length===this.allowedMetrics.length&&this.Po()}else nH.error("Ignoring metric with value >= "+this.Fo,e)},this.Ao=()=>{if(!this.so){var e,t,i,r,s=d.__PosthogExtensions__;V(s)||V(s.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=s.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.ht.bind(this)),this.so=!0):nH.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.mo=!(null==(t=this._instance.persistence)||!t.props[tZ]),this.startIfEnabled()}get No(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=U(this.No)?null==(e=this.No)?void 0:e.web_vitals_allowed_metrics:void 0;return B(i)?(null==(t=this._instance.persistence)?void 0:t.props[tY])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(U(this.No)?this.No.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=U(this.No)?this.No.web_vitals_attribution:void 0;return null!=e&&e}get Fo(){var e=U(this.No)&&Z(this.No.__web_vitals_max_value)?this.No.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==a?void 0:a.protocol;if("http:"!==e&&"https:"!==e)return nH.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=U(this.No)?this.No.web_vitals:Q(this.No)?this.No:void 0;return Q(t)?t:this.mo}startIfEnabled(){this.isEnabled&&!this.so&&(nH.info("enabled, starting..."),this.ur(this.Ao))}onRemoteConfig(e){if("capturePerformance"in e){var t=U(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=U(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tZ]:t}),this._instance.persistence.register({[tY]:i})),this.mo=t,this.startIfEnabled()}}ur(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?nH.error("failed to load script",t):e()})}Lo(){var e=i?i.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return rJ(e,this._instance.config.mask_personal_data_properties?[...r1,...t||[]]:[],r3)}nH.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,r,s;this.Ao=()=>{var e;if(i&&this.isEnabled&&null!=(e=d.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=d.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=d.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=d.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Do&&this.qt.capture_unhandled_errors&&(this.Do=t(this.captureException.bind(this))),!this.$o&&this.qt.capture_unhandled_rejections&&(this.$o=r(this.captureException.bind(this))),!this.qo&&this.qt.capture_console_errors&&(this.qo=s(this.captureException.bind(this)))}catch(e){nV.error("failed to start",e),this.jo()}}},this._instance=e,this.Bo=!(null==(t=this._instance.persistence)||!t.props[tH]),this.Ho=new en({refillRate:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?r:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,Zt:nV}),this.qt=this.Uo(),this.startIfEnabledOrStop()}Uo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return U(e)?t=m({},t,e):(V(e)?this.Bo:e)&&(t=m({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(nV.info("enabled"),this.jo(),this.ur(this.Ao)):this.jo()}ur(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return nV.error("failed to load script",t);e()})}jo(){var e,t,i;null==(e=this.Do)||e.call(this),this.Do=void 0,null==(t=this.$o)||t.call(this),this.$o=void 0,null==(i=this.qo)||i.call(this),this.qo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.Bo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[tH]:this.Bo}),this.qt=this.Uo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.Uo()}captureException(e){var t,i,r,s=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.Ho.consumeRateLimit(s)?nV.info("Skipping exception capture because of client rate limiting.",{exception:s}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.zo=[],this.Vo=new ta([new tm,new tO,new ty,new t_,new tx,new tk,new tw,new tT],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var s=[],n=t.split("\n"),a=r;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tv.test(o)?o.replace(tv,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var c=u(l,e);if(c){s.push(c);break}}if(s.length>=50)break}}}if(!s.length)return[];var h=Array.from(s);return h.reverse(),h.slice(0,50).map(e=>m({},e,{filename:e.filename||(h[h.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",td,tg)),this._instance=e,this.zo=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(tG))?t:[],this.Wo=tR(this.Go()),this.Zo=new tF(this.Wo)}onConfigChange(){this.Wo=tR(this.Go()),this.Zo.setConfig(this.Wo)}onRemoteConfig(e){var t,i,r;if("errorTracking"in e){var s=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.zo=s,this._instance.persistence&&this._instance.persistence.register({[tG]:this.zo,[tB]:n})}}get Qo(){var e,t=!!this._instance.get_property(tB),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Vo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Wo.enabled)try{if(!W(e)||0===e.trim().length)return void au.warn("Ignoring exception step because message must be a non-empty string");var i=this.Jo(t),{sanitizedProperties:r,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,r)=>(tI.has(r)?t.push(r):i[r]=e[r],i),{}),droppedKeys:t}}(i);s.length>0&&au.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Zo.add(m({[tP]:e,[tC]:(new Date).toISOString()},r))}catch(e){au.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Ko(t)){if(this.Yo(t))return this.Xo("Exception dropped: matched a suppression rule"),void au.info("Skipping exception capture because a suppression rule matched");if(!this.Qo&&this.ea(t))return this.Xo("Exception dropped: thrown by a browser extension"),void au.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ta(t))return this.Xo("Exception dropped: thrown by the PostHog SDK"),void au.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Wo.enabled&&B(e.$exception_steps)?this.ra(e):e;try{var r=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",Mn:!0});return r&&this.Zo.clear(),r}catch(e){return au.error("Failed to capture exception event. Dropping this exception.",e),void this.Zo.clear()}}catch(e){return void au.error("Failed to process exception event. Ignoring this exception.",e)}}ra(e){try{var t=this.Zo.getAttachable();return 0===t.length?e:m({},e,{$exception_steps:t})}catch(t){return au.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Xo(e){this.Wo.enabled&&this.Zo.add({[tP]:e,[tC]:(new Date).toISOString()})}Jo(e){return U(e)?m({},e):{}}Go(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}Yo(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>
18{var{type:i,value:r}=t;return W(i)&&i.length>0&&e.$exception_types.push(i),W(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.zo.some(e=>{var i=e.values.map(e=>{var i,r=nu[e.operator],s=q(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return s.length>0&&r(s,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}ea(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ta(e){if(e.length>0){var t,i,r,s,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(r=null==a||null==(s=a.filename)?void 0:s.includes("posthog.com/static"))&&r}return!1}Ko(e){return!B(e)&&q(e)}}},av,{siteApps:class{constructor(e){this._instance=e,this.oa=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}aa(e,t){if(t){var i=this.globalsForEvent(t);this.oa.push(i),this.oa.length>1e3&&(this.oa=this.oa.slice(10))}}get siteAppLoaders(){var e;return null==(e=d._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.aa.bind(this));this.la=()=>{e(),this.oa=[],this.la=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,r,s,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var[c,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[c]={id:u[c],type:c,properties:h};var{$set_once:d,$set:p}=e;return{event:m({},_(e,n2),{properties:m({},e.properties,p?{$set:m({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:m({},null!=(r=null==(s=e.properties)?void 0:s.$set_once)?r:{},d)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.oa.length&&(n3.info("Processing "+this.oa.length+" events for site app with id "+e.id),this.oa.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.la)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,n3.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback(e){s(e)}});n&&(t.processEvent=n),r=!0}catch(t){n3.error(n6+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){n3.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ua(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}ha(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){n3.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.ua(),void this._instance.on("eventCaptured",e=>this.ha(e))):void n3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.la)||i.call(this),null!=(r=e.siteApps)&&r.length)if(this.isEnabled){var n=function(e){var t;d["__$$ph_site_app_"+e]=s._instance,null==(t=d.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,o,t=>{if(t)return n3.error(n6+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else n3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},am,{tracingHeaders:class{constructor(e){this.ca=void 0,this.da=void 0,this.va=void 0,this.Ao=()=>{var e,t,i=this.fa();i?(V(this.ca)&&(this.ca=null==(e=d.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),V(this.da)&&(this.da=null==(t=d.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.jo()},this._instance=e}initialize(){this.startIfEnabledOrStop()}ur(e){var t,i;null!=(t=d.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return nW.error("failed to load script",t);e()})}pa(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}fa(){var e=this.pa();return q(e)?(q(this.va)?this.va.splice(0,this.va.length,...e):this.va=[...e],e.length>0?this.va:void 0):(q(this.va)&&this.va.splice(0),this.va=e||void 0,this.va)}jo(){var e,t;null==(e=this.ca)||e.call(this),null==(t=this.da)||t.call(this),this.ca=void 0,this.da=void 0}startIfEnabledOrStop(){this.fa()?this.ur(this.Ao):this.jo()}}},{toolbar:class{constructor(e){this.instance=e}Ca(e){d.ph_toolbar_state=e}Ia(){var e;return null!=(e=d.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),iK(this.instance.config)||!i||!n)return!1;e=null!=e?e:i.location,r=null!=r?r:i.history;try{if(!t){try{i.localStorage.setItem("test","test"),i.localStorage.removeItem("test")}catch(e){return!1}t=null==i?void 0:i.localStorage}var s,a=at||rX(e.hash,"__posthog")||rX(e.hash,"state"),o=a?iW(()=>JSON.parse(atob(decodeURIComponent(a))))||iW(()=>JSON.parse(decodeURIComponent(a))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(ai)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Ta(e){var t=d.ph_load_toolbar||d.ph_load_editor;!B(t)&&z(t)?t(e,this.instance):ar.warn("No toolbar load function found")}loadToolbar(e){var t,r=!(null==n||!n.getElementById(iE));if(!i||r)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,a=m({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(i.localStorage.setItem(ai,JSON.stringify(m({},a,{source:void 0}))),2===this.Ia())?this.Ta(a):0===this.Ia()&&(this.Ca(1),null==(t=d.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(ar.error("[Toolbar] Failed to load",e),this.Ca(0)):(this.Ca(2),this.Ta(a))}),iZ(i,"turbolinks:load",()=>{this.Ca(0),this.loadToolbar(a)}
18)),!0}Ea(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}},a_,{conversations:class{constructor(e){this.Ma=void 0,this._conversationsManager=null,this.Ra=!1,this.Pa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;B(t)||(Q(t)?this.Ma=t:(this.Ma=t.enabled,this.Pa=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ma=void 0,this.Pa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ra||this._instance.config.disable_conversations||iK(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==d?void 0:d.__PosthogExtensions__;if(e&&!V(this.Ma)&&this.Ma)if(this.Pa&&this.Pa.token){this.Ra=!0;try{var t=e.initConversations;if(t)return this.Oa(t),void(this.Ra=!1);var i=e.loadExternalDependency;if(!i)return void this.La(iP);i(this._instance,"conversations",t=>{t||!e.initConversations?this.La("Could not load conversations script",t):this.Oa(e.initConversations),this.Ra=!1})}catch(e){this.La("Error initializing conversations",e),this.Ra=!1}}else ap.error("Conversations enabled but missing token in remote config.")}}Oa(e){if(this.Pa)try{this._conversationsManager=e(this.Pa,this._instance),ap.info("Conversations loaded successfully")}catch(e){this.La("Error completing conversations initialization",e)}else ap.error("Cannot complete initialization: remote config is null")}La(e,t){ap.error(e,t),this._conversationsManager=null,this.Ra=!1}show(){this._conversationsManager?this._conversationsManager.show():ap.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ma&&!G(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var r=this;return v(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(ap.warn(af),null)})()}getMessages(e,t){var i=this;return v(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(ap.warn(af),null)})()}markAsRead(e){var t=this;return v(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(ap.warn(af),null)})()}getTickets(e){var t=this;return v(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(ap.warn(af),null)})()}requestRestoreLink(e){var t=this;return v(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(ap.warn(af),null)})()}restoreFromToken(e){var t=this;return v(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(ap.warn(af),null)})()}restoreFromUrlToken(){var e=this;return v(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(ap.warn(af),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}Nn(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Dn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.Fa=!1,this.Aa=!1,this.Zt=tN("[logs]"),this.Na=[],this.Da=0,this.$a=0,this.qa=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Fa=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!B(i)&&i&&(this.Fa=!0,this.loadIfEnabled())}reset(){this.Na=[],this.ii&&(clearTimeout(this.ii),this.ii=void 0),this.Da=0,this.$a=0,this.qa=!1}loadIfEnabled(){if(this.Fa&&!this.Aa){var e=null==d?void 0:d.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.Zt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.Aa=!0)}):this.Zt.error(iP)}else this.Zt.error("PostHog Extensions not found.")}}captureLog(e){var t,i,r,s,n,a;
18if(this._instance.is_capturing())if(e&&e.body){var o=null!=(t=null==(i=this._instance.config.logs)?void 0:i.flushIntervalMs)?t:3e3,l=null!=(r=null==(s=this._instance.config.logs)?void 0:s.maxLogsPerInterval)?r:1e3,u=Date.now();if(o>u-this.$a||(this.$a=u,this.Da=0,this.qa=!1),l>this.Da){this.Da++;var c=function(e,t){var{text:i,number:r}=tr[e.level||"info"]||ts,s=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),t.currentUrl&&(n["url.full"]=t.currentUrl),t.screenName&&(n["screen.name"]=t.screenName),t.appState&&(n["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(n.feature_flags=t.activeFeatureFlags);var a=m({},n,e.attributes||{}),o={timeUnixNano:s,observedTimeUnixNano:s,severityNumber:r,severityText:i,body:{stringValue:e.body},attributes:tn(a)};return e.trace_id&&(o.traceId=e.trace_id),e.span_id&&(o.spanId=e.span_id),V(e.trace_flags)||(o.flags=e.trace_flags),o}(e,this.ja());this.Na.push({record:c}),(null!=(n=null==(a=this._instance.config.logs)?void 0:a.maxBufferSize)?n:100)>this.Na.length?this.Ba():this.flushLogs()}else this.qa||(this.Zt.warn("captureLog dropping logs: exceeded "+l+" logs per "+o+"ms"),this.qa=!0)}else this.Zt.warn("captureLog requires a body")}get logger(){return this.Ha||(this.Ha={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.Ha}flushLogs(e){if(this.ii&&(clearTimeout(this.ii),this.ii=void 0),0!==this.Na.length){var t,i,r,s=this.Na;this.Na=[];var n=this._instance.config.logs,a=m({"service.name":(null==n?void 0:n.serviceName)||"unknown_service"},(null==n?void 0:n.environment)&&{"deployment.environment":n.environment},(null==n?void 0:n.serviceVersion)&&{"service.version":n.serviceVersion},null==n?void 0:n.resourceAttributes),o=(t=s.map(e=>e.record),i=f.LIB_NAME,r=f.LIB_VERSION,{resourceLogs:[{resource:{attributes:tn(a)},scopeLogs:[{scope:{name:i,version:r},logRecords:t}]}]}),l=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.yn({method:"POST",url:l,data:o,compression:"best-available",batchKey:"logs",transport:e})}}Ba(){var e,t;this.ii||(this.ii=setTimeout(()=>{this.ii=void 0,this.flushLogs()},null!=(e=null==(t=this._instance.config.logs)?void 0:t.flushIntervalMs)?e:3e3))}ja(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i}if(null!=d&&null!=(e=d.location)&&e.href&&(t.currentUrl=d.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}});nL.__defaultExtensionClasses=m({},ay);var ab=(f.SDK_DIST_CHANNEL="npm",t=nx[nR]=new nL,function(){function e(){e.done||(e.done=!0,nF=!1,iU(nx,function(e){e._dom_loaded()}))}null!=n&&n.addEventListener?"complete"===n.readyState?e():iZ(n,"DOMContentLoaded",e,{capture:!1}):i&&tA.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t);e.s(["Compression",0,sy,"DEFAULT_PRODUCT_TOUR_APPEARANCE",0,{backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:0x7ffffffe},"DisplaySurveyType",0,sd,"PostHog",0,nL,"ProductTourEventName",0,sp,"ProductTourEventProperties",0,sf,"SurveyEventName",0,sc,"SurveyEventProperties",0,sh,"SurveyEventType",0,sl,"SurveyPosition",0,{TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},"SurveyQuestionBranchingType",0,{NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},"SurveyQuestionType",0,{Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},"SurveySchedule",0,{Once:"once",Recurring:"recurring",Always:"always"},"SurveyTabPosition",0,{Top:"top",Left:"left",Right:"right",Bottom:"bottom"},"SurveyType",0,su,"SurveyWidgetType",0,{Button:"button",Tab:"tab",Selector:"selector"},"default",0,ab,"posthog",0,ab,"severityLevels",0,["fatal","error","warning","log","info","debug"]])},698391,700992,862032,978818,619966,e=>{"use strict";let t,i;var r=e.i(676461),s=e.i(338431),n=e.i(271645);let a={USER_LOGGED_IN:"user_logged_in",LOGIN_FAILED:"login_failed",USER_FIRST_LOGIN:"user_first_login",USER_SESSION_INIT_FAILED:"user_session_init_failed",GLOBAL_SEARCH_EXECUTED:"global_search_executed",LP_ASSIGNED:"lp_assigned",LP_VIEWED:"lp_viewed",LP_STARTED:"lp_started",LP_COMPLETED:"lp_completed",FIRST_LP_COMPLETED:"first_lp_completed",COMPETENCY_CREATION_STARTED:"competency_creation_started",COMPETENCY_SAVED:"competency_saved",COMPETENCY_PUBLISHED:"competency_published",COMPETENCY_VIEWED:"c
18ompetency_viewed",COMPETENCY_ENABLED_FOR_AGENCY:"competency_enabled_for_agency",COMPETENCY_ASSIGNED:"competency_assigned",COMPETENCY_ASSIGNMENT_VIEWED:"competency_assignment_viewed",COMPETENCY_STATUS_CHANGED:"competency_status_changed",COMPETENCY_COMPLETED:"competency_completed",REPORT_DOWNLOADED:"report_downloaded",COMPETENCY_REPORT_VIEWED:"competency_report_viewed",REPORT_GENERATED:"report_generated",INTERCOM_MESSAGE:"intercom_message",HELP_ARTICLE_VIEWED:"help_article_viewed",FIRST_ASSIGNMENT_STARTED:"first_assignment_started",FIRST_ASSIGNMENT_COMPLETED:"first_assignment_completed",BUTTON_CLICKED:"button_clicked",PAGE_VIEWED:"page_viewed",FORM_SUBMITTED:"form_submitted",FORM_ABANDONED:"form_abandoned"};e.s(["ANALYTICS_EVENTS",0,a],700992);let o={SEARCH_TERM:"search_term",SEARCH_TERM_LENGTH:"search_term_length",NUMBER_OF_RESULTS:"number_of_results",SEARCH_CATEGORY:"search_category"},l={COMPETENCY_ID:"competency_id",COMPETENCY_NAME:"competency_name",PREVIOUS_STATUS:"previous_status",NEW_STATUS:"new_status",TIME_IN_STAGE:"time_in_stage",TIME_TO_COMPLETE:"time_to_complete",IS_DRAFT:"is_draft"},u={STARTING_URL:"starting_url",MESSAGE_TYPE:"message_type"};e.s(["COMPETENCY_PROPERTIES",0,l,"SEARCH_PROPERTIES",0,o,"SUPPORT_PROPERTIES",0,u],862032),e.i(247167);let c=null,h=!1,d=!1;function p(r){if(!d)return console.log("[PostHog] PostHog is disabled for this environment"),null;if(h&&c)return c;if(!c)try{c=e.r(604570).default}catch(e){return console.error("[PostHog] Failed to load posthog-js:",e),null}let s=t||r?.api_key,n=i||r?.api_host||"https://app.posthog.com";if(!s)return console.warn("[PostHog] API key not found. Analytics will not be tracked."),c;try{c.init(s,{api_host:n,ui_host:r?.ui_host,person_profiles:r?.person_profiles||"identified_only",autocapture:r?.autocapture!==void 0&&r.autocapture,capture_pageview:!1,capture_pageleave:!1,capture_performance:r?.capture_performance!==void 0&&r.capture_performance,disable_session_recording:r?.disable_session_recording||!1,loaded:e=>{},persistence:"localStorage+cookie",cross_subdomain_cookie:!0,respect_dnt:!0,session_recording:{maskAllInputs:!1,maskInputOptions:{password:!0}},before_send:e=>{if("u"<typeof navigator)return e;let t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|scraper|headless|phantom|selenium|puppeteer|playwright|cypress/.test(t)?null:e}}),h=!0}catch(e){console.error("[PostHog] Initialization failed:",e)}return c}function f(){return h&&c?c:p()}function g(){let e=(0,n.useCallback)((e,t)=>{try{let i=f();if(!i)return void console.warn("[useAnalytics] PostHog client not initialized");i.capture(e,{...t,timestamp:new Date().toISOString()})}catch(e){console.error("[useAnalytics] Failed to capture event:",e)}},[]),t=(0,n.useCallback)((e,t)=>{try{let i=f();if(!i)return void console.warn("[useAnalytics] PostHog client not initialized");i.identify(e,t)}catch(e){console.error("[useAnalytics] Failed to identify user:",e)}},[]),i=(0,n.useCallback)(()=>{try{let e=f();if(!e)return void console.warn("[useAnalytics] PostHog client not initialized");e.reset()}catch(e){console.error("[useAnalytics] Failed to reset:",e)}},[]);return{capture:e,identify:t,reset:i,setUserProperties:(0,n.useCallback)(e=>{try{let t=f();if(!t)return void console.warn("[useAnalytics] PostHog client not initialized");t.people.set(e)}catch(e){console.error("[useAnalytics] Failed to set user properties:",e)}},[]),isInitialized:(0,n.useCallback)(()=>null!=f(),[])}}e.s(["getPostHog",0,function(){return c||p(),c},"getPostHogClient",0,f,"initPostHog",0,p,"resetPostHog",0,function(){h&&c&&(c.reset(),h=!1)},"setPostHogEnabled",0,function(e){d=e},"setPostHogRuntimeConfig",0,function(e,r){t=e,i=r}],978818),e.s(["default",0,g,"useAnalytics",0,g],619966);var v=e.i(69733);let m=()=>{let{user:e,isLoaded:t}=(0,r.useUser)(),{capture:i}=g(),{intercomAppId:o}=(0,v.useRuntimeConfig)();(0,n.useEffect)(()=>{if(!t)return;if(!o)return void console.error("Intercom App ID is not defined in runtime configuration");if(!e){window.Intercom&&window.Intercom("shutdown"),(0,s.default)({app_id:o});return}let r=e.organizationMemberships.length>0?e.organizationMemberships[0]:null,n={app_id:o,user_id:e.externalId||"",name:e.fullName||`${e.firstName} ${e.lastName}`||"",email:e.primaryEmailAddress?.emailAddress||"",created_at:e.createdAt?Math.floor(e.createdAt.getTime()/1e3):void 0,phone:e.phoneNumbers[
180]?.phoneNumber||""};r&&(n.company={id:r.organization.publicMetadata?.externalId,name:r.organization.name,shortname:r.organization.slug,role:r.role,created_at:r.organization.createdAt?Math.floor(r.organization.createdAt.getTime()/1e3):void 0},e.organizationMemberships.length>1&&(n.companies=e.organizationMemberships.map(e=>({id:e.organization.publicMetadata?.externalId,name:e.organization.name,shortname:e.organization.slug,role:e.role,created_at:e.organization.createdAt?Math.floor(e.organization.createdAt.getTime()/1e3):void 0})))),(0,s.default)(n),window.Intercom&&window.Intercom("onShow",()=>{try{i(a.INTERCOM_MESSAGE,{[u.STARTING_URL]:window.location.href})}catch(e){console.error("[Analytics] Failed to track Intercom message:",e)}})},[e,t,i,o])};e.s(["default",0,m,"useIntercomChat",0,m],698391)},947878,e=>{"use strict";var t=e.i(843476),i=e.i(676461),r=e.i(271645);let s=(0,r.createContext)({intercomUserId:null,isIntercomReady:!1});e.s(["IntercomProvider",0,({children:e})=>{let{user:n,isLoaded:a}=(0,i.useUser)(),[o,l]=(0,r.useState)(null),[u,c]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!a||!n){c(!1),l(null);return}
18l(n.externalId||null),c(!0)},[n,a]),(0,t.jsx)(s.Provider,{value:{intercomUserId:o,isIntercomReady:u},children:e})},"useIntercomContext",0,()=>{let e=(0,r.useContext)(s);if(!e)throw Error("useIntercomContext must be used within IntercomProvider");return e}])},300397,467701,e=>{"use strict";class t extends Error{code=0;name="APIError";constructor(e,t){super("string"==typeof e?e.replace(/^[A-Za-z]*(Exception|Error):\s*/,""):e.message||"An unknown error occurred"),this.code=t||500}toString(){return`${this.name}: ${this.message}`}}async function i(e,i){try{let r=await e(i);if(r.error)throw new t(r.error,r.code);return r}catch(e){throw console.error(`Error in actionWrapper: ${e}`),e}}e.s(["APIError",0,t],467701),e.s(["actionWrapper",0,i],300397)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.