/*! For license information please see clerk.browser.js.LICENSE.txt */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(globalThis,(function(){return function(){var e,t,n,r,i={2163:function(e,t,n){"use strict";n.d(t,{A:function(){return re}});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(r){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),i=Math.abs,s=String.fromCharCode,a=Object.assign;function o(e){return e.trim()}function c(e,t,n){return e.replace(t,n)}function l(e,t){return e.indexOf(t)}function u(e,t){return 0|e.charCodeAt(t)}function d(e,t,n){return e.slice(t,n)}function h(e){return e.length}function f(e){return e.length}function p(e,t){return t.push(e),e}var m=1,g=1,v=0,y=0,w=0,_="";function b(e,t,n,r,i,s,a){return{value:e,root:t,parent:n,type:r,props:i,children:s,line:m,column:g,length:a,return:""}}function S(e,t){return a(b("",null,null,"",null,null,0),e,{length:-e.length},t)}function k(){return w=y>0?u(_,--y):0,g--,10===w&&(g=1,m--),w}function P(){return w=y<v?u(_,y++):0,g++,10===w&&(g=1,m++),w}function C(){return u(_,y)}function O(){return y}function U(e,t){return d(_,e,t)}function A(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function E(e){return m=g=1,v=h(_=e),y=0,[]}function I(e){return _="",e}function R(e){return o(U(y-1,M(91===e?e+2:40===e?e+1:e)))}function x(e){for(;(w=C())&&w<33;)P();return A(e)>2||A(w)>3?"":" "}function T(e,t){for(;--t&&P()&&!(w<48||w>102||w>57&&w<65||w>70&&w<97););return U(e,O()+(t<6&&32==C()&&32==P()))}function M(e){for(;P();)switch(w){case e:return y;case 34:case 39:34!==e&&39!==e&&M(w);break;case 40:41===e&&M(e);break;case 92:P()}return y}function z(e,t){for(;P()&&e+w!==57&&(e+w!==84||47!==C()););return"/*"+U(t,y-1)+"*"+s(47===e?e:P())}function N(e){for(;!A(C());)P();return U(e,y)}var $="-ms-",L="-moz-",F="-webkit-",W="comm",D="rule",j="decl",V="@keyframes";function K(e,t){for(var n="",r=f(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function J(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case j:return e.return=e.return||e.value;case W:return"";case V:return e.return=e.value+"{"+K(e.children,r)+"}";case D:e.value=e.props.join(",")}return h(n=K(e.children,r))?e.return=e.value+"{"+n+"}":""}function q(e){return I(B("",null,null,null,[""],e=E(e),0,[0],e))}function B(e,t,n,r,i,a,o,d,f){for(var m=0,g=0,v=o,y=0,w=0,_=0,b=1,S=1,U=1,A=0,E="",I=i,M=a,$=r,L=E;S;)switch(_=A,A=P()){case 40:if(108!=_&&58==u(L,v-1)){-1!=l(L+=c(R(A),"&","&\f"),"&\f")&&(U=-1);break}case 34:case 39:case 91:L+=R(A);break;case 9:case 10:case 13:case 32:L+=x(_);break;case 92:L+=T(O()-1,7);continue;case 47:switch(C()){case 42:case 47:p(G(z(P(),O()),t,n),f);break;default:L+="/"}break;case 123*b:d[m++]=h(L)*U;case 125*b:case 59:case 0:switch(A){case 0:case 125:S=0;case 59+g:-1==U&&(L=c(L,/\f/g,"")),w>0&&h(L)-v&&p(w>32?H(L+";",r,n,v-1):H(c(L," ","")+";",r,n,v-2),f);break;case 59:L+=";";default:if(p($=Y(L,t,n,m,g,i,d,E,I=[],M=[],v),a),123===A)if(0===g)B(L,t,$,$,I,a,v,d,M);else switch(99===y&&110===u(L,3)?100:y){case 100:case 108:case 109:case 115:B(e,$,$,r&&p(Y(e,$,$,0,0,i,d,E,i,I=[],v),M),i,M,v,d,r?I:M);break;default:B(L,$,$,$,[""],M,0,d,M)}}m=g=w=0,b=U=1,E=L="",v=o;break;case 58:v=1+h(L),w=_;default:if(b<1)if(123==A)--b;else if(125==A&&0==b++&&125==k())continue;switch(L+=s(A),A*b){case 38:U=g>0?1:(L+="\f",-1);break;case 44:d[m++]=(h(L)-1)*U,U=1;break;case 64:45===C()&&(L+=R(P())),y=C(),g=v=h(E=L+=N(O())),A++;break;case 45:45===_&&2==h(L)&&(b=0)}}return a}function Y(e,t,n,r,s,a,l,u,h,p,m){for(var g=s-1,v=0===s?a:[""],y=f(v),w=0,_=0,S=0;w<r;++w)for(var k=0,P=d(e,g+1,g=i(_=l[w])),C=e;k<y;++k)(C=o(_>0?v[k]+" "+P:c(P,/&\f/g,v[k])))&&(h[S++]=C);return b(e,t,n,0===s?D:u,h,p,m)}function G(e,t,n){return b(e,t,n,W,s(w),d(e,2,-2),0)}function H(e,t,n,r){return b(e,t,n,j,d(e,0,r),d(e,r+1,-1),r)}var Z=function(e,t,n){for(var r=0,i=0;r=i,i=C(),38===r&&12===i&&(t[n]=1),!A(i);)P();return U(e,y)},Q=new WeakMap,X=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Q.get(n))&&!r){Q.set(e,!0);for(var i=[],a=function(e,t){return I(function(e,t){var n=-1,r=44;do{switch(A(r)){case 0:38===r&&12===C()&&(t[n]=1),e[n]+=Z(y-1,t,n);break;case 2:e[n]+=R(r);break;case 4:if(44===r){e[++n]=58===C()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=s(r)}}while(r=P());return e}(E(e),t))}(t,i),o=n.props,c=0,l=0;c<a.length;c++)for(var u=0;u<o.length;u++,l++)e.props[l]=i[c]?a[c].replace(/&\f/g,o[u]):o[u]+" "+a[c]}}},ee=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function te(e,t){switch(function(e,t){return 45^u(e,0)?(((t<<2^u(e,0))<<2^u(e,1))<<2^u(e,2))<<2^u(e,3):0}(e,t)){case 5103:return F+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return F+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return F+e+L+e+$+e+e;case 6828:case 4268:return F+e+$+e+e;case 6165:return F+e+$+"flex-"+e+e;case 5187:return F+e+c(e,/(\w+).+(:[^]+)/,F+"box-$1$2"+$+"flex-$1$2")+e;case 5443:return F+e+$+"flex-item-"+c(e,/flex-|-self/,"")+e;case 4675:return F+e+$+"flex-line-pack"+c(e,/align-content|flex-|-self/,"")+e;case 5548:return F+e+$+c(e,"shrink","negative")+e;case 5292:return F+e+$+c(e,"basis","preferred-size")+e;case 6060:return F+"box-"+c(e,"-grow","")+F+e+$+c(e,"grow","positive")+e;case 4554:return F+c(e,/([^-])(transform)/g,"$1"+F+"$2")+e;case 6187:return c(c(c(e,/(zoom-|grab)/,F+"$1"),/(image-set)/,F+"$1"),e,"")+e;case 5495:case 3959:return c(e,/(image-set\([^]*)/,F+"$1$`$1");case 4968:return c(c(e,/(.+:)(flex-)?(.*)/,F+"box-pack:$3"+$+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+F+e+e;case 4095:case 3583:case 4068:case 2532:return c(e,/(.+)-inline(.+)/,F+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(h(e)-1-t>6)switch(u(e,t+1)){case 109:if(45!==u(e,t+4))break;case 102:return c(e,/(.+:)(.+)-([^]+)/,"$1"+F+"$2-$3$1"+L+(108==u(e,t+3)?"$3":"$2-$3"))+e;case 115:return~l(e,"stretch")?te(c(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==u(e,t+1))break;case 6444:switch(u(e,h(e)-3-(~l(e,"!important")&&10))){case 107:return c(e,":",":"+F)+e;case 101:return c(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+F+(45===u(e,14)?"inline-":"")+"box$3$1"+F+"$2$3$1"+$+"$2box$3")+e}break;case 5936:switch(u(e,t+11)){case 114:return F+e+$+c(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return F+e+$+c(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return F+e+$+c(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return F+e+$+e+e}return e}var ne=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case j:e.return=te(e.value,e.length);break;case V:return K([S(e,{value:c(e.value,"@","@"+F)})],r);case D:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return K([S(e,{props:[c(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return K([S(e,{props:[c(t,/:(plac\w+)/,":"+F+"input-$1")]}),S(e,{props:[c(t,/:(plac\w+)/,":-moz-$1")]}),S(e,{props:[c(t,/:(plac\w+)/,$+"input-$1")]})],r)}return""}))}}],re=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,s,a=e.stylisPlugins||ne,o={},c=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)o[t[n]]=!0;c.push(e)}));var l,u,d,h,p=[J,(h=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&h(e)})],m=(u=[X,ee].concat(a,p),d=f(u),function(e,t,n,r){for(var i="",s=0;s<d;s++)i+=u[s](e,t,n,r)||"";return i});s=function(e,t,n,r){l=n,K(q(e?e+"{"+t.styles+"}":t.styles),m),r&&(g.inserted[t.name]=!0)};var g={key:t,sheet:new r({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:s};return g.sheet.hydrate(c),g}},8818:function(e,t,n){"use strict";n.d(t,{C:function(){return h},E:function(){return _},a:function(){return g},c:function(){return y},h:function(){return u}});var r=n(4041),i=n(2163),s=n(9575),a=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}},o=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},c=n(6979),l=n(6558),u={}.hasOwnProperty,d=r.createContext("undefined"!=typeof HTMLElement?(0,i.A)({key:"css"}):null),h=d.Provider,f=function(e){return(0,r.forwardRef)((function(t,n){var i=(0,r.useContext)(d);return e(t,i,n)}))},p=r.createContext({}),m=a((function(e){return a((function(t){return function(e,t){return"function"==typeof t?t(e):(0,s.A)({},e,t)}(e,t)}))})),g=function(e){var t=r.useContext(p);return e.theme!==t&&(t=m(t)(e.theme)),r.createElement(p.Provider,{value:t},e.children)},v="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",y=function(e,t){var n={};for(var r in t)u.call(t,r)&&(n[r]=t[r]);return n[v]=e,n},w=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return o(t,n,r),(0,l.s)((function(){return function(e,t,n){o(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,n,r)})),null},_=f((function(e,t,n){var i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var s=e[v],a=[i],o="";"string"==typeof e.className?o=function(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}(t.registered,a,e.className):null!=e.className&&(o=e.className+" ");var l=(0,c.J)(a,void 0,r.useContext(p));o+=t.key+"-"+l.name;var d={};for(var h in e)u.call(e,h)&&"css"!==h&&h!==v&&(d[h]=e[h]);return d.ref=n,d.className=o,r.createElement(r.Fragment,null,r.createElement(w,{cache:t,serialized:l,isStringTag:"string"==typeof s}),r.createElement(s,d))}))},4380:function(e,t,n){"use strict";n.d(t,{FD:function(){return o},FK:function(){return s},Y:function(){return a}});var r=n(1085),i=n(8818),s=(n(4041),n(2163),n(5985),n(6979),n(6558),r.Fragment);function a(e,t,n){return i.h.call(t,"css")?r.jsx(i.E,(0,i.c)(e,t),n):r.jsx(e,t,n)}function o(e,t,n){return i.h.call(t,"css")?r.jsxs(i.E,(0,i.c)(e,t),n):r.jsxs(e,t,n)}},6979:function(e,t,n){"use strict";n.d(t,{J:function(){return p}});var r={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function i(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var s=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,o=function(e){return 45===e.charCodeAt(1)},c=function(e){return null!=e&&"boolean"!=typeof e},l=i((function(e){return o(e)?e:e.replace(s,"-$&").toLowerCase()})),u=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(a,(function(e,t,n){return h={name:t,styles:n,next:h},t}))}return 1===r[e]||o(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return h={name:n.name,styles:n.styles,next:h},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)h={name:r.name,styles:r.styles,next:h},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=d(e,t,n[i])+";";else for(var s in n){var a=n[s];if("object"!=typeof a)null!=t&&void 0!==t[a]?r+=s+"{"+t[a]+"}":c(a)&&(r+=l(s)+":"+u(s,a)+";");else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var o=d(e,t,a);switch(s){case"animation":case"animationName":r+=l(s)+":"+o+";";break;default:r+=s+"{"+o+"}"}}else for(var h=0;h<a.length;h++)c(a[h])&&(r+=l(s)+":"+u(s,a[h])+";")}return r}(e,t,n);case"function":if(void 0!==e){var i=h,s=n(e);return h=i,d(e,t,s)}}if(null==t)return n;var a=t[n];return void 0!==a?a:n}var h,f=/label:\s*([^\s;\n{]+)\s*(;|$)/g,p=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";h=void 0;var s=e[0];null==s||void 0===s.raw?(r=!1,i+=d(n,t,s)):i+=s[0];for(var a=1;a<e.length;a++)i+=d(n,t,e[a]),r&&(i+=s[a]);f.lastIndex=0;for(var o,c="";null!==(o=f.exec(i));)c+="-"+o[1];var l=function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+c;return{name:l,styles:i,next:h}}},6558:function(e,t,n){"use strict";var r;n.d(t,{s:function(){return a}});var i=n(4041),s=!!(r||(r=n.t(i,2))).useInsertionEffect&&(r||(r=n.t(i,2))).useInsertionEffect,a=s||function(e){return e()};s||i.useLayoutEffect},3011:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function a(e){try{c(r.next(e))}catch(t){s(t)}}function o(e){try{c(r.throw(e))}catch(t){s(t)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(a,o)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(o){s=[6,o],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(6933),a="browser-tabs-lock-key";function o(e){return new Promise((function(t){return setTimeout(t,e)}))}function c(e){for(var t="",n=0;n<e;n++)t+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"[Math.floor(61*Math.random())];return t}var l=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+c(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return void 0===n&&(n=5e3),r(this,void 0,void 0,(function(){var r,s,l,u,d,h;return i(this,(function(i){switch(i.label){case 0:r=Date.now()+c(4),s=Date.now()+n,l=a+"-"+t,u=window.localStorage,i.label=1;case 1:return Date.now()<s?[4,o(30)]:[3,8];case 2:return i.sent(),null!==u.getItem(l)?[3,5]:(d=this.id+"-"+t+"-"+r,[4,o(Math.floor(25*Math.random()))]);case 3:return i.sent(),u.setItem(l,JSON.stringify({id:this.id,iat:r,timeoutKey:d,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return i.sent(),null!==(h=u.getItem(l))&&(h=JSON.parse(h)).id===this.id&&h.iat===r?(this.acquiredIatSet.add(r),this.refreshLockWhileAcquired(l,r),[2,!0]):[3,7];case 5:return e.lockCorrector(),[4,this.waitForSomethingToChange(s)];case 6:i.sent(),i.label=7;case 7:return r=Date.now()+c(4),[3,1];case 8:return[2,!1]}}))}))},e.prototype.refreshLockWhileAcquired=function(e,t){return r(this,void 0,void 0,(function(){var n=this;return i(this,(function(a){return setTimeout((function(){return r(n,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return[4,s.default().lock(t)];case 1:return i.sent(),this.acquiredIatSet.has(t)?(n=window.localStorage,null===(r=n.getItem(e))?(s.default().unlock(t),[2]):((r=JSON.parse(r)).timeRefreshed=Date.now(),n.setItem(e,JSON.stringify(r)),s.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(s.default().unlock(t),[2])}}))}))}),1e3),[2]}))}))},e.prototype.waitForSomethingToChange=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,new Promise((function(n){var r=!1,i=Date.now(),s=!1;function a(){if(s||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(o),s=!0),!r){r=!0;var t=50-(Date.now()-i);t>0?setTimeout(n,t):n()}}window.addEventListener("storage",a),e.addToWaiting(a);var o=setTimeout(a,Math.max(0,t-Date.now()))}))];case 1:return n.sent(),[2]}}))}))},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter((function(e){return e!==t})))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach((function(e){return e()}))},e.prototype.releaseLock=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.releaseLock__private__=function(t){return r(this,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:return n=window.localStorage,r=a+"-"+t,null===(o=n.getItem(r))?[2]:(o=JSON.parse(o)).id!==this.id?[3,2]:[4,s.default().lock(o.iat)];case 1:i.sent(),this.acquiredIatSet.delete(o.iat),n.removeItem(r),s.default().unlock(o.iat),e.notifyWaiters(),i.label=2;case 2:return[2]}}))}))},e.lockCorrector=function(){for(var t=Date.now()-5e3,n=window.localStorage,r=Object.keys(n),i=!1,s=0;s<r.length;s++){var o=r[s];if(o.includes(a)){var c=n.getItem(o);null!==c&&(void 0===(c=JSON.parse(c)).timeRefreshed&&c.timeAcquired<t||void 0!==c.timeRefreshed&&c.timeRefreshed<t)&&(n.removeItem(o),i=!0)}}i&&e.notifyWaiters()},e.waiters=void 0,e}();t.default=l},6933:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())}))},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}},2580:function(e){e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected a string");for(var n,r=String(e),i="",s=!!t&&!!t.extended,a=!!t&&!!t.globstar,o=!1,c=t&&"string"==typeof t.flags?t.flags:"",l=0,u=r.length;l<u;l++)switch(n=r[l]){case"/":case"$":case"^":case"+":case".":case"(":case")":case"=":case"!":case"|":i+="\\"+n;break;case"?":if(s){i+=".";break}case"[":case"]":if(s){i+=n;break}case"{":if(s){o=!0,i+="(";break}case"}":if(s){o=!1,i+=")";break}case",":if(o){i+="|";break}i+="\\"+n;break;case"*":for(var d=r[l-1],h=1;"*"===r[l+1];)h++,l++;var f=r[l+1];a?!(h>1)||"/"!==d&&void 0!==d||"/"!==f&&void 0!==f?i+="([^/]*)":(i+="((?:[^/]*(?:/|$))*)",l++):i+=".*";break;default:i+=n}return c&&~c.indexOf("g")||(i="^"+i+"$"),new RegExp(i,c)}},5985:function(e,t,n){"use strict";var r=n(524),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};function c(e){return r.isMemo(e)?a:o[e.$$typeof]||i}o[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var a=u(n);d&&(a=a.concat(d(n)));for(var o=c(t),m=c(n),g=0;g<a.length;++g){var v=a[g];if(!(s[v]||r&&r[v]||m&&m[v]||o&&o[v])){var y=h(n,v);try{l(t,v,y)}catch(w){}}}}return t}},320:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,o=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,_=n?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case s:case o:case a:case f:return e;default:switch(e=e&&e.$$typeof){case l:case h:case g:case m:case c:return e;default:return t}}case i:return t}}}function S(e){return b(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=c,t.Element=r,t.ForwardRef=h,t.Fragment=s,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=o,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return S(e)||b(e)===u},t.isConcurrentMode=S,t.isContextConsumer=function(e){return b(e)===l},t.isContextProvider=function(e){return b(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return b(e)===h},t.isFragment=function(e){return b(e)===s},t.isLazy=function(e){return b(e)===g},t.isMemo=function(e){return b(e)===m},t.isPortal=function(e){return b(e)===i},t.isProfiler=function(e){return b(e)===o},t.isStrictMode=function(e){return b(e)===a},t.isSuspense=function(e){return b(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===d||e===o||e===a||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===c||e.$$typeof===l||e.$$typeof===h||e.$$typeof===y||e.$$typeof===w||e.$$typeof===_||e.$$typeof===v)},t.typeOf=b},524:function(e,t,n){"use strict";e.exports=n(320)},3335:function(e,t,n){"use strict";var r=n(4041),i=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,o=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,s={},l=null,u=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,r)&&!c.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:i,type:e,key:l,ref:u,props:s,_owner:o.current}}t.Fragment=s,t.jsx=l,t.jsxs=l},4304:function(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function y(){}function w(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var _=w.prototype=new y;_.constructor=w,m(_,v.prototype),_.isPureReactComponent=!0;var b=Array.isArray,S=Object.prototype.hasOwnProperty,k={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,r){var i,s={},a=null,o=null;if(null!=t)for(i in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(a=""+t.key),t)S.call(t,i)&&!P.hasOwnProperty(i)&&(s[i]=t[i]);var c=arguments.length-2;if(1===c)s.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps)void 0===s[i]&&(s[i]=c[i]);return{$$typeof:n,type:e,key:a,ref:o,props:s,_owner:k.current}}function O(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var U=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function E(e,t,i,s,a){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var c=!1;if(null===e)c=!0;else switch(o){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case n:case r:c=!0}}if(c)return a=a(c=e),e=""===s?"."+A(c,0):s,b(a)?(i="",null!=e&&(i=e.replace(U,"$&/")+"/"),E(a,t,i,"",(function(e){return e}))):null!=a&&(O(a)&&(a=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,i+(!a.key||c&&c.key===a.key?"":(""+a.key).replace(U,"$&/")+"/")+e)),t.push(a)),1;if(c=0,s=""===s?".":s+":",b(e))for(var l=0;l<e.length;l++){var u=s+A(o=e[l],l);c+=E(o,t,i,u,a)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=f&&e[f]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),l=0;!(o=e.next()).done;)c+=E(o=o.value,t,i,u=s+A(o,l++),a);else if("object"===o)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function I(e,t,n){if(null==e)return e;var r=[],i=0;return E(e,r,"","",(function(e){return t.call(n,e,i++)})),r}function R(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var x={current:null},T={transition:null},M={ReactCurrentDispatcher:x,ReactCurrentBatchConfig:T,ReactCurrentOwner:k};function z(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:I,forEach:function(e,t,n){I(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return I(e,(function(){t++})),t},toArray:function(e){return I(e,(function(e){return e}))||[]},only:function(e){if(!O(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=i,t.Profiler=a,t.PureComponent=w,t.StrictMode=s,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,t.act=z,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=m({},e.props),s=e.key,a=e.ref,o=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,o=k.current),void 0!==t.key&&(s=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in t)S.call(t,l)&&!P.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==c?c[l]:t[l])}var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:n,type:e.type,key:s,ref:a,props:i,_owner:o}},t.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=O,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:R}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=T.transition;T.transition={};try{e()}finally{T.transition=t}},t.unstable_act=z,t.useCallback=function(e,t){return x.current.useCallback(e,t)},t.useContext=function(e){return x.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return x.current.useDeferredValue(e)},t.useEffect=function(e,t){return x.current.useEffect(e,t)},t.useId=function(){return x.current.useId()},t.useImperativeHandle=function(e,t,n){return x.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return x.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return x.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return x.current.useMemo(e,t)},t.useReducer=function(e,t,n){return x.current.useReducer(e,t,n)},t.useRef=function(e){return x.current.useRef(e)},t.useState=function(e){return x.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return x.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return x.current.useTransition()},t.version="18.3.1"},4041:function(e,t,n){"use strict";e.exports=n(4304)},1085:function(e,t,n){"use strict";e.exports=n(3335)},8989:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(T){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var s=t&&t.prototype instanceof v?t:v,a=Object.create(s.prototype),o=new I(r||[]);return i(a,"_invoke",{value:O(e,n,o)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(T){return{type:"throw",arg:T}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",m="completed",g={};function v(){}function y(){}function w(){}var _={};l(_,a,(function(){return this}));var b=Object.getPrototypeOf,S=b&&b(b(R([])));S&&S!==n&&r.call(S,a)&&(_=S);var k=w.prototype=v.prototype=Object.create(_);function P(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(i,s,a,o){var c=d(e[i],e,s);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,o)}),(function(e){n("throw",e,a,o)})):t.resolve(u).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,o)}))}o(c.arg)}var s;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return s=s?s.then(i,i):i()}})}function O(e,t,n){var r=h;return function(i,s){if(r===p)throw new Error("Generator is already running");if(r===m){if("throw"===i)throw s;return x()}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var o=U(a,n);if(o){if(o===g)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=d(e,t,n);if("normal"===c.type){if(r=n.done?m:f,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=m,n.method="throw",n.arg=c.arg)}}}function U(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,U(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var s=d(i,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,g;var a=s.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function R(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}return{next:x}}function x(){return{value:t,done:!0}}return y.prototype=w,i(k,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:y,configurable:!0}),y.displayName=l(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,l(e,c,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},P(C.prototype),l(C.prototype,o,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,s){void 0===s&&(s=Promise);var a=new C(u(t,n,r,i),s);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(k),l(k,c,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=R,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return o.type="throw",o.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,g):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),E(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:R(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(n){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},6480:function(e,t,n){"use strict";n.d(t,{$i:function(){return u},CL:function(){return i},Ej:function(){return r},MC:function(){return a},OQ:function(){return o},P6:function(){return d},UU:function(){return l},e8:function(){return c},rt:function(){return s}});const r=["redirect_url","after_sign_in_url","after_sign_up_url","sign_in_force_redirect_url","sign_in_fallback_redirect_url","sign_up_force_redirect_url","sign_up_fallback_redirect_url"],i="__clerk_modal_state",s="__clerk_synced",a="__clerk_satellite_url",o={FORM_IDENTIFIER_NOT_FOUND:"form_identifier_not_found",FORM_PASSWORD_INCORRECT:"form_password_incorrect",INVALID_STRATEGY_FOR_USER:"strategy_for_user_invalid",NOT_ALLOWED_TO_SIGN_UP:"not_allowed_to_sign_up",OAUTH_ACCESS_DENIED:"oauth_access_denied",OAUTH_EMAIL_DOMAIN_RESERVED_BY_SAML:"oauth_email_domain_reserved_by_saml",NOT_ALLOWED_ACCESS:"not_allowed_access",SAML_USER_ATTRIBUTE_MISSING:"saml_user_attribute_missing",USER_LOCKED:"user_locked",EXTERNAL_ACCOUNT_NOT_FOUND:"external_account_not_found",SIGN_UP_MODE_RESTRICTED:"sign_up_mode_restricted"},c=["email_address","phone_number","username"],l=["email_address","phone_number","username","first_name","last_name"],u=350,d={PUBLIC:"public",RESTRICTED:"restricted"}},5882:function(e,t,n){"use strict";n.d(t,{$V:function(){return u},A8:function(){return O},BF:function(){return s},Gm:function(){return m},HZ:function(){return p},IJ:function(){return _},Rj:function(){return g},SK:function(){return U},Tw:function(){return v},U6:function(){return C},ZX:function(){return k},a2:function(){return h},eS:function(){return a},gY:function(){return P},hs:function(){return d},i$:function(){return c},iq:function(){return b},jB:function(){return o},kX:function(){return l},lU:function(){return A},pV:function(){return y},qd:function(){return E},sW:function(){return i},ut:function(){return S},wv:function(){return w},z$:function(){return f}});const r="ClerkJS:";function i(e,t){throw new Error(`${r} Network error at "${e}" - ${t}. Please try again.`)}function s(){throw new Error(`${r} Something went wrong initializing Clerk.`)}function a(e=""){throw new Error(`${r} Something went wrong initializing Clerk in development mode.${e&&` ${e}`}`)}function o(e){throw new Error(`${r} Missing path option. The ${e} component was mounted with path routing so you need to specify the path where the component is mounted on e.g. path="/sign-in".`)}function c(e){throw new Error(`${r} You must wrap your application in a <${e}> component.`)}function l(){throw new Error(`${r} Clerk is undefined`)}function u(){throw new Error(`${r} The target element is empty. Provide a valid DOM element.`)}function d(){throw new Error(`${r} Missing FAPI client in resources.`)}function h(e){throw new Error(`${r} Token refresh failed (error='${e}')`)}function f(e){throw new Error(`${r} Something went wrong initializing Clerk during the ${e} flow. Please contact support.`)}function p(e){throw new Error(`${r} You need to start a ${e} flow by calling ${e}.create() first.`)}function m(e,t){throw new Error(`${r} Strategy "${t}" is not a valid strategy for ${e}.`)}function g(e){throw new Error(`${r} You need to start a ${e} flow by calling ${e}.create({ identifier: 'your web3 wallet address' }) first`)}function v(){throw new Error(`${r} You need to start a SignIn flow by calling SignIn.create({ strategy: 'passkey' }) first`)}function y(e=""){throw new Error(`${r} Missing '${e}' option`)}function w(e,t){throw new Error(`${r} Response: ${e||0} not supported yet.\nFor more information contact us at ${t}`)}function _(){throw new Error(`${r} Missing dev browser jwt. Please contact support.`)}function b(){throw new Error(`${r} Missing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl.`)}function S(){throw new Error(`${r} The signInUrl needs to be on a different origin than your satellite application.`)}function k(){throw new Error(`${r} The signInUrl needs to have a absolute url format.`)}function P(){throw new Error(`${r} Missing signInUrl. A satellite application needs to specify the signInUrl for development instances.`)}function C(){throw new Error(`${r} Invalid redirect_url. A valid http or https url should be used for the redirection.`)}function O(e){throw new Error(`${r} Unable to retrieve a third party script${e?` ${e}`:""}.`)}function U(e){throw new Error(`${r} Invalid routing strategy, path cannot be used in tandem with ${e}.`)}function A(e){throw new Error(`${r} Calling ${e}.reload is not currently supported. Please contact support.`)}function E(e){throw new Error(`${r} Missing publicKey. When calling 'navigator.credentials.${e}()' it is required to pass a publicKey object.`)}},2692:function(e,t,n){"use strict";n.d(t,{A:function(){return r},B:function(){return i}});const r={TokenUpdate:"token:update"},i=(()=>{const e=new Map;return{on:(t,n)=>{var r;e.get(t)||e.set(t,[]),null===(r=e.get(t))||void 0===r||r.push(n)},dispatch:(t,n)=>{(e.get(t)||[]).forEach((e=>"function"==typeof e&&e(n)))},off:(t,n)=>{const r=e.get(t)||[];r.length&&(n&&e.set(t,r.filter((e=>e!==n))),e.set(t,[]))}}})()},600:function(e,t,n){"use strict";n.d(t,{Y:function(){return a}});var r=n(8174),i=n(4870),s=n(5882);function a(e){const t=[],n=[];function a({method:t,path:n,sessionId:r,search:s,rotatingTokenNonce:a}){const o=new URLSearchParams(s);e.version&&o.append("_clerk_js_version",e.version),a&&o.append("rotating_token_nonce",a),"development"===e.instanceType&&e.isSatellite&&o.append("__domain",e.domain),t&&"GET"!==t&&"POST"!==t&&o.append("_method",t),n&&!n.startsWith("/client")&&r&&o.append("_clerk_session_id",r);const c=[...o.entries()].reduce(((e,[t,n])=>(e[t]=n.includes(",")?n.split(","):n,e)),{});return(0,i.Ws)(c)}function o(t){const{path:n,pathPrefix:r="v1"}=t,{proxyUrl:s,domain:o,frontendApi:c,instanceType:l}=e,u="production"===l?o:"";if(s){const e=new URL(s),o=e.pathname.slice(1,e.pathname.length);return(0,i.kZ)({base:e.origin,pathname:`${o}/${r}${n}`,search:a(t)},{stringify:!1})}return(0,i.kZ)({base:`https://${u||c}`,pathname:`${r}${n}`,search:a(t)},{stringify:!1})}return{buildEmailAddress:function(t){return(0,i.DG)({localPart:t,frontendApi:e.frontendApi})},buildUrl:o,onAfterResponse:function(e){n.push(e)},onBeforeRequest:function(e){t.push(e)},request:async function(a){var c;let{method:l="GET",body:u}=a;a.url=o({...a,sessionId:null===(c=e.session)||void 0===c?void 0:c.id}),a.headers||(a.headers=new Headers),"GET"===l||u instanceof FormData||a.headers.has("content-type")||a.headers.set("content-type","application/x-www-form-urlencoded"),"application/x-www-form-urlencoded"===a.headers.get("content-type")&&(a.body=u?(0,i.Ws)(u,{keyEncoder:r.C8}):u);const d=await async function(e){const n="undefined"!=typeof window&&window.__unstable__onBeforeRequest;for await(const r of[n,...t].filter((e=>e)))if(!1===await r(e))return!1;return!0}(a),h="GET"===l?"GET":"POST";let f;const p=a.url.toString(),m={...a,credentials:"include",method:h};try{if(d){const e=(0,r.kv)()?4:11;f="GET"===h?await(0,r.Nv)((()=>fetch(p,m)),{firstDelay:500,maxDelay:3e3,shouldRetry:(t,n)=>n<e}):await fetch(p,m)}else f=new Response("{}",a)}catch(y){(0,s.sW)(p,y)}const g=await f.json(),v=Object.assign(f,{payload:g});return await async function(e,t){const r="undefined"!=typeof window&&window.__unstable__onAfterResponse;for await(const i of[r,...n].filter((e=>e)))if(!1===await i(e,t))return!1;return!0}(a,v),v}}}},4934:function(e,t,n){"use strict";n.d(t,{xW:function(){return o},Qx:function(){return s},LR:function(){return w.LR},cR:function(){return w.cR},Kj:function(){return d},Z4:function(){return h},lx:function(){return f},Tl:function(){return m},NZ:function(){return w.NZ},Ys:function(){return w.Ys},OH:function(){return v},Fi:function(){return O},NX:function(){return U},_V:function(){return A},yb:function(){return z},L5:function(){return N},i7:function(){return $},YO:function(){return L},De:function(){return X},U7:function(){return k},go:function(){return E},LA:function(){return ee},t3:function(){return F},Nn:function(){return Z},Kn:function(){return te},Ls:function(){return ie},Hx:function(){return ce},Vx:function(){return P},_k:function(){return ue},ou:function(){return le},KJ:function(){return fe},E0:function(){return se},wE:function(){return pe},tl:function(){return a},o6:function(){return S},Nv:function(){return me},$R:function(){return w.$R},Cm:function(){return w.Cm},ux:function(){return w.ux},si:function(){return w.si}});var r=n(8521),i=n(5882);class s{constructor(){this.pathRoot=""}static get fapiClient(){return s.clerk.getFapiClient()}static async _fetch(e,t={}){let n;s.fapiClient||(0,i.hs)();try{n=await s.fapiClient.request(e)}catch(u){if((0,r.CS)())throw u;return console.warn(u),null}const{payload:a,status:o,statusText:c,headers:l}=n;if(l){const e=l.get("x-country");this.clerk.__internal_setCountry(e?e.toLowerCase():null)}if(("GET"!==e.method||t.forceUpdateClient)&&this._updateClient(a),o>=200&&o<=299)return a;if(401===o&&await s.clerk.handleUnauthenticated(),o>=400)throw new w.LR(c,{data:null==a?void 0:a.errors,status:o});return null}static _updateClient(e){var t;if(!e)return;const n=e.client||(null===(t=e.meta)||void 0===t?void 0:t.client);n&&s.clerk&&s.clerk.updateClient(d.getInstance().fromJSON(n))}isNew(){return!this.id}path(e){const t=this.pathRoot;if(this.isNew())return t;const n=t.replace(/[^/]$/,"$&/")+encodeURIComponent(this.id);return e?n.replace(/[^/]$/,"$&/")+encodeURIComponent(e):n}async _baseGet(e={}){const t=await s._fetch({method:"GET",path:this.path(),rotatingTokenNonce:e.rotatingTokenNonce},e);return this.fromJSON((null==t?void 0:t.response)||t)}async _baseMutate({action:e,body:t,method:n="POST",path:r}){const i=await s._fetch({method:n,path:r||this.path(e),body:t});return this.fromJSON((null==i?void 0:i.response)||i)}async _basePost(e={}){return this._baseMutate({...e,method:"POST"})}async _basePut(e={}){return this._baseMutate({...e,method:"PUT"})}async _basePatch(e={}){return this._baseMutate({...e,method:"PATCH"})}async _baseDelete(e={}){await this._baseMutate({...e,method:"DELETE"})}async reload(e){const{rotatingTokenNonce:t}=e||{};return this._baseGet({forceUpdateClient:!0,rotatingTokenNonce:t})}}class a extends s{constructor(e){super(),this.id=void 0,this.socialProviderStrategies=[],this.authenticatableSocialStrategies=[],this.web3FirstFactors=[],this.enabledFirstFactorIdentifiers=[],this.fromJSON(e)}get instanceIsPasswordBased(){return this.attributes.password.enabled&&this.attributes.password.required}get hasValidAuthFactor(){return this.attributes.email_address.enabled||this.attributes.phone_number.enabled||this.attributes.password.required&&this.attributes.username.required}fromJSON(e){var t,n,r;return e?(this.social=e.social,this.saml=e.saml,this.attributes=Object.fromEntries(Object.entries(e.attributes).map((e=>[e[0],{...e[1],name:e[0]}]))),this.actions=e.actions,this.signIn=e.sign_in,this.signUp=e.sign_up,this.passwordSettings={...e.password_settings,min_length:Math.max(null===(t=null==e?void 0:e.password_settings)||void 0===t?void 0:t.min_length,8),max_length:0===(null===(n=null==e?void 0:e.password_settings)||void 0===n?void 0:n.max_length)?72:Math.min(null===(r=null==e?void 0:e.password_settings)||void 0===r?void 0:r.max_length,72)},this.passkeySettings=e.passkey_settings,this.socialProviderStrategies=this.getSocialProviderStrategies(e.social),this.authenticatableSocialStrategies=this.getAuthenticatableSocialStrategies(e.social),this.web3FirstFactors=this.getWeb3FirstFactors(this.attributes),this.enabledFirstFactorIdentifiers=this.getEnabledFirstFactorIdentifiers(this.attributes),this):this}getEnabledFirstFactorIdentifiers(e){return e?Object.entries(e).filter((([e,t])=>t.used_for_first_factor&&!e.startsWith("web3"))).map((([e])=>e)):[]}getWeb3FirstFactors(e){return e?Object.entries(e).filter((([e,t])=>t.used_for_first_factor&&e.startsWith("web3"))).map((([,e])=>e.first_factors)).flat():[]}getSocialProviderStrategies(e){return e?Object.entries(e).filter((([,e])=>e.enabled)).map((([,e])=>e.strategy)).sort():[]}getAuthenticatableSocialStrategies(e){return e?Object.entries(e).filter((([,e])=>e.enabled&&e.authenticatable)).map((([,e])=>e.strategy)).sort():[]}}class o extends s{constructor(e){super(),this.fromJSON(e)}fromJSON(e){return this.singleSessionMode=!e||e.single_session_mode,this}}function c(e){const t=new Date(e||new Date);return(n=t)instanceof Date&&!isNaN(n.getTime())?t:new Date;var n}class l{static fromKey(e){const[t,n,r=""]=e.split("::");return new l(t,{audience:r,tokenId:n})}constructor(e,t){this.prefix=e,this.data=t,this.prefix=e,this.data=t}toKey(){const{tokenId:e,audience:t}=this.data;return[this.prefix,e,t||""].join("::")}}const u=((e="clerk")=>{const t=new Map;let n;return{get:(n,r=10)=>{const i=new l(e,n),s=t.get(i.toKey());if(!s)return;const a=Math.floor(Date.now()/1e3)-s.createdAt;if(!(s.expiresIn-a<(r||1)+5))return s.entry;t.delete(i.toKey())},set:r=>{const i=new l(e,{audience:r.audience,tokenId:r.tokenId}).toKey(),s={entry:r,createdAt:Math.floor(Date.now()/1e3)},a=()=>{t.get(i)===s&&t.delete(i)};r.tokenResolver.then((e=>{if(!e.jwt)return a();const t=e.jwt.claims.exp-e.jwt.claims.iat;s.expiresIn=t,n=setTimeout(a,1e3*t),"function"==typeof n.unref&&n.unref()})).catch((()=>{a()})),t.set(i,s)},clear:()=>{clearTimeout(n),t.clear()},size:()=>t.size}})();class d extends s{static getInstance(){return d.instance||(d.instance=new d),d.instance}static isClientResource(e){return!!e&&e instanceof d}constructor(e=null){super(),this.pathRoot="/client",this.sessions=[],this.signUp=new ce,this.signIn=new ie,this.lastActiveSessionId=null,this.createdAt=null,this.updatedAt=null,this.fromJSON(e)}get signUpAttempt(){return this.signUp}get signInAttempt(){return this.signIn}get activeSessions(){return this.sessions.filter((e=>"active"===e.status))}create(){return this._basePut()}fetch(){return this._baseGet()}async destroy(){return this._baseDelete({path:"/client"}).then((()=>{u.clear(),this.id="",this.sessions=[],this.signUp=new ce(null),this.signIn=new ie(null),this.lastActiveSessionId=null,this.createdAt=null,this.updatedAt=null}))}removeSessions(){return this._baseDelete({path:this.path()+"/sessions"})}clearCache(){return this.sessions.forEach((e=>e.clearCache()))}fromJSON(e){return e&&(this.id=e.id,this.sessions=(e.sessions||[]).map((e=>new Z(e))),this.signUp=new ce(e.sign_up),this.signIn=new ie(e.sign_in),this.lastActiveSessionId=e.last_active_session_id,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at)),this}path(){return this.pathRoot}}class h{constructor(e){this.object="",this.deleted=!1,this.fromJSON(e)}fromJSON(e){return e?(this.object=e.object,this.id=e.id,this.slug=e.slug,this.deleted=e.deleted,this):this}}class f extends s{constructor(e){super(),this.captchaPublicKey=null,this.captchaWidgetType=null,this.captchaProvider="turnstile",this.captchaPublicKeyInvisible=null,this.captchaOauthBypass=[],this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.instanceEnvironmentType=e.instance_environment_type,this.applicationName=e.application_name,this.theme=e.theme,this.preferredSignInStrategy=e.preferred_sign_in_strategy,this.logoImageUrl=e.logo_image_url,this.faviconImageUrl=e.favicon_image_url,this.homeUrl=e.home_url,this.signInUrl=e.sign_in_url,this.signUpUrl=e.sign_up_url,this.userProfileUrl=e.user_profile_url,this.afterSignInUrl=e.after_sign_in_url,this.afterSignUpUrl=e.after_sign_up_url,this.afterSignOutOneUrl=e.after_sign_out_one_url,this.afterSignOutAllUrl=e.after_sign_out_all_url,this.afterSwitchSessionUrl=e.after_switch_session_url,this.branded=e.branded,this.captchaPublicKey=e.captcha_public_key,this.captchaWidgetType=e.captcha_widget_type,this.captchaProvider=e.captcha_provider,this.captchaPublicKeyInvisible=e.captcha_public_key_invisible,this.captchaOauthBypass=e.captcha_oauth_bypass||["oauth_google","oauth_microsoft","oauth_apple"],this.supportEmail=e.support_email||"",this.clerkJSVersion=e.clerk_js_version,this.organizationProfileUrl=e.organization_profile_url,this.createOrganizationUrl=e.create_organization_url,this.afterLeaveOrganizationUrl=e.after_leave_organization_url,this.afterCreateOrganizationUrl=e.after_create_organization_url,this.googleOneTapClientId=e.google_one_tap_client_id,this.showDevModeWarning=e.show_devmode_warning,this.termsUrl=e.terms_url,this.privacyPolicyUrl=e.privacy_policy_url,this):this}}var p=n(429);class m extends s{constructor(e,t){super(),this.emailAddress="",this.linkedTo=[],this.prepareVerification=e=>this._basePost({action:"prepare_verification",body:{...e}}),this.attemptVerification=e=>{const{code:t}=e||{};return this._basePost({action:"attempt_verification",body:{code:t}})},this.createEmailLinkFlow=()=>{const{run:e,stop:t}=(0,p.v)();return{startEmailLinkFlow:async({redirectUrl:n})=>(this.id||(0,i.HZ)("SignUp"),await this.prepareVerification({strategy:"email_link",redirectUrl:n}),new Promise(((n,r)=>{e((()=>this.reload().then((e=>{"verified"===e.verification.status&&(t(),n(e))})).catch((e=>{t(),r(e)}))))}))),cancelEmailLinkFlow:t}},this.destroy=()=>this._baseDelete(),this.toString=()=>this.emailAddress,this.pathRoot=t,this.fromJSON(e)}create(){return this._basePost({body:{email_address:this.emailAddress}})}fromJSON(e){return e?(this.id=e.id,this.emailAddress=e.email_address,this.verification=new S(e.verification),this.linkedTo=(e.linked_to||[]).map((e=>new U(e))),this):this}}class g extends s{constructor(e){super(),this.fromJSON(e)}fromJSON(e){const{enabled:t=!1,max_allowed_memberships:n=0,actions:r,domains:i}=e||{};return this.enabled=t,this.maxAllowedMemberships=n,this.actions={adminDelete:(null==r?void 0:r.admin_delete)||!1},this.domains={enabled:(null==i?void 0:i.enabled)||!1,enrollmentModes:(null==i?void 0:i.enrollment_modes)||[],defaultRole:(null==i?void 0:i.default_role)||null},this}}class v extends s{static getInstance(){return v.instance||(v.instance=new v),v.instance}constructor(e=null){super(),this.pathRoot="/environment",this.isSingleSession=()=>this.authConfig.singleSessionMode,this.isProduction=()=>"production"===this.displayConfig.instanceEnvironmentType,this.isDevelopmentOrStaging=()=>!this.isProduction(),this.onWindowLocationHost=()=>this.displayConfig.backendHost===window.location.host,this.fromJSON(e)}fetch({touch:e}={touch:!1}){return e?this._basePatch({}):this._baseGet()}fromJSON(e){return e&&(this.authConfig=new o(e.auth_config),this.displayConfig=new f(e.display_config),this.userSettings=new a(e.user_settings),this.organizationSettings=new g(e.organization_settings),this.maintenanceMode=e.maintenance_mode),this}}var y,w=n(9859),_=n(8174),b=n(2410);class S extends s{constructor(e){super(),this.pathRoot="",this.status=null,this.strategy=null,this.nonce=null,this.message=null,this.externalVerificationRedirectURL=null,this.attempts=null,this.expireAt=null,this.error=null,this.verifiedAtClient=null,this.verifiedFromTheSameClient=()=>{var e,t;return this.verifiedAtClient===(null===(t=null===(e=s.clerk)||void 0===e?void 0:e.client)||void 0===t?void 0:t.id)},this.fromJSON(e)}fromJSON(e){return e&&(this.status=e.status,this.verifiedAtClient=e.verified_at_client,this.strategy=e.strategy,this.nonce=e.nonce||null,this.message=e.message||null,e.external_verification_redirect_url?this.externalVerificationRedirectURL=new URL(e.external_verification_redirect_url):this.externalVerificationRedirectURL=null,this.attempts=e.attempts,this.expireAt=c(e.expire_at),this.error=e.error?(0,w.u$)(e.error):null),this}}class k extends S{constructor(e){super(e),this.publicKey=null,this.fromJSON(e)}fromJSON(e){return super.fromJSON(e),(null==e?void 0:e.nonce)&&(this.publicKey=(0,b.VQ)(JSON.parse(e.nonce))),this}}class P{constructor(e){e?(this.emailAddress=new C(e.email_address),this.phoneNumber=new C(e.phone_number),this.web3Wallet=new C(e.web3_wallet),this.externalAccount=new S(e.external_account)):(this.emailAddress=new C(null),this.phoneNumber=new C(null),this.web3Wallet=new C(null),this.externalAccount=new S(null))}}class C extends S{constructor(e){super(e),e?(this.nextAction=e.next_action,this.supportedStrategies=e.supported_strategies):(this.nextAction="",this.supportedStrategies=[])}}class O extends s{constructor(e,t){super(),this.providerUserId="",this.emailAddress="",this.approvedScopes="",this.firstName="",this.lastName="",this.imageUrl="",this.username="",this.publicMetadata={},this.label="",this.verification=null,this.reauthorize=e=>{const{additionalScopes:t,redirectUrl:n}=e||{};return this._basePatch({action:"reauthorize",body:{additional_scope:t,redirect_url:n}})},this.destroy=()=>this._baseDelete(),this.pathRoot=t,this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.identificationId=e.identification_id,this.providerUserId=e.provider_user_id,this.approvedScopes=e.approved_scopes,this.imageUrl=e.image_url,this.emailAddress=e.email_address,this.firstName=e.first_name,this.lastName=e.last_name,this.provider=(e.provider||"").replace("oauth_",""),this.username=e.username,this.publicMetadata=e.public_metadata,this.label=e.label,e.verification&&(this.verification=new S(e.verification)),this):this}providerSlug(){return this.provider}providerTitle(){return[(0,_.Ns)(this.providerSlug()),"Account"].join(" ")}accountIdentifier(){return this.username||this.emailAddress||this.label}}class U extends s{constructor(e){super(),this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.type=e.type,this):this}}class A extends s{static async create(e,t={}){var n;let r,i=t;"string"==typeof t.file?(i=t.file,r=new Headers({"Content-Type":"application/octet-stream"})):t.file&&(i=new FormData,i.append("file",t.file));const a=null===(n=await s._fetch({path:e,method:"POST",body:i,headers:r}))||void 0===n?void 0:n.response;return new A(a)}static async delete(e){var t;const n=null===(t=await s._fetch({path:e,method:"DELETE"}))||void 0===t?void 0:t.response;return new A(n)}constructor(e){super(),this.name=null,this.publicUrl=null,this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.name=e.name,this.publicUrl=e.public_url,this):this}}class E extends s{constructor(e,t){super(),this.phoneNumber="",this.reservedForSecondFactor=!1,this.defaultSecondFactor=!1,this.linkedTo=[],this.create=()=>this._basePost({body:{phone_number:this.phoneNumber}}),this.prepareVerification=()=>this._basePost({action:"prepare_verification",body:{strategy:"phone_code"}}),this.attemptVerification=e=>{const{code:t}=e||{};return this._basePost({action:"attempt_verification",body:{code:t}})},this.setReservedForSecondFactor=e=>{const{reserved:t}=e||{};return this._basePatch({body:{reserved_for_second_factor:t}})},this.makeDefaultSecondFactor=()=>this._basePatch({body:{default_second_factor:!0}}),this.destroy=()=>this._baseDelete(),this.toString=()=>{const e=this.phoneNumber.match(/^(\d{3})(\d{3})(\d{4})$/);return e?"("+e[1]+") "+e[2]+"-"+e[3]:this.phoneNumber},this.pathRoot=t,this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.phoneNumber=e.phone_number,this.reservedForSecondFactor=e.reserved_for_second_factor,this.defaultSecondFactor=e.default_second_factor,this.verification=new S(e.verification),this.linkedTo=(e.linked_to||[]).map((e=>new U(e))),this.backupCodes=e.backup_codes,this):this}}function I(e){const{pageSize:t,initialPage:n,...r}=e||{},i=null!=t?t:10,s=null!=n?n:1,a={...(0,_.Ir)(r),limit:i+"",offset:(s-1)*i+""};return new URLSearchParams(a)}class R extends s{constructor(e){super(),this.prepareAffiliationVerification=async e=>this._basePost({path:`/organizations/${this.organizationId}/domains/${this.id}/prepare_affiliation_verification`,method:"POST",body:e}),this.attemptAffiliationVerification=async e=>this._basePost({path:`/organizations/${this.organizationId}/domains/${this.id}/attempt_affiliation_verification`,method:"POST",body:e}),this.updateEnrollmentMode=e=>this._basePost({path:`/organizations/${this.organizationId}/domains/${this.id}/update_enrollment_mode`,body:e}),this.delete=()=>this._baseDelete({path:`/organizations/${this.organizationId}/domains/${this.id}`}),this.fromJSON(e)}static async create(e,{name:t}){var n;const r=null===(n=await s._fetch({path:`/organizations/${e}/domains`,method:"POST",body:{name:t}}))||void 0===n?void 0:n.response;return new R(r)}fromJSON(e){return e&&(this.id=e.id,this.name=e.name,this.organizationId=e.organization_id,this.enrollmentMode=e.enrollment_mode,this.affiliationEmailAddress=e.affiliation_email_address,this.totalPendingSuggestions=e.total_pending_suggestions,this.totalPendingInvitations=e.total_pending_invitations,e.verification?this.verification={status:e.verification.status,strategy:e.verification.strategy,attempts:e.verification.attempts,expiresAt:c(e.verification.expires_at)}:this.verification=null),this}}class x extends s{constructor(e){super(),this.accept=async()=>await this._basePost({path:`/organizations/${this.organizationId}/membership_requests/${this.id}/accept`}),this.reject=async()=>await this._basePost({path:`/organizations/${this.organizationId}/membership_requests/${this.id}/reject`}),this.fromJSON(e)}fromJSON(e){return e&&(this.id=e.id,this.organizationId=e.organization_id,this.status=e.status,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at),e.public_user_data&&(this.publicUserData=new ee(e.public_user_data))),this}}class T extends s{constructor(e){super(),this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.key=e.key,this.name=e.name,this.description=e.description,this.type=e.type,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at),this):this}}class M extends s{constructor(e){super(),this.permissions=[],this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.key=e.key,this.name=e.name,this.description=e.description,this.permissions=e.permissions.map((e=>new T(e))),this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at),this):this}}class z extends s{constructor(e){super(),this.pathRoot="/organizations",this.publicMetadata={},this.membersCount=0,this.pendingInvitationsCount=0,this.update=async e=>this._basePatch({body:e}),this.getRoles=async e=>await s._fetch({path:`/organizations/${this.id}/roles`,method:"GET",search:I(e)},{forceUpdateClient:!0}).then((e=>{const{data:t,total_count:n}=null==e?void 0:e.response;return{total_count:n,data:t.map((e=>new M(e)))}})),this.getDomains=async e=>await s._fetch({path:`/organizations/${this.id}/domains`,method:"GET",search:I(e)},{forceUpdateClient:!0}).then((e=>{const{data:t,total_count:n}=null==e?void 0:e.response;return{total_count:n,data:t.map((e=>new R(e)))}})),this.getDomain=async({domainId:e})=>{var t;const n=null===(t=await s._fetch({path:`/organizations/${this.id}/domains/${e}`,method:"GET"}))||void 0===t?void 0:t.response;return new R(n)},this.getMembershipRequests=async e=>await s._fetch({path:`/organizations/${this.id}/membership_requests`,method:"GET",search:I(e)}).then((e=>{const{data:t,total_count:n}=null==e?void 0:e.response;return{total_count:n,data:t.map((e=>new x(e)))}})),this.createDomain=async e=>R.create(this.id,{name:e}),this.getMemberships=async e=>await s._fetch({path:`/organizations/${this.id}/memberships`,method:"GET",search:I({...e,paginated:!0})}).then((e=>{const{data:t,total_count:n}=null==e?void 0:e.response;return{total_count:n,data:t.map((e=>new $(e)))}})),this.getInvitations=async e=>await s._fetch({path:`/organizations/${this.id}/invitations`,method:"GET",search:I(e)},{forceUpdateClient:!0}).then((e=>{const{data:t,total_count:n}=null==e?void 0:e.response;return{total_count:n,data:t.map((e=>new N(e)))}})),this.addMember=async({userId:e,role:t})=>await s._fetch({method:"POST",path:`/organizations/${this.id}/memberships`,body:{userId:e,role:t}}).then((e=>new $(null==e?void 0:e.response))),this.inviteMember=async e=>N.create(this.id,e),this.inviteMembers=async e=>N.createBulk(this.id,e),this.updateMember=async({userId:e,role:t})=>await s._fetch({method:"PATCH",path:`/organizations/${this.id}/memberships/${e}`,body:{role:t}}).then((e=>new $(null==e?void 0:e.response))),this.removeMember=async e=>await s._fetch({method:"DELETE",path:`/organizations/${this.id}/memberships/${e}`}).then((e=>new $(null==e?void 0:e.response))),this.destroy=async()=>this._baseDelete(),this.setLogo=async({file:e})=>{if(null===e)return await s._fetch({path:`/organizations/${this.id}/logo`,method:"DELETE"}).then((e=>new z(null==e?void 0:e.response)));let t,n;return"string"==typeof e?(t=e,n=new Headers({"Content-Type":"application/octet-stream"})):(t=new FormData,t.append("file",e)),await s._fetch({path:`/organizations/${this.id}/logo`,method:"PUT",body:t,headers:n}).then((e=>new z(null==e?void 0:e.response)))},this.fromJSON(e)}static async create(e){var t;const n=null===(t=await s._fetch({path:"/organizations",method:"POST",body:e}))||void 0===t?void 0:t.response;return new z(n)}static async get(e){var t;const n=null===(t=await s._fetch({path:`/organizations/${e}`,method:"GET"}))||void 0===t?void 0:t.response;return new z(n)}fromJSON(e){return e?(this.id=e.id,this.name=e.name,this.slug=e.slug,this.imageUrl=e.image_url,this.hasImage=e.has_image,this.publicMetadata=e.public_metadata,this.membersCount=e.members_count,this.pendingInvitationsCount=e.pending_invitations_count,this.maxAllowedMemberships=e.max_allowed_memberships,this.adminDeleteEnabled=e.admin_delete_enabled,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at),this):this}async reload(e){var t;const{rotatingTokenNonce:n}=e||{},r=null===(t=await s._fetch({path:`/organizations/${this.id}`,method:"GET",rotatingTokenNonce:n},{forceUpdateClient:!0}))||void 0===t?void 0:t.response;return this.fromJSON(r)}}class N extends s{static async create(e,{emailAddress:t,role:n}){var r;const i=null===(r=await s._fetch({path:`/organizations/${e}/invitations`,method:"POST",body:{email_address:t,role:n}}))||void 0===r?void 0:r.response;return new N(i)}static async createBulk(e,t){var n;const{emailAddresses:r,role:i}=t;return(null===(n=await s._fetch({path:`/organizations/${e}/invitations/bulk`,method:"POST",body:{email_address:r,role:i}}))||void 0===n?void 0:n.response).map((e=>new N(e)))}constructor(e){super(),this.publicMetadata={},this.revoke=async()=>await this._basePost({path:`/organizations/${this.organizationId}/invitations/${this.id}/revoke`}),this.fromJSON(e)}fromJSON(e){return e&&(this.id=e.id,this.emailAddress=e.email_address,this.organizationId=e.organization_id,this.publicMetadata=e.public_metadata,this.role=e.role,this.status=e.status,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at)),this}}class $ extends s{constructor(e){super(),this.publicMetadata={},this.permissions=[],this.destroy=async()=>await this._baseDelete({path:`/organizations/${this.organization.id}/memberships/${this.publicUserData.userId}`}),this.update=async({role:e})=>await this._basePatch({path:`/organizations/${this.organization.id}/memberships/${this.publicUserData.userId}`,body:{role:e}}),this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.organization=new z(e.organization),this.publicMetadata=e.public_metadata,e.public_user_data&&(this.publicUserData=new ee(e.public_user_data)),this.permissions=Array.isArray(e.permissions)?[...e.permissions]:[],this.role=e.role,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at),this):this}reload(e){(0,i.lU)("OrganizationMembership")}}y=$,$.retrieve=async e=>await s._fetch({path:"/me/organization_memberships",method:"GET",search:I({...e,paginated:!0})}).then((e=>{const{data:t,total_count:n}=null==e?void 0:e.response;return{total_count:n,data:t.map((e=>new y(e)))}}));class L extends s{constructor(e){super(),this.accept=async()=>await this._basePost({path:`/me/organization_suggestions/${this.id}/accept`}),this.fromJSON(e)}static async retrieve(e){return await s._fetch({path:"/me/organization_suggestions",method:"GET",search:I(e)}).then((e=>{const{data:t,total_count:n}=null==e?void 0:e.response;return{total_count:n,data:t.map((e=>new L(e)))}}))}fromJSON(e){return e&&(this.id=e.id,this.status=e.status,this.publicOrganizationData={hasImage:e.public_organization_data.has_image,imageUrl:e.public_organization_data.image_url,name:e.public_organization_data.name,id:e.public_organization_data.id,slug:e.public_organization_data.slug},this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at)),this}}class F extends s{constructor(e,t){super(),this.provider="saml_custom",this.providerUserId=null,this.active=!1,this.emailAddress="",this.firstName="",this.lastName="",this.verification=null,this.samlConnection=null,this.pathRoot=t,this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.provider=e.provider,this.providerUserId=e.provider_user_id,this.active=e.active,this.emailAddress=e.email_address,this.firstName=e.first_name,this.lastName=e.last_name,e.verification&&(this.verification=new S(e.verification)),e.saml_connection&&(this.samlConnection=new W(e.saml_connection)),this):this}}class W extends s{constructor(e){super(),this.fromJSON(e)}fromJSON(e){return e&&(this.id=e.id,this.name=e.name,this.domain=e.domain,this.active=e.active,this.provider=e.provider,this.syncUserAttributes=e.sync_user_attributes,this.allowSubdomains=e.allow_subdomains,this.allowIdpInitiated=e.allow_idp_initiated,this.disableAdditionalIdentifications=e.disable_additional_identifications,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at)),this}}n(3781);var D={veryStrict:{afterMinutes:10,level:"multiFactor"},strict:{afterMinutes:10,level:"secondFactor"},moderate:{afterMinutes:60,level:"secondFactor"},lax:{afterMinutes:1440,level:"secondFactor"}},j=new Set(["firstFactor","secondFactor","multiFactor"]),V=new Set(["veryStrict","strict","moderate","lax"]),K=e=>t=>{if(!e.userId)return!1;const n=((e,t)=>{const{orgId:n,orgRole:r,orgPermissions:i}=t;return(e.role||e.permission)&&n&&r&&i?e.permission?i.includes(e.permission):e.role?r===e.role:null:null})(t,e),r=((e,{__experimental_factorVerificationAge:t})=>{if(!e.__experimental_reverification||!t)return null;const n=(e=>{return("string"==typeof e&&(t=e,V.has(t))||!!("object"==typeof e&&(r=e.level,j.has(r))&&(n=e.afterMinutes,"number"==typeof n&&n>0)))&&(e=>"string"==typeof e?D[e]:e).bind(null,e);var t,n,r})(e.__experimental_reverification);if(!n)return null;const{level:r,afterMinutes:i}=n(),[s,a]=t,o=-1!==s?i>s:null,c=-1!==a?i>a:null;switch(r){case"firstFactor":return o;case"secondFactor":return-1!==a?c:o;case"multiFactor":return-1===a?o:o&&c}})(t,e);return[n,r].some((e=>null===e))?[n,r].some((e=>!0===e)):[n,r].every((e=>!0===e))},J=n(2692);class q extends s{constructor(e=null){super(),this.supportedFirstFactors=[],this.supportedSecondFactors=[],this.firstFactorVerification=new S(null),this.secondFactorVerification=new S(null),this.fromJSON(e)}fromJSON(e){return e&&(this.id=e.id,this.status=e.status,this.session=new Z(e.session),this.level=e.level,this.supportedFirstFactors=(0,_.Sd)(e.supported_first_factors),this.supportedSecondFactors=(0,_.Sd)(e.supported_second_factors),this.firstFactorVerification=new S(e.first_factor_verification),this.secondFactorVerification=new S(e.second_factor_verification)),this}}var B,Y,G,H=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class Z extends s{static isSessionResource(e){return!!e&&e instanceof Z}constructor(e){super(),B.add(this),this.pathRoot="/client/sessions",this.__experimental_factorVerificationAge=null,this.end=()=>(u.clear(),this._basePost({action:"end"})),this.remove=()=>(u.clear(),this._basePost({action:"remove"})),this.touch=()=>this._basePost({action:"touch",body:{active_organization_id:this.lastActiveOrganizationId}}),this.clearCache=()=>u.clear(),this.getToken=async e=>(0,_.Nv)((()=>this._getToken(e)),{shouldRetry:(e,t)=>!(0,w.nc)(e)&&t<4}),this.checkAuthorization=e=>{var t,n;const r=((null===(t=this.user)||void 0===t?void 0:t.organizationMemberships)||[]).find((e=>e.organization.id===this.lastActiveOrganizationId));return K({userId:null===(n=this.user)||void 0===n?void 0:n.id,__experimental_factorVerificationAge:this.__experimental_factorVerificationAge,orgId:null==r?void 0:r.id,orgRole:null==r?void 0:r.role,orgPermissions:null==r?void 0:r.permissions})(e)},Y.set(this,(e=>{e&&(u.set({tokenId:H(this,B,"m",G).call(this),tokenResolver:Promise.resolve(e)}),J.B.dispatch(J.A.TokenUpdate,{token:e}))})),this.__experimental_startVerification=async({level:e})=>{var t;const n=null===(t=await s._fetch({method:"POST",path:`/client/sessions/${this.id}/verify`,body:{level:e}}))||void 0===t?void 0:t.response;return new q(n)},this.__experimental_prepareFirstFactorVerification=async e=>{var t;let n;switch(e.strategy){case"email_code":n={emailAddressId:e.emailAddressId};break;case"phone_code":n={phoneNumberId:e.phoneNumberId,default:e.default};break;default:(0,i.Gm)("Session.prepareFirstFactorVerification",e.strategy)}const r=null===(t=await s._fetch({method:"POST",path:`/client/sessions/${this.id}/verify/prepare_first_factor`,body:{...n,strategy:e.strategy}}))||void 0===t?void 0:t.response;return new q(r)},this.__experimental_attemptFirstFactorVerification=async e=>{var t;const n=null===(t=await s._fetch({method:"POST",path:`/client/sessions/${this.id}/verify/attempt_first_factor`,body:{...e,strategy:e.strategy}}))||void 0===t?void 0:t.response;return new q(n)},this.__experimental_prepareSecondFactorVerification=async e=>{var t;const n=null===(t=await s._fetch({method:"POST",path:`/client/sessions/${this.id}/verify/prepare_second_factor`,body:e}))||void 0===t?void 0:t.response;return new q(n)},this.__experimental_attemptSecondFactorVerification=async e=>{var t;const n=null===(t=await s._fetch({method:"POST",path:`/client/sessions/${this.id}/verify/attempt_second_factor`,body:e}))||void 0===t?void 0:t.response;return new q(n)},this.fromJSON(e),H(this,Y,"f").call(this,this.lastActiveToken)}fromJSON(e){return e?(this.id=e.id,this.status=e.status,this.expireAt=c(e.expire_at),this.abandonAt=c(e.abandon_at),this.__experimental_factorVerificationAge=e.factor_verification_age,this.lastActiveAt=c(e.last_active_at),this.lastActiveOrganizationId=e.last_active_organization_id,this.actor=e.actor,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at),this.user=new fe(e.user),e.public_user_data&&(this.publicUserData=new ee(e.public_user_data)),this.lastActiveToken=e.last_active_token?new le(e.last_active_token):null,this):this}async _getToken(e){if(!this.user)return null;const{leewayInSeconds:t,template:n,skipCache:r=!1}=e||{},i=void 0===(null==e?void 0:e.organizationId)?this.lastActiveOrganizationId:null==e?void 0:e.organizationId;if(!n&&Number(t)>=60)throw new Error("Leeway can not exceed the token lifespan (60 seconds)");const s=H(this,B,"m",G).call(this,n,i),a=r?void 0:u.get({tokenId:s},t),o=!n&&i===this.lastActiveOrganizationId;if(a){const e=await a.tokenResolver;return o&&J.B.dispatch(J.A.TokenUpdate,{token:e}),e.getRawString()||null}const c=n?`${this.path()}/tokens/${n}`:`${this.path()}/tokens`,l=n?{}:{organizationId:i},d=le.create(c,l);return u.set({tokenId:s,tokenResolver:d}),d.then((e=>(o&&J.B.dispatch(J.A.TokenUpdate,{token:e}),e.getRawString()||null)))}}Y=new WeakMap,B=new WeakSet,G=function(e,t){const n=void 0===t?this.lastActiveOrganizationId:t;return[this.id,e,n,this.updatedAt.getTime()].filter(Boolean).join("-")};var Q=n(2201);class X extends s{constructor(e){super(),this.pathRoot="/me/passkeys",this.verification=null,this.name=null,this.lastUsedAt=null,this.update=e=>this._basePatch({body:e}),this.delete=async()=>{var e;const t=null===(e=await s._fetch({path:this.path(),method:"DELETE"}))||void 0===e?void 0:e.response;return new h(t)},this.fromJSON(e)}static async create(){return s._fetch({path:"/me/passkeys",method:"POST"}).then((e=>new X(null==e?void 0:e.response)))}static async attemptVerification(e,t){const n=(0,b.oe)(t);return s._fetch({path:`/me/passkeys/${e}/attempt_verification`,method:"POST",body:{strategy:"passkey",publicKeyCredential:JSON.stringify(n)}}).then((e=>new X(null==e?void 0:e.response)))}static async registerPasskey(){var e;if(!(0,Q.Bz)())throw new b.EC("Passkeys are not supported on this device.",{code:"passkey_not_supported"});const t=await this.create(),{verification:n}=t,r=null==n?void 0:n.publicKey;if(r||(0,i.qd)("create"),"platform"===(null===(e=r.authenticatorSelection)||void 0===e?void 0:e.authenticatorAttachment)&&!await(0,Q.BT)())throw new b.EC("Registration requires a platform authenticator but the device does not support it.",{code:"passkey_pa_not_supported"});const{publicKeyCredential:s,error:a}=await(0,b.Gp)(r);if(!s)throw a;return this.attemptVerification(t.id,s)}fromJSON(e){return e?(this.id=e.id,this.name=e.name,this.lastUsedAt=e.last_used_at?c(e.last_used_at):null,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at),e.verification&&(this.verification=new k(e.verification)),this):this}}class ee{constructor(e){this.fromJSON(e)}fromJSON(e){return e&&(this.firstName=e.first_name,this.lastName=e.last_name,this.imageUrl=e.image_url,this.hasImage=e.has_image,this.identifier=e.identifier,this.userId=e.user_id),this}}class te extends s{constructor(e,t){super(),this.pathRoot="",this.pathRoot=t,this.fromJSON(e)}static retrieve(){var e;const t=null===(e=s.clerk.session)||void 0===e?void 0:e.id;return this.clerk.getFapiClient().request({method:"GET",path:"/me/sessions/active",sessionId:t}).then((e=>e.payload.map((e=>new te(e,"/me/sessions"))))).catch((()=>[]))}revoke(){return this._basePost({action:"revoke",body:{}})}fromJSON(e){var t;return e?(this.id=e.id,this.status=e.status,this.expireAt=c(e.expire_at),this.abandonAt=c(e.abandon_at),this.lastActiveAt=c(e.last_active_at),this.latestActivity=(e=>({id:e.id,deviceType:e.device_type,browserName:e.browser_name,browserVersion:e.browser_version,country:e.country,city:e.city,isMobile:e.is_mobile,ipAddress:e.ip_address}))(null!==(t=e.latest_activity)&&void 0!==t?t:{}),this.actor=e.actor,this):this}}var ne=n(4870),re=n(9961);class ie extends s{constructor(e=null){super(),this.pathRoot="/client/sign_ins",this.status=null,this.supportedIdentifiers=[],this.supportedFirstFactors=[],this.supportedSecondFactors=null,this.firstFactorVerification=new S(null),this.secondFactorVerification=new S(null),this.identifier=null,this.createdSessionId=null,this.userData=new se(null),this.create=e=>this._basePost({path:this.pathRoot,body:e}),this.resetPassword=e=>this._basePost({body:e,action:"reset_password"}),this.prepareFirstFactor=e=>{let t;switch(e.strategy){case"passkey":t={};break;case"email_link":t={emailAddressId:e.emailAddressId,redirectUrl:e.redirectUrl};break;case"email_code":case"reset_password_email_code":t={emailAddressId:e.emailAddressId};break;case"phone_code":t={phoneNumberId:e.phoneNumberId,default:e.default};break;case"web3_metamask_signature":case"web3_coinbase_wallet_signature":t={web3WalletId:e.web3WalletId};break;case"reset_password_phone_code":t={phoneNumberId:e.phoneNumberId};break;case"saml":t={redirectUrl:e.redirectUrl,actionCompleteRedirectUrl:e.actionCompleteRedirectUrl};break;default:(0,i.Gm)("SignIn.prepareFirstFactor",e.strategy)}return this._basePost({body:{...t,strategy:e.strategy},action:"prepare_first_factor"})},this.attemptFirstFactor=e=>{let t;return t="passkey"===e.strategy?{publicKeyCredential:JSON.stringify((0,b.cC)(e.publicKeyCredential))}:{...e},this._basePost({body:{...t,strategy:e.strategy},action:"attempt_first_factor"})},this.createEmailLinkFlow=()=>{const{run:e,stop:t}=(0,_.vu)();return{startEmailLinkFlow:async({emailAddressId:n,redirectUrl:r})=>(this.id||(0,i.HZ)("SignIn"),await this.prepareFirstFactor({strategy:"email_link",emailAddressId:n,redirectUrl:r}),new Promise(((n,r)=>{e((()=>this.reload().then((e=>{const r=e.firstFactorVerification.status;"verified"!==r&&"expired"!==r||(t(),n(e))})).catch((e=>{t(),r(e)}))))}))),cancelEmailLinkFlow:t}},this.prepareSecondFactor=e=>this._basePost({body:e,action:"prepare_second_factor"}),this.attemptSecondFactor=e=>this._basePost({body:e,action:"attempt_second_factor"}),this.authenticateWithRedirect=async e=>{const{strategy:t,redirectUrl:n,redirectUrlComplete:r,identifier:s}=e||{},{firstFactorVerification:a}="saml"===t&&this.id?await this.prepareFirstFactor({strategy:t,redirectUrl:ie.clerk.buildUrlWithAuth(n),actionCompleteRedirectUrl:r}):await this.create({strategy:t,identifier:s,redirectUrl:ie.clerk.buildUrlWithAuth(n),actionCompleteRedirectUrl:r}),{status:o,externalVerificationRedirectURL:c}=a;"unverified"===o&&c?(0,ne.y7)(c):(0,i.wv)(o,ie.fapiClient.buildEmailAddress("support"))},this.authenticateWithWeb3=async e=>{var t;const{identifier:n,generateSignature:r,strategy:s="web3_metamask_signature"}=e||{},a=s.replace("web3_","").replace("_signature","");"function"!=typeof r&&(0,i.pV)("generateSignature"),await this.create({identifier:n});const o=null===(t=this.supportedFirstFactors)||void 0===t?void 0:t.find((e=>e.strategy===s));o||(0,i.Rj)("SignIn"),await this.prepareFirstFactor(o);const{message:c}=this.firstFactorVerification;let l;c||(0,i.Rj)("SignIn");try{l=await r({identifier:n,nonce:c,provider:a})}catch(u){if("coinbase_wallet"!==a||4001!==u.code)throw u;l=await r({identifier:n,nonce:c,provider:a})}return this.attemptFirstFactor({signature:l,strategy:s})},this.authenticateWithMetamask=async()=>{const e=await(0,ne.$1)();return this.authenticateWithWeb3({identifier:e,generateSignature:ne.l,strategy:"web3_metamask_signature"})},this.authenticateWithCoinbaseWallet=async()=>{const e=await(0,ne.Xt)();return this.authenticateWithWeb3({identifier:e,generateSignature:ne.h8,strategy:"web3_coinbase_wallet_signature"})},this.authenticateWithPasskey=async e=>{const{flow:t}=e||{};if(!(0,Q.Bz)())throw new b.EC("Passkeys are not supported",{code:"passkey_not_supported"});if("autofill"===t||"discoverable"===t)await this.create({strategy:"passkey"});else{const e=this.supportedFirstFactors.find((e=>"passkey"===e.strategy));e||(0,i.Tw)(),await this.prepareFirstFactor(e)}const{nonce:n}=this.firstFactorVerification,r=n?(0,b.sX)(JSON.parse(n)):null;r||(0,i.qd)("get");let s=!1;"autofill"===t&&(s=await(0,Q.nn)());const{publicKeyCredential:a,error:o}=await(0,b.c7)({publicKeyOptions:r,conditionalUI:s});if(!a)throw o;return this.attemptFirstFactor({publicKeyCredential:a,strategy:"passkey"})},this.validatePassword=(e,t)=>{var n,r;if(null===(n=ie.clerk.__unstable__environment)||void 0===n?void 0:n.userSettings.passwordSettings)return(0,re.G)({...null===(r=ie.clerk.__unstable__environment)||void 0===r?void 0:r.userSettings.passwordSettings,validatePassword:!0})(e,t)},this.fromJSON(e)}fromJSON(e){return e&&(this.id=e.id,this.status=e.status,this.supportedIdentifiers=e.supported_identifiers,this.identifier=e.identifier,this.supportedFirstFactors=(0,_.Sd)(e.supported_first_factors),this.supportedSecondFactors=(0,_.Sd)(e.supported_second_factors),this.firstFactorVerification=new S(e.first_factor_verification),this.secondFactorVerification=new S(e.second_factor_verification),this.createdSessionId=e.created_session_id,this.userData=new se(e.user_data)),this}}class se{constructor(e){this.fromJSON(e)}fromJSON(e){return e&&(this.firstName=e.first_name,this.lastName=e.last_name,this.imageUrl=e.image_url,this.hasImage=e.has_image),this}}var ae=n(9210);function oe(e){const{unsafeMetadata:t}={...e},n=t?"object"==typeof t?JSON.stringify(t):t:"";return{...e,...t?{unsafeMetadata:n}:{}}}class ce extends s{constructor(e=null){super(),this.pathRoot="/client/sign_ups",this.status=null,this.requiredFields=[],this.optionalFields=[],this.missingFields=[],this.unverifiedFields=[],this.verifications=new P(null),this.username=null,this.firstName=null,this.lastName=null,this.emailAddress=null,this.phoneNumber=null,this.web3wallet=null,this.hasPassword=!1,this.unsafeMetadata={},this.createdSessionId=null,this.createdUserId=null,this.abandonAt=null,this.legalAcceptedAt=null,this.create=async e=>{var t;const n=e,{captchaSiteKey:r,canUseCaptcha:i,captchaURL:s,captchaWidgetType:a,captchaProvider:o,captchaPublicKeyInvisible:c}=(0,ae.NQ)(ce.clerk);if(!this.shouldBypassCaptchaForAttempt(e)&&i&&r&&s&&c)try{const{captchaToken:e,captchaWidgetTypeUsed:t}=await(0,ae.yi)({siteKey:r,widgetType:a,invisibleSiteKey:c,scriptUrl:s,captchaProvider:o});n.captchaToken=e,n.captchaWidgetType=t}catch(l){if(!l.captchaError)throw new w.cR(l.message,{code:"captcha_unavailable"});n.captchaError=l.captchaError}return e.transfer&&this.shouldBypassCaptchaForAttempt(e)&&(n.strategy=null===(t=ce.clerk.client)||void 0===t?void 0:t.signIn.firstFactorVerification.strategy),void 0!==e.__experimental_legalAccepted&&(n.legalAccepted=e.__experimental_legalAccepted,n.__experimental_legalAccepted=void 0),this._basePost({path:this.pathRoot,body:oe(n)})},this.prepareVerification=e=>this._basePost({body:e,action:"prepare_verification"}),this.attemptVerification=e=>this._basePost({body:e,action:"attempt_verification"}),this.prepareEmailAddressVerification=e=>this.prepareVerification(e||{strategy:"email_code"}),this.attemptEmailAddressVerification=e=>this.attemptVerification({...e,strategy:"email_code"}),this.createEmailLinkFlow=()=>{const{run:e,stop:t}=(0,_.vu)();return{startEmailLinkFlow:async({redirectUrl:n})=>(this.id||(0,i.HZ)("SignUp"),await this.prepareEmailAddressVerification({strategy:"email_link",redirectUrl:n}),new Promise(((n,r)=>{e((()=>this.reload().then((e=>{const r=e.verifications.emailAddress.status;"verified"!==r&&"expired"!==r||(t(),n(e))})).catch((e=>{t(),r(e)}))))}))),cancelEmailLinkFlow:t}},this.preparePhoneNumberVerification=e=>this.prepareVerification(e||{strategy:"phone_code"}),this.attemptPhoneNumberVerification=e=>this.attemptVerification({...e,strategy:"phone_code"}),this.prepareWeb3WalletVerification=e=>this.prepareVerification({strategy:"web3_metamask_signature",...e}),this.attemptWeb3WalletVerification=async e=>{const{signature:t,strategy:n="web3_metamask_signature"}=e;return this.attemptVerification({signature:t,strategy:n})},this.authenticateWithWeb3=async e=>{const{generateSignature:t,identifier:n,unsafeMetadata:r,strategy:s="web3_metamask_signature",__experimental_legalAccepted:a}=e||{},o=s.replace("web3_","").replace("_signature","");"function"!=typeof t&&(0,i.pV)("generateSignature");const c=n||this.web3wallet;await this.create({web3Wallet:c,unsafeMetadata:r,__experimental_legalAccepted:a}),await this.prepareWeb3WalletVerification({strategy:s});const{message:l}=this.verifications.web3Wallet;let u;l||(0,i.Rj)("SignUp");try{u=await t({identifier:n,nonce:l,provider:o})}catch(d){if("coinbase_wallet"!==o||4001!==d.code)throw d;u=await t({identifier:n,nonce:l,provider:o})}return this.attemptWeb3WalletVerification({signature:u,strategy:s})},this.authenticateWithMetamask=async e=>{const t=await(0,ne.$1)();return this.authenticateWithWeb3({identifier:t,generateSignature:ne.l,unsafeMetadata:null==e?void 0:e.unsafeMetadata,strategy:"web3_metamask_signature",__experimental_legalAccepted:null==e?void 0:e.__experimental_legalAccepted})},this.authenticateWithCoinbaseWallet=async e=>{const t=await(0,ne.Xt)();return this.authenticateWithWeb3({identifier:t,generateSignature:ne.h8,unsafeMetadata:null==e?void 0:e.unsafeMetadata,strategy:"web3_coinbase_wallet_signature",__experimental_legalAccepted:null==e?void 0:e.__experimental_legalAccepted})},this.authenticateWithRedirect=async({redirectUrl:e,redirectUrlComplete:t,strategy:n,continueSignUp:r=!1,unsafeMetadata:s,emailAddress:a,__experimental_legalAccepted:o})=>{const c=()=>{const i={strategy:n,redirectUrl:ce.clerk.buildUrlWithAuth(e),actionCompleteRedirectUrl:t,unsafeMetadata:s,emailAddress:a,__experimental_legalAccepted:o};return r&&this.id?this.update(i):this.create(i)},{verifications:l}=await c().catch((async e=>{if((0,w.$R)(e)&&(0,w.rZ)(e))return await ce.clerk.__unstable__environment.reload(),c();throw e})),{externalAccount:u}=l,{status:d,externalVerificationRedirectURL:h}=u;"unverified"===d&&h?(0,ne.y7)(h):(0,i.wv)(d,ce.fapiClient.buildEmailAddress("support"))},this.update=e=>(void 0!==e.__experimental_legalAccepted&&(e.legalAccepted=e.__experimental_legalAccepted,e.__experimental_legalAccepted=void 0),this._basePatch({body:oe(e)})),this.validatePassword=(e,t)=>{var n,r;if(null===(n=ce.clerk.__unstable__environment)||void 0===n?void 0:n.userSettings.passwordSettings)return(0,re.G)({...null===(r=ce.clerk.__unstable__environment)||void 0===r?void 0:r.userSettings.passwordSettings,validatePassword:!0})(e,t)},this.fromJSON(e)}fromJSON(e){return e&&(this.id=e.id,this.status=e.status,this.requiredFields=e.required_fields,this.optionalFields=e.optional_fields,this.missingFields=e.missing_fields,this.unverifiedFields=e.unverified_fields,this.verifications=new P(e.verifications),this.username=e.username,this.firstName=e.first_name,this.lastName=e.last_name,this.emailAddress=e.email_address,this.phoneNumber=e.phone_number,this.hasPassword=e.has_password,this.unsafeMetadata=e.unsafe_metadata,this.createdSessionId=e.created_session_id,this.createdUserId=e.created_user_id,this.abandonAt=e.abandon_at,this.web3wallet=e.web3_wallet,this.legalAcceptedAt=e.legal_accepted_at),this}shouldBypassCaptchaForAttempt(e){if(!e.strategy)return!1;const t=ce.clerk.__unstable__environment.displayConfig.captchaOauthBypass;return!!t.some((t=>t===e.strategy))||!(!e.transfer||!t.some((e=>e===ce.clerk.client.signIn.firstFactorVerification.strategy)))}}class le extends s{static async create(e,t={}){const n=await s._fetch({path:e,method:"POST",body:t});return new le(n,e)}constructor(e,t){super(),this.pathRoot="tokens",this.getRawString=()=>{var e;return(null===(e=this.jwt)||void 0===e?void 0:e.claims.__raw)||""},t&&(this.pathRoot=t),(null==e?void 0:e.jwt)&&(this.jwt=(0,ne.D4)(e.jwt))}fromJSON(e){return e?(this.jwt=(0,ne.D4)(e.jwt),this):this}}class ue extends s{constructor(e){super(),this.pathRoot="/me",this.id="",this.verified=!1,this.updatedAt=null,this.createdAt=null,this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.secret=e.secret,this.uri=e.uri,this.verified=e.verified,this.backupCodes=e.backup_codes,this.updatedAt=c(e.updated_at),this.createdAt=c(e.created_at),this):this}}var de=n(8740);class he extends s{constructor(e){super(),this.pathRoot="/me",this.codes=[],this.updatedAt=null,this.createdAt=null,this.fromJSON(e)}fromJSON(e){return e?(this.id=e.id,this.codes=e.codes,this.updatedAt=c(e.updated_at),this.createdAt=c(e.created_at),this):this}}class fe extends s{static isUserResource(e){return!!e&&e instanceof fe}constructor(e){super(),this.pathRoot="/me",this.id="",this.externalId=null,this.username=null,this.emailAddresses=[],this.phoneNumbers=[],this.web3Wallets=[],this.externalAccounts=[],this.passkeys=[],this.samlAccounts=[],this.organizationMemberships=[],this.passwordEnabled=!1,this.firstName=null,this.lastName=null,this.fullName=null,this.primaryEmailAddressId=null,this.primaryEmailAddress=null,this.primaryPhoneNumberId=null,this.primaryPhoneNumber=null,this.primaryWeb3WalletId=null,this.primaryWeb3Wallet=null,this.imageUrl="",this.hasImage=!1,this.twoFactorEnabled=!1,this.totpEnabled=!1,this.backupCodeEnabled=!1,this.publicMetadata={},this.unsafeMetadata={},this.createOrganizationEnabled=!1,this.createOrganizationsLimit=null,this.deleteSelfEnabled=!1,this.lastSignInAt=null,this.legalAcceptedAt=null,this.updatedAt=null,this.createdAt=null,this.cachedSessionsWithActivities=null,this.isPrimaryIdentification=e=>{switch(e.constructor){case m:return this.primaryEmailAddressId===e.id;case E:return this.primaryPhoneNumberId===e.id;case me:return this.primaryWeb3WalletId===e.id;default:return!1}},this.createEmailAddress=e=>{const{email:t}=e||{};return new m({email_address:t},this.path()+"/email_addresses/").create()},this.createPasskey=()=>X.registerPasskey(),this.createPhoneNumber=e=>{const{phoneNumber:t}=e||{};return new E({phone_number:t},this.path()+"/phone_numbers/").create()},this.createWeb3Wallet=e=>{const{web3Wallet:t}=e||{};return new me({web3_wallet:t},this.path()+"/web3_wallets/").create()},this.createExternalAccount=async e=>{var t;const{strategy:n,redirectUrl:r,additionalScopes:i}=e||{},a=null===(t=await s._fetch({path:"/me/external_accounts",method:"POST",body:{strategy:n,redirect_url:r,additional_scope:i}}))||void 0===t?void 0:t.response;return new O(a,this.path()+"/external_accounts")},this.createTOTP=async()=>{var e;const t=null===(e=await s._fetch({path:"/me/totp",method:"POST"}))||void 0===e?void 0:e.response;return new ue(t)},this.verifyTOTP=async({code:e})=>{var t;const n=null===(t=await s._fetch({path:"/me/totp/attempt_verification",method:"POST",body:{code:e}}))||void 0===t?void 0:t.response;return new ue(n)},this.disableTOTP=async()=>{var e;const t=null===(e=await s._fetch({path:"/me/totp",method:"DELETE"}))||void 0===e?void 0:e.response;return new h(t)},this.createBackupCode=async()=>{var e;const t=null===(e=await s._fetch({path:this.path()+"/backup_codes/",method:"POST"}))||void 0===e?void 0:e.response;return new he(t)},this.update=e=>this._basePatch({body:oe(e)}),this.updatePassword=e=>this._basePost({body:e,path:`${this.path()}/change_password`}),this.removePassword=e=>this._basePost({body:e,path:`${this.path()}/remove_password`}),this.delete=()=>this._baseDelete({path:"/me"}),this.getSessions=async()=>{if(this.cachedSessionsWithActivities)return this.cachedSessionsWithActivities;const e=await te.retrieve();return this.cachedSessionsWithActivities=e,e},this.setProfileImage=e=>{const{file:t}=e||{};return null===t?A.delete(`${this.path()}/profile_image`):A.create(`${this.path()}/profile_image`,{file:t})},this.getOrganizationInvitations=e=>pe.retrieve(e),this.getOrganizationSuggestions=e=>L.retrieve(e),this.getOrganizationMemberships=e=>$.retrieve(e),this.leaveOrganization=async e=>{var t;const n=null===(t=await s._fetch({path:`${this.path()}/organization_memberships/${e}`,method:"DELETE"}))||void 0===t?void 0:t.response;return new h(n)},this.fromJSON(e)}path(){return this.pathRoot}get verifiedExternalAccounts(){return this.externalAccounts.filter((e=>{var t;return"verified"==(null===(t=e.verification)||void 0===t?void 0:t.status)}))}get unverifiedExternalAccounts(){return this.externalAccounts.filter((e=>{var t;return"verified"!=(null===(t=e.verification)||void 0===t?void 0:t.status)}))}get verifiedWeb3Wallets(){return this.web3Wallets.filter((e=>{var t;return"verified"==(null===(t=e.verification)||void 0===t?void 0:t.status)}))}get hasVerifiedEmailAddress(){return this.emailAddresses.filter((e=>"verified"===e.verification.status)).length>0}get hasVerifiedPhoneNumber(){return this.phoneNumbers.filter((e=>"verified"===e.verification.status)).length>0}fromJSON(e){return e?(this.id=e.id,this.externalId=e.external_id,this.firstName=e.first_name,this.lastName=e.last_name,(this.firstName||this.lastName)&&(this.fullName=(0,de.dS)({firstName:this.firstName,lastName:this.lastName})),this.imageUrl=e.image_url,this.hasImage=e.has_image,this.username=e.username,this.passwordEnabled=e.password_enabled,this.emailAddresses=(e.email_addresses||[]).map((e=>new m(e,this.path()+"/email_addresses"))),this.primaryEmailAddressId=e.primary_email_address_id,this.primaryEmailAddress=this.emailAddresses.find((({id:e})=>e===this.primaryEmailAddressId))||null,this.phoneNumbers=(e.phone_numbers||[]).map((e=>new E(e,this.path()+"/phone_numbers"))),this.primaryPhoneNumberId=e.primary_phone_number_id,this.primaryPhoneNumber=this.phoneNumbers.find((({id:e})=>e===this.primaryPhoneNumberId))||null,this.web3Wallets=(e.web3_wallets||[]).map((e=>new me(e,this.path()+"/web3_wallets"))),this.primaryWeb3WalletId=e.primary_web3_wallet_id,this.primaryWeb3Wallet=this.web3Wallets.find((({id:e})=>e===this.primaryWeb3WalletId))||null,this.externalAccounts=(e.external_accounts||[]).map((e=>new O(e,this.path()+"/external_accounts"))),this.passkeys=(e.passkeys||[]).map((e=>new X(e))),this.organizationMemberships=(e.organization_memberships||[]).map((e=>new $(e))),this.samlAccounts=(e.saml_accounts||[]).map((e=>new F(e,this.path()+"/saml_accounts"))),this.publicMetadata=e.public_metadata,this.unsafeMetadata=e.unsafe_metadata,this.totpEnabled=e.totp_enabled,this.backupCodeEnabled=e.backup_code_enabled,this.twoFactorEnabled=e.two_factor_enabled,this.createOrganizationEnabled=e.create_organization_enabled,this.createOrganizationsLimit=e.create_organizations_limit,this.deleteSelfEnabled=e.delete_self_enabled,e.last_sign_in_at&&(this.lastSignInAt=c(e.last_sign_in_at)),e.legal_accepted_at&&(this.legalAcceptedAt=c(e.legal_accepted_at)),this.updatedAt=c(e.updated_at),this.createdAt=c(e.created_at),this):this}}class pe extends s{static async retrieve(e){return await s._fetch({path:"/me/organization_invitations",method:"GET",search:I(e)}).then((e=>{const{data:t,total_count:n}=null==e?void 0:e.response;return{total_count:n,data:t.map((e=>new pe(e)))}}))}constructor(e){super(),this.publicMetadata={},this.accept=async()=>await this._basePost({path:`/me/organization_invitations/${this.id}/accept`}),this.fromJSON(e)}fromJSON(e){return e&&(this.id=e.id,this.emailAddress=e.email_address,this.publicOrganizationData={hasImage:e.public_organization_data.has_image,imageUrl:e.public_organization_data.image_url,name:e.public_organization_data.name,id:e.public_organization_data.id,slug:e.public_organization_data.slug},this.publicMetadata=e.public_metadata,this.role=e.role,this.status=e.status,this.createdAt=c(e.created_at),this.updatedAt=c(e.updated_at)),this}}class me extends s{constructor(e,t){super(),this.web3Wallet="",this.prepareVerification=e=>this._basePost({action:"prepare_verification",body:{...e}}),this.attemptVerification=e=>{const{signature:t}=e;return this._basePost({action:"attempt_verification",body:{signature:t}})},this.pathRoot=t,this.fromJSON(e)}create(){return this._basePost({body:{web3_wallet:this.web3Wallet}})}destroy(){return this._baseDelete()}toString(){return this.web3Wallet}fromJSON(e){return e?(this.id=e.id,this.web3Wallet=e.web3_wallet,this.verification=new S(e.verification),this):this}}},5864:function(e,t,n){"use strict";n.d(t,{A:function(){return i}});const r=e=>`🔒 Clerk:\n${e.trim()}\n(This notice only appears in development)`,i={cannotRenderComponentWhenSessionExists:"The <SignUp/> and <SignIn/> components cannot render when a user is already signed in, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, Clerk is redirecting to the Home URL instead.",cannotRenderSignUpComponentWhenSessionExists:"The <SignUp/> component cannot render when a user is already signed in, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, Clerk is redirecting to the value set in `afterSignUp` URL instead.",cannotRenderSignInComponentWhenSessionExists:"The <SignIn/> component cannot render when a user is already signed in, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, Clerk is redirecting to the `afterSignIn` URL instead.",cannotRenderComponentWhenUserDoesNotExist:"<UserProfile/> cannot render unless a user is signed in. Since no user is signed in, this is no-op.",cannotRenderComponentWhenOrgDoesNotExist:"<OrganizationProfile/> cannot render unless an organization is active. Since no organization is currently active, this is no-op.",cannotRenderAnyOrganizationComponent:e=>r(`The <${e}/> cannot be rendered when the feature is turned off. Visit 'dashboard.clerk.com' to enable the feature. Since the feature is turned off, this is no-op.`),cannotOpenUserProfile:"The UserProfile modal cannot render unless a user is signed in. Since no user is signed in, this is no-op.",cannotOpenSignInOrSignUp:"The SignIn or SignUp modals do not render when a user is already signed in, unless the application allows multiple sessions. Since a user is signed in and this application only allows a single session, this is no-op."};for(const s of Object.keys(i)){const e=i[s];"function"!=typeof e&&(i[s]=r(e))}},2797:function(e,t,n){"use strict";n.d(t,{x:function(){return a}});var r=n(4041),i=n(6480),s=n(4870);const a=()=>{const[e,t]=r.useState({startPath:"",path:"",componentName:"",socialProvider:""}),n=(0,s.FP)();r.useLayoutEffect((()=>{n&&t(n)}),[]);const a=()=>{t({startPath:"",path:"",componentName:"",socialProvider:""})};return{urlStateParam:{...e,clearUrlStateParam:a},decodedRedirectParams:n,clearUrlStateParam:a,removeQueryParam:()=>(0,s.rw)(i.CL)}}},5504:function(e,t,n){"use strict";n.d(t,{I:function(){return i},n:function(){return s}});var r=n(6915);function i(e){const t=["redirectUrl","afterSignInUrl","afterSignUpUrl","after_sign_in_url","after_sign_up_url"],n=Object.keys(e).find((e=>t.includes(e)));n&&e[n]&&r.v.warnOnce(`Clerk: The prop "${n}" is deprecated and should be replaced with the new "fallbackRedirectUrl" or "forceRedirectUrl" props instead. Learn more: https://clerk.com/docs/guides/custom-redirects#redirect-url-props`)}function s(e,t,n,i){t&&i&&r.v.warnOnce(`Clerk: The "${e}" prop ("${t}") has priority over the legacy "${n}" (or "redirectUrl") ("${i}"), which will be completely ignored in this case. "${n}" (or "redirectUrl" prop) should be replaced with the new "fallbackRedirectUrl" or "forceRedirectUrl" props instead. Learn more: https://clerk.com/docs/guides/custom-redirects#redirect-url-props`)}},9210:function(e,t,n){"use strict";n.d(t,{Wl:function(){return s},yi:function(){return l},NQ:function(){return i}});var r=n(600);const i=e=>{const t=e.__unstable__environment,n=(0,r.Y)(e),i=t?t.displayConfig.captchaProvider:"turnstile";return{captchaSiteKey:t?t.displayConfig.captchaPublicKey:null,captchaWidgetType:t?t.displayConfig.captchaWidgetType:null,captchaProvider:i,captchaPublicKeyInvisible:t?t.displayConfig.captchaPublicKeyInvisible:null,canUseCaptcha:t?t.userSettings.signUp.captcha_enabled&&e.isStandardBrowser&&"production"===e.instanceType:null,captchaURL:n.buildUrl({path:"hcaptcha"==i?"hcaptcha/1/api.js":"cloudflare/turnstile/v0/api.js",pathPrefix:"",search:"?render=explicit"}).toString()}},s="clerk-captcha",a="clerk-invisible-captcha";var o=n(4102);const c=async e=>{const{siteKey:t,scriptUrl:n,widgetType:r,invisibleSiteKey:i}=e;let c="",l="",u=!r||"invisible"===r,d=t,h=null;const f=()=>{const e=document.createElement("div");return e.classList.add(a),document.body.appendChild(e),e},p=await async function(e){return window.turnstile||await async function(){try{return await(0,o.k)("https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",{defer:!0})}catch(e){throw console.warn("Clerk: Failed to load the CAPTCHA script from Cloudflare. If you see a CSP error in your browser, please add the necessary CSP rules to your app. Visit https://clerk.com/docs/security/clerk-csp for more information."),e}}().catch((()=>async function(e){try{return await(0,o.k)(e,{defer:!0})}catch(t){throw console.error("Clerk: Failed to load the CAPTCHA script from the URL: ",e),t}}(e))).catch((()=>{throw{captchaError:"captcha_script_failed_to_load"}})),window.turnstile}(n);let m=0;const g=[];try{[c,l]=await new Promise(((e,t)=>{try{if(u)h=f();else{const e=document.getElementById(s);e?(e.style.display="block",h=e):(console.error("Cannot initialize Smart CAPTCHA widget because the `clerk-captcha` DOM element was not found; falling back to Invisible CAPTCHA widget. If you are using a custom flow, visit https://clerk.com/docs/custom-flows/bot-sign-up-protection for instructions"),h=f(),u=!0,d=i)}const n=p.render(u?`.${a}`:`#${s}`,{sitekey:d,appearance:"interaction-only",retry:"never","refresh-expired":"auto",callback:function(t){e([t,n])},"error-callback":function(e){g.push(e),m<2&&(e=>!!["crashed","undefined_error","102","103","104","106","110600","300","600"].find((t=>e.startsWith(t))))(e.toString())?setTimeout((()=>{p.reset(n),m++}),250):t([g.join(","),n])},"unsupported-callback":function(){return t(["This browser is not supported by the CAPTCHA.",n]),!0}})}catch(n){t([n,void 0])}})),p.remove(l)}catch([v,l]){throw l&&p.remove(l),{captchaError:v}}finally{h&&(u?document.body.removeChild(h):h.style.display="none")}return{captchaToken:c,captchaWidgetTypeUsed:u?"invisible":"smart"}},l=e=>{const{captchaProvider:t,...n}=e;return"hcaptcha"===t?(async e=>{const{siteKey:t,scriptUrl:n,widgetType:r,invisibleSiteKey:i}=e;let c="",l="",u=!r||"invisible"===r,d=t,h=null;const f=()=>{const e=document.createElement("div");return e.id=a,document.body.appendChild(e),e},p=await async function(e){if(!window.hcaptcha)try{await(0,o.k)(e,{defer:!0})}catch{throw console.error("Clerk: Failed to load the CAPTCHA script from the URL: ",e),{captchaError:"captcha_script_failed_to_load"}}return window.hcaptcha}(n);let m=0;const g=[];try{[c,l]=await new Promise(((e,t)=>{try{if(u)h=f();else{const e=document.getElementById(s);e?(e.style.display="block",h=e):(console.error("Cannot initialize Smart CAPTCHA widget because the `clerk-captcha` DOM element was not found; falling back to Invisible CAPTCHA widget. If you are using a custom flow, visit https://clerk.com/docs/custom-flows/bot-sign-up-protection for instructions"),h=f(),u=!0,d=i)}const n=p.render(u?a:s,{sitekey:d,size:u?"invisible":"normal",callback:function(t){e([t,n])},"error-callback":function(e){g.push(e),m<2?setTimeout((()=>{p.reset(n),m++}),250):t([g.join(","),n])}});u&&p.execute(n)}catch(n){t([n,void 0])}})),p.remove(l)}catch([v,l]){throw l&&p.remove(l),{captchaError:v}}finally{h&&(u?document.body.removeChild(h):h.style.display="none")}return{captchaToken:c,captchaWidgetTypeUsed:u?"invisible":"smart"}})(n):c(n)}},8356:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});const r=({signUp:e,verifyEmailPath:t,verifyPhonePath:n,navigate:r,handleComplete:i,redirectUrl:s="",redirectUrlComplete:a=""})=>{var o,c;if("complete"===e.status)return i&&i();if("missing_requirements"===e.status){if(e.missingFields.some((e=>"saml"===e)))return e.authenticateWithRedirect({strategy:"saml",redirectUrl:s,redirectUrlComplete:a,continueSignUp:!0});if((null===(o=e.unverifiedFields)||void 0===o?void 0:o.includes("email_address"))&&t)return r(t);if((null===(c=e.unverifiedFields)||void 0===c?void 0:c.includes("phone_number"))&&n)return r(n)}}},4927:function(e,t,n){"use strict";n.d(t,{h:function(){return i},r:function(){return s}});var r=n(6480);function i(e){return new URL(window.location.href).searchParams.get(e)||null}function s(e){const t=new URL(window.location.href);t.searchParams.has(e)&&(t.searchParams.delete(e),window.history.replaceState(window.history.state,"",t))}r.rt,r.MC},4870:function(e,t,n){"use strict";n.d(t,{VY:function(){return r.VY},jk:function(){return U},DG:function(){return u},kZ:function(){return y.kZ},cL:function(){return C},Au:function(){return z.A},Qs:function(){return y.Qs},T0:function(){return i},AL:function(){return l},wO:function(){return S},D4:function(){return w},$K:function(){return c},Fm:function(){return d},sb:function(){return p},h8:function(){return x.h8},l:function(){return x.l},hI:function(){return m.h},Xt:function(){return x.Xt},$1:function(){return x.$1},vA:function(){return A.v},hz:function(){return x.hz},rM:function(){return y.rM},tL:function(){return y.tL},ez:function(){return v},Z$:function(){return I},M:function(){return E},_U:function(){return R},V0:function(){return y.V0},px:function(){return M},zi:function(){return y.zi},DY:function(){return y.DY},bJ:function(){return f},nK:function(){return N},l1:function(){return y.l1},AY:function(){return y.AY},yR:function(){return y.yR},FW:function(){return o},vV:function(){return a},yY:function(){return y.yY},FP:function(){return O},rw:function(){return m.r},AC:function(){return y.AC},Mo:function(){return k},QP:function(){return s},Ws:function(){return A.W},FV:function(){return y.FV},Kj:function(){return y.Kj},y7:function(){return r.y7}});var r=n(3132);const i=()=>{let e=!1;const t=()=>e=!0;return{startTracking:()=>{window.addEventListener("beforeunload",t),window.addEventListener(r.tM,t)},stopTracking:()=>{window.removeEventListener("beforeunload",t),window.removeEventListener(r.tM,t)},isUnloading:()=>e}},s=(e,t)=>!(!e.session||!(null==t?void 0:t.authConfig.singleSessionMode)),a=e=>!e.user,o=e=>!e.organization,c=(e,t)=>!(null==t?void 0:t.organizationSettings.enabled),l=({regex:e})=>({urlWithParam:t,entity:n})=>{const r=e.exec(t);if(r){const e=r[1];if(e in n){const i=n[e];return t.replace(r[0],i)}}return t};function u({localPart:e,frontendApi:t}){return`${e}@${t?t.replace("clerk.",""):"clerk.com"}`}function d(e){return n.g.btoa(e)}function h(e){return function(e){return decodeURIComponent(n.g.atob(e).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))}function f(e,t=""){return e.errors&&!!e.errors.find((e=>e.code===t))}const p=(0,n(9859)._r)({packageName:"@clerk/clerk-js"});var m=n(4927);const g=e=>!!e&&"object"==typeof e&&"target"in e&&"currentTarget"in e&&"preventDefault"in e;function v(e,t={}){if(!(t.requireType&&typeof e!==t.requireType||g(e)))return e}var y=n(7661);function w(e){const t=(e||"").split("."),[n,r,i]=t;if(3!==t.length||!n||!r||!i)throw new Error("JWT could not be decoded");const s=JSON.parse(h(r)),a={__raw:e};return Object.keys(s).forEach((e=>{a[e]=s[e]})),{encoded:{header:n,payload:r,signature:i},header:JSON.parse(h(n)),claims:a}}var _=n(8521);const b=()=>{},S=()=>{if(!(0,_.M)())return{onPageFocus:b};const e={focus:[]};return window.addEventListener("focus",(()=>{"visible"===document.visibilityState&&e.focus.forEach((e=>e()))})),{onPageFocus:t=>{e.focus.push(t)}}};function k(e){return"function"==typeof e?e():e}n(5792);var P=n(6480);const C=({base:e,path:t})=>t?e+t:e,O=()=>{var e;const t=null!==(e=(0,m.h)(P.CL))&&void 0!==e?e:"";return t?JSON.parse(atob(t)):null},U=({url:e,startPath:t="/user",currentPath:n="",componentName:r,socialProvider:i=""})=>{const s={path:n.replace(/CLERK-ROUTER\/VIRTUAL\/.*\//,"")||"",componentName:r,startPath:t,socialProvider:i},a=d(JSON.stringify(s)),o=new URL(e),c=o.searchParams;return c.set(P.CL,a),o.search=c.toString(),o.toString()};var A=n(1630);function E(){return void 0!==globalThis.document}function I(){return E()&&globalThis.document.hasFocus()}function R(){return E()&&window.self!==window.top&&!window.frameElement}var x=n(7199),T=n(1777);n(3781);const M=e=>{if((e||"").includes("gravatar")||(e||"").includes("avatar_placeholder"))return!0;try{const t=new URL(e).pathname.replace("/",""),n=(0,T.y)(t);return"default"===JSON.parse(n).type}catch{return!1}};var z=n(8356);function N(e){return"string"==typeof e&&e.startsWith("org_")}},2410:function(e,t,n){"use strict";n.d(t,{EC:function(){return g},Gp:function(){return s},VQ:function(){return l},c7:function(){return o},cC:function(){return f},oe:function(){return h},sX:function(){return u},sv:function(){return a}});var r=n(9859);class i{static encode(e){return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}static decode(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=atob(t),r=n.length,i=new Uint8Array(r);for(let s=0;s<r;s++)i[s]=n.charCodeAt(s);return i.buffer}}async function s(e){try{const t=await navigator.credentials.create({publicKey:e});return t?{publicKeyCredential:t,error:null}:{error:new g("Browser failed to create credential",{code:"passkey_registration_failed"}),publicKeyCredential:null}}catch(n){return{error:(t=n,"InvalidStateError"===t.name?new g(t.message,{code:"passkey_already_exists"}):"NotAllowedError"===t.name?new g(t.message,{code:"passkey_registration_cancelled"}):c(t)),publicKeyCredential:null}}var t}const a=new class{__abort(){if(!this.controller)return;const e=new Error;e.name="AbortError",this.controller.abort(e)}createAbortSignal(){this.__abort();const e=new AbortController;return this.controller=e,e.signal}abort(){this.__abort(),this.controller=void 0}};async function o({publicKeyOptions:e,conditionalUI:t}){try{const n=await navigator.credentials.get({publicKey:e,mediation:t?"conditional":"optional",signal:a.createAbortSignal()});return n?{publicKeyCredential:n,error:null}:{error:new g("Browser failed to get credential",{code:"passkey_retrieval_failed"}),publicKeyCredential:null}}catch(r){return{error:(n=r,"NotAllowedError"===n.name?new g(n.message,{code:"passkey_retrieval_cancelled"}):c(n)),publicKeyCredential:null}}var n}function c(e){return"AbortError"===e.name?new g(e.message,{code:"passkey_operation_aborted"}):"SecurityError"===e.name?new g(e.message,{code:"passkey_invalid_rpID_or_domain"}):e}function l(e){const t=m(e.user.id),n=m(e.challenge),r=(e.excludeCredentials||[]).map((e=>({...e,id:m(e.id)})));return{...e,excludeCredentials:r,challenge:n,user:{...e.user,id:t}}}function u(e){const t=m(e.challenge),n=(e.allowCredentials||[]).map((e=>({...e,id:m(e.id)})));return{...e,allowCredentials:n,challenge:t}}function d(e){return{type:e.type,id:e.id,rawId:p(e.rawId),authenticatorAttachment:e.authenticatorAttachment}}function h(e){const t=e.response;return{...d(e),response:{clientDataJSON:p(t.clientDataJSON),attestationObject:p(t.attestationObject),transports:t.getTransports()}}}function f(e){const t=e.response;return{...d(e),response:{clientDataJSON:p(t.clientDataJSON),authenticatorData:p(t.authenticatorData),signature:p(t.signature),userHandle:t.userHandle?p(t.userHandle):null}}}const p=i.encode.bind(i),m=i.decode.bind(i);class g extends r.cR{constructor(e,{code:t}){super(e,{code:t}),this.code=t}}},9961:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(8174);const i=(e,t)=>{const{onValidation:i=r.lQ,onValidationComplexity:s=r.lQ}=t||{},{show_zxcvbn:a,validatePassword:o}=e,c=(e=>t=>((e,t)=>{const{max_length:n,min_length:r,require_special_char:i,require_lowercase:s,require_numbers:a,require_uppercase:o}=t,c=(e=>{let t;if(e.allowed_special_characters){let n=e.allowed_special_characters.replace("[","\\[");n=n.replace("]","\\]"),t=new RegExp(`[${n}]`)}else t=/[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/;return(e,{minLength:n,maxLength:r})=>({max_length:e.length<r,min_length:e.length>=n,require_numbers:/\d/.test(e),require_lowercase:/[a-z]/.test(e),require_uppercase:/[A-Z]/.test(e),require_special_char:t.test(e)})})(t),l=c(e,{maxLength:t.max_length,minLength:t.min_length}),u={max_length:n,min_length:r,require_special_char:i,require_lowercase:s,require_numbers:a,require_uppercase:o},d=new Map;for(const h in u){const e=h;u[e]&&(l[e]||d.set(e,!0))}return Object.freeze(Object.fromEntries(d))})(t,e))(e),l=(({min_zxcvbn_strength:e,onResult:t})=>n=>r=>{const i=n(r);return null==t||t(i),i.score>=e&&i.score<3?{state:"pass",keys:["unstable__errors.zxcvbn.couldBeStronger"],result:i}:i.score>=e?{state:"excellent",result:i}:{state:"fail",keys:["unstable__errors.zxcvbn.notEnough",...i.feedback.suggestions.map((e=>`unstable__errors.zxcvbn.suggestions.${e}`))],result:i}})(e);let u={};return(e,t)=>{const{onValidation:r=i,onValidationComplexity:d=s}=t||{};if(!o)return;const h=c(e);d(0===Object.keys(h).length),u={...u,complexity:h},a&&Promise.all([n.e(592).then(n.bind(n,4914)),n.e(128).then(n.bind(n,1206))]).then((([e,t])=>{const{zxcvbnOptions:n,zxcvbn:r}=e,{dictionary:i,adjacencyGraphs:s}=t;return n.setOptions({dictionary:{...i},graphs:s}),r})).then((t=>{const n=l(t)(e);u={...u,strength:n},r({...u,strength:n})})),u.complexity&&0===Object.keys(u.complexity).length&&a||r(u)}}},5792:function(e,t,n){"use strict";n.d(t,{H:function(){return s}});const r="/",i=new RegExp(r+"{1,}","g");function s(e,t){return[e,t].filter((e=>e)).join(r).replace(i,r)}},1630:function(e,t,n){"use strict";n.d(t,{W:function(){return i},v:function(){return r}});const r=e=>{const t={};return new URLSearchParams(e).forEach(((e,n)=>{if(n in t){const r=t[n];Array.isArray(r)?r.push(e):t[n]=[r,e]}else t[n]=e})),t},i=(e,t={})=>{if(null==e)return"";if(!e||"object"!=typeof e)return"";const n=new URLSearchParams;return Object.keys(e).forEach((r=>{const i=t.keyEncoder?t.keyEncoder(r):r,s=e[r];if(Array.isArray(s))s.forEach((e=>void 0!==e&&n.append(i,e||"")));else{if(void 0===s)return;"object"==typeof s&&null!==s?n.append(i,JSON.stringify(s)):n.append(i,String(null!=s?s:""))}})),n.toString()}},191:function(e,t,n){"use strict";n.d(t,{n:function(){return v}}),n(3781);var r,i,s,a,o,c,l,u,d,h,f=n(4219),p=n(5504),m=n(7661),g=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class v{constructor(e,t={},n={}){r.add(this),h.set(this,(e=>{var t;return((e,t)=>{const n={};for(const r in e)e[r]&&t(e[r])&&(n[r]=e[r]);return n})(e,(0,m.Dp)(null===(t=this.options)||void 0===t?void 0:t.allowedRedirectOrigins))})),this.options=e,this.fromOptions=g(this,r,"m",l).call(this,e||{}),this.fromProps=g(this,r,"m",l).call(this,t||{}),this.fromSearchParams=g(this,r,"m",u).call(this,n||{})}getAfterSignInUrl(){return g(this,r,"m",c).call(this,"signIn")}getAfterSignUpUrl(){return g(this,r,"m",c).call(this,"signUp")}getPreservedSearchParams(){return g(this,r,"m",s).call(this,g(this,r,"m",a).call(this))}toSearchParams(){return g(this,r,"m",s).call(this,g(this,r,"m",o).call(this))}}i=v,h=new WeakMap,r=new WeakSet,s=function(e){const t=Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,f.C8)(e),t])));return new URLSearchParams((e=>Object.entries(e).reduce(((e,[t,n])=>(null!=n&&(e[t]=n),e)),{}))(t))},a=function(){return Object.fromEntries(Object.entries({...this.fromSearchParams}).filter((([e])=>i.preserved.includes(e))))},o=function(){const e=this.fromSearchParams.signUpForceRedirectUrl||this.fromProps.signUpForceRedirectUrl||this.fromOptions.signUpForceRedirectUrl,t=this.fromSearchParams.signUpFallbackRedirectUrl||this.fromProps.signUpFallbackRedirectUrl||this.fromOptions.signUpFallbackRedirectUrl,n=this.fromSearchParams.signInForceRedirectUrl||this.fromProps.signInForceRedirectUrl||this.fromOptions.signInForceRedirectUrl,r={signUpForceRedirectUrl:e,signUpFallbackRedirectUrl:t,signInFallbackRedirectUrl:this.fromSearchParams.signInFallbackRedirectUrl||this.fromProps.signInFallbackRedirectUrl||this.fromOptions.signInFallbackRedirectUrl,signInForceRedirectUrl:n,afterSignInUrl:this.fromSearchParams.afterSignInUrl||this.fromProps.afterSignInUrl||this.fromOptions.afterSignInUrl,afterSignUpUrl:this.fromSearchParams.afterSignUpUrl||this.fromProps.afterSignUpUrl||this.fromOptions.afterSignUpUrl,redirectUrl:this.fromSearchParams.redirectUrl||this.fromProps.redirectUrl||this.fromOptions.redirectUrl};return e&&delete r.signUpFallbackRedirectUrl,n&&delete r.signInFallbackRedirectUrl,r},c=function(e){const t=`${e}ForceRedirectUrl`,n=`${e}FallbackRedirectUrl`;let r;const i=`after${e[0].toUpperCase()}${e.slice(1)}Url`;let s;s=this.fromSearchParams[t]||this.fromProps[t]||this.fromOptions[t],s&&(r=t),s||(s=this.fromSearchParams.redirectUrl),s&&(r="redirectUrl"),s||(s=this.fromSearchParams[n]||this.fromProps[n]||this.fromOptions[n]),s&&(r=n);const a=this.fromSearchParams[i]||this.fromProps[i]||this.fromProps.redirectUrl||this.fromOptions[i];return(0,p.n)(r,s,i,a),s||(s=a),s||"/"},l=function(e){(0,p.I)(e);const t={};return i.keys.forEach((n=>{t[n]=e[n]})),g(this,r,"m",d).call(this,g(this,h,"f").call(this,t))},u=function(e){(0,p.I)(e);const t={};return i.keys.forEach((n=>{t[n]=e[(0,f.C8)(n)]})),t.redirectUrl=e.redirect_url,g(this,r,"m",d).call(this,g(this,h,"f").call(this,t))},d=function(e){return((e,t)=>{const n={};for(const i in e)n[i]=(r=e[i],(0,m.kU)(r,window.location.origin));var r;return n})(e)},v.keys=["signInForceRedirectUrl","signInFallbackRedirectUrl","signUpForceRedirectUrl","signUpFallbackRedirectUrl","afterSignInUrl","afterSignUpUrl","redirectUrl"],v.preserved=["redirectUrl"]},7661:function(e,t,n){"use strict";n.d(t,{kZ:function(){return m},Qs:function(){return I},rM:function(){return y},tL:function(){return S},Dp:function(){return E},V0:function(){return b},zi:function(){return f},DY:function(){return d},l1:function(){return U},AY:function(){return w},yR:function(){return k},yY:function(){return P},kU:function(){return _},AC:function(){return A},FV:function(){return g},Kj:function(){return v}}),n(3781);var r=n(2580),i=n(8771),s=n(6915),a=n(4219),o=n(7966),c=n(5792),l=n(1630);const u="http://clerk-dummy",{isDevOrStagingUrl:d}=(0,i.RZ)(),h=new Map;function f(e=window.location.hostname){if(!e)return!1;let t=h.get(e);return void 0===t&&(t=(0,o.sB)(e)||(0,o.Ab)(e),h.set(e,t)),t}function p(e){return e.replace("clerk.","")}function m(e,t={}){const{base:n,hashPath:r,hashSearch:i,searchParams:s,hashSearchParams:o,...d}=e;let h="";h="undefined"!=typeof window&&window.location?window.location.href:"http://react-native-fake-base-url";const f=new URL(n||"",h);if(s instanceof URLSearchParams&&s.forEach(((e,t)=>{null!=e&&f.searchParams.set((0,a.C8)(t),e)})),Object.assign(f,d),r||i||o){const e=new URL(u+f.hash.substring(1));e.pathname=(0,c.H)(e.pathname,r||"");const t=(0,l.v)(i||"");for(const[r,i]of Object.entries(t))e.searchParams.append(r,i);if(o){const t=Array.isArray(o)?o:[o];for(const n of t)(n instanceof URLSearchParams||"object"==typeof n)&&new URLSearchParams(n).forEach(((t,n)=>{null!=t&&e.searchParams.set((0,a.C8)(n),t)}))}const n=e.href.replace(u,"");"/"!==n&&(f.hash=n)}const{stringify:p,skipOrigin:m}=t;return p?m?f.href.replace(f.origin,""):f.href:f}function g(e){return(e=function(e){return new URL(e.toString(),window.location.origin)}(e)).href.replace(e.origin,"")}const v=e=>(e||"").replace(/\/+$/,""),y=e=>{const{externalAccount:t}=e.verifications;return!!t.error};function w(e){if(!e)return!1;try{return new URL(e),!0}catch(t){return!1}}function _(e,t){return w(e)?e:new URL(e,t).href}function b(e){return!!w(e)&&"data:"===new URL(e).protocol}const S=e=>new URL(e,u).hash.startsWith("#/"),k=e=>{const t=new URL(e);if(!S(t))return t;const n=new URL(t.hash.replace("#/","/"),t.href),r=[t.pathname,n.pathname].map((e=>e.split("/"))).flat().filter(Boolean).join("/"),i=new URL(r,t.origin);return t.searchParams.forEach(((e,t)=>{i.searchParams.set(t,e)})),n.searchParams.forEach(((e,t)=>{i.searchParams.set(t,e)})),i},P=e=>e.replace(/CLERK-ROUTER\/(.*?)\//,""),C=["/oauth/authorize"],O=["/v1/verify","/v1/tickets/accept"];function U(e,t){const n=new URL(t,u),r=n.pathname,i=C.includes(r)||O.includes(r);return e===n.host&&i}function A(e){const t=new URL(e,u);return C.includes(t.pathname)}const E=e=>t=>{if(!e)return!0;if(function(e){if(e!=e&&!e)return!1;if(e.startsWith("//")||e.startsWith("http/")||e.startsWith("https/"))return!1;try{return new URL(e),!1}catch(t){try{return new URL(e,u),!0}catch(t){return!1}}}(t))return!0;const n=new URL(t,u),i=e.map((e=>"string"==typeof e?(e=>{try{return r(e)}catch(t){throw new Error(`Invalid pattern: ${e}.\nConsult the documentation of glob-to-regexp here: https://www.npmjs.com/package/glob-to-regexp.\n${t.message}`)}})(v(e)):e)).some((e=>e.test(v(n.origin))));return i||s.v.warnOnce(`Clerk: Redirect URL ${n} is not on one of the allowedRedirectOrigins, falling back to the default redirect URL.`),i};function I(e,t){if(Array.isArray(e)&&e.length)return e;const n=[];return"undefined"!=typeof window&&window.location&&n.push(window.location.origin),n.push(`https://${p(t)}`),n.push(`https://*.${p(t)}`),n}},8740:function(e,t,n){"use strict";n.d(t,{Cm:function(){return s},IM:function(){return i},dS:function(){return r}});const r=({firstName:e,lastName:t,name:n})=>n||[e,t].join(" ").trim()||"",i=({firstName:e,lastName:t,name:n})=>[(e||"")[0],(t||"")[0]].join("").trim()||(n||"")[0],s=e=>e.username?e.username:e.primaryEmailAddress?e.primaryEmailAddress.emailAddress:e.primaryPhoneNumber?e.primaryPhoneNumber.phoneNumber:e.primaryWeb3Wallet?e.primaryWeb3Wallet.web3Wallet:""},7199:function(e,t,n){"use strict";n.d(t,{h8:function(){return g},l:function(){return m},$t:function(){return h},Xt:function(){return p},$1:function(){return f},hz:function(){return d}});var r,i,s,a,o,c=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class l{constructor(){i.set(this,[]),s.set(this,{metamask:"MetaMask"}),this.get=e=>{var t;return 1===c(this,i,"f").length?c(this,i,"f")[0].provider:null===(t=c(this,i,"f").find((t=>t.info.name===c(this,s,"f")[e])))||void 0===t?void 0:t.provider},o.set(this,(e=>{c(this,i,"f").some((t=>t.info.uuid===e.detail.info.uuid))||c(this,i,"f").push(e.detail)})),"undefined"!=typeof window&&(window.addEventListener("eip6963:announceProvider",c(this,o,"f")),window.dispatchEvent(new Event("eip6963:requestProvider")))}static getInstance(){return c(r,r,"f",a)||function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===r?i.call(e,n):i?i.value=n:t.set(e,n)}(r,r,new r,"f",a),c(r,r,"f",a)}}r=l,i=new WeakMap,s=new WeakMap,o=new WeakMap,a={value:null};const u=()=>l.getInstance();async function d(e){const{provider:t}=e,n=await v(t);if(!n)return"";const r=await n.request({method:"eth_requestAccounts"});return r&&r[0]||""}async function h(e){const{identifier:t,nonce:n,provider:r}=e,i=await v(r);return i?await i.request({method:"personal_sign",params:[`0x${s=n,s.split("").map((e=>e.charCodeAt(0).toString(16).padStart(2,"0"))).join("")}`,t]}):"";var s}async function f(){return await d({provider:"metamask"})}async function p(){return await d({provider:"coinbase_wallet"})}async function m(e){return await h({...e,provider:"metamask"})}async function g(e){return await h({...e,provider:"coinbase_wallet"})}async function v(e){return"coinbase_wallet"===e?new(await Promise.all([n.e(520),n.e(96),n.e(553)]).then(n.bind(n,4144)).then((e=>e.CoinbaseWalletSDK)))({}).makeWeb3Provider({options:"all"}):u().get(e)}},3132:function(e,t,n){"use strict";n.d(t,{VY:function(){return i},tM:function(){return r},y7:function(){return s}});const r="clerk:beforeunload",i=["http:","https:","wails:","chrome-extension:"];function s(e){let t=new URL(e,window.location.href);i.includes(t.protocol)||(console.warn(`Clerk: "${t.protocol}" is not a valid protocol. Redirecting to "/" instead. If you think this is a mistake, please open an issue.`),t=new URL("/",window.location.href)),window.dispatchEvent(new CustomEvent(r)),window.location.href=t.href}},4026:function(e,t,n){"use strict";var r=n(4041),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,a=r.useEffect,o=r.useLayoutEffect,c=r.useDebugValue;function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(r){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,u=r[1];return o((function(){i.value=n,i.getSnapshot=t,l(i)&&u({inst:i})}),[e,n,t]),a((function(){return l(i)&&u({inst:i}),e((function(){l(i)&&u({inst:i})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},8139:function(e,t,n){"use strict";e.exports=n(4026)},9575:function(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}n.d(t,{A:function(){return r}})},8521:function(e,t,n){"use strict";n.d(t,{CS:function(){return r.CS},M:function(){return r.M}});var r=n(7736);n(3781)},9253:function(e,t,n){"use strict";n.d(t,{f:function(){return a},v:function(){return o}});var r=n(1153),i='const respond=r=>{self.postMessage(r)},workerToTabIds={};self.addEventListener("message",r=>{const e=r.data;switch(e.type){case"setTimeout":workerToTabIds[e.id]=setTimeout(()=>{respond({id:e.id})},e.ms);break;case"clearTimeout":workerToTabIds[e.id]&&(clearTimeout(workerToTabIds[e.id]),delete workerToTabIds[e.id]);break;case"setInterval":workerToTabIds[e.id]=setInterval(()=>{respond({id:e.id})},e.ms);break;case"clearInterval":workerToTabIds[e.id]&&(clearInterval(workerToTabIds[e.id]),delete workerToTabIds[e.id]);break}});\n',s=(e,t={})=>{if("undefined"==typeof Worker)return null;try{const n=new Blob([e],{type:"application/javascript; charset=utf-8"}),r=globalThis.URL.createObjectURL(n);return new Worker(r,t)}catch(n){return console.warn("Clerk: Cannot create worker from blob. Consider adding worker-src blob:; to your CSP"),null}},a=()=>{let e=0;const t=()=>e++,n=new Map,a=(e,t)=>null==e?void 0:e.postMessage(t),o=e=>{var t;null==(t=n.get(e.data.id))||t()};let c=s(i,{name:"clerk-timers"});if(null==c||c.addEventListener("message",o),!c)return{setTimeout:globalThis.setTimeout.bind(globalThis),setInterval:globalThis.setInterval.bind(globalThis),clearTimeout:globalThis.clearTimeout.bind(globalThis),clearInterval:globalThis.clearInterval.bind(globalThis),cleanup:r.l};const l=()=>{c||(c=s(i,{name:"clerk-timers"}),null==c||c.addEventListener("message",o))};return{setTimeout:(e,r)=>{l();const i=t();return n.set(i,e),a(c,{type:"setTimeout",id:i,ms:r}),i},setInterval:(e,r)=>{l();const i=t();return n.set(i,e),a(c,{type:"setInterval",id:i,ms:r}),i},clearTimeout:e=>{l(),n.delete(e),a(c,{type:"clearTimeout",id:e})},clearInterval:e=>{l(),n.delete(e),a(c,{type:"clearInterval",id:e})},cleanup:()=>{c&&(c.terminate(),c=null,n.clear())}}};function o({delayInMs:e}={delayInMs:1e3}){const t=a();let n,r=!1;const i=()=>{n&&(t.clearTimeout(n),t.cleanup()),r=!0},s=async a=>{r=!1,await a(i),r||(n=t.setTimeout((()=>{s(a)}),e))};return{run:s,stop:i}}},1131:function(e,t,n){"use strict";n.d(t,{W1:function(){return s}});var r=n(6454),i=new Set,s=(e,t,n,s)=>{let a=e[t];Object.defineProperty(e,t,{get(){return((e,t,n)=>{const s=(0,r.MC)()||(0,r.Fj)(),a=null!=n?n:e;i.has(a)||s||(i.add(a),console.warn(`Clerk - DEPRECATION WARNING: "${e}" is deprecated and will be removed in the next major release.\n${t}`))})(t,n,s),a},set(e){a=e}})}},3781:function(e,t,n){"use strict";n.d(t,{OV:function(){return p},S7:function(){return h},VA:function(){return c},VK:function(){return f},ie:function(){return u},jq:function(){return m}});var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=e=>{throw TypeError(e)},c=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let c of s(t))a.call(e,c)||c===n||r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},u=(e,t,n)=>(l(e,t,"default"),n&&l(n,t,"default")),d=(e,t,n)=>t.has(e)||o("Cannot "+n),h=(e,t,n)=>(d(e,t,"read from private field"),n?n.call(e):t.get(e)),f=(e,t,n)=>t.has(e)?o("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),p=(e,t,n,r)=>(d(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),m=(e,t,n)=>(d(e,t,"access private method"),n)},1153:function(e,t,n){"use strict";n.d(t,{l:function(){return r}});var r=(...e)=>{}},3597:function(e,t,n){"use strict";n.d(t,{v:function(){return i}});var r=new Set,i={warnOnce:e=>{r.has(e)||(r.add(e),console.warn(e))},logOnce:e=>{r.has(e)||(console.log(e),r.add(e))}}},6392:function(e,t,n){"use strict";n.d(t,{OG:function(){return i},e7:function(){return a},om:function(){return s}});var r=864e5;function i(e){try{return new Date(e||new Date)}catch(t){return new Date}}function s(e){const{date:t,relativeTo:n}=e;if(!t||!n)return null;const s=i(t),a=function(e,t,{absolute:n=!0}={}){if(!e||!t)return 0;const i=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),s=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),a=Math.floor((s-i)/r);return n?Math.abs(a):a}(i(n),s,{absolute:!1});return a<-6?{relativeDateCase:"other",date:s}:a<-1?{relativeDateCase:"previous6Days",date:s}:-1===a?{relativeDateCase:"lastDay",date:s}:0===a?{relativeDateCase:"sameDay",date:s}:1===a?{relativeDateCase:"nextDay",date:s}:a<7?{relativeDateCase:"next6Days",date:s}:{relativeDateCase:"other",date:s}}function a(e,t){const n=i(e);return n.setFullYear(n.getFullYear()+t),n}},5175:function(e,t,n){"use strict";n.d(t,{Nv:function(){return a},k0:function(){return l},ph:function(){return i}});var r=n(1153),i=()=>{let e=r.l,t=r.l;return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}},s={firstDelay:125,maxDelay:0,timeMultiple:2,shouldRetry:()=>!0},a=async(e,t={})=>{let n=0;const{shouldRetry:r,firstDelay:i,maxDelay:a,timeMultiple:o}={...s,...t},c=(e=>{let t=0;return async()=>{await(async e=>new Promise((t=>setTimeout(t,e))))((()=>{const n=e.firstDelay,r=e.timeMultiple,i=n*Math.pow(r,t);return Math.min(e.maxDelay||i,i)})()),t++}})({firstDelay:i,maxDelay:a,timeMultiple:o});for(;;)try{return await e()}catch(l){if(n++,!r(l,n))throw l;await c()}},o="loadScript cannot be called when document does not exist",c="loadScript cannot be called without a src";async function l(e="",t){const{async:n,defer:r,beforeLoad:i,crossOrigin:s,nonce:l}=t||{};return a((()=>new Promise(((t,a)=>{e||a(c),document&&document.body||a(o);const u=document.createElement("script");s&&u.setAttribute("crossorigin",s),u.async=n||!1,u.defer=r||!1,u.addEventListener("load",(()=>{u.remove(),t(u)})),u.addEventListener("error",(()=>{u.remove(),a()})),u.src=e,u.nonce=l,null==i||i(u),document.body.appendChild(u)}))),{shouldRetry:(e,t)=>t<5})}},371:function(e,t,n){"use strict";n.d(t,{aG:function(){return i},at:function(){return a},gE:function(){return s},iM:function(){return r}});var r=[".lcl.dev",".lclstage.dev",".lclclerk.com"],i=[".accounts.dev",".accountsstage.dev",".accounts.lclclerk.com"],s=[".lcl.dev",".stg.dev",".lclstage.dev",".stgstage.dev",".dev.lclclerk.com",".stg.lclclerk.com",".accounts.lclclerk.com","accountsstage.dev","accounts.dev"];function a(e,t="svg"){return`https://img.clerk.com/static/${e}.${t}`}},6517:function(e,t,n){"use strict";n.d(t,{Ab:function(){return o},GP:function(){return h},TV:function(){return s},Wl:function(){return i},ae:function(){return d},oq:function(){return p},sB:function(){return a},vh:function(){return g}});var r=n(371);function i(e=""){return(e||"").replace(/^.+:\/\//,"")}function s(e){if(!e)return"";let t;if(e.match(/^(clerk\.)+\w*$/))t=/(clerk\.)*(?=clerk\.)/;else{if(e.match(/\.clerk.accounts/))return e;t=/^(clerk\.)*/gi}return`clerk.${e.replace(t,"")}`}function a(e){return r.iM.some((t=>e.startsWith("accounts.")&&e.endsWith(t)))}function o(e){return r.aG.some((t=>e.endsWith(t)&&!e.endsWith(".clerk"+t)))}var c=/\/$|\/\?|\/#/;function l(e="",t){return t?c.test(e):e.endsWith("/")}function u(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(l(e,!0))return e||"/";let n=e,r="";const i=e.indexOf("#");if(i>=0&&(n=e.slice(0,i),r=e.slice(i),!n))return r;const[s,...a]=n.split("?");return s+"/"+(a.length>0?`?${a.join("?")}`:"")+r}function d(e="",t){if(!t)return(l(e)?e.slice(0,-1):e)||"/";if(!l(e,!0))return e||"/";let n=e,r="";const i=e.indexOf("#");i>=0&&(n=e.slice(0,i),r=e.slice(i));const[s,...a]=n.split("?");return(s.slice(0,-1)||"/")+(a.length>0?`?${a.join("?")}`:"")+r}function h(e=""){return function(e=""){return e.startsWith("/")}(e)?e:"/"+e}var f=/^\.?\//;function p(e,...t){let n=e||"";for(const r of t.filter((e=>function(e){return e&&"/"!==e}(e))))if(n){const e=r.replace(f,"");n=u(n)+e}else n=r;return n}var m=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,g=e=>m.test(e)},311:function(e,t,n){"use strict";n.d(t,{RZ:function(){return l},qS:function(){return d},ky:function(){return h},iE:function(){return u},q5:function(){return c}});var r=n(1777),i=e=>"undefined"!=typeof btoa&&"function"==typeof btoa?btoa(e):"undefined"!=typeof global&&global.Buffer?new global.Buffer(e).toString("base64"):e,s=n(371),a="pk_live_",o="pk_test_";function c(e,t={}){if(!(e=e||"")||!function(e){const t=(e=e||"").startsWith(a)||e.startsWith(o),n=(0,r.y)(e.split("_")[2]||"").endsWith("$");return t&&n}(e)){if(t.fatal)throw new Error("Publishable key not valid.");return null}const n=e.startsWith(a)?"production":"development";let i=(0,r.y)(e.split("_")[2]);return i=i.slice(0,-1),t.proxyUrl?i=t.proxyUrl:"development"!==n&&t.domain&&(i=`clerk.${t.domain}`),{instanceType:n,frontendApi:i}}function l(){const e=new Map;return{isDevOrStagingUrl:t=>{if(!t)return!1;const n="string"==typeof t?t:t.hostname;let r=e.get(n);return void 0===r&&(r=s.gE.some((e=>n.endsWith(e))),e.set(n,r)),r}}}function u(e){return e.startsWith("test_")||e.startsWith("pk_test_")}async function d(e,t=globalThis.crypto.subtle){const n=(new TextEncoder).encode(e),r=await t.digest("sha-1",n),s=String.fromCharCode(...new Uint8Array(r));return i(s).replace(/\+/gi,"-").replace(/\//gi,"_").substring(0,8)}var h=(e,t)=>`${e}_${t}`},7736:function(e,t,n){"use strict";function r(){return"undefined"!=typeof window}n.d(t,{CS:function(){return o},F7:function(){return s},M:function(){return r},kv:function(){return a}});var i=new 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"].join("|"),"i");function s(){const e=r()?null==window?void 0:window.navigator:null;return!(!e||(t=null==e?void 0:e.userAgent,t&&i.test(t)||(null==e?void 0:e.webdriver)));var t}function a(){var e,t;const n=r()?null==window?void 0:window.navigator:null;if(!n)return!1;const i=null==n?void 0:n.onLine;return 0!==(null==(e=null==n?void 0:n.connection)?void 0:e.rtt)&&0!==(null==(t=null==n?void 0:n.connection)?void 0:t.downlink)&&i}function o(){return a()&&s()}},295:function(e,t,n){"use strict";function r(e){const t=e||"";return t.charAt(0).toUpperCase()+t.slice(1)}function i(e){return e?e.replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace(/-|_/,""))):""}function s(e){return e?e.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`)):""}n.d(t,{C8:function(){return s},Ir:function(){return l},Ns:function(){return r},Sd:function(){return o},sF:function(){return i},zz:function(){return c}});var a=e=>{const t=n=>{if(!n)return n;if(Array.isArray(n))return n.map((e=>"object"==typeof e||Array.isArray(e)?t(e):e));const r={...n},i=Object.keys(r);for(const s of i){const n=e(s.toString());n!==s&&(r[n]=r[s],delete r[s]),"object"==typeof r[n]&&(r[n]=t(r[n]))}return r};return t},o=(a(s),a(i));function c(e){if("boolean"==typeof e)return e;if(null==e)return!1;if("string"==typeof e){if("true"===e.toLowerCase())return!0;if("false"===e.toLowerCase())return!1}const t=parseInt(e,10);return!isNaN(t)&&t>0}function l(e){return Object.entries(e).reduce(((e,[t,n])=>(void 0!==n&&(e[t]=n),e)),{})}},6454:function(e,t,n){"use strict";n.d(t,{Fj:function(){return s},MC:function(){return i},b_:function(){return r}});var r=()=>{try{return!1}catch(e){}return!1},i=()=>{try{return!1}catch(e){}return!1},s=()=>{try{return!0}catch(e){}return!1}},4231:function(e,t,n){"use strict";function r(e){return["captcha_invalid","captcha_not_enabled","captcha_missing_token"].includes(e.errors[0].code)}function i(e){const t=null==e?void 0:e.status;return!!t&&t>=400&&t<500}function s(e){return(`${e.message}${e.name}`||"").toLowerCase().replace(/\s+/g,"").includes("networkerror")}function a(e){return o(e)||l(e)||c(e)}function o(e){return"clerkError"in e}function c(e){return"clerkRuntimeError"in e}function l(e){return"code"in e&&[4001,32602,32603].includes(e.code)&&"message"in e}function u(e){var t,n;return o(e)&&"user_locked"===(null==(n=null==(t=e.errors)?void 0:t[0])?void 0:n.code)}function d(e){var t,n;return o(e)&&"form_password_pwned"===(null==(n=null==(t=e.errors)?void 0:t[0])?void 0:n.code)}function h(e=[]){return e.length>0?e.map(f):[]}function f(e){var t,n,r,i,s;return{code:e.code,message:e.message,longMessage:e.long_message,meta:{paramName:null==(t=null==e?void 0:e.meta)?void 0:t.param_name,sessionId:null==(n=null==e?void 0:e.meta)?void 0:n.session_id,emailAddresses:null==(r=null==e?void 0:e.meta)?void 0:r.email_addresses,identifiers:null==(i=null==e?void 0:e.meta)?void 0:i.identifiers,zxcvbn:null==(s=null==e?void 0:e.meta)?void 0:s.zxcvbn}}}n.d(t,{$R:function(){return o},Au:function(){return d},Cm:function(){return c},LR:function(){return p},NZ:function(){return g},Rb:function(){return h},TX:function(){return s},Ys:function(){return y},_d:function(){return u},_r:function(){return _},cR:function(){return m},hl:function(){return v},nc:function(){return i},rZ:function(){return r},si:function(){return l},u$:function(){return f},ux:function(){return a}});var p=class e extends Error{constructor(t,{data:n,status:r,clerkTraceId:i}){super(t),this.toString=()=>{let e=`[${this.name}]\nMessage:${this.message}\nStatus:${this.status}\nSerialized errors: ${this.errors.map((e=>JSON.stringify(e)))}`;return this.clerkTraceId&&(e+=`\nClerk Trace ID: ${this.clerkTraceId}`),e},Object.setPrototypeOf(this,e.prototype),this.status=r,this.message=t,this.clerkTraceId=i,this.clerkError=!0,this.errors=h(n)}},m=class e extends Error{constructor(t,{code:n}){super(t),this.toString=()=>`[${this.name}]\nMessage:${this.message}`,Object.setPrototypeOf(this,e.prototype),this.code=n,this.message=t,this.clerkRuntimeError=!0}},g=class e extends Error{constructor(t){super(t),this.code=t,Object.setPrototypeOf(this,e.prototype)}};function v(e){return e instanceof g}var y={Expired:"expired",Failed:"failed",ClientMismatch:"client_mismatch"},w=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 _({packageName:e,customMessages:t}){let n=e;const r={...w,...t};function i(e,t){if(!t)return`${n}: ${e}`;let r=e;const i=e.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(const n of i){const e=(t[n[1]]||"").toString();r=r.replace(`{{${n[1]}}}`,e)}return`${n}: ${r}`}return{setPackageName({packageName:e}){return"string"==typeof e&&(n=e),this},setMessages({customMessages:e}){return Object.assign(r,e||{}),this},throwInvalidPublishableKeyError(e){throw new Error(i(r.InvalidPublishableKeyErrorMessage,e))},throwInvalidProxyUrl(e){throw new Error(i(r.InvalidProxyUrlErrorMessage,e))},throwMissingPublishableKeyError(){throw new Error(i(r.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw new Error(i(r.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(e){throw new Error(i(r.MissingClerkProvider,e))},throw(e){throw new Error(i(e))}}}},1777:function(e,t,n){"use strict";n.d(t,{y:function(){return r}});var r=e=>"undefined"!=typeof atob&&"function"==typeof atob?atob(e):"undefined"!=typeof global&&global.Buffer?new global.Buffer(e,"base64").toString():e},9859:function(e,t,n){"use strict";n.d(t,{$R:function(){return r.$R},Au:function(){return r.Au},Cm:function(){return r.Cm},LR:function(){return r.LR},NZ:function(){return r.NZ},Rb:function(){return r.Rb},TX:function(){return r.TX},Ys:function(){return r.Ys},_d:function(){return r._d},_r:function(){return r._r},cR:function(){return r.cR},hl:function(){return r.hl},nc:function(){return r.nc},rZ:function(){return r.rZ},si:function(){return r.si},u$:function(){return r.u$},ux:function(){return r.ux}});var r=n(4231);n(3781)},8174:function(e,t,n){"use strict";n.d(t,{cR:function(){return a.cR},rK:function(){return m},vu:function(){return r.v},TV:function(){return f.TV},C8:function(){return i.C8},ph:function(){return s.ph},fx:function(){return r.f},Sd:function(){return i.Sd},aY:function(){return v},om:function(){return _.om},Ir:function(){return i.Ir},VK:function(){return y},M:function(){return w.M},nc:function(){return a.nc},kv:function(){return w.kv},$R:function(){return a.$R},Cm:function(){return a.Cm},b_:function(){return g.b_},RE:function(){return u},_d:function(){return a._d},CS:function(){return w.CS},_c:function(){return l},lQ:function(){return p.l},OG:function(){return _.OG},q5:function(){return o.q5},SW:function(){return h},Nv:function(){return s.Nv},sF:function(){return i.sF},Wl:function(){return f.Wl},Ns:function(){return i.Ns}});var r=n(9253),i=n(295),s=n(5175),a=n(4231),o=n(311),{isDevOrStagingUrl:c}=(0,o.RZ)();function l(e){return!e||u(e)||d(e)}function u(e){return/^http(s)?:\/\//.test(e||"")}function d(e){return e.startsWith("/")}function h(e){return e?d(e)?new URL(e,window.location.origin).toString():e:""}(0,a._r)({packageName:"@clerk/shared"});var f=n(6517),p=n(1153),m=class{constructor(e){this.eventTarget=window,this.postMessage=e=>{if("undefined"!=typeof window)try{window.localStorage.setItem(this.channelKey,JSON.stringify(e)),window.localStorage.removeItem(this.channelKey)}catch(t){}},this.addEventListener=(e,t)=>{this.eventTarget.addEventListener(this.prefixEventName(e),(e=>{t(e)}))},this.setupLocalStorageListener=()=>{window.addEventListener("storage",(e=>{if(e.key===this.channelKey&&e.newValue)try{const t=JSON.parse(e.newValue||""),n=new MessageEvent(this.prefixEventName("message"),{data:t});this.eventTarget.dispatchEvent(n)}catch(t){}}))},this.channelKey="__lsbc__"+e,this.setupLocalStorageListener()}prefixEventName(e){return this.channelKey+e}},g=(n(3597),n(1131),n(6454)),v=(e,t)=>{if(e&&t)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&null!==e[n]&&"object"==typeof e[n]?(void 0===t[n]&&(t[n]=new(Object.getPrototypeOf(e[n]).constructor)),v(e[n],t[n])):Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])};function y(e,t,n){return"function"==typeof e?e(t):void 0!==e?e:void 0!==n?n:void 0}Object.freeze({"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/x-icon":"ico","image/vnd.microsoft.icon":"ico"});var w=n(7736),_=n(6392);n(3781)},8771:function(e,t,n){"use strict";n.d(t,{RZ:function(){return r.RZ},iE:function(){return r.iE},ky:function(){return r.ky},qS:function(){return r.qS}});var r=n(311);n(3781)},4102:function(e,t,n){"use strict";n.d(t,{k:function(){return r.k0}});var r=n(5175);n(3781)},6915:function(e,t,n){"use strict";n.d(t,{v:function(){return r.v}});var r=n(3597);n(3781)},429:function(e,t,n){"use strict";n.d(t,{v:function(){return r.v}});var r=n(9253);n(3781)},3931:function(e,t,n){"use strict";n.d(t,{ED:function(){return me},pc:function(){return we},kN:function(){return ke},TS:function(){return Ue},IC:function(){return be},Rs:function(){return ve},_x:function(){return he},e3:function(){return fe},ho:function(){return De},WD:function(){return _e},Oc:function(){return Je},vp:function(){return Pe},Z5:function(){return Me},D_:function(){return Ne},UQ:function(){return $e},wV:function(){return Le},Lg:function(){return Se},g7:function(){return Fe},Jd:function(){return We},ur:function(){return ye}});var r={};function i(e,t){return{event:"METHOD_CALLED",payload:{method:e,...t}}}n.r(r),n.d(r,{SWRConfig:function(){return se},default:function(){return ae},mutate:function(){return j},preload:function(){return Q},unstable_serialize:function(){return ne},useSWRConfig:function(){return Z}});var s=n(3781),a=n(4041),o=n(8139);const c=()=>{},l=c(),u=Object,d=e=>e===l,h=e=>"function"==typeof e,f=(e,t)=>({...e,...t}),p=new WeakMap;let m=0;const g=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,s;if(u(e)!==e||r||n==RegExp)i=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(i=p.get(e),i)return i;if(i=++m+"~",p.set(e,i),n==Array){for(i="@",s=0;s<e.length;s++)i+=g(e[s])+",";p.set(e,i)}if(n==u){i="#";const t=u.keys(e).sort();for(;!d(s=t.pop());)d(e[s])||(i+=s+":"+g(e[s])+",");p.set(e,i)}}return i},v=new WeakMap,y={},w={},_="undefined",b=typeof window!=_,S=typeof document!=_,k=(e,t)=>{const n=v.get(e);return[()=>!d(t)&&e.get(t)||y,r=>{if(!d(t)){const i=e.get(t);t in w||(w[t]=i),n[5](t,f(i,r),i||y)}},n[6],()=>!d(t)&&t in w?w[t]:!d(t)&&e.get(t)||y]};let P=!0;const[C,O]=b&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[c,c],U={isOnline:()=>P,isVisible:()=>{const e=S&&document.visibilityState;return d(e)||"hidden"!==e}},A={initFocus:e=>(S&&document.addEventListener("visibilitychange",e),C("focus",e),()=>{S&&document.removeEventListener("visibilitychange",e),O("focus",e)}),initReconnect:e=>{const t=()=>{P=!0,e()},n=()=>{P=!1};return C("online",t),C("offline",n),()=>{O("online",t),O("offline",n)}}},E=!a.useId,I=!b||"Deno"in window,R=e=>b&&typeof window.requestAnimationFrame!=_?window.requestAnimationFrame(e):setTimeout(e,1),x=I?a.useEffect:a.useLayoutEffect,T="undefined"!=typeof navigator&&navigator.connection,M=!I&&T&&(["slow-2g","2g"].includes(T.effectiveType)||T.saveData),z=e=>{if(h(e))try{e=e()}catch(n){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?g(e):"",t]};let N=0;const $=()=>++N;async function L(...e){const[t,n,r,i]=e,s=f({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let a=s.populateCache;const o=s.rollbackOnError;let c=s.optimisticData;const u=s.throwOnError;if(h(n)){const e=n,r=[],i=t.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&e(t.get(n)._k)&&r.push(n);return Promise.all(r.map(p))}return p(n);async function p(n){const[i]=z(n);if(!i)return;const[f,p]=k(t,i),[m,g,y,w]=v.get(t),_=()=>{const e=m[i];return(h(s.revalidate)?s.revalidate(f().data,n):!1!==s.revalidate)&&(delete y[i],delete w[i],e&&e[0])?e[0](2).then((()=>f().data)):f().data};if(e.length<3)return _();let b,S=r;const P=$();g[i]=[P,0];const C=!d(c),O=f(),U=O.data,A=O._c,E=d(A)?U:A;if(C&&(c=h(c)?c(E,U):c,p({data:c,_c:E})),h(S))try{S=S(E)}catch(I){b=I}if(S&&h(S.then)){if(S=await S.catch((e=>{b=e})),P!==g[i][0]){if(b)throw b;return S}b&&C&&(e=>"function"==typeof o?o(e):!1!==o)(b)&&(a=!0,p({data:E,_c:l}))}if(a&&!b)if(h(a)){const e=a(S,E);p({data:e,error:l,_c:l})}else p({data:S,error:l,_c:l});if(g[i][1]=$(),Promise.resolve(_()).then((()=>{p({_c:l})})),!b)return S;if(u)throw b}}const F=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},W=(e,t)=>{if(!v.has(e)){const n=f(A,t),r={},i=L.bind(l,e);let s=c;const a={},o=(e,t)=>{const n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},u=(t,n,r)=>{e.set(t,n);const i=a[t];if(i)for(const e of i)e(n,r)},d=()=>{if(!v.has(e)&&(v.set(e,[r,{},{},{},i,u,o]),!I)){const t=n.initFocus(setTimeout.bind(l,F.bind(l,r,0))),i=n.initReconnect(setTimeout.bind(l,F.bind(l,r,1)));s=()=>{t&&t(),i&&i(),v.delete(e)}}};return d(),[e,i,d,s]}return[e,v.get(e)[4]]},[D,j]=W(new Map),V=f({onLoadingSlow:c,onSuccess:c,onError:c,onErrorRetry:(e,t,n,r,i)=>{const s=n.errorRetryCount,a=i.retryCount,o=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!d(s)&&a>s||setTimeout(r,o,i)},onDiscarded:c,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:M?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:M?5e3:3e3,compare:(e,t)=>g(e)==g(t),isPaused:()=>!1,cache:D,mutate:j,fallback:{}},U),K=(e,t)=>{const n=f(e,t);if(t){const{use:r,fallback:i}=e,{use:s,fallback:a}=t;r&&s&&(n.use=r.concat(s)),i&&a&&(n.fallback=f(i,a))}return n},J=(0,a.createContext)({}),q=e=>{const{value:t}=e,n=(0,a.useContext)(J),r=h(t),i=(0,a.useMemo)((()=>r?t(n):t),[r,n,t]),s=(0,a.useMemo)((()=>r?i:K(n,i)),[r,n,i]),o=i&&i.provider,c=(0,a.useRef)(l);o&&!c.current&&(c.current=W(o(s.cache||D),i));const u=c.current;return u&&(s.cache=u[0],s.mutate=u[1]),x((()=>{if(u)return u[2]&&u[2](),u[3]}),[]),(0,a.createElement)(J.Provider,f(e,{value:s}))},B="$inf$",Y=b&&window.__SWR_DEVTOOLS_USE__,G=Y?window.__SWR_DEVTOOLS_USE__:[],H=e=>h(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],Z=()=>f(V,(0,a.useContext)(J)),Q=(e,t)=>{const[n,r]=z(e),[,,,i]=v.get(D);if(i[n])return i[n];const s=t(r);return i[n]=s,s},X=G.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const[r]=z(t),[,,,i]=v.get(D);if(r.startsWith(B))return n(...e);const s=i[r];return d(s)?n(...e):(delete i[r],s)}),r))),ee=e=>function(...t){const n=Z(),[r,i,s]=H(t),a=K(n,s);let o=e;const{use:c}=a,l=(c||[]).concat(X);for(let e=l.length;e--;)o=l[e](o);return o(r,i||a.fetcher||null,a)},te=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}};Y&&(window.__SWR_DEVTOOLS_REACT__=a);const ne=e=>z(e)[0],re=a.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})),e)}),ie={dedupe:!0},se=u.defineProperty(q,"defaultValue",{value:V}),ae=ee(((e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:c,revalidateOnMount:u,revalidateIfStale:p,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:y,keepPreviousData:w}=n,[_,b,S,P]=v.get(r),[C,O]=z(e),U=(0,a.useRef)(!1),A=(0,a.useRef)(!1),T=(0,a.useRef)(C),M=(0,a.useRef)(t),N=(0,a.useRef)(n),F=()=>N.current,W=()=>F().isVisible()&&F().isOnline(),[D,j,V,K]=k(r,C),J=(0,a.useRef)({}).current,q=d(c)?n.fallback[C]:c,B=(e,t)=>{for(const n in J){const r=n;if("data"===r){if(!i(e[r],t[r])){if(!d(e[r]))return!1;if(!i(se,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},Y=(0,a.useMemo)((()=>{const e=!!C&&!!t&&(d(u)?!F().isPaused()&&!s&&(!!d(p)||p):u),n=t=>{const n=f(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=D(),i=K(),a=n(r),o=r===i?a:n(i);let c=a;return[()=>{const e=n(D());return B(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>o]}),[r,C]),G=(0,o.useSyncExternalStore)((0,a.useCallback)((e=>V(C,((t,n)=>{B(n,t)||e()}))),[r,C]),Y[0],Y[1]),H=!U.current,Z=_[C]&&_[C].length>0,Q=G.data,X=d(Q)?q:Q,ee=G.error,ne=(0,a.useRef)(X),se=w?d(Q)?ne.current:Q:X,ae=!(Z&&!d(ee))&&(H&&!d(u)?u:!F().isPaused()&&(s?!d(X)&&p:d(X)||p)),oe=!!(C&&t&&H&&ae),ce=d(G.isValidating)?oe:G.isValidating,le=d(G.isLoading)?oe:G.isLoading,ue=(0,a.useCallback)((async e=>{const t=M.current;if(!C||!t||A.current||F().isPaused())return!1;let r,s,a=!0;const o=e||{},c=!S[C]||!o.dedupe,u=()=>E?!A.current&&C===T.current&&U.current:C===T.current,f={isValidating:!1,isLoading:!1},p=()=>{j(f)},m=()=>{const e=S[C];e&&e[1]===s&&delete S[C]},g={isValidating:!0};d(D().data)&&(g.isLoading=!0);try{if(c&&(j(g),n.loadingTimeout&&d(D().data)&&setTimeout((()=>{a&&u()&&F().onLoadingSlow(C,n)}),n.loadingTimeout),S[C]=[t(O),$()]),[r,s]=S[C],r=await r,c&&setTimeout(m,n.dedupingInterval),!S[C]||S[C][1]!==s)return c&&u()&&F().onDiscarded(C),!1;f.error=l;const e=b[C];if(!d(e)&&(s<=e[0]||s<=e[1]||0===e[1]))return p(),c&&u()&&F().onDiscarded(C),!1;const o=D().data;f.data=i(o,r)?o:r,c&&u()&&F().onSuccess(r,C,n)}catch(v){m();const e=F(),{shouldRetryOnError:t}=e;e.isPaused()||(f.error=v,c&&u()&&(e.onError(v,C,e),(!0===t||h(t)&&t(v))&&(F().revalidateOnFocus&&F().revalidateOnReconnect&&!W()||e.onErrorRetry(v,C,e,(e=>{const t=_[C];t&&t[0]&&t[0](3,e)}),{retryCount:(o.retryCount||0)+1,dedupe:!0}))))}return a=!1,p(),!0}),[C,r]),de=(0,a.useCallback)(((...e)=>L(r,T.current,...e)),[]);if(x((()=>{M.current=t,N.current=n,d(Q)||(ne.current=Q)})),x((()=>{if(!C)return;const e=ue.bind(l,ie);let t=0;const n=te(C,_,((n,r={})=>{if(0==n){const n=Date.now();F().revalidateOnFocus&&n>t&&W()&&(t=n+F().focusThrottleInterval,e())}else if(1==n)F().revalidateOnReconnect&&W()&&e();else{if(2==n)return ue();if(3==n)return ue(r)}}));return A.current=!1,T.current=C,U.current=!0,j({_k:O}),ae&&(d(X)||I?e():R(e)),()=>{A.current=!0,n()}}),[C]),x((()=>{let e;function t(){const t=h(m)?m(D().data):m;t&&-1!==e&&(e=setTimeout(n,t))}function n(){D().error||!g&&!F().isVisible()||!y&&!F().isOnline()?t():ue(ie).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[m,g,y,C]),(0,a.useDebugValue)(se),s&&d(X)&&C){if(!E&&I)throw new Error("Fallback data is required when using suspense in SSR.");M.current=t,N.current=n,A.current=!1;const e=P[C];if(!d(e)){const t=de(e);re(t)}if(!d(ee))throw ee;{const e=ue(ie);d(se)||(e.status="fulfilled",e.value=!0),re(e)}}return{mutate:de,get data(){return J.data=!0,se},get error(){return J.error=!0,ee},get isValidating(){return J.isValidating=!0,ce},get isLoading(){return J.isLoading=!0,le}}})),oe=a.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})),e)}),ce={dedupe:!0};u.defineProperty(q,"defaultValue",{value:V});const le=ee(((e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:c,revalidateOnMount:u,revalidateIfStale:p,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:y,keepPreviousData:w}=n,[_,b,S,P]=v.get(r),[C,O]=z(e),U=(0,a.useRef)(!1),A=(0,a.useRef)(!1),T=(0,a.useRef)(C),M=(0,a.useRef)(t),N=(0,a.useRef)(n),F=()=>N.current,W=()=>F().isVisible()&&F().isOnline(),[D,j,V,K]=k(r,C),J=(0,a.useRef)({}).current,q=d(c)?n.fallback[C]:c,B=(e,t)=>{for(const n in J){const r=n;if("data"===r){if(!i(e[r],t[r])){if(!d(e[r]))return!1;if(!i(re,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},Y=(0,a.useMemo)((()=>{const e=!!C&&!!t&&(d(u)?!F().isPaused()&&!s&&(!!d(p)||p):u),n=t=>{const n=f(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=D(),i=K(),a=n(r),o=r===i?a:n(i);let c=a;return[()=>{const e=n(D());return B(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>o]}),[r,C]),G=(0,o.useSyncExternalStore)((0,a.useCallback)((e=>V(C,((t,n)=>{B(n,t)||e()}))),[r,C]),Y[0],Y[1]),H=!U.current,Z=_[C]&&_[C].length>0,Q=G.data,X=d(Q)?q:Q,ee=G.error,ne=(0,a.useRef)(X),re=w?d(Q)?ne.current:Q:X,ie=!(Z&&!d(ee))&&(H&&!d(u)?u:!F().isPaused()&&(s?!d(X)&&p:d(X)||p)),se=!!(C&&t&&H&&ie),ae=d(G.isValidating)?se:G.isValidating,le=d(G.isLoading)?se:G.isLoading,ue=(0,a.useCallback)((async e=>{const t=M.current;if(!C||!t||A.current||F().isPaused())return!1;let r,s,a=!0;const o=e||{},c=!S[C]||!o.dedupe,u=()=>E?!A.current&&C===T.current&&U.current:C===T.current,f={isValidating:!1,isLoading:!1},p=()=>{j(f)},m=()=>{const e=S[C];e&&e[1]===s&&delete S[C]},g={isValidating:!0};d(D().data)&&(g.isLoading=!0);try{if(c&&(j(g),n.loadingTimeout&&d(D().data)&&setTimeout((()=>{a&&u()&&F().onLoadingSlow(C,n)}),n.loadingTimeout),S[C]=[t(O),$()]),[r,s]=S[C],r=await r,c&&setTimeout(m,n.dedupingInterval),!S[C]||S[C][1]!==s)return c&&u()&&F().onDiscarded(C),!1;f.error=l;const e=b[C];if(!d(e)&&(s<=e[0]||s<=e[1]||0===e[1]))return p(),c&&u()&&F().onDiscarded(C),!1;const o=D().data;f.data=i(o,r)?o:r,c&&u()&&F().onSuccess(r,C,n)}catch(v){m();const e=F(),{shouldRetryOnError:t}=e;e.isPaused()||(f.error=v,c&&u()&&(e.onError(v,C,e),(!0===t||h(t)&&t(v))&&(F().revalidateOnFocus&&F().revalidateOnReconnect&&!W()||e.onErrorRetry(v,C,e,(e=>{const t=_[C];t&&t[0]&&t[0](3,e)}),{retryCount:(o.retryCount||0)+1,dedupe:!0}))))}return a=!1,p(),!0}),[C,r]),de=(0,a.useCallback)(((...e)=>L(r,T.current,...e)),[]);if(x((()=>{M.current=t,N.current=n,d(Q)||(ne.current=Q)})),x((()=>{if(!C)return;const e=ue.bind(l,ce);let t=0;const n=te(C,_,((n,r={})=>{if(0==n){const n=Date.now();F().revalidateOnFocus&&n>t&&W()&&(t=n+F().focusThrottleInterval,e())}else if(1==n)F().revalidateOnReconnect&&W()&&e();else{if(2==n)return ue();if(3==n)return ue(r)}}));return A.current=!1,T.current=C,U.current=!0,j({_k:O}),ie&&(d(X)||I?e():R(e)),()=>{A.current=!0,n()}}),[C]),x((()=>{let e;function t(){const t=h(m)?m(D().data):m;t&&-1!==e&&(e=setTimeout(n,t))}function n(){D().error||!g&&!F().isVisible()||!y&&!F().isOnline()?t():ue(ce).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[m,g,y,C]),(0,a.useDebugValue)(re),s&&d(X)&&C){if(!E&&I)throw new Error("Fallback data is required when using suspense in SSR.");M.current=t,N.current=n,A.current=!1;const e=P[C];if(!d(e)){const t=de(e);oe(t)}if(!d(ee))throw ee;{const e=ue(ce);d(re)||(e.status="fulfilled",e.value=!0),oe(e)}}return{mutate:de,get data(){return J.data=!0,re},get error(){return J.error=!0,ee},get isValidating(){return J.isValidating=!0,ae},get isLoading(){return J.isLoading=!0,le}}})),ue=Promise.resolve(),de=((e,t)=>(...n)=>{const[r,i,s]=H(n),a=(s.use||[]).concat(t);return e(r,i,{...s,use:a})})(le,(e=>(t,n,r)=>{const i=(0,a.useRef)(!1),{cache:s,initialSize:c=1,revalidateAll:u=!1,persistSize:f=!1,revalidateFirstPage:p=!0,revalidateOnMount:m=!1,parallel:g=!1}=r,[,,,y]=v.get(D);let w;try{w=(e=>z(e?e(0,null):null)[0])(t),w&&(w=B+w)}catch(R){}const[_,b,S]=k(s,w),P=(0,a.useCallback)((()=>d(_()._l)?c:_()._l),[s,w,c]);(0,o.useSyncExternalStore)((0,a.useCallback)((e=>w?S(w,(()=>{e()})):()=>{}),[s,w]),P,P);const C=(0,a.useCallback)((()=>{const e=_()._l;return d(e)?c:e}),[w,c]),O=(0,a.useRef)(C());x((()=>{i.current?w&&b({_l:f?O.current:C()}):i.current=!0}),[w,s]);const U=m&&!i.current,A=e(w,(async e=>{const i=_()._i,a=_()._r;b({_r:l});const o=[],c=C(),[h]=k(s,e),f=h().data,m=[];let v=null;for(let l=0;l<c;++l){const[e,c]=z(t(l,g?null:v));if(!e)break;const[h,w]=k(s,e);let _=h().data;const b=u||i||d(_)||p&&!l&&!d(f)||U||f&&!d(f[l])&&!r.compare(f[l],_);if(n&&("function"==typeof a?a(_,c):b)){const t=async()=>{if(e in y){const t=y[e];delete y[e],_=await t}else _=await n(c);w({data:_,_k:c}),o[l]=_};g?m.push(t):await t()}else o[l]=_;g||(v=_)}return g&&await Promise.all(m.map((e=>e()))),b({_i:l}),o}),r),E=(0,a.useCallback)((function(e,t){const n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return w?(r&&(d(e)?b({_i:!0,_r:n.revalidate}):b({_i:!1,_r:n.revalidate})),arguments.length?A.mutate(e,{...n,revalidate:r}):A.mutate()):ue}),[w,s]),I=(0,a.useCallback)((e=>{if(!w)return ue;const[,n]=k(s,w);let r;if(h(e)?r=e(C()):"number"==typeof e&&(r=e),"number"!=typeof r)return ue;n({_l:r}),O.current=r;const i=[],[a]=k(s,w);let o=null;for(let c=0;c<r;++c){const[e]=z(t(c,o)),[n]=k(s,e),r=e?n().data:l;if(d(r))return E(a().data);i.push(r),o=r}return E(i)}),[w,s,E,C]);return{size:C(),setSize:I,mutate:E,get data(){return A.data},get error(){return A.error},get isValidating(){return A.isValidating},get isLoading(){return A.isLoading}}}));function he(e,t){if(!e)throw"string"==typeof t?new Error(t):new Error(`${t.displayName} not found`)}var fe=(e,t)=>{const{assertCtxFn:n=he}=t||{},r=a.createContext(void 0);return r.displayName=e,[r,()=>{const t=a.useContext(r);return n(t,`${e} not found`),t.value},()=>{const e=a.useContext(r);return e?e.value:{}}]},pe={};(0,s.VA)(pe,{SWRConfig:()=>se,useSWR:()=>ae,useSWRInfinite:()=>de}),(0,s.ie)(pe,r);var[me,ge]=fe("ClerkInstanceContext"),[ve,ye]=fe("UserContext"),[we,_e]=fe("ClientContext"),[be,Se]=fe("SessionContext"),ke=a.createContext({});function Pe(){const e=a.useContext(ke);if(void 0===e)throw new Error("useOptions must be used within an OptionsContext");return e}var[Ce,Oe]=fe("OrganizationContext"),Ue=({children:e,organization:t,swrConfig:n})=>a.createElement(se,{value:n},a.createElement(Ce.Provider,{value:{value:{organization:t}}},e));function Ae(e){if(!a.useContext(me)){if("function"==typeof e)return void e();throw new Error(`${e} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`)}}function Ee(e,t){const n=new Set(Object.keys(t)),r={};for(const i of Object.keys(e))n.has(i)||(r[i]=e[i]);return r}var Ie=(e,t)=>{var n,r,i;const s="boolean"==typeof e&&e,o=(0,a.useRef)(s?t.initialPage:null!=(n=null==e?void 0:e.initialPage)?n:t.initialPage),c=(0,a.useRef)(s?t.pageSize:null!=(r=null==e?void 0:e.pageSize)?r:t.pageSize),l={};for(const a of Object.keys(t))l[a]=s?t[a]:null!=(i=null==e?void 0:e[a])?i:t[a];return{...l,initialPage:o.current,pageSize:c.current}},Re={dedupingInterval:6e4,focusThrottleInterval:12e4},xe=(e,t,n,r)=>{var i,s,o,c,l,u,d;const[h,f]=(0,a.useState)(null!=(i=e.initialPage)?i:1),p=(0,a.useRef)(null!=(s=e.initialPage)?s:1),m=(0,a.useRef)(null!=(o=e.pageSize)?o:10),g=null==(c=n.enabled)||c,v=null!=(l=n.infinite)&&l,y=null!=(u=n.keepPreviousData)&&u,w={...r,...e,initialPage:h,pageSize:m.current},{data:_,isValidating:b,isLoading:S,error:k,mutate:P}=ae(!v&&t&&g?w:null,(e=>{const n=Ee(e,r);return null==t?void 0:t(n)}),{keepPreviousData:y,...Re}),{data:C,isLoading:O,isValidating:U,error:A,size:E,setSize:I,mutate:R}=de((t=>v&&g?{...e,...r,initialPage:p.current+t,pageSize:m.current}:null),(e=>{const n=Ee(e,r);return null==t?void 0:t(n)}),Re),x=(0,a.useMemo)((()=>v?E:h),[v,E,h]),T=(0,a.useCallback)((e=>{if(!v)return f(e);I(e)}),[I]),M=(0,a.useMemo)((()=>{var e,t;return v?null!=(e=null==C?void 0:C.map((e=>null==e?void 0:e.data)).flat())?e:[]:null!=(t=null==_?void 0:_.data)?t:[]}),[v,_,C]),z=(0,a.useMemo)((()=>{var e,t;return v?(null==(e=null==C?void 0:C[(null==C?void 0:C.length)-1])?void 0:e.total_count)||0:null!=(t=null==_?void 0:_.total_count)?t:0}),[v,_,C]),N=v?O:S,$=v?U:b,L=null!=(d=v?A:k)?d:null,F=!!L,W=(0,a.useCallback)((()=>{T((e=>Math.max(0,e+1)))}),[T]),D=(0,a.useCallback)((()=>{T((e=>Math.max(0,e-1)))}),[T]),j=(p.current-1)*m.current,V=Math.ceil((z-j)/m.current),K=z-j*m.current>x*m.current,J=(x-1)*m.current>j*m.current;return{data:M,count:z,error:L,isLoading:N,isFetching:$,isError:F,page:x,pageCount:V,fetchPage:T,fetchNext:W,fetchPrevious:D,hasNextPage:K,hasPreviousPage:J,revalidate:v?()=>R():()=>P(),setData:v?e=>R(e,{revalidate:!1}):e=>P(e,{revalidate:!1})}},Te={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},Me=e=>{var t;const{domains:n,membershipRequests:r,memberships:s,invitations:a}=e||{};Ae("useOrganization");const{organization:o}=Oe(),c=Se(),l=Ie(n,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,enrollmentMode:void 0}),u=Ie(r,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),d=Ie(s,{initialPage:1,pageSize:10,role:void 0,keepPreviousData:!1,infinite:!1}),h=Ie(a,{initialPage:1,pageSize:10,status:["pending"],keepPreviousData:!1,infinite:!1}),f=ge();null==(t=f.telemetry)||t.record(i("useOrganization"));const p=void 0===n?void 0:{initialPage:l.initialPage,pageSize:l.pageSize,enrollmentMode:l.enrollmentMode},m=void 0===r?void 0:{initialPage:u.initialPage,pageSize:u.pageSize,status:u.status},g=void 0===s?void 0:{initialPage:d.initialPage,pageSize:d.pageSize,role:d.role},v=void 0===a?void 0:{initialPage:h.initialPage,pageSize:h.pageSize,status:h.status},y=xe({...p},null==o?void 0:o.getDomains,{keepPreviousData:l.keepPreviousData,infinite:l.infinite,enabled:!!p},{type:"domains",organizationId:null==o?void 0:o.id}),w=xe({...m},null==o?void 0:o.getMembershipRequests,{keepPreviousData:u.keepPreviousData,infinite:u.infinite,enabled:!!m},{type:"membershipRequests",organizationId:null==o?void 0:o.id}),_=xe(g||{},null==o?void 0:o.getMemberships,{keepPreviousData:d.keepPreviousData,infinite:d.infinite,enabled:!!g},{type:"members",organizationId:null==o?void 0:o.id}),b=xe({...v},null==o?void 0:o.getInvitations,{keepPreviousData:h.keepPreviousData,infinite:h.infinite,enabled:!!v},{type:"invitations",organizationId:null==o?void 0:o.id});return void 0===o?{isLoaded:!1,organization:void 0,membership:void 0,domains:Te,membershipRequests:Te,memberships:Te,invitations:Te}:null===o?{isLoaded:!0,organization:null,membership:null,domains:null,membershipRequests:null,memberships:null,invitations:null}:!f.loaded&&o?{isLoaded:!0,organization:o,membership:void 0,domains:Te,membershipRequests:Te,memberships:Te,invitations:Te}:{isLoaded:f.loaded,organization:o,membership:(S=c.user.organizationMemberships,k=o.id,S.find((e=>e.organization.id===k))),domains:y,membershipRequests:w,memberships:_,invitations:b};var S,k},ze={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},Ne=e=>{var t;const{userMemberships:n,userInvitations:r,userSuggestions:s}=e||{};Ae("useOrganizationList");const a=Ie(n,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1}),o=Ie(r,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),c=Ie(s,{initialPage:1,pageSize:10,status:"pending",keepPreviousData:!1,infinite:!1}),l=ge(),u=ye();null==(t=l.telemetry)||t.record(i("useOrganizationList"));const d=void 0===n?void 0:{initialPage:a.initialPage,pageSize:a.pageSize},h=void 0===r?void 0:{initialPage:o.initialPage,pageSize:o.pageSize,status:o.status},f=void 0===s?void 0:{initialPage:c.initialPage,pageSize:c.pageSize,status:c.status},p=!(!l.loaded||!u),m=xe(d||{},null==u?void 0:u.getOrganizationMemberships,{keepPreviousData:a.keepPreviousData,infinite:a.infinite,enabled:!!d},{type:"userMemberships",userId:null==u?void 0:u.id}),g=xe({...h},null==u?void 0:u.getOrganizationInvitations,{keepPreviousData:o.keepPreviousData,infinite:o.infinite,enabled:!!h},{type:"userInvitations",userId:null==u?void 0:u.id}),v=xe({...f},null==u?void 0:u.getOrganizationSuggestions,{keepPreviousData:c.keepPreviousData,infinite:c.infinite,enabled:!!f},{type:"userSuggestions",userId:null==u?void 0:u.id});return p?{isLoaded:p,setActive:l.setActive,createOrganization:l.createOrganization,userMemberships:m,userInvitations:g,userSuggestions:v}:{isLoaded:!1,createOrganization:void 0,setActive:void 0,userMemberships:ze,userInvitations:ze,userSuggestions:ze}},$e="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,Le=()=>{Ae("useSession");const e=Se();return void 0===e?{isLoaded:!1,isSignedIn:void 0,session:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,session:null}:{isLoaded:!0,isSignedIn:!0,session:e}},Fe=()=>{Ae("useSessionList");const e=ge(),t=_e();return t?{isLoaded:!0,sessions:t.sessions,setActive:e.setActive}:{isLoaded:!1,sessions:void 0,setActive:void 0}};function We(){Ae("useUser");const e=ye();return void 0===e?{isLoaded:!1,isSignedIn:void 0,user:void 0}:null===e?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:e}}var De=()=>(Ae("useClerk"),ge()),je=Object.prototype.hasOwnProperty;function Ve(e,t,n){for(n of e.keys())if(Ke(n,t))return n}function Ke(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ke(e[r],t[r]););return-1===r}if(n===Set){if(e.size!==t.size)return!1;for(r of e){if((i=r)&&"object"==typeof i&&!(i=Ve(t,i)))return!1;if(!t.has(i))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e){if((i=r[0])&&"object"==typeof i&&!(i=Ve(t,i)))return!1;if(!Ke(r[1],t.get(i)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return-1===r}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return-1===r}if(!n||"object"==typeof e){for(n in r=0,e){if(je.call(e,n)&&++r&&!je.call(t,n))return!1;if(!(n in t)||!Ke(e[n],t[n]))return!1}return Object.keys(t).length===r}}return e!=e&&t!=t}var Je=(e,t)=>a.useMemo(e,(e=>{const t=a.useRef(e);return Ke(e,t.current)||(t.current=e),a.useMemo((()=>t.current),[t.current])})(t))},4648:function(e,t,n){"use strict";n.d(t,{Ph:function(){return E},RR:function(){return O},we:function(){return I}});var r,i,s,a,o,c,l=n(295),u=n(311),d=n(3781),h=class{constructor(){(0,d.VK)(this,s),(0,d.VK)(this,r,"clerk_telemetry_throttler"),(0,d.VK)(this,i,864e5)}isEventThrottled(e){var t;if(!(0,d.S7)(this,s,c))return!1;const n=Date.now(),l=(0,d.jq)(this,s,a).call(this,e),u=null==(t=(0,d.S7)(this,s,o))?void 0:t[l];if(!u){const e={...(0,d.S7)(this,s,o),[l]:n};localStorage.setItem((0,d.S7)(this,r),JSON.stringify(e))}if(u&&n-u>(0,d.S7)(this,i)){const e=(0,d.S7)(this,s,o);delete e[l],localStorage.setItem((0,d.S7)(this,r),JSON.stringify(e))}return!!u}};r=new WeakMap,i=new WeakMap,s=new WeakSet,a=function(e){const{sk:t,pk:n,payload:r,...i}=e,s={...r,...i};return JSON.stringify(Object.keys({...r,...i}).sort().map((e=>s[e])))},o=function(){const e=localStorage.getItem((0,d.S7)(this,r));return e?JSON.parse(e):{}},c=function(){if("undefined"==typeof window)return!1;const e=window.localStorage;if(!e)return!1;try{const t="test";return e.setItem(t,t),e.removeItem(t),!0}catch(t){return t instanceof DOMException&&("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&e.length>0&&e.removeItem((0,d.S7)(this,r)),!1}};var f,p,m,g,v,y,w,_,b,S,k,P,C,O=class{constructor(e){var t,n,r,i,s,a;(0,d.VK)(this,y),(0,d.VK)(this,f),(0,d.VK)(this,p),(0,d.VK)(this,m,{}),(0,d.VK)(this,g,[]),(0,d.VK)(this,v),(0,d.OV)(this,f,{maxBufferSize:null!=(t=e.maxBufferSize)?t:5,samplingRate:null!=(n=e.samplingRate)?n:1,disabled:null!=(r=e.disabled)&&r,debug:null!=(i=e.debug)&&i,endpoint:"https://clerk-telemetry.com"}),e.clerkVersion||"undefined"!=typeof window?(0,d.S7)(this,m).clerkVersion=null!=(s=e.clerkVersion)?s:"":(0,d.S7)(this,m).clerkVersion="",(0,d.S7)(this,m).sdk=e.sdk,(0,d.S7)(this,m).sdkVersion=e.sdkVersion,(0,d.S7)(this,m).publishableKey=null!=(a=e.publishableKey)?a:"";const o=(0,u.q5)(e.publishableKey);o&&((0,d.S7)(this,m).instanceType=o.instanceType),e.secretKey&&((0,d.S7)(this,m).secretKey=e.secretKey.substring(0,16)),(0,d.OV)(this,p,new h)}get isEnabled(){var e;return!("development"!==(0,d.S7)(this,m).instanceType||(0,d.S7)(this,f).disabled||"undefined"!=typeof process&&(0,l.zz)(process.env.CLERK_TELEMETRY_DISABLED)||"undefined"!=typeof window&&(null==(e=null==window?void 0:window.navigator)?void 0:e.webdriver))}get isDebug(){return(0,d.S7)(this,f).debug||"undefined"!=typeof process&&(0,l.zz)(process.env.CLERK_TELEMETRY_DEBUG)}record(e){const t=(0,d.jq)(this,y,C).call(this,e.event,e.payload);(0,d.jq)(this,y,k).call(this,t.event,t),(0,d.jq)(this,y,w).call(this,t,e.eventSamplingRate)&&((0,d.S7)(this,g).push(t),(0,d.jq)(this,y,b).call(this))}};f=new WeakMap,p=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakSet,w=function(e,t){return this.isEnabled&&!this.isDebug&&(0,d.jq)(this,y,_).call(this,e,t)},_=function(e,t){const n=Math.random();return!(0,d.S7)(this,p).isEventThrottled(e)&&n<=(0,d.S7)(this,f).samplingRate&&(void 0===t||n<=t)},b=function(){"undefined"!=typeof window?(0,d.S7)(this,g).length>=(0,d.S7)(this,f).maxBufferSize?((0,d.S7)(this,v)&&("undefined"!=typeof cancelIdleCallback?cancelIdleCallback:clearTimeout)((0,d.S7)(this,v)),(0,d.jq)(this,y,S).call(this)):(0,d.S7)(this,v)||("requestIdleCallback"in window?(0,d.OV)(this,v,requestIdleCallback((()=>{(0,d.jq)(this,y,S).call(this)}))):(0,d.OV)(this,v,setTimeout((()=>{(0,d.jq)(this,y,S).call(this)}),0))):(0,d.jq)(this,y,S).call(this)},S=function(){fetch(new URL("/v1/event",(0,d.S7)(this,f).endpoint),{method:"POST",body:JSON.stringify({events:(0,d.S7)(this,g)}),headers:{"Content-Type":"application/json"}}).catch((()=>{})).then((()=>{(0,d.OV)(this,g,[])})).catch((()=>{}))},k=function(e,t){this.isDebug&&(void 0!==console.groupCollapsed?(console.groupCollapsed("[clerk/telemetry]",e),console.log(t),console.groupEnd()):console.log("[clerk/telemetry]",e,t))},P=function(){let e={name:(0,d.S7)(this,m).sdk,version:(0,d.S7)(this,m).sdkVersion};return"undefined"!=typeof window&&window.Clerk&&(e={...e,...window.Clerk.constructor.sdkMetadata}),e},C=function(e,t){var n,r;const i=(0,d.jq)(this,y,P).call(this);return{event:e,cv:null!=(n=(0,d.S7)(this,m).clerkVersion)?n:"",it:null!=(r=(0,d.S7)(this,m).instanceType)?r:"",sdk:i.name,sdkv:i.version,...(0,d.S7)(this,m).publishableKey?{pk:(0,d.S7)(this,m).publishableKey}:{},...(0,d.S7)(this,m).secretKey?{sk:(0,d.S7)(this,m).secretKey}:{},payload:t}};var U="COMPONENT_MOUNTED",A=.1;function E(e,t){var n,r,i;return{event:U,eventSamplingRate:A,payload:{component:e,appearanceProp:Boolean(null==t?void 0:t.appearance),baseTheme:Boolean(null==(n=null==t?void 0:t.appearance)?void 0:n.baseTheme),elements:Boolean(null==(r=null==t?void 0:t.appearance)?void 0:r.elements),variables:Boolean(null==(i=null==t?void 0:t.appearance)?void 0:i.variables)}}}function I(e,t={}){return{event:U,eventSamplingRate:A,payload:{component:e,...t}}}},4219:function(e,t,n){"use strict";n.d(t,{C8:function(){return r.C8},sF:function(){return r.sF}});var r=n(295);n(3781)},7966:function(e,t,n){"use strict";n.d(t,{Ab:function(){return r.Ab},oq:function(){return r.oq},sB:function(){return r.sB}});var r=n(6517);n(3781)},2201:function(e,t,n){"use strict";n.d(t,{BT:function(){return a},Bz:function(){return i},nn:function(){return s}});var r=n(7736);function i(){return(0,r.F7)()&&"function"==typeof window.PublicKeyCredential}async function s(){try{return i()&&await window.PublicKeyCredential.isConditionalMediationAvailable()}catch(e){return!1}}async function a(){try{return"undefined"!=typeof window&&await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()}catch(e){return!1}}n(3781)}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return i[e].call(n.exports,n,n.exports,a),n.exports}return a.m=i,a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);a.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var o=2&r&&n;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((function(e){s[e]=function(){return n[e]}}));return s.default=function(){return n},a.d(i,s),i},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,n){return a.f[n](e,t),t}),[]))},a.u=function(e){return({45:"userprofile",65:"ui-common",96:"vendors",128:"zxcvbn-common",136:"onetap",193:"common-new",267:"prefetchorganizationlist",278:"userbutton",293:"rebuild--sign-up",417:"signin",520:"coinbase-wallet-sdk",578:"organizationlist",592:"zxcvbn-ts-core",593:"framework",671:"userverification",703:"organizationswitcher",787:"signup",796:"impersonationfab",837:"organizationprofile",839:"rebuild--sign-in",862:"createorganization",950:"cookieSuffix"}[e]||e)+"_"+a.h().slice(0,6)+"_5.29.1.js"},a.h=function(){return"f35a0f6cb62d32bbd61d"},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n={},r="@clerk/clerk-js:",a.l=function(e,t,i,s){if(n[e])n[e].push(t);else{var o,c;if(void 0!==i)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+i){o=d;break}}o||(c=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,a.nc&&o.setAttribute("nonce",a.nc),o.setAttribute("data-webpack",r+i),o.src=e),n[e]=[t];var h=function(t,r){o.onerror=o.onload=null,clearTimeout(f);var i=n[e];if(delete n[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach((function(e){return e(r)})),t)return t(r)},f=setTimeout(h.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=h.bind(null,o.onerror),o.onload=h.bind(null,o.onload),c&&document.head.appendChild(o)}},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e}(),function(){var e={468:0};a.f.j=function(t,n){var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise((function(n,i){r=e[t]=[n,i]}));n.push(r[2]=i);var s=a.p+a.u(t),o=new Error;a.l(s,(function(n){if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",o.name="ChunkLoadError",o.type=i,o.request=s,r[1](o)}}),"chunk-"+t,t)}};var t=function(t,n){var r,i,s=n[0],o=n[1],c=n[2],l=0;if(s.some((function(t){return 0!==e[t]}))){for(r in o)a.o(o,r)&&(a.m[r]=o[r]);c&&c(a)}for(t&&t(n);l<s.length;l++)i=s[l],a.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),a.nc=void 0,function(){"use strict";{const e=/(^.*\/@clerk\/clerk-js@)(.+?)(\/dist.*)/;(()=>{try{const t=new URL(document.currentScript.src);let n=new URL(t.href.split("/").slice(0,-1).join("/")).href;n+=n.endsWith("/")?"":"/",a.p=n.replace(e,"$15.29.1$3")}catch(t){}})()}a(8989);var e,t,n=a(8174),r=a(6915),i=a(4648),s=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},o=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};class c{constructor({router:n,clerk:r,options:i}){this.componentRegistry=new Map,e.set(this,void 0),t.set(this,void 0),this.router=n,this.clerk=r,this.options=i,this.register("SignIn",{type:"component",load:()=>Promise.all([a.e(593),a.e(193),a.e(839)]).then(a.bind(a,9872)).then((({SignIn:e})=>({default:e})))}),this.register("SignUp",{type:"component",load:()=>Promise.all([a.e(593),a.e(193),a.e(293)]).then(a.bind(a,3124)).then((({SignUp:e})=>({default:e})))})}mount(e,n,r){const i=this.componentRegistry.get(e);if(!i)throw new Error(`clerk/ui: Unable to find component definition for ${e}`);i.load(),this.renderer().then((()=>{var e;null===(e=s(this,t,"f"))||void 0===e||e.mount(s(this,t,"f").createElementFromComponentDefinition(i),r,n)})).catch((t=>{console.error(`clerk/ui: Error mounting component ${e}:`,t)}))}unmount(e){var n;null===(n=s(this,t,"f"))||void 0===n||n.unmount(e)}register(e,t){this.componentRegistry.set(e,t)}renderer(){return s(this,e,"f")||(o(this,e,(0,n.ph)(),"f"),Promise.all([a.e(593),a.e(65),a.e(429)]).then(a.bind(a,8886)).then((({init:n,wrapperInit:r})=>{var i;!function(e){if(!e)throw new Error('Clerk: Attempted to use functionality that requires the "router" option to be provided to Clerk.')}(this.router),o(this,t,n({wrapper:r({clerk:this.clerk,options:this.options,router:this.router})}),"f"),null===(i=s(this,e,"f"))||void 0===i||i.resolve()}))),s(this,e,"f").promise}}e=new WeakMap,t=new WeakMap;var l=a(4870),u=a(5504),d=a(4934);function h(e,t){return function(e,t){if(!e&&t||e&&!t)return!0;if(!e&&e===t)return!1;if(!e||!t)return!0;try{if(d.Kj.isClientResource(e))return function(e,t){return e.id!==t.id||e.updatedAt.getTime()<t.updatedAt.getTime()||e.sessions.length!==t.sessions.length}(e,t);if(d.Nn.isSessionResource(e))return function(e,t){return e.id!==t.id||e.updatedAt.getTime()<t.updatedAt.getTime()||function(e,t){const n=e.__experimental_factorVerificationAge,r=t.__experimental_factorVerificationAge;return null!==n&&null!==r?n[0]!==r[0]||n[1]!==r[1]:n!==r}(e,t)||function(e,t){var n,r,i,s,a,o;if(e.lastActiveOrganizationId!==t.lastActiveOrganizationId)return!0;const c=null===(r=null===(n=e.user)||void 0===n?void 0:n.organizationMemberships)||void 0===r?void 0:r.find((t=>t.organization.id===e.lastActiveOrganizationId)),l=null===(s=null===(i=t.user)||void 0===i?void 0:i.organizationMemberships)||void 0===s?void 0:s.find((t=>t.organization.id===e.lastActiveOrganizationId));return(null==c?void 0:c.role)!==(null==l?void 0:l.role)||(null===(a=null==c?void 0:c.permissions)||void 0===a?void 0:a.length)!==(null===(o=null==l?void 0:l.permissions)||void 0===o?void 0:o.length)}(e,t)}(e,t);if(d.KJ.isUserResource(e))return function(e,t){return e.id!==t.id||e.updatedAt.getTime()<t.updatedAt.getTime()||function(e,t){var n,r;return e.organizationMemberships.length!==t.organizationMemberships.length||(null===(n=e.organizationMemberships[0])||void 0===n?void 0:n.updatedAt)!==(null===(r=t.organizationMemberships[0])||void 0===r?void 0:r.updatedAt)}(t,e)}(e,t)}catch(n){return!0}return!0}(e,t)?t:e}var f=a(191),p="__clerk_db_jwt";function m(e,t){const n=new URL(e),r=n.searchParams.get(p);n.searchParams.delete(p);const i=r||t;return i&&n.searchParams.set(p,i),n}var g=e=>v(y(e)),v=e=>{const t=new URL(e);return t.searchParams.delete(p),t},y=e=>{const t=new URL(e);return t.searchParams.delete("__dev_session"),t.hash=decodeURI(t.hash).replace(/__clerk_db_jwt\[(.*)\]/,""),t.href.endsWith("#")&&(t.hash=""),t},w=(a(3781),a(9859)),_=a(5882),b=a(2692);function S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var k=function e(t,n){function r(e,r,i){if("undefined"!=typeof document){"number"==typeof(i=S({},n,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in i)i[a]&&(s+="; "+a,!0!==i[a]&&(s+="="+i[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var s=n[i].split("="),a=s.slice(1).join("=");try{var o=decodeURIComponent(s[0]);if(r[o]=t.read(a,o),e===o)break}catch(c){}}return e?r[e]:r}},remove:function(e,t){r(e,"",S({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,S({},this.attributes,t))},withConverter:function(t){return e(S({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function P(e){return{get(){return k.get(e)},set(t,n={}){k.set(e,t,n)},remove(t){k.remove(e,t)}}}var C=a(6392),O=a(8771);let U;const A=P("__clerk_test_etld"),E=e=>"https:"===window.location.protocol||"None"===e&&void 0===window.safari&&(void 0!==window.isSecureContext?window.isSecureContext:"localhost"===window.location.hostname),I="__client_uat",R="__session";function x({cookieSuffix:e,frontendApi:t,fapiClient:n}){const r=(e=>{const t=P(p),n=P((0,O.ky)(p,e));return{get:()=>n.get()||t.get(),set:e=>{const r=(0,C.e7)(Date.now(),1),i=(0,l._U)()?"None":"Lax",s=E(i);n.set(e,{expires:r,sameSite:i,secure:s}),t.set(e,{expires:r,sameSite:i,secure:s})},remove:()=>{n.remove(),t.remove()}}})(e);function i(){return r.get()}function s(e){r.set(e)}function a(){r.remove()}return{clear:function(){a()},setup:async function(){if(!(0,l.DY)(t))return;n.onBeforeRequest((e=>{const t=i();t&&(null==e?void 0:e.url)&&(e.url=m(e.url,t))})),n.onAfterResponse(((e,t)=>{var n;const r=null===(n=null==t?void 0:t.headers)||void 0===n?void 0:n.get("Clerk-Db-Jwt");r&&s(r)}));const e=function(e){const t=(e=>e.searchParams.get(p)||"")(e);return g(e).href!==e.href&&void 0!==globalThis.history&&globalThis.history.replaceState(null,"",g(e)),t}(new URL(window.location.href));if(e)return void s(e);if(r.get())return;const a=n.buildUrl({path:"/dev_browser"}),o=await fetch(a.toString(),{method:"POST"});if(!o.ok){const e=await o.json(),t=(0,w.Rb)(e.errors);t[0]?(0,_.eS)(t[0].longMessage):(0,_.eS)()}const c=await o.json();s(null==c?void 0:c.id)},getDevBrowserJWT:i,setDevBrowserJWT:s,removeDevBrowserJWT:a}}var T=a(3011),M=a.n(T);class z{constructor(){this.lock=function(e){const t=new(M());return window.addEventListener("beforeunload",(async()=>{await t.releaseLock(e)})),{acquireLockAndRun:async n=>{if(await t.acquireLock(e,5e3))try{return await n()}finally{await t.releaseLock(e)}}}}("clerk.lock.refreshSessionToken"),this.workerTimers=(0,n.fx)(),this.timerId=null}startPollingForSessionToken(e){this.timerId||(this.timerId=this.workerTimers.setInterval((()=>{this.lock.acquireLockAndRun(e)}),5e3))}stopPollingForSessionToken(){this.timerId&&(this.workerTimers.clearInterval(this.timerId),this.timerId=null)}}class N{static async create(e,t){const n=await async function(e){let t;try{t=await(0,O.qS)(e)}catch(n){r.v.logOnce(`Suffixed cookie failed due to ${n.message} (secure-context: ${window.isSecureContext}, url: ${window.location.href})`);const{default:i}=await Promise.all([a.e(96),a.e(950)]).then(a.t.bind(a,648,23)),{default:s}=await Promise.all([a.e(96),a.e(950)]).then(a.t.bind(a,4582,23)),o=i(e);t=s.stringify(o).replace(/\+/gi,"-").replace(/\//gi,"_").substring(0,8)}return t}(e.publishableKey);return new N(e,t,n)}constructor(e,t,n){this.clerk=e,this.poller=null,b.B.on(b.A.TokenUpdate,(({token:e})=>{this.updateSessionCookie(e&&e.getRawString()),this.setClientUatCookieForDevelopmentInstances()})),this.refreshTokenOnFocus(),this.startPollingForToken(),this.clientUat=(e=>{const t=P(I),n=P((0,O.ky)(I,e));return{set:e=>{const r=(0,C.e7)(Date.now(),1),i=(0,l._U)()?"None":"Strict",s=E(i),a=function(e=window.location.hostname,t=A){if(U)return U;if(["localhost","127.0.0.1","0.0.0.0"].includes(e))return e;const n=e.split(".");if(1===n.length)return e;for(let r=n.length-2;r>=0;r--){const e=n.slice(r).join(".");if(t.set("1",{domain:e}),"1"===t.get())return t.remove({domain:e}),U=e,e;t.remove({domain:e})}}();let o="0";e&&e.updatedAt&&e.activeSessions.length>0&&(o=Math.floor(e.updatedAt.getTime()/1e3).toString()),n.remove(),t.remove(),n.set(o,{expires:r,sameSite:i,domain:a,secure:s}),t.set(o,{expires:r,sameSite:i,domain:a,secure:s})},get:()=>{const e=n.get()||t.get();return parseInt(e||"0",10)}}})(n),this.sessionCookie=(e=>{const t=P(R),n=P((0,O.ky)(R,e));return{set:e=>{const r=(0,C.e7)(Date.now(),1),i=(0,l._U)()?"None":"Lax",s=E(i);n.set(e,{expires:r,sameSite:i,secure:s}),t.set(e,{expires:r,sameSite:i,secure:s})},remove:()=>{n.remove(),t.remove()}}})(n),this.devBrowser=x({frontendApi:e.frontendApi,fapiClient:t,cookieSuffix:n})}setEnvironment(e){this.environment=e,this.setClientUatCookieForDevelopmentInstances()}isSignedOut(){return this.clerk.loaded?!!this.clerk.user:this.clientUat.get()<=0}async setupDevelopment(){await this.devBrowser.setup()}setupProduction(){this.devBrowser.clear()}async handleUnauthenticatedDevBrowser(){this.devBrowser.clear(),await this.devBrowser.setup()}decorateUrlWithDevBrowserToken(e){const t=this.devBrowser.getDevBrowserJWT();return t?m(e,t):(0,_.IJ)()}startPollingForToken(){this.poller||(this.poller=new z),this.poller.startPollingForSessionToken((()=>this.refreshSessionToken()))}refreshTokenOnFocus(){window.addEventListener("focus",(()=>{"visible"===document.visibilityState&&this.refreshSessionToken({updateCookieImmediately:!0})}))}async refreshSessionToken({updateCookieImmediately:e=!1}={}){if(this.clerk.session)try{const t=await this.clerk.session.getToken();e&&this.updateSessionCookie(t)}catch(t){return this.handleGetTokenError(t)}}updateSessionCookie(e){if(document.hasFocus()||this.isCurrentOrganizationActive())return this.setActiveOrganizationInStorage(),e?this.sessionCookie.set(e):this.sessionCookie.remove()}setClientUatCookieForDevelopmentInstances(){var e;(null===(e=this.environment)||void 0===e?void 0:e.isDevelopmentOrStaging())&&this.inCustomDevelopmentDomain()&&this.clientUat.set(this.clerk.client)}inCustomDevelopmentDomain(){const e=this.clerk.frontendApi.replace("clerk.","");return!window.location.host.endsWith(e)}handleGetTokenError(e){(0,w.$R)(e)||(0,_.a2)(e.message||e),(0,w.nc)(e)?this.clerk.handleUnauthenticated():(0,w.TX)(e)||(0,_.a2)(e.toString())}setActiveOrganizationInStorage(){var e;(null===(e=this.clerk.organization)||void 0===e?void 0:e.id)?localStorage.setItem("clerk_active_org",this.clerk.organization.id):localStorage.removeItem("clerk_active_org")}isCurrentOrganizationActive(){var e,t;const n=localStorage.getItem("clerk_active_org");return!n&&!(null===(e=this.clerk.organization)||void 0===e?void 0:e.id)||(null===(t=this.clerk.organization)||void 0===t?void 0:t.id)===n}}var $,L,F,W,D,j,V,K,J,q,B,Y,G,H,Z,Q,X,ee,te,ne,re,ie,se,ae,oe,ce,le,ue,de,he,fe,pe,me,ge,ve,ye,we,_e,be,Se,ke,Pe=a(6480),Ce=a(600),Oe=a(5864),Ue=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},Ae=function(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n};const Ee={polling:!0,standardBrowser:!0,touchSession:!0,isSatellite:!1,signInUrl:void 0,signUpUrl:void 0,afterSignOutUrl:void 0,signInFallbackRedirectUrl:void 0,signUpFallbackRedirectUrl:void 0,signInForceRedirectUrl:void 0,signUpForceRedirectUrl:void 0};class Ie{get publishableKey(){return Ue(this,L,"f")}get version(){return $.version}set sdkMetadata(e){$.sdkMetadata=e}get sdkMetadata(){return $.sdkMetadata}get loaded(){return Ue(this,q,"f")}get isSatellite(){return!!(0,l.M)()&&(0,n.VK)(Ue(this,Y,"f").isSatellite,new URL(window.location.href),!1)}get domain(){if((0,l.M)()){const e=(0,n.Wl)((0,n.VK)(Ue(this,F,"f"),new URL(window.location.href)));return"production"===Ue(this,J,"f")?(0,n.TV)(e):e}return""}get proxyUrl(){if((0,l.M)()){const e=(0,n.VK)(Ue(this,W,"f"),new URL(window.location.href));return(0,n._c)(e)||l.sb.throwInvalidProxyUrl({url:e}),(0,n.SW)(e)}return""}get frontendApi(){const e=(0,n.q5)(this.publishableKey);return e?e.frontendApi:l.sb.throwInvalidPublishableKeyError({key:this.publishableKey})}get instanceType(){return Ue(this,J,"f")}get isStandardBrowser(){return Ue(this,Y,"f").standardBrowser||!1}constructor(e,t){if(this.internal_last_error=null,L.set(this,""),F.set(this,void 0),W.set(this,void 0),D.set(this,void 0),j.set(this,null),V.set(this,void 0),K.set(this,void 0),J.set(this,void 0),q.set(this,!1),B.set(this,[]),Y.set(this,{}),G.set(this,null),H.set(this,0),this.getFapiClient=()=>Ue(this,K,"f"),this.load=async e=>{this.loaded||("development"===Ue(this,J,"f")&&r.v.warnOnce("Clerk: Clerk has been loaded with development keys. Development instances have strict usage limits and should not be used when deploying your application to production. Learn more: https://clerk.com/docs/deployments/overview"),Ae(this,Y,{...Ee,...e},"f"),(0,u.I)(Ue(this,Y,"f")),Ue(this,Y,"f").sdkMetadata&&($.sdkMetadata=Ue(this,Y,"f").sdkMetadata),!1!==Ue(this,Y,"f").telemetry&&(this.telemetry=new i.RR({clerkVersion:$.version,samplingRate:1,publishableKey:this.publishableKey,...Ue(this,Y,"f").telemetry})),Ue(this,Y,"f").allowedRedirectOrigins=(0,l.Qs)(Ue(this,Y,"f").allowedRedirectOrigins,this.frontendApi),Ue(this,Y,"f").standardBrowser?Ae(this,q,await Ue(this,oe,"f").call(this),"f"):Ae(this,q,await Ue(this,ce,"f").call(this),"f"),this.client&&(this.__experimental_ui=new c({router:Ue(this,Y,"f").__experimental_router,clerk:this,options:Ue(this,Y,"f")})))},this.signOut=async(e,t)=>{var n,r,i;if(!this.client||0===this.client.sessions.length)return;const s=e&&"object"==typeof e?e:t||{},a=(null==s?void 0:s.redirectUrl)||this.buildAfterSignOutUrl(),o="function"==typeof e?e:()=>this.navigate(a);if(!s.sessionId||1===this.client.activeSessions.length)return null===(r=null===(n=Ue(this,Y,"f").experimental)||void 0===n?void 0:n.persistClient)||void 0===r||r?await this.client.removeSessions():await this.client.destroy(),this.setActive({session:null,beforeEmit:(0,l.ez)(o)});const c=this.client.activeSessions.find((e=>e.id===s.sessionId)),u=(null==c?void 0:c.id)&&(null===(i=this.session)||void 0===i?void 0:i.id)===c.id;return await(null==c?void 0:c.remove()),u?this.setActive({session:null,beforeEmit:(0,l.ez)(o)}):void 0},this.openGoogleOneTap=e=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted({preloadHint:"GoogleOneTap"}).then((t=>t.openModal("googleOneTap",e||{})))},this.closeGoogleOneTap=()=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((e=>e.closeModal("googleOneTap")))},this.openSignIn=e=>{if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.QP)(this,this.environment)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotOpenSignInOrSignUp,{code:"cannot_render_single_session_enabled"})}else Ue(this,V,"f").ensureMounted({preloadHint:"SignIn"}).then((t=>t.openModal("signIn",e||{})))},this.closeSignIn=()=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((e=>e.closeModal("signIn")))},this.__experimental_openUserVerification=e=>{if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.vV)(this)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotOpenUserProfile,{code:"cannot_render_user_missing"})}else Ue(this,V,"f").ensureMounted({preloadHint:"UserVerification"}).then((t=>t.openModal("userVerification",e||{})))},this.__experimental_closeUserVerification=()=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((e=>e.closeModal("userVerification")))},this.openSignUp=e=>{if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.QP)(this,this.environment)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotOpenSignInOrSignUp,{code:"cannot_render_single_session_enabled"})}else Ue(this,V,"f").ensureMounted({preloadHint:"SignUp"}).then((t=>t.openModal("signUp",e||{})))},this.closeSignUp=()=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((e=>e.closeModal("signUp")))},this.openUserProfile=e=>{if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.vV)(this)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotOpenUserProfile,{code:"cannot_render_user_missing"})}else Ue(this,V,"f").ensureMounted({preloadHint:"UserProfile"}).then((t=>t.openModal("userProfile",e||{})))},this.closeUserProfile=()=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((e=>e.closeModal("userProfile")))},this.openOrganizationProfile=e=>{if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.$K)(this,this.environment)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderAnyOrganizationComponent("OrganizationProfile"),{code:"cannot_render_organizations_disabled"})}else if((0,l.FW)(this)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderComponentWhenOrgDoesNotExist,{code:"cannot_render_organization_missing"})}else Ue(this,V,"f").ensureMounted({preloadHint:"OrganizationProfile"}).then((t=>t.openModal("organizationProfile",e||{})))},this.closeOrganizationProfile=()=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((e=>e.closeModal("organizationProfile")))},this.openCreateOrganization=e=>{if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.$K)(this,this.environment)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderAnyOrganizationComponent("CreateOrganization"),{code:"cannot_render_organizations_disabled"})}else Ue(this,V,"f").ensureMounted({preloadHint:"CreateOrganization"}).then((t=>t.openModal("createOrganization",e||{})))},this.closeCreateOrganization=()=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((e=>e.closeModal("createOrganization")))},this.mountSignIn=(e,t)=>{var n,r;t&&(null===(n=t.__experimental)||void 0===n?void 0:n.newComponents)&&this.__experimental_ui?this.__experimental_ui.mount("SignIn",e,t):(this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted({preloadHint:"SignIn"}).then((n=>n.mountComponent({name:"SignIn",appearanceKey:"signIn",node:e,props:t})))),null===(r=this.telemetry)||void 0===r||r.record((0,i.Ph)("SignIn",t))},this.unmountSignIn=e=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((t=>t.unmountComponent({node:e})))},this.mountSignUp=(e,t)=>{var n,r;t&&(null===(n=t.__experimental)||void 0===n?void 0:n.newComponents)&&this.__experimental_ui?this.__experimental_ui.mount("SignUp",e,t):(this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted({preloadHint:"SignUp"}).then((n=>n.mountComponent({name:"SignUp",appearanceKey:"signUp",node:e,props:t})))),null===(r=this.telemetry)||void 0===r||r.record((0,i.Ph)("SignUp",t))},this.unmountSignUp=e=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((t=>t.unmountComponent({node:e})))},this.mountUserProfile=(e,t)=>{var r;if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.vV)(this)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderComponentWhenUserDoesNotExist,{code:"cannot_render_user_missing"})}else Ue(this,V,"f").ensureMounted({preloadHint:"UserProfile"}).then((n=>n.mountComponent({name:"UserProfile",appearanceKey:"userProfile",node:e,props:t}))),null===(r=this.telemetry)||void 0===r||r.record((0,i.Ph)("UserProfile",t))},this.unmountUserProfile=e=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((t=>t.unmountComponent({node:e})))},this.mountOrganizationProfile=(e,t)=>{var r;if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.$K)(this,this.environment)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderAnyOrganizationComponent("OrganizationProfile"),{code:"cannot_render_organizations_disabled"});return}const s=!(0,l.vV)(this);if((0,l.FW)(this)&&s){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderComponentWhenOrgDoesNotExist,{code:"cannot_render_organization_missing"})}else Ue(this,V,"f").ensureMounted({preloadHint:"OrganizationProfile"}).then((n=>n.mountComponent({name:"OrganizationProfile",appearanceKey:"userProfile",node:e,props:t}))),null===(r=this.telemetry)||void 0===r||r.record((0,i.Ph)("OrganizationProfile",t))},this.unmountOrganizationProfile=e=>{this.assertComponentsReady(Ue(this,V,"f")),Ue(this,V,"f").ensureMounted().then((t=>t.unmountComponent({node:e})))},this.mountCreateOrganization=(e,t)=>{var r,s;if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.$K)(this,this.environment)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderAnyOrganizationComponent("CreateOrganization"),{code:"cannot_render_organizations_disabled"})}else null===(r=Ue(this,V,"f"))||void 0===r||r.ensureMounted({preloadHint:"CreateOrganization"}).then((n=>n.mountComponent({name:"CreateOrganization",appearanceKey:"createOrganization",node:e,props:t}))),null===(s=this.telemetry)||void 0===s||s.record((0,i.Ph)("CreateOrganization",t))},this.unmountCreateOrganization=e=>{var t;this.assertComponentsReady(Ue(this,V,"f")),null===(t=Ue(this,V,"f"))||void 0===t||t.ensureMounted().then((t=>t.unmountComponent({node:e})))},this.mountOrganizationSwitcher=(e,t)=>{var r,s;if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.$K)(this,this.environment)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderAnyOrganizationComponent("OrganizationSwitcher"),{code:"cannot_render_organizations_disabled"})}else null===(r=Ue(this,V,"f"))||void 0===r||r.ensureMounted({preloadHint:"OrganizationSwitcher"}).then((n=>n.mountComponent({name:"OrganizationSwitcher",appearanceKey:"organizationSwitcher",node:e,props:t}))),null===(s=this.telemetry)||void 0===s||s.record((0,i.Ph)("OrganizationSwitcher",t))},this.unmountOrganizationSwitcher=e=>{var t;this.assertComponentsReady(Ue(this,V,"f")),null===(t=Ue(this,V,"f"))||void 0===t||t.ensureMounted().then((t=>t.unmountComponent({node:e})))},this.__experimental_prefetchOrganizationSwitcher=()=>{var e;this.assertComponentsReady(Ue(this,V,"f")),null===(e=Ue(this,V,"f"))||void 0===e||e.ensureMounted({preloadHint:"OrganizationSwitcher"}).then((e=>e.prefetch("organizationSwitcher")))},this.mountOrganizationList=(e,t)=>{var r,s;if(this.assertComponentsReady(Ue(this,V,"f")),(0,l.$K)(this,this.environment)){if("development"===Ue(this,J,"f"))throw new n.cR(Oe.A.cannotRenderAnyOrganizationComponent("OrganizationList"),{code:"cannot_render_organizations_disabled"})}else null===(r=Ue(this,V,"f"))||void 0===r||r.ensureMounted({preloadHint:"OrganizationList"}).then((n=>n.mountComponent({name:"OrganizationList",appearanceKey:"organizationList",node:e,props:t}))),null===(s=this.telemetry)||void 0===s||s.record((0,i.Ph)("OrganizationList",t))},this.unmountOrganizationList=e=>{var t;this.assertComponentsReady(Ue(this,V,"f")),null===(t=Ue(this,V,"f"))||void 0===t||t.ensureMounted().then((t=>t.unmountComponent({node:e})))},this.mountUserButton=(e,t)=>{var n,r;this.assertComponentsReady(Ue(this,V,"f")),null===(n=Ue(this,V,"f"))||void 0===n||n.ensureMounted({preloadHint:"UserButton"}).then((n=>n.mountComponent({name:"UserButton",appearanceKey:"userButton",node:e,props:t}))),null===(r=this.telemetry)||void 0===r||r.record((0,i.Ph)("UserButton",t))},this.unmountUserButton=e=>{var t;this.assertComponentsReady(Ue(this,V,"f")),null===(t=Ue(this,V,"f"))||void 0===t||t.ensureMounted().then((t=>t.unmountComponent({node:e})))},this.setActive=async({session:e,organization:t,beforeEmit:r})=>{if(!this.client)throw new Error("setActive is being called before the client is loaded. Wait for init.");if(void 0===e&&!this.session)throw new Error("setActive should either be called with a session param or there should be already an active session.");const i="undefined"!=typeof window&&"function"==typeof window.__unstable__onBeforeSetActive?window.__unstable__onBeforeSetActive:n.lQ,s="undefined"!=typeof window&&"function"==typeof window.__unstable__onAfterSetActive?window.__unstable__onAfterSetActive:n.lQ;"string"==typeof e&&(e=this.client.sessions.find((t=>t.id===e))||null);let a=void 0===e?this.session:e;if(a&&void 0!==t){const e="string"==typeof t?t:null==t?void 0:t.id;if((0,l.nK)(e))a.lastActiveOrganizationId=e||null;else{const t=a.user.organizationMemberships.find((t=>t.organization.slug===e));a.lastActiveOrganizationId=(null==t?void 0:t.organization.id)||null}}(null==e?void 0:e.lastActiveToken)&&b.B.dispatch(b.A.TokenUpdate,{token:e.lastActiveToken}),await i(),this.session&&null===a&&(Ue(this,fe,"f").call(this),b.B.dispatch(b.A.TokenUpdate,{token:null})),!(0,l.Z$)()&&Ue(this,Y,"f").standardBrowser||(await Ue(this,de,"f").call(this,a),a=Ue(this,ye,"f").call(this,null==a?void 0:a.id)),await(null==a?void 0:a.getToken())||b.B.dispatch(b.A.TokenUpdate,{token:null});const o=Ue(this,Y,"f").standardBrowser?(0,l.T0)():void 0;r&&(null==o||o.startTracking(),Ue(this,me,"f").call(this),await r(a),null==o||o.stopTracking()),(null==o?void 0:o.isUnloading())||(Ue(this,ve,"f").call(this,a),Ue(this,he,"f").call(this),await s(),Ue(this,pe,"f").call(this))},this.addListener=e=>(e=function(e){let t;return n=>{var r,i;t||(t={...n}),t={...(r=t,i=n,{client:h(r.client,i.client),session:h(r.session,i.session),user:h(r.user,i.user),organization:h(r.organization,i.organization)})},e(t)}}(e),Ue(this,B,"f").push(e),this.client&&e({client:this.client,session:this.session,user:this.user,organization:this.organization}),()=>{Ae(this,B,Ue(this,B,"f").filter((t=>t!==e)),"f")}),this.navigate=async(e,t)=>{if(!e||!(0,l.M)())return;let n=new URL(e,window.location.href);l.VY.includes(n.protocol)||(console.warn(`Clerk: "${n.protocol}" is not a valid protocol. Redirecting to "/" instead. If you think this is a mistake, please open an issue.`),n=new URL("/",window.location.href));const r=(null==t?void 0:t.replace)&&Ue(this,Y,"f").routerReplace?Ue(this,Y,"f").routerReplace:Ue(this,Y,"f").routerPush;if(Ue(this,Y,"f").routerDebug&&console.log(`Clerk is navigating to: ${n}`),n.origin!==window.location.origin||!r)return void(0,l.y7)(n);const i={...(null==t?void 0:t.metadata)?{__internal_metadata:null==t?void 0:t.metadata}:{},windowNavigate:l.y7};return await r((0,l.FV)(n),i)},Z.set(this,(async()=>{if(!(0,l.M)())return;const e=new URLSearchParams({[Pe.rt]:"true"}),t=(0,l.hI)(Pe.MC);t&&(0,n.RE)(t)||(0,_.U6)();const r=(0,l.kZ)({base:(0,l.hI)(Pe.MC),searchParams:e},{stringify:!0});return this.navigate(this.buildUrlWithAuth(r))})),this.redirectWithAuth=async e=>{if((0,l.M)())return this.navigate(this.buildUrlWithAuth(e))},this.redirectToSignIn=async e=>{if((0,l.M)())return this.navigate(this.buildSignInUrl(e))},this.redirectToSignUp=async e=>{if((0,l.M)())return this.navigate(this.buildSignUpUrl(e))},this.redirectToUserProfile=async()=>{if((0,l.M)())return this.navigate(this.buildUserProfileUrl())},this.redirectToCreateOrganization=async()=>{if((0,l.M)())return this.navigate(this.buildCreateOrganizationUrl())},this.redirectToOrganizationProfile=async()=>{if((0,l.M)())return this.navigate(this.buildOrganizationProfileUrl())},this.redirectToAfterSignIn=async()=>{if((0,l.M)())return this.navigate(this.buildAfterSignInUrl())},this.redirectToAfterSignUp=async()=>{if((0,l.M)())return this.navigate(this.buildAfterSignUpUrl())},this.redirectToAfterSignOut=async()=>{if((0,l.M)())return this.navigate(this.buildAfterSignOutUrl())},this.handleEmailLinkVerification=async(e,t)=>{if(!this.client)return;const r=(0,l.hI)("__clerk_status");if("expired"===r)throw new d.NZ(d.Ys.Expired);if("client_mismatch"===r)throw new d.NZ(d.Ys.ClientMismatch);if("verified"!==r)throw new d.NZ(d.Ys.Failed);const i=(0,l.hI)("__clerk_created_session"),{signIn:s,signUp:a,sessions:o}=this.client,c=o.some((e=>e.id===i)),u="needs_second_factor"===s.status||"missing_requirements"===a.status,h=e=>t&&"function"==typeof t?t(e):this.navigate(e),f=e.redirectUrlComplete?()=>h(e.redirectUrlComplete):n.lQ,p=e.redirectUrl?()=>h(e.redirectUrl):n.lQ;return c?this.setActive({session:i,beforeEmit:f}):u?p():("function"==typeof e.onVerifiedOnOtherDevice&&e.onVerifiedOnOtherDevice(),null)},this.handleGoogleOneTapCallback=async(e,t,n)=>{if(!this.loaded||!this.environment||!this.client)return;const{signIn:r,signUp:i}=this.client,s="identifier"in(e||{})?e:r,a="missingFields"in(e||{})?e:i;return this._handleRedirectCallback(t,{signUp:a,signIn:s,navigate:e=>n&&"function"==typeof n?n(this.buildUrlWithAuth(e)):this.navigate(this.buildUrlWithAuth(e))})},this._handleRedirectCallback=async(e,{signIn:t,signUp:n,navigate:r})=>{var i,s,a,o,c,u;if(!this.loaded||!this.environment||!this.client)return;const{displayConfig:d}=this.environment,{firstFactorVerification:h}=t,{externalAccount:p}=n.verifications,m={status:n.status,missingFields:n.missingFields,externalAccountStatus:p.status,externalAccountErrorCode:null===(i=p.error)||void 0===i?void 0:i.code,externalAccountSessionId:null===(a=null===(s=p.error)||void 0===s?void 0:s.meta)||void 0===a?void 0:a.sessionId,sessionId:n.createdSessionId},g={status:t.status,firstFactorVerificationStatus:h.status,firstFactorVerificationErrorCode:null===(o=h.error)||void 0===o?void 0:o.code,firstFactorVerificationSessionId:null===(u=null===(c=h.error)||void 0===c?void 0:c.meta)||void 0===u?void 0:u.sessionId,sessionId:t.createdSessionId},v=e=>()=>r(e),y=v(e.signInUrl||d.signInUrl),w=v(e.signUpUrl||d.signUpUrl),b=v(e.firstFactorUrl||(0,l.kZ)({base:d.signInUrl,hashPath:"/factor-one"},{stringify:!0})),S=v(e.secondFactorUrl||(0,l.kZ)({base:d.signInUrl,hashPath:"/factor-two"},{stringify:!0})),k=v(e.resetPasswordUrl||(0,l.kZ)({base:d.signInUrl,hashPath:"/reset-password"},{stringify:!0})),P=new f.n(Ue(this,Y,"f"),e),C=v(P.getAfterSignInUrl()),O=v(P.getAfterSignUpUrl()),U=v(e.continueSignUpUrl||(0,l.kZ)({base:d.signUpUrl,hashPath:"/continue"},{stringify:!0})),A=({missingFields:t})=>t.length?U():(0,l.Au)({signUp:n,verifyEmailPath:e.verifyEmailAddressUrl||(0,l.kZ)({base:d.signUpUrl,hashPath:"/verify-email-address"},{stringify:!0}),verifyPhonePath:e.verifyPhoneNumberUrl||(0,l.kZ)({base:d.signUpUrl,hashPath:"/verify-phone-number"},{stringify:!0}),navigate:r});if("complete"===g.status)return this.setActive({session:g.sessionId,beforeEmit:C});if("transferable"===m.externalAccountStatus&&"external_account_exists"===m.externalAccountErrorCode){const e=await t.create({transfer:!0});switch(e.status){case"complete":return this.setActive({session:e.createdSessionId,beforeEmit:C});case"needs_first_factor":return b();case"needs_second_factor":return S();case"needs_new_password":return k();default:(0,_.z$)("sign in")}}const E="user_locked"===g.firstFactorVerificationErrorCode;if("user_locked"===m.externalAccountErrorCode)return w();if(E)return y();if("needs_first_factor"===g.status)return b();if("needs_new_password"===g.status)return k();if("transferable"===g.firstFactorVerificationStatus){if(!1===e.transferable)return y();const t=await n.create({transfer:!0});switch(t.status){case"complete":return this.setActive({session:t.createdSessionId,beforeEmit:O});case"missing_requirements":return A({missingFields:t.missingFields});default:(0,_.z$)("sign in")}}if("complete"===m.status)return this.setActive({session:m.sessionId,beforeEmit:O});if("needs_second_factor"===g.status)return S();if(("failed"===m.externalAccountStatus||"unverified"===m.externalAccountStatus)&&"identifier_already_signed_in"===m.externalAccountErrorCode&&m.externalAccountSessionId||"failed"===g.firstFactorVerificationStatus&&"identifier_already_signed_in"===g.firstFactorVerificationErrorCode&&g.firstFactorVerificationSessionId){const e=g.firstFactorVerificationSessionId||m.externalAccountSessionId;if(e)return this.setActive({session:e,beforeEmit:C})}return(0,l.rM)(n)?w():"verified"===m.externalAccountStatus&&"missing_requirements"===m.status?A({missingFields:n.missingFields}):y()},this.handleRedirectCallback=async(e={},t)=>{if(!this.loaded||!this.environment||!this.client)return;const{signIn:n,signUp:r}=this.client;return this._handleRedirectCallback(e,{signUp:r,signIn:n,navigate:e=>t&&"function"==typeof t?t(e):this.navigate(e)})},this.handleUnauthenticated=async(e={broadcast:!0})=>{if(!this.client||!this.session)return;const t=await d.Kj.getInstance().fetch();return this.updateClient(t),this.session?void 0:(e.broadcast&&Ue(this,fe,"f").call(this),this.setActive({session:null}))},this.authenticateWithGoogleOneTap=async e=>{var t;return null===(t=this.client)||void 0===t?void 0:t.signIn.create({strategy:"google_one_tap",token:e.token}).catch((t=>{var r;if((0,n.$R)(t)&&"external_account_not_found"===t.errors[0].code)return null===(r=this.client)||void 0===r?void 0:r.signUp.create({strategy:"google_one_tap",token:e.token,__experimental_legalAccepted:e.__experimental_legalAccepted});throw t}))},this.authenticateWithMetamask=async(e={})=>{await this.authenticateWithWeb3({...e,strategy:"web3_metamask_signature"})},this.authenticateWithCoinbaseWallet=async(e={})=>{await this.authenticateWithWeb3({...e,strategy:"web3_coinbase_wallet_signature"})},this.authenticateWithWeb3=async({redirectUrl:e,signUpContinueUrl:t,customNavigate:n,unsafeMetadata:r,strategy:i,__experimental_legalAccepted:s})=>{if(!this.client||!this.environment)return;const a=i.replace("web3_","").replace("_signature",""),o=await(0,l.hz)({provider:a}),c="metamask"===a?l.l:l.h8,u=e=>n&&"function"==typeof n?n(e):this.navigate(e);let d;try{d=await this.client.signIn.authenticateWithWeb3({identifier:o,generateSignature:c,strategy:i})}catch(h){if(!(0,l.bJ)(h,Pe.OQ.FORM_IDENTIFIER_NOT_FOUND))throw h;d=await this.client.signUp.authenticateWithWeb3({identifier:o,generateSignature:c,unsafeMetadata:r,strategy:i,__experimental_legalAccepted:s}),t&&"missing_requirements"===d.status&&"verified"===d.verifications.web3Wallet.status&&await u(t)}d.createdSessionId&&await this.setActive({session:d.createdSessionId,beforeEmit:()=>e?u(e):Promise.resolve()})},this.createOrganization=async({name:e,slug:t})=>d.yb.create({name:e,slug:t}),this.getOrganization=async e=>d.yb.get(e),this.__internal_setCountry=e=>{this.__internal_country||(this.__internal_country=e)},this.updateClient=e=>{if(!this.client){const t=Ue(this,Y,"f").selectInitialSession?Ue(this,Y,"f").selectInitialSession(e):Ue(this,le,"f").call(this,e);Ue(this,ve,"f").call(this,t)}if(this.client=e,this.session){const e=Ue(this,ye,"f").call(this,this.session.id);Ue(this,ve,"f").call(this,e)}Ue(this,he,"f").call(this)},this.__unstable__setEnvironment=async e=>{this.environment=new d.OH(e),$.mountComponentRenderer&&Ae(this,V,$.mountComponentRenderer(this,this.environment,Ue(this,Y,"f")),"f")},this.__unstable__onBeforeRequest=e=>{Ue(this,K,"f").onBeforeRequest(e)},this.__unstable__onAfterResponse=e=>{Ue(this,K,"f").onAfterResponse(e)},this.__unstable__updateProps=e=>{var t;return null===(t=Ue(this,V,"f"))||void 0===t?void 0:t.ensureMounted().then((t=>t.updateProps(e)))},Q.set(this,(()=>"true"===(0,l.hI)(Pe.rt))),X.set(this,(()=>(0,l.rw)(Pe.rt))),ee.set(this,(()=>{const e=new URLSearchParams({[Pe.MC]:window.location.href});return(0,l.kZ)({base:Ue(this,Y,"f").signInUrl,searchParams:e},{stringify:!0})})),te.set(this,(()=>{let e;if(this.proxyUrl){const t=new URL(this.proxyUrl);e=new URL(`${t.pathname}/v1/client/sync`,t.origin)}else this.domain&&(e=new URL("/v1/client/sync",`https://${this.domain}`));return null==e||e.searchParams.append("redirect_url",window.location.href),(null==e?void 0:e.toString())||""})),ne.set(this,(()=>{var e;return Ue(this,Q,"f").call(this)?(Ue(this,X,"f").call(this),!1):!!this.isSatellite&&!!(null===(e=Ue(this,D,"f"))||void 0===e?void 0:e.isSignedOut())})),re.set(this,(()=>"production"!==Ue(this,J,"f")&&(!this.isSatellite&&!!(0,l.hI)(Pe.MC)))),ie.set(this,(async()=>{"development"===this.instanceType?await this.navigate(Ue(this,ee,"f").call(this)):"production"===this.instanceType&&await this.navigate(Ue(this,te,"f").call(this))})),se.set(this,((e,t)=>{let n;try{n=new URL(e)}catch{(0,_.ZX)()}n.origin===t&&(0,_.ut)()})),ae.set(this,(()=>{this.isSatellite&&("development"!==Ue(this,J,"f")||Ue(this,Y,"f").signInUrl||(0,_.gY)(),this.proxyUrl||this.domain||(0,_.iq)(),Ue(this,Y,"f").signInUrl&&Ue(this,se,"f").call(this,Ue(this,Y,"f").signInUrl,window.location.origin))})),oe.set(this,(async()=>{var e,t;if(Ae(this,D,await N.create(this,Ue(this,K,"f")),"f"),Ue(this,ae,"f").call(this),Ue(this,ne,"f").call(this))return await Ue(this,ie,"f").call(this),!1;if("production"===Ue(this,J,"f")?null===(e=Ue(this,D,"f"))||void 0===e||e.setupProduction():await(null===(t=Ue(this,D,"f"))||void 0===t?void 0:t.setupDevelopment()),Ue(this,re,"f").call(this))return await Ue(this,Z,"f").call(this),!1;Ae(this,G,(0,l.wO)(),"f"),Ae(this,j,new n.rK("clerk"),"f"),Ue(this,ue,"f").call(this);const r=(0,l.zi)(null===window||void 0===window?void 0:window.location.hostname),i="development"===Ue(this,J,"f")&&!r;let s=0;for(;s<2;){s++;try{const[e,t]=await Promise.all([d.OH.getInstance().fetch({touch:i}),d.Kj.getInstance().fetch()]);if(this.updateClient(t),this.updateEnvironment(e),Ue(this,D,"f").setActiveOrganizationInStorage(),await Ue(this,Se,"f").call(this))return!1;$.mountComponentRenderer&&Ae(this,V,$.mountComponentRenderer(this,this.environment,Ue(this,Y,"f")),"f");break}catch(a){if(!(0,l.bJ)(a,"dev_browser_unauthenticated")){if((0,n.CS)())throw a;return console.warn(a),!1}await Ue(this,D,"f").handleUnauthenticatedDevBrowser()}s>=2&&(0,_.BF)()}return Ue(this,ke,"f").call(this),Ue(this,_e,"f").call(this),!0})),ce.set(this,(async()=>{const[e,t]=await Promise.all([d.OH.getInstance().fetch({touch:!1}),d.Kj.getInstance().fetch()]);return this.updateClient(t),this.updateEnvironment(e),$.mountComponentRenderer&&Ae(this,V,$.mountComponentRenderer(this,this.environment,Ue(this,Y,"f")),"f"),!0})),le.set(this,(e=>{if(e.lastActiveSessionId){const t=e.activeSessions.find((t=>t.id===e.lastActiveSessionId));if(t)return t}return e.activeSessions[0]||null})),ue.set(this,(()=>{var e,t;(0,n.M)()&&(null===(e=Ue(this,G,"f"))||void 0===e||e.onPageFocus((()=>{if(this.session){if(Ue(this,H,"f")>Date.now())return;Ae(this,H,Date.now()+5e3,"f"),Ue(this,de,"f").call(this,this.session)}})),null===(t=Ue(this,j,"f"))||void 0===t||t.addEventListener("message",(({data:e})=>{"signout"===e.type&&this.handleUnauthenticated()})))})),de.set(this,(async e=>{if(!e||!Ue(this,Y,"f").touchSession)return Promise.resolve();await e.touch().catch((e=>{(0,n.nc)(e)&&this.handleUnauthenticated()}))})),he.set(this,(()=>{if(this.client)for(const e of Ue(this,B,"f"))e({client:this.client,session:this.session,user:this.user,organization:this.organization})})),fe.set(this,(()=>{var e;null===(e=Ue(this,j,"f"))||void 0===e||e.postMessage({type:"signout"})})),pe.set(this,(()=>{$.mountComponentRenderer&&(this.closeSignUp(),this.closeSignIn())})),me.set(this,(()=>{this.session=void 0,this.organization=void 0,this.user=void 0,Ue(this,he,"f").call(this)})),ge.set(this,(()=>{var e;return((null===(e=this.session)||void 0===e?void 0:e.user.organizationMemberships)||[]).map((e=>e.organization)).find((e=>{var t;return e.id===(null===(t=this.session)||void 0===t?void 0:t.lastActiveOrganizationId)}))||null})),ve.set(this,(e=>{this.session=e||null,this.organization=Ue(this,ge,"f").call(this),Ue(this,we,"f").call(this)})),ye.set(this,(e=>{var t;return(null===(t=this.client)||void 0===t?void 0:t.activeSessions.find((t=>t.id===e)))||null})),we.set(this,(()=>{this.user=this.session?this.session.user:null})),_e.set(this,(()=>{this.addListener((({session:e})=>{var t;(null==e?void 0:e.actor)&&(null===(t=Ue(this,V,"f"))||void 0===t||t.ensureMounted().then((e=>e.mountImpersonationFab())))}))})),be.set(this,((e,t,n)=>{if(!(e&&this.loaded&&this.environment&&this.environment.displayConfig))return"";const r=Ue(this,Y,"f")[e]||this.environment.displayConfig[e],i=new f.n(Ue(this,Y,"f"),t).toSearchParams(),s=new URLSearchParams(n||{}),a=(0,l.kZ)({base:r,hashSearchParams:[s,i]},{stringify:!0});return this.buildUrlWithAuth(a)})),Se.set(this,(async()=>{var e,t;const n=new URLSearchParams(window.location.search).get("redirect_url"),r="production"===this.instanceType,i=null!==n&&(0,l.l1)(this.frontendApi,n);if(r||!i)return!1;const s=this.session,a=Ue(this,Y,"f").signInUrl||(null===(e=this.environment)||void 0===e?void 0:e.displayConfig.signInUrl),o=a&&window.location.href.startsWith(a),c=Ue(this,Y,"f").signUpUrl||(null===(t=this.environment)||void 0===t?void 0:t.displayConfig.signUpUrl),u=c&&window.location.href.startsWith(c);return!((0,l.AC)(n)&&!s&&(o||u)||(await this.navigate(this.buildUrlWithAuth(n)),0))})),ke.set(this,(()=>{try{(0,l.rw)("__clerk_handshake"),(0,l.rw)("__clerk_help")}catch(e){}})),e=(e||"").trim(),Ae(this,F,null==t?void 0:t.domain,"f"),Ae(this,W,null==t?void 0:t.proxyUrl,"f"),!e)return l.sb.throwMissingPublishableKeyError();const s=(0,n.q5)(e);if(!s)return l.sb.throwInvalidPublishableKeyError({key:e});Ae(this,L,e,"f"),Ae(this,J,s.instanceType,"f"),Ae(this,K,(0,Ce.Y)(this),"f"),d.Qx.clerk=this}buildUrlWithAuth(e){if("production"===Ue(this,J,"f"))return e;const t=new URL(e,window.location.origin);return t.origin===window.location.origin?t.href:Ue(this,D,"f")?Ue(this,D,"f").decorateUrlWithDevBrowserToken(t).href:t.href}buildSignInUrl(e){return Ue(this,be,"f").call(this,"signInUrl",{...e,redirectUrl:(null==e?void 0:e.redirectUrl)||window.location.href},null==e?void 0:e.initialValues)}buildSignUpUrl(e){return Ue(this,be,"f").call(this,"signUpUrl",{...e,redirectUrl:(null==e?void 0:e.redirectUrl)||window.location.href},null==e?void 0:e.initialValues)}buildUserProfileUrl(){return this.environment&&this.environment.displayConfig?this.buildUrlWithAuth(this.environment.displayConfig.userProfileUrl):""}buildHomeUrl(){return this.environment&&this.environment.displayConfig?this.buildUrlWithAuth(this.environment.displayConfig.homeUrl):""}buildAfterSignInUrl(){return this.buildUrlWithAuth(new f.n(Ue(this,Y,"f")).getAfterSignInUrl())}buildAfterSignUpUrl(){return this.buildUrlWithAuth(new f.n(Ue(this,Y,"f")).getAfterSignUpUrl())}buildAfterSignOutUrl(){return Ue(this,Y,"f").afterSignOutUrl?this.buildUrlWithAuth(Ue(this,Y,"f").afterSignOutUrl):"/"}buildAfterMultiSessionSingleSignOutUrl(){var e;return Ue(this,Y,"f").afterMultiSessionSingleSignOutUrl?this.buildUrlWithAuth(Ue(this,Y,"f").afterMultiSessionSingleSignOutUrl):this.buildUrlWithAuth((0,l.kZ)({base:Ue(this,Y,"f").signInUrl?`${Ue(this,Y,"f").signInUrl}/choose`:null===(e=this.environment)||void 0===e?void 0:e.displayConfig.afterSignOutOneUrl},{stringify:!0}))}buildCreateOrganizationUrl(){return this.environment&&this.environment.displayConfig?this.buildUrlWithAuth(this.environment.displayConfig.createOrganizationUrl):""}buildOrganizationProfileUrl(){return this.environment&&this.environment.displayConfig?this.buildUrlWithAuth(this.environment.displayConfig.organizationProfileUrl):""}updateEnvironment(e){var t;this.environment=e,null===(t=Ue(this,D,"f"))||void 0===t||t.setEnvironment(e)}get __internal_last_error(){const e=this.internal_last_error;return this.internal_last_error=null,e}set __internal_last_error(e){this.internal_last_error=e}get __unstable__environment(){return this.environment}__internal_navigateWithError(e,t){return this.__internal_last_error=t,this.navigate(e)}assertComponentsReady(e){if(!$.mountComponentRenderer)throw new Error("ClerkJS was loaded without UI components.");if(!e)throw new Error("ClerkJS components are not ready yet.")}}$=Ie,L=new WeakMap,F=new WeakMap,W=new WeakMap,D=new WeakMap,j=new WeakMap,V=new WeakMap,K=new WeakMap,J=new WeakMap,q=new WeakMap,B=new WeakMap,Y=new WeakMap,G=new WeakMap,H=new WeakMap,Z=new WeakMap,Q=new WeakMap,X=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,se=new WeakMap,ae=new WeakMap,oe=new WeakMap,ce=new WeakMap,le=new WeakMap,ue=new WeakMap,de=new WeakMap,he=new WeakMap,fe=new WeakMap,pe=new WeakMap,me=new WeakMap,ge=new WeakMap,ve=new WeakMap,ye=new WeakMap,we=new WeakMap,_e=new WeakMap,be=new WeakMap,Se=new WeakMap,ke=new WeakMap,Ie.version="5.29.1",Ie.sdkMetadata={name:"@clerk/clerk-js",version:"5.29.1",environment:"production"};var Re=a(4380),xe=a(3931),Te=a(4041),Me=a(2797);const ze={SignIn:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(676),a.e(417)]).then(a.bind(a,601)),SignUp:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(787)]).then(a.bind(a,1932)),UserButton:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(676),a.e(278)]).then(a.bind(a,9721)),UserProfile:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(45)]).then(a.bind(a,4994)),CreateOrganization:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(357),a.e(862)]).then(a.bind(a,2525)),OrganizationProfile:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(357),a.e(837)]).then(a.bind(a,8864)),OrganizationSwitcher:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(703)]).then(a.bind(a,8770)),OrganizationList:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(357),a.e(578)]).then(a.bind(a,8382)),ImpersonationFab:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(796)]).then(a.bind(a,9009)),GoogleOneTap:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(136)]).then(a.bind(a,7187)),UserVerification:()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(671)]).then(a.bind(a,8103))},Ne=(0,Te.lazy)((()=>ze.SignIn().then((e=>({default:e.SignIn}))))),$e=(0,Te.lazy)((()=>ze.SignIn().then((e=>({default:e.SignInModal}))))),Le=(0,Te.lazy)((()=>ze.GoogleOneTap().then((e=>({default:e.OneTap}))))),Fe=(0,Te.lazy)((()=>ze.UserVerification().then((e=>({default:e.UserVerification}))))),We=(0,Te.lazy)((()=>ze.UserVerification().then((e=>({default:e.UserVerificationModal}))))),De=(0,Te.lazy)((()=>ze.SignUp().then((e=>({default:e.SignUp}))))),je=(0,Te.lazy)((()=>ze.SignUp().then((e=>({default:e.SignUpModal}))))),Ve=(0,Te.lazy)((()=>ze.UserButton().then((e=>({default:e.UserButton}))))),Ke=(0,Te.lazy)((()=>ze.UserProfile().then((e=>({default:e.UserProfile}))))),Je=(0,Te.lazy)((()=>ze.UserProfile().then((e=>({default:e.UserProfileModal}))))),qe=(0,Te.lazy)((()=>ze.CreateOrganization().then((e=>({default:e.CreateOrganization}))))),Be=(0,Te.lazy)((()=>ze.CreateOrganization().then((e=>({default:e.CreateOrganizationModal}))))),Ye=(0,Te.lazy)((()=>ze.OrganizationProfile().then((e=>({default:e.OrganizationProfile}))))),Ge=(0,Te.lazy)((()=>ze.OrganizationProfile().then((e=>({default:e.OrganizationProfileModal}))))),He=(0,Te.lazy)((()=>ze.OrganizationSwitcher().then((e=>({default:e.OrganizationSwitcher}))))),Ze=(0,Te.lazy)((()=>ze.OrganizationList().then((e=>({default:e.OrganizationList}))))),Qe=(0,Te.lazy)((()=>ze.ImpersonationFab().then((e=>({default:e.ImpersonationFab}))))),Xe={SignIn:Ne,SignUp:De,UserButton:Ve,UserProfile:Ke,UserVerification:Fe,OrganizationSwitcher:He,OrganizationList:Ze,OrganizationProfile:Ye,CreateOrganization:qe,SignInModal:$e,SignUpModal:je,UserProfileModal:Je,OrganizationProfileModal:Ge,CreateOrganizationModal:Be,UserVerificationModal:We,GoogleOneTap:Le},et=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(263)]).then(a.bind(a,844)).then((e=>({default:e.CoreClerkContextWrapper}))))),tt=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(263)]).then(a.bind(a,844)).then((e=>({default:e.EnvironmentProvider}))))),nt=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(263)]).then(a.bind(a,844)).then((e=>({default:e.OptionsProvider}))))),rt=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(882)]).then(a.bind(a,9333)).then((e=>({default:e.AppearanceProvider}))))),it=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(263)]).then(a.bind(a,166)).then((e=>({default:e.VirtualRouter}))))),st=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(882)]).then(a.bind(a,3965)).then((e=>({default:e.InternalThemeProvider}))))),at=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(501)]).then(a.bind(a,5329)).then((e=>({default:e.Portal}))))),ot=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(501)]).then(a.bind(a,5329)).then((e=>({default:e.VirtualBodyRootPortal}))))),ct=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(882)]).then(a.bind(a,8369)).then((e=>({default:e.FlowMetadataProvider}))))),lt=(0,Te.lazy)((()=>Promise.all([a.e(593),a.e(96),a.e(65),a.e(882)]).then(a.bind(a,8369)).then((e=>({default:e.Modal}))))),ut=(0,Te.lazy)((()=>a.e(267).then(a.bind(a,3351)).then((e=>({default:e.OrganizationSwitcherPrefetch}))))),dt=e=>(0,Re.Y)(et,{clerk:e.clerk,children:(0,Re.Y)(tt,{value:e.environment,children:(0,Re.Y)(nt,{value:e.options,children:e.children})})}),ht=e=>(0,Re.Y)(rt,{globalAppearance:e.globalAppearance,appearanceKey:e.appearanceKey,appearance:e.componentAppearance,children:(0,Re.Y)(at,{node:e.node,component:Xe[e.componentName],props:e.componentProps,componentName:e.componentName})}),ft=e=>(0,Re.Y)(Te.Suspense,{fallback:"",children:(0,Re.Y)(rt,{globalAppearance:e.globalAppearance,appearanceKey:e.appearanceKey,appearance:e.componentAppearance,children:(0,Re.Y)(ct,{flow:e.flowName||"",children:(0,Re.Y)(st,{children:(0,Re.Y)(lt,{handleClose:e.onClose,containerSx:e.modalContainerSx,contentSx:e.modalContentSx,children:e.startPath?(0,Re.Y)(Te.Suspense,{children:(0,Re.Y)(it,{startPath:e.startPath,onExternalNavigate:e.onExternalNavigate,children:e.children})}):e.children})})})})}),pt=e=>(0,Re.Y)(Te.Suspense,{children:(0,Re.Y)(it,{startPath:"",children:(0,Re.Y)(rt,{globalAppearance:e.globalAppearance,appearanceKey:"impersonationFab",children:e.children})})}),mt=e=>(0,Re.Y)(rt,{globalAppearance:e.globalAppearance,appearanceKey:"oneTap",appearance:e.componentAppearance,children:(0,Re.Y)(ot,{startPath:e.startPath,component:Xe.GoogleOneTap,props:e.componentProps,componentName:"GoogleOneTap"})});let gt=0;const vt={},yt=Object.freeze({SignUp:"signUpModal",SignIn:"signInModal",UserProfile:"userProfileModal",OrganizationProfile:"organizationProfileModal",CreateOrganization:"createOrganizationModal"}),wt=e=>{const[t,n]=Te.useState({appearance:e.options.appearance,options:e.options,googleOneTapModal:null,signInModal:null,signUpModal:null,userProfileModal:null,userVerificationModal:null,organizationProfileModal:null,createOrganizationModal:null,organizationSwitcherPrefetch:!1,nodes:new Map,impersonationFab:!1}),{googleOneTapModal:r,signInModal:i,signUpModal:s,userProfileModal:a,userVerificationModal:o,organizationProfileModal:c,createOrganizationModal:u,nodes:d}=t,{urlStateParam:h,clearUrlStateParam:f,decodedRedirectParams:p}=(0,Me.x)();(0,xe.UQ)((()=>{p&&n((e=>({...e,[yt[p.componentName]]:!0}))),vt.mountComponent=e=>{const{node:t,name:r,props:i,appearanceKey:s}=e;t||(0,_.$V)(),n((e=>(e.nodes.set(t,{key:"p"+ ++gt,name:r,props:i,appearanceKey:s}),{...e,nodes:d})))},vt.unmountComponent=e=>{const{node:t}=e;n((e=>(e.nodes.delete(t),{...e,nodes:d})))},vt.updateProps=({node:e,props:r,...i})=>{if(e&&r&&"object"==typeof r){const i=t.nodes.get(e);if(i)return i.props={...r},void n((e=>({...e})))}n((e=>({...e,...i,options:{...e.options,...i.options}})))},vt.closeModal=(e,t={})=>{const{notify:r=!0}=t;f(),n((t=>(function(){var n;const i=t[`${e}Modal`]||{};"afterVerificationCancelled"in i&&r&&(null===(n=i.afterVerificationCancelled)||void 0===n||n.call(i))}(),{...t,[`${e}Modal`]:null})))},vt.openModal=(e,t)=>{"afterVerificationCancelled"in t?"afterVerificationCancelled"in t&&n((n=>({...n,[`${e}Modal`]:{...t,afterVerification(){var n;null===(n=t.afterVerification)||void 0===n||n.call(t),vt.closeModal(e,{notify:!1})}}}))):n((n=>({...n,[`${e}Modal`]:t})))},vt.mountImpersonationFab=()=>{n((e=>({...e,impersonationFab:!0})))},vt.prefetch=e=>{n((t=>({...t,[`${e}Prefetch`]:!0})))},e.onComponentsMounted()}),[]);const m=(0,Re.Y)(mt,{componentProps:r,globalAppearance:t.appearance,componentAppearance:null==r?void 0:r.appearance,startPath:(0,l.cL)({base:"/one-tap",path:""})}),g=(0,Re.FD)(ft,{globalAppearance:t.appearance,appearanceKey:"signIn",componentAppearance:null==i?void 0:i.appearance,flowName:"signIn",onClose:()=>vt.closeModal("signIn"),onExternalNavigate:()=>vt.closeModal("signIn"),startPath:(0,l.cL)({base:"/sign-in",path:null==h?void 0:h.path}),componentName:"SignInModal",children:[(0,Re.Y)($e,{...i}),(0,Re.Y)(je,{...i})]}),v=(0,Re.FD)(ft,{globalAppearance:t.appearance,appearanceKey:"signUp",componentAppearance:null==s?void 0:s.appearance,flowName:"signUp",onClose:()=>vt.closeModal("signUp"),onExternalNavigate:()=>vt.closeModal("signUp"),startPath:(0,l.cL)({base:"/sign-up",path:null==h?void 0:h.path}),componentName:"SignUpModal",children:[(0,Re.Y)($e,{...s}),(0,Re.Y)(je,{...s})]}),y=(0,Re.Y)(ft,{globalAppearance:t.appearance,appearanceKey:"userProfile",componentAppearance:null==a?void 0:a.appearance,flowName:"userProfile",onClose:()=>vt.closeModal("userProfile"),onExternalNavigate:()=>vt.closeModal("userProfile"),startPath:(0,l.cL)({base:"/user",path:(null==a?void 0:a.__experimental_startPath)||(null==h?void 0:h.path)}),componentName:"UserProfileModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$176}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,Re.Y)(Je,{...a})}),w=(0,Re.Y)(ft,{globalAppearance:t.appearance,appearanceKey:"userVerification",componentAppearance:null==o?void 0:o.appearance,flowName:"userVerification",onClose:()=>vt.closeModal("userVerification"),onExternalNavigate:()=>vt.closeModal("userVerification"),startPath:(0,l.cL)({base:"/user-verification",path:null==h?void 0:h.path}),componentName:"UserVerificationModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$176}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,Re.Y)(We,{...o})}),b=(0,Re.Y)(ft,{globalAppearance:t.appearance,appearanceKey:"organizationProfile",componentAppearance:null==c?void 0:c.appearance,flowName:"organizationProfile",onClose:()=>vt.closeModal("organizationProfile"),onExternalNavigate:()=>vt.closeModal("organizationProfile"),startPath:(0,l.cL)({base:"/organizationProfile",path:null==h?void 0:h.path}),componentName:"OrganizationProfileModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$176}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,Re.Y)(Ge,{...c})}),S=(0,Re.Y)(ft,{globalAppearance:t.appearance,appearanceKey:"createOrganization",componentAppearance:null==u?void 0:u.appearance,flowName:"createOrganization",onClose:()=>vt.closeModal("createOrganization"),onExternalNavigate:()=>vt.closeModal("createOrganization"),startPath:(0,l.cL)({base:"/createOrganization",path:null==h?void 0:h.path}),componentName:"CreateOrganizationModal",modalContainerSx:{alignItems:"center"},modalContentSx:e=>({height:`min(${e.sizes.$120}, calc(100% - ${e.sizes.$12}))`,margin:0}),children:(0,Re.Y)(Be,{...u})});return(0,Re.Y)(Te.Suspense,{fallback:"",children:(0,Re.FD)(dt,{clerk:e.clerk,environment:e.environment,options:t.options,children:[[...d].map((([e,n])=>{var r;return(0,Re.Y)(ht,{node:e,globalAppearance:t.appearance,appearanceKey:n.appearanceKey,componentAppearance:null===(r=n.props)||void 0===r?void 0:r.appearance,componentName:n.name,componentProps:n.props},n.key)})),r&&m,i&&g,s&&v,a&&y,o&&w,c&&b,u&&S,t.impersonationFab&&(0,Re.Y)(pt,{globalAppearance:t.appearance,children:(0,Re.Y)(Qe,{})}),(0,Re.Y)(Te.Suspense,{children:t.organizationSwitcherPrefetch&&(0,Re.Y)(ut,{})})]})})};var _t,bt,St;Ie.mountComponentRenderer=(e,t,r)=>{let i,s=document.getElementById("clerk-components");return s||(s=document.createElement("div"),s.setAttribute("id","clerk-components"),document.body.appendChild(s)),{ensureMounted:async o=>{const{preloadHint:c}=o||{};if(!i){const o=(0,n.ph)();c&&(async e=>{var t;null===(t=ze[e])||void 0===t||t.call(ze)})(c),i=Promise.all([a.e(593),a.e(96),a.e(65),a.e(644)]).then(a.bind(a,8131)).then((({createRoot:n})=>(n(s).render((0,Re.Y)(wt,{clerk:e,environment:t,options:r,onComponentsMounted:o.resolve})),o.promise.then((()=>vt)))))}return i.then((e=>e))}}};const kt=(null===(_t=document.querySelector("script[data-clerk-publishable-key]"))||void 0===_t?void 0:_t.getAttribute("data-clerk-publishable-key"))||window.__clerk_publishable_key||"",Pt=(null===(bt=document.querySelector("script[data-clerk-proxy-url]"))||void 0===bt?void 0:bt.getAttribute("data-clerk-proxy-url"))||window.__clerk_proxy_url||"",Ct=(null===(St=document.querySelector("script[data-clerk-domain]"))||void 0===St?void 0:St.getAttribute("data-clerk-domain"))||window.__clerk_domain||"";window.Clerk=new Ie(kt,{proxyUrl:Pt,domain:Ct})}(),{}}()}));