module.exports=[875910,a=>{"use strict";function b(a){return function(b){let c=b??this;if(!c)throw TypeError(`${a.kind||a.name} type guard requires an error object`);return c instanceof a}}var c=class{static kind="ClerkApiError";code;message;longMessage;meta;constructor(a){const b={code:a.code,message:a.message,longMessage:a.long_message,meta:{paramName:a.meta?.param_name,sessionId:a.meta?.session_id,emailAddresses:a.meta?.email_addresses,identifiers:a.meta?.identifiers,zxcvbn:a.meta?.zxcvbn,plan:a.meta?.plan,isPlanUpgradePossible:a.meta?.is_plan_upgrade_possible}};this.code=b.code,this.message=b.message,this.longMessage=b.longMessage,this.meta=b.meta}};function d(a=[]){return a.length>0?a.map(a=>new c(a)):[]}function e(a){return new c(a)}function f(a){return{code:a?.code||"",message:a?.message||"",long_message:a?.longMessage,meta:{param_name:a?.meta?.paramName,session_id:a?.meta?.sessionId,email_addresses:a?.meta?.emailAddresses,identifiers:a?.meta?.identifiers,zxcvbn:a?.meta?.zxcvbn,plan:a?.meta?.plan,is_plan_upgrade_possible:a?.meta?.isPlanUpgradePossible}}}b(c);var g=class a extends Error{static kind="ClerkError";clerkError=!0;code;longMessage;docsUrl;cause;get name(){return this.constructor.name}constructor(b){super(new.target.formatMessage(new.target.kind,b.message,b.code,b.docsUrl),{cause:b.cause}),Object.setPrototypeOf(this,a.prototype),this.code=b.code,this.docsUrl=b.docsUrl,this.longMessage=b.longMessage,this.cause=b.cause}toString(){return`[${this.name}]
Message:${this.message}`}static formatMessage(a,b,c,d){let e="Clerk:",f=RegExp(e.replace(" ","\\s*"),"i");return b=b.replace(f,""),b=`${e} ${b.trim()}

(code="${c}")

`,d&&(b+=`

Docs: ${d}`),b}},h=class a extends g{static kind="ClerkAPIResponseError";status;clerkTraceId;retryAfter;errors;constructor(b,d){const{data:e,status:f,clerkTraceId:g,retryAfter:h}=d;super({...d,message:b,code:"api_response_error"}),Object.setPrototypeOf(this,a.prototype),this.status=f,this.clerkTraceId=g,this.retryAfter=h,this.errors=(e||[]).map(a=>new c(a))}toString(){let a=`[${this.name}]
Message:${this.message}
Status:${this.status}
Serialized errors: ${this.errors.map(a=>JSON.stringify(a))}`;return this.clerkTraceId&&(a+=`
Clerk Trace ID: ${this.clerkTraceId}`),a}static formatMessage(a,b,c,d){return b}};let i=b(h),j=Object.freeze({InvalidProxyUrlErrorMessage:"The proxyUrl passed to Clerk is invalid. 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"});function k({packageName:a,customMessages:b}){let c=a;function d(a,b){if(!b)return`${c}: ${a}`;let d=a;for(let c of a.matchAll(/{{([a-zA-Z0-9-_]+)}}/g)){let a=(b[c[1]]||"").toString();d=d.replace(`{{${c[1]}}}`,a)}return`${c}: ${d}`}let e={...j,...b};return{setPackageName({packageName:a}){return"string"==typeof a&&(c=a),this},setMessages({customMessages:a}){return Object.assign(e,a||{}),this},throwInvalidPublishableKeyError(a){throw Error(d(e.InvalidPublishableKeyErrorMessage,a))},throwInvalidProxyUrl(a){throw Error(d(e.InvalidProxyUrlErrorMessage,a))},throwMissingPublishableKeyError(){throw Error(d(e.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(d(e.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(a){throw Error(d(e.MissingClerkProvider,a))},throw(a){throw Error(d(a))}}}var l=class a extends Error{code;constructor(b){super(b),this.code=b,this.name="EmailLinkError",Object.setPrototypeOf(this,a.prototype)}};let m={Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"},n={Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"};var o=class a extends g{static kind="ClerkRuntimeError";clerkRuntimeError=!0;constructor(b,c){super({...c,message:b}),Object.setPrototypeOf(this,a.prototype)}};let p=b(o);var q=class extends o{code;constructor(a,{code:b}){super(a,{code:b}),this.code=b}};function r(a){let b=a?.status;return a?.errors?.[0]?.code==="authentication_invalid"&&401===b}function s(a){return["captcha_invalid","captcha_not_enabled","captcha_missing_token"].includes(a.errors[0].code)}function t(a){let b=a?.status;return!!b&&b>=400&&b<500}function u(a){return(`${a.message}${a.name}`||"").toLowerCase().replace(/\s+/g,"").includes("networkerror")}function v(a){return w(a)||z(a)||x(a)}function w(a){return a&&"clerkError"in a}function x(a){return"clerkRuntimeError"in a}function y(a){return x(a)&&"reverification_cancelled"===a.code}function z(a){return"code"in a&&[4001,32602,32603].includes(a.code)&&"message"in a}function A(a){return w(a)&&a.errors?.[0]?.code==="user_locked"}function B(a){return w(a)&&a.errors?.[0]?.code==="form_password_pwned"}function C(a){return w(a)&&a.errors?.[0]?.code==="form_password_compromised"}function D(a){return"EmailLinkError"===a.name}function E(a){for(let[b,c]of Object.entries({isClerkApiResponseError:i,isClerkRuntimeError:p}))Object.assign(a,{[b]:c});return a}a.s(["ClerkAPIError",()=>c,"ClerkAPIResponseError",()=>h,"ClerkError",()=>g,"ClerkRuntimeError",()=>o,"ClerkWebAuthnError",()=>q,"EmailLinkError",()=>l,"EmailLinkErrorCode",()=>m,"EmailLinkErrorCodeStatus",()=>n,"buildErrorThrower",()=>k,"createClerkGlobalHookError",()=>E,"errorToJSON",()=>f,"is4xxError",()=>t,"isCaptchaError",()=>s,"isClerkAPIResponseError",()=>w,"isClerkRuntimeError",()=>x,"isEmailLinkError",()=>D,"isKnownError",()=>v,"isMetamaskError",()=>z,"isNetworkError",()=>u,"isPasswordCompromisedError",()=>C,"isPasswordPwnedError",()=>B,"isReverificationCancelledError",()=>y,"isUnauthorizedError",()=>r,"isUserLockedError",()=>A,"parseError",()=>e,"parseErrors",()=>d])},319190,a=>{"use strict";let b={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"}},c=new Set(["first_factor","second_factor","multi_factor"]),d=new Set(["strict_mfa","strict","moderate","lax"]),e=(a,b)=>{let{org:c,user:d}=f(a),[e,g]=b.split(":"),h=g||e;return"org"===e?c.includes(h):"user"===e?d.includes(h):[...c,...d].includes(h)},f=a=>{let b=a?a.split(",").map(a=>a.trim()):[];return{org:b.filter(a=>a.split(":")[0].includes("o")).map(a=>a.split(":")[1]),user:b.filter(a=>a.split(":")[0].includes("u")).map(a=>a.split(":")[1])}},g=a=>{let e,f;if(!a)return!1;let g="string"==typeof a&&d.has(a),h="object"==typeof a&&(e=a.level,c.has(e))&&"number"==typeof(f=a.afterMinutes)&&f>0;return(!!g||!!h)&&(a=>"string"==typeof a?b[a]:a).bind(null,a)},h=a=>b=>{if(!a.userId)return!1;let c=((a,b)=>{let{features:c,plans:d}=b;return a.feature&&c?e(c,a.feature):a.plan&&d?e(d,a.plan):null})(b,a),d=((a,b)=>{let{orgId:c,orgRole:d,orgPermissions:e}=b;return(a.role||a.permission)&&c&&d&&e?a.permission?e.includes(a.permission.replace(/^(org:)*/,"org:")):a.role?d.replace(/^(org:)*/,"org:")===a.role.replace(/^(org:)*/,"org:"):null:null})(b,a),f=((a,{factorVerificationAge:b})=>{if(!a.reverification||!b)return null;let c=g(a.reverification);if(!c)return null;let{level:d,afterMinutes:e}=c(),[f,h]=b,i=-1!==f?e>f:null,j=-1!==h?e>h:null;switch(d){case"first_factor":return i;case"second_factor":return -1!==h?j:i;case"multi_factor":return -1===h?i:i&&j}})(b,a);return[c||d,f].some(a=>null===a)?[c||d,f].some(a=>!0===a):[c||d,f].every(a=>!0===a)},i=({authObject:{sessionId:a,sessionStatus:b,userId:c,actor:d,orgId:e,orgRole:f,orgSlug:g,signOut:h,getToken:i,has:j,sessionClaims:k},options:{treatPendingAsSignedOut:l=!0}})=>void 0===a&&void 0===c?{isLoaded:!1,isSignedIn:void 0,sessionId:a,sessionClaims:void 0,userId:c,actor:void 0,orgId:void 0,orgRole:void 0,orgSlug:void 0,has:void 0,signOut:h,getToken:i}:null===a&&null===c?{isLoaded:!0,isSignedIn:!1,sessionId:a,userId:c,sessionClaims:null,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:h,getToken:i}:l&&"pending"===b?{isLoaded:!0,isSignedIn:!1,sessionId:null,userId:null,sessionClaims:null,actor:null,orgId:null,orgRole:null,orgSlug:null,has:()=>!1,signOut:h,getToken:i}:a&&k&&c&&e&&f?{isLoaded:!0,isSignedIn:!0,sessionId:a,sessionClaims:k,userId:c,actor:d||null,orgId:e,orgRole:f,orgSlug:g||null,has:j,signOut:h,getToken:i}:a&&k&&c&&!e?{isLoaded:!0,isSignedIn:!0,sessionId:a,sessionClaims:k,userId:c,actor:d||null,orgId:null,orgRole:null,orgSlug:null,has:j,signOut:h,getToken:i}:void 0;a.s(["createCheckAuthorization",()=>h,"resolveAuthState",()=>i,"splitByScope",()=>f,"validateReverificationConfig",()=>g])},862563,a=>{"use strict";var b=a.i(152240),c=a.i(102986),d=class{#a;#b=864e5;constructor(a){this.#a=a}isEventThrottled(a){let b=Date.now(),c=this.#c(a),d=this.#a.getItem(c);return!!d&&!(b-d>this.#b)||(this.#a.setItem(c,b),!1)}#c(a){let{sk:b,pk:c,payload:d,...e}=a,f={...d,...e};return JSON.stringify(Object.keys({...d,...e}).sort().map(a=>f[a]))}},e=class{#d="clerk_telemetry_throttler";getItem(a){return this.#e()[a]}setItem(a,b){try{let c=this.#e();c[a]=b,localStorage.setItem(this.#d,JSON.stringify(c))}catch(a){a instanceof DOMException&&("QuotaExceededError"===a.name||"NS_ERROR_DOM_QUOTA_REACHED"===a.name)&&localStorage.length>0&&localStorage.removeItem(this.#d)}}removeItem(a){try{let b=this.#e();delete b[a],localStorage.setItem(this.#d,JSON.stringify(b))}catch{}}#e(){try{let a=localStorage.getItem(this.#d);if(!a)return{};return JSON.parse(a)}catch{return{}}}static isSupported(){return!1}},f=class{#a=new Map;#f=1e4;getItem(a){return this.#a.size>this.#f?void this.#a.clear():this.#a.get(a)}setItem(a,b){this.#a.set(a,b)}removeItem(a){this.#a.delete(a)}};let g=new Set(["error","warn","info","debug","trace"]);var h=class{#g;#h;#i={};#j=[];#k=null;constructor(a){this.#g={maxBufferSize:a.maxBufferSize??5,samplingRate:a.samplingRate??1,perEventSampling:a.perEventSampling??!0,disabled:a.disabled??!1,debug:a.debug??!1,endpoint:"https://clerk-telemetry.com"},a.clerkVersion?this.#i.clerkVersion=a.clerkVersion??"":this.#i.clerkVersion="",this.#i.sdk=a.sdk,this.#i.sdkVersion=a.sdkVersion,this.#i.publishableKey=a.publishableKey??"";const c=(0,b.parsePublishableKey)(a.publishableKey);c&&(this.#i.instanceType=c.instanceType),a.secretKey&&(this.#i.secretKey=a.secretKey.substring(0,16)),this.#h=new d(e.isSupported()?new e:new f)}get isEnabled(){return!("development"!==this.#i.instanceType||this.#g.disabled||"undefined"!=typeof process&&process.env&&(0,c.isTruthy)(process.env.CLERK_TELEMETRY_DISABLED))}get isDebug(){return this.#g.debug||"undefined"!=typeof process&&process.env&&(0,c.isTruthy)(process.env.CLERK_TELEMETRY_DEBUG)}record(a){try{let b=this.#l(a.event,a.payload);if(this.#m(b.event,b),!this.#n(b,a.eventSamplingRate))return;this.#j.push({kind:"event",value:b}),this.#o()}catch(a){console.error("[clerk/telemetry] Error recording telemetry event",a)}}recordLog(a){try{if(!this.#p(a))return;let b="string"==typeof a?.level&&g.has(a.level),c="string"==typeof a?.message&&a.message.trim().length>0,d=null,e=a?.timestamp;if("number"==typeof e||"string"==typeof e){let a=new Date(e);Number.isNaN(a.getTime())||(d=a)}if(!b||!c||null===d){this.isDebug&&"undefined"!=typeof console&&console.warn("[clerk/telemetry] Dropping invalid telemetry log entry",{levelIsValid:b,messageIsValid:c,timestampIsValid:null!==d});return}let f=this.#q(),h={sdk:f.name,sdkv:f.version,cv:this.#i.clerkVersion??"",lvl:a.level,msg:a.message,ts:d.toISOString(),pk:this.#i.publishableKey||null,payload:this.#r(a.context)};this.#j.push({kind:"log",value:h}),this.#o()}catch(a){console.error("[clerk/telemetry] Error recording telemetry log entry",a)}}#n(a,b){return this.isEnabled&&!this.isDebug&&this.#s(a,b)}#p(a){return!0}#s(a,b){let c=Math.random();return!!(c<=this.#g.samplingRate&&(!1===this.#g.perEventSampling||void 0===b||c<=b))&&!this.#h.isEventThrottled(a)}#o(){this.#t()}#t(){let a=[...this.#j];if(this.#j=[],this.#k=null,0===a.length)return;let b=a.filter(a=>"event"===a.kind).map(a=>a.value),c=a.filter(a=>"log"===a.kind).map(a=>a.value);b.length>0&&fetch(new URL("/v1/event",this.#g.endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({events:b})}).catch(()=>void 0),c.length>0&&fetch(new URL("/v1/logs",this.#g.endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({logs:c})}).catch(()=>void 0)}#m(a,b){this.isDebug&&(void 0!==console.groupCollapsed?(console.groupCollapsed("[clerk/telemetry]",a),console.log(b),console.groupEnd()):console.log("[clerk/telemetry]",a,b))}#q(){return{name:this.#i.sdk,version:this.#i.sdkVersion}}#l(a,b){let c=this.#q();return{event:a,cv:this.#i.clerkVersion??"",it:this.#i.instanceType??"",sdk:c.name,sdkv:c.version,...this.#i.publishableKey?{pk:this.#i.publishableKey}:{},...this.#i.secretKey?{sk:this.#i.secretKey}:{},payload:b}}#r(a){if(null==a||"object"!=typeof a)return null;try{let b=JSON.parse(JSON.stringify(a));if(b&&"object"==typeof b&&!Array.isArray(b))return b;return null}catch{return null}}};let i="COMPONENT_MOUNTED",j=new Set(["SignIn","SignUp"]);function k(a){return j.has(a)?1:.1}function l(a){return function(b,c,d){return{event:a,eventSamplingRate:a===i?k(b):.1,payload:{component:b,appearanceProp:!!c?.appearance,baseTheme:!!c?.appearance?.baseTheme,elements:!!c?.appearance?.elements,variables:!!c?.appearance?.variables,...d}}}}function m(a,b,c){return l(i)(a,b,c)}function n(a,b,c){return l("COMPONENT_OPENED")(a,b,c)}function o(a,b={}){return{event:i,eventSamplingRate:k(a),payload:{component:a,...b}}}function p(a,b){return{event:"METHOD_CALLED",eventSamplingRate:.1,payload:{method:a,...b}}}function q(a){return{event:"FRAMEWORK_METADATA",eventSamplingRate:.1,payload:a}}let r="THEME_USAGE";function s(a){return{event:r,eventSamplingRate:1,payload:function(a){let b;if(!a||"object"!=typeof a)return{};let c=a.theme||a.baseTheme;if(!c)return{};if(Array.isArray(c))for(let a of c){let c=t(a);if(c){b=c;break}}else b=t(c);return{themeName:b}}(a)}}function t(a){return"string"==typeof a?a:"object"==typeof a&&null!==a&&"name"in a&&"string"==typeof a.name?a.name:void 0}a.s(["EVENT_SAMPLING_RATE",()=>1,"EVENT_THEME_USAGE",()=>r,"TelemetryCollector",()=>h,"eventComponentMounted",()=>o,"eventFrameworkMetadata",()=>q,"eventMethodCalled",()=>p,"eventPrebuiltComponentMounted",()=>m,"eventPrebuiltComponentOpened",()=>n,"eventThemeUsage",()=>s])},659010,a=>{"use strict";let b="reverification-error",c=a=>({clerk_error:{type:"forbidden",reason:b,metadata:{reverification:a}}}),d=a=>a&&"object"==typeof a&&"clerk_error"in a&&a.clerk_error?.type==="forbidden"&&a.clerk_error?.reason===b;a.s(["isReverificationHint",()=>d,"reverificationError",()=>c])},122900,a=>{"use strict";function b(a,b){return a.find(a=>a.organization.id===b)}a.s(["getCurrentOrganizationMembership",()=>b])},589841,(a,b,c)=>{"use strict";var d=a.r(401122);d.useState,d.useEffect,d.useLayoutEffect,d.useDebugValue,c.useSyncExternalStore=void 0!==d.useSyncExternalStore?d.useSyncExternalStore:function(a,b){return b()}},33384,(a,b,c)=>{"use strict";b.exports=a.r(589841)},995728,652307,16510,915804,365126,614581,682197,134545,467691,410040,299657,478224,355855,910489,a=>{"use strict";var b=a.i(401122),c=a.i(33384);a.s(["ERROR_REVALIDATE_EVENT",()=>3,"FOCUS_EVENT",()=>0,"MUTATE_EVENT",()=>2,"RECONNECT_EVENT",()=>1],222716);var d=Object.prototype.hasOwnProperty;let e=new WeakMap,f=()=>{},g=f(),h=Object,i=a=>a===g,j=a=>"function"==typeof a,k=(a,b)=>({...a,...b}),l=a=>j(a.then),m={},n={},o="undefined",p=typeof document!=o,q=!1,r=(a,b)=>{let c=e.get(a);return[()=>!i(b)&&a.get(b)||m,d=>{if(!i(b)){let e=a.get(b);b in n||(n[b]=e),c[5](b,k(e,d),e||m)}},c[6],()=>!i(b)&&b in n?n[b]:!i(b)&&a.get(b)||m]},s=!0,[t,u]=[f,f],v={initFocus:a=>(p&&document.addEventListener("visibilitychange",a),t("focus",a),()=>{p&&document.removeEventListener("visibilitychange",a),u("focus",a)}),initReconnect:a=>{let b=()=>{s=!0,a()},c=()=>{s=!1};return t("online",b),t("offline",c),()=>{u("online",b),u("offline",c)}}},w=!b.default.useId,x=!0,y=a=>setTimeout(a,1),z=b.useEffect,A="undefined"!=typeof navigator&&navigator.connection;!x&&A&&(["slow-2g","2g"].includes(A.effectiveType)||A.saveData);let B=new WeakMap,C=(a,b)=>a===`[object ${b}]`,D=0,E=a=>{let b,c,d=typeof a,e=h.prototype.toString.call(a),f=C(e,"Date"),g=C(e,"RegExp"),j=C(e,"Object");if(h(a)!==a||f||g)b=f?a.toJSON():"symbol"==d?a.toString():"string"==d?JSON.stringify(a):""+a;else{if(b=B.get(a))return b;if(b=++D+"~",B.set(a,b),Array.isArray(a)){for(c=0,b="@";c<a.length;c++)b+=E(a[c])+",";B.set(a,b)}if(j){b="#";let d=h.keys(a).sort();for(;!i(c=d.pop());)i(a[c])||(b+=c+":"+E(a[c])+",");B.set(a,b)}}return b},F=a=>{if(j(a))try{a=a()}catch(b){a=""}let b=a;return[a="string"==typeof a?a:(Array.isArray(a)?a.length:a)?E(a):"",b]},G=0,H=()=>++G;async function I(...a){let[b,c,d,f]=a,h=k({populateCache:!0,throwOnError:!0},"boolean"==typeof f?{revalidate:f}:f||{}),m=h.populateCache,n=h.rollbackOnError,o=h.optimisticData,p=h.throwOnError;if(j(c)){let a=[];for(let d of b.keys())!/^\$(inf|sub)\$/.test(d)&&c(b.get(d)._k)&&a.push(d);return Promise.all(a.map(q))}return q(c);async function q(c){let f,[k]=F(c);if(!k)return;let[q,s]=r(b,k),[t,u,v,w]=e.get(b),x=()=>{let a=t[k];return(j(h.revalidate)?h.revalidate(q().data,c):!1!==h.revalidate)&&(delete v[k],delete w[k],a&&a[0])?a[0](2).then(()=>q().data):q().data};if(a.length<3)return x();let y=d,z=!1,A=H();u[k]=[A,0];let B=!i(o),C=q(),D=C.data,E=C._c,G=i(E)?D:E;if(B&&s({data:o=j(o)?o(G,D):o,_c:G}),j(y))try{y=y(G)}catch(a){f=a,z=!0}if(y&&l(y)){let a;if(y=await y.catch(a=>{f=a,z=!0}),A!==u[k][0]){if(z)throw f;return y}z&&B&&(a=f,"function"==typeof n?n(a):!1!==n)&&(m=!0,s({data:G,_c:g}))}if(m&&!z&&(j(m)?s({data:m(y,G),error:g,_c:g}):s({data:y,error:g,_c:g})),u[k][1]=H(),Promise.resolve(x()).then(()=>{s({_c:g})}),z){if(p)throw f;return}return y}}let J=(a,b)=>{if(!e.has(a)){k(v,b);let c=Object.create(null),d=I.bind(g,a),h=Object.create(null),i=(a,b)=>{let c=h[a]||[];return h[a]=c,c.push(b),()=>c.splice(c.indexOf(b),1)},j=(b,c,d)=>{a.set(b,c);let e=h[b];if(e)for(let a of e)a(c,d)},l=()=>{e.has(a)||e.set(a,[c,Object.create(null),Object.create(null),Object.create(null),d,j,i])};return l(),[a,d,l,f]}return[a,e.get(a)[4]]},[K,L]=J(new Map),M=k({onLoadingSlow:f,onSuccess:f,onError:f,onErrorRetry:(a,b,c,d,e)=>{let f=c.errorRetryCount,g=e.retryCount,h=~~((Math.random()+.5)*(1<<(g<8?g:8)))*c.errorRetryInterval;(i(f)||!(g>f))&&setTimeout(d,h,e)},onDiscarded:f,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:3e3,compare:function a(b,c){var e,f;if(b===c)return!0;if(b&&c&&(e=b.constructor)===c.constructor){if(e===Date)return b.getTime()===c.getTime();if(e===RegExp)return b.toString()===c.toString();if(e===Array){if((f=b.length)===c.length)for(;f--&&a(b[f],c[f]););return -1===f}if(!e||"object"==typeof b){for(e in f=0,b)if(d.call(b,e)&&++f&&!d.call(c,e)||!(e in c)||!a(b[e],c[e]))return!1;return Object.keys(c).length===f}}return b!=b&&c!=c},isPaused:()=>!1,cache:K,mutate:L,fallback:{}},{isOnline:()=>s,isVisible:()=>{let a=p&&document.visibilityState;return i(a)||"hidden"!==a}}),N=(a,b)=>{let c=k(a,b);if(b){let{use:d,fallback:e}=a,{use:f,fallback:g}=b;d&&f&&(c.use=d.concat(f)),e&&g&&(c.fallback=k(e,g))}return c},O=(0,b.createContext)({}),P=a=>{let{value:c}=a,d=(0,b.useContext)(O),e=j(c),f=(0,b.useMemo)(()=>e?c(d):c,[e,d,c]),h=(0,b.useMemo)(()=>e?f:N(d,f),[e,d,f]),i=f&&f.provider,l=(0,b.useRef)(g);i&&!l.current&&(l.current=J(i(h.cache||K),f));let m=l.current;return m&&(h.cache=m[0],h.mutate=m[1]),z(()=>{if(m)return m[2]&&m[2](),m[3]},[]),(0,b.createElement)(O.Provider,k(a,{value:h}))};a.s(["B",()=>l,"I",()=>w,"O",()=>h,"S",()=>O,"U",()=>g,"a",()=>j,"b",()=>e,"c",()=>K,"d",()=>M,"e",()=>i,"f",()=>N,"g",()=>P,"i",()=>!1,"m",()=>k,"n",()=>I,"o",()=>H,"r",()=>x,"s",()=>F,"t",()=>y,"u",()=>z,"z",()=>r],652307);var Q=a.i(222716);let R="$inf$";a.s(["INFINITE_PREFIX",()=>R],16510);let S=!1,T=S?window.__SWR_DEVTOOLS_USE__:[],U=a=>j(a[1])?[a[0],a[1],a[2]||{}]:[a[0],null,(null===a[1]?a[2]:a[1])||{}],V=()=>k(M,(0,b.useContext)(O)),W=T.concat(a=>(b,c,d)=>{let f=c&&((...a)=>{let[d]=F(b),[,,,f]=e.get(K);if(d.startsWith(R))return c(...a);let g=f[d];return i(g)?c(...a):(delete f[d],g)});return a(b,f,d)}),X=a=>function(...b){let c=V(),[d,e,f]=U(b),g=N(c,f),h=a,{use:i}=g,j=(i||[]).concat(W);for(let a=j.length;a--;)h=j[a](h);return h(d,e||g.fetcher||null,g)},Y=(a,b,c)=>{let d=b[a]||(b[a]=[]);return d.push(c),()=>{let a=d.indexOf(c);a>=0&&(d[a]=d[d.length-1],d.pop())}},Z=(a,b)=>(...c)=>{let[d,e,f]=U(c),g=(f.use||[]).concat(b);return a(d,e,{...f,use:g})};S&&(window.__SWR_DEVTOOLS_REACT__=b.default),a.s(["subscribeCallback",()=>Y,"useSWRConfig",()=>V,"withArgs",()=>X,"withMiddleware",()=>Z],915804),a.s(["SWRGlobalState",()=>e],365126),a.s(["serialize",()=>F],614581),a.s(["createCacheHelper",()=>r],682197),a.s(["isUndefined",()=>i],134545),a.s(["UNDEFINED",()=>g],467691),a.s(["getTimestamp",()=>H],410040),a.s(["isFunction",()=>j],299657);a.s(["useIsomorphicLayoutEffect",()=>z],478224),a.s(["IS_REACT_LEGACY",()=>w],355855),a.s(["mergeObjects",()=>k],910489);let $=()=>{},_=$(),aa=(new WeakMap,b.default.use||(a=>{switch(a.status){case"pending":throw a;case"fulfilled":return a.value;case"rejected":throw a.reason;default:throw a.status="pending",a.then(b=>{a.status="fulfilled",a.value=b},b=>{a.status="rejected",a.reason=b}),a}})),ab={dedupe:!0},ac=h.defineProperty(P,"defaultValue",{value:M}),ad=X((a,d,f)=>{let{cache:h,compare:m,suspense:n,fallbackData:o,revalidateOnMount:p,revalidateIfStale:q,refreshInterval:s,refreshWhenHidden:t,refreshWhenOffline:u,keepPreviousData:v}=f,[A,B,C,D]=e.get(h),[E,G]=F(a),J=(0,b.useRef)(!1),K=(0,b.useRef)(!1),L=(0,b.useRef)(E),M=(0,b.useRef)(d),N=(0,b.useRef)(f),O=()=>N.current.isVisible()&&N.current.isOnline(),[P,R,S,T]=r(h,E),U=(0,b.useRef)({}).current,V=i(o)?i(f.fallback)?g:f.fallback[E]:o,W=(a,b)=>{for(let c in U)if("data"===c){if(!m(a[c],b[c])&&(!i(a[c])||!m(ag,b[c])))return!1}else if(b[c]!==a[c])return!1;return!0},X=(0,b.useMemo)(()=>{let a=!!E&&!!d&&(i(p)?!N.current.isPaused()&&!n&&!1!==q:p),b=b=>{let c=k(b);return(delete c._k,a)?{isValidating:!0,isLoading:!0,...c}:c},c=P(),e=T(),f=b(c),g=c===e?f:b(e),h=f;return[()=>{let a=b(P());return W(a,h)?(h.data=a.data,h.isLoading=a.isLoading,h.isValidating=a.isValidating,h.error=a.error,h):(h=a,a)},()=>g]},[h,E]),Z=(0,c.useSyncExternalStore)((0,b.useCallback)(a=>S(E,(b,c)=>{W(c,b)||a()}),[h,E]),X[0],X[1]),$=!J.current,_=A[E]&&A[E].length>0,ac=Z.data,ad=i(ac)?V&&l(V)?aa(V):V:ac,ae=Z.error,af=(0,b.useRef)(ad),ag=v?i(ac)?i(af.current)?ad:af.current:ac:ad,ah=(!_||!!i(ae))&&($&&!i(p)?p:!N.current.isPaused()&&(n?!i(ad)&&q:i(ad)||q)),ai=!!(E&&d&&$&&ah),aj=i(Z.isValidating)?ai:Z.isValidating,ak=i(Z.isLoading)?ai:Z.isLoading,al=(0,b.useCallback)(async a=>{let b,c,d=M.current;if(!E||!d||K.current||N.current.isPaused())return!1;let e=!0,h=a||{},k=!C[E]||!h.dedupe,l=()=>w?!K.current&&E===L.current&&J.current:E===L.current,n={isValidating:!1,isLoading:!1},o=()=>{R(n)},p=()=>{let a=C[E];a&&a[1]===c&&delete C[E]},q={isValidating:!0};i(P().data)&&(q.isLoading=!0);try{if(k&&(R(q),f.loadingTimeout&&i(P().data)&&setTimeout(()=>{e&&l()&&N.current.onLoadingSlow(E,f)},f.loadingTimeout),C[E]=[d(G),H()]),[b,c]=C[E],b=await b,k&&setTimeout(p,f.dedupingInterval),!C[E]||C[E][1]!==c)return k&&l()&&N.current.onDiscarded(E),!1;n.error=g;let a=B[E];if(!i(a)&&(c<=a[0]||c<=a[1]||0===a[1]))return o(),k&&l()&&N.current.onDiscarded(E),!1;let h=P().data;n.data=m(h,b)?h:b,k&&l()&&N.current.onSuccess(b,E,f)}catch(c){p();let a=N.current,{shouldRetryOnError:b}=a;!a.isPaused()&&(n.error=c,k&&l()&&(a.onError(c,E,a),(!0===b||j(b)&&b(c))&&(!N.current.revalidateOnFocus||!N.current.revalidateOnReconnect||O())&&a.onErrorRetry(c,E,a,a=>{let b=A[E];b&&b[0]&&b[0](Q.ERROR_REVALIDATE_EVENT,a)},{retryCount:(h.retryCount||0)+1,dedupe:!0})))}return e=!1,o(),!0},[E,h]),am=(0,b.useCallback)((...a)=>I(h,L.current,...a),[]);if(z(()=>{M.current=d,N.current=f,i(ac)||(af.current=ac)}),z(()=>{if(!E)return;let a=al.bind(g,ab),b=0;N.current.revalidateOnFocus&&(b=Date.now()+N.current.focusThrottleInterval);let c=Y(E,A,(c,d={})=>{if(c==Q.FOCUS_EVENT){let c=Date.now();N.current.revalidateOnFocus&&c>b&&O()&&(b=c+N.current.focusThrottleInterval,a())}else if(c==Q.RECONNECT_EVENT)N.current.revalidateOnReconnect&&O()&&a();else if(c==Q.MUTATE_EVENT)return al();else if(c==Q.ERROR_REVALIDATE_EVENT)return al(d)});return K.current=!1,L.current=E,J.current=!0,R({_k:G}),ah&&!C[E]&&(i(ad)||x?a():y(a)),()=>{K.current=!0,c()}},[E]),z(()=>{let a;function b(){let b=j(s)?s(P().data):s;b&&-1!==a&&(a=setTimeout(c,b))}function c(){!P().error&&(t||N.current.isVisible())&&(u||N.current.isOnline())?al(ab).then(b):b()}return b(),()=>{a&&(clearTimeout(a),a=-1)}},[s,t,u,E]),(0,b.useDebugValue)(ag),n&&i(ad)&&E){if(!w&&x)throw Error("Fallback data is required when using Suspense in SSR.");M.current=d,N.current=f,K.current=!1;let a=D[E];if(i(a)||aa(am(a)),i(ae)){let a=al(ab);i(ag)||(a.status="fulfilled",a.value=!0),aa(a)}else throw ae}return{mutate:am,get data(){return U.data=!0,ag},get error(){return U.error=!0,ae},get isValidating(){return U.isValidating=!0,aj},get isLoading(){return U.isLoading=!0,ak}}});a.s(["SWRConfig",()=>ac,"default",()=>ad],995728)},761686,a=>{"use strict";let b,c;a.i(452148),a.i(561726),a.i(155647),a.i(152240);var d,e=a.i(659010),f=a.i(319190),g=a.i(875910);a.i(628150);var h=a.i(491940);a.i(102986);var i=a.i(122900),j=a.i(862563),k=a.i(401122),l=a.i(995728),m=a.i(915804),n=a.i(365126),o=a.i(652307),o=o,p=a.i(16510),q=a.i(682197),r=a.i(134545),s=a.i(478224),t=a.i(467691),u=a.i(614581),v=a.i(299657),w=a.i(33384);let x=()=>{},y=x(),z=Object,A=a=>a===y,B=new WeakMap,C=(a,b)=>a===`[object ${b}]`,D=0,E=a=>{let b,c,d=typeof a,e=z.prototype.toString.call(a),f=C(e,"Date"),g=C(e,"RegExp"),h=C(e,"Object");if(z(a)!==a||f||g)b=f?a.toJSON():"symbol"==d?a.toString():"string"==d?JSON.stringify(a):""+a;else{if(b=B.get(a))return b;if(b=++D+"~",B.set(a,b),Array.isArray(a)){for(c=0,b="@";c<a.length;c++)b+=E(a[c])+",";B.set(a,b)}if(h){b="#";let d=z.keys(a).sort();for(;!A(c=d.pop());)A(a[c])||(b+=c+":"+E(a[c])+",");B.set(a,b)}}return b},F=Promise.resolve(),G=(0,m.withMiddleware)(l.default,a=>(b,c,d)=>{let e,f=(0,k.useRef)(!1),{cache:g,initialSize:h=1,revalidateAll:i=!1,persistSize:j=!1,revalidateFirstPage:l=!0,revalidateOnMount:m=!1,parallel:x=!1}=d,[,,,y]=n.SWRGlobalState.get(o.c);try{(e=(a=>{if("function"==typeof a)try{a=a()}catch(b){a=""}let b=a;return[a="string"==typeof a?a:(Array.isArray(a)?a.length:a)?E(a):"",b]})(b?b(0,null):null)[0])&&(e=p.INFINITE_PREFIX+e)}catch(a){}let[z,A,B]=(0,q.createCacheHelper)(g,e),C=(0,k.useCallback)(()=>(0,r.isUndefined)(z()._l)?h:z()._l,[g,e,h]);(0,w.useSyncExternalStore)((0,k.useCallback)(a=>e?B(e,()=>{a()}):()=>{},[g,e]),C,C);let D=(0,k.useCallback)(()=>{let a=z()._l;return(0,r.isUndefined)(a)?h:a},[e,h]),G=(0,k.useRef)(D());(0,s.useIsomorphicLayoutEffect)(()=>{if(!f.current){f.current=!0;return}e&&A({_l:j?G.current:D()})},[e,g]);let H=m&&!f.current,I=a(e,async a=>{let e=z()._i,f=z()._r;A({_r:t.UNDEFINED});let h=[],j=D(),[k]=(0,q.createCacheHelper)(g,a),m=k().data,n=[],o=null;for(let a=0;a<j;++a){let[j,k]=(0,u.serialize)(b(a,x?null:o));if(!j)break;let[p,s]=(0,q.createCacheHelper)(g,j),t=p().data,v=i||e||(0,r.isUndefined)(t)||l&&!a&&!(0,r.isUndefined)(m)||H||m&&!(0,r.isUndefined)(m[a])&&!d.compare(m[a],t);if(c&&("function"==typeof f?f(t,k):v)){let b=async()=>{if(j in y){let a=y[j];delete y[j],t=await a}else t=await c(k);s({data:t,_k:k}),h[a]=t};x?n.push(b):await b()}else h[a]=t;x||(o=t)}return x&&await Promise.all(n.map(a=>a())),A({_i:t.UNDEFINED}),h},d),J=(0,k.useCallback)(function(a,b){let c="boolean"==typeof b?{revalidate:b}:b||{},d=!1!==c.revalidate;return e?(d&&((0,r.isUndefined)(a)?A({_i:!0,_r:c.revalidate}):A({_i:!1,_r:c.revalidate})),arguments.length?I.mutate(a,{...c,revalidate:d}):I.mutate()):F},[e,g]),K=(0,k.useCallback)(a=>{let c;if(!e)return F;let[,d]=(0,q.createCacheHelper)(g,e);if((0,v.isFunction)(a)?c=a(D()):"number"==typeof a&&(c=a),"number"!=typeof c)return F;d({_l:c}),G.current=c;let f=[],[h]=(0,q.createCacheHelper)(g,e),i=null;for(let a=0;a<c;++a){let[c]=(0,u.serialize)(b(a,i)),[d]=(0,q.createCacheHelper)(g,c),e=c?d().data:t.UNDEFINED;if((0,r.isUndefined)(e))return J(h().data);f.push(e),i=e}return J(f)},[e,g,J,D]);return{size:D(),setSize:K,mutate:J,get data(){return I.data},get error(){return I.error},get isValidating(){return I.isValidating},get isLoading(){return I.isLoading}}});var H=Object.prototype.hasOwnProperty;function I(a,b,c){for(c of a.keys())if(J(c,b))return c}function J(a,b){var c,d,e;if(a===b)return!0;if(a&&b&&(c=a.constructor)===b.constructor){if(c===Date)return a.getTime()===b.getTime();if(c===RegExp)return a.toString()===b.toString();if(c===Array){if((d=a.length)===b.length)for(;d--&&J(a[d],b[d]););return -1===d}if(c===Set){if(a.size!==b.size)return!1;for(d of a)if((e=d)&&"object"==typeof e&&!(e=I(b,e))||!b.has(e))return!1;return!0}if(c===Map){if(a.size!==b.size)return!1;for(d of a)if((e=d[0])&&"object"==typeof e&&!(e=I(b,e))||!J(d[1],b.get(e)))return!1;return!0}if(c===ArrayBuffer)a=new Uint8Array(a),b=new Uint8Array(b);else if(c===DataView){if((d=a.byteLength)===b.byteLength)for(;d--&&a.getInt8(d)===b.getInt8(d););return -1===d}if(ArrayBuffer.isView(a)){if((d=a.byteLength)===b.byteLength)for(;d--&&a[d]===b[d];);return -1===d}if(!c||"object"==typeof a){for(c in d=0,a)if(H.call(a,c)&&++d&&!H.call(b,c)||!(c in b)||!J(a[c],b[c]))return!1;return Object.keys(b).length===d}}return a!=a&&b!=b}var K=a.i(355855),L=a.i(910489),M=a.i(410040);let N=K.IS_REACT_LEGACY?a=>{a()}:k.default.startTransition,O=(0,m.withMiddleware)(l.default,()=>(a,b,c={})=>{let{mutate:d}=(0,m.useSWRConfig)(),e=(0,k.useRef)(a),f=(0,k.useRef)(b),g=(0,k.useRef)(c),h=(0,k.useRef)(0),[i,j,l]=(a=>{let[,b]=(0,k.useState)({}),c=(0,k.useRef)(!1),d=(0,k.useRef)(a),e=(0,k.useRef)({data:!1,error:!1,isValidating:!1}),f=(0,k.useCallback)(a=>{let f=!1,g=d.current;for(let b in a)Object.prototype.hasOwnProperty.call(a,b)&&g[b]!==a[b]&&(g[b]=a[b],e.current[b]&&(f=!0));f&&!c.current&&b({})},[]);return(0,s.useIsomorphicLayoutEffect)(()=>(c.current=!1,()=>{c.current=!0})),[d,e.current,f]})({data:t.UNDEFINED,error:t.UNDEFINED,isMutating:!1}),n=i.current,o=(0,k.useCallback)(async(a,b)=>{let[c,i]=(0,u.serialize)(e.current);if(!f.current)throw Error("Can’t trigger the mutation: missing fetcher.");if(!c)throw Error("Can’t trigger the mutation: missing key.");let j=(0,L.mergeObjects)((0,L.mergeObjects)({populateCache:!1,throwOnError:!0},g.current),b),k=(0,M.getTimestamp)();h.current=k,l({isMutating:!0});try{let b=await d(c,f.current(i,{arg:a}),(0,L.mergeObjects)(j,{throwOnError:!0}));return h.current<=k&&(N(()=>l({data:b,isMutating:!1,error:void 0})),null==j.onSuccess||j.onSuccess.call(j,b,c,j)),b}catch(a){if(h.current<=k&&(N(()=>l({error:a,isMutating:!1})),null==j.onError||j.onError.call(j,a,c,j),j.throwOnError))throw a}},[]),p=(0,k.useCallback)(()=>{h.current=(0,M.getTimestamp)(),l({data:t.UNDEFINED,error:t.UNDEFINED,isMutating:!1})},[]);return(0,s.useIsomorphicLayoutEffect)(()=>{e.current=a,f.current=b,g.current=c}),{trigger:o,reset:p,get data(){return j.data=!0,n.data},get error(){return j.error=!0,n.error},get isMutating(){return j.isMutating=!0,n.isMutating}}});function P(a,b){if(!a)throw"string"==typeof b?Error(b):Error(`${b.displayName} not found`)}let Q=(a,b)=>{let{assertCtxFn:c=P}=b||{},d=k.default.createContext(void 0);return d.displayName=a,[d,()=>{let b=k.default.useContext(d);return c(b,`${a} not found`),b.value},()=>{let a=k.default.useContext(d);return a?a.value:{}}]};function R({swrConfig:a,children:b}){return k.default.createElement(l.SWRConfig,{value:a},b)}let[S,T]=Q("ClerkInstanceContext"),[U,V]=Q("UserContext"),[W,X]=Q("ClientContext"),[Y,Z]=Q("SessionContext");k.default.createContext({});let[$,_]=Q("CheckoutContext"),aa=({children:a,...b})=>k.default.createElement($.Provider,{value:{value:b}},a),[ab,ac]=Q("OrganizationContext"),ad=({children:a,organization:b,swrConfig:c})=>k.default.createElement(R,{swrConfig:c},k.default.createElement(ab.Provider,{value:{value:{organization:b}}},a));function ae(a){if(!k.default.useContext(S)){if("function"==typeof a)return void a();throw Error(`${a} can only be used within the <ClerkProvider /> component.

Possible fixes:
1. Ensure that the <ClerkProvider /> is correctly wrapping your application where this component is used.
2. 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.

Learn more: https://clerk.com/docs/components/clerk-provider`.trim())}}function af(a){return{queryKey:[a.stablePrefix,a.authenticated,a.tracked,a.untracked],invalidationKey:[a.stablePrefix,a.authenticated,a.tracked],stableKey:a.stablePrefix,authenticated:a.authenticated}}function ag(a){let{queryKey:b}=a;return{type:b[0],...b[2],...b[3].args}}let ah=(a,b)=>{let c="boolean"==typeof a&&a,d=(0,k.useRef)(c?b.initialPage:a?.initialPage??b.initialPage),e=(0,k.useRef)(c?b.pageSize:a?.pageSize??b.pageSize),f={};for(let d of Object.keys(b))f[d]=c?b[d]:a?.[d]??b[d];return{...f,initialPage:d.current,pageSize:e.current}};function ai(a,b){let c=new Set(Object.keys(b)),d={};for(let b of Object.keys(a))c.has(b)||(d[b]=a[b]);return d}let aj={dedupingInterval:6e4,focusThrottleInterval:12e4},ak={...aj,revalidateFirstPage:!1},al=a=>{let b,c,{fetcher:d,config:e,keys:f}=a,[g,h]=(0,k.useState)(e.initialPage??1),i=(0,k.useRef)(e.initialPage??1),j=(0,k.useRef)(e.pageSize??10),m=e.enabled??!0,n="cache"===e.__experimental_mode,o=e.infinite??!1,p=e.keepPreviousData??!1,q=e.isSignedIn,r={...ag(f),initialPage:g,pageSize:j.current},s=(b=(0,k.useRef)(q),c=(0,k.useRef)(null),b.current!==q&&(c.current=b.current,b.current=q),c.current),t=!o&&m&&(!!n||!!d),{data:u,isValidating:v,isLoading:w,error:x,mutate:y}=(0,l.default)("boolean"==typeof q?!0===s&&!1===q||q&&t?r:null:t?r:null,!n&&d?a=>!1===q||!1===t?null:d(ai(a,{type:f.queryKey[0],...f.queryKey[2]})):null,{keepPreviousData:p,...aj}),{data:z,isLoading:A,isValidating:B,error:C,size:D,setSize:E,mutate:F}=G(a=>o&&m&&!1!==q?{...ag(f),initialPage:i.current+a,pageSize:j.current}:null,a=>{let b=ai(a,{type:f.queryKey[0],...f.queryKey[2]});return d?.(b)},ak),H=(0,k.useMemo)(()=>o?D:g,[o,D,g]),I=(0,k.useCallback)(a=>o?void E(a):h(a),[E,o]),J=(0,k.useMemo)(()=>o?z?.map(a=>a?.data).flat()??[]:u?.data??[],[o,u,z]),K=(0,k.useMemo)(()=>o?z?.[z?.length-1]?.total_count||0:u?.total_count??0,[o,u,z]),L=o?A:w,M=o?B:v,N=(o?C:x)??null,O=(0,k.useCallback)(()=>{I(a=>Math.max(0,a+1))},[I]),P=(0,k.useCallback)(()=>{I(a=>Math.max(0,a-1))},[I]),Q=(i.current-1)*j.current;return{data:J,count:K,error:N,isLoading:L,isFetching:M,isError:!!N,page:H,pageCount:Math.ceil((K-Q)/j.current),fetchPage:I,fetchNext:O,fetchPrevious:P,hasNextPage:K-Q*j.current>H*j.current,hasPreviousPage:(H-1)*j.current>Q*j.current,revalidate:o?()=>F():()=>y(),setData:o?a=>F(a,{revalidate:!1}):a=>y(a,{revalidate:!1})}},am=()=>(ae("useClerk"),T());function an(a){let b=am(),c=(0,k.useRef)(!1);(0,k.useEffect)(()=>{c.current||(c.current=!0,b.__internal_attemptToEnableEnvironmentSetting?.({for:"organizations",caller:a}))},[b,a])}let ao={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};function ap(a){let{domains:b,membershipRequests:c,memberships:d,invitations:e}=a||{};ae("useOrganization"),an("useOrganization");let{organization:f}=ac(),g=Z(),h=ah(b,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,enrollmentMode:void 0}),k=ah(c,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),l=ah(d,{initialPage:1,pageSize:10,role:void 0,keepPreviousData:!1,infinite:!1,query:void 0}),m=ah(e,{initialPage:1,pageSize:10,status:["pending"],keepPreviousData:!1,infinite:!1}),n=T();n.telemetry?.record((0,j.eventMethodCalled)("useOrganization"));let o=void 0===b?void 0:{initialPage:h.initialPage,pageSize:h.pageSize,enrollmentMode:h.enrollmentMode},p=void 0===c?void 0:{initialPage:k.initialPage,pageSize:k.pageSize,status:k.status},q=void 0===d?void 0:{initialPage:l.initialPage,pageSize:l.pageSize,role:l.role,query:l.query},r=void 0===e?void 0:{initialPage:m.initialPage,pageSize:m.pageSize,status:m.status},s=al({fetcher:f?.getDomains,config:{keepPreviousData:h.keepPreviousData,infinite:h.infinite,enabled:!!o,isSignedIn:!!f,initialPage:h.initialPage,pageSize:h.pageSize},keys:af({stablePrefix:"domains",authenticated:!!f,tracked:{organizationId:f?.id},untracked:{args:o}})}),t=al({fetcher:f?.getMembershipRequests,config:{keepPreviousData:k.keepPreviousData,infinite:k.infinite,enabled:!!p,isSignedIn:!!f,initialPage:k.initialPage,pageSize:k.pageSize},keys:af({stablePrefix:"membershipRequests",authenticated:!!f,tracked:{organizationId:f?.id},untracked:{args:p}})}),u=al({fetcher:f?.getMemberships,config:{keepPreviousData:l.keepPreviousData,infinite:l.infinite,enabled:!!q,isSignedIn:!!f,initialPage:l.initialPage,pageSize:l.pageSize},keys:af({stablePrefix:"memberships",authenticated:!!f,tracked:{organizationId:f?.id},untracked:{args:q}})}),v=al({fetcher:f?.getInvitations,config:{keepPreviousData:m.keepPreviousData,infinite:m.infinite,enabled:!!r,isSignedIn:!!f,initialPage:m.initialPage,pageSize:m.pageSize},keys:af({stablePrefix:"invitations",authenticated:!!f,tracked:{organizationId:f?.id},untracked:{args:r}})});return void 0===f?{isLoaded:!1,organization:void 0,membership:void 0,domains:ao,membershipRequests:ao,memberships:ao,invitations:ao}:null===f?{isLoaded:!0,organization:null,membership:null,domains:null,membershipRequests:null,memberships:null,invitations:null}:!n.loaded&&f?{isLoaded:!0,organization:f,membership:void 0,domains:ao,membershipRequests:ao,memberships:ao,invitations:ao}:{isLoaded:n.loaded,organization:f,membership:(0,i.getCurrentOrganizationMembership)(g.user.organizationMemberships,f.id),domains:s,membershipRequests:t,memberships:u,invitations:v}}let aq={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};function ar(a){let{userMemberships:b,userInvitations:c,userSuggestions:d}=a||{};ae("useOrganizationList"),an("useOrganizationList");let e=ah(b,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1}),f=ah(c,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),g=ah(d,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),h=T(),i=V();h.telemetry?.record((0,j.eventMethodCalled)("useOrganizationList"));let k=void 0===b?void 0:{initialPage:e.initialPage,pageSize:e.pageSize},l=void 0===c?void 0:{initialPage:f.initialPage,pageSize:f.pageSize,status:f.status},m=void 0===d?void 0:{initialPage:g.initialPage,pageSize:g.pageSize,status:g.status},n=!!(h.loaded&&i),o=al({fetcher:i?.getOrganizationMemberships,config:{keepPreviousData:e.keepPreviousData,infinite:e.infinite,enabled:!!k,isSignedIn:!!i,initialPage:e.initialPage,pageSize:e.pageSize},keys:af({stablePrefix:"userMemberships",authenticated:!!i,tracked:{userId:i?.id},untracked:{args:k}})}),p=al({fetcher:i?.getOrganizationInvitations,config:{keepPreviousData:f.keepPreviousData,infinite:f.infinite,enabled:!!l,isSignedIn:!!i,initialPage:f.initialPage,pageSize:f.pageSize},keys:af({stablePrefix:"userInvitations",authenticated:!!i,tracked:{userId:i?.id},untracked:{args:l}})}),q=al({fetcher:i?.getOrganizationSuggestions,config:{keepPreviousData:g.keepPreviousData,infinite:g.infinite,enabled:!!m,isSignedIn:!!i,initialPage:g.initialPage,pageSize:g.pageSize},keys:af({stablePrefix:"userSuggestions",authenticated:!!i,tracked:{userId:i?.id},untracked:{args:m}})});return n?{isLoaded:n,setActive:h.setActive,createOrganization:h.createOrganization,userMemberships:o,userInvitations:p,userSuggestions:q}:{isLoaded:!1,createOrganization:void 0,setActive:void 0,userMemberships:aq,userInvitations:aq,userSuggestions:aq}}let as=k.default.useEffect,at="useSession",au=()=>{ae(at);let a=Z(),b=T();return(b.telemetry?.record((0,j.eventMethodCalled)(at)),void 0===a)?{isLoaded:!1,isSignedIn:void 0,session:void 0}:null===a?{isLoaded:!0,isSignedIn:!1,session:null}:{isLoaded:!0,isSignedIn:b.isSignedIn,session:a}},av="useSessionList",aw=()=>{ae(av);let a=T(),b=X();return(T().telemetry?.record((0,j.eventMethodCalled)(av)),b)?{isLoaded:!0,sessions:b.sessions,setActive:a.setActive}:{isLoaded:!1,sessions:void 0,setActive:void 0}},ax="useUser";function ay(){ae(ax);let a=V();return(T().telemetry?.record((0,j.eventMethodCalled)(ax)),void 0===a)?{isLoaded:!1,isSignedIn:void 0,user:void 0}:null===a?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:a}}async function az(a){try{let b=await a;if(b instanceof Response)return b.json();return b}catch(a){if((0,g.isClerkAPIResponseError)(a)&&a.errors.find(({code:a})=>"session_reverification_required"===a))return(0,e.reverificationError)();throw a}}let aA=(a,b)=>{let{__internal_openReverification:c,telemetry:d}=am(),i=(0,k.useRef)(a),l=(0,k.useRef)(b);return d?.record((0,j.eventMethodCalled)("useReverification",{onNeedsReverification:!!b?.onNeedsReverification})),as(()=>{i.current=a,l.current=b}),(0,k.useCallback)((...a)=>{var b;return(b={openUIComponent:c,telemetry:d,...l.current},function(a){return async(...c)=>{let d=await az(a(...c));if((0,e.isReverificationHint)(d)){let e=(0,h.createDeferredPromise)(),i=(0,f.validateReverificationConfig)(d.clerk_error.metadata?.reverification),j=i?i().level:void 0,k=()=>{e.reject(new g.ClerkRuntimeError("User cancelled attempted verification",{code:"reverification_cancelled"}))},l=()=>{e.resolve(!0)};void 0===b.onNeedsReverification?b.openUIComponent?.({level:j,afterVerification:l,afterVerificationCancelled:k}):b.onNeedsReverification({cancel:k,complete:l,level:j}),await e.promise,d=await az(a(...c))}return d}})(i.current)(...a)},[c,d])};function aB({hookName:a,resourceType:b,useFetcher:c,options:d}){return function(e){let{for:f,enabled:g,...h}=e||{},i=f||"user";ae(a);let k=c(i),l=ah(h,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,__experimental_mode:void 0}),m=T(),n=V(),{organization:o}=ac();m.telemetry?.record((0,j.eventMethodCalled)(a));let p="organization"===i,q=function(a){let b=T(),c=a?.enabled??!0,d=b.__unstable__environment,e=V(),{organization:f}=ac(),g=a?.for==="organization",h=g?d?.commerceSettings.billing.organization.enabled:d?.commerceSettings.billing.user.enabled,i=!(a?.authenticated??!0)||(!g||!!f?.id)&&!!e?.id;return h&&c&&b.loaded&&i}({for:i,enabled:g,authenticated:!d?.unauthenticated}),r=void 0===h?void 0:{initialPage:l.initialPage,pageSize:l.pageSize,...d?.unauthenticated?{}:p?{orgId:o?.id}:{}},s=!!r&&m.loaded&&!!q;return al({fetcher:k,config:{keepPreviousData:l.keepPreviousData,infinite:l.infinite,enabled:s,...d?.unauthenticated?{}:{isSignedIn:null!==n},__experimental_mode:l.__experimental_mode,initialPage:l.initialPage,pageSize:l.pageSize},keys:af({stablePrefix:b,authenticated:!d?.unauthenticated,tracked:d?.unauthenticated?{for:i}:{userId:n?.id,...p?{_orgId:o?.id}:{}},untracked:{args:r}})})}}aB({hookName:"useStatements",resourceType:"billing-statements",useFetcher:()=>{let a=T();if(a.loaded)return a.billing.getStatements}}),aB({hookName:"usePaymentAttempts",resourceType:"billing-payment-attempts",useFetcher:()=>{let a=T();if(a.loaded)return a.billing.getPaymentAttempts}}),aB({hookName:"usePaymentMethods",resourceType:"billing-payment-methods",useFetcher:a=>{let{organization:b}=ac(),c=V();return"organization"===a?b?.getPaymentMethods:c?.getPaymentMethods}}),aB({hookName:"usePlans",resourceType:"billing-plans",useFetcher:a=>{let b=T();if(b.loaded)return c=>b.billing.getPlans({...c,for:a})},options:{unauthenticated:!0}});let aC=a=>{let b=_(),{for:c,planId:d,planPeriod:e}=a||b,f=am(),{organization:g}=ac(),{isLoaded:h,user:i}=ay();if(!h)throw Error("Clerk: Ensure that `useCheckout` is inside a component wrapped with `<ClerkLoaded />`.");if(!i)throw Error("Clerk: Ensure that `useCheckout` is inside a component wrapped with `<SignedIn />`.");if("organization"===c&&!g)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 j=(0,k.useMemo)(()=>f.__experimental_checkout({planId:d,planPeriod:e,for:c}),[i.id,g?.id,d,e,c]),l=(0,k.useSyncExternalStore)(a=>j.subscribe(a),()=>j.getState(),()=>j.getState());return{checkout:{...(0,k.useMemo)(()=>{if(!l.checkout)return{id:null,externalClientSecret:null,externalGatewayId:null,totals:null,isImmediatePlanChange:null,planPeriod:null,plan:null,paymentMethod:null,freeTrialEndsAt:null,payer:null,needsPaymentMethod:null,planPeriodStart:null};let{reload:a,confirm:b,pathRoot:c,...d}=l.checkout;return d},[l.checkout]),getState:j.getState,start:j.start,confirm:j.confirm,clear:j.clear,finalize:j.finalize,isStarting:l.isStarting,isConfirming:l.isConfirming,error:l.error,status:l.status,fetchStatus:l.fetchStatus}}},aD=a=>{let b=(0,k.useRef)(a);return(0,k.useEffect)(()=>{b.current=a},[a]),b.current},aE=(a,b,c)=>{let d=!!c,e=(0,k.useRef)(c);(0,k.useEffect)(()=>{e.current=c},[c]),(0,k.useEffect)(()=>{if(!d||!a)return()=>{};let c=(...a)=>{e.current&&e.current(...a)};return a.on(b,c),()=>{a.off(b,c)}},[d,b,a,e])},aF=k.default.createContext(null);aF.displayName="ElementsContext";let aG=(a,b)=>{if(!a)throw Error(`Could not find Elements context; You need to wrap the part of your app that ${b} in an <Elements> provider.`);return a},aH=({stripe:a,options:b,children:c})=>{let d=k.default.useMemo(()=>aK(a),[a]),[e,f]=k.default.useState(()=>({stripe:"sync"===d.tag?d.stripe:null,elements:"sync"===d.tag?d.stripe.elements(b):null}));k.default.useEffect(()=>{let a=!0,c=a=>{f(c=>c.stripe?c:{stripe:a,elements:a.elements(b)})};return"async"!==d.tag||e.stripe?"sync"!==d.tag||e.stripe||c(d.stripe):d.stripePromise.then(b=>{b&&a&&c(b)}),()=>{a=!1}},[d,e,b]);let g=aD(a);k.default.useEffect(()=>{null!==g&&g!==a&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[g,a]);let h=aD(b);return k.default.useEffect(()=>{if(!e.elements)return;let a=aO(b,h,["clientSecret","fonts"]);a&&e.elements.update(a)},[b,h,e.elements]),k.default.createElement(aF.Provider,{value:e},c)},aI="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.",aJ=(a,b=aI)=>{if(null===a||aN(a))return a;throw Error(b)},aK=(a,b=aI)=>{if(aM(a))return{tag:"async",stripePromise:Promise.resolve(a).then(a=>aJ(a,b))};let c=aJ(a,b);return null===c?{tag:"empty"}:{tag:"sync",stripe:c}},aL=a=>null!==a&&"object"==typeof a,aM=a=>aL(a)&&"function"==typeof a.then,aN=a=>aL(a)&&"function"==typeof a.elements&&"function"==typeof a.createToken&&"function"==typeof a.createPaymentMethod&&"function"==typeof a.confirmCardPayment,aO=(a,b,c)=>aL(a)?Object.keys(a).reduce((d,e)=>{let f=!aL(b)||!aQ(a[e],b[e]);return c.includes(e)?(f&&console.warn(`Unsupported prop change: options.${e} is not a mutable property.`),d):f?{...d||{},[e]:a[e]}:d},null):null,aP="[object Object]",aQ=(a,b)=>{if(!aL(a)||!aL(b))return a===b;let c=Array.isArray(a);if(c!==Array.isArray(b))return!1;let d=Object.prototype.toString.call(a)===aP;if(d!==(Object.prototype.toString.call(b)===aP))return!1;if(!d&&!c)return a===b;let e=Object.keys(a),f=Object.keys(b);if(e.length!==f.length)return!1;let g={};for(let a=0;a<e.length;a+=1)g[e[a]]=!0;for(let a=0;a<f.length;a+=1)g[f[a]]=!0;let h=Object.keys(g);return h.length===e.length&&h.every(c=>aQ(a[c],b[c]))},aR=a=>aG(k.default.useContext(aF),a),aS=(d="payment",b=`${d.charAt(0).toUpperCase()+d.slice(1)}Element`,(c=a=>{aR(`mounts <${b}>`);let{id:c,className:d}=a;return k.default.createElement("div",{id:c,className:d})}).displayName=b,c.__elementType=d,c),[aT,aU]=Q("PaymentElementContext"),[aV,aW]=Q("StripeUtilsContext"),aX=({children:a})=>{let b=(()=>{let{stripe:a}=aR("calls useStripe()");return a})(),c=(()=>{let{elements:a}=aG(k.default.useContext(aF),"calls useElements()");return a})();return k.default.createElement(aV.Provider,{value:{value:{stripe:b,elements:c}}},a)},aY=({children:a})=>k.default.createElement(aV.Provider,{value:{value:{}}},a),aZ=({children:a,...b})=>{let c=((a="user")=>{let b,c=(b=am(),(0,l.default)("clerk-stripe-sdk",async()=>({loadStripe:await b.__internal_loadStripeJs()}),{keepPreviousData:!0,revalidateOnFocus:!1,dedupingInterval:1/0}).data??null),d=am().__unstable__environment,{initializedPaymentMethod:e,initializePaymentMethod:f}=function(a){let{for:b="user"}=a??{},{organization:c}=ac(),d=V(),e="organization"===b?c:d,{data:f,trigger:g}=O(e?.id?{key:"billing-payment-method-initialize",resourceId:e.id,for:b}:null,()=>e?.initializePaymentMethod({gateway:"stripe"}));return(0,k.useEffect)(()=>{e?.id&&g().catch(()=>{})},[e?.id,g]),{initializedPaymentMethod:f,initializePaymentMethod:g}}({for:a}),g=d?.commerceSettings.billing.stripePublishableKey??void 0;return{stripe:function(a){let{stripeClerkLibs:b,externalGatewayId:c,stripePublishableKey:d}=a;return(0,l.default)(b&&c&&d?{key:"stripe-sdk",externalGatewayId:c,stripePublishableKey:d}:null,({stripePublishableKey:a,externalGatewayId:c})=>b?.loadStripe(a,{stripeAccount:c}),{keepPreviousData:!0,revalidateOnFocus:!1,dedupingInterval:6e4}).data}({stripeClerkLibs:c,externalGatewayId:e?.externalGatewayId,stripePublishableKey:g}),initializePaymentMethod:f,externalClientSecret:e?.externalClientSecret,paymentMethodOrder:e?.paymentMethodOrder}})(b.for),[d,e]=(0,k.useState)(!1);return k.default.createElement(aT.Provider,{value:{value:{...b,...c,setIsPaymentElementReady:e,isPaymentElementReady:d}}},a)},a$=({children:a,...b})=>k.default.createElement(aZ,b,k.default.createElement(a_,null,a)),a_=a=>{let{stripe:b,externalClientSecret:c,stripeAppearance:d}=aU(),e=(()=>{let a=am(),b="en";try{b=a.__internal_getOption("localization")?.locale||"en"}catch{}return b.split("-")[0]})();return b&&c?k.default.createElement(aH,{key:c,stripe:b,options:{loader:"never",clientSecret:c,appearance:{variables:d},locale:e}},k.default.createElement(aX,null,a.children)):k.default.createElement(aY,null,a.children)},a0=({fallback:a})=>{let{setIsPaymentElementReady:b,paymentMethodOrder:c,checkout:d,stripe:e,externalClientSecret:f,paymentDescription:g,for:h}=aU(),i=am().__unstable__environment,j=(0,k.useMemo)(()=>{if(d&&d.totals&&d.plan)return{recurringPaymentRequest:{paymentDescription:g||"",managementURL:"organization"===h?i?.displayConfig.organizationProfileUrl||"":i?.displayConfig.userProfileUrl||"",regularBilling:{amount:d.totals.totalDueNow?.amount||d.totals.grandTotal.amount,label:d.plan.name,recurringPaymentIntervalUnit:"annual"===d.planPeriod?"year":"month"}}}},[d,g,h,i]),l=(0,k.useMemo)(()=>({layout:{type:"tabs",defaultCollapsed:!1},paymentMethodOrder:c,applePay:j}),[j,c]),m=(0,k.useCallback)(()=>{b(!0)},[b]);return e&&f?k.default.createElement(aS,{fallback:a,onReady:m,options:l}):k.default.createElement(k.default.Fragment,null,a)},a1=()=>{throw Error("Clerk: Unable to submit, Stripe libraries are not yet loaded. Be sure to check `isFormReady` before calling `submit`.")},a2=()=>{let{isPaymentElementReady:a,initializePaymentMethod:b}=aU(),{stripe:c,elements:d}=aW(),{externalClientSecret:e}=aU(),f=(0,k.useCallback)(async()=>{if(!c||!d)return a1();let{setupIntent:a,error:b}=await c.confirmSetup({elements:d,confirmParams:{return_url:window.location.href},redirect:"if_required"});return b?{data:null,error:{gateway:"stripe",error:{code:b.code,message:b.message,type:b.type}}}:{data:{gateway:"stripe",paymentToken:a.payment_method},error:null}},[c,d]),g=(0,k.useCallback)(async()=>{if(!c||!d)return a1();await b()},[c,d,b]),h=!!(c&&e);return h?{submit:f,reset:g,isFormReady:a,provider:{name:"stripe"},isProviderReady:h}:{submit:a1,reset:a1,isFormReady:!1,provider:void 0,isProviderReady:!1}};a.s(["ClerkInstanceContext",()=>S,"ClientContext",()=>W,"OrganizationProvider",()=>ad,"SessionContext",()=>Y,"UserContext",()=>U,"__experimental_CheckoutProvider",()=>aa,"__experimental_PaymentElement",()=>a0,"__experimental_PaymentElementProvider",()=>a$,"__experimental_useCheckout",()=>aC,"__experimental_usePaymentElement",()=>a2,"createContextAndHook",()=>Q,"isDeeplyEqual",()=>J,"useAssertWrappedByClerkProvider",()=>ae,"useClerk",()=>am,"useClerkInstanceContext",()=>T,"useClientContext",()=>X,"useOrganization",()=>ap,"useOrganizationList",()=>ar,"useReverification",()=>aA,"useSession",()=>au,"useSessionContext",()=>Z,"useSessionList",()=>aw,"useUser",()=>ay],761686)},133711,844889,112415,470911,384728,536360,416625,590968,879339,247305,912591,a=>{"use strict";let b;var c,d,e,f,g,h,i,j,k,l,m=a.i(875910);a.s([],844889);var n=a.i(319190);a.i(452148),a.i(561726),a.i(155647);var o=a.i(152240);a.i(102986);var p=a.i(862563);a.s([],112415);var q=a.i(401122),r=a.i(761686),s=(0,m.buildErrorThrower)({packageName:"@clerk/clerk-react"});function t(a){s.setMessages(a).setPackageName(a)}var[u,v]=(0,r.createContextAndHook)("AuthContext"),w=r.ClerkInstanceContext,x=r.useClerkInstanceContext,y="You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.",z=a=>`You've passed multiple children components to <${a}/>. You can only pass a single child component or text.`,A="Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.",B="<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",C="<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",D="<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",E="<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",F=a=>`<${a} /> can only accept <${a}.Page /> and <${a}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,G=a=>`Missing props. <${a}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`,H=a=>`Missing props. <${a}.Link /> component requires the following props: url, label and labelIcon.`,I=a=>`The <${a}/> component uses path-based routing by default unless a different routing strategy is provided using the \`routing\` prop. When path-based routing is used, you need to provide the path where the component is mounted on by using the \`path\` prop. Example: <${a} path={'/my-path'} />`,J=a=>`The \`path\` prop will only be respected when the Clerk component uses path-based routing. To resolve this error, pass \`routing='path'\` to the <${a}/> component, or drop the \`path\` prop to switch to hash-based routing. For more details please refer to our docs: https://clerk.com/docs`,K="<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.",L="<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.",M="<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.",N="<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.",O="<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.",P="Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.",Q="Missing props. <UserButton.Action /> component requires the following props: label.",R=a=>{(0,r.useAssertWrappedByClerkProvider)(()=>{s.throwMissingClerkProviderError({source:a})})},S=a=>new Promise(b=>{let c=d=>{["ready","degraded"].includes(d)&&(b(),a.off("status",c))};a.on("status",c,{notify:!0})}),T=(a={})=>{var b;R("useAuth");let{treatPendingAsSignedOut:c,...d}=null!=a?a:{},e=v();void 0===e.sessionId&&void 0===e.userId&&(e=null!=d?d:{});let f=x(),g=(0,q.useCallback)(async a=>(await S(f),f.session)?f.session.getToken(a):null,[f]),h=(0,q.useCallback)(async(...a)=>(await S(f),f.signOut(...a)),[f]);return null==(b=f.telemetry)||b.record((0,p.eventMethodCalled)("useAuth",{treatPendingAsSignedOut:c})),U({...e,getToken:g,signOut:h},{treatPendingAsSignedOut:c})};function U(a,{treatPendingAsSignedOut:b=!0}={}){let{userId:c,orgId:d,orgRole:e,has:f,signOut:g,getToken:h,orgPermissions:i,factorVerificationAge:j,sessionClaims:k}=null!=a?a:{},l=(0,q.useCallback)(a=>f?f(a):(0,n.createCheckAuthorization)({userId:c,orgId:d,orgRole:e,orgPermissions:i,factorVerificationAge:j,features:(null==k?void 0:k.fea)||"",plans:(null==k?void 0:k.pla)||""})(a),[f,c,d,e,i,j,k]),m=(0,n.resolveAuthState)({authObject:{...a,getToken:h,signOut:g,has:l},options:{treatPendingAsSignedOut:b}});return m||s.throw("Invalid state. Feel free to submit a bug or reach out to support here: https://clerk.com/support")}function V(a){let{startEmailLinkFlow:b,cancelEmailLinkFlow:c}=q.default.useMemo(()=>a.createEmailLinkFlow(),[a]);return q.default.useEffect(()=>c,[]),{startEmailLinkFlow:b,cancelEmailLinkFlow:c}}var W=()=>{var a;R("useSignIn");let b=x(),c=(0,r.useClientContext)();return(null==(a=b.telemetry)||a.record((0,p.eventMethodCalled)("useSignIn")),c)?{isLoaded:!0,signIn:c.signIn,setActive:b.setActive}:{isLoaded:!1,signIn:void 0,setActive:void 0}},X=()=>{var a;R("useSignUp");let b=x(),c=(0,r.useClientContext)();return(null==(a=b.telemetry)||a.record((0,p.eventMethodCalled)("useSignUp")),c)?{isLoaded:!0,signUp:c.signUp,setActive:b.setActive}:{isLoaded:!1,signUp:void 0,setActive:void 0}},Y=(a,b)=>{let c=("string"==typeof b?b:null==b?void 0:b.component)||a.displayName||a.name||"Component";a.displayName=c;let d="string"==typeof b?void 0:b,e=b=>{R(c||"withClerk");let e=x();return e.loaded||(null==d?void 0:d.renderWhileLoading)?q.default.createElement(a,{...b,component:c,clerk:e}):null};return e.displayName=`withClerk(${c})`,e};a.s(["AuthContext",()=>u,"IsomorphicClerkContext",()=>w,"customLinkWrongProps",()=>H,"customMenuItemsIgnoredComponent",()=>L,"customPageWrongProps",()=>G,"customPagesIgnoredComponent",()=>F,"errorThrower",()=>s,"incompatibleRoutingWithPathProvidedError",()=>J,"multipleChildrenInButtonComponent",()=>z,"multipleClerkProvidersError",()=>y,"noPathProvidedError",()=>I,"organizationProfileLinkRenderedError",()=>E,"organizationProfilePageRenderedError",()=>D,"setErrorThrowerOptions",()=>t,"unsupportedNonBrowserDomainOrProxyUrlFunction",()=>A,"useAssertWrappedByClerkProvider",()=>R,"useAuth",()=>T,"useDerivedAuth",()=>U,"useEmailLink",()=>V,"useIsomorphicClerkContext",()=>x,"useSignIn",()=>W,"useSignUp",()=>X,"userButtonIgnoredComponent",()=>K,"userButtonMenuActionRenderedError",()=>N,"userButtonMenuItemLinkWrongProps",()=>P,"userButtonMenuItemsActionWrongsProps",()=>Q,"userButtonMenuItemsRenderedError",()=>M,"userButtonMenuLinkRenderedError",()=>O,"userProfileLinkRenderedError",()=>C,"userProfilePageRenderedError",()=>B,"withClerk",()=>Y],470911);var Z=a.i(52036);let $=new Set,_=(a,b,c)=>{let d=(0,Z.isTestEnvironment)()||(0,Z.isProductionEnvironment)(),e=c??a;$.has(e)||d||($.add(e),console.warn(`Clerk - DEPRECATION WARNING: "${a}" is deprecated and will be removed in the next major release.
${b}`))};var aa=({children:a,treatPendingAsSignedOut:b})=>{R("SignedIn");let{userId:c}=T({treatPendingAsSignedOut:b});return c?a:null},ab=({children:a,treatPendingAsSignedOut:b})=>{R("SignedOut");let{userId:c}=T({treatPendingAsSignedOut:b});return null===c?a:null},ac=({children:a})=>(R("ClerkLoaded"),x().loaded)?a:null,ad=({children:a})=>(R("ClerkLoading"),"loading"!==x().status)?null:a,ae=({children:a})=>(R("ClerkFailed"),"error"!==x().status)?null:a,af=({children:a})=>(R("ClerkDegraded"),"degraded"!==x().status)?null:a,ag=({children:a,fallback:b,treatPendingAsSignedOut:c,...d})=>{R("Protect");let{isLoaded:e,has:f,userId:g}=T({treatPendingAsSignedOut:c});if(!e)return null;let h=null!=b?b:null;return g?"function"==typeof d.condition?d.condition(f)?a:h:d.role||d.permission||d.feature||d.plan?f(d)?a:h:a:h},ah=Y(({clerk:a,...b})=>{let{client:c,session:d}=a,e=c.signedInSessions?c.signedInSessions.length>0:c.activeSessions&&c.activeSessions.length>0;return q.default.useEffect(()=>{null===d&&e?a.redirectToAfterSignOut():a.redirectToSignIn(b)},[]),null},"RedirectToSignIn"),ai=Y(({clerk:a,...b})=>(q.default.useEffect(()=>{a.redirectToSignUp(b)},[]),null),"RedirectToSignUp"),aj=Y(({clerk:a,...b})=>(q.default.useEffect(()=>{a.redirectToTasks(b)},[]),null),"RedirectToTasks"),ak=Y(({clerk:a})=>(q.default.useEffect(()=>{_("RedirectToUserProfile","Use the `redirectToUserProfile()` method instead."),a.redirectToUserProfile()},[]),null),"RedirectToUserProfile"),al=Y(({clerk:a})=>(q.default.useEffect(()=>{_("RedirectToOrganizationProfile","Use the `redirectToOrganizationProfile()` method instead."),a.redirectToOrganizationProfile()},[]),null),"RedirectToOrganizationProfile"),am=Y(({clerk:a})=>(q.default.useEffect(()=>{_("RedirectToCreateOrganization","Use the `redirectToCreateOrganization()` method instead."),a.redirectToCreateOrganization()},[]),null),"RedirectToCreateOrganization"),an=Y(({clerk:a,...b})=>(q.default.useEffect(()=>{a.handleRedirectCallback(b)},[]),null),"AuthenticateWithRedirectCallback"),ao=({children:a})=>{R("MultisessionAppSupport");let b=(0,r.useSessionContext)();return q.default.createElement(q.default.Fragment,{key:b?b.id:"no-users"},a)};a.s(["AuthenticateWithRedirectCallback",()=>an,"ClerkDegraded",()=>af,"ClerkFailed",()=>ae,"ClerkLoaded",()=>ac,"ClerkLoading",()=>ad,"MultisessionAppSupport",()=>ao,"Protect",()=>ag,"RedirectToCreateOrganization",()=>am,"RedirectToOrganizationProfile",()=>al,"RedirectToSignIn",()=>ah,"RedirectToSignUp",()=>ai,"RedirectToTasks",()=>aj,"RedirectToUserProfile",()=>ak,"SignedIn",()=>aa,"SignedOut",()=>ab],384728),a.i(453842);var ap=a.i(482200),aq=q,ar=a.i(707372);let as=(a,...b)=>{let c={...a};for(let a of b)delete c[a];return c};var at=a=>b=>{try{return aq.default.Children.only(a)}catch{return s.throw(z(b))}},au=(a,b)=>(a||(a=b),"string"==typeof a&&(a=aq.default.createElement("button",null,a)),a),av=a=>(...b)=>{if(a&&"function"==typeof a)return a(...b)};function aw(a){return"function"==typeof a}var ax=new Map;function ay(a,b,c){let d=a.displayName||a.name||b||"Component",e=d=>(!function(a,b,c=1){aq.default.useEffect(()=>{let d=ax.get(a)||0;return d==c?s.throw(b):(ax.set(a,d+1),()=>{ax.set(a,(ax.get(a)||1)-1)})},[])}(b,c),aq.default.createElement(a,{...d}));return e.displayName=`withMaxAllowedInstancesGuard(${d})`,e}var az=a=>{let[b,c]=(0,aq.useState)(new Map);return a.map(a=>({id:a.id,mount:b=>c(c=>new Map(c).set(String(a.id),b)),unmount:()=>c(b=>{let c=new Map(b);return c.set(String(a.id),null),c}),portal:()=>{let c=b.get(String(a.id));return c?(0,ar.createPortal)(a.component,c):null}}))},aA=(a,b)=>!!a&&aq.default.isValidElement(a)&&(null==a?void 0:a.type)===b,aB=(a,b)=>aE({children:a,reorderItemsLabels:["account","security","billing","apiKeys"],LinkComponent:aS,PageComponent:aR,MenuItemsComponent:aV,componentName:"UserProfile"},b),aC=(a,b)=>aE({children:a,reorderItemsLabels:["general","members","billing","apiKeys"],LinkComponent:a$,PageComponent:aZ,componentName:"OrganizationProfile"},b),aD=a=>{let b=[],c=[a$,aZ,aV,aR,aS];return aq.default.Children.forEach(a,a=>{c.some(b=>aA(a,b))||b.push(a)}),b},aE=(a,b)=>{let{children:c,LinkComponent:d,PageComponent:e,MenuItemsComponent:f,reorderItemsLabels:g,componentName:h}=a,{allowForAnyChildren:i=!1}=b||{},j=[];aq.default.Children.forEach(c,a=>{if(!aA(a,e)&&!aA(a,d)&&!aA(a,f)){a&&!i&&(0,ap.logErrorInDevMode)(F(h));return}let{props:b}=a,{children:c,label:k,url:l,labelIcon:m}=b;if(aA(a,e))if(aF(b,g))j.push({label:k});else{if(!aG(b))return void(0,ap.logErrorInDevMode)(G(h));j.push({label:k,labelIcon:m,children:c,url:l})}if(aA(a,d))if(!aH(b))return void(0,ap.logErrorInDevMode)(H(h));else j.push({label:k,labelIcon:m,url:l})});let k=[],l=[],m=[];j.forEach((a,b)=>{if(aG(a)){k.push({component:a.children,id:b}),l.push({component:a.labelIcon,id:b});return}aH(a)&&m.push({component:a.labelIcon,id:b})});let n=az(k),o=az(l),p=az(m),q=[],r=[];return j.forEach((a,b)=>{if(aF(a,g))return void q.push({label:a.label});if(aG(a)){let{portal:c,mount:d,unmount:e}=n.find(a=>a.id===b),{portal:f,mount:g,unmount:h}=o.find(a=>a.id===b);q.push({label:a.label,url:a.url,mount:d,unmount:e,mountIcon:g,unmountIcon:h}),r.push(c),r.push(f);return}if(aH(a)){let{portal:c,mount:d,unmount:e}=p.find(a=>a.id===b);q.push({label:a.label,url:a.url,mountIcon:d,unmountIcon:e}),r.push(c);return}}),{customPages:q,customPagesPortals:r}},aF=(a,b)=>{let{children:c,label:d,url:e,labelIcon:f}=a;return!c&&!e&&!f&&b.some(a=>a===d)},aG=a=>{let{children:b,label:c,url:d,labelIcon:e}=a;return!!b&&!!d&&!!e&&!!c},aH=a=>{let{children:b,label:c,url:d,labelIcon:e}=a;return!b&&!!d&&!!e&&!!c},aI=(a,b)=>{let{children:c,label:d,onClick:e,labelIcon:f}=a;return!c&&!e&&!f&&b.some(a=>a===d)},aJ=a=>{let{label:b,labelIcon:c,onClick:d,open:e}=a;return!!c&&!!b&&("function"==typeof d||"string"==typeof e)},aK=a=>{let{label:b,href:c,labelIcon:d}=a;return!!c&&!!d&&!!b};function aL(a,b){(0,aq.useRef)();let[c,d]=(0,aq.useState)("rendering");return(0,aq.useEffect)(()=>{if(!a)throw Error("Clerk: no component name provided, unable to detect mount.")},[a,null==b?void 0:b.selector]),c}b=(c={childList:!0,subtree:!0,isReady:(a,b)=>{var c;return!!(null==a?void 0:a.childElementCount)&&(null==(c=null==a?void 0:a.matches)?void 0:c.call(a,b))&&a.childElementCount>0}}).isReady,a=>new Promise((d,e)=>{let{root:f=null==document?void 0:document.body,selector:g,timeout:h=0}=a;if(!f)return void e(Error("No root element provided"));let i=f;if(g&&(i=null==f?void 0:f.querySelector(g)),b(i,g))return void d();let j=new MutationObserver(a=>{for(let e of a)if(!i&&g&&(i=null==f?void 0:f.querySelector(g)),(c.childList&&"childList"===e.type||c.attributes&&"attributes"===e.type)&&b(i,g)){j.disconnect(),d();return}});j.observe(f,c),h>0&&setTimeout(()=>{j.disconnect(),e(Error(`Timeout waiting for ${g}`))},h)});var aM=a=>null==a?void 0:a.map(({mountIcon:a,unmountIcon:b,...c})=>c),aN=class extends aq.default.PureComponent{constructor(){super(...arguments),this.rootRef=aq.default.createRef()}componentDidUpdate(a){var b,c,d,e;if(!("mount"in a)||!("mount"in this.props))return;let f=as(a.props,"customPages","customMenuItems","children"),g=as(this.props.props,"customPages","customMenuItems","children"),h=(null==(b=f.customPages)?void 0:b.length)!==(null==(c=g.customPages)?void 0:c.length),i=(null==(d=f.customMenuItems)?void 0:d.length)!==(null==(e=g.customMenuItems)?void 0:e.length),j=aM(a.props.customMenuItems),k=aM(this.props.props.customMenuItems);(!(0,r.isDeeplyEqual)(f,g)||!(0,r.isDeeplyEqual)(j,k)||h||i)&&this.rootRef.current&&this.props.updateProps({node:this.rootRef.current,props:this.props.props})}componentDidMount(){this.rootRef.current&&("mount"in this.props&&this.props.mount(this.rootRef.current,this.props.props),"open"in this.props&&this.props.open(this.props.props))}componentWillUnmount(){this.rootRef.current&&("mount"in this.props&&this.props.unmount(this.rootRef.current),"open"in this.props&&this.props.close())}render(){let{hideRootHtmlElement:a=!1}=this.props,b={ref:this.rootRef,...this.props.rootProps,...this.props.component&&{"data-clerk-component":this.props.component}};return aq.default.createElement(aq.default.Fragment,null,!a&&aq.default.createElement("div",{...b}),this.props.children)}},aO=a=>{var b,c;return aq.default.createElement(aq.default.Fragment,null,null==(b=null==a?void 0:a.customPagesPortals)?void 0:b.map((a,b)=>(0,aq.createElement)(a,{key:b})),null==(c=null==a?void 0:a.customMenuItemsPortals)?void 0:c.map((a,b)=>(0,aq.createElement)(a,{key:b})))},aP=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountSignIn,unmount:a.unmountSignIn,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"SignIn",renderWhileLoading:!0}),aQ=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountSignUp,unmount:a.unmountSignUp,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"SignUp",renderWhileLoading:!0});function aR({children:a}){return(0,ap.logErrorInDevMode)(B),aq.default.createElement(aq.default.Fragment,null,a)}function aS({children:a}){return(0,ap.logErrorInDevMode)(C),aq.default.createElement(aq.default.Fragment,null,a)}var aT=Object.assign(Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}},{customPages:g,customPagesPortals:h}=aB(d.children);return aq.default.createElement(aq.default.Fragment,null,e&&c,aq.default.createElement(aN,{component:b,mount:a.mountUserProfile,unmount:a.unmountUserProfile,updateProps:a.__unstable__updateProps,props:{...d,customPages:g},rootProps:f},aq.default.createElement(aO,{customPagesPortals:h})))},{component:"UserProfile",renderWhileLoading:!0}),{Page:aR,Link:aS}),aU=(0,aq.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}});function aV({children:a}){return(0,ap.logErrorInDevMode)(M),aq.default.createElement(aq.default.Fragment,null,a)}function aW({children:a}){return(0,ap.logErrorInDevMode)(N),aq.default.createElement(aq.default.Fragment,null,a)}function aX({children:a}){return(0,ap.logErrorInDevMode)(O),aq.default.createElement(aq.default.Fragment,null,a)}var aY=Object.assign(Y(({clerk:a,component:b,fallback:c,...d})=>{var e;let f="rendering"===aL(b)||!a.loaded,g={...f&&c&&{style:{display:"none"}}},{customPages:h,customPagesPortals:i}=aB(d.children,{allowForAnyChildren:!!d.__experimental_asProvider}),j={...d.userProfileProps,customPages:h},{customMenuItems:k,customMenuItemsPortals:l}=(({children:a,MenuItemsComponent:b,MenuActionComponent:c,MenuLinkComponent:d,UserProfileLinkComponent:e,UserProfilePageComponent:f,reorderItemsLabels:g,allowForAnyChildren:h=!1})=>{let i=[],j=[],k=[];aq.default.Children.forEach(a,a=>{if(!aA(a,b)&&!aA(a,e)&&!aA(a,f)){a&&!h&&(0,ap.logErrorInDevMode)(K);return}if(aA(a,e)||aA(a,f))return;let{props:j}=a;aq.default.Children.forEach(j.children,a=>{if(!aA(a,c)&&!aA(a,d)){a&&(0,ap.logErrorInDevMode)(L);return}let{props:b}=a,{label:e,labelIcon:f,href:h,onClick:j,open:k}=b;if(aA(a,c))if(aI(b,g))i.push({label:e});else{if(!aJ(b))return void(0,ap.logErrorInDevMode)(Q);let a={label:e,labelIcon:f};if(void 0!==j)i.push({...a,onClick:j});else{if(void 0===k)return void(0,ap.logErrorInDevMode)("Custom menu item must have either onClick or open property");i.push({...a,open:k.startsWith("/")?k:`/${k}`})}}if(aA(a,d))if(!aK(b))return void(0,ap.logErrorInDevMode)(P);else i.push({label:e,labelIcon:f,href:h})})});let l=[],m=[];i.forEach((a,b)=>{aJ(a)&&l.push({component:a.labelIcon,id:b}),aK(a)&&m.push({component:a.labelIcon,id:b})});let n=az(l),o=az(m);return i.forEach((a,b)=>{if(aI(a,g)&&j.push({label:a.label}),aJ(a)){let{portal:c,mount:d,unmount:e}=n.find(a=>a.id===b),f={label:a.label,mountIcon:d,unmountIcon:e};"onClick"in a?f.onClick=a.onClick:"open"in a&&(f.open=a.open),j.push(f),k.push(c)}if(aK(a)){let{portal:c,mount:d,unmount:e}=o.find(a=>a.id===b);j.push({label:a.label,href:a.href,mountIcon:d,unmountIcon:e}),k.push(c)}}),{customMenuItems:j,customMenuItemsPortals:k}})({children:d.children,reorderItemsLabels:["manageAccount","signOut"],MenuItemsComponent:aV,MenuActionComponent:aW,MenuLinkComponent:aX,UserProfileLinkComponent:aS,UserProfilePageComponent:aR,allowForAnyChildren:null!=(e=({allowForAnyChildren:!!d.__experimental_asProvider}).allowForAnyChildren)&&e}),m=aD(d.children),n={mount:a.mountUserButton,unmount:a.unmountUserButton,updateProps:a.__unstable__updateProps,props:{...d,userProfileProps:j,customMenuItems:k}};return aq.default.createElement(aU.Provider,{value:n},f&&c,a.loaded&&aq.default.createElement(aN,{component:b,...n,hideRootHtmlElement:!!d.__experimental_asProvider,rootProps:g},d.__experimental_asProvider?m:null,aq.default.createElement(aO,{customPagesPortals:i,customMenuItemsPortals:l})))},{component:"UserButton",renderWhileLoading:!0}),{UserProfilePage:aR,UserProfileLink:aS,MenuItems:aV,Action:aW,Link:aX,__experimental_Outlet:function(a){let b=(0,aq.useContext)(aU),c={...b,props:{...b.props,...a}};return aq.default.createElement(aN,{...c})}});function aZ({children:a}){return(0,ap.logErrorInDevMode)(D),aq.default.createElement(aq.default.Fragment,null,a)}function a$({children:a}){return(0,ap.logErrorInDevMode)(E),aq.default.createElement(aq.default.Fragment,null,a)}var a_=Object.assign(Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}},{customPages:g,customPagesPortals:h}=aC(d.children);return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountOrganizationProfile,unmount:a.unmountOrganizationProfile,updateProps:a.__unstable__updateProps,props:{...d,customPages:g},rootProps:f},aq.default.createElement(aO,{customPagesPortals:h})))},{component:"OrganizationProfile",renderWhileLoading:!0}),{Page:aZ,Link:a$}),a0=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountCreateOrganization,unmount:a.unmountCreateOrganization,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"CreateOrganization",renderWhileLoading:!0}),a1=(0,aq.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),a2=Object.assign(Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}},{customPages:g,customPagesPortals:h}=aC(d.children,{allowForAnyChildren:!!d.__experimental_asProvider}),i={...d.organizationProfileProps,customPages:g},j=aD(d.children),k={mount:a.mountOrganizationSwitcher,unmount:a.unmountOrganizationSwitcher,updateProps:a.__unstable__updateProps,props:{...d,organizationProfileProps:i},rootProps:f,component:b};return a.__experimental_prefetchOrganizationSwitcher(),aq.default.createElement(a1.Provider,{value:k},aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{...k,hideRootHtmlElement:!!d.__experimental_asProvider},d.__experimental_asProvider?j:null,aq.default.createElement(aO,{customPagesPortals:h}))))},{component:"OrganizationSwitcher",renderWhileLoading:!0}),{OrganizationProfilePage:aZ,OrganizationProfileLink:a$,__experimental_Outlet:function(a){let b=(0,aq.useContext)(a1),c={...b,props:{...b.props,...a}};return aq.default.createElement(aN,{...c})}}),a3=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountOrganizationList,unmount:a.unmountOrganizationList,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"OrganizationList",renderWhileLoading:!0}),a4=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,open:a.openGoogleOneTap,close:a.closeGoogleOneTap,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"GoogleOneTap",renderWhileLoading:!0}),a5=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountWaitlist,unmount:a.unmountWaitlist,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"Waitlist",renderWhileLoading:!0}),a6=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b,{selector:'[data-component-status="ready"]'})||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountPricingTable,unmount:a.unmountPricingTable,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"PricingTable",renderWhileLoading:!0}),a7=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountAPIKeys,unmount:a.unmountAPIKeys,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"ApiKeys",renderWhileLoading:!0}),a8=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountUserAvatar,unmount:a.unmountUserAvatar,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"UserAvatar",renderWhileLoading:!0}),a9=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountTaskChooseOrganization,unmount:a.unmountTaskChooseOrganization,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"TaskChooseOrganization",renderWhileLoading:!0}),ba=Y(({clerk:a,component:b,fallback:c,...d})=>{let e="rendering"===aL(b)||!a.loaded,f={...e&&c&&{style:{display:"none"}}};return aq.default.createElement(aq.default.Fragment,null,e&&c,a.loaded&&aq.default.createElement(aN,{component:b,mount:a.mountTaskResetPassword,unmount:a.unmountTaskResetPassword,updateProps:a.__unstable__updateProps,props:d,rootProps:f}))},{component:"TaskResetPassword",renderWhileLoading:!0});a.s(["APIKeys",()=>a7,"CreateOrganization",()=>a0,"GoogleOneTap",()=>a4,"OrganizationList",()=>a3,"OrganizationProfile",()=>a_,"OrganizationSwitcher",()=>a2,"PricingTable",()=>a6,"SignIn",()=>aP,"SignUp",()=>aQ,"TaskChooseOrganization",()=>a9,"TaskResetPassword",()=>ba,"UserAvatar",()=>a8,"UserButton",()=>aY,"UserProfile",()=>aT,"Waitlist",()=>a5,"assertSingleChild",()=>at,"isConstructor",()=>aw,"normalizeWithDefaultValue",()=>au,"safeExecute",()=>av,"withMaxAllowedInstancesGuard",()=>ay],536360);var bb=a=>{throw TypeError(a)},bc=(a,b,c)=>b.has(a)||bb("Cannot "+c),bd=(a,b,c)=>(bc(a,b,"read from private field"),c?c.call(a):b.get(a)),be=(a,b,c)=>b.has(a)?bb("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),bf=(a,b,c,d)=>(bc(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c),bg=(a,b,c)=>(bc(a,b,"access private method"),c);a.s(["__privateAdd",()=>be,"__privateGet",()=>bd,"__privateMethod",()=>bg,"__privateSet",()=>bf],416625),a.i(593251);let bh={initialDelay:125,maxDelayBetweenRetries:0,factor:2,shouldRetry:(a,b)=>b<5,retryImmediately:!1,jitter:!0},bi=async a=>new Promise(b=>setTimeout(b,a)),bj=(a,b)=>b?a*(1+Math.random()):a,bk=async(a,b={})=>{var c;let d,e=0,{shouldRetry:f,initialDelay:g,maxDelayBetweenRetries:h,factor:i,retryImmediately:j,jitter:k,onBeforeRetry:l}={...bh,...b},m=(c={initialDelay:g,maxDelayBetweenRetries:h,factor:i,jitter:k},d=0,async()=>{let a;await bi((a=bj(a=c.initialDelay*Math.pow(c.factor,d),c.jitter),Math.min(c.maxDelayBetweenRetries||a,a))),d++});for(;;)try{return await a()}catch(a){if(!f(a,++e))throw a;l&&await l(e),j&&1===e?await bi(bj(100,k)):await m()}};async function bl(a="",b){let{async:c,defer:d,beforeLoad:e,crossOrigin:f,nonce:g}=b||{};return bk(()=>new Promise((b,h)=>{a||h(Error("loadScript cannot be called without a src")),document&&document.body||h(Error("loadScript cannot be called when document does not exist"));let i=document.createElement("script");f&&i.setAttribute("crossorigin",f),i.async=c||!1,i.defer=d||!1,i.addEventListener("load",()=>{i.remove(),b(i)}),i.addEventListener("error",b=>{i.remove(),h(b.error??Error(`failed to load script: ${a}`))}),i.src=a,i.nonce=g,e?.(i),document.body.appendChild(i)}),{shouldRetry:(a,b)=>b<=5})}function bm(a){return a.startsWith("/")}let bn="failed_to_load_clerk_js",bo="Failed to load Clerk",{isDevOrStagingUrl:bp}=(0,o.createDevOrStagingUrlCache)(),bq=(0,m.buildErrorThrower)({packageName:"@clerk/shared"});function br(a){bq.setPackageName({packageName:a})}function bs(a,b){return new Promise((c,d)=>{let e=!1,f=(a,b)=>{clearTimeout(a),clearInterval(b)};b?.addEventListener("error",()=>{f(h,i),d(new m.ClerkRuntimeError(bo,{code:bn}))});let g=()=>{},h=setTimeout(()=>{e||(e=!0,f(h,i),d(new m.ClerkRuntimeError(bo,{code:"failed_to_load_clerk_js_timeout"})))},a);g();let i=setInterval(()=>{e?clearInterval(i):g()},100)})}let bt=async a=>{let b=a?.scriptLoadTimeout??15e3;if(!a?.publishableKey)return bq.throwMissingPublishableKeyError(),null;let c=bu(a),d=document.querySelector("script[data-clerk-js-script]");if(d){try{return await bs(b,d),null}catch{d.remove()}}let e=bs(b);return bl(c,{async:!0,crossOrigin:"anonymous",nonce:a.nonce,beforeLoad:bw(a)}).catch(a=>{throw new m.ClerkRuntimeError(bo+(a.message?`, ${a.message}`:""),{code:bn,cause:a})}),e},bu=a=>{var b;let{clerkJSUrl:c,clerkJSVariant:d,clerkJSVersion:e,proxyUrl:f,domain:g,publishableKey:h}=a;if(c)return c;let i="";if(f&&(!f||(b=f,/^http(s)?:\/\//.test(b||""))||bm(f)))i=(!f?"":bm(f)?new URL(f,window.location.origin).toString():f).replace(/http(s)?:\/\//,"");else i=g&&!bp((0,o.parsePublishableKey)(h)?.frontendApi||"")?function(a){let b;if(!a)return"";if(a.match(/^(clerk\.)+\w*$/))b=/(clerk\.)*(?=clerk\.)/;else{if(a.match(/\.clerk.accounts/))return a;b=/^(clerk\.)*/gi}return`clerk.${a.replace(b,"")}`}(g):(0,o.parsePublishableKey)(h)?.frontendApi||"";let j=d?`${d.replace(/\.+$/,"")}.`:"",k=((a,b="5.114.0")=>{let c;if(a)return a;let d=(c=b,c.trim().replace(/^v/,"").match(/-(.+?)(\.|$)/)?.[1]);if(d)return"snapshot"===d?"5.114.0":d;return b.trim().replace(/^v/,"").split(".")[0]})(e);return`https://${i}/npm/@clerk/clerk-js@${k}/dist/clerk.${j}browser.js`},bv=a=>{let b={};return a.publishableKey&&(b["data-clerk-publishable-key"]=a.publishableKey),a.proxyUrl&&(b["data-clerk-proxy-url"]=a.proxyUrl),a.domain&&(b["data-clerk-domain"]=a.domain),a.nonce&&(b.nonce=a.nonce),b},bw=a=>b=>{let c=bv(a);for(let a in c)b.setAttribute(a,c[a])};a.s(["buildClerkJsScriptAttributes",()=>bv,"clerkJsScriptUrl",()=>bu,"loadClerkJsScript",()=>bt,"setClerkJsLoadingErrorPackageName",()=>br],590968);function bx(){return!1}let by=RegExp("bot|spider|crawl|APIs-Google|AdsBot|Googlebot|mediapartners|Google Favicon|FeedFetcher|Google-Read-Aloud|DuplexWeb-Google|googleweblight|bing|yandex|baidu|duckduck|yahoo|ecosia|ia_archiver|facebook|instagram|pinterest|reddit|slack|twitter|whatsapp|youtube|semrush","i");function bz(a){return!!a&&by.test(a)}function bA(){return!1}function bB(){return!1}function bC(){return!1}a.s(["inBrowser",()=>bx,"isBrowserOnline",()=>bB,"isValidBrowser",()=>bA,"isValidBrowserOnline",()=>bC,"userAgentIsRobot",()=>bz],879339),a.s([],247305);let bD=(a,b,c,d,e)=>{let{notify:f}=e||{},g=a.get(c);g||(g=[],a.set(c,g)),g.push(d),f&&b.has(c)&&d(b.get(c))},bE=(a,b,c)=>(a.get(b)||[]).map(a=>a(c)),bF=(a,b,c)=>{let d=a.get(b);d&&(c?d.splice(d.indexOf(c)>>>0,1):a.set(b,[]))},bG="status";var bH=Y(({clerk:a,children:b,...c})=>{let{signUpFallbackRedirectUrl:d,forceRedirectUrl:e,fallbackRedirectUrl:f,signUpForceRedirectUrl:g,mode:h,initialValues:i,withSignUp:j,oauthFlow:k,...l}=c,m=at(b=au(b,"Sign in"))("SignInButton"),n=async b=>{let l;return m&&"object"==typeof m&&"props"in m&&await av(m.props.onClick)(b),l={forceRedirectUrl:e,fallbackRedirectUrl:f,signUpFallbackRedirectUrl:d,signUpForceRedirectUrl:g,initialValues:i,withSignUp:j,oauthFlow:k},"modal"===h?a.openSignIn({...l,appearance:c.appearance}):a.redirectToSignIn({...l,signInFallbackRedirectUrl:f,signInForceRedirectUrl:e})},o={...l,onClick:n};return q.default.cloneElement(m,o)},{component:"SignInButton",renderWhileLoading:!0}),bI=Y(({clerk:a,children:b,...c})=>{let{redirectUrl:d,...e}=c,f=at(b=au(b,"Sign in with Metamask"))("SignInWithMetamaskButton"),g=async()=>{!async function(){await a.authenticateWithMetamask({redirectUrl:d||void 0})}()},h=async a=>(await av(f.props.onClick)(a),g()),i={...e,onClick:h};return q.default.cloneElement(f,i)},{component:"SignInWithMetamask",renderWhileLoading:!0}),bJ=Y(({clerk:a,children:b,...c})=>{let{redirectUrl:d="/",signOutOptions:e,...f}=c,g=at(b=au(b,"Sign out"))("SignOutButton"),h=async b=>(await av(g.props.onClick)(b),a.signOut({redirectUrl:d,...e})),i={...f,onClick:h};return q.default.cloneElement(g,i)},{component:"SignOutButton",renderWhileLoading:!0}),bK=Y(({clerk:a,children:b,...c})=>{let{fallbackRedirectUrl:d,forceRedirectUrl:e,signInFallbackRedirectUrl:f,signInForceRedirectUrl:g,mode:h,initialValues:i,oauthFlow:j,...k}=c,l=at(b=au(b,"Sign up"))("SignUpButton"),m=async b=>{let k;return l&&"object"==typeof l&&"props"in l&&await av(l.props.onClick)(b),k={fallbackRedirectUrl:d,forceRedirectUrl:e,signInFallbackRedirectUrl:f,signInForceRedirectUrl:g,initialValues:i,oauthFlow:j},"modal"===h?a.openSignUp({...k,appearance:c.appearance,unsafeMetadata:c.unsafeMetadata}):a.redirectToSignUp({...k,signUpFallbackRedirectUrl:d,signUpForceRedirectUrl:e})},n={...k,onClick:m};return q.default.cloneElement(l,n)},{component:"SignUpButton",renderWhileLoading:!0}),bL=class{constructor(a){this.isomorphicClerk=a,this.signInSignalProxy=this.buildSignInProxy(),this.signUpSignalProxy=this.buildSignUpProxy()}signInSignal(){return this.signInSignalProxy}signUpSignal(){return this.signUpSignalProxy}buildSignInProxy(){let a=this.gateProperty.bind(this),b=()=>this.client.signIn.__internal_future;return{errors:{fields:{identifier:null,password:null,code:null},raw:null,global:null},fetchStatus:"idle",signIn:{status:"needs_identifier",availableStrategies:[],isTransferable:!1,get id(){return a(b,"id",void 0)},get supportedFirstFactors(){return a(b,"supportedFirstFactors",[])},get supportedSecondFactors(){return a(b,"supportedSecondFactors",[])},get secondFactorVerification(){return a(b,"secondFactorVerification",{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw Error("__internal_toSnapshot called before Clerk is loaded")},pathRoot:"",reload:()=>{throw Error("__internal_toSnapshot called before Clerk is loaded")}})},get identifier(){return a(b,"identifier",null)},get createdSessionId(){return a(b,"createdSessionId",null)},get userData(){return a(b,"userData",{})},get firstFactorVerification(){return a(b,"firstFactorVerification",{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw Error("__internal_toSnapshot called before Clerk is loaded")},pathRoot:"",reload:()=>{throw Error("__internal_toSnapshot called before Clerk is loaded")}})},create:this.gateMethod(b,"create"),password:this.gateMethod(b,"password"),sso:this.gateMethod(b,"sso"),finalize:this.gateMethod(b,"finalize"),emailCode:this.wrapMethods(()=>b().emailCode,["sendCode","verifyCode"]),emailLink:this.wrapStruct(()=>b().emailLink,["sendLink","waitForVerification"],["verification"],{verification:null}),resetPasswordEmailCode:this.wrapMethods(()=>b().resetPasswordEmailCode,["sendCode","verifyCode","submitPassword"]),phoneCode:this.wrapMethods(()=>b().phoneCode,["sendCode","verifyCode"]),mfa:this.wrapMethods(()=>b().mfa,["sendPhoneCode","verifyPhoneCode","verifyTOTP","verifyBackupCode"]),ticket:this.gateMethod(b,"ticket"),passkey:this.gateMethod(b,"passkey"),web3:this.gateMethod(b,"web3")}}}buildSignUpProxy(){let a=this.gateProperty.bind(this),b=this.gateMethod.bind(this),c=this.wrapMethods.bind(this),d=()=>this.client.signUp.__internal_future;return{errors:{fields:{firstName:null,lastName:null,emailAddress:null,phoneNumber:null,password:null,username:null,code:null,captcha:null,legalAccepted:null},raw:null,global:null},fetchStatus:"idle",signUp:{get id(){return a(d,"id",void 0)},get requiredFields(){return a(d,"requiredFields",[])},get optionalFields(){return a(d,"optionalFields",[])},get missingFields(){return a(d,"missingFields",[])},get username(){return a(d,"username",null)},get firstName(){return a(d,"firstName",null)},get lastName(){return a(d,"lastName",null)},get emailAddress(){return a(d,"emailAddress",null)},get phoneNumber(){return a(d,"phoneNumber",null)},get web3Wallet(){return a(d,"web3Wallet",null)},get hasPassword(){return a(d,"hasPassword",!1)},get unsafeMetadata(){return a(d,"unsafeMetadata",{})},get createdSessionId(){return a(d,"createdSessionId",null)},get createdUserId(){return a(d,"createdUserId",null)},get abandonAt(){return a(d,"abandonAt",null)},get legalAcceptedAt(){return a(d,"legalAcceptedAt",null)},get locale(){return a(d,"locale",null)},get status(){return a(d,"status","missing_requirements")},get unverifiedFields(){return a(d,"unverifiedFields",[])},get isTransferable(){return a(d,"isTransferable",!1)},create:b(d,"create"),update:b(d,"update"),sso:b(d,"sso"),password:b(d,"password"),ticket:b(d,"ticket"),web3:b(d,"web3"),finalize:b(d,"finalize"),verifications:c(()=>d().verifications,["sendEmailCode","verifyEmailCode","sendPhoneCode","verifyPhoneCode"])}}}__internal_effect(a){throw Error("__internal_effect called before Clerk is loaded")}__internal_computed(a){throw Error("__internal_computed called before Clerk is loaded")}get client(){let a=this.isomorphicClerk.client;if(!a)throw Error("Clerk client not ready");return a}gateProperty(a,b,c){return c}gateMethod(a,b){return async(...a)=>s.throw(`Attempted to call a method (${b}) that is not supported on the server.`)}wrapMethods(a,b){return Object.fromEntries(b.map(b=>[b,this.gateMethod(a,b)]))}wrapStruct(a,b,c,d){let e={};for(let c of b)e[c]=this.gateMethod(a,c);for(let b of c)Object.defineProperty(e,b,{get:()=>this.gateProperty(a,b,d[b]),enumerable:!0});return e}};void 0===globalThis.__BUILD_DISABLE_RHC__&&(globalThis.__BUILD_DISABLE_RHC__=!1);var bM={name:"@clerk/clerk-react",version:"5.58.1",environment:"production"},bN=class b{constructor(a){be(this,k),this.clerkjs=null,this.preopenOneTap=null,this.preopenUserVerification=null,this.preopenEnableOrganizationsPrompt=null,this.preopenSignIn=null,this.preopenCheckout=null,this.preopenPlanDetails=null,this.preopenSubscriptionDetails=null,this.preopenSignUp=null,this.preopenUserProfile=null,this.preopenOrganizationProfile=null,this.preopenCreateOrganization=null,this.preOpenWaitlist=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserAvatarNodes=new Map,this.premountUserProfileNodes=new Map,this.premountUserButtonNodes=new Map,this.premountOrganizationProfileNodes=new Map,this.premountCreateOrganizationNodes=new Map,this.premountOrganizationSwitcherNodes=new Map,this.premountOrganizationListNodes=new Map,this.premountMethodCalls=new Map,this.premountWaitlistNodes=new Map,this.premountPricingTableNodes=new Map,this.premountAPIKeysNodes=new Map,this.premountOAuthConsentNodes=new Map,this.premountTaskChooseOrganizationNodes=new Map,this.premountTaskResetPasswordNodes=new Map,this.premountAddListenerCalls=new Map,this.loadedListeners=[],be(this,d,"loading"),be(this,e),be(this,f),be(this,g),be(this,h,(()=>{let a,b,c;return a=new Map,b=new Map,c=new Map,{on:(...c)=>bD(a,b,...c),prioritizedOn:(...a)=>bD(c,b,...a),emit:(d,e)=>{b.set(d,e),bE(c,d,e),bE(a,d,e)},off:(...b)=>bF(a,...b),prioritizedOff:(...a)=>bF(c,...a),internal:{retrieveListeners:b=>a.get(b)||[]}}})()),be(this,i),this.buildSignInUrl=a=>{let b=()=>{var b;return(null==(b=this.clerkjs)?void 0:b.buildSignInUrl(a))||""};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("buildSignInUrl",b)},this.buildSignUpUrl=a=>{let b=()=>{var b;return(null==(b=this.clerkjs)?void 0:b.buildSignUpUrl(a))||""};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("buildSignUpUrl",b)},this.buildAfterSignInUrl=(...a)=>{let b=()=>{var b;return(null==(b=this.clerkjs)?void 0:b.buildAfterSignInUrl(...a))||""};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("buildAfterSignInUrl",b)},this.buildAfterSignUpUrl=(...a)=>{let b=()=>{var b;return(null==(b=this.clerkjs)?void 0:b.buildAfterSignUpUrl(...a))||""};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("buildAfterSignUpUrl",b)},this.buildAfterSignOutUrl=()=>{let a=()=>{var a;return(null==(a=this.clerkjs)?void 0:a.buildAfterSignOutUrl())||""};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("buildAfterSignOutUrl",a)},this.buildNewSubscriptionRedirectUrl=()=>{let a=()=>{var a;return(null==(a=this.clerkjs)?void 0:a.buildNewSubscriptionRedirectUrl())||""};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("buildNewSubscriptionRedirectUrl",a)},this.buildAfterMultiSessionSingleSignOutUrl=()=>{let a=()=>{var a;return(null==(a=this.clerkjs)?void 0:a.buildAfterMultiSessionSingleSignOutUrl())||""};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("buildAfterMultiSessionSingleSignOutUrl",a)},this.buildUserProfileUrl=()=>{let a=()=>{var a;return(null==(a=this.clerkjs)?void 0:a.buildUserProfileUrl())||""};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("buildUserProfileUrl",a)},this.buildCreateOrganizationUrl=()=>{let a=()=>{var a;return(null==(a=this.clerkjs)?void 0:a.buildCreateOrganizationUrl())||""};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("buildCreateOrganizationUrl",a)},this.buildOrganizationProfileUrl=()=>{let a=()=>{var a;return(null==(a=this.clerkjs)?void 0:a.buildOrganizationProfileUrl())||""};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("buildOrganizationProfileUrl",a)},this.buildWaitlistUrl=()=>{let a=()=>{var a;return(null==(a=this.clerkjs)?void 0:a.buildWaitlistUrl())||""};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("buildWaitlistUrl",a)},this.buildTasksUrl=()=>{let a=()=>{var a;return(null==(a=this.clerkjs)?void 0:a.buildTasksUrl())||""};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("buildTasksUrl",a)},this.buildUrlWithAuth=a=>{let b=()=>{var b;return(null==(b=this.clerkjs)?void 0:b.buildUrlWithAuth(a))||""};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("buildUrlWithAuth",b)},this.handleUnauthenticated=async()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.handleUnauthenticated()};this.clerkjs&&this.loaded?a():this.premountMethodCalls.set("handleUnauthenticated",a)},this.on=(...a)=>{var b;if(null==(b=this.clerkjs)?void 0:b.on)return this.clerkjs.on(...a);bd(this,h).on(...a)},this.off=(...a)=>{var b;if(null==(b=this.clerkjs)?void 0:b.off)return this.clerkjs.off(...a);bd(this,h).off(...a)},this.addOnLoaded=a=>{this.loadedListeners.push(a),this.loaded&&this.emitLoaded()},this.emitLoaded=()=>{this.loadedListeners.forEach(a=>a()),this.loadedListeners=[]},this.beforeLoad=a=>{if(!a)throw Error("Failed to hydrate latest Clerk JS")},this.hydrateClerkJS=a=>{var b,c;if(!a)throw Error("Failed to hydrate latest Clerk JS");return this.clerkjs=a,this.premountMethodCalls.forEach(a=>a()),this.premountAddListenerCalls.forEach((b,c)=>{b.nativeUnsubscribe=a.addListener(c)}),null==(b=bd(this,h).internal.retrieveListeners("status"))||b.forEach(a=>{this.on("status",a,{notify:!0})}),null==(c=bd(this,h).internal.retrieveListeners("queryClientStatus"))||c.forEach(a=>{this.on("queryClientStatus",a,{notify:!0})}),null!==this.preopenSignIn&&a.openSignIn(this.preopenSignIn),null!==this.preopenCheckout&&a.__internal_openCheckout(this.preopenCheckout),null!==this.preopenPlanDetails&&a.__internal_openPlanDetails(this.preopenPlanDetails),null!==this.preopenSubscriptionDetails&&a.__internal_openSubscriptionDetails(this.preopenSubscriptionDetails),null!==this.preopenSignUp&&a.openSignUp(this.preopenSignUp),null!==this.preopenUserProfile&&a.openUserProfile(this.preopenUserProfile),null!==this.preopenUserVerification&&a.__internal_openReverification(this.preopenUserVerification),null!==this.preopenOneTap&&a.openGoogleOneTap(this.preopenOneTap),null!==this.preopenOrganizationProfile&&a.openOrganizationProfile(this.preopenOrganizationProfile),null!==this.preopenCreateOrganization&&a.openCreateOrganization(this.preopenCreateOrganization),null!==this.preOpenWaitlist&&a.openWaitlist(this.preOpenWaitlist),this.preopenEnableOrganizationsPrompt&&a.__internal_openEnableOrganizationsPrompt(this.preopenEnableOrganizationsPrompt),this.premountSignInNodes.forEach((b,c)=>{a.mountSignIn(c,b)}),this.premountSignUpNodes.forEach((b,c)=>{a.mountSignUp(c,b)}),this.premountUserProfileNodes.forEach((b,c)=>{a.mountUserProfile(c,b)}),this.premountUserAvatarNodes.forEach((b,c)=>{a.mountUserAvatar(c,b)}),this.premountUserButtonNodes.forEach((b,c)=>{a.mountUserButton(c,b)}),this.premountOrganizationListNodes.forEach((b,c)=>{a.mountOrganizationList(c,b)}),this.premountWaitlistNodes.forEach((b,c)=>{a.mountWaitlist(c,b)}),this.premountPricingTableNodes.forEach((b,c)=>{a.mountPricingTable(c,b)}),this.premountAPIKeysNodes.forEach((b,c)=>{a.mountAPIKeys(c,b)}),this.premountOAuthConsentNodes.forEach((b,c)=>{a.__internal_mountOAuthConsent(c,b)}),this.premountTaskChooseOrganizationNodes.forEach((b,c)=>{a.mountTaskChooseOrganization(c,b)}),this.premountTaskResetPasswordNodes.forEach((b,c)=>{a.mountTaskResetPassword(c,b)}),void 0===this.clerkjs.status&&bd(this,h).emit(bG,"ready"),this.emitLoaded(),this.clerkjs},this.__experimental_checkout=(...a)=>{var b;return null==(b=this.clerkjs)?void 0:b.__experimental_checkout(...a)},this.__unstable__updateProps=async a=>{let b=await bg(this,k,l).call(this);if(b&&"__unstable__updateProps"in b)return b.__unstable__updateProps(a)},this.setActive=a=>this.clerkjs?this.clerkjs.setActive(a):Promise.reject(),this.openSignIn=a=>{this.clerkjs&&this.loaded?this.clerkjs.openSignIn(a):this.preopenSignIn=a},this.closeSignIn=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignIn():this.preopenSignIn=null},this.__internal_openCheckout=a=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openCheckout(a):this.preopenCheckout=a},this.__internal_closeCheckout=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeCheckout():this.preopenCheckout=null},this.__internal_openPlanDetails=a=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openPlanDetails(a):this.preopenPlanDetails=a},this.__internal_closePlanDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closePlanDetails():this.preopenPlanDetails=null},this.__internal_openSubscriptionDetails=a=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openSubscriptionDetails(a):this.preopenSubscriptionDetails=null!=a?a:null},this.__internal_closeSubscriptionDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeSubscriptionDetails():this.preopenSubscriptionDetails=null},this.__internal_openReverification=a=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openReverification(a):this.preopenUserVerification=a},this.__internal_closeReverification=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeReverification():this.preopenUserVerification=null},this.__internal_openEnableOrganizationsPrompt=a=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openEnableOrganizationsPrompt(a):this.preopenEnableOrganizationsPrompt=a},this.__internal_closeEnableOrganizationsPrompt=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeEnableOrganizationsPrompt():this.preopenEnableOrganizationsPrompt=null},this.openGoogleOneTap=a=>{this.clerkjs&&this.loaded?this.clerkjs.openGoogleOneTap(a):this.preopenOneTap=a},this.closeGoogleOneTap=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeGoogleOneTap():this.preopenOneTap=null},this.openUserProfile=a=>{this.clerkjs&&this.loaded?this.clerkjs.openUserProfile(a):this.preopenUserProfile=a},this.closeUserProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeUserProfile():this.preopenUserProfile=null},this.openOrganizationProfile=a=>{this.clerkjs&&this.loaded?this.clerkjs.openOrganizationProfile(a):this.preopenOrganizationProfile=a},this.closeOrganizationProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeOrganizationProfile():this.preopenOrganizationProfile=null},this.openCreateOrganization=a=>{this.clerkjs&&this.loaded?this.clerkjs.openCreateOrganization(a):this.preopenCreateOrganization=a},this.closeCreateOrganization=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeCreateOrganization():this.preopenCreateOrganization=null},this.openWaitlist=a=>{this.clerkjs&&this.loaded?this.clerkjs.openWaitlist(a):this.preOpenWaitlist=a},this.closeWaitlist=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeWaitlist():this.preOpenWaitlist=null},this.openSignUp=a=>{this.clerkjs&&this.loaded?this.clerkjs.openSignUp(a):this.preopenSignUp=a},this.closeSignUp=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignUp():this.preopenSignUp=null},this.mountSignIn=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignIn(a,b):this.premountSignInNodes.set(a,b)},this.unmountSignIn=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignIn(a):this.premountSignInNodes.delete(a)},this.mountSignUp=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignUp(a,b):this.premountSignUpNodes.set(a,b)},this.unmountSignUp=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignUp(a):this.premountSignUpNodes.delete(a)},this.mountUserAvatar=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserAvatar(a,b):this.premountUserAvatarNodes.set(a,b)},this.unmountUserAvatar=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserAvatar(a):this.premountUserAvatarNodes.delete(a)},this.mountUserProfile=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserProfile(a,b):this.premountUserProfileNodes.set(a,b)},this.unmountUserProfile=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserProfile(a):this.premountUserProfileNodes.delete(a)},this.mountOrganizationProfile=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationProfile(a,b):this.premountOrganizationProfileNodes.set(a,b)},this.unmountOrganizationProfile=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationProfile(a):this.premountOrganizationProfileNodes.delete(a)},this.mountCreateOrganization=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountCreateOrganization(a,b):this.premountCreateOrganizationNodes.set(a,b)},this.unmountCreateOrganization=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountCreateOrganization(a):this.premountCreateOrganizationNodes.delete(a)},this.mountOrganizationSwitcher=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationSwitcher(a,b):this.premountOrganizationSwitcherNodes.set(a,b)},this.unmountOrganizationSwitcher=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationSwitcher(a):this.premountOrganizationSwitcherNodes.delete(a)},this.__experimental_prefetchOrganizationSwitcher=()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.__experimental_prefetchOrganizationSwitcher()};this.clerkjs&&this.loaded?a():this.premountMethodCalls.set("__experimental_prefetchOrganizationSwitcher",a)},this.mountOrganizationList=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationList(a,b):this.premountOrganizationListNodes.set(a,b)},this.unmountOrganizationList=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationList(a):this.premountOrganizationListNodes.delete(a)},this.mountUserButton=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserButton(a,b):this.premountUserButtonNodes.set(a,b)},this.unmountUserButton=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserButton(a):this.premountUserButtonNodes.delete(a)},this.mountWaitlist=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountWaitlist(a,b):this.premountWaitlistNodes.set(a,b)},this.unmountWaitlist=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountWaitlist(a):this.premountWaitlistNodes.delete(a)},this.mountPricingTable=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountPricingTable(a,b):this.premountPricingTableNodes.set(a,b)},this.unmountPricingTable=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountPricingTable(a):this.premountPricingTableNodes.delete(a)},this.mountAPIKeys=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountAPIKeys(a,b):this.premountAPIKeysNodes.set(a,b)},this.unmountAPIKeys=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountAPIKeys(a):this.premountAPIKeysNodes.delete(a)},this.__internal_mountOAuthConsent=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_mountOAuthConsent(a,b):this.premountOAuthConsentNodes.set(a,b)},this.__internal_unmountOAuthConsent=a=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_unmountOAuthConsent(a):this.premountOAuthConsentNodes.delete(a)},this.mountTaskChooseOrganization=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskChooseOrganization(a,b):this.premountTaskChooseOrganizationNodes.set(a,b)},this.unmountTaskChooseOrganization=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskChooseOrganization(a):this.premountTaskChooseOrganizationNodes.delete(a)},this.mountTaskResetPassword=(a,b)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskResetPassword(a,b):this.premountTaskResetPasswordNodes.set(a,b)},this.unmountTaskResetPassword=a=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskResetPassword(a):this.premountTaskResetPasswordNodes.delete(a)},this.addListener=a=>{if(this.clerkjs)return this.clerkjs.addListener(a);{let b=()=>{var b;let c=this.premountAddListenerCalls.get(a);c&&(null==(b=c.nativeUnsubscribe)||b.call(c),this.premountAddListenerCalls.delete(a))};return this.premountAddListenerCalls.set(a,{unsubscribe:b,nativeUnsubscribe:void 0}),b}},this.navigate=a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.navigate(a)};this.clerkjs&&this.loaded?b():this.premountMethodCalls.set("navigate",b)},this.redirectWithAuth=async(...a)=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.redirectWithAuth(...a)};return this.clerkjs&&this.loaded?b():void this.premountMethodCalls.set("redirectWithAuth",b)},this.redirectToSignIn=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.redirectToSignIn(a)};return this.clerkjs&&this.loaded?b():void this.premountMethodCalls.set("redirectToSignIn",b)},this.redirectToSignUp=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.redirectToSignUp(a)};return this.clerkjs&&this.loaded?b():void this.premountMethodCalls.set("redirectToSignUp",b)},this.redirectToUserProfile=async()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.redirectToUserProfile()};return this.clerkjs&&this.loaded?a():void this.premountMethodCalls.set("redirectToUserProfile",a)},this.redirectToAfterSignUp=()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.redirectToAfterSignUp()};if(this.clerkjs&&this.loaded)return a();this.premountMethodCalls.set("redirectToAfterSignUp",a)},this.redirectToAfterSignIn=()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.redirectToAfterSignIn()};this.clerkjs&&this.loaded?a():this.premountMethodCalls.set("redirectToAfterSignIn",a)},this.redirectToAfterSignOut=()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.redirectToAfterSignOut()};this.clerkjs&&this.loaded?a():this.premountMethodCalls.set("redirectToAfterSignOut",a)},this.redirectToOrganizationProfile=async()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.redirectToOrganizationProfile()};return this.clerkjs&&this.loaded?a():void this.premountMethodCalls.set("redirectToOrganizationProfile",a)},this.redirectToCreateOrganization=async()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.redirectToCreateOrganization()};return this.clerkjs&&this.loaded?a():void this.premountMethodCalls.set("redirectToCreateOrganization",a)},this.redirectToWaitlist=async()=>{let a=()=>{var a;return null==(a=this.clerkjs)?void 0:a.redirectToWaitlist()};return this.clerkjs&&this.loaded?a():void this.premountMethodCalls.set("redirectToWaitlist",a)},this.redirectToTasks=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.redirectToTasks(a)};return this.clerkjs&&this.loaded?b():void this.premountMethodCalls.set("redirectToTasks",b)},this.handleRedirectCallback=async a=>{var b;let c=()=>{var b;return null==(b=this.clerkjs)?void 0:b.handleRedirectCallback(a)};this.clerkjs&&this.loaded?null==(b=c())||b.catch(()=>{}):this.premountMethodCalls.set("handleRedirectCallback",c)},this.handleGoogleOneTapCallback=async(a,b)=>{var c;let d=()=>{var c;return null==(c=this.clerkjs)?void 0:c.handleGoogleOneTapCallback(a,b)};this.clerkjs&&this.loaded?null==(c=d())||c.catch(()=>{}):this.premountMethodCalls.set("handleGoogleOneTapCallback",d)},this.handleEmailLinkVerification=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.handleEmailLinkVerification(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("handleEmailLinkVerification",b)},this.authenticateWithMetamask=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.authenticateWithMetamask(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("authenticateWithMetamask",b)},this.authenticateWithCoinbaseWallet=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.authenticateWithCoinbaseWallet(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("authenticateWithCoinbaseWallet",b)},this.authenticateWithBase=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.authenticateWithBase(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("authenticateWithBase",b)},this.authenticateWithOKXWallet=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.authenticateWithOKXWallet(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("authenticateWithOKXWallet",b)},this.authenticateWithWeb3=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.authenticateWithWeb3(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("authenticateWithWeb3",b)},this.authenticateWithGoogleOneTap=async a=>(await bg(this,k,l).call(this)).authenticateWithGoogleOneTap(a),this.__internal_loadStripeJs=async()=>(await bg(this,k,l).call(this)).__internal_loadStripeJs(),this.createOrganization=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.createOrganization(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("createOrganization",b)},this.getOrganization=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.getOrganization(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("getOrganization",b)},this.joinWaitlist=async a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.joinWaitlist(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("joinWaitlist",b)},this.signOut=async(...a)=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.signOut(...a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("signOut",b)},this.__internal_attemptToEnableEnvironmentSetting=a=>{let b=()=>{var b;return null==(b=this.clerkjs)?void 0:b.__internal_attemptToEnableEnvironmentSetting(a)};if(this.clerkjs&&this.loaded)return b();this.premountMethodCalls.set("__internal_attemptToEnableEnvironmentSetting",b)};const{Clerk:b=null,publishableKey:c}=a||{};bf(this,g,c),bf(this,f,null==a?void 0:a.proxyUrl),bf(this,e,null==a?void 0:a.domain),this.options=a,this.Clerk=b,this.mode="server",bf(this,i,new bL(this)),this.options.sdkMetadata||(this.options.sdkMetadata=bM),bd(this,h).emit(bG,"loading"),bd(this,h).prioritizedOn(bG,a=>bf(this,d,a)),bd(this,g)&&this.loadClerkJS()}get publishableKey(){return bd(this,g)}get loaded(){var a;return(null==(a=this.clerkjs)?void 0:a.loaded)||!1}get status(){var a;return this.clerkjs?(null==(a=this.clerkjs)?void 0:a.status)||(this.clerkjs.loaded?"ready":"loading"):bd(this,d)}static getOrCreateInstance(a){return bf(this,j,new b(a)),bd(this,j)}static clearInstance(){bf(this,j,null)}get domain(){return"function"==typeof bd(this,e)?s.throw(A):bd(this,e)||""}get proxyUrl(){return"function"==typeof bd(this,f)?s.throw(A):bd(this,f)||""}__internal_getOption(a){var b,c;return(null==(b=this.clerkjs)?void 0:b.__internal_getOption)?null==(c=this.clerkjs)?void 0:c.__internal_getOption(a):this.options[a]}get sdkMetadata(){var a;return(null==(a=this.clerkjs)?void 0:a.sdkMetadata)||this.options.sdkMetadata||void 0}get instanceType(){var a;return null==(a=this.clerkjs)?void 0:a.instanceType}get frontendApi(){var a;return(null==(a=this.clerkjs)?void 0:a.frontendApi)||""}get isStandardBrowser(){var a;return(null==(a=this.clerkjs)?void 0:a.isStandardBrowser)||this.options.standardBrowser||!1}get __internal_queryClient(){var a;return null==(a=this.clerkjs)?void 0:a.__internal_queryClient}get isSatellite(){return"function"==typeof this.options.isSatellite&&s.throw(A)}async loadClerkJS(){var b;if("browser"===this.mode&&!this.loaded)try{if(this.Clerk){let b;aw(this.Clerk)?(b=new this.Clerk(bd(this,g),{proxyUrl:this.proxyUrl,domain:this.domain}),this.beforeLoad(b),await b.load(this.options)):(b=this.Clerk).loaded||(this.beforeLoad(b),await b.load(this.options)),a.g.Clerk=b}else if(!__BUILD_DISABLE_RHC__){if(a.g.Clerk||await bt({...this.options,publishableKey:bd(this,g),proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}),!a.g.Clerk)throw Error("Failed to download latest ClerkJS. Contact support@clerk.com.");this.beforeLoad(a.g.Clerk),await a.g.Clerk.load(this.options)}if(null==(b=a.g.Clerk)?void 0:b.loaded)return this.hydrateClerkJS(a.g.Clerk);return}catch(a){bd(this,h).emit(bG,"error"),console.error(a.stack||a.message||a);return}}get version(){var a;return null==(a=this.clerkjs)?void 0:a.version}get client(){return this.clerkjs?this.clerkjs.client:void 0}get session(){return this.clerkjs?this.clerkjs.session:void 0}get user(){return this.clerkjs?this.clerkjs.user:void 0}get organization(){return this.clerkjs?this.clerkjs.organization:void 0}get telemetry(){return this.clerkjs?this.clerkjs.telemetry:void 0}get __unstable__environment(){return this.clerkjs?this.clerkjs.__unstable__environment:void 0}get isSignedIn(){return!!this.clerkjs&&this.clerkjs.isSignedIn}get billing(){var a;return null==(a=this.clerkjs)?void 0:a.billing}get __internal_state(){return this.loaded&&this.clerkjs?this.clerkjs.__internal_state:bd(this,i)}get apiKeys(){var a;return null==(a=this.clerkjs)?void 0:a.apiKeys}__unstable__setEnvironment(...a){this.clerkjs&&"__unstable__setEnvironment"in this.clerkjs&&this.clerkjs.__unstable__setEnvironment(a)}};function bO(a){var b,c,d;let e,f,g,h,i,j,k,l,m,n,o,p,s,t,v,x,y,z,{isomorphicClerkOptions:A,initialState:B,children:C}=a,{isomorphicClerk:D,clerkStatus:E}=bP(A),[F,G]=q.default.useState({client:D.client,session:D.session,user:D.user,organization:D.organization});q.default.useEffect(()=>D.addListener(a=>G({...a})),[]);let H=(b=D.loaded,!b&&B?(e=(c=B).userId,f=c.user,g=c.sessionId,h=c.sessionStatus,i=c.sessionClaims,{userId:e,user:f,sessionId:g,session:c.session,sessionStatus:h,sessionClaims:i,organization:c.organization,orgId:c.orgId,orgRole:c.orgRole,orgPermissions:c.orgPermissions,orgSlug:c.orgSlug,actor:c.actor,factorVerificationAge:c.factorVerificationAge}):(j=(d=F).user?d.user.id:d.user,k=d.user,l=d.session?d.session.id:d.session,m=d.session,n=d.session?.status,o=d.session?d.session.lastActiveToken?.jwt?.claims:null,p=d.session?d.session.factorVerificationAge:null,s=m?.actor,t=d.organization,v=d.organization?d.organization.id:d.organization,x=t?.slug,z=(y=t?k?.organizationMemberships?.find(a=>a.organization.id===v):t)?y.permissions:y,{userId:j,user:k,sessionId:l,session:m,sessionStatus:n,sessionClaims:o,organization:t,orgId:v,orgRole:y?y.role:y,orgSlug:x,orgPermissions:z,actor:s,factorVerificationAge:p})),I=q.default.useMemo(()=>({value:D}),[E]),J=q.default.useMemo(()=>({value:F.client}),[F.client]),{sessionId:K,sessionStatus:L,sessionClaims:M,session:N,userId:O,user:P,orgId:Q,actor:R,organization:S,orgRole:T,orgSlug:U,orgPermissions:V,factorVerificationAge:W}=H,X=q.default.useMemo(()=>({value:{sessionId:K,sessionStatus:L,sessionClaims:M,userId:O,actor:R,orgId:Q,orgRole:T,orgSlug:U,orgPermissions:V,factorVerificationAge:W}}),[K,L,O,R,Q,T,U,W,null==M?void 0:M.__raw]),Y=q.default.useMemo(()=>({value:N}),[K,N]),Z=q.default.useMemo(()=>({value:P}),[O,P]),$=q.default.useMemo(()=>({value:{organization:S}}),[Q,S]);return q.default.createElement(w.Provider,{value:I},q.default.createElement(r.ClientContext.Provider,{value:J},q.default.createElement(r.SessionContext.Provider,{value:Y},q.default.createElement(r.OrganizationProvider,{...$.value},q.default.createElement(u.Provider,{value:X},q.default.createElement(r.UserContext.Provider,{value:Z},q.default.createElement(r.__experimental_CheckoutProvider,{value:void 0},C)))))))}d=new WeakMap,e=new WeakMap,f=new WeakMap,g=new WeakMap,h=new WeakMap,i=new WeakMap,j=new WeakMap,k=new WeakSet,l=function(){return new Promise(a=>{this.addOnLoaded(()=>a(this.clerkjs))})},be(bN,j);var bP=a=>{let b=q.default.useRef(bN.getOrCreateInstance(a)),[c,d]=q.default.useState(b.current.status);return q.default.useEffect(()=>{b.current.__unstable__updateProps({appearance:a.appearance})},[a.appearance]),q.default.useEffect(()=>{b.current.__unstable__updateProps({options:a})},[a.localization]),q.default.useEffect(()=>(b.current.on("status",d),()=>{b.current&&b.current.off("status",d),bN.clearInstance()}),[]),{isomorphicClerk:b.current,clerkStatus:c}},bQ=ay(function(a){let{initialState:b,children:c,__internal_bypassMissingPublishableKey:d,...e}=a,{publishableKey:f="",Clerk:g}=e;return g||d||(f?f&&!(0,o.isPublishableKey)(f)&&s.throwInvalidPublishableKeyError({key:f}):s.throwMissingPublishableKeyError()),q.default.createElement(bO,{initialState:b,isomorphicClerkOptions:e},c)},"ClerkProvider",y);function bR(a,b,c){let d=b.path||(null==c?void 0:c.path);return"path"===(b.routing||(null==c?void 0:c.routing)||"path")?d?{...c,...b,routing:"path"}:s.throw(I(a)):b.path?s.throw(J(a)):{...c,...b,path:void 0}}bQ.displayName="ClerkProvider",t({packageName:"@clerk/clerk-react"}),br("@clerk/clerk-react"),a.s(["ClerkProvider",()=>bQ,"SignInButton",()=>bH,"SignInWithMetamaskButton",()=>bI,"SignOutButton",()=>bJ,"SignUpButton",()=>bK],133711),a.s(["useRoutingProps",()=>bR],912591)},456304,(a,b,c)=>{"use strict";b.exports=a.r(480686).vendored.contexts.RouterContext},329869,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"useRouter",{enumerable:!0,get:function(){return f}});let d=a.r(401122),e=a.r(456304);function f(){return(0,d.useContext)(e.RouterContext)}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},320833,(a,b,c)=>{b.exports=a.r(329869)}];

//# sourceMappingURL=e99c8_3a95ab68._.js.map