@clerk/clerk-js 6.0.0-snapshot.v20251217194100 → 6.0.0-snapshot.v20251218183643
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/197_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js +1 -0
- package/dist/197_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js +1 -0
- package/dist/197_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js +1 -0
- package/dist/197_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js +1 -0
- package/dist/197_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js +1 -0
- package/dist/{694_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js → 537_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js} +9 -9
- package/dist/896_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js +1 -0
- package/dist/{base-account-sdk_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → base-account-sdk_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +9 -9
- package/dist/{base-account-sdk_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → base-account-sdk_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +9 -9
- package/dist/{base-account-sdk_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → base-account-sdk_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +9 -9
- package/dist/base-account-sdk_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js +1 -0
- package/dist/clerk.browser.js +9 -9
- package/dist/clerk.chips.browser.js +9 -9
- package/dist/clerk.headless.browser.js +9 -9
- package/dist/clerk.headless.js +9 -9
- package/dist/clerk.js +15 -15
- package/dist/clerk.legacy.browser.js +1 -1
- package/dist/clerk.mjs +18 -18
- package/dist/clerk.no-rhc.js +6 -6
- package/dist/clerk.no-rhc.mjs +7 -7
- package/dist/{cookieSuffix_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js → cookieSuffix_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js} +1 -1
- package/dist/types/core/clerk.d.ts +3 -2
- package/dist/types/core/resources/SignIn.d.ts +15 -1
- package/dist/types/core/resources/SignUp.d.ts +23 -10
- package/dist/types/utils/errorThrower.d.ts +1 -1
- package/dist/types/utils/web3.d.ts +10 -7
- package/dist/{vendors_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → vendors_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +1 -1
- package/dist/{vendors_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → vendors_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +1 -1
- package/dist/{vendors_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → vendors_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +1 -1
- package/dist/{vendors_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → vendors_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +1 -1
- package/package.json +7 -3
- package/dist/415_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js +0 -1
- package/dist/base-account-sdk_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js +0 -1
- /package/dist/{308_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js → 308_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{507_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → 507_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{507_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → 507_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{507_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → 507_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{507_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js → 507_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{507_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → 507_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{521_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js → 521_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{527_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → 527_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{527_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → 527_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{527_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → 527_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{527_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → 527_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{604_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js → 604_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{783_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js → 783_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{973_clerk.headless_7f97f0_6.0.0-snapshot.v20251217194100.js → 973_clerk.headless_38bd55_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{coinbase-wallet-sdk_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → coinbase-wallet-sdk_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{coinbase-wallet-sdk_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → coinbase-wallet-sdk_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{coinbase-wallet-sdk_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → coinbase-wallet-sdk_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{coinbase-wallet-sdk_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → coinbase-wallet-sdk_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{cookieSuffix_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → cookieSuffix_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{cookieSuffix_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → cookieSuffix_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{cookieSuffix_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → cookieSuffix_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{cookieSuffix_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → cookieSuffix_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{query-core-vendors_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → query-core-vendors_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{query-core-vendors_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → query-core-vendors_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{query-core-vendors_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → query-core-vendors_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{query-core-vendors_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → query-core-vendors_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{stripe-vendors_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → stripe-vendors_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{stripe-vendors_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → stripe-vendors_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{stripe-vendors_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → stripe-vendors_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{stripe-vendors_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → stripe-vendors_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{zxcvbn-common_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → zxcvbn-common_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{zxcvbn-common_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → zxcvbn-common_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{zxcvbn-common_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → zxcvbn-common_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{zxcvbn-common_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → zxcvbn-common_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{zxcvbn-ts-core_clerk.browser_575b82_6.0.0-snapshot.v20251217194100.js → zxcvbn-ts-core_clerk.browser_834334_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{zxcvbn-ts-core_clerk.chips.browser_a7910d_6.0.0-snapshot.v20251217194100.js → zxcvbn-ts-core_clerk.chips.browser_5e7a74_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{zxcvbn-ts-core_clerk.headless.browser_940c18_6.0.0-snapshot.v20251217194100.js → zxcvbn-ts-core_clerk.headless.browser_45a74c_6.0.0-snapshot.v20251218183643.js} +0 -0
- /package/dist/{zxcvbn-ts-core_clerk.legacy.browser_99ed7c_6.0.0-snapshot.v20251217194100.js → zxcvbn-ts-core_clerk.legacy.browser_6e74bb_6.0.0-snapshot.v20251218183643.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(globalThis,()=>(()=>{var t,e,i,n={8326:function(t,e,i){"use strict";i(9166),i(4261),i(1300),i(7918),i(574),i(5992),i(8385),i(5208),i(2935),i(9356),i(5702),i(9091),i(6178),i(4784),i(1747);var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,s){function a(t){try{l(n.next(t))}catch(t){s(t)}}function o(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(a,o)}l((n=n.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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){var l=[s,o];if(i)throw TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&l[0]?n.return:l[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;switch(n=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){a.label=l[1];break}if(6===l[0]&&a.label<r[1]){a.label=r[1],r=l;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(l);break}r[2]&&a.ops.pop(),a.trys.pop();continue}l=e.call(t,a)}catch(t){l=[6,t],n=0}finally{i=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},s=this;Object.defineProperty(e,"__esModule",{value:!0});var a=i(6599),o="browser-tabs-lock-key",l={key:function(t){return n(s,void 0,void 0,function(){return r(this,function(t){throw Error("Unsupported")})})},getItem:function(t){return n(s,void 0,void 0,function(){return r(this,function(t){throw Error("Unsupported")})})},clear:function(){return n(s,void 0,void 0,function(){return r(this,function(t){return[2,window.localStorage.clear()]})})},removeItem:function(t){return n(s,void 0,void 0,function(){return r(this,function(t){throw Error("Unsupported")})})},setItem:function(t,e){return n(s,void 0,void 0,function(){return r(this,function(t){throw Error("Unsupported")})})},keySync:function(t){return window.localStorage.key(t)},getItemSync:function(t){return window.localStorage.getItem(t)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(t){return window.localStorage.removeItem(t)},setItemSync:function(t,e){return window.localStorage.setItem(t,e)}};function c(t){return new Promise(function(e){return setTimeout(e,t)})}function u(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="",n=0;n<t;n++){var r=Math.floor(Math.random()*e.length);i+=e[r]}return i}e.default=function(){function t(e){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(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),this.storageHandler=e,void 0===t.waiters&&(t.waiters=[])}return t.prototype.acquireLock=function(e,i){return void 0===i&&(i=5e3),n(this,void 0,void 0,function(){var n,s,a,h,d,f,p;return r(this,function(r){switch(r.label){case 0:n=Date.now()+u(4),s=Date.now()+i,a=o+"-"+e,h=void 0===this.storageHandler?l:this.storageHandler,r.label=1;case 1:if(!(Date.now()<s))return[3,8];return[4,c(30)];case 2:if(r.sent(),null!==h.getItemSync(a))return[3,5];return d=this.id+"-"+e+"-"+n,[4,c(Math.floor(25*Math.random()))];case 3:return r.sent(),h.setItemSync(a,JSON.stringify({id:this.id,iat:n,timeoutKey:d,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:if(r.sent(),null!==(f=h.getItemSync(a))&&(p=JSON.parse(f)).id===this.id&&p.iat===n)return this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(a,n),[2,!0];return[3,7];case 5:return t.lockCorrector(void 0===this.storageHandler?l:this.storageHandler),[4,this.waitForSomethingToChange(s)];case 6:r.sent(),r.label=7;case 7:return n=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},t.prototype.refreshLockWhileAcquired=function(t,e){return n(this,void 0,void 0,function(){var i=this;return r(this,function(s){return setTimeout(function(){return n(i,void 0,void 0,function(){var i,n,s;return r(this,function(r){switch(r.label){case 0:return[4,a.default().lock(e)];case 1:if(r.sent(),!this.acquiredIatSet.has(e)||null===(n=(i=void 0===this.storageHandler?l:this.storageHandler).getItemSync(t)))return a.default().unlock(e),[2];return(s=JSON.parse(n)).timeRefreshed=Date.now(),i.setItemSync(t,JSON.stringify(s)),a.default().unlock(e),this.refreshLockWhileAcquired(t,e),[2]}})})},1e3),[2]})})},t.prototype.waitForSomethingToChange=function(e){return n(this,void 0,void 0,function(){return r(this,function(i){switch(i.label){case 0:return[4,new Promise(function(i){var n=!1,r=Date.now(),s=!1;function a(){if(s||(window.removeEventListener("storage",a),t.removeFromWaiting(a),clearTimeout(o),s=!0),!n){n=!0;var e=50-(Date.now()-r);e>0?setTimeout(i,e):i(null)}}window.addEventListener("storage",a),t.addToWaiting(a);var o=setTimeout(a,Math.max(0,e-Date.now()))})];case 1:return i.sent(),[2]}})})},t.addToWaiting=function(e){this.removeFromWaiting(e),void 0!==t.waiters&&t.waiters.push(e)},t.removeFromWaiting=function(e){void 0!==t.waiters&&(t.waiters=t.waiters.filter(function(t){return t!==e}))},t.notifyWaiters=function(){void 0!==t.waiters&&t.waiters.slice().forEach(function(t){return t()})},t.prototype.releaseLock=function(t){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.releaseLock__private__(t)];case 1:return[2,e.sent()]}})})},t.prototype.releaseLock__private__=function(e){return n(this,void 0,void 0,function(){var i,n,s,c;return r(this,function(r){switch(r.label){case 0:if(i=void 0===this.storageHandler?l:this.storageHandler,n=o+"-"+e,null===(s=i.getItemSync(n)))return[2];if((c=JSON.parse(s)).id!==this.id)return[3,2];return[4,a.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),i.removeItemSync(n),a.default().unlock(c.iat),t.notifyWaiters(),r.label=2;case 2:return[2]}})})},t.lockCorrector=function(e){for(var i=Date.now()-5e3,n=[],r=0;;){var s=e.keySync(r);if(null===s)break;n.push(s),r++}for(var a=!1,l=0;l<n.length;l++){var c=n[l];if(c.includes(o)){var u=e.getItemSync(c);if(null!==u){var h=JSON.parse(u);(void 0===h.timeRefreshed&&h.timeAcquired<i||void 0!==h.timeRefreshed&&h.timeRefreshed<i)&&(e.removeItemSync(c),a=!0)}}}a&&t.notifyWaiters()},t.waiters=void 0,t}()},6599:function(t,e,i){"use strict";i(4261),i(4085),i(9166),Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){var t=this;this.locked=new Map,this.addToLocked=function(e,i){var n=t.locked.get(e);void 0===n?void 0===i?t.locked.set(e,[]):t.locked.set(e,[i]):void 0!==i&&(n.unshift(i),t.locked.set(e,n))},this.isLocked=function(e){return t.locked.has(e)},this.lock=function(e){return new Promise(function(i,n){t.isLocked(e)?t.addToLocked(e,i):(t.addToLocked(e),i())})},this.unlock=function(e){var i=t.locked.get(e);if(void 0===i||0===i.length)return void t.locked.delete(e);var n=i.pop();t.locked.set(e,i),void 0!==n&&setTimeout(n,0)}}return t.getInstance=function(){return void 0===t.instance&&(t.instance=new t),t.instance},t}();e.default=function(){return n.getInstance()}},1006:function(t,e,i){i(1300),i(6843),i(6764),i(4853),i(4891),t.exports=function(t,e){if("string"!=typeof t)throw TypeError("Expected a string");for(var i,n=String(t),r="",s=!!e&&!!e.extended,a=!!e&&!!e.globstar,o=!1,l=e&&"string"==typeof e.flags?e.flags:"",c=0,u=n.length;c<u;c++)switch(i=n[c]){case"/":case"$":case"^":case"+":case".":case"(":case")":case"=":case"!":case"|":r+="\\"+i;break;case"?":if(s){r+=".";break}case"[":case"]":if(s){r+=i;break}case"{":if(s){o=!0,r+="(";break}case"}":if(s){o=!1,r+=")";break}case",":if(o){r+="|";break}r+="\\"+i;break;case"*":for(var h=n[c-1],d=1;"*"===n[c+1];)d++,c++;var f=n[c+1];a?d>1&&("/"===h||void 0===h)&&("/"===f||void 0===f)?(r+="((?:[^/]*(?:/|$))*)",c++):r+="([^/]*)":r+=".*";break;default:r+=i}return l&&~l.indexOf("g")||(r="^"+r+"$"),new RegExp(r,l)}},6382:function(t,e,i){"use strict";var n=i(8801),r=i(2123),s=TypeError;t.exports=function(t){if(n(t))return t;throw new s(r(t)+" is not a function")}},7592:function(t,e,i){"use strict";var n=i(2049),r=i(2123),s=TypeError;t.exports=function(t){if(n(t))return t;throw new s(r(t)+" is not a constructor")}},5982:function(t,e,i){"use strict";var n=i(2585),r=String,s=TypeError;t.exports=function(t){if(n(t))return t;throw new s("Can't set "+r(t)+" as a prototype")}},6148:function(t,e,i){"use strict";var n=i(3110).has;t.exports=function(t){return n(t),t}},7161:function(t,e,i){"use strict";var n=i(4735),r=i(5012),s=i(4773).f,a=n("unscopables"),o=Array.prototype;void 0===o[a]&&s(o,a,{configurable:!0,value:r(null)}),t.exports=function(t){o[a][t]=!0}},1857:function(t,e,i){"use strict";var n=i(5059).charAt;t.exports=function(t,e,i){return e+(i?n(t,e).length:1)}},5275:function(t,e,i){"use strict";var n=i(5533),r=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw new r("Incorrect invocation")}},3:function(t,e,i){"use strict";var n=i(9414),r=String,s=TypeError;t.exports=function(t){if(n(t))return t;throw new s(r(t)+" is not an object")}},255:function(t){"use strict";t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},4158:function(t,e,i){"use strict";var n=i(7604),r=i(1190),s=i(4380),a=n.ArrayBuffer,o=n.TypeError;t.exports=a&&r(a.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==s(t))throw new o("ArrayBuffer expected");return t.byteLength}},2674:function(t,e,i){"use strict";var n=i(7604),r=i(255),s=i(4158),a=n.DataView;t.exports=function(t){if(!r||0!==s(t))return!1;try{return new a(t),!1}catch(t){return!0}}},6509:function(t,e,i){"use strict";var n=i(2674),r=TypeError;t.exports=function(t){if(n(t))throw new r("ArrayBuffer is detached");return t}},4088:function(t,e,i){"use strict";var n=i(7604),r=i(2196),s=i(1190),a=i(7932),o=i(6509),l=i(4158),c=i(4791),u=i(1200),h=n.structuredClone,d=n.ArrayBuffer,f=n.DataView,p=Math.min,_=d.prototype,g=f.prototype,v=r(_.slice),m=s(_,"resizable","get"),y=s(_,"maxByteLength","get"),w=r(g.getInt8),b=r(g.setInt8);t.exports=(u||c)&&function(t,e,i){var n,r=l(t),s=void 0===e?r:a(e),_=!m||!m(t);if(o(t),u&&(t=h(t,{transfer:[t]}),r===s&&(i||_)))return t;if(r>=s&&(!i||_))n=v(t,0,s);else{n=new d(s,i&&!_&&y?{maxByteLength:y(t)}:void 0);for(var g=new f(t),k=new f(n),S=p(s,r),A=0;A<S;A++)b(k,A,w(g,A))}return u||c(t),n}},5200:function(t,e,i){"use strict";var n,r,s,a=i(255),o=i(4032),l=i(7604),c=i(8801),u=i(9414),h=i(4461),d=i(6471),f=i(2123),p=i(3599),_=i(1764),g=i(1782),v=i(5533),m=i(9623),y=i(6307),w=i(4735),b=i(8916),k=i(4769),S=k.enforce,A=k.get,I=l.Int8Array,x=I&&I.prototype,U=l.Uint8ClampedArray,E=U&&U.prototype,P=I&&m(I),C=x&&m(x),O=Object.prototype,T=l.TypeError,R=w("toStringTag"),M=b("TYPED_ARRAY_TAG"),N="TypedArrayConstructor",z=a&&!!y&&"Opera"!==d(l.opera),W=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},D={BigInt64Array:8,BigUint64Array:8},L=function(t){var e=m(t);if(u(e)){var i=A(e);return i&&h(i,N)?i[N]:L(e)}},j=function(t){if(!u(t))return!1;var e=d(t);return h(F,e)||h(D,e)};for(n in F)(s=(r=l[n])&&r.prototype)?S(s)[N]=r:z=!1;for(n in D)(s=(r=l[n])&&r.prototype)&&(S(s)[N]=r);if((!z||!c(P)||P===Function.prototype)&&(P=function(){throw new T("Incorrect invocation")},z))for(n in F)l[n]&&y(l[n],P);if((!z||!C||C===O)&&(C=P.prototype,z))for(n in F)l[n]&&y(l[n].prototype,C);if(z&&m(E)!==C&&y(E,C),o&&!h(C,R))for(n in W=!0,g(C,R,{configurable:!0,get:function(){return u(this)?this[M]:void 0}}),F)l[n]&&p(l[n],M,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:z,TYPED_ARRAY_TAG:W&&M,aTypedArray:function(t){if(j(t))return t;throw new T("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!y||v(P,t)))return t;throw new T(f(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i,n){if(o){if(i)for(var r in F){var s=l[r];if(s&&h(s.prototype,t))try{delete s.prototype[t]}catch(i){try{s.prototype[t]=e}catch(t){}}}(!C[t]||i)&&_(C,t,i?e:z&&x[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,i){var n,r;if(o){if(y){if(i){for(n in F)if((r=l[n])&&h(r,t))try{delete r[t]}catch(t){}}if(P[t]&&!i)return;try{return _(P,t,i?e:z&&P[t]||e)}catch(t){}}for(n in F)(r=l[n])&&(!r[t]||i)&&_(r,t,e)}},getTypedArrayConstructor:L,isView:function(t){if(!u(t))return!1;var e=d(t);return"DataView"===e||h(F,e)||h(D,e)},isTypedArray:j,TypedArray:P,TypedArrayPrototype:C}},8158:function(t,e,i){"use strict";var n=i(7604),r=i(2196),s=i(4032),a=i(255),o=i(5410),l=i(3599),c=i(1782),u=i(2267),h=i(7683),d=i(5275),f=i(3231),p=i(4514),_=i(7932),g=i(7125),v=i(6590),m=i(9623),y=i(6307),w=i(7793),b=i(4892),k=i(5779),S=i(2088),A=i(2099),I=i(4769),x=o.PROPER,U=o.CONFIGURABLE,E="ArrayBuffer",P="DataView",C="prototype",O="Wrong index",T=I.getterFor(E),R=I.getterFor(P),M=I.set,N=n[E],z=N,W=z&&z[C],F=n[P],D=F&&F[C],L=Object.prototype,j=n.Array,B=n.RangeError,V=r(w),J=r([].reverse),K=v.pack,q=v.unpack,H=function(t){return[255&t]},G=function(t){return[255&t,t>>8&255]},$=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},X=function(t){return K(g(t),23,4)},Q=function(t){return K(t,52,8)},Z=function(t,e,i){c(t[C],e,{configurable:!0,get:function(){return i(this)[e]}})},tt=function(t,e,i,n){var r=R(t),s=_(i);if(s+e>r.byteLength)throw new B(O);var a=r.bytes,o=s+r.byteOffset,l=b(a,o,o+e);return n?l:J(l)},te=function(t,e,i,n,r,s){var a=R(t),o=_(i),l=n(+r),c=!!s;if(o+e>a.byteLength)throw new B(O);for(var u=a.bytes,h=o+a.byteOffset,d=0;d<e;d++)u[h+d]=l[c?d:e-d-1]};if(a){var ti=x&&N.name!==E;!h(function(){N(1)})||!h(function(){new N(-1)})||h(function(){return new N,new N(1.5),new N(NaN),1!==N.length||ti&&!U})?((z=function(t){return d(this,W),k(new N(_(t)),this,z)})[C]=W,W.constructor=z,S(z,N)):ti&&U&&l(N,"name",E),y&&m(D)!==L&&y(D,L);var tn=new F(new z(2)),tr=r(D.setInt8);tn.setInt8(0,0x80000000),tn.setInt8(1,0x80000001),(tn.getInt8(0)||!tn.getInt8(1))&&u(D,{setInt8:function(t,e){tr(this,t,e<<24>>24)},setUint8:function(t,e){tr(this,t,e<<24>>24)}},{unsafe:!0})}else W=(z=function(t){d(this,W);var e=_(t);M(this,{type:E,bytes:V(j(e),0),byteLength:e}),s||(this.byteLength=e,this.detached=!1)})[C],D=(F=function(t,e,i){d(this,D),d(t,W);var n=T(t),r=n.byteLength,a=f(e);if(a<0||a>r)throw new B("Wrong offset");if(i=void 0===i?r-a:p(i),a+i>r)throw new B("Wrong length");M(this,{type:P,buffer:t,byteLength:i,byteOffset:a,bytes:n.bytes}),s||(this.buffer=t,this.byteLength=i,this.byteOffset=a)})[C],s&&(Z(z,"byteLength",T),Z(F,"buffer",R),Z(F,"byteLength",R),Z(F,"byteOffset",R)),u(D,{getInt8:function(t){return tt(this,1,t)[0]<<24>>24},getUint8:function(t){return tt(this,1,t)[0]},getInt16:function(t){var e=tt(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=tt(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Y(tt(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Y(tt(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return q(tt(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return q(tt(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){te(this,1,t,H,e)},setUint8:function(t,e){te(this,1,t,H,e)},setInt16:function(t,e){te(this,2,t,G,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){te(this,2,t,G,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){te(this,4,t,$,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){te(this,4,t,$,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){te(this,4,t,X,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){te(this,8,t,Q,e,arguments.length>2&&arguments[2])}});A(z,E),A(F,P),t.exports={ArrayBuffer:z,DataView:F}},7793:function(t,e,i){"use strict";var n=i(3561),r=i(6926),s=i(4370);t.exports=function(t){for(var e=n(this),i=s(e),a=arguments.length,o=r(a>1?arguments[1]:void 0,i),l=a>2?arguments[2]:void 0,c=void 0===l?i:r(l,i);c>o;)e[o++]=t;return e}},9974:function(t,e,i){"use strict";var n=i(4370);t.exports=function(t,e,i){for(var r=0,s=arguments.length>2?i:n(e),a=new t(s);s>r;)a[r]=e[r++];return a}},4872:function(t,e,i){"use strict";var n=i(3516),r=i(7625),s=i(3561),a=i(9955),o=i(8269),l=i(2049),c=i(4370),u=i(7180),h=i(6573),d=i(7623),f=Array;t.exports=function(t){var e,i,p,_,g,v,m=s(t),y=l(this),w=arguments.length,b=w>1?arguments[1]:void 0,k=void 0!==b;k&&(b=n(b,w>2?arguments[2]:void 0));var S=d(m),A=0;if(S&&!(this===f&&o(S)))for(i=y?new this:[],g=(_=h(m,S)).next;!(p=r(g,_)).done;A++)v=k?a(_,b,[p.value,A],!0):p.value,u(i,A,v);else for(e=c(m),i=y?new this(e):f(e);e>A;A++)v=k?b(m[A],A):m[A],u(i,A,v);return i.length=A,i}},6845:function(t,e,i){"use strict";var n=i(6905),r=i(6926),s=i(4370),a=function(t){return function(e,i,a){var o,l=n(e),c=s(l);if(0===c)return!t&&-1;var u=r(a,c);if(t&&i!=i){for(;c>u;)if((o=l[u++])!=o)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===i)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},3691:function(t,e,i){"use strict";var n=i(3516),r=i(1395),s=i(3561),a=i(4370),o=function(t){var e=1===t;return function(i,o,l){for(var c,u=s(i),h=r(u),d=a(h),f=n(o,l);d-- >0;)if(f(c=h[d],d,u))switch(t){case 0:return c;case 1:return d}return e?-1:void 0}};t.exports={findLast:o(0),findLastIndex:o(1)}},9425:function(t,e,i){"use strict";var n=i(3516),r=i(2196),s=i(1395),a=i(3561),o=i(4370),l=i(4193),c=r([].push),u=function(t){var e=1===t,i=2===t,r=3===t,u=4===t,h=6===t,d=7===t,f=5===t||h;return function(p,_,g,v){for(var m,y,w=a(p),b=s(w),k=o(b),S=n(_,g),A=0,I=v||l,x=e?I(p,k):i||d?I(p,0):void 0;k>A;A++)if((f||A in b)&&(y=S(m=b[A],A,w),t))if(e)x[A]=y;else if(y)switch(t){case 3:return!0;case 5:return m;case 6:return A;case 2:c(x,m)}else switch(t){case 4:return!1;case 7:c(x,m)}return h?-1:r||u?u:x}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},5122:function(t,e,i){"use strict";var n=i(7683);t.exports=function(t,e){var i=[][t];return!!i&&n(function(){i.call(null,e||function(){return 1},1)})}},8466:function(t,e,i){"use strict";var n=i(6382),r=i(3561),s=i(1395),a=i(4370),o=TypeError,l="Reduce of empty array with no initial value",c=function(t){return function(e,i,c,u){var h=r(e),d=s(h),f=a(h);if(n(i),0===f&&c<2)throw new o(l);var p=t?f-1:0,_=t?-1:1;if(c<2)for(;;){if(p in d){u=d[p],p+=_;break}if(p+=_,t?p<0:f<=p)throw new o(l)}for(;t?p>=0:f>p;p+=_)p in d&&(u=i(u,d[p],p,h));return u}};t.exports={left:c(!1),right:c(!0)}},323:function(t,e,i){"use strict";var n=i(4032),r=i(7708),s=TypeError,a=Object.getOwnPropertyDescriptor;t.exports=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(r(t)&&!a(t,"length").writable)throw new s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},4892:function(t,e,i){"use strict";t.exports=i(2196)([].slice)},1836:function(t,e,i){"use strict";var n=i(4892),r=Math.floor,s=function(t,e){var i=t.length;if(i<8)for(var a,o,l=1;l<i;){for(o=l,a=t[l];o&&e(t[o-1],a)>0;)t[o]=t[--o];o!==l++&&(t[o]=a)}else for(var c=r(i/2),u=s(n(t,0,c),e),h=s(n(t,c),e),d=u.length,f=h.length,p=0,_=0;p<d||_<f;)t[p+_]=p<d&&_<f?0>=e(u[p],h[_])?u[p++]:h[_++]:p<d?u[p++]:h[_++];return t};t.exports=s},4109:function(t,e,i){"use strict";var n=i(7708),r=i(2049),s=i(9414),a=i(4735)("species"),o=Array;t.exports=function(t){var e;return n(t)&&(r(e=t.constructor)&&(e===o||n(e.prototype))?e=void 0:s(e)&&null===(e=e[a])&&(e=void 0)),void 0===e?o:e}},4193:function(t,e,i){"use strict";var n=i(4109);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},2152:function(t,e,i){"use strict";var n=i(4370);t.exports=function(t,e){for(var i=n(t),r=new e(i),s=0;s<i;s++)r[s]=t[i-s-1];return r}},5500:function(t,e,i){"use strict";var n=i(4370),r=i(3231),s=RangeError;t.exports=function(t,e,i,a){var o=n(t),l=r(i),c=l<0?o+l:l;if(c>=o||c<0)throw new s("Incorrect index");for(var u=new e(o),h=0;h<o;h++)u[h]=h===c?a:t[h];return u}},9955:function(t,e,i){"use strict";var n=i(3),r=i(4831);t.exports=function(t,e,i,s){try{return s?e(n(i)[0],i[1]):e(i)}catch(e){r(t,"throw",e)}}},856:function(t,e,i){"use strict";var n=i(4735)("iterator"),r=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){r=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){try{if(!e&&!r)return!1}catch(t){return!1}var i=!1;try{var s={};s[n]=function(){return{next:function(){return{done:i=!0}}}},t(s)}catch(t){}return i}},4380:function(t,e,i){"use strict";var n=i(2196),r=n({}.toString),s=n("".slice);t.exports=function(t){return s(r(t),8,-1)}},6471:function(t,e,i){"use strict";var n=i(5384),r=i(8801),s=i(4380),a=i(4735)("toStringTag"),o=Object,l="Arguments"===s(function(){return arguments}()),c=function(t,e){try{return t[e]}catch(t){}};t.exports=n?s:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=c(e=o(t),a))?i:l?s(e):"Object"===(n=s(e))&&r(e.callee)?"Arguments":n}},2088:function(t,e,i){"use strict";var n=i(4461),r=i(9339),s=i(6047),a=i(4773);t.exports=function(t,e,i){for(var o=r(e),l=a.f,c=s.f,u=0;u<o.length;u++){var h=o[u];n(t,h)||i&&n(i,h)||l(t,h,c(e,h))}}},5447:function(t,e,i){"use strict";t.exports=!i(7683)(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},1597:function(t){"use strict";t.exports=function(t,e){return{value:t,done:e}}},3599:function(t,e,i){"use strict";var n=i(4032),r=i(4773),s=i(1056);t.exports=n?function(t,e,i){return r.f(t,e,s(1,i))}:function(t,e,i){return t[e]=i,t}},1056:function(t){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},7180:function(t,e,i){"use strict";var n=i(4032),r=i(4773),s=i(1056);t.exports=function(t,e,i){n?r.f(t,e,s(0,i)):t[e]=i}},1782:function(t,e,i){"use strict";var n=i(2335),r=i(4773);t.exports=function(t,e,i){return i.get&&n(i.get,e,{getter:!0}),i.set&&n(i.set,e,{setter:!0}),r.f(t,e,i)}},1764:function(t,e,i){"use strict";var n=i(8801),r=i(4773),s=i(2335),a=i(9269);t.exports=function(t,e,i,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:e;if(n(i)&&s(i,c,o),o.global)l?t[e]=i:a(e,i);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=i:r.f(t,e,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},2267:function(t,e,i){"use strict";var n=i(1764);t.exports=function(t,e,i){for(var r in e)n(t,r,e[r],i);return t}},9269:function(t,e,i){"use strict";var n=i(7604),r=Object.defineProperty;t.exports=function(t,e){try{r(n,t,{value:e,configurable:!0,writable:!0})}catch(i){n[t]=e}return e}},1946:function(t,e,i){"use strict";var n=i(2123),r=TypeError;t.exports=function(t,e){if(!delete t[e])throw new r("Cannot delete property "+n(e)+" of "+n(t))}},4032:function(t,e,i){"use strict";t.exports=!i(7683)(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4791:function(t,e,i){"use strict";var n,r,s,a,o=i(7604),l=i(5961),c=i(1200),u=o.structuredClone,h=o.ArrayBuffer,d=o.MessageChannel,f=!1;if(c)f=function(t){u(t,{transfer:[t]})};else if(h)try{!d&&(n=l("worker_threads"))&&(d=n.MessageChannel),d&&(r=new d,s=new h(2),a=function(t){r.port1.postMessage(null,[t])},2===s.byteLength&&(a(s),0===s.byteLength&&(f=a)))}catch(t){}t.exports=f},4307:function(t,e,i){"use strict";var n=i(7604),r=i(9414),s=n.document,a=r(s)&&r(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},9481:function(t){"use strict";var e=TypeError;t.exports=function(t){if(t>0x1fffffffffffff)throw e("Maximum allowed index exceeded");return t}},1430:function(t){"use strict";t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8828:function(t){"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},5396:function(t,e,i){"use strict";var n=i(4307)("span").classList,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r},3155:function(t){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},673:function(t,e,i){"use strict";var n=i(667).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},2927:function(t,e,i){"use strict";var n=i(667);t.exports=/MSIE|Trident/.test(n)},9101:function(t,e,i){"use strict";var n=i(667);t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},516:function(t,e,i){"use strict";var n=i(667);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},1037:function(t,e,i){"use strict";t.exports="NODE"===i(8995)},7256:function(t,e,i){"use strict";var n=i(667);t.exports=/web0s(?!.*chrome)/i.test(n)},667:function(t,e,i){"use strict";var n=i(7604).navigator,r=n&&n.userAgent;t.exports=r?String(r):""},6315:function(t,e,i){"use strict";var n,r,s=i(7604),a=i(667),o=s.process,l=s.Deno,c=o&&o.versions||l&&l.version,u=c&&c.v8;u&&(r=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(r=+n[1]),t.exports=r},5827:function(t,e,i){"use strict";var n=i(667).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},8995:function(t,e,i){"use strict";var n=i(7604),r=i(667),s=i(4380),a=function(t){return r.slice(0,t.length)===t};t.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===s(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},2237:function(t,e,i){"use strict";var n=i(2196),r=Error,s=n("".replace),a=String(new r("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);t.exports=function(t,e){if(l&&"string"==typeof t&&!r.prepareStackTrace)for(;e--;)t=s(t,o,"");return t}},5143:function(t,e,i){"use strict";var n=i(3599),r=i(2237),s=i(4623),a=Error.captureStackTrace;t.exports=function(t,e,i,o){s&&(a?a(t,e):n(t,"stack",r(i,o)))}},4623:function(t,e,i){"use strict";var n=i(7683),r=i(1056);t.exports=!n(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",r(1,7)),7!==t.stack)})},5258:function(t,e,i){"use strict";var n=i(7604),r=i(6047).f,s=i(3599),a=i(1764),o=i(9269),l=i(2088),c=i(8696);t.exports=function(t,e){var i,u,h,d,f,p=t.target,_=t.global,g=t.stat;if(i=_?n:g?n[p]||o(p,{}):n[p]&&n[p].prototype)for(u in e){if(d=e[u],h=t.dontCallGetSet?(f=r(i,u))&&f.value:i[u],!c(_?u:p+(g?".":"#")+u,t.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(t.sham||h&&h.sham)&&s(d,"sham",!0),a(i,u,d,t)}}},7683:function(t){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},4016:function(t,e,i){"use strict";i(4891);var n=i(7625),r=i(1764),s=i(4495),a=i(7683),o=i(4735),l=i(3599),c=o("species"),u=RegExp.prototype;t.exports=function(t,e,i,h){var d=o(t),f=!a(function(){var e={};return e[d]=function(){return 7},7!==""[t](e)}),p=f&&!a(function(){var e=!1,i=/a/;return"split"===t&&((i={}).constructor={},i.constructor[c]=function(){return i},i.flags="",i[d]=/./[d]),i.exec=function(){return e=!0,null},i[d](""),!e});if(!f||!p||i){var _=/./[d],g=e(d,""[t],function(t,e,i,r,a){var o=e.exec;return o===s||o===u.exec?f&&!a?{done:!0,value:n(_,e,i,r)}:{done:!0,value:n(t,i,e,r)}:{done:!1}});r(String.prototype,t,g[0]),r(u,d,g[1])}h&&l(u[d],"sham",!0)}},7957:function(t,e,i){"use strict";var n=i(8724),r=Function.prototype,s=r.apply,a=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(s):function(){return a.apply(s,arguments)})},3516:function(t,e,i){"use strict";var n=i(5344),r=i(6382),s=i(8724),a=n(n.bind);t.exports=function(t,e){return r(t),void 0===e?t:s?a(t,e):function(){return t.apply(e,arguments)}}},8724:function(t,e,i){"use strict";t.exports=!i(7683)(function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},7625:function(t,e,i){"use strict";var n=i(8724),r=Function.prototype.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},5410:function(t,e,i){"use strict";var n=i(4032),r=i(4461),s=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=r(s,"name"),l=o&&(!n||n&&a(s,"name").configurable);t.exports={EXISTS:o,PROPER:o&&"something"===(function(){}).name,CONFIGURABLE:l}},1190:function(t,e,i){"use strict";var n=i(2196),r=i(6382);t.exports=function(t,e,i){try{return n(r(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}}},5344:function(t,e,i){"use strict";var n=i(4380),r=i(2196);t.exports=function(t){if("Function"===n(t))return r(t)}},2196:function(t,e,i){"use strict";var n=i(8724),r=Function.prototype,s=r.call,a=n&&r.bind.bind(s,s);t.exports=n?a:function(t){return function(){return s.apply(t,arguments)}}},5961:function(t,e,i){"use strict";var n=i(7604),r=i(1037);t.exports=function(t){if(r){try{return n.process.getBuiltinModule(t)}catch(t){}try{return Function('return require("'+t+'")')()}catch(t){}}}},3579:function(t,e,i){"use strict";var n=i(7604),r=i(8801);t.exports=function(t,e){var i;return arguments.length<2?r(i=n[t])?i:void 0:n[t]&&n[t][e]}},1147:function(t){"use strict";t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},7623:function(t,e,i){"use strict";var n=i(6471),r=i(5378),s=i(4449),a=i(577),o=i(4735)("iterator");t.exports=function(t){if(!s(t))return r(t,o)||r(t,"@@iterator")||a[n(t)]}},6573:function(t,e,i){"use strict";var n=i(7625),r=i(6382),s=i(3),a=i(2123),o=i(7623),l=TypeError;t.exports=function(t,e){var i=arguments.length<2?o(t):e;if(r(i))return s(n(i,t));throw new l(a(t)+" is not iterable")}},5378:function(t,e,i){"use strict";var n=i(6382),r=i(4449);t.exports=function(t,e){var i=t[e];return r(i)?void 0:n(i)}},5193:function(t,e,i){"use strict";var n=i(6382),r=i(3),s=i(7625),a=i(3231),o=i(1147),l="Invalid size",c=RangeError,u=TypeError,h=Math.max,d=function(t,e){this.set=t,this.size=h(e,0),this.has=n(t.has),this.keys=n(t.keys)};d.prototype={getIterator:function(){return o(r(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}},t.exports=function(t){r(t);var e=+t.size;if(e!=e)throw new u(l);var i=a(e);if(i<0)throw new c(l);return new d(t,i)}},4242:function(t,e,i){"use strict";var n=i(2196),r=i(3561),s=Math.floor,a=n("".charAt),o=n("".replace),l=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,i,n,h,d){var f=i+t.length,p=n.length,_=u;return void 0!==h&&(h=r(h),_=c),o(d,_,function(r,o){var c;switch(a(o,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,i);case"'":return l(e,f);case"<":c=h[l(o,1,-1)];break;default:var u=+o;if(0===u)return r;if(u>p){var d=s(u/10);if(0===d)return r;if(d<=p)return void 0===n[d-1]?a(o,1):n[d-1]+a(o,1);return r}c=n[u-1]}return void 0===c?"":c})}},7604:function(t,e,i){"use strict";var n=function(t){return t&&t.Math===Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4461:function(t,e,i){"use strict";var n=i(2196),r=i(3561),s=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(r(t),e)}},1241:function(t){"use strict";t.exports={}},4713:function(t){"use strict";t.exports=function(t,e){try{1==arguments.length?console.error(t):console.error(t,e)}catch(t){}}},1665:function(t,e,i){"use strict";t.exports=i(3579)("document","documentElement")},3825:function(t,e,i){"use strict";var n=i(4032),r=i(7683),s=i(4307);t.exports=!n&&!r(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},6590:function(t){"use strict";var e=Array,i=Math.abs,n=Math.pow,r=Math.floor,s=Math.log,a=Math.LN2;t.exports={pack:function(t,o,l){var c,u,h,d=e(l),f=8*l-o-1,p=(1<<f)-1,_=p>>1,g=23===o?n(2,-24)-n(2,-77):0,v=+(t<0||0===t&&1/t<0),m=0;for((t=i(t))!=t||t===1/0?(u=+(t!=t),c=p):(h=n(2,-(c=r(s(t)/a))),t*h<1&&(c--,h*=2),c+_>=1?t+=g/h:t+=g*n(2,1-_),t*h>=2&&(c++,h/=2),c+_>=p?(u=0,c=p):c+_>=1?(u=(t*h-1)*n(2,o),c+=_):(u=t*n(2,_-1)*n(2,o),c=0));o>=8;)d[m++]=255&u,u/=256,o-=8;for(c=c<<o|u,f+=o;f>0;)d[m++]=255&c,c/=256,f-=8;return d[m-1]|=128*v,d},unpack:function(t,e){var i,r=t.length,s=8*r-e-1,a=(1<<s)-1,o=a>>1,l=s-7,c=r-1,u=t[c--],h=127&u;for(u>>=7;l>0;)h=256*h+t[c--],l-=8;for(i=h&(1<<-l)-1,h>>=-l,l+=e;l>0;)i=256*i+t[c--],l-=8;if(0===h)h=1-o;else{if(h===a)return i?NaN:u?-1/0:1/0;i+=n(2,e),h-=o}return(u?-1:1)*i*n(2,h-e)}}},1395:function(t,e,i){"use strict";var n=i(2196),r=i(7683),s=i(4380),a=Object,o=n("".split);t.exports=r(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===s(t)?o(t,""):a(t)}:a},5779:function(t,e,i){"use strict";var n=i(8801),r=i(9414),s=i(6307);t.exports=function(t,e,i){var a,o;return s&&n(a=e.constructor)&&a!==i&&r(o=a.prototype)&&o!==i.prototype&&s(t,o),t}},3134:function(t,e,i){"use strict";var n=i(2196),r=i(8801),s=i(1929),a=n(Function.toString);r(s.inspectSource)||(s.inspectSource=function(t){return a(t)}),t.exports=s.inspectSource},7204:function(t,e,i){"use strict";var n=i(9414),r=i(3599);t.exports=function(t,e){n(e)&&"cause"in e&&r(t,"cause",e.cause)}},4769:function(t,e,i){"use strict";var n,r,s,a=i(7218),o=i(7604),l=i(9414),c=i(3599),u=i(4461),h=i(1929),d=i(5555),f=i(1241),p="Object already initialized",_=o.TypeError,g=o.WeakMap;if(a||h.state){var v=h.state||(h.state=new g);v.get=v.get,v.has=v.has,v.set=v.set,n=function(t,e){if(v.has(t))throw new _(p);return e.facade=t,v.set(t,e),e},r=function(t){return v.get(t)||{}},s=function(t){return v.has(t)}}else{var m=d("state");f[m]=!0,n=function(t,e){if(u(t,m))throw new _(p);return e.facade=t,c(t,m,e),e},r=function(t){return u(t,m)?t[m]:{}},s=function(t){return u(t,m)}}t.exports={set:n,get:r,has:s,enforce:function(t){return s(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var i;if(!l(e)||(i=r(e)).type!==t)throw new _("Incompatible receiver, "+t+" required");return i}}}},8269:function(t,e,i){"use strict";var n=i(4735),r=i(577),s=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[s]===t)}},7708:function(t,e,i){"use strict";var n=i(4380);t.exports=Array.isArray||function(t){return"Array"===n(t)}},8003:function(t,e,i){"use strict";var n=i(6471);t.exports=function(t){var e=n(t);return"BigInt64Array"===e||"BigUint64Array"===e}},8801:function(t){"use strict";var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},2049:function(t,e,i){"use strict";var n=i(2196),r=i(7683),s=i(8801),a=i(6471),o=i(3579),l=i(3134),c=function(){},u=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=n(h.exec),f=!h.test(c),p=function(t){if(!s(t))return!1;try{return u(c,[],t),!0}catch(t){return!1}},_=function(t){if(!s(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!d(h,l(t))}catch(t){return!0}};_.sham=!0,t.exports=!u||r(function(){var t;return p(p.call)||!p(Object)||!p(function(){t=!0})||t})?_:p},8696:function(t,e,i){"use strict";var n=i(7683),r=i(8801),s=/#|\.prototype\./,a=function(t,e){var i=l[o(t)];return i===u||i!==c&&(r(e)?n(e):!!e)},o=a.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";t.exports=a},6107:function(t,e,i){"use strict";var n=i(9414),r=Math.floor;t.exports=Number.isInteger||function(t){return!n(t)&&isFinite(t)&&r(t)===t}},4449:function(t){"use strict";t.exports=function(t){return null==t}},9414:function(t,e,i){"use strict";var n=i(8801);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},2585:function(t,e,i){"use strict";var n=i(9414);t.exports=function(t){return n(t)||null===t}},4727:function(t){"use strict";t.exports=!1},4840:function(t,e,i){"use strict";var n=i(9414),r=i(4380),s=i(4735)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[s])?!!e:"RegExp"===r(t))}},4137:function(t,e,i){"use strict";var n=i(3579),r=i(8801),s=i(5533),a=i(948),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return r(e)&&s(e.prototype,o(t))}},8343:function(t,e,i){"use strict";var n=i(7625);t.exports=function(t,e,i){for(var r,s,a=i?t:t.iterator,o=t.next;!(r=n(o,a)).done;)if(void 0!==(s=e(r.value)))return s}},1552:function(t,e,i){"use strict";var n=i(3516),r=i(7625),s=i(3),a=i(2123),o=i(8269),l=i(4370),c=i(5533),u=i(6573),h=i(7623),d=i(4831),f=TypeError,p=function(t,e){this.stopped=t,this.result=e},_=p.prototype;t.exports=function(t,e,i){var g,v,m,y,w,b,k,S=i&&i.that,A=!!(i&&i.AS_ENTRIES),I=!!(i&&i.IS_RECORD),x=!!(i&&i.IS_ITERATOR),U=!!(i&&i.INTERRUPTED),E=n(e,S),P=function(t){return g&&d(g,"normal",t),new p(!0,t)},C=function(t){return A?(s(t),U?E(t[0],t[1],P):E(t[0],t[1])):U?E(t,P):E(t)};if(I)g=t.iterator;else if(x)g=t;else{if(!(v=h(t)))throw new f(a(t)+" is not iterable");if(o(v)){for(m=0,y=l(t);y>m;m++)if((w=C(t[m]))&&c(_,w))return w;return new p(!1)}g=u(t,v)}for(b=I?t.next:g.next;!(k=r(b,g)).done;){try{w=C(k.value)}catch(t){d(g,"throw",t)}if("object"==typeof w&&w&&c(_,w))return w}return new p(!1)}},4831:function(t,e,i){"use strict";var n=i(7625),r=i(3),s=i(5378);t.exports=function(t,e,i){var a,o;r(t);try{if(!(a=s(t,"return"))){if("throw"===e)throw i;return i}a=n(a,t)}catch(t){o=!0,a=t}if("throw"===e)throw i;if(o)throw a;return r(a),i}},7302:function(t,e,i){"use strict";var n=i(3805).IteratorPrototype,r=i(5012),s=i(1056),a=i(2099),o=i(577),l=function(){return this};t.exports=function(t,e,i,c){var u=e+" Iterator";return t.prototype=r(n,{next:s(+!c,i)}),a(t,u,!1,!0),o[u]=l,t}},9866:function(t,e,i){"use strict";var n=i(7625),r=i(5012),s=i(3599),a=i(2267),o=i(4735),l=i(4769),c=i(5378),u=i(3805).IteratorPrototype,h=i(1597),d=i(4831),f=o("toStringTag"),p="IteratorHelper",_="WrapForValidIterator",g=l.set,v=function(t){var e=l.getterFor(t?_:p);return a(r(u),{next:function(){var i=e(this);if(t)return i.nextHandler();if(i.done)return h(void 0,!0);try{var n=i.nextHandler();return i.returnHandlerResult?n:h(n,i.done)}catch(t){throw i.done=!0,t}},return:function(){var i=e(this),r=i.iterator;if(i.done=!0,t){var s=c(r,"return");return s?n(s,r):h(void 0,!0)}if(i.inner)try{d(i.inner.iterator,"normal")}catch(t){return d(r,"throw",t)}return r&&d(r,"normal"),h(void 0,!0)}})},m=v(!0),y=v(!1);s(y,f,"Iterator Helper"),t.exports=function(t,e,i){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=e?_:p,r.returnHandlerResult=!!i,r.nextHandler=t,r.counter=0,r.done=!1,g(this,r)};return n.prototype=e?m:y,n}},9636:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(4727),a=i(5410),o=i(8801),l=i(7302),c=i(9623),u=i(6307),h=i(2099),d=i(3599),f=i(1764),p=i(4735),_=i(577),g=i(3805),v=a.PROPER,m=a.CONFIGURABLE,y=g.IteratorPrototype,w=g.BUGGY_SAFARI_ITERATORS,b=p("iterator"),k="keys",S="values",A="entries",I=function(){return this};t.exports=function(t,e,i,a,p,g,x){l(i,e,a);var U,E,P,C=function(t){if(t===p&&N)return N;if(!w&&t&&t in R)return R[t];switch(t){case k:case S:case A:return function(){return new i(this,t)}}return function(){return new i(this)}},O=e+" Iterator",T=!1,R=t.prototype,M=R[b]||R["@@iterator"]||p&&R[p],N=!w&&M||C(p),z="Array"===e&&R.entries||M;if(z&&(U=c(z.call(new t)))!==Object.prototype&&U.next&&(!s&&c(U)!==y&&(u?u(U,y):o(U[b])||f(U,b,I)),h(U,O,!0,!0),s&&(_[O]=I)),v&&p===S&&M&&M.name!==S&&(!s&&m?d(R,"name",S):(T=!0,N=function(){return r(M,this)})),p)if(E={values:C(S),keys:g?N:C(k),entries:C(A)},x)for(P in E)!w&&!T&&P in R||f(R,P,E[P]);else n({target:e,proto:!0,forced:w||T},E);return(!s||x)&&R[b]!==N&&f(R,b,N,{name:p}),_[e]=N,E}},2165:function(t,e,i){"use strict";var n=i(7625),r=i(6382),s=i(3),a=i(1147),o=i(9866),l=i(9955),c=o(function(){var t=this.iterator,e=s(n(this.next,t));if(!(this.done=!!e.done))return l(t,this.mapper,[e.value,this.counter++],!0)});t.exports=function(t){return s(this),r(t),new c(a(this),{mapper:t})}},3805:function(t,e,i){"use strict";var n,r,s,a=i(7683),o=i(8801),l=i(9414),c=i(5012),u=i(9623),h=i(1764),d=i(4735),f=i(4727),p=d("iterator"),_=!1;[].keys&&("next"in(s=[].keys())?(r=u(u(s)))!==Object.prototype&&(n=r):_=!0),!l(n)||a(function(){var t={};return n[p].call(t)!==t})?n={}:f&&(n=c(n)),o(n[p])||h(n,p,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:_}},577:function(t){"use strict";t.exports={}},4370:function(t,e,i){"use strict";var n=i(4514);t.exports=function(t){return n(t.length)}},2335:function(t,e,i){"use strict";var n=i(2196),r=i(7683),s=i(8801),a=i(4461),o=i(4032),l=i(5410).CONFIGURABLE,c=i(3134),u=i(4769),h=u.enforce,d=u.get,f=String,p=Object.defineProperty,_=n("".slice),g=n("".replace),v=n([].join),m=o&&!r(function(){return 8!==p(function(){},"length",{value:8}).length}),y=String(String).split("String"),w=t.exports=function(t,e,i){"Symbol("===_(f(e),0,7)&&(e="["+g(f(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(o?p(t,"name",{value:e,configurable:!0}):t.name=e),m&&i&&a(i,"arity")&&t.length!==i.arity&&p(t,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?o&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=h(t);return a(n,"source")||(n.source=v(y,"string"==typeof e?e:"")),t};Function.prototype.toString=w(function(){return s(this)&&d(this).source||c(this)},"toString")},6424:function(t,e,i){"use strict";var n=i(6434),r=i(3670),s=Math.abs;t.exports=function(t,e,i,a){var o=+t,l=s(o),c=n(o);if(l<a)return c*r(l/a/e)*a*e;var u=(1+e/2220446049250313e-31)*l,h=u-(u-l);return h>i||h!=h?1/0*c:c*h}},7125:function(t,e,i){"use strict";var n=i(6424);t.exports=Math.fround||function(t){return n(t,11920928955078125e-23,34028234663852886e22,11754943508222875e-54)}},3670:function(t){"use strict";t.exports=function(t){return t+0x10000000000000-0x10000000000000}},6434:function(t){"use strict";t.exports=Math.sign||function(t){var e=+t;return 0===e||e!=e?e:e<0?-1:1}},7553:function(t){"use strict";var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?i:e)(n)}},1855:function(t,e,i){"use strict";var n,r,s,a,o,l=i(7604),c=i(7665),u=i(3516),h=i(6877).set,d=i(7421),f=i(516),p=i(9101),_=i(7256),g=i(1037),v=l.MutationObserver||l.WebKitMutationObserver,m=l.document,y=l.process,w=l.Promise,b=c("queueMicrotask");if(!b){var k=new d,S=function(){var t,e;for(g&&(t=y.domain)&&t.exit();e=k.get();)try{e()}catch(t){throw k.head&&n(),t}t&&t.enter()};f||g||_||!v||!m?!p&&w&&w.resolve?((a=w.resolve(void 0)).constructor=w,o=u(a.then,a),n=function(){o(S)}):g?n=function(){y.nextTick(S)}:(h=u(h,l),n=function(){h(S)}):(r=!0,s=m.createTextNode(""),new v(S).observe(s,{characterData:!0}),n=function(){s.data=r=!r}),b=function(t){k.head||n(),k.add(t)}}t.exports=b},7895:function(t,e,i){"use strict";var n=i(6382),r=TypeError,s=function(t){var e,i;this.promise=new t(function(t,n){if(void 0!==e||void 0!==i)throw new r("Bad Promise constructor");e=t,i=n}),this.resolve=n(e),this.reject=n(i)};t.exports.f=function(t){return new s(t)}},9871:function(t,e,i){"use strict";var n=i(5011);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:n(t)}},1353:function(t,e,i){"use strict";var n=i(4032),r=i(2196),s=i(7625),a=i(7683),o=i(1500),l=i(3473),c=i(185),u=i(3561),h=i(1395),d=Object.assign,f=Object.defineProperty,p=r([].concat);t.exports=!d||a(function(){if(n&&1!==d({b:1},d(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[i]=7,r.split("").forEach(function(t){e[t]=t}),7!==d({},t)[i]||o(d({},e)).join("")!==r})?function(t,e){for(var i=u(t),r=arguments.length,a=1,d=l.f,f=c.f;r>a;)for(var _,g=h(arguments[a++]),v=d?p(o(g),d(g)):o(g),m=v.length,y=0;m>y;)_=v[y++],(!n||s(f,g,_))&&(i[_]=g[_]);return i}:d},5012:function(t,e,i){"use strict";var n,r=i(3),s=i(9549),a=i(3155),o=i(1241),l=i(1665),c=i(4307),u=i(5555),h="prototype",d="script",f=u("IE_PROTO"),p=function(){},_=function(t){return"<"+d+">"+t+"</"+d+">"},g=function(t){t.write(_("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){var t,e=c("iframe");return e.style.display="none",l.appendChild(e),e.src=String("java"+d+":"),(t=e.contentWindow.document).open(),t.write(_("document.F=Object")),t.close(),t.F},m=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}m="undefined"!=typeof document?document.domain&&n?g(n):v():g(n);for(var t=a.length;t--;)delete m[h][a[t]];return m()};o[f]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(p[h]=r(t),i=new p,p[h]=null,i[f]=t):i=m(),void 0===e?i:s.f(i,e)}},9549:function(t,e,i){"use strict";var n=i(4032),r=i(578),s=i(4773),a=i(3),o=i(6905),l=i(1500);e.f=n&&!r?Object.defineProperties:function(t,e){a(t);for(var i,n=o(e),r=l(e),c=r.length,u=0;c>u;)s.f(t,i=r[u++],n[i]);return t}},4773:function(t,e,i){"use strict";var n=i(4032),r=i(3825),s=i(578),a=i(3),o=i(5661),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",f="writable";e.f=n?s?function(t,e,i){if(a(t),e=o(e),a(i),"function"==typeof t&&"prototype"===e&&"value"in i&&f in i&&!i[f]){var n=u(t,e);n&&n[f]&&(t[e]=i.value,i={configurable:d in i?i[d]:n[d],enumerable:h in i?i[h]:n[h],writable:!1})}return c(t,e,i)}:c:function(t,e,i){if(a(t),e=o(e),a(i),r)try{return c(t,e,i)}catch(t){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},6047:function(t,e,i){"use strict";var n=i(4032),r=i(7625),s=i(185),a=i(1056),o=i(6905),l=i(5661),c=i(4461),u=i(3825),h=Object.getOwnPropertyDescriptor;e.f=n?h:function(t,e){if(t=o(t),e=l(e),u)try{return h(t,e)}catch(t){}if(c(t,e))return a(!r(s.f,t,e),t[e])}},1452:function(t,e,i){"use strict";var n=i(9192),r=i(3155).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,r)}},3473:function(t,e){"use strict";e.f=Object.getOwnPropertySymbols},9623:function(t,e,i){"use strict";var n=i(4461),r=i(8801),s=i(3561),a=i(5555),o=i(5447),l=a("IE_PROTO"),c=Object,u=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=s(t);if(n(e,l))return e[l];var i=e.constructor;return r(i)&&e instanceof i?i.prototype:e instanceof c?u:null}},5533:function(t,e,i){"use strict";t.exports=i(2196)({}.isPrototypeOf)},9192:function(t,e,i){"use strict";var n=i(2196),r=i(4461),s=i(6905),a=i(6845).indexOf,o=i(1241),l=n([].push);t.exports=function(t,e){var i,n=s(t),c=0,u=[];for(i in n)!r(o,i)&&r(n,i)&&l(u,i);for(;e.length>c;)r(n,i=e[c++])&&(~a(u,i)||l(u,i));return u}},1500:function(t,e,i){"use strict";var n=i(9192),r=i(3155);t.exports=Object.keys||function(t){return n(t,r)}},185:function(t,e){"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!i.call({1:2},1)?function(t){var e=n(this,t);return!!e&&e.enumerable}:i},6307:function(t,e,i){"use strict";var n=i(1190),r=i(9414),s=i(1826),a=i(5982);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=n(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return s(i),a(n),r(i)&&(e?t(i,n):i.__proto__=n),i}}():void 0)},2986:function(t,e,i){"use strict";var n=i(7625),r=i(8801),s=i(9414),a=TypeError;t.exports=function(t,e){var i,o;if("string"===e&&r(i=t.toString)&&!s(o=n(i,t))||r(i=t.valueOf)&&!s(o=n(i,t))||"string"!==e&&r(i=t.toString)&&!s(o=n(i,t)))return o;throw new a("Can't convert object to primitive value")}},9339:function(t,e,i){"use strict";var n=i(3579),r=i(2196),s=i(1452),a=i(3473),o=i(3),l=r([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=s.f(o(t)),i=a.f;return i?l(e,i(t)):e}},8099:function(t){"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},9576:function(t,e,i){"use strict";var n=i(7604),r=i(8794),s=i(8801),a=i(8696),o=i(3134),l=i(4735),c=i(8995),u=i(4727),h=i(6315),d=r&&r.prototype,f=l("species"),p=!1,_=s(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:a("Promise",function(){var t=o(r),e=t!==String(r);if(!e&&66===h||u&&!(d.catch&&d.finally))return!0;if(!h||h<51||!/native code/.test(t)){var i=new r(function(t){t(1)}),n=function(t){t(function(){},function(){})};if((i.constructor={})[f]=n,!(p=i.then(function(){})instanceof n))return!0}return!e&&("BROWSER"===c||"DENO"===c)&&!_}),REJECTION_EVENT:_,SUBCLASSING:p}},8794:function(t,e,i){"use strict";t.exports=i(7604).Promise},5002:function(t,e,i){"use strict";var n=i(3),r=i(9414),s=i(7895);t.exports=function(t,e){if(n(t),r(e)&&e.constructor===t)return e;var i=s.f(t);return(0,i.resolve)(e),i.promise}},3797:function(t,e,i){"use strict";var n=i(8794),r=i(856);t.exports=i(9576).CONSTRUCTOR||!r(function(t){n.all(t).then(void 0,function(){})})},6252:function(t,e,i){"use strict";var n=i(4773).f;t.exports=function(t,e,i){i in t||n(t,i,{configurable:!0,get:function(){return e[i]},set:function(t){e[i]=t}})}},7421:function(t){"use strict";var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},i=this.tail;i?i.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},5806:function(t,e,i){"use strict";var n=i(7625),r=i(3),s=i(8801),a=i(4380),o=i(4495),l=TypeError;t.exports=function(t,e){var i=t.exec;if(s(i)){var c=n(i,t,e);return null!==c&&r(c),c}if("RegExp"===a(t))return n(o,t,e);throw new l("RegExp#exec called on incompatible receiver")}},4495:function(t,e,i){"use strict";var n,r,s=i(7625),a=i(2196),o=i(5011),l=i(6351),c=i(2665),u=i(3997),h=i(5012),d=i(4769).get,f=i(6927),p=i(7514),_=u("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,v=g,m=a("".charAt),y=a("".indexOf),w=a("".replace),b=a("".slice),k=(r=/b*/g,s(g,n=/a/,"a"),s(g,r,"a"),0!==n.lastIndex||0!==r.lastIndex),S=c.BROKEN_CARET,A=void 0!==/()??/.exec("")[1];(k||A||S||f||p)&&(v=function(t){var e,i,n,r,a,c,u,f=d(this),p=o(t),I=f.raw;if(I)return I.lastIndex=this.lastIndex,e=s(v,I,p),this.lastIndex=I.lastIndex,e;var x=f.groups,U=S&&this.sticky,E=s(l,this),P=this.source,C=0,O=p;if(U&&(-1===y(E=w(E,"y",""),"g")&&(E+="g"),O=b(p,this.lastIndex),this.lastIndex>0&&(!this.multiline||this.multiline&&"\n"!==m(p,this.lastIndex-1))&&(P="(?: "+P+")",O=" "+O,C++),i=RegExp("^(?:"+P+")",E)),A&&(i=RegExp("^"+P+"$(?!\\s)",E)),k&&(n=this.lastIndex),r=s(g,U?i:this,O),U?r?(r.input=b(r.input,C),r[0]=b(r[0],C),r.index=this.lastIndex,this.lastIndex+=r[0].length):this.lastIndex=0:k&&r&&(this.lastIndex=this.global?r.index+r[0].length:n),A&&r&&r.length>1&&s(_,r[0],i,function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)}),r&&x)for(a=0,r.groups=c=h(null);a<x.length;a++)c[(u=x[a])[0]]=r[u[1]];return r}),t.exports=v},6351:function(t,e,i){"use strict";var n=i(3);t.exports=function(){var t=n(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},1678:function(t,e,i){"use strict";var n=i(7625),r=i(4461),s=i(5533),a=i(6351),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return!(void 0===e&&!("flags"in o)&&!r(t,"flags")&&s(o,t))?e:n(a,t)}},2665:function(t,e,i){"use strict";var n=i(7683),r=i(7604).RegExp,s=n(function(){var t=r("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),a=s||n(function(){return!r("a","y").sticky});t.exports={BROKEN_CARET:s||n(function(){var t=r("^r","gy");return t.lastIndex=2,null!==t.exec("str")}),MISSED_STICKY:a,UNSUPPORTED_Y:s}},6927:function(t,e,i){"use strict";var n=i(7683),r=i(7604).RegExp;t.exports=n(function(){var t=r(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})},7514:function(t,e,i){"use strict";var n=i(7683),r=i(7604).RegExp;t.exports=n(function(){var t=r("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})},1826:function(t,e,i){"use strict";var n=i(4449),r=TypeError;t.exports=function(t){if(n(t))throw new r("Can't call method on "+t);return t}},7665:function(t,e,i){"use strict";var n=i(7604),r=i(4032),s=Object.getOwnPropertyDescriptor;t.exports=function(t){if(!r)return n[t];var e=s(n,t);return e&&e.value}},7906:function(t,e,i){"use strict";var n=i(3110),r=i(9121),s=n.Set,a=n.add;t.exports=function(t){var e=new s;return r(t,function(t){a(e,t)}),e}},9212:function(t,e,i){"use strict";var n=i(6148),r=i(3110),s=i(7906),a=i(2830),o=i(5193),l=i(9121),c=i(8343),u=r.has,h=r.remove;t.exports=function(t){var e=n(this),i=o(t),r=s(e);return a(e)<=i.size?l(e,function(t){i.includes(t)&&h(r,t)}):c(i.getIterator(),function(t){u(e,t)&&h(r,t)}),r}},3110:function(t,e,i){"use strict";var n=i(2196),r=Set.prototype;t.exports={Set:Set,add:n(r.add),has:n(r.has),remove:n(r.delete),proto:r}},826:function(t,e,i){"use strict";var n=i(6148),r=i(3110),s=i(2830),a=i(5193),o=i(9121),l=i(8343),c=r.Set,u=r.add,h=r.has;t.exports=function(t){var e=n(this),i=a(t),r=new c;return s(e)>i.size?l(i.getIterator(),function(t){h(e,t)&&u(r,t)}):o(e,function(t){i.includes(t)&&u(r,t)}),r}},237:function(t,e,i){"use strict";var n=i(6148),r=i(3110).has,s=i(2830),a=i(5193),o=i(9121),l=i(8343),c=i(4831);t.exports=function(t){var e=n(this),i=a(t);if(s(e)<=i.size)return!1!==o(e,function(t){if(i.includes(t))return!1},!0);var u=i.getIterator();return!1!==l(u,function(t){if(r(e,t))return c(u,"normal",!1)})}},3802:function(t,e,i){"use strict";var n=i(6148),r=i(2830),s=i(9121),a=i(5193);t.exports=function(t){var e=n(this),i=a(t);return!(r(e)>i.size)&&!1!==s(e,function(t){if(!i.includes(t))return!1},!0)}},6083:function(t,e,i){"use strict";var n=i(6148),r=i(3110).has,s=i(2830),a=i(5193),o=i(8343),l=i(4831);t.exports=function(t){var e=n(this),i=a(t);if(s(e)<i.size)return!1;var c=i.getIterator();return!1!==o(c,function(t){if(!r(e,t))return l(c,"normal",!1)})}},9121:function(t,e,i){"use strict";var n=i(2196),r=i(8343),s=i(3110),a=s.Set,o=s.proto,l=n(o.forEach),c=n(o.keys),u=c(new a).next;t.exports=function(t,e,i){return i?r({iterator:c(t),next:u},e):l(t,e)}},7768:function(t,e,i){"use strict";var n=i(3579),r=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s=function(t){return{size:t,has:function(){return!0},keys:function(){throw Error("e")}}};t.exports=function(t,e){var i=n("Set");try{new i()[t](r(0));try{return new i()[t](r(-1)),!1}catch(n){if(!e)return!0;try{return new i()[t](s(-1/0)),!1}catch(n){var a=new i;return a.add(1),a.add(2),e(a[t](s(1/0)))}}}catch(t){return!1}}},2830:function(t,e,i){"use strict";t.exports=i(1190)(i(3110).proto,"size","get")||function(t){return t.size}},8285:function(t,e,i){"use strict";var n=i(3579),r=i(1782),s=i(4735),a=i(4032),o=s("species");t.exports=function(t){var e=n(t);a&&e&&!e[o]&&r(e,o,{configurable:!0,get:function(){return this}})}},7782:function(t,e,i){"use strict";var n=i(6148),r=i(3110),s=i(7906),a=i(5193),o=i(8343),l=r.add,c=r.has,u=r.remove;t.exports=function(t){var e=n(this),i=a(t).getIterator(),r=s(e);return o(i,function(t){c(e,t)?u(r,t):l(r,t)}),r}},2099:function(t,e,i){"use strict";var n=i(4773).f,r=i(4461),s=i(4735)("toStringTag");t.exports=function(t,e,i){t&&!i&&(t=t.prototype),t&&!r(t,s)&&n(t,s,{configurable:!0,value:e})}},3528:function(t,e,i){"use strict";var n=i(6148),r=i(3110).add,s=i(7906),a=i(5193),o=i(8343);t.exports=function(t){var e=n(this),i=a(t).getIterator(),l=s(e);return o(i,function(t){r(l,t)}),l}},5555:function(t,e,i){"use strict";var n=i(3997),r=i(8916),s=n("keys");t.exports=function(t){return s[t]||(s[t]=r(t))}},1929:function(t,e,i){"use strict";var n=i(4727),r=i(7604),s=i(9269),a="__core-js_shared__",o=t.exports=r[a]||s(a,{});(o.versions||(o.versions=[])).push({version:"3.41.0",mode:n?"pure":"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})},3997:function(t,e,i){"use strict";var n=i(1929);t.exports=function(t,e){return n[t]||(n[t]=e||{})}},4577:function(t,e,i){"use strict";var n=i(3),r=i(7592),s=i(4449),a=i(4735)("species");t.exports=function(t,e){var i,o=n(t).constructor;return void 0===o||s(i=n(o)[a])?e:r(i)}},5059:function(t,e,i){"use strict";var n=i(2196),r=i(3231),s=i(5011),a=i(1826),o=n("".charAt),l=n("".charCodeAt),c=n("".slice),u=function(t){return function(e,i){var n,u,h=s(a(e)),d=r(i),f=h.length;return d<0||d>=f?t?"":void 0:(n=l(h,d))<55296||n>56319||d+1===f||(u=l(h,d+1))<56320||u>57343?t?o(h,d):n:t?c(h,d,d+2):(n-55296<<10)+(u-56320)+65536}};t.exports={codeAt:u(!1),charAt:u(!0)}},6793:function(t,e,i){"use strict";var n=i(2196),r=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",o=RangeError,l=n(s.exec),c=Math.floor,u=String.fromCharCode,h=n("".charCodeAt),d=n([].join),f=n([].push),p=n("".replace),_=n("".split),g=n("".toLowerCase),v=function(t){for(var e=[],i=0,n=t.length;i<n;){var r=h(t,i++);if(r>=55296&&r<=56319&&i<n){var s=h(t,i++);(64512&s)==56320?f(e,((1023&r)<<10)+(1023&s)+65536):(f(e,r),i--)}else f(e,r)}return e},m=function(t){return t+22+75*(t<26)},y=function(t,e,i){var n=0;for(t=i?c(t/700):t>>1,t+=c(t/e);t>455;)t=c(t/35),n+=36;return c(n+36*t/(t+38))},w=function(t){var e,i,n=[],r=(t=v(t)).length,s=128,l=0,h=72;for(e=0;e<t.length;e++)(i=t[e])<128&&f(n,u(i));var p=n.length,_=p;for(p&&f(n,"-");_<r;){var g=0x7fffffff;for(e=0;e<t.length;e++)(i=t[e])>=s&&i<g&&(g=i);var w=_+1;if(g-s>c((0x7fffffff-l)/w))throw new o(a);for(l+=(g-s)*w,s=g,e=0;e<t.length;e++){if((i=t[e])<s&&++l>0x7fffffff)throw new o(a);if(i===s){for(var b=l,k=36;;){var S=k<=h?1:k>=h+26?26:k-h;if(b<S)break;var A=b-S,I=36-S;f(n,u(m(S+A%I))),b=c(A/I),k+=36}f(n,u(m(b))),h=y(l,w,_===p),l=0,_++}}l++,s++}return d(n,"")};t.exports=function(t){var e,i,n=[],a=_(p(g(t),s,"."),".");for(e=0;e<a.length;e++)f(n,l(r,i=a[e])?"xn--"+w(i):i);return d(n,".")}},1200:function(t,e,i){"use strict";var n=i(7604),r=i(7683),s=i(6315),a=i(8995),o=n.structuredClone;t.exports=!!o&&!r(function(){if("DENO"===a&&s>92||"NODE"===a&&s>94||"BROWSER"===a&&s>97)return!1;var t=new ArrayBuffer(8),e=o(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})},6043:function(t,e,i){"use strict";var n=i(6315),r=i(7683),s=i(7604).String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41})},6877:function(t,e,i){"use strict";var n,r,s,a,o=i(7604),l=i(7957),c=i(3516),u=i(8801),h=i(4461),d=i(7683),f=i(1665),p=i(4892),_=i(4307),g=i(5104),v=i(516),m=i(1037),y=o.setImmediate,w=o.clearImmediate,b=o.process,k=o.Dispatch,S=o.Function,A=o.MessageChannel,I=o.String,x=0,U={},E="onreadystatechange";d(function(){n=o.location});var P=function(t){if(h(U,t)){var e=U[t];delete U[t],e()}},C=function(t){return function(){P(t)}},O=function(t){P(t.data)},T=function(t){o.postMessage(I(t),n.protocol+"//"+n.host)};y&&w||(y=function(t){g(arguments.length,1);var e=u(t)?t:S(t),i=p(arguments,1);return U[++x]=function(){l(e,void 0,i)},r(x),x},w=function(t){delete U[t]},m?r=function(t){b.nextTick(C(t))}:k&&k.now?r=function(t){k.now(C(t))}:A&&!v?(a=(s=new A).port2,s.port1.onmessage=O,r=c(a.postMessage,a)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&n&&"file:"!==n.protocol&&!d(T)?(r=T,o.addEventListener("message",O,!1)):r=E in _("script")?function(t){f.appendChild(_("script"))[E]=function(){f.removeChild(this),P(t)}}:function(t){setTimeout(C(t),0)}),t.exports={set:y,clear:w}},6926:function(t,e,i){"use strict";var n=i(3231),r=Math.max,s=Math.min;t.exports=function(t,e){var i=n(t);return i<0?r(i+e,0):s(i,e)}},8402:function(t,e,i){"use strict";var n=i(1277),r=TypeError;t.exports=function(t){var e=n(t,"number");if("number"==typeof e)throw new r("Can't convert number to bigint");return BigInt(e)}},7932:function(t,e,i){"use strict";var n=i(3231),r=i(4514),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=r(e);if(e!==i)throw new s("Wrong length or index");return i}},6905:function(t,e,i){"use strict";var n=i(1395),r=i(1826);t.exports=function(t){return n(r(t))}},3231:function(t,e,i){"use strict";var n=i(7553);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},4514:function(t,e,i){"use strict";var n=i(3231),r=Math.min;t.exports=function(t){var e=n(t);return e>0?r(e,0x1fffffffffffff):0}},3561:function(t,e,i){"use strict";var n=i(1826),r=Object;t.exports=function(t){return r(n(t))}},9113:function(t,e,i){"use strict";var n=i(4114),r=RangeError;t.exports=function(t,e){var i=n(t);if(i%e)throw new r("Wrong offset");return i}},4114:function(t,e,i){"use strict";var n=i(3231),r=RangeError;t.exports=function(t){var e=n(t);if(e<0)throw new r("The argument can't be less than 0");return e}},1277:function(t,e,i){"use strict";var n=i(7625),r=i(9414),s=i(4137),a=i(5378),o=i(2986),l=i(4735),c=TypeError,u=l("toPrimitive");t.exports=function(t,e){if(!r(t)||s(t))return t;var i,l=a(t,u);if(l){if(void 0===e&&(e="default"),!r(i=n(l,t,e))||s(i))return i;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}},5661:function(t,e,i){"use strict";var n=i(1277),r=i(4137);t.exports=function(t){var e=n(t,"string");return r(e)?e:e+""}},5384:function(t,e,i){"use strict";var n=i(4735)("toStringTag"),r={};r[n]="z",t.exports="[object z]"===String(r)},5011:function(t,e,i){"use strict";var n=i(6471),r=String;t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return r(t)}},4899:function(t){"use strict";var e=Math.round;t.exports=function(t){var i=e(t);return i<0?0:i>255?255:255&i}},2123:function(t){"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},6619:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(7625),a=i(4032),o=i(4665),l=i(5200),c=i(8158),u=i(5275),h=i(1056),d=i(3599),f=i(6107),p=i(4514),_=i(7932),g=i(9113),v=i(4899),m=i(5661),y=i(4461),w=i(6471),b=i(9414),k=i(4137),S=i(5012),A=i(5533),I=i(6307),x=i(1452).f,U=i(9055),E=i(9425).forEach,P=i(8285),C=i(1782),O=i(4773),T=i(6047),R=i(9974),M=i(4769),N=i(5779),z=M.get,W=M.set,F=M.enforce,D=O.f,L=T.f,j=r.RangeError,B=c.ArrayBuffer,V=B.prototype,J=c.DataView,K=l.NATIVE_ARRAY_BUFFER_VIEWS,q=l.TYPED_ARRAY_TAG,H=l.TypedArray,G=l.TypedArrayPrototype,$=l.isTypedArray,Y="BYTES_PER_ELEMENT",X="Wrong length",Q=function(t,e){C(t,e,{configurable:!0,get:function(){return z(this)[e]}})},Z=function(t){var e;return A(V,t)||"ArrayBuffer"===(e=w(t))||"SharedArrayBuffer"===e},tt=function(t,e){return $(t)&&!k(e)&&e in t&&f(+e)&&e>=0},te=function(t,e){return tt(t,e=m(e))?h(2,t[e]):L(t,e)},ti=function(t,e,i){return tt(t,e=m(e))&&b(i)&&y(i,"value")&&!y(i,"get")&&!y(i,"set")&&!i.configurable&&(!y(i,"writable")||i.writable)&&(!y(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):D(t,e,i)};a?(K||(T.f=te,O.f=ti,Q(G,"buffer"),Q(G,"byteOffset"),Q(G,"byteLength"),Q(G,"length")),n({target:"Object",stat:!0,forced:!K},{getOwnPropertyDescriptor:te,defineProperty:ti}),t.exports=function(t,e,i){var a=t.match(/\d+/)[0]/8,l=t+(i?"Clamped":"")+"Array",c="get"+t,h="set"+t,f=r[l],m=f,y=m&&m.prototype,w={},k=function(t,e){var i=z(t);return i.view[c](e*a+i.byteOffset,!0)},A=function(t,e,n){var r=z(t);r.view[h](e*a+r.byteOffset,i?v(n):n,!0)},C=function(t,e){D(t,e,{get:function(){return k(this,e)},set:function(t){return A(this,e,t)},enumerable:!0})};K?o&&(m=e(function(t,e,i,n){return u(t,y),N(b(e)?Z(e)?void 0!==n?new f(e,g(i,a),n):void 0!==i?new f(e,g(i,a)):new f(e):$(e)?R(m,e):s(U,m,e):new f(_(e)),t,m)}),I&&I(m,H),E(x(f),function(t){t in m||d(m,t,f[t])}),m.prototype=y):(m=e(function(t,e,i,n){u(t,y);var r,o,l,c=0,h=0;if(b(e))if(Z(e)){r=e,h=g(i,a);var d=e.byteLength;if(void 0===n){if(d%a||(o=d-h)<0)throw new j(X)}else if((o=p(n)*a)+h>d)throw new j(X);l=o/a}else if($(e))return R(m,e);else return s(U,m,e);else r=new B(o=(l=_(e))*a);for(W(t,{buffer:r,byteOffset:h,byteLength:o,length:l,view:new J(r)});c<l;)C(t,c++)}),I&&I(m,H),y=m.prototype=S(G)),y.constructor!==m&&d(y,"constructor",m),F(y).TypedArrayConstructor=m,q&&d(y,q,l);var O=m!==f;w[l]=m,n({global:!0,constructor:!0,forced:O,sham:!K},w),Y in m||d(m,Y,a),Y in y||d(y,Y,a),P(l)}):t.exports=function(){}},4665:function(t,e,i){"use strict";var n=i(7604),r=i(7683),s=i(856),a=i(5200).NATIVE_ARRAY_BUFFER_VIEWS,o=n.ArrayBuffer,l=n.Int8Array;t.exports=!a||!r(function(){l(1)})||!r(function(){new l(-1)})||!s(function(t){new l,new l(null),new l(1.5),new l(t)},!0)||r(function(){return 1!==new l(new o(2),1,void 0).length})},9055:function(t,e,i){"use strict";var n=i(3516),r=i(7625),s=i(7592),a=i(3561),o=i(4370),l=i(6573),c=i(7623),u=i(8269),h=i(8003),d=i(5200).aTypedArrayConstructor,f=i(8402);t.exports=function(t){var e,i,p,_,g,v,m,y,w=s(this),b=a(t),k=arguments.length,S=k>1?arguments[1]:void 0,A=void 0!==S,I=c(b);if(I&&!u(I))for(y=(m=l(b,I)).next,b=[];!(v=r(y,m)).done;)b.push(v.value);for(A&&k>2&&(S=n(S,arguments[2])),i=o(b),_=h(p=new(d(w))(i)),e=0;i>e;e++)g=A?S(b[e],e):b[e],p[e]=_?f(g):+g;return p}},8916:function(t,e,i){"use strict";var n=i(2196),r=0,s=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++r+s,36)}},3172:function(t,e,i){"use strict";var n=i(7683),r=i(4735),s=i(4032),a=i(4727),o=r("iterator");t.exports=!n(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),n="";return t.pathname="c%20d",e.forEach(function(t,i){e.delete("b"),n+=i+t}),i.delete("a",2),i.delete("b",void 0),a&&(!t.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!e.size&&(a||!s)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host})},948:function(t,e,i){"use strict";t.exports=i(6043)&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},578:function(t,e,i){"use strict";var n=i(4032),r=i(7683);t.exports=n&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},5104:function(t){"use strict";var e=TypeError;t.exports=function(t,i){if(t<i)throw new e("Not enough arguments");return t}},7218:function(t,e,i){"use strict";var n=i(7604),r=i(8801),s=n.WeakMap;t.exports=r(s)&&/native code/.test(String(s))},4735:function(t,e,i){"use strict";var n=i(7604),r=i(3997),s=i(4461),a=i(8916),o=i(6043),l=i(948),c=n.Symbol,u=r("wks"),h=l?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){return s(u,t)||(u[t]=o&&s(c,t)?c[t]:h("Symbol."+t)),u[t]}},4565:function(t,e,i){"use strict";var n=i(3579),r=i(4461),s=i(3599),a=i(5533),o=i(6307),l=i(2088),c=i(6252),u=i(5779),h=i(9871),d=i(7204),f=i(5143),p=i(4032),_=i(4727);t.exports=function(t,e,i,g){var v="stackTraceLimit",m=g?2:1,y=t.split("."),w=y[y.length-1],b=n.apply(null,y);if(b){var k=b.prototype;if(!_&&r(k,"cause")&&delete k.cause,!i)return b;var S=n("Error"),A=e(function(t,e){var i=h(g?e:t,void 0),n=g?new b(t):new b;return void 0!==i&&s(n,"message",i),f(n,A,n.stack,2),this&&a(k,this)&&u(n,this,A),arguments.length>m&&d(n,arguments[m]),n});if(A.prototype=k,"Error"!==w?o?o(A,S):l(A,S,{name:!0}):p&&v in b&&(c(A,b,v),c(A,b,"prepareStackTrace")),l(A,b),!_)try{k.name!==w&&s(k,"name",w),k.constructor=A}catch(t){}return A}}},4953:function(t,e,i){"use strict";var n=i(4032),r=i(1782),s=i(2674),a=ArrayBuffer.prototype;!n||"detached"in a||r(a,"detached",{configurable:!0,get:function(){return s(this)}})},8732:function(t,e,i){"use strict";var n=i(5258),r=i(4088);r&&n({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return r(this,arguments.length?arguments[0]:void 0,!1)}})},2536:function(t,e,i){"use strict";var n=i(5258),r=i(4088);r&&n({target:"ArrayBuffer",proto:!0},{transfer:function(){return r(this,arguments.length?arguments[0]:void 0,!0)}})},1747:function(t,e,i){"use strict";var n=i(5258),r=i(6845).includes,s=i(7683),a=i(7161);n({target:"Array",proto:!0,forced:s(function(){return![,].includes()})},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},7812:function(t,e,i){"use strict";var n=i(6905),r=i(7161),s=i(577),a=i(4769),o=i(4773).f,l=i(9636),c=i(1597),u=i(4727),h=i(4032),d="Array Iterator",f=a.set,p=a.getterFor(d);t.exports=l(Array,"Array",function(t,e){f(this,{type:d,target:n(t),index:0,kind:e})},function(){var t=p(this),e=t.target,i=t.index++;if(!e||i>=e.length)return t.target=null,c(void 0,!0);switch(t.kind){case"keys":return c(i,!1);case"values":return c(e[i],!1)}return c([i,e[i]],!1)},"values");var _=s.Arguments=s.Array;if(r("keys"),r("values"),r("entries"),!u&&h&&"values"!==_.name)try{o(_,"name",{value:"values"})}catch(t){}},7918:function(t,e,i){"use strict";var n=i(5258),r=i(3561),s=i(4370),a=i(323),o=i(9481);n({target:"Array",proto:!0,arity:1,forced:i(7683)(function(){return 0x100000001!==[].push.call({length:0x100000000},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=r(this),i=s(e),n=arguments.length;o(i+n);for(var l=0;l<n;l++)e[i]=arguments[l],i++;return a(e,i),i}})},9116:function(t,e,i){"use strict";var n=i(5258),r=i(8466).left,s=i(5122),a=i(6315);n({target:"Array",proto:!0,forced:!i(1037)&&a>79&&a<83||!s("reduce")},{reduce:function(t){var e=arguments.length;return r(this,t,e,e>1?arguments[1]:void 0)}})},4214:function(t,e,i){"use strict";i(7161)("flat")},4085:function(t,e,i){"use strict";var n=i(5258),r=i(3561),s=i(4370),a=i(323),o=i(1946),l=i(9481);n({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}}()},{unshift:function(t){var e=r(this),i=s(e),n=arguments.length;if(n){l(i+n);for(var c=i;c--;){var u=c+n;c in e?e[u]=e[c]:o(e,u)}for(var h=0;h<n;h++)e[h]=arguments[h]}return a(e,i+n)}})},1300:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(7957),a=i(4565),o="WebAssembly",l=r[o],c=7!==Error("e",{cause:7}).cause,u=function(t,e){var i={};i[t]=a(t,e,c),n({global:!0,constructor:!0,arity:1,forced:c},i)},h=function(t,e){if(l&&l[t]){var i={};i[t]=a(o+"."+t,e,c),n({target:o,stat:!0,constructor:!0,arity:1,forced:c},i)}};u("Error",function(t){return function(e){return s(t,this,arguments)}}),u("EvalError",function(t){return function(e){return s(t,this,arguments)}}),u("RangeError",function(t){return function(e){return s(t,this,arguments)}}),u("ReferenceError",function(t){return function(e){return s(t,this,arguments)}}),u("SyntaxError",function(t){return function(e){return s(t,this,arguments)}}),u("TypeError",function(t){return function(e){return s(t,this,arguments)}}),u("URIError",function(t){return function(e){return s(t,this,arguments)}}),h("CompileError",function(t){return function(e){return s(t,this,arguments)}}),h("LinkError",function(t){return function(e){return s(t,this,arguments)}}),h("RuntimeError",function(t){return function(e){return s(t,this,arguments)}})},9091:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(5275),a=i(3),o=i(8801),l=i(9623),c=i(1782),u=i(7180),h=i(7683),d=i(4461),f=i(4735),p=i(3805).IteratorPrototype,_=i(4032),g=i(4727),v="constructor",m="Iterator",y=f("toStringTag"),w=TypeError,b=r[m],k=g||!o(b)||b.prototype!==p||!h(function(){b({})}),S=function(){if(s(this,p),l(this)===p)throw new w("Abstract class Iterator not directly constructable")},A=function(t,e){_?c(p,t,{configurable:!0,get:function(){return e},set:function(e){if(a(this),this===p)throw new w("You can't redefine this property");d(this,t)?this[t]=e:u(this,t,e)}}):p[t]=e};d(p,y)||A(y,m),(k||!d(p,v)||p[v]===Object)&&A(v,S),S.prototype=p,n({global:!0,constructor:!0,forced:k},{Iterator:S})},3272:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147);n({target:"Iterator",proto:!0,real:!0},{every:function(t){a(this),s(t);var e=o(this),i=0;return!r(e,function(e,n){if(!t(e,i++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},6178:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(6382),a=i(3),o=i(1147),l=i(9866),c=i(9955),u=i(4727),h=l(function(){for(var t,e,i=this.iterator,n=this.predicate,s=this.next;;){if(t=a(r(s,i)),this.done=!!t.done)return;if(c(i,n,[e=t.value,this.counter++],!0))return e}});n({target:"Iterator",proto:!0,real:!0,forced:u},{filter:function(t){return a(this),s(t),new h(o(this),{predicate:t})}})},200:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147);n({target:"Iterator",proto:!0,real:!0},{find:function(t){a(this),s(t);var e=o(this),i=0;return r(e,function(e,n){if(t(e,i++))return n(e)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},4784:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147);n({target:"Iterator",proto:!0,real:!0},{forEach:function(t){a(this),s(t);var e=o(this),i=0;r(e,function(e){t(e,i++)},{IS_RECORD:!0})}})},8593:function(t,e,i){"use strict";var n=i(5258),r=i(2165);n({target:"Iterator",proto:!0,real:!0,forced:i(4727)},{map:r})},6969:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147),l=TypeError;n({target:"Iterator",proto:!0,real:!0},{reduce:function(t){a(this),s(t);var e=o(this),i=arguments.length<2,n=i?void 0:arguments[1],c=0;if(r(e,function(e){i?(i=!1,n=e):n=t(n,e,c),c++},{IS_RECORD:!0}),i)throw new l("Reduce of empty iterator with no initial value");return n}})},3775:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147);n({target:"Iterator",proto:!0,real:!0},{some:function(t){a(this),s(t);var e=o(this),i=0;return r(e,function(e,n){if(t(e,i++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1911:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(6382),a=i(7895),o=i(8099),l=i(1552);n({target:"Promise",stat:!0,forced:i(3797)},{all:function(t){var e=this,i=a.f(e),n=i.resolve,c=i.reject,u=o(function(){var i=s(e.resolve),a=[],o=0,u=1;l(t,function(t){var s=o++,l=!1;u++,r(i,e,t).then(function(t){!l&&(l=!0,a[s]=t,--u||n(a))},c)}),--u||n(a)});return u.error&&c(u.value),i.promise}})},5807:function(t,e,i){"use strict";var n=i(5258),r=i(4727),s=i(9576).CONSTRUCTOR,a=i(8794),o=i(3579),l=i(8801),c=i(1764),u=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(t){return this.then(void 0,t)}}),!r&&l(a)){var h=o("Promise").prototype.catch;u.catch!==h&&c(u,"catch",h,{unsafe:!0})}},2520:function(t,e,i){"use strict";var n,r,s,a,o=i(5258),l=i(4727),c=i(1037),u=i(7604),h=i(7625),d=i(1764),f=i(6307),p=i(2099),_=i(8285),g=i(6382),v=i(8801),m=i(9414),y=i(5275),w=i(4577),b=i(6877).set,k=i(1855),S=i(4713),A=i(8099),I=i(7421),x=i(4769),U=i(8794),E=i(9576),P=i(7895),C="Promise",O=E.CONSTRUCTOR,T=E.REJECTION_EVENT,R=E.SUBCLASSING,M=x.getterFor(C),N=x.set,z=U&&U.prototype,W=U,F=z,D=u.TypeError,L=u.document,j=u.process,B=P.f,V=B,J=!!(L&&L.createEvent&&u.dispatchEvent),K="unhandledrejection",q=function(t){var e;return!!(m(t)&&v(e=t.then))&&e},H=function(t,e){var i,n,r,s=e.value,a=1===e.state,o=a?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{o?(a||(2===e.rejection&&Q(e),e.rejection=1),!0===o?i=s:(u&&u.enter(),i=o(s),u&&(u.exit(),r=!0)),i===t.promise?c(new D("Promise-chain cycle")):(n=q(i))?h(n,i,l,c):l(i)):c(s)}catch(t){u&&!r&&u.exit(),c(t)}},G=function(t,e){t.notified||(t.notified=!0,k(function(){for(var i,n=t.reactions;i=n.get();)H(i,t);t.notified=!1,e&&!t.rejection&&Y(t)}))},$=function(t,e,i){var n,r;J?((n=L.createEvent("Event")).promise=e,n.reason=i,n.initEvent(t,!1,!0),u.dispatchEvent(n)):n={promise:e,reason:i},!T&&(r=u["on"+t])?r(n):t===K&&S("Unhandled promise rejection",i)},Y=function(t){h(b,u,function(){var e,i=t.facade,n=t.value;if(X(t)&&(e=A(function(){c?j.emit("unhandledRejection",n,i):$(K,i,n)}),t.rejection=c||X(t)?2:1,e.error))throw e.value})},X=function(t){return 1!==t.rejection&&!t.parent},Q=function(t){h(b,u,function(){var e=t.facade;c?j.emit("rejectionHandled",e):$("rejectionhandled",e,t.value)})},Z=function(t,e,i){return function(n){t(e,n,i)}},tt=function(t,e,i){t.done||(t.done=!0,i&&(t=i),t.value=e,t.state=2,G(t,!0))},te=function(t,e,i){if(!t.done){t.done=!0,i&&(t=i);try{if(t.facade===e)throw new D("Promise can't be resolved itself");var n=q(e);n?k(function(){var i={done:!1};try{h(n,e,Z(te,i,t),Z(tt,i,t))}catch(e){tt(i,e,t)}}):(t.value=e,t.state=1,G(t,!1))}catch(e){tt({done:!1},e,t)}}};if(O&&(F=(W=function(t){y(this,F),g(t),h(n,this);var e=M(this);try{t(Z(te,e),Z(tt,e))}catch(t){tt(e,t)}}).prototype,(n=function(t){N(this,{type:C,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:0,value:null})}).prototype=d(F,"then",function(t,e){var i=M(this),n=B(w(this,W));return i.parent=!0,n.ok=!v(t)||t,n.fail=v(e)&&e,n.domain=c?j.domain:void 0,0===i.state?i.reactions.add(n):k(function(){H(n,i)}),n.promise}),r=function(){var t=new n,e=M(t);this.promise=t,this.resolve=Z(te,e),this.reject=Z(tt,e)},P.f=B=function(t){return t===W||t===s?new r(t):V(t)},!l&&v(U)&&z!==Object.prototype)){a=z.then,R||d(z,"then",function(t,e){var i=this;return new W(function(t,e){h(a,i,t,e)}).then(t,e)},{unsafe:!0});try{delete z.constructor}catch(t){}f&&f(z,F)}o({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:W}),p(W,C,!1,!0),_(C)},9939:function(t,e,i){"use strict";var n=i(5258),r=i(4727),s=i(8794),a=i(7683),o=i(3579),l=i(8801),c=i(4577),u=i(5002),h=i(1764),d=s&&s.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!s&&a(function(){d.finally.call({then:function(){}},function(){})})},{finally:function(t){var e=c(this,o("Promise")),i=l(t);return this.then(i?function(i){return u(e,t()).then(function(){return i})}:t,i?function(i){return u(e,t()).then(function(){throw i})}:t)}}),!r&&l(s)){var f=o("Promise").prototype.finally;d.finally!==f&&h(d,"finally",f,{unsafe:!0})}},9166:function(t,e,i){"use strict";i(2520),i(1911),i(5807),i(4419),i(2173),i(3940)},4419:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(6382),a=i(7895),o=i(8099),l=i(1552);n({target:"Promise",stat:!0,forced:i(3797)},{race:function(t){var e=this,i=a.f(e),n=i.reject,c=o(function(){var a=s(e.resolve);l(t,function(t){r(a,e,t).then(i.resolve,n)})});return c.error&&n(c.value),i.promise}})},2173:function(t,e,i){"use strict";var n=i(5258),r=i(7895);n({target:"Promise",stat:!0,forced:i(9576).CONSTRUCTOR},{reject:function(t){var e=r.f(this);return(0,e.reject)(t),e.promise}})},3940:function(t,e,i){"use strict";var n=i(5258),r=i(3579),s=i(4727),a=i(8794),o=i(9576).CONSTRUCTOR,l=i(5002),c=r("Promise"),u=s&&!o;n({target:"Promise",stat:!0,forced:s||o},{resolve:function(t){return l(u&&this===c?a:this,t)}})},6764:function(t,e,i){"use strict";var n=i(4032),r=i(7604),s=i(2196),a=i(8696),o=i(5779),l=i(3599),c=i(5012),u=i(1452).f,h=i(5533),d=i(4840),f=i(5011),p=i(1678),_=i(2665),g=i(6252),v=i(1764),m=i(7683),y=i(4461),w=i(4769).enforce,b=i(8285),k=i(4735),S=i(6927),A=i(7514),I=k("match"),x=r.RegExp,U=x.prototype,E=r.SyntaxError,P=s(U.exec),C=s("".charAt),O=s("".replace),T=s("".indexOf),R=s("".slice),M=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,N=/a/g,z=/a/g,W=new x(N)!==N,F=_.MISSED_STICKY,D=_.UNSUPPORTED_Y,L=n&&(!W||F||S||A||m(function(){return z[I]=!1,x(N)!==N||x(z)===z||"/a/i"!==String(x(N,"i"))})),j=function(t){for(var e,i=t.length,n=0,r="",s=!1;n<=i;n++){if("\\"===(e=C(t,n))){r+=e+C(t,++n);continue}s||"."!==e?("["===e?s=!0:"]"===e&&(s=!1),r+=e):r+="[\\s\\S]"}return r},B=function(t){for(var e,i=t.length,n=0,r="",s=[],a=c(null),o=!1,l=!1,u=0,h="";n<=i;n++){if("\\"===(e=C(t,n)))e+=C(t,++n);else if("]"===e)o=!1;else if(!o)switch(!0){case"["===e:o=!0;break;case"("===e:if(r+=e,"?:"===R(t,n+1,n+3))continue;P(M,R(t,n+1))&&(n+=2,l=!0),u++;continue;case">"===e&&l:if(""===h||y(a,h))throw new E("Invalid capture group name");a[h]=!0,s[s.length]=[h,u],l=!1,h="";continue}l?h+=e:r+=e}return[r,s]};if(a("RegExp",L)){for(var V=function(t,e){var i,n,r,s,a,c,u=h(U,this),_=d(t),g=void 0===e,v=[],m=t;if(!u&&_&&g&&t.constructor===V)return t;if((_||h(U,t))&&(t=t.source,g&&(e=p(m))),t=void 0===t?"":f(t),e=void 0===e?"":f(e),m=t,S&&"dotAll"in N&&(n=!!e&&T(e,"s")>-1)&&(e=O(e,/s/g,"")),i=e,F&&"sticky"in N&&(r=!!e&&T(e,"y")>-1)&&D&&(e=O(e,/y/g,"")),A&&(t=(s=B(t))[0],v=s[1]),a=o(x(t,e),u?this:U,V),(n||r||v.length)&&(c=w(a),n&&(c.dotAll=!0,c.raw=V(j(t),i)),r&&(c.sticky=!0),v.length&&(c.groups=v)),t!==m)try{l(a,"source",""===m?"(?:)":m)}catch(t){}return a},J=u(x),K=0;J.length>K;)g(V,x,J[K++]);U.constructor=V,V.prototype=U,v(r,"RegExp",V,{constructor:!0})}b("RegExp")},4853:function(t,e,i){"use strict";var n=i(4032),r=i(6927),s=i(4380),a=i(1782),o=i(4769).get,l=RegExp.prototype,c=TypeError;n&&r&&a(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!o(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},4891:function(t,e,i){"use strict";var n=i(5258),r=i(4495);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},6843:function(t,e,i){"use strict";var n=i(7604),r=i(4032),s=i(1782),a=i(6351),o=i(7683),l=n.RegExp,c=l.prototype;r&&o(function(){var t=!0;try{l(".","d")}catch(e){t=!1}var e={},i="",n=t?"dgimsy":"gimsy",r=function(t,n){Object.defineProperty(e,t,{get:function(){return i+=n,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in t&&(s.hasIndices="d"),s)r(a,s[a]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(e)!==n||i!==n})&&s(c,"flags",{configurable:!0,get:a})},574:function(t,e,i){"use strict";var n=i(5258),r=i(9212);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("difference",function(t){return 0===t.size})},{difference:r})},5992:function(t,e,i){"use strict";var n=i(5258),r=i(7683),s=i(826);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||r(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:s})},8385:function(t,e,i){"use strict";var n=i(5258),r=i(237);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("isDisjointFrom",function(t){return!t})},{isDisjointFrom:r})},5208:function(t,e,i){"use strict";var n=i(5258),r=i(3802);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("isSubsetOf",function(t){return t})},{isSubsetOf:r})},2935:function(t,e,i){"use strict";var n=i(5258),r=i(6083);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("isSupersetOf",function(t){return!t})},{isSupersetOf:r})},9356:function(t,e,i){"use strict";var n=i(5258),r=i(7782);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("symmetricDifference")},{symmetricDifference:r})},5702:function(t,e,i){"use strict";var n=i(5258),r=i(3528);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("union")},{union:r})},5837:function(t,e,i){"use strict";var n=i(5258),r=i(2196),s=i(6926),a=RangeError,o=String.fromCharCode,l=String.fromCodePoint,c=r([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(t){for(var e,i=[],n=arguments.length,r=0;n>r;){if(e=+arguments[r++],s(e,1114111)!==e)throw new a(e+" is not a valid code point");i[r]=e<65536?o(e):o(((e-=65536)>>10)+55296,e%1024+56320)}return c(i,"")}})},7864:function(t,e,i){"use strict";var n=i(5059).charAt,r=i(5011),s=i(4769),a=i(9636),o=i(1597),l="String Iterator",c=s.set,u=s.getterFor(l);a(String,"String",function(t){c(this,{type:l,string:r(t),index:0})},function(){var t,e=u(this),i=e.string,r=e.index;return r>=i.length?o(void 0,!0):(t=n(i,r),e.index+=t.length,o(t,!1))})},3459:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(5344),a=i(7302),o=i(1597),l=i(1826),c=i(4514),u=i(5011),h=i(3),d=i(4449),f=i(4380),p=i(4840),_=i(1678),g=i(5378),v=i(1764),m=i(7683),y=i(4735),w=i(4577),b=i(1857),k=i(5806),S=i(4769),A=i(4727),I=y("matchAll"),x="RegExp String",U=x+" Iterator",E=S.set,P=S.getterFor(U),C=RegExp.prototype,O=TypeError,T=s("".indexOf),R=s("".matchAll),M=!!R&&!m(function(){R("a",/./)}),N=a(function(t,e,i,n){E(this,{type:U,regexp:t,string:e,global:i,unicode:n,done:!1})},x,function(){var t=P(this);if(t.done)return o(void 0,!0);var e=t.regexp,i=t.string,n=k(e,i);return null===n?(t.done=!0,o(void 0,!0)):(t.global?""===u(n[0])&&(e.lastIndex=b(i,c(e.lastIndex),t.unicode)):t.done=!0,o(n,!1))}),z=function(t){var e,i,n,r=h(this),s=u(t),a=w(r,RegExp),o=u(_(r));return e=new a(a===RegExp?r.source:r,o),i=!!~T(o,"g"),n=!!~T(o,"u"),e.lastIndex=c(r.lastIndex),new N(e,s,i,n)};n({target:"String",proto:!0,forced:M},{matchAll:function(t){var e,i,n,s=l(this);if(d(t)){if(M)return R(s,t)}else{if(p(t)&&!~T(u(l(_(t))),"g"))throw new O("`.matchAll` does not allow non-global regexes");if(M)return R(s,t);if(void 0===(i=g(t,I))&&A&&"RegExp"===f(t)&&(i=z),i)return r(i,t,s)}return e=u(s),n=RegExp(t,"g"),A?r(z,n,e):n[I](e)}}),A||I in C||v(C,I,z)},2724:function(t,e,i){"use strict";var n=i(7957),r=i(7625),s=i(2196),a=i(4016),o=i(7683),l=i(3),c=i(8801),u=i(4449),h=i(3231),d=i(4514),f=i(5011),p=i(1826),_=i(1857),g=i(5378),v=i(4242),m=i(5806),y=i(4735)("replace"),w=Math.max,b=Math.min,k=s([].concat),S=s([].push),A=s("".indexOf),I=s("".slice),x="$0"==="a".replace(/./,"$0"),U=!!/./[y]&&""===/./[y]("a","$0");a("replace",function(t,e,i){var s=U?"$":"$0";return[function(t,i){var n=p(this),s=u(t)?void 0:g(t,y);return s?r(s,t,n,i):r(e,f(n),t,i)},function(t,r){var a=l(this),o=f(t);if("string"==typeof r&&-1===A(r,s)&&-1===A(r,"$<")){var u=i(e,a,o,r);if(u.done)return u.value}var p=c(r);p||(r=f(r));var g=a.global;g&&(C=a.unicode,a.lastIndex=0);for(var y=[];null!==(T=m(a,o))&&(S(y,T),g);){;""===f(T[0])&&(a.lastIndex=_(o,d(a.lastIndex),C))}for(var x="",U=0,E=0;E<y.length;E++){for(var P,C,O,T=y[E],R=f(T[0]),M=w(b(h(T.index),o.length),0),N=[],z=1;z<T.length;z++)S(N,void 0===(P=T[z])?P:String(P));var W=T.groups;if(p){var F=k([R],N,M,o);void 0!==W&&S(F,W),O=f(n(r,void 0,F))}else O=v(R,o,M,N,W,r);M>=U&&(x+=I(o,U,M)+O,U=M+R.length)}return x+I(o,U)}]},!!o(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})||!x||U)},9016:function(t,e,i){"use strict";var n=i(5200),r=i(4370),s=i(3231),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",function(t){var e=a(this),i=r(e),n=s(t),o=n>=0?n:i+n;return o<0||o>=i?void 0:e[o]})},1408:function(t,e,i){"use strict";var n=i(5200),r=i(7793),s=i(8402),a=i(6471),o=i(7625),l=i(2196),c=i(7683),u=n.aTypedArray,h=n.exportTypedArrayMethod,d=l("".slice);h("fill",function(t){var e=arguments.length;return u(this),o(r,this,"Big"===d(a(this),0,3)?s(t):+t,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},c(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t}))},6698:function(t,e,i){"use strict";var n=i(5200),r=i(3691).findLastIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",function(t){return r(s(this),t,arguments.length>1?arguments[1]:void 0)})},7515:function(t,e,i){"use strict";var n=i(5200),r=i(3691).findLast,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLast",function(t){return r(s(this),t,arguments.length>1?arguments[1]:void 0)})},4169:function(t,e,i){"use strict";var n=i(7604),r=i(7625),s=i(5200),a=i(4370),o=i(9113),l=i(3561),c=i(7683),u=n.RangeError,h=n.Int8Array,d=h&&h.prototype,f=d&&d.set,p=s.aTypedArray,_=s.exportTypedArrayMethod,g=!c(function(){var t=new Uint8ClampedArray(2);return r(f,t,{length:1,0:3},1),3!==t[1]}),v=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c(function(){var t=new h(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]});_("set",function(t){p(this);var e=o(arguments.length>1?arguments[1]:void 0,1),i=l(t);if(g)return r(f,this,i,e);var n=this.length,s=a(i),c=0;if(s+e>n)throw new u("Wrong length");for(;c<s;)this[e+c]=i[c++]},!g||v)},8809:function(t,e,i){"use strict";var n=i(7604),r=i(5344),s=i(7683),a=i(6382),o=i(1836),l=i(5200),c=i(673),u=i(2927),h=i(6315),d=i(5827),f=l.aTypedArray,p=l.exportTypedArrayMethod,_=n.Uint16Array,g=_&&r(_.prototype.sort),v=!!g&&!(s(function(){g(new _(2),null)})&&s(function(){g(new _(2),{})})),m=!!g&&!s(function(){if(h)return h<74;if(c)return c<67;if(u)return!0;if(d)return d<602;var t,e,i=new _(516),n=Array(516);for(t=0;t<516;t++)e=t%4,i[t]=515-t,n[t]=t-2*e+3;for(g(i,function(t,e){return(t/4|0)-(e/4|0)}),t=0;t<516;t++)if(i[t]!==n[t])return!0});p("sort",function(t){return(void 0!==t&&a(t),m)?g(this,t):o(f(this),function(e,i){return void 0!==t?+t(e,i)||0:i!=i?-1:e!=e?1:0===e&&0===i?1/e>0&&1/i<0?1:-1:e>i})},!m||v)},7095:function(t,e,i){"use strict";var n=i(2152),r=i(5200),s=r.aTypedArray,a=r.exportTypedArrayMethod,o=r.getTypedArrayConstructor;a("toReversed",function(){return n(s(this),o(this))})},6176:function(t,e,i){"use strict";var n=i(5200),r=i(2196),s=i(6382),a=i(9974),o=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,u=r(n.TypedArrayPrototype.sort);c("toSorted",function(t){void 0!==t&&s(t);var e=o(this);return u(a(l(e),e),t)})},3405:function(t,e,i){"use strict";i(6619)("Uint8",function(t){return function(e,i,n){return t(this,e,i,n)}})},4189:function(t,e,i){"use strict";var n=i(5500),r=i(5200),s=i(8003),a=i(3231),o=i(8402),l=r.aTypedArray,c=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("with",{with:function(t,e){var i=l(this),r=a(t),u=s(i)?o(e):+e;return n(i,c(i),r,u)}}.with,!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}())},4261:function(t,e,i){"use strict";var n=i(7604),r=i(8828),s=i(5396),a=i(7812),o=i(3599),l=i(2099),c=i(4735)("iterator"),u=a.values,h=function(t,e){if(t){if(t[c]!==u)try{o(t,c,u)}catch(e){t[c]=u}if(l(t,e,!0),r[e]){for(var i in a)if(t[i]!==a[i])try{o(t,i,a[i])}catch(e){t[i]=a[i]}}}};for(var d in r)h(n[d]&&n[d].prototype,d);h(s,"DOMTokenList")},7775:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(3579),a=i(1056),o=i(4773).f,l=i(4461),c=i(5275),u=i(5779),h=i(9871),d=i(1430),f=i(2237),p=i(4032),_=i(4727),g="DOMException",v=s("Error"),m=s(g),y=function(){c(this,w);var t=arguments.length,e=h(t<1?void 0:arguments[0]),i=h(t<2?void 0:arguments[1],"Error"),n=new m(e,i),r=new v(e);return r.name=g,o(n,"stack",a(1,f(r.stack,1))),u(n,this,y),n},w=y.prototype=m.prototype,b="stack"in new v(g),k="stack"in new m(1,2),S=m&&p&&Object.getOwnPropertyDescriptor(r,g),A=!!S&&!(S.writable&&S.configurable),I=b&&!A&&!k;n({global:!0,constructor:!0,forced:_||I},{DOMException:I?y:m});var x=s(g),U=x.prototype;if(U.constructor!==x){for(var E in _||o(U,"constructor",a(1,x)),d)if(l(d,E)){var P=d[E],C=P.s;l(x,C)||o(x,C,a(6,P.c))}}},8303:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(1782),a=i(4032),o=TypeError,l=Object.defineProperty,c=r.self!==r;try{if(a){var u=Object.getOwnPropertyDescriptor(r,"self");!c&&u&&u.get&&u.enumerable||s(r,"self",{get:function(){return r},set:function(t){if(this!==r)throw new o("Illegal invocation");l(r,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else n({global:!0,simple:!0,forced:c},{self:r})}catch(t){}},8002:function(t,e,i){"use strict";i(7812),i(5837);var n=i(5258),r=i(7604),s=i(7665),a=i(3579),o=i(7625),l=i(2196),c=i(4032),u=i(3172),h=i(1764),d=i(1782),f=i(2267),p=i(2099),_=i(7302),g=i(4769),v=i(5275),m=i(8801),y=i(4461),w=i(3516),b=i(6471),k=i(3),S=i(9414),A=i(5011),I=i(5012),x=i(1056),U=i(6573),E=i(7623),P=i(1597),C=i(5104),O=i(4735),T=i(1836),R=O("iterator"),M="URLSearchParams",N=M+"Iterator",z=g.set,W=g.getterFor(M),F=g.getterFor(N),D=s("fetch"),L=s("Request"),j=s("Headers"),B=L&&L.prototype,V=j&&j.prototype,J=r.TypeError,K=r.encodeURIComponent,q=String.fromCharCode,H=a("String","fromCodePoint"),G=parseInt,$=l("".charAt),Y=l([].join),X=l([].push),Q=l("".replace),Z=l([].shift),tt=l([].splice),te=l("".split),ti=l("".slice),tn=l(/./.exec),tr=/\+/g,ts=/^[0-9a-f]+$/i,ta=function(t,e){var i=ti(t,e,e+2);return tn(ts,i)?G(i,16):NaN},to=function(t){for(var e=0,i=128;i>0&&(t&i)!=0;i>>=1)e++;return e},tl=function(t){var e=null;switch(t.length){case 1:e=t[0];break;case 2:e=(31&t[0])<<6|63&t[1];break;case 3:e=(15&t[0])<<12|(63&t[1])<<6|63&t[2];break;case 4:e=(7&t[0])<<18|(63&t[1])<<12|(63&t[2])<<6|63&t[3]}return e>1114111?null:e},tc=function(t){for(var e=(t=Q(t,tr," ")).length,i="",n=0;n<e;){var r=$(t,n);if("%"===r){if("%"===$(t,n+1)||n+3>e){i+="%",n++;continue}var s=ta(t,n+1);if(s!=s){i+=r,n++;continue}n+=2;var a=to(s);if(0===a)r=q(s);else{if(1===a||a>4){i+="�",n++;continue}for(var o=[s],l=1;l<a&&!(++n+3>e)&&"%"===$(t,n);){var c=ta(t,n+1);if(c!=c){n+=3;break}if(c>191||c<128)break;X(o,c),n+=2,l++}if(o.length!==a){i+="�";continue}var u=tl(o);null===u?i+="�":r=H(u)}}i+=r,n++}return i},tu=/[!'()~]|%20/g,th={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},td=function(t){return th[t]},tf=function(t){return Q(K(t),tu,td)},tp=_(function(t,e){z(this,{type:N,target:W(t).entries,index:0,kind:e})},M,function(){var t=F(this),e=t.target,i=t.index++;if(!e||i>=e.length)return t.target=null,P(void 0,!0);var n=e[i];switch(t.kind){case"keys":return P(n.key,!1);case"values":return P(n.value,!1)}return P([n.key,n.value],!1)},!0),t_=function(t){this.entries=[],this.url=null,void 0!==t&&(S(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===$(t,0)?ti(t,1):t:A(t)))};t_.prototype={type:M,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,i,n,r,s,a,l,c=this.entries,u=E(t);if(u)for(i=(e=U(t,u)).next;!(n=o(i,e)).done;){if((a=o(s=(r=U(k(n.value))).next,r)).done||(l=o(s,r)).done||!o(s,r).done)throw new J("Expected sequence with length 2");X(c,{key:A(a.value),value:A(l.value)})}else for(var h in t)y(t,h)&&X(c,{key:h,value:A(t[h])})},parseQuery:function(t){if(t)for(var e,i,n=this.entries,r=te(t,"&"),s=0;s<r.length;)(e=r[s++]).length&&X(n,{key:tc(Z(i=te(e,"="))),value:tc(Y(i,"="))})},serialize:function(){for(var t,e=this.entries,i=[],n=0;n<e.length;)X(i,tf((t=e[n++]).key)+"="+tf(t.value));return Y(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var tg=function(){v(this,tv);var t=arguments.length>0?arguments[0]:void 0,e=z(this,new t_(t));c||(this.size=e.entries.length)},tv=tg.prototype;if(f(tv,{append:function(t,e){var i=W(this);C(arguments.length,2),X(i.entries,{key:A(t),value:A(e)}),!c&&this.length++,i.updateURL()},delete:function(t){for(var e=W(this),i=C(arguments.length,1),n=e.entries,r=A(t),s=i<2?void 0:arguments[1],a=void 0===s?s:A(s),o=0;o<n.length;){var l=n[o];if(l.key===r&&(void 0===a||l.value===a)){if(tt(n,o,1),void 0!==a)break}else o++}c||(this.size=n.length),e.updateURL()},get:function(t){var e=W(this).entries;C(arguments.length,1);for(var i=A(t),n=0;n<e.length;n++)if(e[n].key===i)return e[n].value;return null},getAll:function(t){var e=W(this).entries;C(arguments.length,1);for(var i=A(t),n=[],r=0;r<e.length;r++)e[r].key===i&&X(n,e[r].value);return n},has:function(t){for(var e=W(this).entries,i=C(arguments.length,1),n=A(t),r=i<2?void 0:arguments[1],s=void 0===r?r:A(r),a=0;a<e.length;){var o=e[a++];if(o.key===n&&(void 0===s||o.value===s))return!0}return!1},set:function(t,e){var i,n=W(this);C(arguments.length,1);for(var r=n.entries,s=!1,a=A(t),o=A(e),l=0;l<r.length;l++)(i=r[l]).key===a&&(s?tt(r,l--,1):(s=!0,i.value=o));s||X(r,{key:a,value:o}),c||(this.size=r.length),n.updateURL()},sort:function(){var t=W(this);T(t.entries,function(t,e){return t.key>e.key?1:-1}),t.updateURL()},forEach:function(t){for(var e,i=W(this).entries,n=w(t,arguments.length>1?arguments[1]:void 0),r=0;r<i.length;)n((e=i[r++]).value,e.key,this)},keys:function(){return new tp(this,"keys")},values:function(){return new tp(this,"values")},entries:function(){return new tp(this,"entries")}},{enumerable:!0}),h(tv,R,tv.entries,{name:"entries"}),h(tv,"toString",function(){return W(this).serialize()},{enumerable:!0}),c&&d(tv,"size",{get:function(){return W(this).entries.length},configurable:!0,enumerable:!0}),p(tg,M),n({global:!0,constructor:!0,forced:!u},{URLSearchParams:tg}),!u&&m(j)){var tm=l(V.has),ty=l(V.set),tw=function(t){if(S(t)){var e,i=t.body;if(b(i)===M)return tm(e=t.headers?new j(t.headers):new j,"content-type")||ty(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),I(t,{body:x(0,A(i)),headers:x(0,e)})}return t};if(m(D)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return D(t,arguments.length>1?tw(arguments[1]):{})}}),m(L)){var tb=function(t){return v(this,B),new L(t,arguments.length>1?tw(arguments[1]):{})};B.constructor=tb,tb.prototype=B,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:tb})}}t.exports={URLSearchParams:tg,getState:W}},5711:function(t,e,i){"use strict";var n=i(1764),r=i(2196),s=i(5011),a=i(5104),o=URLSearchParams,l=o.prototype,c=r(l.append),u=r(l.delete),h=r(l.forEach),d=r([].push),f=new o("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&n(l,"delete",function(t){var e,i=arguments.length,n=i<2?void 0:arguments[1];if(i&&void 0===n)return u(this,t);var r=[];h(this,function(t,e){d(r,{key:e,value:t})}),a(i,1);for(var o=s(t),l=s(n),f=0,p=0,_=!1,g=r.length;f<g;)e=r[f++],_||e.key===o?(_=!0,u(this,e.key)):p++;for(;p<g;)((e=r[p++]).key!==o||e.value!==l)&&c(this,e.key,e.value)},{enumerable:!0,unsafe:!0})},4346:function(t,e,i){"use strict";var n=i(1764),r=i(2196),s=i(5011),a=i(5104),o=URLSearchParams,l=o.prototype,c=r(l.getAll),u=r(l.has),h=new o("a=1");(h.has("a",2)||!h.has("a",void 0))&&n(l,"has",function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return u(this,t);var n=c(this,t);a(e,1);for(var r=s(i),o=0;o<n.length;)if(n[o++]===r)return!0;return!1},{enumerable:!0,unsafe:!0})},1244:function(t,e,i){"use strict";i(8002)},8253:function(t,e,i){"use strict";var n=i(4032),r=i(2196),s=i(1782),a=URLSearchParams.prototype,o=r(a.forEach);!n||"size"in a||s(a,"size",{get:function(){var t=0;return o(this,function(){t++}),t},configurable:!0,enumerable:!0})},2877:function(t,e,i){"use strict";i(7864);var n,r=i(5258),s=i(4032),a=i(3172),o=i(7604),l=i(3516),c=i(2196),u=i(1764),h=i(1782),d=i(5275),f=i(4461),p=i(1353),_=i(4872),g=i(4892),v=i(5059).codeAt,m=i(6793),y=i(5011),w=i(2099),b=i(5104),k=i(8002),S=i(4769),A=S.set,I=S.getterFor("URL"),x=k.URLSearchParams,U=k.getState,E=o.URL,P=o.TypeError,C=o.parseInt,O=Math.floor,T=Math.pow,R=c("".charAt),M=c(/./.exec),N=c([].join),z=c(1..toString),W=c([].pop),F=c([].push),D=c("".replace),L=c([].shift),j=c("".split),B=c("".slice),V=c("".toLowerCase),J=c([].unshift),K="Invalid scheme",q="Invalid host",H="Invalid port",G=/[a-z]/i,$=/[\d+-.a-z]/i,Y=/\d/,X=/^0x/i,Q=/^[0-7]+$/,Z=/^\d+$/,tt=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ti=/[\0\t\n\r #/:<>?@[\\\]^|]/,tn=/^[\u0000-\u0020]+/,tr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ts=/[\t\n\r]/g,ta=function(t){var e,i,n,r,s,a,o,l=j(t,".");if(l.length&&""===l[l.length-1]&&l.length--,(e=l.length)>4)return t;for(n=0,i=[];n<e;n++){if(""===(r=l[n]))return t;if(s=10,r.length>1&&"0"===R(r,0)&&(s=M(X,r)?16:8,r=B(r,8===s?1:2)),""===r)a=0;else{if(!M(10===s?Z:8===s?Q:tt,r))return t;a=C(r,s)}F(i,a)}for(n=0;n<e;n++)if(a=i[n],n===e-1){if(a>=T(256,5-e))return null}else if(a>255)return null;for(n=0,o=W(i);n<i.length;n++)o+=i[n]*T(256,3-n);return o},to=function(t){var e,i,n,r,s,a,o,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return R(t,h)};if(":"===d()){if(":"!==R(t,1))return;h+=2,u=++c}for(;d();){if(8===c)return;if(":"===d()){if(null!==u)return;h++,u=++c;continue}for(e=i=0;i<4&&M(tt,d());)e=16*e+C(d(),16),h++,i++;if("."===d()){if(0===i||(h-=i,c>6))return;for(n=0;d();){if(r=null,n>0)if("."!==d()||!(n<4))return;else h++;if(!M(Y,d()))return;for(;M(Y,d());){if(s=C(d(),10),null===r)r=s;else{if(0===r)return;r=10*r+s}if(r>255)return;h++}l[c]=256*l[c]+r,(2==++n||4===n)&&c++}if(4!==n)return;break}if(":"===d()){if(h++,!d())return}else if(d())return;l[c++]=e}if(null!==u)for(a=c-u,c=7;0!==c&&a>0;)o=l[c],l[c--]=l[u+a-1],l[u+--a]=o;else if(8!==c)return;return l},tl=function(t){for(var e=null,i=1,n=null,r=0,s=0;s<8;s++)0!==t[s]?(r>i&&(e=n,i=r),n=null,r=0):(null===n&&(n=s),++r);return r>i?n:e},tc=function(t){var e,i,n,r;if("number"==typeof t){for(i=0,e=[];i<4;i++)J(e,t%256),t=O(t/256);return N(e,".")}if("object"==typeof t){for(i=0,e="",n=tl(t);i<8;i++)(!r||0!==t[i])&&(r&&(r=!1),n===i?(e+=i?":":"::",r=!0):(e+=z(t[i],16),i<7&&(e+=":")));return"["+e+"]"}return t},tu={},th=p({},tu,{" ":1,'"':1,"<":1,">":1,"`":1}),td=p({},th,{"#":1,"?":1,"{":1,"}":1}),tf=p({},td,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),tp=function(t,e){var i=v(t,0);return i>32&&i<127&&!f(e,t)?t:encodeURIComponent(t)},t_={ftp:21,file:null,http:80,https:443,ws:80,wss:443},tg=function(t,e){var i;return 2===t.length&&M(G,R(t,0))&&(":"===(i=R(t,1))||!e&&"|"===i)},tv=function(t){var e;return t.length>1&&tg(B(t,0,2))&&(2===t.length||"/"===(e=R(t,2))||"\\"===e||"?"===e||"#"===e)},tm={},ty={},tw={},tb={},tk={},tS={},tA={},tI={},tx={},tU={},tE={},tP={},tC={},tO={},tT={},tR={},tM={},tN={},tz={},tW={},tF={},tD=function(t,e,i){var n,r,s,a=y(t);if(e){if(r=this.parse(a))throw new P(r);this.searchParams=null}else{if(void 0!==i&&(n=new tD(i,!0)),r=this.parse(a,null,n))throw new P(r);(s=U(new x)).bindURL(this),this.searchParams=s}};tD.prototype={type:"URL",parse:function(t,e,i){var r=e||tm,s=0,a="",o=!1,l=!1,c=!1;for(t=y(t),e||(this.scheme="",this.username="",this.password="",this.host=null,this.port=null,this.path=[],this.query=null,this.fragment=null,this.cannotBeABaseURL=!1,t=D(t,tn,""),t=D(t,tr,"$1")),u=_(t=D(t,ts,""));s<=u.length;){switch(h=u[s],r){case tm:if(h&&M(G,h))a+=V(h),r=ty;else{if(e)return K;r=tw;continue}break;case ty:if(h&&(M($,h)||"+"===h||"-"===h||"."===h))a+=V(h);else if(":"===h){if(e&&(this.isSpecial()!==f(t_,a)||"file"===a&&(this.includesCredentials()||null!==this.port)||"file"===this.scheme&&!this.host))return;if(this.scheme=a,e){this.isSpecial()&&t_[this.scheme]===this.port&&(this.port=null);return}a="","file"===this.scheme?r=tO:this.isSpecial()&&i&&i.scheme===this.scheme?r=tb:this.isSpecial()?r=tI:"/"===u[s+1]?(r=tk,s++):(this.cannotBeABaseURL=!0,F(this.path,""),r=tz)}else{if(e)return K;a="",r=tw,s=0;continue}break;case tw:if(!i||i.cannotBeABaseURL&&"#"!==h)return K;if(i.cannotBeABaseURL&&"#"===h){this.scheme=i.scheme,this.path=g(i.path),this.query=i.query,this.fragment="",this.cannotBeABaseURL=!0,r=tF;break}r="file"===i.scheme?tO:tS;continue;case tb:if("/"===h&&"/"===u[s+1])r=tx,s++;else{r=tS;continue}break;case tk:if("/"===h){r=tU;break}r=tN;continue;case tS:if(this.scheme=i.scheme,h===n)this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,this.path=g(i.path),this.query=i.query;else if("/"===h||"\\"===h&&this.isSpecial())r=tA;else if("?"===h)this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,this.path=g(i.path),this.query="",r=tW;else if("#"===h)this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,this.path=g(i.path),this.query=i.query,this.fragment="",r=tF;else{this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,this.path=g(i.path),this.path.length--,r=tN;continue}break;case tA:if(this.isSpecial()&&("/"===h||"\\"===h))r=tx;else if("/"===h)r=tU;else{this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,r=tN;continue}break;case tI:if(r=tx,"/"!==h||"/"!==R(a,s+1))continue;s++;break;case tx:if("/"!==h&&"\\"!==h){r=tU;continue}break;case tU:if("@"===h){o&&(a="%40"+a),o=!0,d=_(a);for(var u,h,d,p,v,m,w=0;w<d.length;w++){var b=d[w];if(":"===b&&!c){c=!0;continue}var k=tp(b,tf);c?this.password+=k:this.username+=k}a=""}else if(h===n||"/"===h||"?"===h||"#"===h||"\\"===h&&this.isSpecial()){if(o&&""===a)return"Invalid authority";s-=_(a).length+1,a="",r=tE}else a+=h;break;case tE:case tP:if(e&&"file"===this.scheme){r=tR;continue}if(":"!==h||l)if(h===n||"/"===h||"?"===h||"#"===h||"\\"===h&&this.isSpecial()){if(this.isSpecial()&&""===a)return q;if(e&&""===a&&(this.includesCredentials()||null!==this.port))return;if(p=this.parseHost(a))return p;if(a="",r=tM,e)return;continue}else"["===h?l=!0:"]"===h&&(l=!1),a+=h;else{if(""===a)return q;if(p=this.parseHost(a))return p;if(a="",r=tC,e===tP)return}break;case tC:if(M(Y,h))a+=h;else{if(!(h===n||"/"===h||"?"===h||"#"===h||"\\"===h&&this.isSpecial())&&!e)return H;if(""!==a){var S=C(a,10);if(S>65535)return H;this.port=this.isSpecial()&&S===t_[this.scheme]?null:S,a=""}if(e)return;r=tM;continue}break;case tO:if(this.scheme="file","/"===h||"\\"===h)r=tT;else if(i&&"file"===i.scheme)switch(h){case n:this.host=i.host,this.path=g(i.path),this.query=i.query;break;case"?":this.host=i.host,this.path=g(i.path),this.query="",r=tW;break;case"#":this.host=i.host,this.path=g(i.path),this.query=i.query,this.fragment="",r=tF;break;default:tv(N(g(u,s),""))||(this.host=i.host,this.path=g(i.path),this.shortenPath()),r=tN;continue}else{r=tN;continue}break;case tT:if("/"===h||"\\"===h){r=tR;break}i&&"file"===i.scheme&&!tv(N(g(u,s),""))&&(tg(i.path[0],!0)?F(this.path,i.path[0]):this.host=i.host),r=tN;continue;case tR:if(h===n||"/"===h||"\\"===h||"?"===h||"#"===h){if(!e&&tg(a))r=tN;else if(""===a){if(this.host="",e)return;r=tM}else{if(p=this.parseHost(a))return p;if("localhost"===this.host&&(this.host=""),e)return;a="",r=tM}continue}a+=h;break;case tM:if(this.isSpecial()){if(r=tN,"/"!==h&&"\\"!==h)continue}else if(e||"?"!==h)if(e||"#"!==h){if(h!==n&&(r=tN,"/"!==h))continue}else this.fragment="",r=tF;else this.query="",r=tW;break;case tN:if(h===n||"/"===h||"\\"===h&&this.isSpecial()||!e&&("?"===h||"#"===h)){if(".."===(v=V(v=a))||"%2e."===v||".%2e"===v||"%2e%2e"===v?(this.shortenPath(),"/"===h||"\\"===h&&this.isSpecial()||F(this.path,"")):"."===(m=a)||"%2e"===V(m)?"/"===h||"\\"===h&&this.isSpecial()||F(this.path,""):("file"===this.scheme&&!this.path.length&&tg(a)&&(this.host&&(this.host=""),a=R(a,0)+":"),F(this.path,a)),a="","file"===this.scheme&&(h===n||"?"===h||"#"===h))for(;this.path.length>1&&""===this.path[0];)L(this.path);"?"===h?(this.query="",r=tW):"#"===h&&(this.fragment="",r=tF)}else a+=tp(h,td);break;case tz:"?"===h?(this.query="",r=tW):"#"===h?(this.fragment="",r=tF):h!==n&&(this.path[0]+=tp(h,tu));break;case tW:e||"#"!==h?h!==n&&("'"===h&&this.isSpecial()?this.query+="%27":"#"===h?this.query+="%23":this.query+=tp(h,tu)):(this.fragment="",r=tF);break;case tF:h!==n&&(this.fragment+=tp(h,th))}s++}},parseHost:function(t){var e,i,n;if("["===R(t,0)){if("]"!==R(t,t.length-1)||!(e=to(B(t,1,-1))))return q;this.host=e}else if(this.isSpecial()){if(M(te,t=m(t))||null===(e=ta(t)))return q;this.host=e}else{if(M(ti,t))return q;for(n=0,e="",i=_(t);n<i.length;n++)e+=tp(i[n],tu);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return f(t_,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;e&&("file"!==this.scheme||1!==e||!tg(t[0],!0))&&t.length--},serialize:function(){var t=this.scheme,e=this.username,i=this.password,n=this.host,r=this.port,s=this.path,a=this.query,o=this.fragment,l=t+":";return null!==n?(l+="//",this.includesCredentials()&&(l+=e+(i?":"+i:"")+"@"),l+=tc(n),null!==r&&(l+=":"+r)):"file"===t&&(l+="//"),l+=this.cannotBeABaseURL?s[0]:s.length?"/"+N(s,"/"):"",null!==a&&(l+="?"+a),null!==o&&(l+="#"+o),l},setHref:function(t){var e=this.parse(t);if(e)throw new P(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new tL(t.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+tc(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(y(t)+":",tm)},getUsername:function(){return this.username},setUsername:function(t){var e=_(y(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<e.length;i++)this.username+=tp(e[i],tf)}},getPassword:function(){return this.password},setPassword:function(t){var e=_(y(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<e.length;i++)this.password+=tp(e[i],tf)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?tc(t):tc(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,tE)},getHostname:function(){var t=this.host;return null===t?"":tc(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,tP)},getPort:function(){var t=this.port;return null===t?"":y(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=y(t))?this.port=null:this.parse(t,tC))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+N(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,tM))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=y(t))?this.query=null:("?"===R(t,0)&&(t=B(t,1)),this.query="",this.parse(t,tW)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){if(""===(t=y(t))){this.fragment=null;return}"#"===R(t,0)&&(t=B(t,1)),this.fragment="",this.parse(t,tF)},update:function(){this.query=this.searchParams.serialize()||null}};var tL=function(t){var e=d(this,tj),i=b(arguments.length,1)>1?arguments[1]:void 0,n=A(e,new tD(t,!1,i));s||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},tj=tL.prototype,tB=function(t,e){return{get:function(){return I(this)[t]()},set:e&&function(t){return I(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(h(tj,"href",tB("serialize","setHref")),h(tj,"origin",tB("getOrigin")),h(tj,"protocol",tB("getProtocol","setProtocol")),h(tj,"username",tB("getUsername","setUsername")),h(tj,"password",tB("getPassword","setPassword")),h(tj,"host",tB("getHost","setHost")),h(tj,"hostname",tB("getHostname","setHostname")),h(tj,"port",tB("getPort","setPort")),h(tj,"pathname",tB("getPathname","setPathname")),h(tj,"search",tB("getSearch","setSearch")),h(tj,"searchParams",tB("getSearchParams")),h(tj,"hash",tB("getHash","setHash"))),u(tj,"toJSON",function(){return I(this).serialize()},{enumerable:!0}),u(tj,"toString",function(){return I(this).serialize()},{enumerable:!0}),E){var tV=E.createObjectURL,tJ=E.revokeObjectURL;tV&&u(tL,"createObjectURL",l(tV,E)),tJ&&u(tL,"revokeObjectURL",l(tJ,E))}w(tL,"URL"),r({global:!0,constructor:!0,forced:!a,sham:!s},{URL:tL})},9460:function(t,e,i){"use strict";i(2877)},3580:function(t,e,i){"use strict";var n=i(5258),r=i(7625);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}})},5945:function(t,e,i){"use strict";function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}i.d(e,{_:()=>n})},526:function(t,e,i){"use strict";i(9166)},8693:function(t,e,i){"use strict";i.d(e,{t:()=>n});let n=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i]}},4498:function(t,e,i){"use strict";function n(t){return Promise.all(Array.from(t).map(t=>t.then(t=>({status:"fulfilled",value:t}),t=>({status:"rejected",reason:t}))))}i.d(e,{a:()=>n}),i(9091),i(8593),i(9166),i(4261)},6431:function(t,e,i){"use strict";function n(t,e,i){return"function"==typeof t?t(e):void 0!==t?t:void 0!==i?i:void 0}i.d(e,{vd:()=>s.a,VK:()=>n,lQ:()=>r.t});var r=i(8693);i(526);var s=i(4498)}},r={};function s(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t].call(i.exports,i,i.exports,s),i.exports}s.m=n,s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},o=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,s.t=function(t,e){if(1&e&&(t=this(t)),8&e||"object"==typeof t&&t&&(4&e&&t.__esModule||16&e&&"function"==typeof t.then))return t;var i=Object.create(null);s.r(i);var n={};a=a||[null,o({}),o([]),o(o)];for(var r=2&e&&t;("object"==typeof r||"function"==typeof r)&&!~a.indexOf(r);r=o(r))Object.getOwnPropertyNames(r).forEach(e=>{n[e]=()=>t[e]});return n.default=()=>t,s.d(i,n),i},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce((e,i)=>(s.f[i](t,e),e),[])),s.u=t=>""+(({279:"stripe-vendors",545:"vendors",662:"query-core-vendors",729:"zxcvbn-ts-core",811:"cookieSuffix",873:"zxcvbn-common",929:"coinbase-wallet-sdk",994:"base-account-sdk"})[t]||t)+"_clerk.legacy.browser_"+s.h().slice(0,6)+"_6.0.0-snapshot.v20251217194100.js",s.h=()=>"99ed7ca81c56d0aa",s.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),l={},s.l=function(t,e,i,n){if(l[t])return void l[t].push(e);if(void 0!==i)for(var r,a,o=document.getElementsByTagName("script"),c=0;c<o.length;c++){var u=o[c];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")=="@clerk/clerk-js:"+i){r=u;break}}r||(a=!0,(r=document.createElement("script")).timeout=120,s.nc&&r.setAttribute("nonce",s.nc),r.setAttribute("data-webpack","@clerk/clerk-js:"+i),r.src=t),l[t]=[e];var h=function(e,i){r.onerror=r.onload=null,clearTimeout(d);var n=l[t];if(delete l[t],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach(function(t){return t(i)}),e)return e(i)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=h.bind(null,r.onerror),r.onload=h.bind(null,r.onload),a&&document.head.appendChild(r)},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.g.importScripts&&(c=s.g.location+"");var a,o,l,c,u=s.g.document;if(!c&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(c=u.currentScript.src),!c)){var h=u.getElementsByTagName("script");if(h.length)for(var d=h.length-1;d>-1&&(!c||!/^http(s?):/.test(c));)c=h[d--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");return s.p=c=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={236:0},s.f.j=function(e,i){var n=s.o(t,e)?t[e]:void 0;if(0!==n)if(n)i.push(n[2]);else{var r=new Promise((i,r)=>n=t[e]=[i,r]);i.push(n[2]=r);var a=s.p+s.u(e),o=Error();s.l(a,function(i){if(s.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+a+")",o.name="ChunkLoadError",o.type=r,o.request=a,n[1](o)}},"chunk-"+e,e)}},e=(e,i)=>{var n,r,a=i[0],o=i[1],l=i[2],c=0;if(a.some(e=>0!==t[e])){for(n in o)s.o(o,n)&&(s.m[n]=o[n]);l&&l(s)}for(e&&e(i);c<a.length;c++)r=a[c],s.o(t,r)&&t[r]&&t[r][0](),t[r]=0},(i=globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i)),(()=>{"use strict";let t,e,i,n;s(4261),s(9460),s(3580),s(1244),s(5711),s(4346),s(8253),s(4891),s(2724);try{let t=new URL(document.currentScript.src),e=new URL(t.href.split("/").slice(0,-1).join("/")).href;s.p=(e+=e.endsWith("/")?"":"/").replace(/(^.*\/@clerk\/clerk-js@)(.+?)(\/dist.*)/,"$1".concat("6.0.0-snapshot.v20251217194100","$3"))}catch{}function r(t,e){return e.get?e.get.call(t):e.value}function a(t,e,i){if(!e.has(t))throw TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function o(t,e){var i=a(t,e,"get");return r(t,i)}function l(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function c(t,e,i){l(t,e),e.set(t,i)}function u(t,e,i){var n=a(t,e,"set");if(n.set)n.set.call(t,i);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=i}return i}function h(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return i}function d(t,e){l(t,e),e.add(t)}s(1300);var f,p,_,g,v,m,y,w,b,k,S,A,I,x,U,E,P,C,O,T,R,M,N,z,W,F,D,L,j,B,V,J,K,q,H,G,$,Y,X,Q,Z,tt,te,ti,tn=s(5945);function tr(){return"undefined"!=typeof window}s(9166),s(9091),s(200),s(7918),s(6178),s(1747),s(3775),s(3272),s(9939),s(8593),s(6764),s(4853);let ts=RegExp("bot|spider|crawl|APIs-Google|AdsBot|Googlebot|mediapartners|Google Favicon|FeedFetcher|Google-Read-Aloud|DuplexWeb-Google|googleweblight|bing|yandex|baidu|duckduck|yahoo|ecosia|ia_archiver|facebook|instagram|pinterest|reddit|slack|twitter|whatsapp|youtube|semrush","i");function ta(){var t,e;let i=tr()?null==(t=window)?void 0:t.navigator:null;return!!i&&!((e=null==i?void 0:i.userAgent)&&ts.test(e))&&!(null==i?void 0:i.webdriver)}function to(){var t,e,i;let n=tr()?null==(t=window)?void 0:t.navigator:null;if(!n)return!1;let r=null==n?void 0:n.onLine;return(null==n||null==(e=n.connection)?void 0:e.rtt)!==0&&(null==n||null==(i=n.connection)?void 0:i.downlink)!==0&&r}function tl(){return to()&&ta()}let tc=(t,e,i,n,r)=>{let{notify:s}=r||{},a=t.get(i);a||(a=[],t.set(i,a)),a.push(n),s&&e.has(i)&&n(e.get(i))},tu=(t,e,i)=>(t.get(e)||[]).map(t=>t(i)),th=(t,e,i)=>{let n=t.get(e);n&&(i?n.splice(n.indexOf(i)>>>0,1):t.set(e,[]))},td=()=>{let t=new Map,e=new Map,i=new Map;return{on:function(){for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];return tc(t,e,...n)},prioritizedOn:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return tc(i,e,...n)},emit:(n,r)=>{e.set(n,r),tu(i,n,r),tu(t,n,r)},off:function(){for(var e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];return th(t,...i)},prioritizedOff:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return th(i,...e)},internal:{retrieveListeners:e=>t.get(e)||[]}}},tf="status";function tp(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function t_(t){return function(e){let i=null!=e?e:this;if(!i)throw TypeError("".concat(t.kind||t.name," type guard requires an error object"));return i instanceof t}}s(3459);var tg=(p=class{constructor(t){var e,i,n,r,s,a,o;tp(this,"code",void 0),tp(this,"message",void 0),tp(this,"longMessage",void 0),tp(this,"meta",void 0);const l={code:t.code,message:t.message,longMessage:t.long_message,meta:{paramName:null==(e=t.meta)?void 0:e.param_name,sessionId:null==(i=t.meta)?void 0:i.session_id,emailAddresses:null==(n=t.meta)?void 0:n.email_addresses,identifiers:null==(r=t.meta)?void 0:r.identifiers,zxcvbn:null==(s=t.meta)?void 0:s.zxcvbn,plan:null==(a=t.meta)?void 0:a.plan,isPlanUpgradePossible:null==(o=t.meta)?void 0:o.is_plan_upgrade_possible}};this.code=l.code,this.message=l.message,this.longMessage=l.longMessage,this.meta=l.meta}},tp(p,"kind","ClerkApiError"),p);t_(tg);var tv=(_=class t extends Error{get name(){return this.constructor.name}toString(){return"[".concat(this.name,"]\nMessage:").concat(this.message)}static formatMessage(t,e,i,n){let r="Clerk:",s=RegExp(r.replace(" ","\\s*"),"i");return e=e.replace(s,""),e="".concat(r," ").concat(e.trim(),'\n\n(code="').concat(i,'")\n\n'),n&&(e+="\n\nDocs: ".concat(n)),e}constructor(e){super(new.target.formatMessage(new.target.kind,e.message,e.code,e.docsUrl),{cause:e.cause}),tp(this,"clerkError",!0),tp(this,"code",void 0),tp(this,"longMessage",void 0),tp(this,"docsUrl",void 0),tp(this,"cause",void 0),Object.setPrototypeOf(this,t.prototype),this.code=e.code,this.docsUrl=e.docsUrl,this.longMessage=e.longMessage,this.cause=e.cause}},tp(_,"kind","ClerkError"),_),tm=(g=class t extends tv{toString(){let t="[".concat(this.name,"]\nMessage:").concat(this.message,"\nStatus:").concat(this.status,"\nSerialized errors: ").concat(this.errors.map(t=>JSON.stringify(t)));return this.clerkTraceId&&(t+="\nClerk Trace ID: ".concat(this.clerkTraceId)),t}static formatMessage(t,e,i,n){return e}constructor(e,i){const{data:n,status:r,clerkTraceId:s,retryAfter:a}=i;super({...i,message:e,code:"api_response_error"}),tp(this,"status",void 0),tp(this,"clerkTraceId",void 0),tp(this,"retryAfter",void 0),tp(this,"errors",void 0),Object.setPrototypeOf(this,t.prototype),this.status=r,this.clerkTraceId=s,this.retryAfter=a,this.errors=(n||[]).map(t=>new tg(t))}},tp(g,"kind","ClerkAPIResponseError"),g);let ty=t_(tm),tw=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"});var tb=class t extends Error{constructor(e){super(e),tp(this,"code",void 0),this.code=e,this.name="EmailLinkError",Object.setPrototypeOf(this,t.prototype)}},tk=(v=class t extends tv{constructor(e,i){super({...i,message:e}),tp(this,"clerkRuntimeError",!0),Object.setPrototypeOf(this,t.prototype)}},tp(v,"kind","ClerkRuntimeError"),v);let tS=t_(tk);var tA=class extends tk{constructor(t,{code:e}){super(t,{code:e}),tp(this,"code",void 0),this.code=e}};function tI(t){return["captcha_invalid","captcha_not_enabled","captcha_missing_token"].includes(t.errors[0].code)}function tx(t){let e=null==t?void 0:t.status;return!!e&&e>=400&&e<500}function tU(t){return t&&"clerkError"in t}function tE(t){return"clerkRuntimeError"in t}function tP(t){for(let[e,i]of Object.entries({isClerkApiResponseError:ty,isClerkRuntimeError:tS}))Object.assign(t,{[e]:i});return t}let tC=(t,e)=>!!(t.isSignedIn&&(null==e?void 0:e.authConfig.singleSessionMode)),tO=(t,e)=>!(null==e?void 0:e.commerceSettings.billing.user.enabled)&&!(null==e?void 0:e.commerceSettings.billing.organization.enabled),tT=(t,e)=>{var i;return!(null==e||null==(i=e.apiKeysSettings)?void 0:i.user_api_keys_enabled)},tR=(t,e)=>{var i;return!(null==e||null==(i=e.apiKeysSettings)?void 0:i.orgs_api_keys_enabled)},tM="__clerk_synced",tN="suffixed_cookies",tz="__clerk_satellite_url",tW="clerk-captcha",tF="clerk-invisible-captcha";s(4784),s(7775);let tD=t=>"undefined"!=typeof atob&&"function"==typeof atob?atob(t):"undefined"!=typeof global&&global.Buffer?new global.Buffer(t,"base64").toString():t;s(4953),s(2536),s(8732),s(3405),s(9016),s(1408),s(7515),s(6698),s(4169),s(8809),s(7095),s(6176),s(4189);let tL=[".lcl.dev",".lclstage.dev",".lclclerk.com"],tj=[".accounts.dev",".accountsstage.dev",".accounts.lclclerk.com"],tB=[".lcl.dev",".stg.dev",".lclstage.dev",".stgstage.dev",".dev.lclclerk.com",".stg.lclclerk.com",".accounts.lclclerk.com","accountsstage.dev","accounts.dev"],tV="pk_live_";function tJ(t){if(!t.endsWith("$"))return!1;let e=t.slice(0,-1);return!e.includes("$")&&e.includes(".")}function tK(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t=t||"")||!tq(t)){if(i.fatal&&!t)throw Error("Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys");if(i.fatal&&!tq(t))throw Error("Publishable key not valid.");return null}let n=t.startsWith(tV)?"production":"development";try{e=tD(t.split("_")[2])}catch{if(i.fatal)throw Error("Publishable key not valid: Failed to decode key.");return null}if(!tJ(e)){if(i.fatal)throw Error("Publishable key not valid: Decoded key has invalid format.");return null}let r=e.slice(0,-1);return i.proxyUrl?r=i.proxyUrl:"development"!==n&&i.domain&&i.isSatellite&&(r="clerk.".concat(i.domain)),{instanceType:n,frontendApi:r}}function tq(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{if(!(t.startsWith(tV)||t.startsWith("pk_test_")))return!1;let e=t.split("_");if(3!==e.length)return!1;let i=e[2];if(!i)return!1;return tJ(tD(i))}catch{return!1}}async function tH(t){var e;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis.crypto.subtle,n=new TextEncoder().encode(t);return(e=String.fromCharCode(...new Uint8Array(await i.digest("sha-1",n))),"undefined"!=typeof btoa&&"function"==typeof btoa?btoa(e):"undefined"!=typeof global&&global.Buffer?new global.Buffer(e).toString("base64"):e).replace(/\+/gi,"-").replace(/\//gi,"_").substring(0,8)}let tG=(t,e)=>"".concat(t,"_").concat(e);var t$=s(1006);let tY=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/;s(574),s(5992),s(8385),s(5208),s(2935),s(9356),s(5702);let tX=new Set,tQ=t=>{tX.has(t)||(tX.add(t),console.warn(t))};s(9116),s(6969);let tZ=(t,e)=>{let i={};for(let n in t)i[n]=e(t[n],n);return i},t0=(t,e)=>{let i={};for(let n in t)t[n]&&e(t[n])&&(i[n]=t[n]);return i};function t1(t){return t?t.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace(/-|_/,"")):""}function t2(t){return t?t.replace(/[A-Z]/g,t=>"_".concat(t.toLowerCase())):""}let t3=t=>{let e=i=>{if(!i)return i;if(Array.isArray(i))return i.map(t=>"object"==typeof t||Array.isArray(t)?e(t):t);let n={...i};for(let i of Object.keys(n)){let r=t(i.toString());r!==i&&(n[r]=n[i],delete n[i]),"object"==typeof n[r]&&(n[r]=e(n[r]))}return n};return e},t5=t3(t2),t4=t3(t1);function t6(t){if("boolean"==typeof t)return t;if(null==t)return!1;if("string"==typeof t){if("true"===t.toLowerCase())return!0;if("false"===t.toLowerCase())return!1}let e=parseInt(t,10);return!isNaN(e)&&e>0}let t7=RegExp("/{1,}","g"),t8=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==t||!t||"object"!=typeof t)return"";let i=new URLSearchParams;return Object.keys(t).forEach(n=>{let r=e.keyEncoder?e.keyEncoder(n):n,s=t[n];if(Array.isArray(s))s.forEach(t=>void 0!==t&&i.append(r,t||""));else{if(void 0===s)return;"object"==typeof s&&null!==s?i.append(r,JSON.stringify(s)):i.append(r,String(null!=s?s:""))}}),i.toString()};s(4214);let t9="http://clerk-dummy",et=["javascript:"],{isDevOrStagingUrl:ee}=(n=new Map,{isDevOrStagingUrl:t=>{if(!t)return!1;let e="string"==typeof t?t:t.hostname,i=n.get(e);return void 0===i&&(i=tB.some(t=>e.endsWith(t)),n.set(e,i)),i}}),ei=new Map;function en(t){return t.replace("clerk.","")}function er(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{base:i,hashPath:n,hashSearch:r,searchParams:s,hashSearchParams:a,...o}=t,l=new URL(i||"","undefined"!=typeof window&&window.location?window.location.href:"http://react-native-fake-base-url");if(s instanceof URLSearchParams&&s.forEach((t,e)=>{null!=t&&l.searchParams.set(t2(e),t)}),Object.assign(l,o),n||r||a){var c;let t,e=new URL(t9+l.hash.substring(1));for(let[i,s]of(c=e.pathname,e.pathname=[c,n||""].filter(t=>t).join("/").replace(t7,"/"),Object.entries((t={},new URLSearchParams(r||"").forEach((e,i)=>{if(i in t){let n=t[i];Array.isArray(n)?n.push(e):t[i]=[n,e]}else t[i]=e}),t))))e.searchParams.append(i,s);if(a)for(let t of Array.isArray(a)?a:[a])(t instanceof URLSearchParams||"object"==typeof t)&&new URLSearchParams(t).forEach((t,i)=>{null!=t&&e.searchParams.set(t2(i),t)});let i=e.href.replace(t9,"");"/"!==i&&(l.hash=i)}let{stringify:u,skipOrigin:h}=e;return u?h?l.href.replace(l.origin,""):l.href:l}function es(t){return void 0===window.location&&"string"==typeof t?t:(t=new URL(t.toString(),window.location.origin)).href.replace(t.origin,"")}let ea=t=>(t||"").replace(/\/+$/,"");function eo(t,e){try{return new URL(t)}catch{return new URL(t,e)}}let el=[/\0/,/^\/\//,/[\x00-\x1F]/],ec=["/oauth/authorize"],eu=["/v1/verify","/v1/tickets/accept","/oauth/authorize-with-immediate-redirect","/oauth/end_session"];function eh(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function ed(t,e){var i=function(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return e.get(t)}(t,e,0);return i.get?i.get.call(t):i.value}function ef(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return i}function ep(t,e){eh(t,e),e.add(t)}function e_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var eg=(m=new WeakSet,y=new WeakSet,w=new WeakSet,b=new WeakSet,k=new WeakSet,S=new WeakSet,A=new WeakSet,I=new WeakMap,x=class{getAfterSignInUrl(){return ef(this,b,ew).call(this,"signIn")}getAfterSignUpUrl(){return ef(this,b,ew).call(this,"signUp")}getPreservedSearchParams(){return ef(this,m,ev).call(this,ef(this,y,em).call(this))}toSearchParams(){return ef(this,m,ev).call(this,ef(this,w,ey).call(this))}constructor(t,e={},i={},n){ep(this,m),ep(this,y),ep(this,w),ep(this,b),ep(this,k),ep(this,S),ep(this,A),e_(this,"options",void 0),e_(this,"fromOptions",void 0),e_(this,"fromProps",void 0),e_(this,"fromSearchParams",void 0),e_(this,"mode",void 0),function(t,e,i){eh(t,e),e.set(t,i)}(this,I,{writable:!0,value:t=>{var e;let i,n;return t0(t,(i=null==(e=this.options)?void 0:e.allowedRedirectOrigins,n=window.location.origin,t=>{let e=t;if("string"==typeof e&&(e=eo(e,n)),!i)return!0;let r=n===e.origin,s=!function(t){if(function(t){if(!function(t){if(!t)return!1;try{return new URL(t),!0}catch{return!1}}(t))return!1;let e=new URL(t).protocol;return et.some(t=>t===e)}(t))return!0;for(let e of el)if(e.test(t.pathname))return!0;return!1}(e)&&(r||i.map(t=>"string"==typeof t?(t=>{try{return t$(t)}catch(e){throw Error("Invalid pattern: ".concat(t,".\nConsult the documentation of glob-to-regexp here: https://www.npmjs.com/package/glob-to-regexp.\n").concat(e.message))}})(ea(t)):t).some(t=>t.test(ea(e.origin))));return s||tQ("Clerk: Redirect URL ".concat(e," is not on one of the allowedRedirectOrigins, falling back to the default redirect URL.")),s}))}}),this.options=t,this.fromOptions=ef(this,k,eb).call(this,t||{}),this.fromProps=ef(this,k,eb).call(this,e||{}),this.fromSearchParams=ef(this,S,ek).call(this,i||{}),this.mode=n}},e_(x,"keys",["signInForceRedirectUrl","signInFallbackRedirectUrl","signUpForceRedirectUrl","signUpFallbackRedirectUrl","redirectUrl"]),e_(x,"preserved",["redirectUrl"]),x);function ev(t){return new URLSearchParams(Object.entries(Object.fromEntries(Object.entries(t).map(t=>{let[e,i]=t;return[t2(e),i]}))).reduce((t,e)=>{let[i,n]=e;return null!=n&&(t[i]=n),t},{}))}function em(){return Object.fromEntries(Object.entries({...this.fromSearchParams}).filter(t=>{let[e]=t;return x.preserved.includes(e)}))}function ey(){let t=this.fromSearchParams.signUpForceRedirectUrl||this.fromProps.signUpForceRedirectUrl||this.fromOptions.signUpForceRedirectUrl,e=this.fromSearchParams.signUpFallbackRedirectUrl||this.fromProps.signUpFallbackRedirectUrl||this.fromOptions.signUpFallbackRedirectUrl,i=this.fromSearchParams.signInForceRedirectUrl||this.fromProps.signInForceRedirectUrl||this.fromOptions.signInForceRedirectUrl,n={signUpForceRedirectUrl:t,signUpFallbackRedirectUrl:e,signInFallbackRedirectUrl:this.fromSearchParams.signInFallbackRedirectUrl||this.fromProps.signInFallbackRedirectUrl||this.fromOptions.signInFallbackRedirectUrl,signInForceRedirectUrl:i,redirectUrl:this.fromSearchParams.redirectUrl};return t&&delete n.signUpFallbackRedirectUrl,i&&delete n.signInFallbackRedirectUrl,n}function ew(t){let e,i="".concat(t,"ForceRedirectUrl"),n="".concat(t,"FallbackRedirectUrl");return((e=this.fromSearchParams[i]||this.fromProps[i]||this.fromOptions[i])||(e=this.fromSearchParams.redirectUrl),e||(e=this.fromSearchParams[n]||this.fromProps[n]||this.fromOptions[n]),e||"modal"!==this.mode)?e||"/":window.location.href}function eb(t){let e={};return x.keys.forEach(i=>{e[i]=t[i]}),tZ(ed(this,I).call(this,ef(this,A,eS).call(this,t0(e,Boolean))),t=>t.toString())}function ek(t){let e={};return x.keys.forEach(i=>{t instanceof URLSearchParams?e[i]=t.get(t2(i)):e[i]=t[t2(i)]}),tZ(ed(this,I).call(this,ef(this,A,eS).call(this,t0(e,Boolean))),t=>t.toString())}function eS(t){return tZ(t,t=>eo(t,window.location.origin))}let eA="__clerk_netlify_cache_bust",eI=["__clerk_status","__clerk_created_session","__clerk_invitation_token","__clerk_ticket","__clerk_modal_state","__clerk_handshake","__clerk_handshake_nonce","__clerk_help",eA,tM,tz,tN];function ex(t){return new URL(window.location.href).searchParams.get(t)||null}function eU(t){let e=new URL(window.location.href);e.searchParams.has(t)&&(e.searchParams.delete(t),window.history.replaceState(window.history.state,"",e))}function eE(t){let e=new URLSearchParams(window.location.search),i=t||new URLSearchParams;for(let t of eI){let n=e.get(t);n&&i.set(t,n)}return i}let eP={"choose-organization":"choose-organization","reset-password":"reset-password"},eC=t=>"/tasks/".concat(eP[t.key]);function eO(t,e){let{navigate:i,baseUrl:n}=e,r=t.currentTask;if(r){var s;let t;return i((s={base:n},t=eE(),er({base:s.base,hashPath:eC(r),searchParams:t},{stringify:!0})))}}let eT=t=>"\uD83D\uDD12 Clerk:\n".concat(t.trim(),"\n(This notice only appears in development)"),eR={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.",cannotRenderSignUpComponentWhenTaskExists:"The <SignUp/> component cannot render when a user has a pending task, 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 task instead.",cannotRenderComponentWhenTaskDoesNotExist:"<TaskChooseOrganization/> cannot render unless a session task is pending. Clerk is redirecting to the value set in `redirectUrlComplete` 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.",cannotRenderSignInComponentWhenTaskExists:"The <SignIn/> component cannot render when a user has a pending task, 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 task 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:t=>eT("The <".concat(t,"/> 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.")),cannotRenderAnyBillingComponent:t=>eT("The <".concat(t,"/> component cannot be rendered when billing is disabled. Visit 'https://dashboard.clerk.com/last-active?path=billing/settings' to follow the necessary steps to enable billing. Since billing is disabled, 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.",cannotOpenCheckout:"The Checkout drawer 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.",cannotRenderAPIKeysComponent:"The <APIKeys/> component cannot be rendered when API keys is disabled. Since API keys is disabled, this is no-op.",cannotRenderAPIKeysComponentForOrgWhenUnauthorized:"The <APIKeys/> component cannot be rendered for an organization unless a user has the required permissions. Since the user does not have the necessary permissions, this is no-op.",cannotRenderAPIKeysComponentForUserWhenDisabled:"The <APIKeys/> component cannot be rendered when user API keys are disabled. Since user API keys are disabled, this is no-op.",cannotRenderAPIKeysComponentForOrgWhenDisabled:"The <APIKeys/> component cannot be rendered when organization API keys are disabled. Since organization API keys are disabled, this is no-op."};for(let t of Object.keys(eR)){let e=eR[t];"function"!=typeof e&&(eR[t]=eT(e))}let eM="clerk:beforeunload",eN=["http:","https:","wails:","chrome-extension:"];function ez(t){let e=new URL(t,window.location.href);window.dispatchEvent(new CustomEvent(eM)),window.location.href=e.href}function eW(t){return/^http(s)?:\/\//.test(t||"")}function eF(t){return t.startsWith("/")}function eD(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function eL(t,e,i){if(!e.has(t))throw TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function ej(t,e){var i=eL(t,e,"get");return i.get?i.get.call(t):i.value}function eB(t,e,i){eD(t,e),e.set(t,i)}function eV(t,e,i){var n=eL(t,e,"set");if(n.set)n.set.call(t,i);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=i}return i}function eJ(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return i}function eK(t,e){eD(t,e),e.add(t)}var eq=(U=new WeakMap,E=new WeakMap,P=new WeakSet,class{isEventThrottled(t){let e=Date.now(),i=eJ(this,P,e3).call(this,t),n=ej(this,U).getItem(i);return!(!n||e-n>ej(this,E))||(ej(this,U).setItem(i,e),!1)}constructor(t){eK(this,P),eB(this,U,{writable:!0,value:void 0}),eB(this,E,{writable:!0,value:864e5}),eV(this,U,t)}}),eH=(C=new WeakMap,O=new WeakSet,class{getItem(t){return eJ(this,O,e5).call(this)[t]}setItem(t,e){try{let i=eJ(this,O,e5).call(this);i[t]=e,localStorage.setItem(ej(this,C),JSON.stringify(i))}catch(t){t instanceof DOMException&&("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&localStorage.length>0&&localStorage.removeItem(ej(this,C))}}removeItem(t){try{let e=eJ(this,O,e5).call(this);delete e[t],localStorage.setItem(ej(this,C),JSON.stringify(e))}catch{}}static isSupported(){return"undefined"!=typeof window&&!!window.localStorage}constructor(){eK(this,O),eB(this,C,{writable:!0,value:"clerk_telemetry_throttler"})}}),eG=(T=new WeakMap,R=new WeakMap,class{getItem(t){return ej(this,T).size>ej(this,R)?void ej(this,T).clear():ej(this,T).get(t)}setItem(t,e){ej(this,T).set(t,e)}removeItem(t){ej(this,T).delete(t)}constructor(){eB(this,T,{writable:!0,value:new Map}),eB(this,R,{writable:!0,value:1e4})}});let e$=new Set(["error","warn","info","debug","trace"]);var eY=(M=new WeakMap,N=new WeakMap,z=new WeakMap,W=new WeakMap,F=new WeakMap,D=new WeakSet,L=new WeakSet,j=new WeakSet,B=new WeakSet,V=new WeakSet,J=new WeakSet,K=new WeakSet,q=new WeakSet,H=new WeakSet,class{get isEnabled(){var t,e;return!("development"!==ej(this,z).instanceType||ej(this,M).disabled||"undefined"!=typeof process&&process.env&&t6(process.env.CLERK_TELEMETRY_DISABLED))&&("undefined"==typeof window||null==(e=window)||null==(t=e.navigator)||!t.webdriver)}get isDebug(){return ej(this,M).debug||"undefined"!=typeof process&&process.env&&t6(process.env.CLERK_TELEMETRY_DEBUG)}record(t){try{let e=eJ(this,q,ii).call(this,t.event,t.payload);if(eJ(this,J,it).call(this,e.event,e),!eJ(this,D,e4).call(this,e,t.eventSamplingRate))return;ej(this,W).push({kind:"event",value:e}),eJ(this,B,e8).call(this)}catch(t){console.error("[clerk/telemetry] Error recording telemetry event",t)}}recordLog(t){try{var e;if(!eJ(this,L,e6).call(this,t))return;let i="string"==typeof(null==t?void 0:t.level)&&e$.has(t.level),n="string"==typeof(null==t?void 0:t.message)&&t.message.trim().length>0,r=null,s=null==t?void 0:t.timestamp;if("number"==typeof s||"string"==typeof s){let t=new Date(s);Number.isNaN(t.getTime())||(r=t)}if(!i||!n||null===r){this.isDebug&&"undefined"!=typeof console&&console.warn("[clerk/telemetry] Dropping invalid telemetry log entry",{levelIsValid:i,messageIsValid:n,timestampIsValid:null!==r});return}let a=eJ(this,K,ie).call(this),o={sdk:a.name,sdkv:a.version,cv:null!=(e=ej(this,z).clerkVersion)?e:"",lvl:t.level,msg:t.message,ts:r.toISOString(),pk:ej(this,z).publishableKey||null,payload:eJ(this,H,ir).call(this,t.context)};ej(this,W).push({kind:"log",value:o}),eJ(this,B,e8).call(this)}catch(t){console.error("[clerk/telemetry] Error recording telemetry log entry",t)}}constructor(t){var e,i,n,r,s,a,o;eK(this,D),eK(this,L),eK(this,j),eK(this,B),eK(this,V),eK(this,J),eK(this,K),eK(this,q),eK(this,H),eB(this,M,{writable:!0,value:void 0}),eB(this,N,{writable:!0,value:void 0}),eB(this,z,{writable:!0,value:{}}),eB(this,W,{writable:!0,value:[]}),eB(this,F,{writable:!0,value:null}),eV(this,M,{maxBufferSize:null!=(e=t.maxBufferSize)?e:5,samplingRate:null!=(i=t.samplingRate)?i:1,perEventSampling:null==(n=t.perEventSampling)||n,disabled:null!=(r=t.disabled)&&r,debug:null!=(s=t.debug)&&s,endpoint:"https://clerk-telemetry.com"}),t.clerkVersion||"undefined"!=typeof window?ej(this,z).clerkVersion=null!=(a=t.clerkVersion)?a:"":ej(this,z).clerkVersion="",ej(this,z).sdk=t.sdk,ej(this,z).sdkVersion=t.sdkVersion,ej(this,z).publishableKey=null!=(o=t.publishableKey)?o:"";const l=tK(t.publishableKey);l&&(ej(this,z).instanceType=l.instanceType),t.secretKey&&(ej(this,z).secretKey=t.secretKey.substring(0,16)),eV(this,N,new eq(eH.isSupported()?new eH:new eG))}});let eX="COMPONENT_MOUNTED",eQ=new Set(["SignIn","SignUp"]);function eZ(t){return function(e,i,n){var r,s,a;return{event:t,eventSamplingRate:t===eX?eQ.has(e)?1:.1:.1,payload:{component:e,appearanceProp:!!(null==i?void 0:i.appearance),theme:!!(null==i||null==(r=i.appearance)?void 0:r.theme),elements:!!(null==i||null==(s=i.appearance)?void 0:s.elements),variables:!!(null==i||null==(a=i.appearance)?void 0:a.variables),...n}}}}function e0(t,e,i){return eZ(eX)(t,e,i)}function e1(t,e,i){return eZ("COMPONENT_OPENED")(t,e,i)}function e2(t){return"string"==typeof t?t:"object"==typeof t&&null!==t&&"name"in t&&"string"==typeof t.name?t.name:void 0}function e3(t){let{sk:e,pk:i,payload:n,...r}=t,s={...n,...r};return JSON.stringify(Object.keys({...n,...r}).sort().map(t=>s[t]))}function e5(){try{let t=localStorage.getItem(ej(this,C));if(!t)return{};return JSON.parse(t)}catch{return{}}}function e4(t,e){return this.isEnabled&&!this.isDebug&&eJ(this,j,e7).call(this,t,e)}function e6(t){return!0}function e7(t,e){let i=Math.random();return!!(i<=ej(this,M).samplingRate&&(!1===ej(this,M).perEventSampling||void 0===e||i<=e))&&!ej(this,N).isEventThrottled(t)}function e8(){if("undefined"==typeof window)return void eJ(this,V,e9).call(this);if(ej(this,W).length>=ej(this,M).maxBufferSize){ej(this,F)&&("undefined"!=typeof cancelIdleCallback?cancelIdleCallback(Number(ej(this,F))):clearTimeout(Number(ej(this,F)))),eJ(this,V,e9).call(this);return}ej(this,F)||("requestIdleCallback"in window?eV(this,F,requestIdleCallback(()=>{eJ(this,V,e9).call(this),eV(this,F,null)})):eV(this,F,setTimeout(()=>{eJ(this,V,e9).call(this),eV(this,F,null)},0)))}function e9(){let t=[...ej(this,W)];if(eV(this,W,[]),eV(this,F,null),0===t.length)return;let e=t.filter(t=>"event"===t.kind).map(t=>t.value),i=t.filter(t=>"log"===t.kind).map(t=>t.value);e.length>0&&fetch(new URL("/v1/event",ej(this,M).endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({events:e})}).catch(()=>void 0),i.length>0&&fetch(new URL("/v1/logs",ej(this,M).endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({logs:i})}).catch(()=>void 0)}function it(t,e){this.isDebug&&(void 0!==console.groupCollapsed?(console.groupCollapsed("[clerk/telemetry]",t),console.log(e),console.groupEnd()):console.log("[clerk/telemetry]",t,e))}function ie(){let t={name:ej(this,z).sdk,version:ej(this,z).sdkVersion};if("undefined"!=typeof window){let e=window;if(e.Clerk){let i=e.Clerk;if("object"==typeof i&&null!==i&&"constructor"in i&&"function"==typeof i.constructor&&i.constructor.sdkMetadata){let{name:e,version:n}=i.constructor.sdkMetadata;void 0!==e&&(t.name=e),void 0!==n&&(t.version=n)}}}return t}function ii(t,e){var i,n;let r=eJ(this,K,ie).call(this);return{event:t,cv:null!=(i=ej(this,z).clerkVersion)?i:"",it:null!=(n=ej(this,z).instanceType)?n:"",sdk:r.name,sdkv:r.version,...ej(this,z).publishableKey?{pk:ej(this,z).publishableKey}:{},...ej(this,z).secretKey?{sk:ej(this,z).secretKey}:{},payload:e}}function ir(t){if(null==t||"object"!=typeof t)return null;try{let e=JSON.parse(JSON.stringify(t));if(e&&"object"==typeof e&&!Array.isArray(e))return e;return null}catch{return null}}var is=s(6431);let ia=!1,io=null,il=!1,ic=[];function iu(t,e,i,n){ia&&(ic.push({level:t,message:e,context:i,source:n,ts:Date.now()}),ic.length>200&&ic.shift())}async function ih(t){try{if(!ia||io)return;let{getDebugLogger:e}=await Promise.all([s.e("545"),s.e("507")]).then(s.bind(s,9854)),i=await e({logLevel:null==t?void 0:t.logLevel,telemetryCollector:null==t?void 0:t.telemetryCollector});if(i&&(io=i)&&0!==ic.length){for(let t of ic){let e={...t.context||{},__preInit:!0,__preInitTs:t.ts};switch(t.level){case"error":io.error(t.message,e,t.source);break;case"warn":io.warn(t.message,e,t.source);break;case"info":io.info(t.message,e,t.source);break;case"debug":io.debug(t.message,e,t.source)}}ic.length=0}}catch(t){try{var e,i;null==(e=(i=console).debug)||e.call(i,"Debug logger initialization failed",t)}catch{}return}}let id={debug(t,e,i){io?io.debug(t,e,i):iu("debug",t,e,i)},error(t,e,i){io?io.error(t,e,i):iu("error",t,e,i)},info(t,e,i){io?io.info(t,e,i):iu("info",t,e,i)},warn(t,e,i){io?io.warn(t,e,i):iu("warn",t,e,i)}},ip={initialDelay:125,maxDelayBetweenRetries:0,factor:2,shouldRetry:(t,e)=>e<5,retryImmediately:!1,jitter:!0},i_=async t=>new Promise(e=>setTimeout(e,t)),ig=(t,e)=>e?t*(1+Math.random()):t,iv=async function(t){var e;let i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=0,{shouldRetry:s,initialDelay:a,maxDelayBetweenRetries:o,factor:l,retryImmediately:c,jitter:u,onBeforeRetry:h}={...ip,...n},d=(e={initialDelay:a,maxDelayBetweenRetries:o,factor:l,jitter:u},i=0,async()=>{let t;await i_((t=ig(t=e.initialDelay*Math.pow(e.factor,i),e.jitter),Math.min(e.maxDelayBetweenRetries||t,t))),i++});for(;;)try{return await t()}catch(t){if(!s(t,++r))throw t;h&&await h(r),c&&1===r?await i_(ig(100,u)):await d()}},im=async t=>iv(t,{initialDelay:100,shouldRetry:(t,e)=>e<=3,retryImmediately:!0,factor:2});var iy=new WeakMap;class iw{import(t){return o(this,iy)[t]?o(this,iy)[t]():Promise.resolve(void 0)}constructor(){c(this,iy,{writable:!0,value:{"@zxcvbn-ts/core":()=>im(()=>Promise.all([s.e("729"),s.e("545")]).then(s.bind(s,7010))),"@zxcvbn-ts/language-common":()=>im(()=>s.e("873").then(s.bind(s,655))),"@base-org/account":()=>im(()=>Promise.all([s.e("994"),s.e("929"),s.e("545")]).then(s.bind(s,4013))),"@coinbase/wallet-sdk":()=>im(()=>Promise.all([s.e("994"),s.e("929"),s.e("545")]).then(s.bind(s,5537))),"@stripe/stripe-js":()=>im(()=>s.e("279").then(s.bind(s,5608)))}})}}let ib=function(){let t,e,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!i)return{track:async t=>{await t()},isUnloading:()=>!1};let n=(t=!1,e=()=>t=!0,{startListening:()=>{window.addEventListener("beforeunload",e),window.addEventListener(eM,e)},stopListening:()=>{window.removeEventListener("beforeunload",e),window.removeEventListener(eM,e)},isUnloading:()=>t});return{track:async t=>{n.startListening(),await t(),n.stopListening()},isUnloading:n.isUnloading}},ik=t=>({amount:t.amount,amountFormatted:t.amount_formatted,currency:t.currency,currencySymbol:t.currency_symbol}),iS=t=>{let e={grandTotal:ik(t.grand_total),subtotal:ik(t.subtotal),taxTotal:ik(t.tax_total)};return"past_due"in t&&(e.pastDue=t.past_due?ik(t.past_due):null),"credit"in t&&(e.credit=t.credit?ik(t.credit):null),"total_due_now"in t&&(e.totalDueNow=ik(t.total_due_now)),"total_due_after_free_trial"in t&&(e.totalDueAfterFreeTrial=t.total_due_after_free_trial?ik(t.total_due_after_free_trial):null),e};function iA(t){return decodeURIComponent(globalThis.atob(t.replace(/_/g,"/").replace(/-/g,"+")).split("").map(t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}function iI(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t.errors&&!!t.errors.find(t=>t.code===e)}let ix=function(t){let{packageName:e,customMessages:i}=t,n=e;function r(t,e){if(!e)return"".concat(n,": ").concat(t);let i=t;for(let n of t.matchAll(/{{([a-zA-Z0-9-_]+)}}/g)){let t=(e[n[1]]||"").toString();i=i.replace("{{".concat(n[1],"}}"),t)}return"".concat(n,": ").concat(i)}let s={...tw,...i};return{setPackageName(t){let{packageName:e}=t;return"string"==typeof e&&(n=e),this},setMessages(t){let{customMessages:e}=t;return Object.assign(s,e||{}),this},throwInvalidPublishableKeyError(t){throw Error(r(s.InvalidPublishableKeyErrorMessage,t))},throwInvalidProxyUrl(t){throw Error(r(s.InvalidProxyUrlErrorMessage,t))},throwMissingPublishableKeyError(){throw Error(r(s.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(r(s.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(t){throw Error(r(s.MissingClerkProvider,t))},throw(t){throw Error(r(t))}}}({packageName:"@clerk/clerk-js"});function iU(t){let e=(t||"").split("."),[i,n,r]=e;if(3!==e.length||!i||!n||!r)throw Error("JWT could not be decoded");let s=JSON.parse(iA(n)),a={__raw:t};return Object.keys(s).forEach(t=>{a[t]=s[t]}),{encoded:{header:i,payload:n,signature:r},header:JSON.parse(iA(i)),claims:a}}function iE(){if(!tr())return null;try{var t;let e=null==(t=navigator)?void 0:t.language;if(!e||"string"!=typeof e||""===e.trim())return null;return e}catch{return null}}function iP(){return void 0!==globalThis.document}function iC(){if(!function(){if(!iP())return!1;try{return window.self!==window.top}catch{return!0}}())return!1;try{var t;return null==(t=window.top)||t.location.href,!1}catch{return!0}}s(8303);let iO={build:(t,e,i)=>[t,e,i].filter(Boolean).join("-"),parse:(t,e,i)=>{let n=iO.extractTemplate(t,e,i);return{organizationId:i,sessionId:e,template:n}},extractTemplate:(t,e,i)=>{if(t===e||i&&t==="".concat(e,"-").concat(i))return;let n=t.slice(e.length+1);return i&&n.endsWith("-".concat(i))&&(n=n.slice(0,-(i.length+1))),n||void 0}},iT="ClerkJS:";function iR(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";throw Error("".concat(iT," Something went wrong initializing Clerk in development mode.").concat(t&&" ".concat(t)))}function iM(t){throw Error("".concat(iT," Something went wrong initializing Clerk during the ").concat(t," flow. Please contact support."))}function iN(t){throw Error("".concat(iT," You need to start a ").concat(t," flow by calling ").concat(t,".create() first."))}function iz(t,e){throw Error("".concat(iT,' Strategy "').concat(e,'" is not a valid strategy for ').concat(t,"."))}function iW(t){throw Error("".concat(iT," You need to start a ").concat(t," flow by calling ").concat(t,".create({ identifier: 'your web3 wallet address' }) first"))}function iF(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";throw Error("".concat(iT," Missing '").concat(t,"' option"))}function iD(t,e){throw Error("".concat(iT," Response: ").concat(t||0," not supported yet.\nFor more information contact us at ").concat(e))}function iL(t){throw Error("".concat(iT," Missing publicKey. When calling 'navigator.credentials.").concat(t,"()' it is required to pass a publicKey object."))}function ij(t,e){return e.get?e.get.call(t):e.value}function iB(t,e){if(void 0===t)throw TypeError("attempted to "+e+" private static field before its declaration")}function iV(t,e){var i=function(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return e.get(t)}(t,e,0);return ij(t,i)}function iJ(t,e,i){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object");e.set(t,i)}function iK(t,e,i){return iq(t,e),iB(i,"get"),ij(t,i)}function iq(t,e){if(t!==e)throw TypeError("Private static access of wrong provenance")}var iH=(G=new WeakMap,$=new WeakMap,Y=new WeakMap,X=class t{static getInstance(){return iK(t,X,Q)||function(t,e,i,n){iq(t,e),iB(i,"set");if(i.set)i.set.call(t,n);else{if(!i.writable)throw TypeError("attempted to set read only private field");i.value=n}}(t,X,Q,new t),iK(t,X,Q)}constructor(){if(iJ(this,G,{writable:!0,value:[]}),iJ(this,$,{writable:!0,value:{metamask:"MetaMask",okx_wallet:"OKX Wallet"}}),!function(t,e,i){"get"in t?Object.defineProperty(t,"get",{value:i,enumerable:!0,configurable:!0,writable:!0}):t.get=i}(this,0,t=>{var e;let i=null==(e=iV(this,G).find(e=>e.info.name===iV(this,$)[t]))?void 0:e.provider;return void 0!==i?i:window.ethereum}),iJ(this,Y,{writable:!0,value:t=>{iV(this,G).some(e=>e.info.uuid===t.detail.info.uuid)||iV(this,G).push(t.detail)}}),"undefined"==typeof window)return;window.addEventListener("eip6963:announceProvider",iV(this,Y)),window.dispatchEvent(new Event("eip6963:requestProvider"))}},Q={writable:!0,value:null},X);let iG=()=>(function(t){async function e(t){let{provider:e}=t,i=await h(e);if(!i)return"";let n=await i.request({method:"eth_requestAccounts"});return n&&n[0]||""}async function i(t){let{identifier:e,nonce:i,provider:n}=t,r=await h(n);return r?await r.request({method:"personal_sign",params:["0x".concat(i.split("").map(t=>t.charCodeAt(0).toString(16).padStart(2,"0")).join("")),e]}):""}async function n(){return await e({provider:"metamask"})}async function r(){return await e({provider:"coinbase_wallet"})}async function s(){return await e({provider:"okx_wallet"})}async function a(){return await e({provider:"base"})}async function o(t){return await i({...t,provider:"metamask"})}async function l(t){return await i({...t,provider:"coinbase_wallet"})}async function c(t){return await i({...t,provider:"okx_wallet"})}async function u(t){return await i({...t,provider:"base"})}async function h(e){if("coinbase_wallet"===e){let e=await t.import("@coinbase/wallet-sdk");return e?e.createCoinbaseWalletSDK({preference:{options:"all"}}).getProvider():null}if("base"===e)try{var i,n,r;let e=await t.import("@base-org/account");if(!e)return null;return e.createBaseAccountSDK({appName:"undefined"!=typeof window&&(null==(r=window.Clerk)||null==(n=r.__internal_environment)||null==(i=n.displayConfig)?void 0:i.applicationName)||"undefined"!=typeof document&&document.title||"Web3 Application"}).getProvider()}catch{return null}return iH.getInstance().get(e)}return{getWeb3Identifier:e,generateWeb3Signature:i,getMetamaskIdentifier:n,getCoinbaseWalletIdentifier:r,getOKXWalletIdentifier:s,getBaseIdentifier:a,generateSignatureWithMetamask:o,generateSignatureWithCoinbaseWallet:l,generateSignatureWithOKXWallet:c,generateSignatureWithBase:u}})(new iw),i$="environment",iY=JSON.stringify,iX=JSON.parse;class iQ{static _key(t){return"".concat("__clerk_").concat(t)}static isExpired(t){return!!t.exp&&Date.now()>t.exp}static setItem(t,e,i){try{let n={value:e,...i&&{exp:Date.now()+i}};window.localStorage.setItem(this._key(t),iY(n))}catch{}}static getItem(t,e){try{var i;let n=window.localStorage.getItem(this._key(t));if(!n)return e;let r=iX(n);if(!r)return e;if(this.isExpired(r))return this.removeItem(t),e;return null!=(i=null==r?void 0:r.value)?i:e}catch{return e}}static removeItem(t){try{window.localStorage.removeItem(this._key(t))}catch{}}}async function iZ(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,{async:i,defer:n,beforeLoad:r,crossOrigin:s,nonce:a}=e||{};return iv(()=>new Promise((e,o)=>{t||o(Error("loadScript cannot be called without a src")),document&&document.body||o(Error("loadScript cannot be called when document does not exist"));let l=document.createElement("script");s&&l.setAttribute("crossorigin",s),l.async=i||!1,l.defer=n||!1,l.addEventListener("load",()=>{l.remove(),e(l)}),l.addEventListener("error",e=>{var i;l.remove(),o(null!=(i=e.error)?i:Error("failed to load script: ".concat(t)))}),l.src=t,l.nonce=a,null==r||r(l),document.body.appendChild(l)}),{shouldRetry:(t,e)=>e<=5})}async function i0(t){return window.turnstile||await i1(t).catch(()=>{throw{captchaError:"captcha_script_failed_to_load"}}),window.turnstile}async function i1(t){try{return await iZ("https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",{defer:!0,nonce:t})}catch(t){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."),t}}function i2(t){try{let e=t.getAttribute("data-cl-theme")||void 0,i=t.getAttribute("data-cl-language")||void 0,n=t.getAttribute("data-cl-size")||void 0;return{theme:e,language:i,size:n}}catch{return{theme:void 0,language:void 0,size:void 0}}}let i3=async t=>{let e,i,n,r,{siteKey:s,widgetType:a,invisibleSiteKey:o,nonce:l}=t,{modalContainerQuerySelector:c,modalWrapperQuerySelector:u,closeModal:h,openModal:d}=t,f=await i0(l),p=[],_="",g="",v=s,m=0,y=null,w="invisible";if(c&&u){y=a,r=c,w="modal";try{await (null==d?void 0:d())}catch{throw{captchaError:"modal_component_not_ready"}}let t=await new Promise(t=>{if(document.querySelector(c))return t(document.querySelector(c));let e=new MutationObserver(()=>{document.querySelector(c)&&(e.disconnect(),t(document.querySelector(c)))});e.observe(document.body,{childList:!0,subtree:!0})});if(t){let{theme:r,language:s,size:a}=i2(t);e=r,n=s,i=a}}if(!r&&"smart"===a){let t=document.getElementById(tW);if(t){w="smart",y="smart",r="#".concat(tW),t.style.maxHeight="0";let{theme:s,language:a,size:o}=i2(t);e=s,n=a,i=o}else 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/guides/development/custom-flows/authentication/bot-sign-up-protection for instructions")}if(!r){w="invisible",v=o,y="invisible",r=".".concat(tF);let t=document.createElement("div");t.classList.add(tF),t.style.display="none",document.body.appendChild(t)}let b=async()=>new Promise((s,a)=>{try{let o=f.render(r,{sitekey:v,appearance:"interaction-only",theme:e||"auto",size:i||"normal",language:n||"auto",action:t.action,retry:"never","refresh-expired":"auto",callback:function(t){null==h||h(),s([t,o])},"before-interactive-callback":()=>{if(u){let t=document.querySelector(u);null==t||t.style.setProperty("visibility","visible"),null==t||t.style.setProperty("pointer-events","all")}else{let t=document.getElementById(tW);t&&(t.style.maxHeight="unset",t.style.minHeight="compact"===i?"140px":"68px",t.style.marginBottom="1.5rem")}},"error-callback":function(t){var e;(p.push(t),m<2&&(e=t.toString(),["crashed","undefined_error","102","103","104","106","110600","300","600"].find(t=>e.startsWith(t))))?setTimeout(()=>{f.reset(o),m++},250):a([p.join(","),o])},"unsupported-callback":function(){return a(["This browser is not supported by the CAPTCHA.",o]),!0}})}catch(t){a([t,void 0])}});try{[_,g]=await b(),f.remove(g)}catch(i){let[t,e]=i;throw e&&f.remove(e),{captchaError:t}}finally{if("modal"===w&&(null==h||h()),"invisible"===w){let t=document.querySelector(".".concat(tF));t&&document.body.removeChild(t)}if("smart"===w){let t=document.getElementById(tW);t&&(t.style.maxHeight="0",t.style.minHeight="unset",t.style.marginBottom="unset")}}return{captchaToken:_,captchaWidgetType:y}},i5=t=>{var e;let i=t.__internal_environment,n=i?i.displayConfig.captchaProvider:"turnstile",r=null==(e=t.__internal_getOption)?void 0:e.call(t,"nonce");return{captchaSiteKey:i?i.displayConfig.captchaPublicKey:null,captchaWidgetType:i?i.displayConfig.captchaWidgetType:null,captchaProvider:n,captchaPublicKeyInvisible:i?i.displayConfig.captchaPublicKeyInvisible:null,canUseCaptcha:i?i.userSettings.signUp.captcha_enabled&&t.isStandardBrowser:null,nonce:r||void 0}};class i4{async invisible(t){let{captchaSiteKey:e,canUseCaptcha:i,captchaPublicKeyInvisible:n,nonce:r}=i5(this.clerk);return i&&e&&n?{...await i3({action:null==t?void 0:t.action,captchaProvider:"turnstile",invisibleSiteKey:n,nonce:(null==t?void 0:t.nonce)||r||void 0,siteKey:n,widgetType:"invisible"}).catch(t=>t.captchaError?{captchaError:t.captchaError}:{captchaError:(null==t?void 0:t.message)||t||"unexpected_captcha_error"}),captchaAction:null==t?void 0:t.action}:{captchaError:"captcha_unavailable",captchaAction:null==t?void 0:t.action}}async managedOrInvisible(t){let{captchaSiteKey:e,canUseCaptcha:i,captchaWidgetType:n,captchaProvider:r,captchaPublicKeyInvisible:s,nonce:a}=i5(this.clerk);if(i&&e&&s){let i=await i3({captchaProvider:r,invisibleSiteKey:s,nonce:a||void 0,siteKey:e,widgetType:n,...t}).catch(e=>e.captchaError?{captchaError:e.captchaError}:(null==t?void 0:t.action)==="verify"?{captchaError:(null==e?void 0:e.message)||e||"unexpected_captcha_error"}:void 0);return(null==t?void 0:t.action)==="verify"?{...i,captchaAction:"verify"}:i}return(null==t?void 0:t.action)==="verify"?{captchaError:"captcha_unavailable",captchaAction:null==t?void 0:t.action}:{}}async managedInModal(t){return this.managedOrInvisible({modalWrapperQuerySelector:"#cl-modal-captcha-wrapper",modalContainerQuerySelector:"#cl-modal-captcha-container",openModal:()=>this.clerk.__internal_openBlankCaptchaModal(),closeModal:()=>this.clerk.__internal_closeBlankCaptchaModal(),action:null==t?void 0:t.action})}constructor(t){(0,tn._)(this,"clerk",void 0),this.clerk=t}}class i6{static getInstance(){return i6.instance||(i6.instance=new i6(n0,i4)),i6.instance}async execute(t,e){if(this.captchaAttemptsExceeded())throw new tk("Security verification failed. Please try again by refreshing the page, clearing your browser cookies, or using a different web browser.",{code:"captcha_client_attempts_exceeded"});try{return this.inflightException&&await this.inflightException,await e()}catch(r){var i;let n;if(!tU(r)||tE(r)&&"network_error"===r.code||(null==(i=r.errors[0])?void 0:i.code)!=="requires_captcha")throw r;if(this.inflightException)return await this.inflightException,await e();this.inflightException=new Promise(t=>n=t);try{let e=await this.managedChallenge(t);(null==e?void 0:e.captchaError)!=="modal_component_not_ready"&&(await this.client.getOrCreateInstance().__internal_sendCaptchaToken(e),this.captchaRetryCount=0)}catch(t){throw this.captchaRetryCount++,t}finally{n(),this.inflightException=null}return await e()}}managedChallenge(t){return new this.CaptchaChallengeImpl(t).managedInModal({action:"verify"})}constructor(t,e){(0,tn._)(this,"client",void 0),(0,tn._)(this,"CaptchaChallengeImpl",void 0),(0,tn._)(this,"inflightException",void 0),(0,tn._)(this,"captchaRetryCount",void 0),(0,tn._)(this,"MAX_RETRY_ATTEMPTS",void 0),(0,tn._)(this,"captchaAttemptsExceeded",void 0),this.client=t,this.CaptchaChallengeImpl=e,this.inflightException=null,this.captchaRetryCount=0,this.MAX_RETRY_ATTEMPTS=3,this.captchaAttemptsExceeded=()=>this.captchaRetryCount>=this.MAX_RETRY_ATTEMPTS}}(0,tn._)(i6,"instance",void 0);class i7{static get fapiClient(){return i7.clerk.getFapiClient()}async reload(t){let{rotatingTokenNonce:e}=t||{};return this._baseGet({forceUpdateClient:!0,rotatingTokenNonce:e})}isNew(){return!this.id}static async _fetch(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i6.getInstance().execute(this.clerk,()=>this._baseFetch(t,e))}static async _baseFetch(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i7.fapiClient||function(){throw Error("".concat(iT," Missing FAPI client in resources."))}();let{fetchMaxTries:n}=i;try{e=await i7.fapiClient.request(t,{fetchMaxTries:n})}catch(e){if(this.shouldRethrowOfflineNetworkErrors())throw new tk((null==e?void 0:e.message)||e,{code:"network_error"});if(!tl())return id.warn("Network request failed while offline, returning null",{method:t.method,path:t.path},"baseResource"),null;throw e}let{payload:r,status:s,statusText:a,headers:o}=e;if(o){let t=o.get("x-country");this.clerk.__internal_setCountry(t?t.toLowerCase():null)}if(("GET"!==t.method||i.forceUpdateClient)&&this._updateClient(r),s>=200&&s<=299)return r;if(s>=400){var l,c;let t=null==r?void 0:r.errors,e=null==t||null==(l=t[0])?void 0:l.long_message,i=null==t||null==(c=t[0])?void 0:c.code;401===s&&"requires_captcha"!==i&&await i7.clerk.handleUnauthenticated(),function(t,e){var i;if(!e||!e[0])return;let n=e[0],r=n.long_message;if("origin_invalid"===n.code&&((i=i7.clerk.publishableKey).startsWith("live_")||i.startsWith("pk_live_"))){let i=i7.clerk.frontendApi.replace("clerk.","");throw new tm('Clerk: Production Keys are only allowed for domain "'.concat(i,'". \nAPI Error: ').concat(r),{data:e,status:t})}}(s,t);let n={data:t,status:s};if(429===s&&o){let t=o.get("retry-after");if(t){let e=parseInt(t,10);isNaN(e)||(n.retryAfter=e)}}throw new tm(e||a,n)}return null}static _updateClient(t){var e;if(!t)return;let i=t.client||(null==(e=t.meta)?void 0:e.client);i&&i7.clerk&&i7.clerk.updateClient(n0.getOrCreateInstance().fromJSON(i))}path(t){let e=this.pathRoot;if(this.isNew())return e;let i=e.replace(/[^/]$/,"$&/")+encodeURIComponent(this.id);return t?i.replace(/[^/]$/,"$&/")+encodeURIComponent(t):i}withDefault(t,e){return null!=t?t:e}async _baseGet(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=await i7._fetch({method:"GET",path:this.path(),rotatingTokenNonce:t.rotatingTokenNonce},t);return this.fromJSON((null==e?void 0:e.response)||e)}async _baseMutate(t){let{action:e,body:i,method:n,path:r}=t,s=await i7._fetch({method:n,path:r||this.path(e),body:i});return this.fromJSON((null==s?void 0:s.response)||s)}async _baseMutateBypass(t){let{action:e,body:i,method:n,path:r}=t,s=await i7._baseFetch({method:n,path:r||this.path(e),body:i});return this.fromJSON((null==s?void 0:s.response)||s)}async _basePost(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseMutate({...t,method:"POST"})}async _basePostBypass(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseMutateBypass({...t,method:"POST"})}async _basePut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseMutate({...t,method:"PUT"})}async _basePatch(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseMutate({...t,method:"PATCH"})}async _baseDelete(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await this._baseMutate({...t,method:"DELETE"})}static shouldRethrowOfflineNetworkErrors(){var t,e;let i=null==(e=i7.clerk)||null==(t=e.__internal_getOption)?void 0:t.call(e,"experimental");return(null==i?void 0:i.rethrowOfflineNetworkErrors)||!1}constructor(){(0,tn._)(this,"id",void 0),(0,tn._)(this,"pathRoot","")}}function i8(t){let e=new Date(t||new Date);return e instanceof Date&&!isNaN(e.getTime())?e:new Date}(0,tn._)(i7,"clerk",void 0);class i9 extends i7{fromJSON(t){return t&&(this.id=t.id,this.type=t.type,this.name=t.name,this.subject=t.subject,this.scopes=t.scopes,this.claims=t.claims,this.revoked=t.revoked,this.revocationReason=t.revocation_reason,this.expired=t.expired,this.expiration=t.expiration?i8(t.expiration):null,this.createdBy=t.created_by,this.description=t.description,this.secret=t.secret,this.lastUsedAt=t.last_used_at?i8(t.last_used_at):null,this.updatedAt=i8(t.updated_at),this.createdAt=i8(t.created_at)),this}__internal_toSnapshot(){return{object:"api_key",id:this.id,type:this.type,name:this.name,subject:this.subject,scopes:this.scopes,claims:this.claims,revoked:this.revoked,revocation_reason:this.revocationReason,expired:this.expired,expiration:this.expiration?this.expiration.getTime():null,created_by:this.createdBy,description:this.description,last_used_at:this.lastUsedAt?this.lastUsedAt.getTime():null,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}constructor(t){super(),(0,tn._)(this,"pathRoot","/api_keys"),(0,tn._)(this,"id",void 0),(0,tn._)(this,"type",void 0),(0,tn._)(this,"name",void 0),(0,tn._)(this,"subject",void 0),(0,tn._)(this,"scopes",void 0),(0,tn._)(this,"claims",void 0),(0,tn._)(this,"revoked",void 0),(0,tn._)(this,"revocationReason",void 0),(0,tn._)(this,"expired",void 0),(0,tn._)(this,"expiration",void 0),(0,tn._)(this,"createdBy",void 0),(0,tn._)(this,"description",void 0),(0,tn._)(this,"secret",void 0),(0,tn._)(this,"lastUsedAt",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),this.fromJSON(t)}}class nt extends i7{fromJSON(t){return t&&(this.claimedAt=this.withDefault(t.claimed_at?i8(t.claimed_at):null,this.claimedAt),this.reverification=this.withDefault(t.reverification,this.reverification),this.singleSessionMode=this.withDefault(t.single_session_mode,this.singleSessionMode),this.preferredChannels=this.withDefault(t.preferred_channels,this.preferredChannels)),this}__internal_toSnapshot(){var t;return{claimed_at:this.claimedAt?this.claimedAt.getTime():null,id:null!=(t=this.id)?t:"",object:"auth_config",reverification:this.reverification,single_session_mode:this.singleSessionMode}}constructor(t=null){super(),(0,tn._)(this,"claimedAt",null),(0,tn._)(this,"reverification",!1),(0,tn._)(this,"singleSessionMode",!1),(0,tn._)(this,"preferredChannels",null),this.fromJSON(t)}}s(6843),(f=Z||(Z={}))[f.None=0]="None",f[f.Mutable=1]="Mutable",f[f.Watching=2]="Watching",f[f.RecursedCheck=4]="RecursedCheck",f[f.Recursed=8]="Recursed",f[f.Dirty=16]="Dirty",f[f.Pending=32]="Pending";let ne=[],{link:ni,unlink:nn,propagate:nr,checkDirty:ns,endTracking:na,startTracking:no,shallowPropagate:nl}=function(t){let{update:e,notify:i,unwatched:n}=t,r=0;return{link:function(t,e){let i,n=e.depsTail;if(void 0!==n&&n.dep===t)return;if(4&e.flags&&void 0!==(i=void 0!==n?n.nextDep:e.deps)&&i.dep===t){i.version=r,e.depsTail=i;return}let s=t.subsTail;if(void 0!==s&&s.version===r&&s.sub===e)return;let a=e.depsTail=t.subsTail={version:r,dep:t,sub:e,prevDep:n,nextDep:i,prevSub:s,nextSub:void 0};void 0!==i&&(i.prevDep=a),void 0!==n?n.nextDep=a:e.deps=a,void 0!==s?s.nextSub=a:t.subs=a},unlink:s,propagate:function(t){let e,n=t.nextSub;t:for(;;){let r=t.sub,s=r.flags;if(3&s&&(60&s?12&s?4&s?!(48&s)&&function(t,e){let i=e.depsTail;if(void 0!==i){let n=e.deps;do{if(n===t)return!0;if(n===i)break;n=n.nextDep}while(void 0!==n)}return!1}(t,r)?(r.flags=40|s,s&=1):s=0:r.flags=-9&s|32:s=0:r.flags=32|s,2&s&&i(r),1&s)){let i=r.subs;if(void 0!==i){t=i,void 0!==i.nextSub&&(e={value:n,prev:e},n=t.nextSub);continue}}if(void 0!==(t=n)){n=t.nextSub;continue}for(;void 0!==e;)if(t=e.value,e=e.prev,void 0!==t){n=t.nextSub;continue t}break}},checkDirty:function(t,i){let n,r=0;t:for(;;){let s=t.dep,o=s.flags,l=!1;if(16&i.flags)l=!0;else if((17&o)==17){if(e(s)){let t=s.subs;void 0!==t.nextSub&&a(t),l=!0}}else if((33&o)==33){(void 0!==t.nextSub||void 0!==t.prevSub)&&(n={value:t,prev:n}),t=s.deps,i=s,++r;continue}if(!l&&void 0!==t.nextDep){t=t.nextDep;continue}for(;r;){--r;let s=i.subs,o=void 0!==s.nextSub;if(o?(t=n.value,n=n.prev):t=s,l){if(e(i)){o&&a(s),i=t.sub;continue}}else i.flags&=-33;if(i=t.sub,void 0!==t.nextDep){t=t.nextDep;continue t}l=!1}return l}},endTracking:function(t){let e=t.depsTail,i=void 0!==e?e.nextDep:t.deps;for(;void 0!==i;)i=s(i,t);t.flags&=-5},startTracking:function(t){++r,t.depsTail=void 0,t.flags=-57&t.flags|4},shallowPropagate:a};function s(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.sub,i=t.dep,r=t.prevDep,s=t.nextDep,a=t.nextSub,o=t.prevSub;return void 0!==s?s.prevDep=r:e.depsTail=r,void 0!==r?r.nextDep=s:e.deps=s,void 0!==a?a.prevSub=o:i.subsTail=o,void 0!==o?o.nextSub=a:void 0===(i.subs=a)&&n(i),s}function a(t){do{let e=t.sub,n=t.nextSub,r=e.flags;(48&r)==32&&(e.flags=16|r,2&r&&i(e)),t=n}while(void 0!==t)}}({update:t=>"getter"in t?ng(t):nv(t,t.value),notify:function t(e){let i=e.flags;if(!(64&i)){e.flags=64|i;let n=e.subs;void 0!==n?t(n.sub):ne[nh++]=e}},unwatched(t){if("getter"in t){let e=t.deps;if(void 0!==e){t.flags=17;do e=nn(e,t);while(void 0!==e)}}else"previousValue"in t||nb.call(t)}}),nc=0,nu=0,nh=0;function nd(e){let i=t;return t=e,i}function nf(t){return nw.bind({previousValue:t,value:t,subs:void 0,subsTail:void 0,flags:1})}function np(t){return ny.bind({value:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:17,getter:t})}function n_(i){let n={fn:i,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:2};void 0!==t?ni(n,t):void 0!==e&&ni(n,e);let r=nd(n);try{n.fn()}finally{nd(r)}return nb.bind(n)}function ng(t){let e=nd(t);no(t);try{let e=t.value;return e!==(t.value=t.getter(e))}finally{nd(e),na(t)}}function nv(t,e){return t.flags=1,t.previousValue!==(t.previousValue=e)}function nm(){for(;nu<nh;){let t=ne[nu];ne[nu++]=void 0,function t(e,i){if(16&i||32&i&&ns(e.deps,e)){let t=nd(e);no(e);try{e.fn()}finally{nd(t),na(e)}return}32&i&&(e.flags=-33&i);let n=e.deps;for(;void 0!==n;){let e=n.dep,i=e.flags;64&i&&t(e,e.flags=-65&i),n=n.nextDep}}(t,t.flags&=-65)}nu=0,nh=0}function ny(){let i=this.flags;if(16&i||32&i&&ns(this.deps,this)){if(ng(this)){let t=this.subs;void 0!==t&&nl(t)}}else 32&i&&(this.flags=-33&i);return void 0!==t?ni(this,t):void 0!==e&&ni(this,e),this.value}function nw(){for(var e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];if(i.length){let t=i[0];if(this.value!==(this.value=t)){this.flags=17;let t=this.subs;void 0!==t&&(nr(t),nc||nm())}}else{let e=this.value;if(16&this.flags&&nv(this,e)){let t=this.subs;void 0!==t&&nl(t)}return void 0!==t&&ni(this,t),e}}function nb(){let t=this.deps;for(;void 0!==t;)t=nn(t,this);let e=this.subs;void 0!==e&&nn(e),this.flags=0}function nk(t,e,i){if(t!==e)throw TypeError("Private static access of wrong provenance");if(void 0===i)throw TypeError("attempted to get private static field before its declaration");return r(t,i)}function nS(t){let{pageSize:e,initialPage:i,...n}=t||{},r=null!=e?e:10;return new URLSearchParams({...Object.entries(n).reduce((t,e)=>{let[i,n]=e;return void 0!==n&&(t[i]=n),t},{}),limit:r+"",offset:((null!=i?i:1)-1)*r+""})}class nA{static path(t,e){let{orgId:i}=e||{};return"".concat(i?"/organizations/".concat(i):"/me").concat(nk(nA,nA,nI)).concat(t)}constructor(){(0,tn._)(this,"getPlans",async t=>{let{for:e,...i}=t||{},n={...i,payer_type:"organization"===e?"org":"user"};return await i7._fetch({path:"".concat(nk(nA,nA,nI),"/plans"),method:"GET",search:nS(n)}).then(t=>{let{data:e,total_count:i}=t;return{total_count:i,data:e.map(t=>new nK(t))}})}),(0,tn._)(this,"getPlan",async t=>new nK(await i7._fetch({path:"".concat(nk(nA,nA,nI),"/plans/").concat(t.id),method:"GET"}))),(0,tn._)(this,"getSubscription",async t=>await i7._fetch({path:nA.path("/subscription",{orgId:t.orgId}),method:"GET"}).then(t=>new nG(null==t?void 0:t.response))),(0,tn._)(this,"getStatements",async t=>{let{orgId:e,...i}=t;return await i7._fetch({path:nA.path("/statements",{orgId:e}),method:"GET",search:nS(i)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new nq(t))}})}),(0,tn._)(this,"getStatement",async t=>{var e;return new nq(null==(e=await i7._fetch({path:nA.path("/statements/".concat(t.id),{orgId:t.orgId}),method:"GET"}))?void 0:e.response)}),(0,tn._)(this,"getPaymentAttempts",async t=>{let{orgId:e,...i}=t;return await i7._fetch({path:nA.path("/payment_attempts",{orgId:e}),method:"GET",search:nS(i)}).then(t=>{let{data:e,total_count:i}=t;return{total_count:i,data:e.map(t=>new nF(t))}})}),(0,tn._)(this,"getPaymentAttempt",async t=>new nF(await i7._fetch({path:nA.path("/payment_attempts/".concat(t.id),{orgId:t.orgId}),method:"GET"}))),(0,tn._)(this,"startCheckout",async t=>{var e;let{orgId:i,...n}=t;return new nz(null==(e=await i7._fetch({path:nA.path("/checkouts",{orgId:i}),method:"POST",body:n}))?void 0:e.response)})}}var nI={writable:!0,value:"/billing"};let nx=nf({resource:null}),nU=nf({error:null}),nE=nf({status:"idle"}),nP=np(()=>{let t=nx().resource,e=nU().error,i=nE().status;return{errors:nM(e,{identifier:null,password:null,code:null}),fetchStatus:i,signIn:t?t.__internal_future:null}}),nC=nf({resource:null}),nO=nf({error:null}),nT=nf({status:"idle"}),nR=np(()=>{let t=nC().resource,e=nO().error,i=nT().status;return{errors:nM(e,{firstName:null,lastName:null,emailAddress:null,phoneNumber:null,password:null,username:null,code:null,captcha:null,legalAccepted:null}),fetchStatus:i,signUp:t?t.__internal_future:null}});function nM(t,e){let i={fields:{...e},raw:null,global:null};if(!t)return i;if(!tU(t))return i.raw=[t],i.global=[tP(t)],i;function n(t){return"meta"in t&&t.meta&&"paramName"in t.meta&&void 0!==t.meta.paramName}return t.errors.some(n)?t.errors.forEach(t=>{if(i.raw?i.raw.push(t):i.raw=[t],n(t)){let e=t1(t.meta.paramName);e in i.fields&&(i.fields[e]=t)}}):(i.raw=[t],i.global=[tP(t)]),i}class nN extends i7{fromJSON(t){return t&&(this.id=t.id,t.created_at&&(this.createdAt=i8(t.created_at)),t.updated_at&&(this.updatedAt=i8(t.updated_at)),this.imageUrl=t.image_url,this.userId=t.user_id,this.email=t.email,this.firstName=t.first_name,this.lastName=t.last_name,this.organizationId=t.organization_id,this.organizationName=t.organization_name),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"imageUrl",void 0),(0,tn._)(this,"userId",null),(0,tn._)(this,"email",void 0),(0,tn._)(this,"firstName",void 0),(0,tn._)(this,"lastName",void 0),(0,tn._)(this,"organizationId",null),(0,tn._)(this,"organizationName",void 0),this.fromJSON(t)}}class nz extends i7{fromJSON(t){return t&&(this.id=t.id,this.externalClientSecret=t.external_client_secret,this.externalGatewayId=t.external_gateway_id,this.paymentMethod=t.payment_method?new nV(t.payment_method):void 0,this.plan=new nK(t.plan),this.planPeriod=t.plan_period,this.planPeriodStart=t.plan_period_start,this.status=t.status,this.totals=iS(t.totals),this.isImmediatePlanChange=t.is_immediate_plan_change,t.free_trial_ends_at&&(this.freeTrialEndsAt=i8(t.free_trial_ends_at)),this.payer=new nN(t.payer),this.needsPaymentMethod=t.needs_payment_method),this}constructor(t=null){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"externalClientSecret",void 0),(0,tn._)(this,"externalGatewayId",void 0),(0,tn._)(this,"paymentMethod",void 0),(0,tn._)(this,"plan",void 0),(0,tn._)(this,"planPeriod",void 0),(0,tn._)(this,"planPeriodStart",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"totals",void 0),(0,tn._)(this,"isImmediatePlanChange",void 0),(0,tn._)(this,"freeTrialEndsAt",void 0),(0,tn._)(this,"payer",void 0),(0,tn._)(this,"needsPaymentMethod",void 0),(0,tn._)(this,"confirm",t=>iv(()=>this._basePatch({path:nA.path("/checkouts/".concat(this.id,"/confirm"),{orgId:this.payer.organizationId}),body:t}),{factor:1.1,maxDelayBetweenRetries:2e3,initialDelay:2e3,jitter:!1,shouldRetry(t,e){var i,n;if(!tU(t)||e>=4)return!1;let r=null==t?void 0:t.status,s=409===r&&(null==(n=t.errors)||null==(i=n[0])?void 0:i.code)==="checkout_already_in_progress";return r>=500||s}})),this.fromJSON(t)}}class nW{get status(){var t;return null!=(t=this.resource.status)?t:"needs_initialization"}get externalClientSecret(){return this.resource.externalClientSecret}get externalGatewayId(){return this.resource.externalGatewayId}get plan(){return this.resource.plan}get planPeriod(){return this.resource.planPeriod}get totals(){return this.resource.totals}get isImmediatePlanChange(){return this.resource.isImmediatePlanChange}get freeTrialEndsAt(){return this.resource.freeTrialEndsAt}get payer(){return this.resource.payer}get paymentMethod(){var t;return null!=(t=this.resource.paymentMethod)?t:null}get planPeriodStart(){return this.resource.planPeriodStart}get needsPaymentMethod(){return this.resource.needsPaymentMethod}async start(){return this.runAsyncCheckoutTask("start",async()=>{var t;let e=await (null==(t=nz.clerk.billing)?void 0:t.startCheckout(this.config));this.resource=e},()=>{this.resource=new nz(null),this.signals.resourceSignal({resource:this})})}async confirm(t){if(!this.resource.id)throw Error("Clerk: `start()` must be called before `confirm()`");return this.runAsyncCheckoutTask("confirm",async()=>{await this.resource.confirm(t)})}async finalize(t){let{navigate:e}=t||{};return this.runAsyncCheckoutTask("finalize",async()=>{var t;if("completed"!==this.resource.status)throw Error("Clerk: `confirm()` must be called before `finalize()`");await nz.clerk.setActive({session:null==(t=nz.clerk.session)?void 0:t.id,navigate:e})})}runAsyncCheckoutTask(t,e,i){var n,r,s;return void 0===nz.clerk.user?(console.warn("Clerk: Checkout operations cannot be performed during transitive state"),{error:null}):(n=this,r=this.signals,s=this.pendingOperations,async(t,e,i)=>{if(s.get(t))return s.get(t);let a=(async()=>{++nc,r.errorSignal({error:null}),r.fetchSignal({status:"fetching"}),null==i||i(),--nc||nm(),++nc;try{return await e(),r.resourceSignal({resource:n}),{error:null}}catch(t){return r.errorSignal({error:t}),{error:t}}finally{s.delete(t),r.fetchSignal({status:"idle"}),--nc||nm()}})();return s.set(t,a),a})(t,e,i)}constructor(t,e){(0,tn._)(this,"resource",new nz(null)),(0,tn._)(this,"config",void 0),(0,tn._)(this,"signals",void 0),(0,tn._)(this,"pendingOperations",new Map),this.config=e,this.signals=t,this.signals.resourceSignal({resource:this})}}class nF extends i7{fromJSON(t){return t&&(this.id=t.id,this.amount=ik(t.amount),this.paidAt=t.paid_at?i8(t.paid_at):null,this.failedAt=t.failed_at?i8(t.failed_at):null,this.updatedAt=i8(t.updated_at),this.paymentMethod=t.payment_method?new nV(t.payment_method):null,this.subscriptionItem=new n$(t.subscription_item),this.chargeType=t.charge_type,this.status=t.status),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"amount",void 0),(0,tn._)(this,"failedAt",null),(0,tn._)(this,"paidAt",null),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"paymentMethod",null),(0,tn._)(this,"subscriptionItem",void 0),(0,tn._)(this,"chargeType",void 0),(0,tn._)(this,"status",void 0),this.fromJSON(t)}}let nD="/payment_methods",nL=async t=>{var e;let{orgId:i,...n}=t;return new nJ(null==(e=await i7._fetch({path:nA.path("".concat(nD,"/initialize"),{orgId:i}),method:"POST",body:n}))?void 0:e.response)},nj=async t=>{var e;let{orgId:i,...n}=t;return new nV(null==(e=await i7._fetch({path:nA.path(nD,{orgId:i}),method:"POST",body:n}))?void 0:e.response)},nB=async t=>{let{orgId:e,...i}=null!=t?t:{};return await i7._fetch({path:nA.path(nD,{orgId:e}),method:"GET",search:nS(i)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new nV(t))}})};class nV extends i7{fromJSON(t){return t&&(this.id=t.id,this.last4=t.last4,this.paymentType=t.payment_type,this.cardType=t.card_type,this.isDefault=t.is_default,this.isRemovable=t.is_removable,this.status=t.status,this.walletType=t.wallet_type,this.expiryYear=t.expiry_year,this.expiryMonth=t.expiry_month,this.createdAt=null==t.created_at?t.created_at:i8(t.created_at),this.updatedAt=null==t.updated_at?t.updated_at:i8(t.updated_at)),this}async remove(t){var e;let{orgId:i}=null!=t?t:{};return new n2(null==(e=await i7._fetch({path:nA.path("/payment_methods/".concat(this.id),{orgId:i}),method:"DELETE"}))?void 0:e.response)}async makeDefault(t){let{orgId:e}=null!=t?t:{};return await i7._fetch({path:nA.path("/payers/default_payment_method",{orgId:e}),method:"PUT",body:{payment_method_id:this.id}}),null}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"last4",null),(0,tn._)(this,"paymentType",void 0),(0,tn._)(this,"cardType",null),(0,tn._)(this,"isDefault",void 0),(0,tn._)(this,"isRemovable",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"walletType",void 0),(0,tn._)(this,"expiryYear",void 0),(0,tn._)(this,"expiryMonth",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),this.fromJSON(t)}}class nJ extends i7{fromJSON(t){var e;return t&&(this.externalClientSecret=t.external_client_secret,this.externalGatewayId=t.external_gateway_id,this.paymentMethodOrder=null!=(e=t.payment_method_order)?e:["card"]),this}constructor(t){super(),(0,tn._)(this,"externalClientSecret",void 0),(0,tn._)(this,"externalGatewayId",void 0),(0,tn._)(this,"paymentMethodOrder",void 0),this.fromJSON(t)}}class nK extends i7{fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.fee=ik(t.fee),this.annualFee=t.annual_fee?ik(t.annual_fee):null,this.annualMonthlyFee=t.annual_monthly_fee?ik(t.annual_monthly_fee):null,this.description=t.description,this.isDefault=t.is_default,this.isRecurring=t.is_recurring,this.hasBaseFee=t.has_base_fee,this.forPayerType=t.for_payer_type,this.publiclyVisible=t.publicly_visible,this.slug=t.slug,this.avatarUrl=t.avatar_url,this.freeTrialDays=this.withDefault(t.free_trial_days,null),this.freeTrialEnabled=this.withDefault(t.free_trial_enabled,!1),this.features=(t.features||[]).map(t=>new rI(t))),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"name",void 0),(0,tn._)(this,"fee",void 0),(0,tn._)(this,"annualFee",null),(0,tn._)(this,"annualMonthlyFee",null),(0,tn._)(this,"description",null),(0,tn._)(this,"isDefault",void 0),(0,tn._)(this,"isRecurring",void 0),(0,tn._)(this,"hasBaseFee",void 0),(0,tn._)(this,"forPayerType",void 0),(0,tn._)(this,"publiclyVisible",void 0),(0,tn._)(this,"slug",void 0),(0,tn._)(this,"avatarUrl",null),(0,tn._)(this,"features",void 0),(0,tn._)(this,"freeTrialDays",void 0),(0,tn._)(this,"freeTrialEnabled",void 0),this.fromJSON(t)}}class nq extends i7{fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.timestamp=i8(t.timestamp),this.totals=iS(t.totals),this.groups=t.groups.map(t=>new nH(t))),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"timestamp",void 0),(0,tn._)(this,"totals",void 0),(0,tn._)(this,"groups",void 0),this.fromJSON(t)}}class nH{fromJSON(t){return t&&(this.id=t.id,this.timestamp=i8(t.timestamp),this.items=t.items.map(t=>new nF(t))),this}constructor(t){(0,tn._)(this,"id",void 0),(0,tn._)(this,"timestamp",void 0),(0,tn._)(this,"items",void 0),this.fromJSON(t)}}class nG extends i7{fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.createdAt=i8(t.created_at),this.updatedAt=t.updated_at?i8(t.updated_at):null,this.activeAt=i8(t.active_at),this.pastDueAt=t.past_due_at?i8(t.past_due_at):null,t.next_payment&&(this.nextPayment={amount:ik(t.next_payment.amount),date:i8(t.next_payment.date)}),this.subscriptionItems=(t.subscription_items||[]).map(t=>new n$(t)),this.eligibleForFreeTrial=this.withDefault(t.eligible_for_free_trial,!1)),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"activeAt",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"pastDueAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"nextPayment",void 0),(0,tn._)(this,"subscriptionItems",void 0),(0,tn._)(this,"eligibleForFreeTrial",void 0),this.fromJSON(t)}}class n$ extends i7{fromJSON(t){return t&&(this.id=t.id,this.plan=new nK(t.plan),this.planPeriod=t.plan_period,this.status=t.status,this.createdAt=i8(t.created_at),this.pastDueAt=t.past_due_at?i8(t.past_due_at):null,this.periodStart=i8(t.period_start),this.periodEnd=t.period_end?i8(t.period_end):null,this.canceledAt=t.canceled_at?i8(t.canceled_at):null,this.amount=t.amount?ik(t.amount):void 0,this.credit=t.credit&&t.credit.amount?{amount:ik(t.credit.amount)}:void 0,this.isFreeTrial=this.withDefault(t.is_free_trial,!1)),this}async cancel(t){var e;let{orgId:i}=t;return new n2(null==(e=await i7._fetch({path:nA.path("/subscription_items/".concat(this.id),{orgId:i}),method:"DELETE"}))?void 0:e.response)}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"plan",void 0),(0,tn._)(this,"planPeriod",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"periodStart",void 0),(0,tn._)(this,"periodEnd",void 0),(0,tn._)(this,"canceledAt",void 0),(0,tn._)(this,"pastDueAt",void 0),(0,tn._)(this,"amount",void 0),(0,tn._)(this,"credit",void 0),(0,tn._)(this,"isFreeTrial",void 0),this.fromJSON(t)}}let nY={broadcast:!0},nX={broadcast:!1};class nQ{static fromKey(t){let[e,i,n=""]=t.split("::");return new nQ(e,{audience:n,tokenId:i})}toKey(){let{tokenId:t,audience:e}=this.data;return[this.prefix,t,e||""].join("::")}constructor(t,e){(0,tn._)(this,"prefix",void 0),(0,tn._)(this,"data",void 0),this.prefix=t,this.data=e,this.prefix=t,this.data=e}}let nZ=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"clerk",e=new Map,i=Math.random().toString(36).slice(2),n=null,r=()=>n||("undefined"==typeof BroadcastChannel?null:((n=new BroadcastChannel("clerk:session_token")).addEventListener("message",t=>{a(t)}),n));r();let s=function(i){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;r();let s=new nQ(t,i),a=e.get(s.toKey());if(!a)return;let o=Math.floor(Date.now()/1e3)-a.createdAt;if(a.expiresIn-o<(n||1)+5){void 0!==a.timeoutId&&clearTimeout(a.timeoutId),e.delete(s.toKey());return}return a.entry},a=async t=>{var e,n,r,a,l,c;let u,{data:h}=t,d=iO.build(h.sessionId,h.template,h.organizationId);if(h.tokenId!==d)return void id.warn("Ignoring token broadcast with mismatched tokenId",{expectedTokenId:d,organizationId:h.organizationId,receivedTokenId:h.tokenId,tabId:i,template:h.template,traceId:h.traceId},"tokenCache");try{u=new so({id:h.tokenId,jwt:h.tokenRaw,object:"token"})}catch(t){id.warn("Failed to parse token from broadcast, skipping cache update",{error:t,tabId:i,tokenId:h.tokenId,traceId:h.traceId},"tokenCache");return}let f=null==(n=u.jwt)||null==(e=n.claims)?void 0:e.iat,p=null==(a=u.jwt)||null==(r=a.claims)?void 0:r.exp;if(!f||!p)return void id.warn("Token missing iat/exp claim, skipping cache update",{tabId:i,tokenId:h.tokenId,traceId:h.traceId},"tokenCache");try{let t=s({tokenId:h.tokenId});if(t){let e=null==(c=(await t.tokenResolver).jwt)||null==(l=c.claims)?void 0:l.iat;if(e&&e>=f)return void id.debug("Ignoring older token broadcast",{existingIat:e,incomingIat:f,tabId:i,tokenId:h.tokenId,traceId:h.traceId},"tokenCache")}}catch(t){id.warn("Existing entry compare failed; proceeding with broadcast update",{error:t,tabId:i,tokenId:h.tokenId,traceId:h.traceId},"tokenCache")}id.info("Updating token cache from broadcast",{iat:f,organizationId:h.organizationId,tabId:i,template:h.template,tokenId:h.tokenId,traceId:h.traceId},"tokenCache"),o({createdAt:f,tokenId:h.tokenId,tokenResolver:Promise.resolve(u)},nX)},o=function(r){var s;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nY,o=new nQ(t,{audience:r.audience,tokenId:r.tokenId}).toKey(),l=Math.floor(Date.now()/1e3),c={createdAt:null!=(s=r.createdAt)?s:l,entry:r,expiresIn:void 0},u=()=>{let t=e.get(o);t===c&&(void 0!==t.timeoutId&&clearTimeout(t.timeoutId),e.delete(o))};r.tokenResolver.then(t=>{var e,s;let o=null==(e=t.jwt)?void 0:e.claims;if(!o||"number"!=typeof o.exp||"number"!=typeof o.iat)return u();let l=o.exp-o.iat;c.expiresIn=l;let h=setTimeout(u,1e3*l);c.timeoutId=h,"function"==typeof h.unref&&h.unref();let d=n;if(d&&a.broadcast){let e=t.getRawString();if(e&&o.sid){let t=o.sid,n=o.org_id||(null==(s=o.o)?void 0:s.id),a=iO.extractTemplate(r.tokenId,t,n),l=iO.build(t,a,n);if(r.tokenId===l){let s="bc_".concat(Date.now(),"_").concat(Math.random().toString(36).substring(2,11));id.info("Broadcasting token update to other tabs",{organizationId:n,sessionId:t,tabId:i,template:a,tokenId:r.tokenId,traceId:s},"tokenCache");let o={organizationId:n,sessionId:t,template:a,tokenId:r.tokenId,tokenRaw:e,traceId:s};d.postMessage(o)}}}}).catch(()=>{u()}),e.set(o,c)};return{clear:()=>{e.forEach(t=>{void 0!==t.timeoutId&&clearTimeout(t.timeoutId)}),e.clear()},close:()=>{n&&(n.close(),n=null)},get:s,set:t=>{r(),o(t,nY)},size:()=>e.size}}();class n0 extends i7{static getOrCreateInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return n0.instance||(n0.instance=new n0(t)),n0.instance}static clearInstance(){n0.instance=null}static isClientResource(t){return!!t&&t instanceof n0}get signUpAttempt(){return this.signUp}get signInAttempt(){return this.signIn}get signedInSessions(){return this.sessions.filter(t=>"active"===t.status||"pending"===t.status)}create(){return this._basePut()}fetch(){let{fetchMaxTries:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseGet({fetchMaxTries:t})}async destroy(){return this._baseDelete({path:"/client"}).then(()=>{nZ.clear(),this.id="",this.sessions=[],this.signUp=new si(null),this.signIn=new r7(null),this.lastActiveSessionId=null,this.lastAuthenticationStrategy=null,this.cookieExpiresAt=null,this.createdAt=null,this.updatedAt=null})}removeSessions(){return this._baseDelete({path:this.path()+"/sessions"}).then(t=>(nZ.clear(),t))}clearCache(){return this.sessions.forEach(t=>t.clearCache())}isEligibleForTouch(){return!!this.cookieExpiresAt&&this.cookieExpiresAt.getTime()-Date.now()<=6912e5}buildTouchUrl(t){let{redirectUrl:e}=t;return i7.fapiClient.buildUrl({method:"GET",path:"/client/touch",pathPrefix:"v1",search:{redirect_url:e.toString()}}).toString()}__internal_sendCaptchaToken(t){return this._basePostBypass({body:t,path:this.path()+"/verify"})}fromJSON(t){return t&&(this.id=t.id,this.sessions=(t.sessions||[]).map(t=>new rX(t)),this.signUp=new si(t.sign_up),this.signIn=new r7(t.sign_in),this.lastActiveSessionId=t.last_active_session_id,this.captchaBypass=t.captcha_bypass||!1,this.cookieExpiresAt=t.cookie_expires_at?i8(t.cookie_expires_at):null,this.lastAuthenticationStrategy=t.last_authentication_strategy||null,this.createdAt=i8(t.created_at||void 0),this.updatedAt=i8(t.updated_at||void 0)),this}__internal_toSnapshot(){var t,e,i,n,r;return{object:"client",id:this.id||"",sessions:this.sessions.map(t=>t.__internal_toSnapshot()),sign_up:this.signUp.__internal_toSnapshot(),sign_in:this.signIn.__internal_toSnapshot(),last_active_session_id:this.lastActiveSessionId,captcha_bypass:this.captchaBypass,cookie_expires_at:this.cookieExpiresAt?this.cookieExpiresAt.getTime():null,last_authentication_strategy:null!=(i=this.lastAuthenticationStrategy)?i:null,created_at:null!=(n=null==(t=this.createdAt)?void 0:t.getTime())?n:null,updated_at:null!=(r=null==(e=this.updatedAt)?void 0:e.getTime())?r:null}}path(){return this.pathRoot}constructor(t=null){super(),(0,tn._)(this,"pathRoot","/client"),(0,tn._)(this,"sessions",[]),(0,tn._)(this,"signUp",new si),(0,tn._)(this,"signIn",new r7),(0,tn._)(this,"lastActiveSessionId",null),(0,tn._)(this,"captchaBypass",!1),(0,tn._)(this,"cookieExpiresAt",null),(0,tn._)(this,"lastAuthenticationStrategy",null),(0,tn._)(this,"createdAt",null),(0,tn._)(this,"updatedAt",null),this.fromJSON(t)}}(0,tn._)(n0,"instance",void 0);class n1 extends i7{fromJSON(t){return t&&(this.billing.stripePublishableKey=t.billing.stripe_publishable_key,this.billing.organization.enabled=t.billing.organization.enabled,this.billing.organization.hasPaidPlans=t.billing.organization.has_paid_plans,this.billing.user.enabled=t.billing.user.enabled,this.billing.user.hasPaidPlans=t.billing.user.has_paid_plans),this}__internal_toSnapshot(){return{billing:{stripe_publishable_key:this.billing.stripePublishableKey,organization:{enabled:this.billing.organization.enabled,has_paid_plans:this.billing.organization.hasPaidPlans},user:{enabled:this.billing.user.enabled,has_paid_plans:this.billing.user.hasPaidPlans}}}}constructor(t=null){super(),(0,tn._)(this,"billing",{stripePublishableKey:null,organization:{enabled:!1,hasPaidPlans:!1},user:{enabled:!1,hasPaidPlans:!1}}),this.fromJSON(t)}}class n2{fromJSON(t){return t&&(this.object=t.object,this.id=t.id,this.slug=t.slug,this.deleted=t.deleted),this}constructor(t){(0,tn._)(this,"object",""),(0,tn._)(this,"id",void 0),(0,tn._)(this,"slug",void 0),(0,tn._)(this,"deleted",!1),this.fromJSON(t)}}class n3 extends i7{fromJSON(t){return t&&(this.afterCreateOrganizationUrl=this.withDefault(t.after_create_organization_url,this.afterCreateOrganizationUrl),this.afterJoinWaitlistUrl=this.withDefault(t.after_join_waitlist_url,this.afterJoinWaitlistUrl),this.afterLeaveOrganizationUrl=this.withDefault(t.after_leave_organization_url,this.afterLeaveOrganizationUrl),this.afterSignInUrl=this.withDefault(t.after_sign_in_url,this.afterSignInUrl),this.afterSignOutAllUrl=this.withDefault(t.after_sign_out_all_url,this.afterSignOutAllUrl),this.afterSignOutOneUrl=this.withDefault(t.after_sign_out_one_url,this.afterSignOutOneUrl),this.afterSignUpUrl=this.withDefault(t.after_sign_up_url,this.afterSignUpUrl),this.afterSwitchSessionUrl=this.withDefault(t.after_switch_session_url,this.afterSwitchSessionUrl),this.applicationName=this.withDefault(t.application_name,this.applicationName),this.branded=this.withDefault(t.branded,this.branded),this.captchaHeartbeat=this.withDefault(t.captcha_heartbeat,this.captchaHeartbeat),this.captchaHeartbeatIntervalMs=this.withDefault(t.captcha_heartbeat_interval_ms,this.captchaHeartbeatIntervalMs),this.captchaOauthBypass=this.withDefault(t.captcha_oauth_bypass,this.captchaOauthBypass),this.captchaProvider=this.withDefault(t.captcha_provider,this.captchaProvider),this.captchaPublicKey=this.withDefault(t.captcha_public_key,this.captchaPublicKey),this.captchaPublicKeyInvisible=this.withDefault(t.captcha_public_key_invisible,this.captchaPublicKeyInvisible),this.captchaWidgetType=this.withDefault(t.captcha_widget_type,this.captchaWidgetType),this.clerkJSVersion=this.withDefault(t.clerk_js_version,this.clerkJSVersion),this.createOrganizationUrl=this.withDefault(t.create_organization_url,this.createOrganizationUrl),this.faviconImageUrl=this.withDefault(t.favicon_image_url,this.faviconImageUrl),this.googleOneTapClientId=this.withDefault(t.google_one_tap_client_id,this.googleOneTapClientId),this.homeUrl=this.withDefault(t.home_url,this.homeUrl),this.id=this.withDefault(t.id,this.id),this.instanceEnvironmentType=this.withDefault(t.instance_environment_type,this.instanceEnvironmentType),this.logoImageUrl=this.withDefault(t.logo_image_url,this.logoImageUrl),this.organizationProfileUrl=this.withDefault(t.organization_profile_url,this.organizationProfileUrl),this.preferredSignInStrategy=this.withDefault(t.preferred_sign_in_strategy,this.preferredSignInStrategy),this.privacyPolicyUrl=this.withDefault(t.privacy_policy_url,this.privacyPolicyUrl),this.showDevModeWarning=this.withDefault(t.show_devmode_warning,this.showDevModeWarning),this.signInUrl=this.withDefault(t.sign_in_url,this.signInUrl),this.signUpUrl=this.withDefault(t.sign_up_url,this.signUpUrl),this.supportEmail=this.withDefault(t.support_email,this.supportEmail),this.termsUrl=this.withDefault(t.terms_url,this.termsUrl),this.theme=this.withDefault(t.theme,this.theme),this.userProfileUrl=this.withDefault(t.user_profile_url,this.userProfileUrl),this.waitlistUrl=this.withDefault(t.waitlist_url,this.waitlistUrl)),this}__internal_toSnapshot(){return{object:"display_config",after_create_organization_url:this.afterCreateOrganizationUrl,after_join_waitlist_url:this.afterJoinWaitlistUrl,after_leave_organization_url:this.afterLeaveOrganizationUrl,after_sign_in_url:this.afterSignInUrl,after_sign_out_all_url:this.afterSignOutAllUrl,after_sign_out_one_url:this.afterSignOutOneUrl,after_sign_up_url:this.afterSignUpUrl,after_switch_session_url:this.afterSwitchSessionUrl,application_name:this.applicationName,branded:this.branded,captcha_heartbeat_interval_ms:this.captchaHeartbeatIntervalMs,captcha_heartbeat:this.captchaHeartbeat,captcha_oauth_bypass:this.captchaOauthBypass,captcha_provider:this.captchaProvider,captcha_public_key_invisible:this.captchaPublicKeyInvisible,captcha_public_key:this.captchaPublicKey,captcha_widget_type:this.captchaWidgetType,clerk_js_version:this.clerkJSVersion,create_organization_url:this.createOrganizationUrl,favicon_image_url:this.faviconImageUrl,google_one_tap_client_id:this.googleOneTapClientId,home_url:this.homeUrl,id:this.id,instance_environment_type:this.instanceEnvironmentType,logo_image_url:this.logoImageUrl,organization_profile_url:this.organizationProfileUrl,preferred_sign_in_strategy:this.preferredSignInStrategy,privacy_policy_url:this.privacyPolicyUrl,show_devmode_warning:this.showDevModeWarning,sign_in_url:this.signInUrl,sign_up_url:this.signUpUrl,support_email:this.supportEmail,terms_url:this.termsUrl,theme:this.theme,user_profile_url:this.userProfileUrl,waitlist_url:this.waitlistUrl}}constructor(t=null){super(),(0,tn._)(this,"afterCreateOrganizationUrl",""),(0,tn._)(this,"afterJoinWaitlistUrl",""),(0,tn._)(this,"afterLeaveOrganizationUrl",""),(0,tn._)(this,"afterSignInUrl",""),(0,tn._)(this,"afterSignOutAllUrl",""),(0,tn._)(this,"afterSignOutOneUrl",""),(0,tn._)(this,"afterSignOutUrl",""),(0,tn._)(this,"afterSignUpUrl",""),(0,tn._)(this,"afterSwitchSessionUrl",""),(0,tn._)(this,"applicationName",""),(0,tn._)(this,"backendHost",""),(0,tn._)(this,"branded",!1),(0,tn._)(this,"captchaHeartbeat",!1),(0,tn._)(this,"captchaHeartbeatIntervalMs",void 0),(0,tn._)(this,"captchaOauthBypass",["oauth_google","oauth_microsoft","oauth_apple"]),(0,tn._)(this,"captchaProvider","turnstile"),(0,tn._)(this,"captchaPublicKey",null),(0,tn._)(this,"captchaPublicKeyInvisible",null),(0,tn._)(this,"captchaWidgetType",null),(0,tn._)(this,"clerkJSVersion",void 0),(0,tn._)(this,"createOrganizationUrl",""),(0,tn._)(this,"faviconImageUrl",""),(0,tn._)(this,"googleOneTapClientId",void 0),(0,tn._)(this,"homeUrl",""),(0,tn._)(this,"id",""),(0,tn._)(this,"instanceEnvironmentType",""),(0,tn._)(this,"logoImageUrl",""),(0,tn._)(this,"organizationProfileUrl",""),(0,tn._)(this,"preferredSignInStrategy","password"),(0,tn._)(this,"privacyPolicyUrl",""),(0,tn._)(this,"showDevModeWarning",!1),(0,tn._)(this,"signInUrl",""),(0,tn._)(this,"signUpUrl",""),(0,tn._)(this,"supportEmail",""),(0,tn._)(this,"termsUrl",""),(0,tn._)(this,"theme",{}),(0,tn._)(this,"userProfileUrl",""),(0,tn._)(this,"waitlistUrl",""),this.fromJSON(t)}}var n5=s(8693),n4='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}),delete workerToTabIds[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';let n6=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"==typeof Worker)return null;try{let i=new Blob([t],{type:"application/javascript; charset=utf-8"}),n=globalThis.URL.createObjectURL(i);return new Worker(n,e)}catch{return console.warn("Clerk: Cannot create worker from blob. Consider adding worker-src blob:; to your CSP"),null}},n7=()=>{let t=0,e=()=>t++,i=new Map,n=(t,e)=>null==t?void 0:t.postMessage(e),r=t=>{var e;null==(e=i.get(t.data.id))||e()},s=n6(n4,{name:"clerk-timers"});if(null==s||s.addEventListener("message",r),!s)return{setTimeout:globalThis.setTimeout.bind(globalThis),setInterval:globalThis.setInterval.bind(globalThis),clearTimeout:globalThis.clearTimeout.bind(globalThis),clearInterval:globalThis.clearInterval.bind(globalThis),cleanup:n5.t};let a=()=>{s||null==(s=n6(n4,{name:"clerk-timers"}))||s.addEventListener("message",r)};return{setTimeout:(t,r)=>{a();let o=e();return i.set(o,()=>{t(),i.delete(o)}),n(s,{type:"setTimeout",id:o,ms:r}),o},setInterval:(t,r)=>{a();let o=e();return i.set(o,t),n(s,{type:"setInterval",id:o,ms:r}),o},clearTimeout:t=>{a(),i.delete(t),n(s,{type:"clearTimeout",id:t})},clearInterval:t=>{a(),i.delete(t),n(s,{type:"clearInterval",id:t})},cleanup:()=>{s&&(s.terminate(),s=null,i.clear())}}};function n8(){let t,{delayInMs:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{delayInMs:1e3},i=n7(),n=!1,r=()=>{t&&(i.clearTimeout(t),i.cleanup()),n=!0},s=async a=>{n=!1,await a(r),n||(t=i.setTimeout(()=>{s(a)},e))};return{run:s,stop:r}}class n9 extends i7{create(){return this._basePost({body:{email_address:this.emailAddress}})}fromJSON(t){return t&&(this.id=t.id,this.emailAddress=t.email_address,this.verification=new ru(t.verification),this.matchesSsoConnection=t.matches_sso_connection,this.linkedTo=(t.linked_to||[]).map(t=>new rx(t))),this}__internal_toSnapshot(){return{object:"email_address",id:this.id,email_address:this.emailAddress,verification:this.verification.__internal_toSnapshot(),linked_to:this.linkedTo.map(t=>t.__internal_toSnapshot()),matches_sso_connection:this.matchesSsoConnection}}constructor(t,e){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"emailAddress",""),(0,tn._)(this,"matchesSsoConnection",!1),(0,tn._)(this,"linkedTo",[]),(0,tn._)(this,"verification",void 0),(0,tn._)(this,"prepareVerification",t=>this._basePost({action:"prepare_verification",body:{...t}})),(0,tn._)(this,"attemptVerification",t=>{let{code:e}=t||{};return this._basePost({action:"attempt_verification",body:{code:e}})}),(0,tn._)(this,"createEmailLinkFlow",()=>{let{run:t,stop:e}=n8();return{startEmailLinkFlow:async i=>{let{redirectUrl:n}=i;return await this.prepareVerification({strategy:"email_link",redirectUrl:n}),new Promise((i,n)=>{t(()=>this.reload().then(t=>{"verified"===t.verification.status&&(e(),i(t))}).catch(t=>{e(),n(t)}))})},cancelEmailLinkFlow:e}}),(0,tn._)(this,"createEnterpriseSSOLinkFlow",()=>{let{run:t,stop:e}=n8();return{startEnterpriseSSOLinkFlow:async i=>{let{redirectUrl:n}=i;if(!(await this.prepareVerification({strategy:"enterprise_sso",redirectUrl:n})).verification.externalVerificationRedirectURL)throw Error("Unexpected: External verification redirect URL is missing");return new Promise((i,n)=>{t(()=>this.reload().then(t=>{"verified"===t.verification.status&&(e(),i(t))}).catch(t=>{e(),n(t)}))})},cancelEnterpriseSSOLinkFlow:e}}),(0,tn._)(this,"destroy",()=>this._baseDelete()),(0,tn._)(this,"toString",()=>this.emailAddress),this.pathRoot=e,this.fromJSON(t)}}var rt=class{static encode(t){return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}static decode(t){let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")),i=e.length,n=new Uint8Array(i);for(let t=0;t<i;t++)n[t]=e.charCodeAt(t);return n.buffer}};async function re(t){try{let e=await navigator.credentials.create({publicKey:t});if(!e)return{error:new tA("Browser failed to create credential",{code:"passkey_registration_failed"}),publicKeyCredential:null};return{publicKeyCredential:e,error:null}}catch(t){var e;return{error:"InvalidStateError"===(e=t).name?new tA(e.message,{code:"passkey_already_exists"}):"NotAllowedError"===e.name?new tA(e.message,{code:"passkey_registration_cancelled"}):rr(e),publicKeyCredential:null}}}let ri=new class{__abort(){if(!this.controller)return;let t=Error();t.name="AbortError",this.controller.abort(t)}createAbortSignal(){this.__abort();let t=new AbortController;return this.controller=t,t.signal}abort(){this.__abort(),this.controller=void 0}constructor(){!function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"controller",void 0)}};async function rn(t){let{publicKeyOptions:e,conditionalUI:i}=t;try{let t=await navigator.credentials.get({publicKey:e,mediation:i?"conditional":"optional",signal:ri.createAbortSignal()});if(!t)return{error:new tA("Browser failed to get credential",{code:"passkey_retrieval_failed"}),publicKeyCredential:null};return{publicKeyCredential:t,error:null}}catch(t){var n;return{error:"NotAllowedError"===(n=t).name?new tA(n.message,{code:"passkey_retrieval_cancelled"}):rr(n),publicKeyCredential:null}}}function rr(t){return"AbortError"===t.name?new tA(t.message,{code:"passkey_operation_aborted"}):"SecurityError"===t.name?new tA(t.message,{code:"passkey_invalid_rpID_or_domain"}):t}function rs(t){let e=rc(t.challenge),i=(t.allowCredentials||[]).map(t=>({...t,id:rc(t.id)}));return{...t,allowCredentials:i,challenge:e}}function ra(t){return{type:t.type,id:t.id,rawId:rl(t.rawId),authenticatorAttachment:t.authenticatorAttachment}}function ro(t){let e=t.response;return{...ra(t),response:{clientDataJSON:rl(e.clientDataJSON),authenticatorData:rl(e.authenticatorData),signature:rl(e.signature),userHandle:e.userHandle?rl(e.userHandle):null}}}let rl=rt.encode.bind(rt),rc=rt.decode.bind(rt);class ru extends i7{fromJSON(t){return t&&(this.status=t.status,this.verifiedAtClient=t.verified_at_client,this.strategy=t.strategy,this.nonce=t.nonce||null,this.message=t.message||null,t.external_verification_redirect_url?this.externalVerificationRedirectURL=new URL(t.external_verification_redirect_url):this.externalVerificationRedirectURL=null,this.attempts=t.attempts,this.expireAt=i8(t.expire_at||void 0),this.error=t.error?new tg(t.error):null,this.channel=t.channel||void 0),this}__internal_toSnapshot(){var t,e,i,n,r,s,a,o,l,c;return{object:"verification",id:this.id||"",status:this.status,strategy:this.strategy,nonce:this.nonce,message:this.message,external_verification_redirect_url:(null==(t=this.externalVerificationRedirectURL)?void 0:t.toString())||null,attempts:this.attempts,expire_at:(null==(e=this.expireAt)?void 0:e.getTime())||null,error:{code:(null==(i=this.error)?void 0:i.code)||"",message:(null==i?void 0:i.message)||"",long_message:null==i?void 0:i.longMessage,meta:{param_name:null==i||null==(n=i.meta)?void 0:n.paramName,session_id:null==i||null==(r=i.meta)?void 0:r.sessionId,email_addresses:null==i||null==(s=i.meta)?void 0:s.emailAddresses,identifiers:null==i||null==(a=i.meta)?void 0:a.identifiers,zxcvbn:null==i||null==(o=i.meta)?void 0:o.zxcvbn,plan:null==i||null==(l=i.meta)?void 0:l.plan,is_plan_upgrade_possible:null==i||null==(c=i.meta)?void 0:c.isPlanUpgradePossible}},verified_at_client:this.verifiedAtClient}}constructor(t){super(),(0,tn._)(this,"pathRoot",""),(0,tn._)(this,"status",null),(0,tn._)(this,"strategy",null),(0,tn._)(this,"nonce",null),(0,tn._)(this,"message",null),(0,tn._)(this,"externalVerificationRedirectURL",null),(0,tn._)(this,"attempts",null),(0,tn._)(this,"expireAt",null),(0,tn._)(this,"error",null),(0,tn._)(this,"verifiedAtClient",null),(0,tn._)(this,"channel",void 0),(0,tn._)(this,"verifiedFromTheSameClient",()=>{var t,e;return this.verifiedAtClient===(null==(e=i7.clerk)||null==(t=e.client)?void 0:t.id)}),this.fromJSON(t)}}class rh extends ru{fromJSON(t){var e;let i,n,r;return super.fromJSON(t),(null==t?void 0:t.nonce)&&(this.publicKey=(i=rc((e=JSON.parse(t.nonce)).user.id),n=rc(e.challenge),r=(e.excludeCredentials||[]).map(t=>({...t,id:rc(t.id)})),{...e,excludeCredentials:r,challenge:n,user:{...e.user,id:i}})),this}constructor(t){super(t),(0,tn._)(this,"publicKey",null),this.fromJSON(t)}}class rd{__internal_toSnapshot(){return{email_address:this.emailAddress.__internal_toSnapshot(),phone_number:this.phoneNumber.__internal_toSnapshot(),web3_wallet:this.web3Wallet.__internal_toSnapshot(),external_account:this.externalAccount.__internal_toSnapshot()}}constructor(t){(0,tn._)(this,"emailAddress",void 0),(0,tn._)(this,"phoneNumber",void 0),(0,tn._)(this,"web3Wallet",void 0),(0,tn._)(this,"externalAccount",void 0),t?(this.emailAddress=new rf(t.email_address),this.phoneNumber=new rf(t.phone_number),this.web3Wallet=new rf(t.web3_wallet),this.externalAccount=new ru(t.external_account)):(this.emailAddress=new rf(null),this.phoneNumber=new rf(null),this.web3Wallet=new rf(null),this.externalAccount=new ru(null))}}class rf extends ru{__internal_toSnapshot(){return{...super.__internal_toSnapshot(),next_action:this.nextAction,supported_strategies:this.supportedStrategies}}constructor(t){super(t),(0,tn._)(this,"nextAction",void 0),(0,tn._)(this,"supportedStrategies",void 0),t?(this.nextAction=t.next_action,this.supportedStrategies=t.supported_strategies):(this.nextAction="",this.supportedStrategies=[])}}class rp extends i7{fromJSON(t){return t&&(this.id=t.id,this.provider=t.provider,this.protocol=t.protocol,this.providerUserId=t.provider_user_id,this.active=t.active,this.emailAddress=t.email_address,this.firstName=t.first_name,this.lastName=t.last_name,this.publicMetadata=t.public_metadata,this.lastAuthenticatedAt=t.last_authenticated_at?i8(t.last_authenticated_at):null,this.enterpriseConnectionId=t.enterprise_connection_id,t.verification&&(this.verification=new ru(t.verification)),t.enterprise_connection&&(this.enterpriseConnection=new r_(t.enterprise_connection))),this}__internal_toSnapshot(){var t,e;return{object:"enterprise_account",id:this.id,provider:this.provider,protocol:this.protocol,provider_user_id:this.providerUserId,active:this.active,email_address:this.emailAddress,first_name:this.firstName,last_name:this.lastName,public_metadata:this.publicMetadata,verification:(null==(t=this.verification)?void 0:t.__internal_toSnapshot())||null,enterprise_connection:(null==(e=this.enterpriseConnection)?void 0:e.__internal_toSnapshot())||null,last_authenticated_at:this.lastAuthenticatedAt?this.lastAuthenticatedAt.getTime():null,enterprise_connection_id:this.enterpriseConnectionId}}constructor(t,e){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"protocol",void 0),(0,tn._)(this,"provider",void 0),(0,tn._)(this,"providerUserId",null),(0,tn._)(this,"active",void 0),(0,tn._)(this,"emailAddress",""),(0,tn._)(this,"firstName",""),(0,tn._)(this,"lastName",""),(0,tn._)(this,"publicMetadata",{}),(0,tn._)(this,"verification",null),(0,tn._)(this,"enterpriseConnection",null),(0,tn._)(this,"lastAuthenticatedAt",null),(0,tn._)(this,"enterpriseConnectionId",null),this.pathRoot=e,this.fromJSON(t)}}class r_ extends i7{fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.domain=t.domain,this.active=t.active,this.provider=t.provider,this.logoPublicUrl=t.logo_public_url,this.syncUserAttributes=t.sync_user_attributes,this.allowSubdomains=t.allow_subdomains,this.allowIdpInitiated=t.allow_idp_initiated,this.disableAdditionalIdentifications=t.disable_additional_identifications,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at),this.enterpriseConnectionId=t.enterprise_connection_id),this}__internal_toSnapshot(){return{object:"enterprise_account_connection",id:this.id,name:this.name,domain:this.domain,active:this.active,protocol:this.protocol,provider:this.provider,logo_public_url:this.logoPublicUrl,sync_user_attributes:this.syncUserAttributes,allow_subdomains:this.allowSubdomains,allow_idp_initiated:this.allowIdpInitiated,disable_additional_identifications:this.disableAdditionalIdentifications,enterprise_connection_id:this.enterpriseConnectionId,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"active",void 0),(0,tn._)(this,"allowIdpInitiated",void 0),(0,tn._)(this,"allowSubdomains",void 0),(0,tn._)(this,"disableAdditionalIdentifications",void 0),(0,tn._)(this,"domain",void 0),(0,tn._)(this,"logoPublicUrl",""),(0,tn._)(this,"name",void 0),(0,tn._)(this,"protocol",void 0),(0,tn._)(this,"provider",void 0),(0,tn._)(this,"syncUserAttributes",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"enterpriseConnectionId",""),this.fromJSON(t)}}let rg="token:update",rv="user:signOut",rm="environment:update",ry="session:tokenResolved",rw=td();class rb extends i7{fromJSON(t){return t&&(this.user_api_keys_enabled=t.user_api_keys_enabled,this.orgs_api_keys_enabled=t.orgs_api_keys_enabled),this}__internal_toSnapshot(){return{user_api_keys_enabled:this.user_api_keys_enabled,orgs_api_keys_enabled:this.orgs_api_keys_enabled}}constructor(t=null){super(),(0,tn._)(this,"user_api_keys_enabled",!1),(0,tn._)(this,"orgs_api_keys_enabled",!1),this.fromJSON(t)}}class rk extends i7{fromJSON(t){return t&&(t.actions&&(this.actions.adminDelete=this.withDefault(t.actions.admin_delete,this.actions.adminDelete)),t.domains&&(this.domains.enabled=this.withDefault(t.domains.enabled,this.domains.enabled),this.domains.enrollmentModes=this.withDefault(t.domains.enrollment_modes,this.domains.enrollmentModes),this.domains.defaultRole=this.withDefault(t.domains.default_role,this.domains.defaultRole)),t.slug&&(this.slug.disabled=this.withDefault(t.slug.disabled,this.slug.disabled)),this.enabled=this.withDefault(t.enabled,this.enabled),this.maxAllowedMemberships=this.withDefault(t.max_allowed_memberships,this.maxAllowedMemberships),this.forceOrganizationSelection=this.withDefault(t.force_organization_selection,this.forceOrganizationSelection)),this}__internal_toSnapshot(){return{actions:{admin_delete:this.actions.adminDelete},domains:{enabled:this.domains.enabled,enrollment_modes:this.domains.enrollmentModes,default_role:this.domains.defaultRole},enabled:this.enabled,max_allowed_memberships:this.maxAllowedMemberships}}constructor(t=null){super(),(0,tn._)(this,"actions",{adminDelete:!1}),(0,tn._)(this,"domains",{enabled:!1,enrollmentModes:[],defaultRole:null}),(0,tn._)(this,"slug",{disabled:!1}),(0,tn._)(this,"enabled",!1),(0,tn._)(this,"maxAllowedMemberships",1),(0,tn._)(this,"forceOrganizationSelection",void 0),this.fromJSON(t)}}class rS extends i7{static getInstance(){return rS.instance||(rS.instance=new rS),rS.instance}fromJSON(t){return t&&(this.authConfig=new nt(t.auth_config),this.displayConfig=new n3(t.display_config),this.maintenanceMode=this.withDefault(t.maintenance_mode,this.maintenanceMode),this.clientDebugMode=this.withDefault(t.client_debug_mode,this.clientDebugMode),this.organizationSettings=new rk(t.organization_settings),this.userSettings=new sp(t.user_settings),this.commerceSettings=new n1(t.commerce_settings),this.apiKeysSettings=new rb(t.api_keys_settings),this.protectConfig=new rj(t.protect_config)),this}fetch(){let{touch:t,fetchMaxTries:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{touch:!1};return(t?this._basePatch({}):this._baseGet({fetchMaxTries:e})).then(t=>(rw.emit(rm,null),t))}__internal_toSnapshot(){var t;return{object:"environment",auth_config:this.authConfig.__internal_toSnapshot(),display_config:this.displayConfig.__internal_toSnapshot(),id:null!=(t=this.id)?t:"",maintenance_mode:this.maintenanceMode,client_debug_mode:this.clientDebugMode,organization_settings:this.organizationSettings.__internal_toSnapshot(),user_settings:this.userSettings.__internal_toSnapshot(),commerce_settings:this.commerceSettings.__internal_toSnapshot(),api_keys_settings:this.apiKeysSettings.__internal_toSnapshot(),protect_config:this.protectConfig.__internal_toSnapshot()}}async __internal_enableEnvironmentSetting(t){await this._basePatch({path:"/dev_tools/enable_environment_setting",body:t})}constructor(t=null){super(),(0,tn._)(this,"authConfig",new nt),(0,tn._)(this,"displayConfig",new n3),(0,tn._)(this,"maintenanceMode",!1),(0,tn._)(this,"clientDebugMode",!1),(0,tn._)(this,"pathRoot","/environment"),(0,tn._)(this,"userSettings",new sp),(0,tn._)(this,"organizationSettings",new rk),(0,tn._)(this,"commerceSettings",new n1),(0,tn._)(this,"apiKeysSettings",new rb),(0,tn._)(this,"protectConfig",new rj),(0,tn._)(this,"isDevelopmentOrStaging",()=>!this.isProduction()),(0,tn._)(this,"isProduction",()=>"production"===this.displayConfig.instanceEnvironmentType),(0,tn._)(this,"isSingleSession",()=>this.authConfig.singleSessionMode),(0,tn._)(this,"onWindowLocationHost",()=>this.displayConfig.backendHost===window.location.host),this.fromJSON(t)}}(0,tn._)(rS,"instance",void 0);class rA extends i7{fromJSON(t){return t&&(this.id=t.id,this.identificationId=t.identification_id,this.providerUserId=t.provider_user_id,this.approvedScopes=t.approved_scopes,this.imageUrl=t.image_url,this.emailAddress=t.email_address,this.firstName=t.first_name,this.lastName=t.last_name,this.provider=(t.provider||"").replace("oauth_",""),this.username=t.username,this.phoneNumber=t.phone_number,this.publicMetadata=t.public_metadata,this.label=t.label,t.verification&&(this.verification=new ru(t.verification))),this}__internal_toSnapshot(){var t;return{object:"external_account",id:this.id,identification_id:this.identificationId,provider:this.provider,provider_user_id:this.providerUserId,email_address:this.emailAddress,approved_scopes:this.approvedScopes,first_name:this.firstName,last_name:this.lastName,image_url:this.imageUrl,username:this.username,phone_number:this.phoneNumber,public_metadata:this.publicMetadata,label:this.label,verification:(null==(t=this.verification)?void 0:t.__internal_toSnapshot())||null}}providerSlug(){return this.provider}providerTitle(){let t;return[(t=this.providerSlug()||"").charAt(0).toUpperCase()+t.slice(1),"Account"].join(" ")}accountIdentifier(){return this.username||this.emailAddress||this.label}constructor(t,e){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"identificationId",void 0),(0,tn._)(this,"provider",void 0),(0,tn._)(this,"providerUserId",""),(0,tn._)(this,"emailAddress",""),(0,tn._)(this,"approvedScopes",""),(0,tn._)(this,"firstName",""),(0,tn._)(this,"lastName",""),(0,tn._)(this,"imageUrl",""),(0,tn._)(this,"username",""),(0,tn._)(this,"phoneNumber",""),(0,tn._)(this,"publicMetadata",{}),(0,tn._)(this,"label",""),(0,tn._)(this,"verification",null),(0,tn._)(this,"reauthorize",t=>{let{additionalScopes:e,redirectUrl:i}=t||{};return this._basePatch({action:"reauthorize",body:{additional_scope:e,redirect_url:i}})}),(0,tn._)(this,"destroy",()=>this._baseDelete()),this.pathRoot=e,this.fromJSON(t)}}class rI extends i7{fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.description=t.description,this.slug=t.slug,this.avatarUrl=t.avatar_url),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"name",void 0),(0,tn._)(this,"description",null),(0,tn._)(this,"slug",void 0),(0,tn._)(this,"avatarUrl",null),this.fromJSON(t)}}class rx extends i7{fromJSON(t){return t&&(this.id=t.id,this.type=t.type),this}__internal_toSnapshot(){return{object:"identification_link",id:this.id,type:this.type}}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"type",void 0),this.fromJSON(t)}}class rU extends i7{static async create(t){var e;let i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n;return"string"==typeof n.file?(r=n.file,i=new Headers({"Content-Type":"application/octet-stream"})):n.file&&(r=new FormData).append("file",n.file),new rU(null==(e=await i7._fetch({path:t,method:"POST",body:r,headers:i}))?void 0:e.response)}static async delete(t){var e;return new rU(null==(e=await i7._fetch({path:t,method:"DELETE"}))?void 0:e.response)}fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.publicUrl=t.public_url),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"name",null),(0,tn._)(this,"publicUrl",null),this.fromJSON(t)}}class rE extends i7{static async create(t,e){var i;let{name:n}=e;return new rE(null==(i=await i7._fetch({path:"/organizations/".concat(t,"/domains"),method:"POST",body:{name:n}}))?void 0:i.response)}fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.organizationId=t.organization_id,this.enrollmentMode=t.enrollment_mode,this.affiliationEmailAddress=t.affiliation_email_address,this.totalPendingSuggestions=t.total_pending_suggestions,this.totalPendingInvitations=t.total_pending_invitations,t.verification?this.verification={status:t.verification.status,strategy:t.verification.strategy,attempts:t.verification.attempts,expiresAt:i8(t.verification.expires_at)}:this.verification=null),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"name",void 0),(0,tn._)(this,"organizationId",void 0),(0,tn._)(this,"enrollmentMode",void 0),(0,tn._)(this,"verification",void 0),(0,tn._)(this,"affiliationEmailAddress",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"totalPendingInvitations",void 0),(0,tn._)(this,"totalPendingSuggestions",void 0),(0,tn._)(this,"prepareAffiliationVerification",async t=>this._basePost({path:"/organizations/".concat(this.organizationId,"/domains/").concat(this.id,"/prepare_affiliation_verification"),method:"POST",body:t})),(0,tn._)(this,"attemptAffiliationVerification",async t=>this._basePost({path:"/organizations/".concat(this.organizationId,"/domains/").concat(this.id,"/attempt_affiliation_verification"),method:"POST",body:t})),(0,tn._)(this,"updateEnrollmentMode",t=>this._basePost({path:"/organizations/".concat(this.organizationId,"/domains/").concat(this.id,"/update_enrollment_mode"),body:t})),(0,tn._)(this,"delete",()=>this._baseDelete({path:"/organizations/".concat(this.organizationId,"/domains/").concat(this.id)})),this.fromJSON(t)}}class rP extends i7{fromJSON(t){return t&&(this.id=t.id,this.organizationId=t.organization_id,this.status=t.status,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at),t.public_user_data&&(this.publicUserData=new rB(t.public_user_data))),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"organizationId",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"publicUserData",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"accept",async()=>await this._basePost({path:"/organizations/".concat(this.organizationId,"/membership_requests/").concat(this.id,"/accept")})),(0,tn._)(this,"reject",async()=>await this._basePost({path:"/organizations/".concat(this.organizationId,"/membership_requests/").concat(this.id,"/reject")})),this.fromJSON(t)}}class rC extends i7{fromJSON(t){return t&&(this.id=t.id,this.key=t.key,this.name=t.name,this.description=t.description,this.type=t.type,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at)),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"key",void 0),(0,tn._)(this,"name",void 0),(0,tn._)(this,"description",void 0),(0,tn._)(this,"type",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),this.fromJSON(t)}}class rO extends i7{fromJSON(t){return t&&(this.id=t.id,this.key=t.key,this.name=t.name,this.description=t.description,this.permissions=t.permissions.map(t=>new rC(t)),this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at)),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"key",void 0),(0,tn._)(this,"name",void 0),(0,tn._)(this,"description",void 0),(0,tn._)(this,"permissions",[]),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),this.fromJSON(t)}}class rT extends i7{static async create(t){var e;return new rT(null==(e=await i7._fetch({path:"/organizations",method:"POST",body:t}))?void 0:e.response)}static async get(t){var e;return new rT(null==(e=await i7._fetch({path:"/organizations/".concat(t),method:"GET"}))?void 0:e.response)}fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.slug=t.slug,this.imageUrl=t.image_url||"",this.hasImage=t.has_image||!1,this.publicMetadata=t.public_metadata||{},this.membersCount=t.members_count||0,this.pendingInvitationsCount=t.pending_invitations_count||0,this.maxAllowedMemberships=t.max_allowed_memberships||0,this.adminDeleteEnabled=t.admin_delete_enabled||!1,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at)),this}__internal_toSnapshot(){return{object:"organization",id:this.id,name:this.name,slug:this.slug,image_url:this.imageUrl,has_image:this.hasImage,public_metadata:this.publicMetadata,members_count:this.membersCount,pending_invitations_count:this.pendingInvitationsCount,max_allowed_memberships:this.maxAllowedMemberships,admin_delete_enabled:this.adminDeleteEnabled,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}async reload(t){var e;let{rotatingTokenNonce:i}=t||{},n=null==(e=await i7._fetch({path:"/organizations/".concat(this.id),method:"GET",rotatingTokenNonce:i},{forceUpdateClient:!0}))?void 0:e.response;return this.fromJSON(n)}constructor(t){super(),(0,tn._)(this,"pathRoot","/organizations"),(0,tn._)(this,"id",void 0),(0,tn._)(this,"name",void 0),(0,tn._)(this,"slug",void 0),(0,tn._)(this,"imageUrl",void 0),(0,tn._)(this,"hasImage",void 0),(0,tn._)(this,"publicMetadata",{}),(0,tn._)(this,"adminDeleteEnabled",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"membersCount",0),(0,tn._)(this,"pendingInvitationsCount",0),(0,tn._)(this,"maxAllowedMemberships",void 0),(0,tn._)(this,"update",async t=>this._basePatch({body:t})),(0,tn._)(this,"getRoles",async t=>await i7._fetch({path:"/organizations/".concat(this.id,"/roles"),method:"GET",search:nS(t)},{forceUpdateClient:!0}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rO(t))}})),(0,tn._)(this,"getDomains",async t=>await i7._fetch({path:"/organizations/".concat(this.id,"/domains"),method:"GET",search:nS(t)},{forceUpdateClient:!0}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rE(t))}})),(0,tn._)(this,"getDomain",async t=>{var e;let{domainId:i}=t;return new rE(null==(e=await i7._fetch({path:"/organizations/".concat(this.id,"/domains/").concat(i),method:"GET"}))?void 0:e.response)}),(0,tn._)(this,"getMembershipRequests",async t=>await i7._fetch({path:"/organizations/".concat(this.id,"/membership_requests"),method:"GET",search:nS(t)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rP(t))}})),(0,tn._)(this,"createDomain",async t=>rE.create(this.id,{name:t})),(0,tn._)(this,"getMemberships",async t=>await i7._fetch({path:"/organizations/".concat(this.id,"/memberships"),method:"GET",search:nS({...t,paginated:!0})}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rM(t))}})),(0,tn._)(this,"getInvitations",async t=>await i7._fetch({path:"/organizations/".concat(this.id,"/invitations"),method:"GET",search:nS(t)},{forceUpdateClient:!0}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rR(t))}})),(0,tn._)(this,"addMember",async t=>{let{userId:e,role:i}=t;return await i7._fetch({method:"POST",path:"/organizations/".concat(this.id,"/memberships"),body:{userId:e,role:i}}).then(t=>new rM(null==t?void 0:t.response))}),(0,tn._)(this,"inviteMember",async t=>rR.create(this.id,t)),(0,tn._)(this,"inviteMembers",async t=>rR.createBulk(this.id,t)),(0,tn._)(this,"updateMember",async t=>{let{userId:e,role:i}=t;return await i7._fetch({method:"PATCH",path:"/organizations/".concat(this.id,"/memberships/").concat(e),body:{role:i}}).then(t=>new rM(null==t?void 0:t.response))}),(0,tn._)(this,"removeMember",async t=>await i7._fetch({method:"DELETE",path:"/organizations/".concat(this.id,"/memberships/").concat(t)}).then(t=>new rM(null==t?void 0:t.response))),(0,tn._)(this,"destroy",async()=>this._baseDelete()),(0,tn._)(this,"setLogo",async t=>{let e,i,{file:n}=t;return null===n?await i7._fetch({path:"/organizations/".concat(this.id,"/logo"),method:"DELETE"}).then(t=>new rT(null==t?void 0:t.response)):("string"==typeof n?(e=n,i=new Headers({"Content-Type":"application/octet-stream"})):(e=new FormData).append("file",n),await i7._fetch({path:"/organizations/".concat(this.id,"/logo"),method:"PUT",body:e,headers:i}).then(t=>new rT(null==t?void 0:t.response)))}),(0,tn._)(this,"initializePaymentMethod",t=>nL({...t,orgId:this.id})),(0,tn._)(this,"addPaymentMethod",t=>nj({...t,orgId:this.id})),(0,tn._)(this,"getPaymentMethods",t=>nB({...t,orgId:this.id})),this.fromJSON(t)}}class rR extends i7{static async create(t,e){var i;let{emailAddress:n,role:r}=e;return new rR(null==(i=await i7._fetch({path:"/organizations/".concat(t,"/invitations"),method:"POST",body:{email_address:n,role:r}}))?void 0:i.response)}static async createBulk(t,e){var i;let{emailAddresses:n,role:r}=e;return(null==(i=await i7._fetch({path:"/organizations/".concat(t,"/invitations/bulk"),method:"POST",body:{email_address:n,role:r}}))?void 0:i.response).map(t=>new rR(t))}fromJSON(t){return t&&(this.id=t.id,this.emailAddress=t.email_address,this.organizationId=t.organization_id,this.publicMetadata=t.public_metadata,this.role=t.role,this.roleName=t.role_name,this.status=t.status,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at)),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"emailAddress",void 0),(0,tn._)(this,"organizationId",void 0),(0,tn._)(this,"publicMetadata",{}),(0,tn._)(this,"status",void 0),(0,tn._)(this,"role",void 0),(0,tn._)(this,"roleName",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"revoke",async()=>await this._basePost({path:"/organizations/".concat(this.organizationId,"/invitations/").concat(this.id,"/revoke")})),this.fromJSON(t)}}class rM extends i7{fromJSON(t){return t&&(this.id=t.id,this.organization=new rT(t.organization),this.publicMetadata=t.public_metadata||{},t.public_user_data&&(this.publicUserData=new rB(t.public_user_data)),this.permissions=Array.isArray(t.permissions)?[...t.permissions]:[],this.role=t.role,this.roleName=t.role_name,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at)),this}__internal_toSnapshot(){var t;return{object:"organization_membership",id:this.id,organization:this.organization.__internal_toSnapshot(),public_metadata:this.publicMetadata,public_user_data:null==(t=this.publicUserData)?void 0:t.__internal_toSnapshot(),permissions:this.permissions,role:this.role,role_name:this.roleName,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}reload(t){throw Error("".concat(iT," Calling ").concat("OrganizationMembership",".reload is not currently supported. Please contact support."))}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"publicMetadata",{}),(0,tn._)(this,"publicUserData",void 0),(0,tn._)(this,"organization",void 0),(0,tn._)(this,"permissions",[]),(0,tn._)(this,"role",void 0),(0,tn._)(this,"roleName",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"destroy",async()=>{var t;return await this._baseDelete({path:"/organizations/".concat(this.organization.id,"/memberships/").concat(null==(t=this.publicUserData)?void 0:t.userId)})}),(0,tn._)(this,"update",async t=>{var e;let{role:i}=t;return await this._basePatch({path:"/organizations/".concat(this.organization.id,"/memberships/").concat(null==(e=this.publicUserData)?void 0:e.userId),body:{role:i}})}),this.fromJSON(t)}}(0,tn._)(rM,"retrieve",async t=>await i7._fetch({path:"/me/organization_memberships",method:"GET",search:nS({...t,paginated:!0})}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rM(t))}}));class rN extends i7{static async retrieve(t){return await i7._fetch({path:"/me/organization_suggestions",method:"GET",search:nS(t)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rN(t))}})}fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.publicOrganizationData={hasImage:t.public_organization_data.has_image,imageUrl:t.public_organization_data.image_url,name:t.public_organization_data.name,id:t.public_organization_data.id,slug:t.public_organization_data.slug},this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at)),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"publicOrganizationData",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"accept",async()=>await this._basePost({path:"/me/organization_suggestions/".concat(this.id,"/accept")})),this.fromJSON(t)}}function rz(){return ta()&&"function"==typeof window.PublicKeyCredential}async function rW(){try{return rz()&&await window.PublicKeyCredential.isConditionalMediationAvailable()}catch{return!1}}async function rF(){try{return"undefined"!=typeof window&&await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()}catch{return!1}}class rD extends i7{static async create(){return i7._fetch({path:"/me/passkeys",method:"POST"}).then(t=>new rD(null==t?void 0:t.response))}static async attemptVerification(t,e){let i,n=(i=e.response,{...ra(e),response:{clientDataJSON:rl(i.clientDataJSON),attestationObject:rl(i.attestationObject),transports:i.getTransports()}});return i7._fetch({path:"/me/passkeys/".concat(t,"/attempt_verification"),method:"POST",body:{strategy:"passkey",publicKeyCredential:JSON.stringify(n)}}).then(t=>new rD(null==t?void 0:t.response))}static async registerPasskey(){var t;let e=rD.clerk.__internal_isWebAuthnSupported||rz,i=rD.clerk.__internal_createPublicCredentials||re,n=rD.clerk.__internal_isWebAuthnPlatformAuthenticatorSupported||rF;if(!e())throw new tA("Passkeys are not supported on this device.",{code:"passkey_not_supported"});let r=await this.create(),{verification:s}=r,a=null==s?void 0:s.publicKey;if(a||iL("create"),(null==(t=a.authenticatorSelection)?void 0:t.authenticatorAttachment)==="platform"&&!await n())throw new tA("Registration requires a platform authenticator but the device does not support it.",{code:"passkey_pa_not_supported"});let{publicKeyCredential:o,error:l}=await i(a);if(!o)throw l;return this.attemptVerification(r.id,o)}fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.lastUsedAt=t.last_used_at?i8(t.last_used_at):null,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at),t.verification&&(this.verification=new rh(t.verification))),this}__internal_toSnapshot(){var t,e;return{object:"passkey",id:this.id,name:this.name,verification:(null==(t=this.verification)?void 0:t.__internal_toSnapshot())||null,last_used_at:(null==(e=this.lastUsedAt)?void 0:e.getTime())||null,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"pathRoot","/me/passkeys"),(0,tn._)(this,"verification",null),(0,tn._)(this,"name",null),(0,tn._)(this,"lastUsedAt",null),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"update",t=>this._basePatch({body:t})),(0,tn._)(this,"delete",async()=>{var t;return new n2(null==(t=await i7._fetch({path:this.path(),method:"DELETE"}))?void 0:t.response)}),this.fromJSON(t)}}class rL extends i7{fromJSON(t){return t&&(this.id=t.id,this.phoneNumber=t.phone_number,this.reservedForSecondFactor=t.reserved_for_second_factor,this.defaultSecondFactor=t.default_second_factor,this.verification=new ru(t.verification),this.linkedTo=(t.linked_to||[]).map(t=>new rx(t)),this.backupCodes=t.backup_codes),this}__internal_toSnapshot(){return{object:"phone_number",id:this.id||"",phone_number:this.phoneNumber,reserved_for_second_factor:this.reservedForSecondFactor,default_second_factor:this.defaultSecondFactor,verification:this.verification.__internal_toSnapshot(),linked_to:this.linkedTo.map(t=>t.__internal_toSnapshot()),backup_codes:this.backupCodes}}constructor(t,e){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"phoneNumber",""),(0,tn._)(this,"reservedForSecondFactor",!1),(0,tn._)(this,"defaultSecondFactor",!1),(0,tn._)(this,"linkedTo",[]),(0,tn._)(this,"verification",void 0),(0,tn._)(this,"backupCodes",void 0),(0,tn._)(this,"create",()=>this._basePost({body:{phone_number:this.phoneNumber}})),(0,tn._)(this,"prepareVerification",()=>this._basePost({action:"prepare_verification",body:{strategy:"phone_code"}})),(0,tn._)(this,"attemptVerification",t=>{let{code:e}=t||{};return this._basePost({action:"attempt_verification",body:{code:e}})}),(0,tn._)(this,"setReservedForSecondFactor",t=>{let{reserved:e}=t||{};return this._basePatch({body:{reserved_for_second_factor:e}})}),(0,tn._)(this,"makeDefaultSecondFactor",()=>this._basePatch({body:{default_second_factor:!0}})),(0,tn._)(this,"destroy",()=>this._baseDelete()),(0,tn._)(this,"toString",()=>{let t=this.phoneNumber.match(/^(\d{3})(\d{3})(\d{4})$/);return t?"("+t[1]+") "+t[2]+"-"+t[3]:this.phoneNumber}),this.pathRoot=e,this.fromJSON(t)}}class rj extends i7{fromJSON(t){return t&&(this.id=this.withDefault(t.id,this.id),this.loaders=this.withDefault(t.loaders,this.loaders)),this}__internal_toSnapshot(){return{object:"protect_config",id:this.id,loaders:this.loaders}}constructor(t=null){super(),(0,tn._)(this,"id",""),(0,tn._)(this,"loaders",void 0),(0,tn._)(this,"rollout",void 0),this.fromJSON(t)}}class rB{fromJSON(t){return t&&(this.firstName=t.first_name||null,this.lastName=t.last_name||null,this.imageUrl=t.image_url||"",this.hasImage=t.has_image||!1,this.identifier=t.identifier||"",this.userId=t.user_id),this}__internal_toSnapshot(){return{first_name:this.firstName,last_name:this.lastName,image_url:this.imageUrl,has_image:this.hasImage,identifier:this.identifier,user_id:this.userId}}constructor(t){(0,tn._)(this,"firstName",void 0),(0,tn._)(this,"lastName",void 0),(0,tn._)(this,"imageUrl",void 0),(0,tn._)(this,"hasImage",void 0),(0,tn._)(this,"identifier",void 0),(0,tn._)(this,"userId",void 0),this.fromJSON(t)}}let rV={strict_mfa:{afterMinutes:10,level:"multi_factor"},strict:{afterMinutes:10,level:"second_factor"},moderate:{afterMinutes:60,level:"second_factor"},lax:{afterMinutes:1440,level:"second_factor"}},rJ=new Set(["first_factor","second_factor","multi_factor"]),rK=new Set(["strict_mfa","strict","moderate","lax"]),rq=(t,e)=>{let{org:i,user:n}=rH(t),[r,s]=e.split(":"),a=s||r;return"org"===r?i.includes(a):"user"===r?n.includes(a):[...i,...n].includes(a)},rH=t=>{let e=t?t.split(",").map(t=>t.trim()):[];return{org:e.filter(t=>t.split(":")[0].includes("o")).map(t=>t.split(":")[1]),user:e.filter(t=>t.split(":")[0].includes("u")).map(t=>t.split(":")[1])}};class rG extends i7{fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.session=new rX(t.session),this.level=t.level,this.supportedFirstFactors=t4(t.supported_first_factors),this.supportedSecondFactors=t4(t.supported_second_factors),this.firstFactorVerification=new ru(t.first_factor_verification),this.secondFactorVerification=new ru(t.second_factor_verification)),this}constructor(t=null){super(),(0,tn._)(this,"status",void 0),(0,tn._)(this,"level",void 0),(0,tn._)(this,"session",void 0),(0,tn._)(this,"supportedFirstFactors",[]),(0,tn._)(this,"supportedSecondFactors",[]),(0,tn._)(this,"firstFactorVerification",new ru(null)),(0,tn._)(this,"secondFactorVerification",new ru(null)),this.fromJSON(t)}}var r$=new WeakMap,rY=new WeakSet;class rX extends i7{static isSessionResource(t){return!!t&&t instanceof rX}fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.expireAt=i8(t.expire_at),this.abandonAt=i8(t.abandon_at),this.factorVerificationAge=t.factor_verification_age,this.lastActiveAt=i8(t.last_active_at||void 0),this.lastActiveOrganizationId=t.last_active_organization_id,this.actor=t.actor||null,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at),this.user=new su(t.user),this.tasks=t.tasks||null,t.public_user_data&&(this.publicUserData=new rB(t.public_user_data)),this.lastActiveToken=t.last_active_token?new so(t.last_active_token):null),this}__internal_toSnapshot(){var t,e;return{object:"session",id:this.id,status:this.status,expire_at:this.expireAt.getTime(),abandon_at:this.abandonAt.getTime(),factor_verification_age:this.factorVerificationAge,last_active_at:this.lastActiveAt.getTime(),last_active_organization_id:this.lastActiveOrganizationId,actor:this.actor,tasks:this.tasks,user:(null==(t=this.user)?void 0:t.__internal_toSnapshot())||null,public_user_data:this.publicUserData.__internal_toSnapshot(),last_active_token:(null==(e=this.lastActiveToken)?void 0:e.__internal_toSnapshot())||null,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}async _getToken(t){if(!this.user)return null;let{leewayInSeconds:e,template:i,skipCache:n=!1}=t||{},r=void 0===(null==t?void 0:t.organizationId)?this.lastActiveOrganizationId:null==t?void 0:t.organizationId;if(!i&&Number(e)>=60)throw Error("Leeway can not exceed the token lifespan (60 seconds)");let s=h(this,rY,rQ).call(this,i,r),a=n?void 0:nZ.get({tokenId:s},e),o=!i&&r===this.lastActiveOrganizationId;if(a){id.debug("Using cached token (no fetch needed)",{tokenId:s},"session");let t=await a.tokenResolver;return o&&rw.emit(rg,{token:t}),t.getRawString()||null}id.info("Fetching new token from API",{organizationId:r,template:i,tokenId:s},"session");let l=i?"".concat(this.path(),"/tokens/").concat(i):"".concat(this.path(),"/tokens"),c=i?{}:{organizationId:r},u=so.create(l,c,n);return nZ.set({tokenId:s,tokenResolver:u}),u.then(t=>(o&&(rw.emit(rg,{token:t}),t.jwt&&(this.lastActiveToken=t,rw.emit(ry,null))),t.getRawString()||null))}get currentTask(){var t;let[e]=null!=(t=this.tasks)?t:[];return e}constructor(t){super(),d(this,rY),(0,tn._)(this,"pathRoot","/client/sessions"),(0,tn._)(this,"id",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"lastActiveAt",void 0),(0,tn._)(this,"lastActiveToken",void 0),(0,tn._)(this,"lastActiveOrganizationId",void 0),(0,tn._)(this,"actor",void 0),(0,tn._)(this,"user",void 0),(0,tn._)(this,"publicUserData",void 0),(0,tn._)(this,"factorVerificationAge",null),(0,tn._)(this,"tasks",null),(0,tn._)(this,"expireAt",void 0),(0,tn._)(this,"abandonAt",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"end",()=>(nZ.clear(),this._basePost({action:"end"}))),(0,tn._)(this,"remove",()=>(nZ.clear(),this._basePost({action:"remove"}))),(0,tn._)(this,"touch",()=>this._basePost({action:"touch",body:{active_organization_id:this.lastActiveOrganizationId}}).then(t=>(t.lastActiveToken&&rw.emit(rg,{token:t.lastActiveToken}),t))),(0,tn._)(this,"clearCache",()=>nZ.clear()),(0,tn._)(this,"getToken",async t=>iv(()=>this._getToken(t),{factor:1.55,initialDelay:3e3,maxDelayBetweenRetries:5e4,jitter:!1,shouldRetry:(t,e)=>!tx(t)&&e<=8})),(0,tn._)(this,"checkAuthorization",t=>{var e,i,n,r,s,a;let o,l=((null==(e=this.user)?void 0:e.organizationMemberships)||[]).find(t=>t.organization.id===this.lastActiveOrganizationId);return(o={userId:null==(i=this.user)?void 0:i.id,factorVerificationAge:this.factorVerificationAge,orgId:null==l?void 0:l.id,orgRole:null==l?void 0:l.role,orgPermissions:null==l?void 0:l.permissions,features:(null==(r=this.lastActiveToken)||null==(n=r.jwt)?void 0:n.claims.fea)||"",plans:(null==(a=this.lastActiveToken)||null==(s=a.jwt)?void 0:s.claims.pla)||""},t=>{if(!o.userId)return!1;let e=((t,e)=>{let{features:i,plans:n}=e;return t.feature&&i?rq(i,t.feature):t.plan&&n?rq(n,t.plan):null})(t,o),i=((t,e)=>{let{orgId:i,orgRole:n,orgPermissions:r}=e;return(t.role||t.permission)&&i&&n&&r?t.permission?r.includes(t.permission.replace(/^(org:)*/,"org:")):t.role?n.replace(/^(org:)*/,"org:")===t.role.replace(/^(org:)*/,"org:"):null:null})(t,o),n=((t,e)=>{let{factorVerificationAge:i}=e;if(!t.reverification||!i)return null;let n=(t=>{let e,i;if(!t)return!1;let n="string"==typeof t&&rK.has(t),r="object"==typeof t&&(e=t.level,rJ.has(e))&&"number"==typeof(i=t.afterMinutes)&&i>0;return(!!n||!!r)&&(t=>"string"==typeof t?rV[t]:t).bind(null,t)})(t.reverification);if(!n)return null;let{level:r,afterMinutes:s}=n(),[a,o]=i,l=-1!==a?s>a:null,c=-1!==o?s>o:null;switch(r){case"first_factor":return l;case"second_factor":return -1!==o?c:l;case"multi_factor":return -1===o?l:l&&c}})(t,o);return[e||i,n].some(t=>null===t)?[e||i,n].some(t=>!0===t):[e||i,n].every(t=>!0===t)})(t)}),c(this,r$,{writable:!0,value:t=>{t&&nZ.set({tokenId:h(this,rY,rQ).call(this),tokenResolver:Promise.resolve(t)})}}),(0,tn._)(this,"startVerification",async t=>{var e;let{level:i}=t;return new rG(null==(e=await i7._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify"),body:{level:i}}))?void 0:e.response)}),(0,tn._)(this,"prepareFirstFactorVerification",async t=>{var e;let i;switch(t.strategy){case"email_code":i={emailAddressId:t.emailAddressId};break;case"phone_code":i={phoneNumberId:t.phoneNumberId,default:t.default};break;case"passkey":i={};break;case"enterprise_sso":i={emailAddressId:t.emailAddressId,enterpriseConnectionId:t.enterpriseConnectionId,redirectUrl:t.redirectUrl};break;default:iz("Session.prepareFirstFactorVerification",t.strategy)}return new rG(null==(e=await i7._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify/prepare_first_factor"),body:{...i,strategy:t.strategy}}))?void 0:e.response)}),(0,tn._)(this,"attemptFirstFactorVerification",async t=>{var e;let i;return i="passkey"===t.strategy?{publicKeyCredential:JSON.stringify(ro(t.publicKeyCredential))}:{...t},new rG(null==(e=await i7._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify/attempt_first_factor"),body:{...i,strategy:t.strategy}}))?void 0:e.response)}),(0,tn._)(this,"verifyWithPasskey",async()=>{let{nonce:t=null}=(await this.prepareFirstFactorVerification({strategy:"passkey"})).firstFactorVerification,e=rX.clerk.__internal_isWebAuthnSupported||rz,i=rX.clerk.__internal_getPublicCredentials||rn;if(!e())throw new tA("Passkeys are not supported",{code:"passkey_not_supported"});let n=t?rs(JSON.parse(t)):null;n||iL("get");let{publicKeyCredential:r,error:s}=await i({publicKeyOptions:n,conditionalUI:!1});if(!r)throw s;return this.attemptFirstFactorVerification({strategy:"passkey",publicKeyCredential:r})}),(0,tn._)(this,"prepareSecondFactorVerification",async t=>{var e;return new rG(null==(e=await i7._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify/prepare_second_factor"),body:t}))?void 0:e.response)}),(0,tn._)(this,"attemptSecondFactorVerification",async t=>{var e;return new rG(null==(e=await i7._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify/attempt_second_factor"),body:t}))?void 0:e.response)}),this.fromJSON(t),o(this,r$).call(this,this.lastActiveToken)}}function rQ(t,e){let i=void 0===e?this.lastActiveOrganizationId:e;return iO.build(this.id,t,i)}class rZ extends i7{static retrieve(){var t;let e=null==(t=i7.clerk.session)?void 0:t.id;return this.clerk.getFapiClient().request({method:"GET",path:"/me/sessions/active",sessionId:e}).then(t=>t.payload.map(t=>new rZ(t,"/me/sessions"))).catch(()=>[])}revoke(){return this._basePost({action:"revoke",body:{}})}fromJSON(t){var e;let i;return t?(this.id=t.id,this.status=t.status,this.expireAt=i8(t.expire_at),this.abandonAt=i8(t.abandon_at),this.lastActiveAt=i8(t.last_active_at||void 0),this.latestActivity={id:(i=null!=(e=t.latest_activity)?e:{}).id,deviceType:i.device_type,browserName:i.browser_name,browserVersion:i.browser_version,country:i.country,city:i.city,isMobile:i.is_mobile,ipAddress:i.ip_address},this.actor=t.actor,this):this}constructor(t,e){super(),(0,tn._)(this,"pathRoot",""),(0,tn._)(this,"id",void 0),(0,tn._)(this,"status",void 0),(0,tn._)(this,"abandonAt",void 0),(0,tn._)(this,"expireAt",void 0),(0,tn._)(this,"lastActiveAt",void 0),(0,tn._)(this,"latestActivity",void 0),(0,tn._)(this,"actor",void 0),this.pathRoot=e,this.fromJSON(t)}}s(526),s(4498);let r0=(t,e,i)=>{let{onValidation:n=n5.t,onValidationComplexity:r=n5.t}=i||{},{show_zxcvbn:s,validatePassword:a}=e,o=t=>((t,e)=>{let{max_length:i,min_length:n,require_special_char:r,require_lowercase:s,require_numbers:a,require_uppercase:o}=e,l=(t=>{let e;if(t.allowed_special_characters){let i=t.allowed_special_characters.replace("[","\\[");i=i.replace("]","\\]"),e=new RegExp("[".concat(i,"]"))}else e=/[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/;return(t,i)=>{let{minLength:n,maxLength:r}=i;return{max_length:t.length<r,min_length:t.length>=n,require_numbers:/\d/.test(t),require_lowercase:/[a-z]/.test(t),require_uppercase:/[A-Z]/.test(t),require_special_char:e.test(t)}}})(e)(t,{maxLength:e.max_length,minLength:e.min_length}),c={max_length:i,min_length:n,require_special_char:r,require_lowercase:s,require_numbers:a,require_uppercase:o},u=new Map;for(let t in c)c[t]&&!l[t]&&u.set(t,!0);return Object.freeze(Object.fromEntries(u))})(t,e),l=(t=>{let{min_zxcvbn_strength:e,onResult:i}=t;return t=>n=>{let r=t(n);return(null==i||i(r),r.score>=e&&r.score<3)?{state:"pass",keys:["unstable__errors.zxcvbn.couldBeStronger"],result:r}:r.score>=e?{state:"excellent",result:r}:{state:"fail",keys:["unstable__errors.zxcvbn.notEnough",...r.feedback.suggestions.map(t=>"unstable__errors.zxcvbn.suggestions.".concat(t))],result:r}}})(e),c={};return(e,i)=>{let{onValidation:u=n,onValidationComplexity:h=r}=i||{};if(!a)return;let d=o(e);h(0===Object.keys(d).length),c={...c,complexity:d},s&&t().then(t=>{let i=l(t)(e);u({...c={...c,strength:i},strength:i})}),c.complexity&&0===Object.keys(c.complexity).length&&s||u(c)}};function r1(t){return t?"https://".concat(t.replace(/clerk\.accountsstage\./,"accountsstage.").replace(/clerk\.accounts\.|clerk\./,"accounts.")):""}async function r2(t,e,i,n,r){if(!t.client||!n.popup)return;let s=r1(t.frontendApi),{redirectUrl:a}=n,o=new URL(a);o.searchParams.set("sign_in_force_redirect_url",n.redirectUrlComplete),o.searchParams.set("sign_up_force_redirect_url",n.redirectUrlComplete),o.searchParams.set("intent",e);let l=t.buildUrlWithAuth(o.toString()),c=t.buildUrlWithAuth("".concat(s,"/popup-callback")),u=t.buildUrlWithAuth("".concat(s,"/popup-callback?return_url=").concat(encodeURIComponent(l))),h=async e=>{if(e.origin!==s)return;let i=!1;if(e.data.session){var r,a;if(!(null==(r=t.client)?void 0:r.sessions.find(t=>t.id===e.data.session)))try{await (null==(a=t.client)?void 0:a.reload())}catch(t){console.error(t)}await t.setActive({session:e.data.session,redirectUrl:n.redirectUrlComplete}),i=!0}else e.data.return_url&&(t.navigate(e.data.return_url),i=!0);i&&window.removeEventListener("message",h)};window.addEventListener("message",h),await i({...n,redirectUrlComplete:c,redirectUrl:u},r)}function r3(t,e){let{redirectCallbackUrl:i,redirectUrl:n}=e,r=r1(t.frontendApi),s=new URL(i);s.searchParams.set("sign_in_force_redirect_url",n),s.searchParams.set("sign_up_force_redirect_url",n);let a=t.buildUrlWithAuth(s.toString()),o=t.buildUrlWithAuth("".concat(r,"/popup-callback"));return{redirectCallbackUrl:t.buildUrlWithAuth("".concat(r,"/popup-callback?return_url=").concat(encodeURIComponent(a))),redirectUrl:o}}function r5(t,e){return new Promise((i,n)=>{if(!t.client||!e.popup)return void n();let r=async e=>{e.origin===r1(t.frontendApi)&&(e.data.session||e.data.return_url?(window.removeEventListener("message",r),i()):n())};window.addEventListener("message",r),e.popup.location.href=e.externalVerificationRedirectURL.toString()})}async function r4(t,e){rw.emit("resource:error",{resource:t,error:null}),rw.emit("resource:fetch",{resource:t,status:"fetching"});try{return{result:await e(),error:null}}catch(e){return rw.emit("resource:error",{resource:t,error:e}),{error:e}}finally{rw.emit("resource:fetch",{resource:t,status:"idle"})}}let r6=()=>{var t;return(t=new iw,{loadZxcvbn:()=>Promise.all([t.import("@zxcvbn-ts/core"),t.import("@zxcvbn-ts/language-common")]).then(t=>{let[e,i]=t;if(!e||!i)throw Error("Failed to load zxcvbn modules");let{zxcvbnOptions:n,zxcvbn:r}=e,{dictionary:s,adjacencyGraphs:a}=i;return n.setOptions({dictionary:{...s},graphs:a}),r})}).loadZxcvbn};class r7 extends i7{get status(){return this._status}set status(t){let e=this._status;this._status=t,t&&e!==t&&id.debug("SignIn.status",{id:this.id,from:e,to:t})}fromJSON(t){if(t){var e;this.id=t.id,this.status=t.status,this.supportedIdentifiers=t.supported_identifiers,this.identifier=t.identifier,this.supportedFirstFactors=t4(t.supported_first_factors),this.supportedSecondFactors=t4(t.supported_second_factors),this.firstFactorVerification=new ru(t.first_factor_verification),this.secondFactorVerification=new ru(t.second_factor_verification),this.createdSessionId=t.created_session_id,this.userData=new sh(t.user_data),this.clientTrustState=null!=(e=t.client_trust_state)?e:void 0}return rw.emit("resource:update",{resource:this}),this}__internal_toSnapshot(){return{object:"sign_in",id:this.id||"",status:this.status||null,supported_identifiers:this.supportedIdentifiers,supported_first_factors:t5(this.supportedFirstFactors),supported_second_factors:t5(this.supportedSecondFactors),first_factor_verification:this.firstFactorVerification.__internal_toSnapshot(),second_factor_verification:this.secondFactorVerification.__internal_toSnapshot(),identifier:this.identifier,created_session_id:this.createdSessionId,user_data:this.userData.__internal_toSnapshot()}}constructor(t=null){super(),(0,tn._)(this,"pathRoot","/client/sign_ins"),(0,tn._)(this,"id",void 0),(0,tn._)(this,"_status",null),(0,tn._)(this,"supportedIdentifiers",[]),(0,tn._)(this,"supportedFirstFactors",[]),(0,tn._)(this,"supportedSecondFactors",null),(0,tn._)(this,"firstFactorVerification",new ru(null)),(0,tn._)(this,"secondFactorVerification",new ru(null)),(0,tn._)(this,"identifier",null),(0,tn._)(this,"createdSessionId",null),(0,tn._)(this,"userData",new sh(null)),(0,tn._)(this,"clientTrustState",void 0),(0,tn._)(this,"__internal_future",new st(this)),(0,tn._)(this,"__internal_basePost",this._basePost.bind(this)),(0,tn._)(this,"__internal_baseGet",this._baseGet.bind(this)),(0,tn._)(this,"create",t=>{id.debug("SignIn.create",{id:this.id,strategy:"strategy"in t?t.strategy:void 0});let e=iE();return this._basePost({path:this.pathRoot,body:e?{locale:e,...t}:t})}),(0,tn._)(this,"resetPassword",t=>this._basePost({body:t,action:"reset_password"})),(0,tn._)(this,"prepareFirstFactor",t=>{let e;switch(id.debug("SignIn.prepareFirstFactor",{id:this.id,strategy:t.strategy}),t.strategy){case"passkey":e={};break;case"email_link":e={emailAddressId:t.emailAddressId,redirectUrl:t.redirectUrl};break;case"email_code":case"reset_password_email_code":e={emailAddressId:t.emailAddressId};break;case"phone_code":e={phoneNumberId:t.phoneNumberId,default:t.default,channel:t.channel};break;case"web3_metamask_signature":case"web3_base_signature":case"web3_coinbase_wallet_signature":case"web3_okx_wallet_signature":e={web3WalletId:t.web3WalletId};break;case"reset_password_phone_code":e={phoneNumberId:t.phoneNumberId};break;case"enterprise_sso":e={redirectUrl:t.redirectUrl,actionCompleteRedirectUrl:t.actionCompleteRedirectUrl,oidcPrompt:t.oidcPrompt,enterpriseConnectionId:t.enterpriseConnectionId};break;default:iz("SignIn.prepareFirstFactor",t.strategy)}return this._basePost({body:{...e,strategy:t.strategy},action:"prepare_first_factor"})}),(0,tn._)(this,"attemptFirstFactor",t=>{let e;return id.debug("SignIn.attemptFirstFactor",{id:this.id,strategy:t.strategy}),e="passkey"===t.strategy?{publicKeyCredential:JSON.stringify(ro(t.publicKeyCredential))}:{...t},this._basePost({body:{...e,strategy:t.strategy},action:"attempt_first_factor"})}),(0,tn._)(this,"createEmailLinkFlow",()=>{let{run:t,stop:e}=n8();return{startEmailLinkFlow:async i=>{let{emailAddressId:n,redirectUrl:r}=i;this.id||iN("SignIn");let s={strategy:"email_link",emailAddressId:n,redirectUrl:r},a="needs_second_factor"===this.status||"needs_client_trust"===this.status,o=a?"secondFactorVerification":"firstFactorVerification";return a?await this.prepareSecondFactor(s):await this.prepareFirstFactor(s),new Promise((i,n)=>{t(()=>this.reload().then(t=>{let n=t[o].status;("verified"===n||"expired"===n)&&(e(),i(t))}).catch(t=>{e(),n(t)}))})},cancelEmailLinkFlow:e}}),(0,tn._)(this,"prepareSecondFactor",t=>(id.debug("SignIn.prepareSecondFactor",{id:this.id,strategy:t.strategy}),this._basePost({body:t,action:"prepare_second_factor"}))),(0,tn._)(this,"attemptSecondFactor",t=>(id.debug("SignIn.attemptSecondFactor",{id:this.id,strategy:t.strategy}),this._basePost({body:t,action:"attempt_second_factor"}))),(0,tn._)(this,"authenticateWithRedirectOrPopup",async(t,e)=>{let{strategy:i,redirectUrlComplete:n,identifier:r,oidcPrompt:s,continueSignIn:a,enterpriseConnectionId:o}=t||{},l=r7.clerk.buildUrlWithAuth(t.redirectUrl);this.id&&a||await this.create({strategy:i,identifier:r,redirectUrl:l,actionCompleteRedirectUrl:n}),"enterprise_sso"===i&&await this.prepareFirstFactor({strategy:i,redirectUrl:l,actionCompleteRedirectUrl:n,oidcPrompt:s,enterpriseConnectionId:o});let{status:c,externalVerificationRedirectURL:u}=this.firstFactorVerification;"unverified"===c&&u?e(u):iD(c,r7.fapiClient.buildEmailAddress("support"))}),(0,tn._)(this,"authenticateWithRedirect",async t=>this.authenticateWithRedirectOrPopup(t,ez)),(0,tn._)(this,"authenticateWithPopup",async t=>{let{popup:e}=t||{};return e||iF("popup"),r2(r7.clerk,"signIn",this.authenticateWithRedirectOrPopup,t,t=>{e.location.href=t.toString()})}),(0,tn._)(this,"authenticateWithWeb3",async t=>{var e;let i,{identifier:n,generateSignature:r,strategy:s="web3_metamask_signature"}=t||{},a=s.replace("web3_","").replace("_signature","");"function"!=typeof r&&iF("generateSignature"),await this.create({identifier:n});let o=null==(e=this.supportedFirstFactors)?void 0:e.find(t=>t.strategy===s);o||iW("SignIn"),await this.prepareFirstFactor(o);let{message:l}=this.firstFactorVerification;l||iW("SignIn");try{i=await r({identifier:n,nonce:l,provider:a})}catch(t){if("coinbase_wallet"===a&&4001===t.code)i=await r({identifier:n,nonce:l,provider:a});else throw t}return this.attemptFirstFactor({signature:i,strategy:s})}),(0,tn._)(this,"authenticateWithMetamask",async()=>{let t=await iG().getMetamaskIdentifier();return this.authenticateWithWeb3({identifier:t,generateSignature:iG().generateSignatureWithMetamask,strategy:"web3_metamask_signature"})}),(0,tn._)(this,"authenticateWithCoinbaseWallet",async()=>{let t=await iG().getCoinbaseWalletIdentifier();return this.authenticateWithWeb3({identifier:t,generateSignature:iG().generateSignatureWithCoinbaseWallet,strategy:"web3_coinbase_wallet_signature"})}),(0,tn._)(this,"authenticateWithBase",async()=>{let t=await iG().getBaseIdentifier();return this.authenticateWithWeb3({identifier:t,generateSignature:iG().generateSignatureWithBase,strategy:"web3_base_signature"})}),(0,tn._)(this,"authenticateWithOKXWallet",async()=>{let t=await iG().getOKXWalletIdentifier();return this.authenticateWithWeb3({identifier:t,generateSignature:iG().generateSignatureWithOKXWallet,strategy:"web3_okx_wallet_signature"})}),(0,tn._)(this,"authenticateWithPasskey",async t=>{let{flow:e}=t||{},i=r7.clerk.__internal_isWebAuthnSupported||rz,n=r7.clerk.__internal_getPublicCredentials||rn,r=r7.clerk.__internal_isWebAuthnAutofillSupported||rW;if(!i())throw new tA("Passkeys are not supported",{code:"passkey_not_supported"});if("autofill"===e||"discoverable"===e)await this.create({strategy:"passkey"});else{let t=this.supportedFirstFactors.find(t=>"passkey"===t.strategy);t||function(){throw Error("".concat(iT," You need to start a SignIn flow by calling SignIn.create({ strategy: 'passkey' }) first"))}(),await this.prepareFirstFactor(t)}let{nonce:s}=this.firstFactorVerification,a=s?rs(JSON.parse(s)):null;a||iL("get");let o=!1;"autofill"===e&&(o=await r());let{publicKeyCredential:l,error:c}=await n({publicKeyOptions:a,conditionalUI:o});if(!l)throw c;return this.attemptFirstFactor({publicKeyCredential:l,strategy:"passkey"})}),(0,tn._)(this,"validatePassword",(t,e)=>{var i,n;if(null==(i=r7.clerk.__internal_environment)?void 0:i.userSettings.passwordSettings)return r0(r6(),{...null==(n=r7.clerk.__internal_environment)?void 0:n.userSettings.passwordSettings,validatePassword:!0})(t,e)}),this.fromJSON(t)}}var r8=new WeakMap,r9=new WeakMap;class st{get id(){return o(this,r9).id}get identifier(){return o(this,r9).identifier}get createdSessionId(){return o(this,r9).createdSessionId}get userData(){return o(this,r9).userData}get status(){return o(this,r9).status||"needs_identifier"}get supportedFirstFactors(){var t;return null!=(t=o(this,r9).supportedFirstFactors)?t:[]}get supportedSecondFactors(){var t;return null!=(t=o(this,r9).supportedSecondFactors)?t:[]}get isTransferable(){return"transferable"===o(this,r9).firstFactorVerification.status}get existingSession(){var t,e,i,n,r;if("failed"===o(this,r9).firstFactorVerification.status&&(null==(t=o(this,r9).firstFactorVerification.error)?void 0:t.code)==="identifier_already_signed_in"&&(null==(i=o(this,r9).firstFactorVerification.error)||null==(e=i.meta)?void 0:e.sessionId))return{sessionId:null==(r=o(this,r9).firstFactorVerification.error)||null==(n=r.meta)?void 0:n.sessionId}}get firstFactorVerification(){return o(this,r9).firstFactorVerification}get secondFactorVerification(){return o(this,r9).secondFactorVerification}get hasBeenFinalized(){return o(this,r8)}async sendResetPasswordEmailCode(){if(!o(this,r9).id)throw Error("Cannot reset password without a sign in.");return r4(o(this,r9),async()=>{var t;let e=null==(t=o(this,r9).supportedFirstFactors)?void 0:t.find(t=>"reset_password_email_code"===t.strategy);if(!e)throw new tk("Reset password email code factor not found",{code:"factor_not_found"});let{emailAddressId:i}=e;await o(this,r9).__internal_basePost({body:{emailAddressId:i,strategy:"reset_password_email_code"},action:"prepare_first_factor"})})}async verifyResetPasswordEmailCode(t){let{code:e}=t;return r4(o(this,r9),async()=>{await o(this,r9).__internal_basePost({body:{code:e,strategy:"reset_password_email_code"},action:"attempt_first_factor"})})}async submitResetPassword(t){let{password:e,signOutOfOtherSessions:i=!0}=t;return r4(o(this,r9),async()=>{await o(this,r9).__internal_basePost({body:{password:e,signOutOfOtherSessions:i},action:"reset_password"})})}async _create(t){let e=iE();await o(this,r9).__internal_basePost({path:o(this,r9).pathRoot,body:e?{locale:e,...t}:t})}async create(t){return r4(o(this,r9),async()=>{await this._create(t)})}async password(t){if([t.identifier,t.emailAddress,t.phoneNumber].filter(Boolean).length>1)throw Error("Only one of identifier, emailAddress, or phoneNumber can be provided");return r4(o(this,r9),async()=>{let e=t.identifier||t.emailAddress||t.phoneNumber,i=o(this,r9).identifier,n=iE();await o(this,r9).__internal_basePost({path:o(this,r9).pathRoot,body:{identifier:e||i,password:t.password,...n?{locale:n}:{}}})})}async sendEmailCode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{emailAddress:e,emailAddressId:i}=t;if(!o(this,r9).id&&i)throw Error("signIn.emailCode.sendCode() cannot be called with an emailAddressId if an existing signIn does not exist.");if(!o(this,r9).id&&!e)throw Error("signIn.emailCode.sendCode() cannot be called without an emailAddress if an existing signIn does not exist.");return r4(o(this,r9),async()=>{e&&await this._create({identifier:e});let t=this.selectFirstFactor({strategy:"email_code",emailAddressId:i});if(!t)throw new tk("Email code factor not found",{code:"factor_not_found"});await o(this,r9).__internal_basePost({body:{emailAddressId:t.emailAddressId,strategy:"email_code"},action:"prepare_first_factor"})})}async verifyEmailCode(t){let{code:e}=t;return r4(o(this,r9),async()=>{await o(this,r9).__internal_basePost({body:{code:e,strategy:"email_code"},action:"attempt_first_factor"})})}async sendEmailLink(t){let{emailAddress:e,verificationUrl:i,emailAddressId:n}=t;if(!o(this,r9).id&&n)throw Error("signIn.emailLink.sendLink() cannot be called with an emailAddressId if an existing signIn does not exist.");if(!o(this,r9).id&&!e)throw Error("signIn.emailLink.sendLink() cannot be called without an emailAddress if an existing signIn does not exist.");return r4(o(this,r9),async()=>{e&&await this._create({identifier:e});let t=this.selectFirstFactor({strategy:"email_link",emailAddressId:n});if(!t)throw new tk("Email link factor not found",{code:"factor_not_found"});let r=i;try{new URL(i)}catch{r=window.location.origin+i}await o(this,r9).__internal_basePost({body:{emailAddressId:t.emailAddressId,redirectUrl:r,strategy:"email_link"},action:"prepare_first_factor"})})}async waitForEmailLinkVerification(){return r4(o(this,r9),async()=>{let{run:t,stop:e}=n8();await new Promise((i,n)=>{t(async()=>{try{let t=await o(this,r9).__internal_baseGet(),n=t.firstFactorVerification.status;("verified"===n||"expired"===n)&&(e(),i(t))}catch(t){e(),n(t)}})})})}async sendPhoneCode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{phoneNumber:e,phoneNumberId:i,channel:n="sms"}=t;if(!o(this,r9).id&&i)throw Error("signIn.phoneCode.sendCode() cannot be called with an phoneNumberId if an existing signIn does not exist.");if(!o(this,r9).id&&!e)throw Error("signIn.phoneCode.sendCode() cannot be called without an phoneNumber if an existing signIn does not exist.");return r4(o(this,r9),async()=>{e&&await this._create({identifier:e});let t=this.selectFirstFactor({strategy:"phone_code",phoneNumberId:i});if(!t)throw new tk("Phone code factor not found",{code:"factor_not_found"});await o(this,r9).__internal_basePost({body:{phoneNumberId:t.phoneNumberId,strategy:"phone_code",channel:n},action:"prepare_first_factor"})})}async verifyPhoneCode(t){let{code:e}=t;return r4(o(this,r9),async()=>{await o(this,r9).__internal_basePost({body:{code:e,strategy:"phone_code"},action:"attempt_first_factor"})})}async sso(t){let{strategy:e,redirectUrl:i,redirectCallbackUrl:n,popup:r,oidcPrompt:s,enterpriseConnectionId:a,identifier:l}=t;return r4(o(this,r9),async()=>{let t=i;try{new URL(i)}catch{t=window.location.origin+i}let c={redirectUrl:r7.clerk.buildUrlWithAuth(n),actionCompleteRedirectUrl:t};if(r){let e=r3(r7.clerk,{redirectCallbackUrl:c.redirectUrl,redirectUrl:t});c.redirectUrl=e.redirectCallbackUrl,c.actionCompleteRedirectUrl=e.redirectUrl}await this._create({strategy:e,...c,identifier:l}),"enterprise_sso"===e&&await o(this,r9).__internal_basePost({body:{...c,oidcPrompt:s,enterpriseConnectionId:a,strategy:"enterprise_sso"},action:"prepare_first_factor"});let{status:u,externalVerificationRedirectURL:h}=o(this,r9).firstFactorVerification;"unverified"===u&&h&&(r?(await r5(r7.clerk,{popup:r,externalVerificationRedirectURL:h}),await o(this,r9).reload()):ez(h))})}async web3(t){let{strategy:e}=t,i=e.replace("web3_","").replace("_signature","");return r4(o(this,r9),async()=>{var t;let n,r,s;switch(i){case"metamask":n=await iG().getMetamaskIdentifier(),r=iG().generateSignatureWithMetamask;break;case"coinbase_wallet":n=await iG().getCoinbaseWalletIdentifier(),r=iG().generateSignatureWithCoinbaseWallet;break;case"base":n=await iG().getBaseIdentifier(),r=iG().generateSignatureWithBase;break;case"okx_wallet":n=await iG().getOKXWalletIdentifier(),r=iG().generateSignatureWithOKXWallet;break;default:throw Error("Unsupported Web3 provider: ".concat(i))}await this._create({identifier:n});let a=null==(t=o(this,r9).supportedFirstFactors)?void 0:t.find(t=>t.strategy===e);if(!a)throw new tk("Web3 first factor not found",{code:"factor_not_found"});await o(this,r9).__internal_basePost({body:{web3WalletId:a.web3WalletId,strategy:e},action:"prepare_first_factor"});let{message:l}=this.firstFactorVerification;if(!l)throw new tk("Web3 nonce not found",{code:"web3_nonce_not_found"});try{s=await r({identifier:n,nonce:l})}catch(t){if("coinbase_wallet"===i&&4001===t.code)s=await r({identifier:n,nonce:l});else throw t}await o(this,r9).__internal_basePost({body:{signature:s,strategy:e},action:"attempt_first_factor"})})}async passkey(t){let{flow:e}=t||{},i=r7.clerk.__internal_isWebAuthnSupported||rz,n=r7.clerk.__internal_getPublicCredentials||rn,r=r7.clerk.__internal_isWebAuthnAutofillSupported||rW;if(!i())throw new tA("Passkeys are not supported",{code:"passkey_not_supported"});return r4(o(this,r9),async()=>{if("autofill"===e||"discoverable"===e)await this._create({strategy:"passkey"});else{if(!this.supportedFirstFactors.find(t=>"passkey"===t.strategy))throw new tk("Passkey factor not found",{code:"factor_not_found"});await o(this,r9).__internal_basePost({body:{strategy:"passkey"},action:"prepare_first_factor"})}let{nonce:t}=this.firstFactorVerification,i=t?rs(JSON.parse(t)):null;if(!i)throw new tk("Missing public key options",{code:"missing_public_key_options"});let s=!1;"autofill"===e&&(s=await r());let{publicKeyCredential:a,error:l}=await n({publicKeyOptions:i,conditionalUI:s});if(!a)throw new tA(l.message,{code:"passkey_retrieval_failed"});await o(this,r9).__internal_basePost({body:{publicKeyCredential:JSON.stringify(ro(a)),strategy:"passkey"},action:"attempt_first_factor"})})}async sendMFAPhoneCode(){return r4(o(this,r9),async()=>{var t;let e=null==(t=o(this,r9).supportedSecondFactors)?void 0:t.find(t=>"phone_code"===t.strategy);if(!e)throw new tk("Phone code factor not found",{code:"factor_not_found"});let{phoneNumberId:i}=e;await o(this,r9).__internal_basePost({body:{phoneNumberId:i,strategy:"phone_code"},action:"prepare_second_factor"})})}async verifyMFAPhoneCode(t){let{code:e}=t;return r4(o(this,r9),async()=>{await o(this,r9).__internal_basePost({body:{code:e,strategy:"phone_code"},action:"attempt_second_factor"})})}async verifyTOTP(t){let{code:e}=t;return r4(o(this,r9),async()=>{await o(this,r9).__internal_basePost({body:{code:e,strategy:"totp"},action:"attempt_second_factor"})})}async verifyBackupCode(t){let{code:e}=t;return r4(o(this,r9),async()=>{await o(this,r9).__internal_basePost({body:{code:e,strategy:"backup_code"},action:"attempt_second_factor"})})}async ticket(t){var e;let i=null!=(e=null==t?void 0:t.ticket)?e:ex("__clerk_ticket");return this.create({ticket:null!=i?i:void 0})}async finalize(t){let{navigate:e}=t||{};if(!o(this,r9).createdSessionId)throw Error("Cannot finalize sign-in without a created session.");return r4(o(this,r9),async()=>{r7.clerk.client&&!r7.clerk.client.sessions.some(t=>t.id===o(this,r9).createdSessionId)&&await r7.clerk.client.reload(),u(this,r8,!0),await r7.clerk.setActive({session:o(this,r9).createdSessionId,navigate:e})})}selectFirstFactor(t){let{strategy:e,emailAddressId:i,phoneNumberId:n}=t;if(!o(this,r9).supportedFirstFactors)return null;if(i){let t=o(this,r9).supportedFirstFactors.find(t=>t.strategy===e&&t.emailAddressId===i);if(t)return t}if(n){let t=o(this,r9).supportedFirstFactors.find(t=>t.strategy===e&&t.phoneNumberId===n);if(t)return t}let r=o(this,r9).supportedFirstFactors.find(t=>t.strategy===e&&t.safeIdentifier===o(this,r9).identifier);if(r)return r;let s=o(this,r9).supportedFirstFactors.find(t=>t.strategy===e);return s||null}constructor(t){(0,tn._)(this,"emailCode",{sendCode:this.sendEmailCode.bind(this),verifyCode:this.verifyEmailCode.bind(this)}),(0,tn._)(this,"emailLink",{sendLink:this.sendEmailLink.bind(this),waitForVerification:this.waitForEmailLinkVerification.bind(this),get verification(){if(!tr())return null;const t=ex("__clerk_status"),e=ex("__clerk_created_session");if(!t||!e)return null;const i="verified"===t&&void 0!==r7.clerk.client&&r7.clerk.client.sessions.some(t=>t.id===e);return{status:t,createdSessionId:e,verifiedFromTheSameClient:i}}}),(0,tn._)(this,"resetPasswordEmailCode",{sendCode:this.sendResetPasswordEmailCode.bind(this),verifyCode:this.verifyResetPasswordEmailCode.bind(this),submitPassword:this.submitResetPassword.bind(this)}),(0,tn._)(this,"phoneCode",{sendCode:this.sendPhoneCode.bind(this),verifyCode:this.verifyPhoneCode.bind(this)}),(0,tn._)(this,"mfa",{sendPhoneCode:this.sendMFAPhoneCode.bind(this),verifyPhoneCode:this.verifyMFAPhoneCode.bind(this),verifyTOTP:this.verifyTOTP.bind(this),verifyBackupCode:this.verifyBackupCode.bind(this)}),c(this,r8,{writable:!0,value:!1}),c(this,r9,{writable:!0,value:void 0}),u(this,r9,t)}}function se(t){let{unsafeMetadata:e}={...t},i=e?"object"==typeof e?JSON.stringify(e):e:"";return{...t,...e?{unsafeMetadata:i}:{}}}class si extends i7{get status(){return this._status}set status(t){let e=this._status;this._status=t,t&&e!==t&&id.debug("SignUp.status",{id:this.id,from:e,to:t})}fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.requiredFields=t.required_fields,this.optionalFields=t.optional_fields,this.missingFields=t.missing_fields,this.unverifiedFields=t.unverified_fields,this.verifications=new rd(t.verifications),this.username=t.username,this.firstName=t.first_name,this.lastName=t.last_name,this.emailAddress=t.email_address,this.phoneNumber=t.phone_number,this.hasPassword=t.has_password,this.unsafeMetadata=t.unsafe_metadata,this.createdSessionId=t.created_session_id,this.createdUserId=t.created_user_id,this.abandonAt=t.abandon_at,this.web3wallet=t.web3_wallet,this.legalAcceptedAt=t.legal_accepted_at,this.locale=t.locale),rw.emit("resource:update",{resource:this}),this}__internal_toSnapshot(){var t;return{object:"sign_up",id:this.id||"",status:this.status||null,required_fields:this.requiredFields,optional_fields:this.optionalFields,missing_fields:this.missingFields,unverified_fields:this.unverifiedFields,verifications:this.verifications.__internal_toSnapshot(),username:this.username,first_name:this.firstName,last_name:this.lastName,email_address:this.emailAddress,phone_number:this.phoneNumber,has_password:this.hasPassword,unsafe_metadata:this.unsafeMetadata,created_session_id:this.createdSessionId,created_user_id:this.createdUserId,abandon_at:this.abandonAt,web3_wallet:this.web3wallet,legal_accepted_at:this.legalAcceptedAt,locale:this.locale,external_account:this.externalAccount,external_account_strategy:null==(t=this.externalAccount)?void 0:t.strategy}}clientBypass(){var t;return null==(t=si.clerk.client)?void 0:t.captchaBypass}shouldBypassCaptchaForAttempt(t){if(!t.strategy)return!1;let e=si.clerk.__internal_environment.displayConfig.captchaOauthBypass;return!!(e.some(e=>e===t.strategy)||t.transfer&&e.some(t=>t===si.clerk.client.signIn.firstFactorVerification.strategy))}constructor(t=null){super(),(0,tn._)(this,"pathRoot","/client/sign_ups"),(0,tn._)(this,"id",void 0),(0,tn._)(this,"_status",null),(0,tn._)(this,"requiredFields",[]),(0,tn._)(this,"missingFields",[]),(0,tn._)(this,"optionalFields",[]),(0,tn._)(this,"unverifiedFields",[]),(0,tn._)(this,"verifications",new rd(null)),(0,tn._)(this,"username",null),(0,tn._)(this,"firstName",null),(0,tn._)(this,"lastName",null),(0,tn._)(this,"emailAddress",null),(0,tn._)(this,"phoneNumber",null),(0,tn._)(this,"web3wallet",null),(0,tn._)(this,"externalAccount",void 0),(0,tn._)(this,"hasPassword",!1),(0,tn._)(this,"unsafeMetadata",{}),(0,tn._)(this,"createdSessionId",null),(0,tn._)(this,"createdUserId",null),(0,tn._)(this,"abandonAt",null),(0,tn._)(this,"legalAcceptedAt",null),(0,tn._)(this,"locale",null),(0,tn._)(this,"__internal_future",new ss(this)),(0,tn._)(this,"__internal_basePost",this._basePost.bind(this)),(0,tn._)(this,"__internal_basePatch",this._basePatch.bind(this)),(0,tn._)(this,"create",async t=>{id.debug("SignUp.create",{id:this.id,strategy:t.strategy});let e={...t};if(!e.locale){let t=iE();t&&(e.locale=t)}if(!this.clientBypass()&&!this.shouldBypassCaptchaForAttempt(t)){let t=new i4(si.clerk),i=await t.managedOrInvisible({action:"signup"});if(!i)throw new tk("",{code:"captcha_unavailable"});e={...e,...i}}if(e.transfer&&this.shouldBypassCaptchaForAttempt(e)){var i;let t=null==(i=si.clerk.client)?void 0:i.signIn.firstFactorVerification.strategy;t&&(e={...e,strategy:t})}return this._basePost({path:this.pathRoot,body:se(e)})}),(0,tn._)(this,"prepareVerification",t=>(id.debug("SignUp.prepareVerification",{id:this.id,strategy:t.strategy}),this._basePost({body:t,action:"prepare_verification"}))),(0,tn._)(this,"attemptVerification",t=>(id.debug("SignUp.attemptVerification",{id:this.id,strategy:t.strategy}),this._basePost({body:t,action:"attempt_verification"}))),(0,tn._)(this,"prepareEmailAddressVerification",t=>this.prepareVerification(t||{strategy:"email_code"})),(0,tn._)(this,"attemptEmailAddressVerification",t=>this.attemptVerification({...t,strategy:"email_code"})),(0,tn._)(this,"createEmailLinkFlow",()=>{let{run:t,stop:e}=n8();return{startEmailLinkFlow:async i=>{let{redirectUrl:n}=i;return this.id||iN("SignUp"),await this.prepareEmailAddressVerification({strategy:"email_link",redirectUrl:n}),new Promise((i,n)=>{t(()=>this.reload().then(t=>{let n=t.verifications.emailAddress.status;("verified"===n||"expired"===n)&&(e(),i(t))}).catch(t=>{e(),n(t)}))})},cancelEmailLinkFlow:e}}),(0,tn._)(this,"preparePhoneNumberVerification",t=>this.prepareVerification(t||{strategy:"phone_code"})),(0,tn._)(this,"attemptPhoneNumberVerification",t=>this.attemptVerification({...t,strategy:"phone_code"})),(0,tn._)(this,"prepareWeb3WalletVerification",t=>this.prepareVerification({strategy:"web3_metamask_signature",...t})),(0,tn._)(this,"attemptWeb3WalletVerification",async t=>{let{signature:e,strategy:i="web3_metamask_signature"}=t;return this.attemptVerification({signature:e,strategy:i})}),(0,tn._)(this,"authenticateWithWeb3",async t=>{let e,{generateSignature:i,identifier:n,unsafeMetadata:r,strategy:s="web3_metamask_signature",legalAccepted:a}=t||{},o=s.replace("web3_","").replace("_signature","");"function"!=typeof i&&iF("generateSignature");let l=n||this.web3wallet;await this.create({web3Wallet:l,unsafeMetadata:r,legalAccepted:a}),await this.prepareWeb3WalletVerification({strategy:s});let{message:c}=this.verifications.web3Wallet;c||iW("SignUp");try{e=await i({identifier:n,nonce:c,provider:o})}catch(t){if("coinbase_wallet"===o&&4001===t.code)e=await i({identifier:n,nonce:c,provider:o});else throw t}return this.attemptWeb3WalletVerification({signature:e,strategy:s})}),(0,tn._)(this,"authenticateWithMetamask",async t=>{let e=await iG().getMetamaskIdentifier();return this.authenticateWithWeb3({identifier:e,generateSignature:iG().generateSignatureWithMetamask,unsafeMetadata:null==t?void 0:t.unsafeMetadata,strategy:"web3_metamask_signature",legalAccepted:null==t?void 0:t.legalAccepted})}),(0,tn._)(this,"authenticateWithCoinbaseWallet",async t=>{let e=await iG().getCoinbaseWalletIdentifier();return this.authenticateWithWeb3({identifier:e,generateSignature:iG().generateSignatureWithCoinbaseWallet,unsafeMetadata:null==t?void 0:t.unsafeMetadata,strategy:"web3_coinbase_wallet_signature",legalAccepted:null==t?void 0:t.legalAccepted})}),(0,tn._)(this,"authenticateWithBase",async t=>{let e=await iG().getBaseIdentifier();return this.authenticateWithWeb3({identifier:e,generateSignature:iG().generateSignatureWithBase,unsafeMetadata:null==t?void 0:t.unsafeMetadata,strategy:"web3_base_signature",legalAccepted:null==t?void 0:t.legalAccepted})}),(0,tn._)(this,"authenticateWithOKXWallet",async t=>{let e=await iG().getOKXWalletIdentifier();return this.authenticateWithWeb3({identifier:e,generateSignature:iG().generateSignatureWithOKXWallet,unsafeMetadata:null==t?void 0:t.unsafeMetadata,strategy:"web3_okx_wallet_signature",legalAccepted:null==t?void 0:t.legalAccepted})}),(0,tn._)(this,"authenticateWithRedirectOrPopup",async(t,e)=>{let{redirectUrl:i,redirectUrlComplete:n,strategy:r,continueSignUp:s=!1,unsafeMetadata:a,emailAddress:o,legalAccepted:l,oidcPrompt:c,enterpriseConnectionId:u}=t,h=si.clerk.buildUrlWithAuth(i),d=()=>{let t={strategy:r,redirectUrl:h,actionCompleteRedirectUrl:n,unsafeMetadata:a,emailAddress:o,legalAccepted:l,oidcPrompt:c,enterpriseConnectionId:u};return s&&this.id?this.update(t):this.create(t)},{verifications:f}=await d().catch(async t=>{if(tU(t)&&tI(t))return await si.clerk.__internal_environment.reload(),d();throw t}),{externalAccount:p}=f,{status:_,externalVerificationRedirectURL:g}=p;"unverified"===_&&g?e(g):iD(_,si.fapiClient.buildEmailAddress("support"))}),(0,tn._)(this,"authenticateWithRedirect",async t=>this.authenticateWithRedirectOrPopup(t,ez)),(0,tn._)(this,"authenticateWithPopup",async t=>{let{popup:e}=t||{};return e||iF("popup"),r2(si.clerk,"signUp",this.authenticateWithRedirectOrPopup,t,t=>{e.location.href=t instanceof URL?t.toString():t})}),(0,tn._)(this,"update",t=>this._basePatch({body:se(t)})),(0,tn._)(this,"upsert",t=>this.id?this.update(t):this.create(t)),(0,tn._)(this,"validatePassword",(t,e)=>{var i,n;if(null==(i=si.clerk.__internal_environment)?void 0:i.userSettings.passwordSettings)return r0(r6(),{...null==(n=si.clerk.__internal_environment)?void 0:n.userSettings.passwordSettings,validatePassword:!0})(t,e)}),(0,tn._)(this,"__experimental_getEnterpriseConnections",()=>i7._fetch({path:"/client/sign_ups/".concat(this.id,"/enterprise_connections"),method:"GET"}).then(t=>(null==t?void 0:t.response).map(t=>new sa(t)))),this.fromJSON(t)}}var sn=new WeakMap,sr=new WeakMap;class ss{get id(){return o(this,sr).id}get requiredFields(){return o(this,sr).requiredFields}get optionalFields(){return o(this,sr).optionalFields}get missingFields(){return o(this,sr).missingFields}get status(){return o(this,sr).status||"missing_requirements"}get username(){return o(this,sr).username}get firstName(){return o(this,sr).firstName}get lastName(){return o(this,sr).lastName}get emailAddress(){return o(this,sr).emailAddress}get phoneNumber(){return o(this,sr).phoneNumber}get web3Wallet(){return o(this,sr).web3wallet}get hasPassword(){return o(this,sr).hasPassword}get unsafeMetadata(){return o(this,sr).unsafeMetadata}get createdSessionId(){return o(this,sr).createdSessionId}get createdUserId(){return o(this,sr).createdUserId}get abandonAt(){return o(this,sr).abandonAt}get legalAcceptedAt(){return o(this,sr).legalAcceptedAt}get locale(){return o(this,sr).locale}get unverifiedFields(){return o(this,sr).unverifiedFields}get isTransferable(){var t;return"transferable"===o(this,sr).verifications.externalAccount.status&&(null==(t=o(this,sr).verifications.externalAccount.error)?void 0:t.code)==="external_account_exists"}get existingSession(){var t,e,i,n,r;if(("failed"===o(this,sr).verifications.externalAccount.status||"unverified"===o(this,sr).verifications.externalAccount.status)&&(null==(t=o(this,sr).verifications.externalAccount.error)?void 0:t.code)==="identifier_already_signed_in"&&(null==(i=o(this,sr).verifications.externalAccount.error)||null==(e=i.meta)?void 0:e.sessionId))return{sessionId:null==(r=o(this,sr).verifications.externalAccount.error)||null==(n=r.meta)?void 0:n.sessionId}}get hasBeenFinalized(){return o(this,sn)}async getCaptchaToken(){let t=new i4(si.clerk),e=await t.managedOrInvisible({action:"signup"});if(!e)throw Error("Captcha challenge failed");let{captchaError:i,captchaToken:n,captchaWidgetType:r}=e;return{captchaToken:n,captchaWidgetType:r,captchaError:i}}async _create(t){var e;let{captchaToken:i,captchaWidgetType:n,captchaError:r}=await this.getCaptchaToken(),s={transfer:t.transfer,captchaToken:i,captchaWidgetType:n,captchaError:r,...t,unsafeMetadata:t.unsafeMetadata?se(t.unsafeMetadata):void 0,locale:null!=(e=t.locale)?e:iE()};await o(this,sr).__internal_basePost({path:o(this,sr).pathRoot,body:s})}async create(t){return r4(o(this,sr),async()=>{await this._create(t)})}async update(t){return r4(o(this,sr),async()=>{let e={...t,unsafeMetadata:t.unsafeMetadata?se(t.unsafeMetadata):void 0};await o(this,sr).__internal_basePatch({path:o(this,sr).pathRoot,body:e})})}async password(t){return r4(o(this,sr),async()=>{let{captchaToken:e,captchaWidgetType:i,captchaError:n}=await this.getCaptchaToken(),r={strategy:"password",captchaToken:e,captchaWidgetType:i,captchaError:n,...t,unsafeMetadata:t.unsafeMetadata?se(t.unsafeMetadata):void 0};await o(this,sr).__internal_basePost({path:o(this,sr).pathRoot,body:r})})}async sendEmailCode(){return r4(o(this,sr),async()=>{await o(this,sr).__internal_basePost({body:{strategy:"email_code"},action:"prepare_verification"})})}async verifyEmailCode(t){let{code:e}=t;return r4(o(this,sr),async()=>{await o(this,sr).__internal_basePost({body:{strategy:"email_code",code:e},action:"attempt_verification"})})}async sendPhoneCode(t){let{phoneNumber:e,channel:i="sms"}=t;return r4(o(this,sr),async()=>{if(!o(this,sr).id){let{captchaToken:t,captchaWidgetType:i,captchaError:n}=await this.getCaptchaToken();await o(this,sr).__internal_basePost({path:o(this,sr).pathRoot,body:{phoneNumber:e,captchaToken:t,captchaWidgetType:i,captchaError:n}})}await o(this,sr).__internal_basePost({body:{strategy:"phone_code",channel:i},action:"prepare_verification"})})}async verifyPhoneCode(t){let{code:e}=t;return r4(o(this,sr),async()=>{await o(this,sr).__internal_basePost({body:{strategy:"phone_code",code:e},action:"attempt_verification"})})}async sso(t){let{strategy:e,redirectUrl:i,redirectCallbackUrl:n,unsafeMetadata:r,legalAccepted:s,oidcPrompt:a,enterpriseConnectionId:l,emailAddress:c,popup:u}=t;return r4(o(this,sr),async()=>{let{captchaToken:t,captchaWidgetType:h,captchaError:d}=await this.getCaptchaToken(),f=i;try{new URL(i)}catch{f=window.location.origin+i}let p={redirectUrl:si.clerk.buildUrlWithAuth(n),actionCompleteRedirectUrl:f};if(u){let t=r3(si.clerk,{redirectCallbackUrl:p.redirectUrl,redirectUrl:f});p.redirectUrl=t.redirectCallbackUrl,p.actionCompleteRedirectUrl=t.redirectUrl}let _=()=>o(this,sr).__internal_basePost({path:o(this,sr).pathRoot,body:{strategy:e,...p,unsafeMetadata:r,legalAccepted:s,oidcPrompt:a,enterpriseConnectionId:l,emailAddress:c,captchaToken:t,captchaWidgetType:h,captchaError:d}});await _().catch(async t=>{if(tU(t)&&tI(t))return await si.clerk.__internal_environment.reload(),_();throw t});let{status:g,externalVerificationRedirectURL:v}=o(this,sr).verifications.externalAccount;"unverified"===g&&v&&(u?(await r5(si.clerk,{popup:u,externalVerificationRedirectURL:v}),await o(this,sr).reload()):ez(v))})}async web3(t){let{strategy:e,unsafeMetadata:i,legalAccepted:n}=t,r=e.replace("web3_","").replace("_signature","");return r4(o(this,sr),async()=>{let t,s,a;switch(r){case"metamask":t=await iG().getMetamaskIdentifier(),s=iG().generateSignatureWithMetamask;break;case"coinbase_wallet":t=await iG().getCoinbaseWalletIdentifier(),s=iG().generateSignatureWithCoinbaseWallet;break;case"base":t=await iG().getBaseIdentifier(),s=iG().generateSignatureWithBase;break;case"okx_wallet":t=await iG().getOKXWalletIdentifier(),s=iG().generateSignatureWithOKXWallet;break;default:throw Error("Unsupported Web3 provider: ".concat(r))}let l=t||o(this,sr).web3wallet;await this._create({web3Wallet:l,unsafeMetadata:i,legalAccepted:n}),await o(this,sr).__internal_basePost({body:{strategy:e},action:"prepare_verification"});let{message:c}=o(this,sr).verifications.web3Wallet;c||iW("SignUp");try{a=await s({identifier:t,nonce:c})}catch(e){if("coinbase_wallet"===r&&4001===e.code)a=await s({identifier:t,nonce:c});else throw e}await o(this,sr).__internal_basePost({body:{signature:a,strategy:e},action:"attempt_verification"})})}async ticket(t){var e;let i=null!=(e=null==t?void 0:t.ticket)?e:ex("__clerk_ticket");return this.create({...t,ticket:null!=i?i:void 0})}async finalize(t){let{navigate:e}=t||{};return r4(o(this,sr),async()=>{if(!o(this,sr).createdSessionId)throw Error("Cannot finalize sign-up without a created session.");u(this,sn,!0),await si.clerk.setActive({session:o(this,sr).createdSessionId,navigate:e})})}constructor(t){(0,tn._)(this,"verifications",{sendEmailCode:this.sendEmailCode.bind(this),verifyEmailCode:this.verifyEmailCode.bind(this),sendPhoneCode:this.sendPhoneCode.bind(this),verifyPhoneCode:this.verifyPhoneCode.bind(this)}),c(this,sn,{writable:!0,value:!1}),c(this,sr,{writable:!0,value:void 0}),u(this,sr,t)}}class sa extends i7{fromJSON(t){return t&&(this.id=t.id,this.name=t.name),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"name",void 0),this.fromJSON(t)}}class so extends i7{static async create(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new so(await i7._fetch({body:e,method:"POST",path:t,search:i?"debug=skip_cache":void 0}),t)}fromJSON(t){return t&&(this.jwt=iU(t.jwt)),this}__internal_toSnapshot(){return{object:"token",id:this.id||"",jwt:this.getRawString()}}constructor(t,e){super(),(0,tn._)(this,"pathRoot","tokens"),(0,tn._)(this,"jwt",void 0),(0,tn._)(this,"getRawString",()=>{var t;return(null==(t=this.jwt)?void 0:t.claims.__raw)||""}),e&&(this.pathRoot=e),(null==t?void 0:t.jwt)&&(this.jwt=iU(t.jwt))}}class sl extends i7{fromJSON(t){return t&&(this.id=t.id,this.secret=t.secret,this.uri=t.uri,this.verified=t.verified,this.backupCodes=t.backup_codes,this.updatedAt=i8(t.updated_at),this.createdAt=i8(t.created_at)),this}constructor(t){super(),(0,tn._)(this,"pathRoot","/me"),(0,tn._)(this,"id",""),(0,tn._)(this,"secret",void 0),(0,tn._)(this,"uri",void 0),(0,tn._)(this,"verified",!1),(0,tn._)(this,"backupCodes",void 0),(0,tn._)(this,"updatedAt",null),(0,tn._)(this,"createdAt",null),this.fromJSON(t)}}class sc extends i7{fromJSON(t){return t&&(this.id=t.id,this.codes=t.codes,this.updatedAt=i8(t.updated_at),this.createdAt=i8(t.created_at)),this}constructor(t){super(),(0,tn._)(this,"pathRoot","/me"),(0,tn._)(this,"id",void 0),(0,tn._)(this,"codes",[]),(0,tn._)(this,"updatedAt",null),(0,tn._)(this,"createdAt",null),this.fromJSON(t)}}class su extends i7{static isUserResource(t){return!!t&&t instanceof su}path(){return this.pathRoot}get verifiedExternalAccounts(){return this.externalAccounts.filter(t=>{var e;return(null==(e=t.verification)?void 0:e.status)=="verified"})}get unverifiedExternalAccounts(){return this.externalAccounts.filter(t=>{var e;return(null==(e=t.verification)?void 0:e.status)!="verified"})}get verifiedWeb3Wallets(){return this.web3Wallets.filter(t=>{var e;return(null==(e=t.verification)?void 0:e.status)=="verified"})}get hasVerifiedEmailAddress(){return this.emailAddresses.filter(t=>"verified"===t.verification.status).length>0}get hasVerifiedPhoneNumber(){return this.phoneNumbers.filter(t=>"verified"===t.verification.status).length>0}fromJSON(t){return t&&(this.id=t.id,this.externalId=t.external_id||null,this.firstName=t.first_name||null,this.lastName=t.last_name||null,(this.firstName||this.lastName)&&(this.fullName=(t=>{let{firstName:e,lastName:i,name:n}=t;return n||[e,i].join(" ").trim()||""})({firstName:this.firstName,lastName:this.lastName})),this.imageUrl=t.image_url||"",this.hasImage=t.has_image||!1,this.username=t.username||null,this.passwordEnabled=t.password_enabled||!1,this.emailAddresses=(t.email_addresses||[]).map(t=>new n9(t,this.path()+"/email_addresses")),this.primaryEmailAddressId=t.primary_email_address_id||null,this.primaryEmailAddress=this.emailAddresses.find(t=>{let{id:e}=t;return e===this.primaryEmailAddressId})||null,this.phoneNumbers=(t.phone_numbers||[]).map(t=>new rL(t,this.path()+"/phone_numbers")),this.primaryPhoneNumberId=t.primary_phone_number_id||null,this.primaryPhoneNumber=this.phoneNumbers.find(t=>{let{id:e}=t;return e===this.primaryPhoneNumberId})||null,this.web3Wallets=(t.web3_wallets||[]).map(t=>new s_(t,this.path()+"/web3_wallets")),this.primaryWeb3WalletId=t.primary_web3_wallet_id||null,this.primaryWeb3Wallet=this.web3Wallets.find(t=>{let{id:e}=t;return e===this.primaryWeb3WalletId})||null,this.externalAccounts=(t.external_accounts||[]).map(t=>new rA(t,this.path()+"/external_accounts")),this.passkeys=(t.passkeys||[]).map(t=>new rD(t)),this.organizationMemberships=(t.organization_memberships||[]).map(t=>new rM(t)),this.enterpriseAccounts=(t.enterprise_accounts||[]).map(t=>new rp(t,this.path()+"/enterprise_accounts")),this.publicMetadata=t.public_metadata||{},this.unsafeMetadata=t.unsafe_metadata||{},this.totpEnabled=t.totp_enabled||!1,this.backupCodeEnabled=t.backup_code_enabled||!1,this.twoFactorEnabled=t.two_factor_enabled||!1,this.createOrganizationEnabled=t.create_organization_enabled||!1,this.createOrganizationsLimit=t.create_organizations_limit||null,this.deleteSelfEnabled=t.delete_self_enabled||!1,t.last_sign_in_at&&(this.lastSignInAt=i8(t.last_sign_in_at)),t.legal_accepted_at&&(this.legalAcceptedAt=i8(t.legal_accepted_at)),this.updatedAt=i8(t.updated_at||void 0),this.createdAt=i8(t.created_at||void 0)),this}__internal_toSnapshot(){var t,e,i,n;return{object:"user",id:this.id,external_id:this.externalId,first_name:this.firstName,last_name:this.lastName,username:this.username,public_metadata:this.publicMetadata,unsafe_metadata:this.unsafeMetadata,image_url:this.imageUrl,has_image:this.hasImage,email_addresses:this.emailAddresses.map(t=>t.__internal_toSnapshot()),phone_numbers:this.phoneNumbers.map(t=>t.__internal_toSnapshot()),web3_wallets:this.web3Wallets.map(t=>t.__internal_toSnapshot()),external_accounts:this.externalAccounts.map(t=>t.__internal_toSnapshot()),passkeys:this.passkeys.map(t=>t.__internal_toSnapshot()),organization_memberships:this.organizationMemberships.map(t=>t.__internal_toSnapshot()),enterprise_accounts:this.enterpriseAccounts.map(t=>t.__internal_toSnapshot()),totp_enabled:this.totpEnabled,backup_code_enabled:this.backupCodeEnabled,two_factor_enabled:this.twoFactorEnabled,create_organization_enabled:this.createOrganizationEnabled,create_organizations_limit:this.createOrganizationsLimit,delete_self_enabled:this.deleteSelfEnabled,primary_email_address_id:this.primaryEmailAddressId,primary_phone_number_id:this.primaryPhoneNumberId,primary_web3_wallet_id:this.primaryWeb3WalletId,password_enabled:this.passwordEnabled,profile_image_id:this.imageUrl,last_sign_in_at:(null==(t=this.lastSignInAt)?void 0:t.getTime())||null,legal_accepted_at:(null==(e=this.legalAcceptedAt)?void 0:e.getTime())||null,updated_at:(null==(i=this.updatedAt)?void 0:i.getTime())||null,created_at:(null==(n=this.createdAt)?void 0:n.getTime())||null}}constructor(t){super(),(0,tn._)(this,"pathRoot","/me"),(0,tn._)(this,"id",""),(0,tn._)(this,"externalId",null),(0,tn._)(this,"username",null),(0,tn._)(this,"emailAddresses",[]),(0,tn._)(this,"phoneNumbers",[]),(0,tn._)(this,"web3Wallets",[]),(0,tn._)(this,"externalAccounts",[]),(0,tn._)(this,"enterpriseAccounts",[]),(0,tn._)(this,"passkeys",[]),(0,tn._)(this,"organizationMemberships",[]),(0,tn._)(this,"passwordEnabled",!1),(0,tn._)(this,"firstName",null),(0,tn._)(this,"lastName",null),(0,tn._)(this,"fullName",null),(0,tn._)(this,"primaryEmailAddressId",null),(0,tn._)(this,"primaryEmailAddress",null),(0,tn._)(this,"primaryPhoneNumberId",null),(0,tn._)(this,"primaryPhoneNumber",null),(0,tn._)(this,"primaryWeb3WalletId",null),(0,tn._)(this,"primaryWeb3Wallet",null),(0,tn._)(this,"imageUrl",""),(0,tn._)(this,"hasImage",!1),(0,tn._)(this,"twoFactorEnabled",!1),(0,tn._)(this,"totpEnabled",!1),(0,tn._)(this,"backupCodeEnabled",!1),(0,tn._)(this,"publicMetadata",{}),(0,tn._)(this,"unsafeMetadata",{}),(0,tn._)(this,"createOrganizationEnabled",!1),(0,tn._)(this,"createOrganizationsLimit",null),(0,tn._)(this,"deleteSelfEnabled",!1),(0,tn._)(this,"lastSignInAt",null),(0,tn._)(this,"legalAcceptedAt",null),(0,tn._)(this,"updatedAt",null),(0,tn._)(this,"createdAt",null),(0,tn._)(this,"cachedSessionsWithActivities",null),(0,tn._)(this,"isPrimaryIdentification",t=>{switch(t.constructor){case n9:return this.primaryEmailAddressId===t.id;case rL:return this.primaryPhoneNumberId===t.id;case s_:return this.primaryWeb3WalletId===t.id;default:return!1}}),(0,tn._)(this,"createEmailAddress",t=>{let{email:e}=t||{};return new n9({email_address:e},this.path()+"/email_addresses/").create()}),(0,tn._)(this,"createPasskey",()=>rD.registerPasskey()),(0,tn._)(this,"createPhoneNumber",t=>{let{phoneNumber:e}=t||{};return new rL({phone_number:e},this.path()+"/phone_numbers/").create()}),(0,tn._)(this,"createWeb3Wallet",t=>{let{web3Wallet:e}=t||{};return new s_({web3_wallet:e},this.path()+"/web3_wallets/").create()}),(0,tn._)(this,"createExternalAccount",async t=>{var e;let{strategy:i,redirectUrl:n,additionalScopes:r}=t||{};return new rA(null==(e=await i7._fetch({path:"/me/external_accounts",method:"POST",body:{strategy:i,redirect_url:n,additional_scope:r}}))?void 0:e.response,this.path()+"/external_accounts")}),(0,tn._)(this,"createTOTP",async()=>{var t;return new sl(null==(t=await i7._fetch({path:"/me/totp",method:"POST"}))?void 0:t.response)}),(0,tn._)(this,"verifyTOTP",async t=>{var e;let{code:i}=t;return new sl(null==(e=await i7._fetch({path:"/me/totp/attempt_verification",method:"POST",body:{code:i}}))?void 0:e.response)}),(0,tn._)(this,"disableTOTP",async()=>{var t;return new n2(null==(t=await i7._fetch({path:"/me/totp",method:"DELETE"}))?void 0:t.response)}),(0,tn._)(this,"createBackupCode",async()=>{var t;return new sc(null==(t=await i7._fetch({path:this.path()+"/backup_codes/",method:"POST"}))?void 0:t.response)}),(0,tn._)(this,"update",t=>this._basePatch({body:se(t)})),(0,tn._)(this,"updatePassword",t=>this._basePost({body:t,path:"".concat(this.path(),"/change_password")})),(0,tn._)(this,"removePassword",t=>this._basePost({body:t,path:"".concat(this.path(),"/remove_password")})),(0,tn._)(this,"delete",()=>this._baseDelete({path:"/me"}).then(t=>(rw.emit(rv,null),t))),(0,tn._)(this,"getSessions",async()=>{if(this.cachedSessionsWithActivities)return this.cachedSessionsWithActivities;let t=await rZ.retrieve();return this.cachedSessionsWithActivities=t,t}),(0,tn._)(this,"setProfileImage",t=>{let{file:e}=t||{};return null===e?rU.delete("".concat(this.path(),"/profile_image")):rU.create("".concat(this.path(),"/profile_image"),{file:e})}),(0,tn._)(this,"getOrganizationInvitations",t=>sd.retrieve(t)),(0,tn._)(this,"getOrganizationSuggestions",t=>rN.retrieve(t)),(0,tn._)(this,"getOrganizationMemberships",t=>rM.retrieve(t)),(0,tn._)(this,"leaveOrganization",async t=>{var e;return new n2(null==(e=await i7._fetch({path:"".concat(this.path(),"/organization_memberships/").concat(t),method:"DELETE"}))?void 0:e.response)}),(0,tn._)(this,"initializePaymentMethod",t=>nL(t)),(0,tn._)(this,"addPaymentMethod",t=>nj(t)),(0,tn._)(this,"getPaymentMethods",t=>nB(t)),this.fromJSON(t)}}class sh{fromJSON(t){if(t){var e,i;this.firstName=t.first_name,this.lastName=t.last_name,this.imageUrl=null!=(e=t.image_url)?e:void 0,this.hasImage=null!=(i=t.has_image)?i:void 0}return this}__internal_toSnapshot(){return{first_name:this.firstName,last_name:this.lastName,image_url:this.imageUrl||null,has_image:this.hasImage||null}}constructor(t){(0,tn._)(this,"firstName",void 0),(0,tn._)(this,"lastName",void 0),(0,tn._)(this,"imageUrl",void 0),(0,tn._)(this,"hasImage",void 0),this.fromJSON(t)}}class sd extends i7{static async retrieve(t){return await i7._fetch({path:"/me/organization_invitations",method:"GET",search:nS(t)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new sd(t))}})}fromJSON(t){return t&&(this.id=t.id,this.emailAddress=t.email_address,this.publicOrganizationData={hasImage:t.public_organization_data.has_image,imageUrl:t.public_organization_data.image_url,name:t.public_organization_data.name,id:t.public_organization_data.id,slug:t.public_organization_data.slug},this.publicMetadata=t.public_metadata,this.role=t.role,this.status=t.status,this.createdAt=i8(t.created_at),this.updatedAt=i8(t.updated_at)),this}constructor(t){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"emailAddress",void 0),(0,tn._)(this,"publicOrganizationData",void 0),(0,tn._)(this,"publicMetadata",{}),(0,tn._)(this,"status",void 0),(0,tn._)(this,"role",void 0),(0,tn._)(this,"createdAt",void 0),(0,tn._)(this,"updatedAt",void 0),(0,tn._)(this,"accept",async()=>await this._basePost({path:"/me/organization_invitations/".concat(this.id,"/accept")})),this.fromJSON(t)}}let sf={enabled:!1,first_factors:[],name:"phone_number",required:!1,second_factors:[],used_for_first_factor:!1,used_for_second_factor:!1,verifications:[],verify_at_sign_up:!1};class sp extends i7{get authenticatableSocialStrategies(){return this.social?Object.entries(this.social).filter(t=>{let[,e]=t;return e.enabled&&e.authenticatable}).map(t=>{let[,e]=t;return e.strategy}).sort():[]}get enabledFirstFactorIdentifiers(){return this.attributes?Object.entries(this.attributes).filter(t=>{let[e,i]=t;return i.used_for_first_factor&&!e.startsWith("web3")}).map(t=>{let[e]=t;return e}):[]}get socialProviderStrategies(){return this.social?Object.entries(this.social).filter(t=>{let[,e]=t;return e.enabled}).map(t=>{let[,e]=t;return e.strategy}).sort():[]}get web3FirstFactors(){return this.attributes?Object.entries(this.attributes).filter(t=>{let[e,i]=t;return i.used_for_first_factor&&e.startsWith("web3")}).map(t=>{let[,e]=t;return e.first_factors}).flat():[]}get alternativePhoneCodeChannels(){return this.attributes?Object.entries(this.attributes).filter(t=>{let[e,i]=t;return i.used_for_first_factor&&"phone_number"===e}).map(t=>{var e;let[,i]=t;return(null==i||null==(e=i.channels)?void 0:e.filter(t=>"sms"!==t))||[]}).flat():[]}get instanceIsPasswordBased(){var t,e,i;return!!((null==(e=this.attributes)||null==(t=e.password)?void 0:t.enabled)&&(null==(i=this.attributes.password)?void 0:i.required))}get hasValidAuthFactor(){var t,e,i,n,r,s;return!!((null==(e=this.attributes)||null==(t=e.email_address)?void 0:t.enabled)||(null==(n=this.attributes)||null==(i=n.phone_number)?void 0:i.enabled)||(null==(r=this.attributes.password)?void 0:r.required)&&(null==(s=this.attributes.username)?void 0:s.required))}fromJSON(t){var e,i,n,r,s,a,o,l,c;return t&&(this.attributes=this.withDefault(t.attributes?Object.fromEntries(Object.entries(t.attributes).map(t=>[t[0],{...t[1],name:t[0]}])):null,this.attributes),this.actions=this.withDefault(t.actions,this.actions),this.enterpriseSSO=this.withDefault(t.enterprise_sso,this.enterpriseSSO),this.passkeySettings=this.withDefault(t.passkey_settings,this.passkeySettings),this.passwordSettings=t.password_settings?{...t.password_settings,min_length:Math.max(null!=(a=null==(e=t.password_settings)?void 0:e.min_length)?a:8,8),max_length:(null==(i=t.password_settings)?void 0:i.max_length)===0?72:Math.min(null!=(o=null==(n=t.password_settings)?void 0:n.max_length)?o:72,72)}:this.passwordSettings,this.signIn=this.withDefault(t.sign_in,this.signIn),this.signUp=this.withDefault(t.sign_up,this.signUp),this.social=this.withDefault(t.social,this.social),this.usernameSettings=t.username_settings?{...t.username_settings,min_length:Math.max(null!=(l=null==(r=t.username_settings)?void 0:r.min_length)?l:4,4),max_length:Math.min(null!=(c=null==(s=t.username_settings)?void 0:s.max_length)?c:64,64)}:this.usernameSettings),this}__internal_toSnapshot(){return{actions:this.actions,attributes:this.attributes,passkey_settings:this.passkeySettings,password_settings:this.passwordSettings,sign_in:this.signIn,sign_up:this.signUp,social:this.social}}constructor(t=null){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"actions",{create_organization:!1,delete_self:!1}),(0,tn._)(this,"attributes",{email_address:{enabled:!0,first_factors:["email_code"],name:"email_address",required:!0,second_factors:[],used_for_first_factor:!0,used_for_second_factor:!1,verifications:["email_code"],verify_at_sign_up:!0},phone_number:{...sf,name:"phone_number"},username:{...sf,name:"username"},web3_wallet:{...sf,name:"web3_wallet"},first_name:{...sf,name:"first_name"},last_name:{...sf,name:"last_name"},password:{enabled:!0,first_factors:[],name:"password",required:!0,second_factors:[],used_for_first_factor:!1,used_for_second_factor:!1,verifications:[],verify_at_sign_up:!1},authenticator_app:{...sf,name:"authenticator_app"},backup_code:{...sf,name:"backup_code"},passkey:{...sf,name:"passkey"}}),(0,tn._)(this,"enterpriseSSO",{enabled:!1}),(0,tn._)(this,"passkeySettings",{allow_autofill:!1,show_sign_in_button:!1}),(0,tn._)(this,"passwordSettings",{}),(0,tn._)(this,"signIn",{second_factor:{required:!1,enabled:!1}}),(0,tn._)(this,"signUp",{allowlist_only:!1,captcha_enabled:!1,legal_consent_enabled:!1,mode:"public",progressive:!0}),(0,tn._)(this,"social",{}),(0,tn._)(this,"usernameSettings",{}),this.fromJSON(t)}}class s_ extends i7{create(){return this._basePost({body:{web3_wallet:this.web3Wallet}})}destroy(){return this._baseDelete()}toString(){return this.web3Wallet}fromJSON(t){return t&&(this.id=t.id,this.web3Wallet=t.web3_wallet,this.verification=new ru(t.verification)),this}__internal_toSnapshot(){return{object:"web3_wallet",id:this.id,web3_wallet:this.web3Wallet,verification:this.verification.__internal_toSnapshot()}}constructor(t,e){super(),(0,tn._)(this,"id",void 0),(0,tn._)(this,"web3Wallet",""),(0,tn._)(this,"verification",void 0),(0,tn._)(this,"prepareVerification",t=>this._basePost({action:"prepare_verification",body:{...t}})),(0,tn._)(this,"attemptVerification",t=>{let{signature:e}=t;return this._basePost({action:"attempt_verification",body:{signature:e}})}),this.pathRoot=e,this.fromJSON(t)}}class sg extends i7{fromJSON(t){return t&&(this.id=t.id,this.updatedAt=i8(t.updated_at),this.createdAt=i8(t.created_at)),this}static async join(t){var e;return new sg(null==(e=await i7._fetch({path:"/waitlist",method:"POST",body:t}))?void 0:e.response)}constructor(t){super(),(0,tn._)(this,"pathRoot","/waitlist"),(0,tn._)(this,"id",""),(0,tn._)(this,"updatedAt",null),(0,tn._)(this,"createdAt",null),this.fromJSON(t)}}function sv(t,e){var i,n,r,s;return t.id!==e.id||t.updatedAt.getTime()<e.updatedAt.getTime()||(i=e,n=t,i.organizationMemberships.length!==n.organizationMemberships.length||(null==(r=i.organizationMemberships[0])?void 0:r.updatedAt)!==(null==(s=n.organizationMemberships[0])?void 0:s.updatedAt))}function sm(t,e){return!function(t,e){if(!t&&e||t&&!e)return!0;if(!t&&t===e)return!1;if(!t||!e)return!0;try{var i,n,r,s,a,o,l,c;if(n0.isClientResource(t))return t.id!==e.id||t.updatedAt.getTime()<e.updatedAt.getTime()||t.sessions.length!==e.sessions.length;if(rX.isSessionResource(t)){return t.id!==e.id||t.updatedAt.getTime()<e.updatedAt.getTime()||(null==(r=t.lastActiveToken)||null==(n=r.jwt)||null==(i=n.claims)?void 0:i.__raw)!==(null==(o=e.lastActiveToken)||null==(a=o.jwt)||null==(s=a.claims)?void 0:s.__raw)||function(t,e){var i,n,r,s,a,o;if(t.lastActiveOrganizationId!==e.lastActiveOrganizationId)return!0;let l=null==(n=t.user)||null==(i=n.organizationMemberships)?void 0:i.find(e=>e.organization.id===t.lastActiveOrganizationId),c=null==(s=e.user)||null==(r=s.organizationMemberships)?void 0:r.find(e=>e.organization.id===t.lastActiveOrganizationId);return(null==l||null==(a=l.permissions)?void 0:a.length)!==(null==c||null==(o=c.permissions)?void 0:o.length)}(t,e)||(l=t,c=e,!!l.user!=!!c.user||!!l.user&&!!c.user&&sv(l.user,c.user))}if(su.isUserResource(t))return sv(t,e)}catch{}return!0}(t,e)?t:e}let sy="__clerk_db_jwt";function sw(t,e){let i=new URL(t),n=i.searchParams.get(sy);i.searchParams.delete(sy);let r=n||e;return r&&i.searchParams.set(sy,r),i}let sb=t=>{let e=new URL(t);return e.searchParams.delete(sy),e},sk=t=>{let e=new URL(t);return e.searchParams.delete("__dev_session"),e.hash=decodeURI(e.hash).replace(/__clerk_db_jwt\[(.*)\]/,""),e.href.endsWith("#")&&(e.hash=""),e};function sS(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}var sA=function t(e,i){function n(t,n,r){if("undefined"!=typeof document){"number"==typeof(r=sS({},i,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in r)r[a]&&(s+="; "+a,!0!==r[a]&&(s+="="+r[a].split(";")[0]));return document.cookie=t+"="+e.write(n,t)+s}}return Object.create({set:n,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var i=document.cookie?document.cookie.split("; "):[],n={},r=0;r<i.length;r++){var s=i[r].split("="),a=s.slice(1).join("=");try{var o=decodeURIComponent(s[0]);if(n[o]=e.read(a,o),t===o)break}catch(t){}}return t?n[t]:n}},remove:function(t,e){n(t,"",sS({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,sS({},this.attributes,e))},withConverter:function(e){return t(sS({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function sI(t){return{get:()=>sA.get(t),set(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};sA.set(t,e,i)},remove(e){sA.remove(t,e)}}}let sx=t=>"https:"===window.location.protocol||"None"===t&&void 0===window.safari&&(void 0!==window.isSecureContext?window.isSecureContext:"localhost"===window.location.hostname);function sU(t,e){let i=function(t){try{return new Date(t||new Date)}catch{return new Date}}(t);return i.setFullYear(i.getFullYear()+e),i}let sE=sI("__clerk_test_etld"),sP="__client_uat",sC="__session",sO=()=>{let t=iC()?"None":"Lax",e=sx(t);return{sameSite:t,secure:e,partitioned:!1}};async function sT(t){let e;try{e=await tH(t)}catch(o){var i;i="Suffixed cookie failed due to ".concat(o.message," (secure-context: ").concat(window.isSecureContext,", url: ").concat(window.location.href,")"),tX.has(i)||(console.log(i),tX.add(i));let{default:n}=await Promise.all([s.e("545"),s.e("811")]).then(s.t.bind(s,180,23)),{default:r}=await Promise.all([s.e("545"),s.e("811")]).then(s.t.bind(s,3413,23)),a=n(t);e=r.stringify(a).replace(/\+/gi,"-").replace(/\//gi,"_").substring(0,8)}return e}let sR=()=>{let t=iC()?"None":"Lax",e=sx(t);return{sameSite:t,secure:e}};var sM=s(8326),sN=s.n(sM);class sz{startPollingForSessionToken(t){if(this.timerId||this.initiated)return;let e=async()=>{this.initiated=!0,await this.lock.acquireLockAndRun(t),this.timerId=this.workerTimers.setTimeout(e,5e3)};e()}stopPollingForSessionToken(){null!=this.timerId&&(this.workerTimers.clearTimeout(this.timerId),this.timerId=null),this.initiated=!1}constructor(){(0,tn._)(this,"lock",function(t){let e=new(sN());return window.addEventListener("beforeunload",async()=>{await e.releaseLock(t)}),{acquireLockAndRun:async i=>{if("locks"in navigator&&isSecureContext){let e=new AbortController,n=setTimeout(()=>e.abort(),4999);return await navigator.locks.request(t,{signal:e.signal},async()=>(clearTimeout(n),await i())).catch(()=>!1)}if(await e.acquireLock(t,5e3))try{return await i()}finally{await e.releaseLock(t)}}}}("clerk.lock.refreshSessionToken")),(0,tn._)(this,"workerTimers",n7()),(0,tn._)(this,"timerId",null),(0,tn._)(this,"initiated",!1)}}class sW{static async create(t,e,i,n){let r=await sT(t.publishableKey),s=new sW(t,e,r,i,n);return await s.setup(),s}async setup(){return"production"===this.instanceType?this.setupProduction():this.setupDevelopment()}isSignedOut(){return this.clerk.loaded?!!this.clerk.user:0>=this.clientUat.get()}async handleUnauthenticatedDevBrowser(){this.devBrowser.clear(),await this.devBrowser.setup()}decorateUrlWithDevBrowserToken(t){let e=this.devBrowser.getDevBrowserJWT();if(!e)throw Error("".concat(iT," Missing dev browser jwt. Please contact support."));return sw(t,e)}async setupDevelopment(){await this.devBrowser.setup()}setupProduction(){this.devBrowser.clear()}startPollingForToken(){this.poller||(this.poller=new sz,this.poller.startPollingForSessionToken(()=>this.refreshSessionToken()))}stopPollingForToken(){this.poller&&(this.poller.stopPollingForSessionToken(),this.poller=null)}refreshTokenOnFocus(){window.addEventListener("focus",()=>{"visible"===document.visibilityState&&this.refreshSessionToken({updateCookieImmediately:!0})})}async refreshSessionToken(){let{updateCookieImmediately:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.clerk.session)try{let e=await this.clerk.session.getToken();t&&this.updateSessionCookie(e)}catch(t){return this.handleGetTokenError(t)}}updateSessionCookie(t){if(document.hasFocus()||this.isCurrentContextActive()){if(!t&&!tl()){var e;id.warn("Removing session cookie (offline)",{sessionId:null==(e=this.clerk.session)?void 0:e.id},"authCookieService")}return this.setActiveContextInStorage(),t?this.sessionCookie.set(t):this.sessionCookie.remove()}}setClientUatCookieForDevelopmentInstances(){"production"!==this.instanceType&&this.inCustomDevelopmentDomain()&&this.clientUat.set(this.clerk.client)}inCustomDevelopmentDomain(){let t=this.clerk.frontendApi.replace("clerk.","");return!window.location.host.endsWith(t)}handleGetTokenError(t){if(tU(t)||tE(t)||("".concat(t.message).concat(t.name)||"").toLowerCase().replace(/\s+/g,"").includes("networkerror")){if(tx(t))return void this.clerk.handleUnauthenticated().catch(is.lQ);this.clerkEventBus.emit(tf,"degraded")}}handleSignOut(){this.activeCookie.remove(),this.sessionCookie.remove(),this.setClientUatCookieForDevelopmentInstances()}setActiveContextInStorage(){var t,e;let i=(null==(t=this.clerk.session)?void 0:t.id)||"",n=(null==(e=this.clerk.organization)?void 0:e.id)||"",r="".concat(i,":").concat(n);":"!==r?this.activeCookie.set(r):this.activeCookie.remove()}isCurrentContextActive(){var t,e;let i=this.activeCookie.get();if(!i)return!0;let[n,r]=i.split(":"),s=(null==(t=this.clerk.session)?void 0:t.id)||"",a=(null==(e=this.clerk.organization)?void 0:e.id)||"";return n===s&&r===a}getSessionCookie(){return this.sessionCookie.get()}constructor(t,e,n,r,s){(0,tn._)(this,"clerk",void 0),(0,tn._)(this,"instanceType",void 0),(0,tn._)(this,"clerkEventBus",void 0),(0,tn._)(this,"poller",void 0),(0,tn._)(this,"clientUat",void 0),(0,tn._)(this,"sessionCookie",void 0),(0,tn._)(this,"activeCookie",void 0),(0,tn._)(this,"devBrowser",void 0),this.clerk=t,this.instanceType=r,this.clerkEventBus=s,this.poller=null,rw.on(rg,t=>{let{token:e}=t;this.updateSessionCookie(e&&e.getRawString()),this.setClientUatCookieForDevelopmentInstances()}),rw.on(rv,()=>this.handleSignOut()),this.refreshTokenOnFocus(),this.startPollingForToken(),this.clientUat=(t=>{let e=sI(sP),n=sI(tG(sP,t));return{set:t=>{let r=sU(Date.now(),1),s=iC()?"None":"Strict",a=sx(s),o=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.hostname,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sE;if(i)return i;if(["localhost","127.0.0.1","0.0.0.0"].includes(t))return t;let n=t.split(".");if(1===n.length)return t;for(let t=n.length-2;t>=0;t--){let r=n.slice(t).join(".");if(e.set("1",{domain:r}),"1"===e.get())return e.remove({domain:r}),i=r,r;e.remove({domain:r})}}(),l="0";t&&t.updatedAt&&t.signedInSessions.length>0&&(l=Math.floor(t.updatedAt.getTime()/1e3).toString()),n.remove(),e.remove(),n.set(l,{domain:o,expires:r,partitioned:!1,sameSite:s,secure:a}),e.set(l,{domain:o,expires:r,partitioned:!1,sameSite:s,secure:a})},get:()=>parseInt(n.get()||e.get()||"0",10)}})(n),this.sessionCookie=(t=>{let e=sI(sC),i=sI(tG(sC,t)),n=()=>{let t=sO();e.remove(t),i.remove(t)};return{set:t=>{let r=sU(Date.now(),1),{sameSite:s,secure:a,partitioned:o}=sO();o&&n(),e.set(t,{expires:r,sameSite:s,secure:a,partitioned:o}),i.set(t,{expires:r,sameSite:s,secure:a,partitioned:o})},remove:n,get:()=>i.get()||e.get()}})(n),this.activeCookie=(()=>{let t=sI("clerk_active_context"),e={secure:sx("None")};return{set:i=>{t.set(i,e)},get:()=>t.get(),remove:()=>t.remove(e)}})(),this.devBrowser=function(t){let e,i,{cookieSuffix:n,frontendApi:r,fapiClient:s}=t,a=(e=sI(sy),i=sI(tG(sy,n)),{get:()=>i.get()||e.get(),set:t=>{let n=sU(Date.now(),1),{sameSite:r,secure:s}=sR();i.set(t,{expires:n,sameSite:r,secure:s}),e.set(t,{expires:n,sameSite:r,secure:s})},remove:()=>{let t=sR();i.remove(t),e.remove(t)}});function o(){return a.get()}function l(t){a.set(t)}function c(){a.remove()}return{clear:function(){c()},setup:async function(){var t;let e;if(!ee(r))return;s.onBeforeRequest(t=>{let e=o();e&&(null==t?void 0:t.url)&&(t.url=sw(t.url,e))}),s.onAfterResponse((t,e)=>{var i;let n=null==e||null==(i=e.headers)?void 0:i.get("Clerk-Db-Jwt");n&&l(n)});let i=(e=(t=new URL(window.location.href)).searchParams.get(sy)||"",sb(sk(t)).href!==t.href&&void 0!==globalThis.history&&globalThis.history.replaceState(null,"",sb(sk(t))),e);if(i)return void l(i);if(a.get())return;let n=s.buildUrl({path:"/dev_browser"}),c=await fetch(n.toString(),{method:"POST"});if(!c.ok){let t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.length>0?t.map(t=>new tg(t)):[]}((await c.json()).errors);t[0]?iR(t[0].longMessage):iR()}let u=await c.json();l(null==u?void 0:u.id)},getDevBrowserJWT:o,setDevBrowserJWT:l,removeDevBrowserJWT:c}}({frontendApi:t.frontendApi,fapiClient:e,cookieSuffix:n})}}class sF{async start(){this.isEnabled()&&(await this.challengeAndSend(),this.timers.setInterval(()=>{this.challengeAndSend()},this.intervalInMs()))}async challengeAndSend(){if(!(!this.clerk.client||this.clientBypass()))try{let t=await this.captchaChallenge.invisible({action:"heartbeat"});await this.clerk.client.__internal_sendCaptchaToken(t)}catch{}}isEnabled(){var t,e;return!!(null==(e=this.clerk.__internal_environment)||null==(t=e.displayConfig)?void 0:t.captchaHeartbeat)}clientBypass(){var t;return null==(t=this.clerk.client)?void 0:t.captchaBypass}intervalInMs(){var t,e,i;return null!=(i=null==(e=this.clerk.__internal_environment)||null==(t=e.displayConfig)?void 0:t.captchaHeartbeatIntervalMs)?i:6e5}constructor(t,e=new i4(t),i=n7()){(0,tn._)(this,"clerk",void 0),(0,tn._)(this,"captchaChallenge",void 0),(0,tn._)(this,"timers",void 0),this.clerk=t,this.captchaChallenge=e,this.timers=i}}let sD=["/client","/waitlist"];class sL{async getBaseFapiProxyOptions(){var t;let e=await (null==(t=i7.clerk.session)?void 0:t.getToken());if(!e)throw new tk("No valid session token available",{code:"no_session_token"});return{pathPrefix:"",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},credentials:"same-origin"}}async getAll(t){var e,i,n,r,s,a;return i7._fetch({...await this.getBaseFapiProxyOptions(),method:"GET",path:"/api_keys",search:nS({...t,subject:null!=(s=null!=(r=null!=(n=null==t?void 0:t.subject)?n:null==(e=i7.clerk.organization)?void 0:e.id)?r:null==(i=i7.clerk.user)?void 0:i.id)?s:"",query:null!=(a=null==t?void 0:t.query)?a:""})}).then(t=>{let{data:e,total_count:i}=t;return{total_count:i,data:e.map(t=>new i9(t))}})}async create(t){var e,i,n,r,s;return new i9(await i7._fetch({...await this.getBaseFapiProxyOptions(),path:"/api_keys",method:"POST",body:JSON.stringify({type:"api_key",name:t.name,subject:null!=(s=null!=(r=null!=(n=t.subject)?n:null==(e=i7.clerk.organization)?void 0:e.id)?r:null==(i=i7.clerk.user)?void 0:i.id)?s:"",description:t.description,seconds_until_expiration:t.secondsUntilExpiration})}))}async revoke(t){return new i9(await i7._fetch({...await this.getBaseFapiProxyOptions(),method:"POST",path:"/api_keys/".concat(t.apiKeyID,"/revoke"),body:JSON.stringify({revocation_reason:t.revocationReason})}))}}let sj=new Map;var sB=new WeakMap;class sV{load(t){let e=null==t?void 0:t.protectConfig;if(!(!(null==e?void 0:e.loaders)||!Array.isArray(e.loaders)||0===e.loaders.length||o(this,sB))){if(tr())for(let t of(u(this,sB,!0),e.loaders))try{this.applyLoader(t)}catch(t){tQ("[protect] failed to apply loader: ".concat(t))}}}applyLoader(t){if(void 0!==t.rollout){let e=t.rollout;if("number"!=typeof e||e<0)return void tQ("[protect] loader rollout value is invalid: ".concat(e));if(0===e||Math.random()>e)return}let e=t.type||"script",i=t.target||"body",n=document.createElement(e);if(t.attributes)for(let[e,i]of Object.entries(t.attributes))switch(typeof i){case"string":case"number":case"boolean":n.setAttribute(e,String(i));break;default:tQ("[protect] loader attribute is invalid type: ".concat(e,"=").concat(i))}switch(t.textContent&&"string"==typeof t.textContent&&(n.textContent=t.textContent),i){case"head":document.head.appendChild(n);break;case"body":document.body.appendChild(n);break;default:if(null==i?void 0:i.startsWith("#")){let t=document.getElementById(i.substring(1));if(!t)return void tQ("[protect] loader target element not found: ".concat(i));t.appendChild(n);return}tQ("[protect] loader target is invalid: ".concat(i))}}constructor(){c(this,sB,{writable:!0,value:!1})}}class sJ{constructor(){(0,tn._)(this,"signInResourceSignal",nx),(0,tn._)(this,"signInErrorSignal",nU),(0,tn._)(this,"signInFetchSignal",nE),(0,tn._)(this,"signInSignal",nP),(0,tn._)(this,"signUpResourceSignal",nC),(0,tn._)(this,"signUpErrorSignal",nO),(0,tn._)(this,"signUpFetchSignal",nT),(0,tn._)(this,"signUpSignal",nR),(0,tn._)(this,"__internal_effect",n_),(0,tn._)(this,"__internal_computed",np),(0,tn._)(this,"onResourceError",t=>{t.resource instanceof r7&&this.signInErrorSignal({error:t.error}),t.resource instanceof si&&this.signUpErrorSignal({error:t.error})}),(0,tn._)(this,"onResourceUpdated",t=>{if(t.resource instanceof r7){if(sK(this.signInResourceSignal().resource,t.resource))return;this.signInResourceSignal({resource:t.resource})}if(t.resource instanceof si){if(sK(this.signUpResourceSignal().resource,t.resource))return;this.signUpResourceSignal({resource:t.resource})}}),(0,tn._)(this,"onResourceFetch",t=>{t.resource instanceof r7&&this.signInFetchSignal({status:t.status}),t.resource instanceof si&&this.signUpFetchSignal({status:t.status})}),rw.on("resource:update",this.onResourceUpdated),rw.on("resource:error",this.onResourceError),rw.on("resource:fetch",this.onResourceFetch)}}function sK(t,e){var i;return!(null==e?void 0:e.id)&&t&&(null==(i=t.__internal_future)?void 0:i.hasBeenFinalized)===!1}let sq="cannot_render_billing_disabled",sH="cannot_render_user_missing",sG="cannot_render_organizations_disabled",s$="cannot_render_organization_missing",sY="cannot_render_single_session_enabled",sX={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,newSubscriptionRedirectUrl:void 0};var sQ=new WeakMap,sZ=new WeakMap,s0=new WeakMap,s1=new WeakMap,s2=new WeakMap,s3=new WeakMap,s5=new WeakMap,s4=new WeakMap,s6=new WeakMap,s7=new WeakMap,s8=new WeakMap,s9=new WeakMap,at=new WeakMap,ae=new WeakMap,ai=new WeakMap,an=new WeakMap,ar=new WeakMap,as=new WeakMap,aa=new WeakSet,ao=new WeakMap,al=new WeakMap,ac=new WeakMap,au=new WeakMap,ah=new WeakMap,ad=new WeakMap,af=new WeakMap,ap=new WeakMap,a_=new WeakMap,ag=new WeakMap,av=new WeakMap,am=new WeakMap,ay=new WeakMap,aw=new WeakMap,ab=new WeakMap,ak=new WeakMap,aS=new WeakMap,aA=new WeakMap,aI=new WeakMap,ax=new WeakMap,aU=new WeakMap,aE=new WeakMap,aP=new WeakMap,aC=new WeakMap,aO=new WeakMap,aT=new WeakMap;class aR{get __internal_queryClient(){return o(this,sQ)||Promise.all([s.e("662"),s.e("527")]).then(s.bind(s,250)).then(t=>t.QueryClient).then(t=>{o(this,sQ)||(u(this,sQ,new t),o(this,as).emit("queryClientStatus","ready"))}),o(this,sQ)?{__tag:"clerk-rq-client",client:o(this,sQ)}:void 0}get publishableKey(){return o(this,sZ)}get version(){return aR.version}set sdkMetadata(t){aR.sdkMetadata=t}get sdkMetadata(){return aR.sdkMetadata}get loaded(){return"degraded"===this.status||"ready"===this.status}get status(){return o(this,s9)}get isSatellite(){return!!iP()&&(0,is.VK)(o(this,ai).isSatellite,new URL(window.location.href),!1)}get domain(){if(iP()){let t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(t||"").replace(/^.+:\/\//,"")}((0,is.VK)(o(this,s0),new URL(window.location.href)));if("production"===o(this,s8)){let e;if(!t)return"";if(t.match(/^(clerk\.)+\w*$/))e=/(clerk\.)*(?=clerk\.)/;else{if(t.match(/\.clerk.accounts/))return t;e=/^(clerk\.)*/gi}return"clerk.".concat(t.replace(e,""))}return t}return""}get proxyUrl(){if(iP()){let t=(0,is.VK)(o(this,s1),new URL(window.location.href));return!t||eW(t)||eF(t)||ix.throwInvalidProxyUrl({url:t}),t?eF(t)?new URL(t,window.location.origin).toString():t:""}return""}get frontendApi(){let t=tK(this.publishableKey);return t?t.frontendApi:ix.throwInvalidPublishableKeyError({key:this.publishableKey})}get instanceType(){return o(this,s8)}get isStandardBrowser(){return o(this,ai).standardBrowser||!1}get billing(){return aR._billing||(aR._billing=new nA),aR._billing}get apiKeys(){return aR._apiKeys||(aR._apiKeys=new sL),aR._apiKeys}__experimental_checkout(t){return this._checkout||(this._checkout=t=>(function(t,e){var i,n,r;let s,a,o,l,{for:c,planId:u,planPeriod:h}=e;if(null===t.user)throw Error("Clerk: User is not authenticated");if("organization"===c&&null===t.organization)throw Error("Clerk: The current session does not have an active organization. Use `setActive` to set the organization");let d=function(t){let{userId:e,orgId:i,planId:n,planPeriod:r}=t;return"".concat(e,"-").concat(i||"user","-").concat(n,"-").concat(r)}({userId:(null==(i=t.user)?void 0:i.id)||"",orgId:"organization"===c?null==(n=t.organization)?void 0:n.id:void 0,planId:u,planPeriod:h}),f=sj.get(d);if(f)return f.signals.computedSignal();let p=(s=nf({resource:null}),a=nf({error:null}),o=nf({status:"idle"}),l=np(()=>{let t=s().resource,e=a().error,i=o().status;return{errors:nM(e,{}),fetchStatus:i,checkout:t}}),{resourceSignal:s,errorSignal:a,fetchSignal:o,computedSignal:l}),_=new nW(p,{..."organization"===c?{orgId:null==(r=t.organization)?void 0:r.id}:{},planId:u,planPeriod:h});return sj.set(d,{resource:_,signals:p}),p.computedSignal()})(this,t)),this._checkout(t)}__internal_getOption(t){return o(this,ai)[t]}get isSignedIn(){var t;return(null===this||void 0===this||null==(t=this.session)?void 0:t.status)!=="pending"&&!!this.session}buildUrlWithAuth(t){if("production"===o(this,s8))return t;let e=new URL(t,window.location.origin);return e.origin!==window.location.origin&&o(this,s2)?o(this,s2).decorateUrlWithDevBrowserToken(e).href:e.href}buildSignInUrl(t){return o(this,aE).call(this,"signInUrl",{...t,redirectUrl:(null==t?void 0:t.redirectUrl)||window.location.href},null==t?void 0:t.initialValues)}buildSignUpUrl(t){return o(this,aE).call(this,"signUpUrl",{...t,redirectUrl:(null==t?void 0:t.redirectUrl)||window.location.href},null==t?void 0:t.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(){let{params:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buildUrlWithAuth(new eg(o(this,ai),{},t).getAfterSignInUrl())}buildAfterSignUpUrl(){let{params:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buildUrlWithAuth(new eg(o(this,ai),{},t).getAfterSignUpUrl())}buildAfterSignOutUrl(){return o(this,ai).afterSignOutUrl?this.buildUrlWithAuth(o(this,ai).afterSignOutUrl):"/"}buildNewSubscriptionRedirectUrl(){return o(this,ai).newSubscriptionRedirectUrl?o(this,ai).newSubscriptionRedirectUrl:this.buildAfterSignInUrl()}buildWaitlistUrl(t){return this.environment&&this.environment.displayConfig?er({base:o(this,ai).waitlistUrl||this.environment.displayConfig.waitlistUrl,hashSearchParams:[new URLSearchParams((null==t?void 0:t.initialValues)||{})]},{stringify:!0}):""}buildAfterMultiSessionSingleSignOutUrl(){return this.environment?o(this,ai).afterMultiSessionSingleSignOutUrl?this.buildUrlWithAuth(o(this,ai).afterMultiSessionSingleSignOutUrl):o(this,ai).signInUrl?this.buildUrlWithAuth(er({base:o(this,ai).signInUrl,hashPath:"choose"},{stringify:!0})):this.buildUrlWithAuth(this.environment.displayConfig.afterSignOutOneUrl):""}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):""}buildTasksUrl(t){var e,i;let n=null==(e=this.session)?void 0:e.currentTask;if(!n)return"";let r=null==(i=o(this,ai).taskUrls)?void 0:i[n.key];return r||er({base:this.buildSignInUrl(t),hashPath:eC(n)},{stringify:!0})}updateEnvironment(t){this.environment=t}get __internal_last_error(){let t=this.internal_last_error;return this.internal_last_error=null,t}set __internal_last_error(t){this.internal_last_error=t}get __internal_environment(){return this.environment}__internal_navigateWithError(t,e){return this.__internal_last_error=e,this.navigate(t)}assertComponentsReady(t){if(!t)throw Error("Clerk was not loaded with Ui components")}constructor(t,e){var i=this;if(d(this,aa),c(this,aT,{get:aN,set:void 0}),(0,tn._)(this,"_checkout",void 0),(0,tn._)(this,"client",void 0),(0,tn._)(this,"session",void 0),(0,tn._)(this,"organization",void 0),(0,tn._)(this,"user",void 0),(0,tn._)(this,"__internal_country",void 0),(0,tn._)(this,"telemetry",void 0),(0,tn._)(this,"__internal_state",new sJ),(0,tn._)(this,"internal_last_error",null),(0,tn._)(this,"environment",void 0),c(this,sQ,{writable:!0,value:void 0}),c(this,sZ,{writable:!0,value:""}),c(this,s0,{writable:!0,value:void 0}),c(this,s1,{writable:!0,value:void 0}),c(this,s2,{writable:!0,value:void 0}),c(this,s3,{writable:!0,value:void 0}),c(this,s5,{writable:!0,value:void 0}),c(this,s4,{writable:!0,value:null}),c(this,s6,{writable:!0,value:void 0}),c(this,s7,{writable:!0,value:void 0}),c(this,s8,{writable:!0,value:void 0}),c(this,s9,{writable:!0,value:"loading"}),c(this,at,{writable:!0,value:[]}),c(this,ae,{writable:!0,value:[]}),c(this,ai,{writable:!0,value:{}}),c(this,an,{writable:!0,value:null}),c(this,ar,{writable:!0,value:0}),c(this,as,{writable:!0,value:td()}),(0,tn._)(this,"__internal_getCachedResources",void 0),(0,tn._)(this,"__internal_createPublicCredentials",void 0),(0,tn._)(this,"__internal_getPublicCredentials",void 0),(0,tn._)(this,"__internal_isWebAuthnSupported",void 0),(0,tn._)(this,"__internal_isWebAuthnAutofillSupported",void 0),(0,tn._)(this,"__internal_isWebAuthnPlatformAuthenticatorSupported",void 0),(0,tn._)(this,"__internal_setActiveInProgress",!1),(0,tn._)(this,"getFapiClient",()=>o(this,s7)),(0,tn._)(this,"load",async t=>{if(id.info("load() start",{},"clerk"),!this.loaded){if("development"===o(this,s8)&&tQ("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"),u(this,ai,o(this,aC).call(this,t)),o(this,ai).clerkUiCtor&&u(this,s6,Promise.resolve(o(this,ai).clerkUiCtor).then(t=>new t(()=>this,()=>this.environment,o(this,ai),new iw))),"development"===o(this,s8)&&(o(this,ai).routerPush||o(this,ai).routerReplace)&&(!o(this,ai).routerPush||!o(this,ai).routerReplace)){let t=o(this,ai).routerPush?"routerReplace":"routerPush";tQ("Clerk: Both `routerPush` and `routerReplace` need to be defined, but `".concat(t,"` is not defined. This may cause issues with navigation in your application."))}rw.on(ry,()=>{o(this,aA).call(this,this.session),o(this,aw).call(this)}),o(this,ai).sdkMetadata&&(aR.sdkMetadata=o(this,ai).sdkMetadata),!1!==o(this,ai).telemetry&&(this.telemetry=new eY({clerkVersion:aR.version,samplingRate:1,perEventSampling:!o(this,ai).__internal_keyless_claimKeylessApplicationUrl&&void 0,publishableKey:this.publishableKey,...o(this,ai).telemetry}),o(this,ai).appearance&&this.telemetry.record({event:"THEME_USAGE",eventSamplingRate:1,payload:function(t){let e;if(!t||"object"!=typeof t)return{};let i=t.theme;if(!i)return{};if(Array.isArray(i))for(let t of i){let i=e2(t);if(i){e=i;break}}else e=e2(i);return{themeName:e}}(o(this,ai).appearance)}));try{var e,i,n,r,s;o(this,ai).standardBrowser?await o(this,a_).call(this):await o(this,ag).call(this);let t=o(this,ai).telemetry,a=!1!==t&&!(null==t?void 0:t.disabled),l=!!o(this,ai).__internal_keyless_claimKeylessApplicationUrl,c=!!(null==(e=this.environment)?void 0:e.clientDebugMode),u=null!=(s=null==(n=this.environment)||null==(i=n.isProduction)?void 0:i.call(n))&&s,h=c||l&&!u,d=l&&!c?"error":void 0;h&&function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(il)return;let{enabled:e=!1,...i}=t;e&&(ia=!0,il=!0,ih(i))}({enabled:!0,...d?{logLevel:d}:{},...a&&this.telemetry?{telemetryCollector:this.telemetry}:{}}),null==(r=o(this,s3))||r.load(this.environment),id.info("load() complete",{},"clerk")}catch(t){throw o(this,as).emit(tf,"error"),id.error("load() failed",{error:t},"clerk"),t}}}),(0,tn._)(this,"signOut",async(t,e)=>{var i,n,r,s,a,l;if(!this.client||0===this.client.sessions.length)return;let c="undefined"!=typeof window&&"function"==typeof window.__internal_onBeforeSetActive?window.__internal_onBeforeSetActive:is.lQ,u="undefined"!=typeof window&&"function"==typeof window.__internal_onAfterSetActive?window.__internal_onAfterSetActive:is.lQ,h=t&&"object"==typeof t?t:e||{},d=(null==h?void 0:h.redirectUrl)||this.buildAfterSignOutUrl();id.debug("signOut() start",{hasClient:!!this.client,multiSessionCount:null!=(r=null==(i=this.client)?void 0:i.signedInSessions.length)?r:0,redirectUrl:d,sessionTarget:null!=(s=null==h?void 0:h.sessionId)?s:null},"clerk");let f="function"==typeof t?t:void 0,p=async()=>{let t=ib(o(this,ai).standardBrowser);rw.emit(rv,null),o(this,ak).call(this),await t.track(async()=>{f?await f():await this.navigate(d)}),t.isUnloading()||(o(this,aA).call(this),o(this,aw).call(this),await u())};if(await c(),!h.sessionId||1===this.client.signedInSessions.length){null==(l=null==(a=o(this,ai).experimental)?void 0:a.persistClient)||l?await this.client.removeSessions():await this.client.destroy(),await p(),id.info("signOut() complete",{redirectUrl:es(d)},"clerk");return}let _=this.client.signedInSessions.find(t=>t.id===h.sessionId),g=(null==_?void 0:_.id)&&(null==(n=this.session)?void 0:n.id)===_.id;await (null==_?void 0:_.remove()),g&&(await p(),id.info("signOut() complete",{redirectUrl:es(d)},"clerk"))}),(0,tn._)(this,"openGoogleOneTap",t=>{var e;this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openModal("googleOneTap",t||{})),null==(e=this.telemetry)||e.record(e1("GoogleOneTap",t))}),(0,tn._)(this,"closeGoogleOneTap",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("googleOneTap"))}),(0,tn._)(this,"openSignIn",t=>{var e,i;if(tC(this,this.environment)){if("development"===o(this,s8))throw new tk(eR.cannotOpenSignInOrSignUp,{code:sY});return}this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openModal("signIn",t||{}));let n={withSignUp:null!=(i=null==t?void 0:t.withSignUp)?i:h(this,aa,aM).call(this)};null==(e=this.telemetry)||e.record(e1("SignIn",t,n))}),(0,tn._)(this,"closeSignIn",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("signIn"))}),(0,tn._)(this,"__internal_openCheckout",t=>{if(tO(this,this.environment)){if("development"===o(this,s8))throw new tk(eR.cannotRenderAnyBillingComponent("Checkout"),{code:sq});return}if(!this.user){if("development"===o(this,s8))throw new tk(eR.cannotOpenCheckout,{code:sH});return}this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openDrawer("checkout",t||{}))}),(0,tn._)(this,"__internal_closeCheckout",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeDrawer("checkout"))}),(0,tn._)(this,"__internal_openPlanDetails",t=>{var e;if(tO(this,this.environment)){if("development"===o(this,s8))throw new tk(eR.cannotRenderAnyBillingComponent("PlanDetails"),{code:sq});return}this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openDrawer("planDetails",t||{})),null==(e=this.telemetry)||e.record(e1("PlanDetails",t))}),(0,tn._)(this,"__internal_closePlanDetails",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeDrawer("planDetails"))}),(0,tn._)(this,"__internal_openSubscriptionDetails",t=>{this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openDrawer("subscriptionDetails",t||{}))}),(0,tn._)(this,"__internal_closeSubscriptionDetails",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeDrawer("subscriptionDetails"))}),(0,tn._)(this,"__internal_openReverification",t=>{var e;if(!this.user){if("development"===o(this,s8))throw new tk(eR.cannotOpenUserProfile,{code:sH});return}this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openModal("userVerification",t||{})),null==(e=this.telemetry)||e.record(e1("UserVerification",t))}),(0,tn._)(this,"__internal_closeReverification",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("userVerification"))}),(0,tn._)(this,"__internal_attemptToEnableEnvironmentSetting",t=>{let{for:e,caller:i}=t;if(this.user||"development"!==o(this,s8)||tQ('Clerk: "'.concat(i,'" requires an active user session. Ensure a user is signed in before executing ').concat(i,".")),"organizations"===e){var n,r;let e;return(null==(e=this.environment)?void 0:e.organizationSettings.enabled)||(null==(r=this.session)||null==(n=r.currentTask)?void 0:n.key)==="choose-organization"?{isEnabled:!0}:("development"===o(this,s8)&&this.__internal_openEnableOrganizationsPrompt({caller:i,onSuccess:()=>window.location.reload(),onClose:t.onClose}),{isEnabled:!1})}throw Error('Attempted to enable an unknown or unsupported setting "'.concat(e,'".'))}),(0,tn._)(this,"__internal_openEnableOrganizationsPrompt",t=>{var e;this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted({preloadHint:"EnableOrganizationsPrompt"})).then(e=>e.openModal("enableOrganizationsPrompt",t||{})),null==(e=this.telemetry)||e.record(e0("EnableOrganizationsPrompt",t))}),(0,tn._)(this,"__internal_closeEnableOrganizationsPrompt",()=>{var t;this.assertComponentsReady(o(this,s6)),null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("enableOrganizationsPrompt"))}),(0,tn._)(this,"__internal_openBlankCaptchaModal",()=>(this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(t=>t.openModal("blankCaptcha",{})))),(0,tn._)(this,"__internal_closeBlankCaptchaModal",()=>(this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(t=>t.closeModal("blankCaptcha")))),(0,tn._)(this,"__internal_loadStripeJs",async()=>{let{loadStripe:t}=await s.e("279").then(s.bind(s,5608));return t}),(0,tn._)(this,"openSignUp",t=>{var e;if(tC(this,this.environment)){if("development"===o(this,s8))throw new tk(eR.cannotOpenSignInOrSignUp,{code:sY});return}this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openModal("signUp",t||{})),null==(e=this.telemetry)||e.record(e1("SignUp",t))}),(0,tn._)(this,"closeSignUp",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("signUp"))}),(0,tn._)(this,"openUserProfile",t=>{var e,i;if(!this.user){if("development"===o(this,s8))throw new tk(eR.cannotOpenUserProfile,{code:sH});return}this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openModal("userProfile",t||{}));let n=((null==t||null==(e=t.customPages)?void 0:e.length)||0)>0?{customPages:!0}:void 0;null==(i=this.telemetry)||i.record(e1("UserProfile",t,n))}),(0,tn._)(this,"closeUserProfile",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("userProfile"))}),(0,tn._)(this,"openOrganizationProfile",t=>{var e;let{isEnabled:i}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"OrganizationProfile",onClose:()=>{throw new tk(eR.cannotRenderAnyOrganizationComponent("OrganizationProfile"),{code:sG})}});if(i){if(!this.organization){if("development"===o(this,s8))throw new tk(eR.cannotRenderComponentWhenOrgDoesNotExist,{code:s$});return}this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openModal("organizationProfile",t||{})),null==(e=this.telemetry)||e.record(e1("OrganizationProfile",t))}}),(0,tn._)(this,"closeOrganizationProfile",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("organizationProfile"))}),(0,tn._)(this,"openCreateOrganization",t=>{var e;let{isEnabled:i}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"CreateOrganization",onClose:()=>{throw new tk(eR.cannotRenderAnyOrganizationComponent("CreateOrganization"),{code:sG})}});i&&(this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openModal("createOrganization",t||{})),null==(e=this.telemetry)||e.record(e1("CreateOrganization",t)))}),(0,tn._)(this,"closeCreateOrganization",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("createOrganization"))}),(0,tn._)(this,"openWaitlist",t=>{var e;this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(e=>e.openModal("waitlist",t||{})),null==(e=this.telemetry)||e.record(e1("Waitlist",t))}),(0,tn._)(this,"closeWaitlist",()=>{var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("waitlist"))}),(0,tn._)(this,"mountSignIn",(t,e)=>{var i,n;this.assertComponentsReady(o(this,s6));let r="SignIn";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"signIn",node:t,props:e}));let s={withSignUp:null!=(n=null==e?void 0:e.withSignUp)?n:h(this,aa,aM).call(this)};null==(i=this.telemetry)||i.record(e0(r,e,s))}),(0,tn._)(this,"unmountSignIn",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountUserAvatar",(t,e)=>{var i;this.assertComponentsReady(o(this,s6));let n="UserAvatar";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:n,appearanceKey:"userAvatar",node:t,props:e})),null==(i=this.telemetry)||i.record(e0(n,e))}),(0,tn._)(this,"unmountUserAvatar",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountSignUp",(t,e)=>{var i;this.assertComponentsReady(o(this,s6));let n="SignUp";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:n,appearanceKey:"signUp",node:t,props:e})),null==(i=this.telemetry)||i.record(e0(n,e))}),(0,tn._)(this,"unmountSignUp",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountUserProfile",(t,e)=>{var i,n;if(!this.user){if("development"===o(this,s8))throw new tk(eR.cannotRenderComponentWhenUserDoesNotExist,{code:sH});return}this.assertComponentsReady(o(this,s6));let r="UserProfile";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"userProfile",node:t,props:e}));let s=((null==e||null==(i=e.customPages)?void 0:i.length)||0)>0?{customPages:!0}:void 0;null==(n=this.telemetry)||n.record(e0(r,e,s))}),(0,tn._)(this,"unmountUserProfile",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountOrganizationProfile",(t,e)=>{var i;let{isEnabled:n}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"OrganizationProfile",onClose:()=>{throw new tk(eR.cannotRenderAnyOrganizationComponent("OrganizationProfile"),{code:sG})}});if(!n)return;let r=!!this.user;if(!this.organization&&r){if("development"===o(this,s8))throw new tk(eR.cannotRenderComponentWhenOrgDoesNotExist,{code:s$});return}this.assertComponentsReady(o(this,s6));let s="OrganizationProfile";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:s,appearanceKey:"userProfile",node:t,props:e})),null==(i=this.telemetry)||i.record(e0(s,e))}),(0,tn._)(this,"unmountOrganizationProfile",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountCreateOrganization",(t,e)=>{var i;let{isEnabled:n}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"CreateOrganization",onClose:()=>{throw new tk(eR.cannotRenderAnyOrganizationComponent("CreateOrganization"),{code:sG})}});if(!n)return;this.assertComponentsReady(o(this,s6));let r="CreateOrganization";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"createOrganization",node:t,props:e})),null==(i=this.telemetry)||i.record(e0(r,e))}),(0,tn._)(this,"unmountCreateOrganization",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountOrganizationSwitcher",(t,e)=>{var i,n;let{isEnabled:r}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"OrganizationSwitcher",onClose:()=>{throw new tk(eR.cannotRenderAnyOrganizationComponent("OrganizationSwitcher"),{code:sG})}});if(!r)return;this.assertComponentsReady(o(this,s6));let s="OrganizationSwitcher";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:s,appearanceKey:"organizationSwitcher",node:t,props:e})),null==(n=this.telemetry)||n.record(e0(s,{...e,forceOrganizationSelection:null==(i=this.environment)?void 0:i.organizationSettings.forceOrganizationSelection}))}),(0,tn._)(this,"unmountOrganizationSwitcher",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"__experimental_prefetchOrganizationSwitcher",()=>{this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(t=>t.prefetch("organizationSwitcher"))}),(0,tn._)(this,"mountOrganizationList",(t,e)=>{var i,n;let{isEnabled:r}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"OrganizationList",onClose:()=>{throw new tk(eR.cannotRenderAnyOrganizationComponent("OrganizationList"),{code:sG})}});if(!r)return;this.assertComponentsReady(o(this,s6));let s="OrganizationList";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:s,appearanceKey:"organizationList",node:t,props:e})),null==(n=this.telemetry)||n.record(e0(s,{...e,forceOrganizationSelection:null==(i=this.environment)?void 0:i.organizationSettings.forceOrganizationSelection}))}),(0,tn._)(this,"unmountOrganizationList",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountUserButton",(t,e)=>{var i,n;this.assertComponentsReady(o(this,s6));let r="UserButton";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"userButton",node:t,props:e}));let s={...(null==e||null==(i=e.customMenuItems)?void 0:i.length)||0?{customItems:!0}:void 0,...(null==e?void 0:e.__experimental_asStandalone)?{standalone:!0}:void 0};null==(n=this.telemetry)||n.record(e0(r,e,s))}),(0,tn._)(this,"unmountUserButton",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountWaitlist",(t,e)=>{var i;this.assertComponentsReady(o(this,s6));let n="Waitlist";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:n,appearanceKey:"waitlist",node:t,props:e})),null==(i=this.telemetry)||i.record(e0(n,e))}),(0,tn._)(this,"unmountWaitlist",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountPricingTable",(t,e)=>{var i;if(tO(this,this.environment)){if("development"===o(this,s8))throw new tk(eR.cannotRenderAnyBillingComponent("PricingTable"),{code:sq});return}this.assertComponentsReady(o(this,s6));let n="PricingTable";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:n,appearanceKey:"pricingTable",node:t,props:e})),null==(i=this.telemetry)||i.record(e0(n,e))}),(0,tn._)(this,"unmountPricingTable",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"__internal_mountOAuthConsent",(t,e)=>{this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:"OAuthConsent",appearanceKey:"__internal_oauthConsent",node:t,props:e}))}),(0,tn._)(this,"__internal_unmountOAuthConsent",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountAPIKeys",(t,e)=>{var i;let n;if(tQ("Clerk: <APIKeys /> component is in early access and not yet recommended for production use."),tT(this,n=this.environment)&&tR(this,n)){if("development"===o(this,s8))throw new tk(eR.cannotRenderAPIKeysComponent,{code:"cannot_render_api_keys_disabled"});return}if(this.organization&&tR(this,this.environment)){if("development"===o(this,s8))throw new tk(eR.cannotRenderAPIKeysComponentForOrgWhenDisabled,{code:"cannot_render_api_keys_org_disabled"});return}if(tT(this,this.environment)){if("development"===o(this,s8))throw new tk(eR.cannotRenderAPIKeysComponentForUserWhenDisabled,{code:"cannot_render_api_keys_user_disabled"});return}this.assertComponentsReady(o(this,s6));let r="APIKeys";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"apiKeys",node:t,props:e})),null==(i=this.telemetry)||i.record(e0(r,e))}),(0,tn._)(this,"unmountAPIKeys",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountTaskChooseOrganization",(t,e)=>{var i;let{isEnabled:n}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"TaskChooseOrganization",onClose:()=>{throw new tk(eR.cannotRenderAnyOrganizationComponent("TaskChooseOrganization"),{code:sG})}});if(!n)return;this.assertComponentsReady(o(this,s6));let r="TaskChooseOrganization";o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"taskChooseOrganization",node:t,props:e})),null==(i=this.telemetry)||i.record(e0(r,e))}),(0,tn._)(this,"unmountTaskChooseOrganization",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"mountTaskResetPassword",(t,e)=>{var i;this.assertComponentsReady(o(this,s6)),o(this,s6).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:"TaskResetPassword",appearanceKey:"taskResetPassword",node:t,props:e})),null==(i=this.telemetry)||i.record(e0("TaskResetPassword",e))}),(0,tn._)(this,"unmountTaskResetPassword",t=>{var e;null==(e=o(this,s6))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tn._)(this,"setActive",async t=>{var e,i,n,r,s,a,l,c;let{organization:u,redirectUrl:h,navigate:d}=t,{session:f}=t;this.__internal_setActiveInProgress=!0,id.debug("setActive() start",{hasClient:!!this.client,sessionTarget:"string"==typeof f?f:null!=(i=null!=(e=null==f?void 0:f.id)?e:f)?i:null,organizationTarget:"string"==typeof u?u:null!=(r=null!=(n=null==u?void 0:u.id)?n:u)?r:null,redirectUrl:null!=h?h:null},"clerk");try{let e;if(!this.client)throw id.warn("Clerk setActive called before client is loaded",{},"clerk"),Error("setActive is being called before the client is loaded. Wait for init.");if(void 0===f&&!this.session)throw id.warn("Clerk setActive precondition not met: no target session and no active session",{},"clerk"),Error("setActive should either be called with a session param or there should be already an active session.");"string"==typeof f&&(f=this.client.sessions.find(t=>t.id===f)||null);let i="undefined"!=typeof window&&"function"==typeof window.__internal_onBeforeSetActive?window.__internal_onBeforeSetActive:is.lQ,n="undefined"!=typeof window&&"function"==typeof window.__internal_onAfterSetActive?window.__internal_onAfterSetActive:is.lQ,r=void 0===f?this.session:f;(null==r?void 0:r.status)==="pending"&&(c={...o(this,ai),...t},e=["taskUrls","navigate"],Object.keys(c).some(t=>e.includes(t))||tQ('Clerk: Session has pending tasks but no handling is configured. To handle pending tasks, provide either "taskUrls" for navigation to custom URLs or "navigate" for programmatic navigation. Without these options, users may get stuck on incomplete flows.'));let p=void 0!==u;if(r&&p){let t="string"==typeof u?u:null==u?void 0:u.id;if("string"==typeof t&&t.startsWith("org_"))r.lastActiveOrganizationId=t||null;else{let e=r.user.organizationMemberships.find(e=>e.organization.slug===t),i=(null==e?void 0:e.organization.id)||null,n=null===i;if((null==(l=this.environment)||null==(a=l.organizationSettings)?void 0:a.forceOrganizationSelection)&&n)return;r.lastActiveOrganizationId=i}}(null==r?void 0:r.status)!=="pending"&&await i(null===r?"sign-out":void 0),(iP()&&globalThis.document.hasFocus()||!o(this,ai).standardBrowser)&&(await o(this,ay).call(this,r),r=o(this,aI).call(this,null==r?void 0:r.id)),await (null==r?void 0:r.getToken())||(tl()||id.warn("Token is null when setting active session (offline)",{sessionId:null==r?void 0:r.id},"clerk"),rw.emit(rg,{token:null}));let _=ib(o(this,ai).standardBrowser),g=(null==r?void 0:r.status)==="pending"&&(null==r?void 0:r.currentTask)&&(null==(s=o(this,ai).taskUrls)?void 0:s[null==r?void 0:r.currentTask.key]);if((h||g||d)&&await _.track(async()=>{if(this.client){if((null==r?void 0:r.status)!=="pending"&&o(this,ak).call(this),g){let t=h?er({base:g,hashSearchParams:{redirectUrl:h}},{stringify:!0}):g;await this.navigate(t)}else if(d&&r)await d({session:r});else if(h){if(this.client.isEligibleForTouch()){let t=new URL(h,window.location.href),e=this.buildUrlWithAuth(this.client.buildTouchUrl({redirectUrl:t}));await this.navigate(e)}await this.navigate(h)}}}),_.isUnloading())return;o(this,aA).call(this,r),o(this,aw).call(this),(null==r?void 0:r.status)!=="pending"&&await n()}finally{this.__internal_setActiveInProgress=!1}}),(0,tn._)(this,"addListener",t=>{var e;let i;return e=t,t=t=>{var n;i||(i={...t}),e(i={...{client:sm((n=i).client,t.client),session:sm(n.session,t.session),user:sm(n.user,t.user),organization:sm(n.organization,t.organization)}})},o(this,at).push(t),this.client&&t({client:this.client,session:this.session,user:this.user,organization:this.organization}),()=>{u(this,at,o(this,at).filter(e=>e!==t))}}),(0,tn._)(this,"on",function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];o(i,as).on(...e)}),(0,tn._)(this,"off",function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];o(i,as).off(...e)}),(0,tn._)(this,"__internal_addNavigationListener",t=>(o(this,ae).push(t),()=>{u(this,ae,o(this,ae).filter(e=>e!==t))})),(0,tn._)(this,"navigate",async(t,e)=>{if(!t||!iP())return;setTimeout(()=>{o(this,ab).call(this)},0);let i=new URL(t,window.location.href);o(this,aT).includes(i.protocol)||(console.warn('Clerk: "'.concat(i.protocol,'" is not a valid protocol. Redirecting to "/" instead. If you think this is a mistake, please open an issue.')),i=new URL("/",window.location.href));let n=(null==e?void 0:e.replace)&&o(this,ai).routerReplace?o(this,ai).routerReplace:o(this,ai).routerPush;if(id.info("Clerk is navigating to: ".concat(i)),o(this,ai).routerDebug&&console.log("Clerk is navigating to: ".concat(i)),"null"!==i.origin&&i.origin!==window.location.origin||!n)return void ez(i);let r={...(null==e?void 0:e.metadata)?{__internal_metadata:null==e?void 0:e.metadata}:{},windowNavigate:ez};return await n(es(i),r)}),c(this,ao,{writable:!0,value:async()=>{if(!iP())return;let t=new URLSearchParams({[tM]:"true"}),e=ex(tz);e&&eW(e)||function(){throw Error("".concat(iT," Invalid redirect_url. A valid http or https url should be used for the redirection."))}();let i=er({base:ex(tz),searchParams:t},{stringify:!0});return this.navigate(this.buildUrlWithAuth(i))}}),(0,tn._)(this,"redirectWithAuth",async t=>{if(iP())return this.navigate(this.buildUrlWithAuth(t))}),(0,tn._)(this,"redirectToSignIn",async t=>{if(iP())return this.navigate(this.buildSignInUrl(t))}),(0,tn._)(this,"redirectToSignUp",async t=>{if(iP())return this.navigate(this.buildSignUpUrl(t))}),(0,tn._)(this,"redirectToUserProfile",async()=>{if(iP())return this.navigate(this.buildUserProfileUrl())}),(0,tn._)(this,"redirectToCreateOrganization",async()=>{if(iP())return this.navigate(this.buildCreateOrganizationUrl())}),(0,tn._)(this,"redirectToOrganizationProfile",async()=>{if(iP())return this.navigate(this.buildOrganizationProfileUrl())}),(0,tn._)(this,"redirectToAfterSignIn",async()=>{if(iP())return this.navigate(this.buildAfterSignInUrl())}),(0,tn._)(this,"redirectToAfterSignUp",async()=>{if(iP())return this.navigate(this.buildAfterSignUpUrl())}),(0,tn._)(this,"redirectToAfterSignOut",async()=>{if(iP())return this.navigate(this.buildAfterSignOutUrl())}),(0,tn._)(this,"redirectToWaitlist",async()=>{if(iP())return this.navigate(this.buildWaitlistUrl())}),(0,tn._)(this,"redirectToTasks",async t=>{if(iP())return this.navigate(this.buildTasksUrl(t))}),(0,tn._)(this,"handleEmailLinkVerification",async(t,e)=>{if(!this.client)return;let i=ex("__clerk_status");if("expired"===i)throw new tb("expired");if("client_mismatch"===i)throw new tb("client_mismatch");if("verified"!==i)throw new tb("failed");let n=ex("__clerk_created_session"),{signIn:r,signUp:s,sessions:a}=this.client,o=a.some(t=>t.id===n),l="needs_second_factor"===r.status||"missing_requirements"===s.status,c=t=>e&&"function"==typeof e?e(t):this.navigate(t),u=t.redirectUrl?()=>c(t.redirectUrl):is.lQ;return o?this.setActive({session:n,redirectUrl:t.redirectUrlComplete}):l?u():("function"==typeof t.onVerifiedOnOtherDevice&&t.onVerifiedOnOtherDevice(),null)}),(0,tn._)(this,"handleGoogleOneTapCallback",async(t,e,i)=>{if(!this.loaded||!this.environment||!this.client)return;let{signIn:n,signUp:r}=this.client,s="identifier"in(t||{})?t:n,a="missingFields"in(t||{})?t:r,o=t=>i&&"function"==typeof i?i(this.buildUrlWithAuth(t)):this.navigate(this.buildUrlWithAuth(t));return this._handleRedirectCallback(e,{signUp:a,signIn:s,navigate:o})}),(0,tn._)(this,"_handleRedirectCallback",async(t,e)=>{var i,n,r,s,a,l,c,u;let{signIn:h,signUp:d,navigate:f}=e;if(!this.loaded||!this.environment||!this.client)return;if(!window.opener&&t.reloadResource)try{"signIn"===t.reloadResource?await h.reload():"signUp"===t.reloadResource&&await d.reload()}catch{}let{displayConfig:p}=this.environment,{firstFactorVerification:_}=h,{externalAccount:g}=d.verifications,v={status:d.status,missingFields:d.missingFields,externalAccountStatus:g.status,externalAccountErrorCode:null==(i=g.error)?void 0:i.code,externalAccountSessionId:null==(r=g.error)||null==(n=r.meta)?void 0:n.sessionId,sessionId:d.createdSessionId},m={status:h.status,firstFactorVerificationStatus:_.status,firstFactorVerificationErrorCode:null==(s=_.error)?void 0:s.code,firstFactorVerificationSessionId:null==(l=_.error)||null==(a=l.meta)?void 0:a.sessionId,sessionId:h.createdSessionId},y=t=>()=>f(t),w=y(t.signInUrl||p.signInUrl),b=y(t.signUpUrl||p.signUpUrl),k=y(t.firstFactorUrl||er({base:p.signInUrl,hashPath:"/factor-one"},{stringify:!0})),S=y(t.secondFactorUrl||er({base:p.signInUrl,hashPath:"/factor-two"},{stringify:!0})),A=y(t.resetPasswordUrl||er({base:p.signInUrl,hashPath:"/reset-password"},{stringify:!0})),I=new eg(o(this,ai),t),x=y(t.continueSignUpUrl||er({base:p.signUpUrl,hashPath:"/continue"},{stringify:!0})),U=e=>{let{missingFields:i}=e;return i.length?x():(t=>{let{signUp:e,verifyEmailPath:i,verifyPhonePath:n,continuePath:r,navigate:s,handleComplete:a,redirectUrl:o="",redirectUrlComplete:l="",oidcPrompt:c}=t;if("complete"===e.status)return a&&a();if("missing_requirements"===e.status){var u,h;if(e.missingFields.some(t=>"enterprise_sso"===t))return e.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:o,redirectUrlComplete:l,continueSignUp:!0,oidcPrompt:c});let t=eE();if((null==(u=e.unverifiedFields)?void 0:u.includes("email_address"))&&i)return s(i,{searchParams:t});if((null==(h=e.unverifiedFields)?void 0:h.includes("phone_number"))&&n)return s(n,{searchParams:t});if(r)return s(r,{searchParams:t})}})({signUp:d,verifyEmailPath:t.verifyEmailAddressUrl||er({base:p.signUpUrl,hashPath:"/verify-email-address"},{stringify:!0}),verifyPhonePath:t.verifyPhoneNumberUrl||er({base:p.signUpUrl,hashPath:"/verify-phone-number"},{stringify:!0}),navigate:f})},E=t.signInUrl||p.signInUrl,P=t.signUpUrl||p.signUpUrl,C=async t=>{let{session:e,baseUrl:i,redirectUrl:n}=t;e.currentTask?await eO(e,{baseUrl:i,navigate:this.navigate}):await this.navigate(n)};if("complete"===m.status)return this.setActive({session:m.sessionId,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:E,redirectUrl:I.getAfterSignInUrl()})}});if("transferable"===v.externalAccountStatus&&"external_account_exists"===v.externalAccountErrorCode){let t=await h.create({transfer:!0});switch(t.status){case"complete":return this.setActive({session:t.createdSessionId,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:P,redirectUrl:I.getAfterSignInUrl()})}});case"needs_first_factor":return k();case"needs_second_factor":return S();case"needs_new_password":return A();default:iM("sign in")}}let O="user_locked"===v.externalAccountErrorCode,T="user_locked"===m.firstFactorVerificationErrorCode;if(O)return b();if(T)return w();if("needs_first_factor"===m.status&&!(null==(c=h.supportedFirstFactors)?void 0:c.every(t=>"enterprise_sso"===t.strategy)))return k();if("needs_new_password"===m.status)return A();if("transferable"===m.firstFactorVerificationStatus){if(!1===t.transferable)return w();let e=await d.create({transfer:!0});switch(e.status){case"complete":return this.setActive({session:e.createdSessionId,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:P,redirectUrl:I.getAfterSignUpUrl()})}});case"missing_requirements":return U({missingFields:e.missingFields});default:iM("sign in")}}if("complete"===v.status)return this.setActive({session:v.sessionId,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:P,redirectUrl:I.getAfterSignUpUrl()})}});if("needs_second_factor"===m.status)return S();let R=("failed"===v.externalAccountStatus||"unverified"===v.externalAccountStatus)&&"identifier_already_signed_in"===v.externalAccountErrorCode&&v.externalAccountSessionId,M="failed"===m.firstFactorVerificationStatus&&"identifier_already_signed_in"===m.firstFactorVerificationErrorCode&&m.firstFactorVerificationSessionId;if(R||M){let t=m.firstFactorVerificationSessionId||v.externalAccountSessionId;if(t)return this.setActive({session:t,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:R?P:E,redirectUrl:I.getAfterSignInUrl()})}})}return(t=>{let{externalAccount:e}=t.verifications;return!!e.error})(d)?b():"verified"===v.externalAccountStatus&&"missing_requirements"===v.status?U({missingFields:d.missingFields}):(null==(u=this.session)?void 0:u.currentTask)?void await this.redirectToTasks({redirectUrl:this.buildAfterSignInUrl()}):w()}),(0,tn._)(this,"handleRedirectCallback",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(!i.loaded||!i.environment||!i.client)return;let{signIn:n,signUp:r}=i.client;return i._handleRedirectCallback(t,{signUp:r,signIn:n,navigate:t=>e&&"function"==typeof e?e(t):i.navigate(t)})}),(0,tn._)(this,"handleUnauthenticated",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{broadcast:!0};if(i.client&&i.session)try{let e=await n0.getOrCreateInstance().fetch();if(i.updateClient(e),i.session)return;return t.broadcast&&rw.emit(rv,null),i.setActive({session:null})}catch(t){if(tU(t)&&[403,500].includes(t.status))return i.setActive({session:null});throw t}}),(0,tn._)(this,"authenticateWithGoogleOneTap",async t=>{var e;return null==(e=this.client)?void 0:e.signIn.create({strategy:"google_one_tap",token:t.token}).catch(e=>{if(tU(e)&&"external_account_not_found"===e.errors[0].code){var i;return null==(i=this.client)?void 0:i.signUp.create({strategy:"google_one_tap",token:t.token,legalAccepted:t.legalAccepted})}throw e})}),(0,tn._)(this,"authenticateWithMetamask",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await i.authenticateWithWeb3({...t,strategy:"web3_metamask_signature"})}),(0,tn._)(this,"authenticateWithCoinbaseWallet",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await i.authenticateWithWeb3({...t,strategy:"web3_coinbase_wallet_signature"})}),(0,tn._)(this,"authenticateWithBase",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await i.authenticateWithWeb3({...t,strategy:"web3_base_signature"})}),(0,tn._)(this,"authenticateWithOKXWallet",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await i.authenticateWithWeb3({...t,strategy:"web3_okx_wallet_signature"})}),(0,tn._)(this,"authenticateWithWeb3",async t=>{let e,i,{redirectUrl:n,signUpContinueUrl:r,customNavigate:s,unsafeMetadata:a,strategy:o,legalAccepted:l,secondFactorUrl:c}=t;if(!this.client||!this.environment)return;let{displayConfig:u}=this.environment,h=o.replace("web3_","").replace("_signature",""),d=await iG().getWeb3Identifier({provider:h});switch(h){case"metamask":e=iG().generateSignatureWithMetamask;break;case"base":e=iG().generateSignatureWithBase;break;case"coinbase_wallet":e=iG().generateSignatureWithCoinbaseWallet;break;default:e=iG().generateSignatureWithOKXWallet}let f=t=>()=>s&&"function"==typeof s?s(t):this.navigate(t),p=f(c||er({base:u.signInUrl,hashPath:"/factor-two"},{stringify:!0})),_=f(r||er({base:u.signUpUrl,hashPath:"/continue"},{stringify:!0}));try{i=await this.client.signIn.authenticateWithWeb3({identifier:d,generateSignature:e,strategy:o})}catch(t){if(iI(t,"form_identifier_not_found"))i=await this.client.signUp.authenticateWithWeb3({identifier:d,generateSignature:e,unsafeMetadata:a,strategy:o,legalAccepted:l}),r&&"missing_requirements"===i.status&&"verified"===i.verifications.web3Wallet.status&&await _();else throw t}let g=async t=>{let{session:e,redirectUrl:i}=t;e.currentTask?await eO(e,{baseUrl:u.signInUrl,navigate:this.navigate}):await this.navigate(i)};switch(i.status){case"needs_second_factor":await p();break;case"complete":i.createdSessionId&&await this.setActive({session:i.createdSessionId,navigate:async t=>{let{session:e}=t;await g({session:e,redirectUrl:null!=n?n:this.buildAfterSignInUrl()})}});break;default:return}}),(0,tn._)(this,"createOrganization",async t=>{let{name:e,slug:i}=t;return rT.create({name:e,slug:i})}),(0,tn._)(this,"getOrganization",async t=>rT.get(t)),(0,tn._)(this,"joinWaitlist",async t=>{let{emailAddress:e}=t;return sg.join({emailAddress:e})}),(0,tn._)(this,"__internal_setCountry",t=>{this.__internal_country||(this.__internal_country=t)}),(0,tn._)(this,"updateClient",t=>{if(!this.client){let e=o(this,ai).selectInitialSession?o(this,ai).selectInitialSession(t):o(this,av).call(this,t);o(this,aA).call(this,e)}if(this.client=t,this.session){var e,i,n;let t=o(this,aI).call(this,this.session.id);"active"===this.session.status&&(null==t?void 0:t.status)==="pending"&&("undefined"!=typeof window&&"function"==typeof window.__internal_onAfterSetActive?window.__internal_onAfterSetActive:is.lQ)(),o(this,aA).call(this,t),(null==(e=this.session)?void 0:e.lastActiveToken)||tl()||id.warn("No last active token when updating client (offline)",{sessionId:null==(n=this.session)?void 0:n.id},"clerk"),rw.emit(rg,{token:null==(i=this.session)?void 0:i.lastActiveToken})}o(this,aw).call(this)}),(0,tn._)(this,"__internal_setEnvironment",async t=>{this.environment=new rS(t)}),(0,tn._)(this,"__internal_onBeforeRequest",t=>{o(this,s7).onBeforeRequest(t)}),(0,tn._)(this,"__internal_onAfterResponse",t=>{o(this,s7).onAfterResponse(t)}),(0,tn._)(this,"__internal_updateProps",t=>{var e;let i={...t,options:o(this,aC).call(this,{...o(this,ai),...t.options})};return null==(e=o(this,s6))?void 0:e.then(t=>t.ensureMounted()).then(t=>t.updateProps(i))}),c(this,al,{writable:!0,value:()=>{let t=new URLSearchParams({[tz]:window.location.href});return er({base:o(this,ai).signInUrl,searchParams:t},{stringify:!0})}}),c(this,ac,{writable:!0,value:()=>{let t;if(this.proxyUrl){let e=new URL(this.proxyUrl);t=new URL("".concat(e.pathname,"/v1/client/sync"),e.origin)}else this.domain&&(t=new URL("/v1/client/sync","https://".concat(this.domain)));return null==t||t.searchParams.append("redirect_url",window.location.href),(null==t?void 0:t.toString())||""}}),c(this,au,{writable:!0,value:()=>{var t;return"true"!==ex(tM)&&!!this.isSatellite&&!!(null==(t=o(this,s2))?void 0:t.isSignedOut())}}),c(this,ah,{writable:!0,value:()=>"production"!==o(this,s8)&&!this.isSatellite&&!!ex(tz)}),c(this,ad,{writable:!0,value:async()=>{"development"===this.instanceType?await this.navigate(o(this,al).call(this)):"production"===this.instanceType&&await this.navigate(o(this,ac).call(this))}}),c(this,af,{writable:!0,value:(t,e)=>{let i;try{i=new URL(t)}catch{throw Error("".concat(iT," The signInUrl needs to have a absolute url format."))}i.origin===e&&function(){throw Error("".concat(iT," The signInUrl needs to be on a different origin than your satellite application."))}()}}),c(this,ap,{writable:!0,value:()=>{this.isSatellite&&("development"!==o(this,s8)||o(this,ai).signInUrl||function(){throw Error("".concat(iT," Missing signInUrl. A satellite application needs to specify the signInUrl for development instances."))}(),this.proxyUrl||this.domain||function(){throw Error("".concat(iT," Missing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl."))}(),o(this,ai).signInUrl&&o(this,af).call(this,o(this,ai).signInUrl,window.location.origin))}}),c(this,a_,{writable:!0,value:async()=>{var t,e;if(u(this,s2,await sW.create(this,o(this,s7),o(this,s8),o(this,as))),o(this,ap).call(this),o(this,au).call(this))return void await o(this,ad).call(this);if(o(this,ah).call(this))return void await o(this,ao).call(this);u(this,an,(()=>{if(!tr())return{onPageFocus:is.lQ};let t=[];return window.addEventListener("focus",()=>{"visible"===document.visibilityState&&t.forEach(t=>t())}),{onPageFocus:e=>{t.push(e)}}})()),"undefined"!=typeof BroadcastChannel&&u(this,s4,new BroadcastChannel("clerk")),o(this,am).call(this);let i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.hostname;if(!t)return!1;let e=ei.get(t);void 0===e&&(e=tL.some(e=>t.startsWith("accounts.")&&t.endsWith(e))||tj.some(e=>t.endsWith(e)&&!t.endsWith(".clerk"+e)),ei.set(t,e));return e}(null==(t=window)?void 0:t.location.hostname),n="development"===o(this,s8)&&!i,r=0,s=0;for(;s<2;){s++;try{let t=rS.getInstance().fetch({touch:n}).then(t=>this.updateEnvironment(t)).catch(()=>{++r;let t=iQ.getItem(i$,null);t&&this.updateEnvironment(new rS(t))}),i=async()=>n0.getOrCreateInstance().fetch().then(t=>this.updateClient(t)).catch(async t=>{var e,i,n;if(tx(t))throw t;++r;let s=null==(e=o(this,s2))?void 0:e.getSessionCookie(),a=function(t){let e;try{e=new so({jwt:t||"",object:"token",id:void 0})}catch{e=null}if(n0.clearInstance(),!(null==e?void 0:e.jwt))return n0.getOrCreateInstance({object:"client",last_active_session_id:null,id:"client_init",sessions:[]});let{sessionId:i,userId:n,orgId:r,orgRole:s,orgPermissions:a,orgSlug:o,factorVerificationAge:l}=(t=>{var e,i,n,r,s,a,o,l;let c,u,h,d,f=null!=(e=t.fva)?e:null,p=null!=(i=t.sts)?i:null;if(2===t.v){if(t.o){c=null==(n=t.o)?void 0:n.id,h=null==(r=t.o)?void 0:r.slg,(null==(s=t.o)?void 0:s.rol)&&(u="org:".concat(null==(a=t.o)?void 0:a.rol));let{org:e}=rH(t.fea),{permissions:i,featurePermissionMap:f}=(t=>{let{per:e,fpm:i}=t;if(!e||!i)return{permissions:[],featurePermissionMap:[]};let n=e.split(",").map(t=>t.trim());return{permissions:n,featurePermissionMap:i.split(",").map(t=>Number.parseInt(t.trim(),10)).map(t=>t.toString(2).padStart(n.length,"0").split("").map(t=>Number.parseInt(t,10)).reverse()).filter(Boolean)}})({per:null==(o=t.o)?void 0:o.per,fpm:null==(l=t.o)?void 0:l.fpm});d=function(t){let{features:e,permissions:i,featurePermissionMap:n}=t;if(!e||!i||!n)return[];let r=[];for(let t=0;t<e.length;t++){let s=e[t];if(t>=n.length)continue;let a=n[t];if(a)for(let t=0;t<a.length;t++)1===a[t]&&r.push("org:".concat(s,":").concat(i[t]))}return r}({features:e,featurePermissionMap:f,permissions:i})}}else c=t.org_id,u=t.org_role,h=t.org_slug,d=t.org_permissions;return{sessionClaims:t,sessionId:t.sid,sessionStatus:p,actor:t.act,userId:t.sub,orgId:c,orgRole:u,orgSlug:h,orgPermissions:d,factorVerificationAge:f}})(e.jwt.claims),c={object:"client",last_active_session_id:i,id:"client_init",sessions:[{object:"session",id:i,status:"active",last_active_organization_id:r||null,last_active_token:{id:void 0,object:"token",jwt:t},factor_verification_age:l||null,public_user_data:{user_id:n},user:{object:"user",id:n,organization_memberships:r&&o&&s?[{object:"organization_membership",id:r,role:s,permissions:a||[],organization:{object:"organization",id:r,name:o,slug:o,members_count:1,max_allowed_memberships:1}}]:[]}}]};return n0.getOrCreateInstance(c)}(s);return this.updateClient(a),null==(i=o(this,s2))||i.stopPollingForToken(),await (null==(n=this.session)?void 0:n.getToken({skipCache:!0}).catch(()=>null).finally(()=>{var t;null==(t=o(this,s2))||t.startPollingForToken()})),null}),[,s]=await (0,is.vd)([t,i()]);if("rejected"===s.status){let t=s.reason;if(iI(t,"requires_captcha"))await i();else throw t}if(null==(e=o(this,s2))||e.setClientUatCookieForDevelopmentInstances(),await o(this,aP).call(this))return;break}catch(t){if(iI(t,"dev_browser_unauthenticated"))await o(this,s2).handleUnauthenticatedDevBrowser();else if(!tl())return void console.warn(t);else throw t}s>=2&&function(){throw Error("".concat(iT," Something went wrong initializing Clerk."))}()}u(this,s5,new sF(this)),o(this,s5).start(),o(this,aO).call(this),o(this,ax).call(this),o(this,aU).call(this),o(this,as).emit(tf,r>0?"degraded":"ready")}}),(0,tn._)(this,"shouldFallbackToCachedResources",()=>!!this.__internal_getCachedResources),c(this,ag,{writable:!0,value:async()=>{let t,e,i=this.shouldFallbackToCachedResources()?1:void 0,n=0;try{[t,e]=await Promise.all([rS.getInstance().fetch({touch:!1,fetchMaxTries:i}),n0.getOrCreateInstance().fetch({fetchMaxTries:i})])}catch(i){if(tE(i)&&"network_error"===i.code&&this.shouldFallbackToCachedResources()){var r;let i=await (null==(r=this.__internal_getCachedResources)?void 0:r.call(this));t=new rS(null==i?void 0:i.environment),n0.clearInstance(),e=n0.getOrCreateInstance(null==i?void 0:i.client),++n}else throw i}this.updateClient(e),this.updateEnvironment(t),o(this,as).emit(tf,n>0?"degraded":"ready")}}),(0,tn._)(this,"__internal_reloadInitialResources",async()=>{let[t,e]=await Promise.all([rS.getInstance().fetch({touch:!1,fetchMaxTries:1}),n0.getOrCreateInstance().fetch({fetchMaxTries:1})]);this.updateClient(e),this.updateEnvironment(t),o(this,aw).call(this)}),c(this,av,{writable:!0,value:t=>{if(t.lastActiveSessionId){let e=t.signedInSessions.find(e=>e.id===t.lastActiveSessionId);if(e)return e}return t.signedInSessions[0]||null}}),c(this,am,{writable:!0,value:()=>{var t,e;tr()&&(null==(t=o(this,an))||t.onPageFocus(()=>{this.session&&!(!(this.environment&&!this.environment.authConfig.singleSessionMode)&&o(this,ar)>Date.now())&&(u(this,ar,Date.now()+5e3),o(this,ai).touchSession&&o(this,ay).call(this,this.session))}),null==(e=o(this,s4))||e.addEventListener("message",t=>{var e;(null==(e=t.data)?void 0:e.type)==="signout"&&this.handleUnauthenticated({broadcast:!1})}),rw.on(rv,()=>{var t;null==(t=o(this,s4))||t.postMessage({type:"signout"})}),rw.on(rm,()=>{var t;iQ.setItem(i$,null==(t=this.environment)?void 0:t.__internal_toSnapshot(),864e5)}))}}),c(this,ay,{writable:!0,value:async t=>{if(!t)return Promise.resolve();await t.touch().catch(t=>{tx(t)&&this.handleUnauthenticated()})}}),c(this,aw,{writable:!0,value:()=>{if(this.client)for(let t of o(this,at))t({client:this.client,session:this.session,user:this.user,organization:this.organization})}}),c(this,ab,{writable:!0,value:()=>{for(let t of o(this,ae))t()}}),c(this,ak,{writable:!0,value:()=>{this.session=void 0,this.organization=void 0,this.user=void 0,o(this,aw).call(this)}}),c(this,aS,{writable:!0,value:()=>{var t;return((null==(t=this.session)?void 0:t.user.organizationMemberships)||[]).map(t=>t.organization).find(t=>{var e;return t.id===(null==(e=this.session)?void 0:e.lastActiveOrganizationId)})||null}}),c(this,aA,{writable:!0,value:t=>{this.session=t||null,this.organization=o(this,aS).call(this),this.user=this.session?this.session.user:null}}),c(this,aI,{writable:!0,value:t=>{var e;return(null==(e=this.client)?void 0:e.signedInSessions.find(e=>e.id===t))||null}}),c(this,ax,{writable:!0,value:()=>{this.addListener(t=>{let{session:e}=t;if(null==e?void 0:e.actor){var i;null==(i=o(this,s6))||i.then(t=>t.ensureMounted()).then(t=>t.mountImpersonationFab())}})}}),c(this,aU,{writable:!0,value:()=>{if(o(this,ai).__internal_keyless_claimKeylessApplicationUrl){var t;null==(t=o(this,s6))||t.then(t=>t.ensureMounted()).then(t=>{t.updateProps({options:{__internal_keyless_claimKeylessApplicationUrl:o(this,ai).__internal_keyless_claimKeylessApplicationUrl,__internal_keyless_copyInstanceKeysUrl:o(this,ai).__internal_keyless_copyInstanceKeysUrl,__internal_keyless_dismissPrompt:o(this,ai).__internal_keyless_dismissPrompt}})})}}}),c(this,aE,{writable:!0,value:(t,e,i)=>{if(!t||!this.loaded||!this.environment||!this.environment.displayConfig)return"";let n=o(this,ai)[t]||this.environment.displayConfig[t];h(this,aa,aM).call(this)&&(n=o(this,ai).signInUrl);let r=new eg(o(this,ai),e).toSearchParams(),s=new URLSearchParams(i||{}),a=er({base:n,hashPath:h(this,aa,aM).call(this)&&"signUpUrl"===t?"/create":"",hashSearchParams:[s,r]},{stringify:!0});return this.buildUrlWithAuth(a)}}),c(this,aP,{writable:!0,value:async()=>{var t,e,i;let n,r,s,a,l=new URLSearchParams(window.location.search).get("redirect_url"),c="production"===this.instanceType,u=null!==l&&(i=this.frontendApi,r=(n=new URL(l,t9)).pathname,s=ec.includes(r)||eu.includes(r),i===n.host&&s);if(c||!u)return!1;let h=this.session,d=o(this,ai).signInUrl||(null==(t=this.environment)?void 0:t.displayConfig.signInUrl),f=d&&window.location.href.startsWith(d),p=o(this,ai).signUpUrl||(null==(e=this.environment)?void 0:e.displayConfig.signUpUrl),_=p&&window.location.href.startsWith(p);return a=new URL(l,t9),(!ec.includes(a.pathname)||!!h||!f&&!_)&&(await this.navigate(this.buildUrlWithAuth(l)),!0)}}),c(this,aC,{writable:!0,value:t=>({...sX,...t,allowedRedirectOrigins:function(t,e,i){if(Array.isArray(t)&&t.length)return t;let n=[];return"undefined"!=typeof window&&window.location&&n.push(window.location.origin),n.push("https://".concat(en(e))),n.push("https://*.".concat(en(e))),"development"===i&&n.push("https://".concat(e)),n}(null==t?void 0:t.allowedRedirectOrigins,this.frontendApi,this.instanceType)})}),c(this,aO,{writable:!0,value:()=>{try{eU(tM),eU(eA),eU(tN),eU("__clerk_handshake"),eU("__clerk_handshake_nonce"),eU("__clerk_help")}catch{}}}),!(t=(t||"").trim()))return ix.throwMissingPublishableKeyError();const n=tK(t);if(!n)return ix.throwInvalidPublishableKeyError({key:t});u(this,s0,null==e?void 0:e.domain),u(this,s1,null==e?void 0:e.proxyUrl),this.environment=rS.getInstance(),u(this,s8,n.instanceType),u(this,sZ,t),u(this,s7,function(t){let e=[],i=[];async function n(t){for await(let i of["undefined"!=typeof window&&window.__internal_onBeforeRequest,...e].filter(t=>t))if(await i(t)===!1)return!1;return!0}async function r(t,e){for await(let n of["undefined"!=typeof window&&window.__internal_onAfterResponse,...i].filter(t=>t))if(await n(t,e)===!1)return!1;return!0}function s(e){let{method:i,path:n,sessionId:r,search:s,rotatingTokenNonce:a}=e,o=new URLSearchParams(s);return o.append("__clerk_api_version","2025-11-10"),o.append("_clerk_js_version","6.0.0-snapshot.v20251217194100"),a&&o.append("rotating_token_nonce",a),t.domain&&"development"===t.instanceType&&t.isSatellite&&o.append("__domain",t.domain),i&&"GET"!==i&&"POST"!==i&&o.append("_method",i),n&&!sD.some(t=>n.startsWith(t))&&r&&o.append("_clerk_session_id",r),t8([...o.entries()].reduce((t,e)=>{let[i,n]=e;return t[i]=n.includes(",")?n.split(","):n,t},{}))}function a(e){let{path:i,pathPrefix:n="v1"}=e;if(t.proxyUrl){let r=new URL(t.proxyUrl),a=r.pathname.slice(1);return a.endsWith("/")&&(a=a.slice(0,-1)),er({base:r.origin,pathname:"".concat(a,"/").concat(n).concat(i),search:s(e)},{stringify:!1})}let r="production"===t.instanceType?t.domain:"";return er({base:"https://".concat(r||t.frontendApi),pathname:"".concat(n).concat(i),search:s(e)},{stringify:!1})}async function o(e,i){let s,o={...e},{method:l="GET",body:c}=o;!c||"object"!=typeof c||c instanceof FormData||(o.body=function(t){if(!t||"object"!=typeof t||Object.getPrototypeOf(t)!==Object.prototype)return t;let e={};for(let[i,n]of Object.entries(t))void 0!==n&&(e[i]=n);return e}(c)),o.url=a({...o,sessionId:t.getSessionId()}),o.headers=new Headers(o.headers),"GET"===l||c instanceof FormData||o.headers.has("content-type")||o.headers.set("content-type","application/x-www-form-urlencoded"),"application/x-www-form-urlencoded"===o.headers.get("content-type")&&(o.body=c?t8(c,{keyEncoder:t2}):c);let u=await n(o),h="GET"===l?"GET":"POST",d=o.url,f={...o,method:h,credentials:o.credentials||"include"};try{if(u){var p;let t=null!=(p=null==i?void 0:i.fetchMaxTries)?p:to()?4:11;s=await iv(()=>fetch(d,f),{retryImmediately:!0,initialDelay:700,maxDelayBetweenRetries:5e3,shouldRetry:(e,i)=>"GET"===h&&i<t,onBeforeRetry:t=>{d.searchParams.set("_clerk_retry_attempt",t.toString())}})}else s=new Response("{}",o)}catch(e){let t=d.toString();id.error("network error",{error:e,url:t,method:l},"fapiClient");throw Error("".concat(iT,' Network error at "').concat(t,'" - ').concat(e,". Please try again."))}let _=204!==s.status?await s.json():null,g=Object.assign(s,{payload:_});return s.ok||id.error("request failed",{method:l,path:o.path,status:s.status},"fapiClient"),await r(o,g),g}return{buildEmailAddress:function(e){return function(t){let{localPart:e,frontendApi:i}=t;return"".concat(e,"@").concat(i?i.replace("clerk.",""):"clerk.com")}({localPart:e,frontendApi:t.frontendApi})},buildUrl:a,onAfterResponse:function(t){i.push(t)},onBeforeRequest:function(t){e.push(t)},request:o}}({domain:this.domain,frontendApi:this.frontendApi,instanceType:this.instanceType,isSatellite:this.isSatellite,getSessionId:()=>{var t;return null==(t=this.session)?void 0:t.id},proxyUrl:this.proxyUrl})),o(this,as).emit(tf,"loading"),o(this,as).prioritizedOn(tf,t=>u(this,s9,t)),i7.clerk=this,u(this,s3,new sV)}}function aM(){let t;return!!(!o(this,ai).signUpUrl&&o(this,ai).signInUrl&&(t=o(this,ai).signInUrl,!tY.test(t)))}function aN(){let t=eN;return o(this,ai).allowedRedirectProtocols&&(t=t.concat(o(this,ai).allowedRedirectProtocols)),t}(0,tn._)(aR,"version","6.0.0-snapshot.v20251217194100"),(0,tn._)(aR,"sdkMetadata",{name:"@clerk/clerk-js",version:"6.0.0-snapshot.v20251217194100"}),(0,tn._)(aR,"_billing",void 0),(0,tn._)(aR,"_apiKeys",void 0);let az=(null==(tt=document.querySelector("script[data-clerk-publishable-key]"))?void 0:tt.getAttribute("data-clerk-publishable-key"))||window.__clerk_publishable_key||"",aW=(null==(te=document.querySelector("script[data-clerk-proxy-url]"))?void 0:te.getAttribute("data-clerk-proxy-url"))||window.__clerk_proxy_url||"",aF=(null==(ti=document.querySelector("script[data-clerk-domain]"))?void 0:ti.getAttribute("data-clerk-domain"))||window.__clerk_domain||"";window.Clerk||(window.Clerk=new aR(az,{proxyUrl:aW,domain:aF}))})(),{}})());
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(globalThis,()=>(()=>{var t,e,i,n={8326:function(t,e,i){"use strict";i(9166),i(4261),i(1300),i(7918),i(574),i(5992),i(8385),i(5208),i(2935),i(9356),i(5702),i(9091),i(6178),i(4784),i(1747);var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,s){function a(t){try{l(n.next(t))}catch(t){s(t)}}function o(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(a,o)}l((n=n.apply(t,e||[])).next())})},r=this&&this.__generator||function(t,e){var i,n,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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){var l=[s,o];if(i)throw TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&l[0]?n.return:l[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;switch(n=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){a.label=l[1];break}if(6===l[0]&&a.label<r[1]){a.label=r[1],r=l;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(l);break}r[2]&&a.ops.pop(),a.trys.pop();continue}l=e.call(t,a)}catch(t){l=[6,t],n=0}finally{i=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}},s=this;Object.defineProperty(e,"__esModule",{value:!0});var a=i(6599),o="browser-tabs-lock-key",l={key:function(t){return n(s,void 0,void 0,function(){return r(this,function(t){throw Error("Unsupported")})})},getItem:function(t){return n(s,void 0,void 0,function(){return r(this,function(t){throw Error("Unsupported")})})},clear:function(){return n(s,void 0,void 0,function(){return r(this,function(t){return[2,window.localStorage.clear()]})})},removeItem:function(t){return n(s,void 0,void 0,function(){return r(this,function(t){throw Error("Unsupported")})})},setItem:function(t,e){return n(s,void 0,void 0,function(){return r(this,function(t){throw Error("Unsupported")})})},keySync:function(t){return window.localStorage.key(t)},getItemSync:function(t){return window.localStorage.getItem(t)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(t){return window.localStorage.removeItem(t)},setItemSync:function(t,e){return window.localStorage.setItem(t,e)}};function c(t){return new Promise(function(e){return setTimeout(e,t)})}function u(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="",n=0;n<t;n++){var r=Math.floor(Math.random()*e.length);i+=e[r]}return i}e.default=function(){function t(e){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(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),this.storageHandler=e,void 0===t.waiters&&(t.waiters=[])}return t.prototype.acquireLock=function(e,i){return void 0===i&&(i=5e3),n(this,void 0,void 0,function(){var n,s,a,h,d,f,p;return r(this,function(r){switch(r.label){case 0:n=Date.now()+u(4),s=Date.now()+i,a=o+"-"+e,h=void 0===this.storageHandler?l:this.storageHandler,r.label=1;case 1:if(!(Date.now()<s))return[3,8];return[4,c(30)];case 2:if(r.sent(),null!==h.getItemSync(a))return[3,5];return d=this.id+"-"+e+"-"+n,[4,c(Math.floor(25*Math.random()))];case 3:return r.sent(),h.setItemSync(a,JSON.stringify({id:this.id,iat:n,timeoutKey:d,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:if(r.sent(),null!==(f=h.getItemSync(a))&&(p=JSON.parse(f)).id===this.id&&p.iat===n)return this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(a,n),[2,!0];return[3,7];case 5:return t.lockCorrector(void 0===this.storageHandler?l:this.storageHandler),[4,this.waitForSomethingToChange(s)];case 6:r.sent(),r.label=7;case 7:return n=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},t.prototype.refreshLockWhileAcquired=function(t,e){return n(this,void 0,void 0,function(){var i=this;return r(this,function(s){return setTimeout(function(){return n(i,void 0,void 0,function(){var i,n,s;return r(this,function(r){switch(r.label){case 0:return[4,a.default().lock(e)];case 1:if(r.sent(),!this.acquiredIatSet.has(e)||null===(n=(i=void 0===this.storageHandler?l:this.storageHandler).getItemSync(t)))return a.default().unlock(e),[2];return(s=JSON.parse(n)).timeRefreshed=Date.now(),i.setItemSync(t,JSON.stringify(s)),a.default().unlock(e),this.refreshLockWhileAcquired(t,e),[2]}})})},1e3),[2]})})},t.prototype.waitForSomethingToChange=function(e){return n(this,void 0,void 0,function(){return r(this,function(i){switch(i.label){case 0:return[4,new Promise(function(i){var n=!1,r=Date.now(),s=!1;function a(){if(s||(window.removeEventListener("storage",a),t.removeFromWaiting(a),clearTimeout(o),s=!0),!n){n=!0;var e=50-(Date.now()-r);e>0?setTimeout(i,e):i(null)}}window.addEventListener("storage",a),t.addToWaiting(a);var o=setTimeout(a,Math.max(0,e-Date.now()))})];case 1:return i.sent(),[2]}})})},t.addToWaiting=function(e){this.removeFromWaiting(e),void 0!==t.waiters&&t.waiters.push(e)},t.removeFromWaiting=function(e){void 0!==t.waiters&&(t.waiters=t.waiters.filter(function(t){return t!==e}))},t.notifyWaiters=function(){void 0!==t.waiters&&t.waiters.slice().forEach(function(t){return t()})},t.prototype.releaseLock=function(t){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.releaseLock__private__(t)];case 1:return[2,e.sent()]}})})},t.prototype.releaseLock__private__=function(e){return n(this,void 0,void 0,function(){var i,n,s,c;return r(this,function(r){switch(r.label){case 0:if(i=void 0===this.storageHandler?l:this.storageHandler,n=o+"-"+e,null===(s=i.getItemSync(n)))return[2];if((c=JSON.parse(s)).id!==this.id)return[3,2];return[4,a.default().lock(c.iat)];case 1:r.sent(),this.acquiredIatSet.delete(c.iat),i.removeItemSync(n),a.default().unlock(c.iat),t.notifyWaiters(),r.label=2;case 2:return[2]}})})},t.lockCorrector=function(e){for(var i=Date.now()-5e3,n=[],r=0;;){var s=e.keySync(r);if(null===s)break;n.push(s),r++}for(var a=!1,l=0;l<n.length;l++){var c=n[l];if(c.includes(o)){var u=e.getItemSync(c);if(null!==u){var h=JSON.parse(u);(void 0===h.timeRefreshed&&h.timeAcquired<i||void 0!==h.timeRefreshed&&h.timeRefreshed<i)&&(e.removeItemSync(c),a=!0)}}}a&&t.notifyWaiters()},t.waiters=void 0,t}()},6599:function(t,e,i){"use strict";i(4261),i(4085),i(9166),Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){var t=this;this.locked=new Map,this.addToLocked=function(e,i){var n=t.locked.get(e);void 0===n?void 0===i?t.locked.set(e,[]):t.locked.set(e,[i]):void 0!==i&&(n.unshift(i),t.locked.set(e,n))},this.isLocked=function(e){return t.locked.has(e)},this.lock=function(e){return new Promise(function(i,n){t.isLocked(e)?t.addToLocked(e,i):(t.addToLocked(e),i())})},this.unlock=function(e){var i=t.locked.get(e);if(void 0===i||0===i.length)return void t.locked.delete(e);var n=i.pop();t.locked.set(e,i),void 0!==n&&setTimeout(n,0)}}return t.getInstance=function(){return void 0===t.instance&&(t.instance=new t),t.instance},t}();e.default=function(){return n.getInstance()}},1006:function(t,e,i){i(1300),i(6843),i(6764),i(4853),i(4891),t.exports=function(t,e){if("string"!=typeof t)throw TypeError("Expected a string");for(var i,n=String(t),r="",s=!!e&&!!e.extended,a=!!e&&!!e.globstar,o=!1,l=e&&"string"==typeof e.flags?e.flags:"",c=0,u=n.length;c<u;c++)switch(i=n[c]){case"/":case"$":case"^":case"+":case".":case"(":case")":case"=":case"!":case"|":r+="\\"+i;break;case"?":if(s){r+=".";break}case"[":case"]":if(s){r+=i;break}case"{":if(s){o=!0,r+="(";break}case"}":if(s){o=!1,r+=")";break}case",":if(o){r+="|";break}r+="\\"+i;break;case"*":for(var h=n[c-1],d=1;"*"===n[c+1];)d++,c++;var f=n[c+1];a?d>1&&("/"===h||void 0===h)&&("/"===f||void 0===f)?(r+="((?:[^/]*(?:/|$))*)",c++):r+="([^/]*)":r+=".*";break;default:r+=i}return l&&~l.indexOf("g")||(r="^"+r+"$"),new RegExp(r,l)}},6382:function(t,e,i){"use strict";var n=i(8801),r=i(2123),s=TypeError;t.exports=function(t){if(n(t))return t;throw new s(r(t)+" is not a function")}},7592:function(t,e,i){"use strict";var n=i(2049),r=i(2123),s=TypeError;t.exports=function(t){if(n(t))return t;throw new s(r(t)+" is not a constructor")}},5982:function(t,e,i){"use strict";var n=i(2585),r=String,s=TypeError;t.exports=function(t){if(n(t))return t;throw new s("Can't set "+r(t)+" as a prototype")}},6148:function(t,e,i){"use strict";var n=i(3110).has;t.exports=function(t){return n(t),t}},7161:function(t,e,i){"use strict";var n=i(4735),r=i(5012),s=i(4773).f,a=n("unscopables"),o=Array.prototype;void 0===o[a]&&s(o,a,{configurable:!0,value:r(null)}),t.exports=function(t){o[a][t]=!0}},1857:function(t,e,i){"use strict";var n=i(5059).charAt;t.exports=function(t,e,i){return e+(i?n(t,e).length:1)}},5275:function(t,e,i){"use strict";var n=i(5533),r=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw new r("Incorrect invocation")}},3:function(t,e,i){"use strict";var n=i(9414),r=String,s=TypeError;t.exports=function(t){if(n(t))return t;throw new s(r(t)+" is not an object")}},255:function(t){"use strict";t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},4158:function(t,e,i){"use strict";var n=i(7604),r=i(1190),s=i(4380),a=n.ArrayBuffer,o=n.TypeError;t.exports=a&&r(a.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==s(t))throw new o("ArrayBuffer expected");return t.byteLength}},2674:function(t,e,i){"use strict";var n=i(7604),r=i(255),s=i(4158),a=n.DataView;t.exports=function(t){if(!r||0!==s(t))return!1;try{return new a(t),!1}catch(t){return!0}}},6509:function(t,e,i){"use strict";var n=i(2674),r=TypeError;t.exports=function(t){if(n(t))throw new r("ArrayBuffer is detached");return t}},4088:function(t,e,i){"use strict";var n=i(7604),r=i(2196),s=i(1190),a=i(7932),o=i(6509),l=i(4158),c=i(4791),u=i(1200),h=n.structuredClone,d=n.ArrayBuffer,f=n.DataView,p=Math.min,_=d.prototype,g=f.prototype,v=r(_.slice),m=s(_,"resizable","get"),y=s(_,"maxByteLength","get"),w=r(g.getInt8),b=r(g.setInt8);t.exports=(u||c)&&function(t,e,i){var n,r=l(t),s=void 0===e?r:a(e),_=!m||!m(t);if(o(t),u&&(t=h(t,{transfer:[t]}),r===s&&(i||_)))return t;if(r>=s&&(!i||_))n=v(t,0,s);else{n=new d(s,i&&!_&&y?{maxByteLength:y(t)}:void 0);for(var g=new f(t),k=new f(n),S=p(s,r),A=0;A<S;A++)b(k,A,w(g,A))}return u||c(t),n}},5200:function(t,e,i){"use strict";var n,r,s,a=i(255),o=i(4032),l=i(7604),c=i(8801),u=i(9414),h=i(4461),d=i(6471),f=i(2123),p=i(3599),_=i(1764),g=i(1782),v=i(5533),m=i(9623),y=i(6307),w=i(4735),b=i(8916),k=i(4769),S=k.enforce,A=k.get,I=l.Int8Array,x=I&&I.prototype,U=l.Uint8ClampedArray,E=U&&U.prototype,P=I&&m(I),C=x&&m(x),O=Object.prototype,T=l.TypeError,R=w("toStringTag"),M=b("TYPED_ARRAY_TAG"),N="TypedArrayConstructor",W=a&&!!y&&"Opera"!==d(l.opera),z=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},D={BigInt64Array:8,BigUint64Array:8},L=function(t){var e=m(t);if(u(e)){var i=A(e);return i&&h(i,N)?i[N]:L(e)}},j=function(t){if(!u(t))return!1;var e=d(t);return h(F,e)||h(D,e)};for(n in F)(s=(r=l[n])&&r.prototype)?S(s)[N]=r:W=!1;for(n in D)(s=(r=l[n])&&r.prototype)&&(S(s)[N]=r);if((!W||!c(P)||P===Function.prototype)&&(P=function(){throw new T("Incorrect invocation")},W))for(n in F)l[n]&&y(l[n],P);if((!W||!C||C===O)&&(C=P.prototype,W))for(n in F)l[n]&&y(l[n].prototype,C);if(W&&m(E)!==C&&y(E,C),o&&!h(C,R))for(n in z=!0,g(C,R,{configurable:!0,get:function(){return u(this)?this[M]:void 0}}),F)l[n]&&p(l[n],M,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:W,TYPED_ARRAY_TAG:z&&M,aTypedArray:function(t){if(j(t))return t;throw new T("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!y||v(P,t)))return t;throw new T(f(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i,n){if(o){if(i)for(var r in F){var s=l[r];if(s&&h(s.prototype,t))try{delete s.prototype[t]}catch(i){try{s.prototype[t]=e}catch(t){}}}(!C[t]||i)&&_(C,t,i?e:W&&x[t]||e,n)}},exportTypedArrayStaticMethod:function(t,e,i){var n,r;if(o){if(y){if(i){for(n in F)if((r=l[n])&&h(r,t))try{delete r[t]}catch(t){}}if(P[t]&&!i)return;try{return _(P,t,i?e:W&&P[t]||e)}catch(t){}}for(n in F)(r=l[n])&&(!r[t]||i)&&_(r,t,e)}},getTypedArrayConstructor:L,isView:function(t){if(!u(t))return!1;var e=d(t);return"DataView"===e||h(F,e)||h(D,e)},isTypedArray:j,TypedArray:P,TypedArrayPrototype:C}},8158:function(t,e,i){"use strict";var n=i(7604),r=i(2196),s=i(4032),a=i(255),o=i(5410),l=i(3599),c=i(1782),u=i(2267),h=i(7683),d=i(5275),f=i(3231),p=i(4514),_=i(7932),g=i(7125),v=i(6590),m=i(9623),y=i(6307),w=i(7793),b=i(4892),k=i(5779),S=i(2088),A=i(2099),I=i(4769),x=o.PROPER,U=o.CONFIGURABLE,E="ArrayBuffer",P="DataView",C="prototype",O="Wrong index",T=I.getterFor(E),R=I.getterFor(P),M=I.set,N=n[E],W=N,z=W&&W[C],F=n[P],D=F&&F[C],L=Object.prototype,j=n.Array,B=n.RangeError,V=r(w),J=r([].reverse),K=v.pack,q=v.unpack,H=function(t){return[255&t]},G=function(t){return[255&t,t>>8&255]},$=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},X=function(t){return K(g(t),23,4)},Q=function(t){return K(t,52,8)},Z=function(t,e,i){c(t[C],e,{configurable:!0,get:function(){return i(this)[e]}})},tt=function(t,e,i,n){var r=R(t),s=_(i);if(s+e>r.byteLength)throw new B(O);var a=r.bytes,o=s+r.byteOffset,l=b(a,o,o+e);return n?l:J(l)},te=function(t,e,i,n,r,s){var a=R(t),o=_(i),l=n(+r),c=!!s;if(o+e>a.byteLength)throw new B(O);for(var u=a.bytes,h=o+a.byteOffset,d=0;d<e;d++)u[h+d]=l[c?d:e-d-1]};if(a){var ti=x&&N.name!==E;!h(function(){N(1)})||!h(function(){new N(-1)})||h(function(){return new N,new N(1.5),new N(NaN),1!==N.length||ti&&!U})?((W=function(t){return d(this,z),k(new N(_(t)),this,W)})[C]=z,z.constructor=W,S(W,N)):ti&&U&&l(N,"name",E),y&&m(D)!==L&&y(D,L);var tn=new F(new W(2)),tr=r(D.setInt8);tn.setInt8(0,0x80000000),tn.setInt8(1,0x80000001),(tn.getInt8(0)||!tn.getInt8(1))&&u(D,{setInt8:function(t,e){tr(this,t,e<<24>>24)},setUint8:function(t,e){tr(this,t,e<<24>>24)}},{unsafe:!0})}else z=(W=function(t){d(this,z);var e=_(t);M(this,{type:E,bytes:V(j(e),0),byteLength:e}),s||(this.byteLength=e,this.detached=!1)})[C],D=(F=function(t,e,i){d(this,D),d(t,z);var n=T(t),r=n.byteLength,a=f(e);if(a<0||a>r)throw new B("Wrong offset");if(i=void 0===i?r-a:p(i),a+i>r)throw new B("Wrong length");M(this,{type:P,buffer:t,byteLength:i,byteOffset:a,bytes:n.bytes}),s||(this.buffer=t,this.byteLength=i,this.byteOffset=a)})[C],s&&(Z(W,"byteLength",T),Z(F,"buffer",R),Z(F,"byteLength",R),Z(F,"byteOffset",R)),u(D,{getInt8:function(t){return tt(this,1,t)[0]<<24>>24},getUint8:function(t){return tt(this,1,t)[0]},getInt16:function(t){var e=tt(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=tt(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Y(tt(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Y(tt(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return q(tt(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return q(tt(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){te(this,1,t,H,e)},setUint8:function(t,e){te(this,1,t,H,e)},setInt16:function(t,e){te(this,2,t,G,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){te(this,2,t,G,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){te(this,4,t,$,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){te(this,4,t,$,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){te(this,4,t,X,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){te(this,8,t,Q,e,arguments.length>2&&arguments[2])}});A(W,E),A(F,P),t.exports={ArrayBuffer:W,DataView:F}},7793:function(t,e,i){"use strict";var n=i(3561),r=i(6926),s=i(4370);t.exports=function(t){for(var e=n(this),i=s(e),a=arguments.length,o=r(a>1?arguments[1]:void 0,i),l=a>2?arguments[2]:void 0,c=void 0===l?i:r(l,i);c>o;)e[o++]=t;return e}},9974:function(t,e,i){"use strict";var n=i(4370);t.exports=function(t,e,i){for(var r=0,s=arguments.length>2?i:n(e),a=new t(s);s>r;)a[r]=e[r++];return a}},4872:function(t,e,i){"use strict";var n=i(3516),r=i(7625),s=i(3561),a=i(9955),o=i(8269),l=i(2049),c=i(4370),u=i(7180),h=i(6573),d=i(7623),f=Array;t.exports=function(t){var e,i,p,_,g,v,m=s(t),y=l(this),w=arguments.length,b=w>1?arguments[1]:void 0,k=void 0!==b;k&&(b=n(b,w>2?arguments[2]:void 0));var S=d(m),A=0;if(S&&!(this===f&&o(S)))for(i=y?new this:[],g=(_=h(m,S)).next;!(p=r(g,_)).done;A++)v=k?a(_,b,[p.value,A],!0):p.value,u(i,A,v);else for(e=c(m),i=y?new this(e):f(e);e>A;A++)v=k?b(m[A],A):m[A],u(i,A,v);return i.length=A,i}},6845:function(t,e,i){"use strict";var n=i(6905),r=i(6926),s=i(4370),a=function(t){return function(e,i,a){var o,l=n(e),c=s(l);if(0===c)return!t&&-1;var u=r(a,c);if(t&&i!=i){for(;c>u;)if((o=l[u++])!=o)return!0}else for(;c>u;u++)if((t||u in l)&&l[u]===i)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},3691:function(t,e,i){"use strict";var n=i(3516),r=i(1395),s=i(3561),a=i(4370),o=function(t){var e=1===t;return function(i,o,l){for(var c,u=s(i),h=r(u),d=a(h),f=n(o,l);d-- >0;)if(f(c=h[d],d,u))switch(t){case 0:return c;case 1:return d}return e?-1:void 0}};t.exports={findLast:o(0),findLastIndex:o(1)}},9425:function(t,e,i){"use strict";var n=i(3516),r=i(2196),s=i(1395),a=i(3561),o=i(4370),l=i(4193),c=r([].push),u=function(t){var e=1===t,i=2===t,r=3===t,u=4===t,h=6===t,d=7===t,f=5===t||h;return function(p,_,g,v){for(var m,y,w=a(p),b=s(w),k=o(b),S=n(_,g),A=0,I=v||l,x=e?I(p,k):i||d?I(p,0):void 0;k>A;A++)if((f||A in b)&&(y=S(m=b[A],A,w),t))if(e)x[A]=y;else if(y)switch(t){case 3:return!0;case 5:return m;case 6:return A;case 2:c(x,m)}else switch(t){case 4:return!1;case 7:c(x,m)}return h?-1:r||u?u:x}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},5122:function(t,e,i){"use strict";var n=i(7683);t.exports=function(t,e){var i=[][t];return!!i&&n(function(){i.call(null,e||function(){return 1},1)})}},8466:function(t,e,i){"use strict";var n=i(6382),r=i(3561),s=i(1395),a=i(4370),o=TypeError,l="Reduce of empty array with no initial value",c=function(t){return function(e,i,c,u){var h=r(e),d=s(h),f=a(h);if(n(i),0===f&&c<2)throw new o(l);var p=t?f-1:0,_=t?-1:1;if(c<2)for(;;){if(p in d){u=d[p],p+=_;break}if(p+=_,t?p<0:f<=p)throw new o(l)}for(;t?p>=0:f>p;p+=_)p in d&&(u=i(u,d[p],p,h));return u}};t.exports={left:c(!1),right:c(!0)}},323:function(t,e,i){"use strict";var n=i(4032),r=i(7708),s=TypeError,a=Object.getOwnPropertyDescriptor;t.exports=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(r(t)&&!a(t,"length").writable)throw new s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},4892:function(t,e,i){"use strict";t.exports=i(2196)([].slice)},1836:function(t,e,i){"use strict";var n=i(4892),r=Math.floor,s=function(t,e){var i=t.length;if(i<8)for(var a,o,l=1;l<i;){for(o=l,a=t[l];o&&e(t[o-1],a)>0;)t[o]=t[--o];o!==l++&&(t[o]=a)}else for(var c=r(i/2),u=s(n(t,0,c),e),h=s(n(t,c),e),d=u.length,f=h.length,p=0,_=0;p<d||_<f;)t[p+_]=p<d&&_<f?0>=e(u[p],h[_])?u[p++]:h[_++]:p<d?u[p++]:h[_++];return t};t.exports=s},4109:function(t,e,i){"use strict";var n=i(7708),r=i(2049),s=i(9414),a=i(4735)("species"),o=Array;t.exports=function(t){var e;return n(t)&&(r(e=t.constructor)&&(e===o||n(e.prototype))?e=void 0:s(e)&&null===(e=e[a])&&(e=void 0)),void 0===e?o:e}},4193:function(t,e,i){"use strict";var n=i(4109);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},2152:function(t,e,i){"use strict";var n=i(4370);t.exports=function(t,e){for(var i=n(t),r=new e(i),s=0;s<i;s++)r[s]=t[i-s-1];return r}},5500:function(t,e,i){"use strict";var n=i(4370),r=i(3231),s=RangeError;t.exports=function(t,e,i,a){var o=n(t),l=r(i),c=l<0?o+l:l;if(c>=o||c<0)throw new s("Incorrect index");for(var u=new e(o),h=0;h<o;h++)u[h]=h===c?a:t[h];return u}},9955:function(t,e,i){"use strict";var n=i(3),r=i(4831);t.exports=function(t,e,i,s){try{return s?e(n(i)[0],i[1]):e(i)}catch(e){r(t,"throw",e)}}},856:function(t,e,i){"use strict";var n=i(4735)("iterator"),r=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){r=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){try{if(!e&&!r)return!1}catch(t){return!1}var i=!1;try{var s={};s[n]=function(){return{next:function(){return{done:i=!0}}}},t(s)}catch(t){}return i}},4380:function(t,e,i){"use strict";var n=i(2196),r=n({}.toString),s=n("".slice);t.exports=function(t){return s(r(t),8,-1)}},6471:function(t,e,i){"use strict";var n=i(5384),r=i(8801),s=i(4380),a=i(4735)("toStringTag"),o=Object,l="Arguments"===s(function(){return arguments}()),c=function(t,e){try{return t[e]}catch(t){}};t.exports=n?s:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=c(e=o(t),a))?i:l?s(e):"Object"===(n=s(e))&&r(e.callee)?"Arguments":n}},2088:function(t,e,i){"use strict";var n=i(4461),r=i(9339),s=i(6047),a=i(4773);t.exports=function(t,e,i){for(var o=r(e),l=a.f,c=s.f,u=0;u<o.length;u++){var h=o[u];n(t,h)||i&&n(i,h)||l(t,h,c(e,h))}}},5447:function(t,e,i){"use strict";t.exports=!i(7683)(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},1597:function(t){"use strict";t.exports=function(t,e){return{value:t,done:e}}},3599:function(t,e,i){"use strict";var n=i(4032),r=i(4773),s=i(1056);t.exports=n?function(t,e,i){return r.f(t,e,s(1,i))}:function(t,e,i){return t[e]=i,t}},1056:function(t){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},7180:function(t,e,i){"use strict";var n=i(4032),r=i(4773),s=i(1056);t.exports=function(t,e,i){n?r.f(t,e,s(0,i)):t[e]=i}},1782:function(t,e,i){"use strict";var n=i(2335),r=i(4773);t.exports=function(t,e,i){return i.get&&n(i.get,e,{getter:!0}),i.set&&n(i.set,e,{setter:!0}),r.f(t,e,i)}},1764:function(t,e,i){"use strict";var n=i(8801),r=i(4773),s=i(2335),a=i(9269);t.exports=function(t,e,i,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:e;if(n(i)&&s(i,c,o),o.global)l?t[e]=i:a(e,i);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=i:r.f(t,e,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},2267:function(t,e,i){"use strict";var n=i(1764);t.exports=function(t,e,i){for(var r in e)n(t,r,e[r],i);return t}},9269:function(t,e,i){"use strict";var n=i(7604),r=Object.defineProperty;t.exports=function(t,e){try{r(n,t,{value:e,configurable:!0,writable:!0})}catch(i){n[t]=e}return e}},1946:function(t,e,i){"use strict";var n=i(2123),r=TypeError;t.exports=function(t,e){if(!delete t[e])throw new r("Cannot delete property "+n(e)+" of "+n(t))}},4032:function(t,e,i){"use strict";t.exports=!i(7683)(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4791:function(t,e,i){"use strict";var n,r,s,a,o=i(7604),l=i(5961),c=i(1200),u=o.structuredClone,h=o.ArrayBuffer,d=o.MessageChannel,f=!1;if(c)f=function(t){u(t,{transfer:[t]})};else if(h)try{!d&&(n=l("worker_threads"))&&(d=n.MessageChannel),d&&(r=new d,s=new h(2),a=function(t){r.port1.postMessage(null,[t])},2===s.byteLength&&(a(s),0===s.byteLength&&(f=a)))}catch(t){}t.exports=f},4307:function(t,e,i){"use strict";var n=i(7604),r=i(9414),s=n.document,a=r(s)&&r(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},9481:function(t){"use strict";var e=TypeError;t.exports=function(t){if(t>0x1fffffffffffff)throw e("Maximum allowed index exceeded");return t}},1430:function(t){"use strict";t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8828:function(t){"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},5396:function(t,e,i){"use strict";var n=i(4307)("span").classList,r=n&&n.constructor&&n.constructor.prototype;t.exports=r===Object.prototype?void 0:r},3155:function(t){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},673:function(t,e,i){"use strict";var n=i(667).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},2927:function(t,e,i){"use strict";var n=i(667);t.exports=/MSIE|Trident/.test(n)},9101:function(t,e,i){"use strict";var n=i(667);t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},516:function(t,e,i){"use strict";var n=i(667);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},1037:function(t,e,i){"use strict";t.exports="NODE"===i(8995)},7256:function(t,e,i){"use strict";var n=i(667);t.exports=/web0s(?!.*chrome)/i.test(n)},667:function(t,e,i){"use strict";var n=i(7604).navigator,r=n&&n.userAgent;t.exports=r?String(r):""},6315:function(t,e,i){"use strict";var n,r,s=i(7604),a=i(667),o=s.process,l=s.Deno,c=o&&o.versions||l&&l.version,u=c&&c.v8;u&&(r=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(r=+n[1]),t.exports=r},5827:function(t,e,i){"use strict";var n=i(667).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},8995:function(t,e,i){"use strict";var n=i(7604),r=i(667),s=i(4380),a=function(t){return r.slice(0,t.length)===t};t.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===s(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},2237:function(t,e,i){"use strict";var n=i(2196),r=Error,s=n("".replace),a=String(new r("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);t.exports=function(t,e){if(l&&"string"==typeof t&&!r.prepareStackTrace)for(;e--;)t=s(t,o,"");return t}},5143:function(t,e,i){"use strict";var n=i(3599),r=i(2237),s=i(4623),a=Error.captureStackTrace;t.exports=function(t,e,i,o){s&&(a?a(t,e):n(t,"stack",r(i,o)))}},4623:function(t,e,i){"use strict";var n=i(7683),r=i(1056);t.exports=!n(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",r(1,7)),7!==t.stack)})},5258:function(t,e,i){"use strict";var n=i(7604),r=i(6047).f,s=i(3599),a=i(1764),o=i(9269),l=i(2088),c=i(8696);t.exports=function(t,e){var i,u,h,d,f,p=t.target,_=t.global,g=t.stat;if(i=_?n:g?n[p]||o(p,{}):n[p]&&n[p].prototype)for(u in e){if(d=e[u],h=t.dontCallGetSet?(f=r(i,u))&&f.value:i[u],!c(_?u:p+(g?".":"#")+u,t.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(t.sham||h&&h.sham)&&s(d,"sham",!0),a(i,u,d,t)}}},7683:function(t){"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},4016:function(t,e,i){"use strict";i(4891);var n=i(7625),r=i(1764),s=i(4495),a=i(7683),o=i(4735),l=i(3599),c=o("species"),u=RegExp.prototype;t.exports=function(t,e,i,h){var d=o(t),f=!a(function(){var e={};return e[d]=function(){return 7},7!==""[t](e)}),p=f&&!a(function(){var e=!1,i=/a/;return"split"===t&&((i={}).constructor={},i.constructor[c]=function(){return i},i.flags="",i[d]=/./[d]),i.exec=function(){return e=!0,null},i[d](""),!e});if(!f||!p||i){var _=/./[d],g=e(d,""[t],function(t,e,i,r,a){var o=e.exec;return o===s||o===u.exec?f&&!a?{done:!0,value:n(_,e,i,r)}:{done:!0,value:n(t,i,e,r)}:{done:!1}});r(String.prototype,t,g[0]),r(u,d,g[1])}h&&l(u[d],"sham",!0)}},7957:function(t,e,i){"use strict";var n=i(8724),r=Function.prototype,s=r.apply,a=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(s):function(){return a.apply(s,arguments)})},3516:function(t,e,i){"use strict";var n=i(5344),r=i(6382),s=i(8724),a=n(n.bind);t.exports=function(t,e){return r(t),void 0===e?t:s?a(t,e):function(){return t.apply(e,arguments)}}},8724:function(t,e,i){"use strict";t.exports=!i(7683)(function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},7625:function(t,e,i){"use strict";var n=i(8724),r=Function.prototype.call;t.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},5410:function(t,e,i){"use strict";var n=i(4032),r=i(4461),s=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,o=r(s,"name"),l=o&&(!n||n&&a(s,"name").configurable);t.exports={EXISTS:o,PROPER:o&&"something"===(function(){}).name,CONFIGURABLE:l}},1190:function(t,e,i){"use strict";var n=i(2196),r=i(6382);t.exports=function(t,e,i){try{return n(r(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}}},5344:function(t,e,i){"use strict";var n=i(4380),r=i(2196);t.exports=function(t){if("Function"===n(t))return r(t)}},2196:function(t,e,i){"use strict";var n=i(8724),r=Function.prototype,s=r.call,a=n&&r.bind.bind(s,s);t.exports=n?a:function(t){return function(){return s.apply(t,arguments)}}},5961:function(t,e,i){"use strict";var n=i(7604),r=i(1037);t.exports=function(t){if(r){try{return n.process.getBuiltinModule(t)}catch(t){}try{return Function('return require("'+t+'")')()}catch(t){}}}},3579:function(t,e,i){"use strict";var n=i(7604),r=i(8801);t.exports=function(t,e){var i;return arguments.length<2?r(i=n[t])?i:void 0:n[t]&&n[t][e]}},1147:function(t){"use strict";t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},7623:function(t,e,i){"use strict";var n=i(6471),r=i(5378),s=i(4449),a=i(577),o=i(4735)("iterator");t.exports=function(t){if(!s(t))return r(t,o)||r(t,"@@iterator")||a[n(t)]}},6573:function(t,e,i){"use strict";var n=i(7625),r=i(6382),s=i(3),a=i(2123),o=i(7623),l=TypeError;t.exports=function(t,e){var i=arguments.length<2?o(t):e;if(r(i))return s(n(i,t));throw new l(a(t)+" is not iterable")}},5378:function(t,e,i){"use strict";var n=i(6382),r=i(4449);t.exports=function(t,e){var i=t[e];return r(i)?void 0:n(i)}},5193:function(t,e,i){"use strict";var n=i(6382),r=i(3),s=i(7625),a=i(3231),o=i(1147),l="Invalid size",c=RangeError,u=TypeError,h=Math.max,d=function(t,e){this.set=t,this.size=h(e,0),this.has=n(t.has),this.keys=n(t.keys)};d.prototype={getIterator:function(){return o(r(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}},t.exports=function(t){r(t);var e=+t.size;if(e!=e)throw new u(l);var i=a(e);if(i<0)throw new c(l);return new d(t,i)}},4242:function(t,e,i){"use strict";var n=i(2196),r=i(3561),s=Math.floor,a=n("".charAt),o=n("".replace),l=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,i,n,h,d){var f=i+t.length,p=n.length,_=u;return void 0!==h&&(h=r(h),_=c),o(d,_,function(r,o){var c;switch(a(o,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,i);case"'":return l(e,f);case"<":c=h[l(o,1,-1)];break;default:var u=+o;if(0===u)return r;if(u>p){var d=s(u/10);if(0===d)return r;if(d<=p)return void 0===n[d-1]?a(o,1):n[d-1]+a(o,1);return r}c=n[u-1]}return void 0===c?"":c})}},7604:function(t,e,i){"use strict";var n=function(t){return t&&t.Math===Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4461:function(t,e,i){"use strict";var n=i(2196),r=i(3561),s=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(r(t),e)}},1241:function(t){"use strict";t.exports={}},4713:function(t){"use strict";t.exports=function(t,e){try{1==arguments.length?console.error(t):console.error(t,e)}catch(t){}}},1665:function(t,e,i){"use strict";t.exports=i(3579)("document","documentElement")},3825:function(t,e,i){"use strict";var n=i(4032),r=i(7683),s=i(4307);t.exports=!n&&!r(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},6590:function(t){"use strict";var e=Array,i=Math.abs,n=Math.pow,r=Math.floor,s=Math.log,a=Math.LN2;t.exports={pack:function(t,o,l){var c,u,h,d=e(l),f=8*l-o-1,p=(1<<f)-1,_=p>>1,g=23===o?n(2,-24)-n(2,-77):0,v=+(t<0||0===t&&1/t<0),m=0;for((t=i(t))!=t||t===1/0?(u=+(t!=t),c=p):(h=n(2,-(c=r(s(t)/a))),t*h<1&&(c--,h*=2),c+_>=1?t+=g/h:t+=g*n(2,1-_),t*h>=2&&(c++,h/=2),c+_>=p?(u=0,c=p):c+_>=1?(u=(t*h-1)*n(2,o),c+=_):(u=t*n(2,_-1)*n(2,o),c=0));o>=8;)d[m++]=255&u,u/=256,o-=8;for(c=c<<o|u,f+=o;f>0;)d[m++]=255&c,c/=256,f-=8;return d[m-1]|=128*v,d},unpack:function(t,e){var i,r=t.length,s=8*r-e-1,a=(1<<s)-1,o=a>>1,l=s-7,c=r-1,u=t[c--],h=127&u;for(u>>=7;l>0;)h=256*h+t[c--],l-=8;for(i=h&(1<<-l)-1,h>>=-l,l+=e;l>0;)i=256*i+t[c--],l-=8;if(0===h)h=1-o;else{if(h===a)return i?NaN:u?-1/0:1/0;i+=n(2,e),h-=o}return(u?-1:1)*i*n(2,h-e)}}},1395:function(t,e,i){"use strict";var n=i(2196),r=i(7683),s=i(4380),a=Object,o=n("".split);t.exports=r(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===s(t)?o(t,""):a(t)}:a},5779:function(t,e,i){"use strict";var n=i(8801),r=i(9414),s=i(6307);t.exports=function(t,e,i){var a,o;return s&&n(a=e.constructor)&&a!==i&&r(o=a.prototype)&&o!==i.prototype&&s(t,o),t}},3134:function(t,e,i){"use strict";var n=i(2196),r=i(8801),s=i(1929),a=n(Function.toString);r(s.inspectSource)||(s.inspectSource=function(t){return a(t)}),t.exports=s.inspectSource},7204:function(t,e,i){"use strict";var n=i(9414),r=i(3599);t.exports=function(t,e){n(e)&&"cause"in e&&r(t,"cause",e.cause)}},4769:function(t,e,i){"use strict";var n,r,s,a=i(7218),o=i(7604),l=i(9414),c=i(3599),u=i(4461),h=i(1929),d=i(5555),f=i(1241),p="Object already initialized",_=o.TypeError,g=o.WeakMap;if(a||h.state){var v=h.state||(h.state=new g);v.get=v.get,v.has=v.has,v.set=v.set,n=function(t,e){if(v.has(t))throw new _(p);return e.facade=t,v.set(t,e),e},r=function(t){return v.get(t)||{}},s=function(t){return v.has(t)}}else{var m=d("state");f[m]=!0,n=function(t,e){if(u(t,m))throw new _(p);return e.facade=t,c(t,m,e),e},r=function(t){return u(t,m)?t[m]:{}},s=function(t){return u(t,m)}}t.exports={set:n,get:r,has:s,enforce:function(t){return s(t)?r(t):n(t,{})},getterFor:function(t){return function(e){var i;if(!l(e)||(i=r(e)).type!==t)throw new _("Incompatible receiver, "+t+" required");return i}}}},8269:function(t,e,i){"use strict";var n=i(4735),r=i(577),s=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[s]===t)}},7708:function(t,e,i){"use strict";var n=i(4380);t.exports=Array.isArray||function(t){return"Array"===n(t)}},8003:function(t,e,i){"use strict";var n=i(6471);t.exports=function(t){var e=n(t);return"BigInt64Array"===e||"BigUint64Array"===e}},8801:function(t){"use strict";var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},2049:function(t,e,i){"use strict";var n=i(2196),r=i(7683),s=i(8801),a=i(6471),o=i(3579),l=i(3134),c=function(){},u=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=n(h.exec),f=!h.test(c),p=function(t){if(!s(t))return!1;try{return u(c,[],t),!0}catch(t){return!1}},_=function(t){if(!s(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!d(h,l(t))}catch(t){return!0}};_.sham=!0,t.exports=!u||r(function(){var t;return p(p.call)||!p(Object)||!p(function(){t=!0})||t})?_:p},8696:function(t,e,i){"use strict";var n=i(7683),r=i(8801),s=/#|\.prototype\./,a=function(t,e){var i=l[o(t)];return i===u||i!==c&&(r(e)?n(e):!!e)},o=a.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";t.exports=a},6107:function(t,e,i){"use strict";var n=i(9414),r=Math.floor;t.exports=Number.isInteger||function(t){return!n(t)&&isFinite(t)&&r(t)===t}},4449:function(t){"use strict";t.exports=function(t){return null==t}},9414:function(t,e,i){"use strict";var n=i(8801);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},2585:function(t,e,i){"use strict";var n=i(9414);t.exports=function(t){return n(t)||null===t}},4727:function(t){"use strict";t.exports=!1},4840:function(t,e,i){"use strict";var n=i(9414),r=i(4380),s=i(4735)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[s])?!!e:"RegExp"===r(t))}},4137:function(t,e,i){"use strict";var n=i(3579),r=i(8801),s=i(5533),a=i(948),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return r(e)&&s(e.prototype,o(t))}},8343:function(t,e,i){"use strict";var n=i(7625);t.exports=function(t,e,i){for(var r,s,a=i?t:t.iterator,o=t.next;!(r=n(o,a)).done;)if(void 0!==(s=e(r.value)))return s}},1552:function(t,e,i){"use strict";var n=i(3516),r=i(7625),s=i(3),a=i(2123),o=i(8269),l=i(4370),c=i(5533),u=i(6573),h=i(7623),d=i(4831),f=TypeError,p=function(t,e){this.stopped=t,this.result=e},_=p.prototype;t.exports=function(t,e,i){var g,v,m,y,w,b,k,S=i&&i.that,A=!!(i&&i.AS_ENTRIES),I=!!(i&&i.IS_RECORD),x=!!(i&&i.IS_ITERATOR),U=!!(i&&i.INTERRUPTED),E=n(e,S),P=function(t){return g&&d(g,"normal",t),new p(!0,t)},C=function(t){return A?(s(t),U?E(t[0],t[1],P):E(t[0],t[1])):U?E(t,P):E(t)};if(I)g=t.iterator;else if(x)g=t;else{if(!(v=h(t)))throw new f(a(t)+" is not iterable");if(o(v)){for(m=0,y=l(t);y>m;m++)if((w=C(t[m]))&&c(_,w))return w;return new p(!1)}g=u(t,v)}for(b=I?t.next:g.next;!(k=r(b,g)).done;){try{w=C(k.value)}catch(t){d(g,"throw",t)}if("object"==typeof w&&w&&c(_,w))return w}return new p(!1)}},4831:function(t,e,i){"use strict";var n=i(7625),r=i(3),s=i(5378);t.exports=function(t,e,i){var a,o;r(t);try{if(!(a=s(t,"return"))){if("throw"===e)throw i;return i}a=n(a,t)}catch(t){o=!0,a=t}if("throw"===e)throw i;if(o)throw a;return r(a),i}},7302:function(t,e,i){"use strict";var n=i(3805).IteratorPrototype,r=i(5012),s=i(1056),a=i(2099),o=i(577),l=function(){return this};t.exports=function(t,e,i,c){var u=e+" Iterator";return t.prototype=r(n,{next:s(+!c,i)}),a(t,u,!1,!0),o[u]=l,t}},9866:function(t,e,i){"use strict";var n=i(7625),r=i(5012),s=i(3599),a=i(2267),o=i(4735),l=i(4769),c=i(5378),u=i(3805).IteratorPrototype,h=i(1597),d=i(4831),f=o("toStringTag"),p="IteratorHelper",_="WrapForValidIterator",g=l.set,v=function(t){var e=l.getterFor(t?_:p);return a(r(u),{next:function(){var i=e(this);if(t)return i.nextHandler();if(i.done)return h(void 0,!0);try{var n=i.nextHandler();return i.returnHandlerResult?n:h(n,i.done)}catch(t){throw i.done=!0,t}},return:function(){var i=e(this),r=i.iterator;if(i.done=!0,t){var s=c(r,"return");return s?n(s,r):h(void 0,!0)}if(i.inner)try{d(i.inner.iterator,"normal")}catch(t){return d(r,"throw",t)}return r&&d(r,"normal"),h(void 0,!0)}})},m=v(!0),y=v(!1);s(y,f,"Iterator Helper"),t.exports=function(t,e,i){var n=function(n,r){r?(r.iterator=n.iterator,r.next=n.next):r=n,r.type=e?_:p,r.returnHandlerResult=!!i,r.nextHandler=t,r.counter=0,r.done=!1,g(this,r)};return n.prototype=e?m:y,n}},9636:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(4727),a=i(5410),o=i(8801),l=i(7302),c=i(9623),u=i(6307),h=i(2099),d=i(3599),f=i(1764),p=i(4735),_=i(577),g=i(3805),v=a.PROPER,m=a.CONFIGURABLE,y=g.IteratorPrototype,w=g.BUGGY_SAFARI_ITERATORS,b=p("iterator"),k="keys",S="values",A="entries",I=function(){return this};t.exports=function(t,e,i,a,p,g,x){l(i,e,a);var U,E,P,C=function(t){if(t===p&&N)return N;if(!w&&t&&t in R)return R[t];switch(t){case k:case S:case A:return function(){return new i(this,t)}}return function(){return new i(this)}},O=e+" Iterator",T=!1,R=t.prototype,M=R[b]||R["@@iterator"]||p&&R[p],N=!w&&M||C(p),W="Array"===e&&R.entries||M;if(W&&(U=c(W.call(new t)))!==Object.prototype&&U.next&&(!s&&c(U)!==y&&(u?u(U,y):o(U[b])||f(U,b,I)),h(U,O,!0,!0),s&&(_[O]=I)),v&&p===S&&M&&M.name!==S&&(!s&&m?d(R,"name",S):(T=!0,N=function(){return r(M,this)})),p)if(E={values:C(S),keys:g?N:C(k),entries:C(A)},x)for(P in E)!w&&!T&&P in R||f(R,P,E[P]);else n({target:e,proto:!0,forced:w||T},E);return(!s||x)&&R[b]!==N&&f(R,b,N,{name:p}),_[e]=N,E}},2165:function(t,e,i){"use strict";var n=i(7625),r=i(6382),s=i(3),a=i(1147),o=i(9866),l=i(9955),c=o(function(){var t=this.iterator,e=s(n(this.next,t));if(!(this.done=!!e.done))return l(t,this.mapper,[e.value,this.counter++],!0)});t.exports=function(t){return s(this),r(t),new c(a(this),{mapper:t})}},3805:function(t,e,i){"use strict";var n,r,s,a=i(7683),o=i(8801),l=i(9414),c=i(5012),u=i(9623),h=i(1764),d=i(4735),f=i(4727),p=d("iterator"),_=!1;[].keys&&("next"in(s=[].keys())?(r=u(u(s)))!==Object.prototype&&(n=r):_=!0),!l(n)||a(function(){var t={};return n[p].call(t)!==t})?n={}:f&&(n=c(n)),o(n[p])||h(n,p,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:_}},577:function(t){"use strict";t.exports={}},4370:function(t,e,i){"use strict";var n=i(4514);t.exports=function(t){return n(t.length)}},2335:function(t,e,i){"use strict";var n=i(2196),r=i(7683),s=i(8801),a=i(4461),o=i(4032),l=i(5410).CONFIGURABLE,c=i(3134),u=i(4769),h=u.enforce,d=u.get,f=String,p=Object.defineProperty,_=n("".slice),g=n("".replace),v=n([].join),m=o&&!r(function(){return 8!==p(function(){},"length",{value:8}).length}),y=String(String).split("String"),w=t.exports=function(t,e,i){"Symbol("===_(f(e),0,7)&&(e="["+g(f(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(o?p(t,"name",{value:e,configurable:!0}):t.name=e),m&&i&&a(i,"arity")&&t.length!==i.arity&&p(t,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?o&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=h(t);return a(n,"source")||(n.source=v(y,"string"==typeof e?e:"")),t};Function.prototype.toString=w(function(){return s(this)&&d(this).source||c(this)},"toString")},6424:function(t,e,i){"use strict";var n=i(6434),r=i(3670),s=Math.abs;t.exports=function(t,e,i,a){var o=+t,l=s(o),c=n(o);if(l<a)return c*r(l/a/e)*a*e;var u=(1+e/2220446049250313e-31)*l,h=u-(u-l);return h>i||h!=h?1/0*c:c*h}},7125:function(t,e,i){"use strict";var n=i(6424);t.exports=Math.fround||function(t){return n(t,11920928955078125e-23,34028234663852886e22,11754943508222875e-54)}},3670:function(t){"use strict";t.exports=function(t){return t+0x10000000000000-0x10000000000000}},6434:function(t){"use strict";t.exports=Math.sign||function(t){var e=+t;return 0===e||e!=e?e:e<0?-1:1}},7553:function(t){"use strict";var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?i:e)(n)}},1855:function(t,e,i){"use strict";var n,r,s,a,o,l=i(7604),c=i(7665),u=i(3516),h=i(6877).set,d=i(7421),f=i(516),p=i(9101),_=i(7256),g=i(1037),v=l.MutationObserver||l.WebKitMutationObserver,m=l.document,y=l.process,w=l.Promise,b=c("queueMicrotask");if(!b){var k=new d,S=function(){var t,e;for(g&&(t=y.domain)&&t.exit();e=k.get();)try{e()}catch(t){throw k.head&&n(),t}t&&t.enter()};f||g||_||!v||!m?!p&&w&&w.resolve?((a=w.resolve(void 0)).constructor=w,o=u(a.then,a),n=function(){o(S)}):g?n=function(){y.nextTick(S)}:(h=u(h,l),n=function(){h(S)}):(r=!0,s=m.createTextNode(""),new v(S).observe(s,{characterData:!0}),n=function(){s.data=r=!r}),b=function(t){k.head||n(),k.add(t)}}t.exports=b},7895:function(t,e,i){"use strict";var n=i(6382),r=TypeError,s=function(t){var e,i;this.promise=new t(function(t,n){if(void 0!==e||void 0!==i)throw new r("Bad Promise constructor");e=t,i=n}),this.resolve=n(e),this.reject=n(i)};t.exports.f=function(t){return new s(t)}},9871:function(t,e,i){"use strict";var n=i(5011);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:n(t)}},1353:function(t,e,i){"use strict";var n=i(4032),r=i(2196),s=i(7625),a=i(7683),o=i(1500),l=i(3473),c=i(185),u=i(3561),h=i(1395),d=Object.assign,f=Object.defineProperty,p=r([].concat);t.exports=!d||a(function(){if(n&&1!==d({b:1},d(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[i]=7,r.split("").forEach(function(t){e[t]=t}),7!==d({},t)[i]||o(d({},e)).join("")!==r})?function(t,e){for(var i=u(t),r=arguments.length,a=1,d=l.f,f=c.f;r>a;)for(var _,g=h(arguments[a++]),v=d?p(o(g),d(g)):o(g),m=v.length,y=0;m>y;)_=v[y++],(!n||s(f,g,_))&&(i[_]=g[_]);return i}:d},5012:function(t,e,i){"use strict";var n,r=i(3),s=i(9549),a=i(3155),o=i(1241),l=i(1665),c=i(4307),u=i(5555),h="prototype",d="script",f=u("IE_PROTO"),p=function(){},_=function(t){return"<"+d+">"+t+"</"+d+">"},g=function(t){t.write(_("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){var t,e=c("iframe");return e.style.display="none",l.appendChild(e),e.src=String("java"+d+":"),(t=e.contentWindow.document).open(),t.write(_("document.F=Object")),t.close(),t.F},m=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}m="undefined"!=typeof document?document.domain&&n?g(n):v():g(n);for(var t=a.length;t--;)delete m[h][a[t]];return m()};o[f]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(p[h]=r(t),i=new p,p[h]=null,i[f]=t):i=m(),void 0===e?i:s.f(i,e)}},9549:function(t,e,i){"use strict";var n=i(4032),r=i(578),s=i(4773),a=i(3),o=i(6905),l=i(1500);e.f=n&&!r?Object.defineProperties:function(t,e){a(t);for(var i,n=o(e),r=l(e),c=r.length,u=0;c>u;)s.f(t,i=r[u++],n[i]);return t}},4773:function(t,e,i){"use strict";var n=i(4032),r=i(3825),s=i(578),a=i(3),o=i(5661),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",f="writable";e.f=n?s?function(t,e,i){if(a(t),e=o(e),a(i),"function"==typeof t&&"prototype"===e&&"value"in i&&f in i&&!i[f]){var n=u(t,e);n&&n[f]&&(t[e]=i.value,i={configurable:d in i?i[d]:n[d],enumerable:h in i?i[h]:n[h],writable:!1})}return c(t,e,i)}:c:function(t,e,i){if(a(t),e=o(e),a(i),r)try{return c(t,e,i)}catch(t){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},6047:function(t,e,i){"use strict";var n=i(4032),r=i(7625),s=i(185),a=i(1056),o=i(6905),l=i(5661),c=i(4461),u=i(3825),h=Object.getOwnPropertyDescriptor;e.f=n?h:function(t,e){if(t=o(t),e=l(e),u)try{return h(t,e)}catch(t){}if(c(t,e))return a(!r(s.f,t,e),t[e])}},1452:function(t,e,i){"use strict";var n=i(9192),r=i(3155).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,r)}},3473:function(t,e){"use strict";e.f=Object.getOwnPropertySymbols},9623:function(t,e,i){"use strict";var n=i(4461),r=i(8801),s=i(3561),a=i(5555),o=i(5447),l=a("IE_PROTO"),c=Object,u=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=s(t);if(n(e,l))return e[l];var i=e.constructor;return r(i)&&e instanceof i?i.prototype:e instanceof c?u:null}},5533:function(t,e,i){"use strict";t.exports=i(2196)({}.isPrototypeOf)},9192:function(t,e,i){"use strict";var n=i(2196),r=i(4461),s=i(6905),a=i(6845).indexOf,o=i(1241),l=n([].push);t.exports=function(t,e){var i,n=s(t),c=0,u=[];for(i in n)!r(o,i)&&r(n,i)&&l(u,i);for(;e.length>c;)r(n,i=e[c++])&&(~a(u,i)||l(u,i));return u}},1500:function(t,e,i){"use strict";var n=i(9192),r=i(3155);t.exports=Object.keys||function(t){return n(t,r)}},185:function(t,e){"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor;e.f=n&&!i.call({1:2},1)?function(t){var e=n(this,t);return!!e&&e.enumerable}:i},6307:function(t,e,i){"use strict";var n=i(1190),r=i(9414),s=i(1826),a=i(5982);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=n(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return s(i),a(n),r(i)&&(e?t(i,n):i.__proto__=n),i}}():void 0)},2986:function(t,e,i){"use strict";var n=i(7625),r=i(8801),s=i(9414),a=TypeError;t.exports=function(t,e){var i,o;if("string"===e&&r(i=t.toString)&&!s(o=n(i,t))||r(i=t.valueOf)&&!s(o=n(i,t))||"string"!==e&&r(i=t.toString)&&!s(o=n(i,t)))return o;throw new a("Can't convert object to primitive value")}},9339:function(t,e,i){"use strict";var n=i(3579),r=i(2196),s=i(1452),a=i(3473),o=i(3),l=r([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=s.f(o(t)),i=a.f;return i?l(e,i(t)):e}},8099:function(t){"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},9576:function(t,e,i){"use strict";var n=i(7604),r=i(8794),s=i(8801),a=i(8696),o=i(3134),l=i(4735),c=i(8995),u=i(4727),h=i(6315),d=r&&r.prototype,f=l("species"),p=!1,_=s(n.PromiseRejectionEvent);t.exports={CONSTRUCTOR:a("Promise",function(){var t=o(r),e=t!==String(r);if(!e&&66===h||u&&!(d.catch&&d.finally))return!0;if(!h||h<51||!/native code/.test(t)){var i=new r(function(t){t(1)}),n=function(t){t(function(){},function(){})};if((i.constructor={})[f]=n,!(p=i.then(function(){})instanceof n))return!0}return!e&&("BROWSER"===c||"DENO"===c)&&!_}),REJECTION_EVENT:_,SUBCLASSING:p}},8794:function(t,e,i){"use strict";t.exports=i(7604).Promise},5002:function(t,e,i){"use strict";var n=i(3),r=i(9414),s=i(7895);t.exports=function(t,e){if(n(t),r(e)&&e.constructor===t)return e;var i=s.f(t);return(0,i.resolve)(e),i.promise}},3797:function(t,e,i){"use strict";var n=i(8794),r=i(856);t.exports=i(9576).CONSTRUCTOR||!r(function(t){n.all(t).then(void 0,function(){})})},6252:function(t,e,i){"use strict";var n=i(4773).f;t.exports=function(t,e,i){i in t||n(t,i,{configurable:!0,get:function(){return e[i]},set:function(t){e[i]=t}})}},7421:function(t){"use strict";var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},i=this.tail;i?i.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},5806:function(t,e,i){"use strict";var n=i(7625),r=i(3),s=i(8801),a=i(4380),o=i(4495),l=TypeError;t.exports=function(t,e){var i=t.exec;if(s(i)){var c=n(i,t,e);return null!==c&&r(c),c}if("RegExp"===a(t))return n(o,t,e);throw new l("RegExp#exec called on incompatible receiver")}},4495:function(t,e,i){"use strict";var n,r,s=i(7625),a=i(2196),o=i(5011),l=i(6351),c=i(2665),u=i(3997),h=i(5012),d=i(4769).get,f=i(6927),p=i(7514),_=u("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,v=g,m=a("".charAt),y=a("".indexOf),w=a("".replace),b=a("".slice),k=(r=/b*/g,s(g,n=/a/,"a"),s(g,r,"a"),0!==n.lastIndex||0!==r.lastIndex),S=c.BROKEN_CARET,A=void 0!==/()??/.exec("")[1];(k||A||S||f||p)&&(v=function(t){var e,i,n,r,a,c,u,f=d(this),p=o(t),I=f.raw;if(I)return I.lastIndex=this.lastIndex,e=s(v,I,p),this.lastIndex=I.lastIndex,e;var x=f.groups,U=S&&this.sticky,E=s(l,this),P=this.source,C=0,O=p;if(U&&(-1===y(E=w(E,"y",""),"g")&&(E+="g"),O=b(p,this.lastIndex),this.lastIndex>0&&(!this.multiline||this.multiline&&"\n"!==m(p,this.lastIndex-1))&&(P="(?: "+P+")",O=" "+O,C++),i=RegExp("^(?:"+P+")",E)),A&&(i=RegExp("^"+P+"$(?!\\s)",E)),k&&(n=this.lastIndex),r=s(g,U?i:this,O),U?r?(r.input=b(r.input,C),r[0]=b(r[0],C),r.index=this.lastIndex,this.lastIndex+=r[0].length):this.lastIndex=0:k&&r&&(this.lastIndex=this.global?r.index+r[0].length:n),A&&r&&r.length>1&&s(_,r[0],i,function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)}),r&&x)for(a=0,r.groups=c=h(null);a<x.length;a++)c[(u=x[a])[0]]=r[u[1]];return r}),t.exports=v},6351:function(t,e,i){"use strict";var n=i(3);t.exports=function(){var t=n(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},1678:function(t,e,i){"use strict";var n=i(7625),r=i(4461),s=i(5533),a=i(6351),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return!(void 0===e&&!("flags"in o)&&!r(t,"flags")&&s(o,t))?e:n(a,t)}},2665:function(t,e,i){"use strict";var n=i(7683),r=i(7604).RegExp,s=n(function(){var t=r("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),a=s||n(function(){return!r("a","y").sticky});t.exports={BROKEN_CARET:s||n(function(){var t=r("^r","gy");return t.lastIndex=2,null!==t.exec("str")}),MISSED_STICKY:a,UNSUPPORTED_Y:s}},6927:function(t,e,i){"use strict";var n=i(7683),r=i(7604).RegExp;t.exports=n(function(){var t=r(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})},7514:function(t,e,i){"use strict";var n=i(7683),r=i(7604).RegExp;t.exports=n(function(){var t=r("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})},1826:function(t,e,i){"use strict";var n=i(4449),r=TypeError;t.exports=function(t){if(n(t))throw new r("Can't call method on "+t);return t}},7665:function(t,e,i){"use strict";var n=i(7604),r=i(4032),s=Object.getOwnPropertyDescriptor;t.exports=function(t){if(!r)return n[t];var e=s(n,t);return e&&e.value}},7906:function(t,e,i){"use strict";var n=i(3110),r=i(9121),s=n.Set,a=n.add;t.exports=function(t){var e=new s;return r(t,function(t){a(e,t)}),e}},9212:function(t,e,i){"use strict";var n=i(6148),r=i(3110),s=i(7906),a=i(2830),o=i(5193),l=i(9121),c=i(8343),u=r.has,h=r.remove;t.exports=function(t){var e=n(this),i=o(t),r=s(e);return a(e)<=i.size?l(e,function(t){i.includes(t)&&h(r,t)}):c(i.getIterator(),function(t){u(e,t)&&h(r,t)}),r}},3110:function(t,e,i){"use strict";var n=i(2196),r=Set.prototype;t.exports={Set:Set,add:n(r.add),has:n(r.has),remove:n(r.delete),proto:r}},826:function(t,e,i){"use strict";var n=i(6148),r=i(3110),s=i(2830),a=i(5193),o=i(9121),l=i(8343),c=r.Set,u=r.add,h=r.has;t.exports=function(t){var e=n(this),i=a(t),r=new c;return s(e)>i.size?l(i.getIterator(),function(t){h(e,t)&&u(r,t)}):o(e,function(t){i.includes(t)&&u(r,t)}),r}},237:function(t,e,i){"use strict";var n=i(6148),r=i(3110).has,s=i(2830),a=i(5193),o=i(9121),l=i(8343),c=i(4831);t.exports=function(t){var e=n(this),i=a(t);if(s(e)<=i.size)return!1!==o(e,function(t){if(i.includes(t))return!1},!0);var u=i.getIterator();return!1!==l(u,function(t){if(r(e,t))return c(u,"normal",!1)})}},3802:function(t,e,i){"use strict";var n=i(6148),r=i(2830),s=i(9121),a=i(5193);t.exports=function(t){var e=n(this),i=a(t);return!(r(e)>i.size)&&!1!==s(e,function(t){if(!i.includes(t))return!1},!0)}},6083:function(t,e,i){"use strict";var n=i(6148),r=i(3110).has,s=i(2830),a=i(5193),o=i(8343),l=i(4831);t.exports=function(t){var e=n(this),i=a(t);if(s(e)<i.size)return!1;var c=i.getIterator();return!1!==o(c,function(t){if(!r(e,t))return l(c,"normal",!1)})}},9121:function(t,e,i){"use strict";var n=i(2196),r=i(8343),s=i(3110),a=s.Set,o=s.proto,l=n(o.forEach),c=n(o.keys),u=c(new a).next;t.exports=function(t,e,i){return i?r({iterator:c(t),next:u},e):l(t,e)}},7768:function(t,e,i){"use strict";var n=i(3579),r=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s=function(t){return{size:t,has:function(){return!0},keys:function(){throw Error("e")}}};t.exports=function(t,e){var i=n("Set");try{new i()[t](r(0));try{return new i()[t](r(-1)),!1}catch(n){if(!e)return!0;try{return new i()[t](s(-1/0)),!1}catch(n){var a=new i;return a.add(1),a.add(2),e(a[t](s(1/0)))}}}catch(t){return!1}}},2830:function(t,e,i){"use strict";t.exports=i(1190)(i(3110).proto,"size","get")||function(t){return t.size}},8285:function(t,e,i){"use strict";var n=i(3579),r=i(1782),s=i(4735),a=i(4032),o=s("species");t.exports=function(t){var e=n(t);a&&e&&!e[o]&&r(e,o,{configurable:!0,get:function(){return this}})}},7782:function(t,e,i){"use strict";var n=i(6148),r=i(3110),s=i(7906),a=i(5193),o=i(8343),l=r.add,c=r.has,u=r.remove;t.exports=function(t){var e=n(this),i=a(t).getIterator(),r=s(e);return o(i,function(t){c(e,t)?u(r,t):l(r,t)}),r}},2099:function(t,e,i){"use strict";var n=i(4773).f,r=i(4461),s=i(4735)("toStringTag");t.exports=function(t,e,i){t&&!i&&(t=t.prototype),t&&!r(t,s)&&n(t,s,{configurable:!0,value:e})}},3528:function(t,e,i){"use strict";var n=i(6148),r=i(3110).add,s=i(7906),a=i(5193),o=i(8343);t.exports=function(t){var e=n(this),i=a(t).getIterator(),l=s(e);return o(i,function(t){r(l,t)}),l}},5555:function(t,e,i){"use strict";var n=i(3997),r=i(8916),s=n("keys");t.exports=function(t){return s[t]||(s[t]=r(t))}},1929:function(t,e,i){"use strict";var n=i(4727),r=i(7604),s=i(9269),a="__core-js_shared__",o=t.exports=r[a]||s(a,{});(o.versions||(o.versions=[])).push({version:"3.41.0",mode:n?"pure":"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})},3997:function(t,e,i){"use strict";var n=i(1929);t.exports=function(t,e){return n[t]||(n[t]=e||{})}},4577:function(t,e,i){"use strict";var n=i(3),r=i(7592),s=i(4449),a=i(4735)("species");t.exports=function(t,e){var i,o=n(t).constructor;return void 0===o||s(i=n(o)[a])?e:r(i)}},5059:function(t,e,i){"use strict";var n=i(2196),r=i(3231),s=i(5011),a=i(1826),o=n("".charAt),l=n("".charCodeAt),c=n("".slice),u=function(t){return function(e,i){var n,u,h=s(a(e)),d=r(i),f=h.length;return d<0||d>=f?t?"":void 0:(n=l(h,d))<55296||n>56319||d+1===f||(u=l(h,d+1))<56320||u>57343?t?o(h,d):n:t?c(h,d,d+2):(n-55296<<10)+(u-56320)+65536}};t.exports={codeAt:u(!1),charAt:u(!0)}},6793:function(t,e,i){"use strict";var n=i(2196),r=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",o=RangeError,l=n(s.exec),c=Math.floor,u=String.fromCharCode,h=n("".charCodeAt),d=n([].join),f=n([].push),p=n("".replace),_=n("".split),g=n("".toLowerCase),v=function(t){for(var e=[],i=0,n=t.length;i<n;){var r=h(t,i++);if(r>=55296&&r<=56319&&i<n){var s=h(t,i++);(64512&s)==56320?f(e,((1023&r)<<10)+(1023&s)+65536):(f(e,r),i--)}else f(e,r)}return e},m=function(t){return t+22+75*(t<26)},y=function(t,e,i){var n=0;for(t=i?c(t/700):t>>1,t+=c(t/e);t>455;)t=c(t/35),n+=36;return c(n+36*t/(t+38))},w=function(t){var e,i,n=[],r=(t=v(t)).length,s=128,l=0,h=72;for(e=0;e<t.length;e++)(i=t[e])<128&&f(n,u(i));var p=n.length,_=p;for(p&&f(n,"-");_<r;){var g=0x7fffffff;for(e=0;e<t.length;e++)(i=t[e])>=s&&i<g&&(g=i);var w=_+1;if(g-s>c((0x7fffffff-l)/w))throw new o(a);for(l+=(g-s)*w,s=g,e=0;e<t.length;e++){if((i=t[e])<s&&++l>0x7fffffff)throw new o(a);if(i===s){for(var b=l,k=36;;){var S=k<=h?1:k>=h+26?26:k-h;if(b<S)break;var A=b-S,I=36-S;f(n,u(m(S+A%I))),b=c(A/I),k+=36}f(n,u(m(b))),h=y(l,w,_===p),l=0,_++}}l++,s++}return d(n,"")};t.exports=function(t){var e,i,n=[],a=_(p(g(t),s,"."),".");for(e=0;e<a.length;e++)f(n,l(r,i=a[e])?"xn--"+w(i):i);return d(n,".")}},1200:function(t,e,i){"use strict";var n=i(7604),r=i(7683),s=i(6315),a=i(8995),o=n.structuredClone;t.exports=!!o&&!r(function(){if("DENO"===a&&s>92||"NODE"===a&&s>94||"BROWSER"===a&&s>97)return!1;var t=new ArrayBuffer(8),e=o(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})},6043:function(t,e,i){"use strict";var n=i(6315),r=i(7683),s=i(7604).String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41})},6877:function(t,e,i){"use strict";var n,r,s,a,o=i(7604),l=i(7957),c=i(3516),u=i(8801),h=i(4461),d=i(7683),f=i(1665),p=i(4892),_=i(4307),g=i(5104),v=i(516),m=i(1037),y=o.setImmediate,w=o.clearImmediate,b=o.process,k=o.Dispatch,S=o.Function,A=o.MessageChannel,I=o.String,x=0,U={},E="onreadystatechange";d(function(){n=o.location});var P=function(t){if(h(U,t)){var e=U[t];delete U[t],e()}},C=function(t){return function(){P(t)}},O=function(t){P(t.data)},T=function(t){o.postMessage(I(t),n.protocol+"//"+n.host)};y&&w||(y=function(t){g(arguments.length,1);var e=u(t)?t:S(t),i=p(arguments,1);return U[++x]=function(){l(e,void 0,i)},r(x),x},w=function(t){delete U[t]},m?r=function(t){b.nextTick(C(t))}:k&&k.now?r=function(t){k.now(C(t))}:A&&!v?(a=(s=new A).port2,s.port1.onmessage=O,r=c(a.postMessage,a)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&n&&"file:"!==n.protocol&&!d(T)?(r=T,o.addEventListener("message",O,!1)):r=E in _("script")?function(t){f.appendChild(_("script"))[E]=function(){f.removeChild(this),P(t)}}:function(t){setTimeout(C(t),0)}),t.exports={set:y,clear:w}},6926:function(t,e,i){"use strict";var n=i(3231),r=Math.max,s=Math.min;t.exports=function(t,e){var i=n(t);return i<0?r(i+e,0):s(i,e)}},8402:function(t,e,i){"use strict";var n=i(1277),r=TypeError;t.exports=function(t){var e=n(t,"number");if("number"==typeof e)throw new r("Can't convert number to bigint");return BigInt(e)}},7932:function(t,e,i){"use strict";var n=i(3231),r=i(4514),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=r(e);if(e!==i)throw new s("Wrong length or index");return i}},6905:function(t,e,i){"use strict";var n=i(1395),r=i(1826);t.exports=function(t){return n(r(t))}},3231:function(t,e,i){"use strict";var n=i(7553);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},4514:function(t,e,i){"use strict";var n=i(3231),r=Math.min;t.exports=function(t){var e=n(t);return e>0?r(e,0x1fffffffffffff):0}},3561:function(t,e,i){"use strict";var n=i(1826),r=Object;t.exports=function(t){return r(n(t))}},9113:function(t,e,i){"use strict";var n=i(4114),r=RangeError;t.exports=function(t,e){var i=n(t);if(i%e)throw new r("Wrong offset");return i}},4114:function(t,e,i){"use strict";var n=i(3231),r=RangeError;t.exports=function(t){var e=n(t);if(e<0)throw new r("The argument can't be less than 0");return e}},1277:function(t,e,i){"use strict";var n=i(7625),r=i(9414),s=i(4137),a=i(5378),o=i(2986),l=i(4735),c=TypeError,u=l("toPrimitive");t.exports=function(t,e){if(!r(t)||s(t))return t;var i,l=a(t,u);if(l){if(void 0===e&&(e="default"),!r(i=n(l,t,e))||s(i))return i;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}},5661:function(t,e,i){"use strict";var n=i(1277),r=i(4137);t.exports=function(t){var e=n(t,"string");return r(e)?e:e+""}},5384:function(t,e,i){"use strict";var n=i(4735)("toStringTag"),r={};r[n]="z",t.exports="[object z]"===String(r)},5011:function(t,e,i){"use strict";var n=i(6471),r=String;t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return r(t)}},4899:function(t){"use strict";var e=Math.round;t.exports=function(t){var i=e(t);return i<0?0:i>255?255:255&i}},2123:function(t){"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},6619:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(7625),a=i(4032),o=i(4665),l=i(5200),c=i(8158),u=i(5275),h=i(1056),d=i(3599),f=i(6107),p=i(4514),_=i(7932),g=i(9113),v=i(4899),m=i(5661),y=i(4461),w=i(6471),b=i(9414),k=i(4137),S=i(5012),A=i(5533),I=i(6307),x=i(1452).f,U=i(9055),E=i(9425).forEach,P=i(8285),C=i(1782),O=i(4773),T=i(6047),R=i(9974),M=i(4769),N=i(5779),W=M.get,z=M.set,F=M.enforce,D=O.f,L=T.f,j=r.RangeError,B=c.ArrayBuffer,V=B.prototype,J=c.DataView,K=l.NATIVE_ARRAY_BUFFER_VIEWS,q=l.TYPED_ARRAY_TAG,H=l.TypedArray,G=l.TypedArrayPrototype,$=l.isTypedArray,Y="BYTES_PER_ELEMENT",X="Wrong length",Q=function(t,e){C(t,e,{configurable:!0,get:function(){return W(this)[e]}})},Z=function(t){var e;return A(V,t)||"ArrayBuffer"===(e=w(t))||"SharedArrayBuffer"===e},tt=function(t,e){return $(t)&&!k(e)&&e in t&&f(+e)&&e>=0},te=function(t,e){return tt(t,e=m(e))?h(2,t[e]):L(t,e)},ti=function(t,e,i){return tt(t,e=m(e))&&b(i)&&y(i,"value")&&!y(i,"get")&&!y(i,"set")&&!i.configurable&&(!y(i,"writable")||i.writable)&&(!y(i,"enumerable")||i.enumerable)?(t[e]=i.value,t):D(t,e,i)};a?(K||(T.f=te,O.f=ti,Q(G,"buffer"),Q(G,"byteOffset"),Q(G,"byteLength"),Q(G,"length")),n({target:"Object",stat:!0,forced:!K},{getOwnPropertyDescriptor:te,defineProperty:ti}),t.exports=function(t,e,i){var a=t.match(/\d+/)[0]/8,l=t+(i?"Clamped":"")+"Array",c="get"+t,h="set"+t,f=r[l],m=f,y=m&&m.prototype,w={},k=function(t,e){var i=W(t);return i.view[c](e*a+i.byteOffset,!0)},A=function(t,e,n){var r=W(t);r.view[h](e*a+r.byteOffset,i?v(n):n,!0)},C=function(t,e){D(t,e,{get:function(){return k(this,e)},set:function(t){return A(this,e,t)},enumerable:!0})};K?o&&(m=e(function(t,e,i,n){return u(t,y),N(b(e)?Z(e)?void 0!==n?new f(e,g(i,a),n):void 0!==i?new f(e,g(i,a)):new f(e):$(e)?R(m,e):s(U,m,e):new f(_(e)),t,m)}),I&&I(m,H),E(x(f),function(t){t in m||d(m,t,f[t])}),m.prototype=y):(m=e(function(t,e,i,n){u(t,y);var r,o,l,c=0,h=0;if(b(e))if(Z(e)){r=e,h=g(i,a);var d=e.byteLength;if(void 0===n){if(d%a||(o=d-h)<0)throw new j(X)}else if((o=p(n)*a)+h>d)throw new j(X);l=o/a}else if($(e))return R(m,e);else return s(U,m,e);else r=new B(o=(l=_(e))*a);for(z(t,{buffer:r,byteOffset:h,byteLength:o,length:l,view:new J(r)});c<l;)C(t,c++)}),I&&I(m,H),y=m.prototype=S(G)),y.constructor!==m&&d(y,"constructor",m),F(y).TypedArrayConstructor=m,q&&d(y,q,l);var O=m!==f;w[l]=m,n({global:!0,constructor:!0,forced:O,sham:!K},w),Y in m||d(m,Y,a),Y in y||d(y,Y,a),P(l)}):t.exports=function(){}},4665:function(t,e,i){"use strict";var n=i(7604),r=i(7683),s=i(856),a=i(5200).NATIVE_ARRAY_BUFFER_VIEWS,o=n.ArrayBuffer,l=n.Int8Array;t.exports=!a||!r(function(){l(1)})||!r(function(){new l(-1)})||!s(function(t){new l,new l(null),new l(1.5),new l(t)},!0)||r(function(){return 1!==new l(new o(2),1,void 0).length})},9055:function(t,e,i){"use strict";var n=i(3516),r=i(7625),s=i(7592),a=i(3561),o=i(4370),l=i(6573),c=i(7623),u=i(8269),h=i(8003),d=i(5200).aTypedArrayConstructor,f=i(8402);t.exports=function(t){var e,i,p,_,g,v,m,y,w=s(this),b=a(t),k=arguments.length,S=k>1?arguments[1]:void 0,A=void 0!==S,I=c(b);if(I&&!u(I))for(y=(m=l(b,I)).next,b=[];!(v=r(y,m)).done;)b.push(v.value);for(A&&k>2&&(S=n(S,arguments[2])),i=o(b),_=h(p=new(d(w))(i)),e=0;i>e;e++)g=A?S(b[e],e):b[e],p[e]=_?f(g):+g;return p}},8916:function(t,e,i){"use strict";var n=i(2196),r=0,s=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++r+s,36)}},3172:function(t,e,i){"use strict";var n=i(7683),r=i(4735),s=i(4032),a=i(4727),o=r("iterator");t.exports=!n(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,i=new URLSearchParams("a=1&a=2&b=3"),n="";return t.pathname="c%20d",e.forEach(function(t,i){e.delete("b"),n+=i+t}),i.delete("a",2),i.delete("b",void 0),a&&(!t.toJSON||!i.has("a",1)||i.has("a",2)||!i.has("a",void 0)||i.has("b"))||!e.size&&(a||!s)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host})},948:function(t,e,i){"use strict";t.exports=i(6043)&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},578:function(t,e,i){"use strict";var n=i(4032),r=i(7683);t.exports=n&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},5104:function(t){"use strict";var e=TypeError;t.exports=function(t,i){if(t<i)throw new e("Not enough arguments");return t}},7218:function(t,e,i){"use strict";var n=i(7604),r=i(8801),s=n.WeakMap;t.exports=r(s)&&/native code/.test(String(s))},4735:function(t,e,i){"use strict";var n=i(7604),r=i(3997),s=i(4461),a=i(8916),o=i(6043),l=i(948),c=n.Symbol,u=r("wks"),h=l?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){return s(u,t)||(u[t]=o&&s(c,t)?c[t]:h("Symbol."+t)),u[t]}},4565:function(t,e,i){"use strict";var n=i(3579),r=i(4461),s=i(3599),a=i(5533),o=i(6307),l=i(2088),c=i(6252),u=i(5779),h=i(9871),d=i(7204),f=i(5143),p=i(4032),_=i(4727);t.exports=function(t,e,i,g){var v="stackTraceLimit",m=g?2:1,y=t.split("."),w=y[y.length-1],b=n.apply(null,y);if(b){var k=b.prototype;if(!_&&r(k,"cause")&&delete k.cause,!i)return b;var S=n("Error"),A=e(function(t,e){var i=h(g?e:t,void 0),n=g?new b(t):new b;return void 0!==i&&s(n,"message",i),f(n,A,n.stack,2),this&&a(k,this)&&u(n,this,A),arguments.length>m&&d(n,arguments[m]),n});if(A.prototype=k,"Error"!==w?o?o(A,S):l(A,S,{name:!0}):p&&v in b&&(c(A,b,v),c(A,b,"prepareStackTrace")),l(A,b),!_)try{k.name!==w&&s(k,"name",w),k.constructor=A}catch(t){}return A}}},4953:function(t,e,i){"use strict";var n=i(4032),r=i(1782),s=i(2674),a=ArrayBuffer.prototype;!n||"detached"in a||r(a,"detached",{configurable:!0,get:function(){return s(this)}})},8732:function(t,e,i){"use strict";var n=i(5258),r=i(4088);r&&n({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return r(this,arguments.length?arguments[0]:void 0,!1)}})},2536:function(t,e,i){"use strict";var n=i(5258),r=i(4088);r&&n({target:"ArrayBuffer",proto:!0},{transfer:function(){return r(this,arguments.length?arguments[0]:void 0,!0)}})},1747:function(t,e,i){"use strict";var n=i(5258),r=i(6845).includes,s=i(7683),a=i(7161);n({target:"Array",proto:!0,forced:s(function(){return![,].includes()})},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},7812:function(t,e,i){"use strict";var n=i(6905),r=i(7161),s=i(577),a=i(4769),o=i(4773).f,l=i(9636),c=i(1597),u=i(4727),h=i(4032),d="Array Iterator",f=a.set,p=a.getterFor(d);t.exports=l(Array,"Array",function(t,e){f(this,{type:d,target:n(t),index:0,kind:e})},function(){var t=p(this),e=t.target,i=t.index++;if(!e||i>=e.length)return t.target=null,c(void 0,!0);switch(t.kind){case"keys":return c(i,!1);case"values":return c(e[i],!1)}return c([i,e[i]],!1)},"values");var _=s.Arguments=s.Array;if(r("keys"),r("values"),r("entries"),!u&&h&&"values"!==_.name)try{o(_,"name",{value:"values"})}catch(t){}},7918:function(t,e,i){"use strict";var n=i(5258),r=i(3561),s=i(4370),a=i(323),o=i(9481);n({target:"Array",proto:!0,arity:1,forced:i(7683)(function(){return 0x100000001!==[].push.call({length:0x100000000},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=r(this),i=s(e),n=arguments.length;o(i+n);for(var l=0;l<n;l++)e[i]=arguments[l],i++;return a(e,i),i}})},9116:function(t,e,i){"use strict";var n=i(5258),r=i(8466).left,s=i(5122),a=i(6315);n({target:"Array",proto:!0,forced:!i(1037)&&a>79&&a<83||!s("reduce")},{reduce:function(t){var e=arguments.length;return r(this,t,e,e>1?arguments[1]:void 0)}})},4214:function(t,e,i){"use strict";i(7161)("flat")},4085:function(t,e,i){"use strict";var n=i(5258),r=i(3561),s=i(4370),a=i(323),o=i(1946),l=i(9481);n({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(t){return t instanceof TypeError}}()},{unshift:function(t){var e=r(this),i=s(e),n=arguments.length;if(n){l(i+n);for(var c=i;c--;){var u=c+n;c in e?e[u]=e[c]:o(e,u)}for(var h=0;h<n;h++)e[h]=arguments[h]}return a(e,i+n)}})},1300:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(7957),a=i(4565),o="WebAssembly",l=r[o],c=7!==Error("e",{cause:7}).cause,u=function(t,e){var i={};i[t]=a(t,e,c),n({global:!0,constructor:!0,arity:1,forced:c},i)},h=function(t,e){if(l&&l[t]){var i={};i[t]=a(o+"."+t,e,c),n({target:o,stat:!0,constructor:!0,arity:1,forced:c},i)}};u("Error",function(t){return function(e){return s(t,this,arguments)}}),u("EvalError",function(t){return function(e){return s(t,this,arguments)}}),u("RangeError",function(t){return function(e){return s(t,this,arguments)}}),u("ReferenceError",function(t){return function(e){return s(t,this,arguments)}}),u("SyntaxError",function(t){return function(e){return s(t,this,arguments)}}),u("TypeError",function(t){return function(e){return s(t,this,arguments)}}),u("URIError",function(t){return function(e){return s(t,this,arguments)}}),h("CompileError",function(t){return function(e){return s(t,this,arguments)}}),h("LinkError",function(t){return function(e){return s(t,this,arguments)}}),h("RuntimeError",function(t){return function(e){return s(t,this,arguments)}})},9091:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(5275),a=i(3),o=i(8801),l=i(9623),c=i(1782),u=i(7180),h=i(7683),d=i(4461),f=i(4735),p=i(3805).IteratorPrototype,_=i(4032),g=i(4727),v="constructor",m="Iterator",y=f("toStringTag"),w=TypeError,b=r[m],k=g||!o(b)||b.prototype!==p||!h(function(){b({})}),S=function(){if(s(this,p),l(this)===p)throw new w("Abstract class Iterator not directly constructable")},A=function(t,e){_?c(p,t,{configurable:!0,get:function(){return e},set:function(e){if(a(this),this===p)throw new w("You can't redefine this property");d(this,t)?this[t]=e:u(this,t,e)}}):p[t]=e};d(p,y)||A(y,m),(k||!d(p,v)||p[v]===Object)&&A(v,S),S.prototype=p,n({global:!0,constructor:!0,forced:k},{Iterator:S})},3272:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147);n({target:"Iterator",proto:!0,real:!0},{every:function(t){a(this),s(t);var e=o(this),i=0;return!r(e,function(e,n){if(!t(e,i++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},6178:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(6382),a=i(3),o=i(1147),l=i(9866),c=i(9955),u=i(4727),h=l(function(){for(var t,e,i=this.iterator,n=this.predicate,s=this.next;;){if(t=a(r(s,i)),this.done=!!t.done)return;if(c(i,n,[e=t.value,this.counter++],!0))return e}});n({target:"Iterator",proto:!0,real:!0,forced:u},{filter:function(t){return a(this),s(t),new h(o(this),{predicate:t})}})},200:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147);n({target:"Iterator",proto:!0,real:!0},{find:function(t){a(this),s(t);var e=o(this),i=0;return r(e,function(e,n){if(t(e,i++))return n(e)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},4784:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147);n({target:"Iterator",proto:!0,real:!0},{forEach:function(t){a(this),s(t);var e=o(this),i=0;r(e,function(e){t(e,i++)},{IS_RECORD:!0})}})},8593:function(t,e,i){"use strict";var n=i(5258),r=i(2165);n({target:"Iterator",proto:!0,real:!0,forced:i(4727)},{map:r})},6969:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147),l=TypeError;n({target:"Iterator",proto:!0,real:!0},{reduce:function(t){a(this),s(t);var e=o(this),i=arguments.length<2,n=i?void 0:arguments[1],c=0;if(r(e,function(e){i?(i=!1,n=e):n=t(n,e,c),c++},{IS_RECORD:!0}),i)throw new l("Reduce of empty iterator with no initial value");return n}})},3775:function(t,e,i){"use strict";var n=i(5258),r=i(1552),s=i(6382),a=i(3),o=i(1147);n({target:"Iterator",proto:!0,real:!0},{some:function(t){a(this),s(t);var e=o(this),i=0;return r(e,function(e,n){if(t(e,i++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1911:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(6382),a=i(7895),o=i(8099),l=i(1552);n({target:"Promise",stat:!0,forced:i(3797)},{all:function(t){var e=this,i=a.f(e),n=i.resolve,c=i.reject,u=o(function(){var i=s(e.resolve),a=[],o=0,u=1;l(t,function(t){var s=o++,l=!1;u++,r(i,e,t).then(function(t){!l&&(l=!0,a[s]=t,--u||n(a))},c)}),--u||n(a)});return u.error&&c(u.value),i.promise}})},5807:function(t,e,i){"use strict";var n=i(5258),r=i(4727),s=i(9576).CONSTRUCTOR,a=i(8794),o=i(3579),l=i(8801),c=i(1764),u=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(t){return this.then(void 0,t)}}),!r&&l(a)){var h=o("Promise").prototype.catch;u.catch!==h&&c(u,"catch",h,{unsafe:!0})}},2520:function(t,e,i){"use strict";var n,r,s,a,o=i(5258),l=i(4727),c=i(1037),u=i(7604),h=i(7625),d=i(1764),f=i(6307),p=i(2099),_=i(8285),g=i(6382),v=i(8801),m=i(9414),y=i(5275),w=i(4577),b=i(6877).set,k=i(1855),S=i(4713),A=i(8099),I=i(7421),x=i(4769),U=i(8794),E=i(9576),P=i(7895),C="Promise",O=E.CONSTRUCTOR,T=E.REJECTION_EVENT,R=E.SUBCLASSING,M=x.getterFor(C),N=x.set,W=U&&U.prototype,z=U,F=W,D=u.TypeError,L=u.document,j=u.process,B=P.f,V=B,J=!!(L&&L.createEvent&&u.dispatchEvent),K="unhandledrejection",q=function(t){var e;return!!(m(t)&&v(e=t.then))&&e},H=function(t,e){var i,n,r,s=e.value,a=1===e.state,o=a?t.ok:t.fail,l=t.resolve,c=t.reject,u=t.domain;try{o?(a||(2===e.rejection&&Q(e),e.rejection=1),!0===o?i=s:(u&&u.enter(),i=o(s),u&&(u.exit(),r=!0)),i===t.promise?c(new D("Promise-chain cycle")):(n=q(i))?h(n,i,l,c):l(i)):c(s)}catch(t){u&&!r&&u.exit(),c(t)}},G=function(t,e){t.notified||(t.notified=!0,k(function(){for(var i,n=t.reactions;i=n.get();)H(i,t);t.notified=!1,e&&!t.rejection&&Y(t)}))},$=function(t,e,i){var n,r;J?((n=L.createEvent("Event")).promise=e,n.reason=i,n.initEvent(t,!1,!0),u.dispatchEvent(n)):n={promise:e,reason:i},!T&&(r=u["on"+t])?r(n):t===K&&S("Unhandled promise rejection",i)},Y=function(t){h(b,u,function(){var e,i=t.facade,n=t.value;if(X(t)&&(e=A(function(){c?j.emit("unhandledRejection",n,i):$(K,i,n)}),t.rejection=c||X(t)?2:1,e.error))throw e.value})},X=function(t){return 1!==t.rejection&&!t.parent},Q=function(t){h(b,u,function(){var e=t.facade;c?j.emit("rejectionHandled",e):$("rejectionhandled",e,t.value)})},Z=function(t,e,i){return function(n){t(e,n,i)}},tt=function(t,e,i){t.done||(t.done=!0,i&&(t=i),t.value=e,t.state=2,G(t,!0))},te=function(t,e,i){if(!t.done){t.done=!0,i&&(t=i);try{if(t.facade===e)throw new D("Promise can't be resolved itself");var n=q(e);n?k(function(){var i={done:!1};try{h(n,e,Z(te,i,t),Z(tt,i,t))}catch(e){tt(i,e,t)}}):(t.value=e,t.state=1,G(t,!1))}catch(e){tt({done:!1},e,t)}}};if(O&&(F=(z=function(t){y(this,F),g(t),h(n,this);var e=M(this);try{t(Z(te,e),Z(tt,e))}catch(t){tt(e,t)}}).prototype,(n=function(t){N(this,{type:C,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:0,value:null})}).prototype=d(F,"then",function(t,e){var i=M(this),n=B(w(this,z));return i.parent=!0,n.ok=!v(t)||t,n.fail=v(e)&&e,n.domain=c?j.domain:void 0,0===i.state?i.reactions.add(n):k(function(){H(n,i)}),n.promise}),r=function(){var t=new n,e=M(t);this.promise=t,this.resolve=Z(te,e),this.reject=Z(tt,e)},P.f=B=function(t){return t===z||t===s?new r(t):V(t)},!l&&v(U)&&W!==Object.prototype)){a=W.then,R||d(W,"then",function(t,e){var i=this;return new z(function(t,e){h(a,i,t,e)}).then(t,e)},{unsafe:!0});try{delete W.constructor}catch(t){}f&&f(W,F)}o({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:z}),p(z,C,!1,!0),_(C)},9939:function(t,e,i){"use strict";var n=i(5258),r=i(4727),s=i(8794),a=i(7683),o=i(3579),l=i(8801),c=i(4577),u=i(5002),h=i(1764),d=s&&s.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!s&&a(function(){d.finally.call({then:function(){}},function(){})})},{finally:function(t){var e=c(this,o("Promise")),i=l(t);return this.then(i?function(i){return u(e,t()).then(function(){return i})}:t,i?function(i){return u(e,t()).then(function(){throw i})}:t)}}),!r&&l(s)){var f=o("Promise").prototype.finally;d.finally!==f&&h(d,"finally",f,{unsafe:!0})}},9166:function(t,e,i){"use strict";i(2520),i(1911),i(5807),i(4419),i(2173),i(3940)},4419:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(6382),a=i(7895),o=i(8099),l=i(1552);n({target:"Promise",stat:!0,forced:i(3797)},{race:function(t){var e=this,i=a.f(e),n=i.reject,c=o(function(){var a=s(e.resolve);l(t,function(t){r(a,e,t).then(i.resolve,n)})});return c.error&&n(c.value),i.promise}})},2173:function(t,e,i){"use strict";var n=i(5258),r=i(7895);n({target:"Promise",stat:!0,forced:i(9576).CONSTRUCTOR},{reject:function(t){var e=r.f(this);return(0,e.reject)(t),e.promise}})},3940:function(t,e,i){"use strict";var n=i(5258),r=i(3579),s=i(4727),a=i(8794),o=i(9576).CONSTRUCTOR,l=i(5002),c=r("Promise"),u=s&&!o;n({target:"Promise",stat:!0,forced:s||o},{resolve:function(t){return l(u&&this===c?a:this,t)}})},6764:function(t,e,i){"use strict";var n=i(4032),r=i(7604),s=i(2196),a=i(8696),o=i(5779),l=i(3599),c=i(5012),u=i(1452).f,h=i(5533),d=i(4840),f=i(5011),p=i(1678),_=i(2665),g=i(6252),v=i(1764),m=i(7683),y=i(4461),w=i(4769).enforce,b=i(8285),k=i(4735),S=i(6927),A=i(7514),I=k("match"),x=r.RegExp,U=x.prototype,E=r.SyntaxError,P=s(U.exec),C=s("".charAt),O=s("".replace),T=s("".indexOf),R=s("".slice),M=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,N=/a/g,W=/a/g,z=new x(N)!==N,F=_.MISSED_STICKY,D=_.UNSUPPORTED_Y,L=n&&(!z||F||S||A||m(function(){return W[I]=!1,x(N)!==N||x(W)===W||"/a/i"!==String(x(N,"i"))})),j=function(t){for(var e,i=t.length,n=0,r="",s=!1;n<=i;n++){if("\\"===(e=C(t,n))){r+=e+C(t,++n);continue}s||"."!==e?("["===e?s=!0:"]"===e&&(s=!1),r+=e):r+="[\\s\\S]"}return r},B=function(t){for(var e,i=t.length,n=0,r="",s=[],a=c(null),o=!1,l=!1,u=0,h="";n<=i;n++){if("\\"===(e=C(t,n)))e+=C(t,++n);else if("]"===e)o=!1;else if(!o)switch(!0){case"["===e:o=!0;break;case"("===e:if(r+=e,"?:"===R(t,n+1,n+3))continue;P(M,R(t,n+1))&&(n+=2,l=!0),u++;continue;case">"===e&&l:if(""===h||y(a,h))throw new E("Invalid capture group name");a[h]=!0,s[s.length]=[h,u],l=!1,h="";continue}l?h+=e:r+=e}return[r,s]};if(a("RegExp",L)){for(var V=function(t,e){var i,n,r,s,a,c,u=h(U,this),_=d(t),g=void 0===e,v=[],m=t;if(!u&&_&&g&&t.constructor===V)return t;if((_||h(U,t))&&(t=t.source,g&&(e=p(m))),t=void 0===t?"":f(t),e=void 0===e?"":f(e),m=t,S&&"dotAll"in N&&(n=!!e&&T(e,"s")>-1)&&(e=O(e,/s/g,"")),i=e,F&&"sticky"in N&&(r=!!e&&T(e,"y")>-1)&&D&&(e=O(e,/y/g,"")),A&&(t=(s=B(t))[0],v=s[1]),a=o(x(t,e),u?this:U,V),(n||r||v.length)&&(c=w(a),n&&(c.dotAll=!0,c.raw=V(j(t),i)),r&&(c.sticky=!0),v.length&&(c.groups=v)),t!==m)try{l(a,"source",""===m?"(?:)":m)}catch(t){}return a},J=u(x),K=0;J.length>K;)g(V,x,J[K++]);U.constructor=V,V.prototype=U,v(r,"RegExp",V,{constructor:!0})}b("RegExp")},4853:function(t,e,i){"use strict";var n=i(4032),r=i(6927),s=i(4380),a=i(1782),o=i(4769).get,l=RegExp.prototype,c=TypeError;n&&r&&a(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!o(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},4891:function(t,e,i){"use strict";var n=i(5258),r=i(4495);n({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},6843:function(t,e,i){"use strict";var n=i(7604),r=i(4032),s=i(1782),a=i(6351),o=i(7683),l=n.RegExp,c=l.prototype;r&&o(function(){var t=!0;try{l(".","d")}catch(e){t=!1}var e={},i="",n=t?"dgimsy":"gimsy",r=function(t,n){Object.defineProperty(e,t,{get:function(){return i+=n,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in t&&(s.hasIndices="d"),s)r(a,s[a]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(e)!==n||i!==n})&&s(c,"flags",{configurable:!0,get:a})},574:function(t,e,i){"use strict";var n=i(5258),r=i(9212);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("difference",function(t){return 0===t.size})},{difference:r})},5992:function(t,e,i){"use strict";var n=i(5258),r=i(7683),s=i(826);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("intersection",function(t){return 2===t.size&&t.has(1)&&t.has(2)})||r(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:s})},8385:function(t,e,i){"use strict";var n=i(5258),r=i(237);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("isDisjointFrom",function(t){return!t})},{isDisjointFrom:r})},5208:function(t,e,i){"use strict";var n=i(5258),r=i(3802);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("isSubsetOf",function(t){return t})},{isSubsetOf:r})},2935:function(t,e,i){"use strict";var n=i(5258),r=i(6083);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("isSupersetOf",function(t){return!t})},{isSupersetOf:r})},9356:function(t,e,i){"use strict";var n=i(5258),r=i(7782);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("symmetricDifference")},{symmetricDifference:r})},5702:function(t,e,i){"use strict";var n=i(5258),r=i(3528);n({target:"Set",proto:!0,real:!0,forced:!i(7768)("union")},{union:r})},5837:function(t,e,i){"use strict";var n=i(5258),r=i(2196),s=i(6926),a=RangeError,o=String.fromCharCode,l=String.fromCodePoint,c=r([].join);n({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(t){for(var e,i=[],n=arguments.length,r=0;n>r;){if(e=+arguments[r++],s(e,1114111)!==e)throw new a(e+" is not a valid code point");i[r]=e<65536?o(e):o(((e-=65536)>>10)+55296,e%1024+56320)}return c(i,"")}})},7864:function(t,e,i){"use strict";var n=i(5059).charAt,r=i(5011),s=i(4769),a=i(9636),o=i(1597),l="String Iterator",c=s.set,u=s.getterFor(l);a(String,"String",function(t){c(this,{type:l,string:r(t),index:0})},function(){var t,e=u(this),i=e.string,r=e.index;return r>=i.length?o(void 0,!0):(t=n(i,r),e.index+=t.length,o(t,!1))})},3459:function(t,e,i){"use strict";var n=i(5258),r=i(7625),s=i(5344),a=i(7302),o=i(1597),l=i(1826),c=i(4514),u=i(5011),h=i(3),d=i(4449),f=i(4380),p=i(4840),_=i(1678),g=i(5378),v=i(1764),m=i(7683),y=i(4735),w=i(4577),b=i(1857),k=i(5806),S=i(4769),A=i(4727),I=y("matchAll"),x="RegExp String",U=x+" Iterator",E=S.set,P=S.getterFor(U),C=RegExp.prototype,O=TypeError,T=s("".indexOf),R=s("".matchAll),M=!!R&&!m(function(){R("a",/./)}),N=a(function(t,e,i,n){E(this,{type:U,regexp:t,string:e,global:i,unicode:n,done:!1})},x,function(){var t=P(this);if(t.done)return o(void 0,!0);var e=t.regexp,i=t.string,n=k(e,i);return null===n?(t.done=!0,o(void 0,!0)):(t.global?""===u(n[0])&&(e.lastIndex=b(i,c(e.lastIndex),t.unicode)):t.done=!0,o(n,!1))}),W=function(t){var e,i,n,r=h(this),s=u(t),a=w(r,RegExp),o=u(_(r));return e=new a(a===RegExp?r.source:r,o),i=!!~T(o,"g"),n=!!~T(o,"u"),e.lastIndex=c(r.lastIndex),new N(e,s,i,n)};n({target:"String",proto:!0,forced:M},{matchAll:function(t){var e,i,n,s=l(this);if(d(t)){if(M)return R(s,t)}else{if(p(t)&&!~T(u(l(_(t))),"g"))throw new O("`.matchAll` does not allow non-global regexes");if(M)return R(s,t);if(void 0===(i=g(t,I))&&A&&"RegExp"===f(t)&&(i=W),i)return r(i,t,s)}return e=u(s),n=RegExp(t,"g"),A?r(W,n,e):n[I](e)}}),A||I in C||v(C,I,W)},2724:function(t,e,i){"use strict";var n=i(7957),r=i(7625),s=i(2196),a=i(4016),o=i(7683),l=i(3),c=i(8801),u=i(4449),h=i(3231),d=i(4514),f=i(5011),p=i(1826),_=i(1857),g=i(5378),v=i(4242),m=i(5806),y=i(4735)("replace"),w=Math.max,b=Math.min,k=s([].concat),S=s([].push),A=s("".indexOf),I=s("".slice),x="$0"==="a".replace(/./,"$0"),U=!!/./[y]&&""===/./[y]("a","$0");a("replace",function(t,e,i){var s=U?"$":"$0";return[function(t,i){var n=p(this),s=u(t)?void 0:g(t,y);return s?r(s,t,n,i):r(e,f(n),t,i)},function(t,r){var a=l(this),o=f(t);if("string"==typeof r&&-1===A(r,s)&&-1===A(r,"$<")){var u=i(e,a,o,r);if(u.done)return u.value}var p=c(r);p||(r=f(r));var g=a.global;g&&(C=a.unicode,a.lastIndex=0);for(var y=[];null!==(T=m(a,o))&&(S(y,T),g);){;""===f(T[0])&&(a.lastIndex=_(o,d(a.lastIndex),C))}for(var x="",U=0,E=0;E<y.length;E++){for(var P,C,O,T=y[E],R=f(T[0]),M=w(b(h(T.index),o.length),0),N=[],W=1;W<T.length;W++)S(N,void 0===(P=T[W])?P:String(P));var z=T.groups;if(p){var F=k([R],N,M,o);void 0!==z&&S(F,z),O=f(n(r,void 0,F))}else O=v(R,o,M,N,z,r);M>=U&&(x+=I(o,U,M)+O,U=M+R.length)}return x+I(o,U)}]},!!o(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})||!x||U)},9016:function(t,e,i){"use strict";var n=i(5200),r=i(4370),s=i(3231),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("at",function(t){var e=a(this),i=r(e),n=s(t),o=n>=0?n:i+n;return o<0||o>=i?void 0:e[o]})},1408:function(t,e,i){"use strict";var n=i(5200),r=i(7793),s=i(8402),a=i(6471),o=i(7625),l=i(2196),c=i(7683),u=n.aTypedArray,h=n.exportTypedArrayMethod,d=l("".slice);h("fill",function(t){var e=arguments.length;return u(this),o(r,this,"Big"===d(a(this),0,3)?s(t):+t,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)},c(function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t}))},6698:function(t,e,i){"use strict";var n=i(5200),r=i(3691).findLastIndex,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLastIndex",function(t){return r(s(this),t,arguments.length>1?arguments[1]:void 0)})},7515:function(t,e,i){"use strict";var n=i(5200),r=i(3691).findLast,s=n.aTypedArray;(0,n.exportTypedArrayMethod)("findLast",function(t){return r(s(this),t,arguments.length>1?arguments[1]:void 0)})},4169:function(t,e,i){"use strict";var n=i(7604),r=i(7625),s=i(5200),a=i(4370),o=i(9113),l=i(3561),c=i(7683),u=n.RangeError,h=n.Int8Array,d=h&&h.prototype,f=d&&d.set,p=s.aTypedArray,_=s.exportTypedArrayMethod,g=!c(function(){var t=new Uint8ClampedArray(2);return r(f,t,{length:1,0:3},1),3!==t[1]}),v=g&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c(function(){var t=new h(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]});_("set",function(t){p(this);var e=o(arguments.length>1?arguments[1]:void 0,1),i=l(t);if(g)return r(f,this,i,e);var n=this.length,s=a(i),c=0;if(s+e>n)throw new u("Wrong length");for(;c<s;)this[e+c]=i[c++]},!g||v)},8809:function(t,e,i){"use strict";var n=i(7604),r=i(5344),s=i(7683),a=i(6382),o=i(1836),l=i(5200),c=i(673),u=i(2927),h=i(6315),d=i(5827),f=l.aTypedArray,p=l.exportTypedArrayMethod,_=n.Uint16Array,g=_&&r(_.prototype.sort),v=!!g&&!(s(function(){g(new _(2),null)})&&s(function(){g(new _(2),{})})),m=!!g&&!s(function(){if(h)return h<74;if(c)return c<67;if(u)return!0;if(d)return d<602;var t,e,i=new _(516),n=Array(516);for(t=0;t<516;t++)e=t%4,i[t]=515-t,n[t]=t-2*e+3;for(g(i,function(t,e){return(t/4|0)-(e/4|0)}),t=0;t<516;t++)if(i[t]!==n[t])return!0});p("sort",function(t){return(void 0!==t&&a(t),m)?g(this,t):o(f(this),function(e,i){return void 0!==t?+t(e,i)||0:i!=i?-1:e!=e?1:0===e&&0===i?1/e>0&&1/i<0?1:-1:e>i})},!m||v)},7095:function(t,e,i){"use strict";var n=i(2152),r=i(5200),s=r.aTypedArray,a=r.exportTypedArrayMethod,o=r.getTypedArrayConstructor;a("toReversed",function(){return n(s(this),o(this))})},6176:function(t,e,i){"use strict";var n=i(5200),r=i(2196),s=i(6382),a=i(9974),o=n.aTypedArray,l=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,u=r(n.TypedArrayPrototype.sort);c("toSorted",function(t){void 0!==t&&s(t);var e=o(this);return u(a(l(e),e),t)})},3405:function(t,e,i){"use strict";i(6619)("Uint8",function(t){return function(e,i,n){return t(this,e,i,n)}})},4189:function(t,e,i){"use strict";var n=i(5500),r=i(5200),s=i(8003),a=i(3231),o=i(8402),l=r.aTypedArray,c=r.getTypedArrayConstructor;(0,r.exportTypedArrayMethod)("with",{with:function(t,e){var i=l(this),r=a(t),u=s(i)?o(e):+e;return n(i,c(i),r,u)}}.with,!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}())},4261:function(t,e,i){"use strict";var n=i(7604),r=i(8828),s=i(5396),a=i(7812),o=i(3599),l=i(2099),c=i(4735)("iterator"),u=a.values,h=function(t,e){if(t){if(t[c]!==u)try{o(t,c,u)}catch(e){t[c]=u}if(l(t,e,!0),r[e]){for(var i in a)if(t[i]!==a[i])try{o(t,i,a[i])}catch(e){t[i]=a[i]}}}};for(var d in r)h(n[d]&&n[d].prototype,d);h(s,"DOMTokenList")},7775:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(3579),a=i(1056),o=i(4773).f,l=i(4461),c=i(5275),u=i(5779),h=i(9871),d=i(1430),f=i(2237),p=i(4032),_=i(4727),g="DOMException",v=s("Error"),m=s(g),y=function(){c(this,w);var t=arguments.length,e=h(t<1?void 0:arguments[0]),i=h(t<2?void 0:arguments[1],"Error"),n=new m(e,i),r=new v(e);return r.name=g,o(n,"stack",a(1,f(r.stack,1))),u(n,this,y),n},w=y.prototype=m.prototype,b="stack"in new v(g),k="stack"in new m(1,2),S=m&&p&&Object.getOwnPropertyDescriptor(r,g),A=!!S&&!(S.writable&&S.configurable),I=b&&!A&&!k;n({global:!0,constructor:!0,forced:_||I},{DOMException:I?y:m});var x=s(g),U=x.prototype;if(U.constructor!==x){for(var E in _||o(U,"constructor",a(1,x)),d)if(l(d,E)){var P=d[E],C=P.s;l(x,C)||o(x,C,a(6,P.c))}}},8303:function(t,e,i){"use strict";var n=i(5258),r=i(7604),s=i(1782),a=i(4032),o=TypeError,l=Object.defineProperty,c=r.self!==r;try{if(a){var u=Object.getOwnPropertyDescriptor(r,"self");!c&&u&&u.get&&u.enumerable||s(r,"self",{get:function(){return r},set:function(t){if(this!==r)throw new o("Illegal invocation");l(r,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else n({global:!0,simple:!0,forced:c},{self:r})}catch(t){}},8002:function(t,e,i){"use strict";i(7812),i(5837);var n=i(5258),r=i(7604),s=i(7665),a=i(3579),o=i(7625),l=i(2196),c=i(4032),u=i(3172),h=i(1764),d=i(1782),f=i(2267),p=i(2099),_=i(7302),g=i(4769),v=i(5275),m=i(8801),y=i(4461),w=i(3516),b=i(6471),k=i(3),S=i(9414),A=i(5011),I=i(5012),x=i(1056),U=i(6573),E=i(7623),P=i(1597),C=i(5104),O=i(4735),T=i(1836),R=O("iterator"),M="URLSearchParams",N=M+"Iterator",W=g.set,z=g.getterFor(M),F=g.getterFor(N),D=s("fetch"),L=s("Request"),j=s("Headers"),B=L&&L.prototype,V=j&&j.prototype,J=r.TypeError,K=r.encodeURIComponent,q=String.fromCharCode,H=a("String","fromCodePoint"),G=parseInt,$=l("".charAt),Y=l([].join),X=l([].push),Q=l("".replace),Z=l([].shift),tt=l([].splice),te=l("".split),ti=l("".slice),tn=l(/./.exec),tr=/\+/g,ts=/^[0-9a-f]+$/i,ta=function(t,e){var i=ti(t,e,e+2);return tn(ts,i)?G(i,16):NaN},to=function(t){for(var e=0,i=128;i>0&&(t&i)!=0;i>>=1)e++;return e},tl=function(t){var e=null;switch(t.length){case 1:e=t[0];break;case 2:e=(31&t[0])<<6|63&t[1];break;case 3:e=(15&t[0])<<12|(63&t[1])<<6|63&t[2];break;case 4:e=(7&t[0])<<18|(63&t[1])<<12|(63&t[2])<<6|63&t[3]}return e>1114111?null:e},tc=function(t){for(var e=(t=Q(t,tr," ")).length,i="",n=0;n<e;){var r=$(t,n);if("%"===r){if("%"===$(t,n+1)||n+3>e){i+="%",n++;continue}var s=ta(t,n+1);if(s!=s){i+=r,n++;continue}n+=2;var a=to(s);if(0===a)r=q(s);else{if(1===a||a>4){i+="�",n++;continue}for(var o=[s],l=1;l<a&&!(++n+3>e)&&"%"===$(t,n);){var c=ta(t,n+1);if(c!=c){n+=3;break}if(c>191||c<128)break;X(o,c),n+=2,l++}if(o.length!==a){i+="�";continue}var u=tl(o);null===u?i+="�":r=H(u)}}i+=r,n++}return i},tu=/[!'()~]|%20/g,th={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},td=function(t){return th[t]},tf=function(t){return Q(K(t),tu,td)},tp=_(function(t,e){W(this,{type:N,target:z(t).entries,index:0,kind:e})},M,function(){var t=F(this),e=t.target,i=t.index++;if(!e||i>=e.length)return t.target=null,P(void 0,!0);var n=e[i];switch(t.kind){case"keys":return P(n.key,!1);case"values":return P(n.value,!1)}return P([n.key,n.value],!1)},!0),t_=function(t){this.entries=[],this.url=null,void 0!==t&&(S(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===$(t,0)?ti(t,1):t:A(t)))};t_.prototype={type:M,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,i,n,r,s,a,l,c=this.entries,u=E(t);if(u)for(i=(e=U(t,u)).next;!(n=o(i,e)).done;){if((a=o(s=(r=U(k(n.value))).next,r)).done||(l=o(s,r)).done||!o(s,r).done)throw new J("Expected sequence with length 2");X(c,{key:A(a.value),value:A(l.value)})}else for(var h in t)y(t,h)&&X(c,{key:h,value:A(t[h])})},parseQuery:function(t){if(t)for(var e,i,n=this.entries,r=te(t,"&"),s=0;s<r.length;)(e=r[s++]).length&&X(n,{key:tc(Z(i=te(e,"="))),value:tc(Y(i,"="))})},serialize:function(){for(var t,e=this.entries,i=[],n=0;n<e.length;)X(i,tf((t=e[n++]).key)+"="+tf(t.value));return Y(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var tg=function(){v(this,tv);var t=arguments.length>0?arguments[0]:void 0,e=W(this,new t_(t));c||(this.size=e.entries.length)},tv=tg.prototype;if(f(tv,{append:function(t,e){var i=z(this);C(arguments.length,2),X(i.entries,{key:A(t),value:A(e)}),!c&&this.length++,i.updateURL()},delete:function(t){for(var e=z(this),i=C(arguments.length,1),n=e.entries,r=A(t),s=i<2?void 0:arguments[1],a=void 0===s?s:A(s),o=0;o<n.length;){var l=n[o];if(l.key===r&&(void 0===a||l.value===a)){if(tt(n,o,1),void 0!==a)break}else o++}c||(this.size=n.length),e.updateURL()},get:function(t){var e=z(this).entries;C(arguments.length,1);for(var i=A(t),n=0;n<e.length;n++)if(e[n].key===i)return e[n].value;return null},getAll:function(t){var e=z(this).entries;C(arguments.length,1);for(var i=A(t),n=[],r=0;r<e.length;r++)e[r].key===i&&X(n,e[r].value);return n},has:function(t){for(var e=z(this).entries,i=C(arguments.length,1),n=A(t),r=i<2?void 0:arguments[1],s=void 0===r?r:A(r),a=0;a<e.length;){var o=e[a++];if(o.key===n&&(void 0===s||o.value===s))return!0}return!1},set:function(t,e){var i,n=z(this);C(arguments.length,1);for(var r=n.entries,s=!1,a=A(t),o=A(e),l=0;l<r.length;l++)(i=r[l]).key===a&&(s?tt(r,l--,1):(s=!0,i.value=o));s||X(r,{key:a,value:o}),c||(this.size=r.length),n.updateURL()},sort:function(){var t=z(this);T(t.entries,function(t,e){return t.key>e.key?1:-1}),t.updateURL()},forEach:function(t){for(var e,i=z(this).entries,n=w(t,arguments.length>1?arguments[1]:void 0),r=0;r<i.length;)n((e=i[r++]).value,e.key,this)},keys:function(){return new tp(this,"keys")},values:function(){return new tp(this,"values")},entries:function(){return new tp(this,"entries")}},{enumerable:!0}),h(tv,R,tv.entries,{name:"entries"}),h(tv,"toString",function(){return z(this).serialize()},{enumerable:!0}),c&&d(tv,"size",{get:function(){return z(this).entries.length},configurable:!0,enumerable:!0}),p(tg,M),n({global:!0,constructor:!0,forced:!u},{URLSearchParams:tg}),!u&&m(j)){var tm=l(V.has),ty=l(V.set),tw=function(t){if(S(t)){var e,i=t.body;if(b(i)===M)return tm(e=t.headers?new j(t.headers):new j,"content-type")||ty(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),I(t,{body:x(0,A(i)),headers:x(0,e)})}return t};if(m(D)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return D(t,arguments.length>1?tw(arguments[1]):{})}}),m(L)){var tb=function(t){return v(this,B),new L(t,arguments.length>1?tw(arguments[1]):{})};B.constructor=tb,tb.prototype=B,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:tb})}}t.exports={URLSearchParams:tg,getState:z}},5711:function(t,e,i){"use strict";var n=i(1764),r=i(2196),s=i(5011),a=i(5104),o=URLSearchParams,l=o.prototype,c=r(l.append),u=r(l.delete),h=r(l.forEach),d=r([].push),f=new o("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&n(l,"delete",function(t){var e,i=arguments.length,n=i<2?void 0:arguments[1];if(i&&void 0===n)return u(this,t);var r=[];h(this,function(t,e){d(r,{key:e,value:t})}),a(i,1);for(var o=s(t),l=s(n),f=0,p=0,_=!1,g=r.length;f<g;)e=r[f++],_||e.key===o?(_=!0,u(this,e.key)):p++;for(;p<g;)((e=r[p++]).key!==o||e.value!==l)&&c(this,e.key,e.value)},{enumerable:!0,unsafe:!0})},4346:function(t,e,i){"use strict";var n=i(1764),r=i(2196),s=i(5011),a=i(5104),o=URLSearchParams,l=o.prototype,c=r(l.getAll),u=r(l.has),h=new o("a=1");(h.has("a",2)||!h.has("a",void 0))&&n(l,"has",function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return u(this,t);var n=c(this,t);a(e,1);for(var r=s(i),o=0;o<n.length;)if(n[o++]===r)return!0;return!1},{enumerable:!0,unsafe:!0})},1244:function(t,e,i){"use strict";i(8002)},8253:function(t,e,i){"use strict";var n=i(4032),r=i(2196),s=i(1782),a=URLSearchParams.prototype,o=r(a.forEach);!n||"size"in a||s(a,"size",{get:function(){var t=0;return o(this,function(){t++}),t},configurable:!0,enumerable:!0})},2877:function(t,e,i){"use strict";i(7864);var n,r=i(5258),s=i(4032),a=i(3172),o=i(7604),l=i(3516),c=i(2196),u=i(1764),h=i(1782),d=i(5275),f=i(4461),p=i(1353),_=i(4872),g=i(4892),v=i(5059).codeAt,m=i(6793),y=i(5011),w=i(2099),b=i(5104),k=i(8002),S=i(4769),A=S.set,I=S.getterFor("URL"),x=k.URLSearchParams,U=k.getState,E=o.URL,P=o.TypeError,C=o.parseInt,O=Math.floor,T=Math.pow,R=c("".charAt),M=c(/./.exec),N=c([].join),W=c(1..toString),z=c([].pop),F=c([].push),D=c("".replace),L=c([].shift),j=c("".split),B=c("".slice),V=c("".toLowerCase),J=c([].unshift),K="Invalid scheme",q="Invalid host",H="Invalid port",G=/[a-z]/i,$=/[\d+-.a-z]/i,Y=/\d/,X=/^0x/i,Q=/^[0-7]+$/,Z=/^\d+$/,tt=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ti=/[\0\t\n\r #/:<>?@[\\\]^|]/,tn=/^[\u0000-\u0020]+/,tr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ts=/[\t\n\r]/g,ta=function(t){var e,i,n,r,s,a,o,l=j(t,".");if(l.length&&""===l[l.length-1]&&l.length--,(e=l.length)>4)return t;for(n=0,i=[];n<e;n++){if(""===(r=l[n]))return t;if(s=10,r.length>1&&"0"===R(r,0)&&(s=M(X,r)?16:8,r=B(r,8===s?1:2)),""===r)a=0;else{if(!M(10===s?Z:8===s?Q:tt,r))return t;a=C(r,s)}F(i,a)}for(n=0;n<e;n++)if(a=i[n],n===e-1){if(a>=T(256,5-e))return null}else if(a>255)return null;for(n=0,o=z(i);n<i.length;n++)o+=i[n]*T(256,3-n);return o},to=function(t){var e,i,n,r,s,a,o,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return R(t,h)};if(":"===d()){if(":"!==R(t,1))return;h+=2,u=++c}for(;d();){if(8===c)return;if(":"===d()){if(null!==u)return;h++,u=++c;continue}for(e=i=0;i<4&&M(tt,d());)e=16*e+C(d(),16),h++,i++;if("."===d()){if(0===i||(h-=i,c>6))return;for(n=0;d();){if(r=null,n>0)if("."!==d()||!(n<4))return;else h++;if(!M(Y,d()))return;for(;M(Y,d());){if(s=C(d(),10),null===r)r=s;else{if(0===r)return;r=10*r+s}if(r>255)return;h++}l[c]=256*l[c]+r,(2==++n||4===n)&&c++}if(4!==n)return;break}if(":"===d()){if(h++,!d())return}else if(d())return;l[c++]=e}if(null!==u)for(a=c-u,c=7;0!==c&&a>0;)o=l[c],l[c--]=l[u+a-1],l[u+--a]=o;else if(8!==c)return;return l},tl=function(t){for(var e=null,i=1,n=null,r=0,s=0;s<8;s++)0!==t[s]?(r>i&&(e=n,i=r),n=null,r=0):(null===n&&(n=s),++r);return r>i?n:e},tc=function(t){var e,i,n,r;if("number"==typeof t){for(i=0,e=[];i<4;i++)J(e,t%256),t=O(t/256);return N(e,".")}if("object"==typeof t){for(i=0,e="",n=tl(t);i<8;i++)(!r||0!==t[i])&&(r&&(r=!1),n===i?(e+=i?":":"::",r=!0):(e+=W(t[i],16),i<7&&(e+=":")));return"["+e+"]"}return t},tu={},th=p({},tu,{" ":1,'"':1,"<":1,">":1,"`":1}),td=p({},th,{"#":1,"?":1,"{":1,"}":1}),tf=p({},td,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),tp=function(t,e){var i=v(t,0);return i>32&&i<127&&!f(e,t)?t:encodeURIComponent(t)},t_={ftp:21,file:null,http:80,https:443,ws:80,wss:443},tg=function(t,e){var i;return 2===t.length&&M(G,R(t,0))&&(":"===(i=R(t,1))||!e&&"|"===i)},tv=function(t){var e;return t.length>1&&tg(B(t,0,2))&&(2===t.length||"/"===(e=R(t,2))||"\\"===e||"?"===e||"#"===e)},tm={},ty={},tw={},tb={},tk={},tS={},tA={},tI={},tx={},tU={},tE={},tP={},tC={},tO={},tT={},tR={},tM={},tN={},tW={},tz={},tF={},tD=function(t,e,i){var n,r,s,a=y(t);if(e){if(r=this.parse(a))throw new P(r);this.searchParams=null}else{if(void 0!==i&&(n=new tD(i,!0)),r=this.parse(a,null,n))throw new P(r);(s=U(new x)).bindURL(this),this.searchParams=s}};tD.prototype={type:"URL",parse:function(t,e,i){var r=e||tm,s=0,a="",o=!1,l=!1,c=!1;for(t=y(t),e||(this.scheme="",this.username="",this.password="",this.host=null,this.port=null,this.path=[],this.query=null,this.fragment=null,this.cannotBeABaseURL=!1,t=D(t,tn,""),t=D(t,tr,"$1")),u=_(t=D(t,ts,""));s<=u.length;){switch(h=u[s],r){case tm:if(h&&M(G,h))a+=V(h),r=ty;else{if(e)return K;r=tw;continue}break;case ty:if(h&&(M($,h)||"+"===h||"-"===h||"."===h))a+=V(h);else if(":"===h){if(e&&(this.isSpecial()!==f(t_,a)||"file"===a&&(this.includesCredentials()||null!==this.port)||"file"===this.scheme&&!this.host))return;if(this.scheme=a,e){this.isSpecial()&&t_[this.scheme]===this.port&&(this.port=null);return}a="","file"===this.scheme?r=tO:this.isSpecial()&&i&&i.scheme===this.scheme?r=tb:this.isSpecial()?r=tI:"/"===u[s+1]?(r=tk,s++):(this.cannotBeABaseURL=!0,F(this.path,""),r=tW)}else{if(e)return K;a="",r=tw,s=0;continue}break;case tw:if(!i||i.cannotBeABaseURL&&"#"!==h)return K;if(i.cannotBeABaseURL&&"#"===h){this.scheme=i.scheme,this.path=g(i.path),this.query=i.query,this.fragment="",this.cannotBeABaseURL=!0,r=tF;break}r="file"===i.scheme?tO:tS;continue;case tb:if("/"===h&&"/"===u[s+1])r=tx,s++;else{r=tS;continue}break;case tk:if("/"===h){r=tU;break}r=tN;continue;case tS:if(this.scheme=i.scheme,h===n)this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,this.path=g(i.path),this.query=i.query;else if("/"===h||"\\"===h&&this.isSpecial())r=tA;else if("?"===h)this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,this.path=g(i.path),this.query="",r=tz;else if("#"===h)this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,this.path=g(i.path),this.query=i.query,this.fragment="",r=tF;else{this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,this.path=g(i.path),this.path.length--,r=tN;continue}break;case tA:if(this.isSpecial()&&("/"===h||"\\"===h))r=tx;else if("/"===h)r=tU;else{this.username=i.username,this.password=i.password,this.host=i.host,this.port=i.port,r=tN;continue}break;case tI:if(r=tx,"/"!==h||"/"!==R(a,s+1))continue;s++;break;case tx:if("/"!==h&&"\\"!==h){r=tU;continue}break;case tU:if("@"===h){o&&(a="%40"+a),o=!0,d=_(a);for(var u,h,d,p,v,m,w=0;w<d.length;w++){var b=d[w];if(":"===b&&!c){c=!0;continue}var k=tp(b,tf);c?this.password+=k:this.username+=k}a=""}else if(h===n||"/"===h||"?"===h||"#"===h||"\\"===h&&this.isSpecial()){if(o&&""===a)return"Invalid authority";s-=_(a).length+1,a="",r=tE}else a+=h;break;case tE:case tP:if(e&&"file"===this.scheme){r=tR;continue}if(":"!==h||l)if(h===n||"/"===h||"?"===h||"#"===h||"\\"===h&&this.isSpecial()){if(this.isSpecial()&&""===a)return q;if(e&&""===a&&(this.includesCredentials()||null!==this.port))return;if(p=this.parseHost(a))return p;if(a="",r=tM,e)return;continue}else"["===h?l=!0:"]"===h&&(l=!1),a+=h;else{if(""===a)return q;if(p=this.parseHost(a))return p;if(a="",r=tC,e===tP)return}break;case tC:if(M(Y,h))a+=h;else{if(!(h===n||"/"===h||"?"===h||"#"===h||"\\"===h&&this.isSpecial())&&!e)return H;if(""!==a){var S=C(a,10);if(S>65535)return H;this.port=this.isSpecial()&&S===t_[this.scheme]?null:S,a=""}if(e)return;r=tM;continue}break;case tO:if(this.scheme="file","/"===h||"\\"===h)r=tT;else if(i&&"file"===i.scheme)switch(h){case n:this.host=i.host,this.path=g(i.path),this.query=i.query;break;case"?":this.host=i.host,this.path=g(i.path),this.query="",r=tz;break;case"#":this.host=i.host,this.path=g(i.path),this.query=i.query,this.fragment="",r=tF;break;default:tv(N(g(u,s),""))||(this.host=i.host,this.path=g(i.path),this.shortenPath()),r=tN;continue}else{r=tN;continue}break;case tT:if("/"===h||"\\"===h){r=tR;break}i&&"file"===i.scheme&&!tv(N(g(u,s),""))&&(tg(i.path[0],!0)?F(this.path,i.path[0]):this.host=i.host),r=tN;continue;case tR:if(h===n||"/"===h||"\\"===h||"?"===h||"#"===h){if(!e&&tg(a))r=tN;else if(""===a){if(this.host="",e)return;r=tM}else{if(p=this.parseHost(a))return p;if("localhost"===this.host&&(this.host=""),e)return;a="",r=tM}continue}a+=h;break;case tM:if(this.isSpecial()){if(r=tN,"/"!==h&&"\\"!==h)continue}else if(e||"?"!==h)if(e||"#"!==h){if(h!==n&&(r=tN,"/"!==h))continue}else this.fragment="",r=tF;else this.query="",r=tz;break;case tN:if(h===n||"/"===h||"\\"===h&&this.isSpecial()||!e&&("?"===h||"#"===h)){if(".."===(v=V(v=a))||"%2e."===v||".%2e"===v||"%2e%2e"===v?(this.shortenPath(),"/"===h||"\\"===h&&this.isSpecial()||F(this.path,"")):"."===(m=a)||"%2e"===V(m)?"/"===h||"\\"===h&&this.isSpecial()||F(this.path,""):("file"===this.scheme&&!this.path.length&&tg(a)&&(this.host&&(this.host=""),a=R(a,0)+":"),F(this.path,a)),a="","file"===this.scheme&&(h===n||"?"===h||"#"===h))for(;this.path.length>1&&""===this.path[0];)L(this.path);"?"===h?(this.query="",r=tz):"#"===h&&(this.fragment="",r=tF)}else a+=tp(h,td);break;case tW:"?"===h?(this.query="",r=tz):"#"===h?(this.fragment="",r=tF):h!==n&&(this.path[0]+=tp(h,tu));break;case tz:e||"#"!==h?h!==n&&("'"===h&&this.isSpecial()?this.query+="%27":"#"===h?this.query+="%23":this.query+=tp(h,tu)):(this.fragment="",r=tF);break;case tF:h!==n&&(this.fragment+=tp(h,th))}s++}},parseHost:function(t){var e,i,n;if("["===R(t,0)){if("]"!==R(t,t.length-1)||!(e=to(B(t,1,-1))))return q;this.host=e}else if(this.isSpecial()){if(M(te,t=m(t))||null===(e=ta(t)))return q;this.host=e}else{if(M(ti,t))return q;for(n=0,e="",i=_(t);n<i.length;n++)e+=tp(i[n],tu);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return f(t_,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;e&&("file"!==this.scheme||1!==e||!tg(t[0],!0))&&t.length--},serialize:function(){var t=this.scheme,e=this.username,i=this.password,n=this.host,r=this.port,s=this.path,a=this.query,o=this.fragment,l=t+":";return null!==n?(l+="//",this.includesCredentials()&&(l+=e+(i?":"+i:"")+"@"),l+=tc(n),null!==r&&(l+=":"+r)):"file"===t&&(l+="//"),l+=this.cannotBeABaseURL?s[0]:s.length?"/"+N(s,"/"):"",null!==a&&(l+="?"+a),null!==o&&(l+="#"+o),l},setHref:function(t){var e=this.parse(t);if(e)throw new P(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new tL(t.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+tc(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(y(t)+":",tm)},getUsername:function(){return this.username},setUsername:function(t){var e=_(y(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<e.length;i++)this.username+=tp(e[i],tf)}},getPassword:function(){return this.password},setPassword:function(t){var e=_(y(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<e.length;i++)this.password+=tp(e[i],tf)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?tc(t):tc(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,tE)},getHostname:function(){var t=this.host;return null===t?"":tc(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,tP)},getPort:function(){var t=this.port;return null===t?"":y(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=y(t))?this.port=null:this.parse(t,tC))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+N(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,tM))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=y(t))?this.query=null:("?"===R(t,0)&&(t=B(t,1)),this.query="",this.parse(t,tz)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){if(""===(t=y(t))){this.fragment=null;return}"#"===R(t,0)&&(t=B(t,1)),this.fragment="",this.parse(t,tF)},update:function(){this.query=this.searchParams.serialize()||null}};var tL=function(t){var e=d(this,tj),i=b(arguments.length,1)>1?arguments[1]:void 0,n=A(e,new tD(t,!1,i));s||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},tj=tL.prototype,tB=function(t,e){return{get:function(){return I(this)[t]()},set:e&&function(t){return I(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(h(tj,"href",tB("serialize","setHref")),h(tj,"origin",tB("getOrigin")),h(tj,"protocol",tB("getProtocol","setProtocol")),h(tj,"username",tB("getUsername","setUsername")),h(tj,"password",tB("getPassword","setPassword")),h(tj,"host",tB("getHost","setHost")),h(tj,"hostname",tB("getHostname","setHostname")),h(tj,"port",tB("getPort","setPort")),h(tj,"pathname",tB("getPathname","setPathname")),h(tj,"search",tB("getSearch","setSearch")),h(tj,"searchParams",tB("getSearchParams")),h(tj,"hash",tB("getHash","setHash"))),u(tj,"toJSON",function(){return I(this).serialize()},{enumerable:!0}),u(tj,"toString",function(){return I(this).serialize()},{enumerable:!0}),E){var tV=E.createObjectURL,tJ=E.revokeObjectURL;tV&&u(tL,"createObjectURL",l(tV,E)),tJ&&u(tL,"revokeObjectURL",l(tJ,E))}w(tL,"URL"),r({global:!0,constructor:!0,forced:!a,sham:!s},{URL:tL})},9460:function(t,e,i){"use strict";i(2877)},3580:function(t,e,i){"use strict";var n=i(5258),r=i(7625);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}})},5945:function(t,e,i){"use strict";function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}i.d(e,{_:()=>n})},526:function(t,e,i){"use strict";i(9166)},8693:function(t,e,i){"use strict";i.d(e,{t:()=>n});let n=function(){for(var t=arguments.length,e=Array(t),i=0;i<t;i++)e[i]=arguments[i]}},9869:function(t,e,i){"use strict";function n(t){return Promise.all(Array.from(t).map(t=>t.then(t=>({status:"fulfilled",value:t}),t=>({status:"rejected",reason:t}))))}i.d(e,{a:()=>n}),i(9091),i(8593),i(9166),i(4261)},6431:function(t,e,i){"use strict";function n(t,e,i){return"function"==typeof t?t(e):void 0!==t?t:void 0!==i?i:void 0}i.d(e,{vd:()=>s.a,VK:()=>n,lQ:()=>r.t});var r=i(8693);i(526);var s=i(9869)}},r={};function s(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t].call(i.exports,i,i.exports,s),i.exports}s.m=n,s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},o=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,s.t=function(t,e){if(1&e&&(t=this(t)),8&e||"object"==typeof t&&t&&(4&e&&t.__esModule||16&e&&"function"==typeof t.then))return t;var i=Object.create(null);s.r(i);var n={};a=a||[null,o({}),o([]),o(o)];for(var r=2&e&&t;("object"==typeof r||"function"==typeof r)&&!~a.indexOf(r);r=o(r))Object.getOwnPropertyNames(r).forEach(e=>{n[e]=()=>t[e]});return n.default=()=>t,s.d(i,n),i},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce((e,i)=>(s.f[i](t,e),e),[])),s.u=t=>""+(({279:"stripe-vendors",545:"vendors",662:"query-core-vendors",729:"zxcvbn-ts-core",811:"cookieSuffix",873:"zxcvbn-common",929:"coinbase-wallet-sdk",994:"base-account-sdk"})[t]||t)+"_clerk.legacy.browser_"+s.h().slice(0,6)+"_6.0.0-snapshot.v20251218183643.js",s.h=()=>"6e74bb8f3d945b45",s.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),l={},s.l=function(t,e,i,n){if(l[t])return void l[t].push(e);if(void 0!==i)for(var r,a,o=document.getElementsByTagName("script"),c=0;c<o.length;c++){var u=o[c];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")=="@clerk/clerk-js:"+i){r=u;break}}r||(a=!0,(r=document.createElement("script")).timeout=120,s.nc&&r.setAttribute("nonce",s.nc),r.setAttribute("data-webpack","@clerk/clerk-js:"+i),r.src=t),l[t]=[e];var h=function(e,i){r.onerror=r.onload=null,clearTimeout(d);var n=l[t];if(delete l[t],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach(function(t){return t(i)}),e)return e(i)},d=setTimeout(h.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=h.bind(null,r.onerror),r.onload=h.bind(null,r.onload),a&&document.head.appendChild(r)},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.g.importScripts&&(c=s.g.location+"");var a,o,l,c,u=s.g.document;if(!c&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(c=u.currentScript.src),!c)){var h=u.getElementsByTagName("script");if(h.length)for(var d=h.length-1;d>-1&&(!c||!/^http(s?):/.test(c));)c=h[d--].src}if(!c)throw Error("Automatic publicPath is not supported in this browser");return s.p=c=c.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={236:0},s.f.j=function(e,i){var n=s.o(t,e)?t[e]:void 0;if(0!==n)if(n)i.push(n[2]);else{var r=new Promise((i,r)=>n=t[e]=[i,r]);i.push(n[2]=r);var a=s.p+s.u(e),o=Error();s.l(a,function(i){if(s.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),a=i&&i.target&&i.target.src;o.message="Loading chunk "+e+" failed.\n("+r+": "+a+")",o.name="ChunkLoadError",o.type=r,o.request=a,n[1](o)}},"chunk-"+e,e)}},e=(e,i)=>{var n,r,a=i[0],o=i[1],l=i[2],c=0;if(a.some(e=>0!==t[e])){for(n in o)s.o(o,n)&&(s.m[n]=o[n]);l&&l(s)}for(e&&e(i);c<a.length;c++)r=a[c],s.o(t,r)&&t[r]&&t[r][0](),t[r]=0},(i=globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i)),(()=>{"use strict";let t,e,i,n;s(4261),s(9460),s(3580),s(1244),s(5711),s(4346),s(8253),s(4891),s(2724);try{let t=new URL(document.currentScript.src),e=new URL(t.href.split("/").slice(0,-1).join("/")).href;s.p=(e+=e.endsWith("/")?"":"/").replace(/(^.*\/@clerk\/clerk-js@)(.+?)(\/dist.*)/,"$1".concat("6.0.0-snapshot.v20251218183643","$3"))}catch{}function r(t,e){return e.get?e.get.call(t):e.value}function a(t,e,i){if(!e.has(t))throw TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function o(t,e){var i=a(t,e,"get");return r(t,i)}function l(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function c(t,e,i){l(t,e),e.set(t,i)}function u(t,e,i){var n=a(t,e,"set");if(n.set)n.set.call(t,i);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=i}return i}function h(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return i}function d(t,e){l(t,e),e.add(t)}s(1300);var f,p,_,g,v,m,y,w,b,k,S,A,I,x,U,E,P,C,O,T,R,M,N,W,z,F,D,L,j,B,V,J,K,q,H,G,$,Y,X,Q,Z,tt,te,ti,tn,tr,ts,ta,to,tl,tc,tu=s(5945);function th(){return"undefined"!=typeof window}s(9166),s(9091),s(200),s(7918),s(6178),s(1747),s(3775),s(3272),s(9939),s(8593),s(6764),s(4853);let td=RegExp("bot|spider|crawl|APIs-Google|AdsBot|Googlebot|mediapartners|Google Favicon|FeedFetcher|Google-Read-Aloud|DuplexWeb-Google|googleweblight|bing|yandex|baidu|duckduck|yahoo|ecosia|ia_archiver|facebook|instagram|pinterest|reddit|slack|twitter|whatsapp|youtube|semrush","i");function tf(){var t,e;let i=th()?null==(t=window)?void 0:t.navigator:null;return!!i&&!((e=null==i?void 0:i.userAgent)&&td.test(e))&&!(null==i?void 0:i.webdriver)}function tp(){var t,e,i;let n=th()?null==(t=window)?void 0:t.navigator:null;if(!n)return!1;let r=null==n?void 0:n.onLine;return(null==n||null==(e=n.connection)?void 0:e.rtt)!==0&&(null==n||null==(i=n.connection)?void 0:i.downlink)!==0&&r}function t_(){return tp()&&tf()}let tg=(t,e,i,n,r)=>{let{notify:s}=r||{},a=t.get(i);a||(a=[],t.set(i,a)),a.push(n),s&&e.has(i)&&n(e.get(i))},tv=(t,e,i)=>(t.get(e)||[]).map(t=>t(i)),tm=(t,e,i)=>{let n=t.get(e);n&&(i?n.splice(n.indexOf(i)>>>0,1):t.set(e,[]))},ty=()=>{let t=new Map,e=new Map,i=new Map;return{on:function(){for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];return tg(t,e,...n)},prioritizedOn:function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return tg(i,e,...n)},emit:(n,r)=>{e.set(n,r),tv(i,n,r),tv(t,n,r)},off:function(){for(var e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];return tm(t,...i)},prioritizedOff:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return tm(i,...e)},internal:{retrieveListeners:e=>t.get(e)||[]}}},tw="status";function tb(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function tk(t){return function(e){let i=null!=e?e:this;if(!i)throw TypeError("".concat(t.kind||t.name," type guard requires an error object"));return i instanceof t}}s(3459);var tS=(p=class{constructor(t){var e,i,n,r,s,a,o;tb(this,"code",void 0),tb(this,"message",void 0),tb(this,"longMessage",void 0),tb(this,"meta",void 0);const l={code:t.code,message:t.message,longMessage:t.long_message,meta:{paramName:null==(e=t.meta)?void 0:e.param_name,sessionId:null==(i=t.meta)?void 0:i.session_id,emailAddresses:null==(n=t.meta)?void 0:n.email_addresses,identifiers:null==(r=t.meta)?void 0:r.identifiers,zxcvbn:null==(s=t.meta)?void 0:s.zxcvbn,plan:null==(a=t.meta)?void 0:a.plan,isPlanUpgradePossible:null==(o=t.meta)?void 0:o.is_plan_upgrade_possible}};this.code=l.code,this.message=l.message,this.longMessage=l.longMessage,this.meta=l.meta}},tb(p,"kind","ClerkApiError"),p);tk(tS);var tA=(_=class t extends Error{get name(){return this.constructor.name}toString(){return"[".concat(this.name,"]\nMessage:").concat(this.message)}static formatMessage(t,e,i,n){let r="Clerk:",s=RegExp(r.replace(" ","\\s*"),"i");return e=e.replace(s,""),e="".concat(r," ").concat(e.trim(),'\n\n(code="').concat(i,'")\n\n'),n&&(e+="\n\nDocs: ".concat(n)),e}constructor(e){super(new.target.formatMessage(new.target.kind,e.message,e.code,e.docsUrl),{cause:e.cause}),tb(this,"clerkError",!0),tb(this,"code",void 0),tb(this,"longMessage",void 0),tb(this,"docsUrl",void 0),tb(this,"cause",void 0),Object.setPrototypeOf(this,t.prototype),this.code=e.code,this.docsUrl=e.docsUrl,this.longMessage=e.longMessage,this.cause=e.cause}},tb(_,"kind","ClerkError"),_),tI=(g=class t extends tA{toString(){let t="[".concat(this.name,"]\nMessage:").concat(this.message,"\nStatus:").concat(this.status,"\nSerialized errors: ").concat(this.errors.map(t=>JSON.stringify(t)));return this.clerkTraceId&&(t+="\nClerk Trace ID: ".concat(this.clerkTraceId)),t}static formatMessage(t,e,i,n){return e}constructor(e,i){const{data:n,status:r,clerkTraceId:s,retryAfter:a}=i;super({...i,message:e,code:"api_response_error"}),tb(this,"status",void 0),tb(this,"clerkTraceId",void 0),tb(this,"retryAfter",void 0),tb(this,"errors",void 0),Object.setPrototypeOf(this,t.prototype),this.status=r,this.clerkTraceId=s,this.retryAfter=a,this.errors=(n||[]).map(t=>new tS(t))}},tb(g,"kind","ClerkAPIResponseError"),g);let tx=tk(tI),tU=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 tE(t){let{packageName:e,customMessages:i}=t,n=e;function r(t,e){if(!e)return"".concat(n,": ").concat(t);let i=t;for(let n of t.matchAll(/{{([a-zA-Z0-9-_]+)}}/g)){let t=(e[n[1]]||"").toString();i=i.replace("{{".concat(n[1],"}}"),t)}return"".concat(n,": ").concat(i)}let s={...tU,...i};return{setPackageName(t){let{packageName:e}=t;return"string"==typeof e&&(n=e),this},setMessages(t){let{customMessages:e}=t;return Object.assign(s,e||{}),this},throwInvalidPublishableKeyError(t){throw Error(r(s.InvalidPublishableKeyErrorMessage,t))},throwInvalidProxyUrl(t){throw Error(r(s.InvalidProxyUrlErrorMessage,t))},throwMissingPublishableKeyError(){throw Error(r(s.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(r(s.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(t){throw Error(r(s.MissingClerkProvider,t))},throw(t){throw Error(r(t))}}}var tP=class t extends Error{constructor(e){super(e),tb(this,"code",void 0),this.code=e,this.name="EmailLinkError",Object.setPrototypeOf(this,t.prototype)}},tC=(v=class t extends tA{constructor(e,i){super({...i,message:e}),tb(this,"clerkRuntimeError",!0),Object.setPrototypeOf(this,t.prototype)}},tb(v,"kind","ClerkRuntimeError"),v);let tO=tk(tC);var tT=class extends tC{constructor(t,{code:e}){super(t,{code:e}),tb(this,"code",void 0),this.code=e}};function tR(t){return["captcha_invalid","captcha_not_enabled","captcha_missing_token"].includes(t.errors[0].code)}function tM(t){let e=null==t?void 0:t.status;return!!e&&e>=400&&e<500}function tN(t){return t&&"clerkError"in t}function tW(t){return"clerkRuntimeError"in t}function tz(t){for(let[e,i]of Object.entries({isClerkApiResponseError:tx,isClerkRuntimeError:tO}))Object.assign(t,{[e]:i});return t}let tF=(t,e)=>!!(t.isSignedIn&&(null==e?void 0:e.authConfig.singleSessionMode)),tD=(t,e)=>!(null==e?void 0:e.commerceSettings.billing.user.enabled)&&!(null==e?void 0:e.commerceSettings.billing.organization.enabled),tL=(t,e)=>{var i;return!(null==e||null==(i=e.apiKeysSettings)?void 0:i.user_api_keys_enabled)},tj=(t,e)=>{var i;return!(null==e||null==(i=e.apiKeysSettings)?void 0:i.orgs_api_keys_enabled)},tB="__clerk_synced",tV="suffixed_cookies",tJ="__clerk_satellite_url",tK="clerk-captcha",tq="clerk-invisible-captcha";s(4784),s(7775);let tH=t=>"undefined"!=typeof atob&&"function"==typeof atob?atob(t):"undefined"!=typeof global&&global.Buffer?new global.Buffer(t,"base64").toString():t;s(4953),s(2536),s(8732),s(3405),s(9016),s(1408),s(7515),s(6698),s(4169),s(8809),s(7095),s(6176),s(4189);let tG=[".lcl.dev",".lclstage.dev",".lclclerk.com"],t$=[".accounts.dev",".accountsstage.dev",".accounts.lclclerk.com"],tY=[".lcl.dev",".stg.dev",".lclstage.dev",".stgstage.dev",".dev.lclclerk.com",".stg.lclclerk.com",".accounts.lclclerk.com","accountsstage.dev","accounts.dev"],tX="pk_live_";function tQ(t){if(!t.endsWith("$"))return!1;let e=t.slice(0,-1);return!e.includes("$")&&e.includes(".")}function tZ(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(t=t||"")||!t0(t)){if(i.fatal&&!t)throw Error("Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys");if(i.fatal&&!t0(t))throw Error("Publishable key not valid.");return null}let n=t.startsWith(tX)?"production":"development";try{e=tH(t.split("_")[2])}catch{if(i.fatal)throw Error("Publishable key not valid: Failed to decode key.");return null}if(!tQ(e)){if(i.fatal)throw Error("Publishable key not valid: Decoded key has invalid format.");return null}let r=e.slice(0,-1);return i.proxyUrl?r=i.proxyUrl:"development"!==n&&i.domain&&i.isSatellite&&(r="clerk.".concat(i.domain)),{instanceType:n,frontendApi:r}}function t0(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{if(!(t.startsWith(tX)||t.startsWith("pk_test_")))return!1;let e=t.split("_");if(3!==e.length)return!1;let i=e[2];if(!i)return!1;return tQ(tH(i))}catch{return!1}}async function t1(t){var e;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:globalThis.crypto.subtle,n=new TextEncoder().encode(t);return(e=String.fromCharCode(...new Uint8Array(await i.digest("sha-1",n))),"undefined"!=typeof btoa&&"function"==typeof btoa?btoa(e):"undefined"!=typeof global&&global.Buffer?new global.Buffer(e).toString("base64"):e).replace(/\+/gi,"-").replace(/\//gi,"_").substring(0,8)}let t2=(t,e)=>"".concat(t,"_").concat(e);var t3=s(1006);let t5=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/;s(574),s(5992),s(8385),s(5208),s(2935),s(9356),s(5702);let t6=new Set,t4=t=>{t6.has(t)||(t6.add(t),console.warn(t))};s(9116),s(6969);let t7=(t,e)=>{let i={};for(let n in t)i[n]=e(t[n],n);return i},t8=(t,e)=>{let i={};for(let n in t)t[n]&&e(t[n])&&(i[n]=t[n]);return i};function t9(t){return t?t.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace(/-|_/,"")):""}function et(t){return t?t.replace(/[A-Z]/g,t=>"_".concat(t.toLowerCase())):""}let ee=t=>{let e=i=>{if(!i)return i;if(Array.isArray(i))return i.map(t=>"object"==typeof t||Array.isArray(t)?e(t):t);let n={...i};for(let i of Object.keys(n)){let r=t(i.toString());r!==i&&(n[r]=n[i],delete n[i]),"object"==typeof n[r]&&(n[r]=e(n[r]))}return n};return e},ei=ee(et),en=ee(t9);function er(t){if("boolean"==typeof t)return t;if(null==t)return!1;if("string"==typeof t){if("true"===t.toLowerCase())return!0;if("false"===t.toLowerCase())return!1}let e=parseInt(t,10);return!isNaN(e)&&e>0}let es=RegExp("/{1,}","g"),ea=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==t||!t||"object"!=typeof t)return"";let i=new URLSearchParams;return Object.keys(t).forEach(n=>{let r=e.keyEncoder?e.keyEncoder(n):n,s=t[n];if(Array.isArray(s))s.forEach(t=>void 0!==t&&i.append(r,t||""));else{if(void 0===s)return;"object"==typeof s&&null!==s?i.append(r,JSON.stringify(s)):i.append(r,String(null!=s?s:""))}}),i.toString()};s(4214);let eo="http://clerk-dummy",el=["javascript:"],{isDevOrStagingUrl:ec}=(n=new Map,{isDevOrStagingUrl:t=>{if(!t)return!1;let e="string"==typeof t?t:t.hostname,i=n.get(e);return void 0===i&&(i=tY.some(t=>e.endsWith(t)),n.set(e,i)),i}}),eu=new Map;function eh(t){return t.replace("clerk.","")}function ed(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{base:i,hashPath:n,hashSearch:r,searchParams:s,hashSearchParams:a,...o}=t,l=new URL(i||"","undefined"!=typeof window&&window.location?window.location.href:"http://react-native-fake-base-url");if(s instanceof URLSearchParams&&s.forEach((t,e)=>{null!=t&&l.searchParams.set(et(e),t)}),Object.assign(l,o),n||r||a){var c;let t,e=new URL(eo+l.hash.substring(1));for(let[i,s]of(c=e.pathname,e.pathname=[c,n||""].filter(t=>t).join("/").replace(es,"/"),Object.entries((t={},new URLSearchParams(r||"").forEach((e,i)=>{if(i in t){let n=t[i];Array.isArray(n)?n.push(e):t[i]=[n,e]}else t[i]=e}),t))))e.searchParams.append(i,s);if(a)for(let t of Array.isArray(a)?a:[a])(t instanceof URLSearchParams||"object"==typeof t)&&new URLSearchParams(t).forEach((t,i)=>{null!=t&&e.searchParams.set(et(i),t)});let i=e.href.replace(eo,"");"/"!==i&&(l.hash=i)}let{stringify:u,skipOrigin:h}=e;return u?h?l.href.replace(l.origin,""):l.href:l}function ef(t){return void 0===window.location&&"string"==typeof t?t:(t=new URL(t.toString(),window.location.origin)).href.replace(t.origin,"")}let ep=t=>(t||"").replace(/\/+$/,"");function e_(t,e){try{return new URL(t)}catch{return new URL(t,e)}}let eg=[/\0/,/^\/\//,/[\x00-\x1F]/],ev=["/oauth/authorize"],em=["/v1/verify","/v1/tickets/accept","/oauth/authorize-with-immediate-redirect","/oauth/end_session"];function ey(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function ew(t,e){var i=function(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return e.get(t)}(t,e,0);return i.get?i.get.call(t):i.value}function eb(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return i}function ek(t,e){ey(t,e),e.add(t)}function eS(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var eA=(m=new WeakSet,y=new WeakSet,w=new WeakSet,b=new WeakSet,k=new WeakSet,S=new WeakSet,A=new WeakSet,I=new WeakMap,x=class{getAfterSignInUrl(){return eb(this,b,eE).call(this,"signIn")}getAfterSignUpUrl(){return eb(this,b,eE).call(this,"signUp")}getPreservedSearchParams(){return eb(this,m,eI).call(this,eb(this,y,ex).call(this))}toSearchParams(){return eb(this,m,eI).call(this,eb(this,w,eU).call(this))}constructor(t,e={},i={},n){ek(this,m),ek(this,y),ek(this,w),ek(this,b),ek(this,k),ek(this,S),ek(this,A),eS(this,"options",void 0),eS(this,"fromOptions",void 0),eS(this,"fromProps",void 0),eS(this,"fromSearchParams",void 0),eS(this,"mode",void 0),function(t,e,i){ey(t,e),e.set(t,i)}(this,I,{writable:!0,value:t=>{var e;let i,n;return t8(t,(i=null==(e=this.options)?void 0:e.allowedRedirectOrigins,n=window.location.origin,t=>{let e=t;if("string"==typeof e&&(e=e_(e,n)),!i)return!0;let r=n===e.origin,s=!function(t){if(function(t){if(!function(t){if(!t)return!1;try{return new URL(t),!0}catch{return!1}}(t))return!1;let e=new URL(t).protocol;return el.some(t=>t===e)}(t))return!0;for(let e of eg)if(e.test(t.pathname))return!0;return!1}(e)&&(r||i.map(t=>"string"==typeof t?(t=>{try{return t3(t)}catch(e){throw Error("Invalid pattern: ".concat(t,".\nConsult the documentation of glob-to-regexp here: https://www.npmjs.com/package/glob-to-regexp.\n").concat(e.message))}})(ep(t)):t).some(t=>t.test(ep(e.origin))));return s||t4("Clerk: Redirect URL ".concat(e," is not on one of the allowedRedirectOrigins, falling back to the default redirect URL.")),s}))}}),this.options=t,this.fromOptions=eb(this,k,eP).call(this,t||{}),this.fromProps=eb(this,k,eP).call(this,e||{}),this.fromSearchParams=eb(this,S,eC).call(this,i||{}),this.mode=n}},eS(x,"keys",["signInForceRedirectUrl","signInFallbackRedirectUrl","signUpForceRedirectUrl","signUpFallbackRedirectUrl","redirectUrl"]),eS(x,"preserved",["redirectUrl"]),x);function eI(t){return new URLSearchParams(Object.entries(Object.fromEntries(Object.entries(t).map(t=>{let[e,i]=t;return[et(e),i]}))).reduce((t,e)=>{let[i,n]=e;return null!=n&&(t[i]=n),t},{}))}function ex(){return Object.fromEntries(Object.entries({...this.fromSearchParams}).filter(t=>{let[e]=t;return x.preserved.includes(e)}))}function eU(){let t=this.fromSearchParams.signUpForceRedirectUrl||this.fromProps.signUpForceRedirectUrl||this.fromOptions.signUpForceRedirectUrl,e=this.fromSearchParams.signUpFallbackRedirectUrl||this.fromProps.signUpFallbackRedirectUrl||this.fromOptions.signUpFallbackRedirectUrl,i=this.fromSearchParams.signInForceRedirectUrl||this.fromProps.signInForceRedirectUrl||this.fromOptions.signInForceRedirectUrl,n={signUpForceRedirectUrl:t,signUpFallbackRedirectUrl:e,signInFallbackRedirectUrl:this.fromSearchParams.signInFallbackRedirectUrl||this.fromProps.signInFallbackRedirectUrl||this.fromOptions.signInFallbackRedirectUrl,signInForceRedirectUrl:i,redirectUrl:this.fromSearchParams.redirectUrl};return t&&delete n.signUpFallbackRedirectUrl,i&&delete n.signInFallbackRedirectUrl,n}function eE(t){let e,i="".concat(t,"ForceRedirectUrl"),n="".concat(t,"FallbackRedirectUrl");return((e=this.fromSearchParams[i]||this.fromProps[i]||this.fromOptions[i])||(e=this.fromSearchParams.redirectUrl),e||(e=this.fromSearchParams[n]||this.fromProps[n]||this.fromOptions[n]),e||"modal"!==this.mode)?e||"/":window.location.href}function eP(t){let e={};return x.keys.forEach(i=>{e[i]=t[i]}),t7(ew(this,I).call(this,eb(this,A,eO).call(this,t8(e,Boolean))),t=>t.toString())}function eC(t){let e={};return x.keys.forEach(i=>{t instanceof URLSearchParams?e[i]=t.get(et(i)):e[i]=t[et(i)]}),t7(ew(this,I).call(this,eb(this,A,eO).call(this,t8(e,Boolean))),t=>t.toString())}function eO(t){return t7(t,t=>e_(t,window.location.origin))}let eT="__clerk_netlify_cache_bust",eR=["__clerk_status","__clerk_created_session","__clerk_invitation_token","__clerk_ticket","__clerk_modal_state","__clerk_handshake","__clerk_handshake_nonce","__clerk_help",eT,tB,tJ,tV];function eM(t){return new URL(window.location.href).searchParams.get(t)||null}function eN(t){let e=new URL(window.location.href);e.searchParams.has(t)&&(e.searchParams.delete(t),window.history.replaceState(window.history.state,"",e))}function eW(t){let e=new URLSearchParams(window.location.search),i=t||new URLSearchParams;for(let t of eR){let n=e.get(t);n&&i.set(t,n)}return i}let ez={"choose-organization":"choose-organization","reset-password":"reset-password"},eF=t=>"/tasks/".concat(ez[t.key]);function eD(t,e){let{navigate:i,baseUrl:n}=e,r=t.currentTask;if(r){var s;let t;return i((s={base:n},t=eW(),ed({base:s.base,hashPath:eF(r),searchParams:t},{stringify:!0})))}}let eL=t=>"\uD83D\uDD12 Clerk:\n".concat(t.trim(),"\n(This notice only appears in development)"),ej={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.",cannotRenderSignUpComponentWhenTaskExists:"The <SignUp/> component cannot render when a user has a pending task, 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 task instead.",cannotRenderComponentWhenTaskDoesNotExist:"<TaskChooseOrganization/> cannot render unless a session task is pending. Clerk is redirecting to the value set in `redirectUrlComplete` 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.",cannotRenderSignInComponentWhenTaskExists:"The <SignIn/> component cannot render when a user has a pending task, 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 task 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:t=>eL("The <".concat(t,"/> 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.")),cannotRenderAnyBillingComponent:t=>eL("The <".concat(t,"/> component cannot be rendered when billing is disabled. Visit 'https://dashboard.clerk.com/last-active?path=billing/settings' to follow the necessary steps to enable billing. Since billing is disabled, 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.",cannotOpenCheckout:"The Checkout drawer 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.",cannotRenderAPIKeysComponent:"The <APIKeys/> component cannot be rendered when API keys is disabled. Since API keys is disabled, this is no-op.",cannotRenderAPIKeysComponentForOrgWhenUnauthorized:"The <APIKeys/> component cannot be rendered for an organization unless a user has the required permissions. Since the user does not have the necessary permissions, this is no-op.",cannotRenderAPIKeysComponentForUserWhenDisabled:"The <APIKeys/> component cannot be rendered when user API keys are disabled. Since user API keys are disabled, this is no-op.",cannotRenderAPIKeysComponentForOrgWhenDisabled:"The <APIKeys/> component cannot be rendered when organization API keys are disabled. Since organization API keys are disabled, this is no-op."};for(let t of Object.keys(ej)){let e=ej[t];"function"!=typeof e&&(ej[t]=eL(e))}let eB="clerk:beforeunload",eV=["http:","https:","wails:","chrome-extension:"];function eJ(t){let e=new URL(t,window.location.href);window.dispatchEvent(new CustomEvent(eB)),window.location.href=e.href}function eK(t){return/^http(s)?:\/\//.test(t||"")}function eq(t){return t.startsWith("/")}function eH(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function eG(t,e,i){if(!e.has(t))throw TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function e$(t,e){var i=eG(t,e,"get");return i.get?i.get.call(t):i.value}function eY(t,e,i){eH(t,e),e.set(t,i)}function eX(t,e,i){var n=eG(t,e,"set");if(n.set)n.set.call(t,i);else{if(!n.writable)throw TypeError("attempted to set read only private field");n.value=i}return i}function eQ(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return i}function eZ(t,e){eH(t,e),e.add(t)}var e0=(U=new WeakMap,E=new WeakMap,P=new WeakSet,class{isEventThrottled(t){let e=Date.now(),i=eQ(this,P,ie).call(this,t),n=e$(this,U).getItem(i);return!(!n||e-n>e$(this,E))||(e$(this,U).setItem(i,e),!1)}constructor(t){eZ(this,P),eY(this,U,{writable:!0,value:void 0}),eY(this,E,{writable:!0,value:864e5}),eX(this,U,t)}}),e1=(C=new WeakMap,O=new WeakSet,class{getItem(t){return eQ(this,O,ii).call(this)[t]}setItem(t,e){try{let i=eQ(this,O,ii).call(this);i[t]=e,localStorage.setItem(e$(this,C),JSON.stringify(i))}catch(t){t instanceof DOMException&&("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&localStorage.length>0&&localStorage.removeItem(e$(this,C))}}removeItem(t){try{let e=eQ(this,O,ii).call(this);delete e[t],localStorage.setItem(e$(this,C),JSON.stringify(e))}catch{}}static isSupported(){return"undefined"!=typeof window&&!!window.localStorage}constructor(){eZ(this,O),eY(this,C,{writable:!0,value:"clerk_telemetry_throttler"})}}),e2=(T=new WeakMap,R=new WeakMap,class{getItem(t){return e$(this,T).size>e$(this,R)?void e$(this,T).clear():e$(this,T).get(t)}setItem(t,e){e$(this,T).set(t,e)}removeItem(t){e$(this,T).delete(t)}constructor(){eY(this,T,{writable:!0,value:new Map}),eY(this,R,{writable:!0,value:1e4})}});let e3=new Set(["error","warn","info","debug","trace"]);var e5=(M=new WeakMap,N=new WeakMap,W=new WeakMap,z=new WeakMap,F=new WeakMap,D=new WeakSet,L=new WeakSet,j=new WeakSet,B=new WeakSet,V=new WeakSet,J=new WeakSet,K=new WeakSet,q=new WeakSet,H=new WeakSet,class{get isEnabled(){var t,e;return!("development"!==e$(this,W).instanceType||e$(this,M).disabled||"undefined"!=typeof process&&process.env&&er(process.env.CLERK_TELEMETRY_DISABLED))&&("undefined"==typeof window||null==(e=window)||null==(t=e.navigator)||!t.webdriver)}get isDebug(){return e$(this,M).debug||"undefined"!=typeof process&&process.env&&er(process.env.CLERK_TELEMETRY_DEBUG)}record(t){try{let e=eQ(this,q,ih).call(this,t.event,t.payload);if(eQ(this,J,ic).call(this,e.event,e),!eQ(this,D,ir).call(this,e,t.eventSamplingRate))return;e$(this,z).push({kind:"event",value:e}),eQ(this,B,io).call(this)}catch(t){console.error("[clerk/telemetry] Error recording telemetry event",t)}}recordLog(t){try{var e;if(!eQ(this,L,is).call(this,t))return;let i="string"==typeof(null==t?void 0:t.level)&&e3.has(t.level),n="string"==typeof(null==t?void 0:t.message)&&t.message.trim().length>0,r=null,s=null==t?void 0:t.timestamp;if("number"==typeof s||"string"==typeof s){let t=new Date(s);Number.isNaN(t.getTime())||(r=t)}if(!i||!n||null===r){this.isDebug&&"undefined"!=typeof console&&console.warn("[clerk/telemetry] Dropping invalid telemetry log entry",{levelIsValid:i,messageIsValid:n,timestampIsValid:null!==r});return}let a=eQ(this,K,iu).call(this),o={sdk:a.name,sdkv:a.version,cv:null!=(e=e$(this,W).clerkVersion)?e:"",lvl:t.level,msg:t.message,ts:r.toISOString(),pk:e$(this,W).publishableKey||null,payload:eQ(this,H,id).call(this,t.context)};e$(this,z).push({kind:"log",value:o}),eQ(this,B,io).call(this)}catch(t){console.error("[clerk/telemetry] Error recording telemetry log entry",t)}}constructor(t){var e,i,n,r,s,a,o;eZ(this,D),eZ(this,L),eZ(this,j),eZ(this,B),eZ(this,V),eZ(this,J),eZ(this,K),eZ(this,q),eZ(this,H),eY(this,M,{writable:!0,value:void 0}),eY(this,N,{writable:!0,value:void 0}),eY(this,W,{writable:!0,value:{}}),eY(this,z,{writable:!0,value:[]}),eY(this,F,{writable:!0,value:null}),eX(this,M,{maxBufferSize:null!=(e=t.maxBufferSize)?e:5,samplingRate:null!=(i=t.samplingRate)?i:1,perEventSampling:null==(n=t.perEventSampling)||n,disabled:null!=(r=t.disabled)&&r,debug:null!=(s=t.debug)&&s,endpoint:"https://clerk-telemetry.com"}),t.clerkVersion||"undefined"!=typeof window?e$(this,W).clerkVersion=null!=(a=t.clerkVersion)?a:"":e$(this,W).clerkVersion="",e$(this,W).sdk=t.sdk,e$(this,W).sdkVersion=t.sdkVersion,e$(this,W).publishableKey=null!=(o=t.publishableKey)?o:"";const l=tZ(t.publishableKey);l&&(e$(this,W).instanceType=l.instanceType),t.secretKey&&(e$(this,W).secretKey=t.secretKey.substring(0,16)),eX(this,N,new e0(e1.isSupported()?new e1:new e2))}});let e6="COMPONENT_MOUNTED",e4=new Set(["SignIn","SignUp"]);function e7(t){return function(e,i,n){var r,s,a;return{event:t,eventSamplingRate:t===e6?e4.has(e)?1:.1:.1,payload:{component:e,appearanceProp:!!(null==i?void 0:i.appearance),theme:!!(null==i||null==(r=i.appearance)?void 0:r.theme),elements:!!(null==i||null==(s=i.appearance)?void 0:s.elements),variables:!!(null==i||null==(a=i.appearance)?void 0:a.variables),...n}}}}function e8(t,e,i){return e7(e6)(t,e,i)}function e9(t,e,i){return e7("COMPONENT_OPENED")(t,e,i)}function it(t){return"string"==typeof t?t:"object"==typeof t&&null!==t&&"name"in t&&"string"==typeof t.name?t.name:void 0}function ie(t){let{sk:e,pk:i,payload:n,...r}=t,s={...n,...r};return JSON.stringify(Object.keys({...n,...r}).sort().map(t=>s[t]))}function ii(){try{let t=localStorage.getItem(e$(this,C));if(!t)return{};return JSON.parse(t)}catch{return{}}}function ir(t,e){return this.isEnabled&&!this.isDebug&&eQ(this,j,ia).call(this,t,e)}function is(t){return!0}function ia(t,e){let i=Math.random();return!!(i<=e$(this,M).samplingRate&&(!1===e$(this,M).perEventSampling||void 0===e||i<=e))&&!e$(this,N).isEventThrottled(t)}function io(){if("undefined"==typeof window)return void eQ(this,V,il).call(this);if(e$(this,z).length>=e$(this,M).maxBufferSize){e$(this,F)&&("undefined"!=typeof cancelIdleCallback?cancelIdleCallback(Number(e$(this,F))):clearTimeout(Number(e$(this,F)))),eQ(this,V,il).call(this);return}e$(this,F)||("requestIdleCallback"in window?eX(this,F,requestIdleCallback(()=>{eQ(this,V,il).call(this),eX(this,F,null)})):eX(this,F,setTimeout(()=>{eQ(this,V,il).call(this),eX(this,F,null)},0)))}function il(){let t=[...e$(this,z)];if(eX(this,z,[]),eX(this,F,null),0===t.length)return;let e=t.filter(t=>"event"===t.kind).map(t=>t.value),i=t.filter(t=>"log"===t.kind).map(t=>t.value);e.length>0&&fetch(new URL("/v1/event",e$(this,M).endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({events:e})}).catch(()=>void 0),i.length>0&&fetch(new URL("/v1/logs",e$(this,M).endpoint),{headers:{"Content-Type":"application/json"},keepalive:!0,method:"POST",body:JSON.stringify({logs:i})}).catch(()=>void 0)}function ic(t,e){this.isDebug&&(void 0!==console.groupCollapsed?(console.groupCollapsed("[clerk/telemetry]",t),console.log(e),console.groupEnd()):console.log("[clerk/telemetry]",t,e))}function iu(){let t={name:e$(this,W).sdk,version:e$(this,W).sdkVersion};if("undefined"!=typeof window){let e=window;if(e.Clerk){let i=e.Clerk;if("object"==typeof i&&null!==i&&"constructor"in i&&"function"==typeof i.constructor&&i.constructor.sdkMetadata){let{name:e,version:n}=i.constructor.sdkMetadata;void 0!==e&&(t.name=e),void 0!==n&&(t.version=n)}}}return t}function ih(t,e){var i,n;let r=eQ(this,K,iu).call(this);return{event:t,cv:null!=(i=e$(this,W).clerkVersion)?i:"",it:null!=(n=e$(this,W).instanceType)?n:"",sdk:r.name,sdkv:r.version,...e$(this,W).publishableKey?{pk:e$(this,W).publishableKey}:{},...e$(this,W).secretKey?{sk:e$(this,W).secretKey}:{},payload:e}}function id(t){if(null==t||"object"!=typeof t)return null;try{let e=JSON.parse(JSON.stringify(t));if(e&&"object"==typeof e&&!Array.isArray(e))return e;return null}catch{return null}}var ip=s(6431);let i_=!1,ig=null,iv=!1,im=[];function iy(t,e,i,n){i_&&(im.push({level:t,message:e,context:i,source:n,ts:Date.now()}),im.length>200&&im.shift())}async function iw(t){try{if(!i_||ig)return;let{getDebugLogger:e}=await Promise.all([s.e("545"),s.e("507")]).then(s.bind(s,9854)),i=await e({logLevel:null==t?void 0:t.logLevel,telemetryCollector:null==t?void 0:t.telemetryCollector});if(i&&(ig=i)&&0!==im.length){for(let t of im){let e={...t.context||{},__preInit:!0,__preInitTs:t.ts};switch(t.level){case"error":ig.error(t.message,e,t.source);break;case"warn":ig.warn(t.message,e,t.source);break;case"info":ig.info(t.message,e,t.source);break;case"debug":ig.debug(t.message,e,t.source)}}im.length=0}}catch(t){try{var e,i;null==(e=(i=console).debug)||e.call(i,"Debug logger initialization failed",t)}catch{}return}}let ib={debug(t,e,i){ig?ig.debug(t,e,i):iy("debug",t,e,i)},error(t,e,i){ig?ig.error(t,e,i):iy("error",t,e,i)},info(t,e,i){ig?ig.info(t,e,i):iy("info",t,e,i)},warn(t,e,i){ig?ig.warn(t,e,i):iy("warn",t,e,i)}},ik={initialDelay:125,maxDelayBetweenRetries:0,factor:2,shouldRetry:(t,e)=>e<5,retryImmediately:!1,jitter:!0},iS=async t=>new Promise(e=>setTimeout(e,t)),iA=(t,e)=>e?t*(1+Math.random()):t,iI=async function(t){var e;let i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=0,{shouldRetry:s,initialDelay:a,maxDelayBetweenRetries:o,factor:l,retryImmediately:c,jitter:u,onBeforeRetry:h}={...ik,...n},d=(e={initialDelay:a,maxDelayBetweenRetries:o,factor:l,jitter:u},i=0,async()=>{let t;await iS((t=iA(t=e.initialDelay*Math.pow(e.factor,i),e.jitter),Math.min(e.maxDelayBetweenRetries||t,t))),i++});for(;;)try{return await t()}catch(t){if(!s(t,++r))throw t;h&&await h(r),c&&1===r?await iS(iA(100,u)):await d()}},ix=async t=>iI(t,{initialDelay:100,shouldRetry:(t,e)=>e<=3,retryImmediately:!0,factor:2});var iU=new WeakMap;class iE{import(t){return o(this,iU)[t]?o(this,iU)[t]():Promise.resolve(void 0)}constructor(){c(this,iU,{writable:!0,value:{"@zxcvbn-ts/core":()=>ix(()=>Promise.all([s.e("729"),s.e("545")]).then(s.bind(s,7010))),"@zxcvbn-ts/language-common":()=>ix(()=>s.e("873").then(s.bind(s,655))),"@base-org/account":()=>ix(()=>Promise.all([s.e("994"),s.e("929"),s.e("545")]).then(s.bind(s,71))),"@coinbase/wallet-sdk":()=>ix(()=>Promise.all([s.e("994"),s.e("929"),s.e("545")]).then(s.bind(s,5537))),"@stripe/stripe-js":()=>ix(()=>s.e("279").then(s.bind(s,5608)))}})}}let iP=function(){let t,e,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!i)return{track:async t=>{await t()},isUnloading:()=>!1};let n=(t=!1,e=()=>t=!0,{startListening:()=>{window.addEventListener("beforeunload",e),window.addEventListener(eB,e)},stopListening:()=>{window.removeEventListener("beforeunload",e),window.removeEventListener(eB,e)},isUnloading:()=>t});return{track:async t=>{n.startListening(),await t(),n.stopListening()},isUnloading:n.isUnloading}},iC=t=>({amount:t.amount,amountFormatted:t.amount_formatted,currency:t.currency,currencySymbol:t.currency_symbol}),iO=t=>{let e={grandTotal:iC(t.grand_total),subtotal:iC(t.subtotal),taxTotal:iC(t.tax_total)};return"past_due"in t&&(e.pastDue=t.past_due?iC(t.past_due):null),"credit"in t&&(e.credit=t.credit?iC(t.credit):null),"total_due_now"in t&&(e.totalDueNow=iC(t.total_due_now)),"total_due_after_free_trial"in t&&(e.totalDueAfterFreeTrial=t.total_due_after_free_trial?iC(t.total_due_after_free_trial):null),e};function iT(t){return decodeURIComponent(globalThis.atob(t.replace(/_/g,"/").replace(/-/g,"+")).split("").map(t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}function iR(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t.errors&&!!t.errors.find(t=>t.code===e)}let iM=tE({packageName:"@clerk/clerk-js"});function iN(t){let e=(t||"").split("."),[i,n,r]=e;if(3!==e.length||!i||!n||!r)throw Error("JWT could not be decoded");let s=JSON.parse(iT(n)),a={__raw:t};return Object.keys(s).forEach(t=>{a[t]=s[t]}),{encoded:{header:i,payload:n,signature:r},header:JSON.parse(iT(i)),claims:a}}function iW(){if(!th())return null;try{var t;let e=null==(t=navigator)?void 0:t.language;if(!e||"string"!=typeof e||""===e.trim())return null;return e}catch{return null}}function iz(){return void 0!==globalThis.document}function iF(){if(!function(){if(!iz())return!1;try{return window.self!==window.top}catch{return!0}}())return!1;try{var t;return null==(t=window.top)||t.location.href,!1}catch{return!0}}s(8303);let iD={build:(t,e,i)=>[t,e,i].filter(Boolean).join("-"),parse:(t,e,i)=>{let n=iD.extractTemplate(t,e,i);return{organizationId:i,sessionId:e,template:n}},extractTemplate:(t,e,i)=>{if(t===e||i&&t==="".concat(e,"-").concat(i))return;let n=t.slice(e.length+1);return i&&n.endsWith("-".concat(i))&&(n=n.slice(0,-(i.length+1))),n||void 0}},iL="ClerkJS:";function ij(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";throw Error("".concat(iL," Something went wrong initializing Clerk in development mode.").concat(t&&" ".concat(t)))}function iB(t){throw Error("".concat(iL," Something went wrong initializing Clerk during the ").concat(t," flow. Please contact support."))}function iV(t){throw Error("".concat(iL," You need to start a ").concat(t," flow by calling ").concat(t,".create() first."))}function iJ(t,e){throw Error("".concat(iL,' Strategy "').concat(e,'" is not a valid strategy for ').concat(t,"."))}function iK(t){throw Error("".concat(iL," You need to start a ").concat(t," flow by calling ").concat(t,".create({ identifier: 'your web3 wallet address' }) first"))}function iq(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";throw Error("".concat(iL," Missing '").concat(t,"' option"))}function iH(t,e){throw Error("".concat(iL," Response: ").concat(t||0," not supported yet.\nFor more information contact us at ").concat(e))}function iG(t){throw Error("".concat(iL," Missing publicKey. When calling 'navigator.credentials.").concat(t,"()' it is required to pass a publicKey object."))}function i$(t,e){return e.get?e.get.call(t):e.value}function iY(t,e){if(void 0===t)throw TypeError("attempted to "+e+" private static field before its declaration")}function iX(t,e){var i=function(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return e.get(t)}(t,e,0);return i$(t,i)}function iQ(t,e,i){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object");e.set(t,i)}function iZ(t,e,i){return i0(t,e),iY(i,"get"),i$(t,i)}function i0(t,e){if(t!==e)throw TypeError("Private static access of wrong provenance")}var i1=(G=new WeakMap,$=new WeakMap,Y=new WeakMap,X=class t{static getInstance(){return iZ(t,X,Q)||function(t,e,i,n){i0(t,e),iY(i,"set");if(i.set)i.set.call(t,n);else{if(!i.writable)throw TypeError("attempted to set read only private field");i.value=n}}(t,X,Q,new t),iZ(t,X,Q)}constructor(){if(iQ(this,G,{writable:!0,value:[]}),iQ(this,$,{writable:!0,value:{metamask:"MetaMask",okx_wallet:"OKX Wallet"}}),!function(t,e,i){"get"in t?Object.defineProperty(t,"get",{value:i,enumerable:!0,configurable:!0,writable:!0}):t.get=i}(this,0,t=>{var e;let i=null==(e=iX(this,G).find(e=>e.info.name===iX(this,$)[t]))?void 0:e.provider;return void 0!==i?i:window.ethereum}),iQ(this,Y,{writable:!0,value:t=>{iX(this,G).some(e=>e.info.uuid===t.detail.info.uuid)||iX(this,G).push(t.detail)}}),"undefined"==typeof window)return;window.addEventListener("eip6963:announceProvider",iX(this,Y)),window.dispatchEvent(new Event("eip6963:requestProvider"))}},Q={writable:!0,value:null},X);function i2(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function i3(t,e){return e.get?e.get.call(t):e.value}function i5(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=i}}function i6(t,e){if(void 0===t)throw TypeError("attempted to "+e+" private static field before its declaration")}function i4(t,e,i){if(!e.has(t))throw TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function i7(t,e){var i=i4(t,e,"get");return i3(t,i)}function i8(t,e,i){i2(t,e),e.set(t,i)}function i9(t,e,i){var n=i4(t,e,"set");return i5(t,n,i),i}function nt(t,e,i){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return i}function ne(t,e){i2(t,e),e.add(t)}function ni(t,e,i){return nn(t,e),i6(i,"get"),i3(t,i)}function nn(t,e){if(t!==e)throw TypeError("Private static access of wrong provenance")}var nr=(Z=new WeakMap,tt=new WeakMap,te=new WeakSet,ti=new WeakSet,tn=new WeakSet,tr=class t{static getInstance(){var e,i,n;return ni(t,tr,ts)||(e=tr,i=ts,n=new t,nn(t,e),i6(i,"set"),i5(t,i,n)),ni(t,tr,ts)}constructor(){ne(this,te),ne(this,ti),ne(this,tn),i8(this,Z,{writable:!0,value:void 0}),i8(this,tt,{writable:!0,value:!1}),function(t,e,i){"get"in t?Object.defineProperty(t,"get",{value:i,enumerable:!0,configurable:!0,writable:!0}):t.get=i}(this,0,async t=>{await nt(this,te,ns).call(this);let e=(i7(this,Z)||[]).find(e=>e.name===t&&nt(this,ti,na).call(this,e)&&nt(this,tn,no).call(this,e));if(e&&nt(this,ti,na).call(this,e))return e;if("undefined"==typeof window)return;let i=window.solana;if(i&&"function"==typeof i.connect&&"function"==typeof i.signMessage)return i})}},ts={writable:!0,value:null},tr);async function ns(){if(i7(this,tt))return;i9(this,tt,!0);let t=await s.e("197").then(s.bind(s,4076)).then(t=>t.getWallets());i9(this,Z,t.get()),t.on("register",()=>{i9(this,Z,t.get())}),t.on("unregister",()=>{i9(this,Z,t.get())})}function na(t){var e,i;return null!=(i=null==(e=t.chains)?void 0:e.some(t=>t.startsWith("solana:")))&&i}function no(t){return"solana:signMessage"in t.features}let nl=()=>(function(t){let e=tE({packageName:"@clerk/shared"});async function i(t){let{provider:e,walletName:i}=t,n=await p(e,i);if(!n)return"";if("solana"===e){let t=await n.features["standard:connect"].connect();return t&&t.accounts[0].address||""}let r=await n.request({method:"eth_requestAccounts"});return r&&r[0]||""}let n=async t=>{let{identifier:e,nonce:i,provider:n,walletName:r=""}=t,s=await p(n,r);if(!s)return"";if("solana"===n)try{var a,o;let t=s.accounts.find(t=>t.address===e);if(!t)return console.warn("Wallet account with address ".concat(e," not found")),"";let n=await (null==(a=s.features["solana:signMessage"])?void 0:a.signMessage({account:t,message:new TextEncoder().encode(i)}));return(null==n||null==(o=n[0])?void 0:o.signature)?btoa(String.fromCharCode(...n[0].signature)):""}catch(t){if(t instanceof Error&&t.message.includes("User rejected the request."))throw new tC("Web3 signature request was rejected by the user.",{code:"web3_signature_request_rejected"});throw new tC("An error occurred while generating the Solana signature.",{code:"web3_solana_signature_generation_failed",cause:t instanceof Error?t:void 0})}return await s.request({method:"personal_sign",params:["0x".concat(i.split("").map(t=>t.charCodeAt(0).toString(16).padStart(2,"0")).join("")),e]})};async function r(){return await i({provider:"metamask"})}async function s(){return await i({provider:"coinbase_wallet"})}async function a(){return await i({provider:"okx_wallet"})}async function o(){return await i({provider:"base"})}async function l(t){return await i({provider:"solana",walletName:t})}async function c(t){return await n({...t,provider:"metamask"})}async function u(t){return await n({...t,provider:"coinbase_wallet"})}async function h(t){return await n({...t,provider:"okx_wallet"})}async function d(t){return await n({...t,provider:"base"})}async function f(t){return await n({...t,provider:"solana"})}async function p(i,n){if("coinbase_wallet"===i){let e=await t.import("@coinbase/wallet-sdk");return e?e.createCoinbaseWalletSDK({preference:{options:"all"}}).getProvider():null}if("base"===i)try{var r,s,a;let e=await t.import("@base-org/account");if(!e)return null;return e.createBaseAccountSDK({appName:"undefined"!=typeof window&&(null==(a=window.Clerk)||null==(s=a.__internal_environment)||null==(r=s.displayConfig)?void 0:r.applicationName)||"undefined"!=typeof document&&document.title||"Web3 Application"}).getProvider()}catch{return null}return"solana"===i?n&&0!==n.length?await nr.getInstance().get(n):void e.throw("Wallet name must be provided to get Solana wallet provider"):i1.getInstance().get(i)}return{getWeb3Identifier:i,generateWeb3Signature:n,getMetamaskIdentifier:r,getCoinbaseWalletIdentifier:s,getOKXWalletIdentifier:a,getBaseIdentifier:o,getSolanaIdentifier:l,generateSignatureWithMetamask:c,generateSignatureWithCoinbaseWallet:u,generateSignatureWithOKXWallet:h,generateSignatureWithBase:d,generateSignatureWithSolana:f}})(new iE),nc="environment",nu=JSON.stringify,nh=JSON.parse;class nd{static _key(t){return"".concat("__clerk_").concat(t)}static isExpired(t){return!!t.exp&&Date.now()>t.exp}static setItem(t,e,i){try{let n={value:e,...i&&{exp:Date.now()+i}};window.localStorage.setItem(this._key(t),nu(n))}catch{}}static getItem(t,e){try{var i;let n=window.localStorage.getItem(this._key(t));if(!n)return e;let r=nh(n);if(!r)return e;if(this.isExpired(r))return this.removeItem(t),e;return null!=(i=null==r?void 0:r.value)?i:e}catch{return e}}static removeItem(t){try{window.localStorage.removeItem(this._key(t))}catch{}}}async function nf(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,{async:i,defer:n,beforeLoad:r,crossOrigin:s,nonce:a}=e||{};return iI(()=>new Promise((e,o)=>{t||o(Error("loadScript cannot be called without a src")),document&&document.body||o(Error("loadScript cannot be called when document does not exist"));let l=document.createElement("script");s&&l.setAttribute("crossorigin",s),l.async=i||!1,l.defer=n||!1,l.addEventListener("load",()=>{l.remove(),e(l)}),l.addEventListener("error",e=>{var i;l.remove(),o(null!=(i=e.error)?i:Error("failed to load script: ".concat(t)))}),l.src=t,l.nonce=a,null==r||r(l),document.body.appendChild(l)}),{shouldRetry:(t,e)=>e<=5})}async function np(t){return window.turnstile||await n_(t).catch(()=>{throw{captchaError:"captcha_script_failed_to_load"}}),window.turnstile}async function n_(t){try{return await nf("https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",{defer:!0,nonce:t})}catch(t){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."),t}}function ng(t){try{let e=t.getAttribute("data-cl-theme")||void 0,i=t.getAttribute("data-cl-language")||void 0,n=t.getAttribute("data-cl-size")||void 0;return{theme:e,language:i,size:n}}catch{return{theme:void 0,language:void 0,size:void 0}}}let nv=async t=>{let e,i,n,r,{siteKey:s,widgetType:a,invisibleSiteKey:o,nonce:l}=t,{modalContainerQuerySelector:c,modalWrapperQuerySelector:u,closeModal:h,openModal:d}=t,f=await np(l),p=[],_="",g="",v=s,m=0,y=null,w="invisible";if(c&&u){y=a,r=c,w="modal";try{await (null==d?void 0:d())}catch{throw{captchaError:"modal_component_not_ready"}}let t=await new Promise(t=>{if(document.querySelector(c))return t(document.querySelector(c));let e=new MutationObserver(()=>{document.querySelector(c)&&(e.disconnect(),t(document.querySelector(c)))});e.observe(document.body,{childList:!0,subtree:!0})});if(t){let{theme:r,language:s,size:a}=ng(t);e=r,n=s,i=a}}if(!r&&"smart"===a){let t=document.getElementById(tK);if(t){w="smart",y="smart",r="#".concat(tK),t.style.maxHeight="0";let{theme:s,language:a,size:o}=ng(t);e=s,n=a,i=o}else 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/guides/development/custom-flows/authentication/bot-sign-up-protection for instructions")}if(!r){w="invisible",v=o,y="invisible",r=".".concat(tq);let t=document.createElement("div");t.classList.add(tq),t.style.display="none",document.body.appendChild(t)}let b=async()=>new Promise((s,a)=>{try{let o=f.render(r,{sitekey:v,appearance:"interaction-only",theme:e||"auto",size:i||"normal",language:n||"auto",action:t.action,retry:"never","refresh-expired":"auto",callback:function(t){null==h||h(),s([t,o])},"before-interactive-callback":()=>{if(u){let t=document.querySelector(u);null==t||t.style.setProperty("visibility","visible"),null==t||t.style.setProperty("pointer-events","all")}else{let t=document.getElementById(tK);t&&(t.style.maxHeight="unset",t.style.minHeight="compact"===i?"140px":"68px",t.style.marginBottom="1.5rem")}},"error-callback":function(t){var e;(p.push(t),m<2&&(e=t.toString(),["crashed","undefined_error","102","103","104","106","110600","300","600"].find(t=>e.startsWith(t))))?setTimeout(()=>{f.reset(o),m++},250):a([p.join(","),o])},"unsupported-callback":function(){return a(["This browser is not supported by the CAPTCHA.",o]),!0}})}catch(t){a([t,void 0])}});try{[_,g]=await b(),f.remove(g)}catch(i){let[t,e]=i;throw e&&f.remove(e),{captchaError:t}}finally{if("modal"===w&&(null==h||h()),"invisible"===w){let t=document.querySelector(".".concat(tq));t&&document.body.removeChild(t)}if("smart"===w){let t=document.getElementById(tK);t&&(t.style.maxHeight="0",t.style.minHeight="unset",t.style.marginBottom="unset")}}return{captchaToken:_,captchaWidgetType:y}},nm=t=>{var e;let i=t.__internal_environment,n=i?i.displayConfig.captchaProvider:"turnstile",r=null==(e=t.__internal_getOption)?void 0:e.call(t,"nonce");return{captchaSiteKey:i?i.displayConfig.captchaPublicKey:null,captchaWidgetType:i?i.displayConfig.captchaWidgetType:null,captchaProvider:n,captchaPublicKeyInvisible:i?i.displayConfig.captchaPublicKeyInvisible:null,canUseCaptcha:i?i.userSettings.signUp.captcha_enabled&&t.isStandardBrowser:null,nonce:r||void 0}};class ny{async invisible(t){let{captchaSiteKey:e,canUseCaptcha:i,captchaPublicKeyInvisible:n,nonce:r}=nm(this.clerk);return i&&e&&n?{...await nv({action:null==t?void 0:t.action,captchaProvider:"turnstile",invisibleSiteKey:n,nonce:(null==t?void 0:t.nonce)||r||void 0,siteKey:n,widgetType:"invisible"}).catch(t=>t.captchaError?{captchaError:t.captchaError}:{captchaError:(null==t?void 0:t.message)||t||"unexpected_captcha_error"}),captchaAction:null==t?void 0:t.action}:{captchaError:"captcha_unavailable",captchaAction:null==t?void 0:t.action}}async managedOrInvisible(t){let{captchaSiteKey:e,canUseCaptcha:i,captchaWidgetType:n,captchaProvider:r,captchaPublicKeyInvisible:s,nonce:a}=nm(this.clerk);if(i&&e&&s){let i=await nv({captchaProvider:r,invisibleSiteKey:s,nonce:a||void 0,siteKey:e,widgetType:n,...t}).catch(e=>e.captchaError?{captchaError:e.captchaError}:(null==t?void 0:t.action)==="verify"?{captchaError:(null==e?void 0:e.message)||e||"unexpected_captcha_error"}:void 0);return(null==t?void 0:t.action)==="verify"?{...i,captchaAction:"verify"}:i}return(null==t?void 0:t.action)==="verify"?{captchaError:"captcha_unavailable",captchaAction:null==t?void 0:t.action}:{}}async managedInModal(t){return this.managedOrInvisible({modalWrapperQuerySelector:"#cl-modal-captcha-wrapper",modalContainerQuerySelector:"#cl-modal-captcha-container",openModal:()=>this.clerk.__internal_openBlankCaptchaModal(),closeModal:()=>this.clerk.__internal_closeBlankCaptchaModal(),action:null==t?void 0:t.action})}constructor(t){(0,tu._)(this,"clerk",void 0),this.clerk=t}}class nw{static getInstance(){return nw.instance||(nw.instance=new nw(rp,ny)),nw.instance}async execute(t,e){if(this.captchaAttemptsExceeded())throw new tC("Security verification failed. Please try again by refreshing the page, clearing your browser cookies, or using a different web browser.",{code:"captcha_client_attempts_exceeded"});try{return this.inflightException&&await this.inflightException,await e()}catch(r){var i;let n;if(!tN(r)||tW(r)&&"network_error"===r.code||(null==(i=r.errors[0])?void 0:i.code)!=="requires_captcha")throw r;if(this.inflightException)return await this.inflightException,await e();this.inflightException=new Promise(t=>n=t);try{let e=await this.managedChallenge(t);(null==e?void 0:e.captchaError)!=="modal_component_not_ready"&&(await this.client.getOrCreateInstance().__internal_sendCaptchaToken(e),this.captchaRetryCount=0)}catch(t){throw this.captchaRetryCount++,t}finally{n(),this.inflightException=null}return await e()}}managedChallenge(t){return new this.CaptchaChallengeImpl(t).managedInModal({action:"verify"})}constructor(t,e){(0,tu._)(this,"client",void 0),(0,tu._)(this,"CaptchaChallengeImpl",void 0),(0,tu._)(this,"inflightException",void 0),(0,tu._)(this,"captchaRetryCount",void 0),(0,tu._)(this,"MAX_RETRY_ATTEMPTS",void 0),(0,tu._)(this,"captchaAttemptsExceeded",void 0),this.client=t,this.CaptchaChallengeImpl=e,this.inflightException=null,this.captchaRetryCount=0,this.MAX_RETRY_ATTEMPTS=3,this.captchaAttemptsExceeded=()=>this.captchaRetryCount>=this.MAX_RETRY_ATTEMPTS}}(0,tu._)(nw,"instance",void 0);class nb{static get fapiClient(){return nb.clerk.getFapiClient()}async reload(t){let{rotatingTokenNonce:e}=t||{};return this._baseGet({forceUpdateClient:!0,rotatingTokenNonce:e})}isNew(){return!this.id}static async _fetch(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nw.getInstance().execute(this.clerk,()=>this._baseFetch(t,e))}static async _baseFetch(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};nb.fapiClient||function(){throw Error("".concat(iL," Missing FAPI client in resources."))}();let{fetchMaxTries:n}=i;try{e=await nb.fapiClient.request(t,{fetchMaxTries:n})}catch(e){if(this.shouldRethrowOfflineNetworkErrors())throw new tC((null==e?void 0:e.message)||e,{code:"network_error"});if(!t_())return ib.warn("Network request failed while offline, returning null",{method:t.method,path:t.path},"baseResource"),null;throw e}let{payload:r,status:s,statusText:a,headers:o}=e;if(o){let t=o.get("x-country");this.clerk.__internal_setCountry(t?t.toLowerCase():null)}if(("GET"!==t.method||i.forceUpdateClient)&&this._updateClient(r),s>=200&&s<=299)return r;if(s>=400){var l,c;let t=null==r?void 0:r.errors,e=null==t||null==(l=t[0])?void 0:l.long_message,i=null==t||null==(c=t[0])?void 0:c.code;401===s&&"requires_captcha"!==i&&await nb.clerk.handleUnauthenticated(),function(t,e){var i;if(!e||!e[0])return;let n=e[0],r=n.long_message;if("origin_invalid"===n.code&&((i=nb.clerk.publishableKey).startsWith("live_")||i.startsWith("pk_live_"))){let i=nb.clerk.frontendApi.replace("clerk.","");throw new tI('Clerk: Production Keys are only allowed for domain "'.concat(i,'". \nAPI Error: ').concat(r),{data:e,status:t})}}(s,t);let n={data:t,status:s};if(429===s&&o){let t=o.get("retry-after");if(t){let e=parseInt(t,10);isNaN(e)||(n.retryAfter=e)}}throw new tI(e||a,n)}return null}static _updateClient(t){var e;if(!t)return;let i=t.client||(null==(e=t.meta)?void 0:e.client);i&&nb.clerk&&nb.clerk.updateClient(rp.getOrCreateInstance().fromJSON(i))}path(t){let e=this.pathRoot;if(this.isNew())return e;let i=e.replace(/[^/]$/,"$&/")+encodeURIComponent(this.id);return t?i.replace(/[^/]$/,"$&/")+encodeURIComponent(t):i}withDefault(t,e){return null!=t?t:e}async _baseGet(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=await nb._fetch({method:"GET",path:this.path(),rotatingTokenNonce:t.rotatingTokenNonce},t);return this.fromJSON((null==e?void 0:e.response)||e)}async _baseMutate(t){let{action:e,body:i,method:n,path:r}=t,s=await nb._fetch({method:n,path:r||this.path(e),body:i});return this.fromJSON((null==s?void 0:s.response)||s)}async _baseMutateBypass(t){let{action:e,body:i,method:n,path:r}=t,s=await nb._baseFetch({method:n,path:r||this.path(e),body:i});return this.fromJSON((null==s?void 0:s.response)||s)}async _basePost(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseMutate({...t,method:"POST"})}async _basePostBypass(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseMutateBypass({...t,method:"POST"})}async _basePut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseMutate({...t,method:"PUT"})}async _basePatch(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseMutate({...t,method:"PATCH"})}async _baseDelete(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await this._baseMutate({...t,method:"DELETE"})}static shouldRethrowOfflineNetworkErrors(){var t,e;let i=null==(e=nb.clerk)||null==(t=e.__internal_getOption)?void 0:t.call(e,"experimental");return(null==i?void 0:i.rethrowOfflineNetworkErrors)||!1}constructor(){(0,tu._)(this,"id",void 0),(0,tu._)(this,"pathRoot","")}}function nk(t){let e=new Date(t||new Date);return e instanceof Date&&!isNaN(e.getTime())?e:new Date}(0,tu._)(nb,"clerk",void 0);class nS extends nb{fromJSON(t){return t&&(this.id=t.id,this.type=t.type,this.name=t.name,this.subject=t.subject,this.scopes=t.scopes,this.claims=t.claims,this.revoked=t.revoked,this.revocationReason=t.revocation_reason,this.expired=t.expired,this.expiration=t.expiration?nk(t.expiration):null,this.createdBy=t.created_by,this.description=t.description,this.secret=t.secret,this.lastUsedAt=t.last_used_at?nk(t.last_used_at):null,this.updatedAt=nk(t.updated_at),this.createdAt=nk(t.created_at)),this}__internal_toSnapshot(){return{object:"api_key",id:this.id,type:this.type,name:this.name,subject:this.subject,scopes:this.scopes,claims:this.claims,revoked:this.revoked,revocation_reason:this.revocationReason,expired:this.expired,expiration:this.expiration?this.expiration.getTime():null,created_by:this.createdBy,description:this.description,last_used_at:this.lastUsedAt?this.lastUsedAt.getTime():null,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}constructor(t){super(),(0,tu._)(this,"pathRoot","/api_keys"),(0,tu._)(this,"id",void 0),(0,tu._)(this,"type",void 0),(0,tu._)(this,"name",void 0),(0,tu._)(this,"subject",void 0),(0,tu._)(this,"scopes",void 0),(0,tu._)(this,"claims",void 0),(0,tu._)(this,"revoked",void 0),(0,tu._)(this,"revocationReason",void 0),(0,tu._)(this,"expired",void 0),(0,tu._)(this,"expiration",void 0),(0,tu._)(this,"createdBy",void 0),(0,tu._)(this,"description",void 0),(0,tu._)(this,"secret",void 0),(0,tu._)(this,"lastUsedAt",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),this.fromJSON(t)}}class nA extends nb{fromJSON(t){return t&&(this.claimedAt=this.withDefault(t.claimed_at?nk(t.claimed_at):null,this.claimedAt),this.reverification=this.withDefault(t.reverification,this.reverification),this.singleSessionMode=this.withDefault(t.single_session_mode,this.singleSessionMode),this.preferredChannels=this.withDefault(t.preferred_channels,this.preferredChannels)),this}__internal_toSnapshot(){var t;return{claimed_at:this.claimedAt?this.claimedAt.getTime():null,id:null!=(t=this.id)?t:"",object:"auth_config",reverification:this.reverification,single_session_mode:this.singleSessionMode}}constructor(t=null){super(),(0,tu._)(this,"claimedAt",null),(0,tu._)(this,"reverification",!1),(0,tu._)(this,"singleSessionMode",!1),(0,tu._)(this,"preferredChannels",null),this.fromJSON(t)}}s(6843),(f=ta||(ta={}))[f.None=0]="None",f[f.Mutable=1]="Mutable",f[f.Watching=2]="Watching",f[f.RecursedCheck=4]="RecursedCheck",f[f.Recursed=8]="Recursed",f[f.Dirty=16]="Dirty",f[f.Pending=32]="Pending";let nI=[],{link:nx,unlink:nU,propagate:nE,checkDirty:nP,endTracking:nC,startTracking:nO,shallowPropagate:nT}=function(t){let{update:e,notify:i,unwatched:n}=t,r=0;return{link:function(t,e){let i,n=e.depsTail;if(void 0!==n&&n.dep===t)return;if(4&e.flags&&void 0!==(i=void 0!==n?n.nextDep:e.deps)&&i.dep===t){i.version=r,e.depsTail=i;return}let s=t.subsTail;if(void 0!==s&&s.version===r&&s.sub===e)return;let a=e.depsTail=t.subsTail={version:r,dep:t,sub:e,prevDep:n,nextDep:i,prevSub:s,nextSub:void 0};void 0!==i&&(i.prevDep=a),void 0!==n?n.nextDep=a:e.deps=a,void 0!==s?s.nextSub=a:t.subs=a},unlink:s,propagate:function(t){let e,n=t.nextSub;t:for(;;){let r=t.sub,s=r.flags;if(3&s&&(60&s?12&s?4&s?!(48&s)&&function(t,e){let i=e.depsTail;if(void 0!==i){let n=e.deps;do{if(n===t)return!0;if(n===i)break;n=n.nextDep}while(void 0!==n)}return!1}(t,r)?(r.flags=40|s,s&=1):s=0:r.flags=-9&s|32:s=0:r.flags=32|s,2&s&&i(r),1&s)){let i=r.subs;if(void 0!==i){t=i,void 0!==i.nextSub&&(e={value:n,prev:e},n=t.nextSub);continue}}if(void 0!==(t=n)){n=t.nextSub;continue}for(;void 0!==e;)if(t=e.value,e=e.prev,void 0!==t){n=t.nextSub;continue t}break}},checkDirty:function(t,i){let n,r=0;t:for(;;){let s=t.dep,o=s.flags,l=!1;if(16&i.flags)l=!0;else if((17&o)==17){if(e(s)){let t=s.subs;void 0!==t.nextSub&&a(t),l=!0}}else if((33&o)==33){(void 0!==t.nextSub||void 0!==t.prevSub)&&(n={value:t,prev:n}),t=s.deps,i=s,++r;continue}if(!l&&void 0!==t.nextDep){t=t.nextDep;continue}for(;r;){--r;let s=i.subs,o=void 0!==s.nextSub;if(o?(t=n.value,n=n.prev):t=s,l){if(e(i)){o&&a(s),i=t.sub;continue}}else i.flags&=-33;if(i=t.sub,void 0!==t.nextDep){t=t.nextDep;continue t}l=!1}return l}},endTracking:function(t){let e=t.depsTail,i=void 0!==e?e.nextDep:t.deps;for(;void 0!==i;)i=s(i,t);t.flags&=-5},startTracking:function(t){++r,t.depsTail=void 0,t.flags=-57&t.flags|4},shallowPropagate:a};function s(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.sub,i=t.dep,r=t.prevDep,s=t.nextDep,a=t.nextSub,o=t.prevSub;return void 0!==s?s.prevDep=r:e.depsTail=r,void 0!==r?r.nextDep=s:e.deps=s,void 0!==a?a.prevSub=o:i.subsTail=o,void 0!==o?o.nextSub=a:void 0===(i.subs=a)&&n(i),s}function a(t){do{let e=t.sub,n=t.nextSub,r=e.flags;(48&r)==32&&(e.flags=16|r,2&r&&i(e)),t=n}while(void 0!==t)}}({update:t=>"getter"in t?nL(t):nj(t,t.value),notify:function t(e){let i=e.flags;if(!(64&i)){e.flags=64|i;let n=e.subs;void 0!==n?t(n.sub):nI[nN++]=e}},unwatched(t){if("getter"in t){let e=t.deps;if(void 0!==e){t.flags=17;do e=nU(e,t);while(void 0!==e)}}else"previousValue"in t||nK.call(t)}}),nR=0,nM=0,nN=0;function nW(e){let i=t;return t=e,i}function nz(t){return nJ.bind({previousValue:t,value:t,subs:void 0,subsTail:void 0,flags:1})}function nF(t){return nV.bind({value:void 0,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:17,getter:t})}function nD(i){let n={fn:i,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:2};void 0!==t?nx(n,t):void 0!==e&&nx(n,e);let r=nW(n);try{n.fn()}finally{nW(r)}return nK.bind(n)}function nL(t){let e=nW(t);nO(t);try{let e=t.value;return e!==(t.value=t.getter(e))}finally{nW(e),nC(t)}}function nj(t,e){return t.flags=1,t.previousValue!==(t.previousValue=e)}function nB(){for(;nM<nN;){let t=nI[nM];nI[nM++]=void 0,function t(e,i){if(16&i||32&i&&nP(e.deps,e)){let t=nW(e);nO(e);try{e.fn()}finally{nW(t),nC(e)}return}32&i&&(e.flags=-33&i);let n=e.deps;for(;void 0!==n;){let e=n.dep,i=e.flags;64&i&&t(e,e.flags=-65&i),n=n.nextDep}}(t,t.flags&=-65)}nM=0,nN=0}function nV(){let i=this.flags;if(16&i||32&i&&nP(this.deps,this)){if(nL(this)){let t=this.subs;void 0!==t&&nT(t)}}else 32&i&&(this.flags=-33&i);return void 0!==t?nx(this,t):void 0!==e&&nx(this,e),this.value}function nJ(){for(var e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];if(i.length){let t=i[0];if(this.value!==(this.value=t)){this.flags=17;let t=this.subs;void 0!==t&&(nE(t),nR||nB())}}else{let e=this.value;if(16&this.flags&&nj(this,e)){let t=this.subs;void 0!==t&&nT(t)}return void 0!==t&&nx(this,t),e}}function nK(){let t=this.deps;for(;void 0!==t;)t=nU(t,this);let e=this.subs;void 0!==e&&nU(e),this.flags=0}function nq(t,e,i){if(t!==e)throw TypeError("Private static access of wrong provenance");if(void 0===i)throw TypeError("attempted to get private static field before its declaration");return r(t,i)}function nH(t){let{pageSize:e,initialPage:i,...n}=t||{},r=null!=e?e:10;return new URLSearchParams({...Object.entries(n).reduce((t,e)=>{let[i,n]=e;return void 0!==n&&(t[i]=n),t},{}),limit:r+"",offset:((null!=i?i:1)-1)*r+""})}class nG{static path(t,e){let{orgId:i}=e||{};return"".concat(i?"/organizations/".concat(i):"/me").concat(nq(nG,nG,n$)).concat(t)}constructor(){(0,tu._)(this,"getPlans",async t=>{let{for:e,...i}=t||{},n={...i,payer_type:"organization"===e?"org":"user"};return await nb._fetch({path:"".concat(nq(nG,nG,n$),"/plans"),method:"GET",search:nH(n)}).then(t=>{let{data:e,total_count:i}=t;return{total_count:i,data:e.map(t=>new rs(t))}})}),(0,tu._)(this,"getPlan",async t=>new rs(await nb._fetch({path:"".concat(nq(nG,nG,n$),"/plans/").concat(t.id),method:"GET"}))),(0,tu._)(this,"getSubscription",async t=>await nb._fetch({path:nG.path("/subscription",{orgId:t.orgId}),method:"GET"}).then(t=>new rl(null==t?void 0:t.response))),(0,tu._)(this,"getStatements",async t=>{let{orgId:e,...i}=t;return await nb._fetch({path:nG.path("/statements",{orgId:e}),method:"GET",search:nH(i)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new ra(t))}})}),(0,tu._)(this,"getStatement",async t=>{var e;return new ra(null==(e=await nb._fetch({path:nG.path("/statements/".concat(t.id),{orgId:t.orgId}),method:"GET"}))?void 0:e.response)}),(0,tu._)(this,"getPaymentAttempts",async t=>{let{orgId:e,...i}=t;return await nb._fetch({path:nG.path("/payment_attempts",{orgId:e}),method:"GET",search:nH(i)}).then(t=>{let{data:e,total_count:i}=t;return{total_count:i,data:e.map(t=>new n8(t))}})}),(0,tu._)(this,"getPaymentAttempt",async t=>new n8(await nb._fetch({path:nG.path("/payment_attempts/".concat(t.id),{orgId:t.orgId}),method:"GET"}))),(0,tu._)(this,"startCheckout",async t=>{var e;let{orgId:i,...n}=t;return new n4(null==(e=await nb._fetch({path:nG.path("/checkouts",{orgId:i}),method:"POST",body:n}))?void 0:e.response)})}}var n$={writable:!0,value:"/billing"};let nY=nz({resource:null}),nX=nz({error:null}),nQ=nz({status:"idle"}),nZ=nF(()=>{let t=nY().resource,e=nX().error,i=nQ().status;return{errors:n5(e,{identifier:null,password:null,code:null}),fetchStatus:i,signIn:t?t.__internal_future:null}}),n0=nz({resource:null}),n1=nz({error:null}),n2=nz({status:"idle"}),n3=nF(()=>{let t=n0().resource,e=n1().error,i=n2().status;return{errors:n5(e,{firstName:null,lastName:null,emailAddress:null,phoneNumber:null,password:null,username:null,code:null,captcha:null,legalAccepted:null}),fetchStatus:i,signUp:t?t.__internal_future:null}});function n5(t,e){let i={fields:{...e},raw:null,global:null};if(!t)return i;if(!tN(t))return i.raw=[t],i.global=[tz(t)],i;function n(t){return"meta"in t&&t.meta&&"paramName"in t.meta&&void 0!==t.meta.paramName}return t.errors.some(n)?t.errors.forEach(t=>{if(i.raw?i.raw.push(t):i.raw=[t],n(t)){let e=t9(t.meta.paramName);e in i.fields&&(i.fields[e]=t)}}):(i.raw=[t],i.global=[tz(t)]),i}class n6 extends nb{fromJSON(t){return t&&(this.id=t.id,t.created_at&&(this.createdAt=nk(t.created_at)),t.updated_at&&(this.updatedAt=nk(t.updated_at)),this.imageUrl=t.image_url,this.userId=t.user_id,this.email=t.email,this.firstName=t.first_name,this.lastName=t.last_name,this.organizationId=t.organization_id,this.organizationName=t.organization_name),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"imageUrl",void 0),(0,tu._)(this,"userId",null),(0,tu._)(this,"email",void 0),(0,tu._)(this,"firstName",void 0),(0,tu._)(this,"lastName",void 0),(0,tu._)(this,"organizationId",null),(0,tu._)(this,"organizationName",void 0),this.fromJSON(t)}}class n4 extends nb{fromJSON(t){return t&&(this.id=t.id,this.externalClientSecret=t.external_client_secret,this.externalGatewayId=t.external_gateway_id,this.paymentMethod=t.payment_method?new rn(t.payment_method):void 0,this.plan=new rs(t.plan),this.planPeriod=t.plan_period,this.planPeriodStart=t.plan_period_start,this.status=t.status,this.totals=iO(t.totals),this.isImmediatePlanChange=t.is_immediate_plan_change,t.free_trial_ends_at&&(this.freeTrialEndsAt=nk(t.free_trial_ends_at)),this.payer=new n6(t.payer),this.needsPaymentMethod=t.needs_payment_method),this}constructor(t=null){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"externalClientSecret",void 0),(0,tu._)(this,"externalGatewayId",void 0),(0,tu._)(this,"paymentMethod",void 0),(0,tu._)(this,"plan",void 0),(0,tu._)(this,"planPeriod",void 0),(0,tu._)(this,"planPeriodStart",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"totals",void 0),(0,tu._)(this,"isImmediatePlanChange",void 0),(0,tu._)(this,"freeTrialEndsAt",void 0),(0,tu._)(this,"payer",void 0),(0,tu._)(this,"needsPaymentMethod",void 0),(0,tu._)(this,"confirm",t=>iI(()=>this._basePatch({path:nG.path("/checkouts/".concat(this.id,"/confirm"),{orgId:this.payer.organizationId}),body:t}),{factor:1.1,maxDelayBetweenRetries:2e3,initialDelay:2e3,jitter:!1,shouldRetry(t,e){var i,n;if(!tN(t)||e>=4)return!1;let r=null==t?void 0:t.status,s=409===r&&(null==(n=t.errors)||null==(i=n[0])?void 0:i.code)==="checkout_already_in_progress";return r>=500||s}})),this.fromJSON(t)}}class n7{get status(){var t;return null!=(t=this.resource.status)?t:"needs_initialization"}get externalClientSecret(){return this.resource.externalClientSecret}get externalGatewayId(){return this.resource.externalGatewayId}get plan(){return this.resource.plan}get planPeriod(){return this.resource.planPeriod}get totals(){return this.resource.totals}get isImmediatePlanChange(){return this.resource.isImmediatePlanChange}get freeTrialEndsAt(){return this.resource.freeTrialEndsAt}get payer(){return this.resource.payer}get paymentMethod(){var t;return null!=(t=this.resource.paymentMethod)?t:null}get planPeriodStart(){return this.resource.planPeriodStart}get needsPaymentMethod(){return this.resource.needsPaymentMethod}async start(){return this.runAsyncCheckoutTask("start",async()=>{var t;let e=await (null==(t=n4.clerk.billing)?void 0:t.startCheckout(this.config));this.resource=e},()=>{this.resource=new n4(null),this.signals.resourceSignal({resource:this})})}async confirm(t){if(!this.resource.id)throw Error("Clerk: `start()` must be called before `confirm()`");return this.runAsyncCheckoutTask("confirm",async()=>{await this.resource.confirm(t)})}async finalize(t){let{navigate:e}=t||{};return this.runAsyncCheckoutTask("finalize",async()=>{var t;if("completed"!==this.resource.status)throw Error("Clerk: `confirm()` must be called before `finalize()`");await n4.clerk.setActive({session:null==(t=n4.clerk.session)?void 0:t.id,navigate:e})})}runAsyncCheckoutTask(t,e,i){var n,r,s;return void 0===n4.clerk.user?(console.warn("Clerk: Checkout operations cannot be performed during transitive state"),{error:null}):(n=this,r=this.signals,s=this.pendingOperations,async(t,e,i)=>{if(s.get(t))return s.get(t);let a=(async()=>{++nR,r.errorSignal({error:null}),r.fetchSignal({status:"fetching"}),null==i||i(),--nR||nB(),++nR;try{return await e(),r.resourceSignal({resource:n}),{error:null}}catch(t){return r.errorSignal({error:t}),{error:t}}finally{s.delete(t),r.fetchSignal({status:"idle"}),--nR||nB()}})();return s.set(t,a),a})(t,e,i)}constructor(t,e){(0,tu._)(this,"resource",new n4(null)),(0,tu._)(this,"config",void 0),(0,tu._)(this,"signals",void 0),(0,tu._)(this,"pendingOperations",new Map),this.config=e,this.signals=t,this.signals.resourceSignal({resource:this})}}class n8 extends nb{fromJSON(t){return t&&(this.id=t.id,this.amount=iC(t.amount),this.paidAt=t.paid_at?nk(t.paid_at):null,this.failedAt=t.failed_at?nk(t.failed_at):null,this.updatedAt=nk(t.updated_at),this.paymentMethod=t.payment_method?new rn(t.payment_method):null,this.subscriptionItem=new rc(t.subscription_item),this.chargeType=t.charge_type,this.status=t.status),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"amount",void 0),(0,tu._)(this,"failedAt",null),(0,tu._)(this,"paidAt",null),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"paymentMethod",null),(0,tu._)(this,"subscriptionItem",void 0),(0,tu._)(this,"chargeType",void 0),(0,tu._)(this,"status",void 0),this.fromJSON(t)}}let n9="/payment_methods",rt=async t=>{var e;let{orgId:i,...n}=t;return new rr(null==(e=await nb._fetch({path:nG.path("".concat(n9,"/initialize"),{orgId:i}),method:"POST",body:n}))?void 0:e.response)},re=async t=>{var e;let{orgId:i,...n}=t;return new rn(null==(e=await nb._fetch({path:nG.path(n9,{orgId:i}),method:"POST",body:n}))?void 0:e.response)},ri=async t=>{let{orgId:e,...i}=null!=t?t:{};return await nb._fetch({path:nG.path(n9,{orgId:e}),method:"GET",search:nH(i)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rn(t))}})};class rn extends nb{fromJSON(t){return t&&(this.id=t.id,this.last4=t.last4,this.paymentType=t.payment_type,this.cardType=t.card_type,this.isDefault=t.is_default,this.isRemovable=t.is_removable,this.status=t.status,this.walletType=t.wallet_type,this.expiryYear=t.expiry_year,this.expiryMonth=t.expiry_month,this.createdAt=null==t.created_at?t.created_at:nk(t.created_at),this.updatedAt=null==t.updated_at?t.updated_at:nk(t.updated_at)),this}async remove(t){var e;let{orgId:i}=null!=t?t:{};return new rg(null==(e=await nb._fetch({path:nG.path("/payment_methods/".concat(this.id),{orgId:i}),method:"DELETE"}))?void 0:e.response)}async makeDefault(t){let{orgId:e}=null!=t?t:{};return await nb._fetch({path:nG.path("/payers/default_payment_method",{orgId:e}),method:"PUT",body:{payment_method_id:this.id}}),null}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"last4",null),(0,tu._)(this,"paymentType",void 0),(0,tu._)(this,"cardType",null),(0,tu._)(this,"isDefault",void 0),(0,tu._)(this,"isRemovable",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"walletType",void 0),(0,tu._)(this,"expiryYear",void 0),(0,tu._)(this,"expiryMonth",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),this.fromJSON(t)}}class rr extends nb{fromJSON(t){var e;return t&&(this.externalClientSecret=t.external_client_secret,this.externalGatewayId=t.external_gateway_id,this.paymentMethodOrder=null!=(e=t.payment_method_order)?e:["card"]),this}constructor(t){super(),(0,tu._)(this,"externalClientSecret",void 0),(0,tu._)(this,"externalGatewayId",void 0),(0,tu._)(this,"paymentMethodOrder",void 0),this.fromJSON(t)}}class rs extends nb{fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.fee=iC(t.fee),this.annualFee=t.annual_fee?iC(t.annual_fee):null,this.annualMonthlyFee=t.annual_monthly_fee?iC(t.annual_monthly_fee):null,this.description=t.description,this.isDefault=t.is_default,this.isRecurring=t.is_recurring,this.hasBaseFee=t.has_base_fee,this.forPayerType=t.for_payer_type,this.publiclyVisible=t.publicly_visible,this.slug=t.slug,this.avatarUrl=t.avatar_url,this.freeTrialDays=this.withDefault(t.free_trial_days,null),this.freeTrialEnabled=this.withDefault(t.free_trial_enabled,!1),this.features=(t.features||[]).map(t=>new r$(t))),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"name",void 0),(0,tu._)(this,"fee",void 0),(0,tu._)(this,"annualFee",null),(0,tu._)(this,"annualMonthlyFee",null),(0,tu._)(this,"description",null),(0,tu._)(this,"isDefault",void 0),(0,tu._)(this,"isRecurring",void 0),(0,tu._)(this,"hasBaseFee",void 0),(0,tu._)(this,"forPayerType",void 0),(0,tu._)(this,"publiclyVisible",void 0),(0,tu._)(this,"slug",void 0),(0,tu._)(this,"avatarUrl",null),(0,tu._)(this,"features",void 0),(0,tu._)(this,"freeTrialDays",void 0),(0,tu._)(this,"freeTrialEnabled",void 0),this.fromJSON(t)}}class ra extends nb{fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.timestamp=nk(t.timestamp),this.totals=iO(t.totals),this.groups=t.groups.map(t=>new ro(t))),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"timestamp",void 0),(0,tu._)(this,"totals",void 0),(0,tu._)(this,"groups",void 0),this.fromJSON(t)}}class ro{fromJSON(t){return t&&(this.id=t.id,this.timestamp=nk(t.timestamp),this.items=t.items.map(t=>new n8(t))),this}constructor(t){(0,tu._)(this,"id",void 0),(0,tu._)(this,"timestamp",void 0),(0,tu._)(this,"items",void 0),this.fromJSON(t)}}class rl extends nb{fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.createdAt=nk(t.created_at),this.updatedAt=t.updated_at?nk(t.updated_at):null,this.activeAt=nk(t.active_at),this.pastDueAt=t.past_due_at?nk(t.past_due_at):null,t.next_payment&&(this.nextPayment={amount:iC(t.next_payment.amount),date:nk(t.next_payment.date)}),this.subscriptionItems=(t.subscription_items||[]).map(t=>new rc(t)),this.eligibleForFreeTrial=this.withDefault(t.eligible_for_free_trial,!1)),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"activeAt",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"pastDueAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"nextPayment",void 0),(0,tu._)(this,"subscriptionItems",void 0),(0,tu._)(this,"eligibleForFreeTrial",void 0),this.fromJSON(t)}}class rc extends nb{fromJSON(t){return t&&(this.id=t.id,this.plan=new rs(t.plan),this.planPeriod=t.plan_period,this.status=t.status,this.createdAt=nk(t.created_at),this.pastDueAt=t.past_due_at?nk(t.past_due_at):null,this.periodStart=nk(t.period_start),this.periodEnd=t.period_end?nk(t.period_end):null,this.canceledAt=t.canceled_at?nk(t.canceled_at):null,this.amount=t.amount?iC(t.amount):void 0,this.credit=t.credit&&t.credit.amount?{amount:iC(t.credit.amount)}:void 0,this.isFreeTrial=this.withDefault(t.is_free_trial,!1)),this}async cancel(t){var e;let{orgId:i}=t;return new rg(null==(e=await nb._fetch({path:nG.path("/subscription_items/".concat(this.id),{orgId:i}),method:"DELETE"}))?void 0:e.response)}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"plan",void 0),(0,tu._)(this,"planPeriod",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"periodStart",void 0),(0,tu._)(this,"periodEnd",void 0),(0,tu._)(this,"canceledAt",void 0),(0,tu._)(this,"pastDueAt",void 0),(0,tu._)(this,"amount",void 0),(0,tu._)(this,"credit",void 0),(0,tu._)(this,"isFreeTrial",void 0),this.fromJSON(t)}}let ru={broadcast:!0},rh={broadcast:!1};class rd{static fromKey(t){let[e,i,n=""]=t.split("::");return new rd(e,{audience:n,tokenId:i})}toKey(){let{tokenId:t,audience:e}=this.data;return[this.prefix,t,e||""].join("::")}constructor(t,e){(0,tu._)(this,"prefix",void 0),(0,tu._)(this,"data",void 0),this.prefix=t,this.data=e,this.prefix=t,this.data=e}}let rf=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"clerk",e=new Map,i=Math.random().toString(36).slice(2),n=null,r=()=>n||("undefined"==typeof BroadcastChannel?null:((n=new BroadcastChannel("clerk:session_token")).addEventListener("message",t=>{a(t)}),n));r();let s=function(i){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;r();let s=new rd(t,i),a=e.get(s.toKey());if(!a)return;let o=Math.floor(Date.now()/1e3)-a.createdAt;if(a.expiresIn-o<(n||1)+5){void 0!==a.timeoutId&&clearTimeout(a.timeoutId),e.delete(s.toKey());return}return a.entry},a=async t=>{var e,n,r,a,l,c;let u,{data:h}=t,d=iD.build(h.sessionId,h.template,h.organizationId);if(h.tokenId!==d)return void ib.warn("Ignoring token broadcast with mismatched tokenId",{expectedTokenId:d,organizationId:h.organizationId,receivedTokenId:h.tokenId,tabId:i,template:h.template,traceId:h.traceId},"tokenCache");try{u=new sO({id:h.tokenId,jwt:h.tokenRaw,object:"token"})}catch(t){ib.warn("Failed to parse token from broadcast, skipping cache update",{error:t,tabId:i,tokenId:h.tokenId,traceId:h.traceId},"tokenCache");return}let f=null==(n=u.jwt)||null==(e=n.claims)?void 0:e.iat,p=null==(a=u.jwt)||null==(r=a.claims)?void 0:r.exp;if(!f||!p)return void ib.warn("Token missing iat/exp claim, skipping cache update",{tabId:i,tokenId:h.tokenId,traceId:h.traceId},"tokenCache");try{let t=s({tokenId:h.tokenId});if(t){let e=null==(c=(await t.tokenResolver).jwt)||null==(l=c.claims)?void 0:l.iat;if(e&&e>=f)return void ib.debug("Ignoring older token broadcast",{existingIat:e,incomingIat:f,tabId:i,tokenId:h.tokenId,traceId:h.traceId},"tokenCache")}}catch(t){ib.warn("Existing entry compare failed; proceeding with broadcast update",{error:t,tabId:i,tokenId:h.tokenId,traceId:h.traceId},"tokenCache")}ib.info("Updating token cache from broadcast",{iat:f,organizationId:h.organizationId,tabId:i,template:h.template,tokenId:h.tokenId,traceId:h.traceId},"tokenCache"),o({createdAt:f,tokenId:h.tokenId,tokenResolver:Promise.resolve(u)},rh)},o=function(r){var s;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ru,o=new rd(t,{audience:r.audience,tokenId:r.tokenId}).toKey(),l=Math.floor(Date.now()/1e3),c={createdAt:null!=(s=r.createdAt)?s:l,entry:r,expiresIn:void 0},u=()=>{let t=e.get(o);t===c&&(void 0!==t.timeoutId&&clearTimeout(t.timeoutId),e.delete(o))};r.tokenResolver.then(t=>{var e,s;let o=null==(e=t.jwt)?void 0:e.claims;if(!o||"number"!=typeof o.exp||"number"!=typeof o.iat)return u();let l=o.exp-o.iat;c.expiresIn=l;let h=setTimeout(u,1e3*l);c.timeoutId=h,"function"==typeof h.unref&&h.unref();let d=n;if(d&&a.broadcast){let e=t.getRawString();if(e&&o.sid){let t=o.sid,n=o.org_id||(null==(s=o.o)?void 0:s.id),a=iD.extractTemplate(r.tokenId,t,n),l=iD.build(t,a,n);if(r.tokenId===l){let s="bc_".concat(Date.now(),"_").concat(Math.random().toString(36).substring(2,11));ib.info("Broadcasting token update to other tabs",{organizationId:n,sessionId:t,tabId:i,template:a,tokenId:r.tokenId,traceId:s},"tokenCache");let o={organizationId:n,sessionId:t,template:a,tokenId:r.tokenId,tokenRaw:e,traceId:s};d.postMessage(o)}}}}).catch(()=>{u()}),e.set(o,c)};return{clear:()=>{e.forEach(t=>{void 0!==t.timeoutId&&clearTimeout(t.timeoutId)}),e.clear()},close:()=>{n&&(n.close(),n=null)},get:s,set:t=>{r(),o(t,ru)},size:()=>e.size}}();class rp extends nb{static getOrCreateInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return rp.instance||(rp.instance=new rp(t)),rp.instance}static clearInstance(){rp.instance=null}static isClientResource(t){return!!t&&t instanceof rp}get signUpAttempt(){return this.signUp}get signInAttempt(){return this.signIn}get signedInSessions(){return this.sessions.filter(t=>"active"===t.status||"pending"===t.status)}create(){return this._basePut()}fetch(){let{fetchMaxTries:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._baseGet({fetchMaxTries:t})}async destroy(){return this._baseDelete({path:"/client"}).then(()=>{rf.clear(),this.id="",this.sessions=[],this.signUp=new sx(null),this.signIn=new sb(null),this.lastActiveSessionId=null,this.lastAuthenticationStrategy=null,this.cookieExpiresAt=null,this.createdAt=null,this.updatedAt=null})}removeSessions(){return this._baseDelete({path:this.path()+"/sessions"}).then(t=>(rf.clear(),t))}clearCache(){return this.sessions.forEach(t=>t.clearCache())}isEligibleForTouch(){return!!this.cookieExpiresAt&&this.cookieExpiresAt.getTime()-Date.now()<=6912e5}buildTouchUrl(t){let{redirectUrl:e}=t;return nb.fapiClient.buildUrl({method:"GET",path:"/client/touch",pathPrefix:"v1",search:{redirect_url:e.toString()}}).toString()}__internal_sendCaptchaToken(t){return this._basePostBypass({body:t,path:this.path()+"/verify"})}fromJSON(t){return t&&(this.id=t.id,this.sessions=(t.sessions||[]).map(t=>new sh(t)),this.signUp=new sx(t.sign_up),this.signIn=new sb(t.sign_in),this.lastActiveSessionId=t.last_active_session_id,this.captchaBypass=t.captcha_bypass||!1,this.cookieExpiresAt=t.cookie_expires_at?nk(t.cookie_expires_at):null,this.lastAuthenticationStrategy=t.last_authentication_strategy||null,this.createdAt=nk(t.created_at||void 0),this.updatedAt=nk(t.updated_at||void 0)),this}__internal_toSnapshot(){var t,e,i,n,r;return{object:"client",id:this.id||"",sessions:this.sessions.map(t=>t.__internal_toSnapshot()),sign_up:this.signUp.__internal_toSnapshot(),sign_in:this.signIn.__internal_toSnapshot(),last_active_session_id:this.lastActiveSessionId,captcha_bypass:this.captchaBypass,cookie_expires_at:this.cookieExpiresAt?this.cookieExpiresAt.getTime():null,last_authentication_strategy:null!=(i=this.lastAuthenticationStrategy)?i:null,created_at:null!=(n=null==(t=this.createdAt)?void 0:t.getTime())?n:null,updated_at:null!=(r=null==(e=this.updatedAt)?void 0:e.getTime())?r:null}}path(){return this.pathRoot}constructor(t=null){super(),(0,tu._)(this,"pathRoot","/client"),(0,tu._)(this,"sessions",[]),(0,tu._)(this,"signUp",new sx),(0,tu._)(this,"signIn",new sb),(0,tu._)(this,"lastActiveSessionId",null),(0,tu._)(this,"captchaBypass",!1),(0,tu._)(this,"cookieExpiresAt",null),(0,tu._)(this,"lastAuthenticationStrategy",null),(0,tu._)(this,"createdAt",null),(0,tu._)(this,"updatedAt",null),this.fromJSON(t)}}(0,tu._)(rp,"instance",void 0);class r_ extends nb{fromJSON(t){return t&&(this.billing.stripePublishableKey=t.billing.stripe_publishable_key,this.billing.organization.enabled=t.billing.organization.enabled,this.billing.organization.hasPaidPlans=t.billing.organization.has_paid_plans,this.billing.user.enabled=t.billing.user.enabled,this.billing.user.hasPaidPlans=t.billing.user.has_paid_plans),this}__internal_toSnapshot(){return{billing:{stripe_publishable_key:this.billing.stripePublishableKey,organization:{enabled:this.billing.organization.enabled,has_paid_plans:this.billing.organization.hasPaidPlans},user:{enabled:this.billing.user.enabled,has_paid_plans:this.billing.user.hasPaidPlans}}}}constructor(t=null){super(),(0,tu._)(this,"billing",{stripePublishableKey:null,organization:{enabled:!1,hasPaidPlans:!1},user:{enabled:!1,hasPaidPlans:!1}}),this.fromJSON(t)}}class rg{fromJSON(t){return t&&(this.object=t.object,this.id=t.id,this.slug=t.slug,this.deleted=t.deleted),this}constructor(t){(0,tu._)(this,"object",""),(0,tu._)(this,"id",void 0),(0,tu._)(this,"slug",void 0),(0,tu._)(this,"deleted",!1),this.fromJSON(t)}}class rv extends nb{fromJSON(t){return t&&(this.afterCreateOrganizationUrl=this.withDefault(t.after_create_organization_url,this.afterCreateOrganizationUrl),this.afterJoinWaitlistUrl=this.withDefault(t.after_join_waitlist_url,this.afterJoinWaitlistUrl),this.afterLeaveOrganizationUrl=this.withDefault(t.after_leave_organization_url,this.afterLeaveOrganizationUrl),this.afterSignInUrl=this.withDefault(t.after_sign_in_url,this.afterSignInUrl),this.afterSignOutAllUrl=this.withDefault(t.after_sign_out_all_url,this.afterSignOutAllUrl),this.afterSignOutOneUrl=this.withDefault(t.after_sign_out_one_url,this.afterSignOutOneUrl),this.afterSignUpUrl=this.withDefault(t.after_sign_up_url,this.afterSignUpUrl),this.afterSwitchSessionUrl=this.withDefault(t.after_switch_session_url,this.afterSwitchSessionUrl),this.applicationName=this.withDefault(t.application_name,this.applicationName),this.branded=this.withDefault(t.branded,this.branded),this.captchaHeartbeat=this.withDefault(t.captcha_heartbeat,this.captchaHeartbeat),this.captchaHeartbeatIntervalMs=this.withDefault(t.captcha_heartbeat_interval_ms,this.captchaHeartbeatIntervalMs),this.captchaOauthBypass=this.withDefault(t.captcha_oauth_bypass,this.captchaOauthBypass),this.captchaProvider=this.withDefault(t.captcha_provider,this.captchaProvider),this.captchaPublicKey=this.withDefault(t.captcha_public_key,this.captchaPublicKey),this.captchaPublicKeyInvisible=this.withDefault(t.captcha_public_key_invisible,this.captchaPublicKeyInvisible),this.captchaWidgetType=this.withDefault(t.captcha_widget_type,this.captchaWidgetType),this.clerkJSVersion=this.withDefault(t.clerk_js_version,this.clerkJSVersion),this.createOrganizationUrl=this.withDefault(t.create_organization_url,this.createOrganizationUrl),this.faviconImageUrl=this.withDefault(t.favicon_image_url,this.faviconImageUrl),this.googleOneTapClientId=this.withDefault(t.google_one_tap_client_id,this.googleOneTapClientId),this.homeUrl=this.withDefault(t.home_url,this.homeUrl),this.id=this.withDefault(t.id,this.id),this.instanceEnvironmentType=this.withDefault(t.instance_environment_type,this.instanceEnvironmentType),this.logoImageUrl=this.withDefault(t.logo_image_url,this.logoImageUrl),this.organizationProfileUrl=this.withDefault(t.organization_profile_url,this.organizationProfileUrl),this.preferredSignInStrategy=this.withDefault(t.preferred_sign_in_strategy,this.preferredSignInStrategy),this.privacyPolicyUrl=this.withDefault(t.privacy_policy_url,this.privacyPolicyUrl),this.showDevModeWarning=this.withDefault(t.show_devmode_warning,this.showDevModeWarning),this.signInUrl=this.withDefault(t.sign_in_url,this.signInUrl),this.signUpUrl=this.withDefault(t.sign_up_url,this.signUpUrl),this.supportEmail=this.withDefault(t.support_email,this.supportEmail),this.termsUrl=this.withDefault(t.terms_url,this.termsUrl),this.theme=this.withDefault(t.theme,this.theme),this.userProfileUrl=this.withDefault(t.user_profile_url,this.userProfileUrl),this.waitlistUrl=this.withDefault(t.waitlist_url,this.waitlistUrl)),this}__internal_toSnapshot(){return{object:"display_config",after_create_organization_url:this.afterCreateOrganizationUrl,after_join_waitlist_url:this.afterJoinWaitlistUrl,after_leave_organization_url:this.afterLeaveOrganizationUrl,after_sign_in_url:this.afterSignInUrl,after_sign_out_all_url:this.afterSignOutAllUrl,after_sign_out_one_url:this.afterSignOutOneUrl,after_sign_up_url:this.afterSignUpUrl,after_switch_session_url:this.afterSwitchSessionUrl,application_name:this.applicationName,branded:this.branded,captcha_heartbeat_interval_ms:this.captchaHeartbeatIntervalMs,captcha_heartbeat:this.captchaHeartbeat,captcha_oauth_bypass:this.captchaOauthBypass,captcha_provider:this.captchaProvider,captcha_public_key_invisible:this.captchaPublicKeyInvisible,captcha_public_key:this.captchaPublicKey,captcha_widget_type:this.captchaWidgetType,clerk_js_version:this.clerkJSVersion,create_organization_url:this.createOrganizationUrl,favicon_image_url:this.faviconImageUrl,google_one_tap_client_id:this.googleOneTapClientId,home_url:this.homeUrl,id:this.id,instance_environment_type:this.instanceEnvironmentType,logo_image_url:this.logoImageUrl,organization_profile_url:this.organizationProfileUrl,preferred_sign_in_strategy:this.preferredSignInStrategy,privacy_policy_url:this.privacyPolicyUrl,show_devmode_warning:this.showDevModeWarning,sign_in_url:this.signInUrl,sign_up_url:this.signUpUrl,support_email:this.supportEmail,terms_url:this.termsUrl,theme:this.theme,user_profile_url:this.userProfileUrl,waitlist_url:this.waitlistUrl}}constructor(t=null){super(),(0,tu._)(this,"afterCreateOrganizationUrl",""),(0,tu._)(this,"afterJoinWaitlistUrl",""),(0,tu._)(this,"afterLeaveOrganizationUrl",""),(0,tu._)(this,"afterSignInUrl",""),(0,tu._)(this,"afterSignOutAllUrl",""),(0,tu._)(this,"afterSignOutOneUrl",""),(0,tu._)(this,"afterSignOutUrl",""),(0,tu._)(this,"afterSignUpUrl",""),(0,tu._)(this,"afterSwitchSessionUrl",""),(0,tu._)(this,"applicationName",""),(0,tu._)(this,"backendHost",""),(0,tu._)(this,"branded",!1),(0,tu._)(this,"captchaHeartbeat",!1),(0,tu._)(this,"captchaHeartbeatIntervalMs",void 0),(0,tu._)(this,"captchaOauthBypass",["oauth_google","oauth_microsoft","oauth_apple"]),(0,tu._)(this,"captchaProvider","turnstile"),(0,tu._)(this,"captchaPublicKey",null),(0,tu._)(this,"captchaPublicKeyInvisible",null),(0,tu._)(this,"captchaWidgetType",null),(0,tu._)(this,"clerkJSVersion",void 0),(0,tu._)(this,"createOrganizationUrl",""),(0,tu._)(this,"faviconImageUrl",""),(0,tu._)(this,"googleOneTapClientId",void 0),(0,tu._)(this,"homeUrl",""),(0,tu._)(this,"id",""),(0,tu._)(this,"instanceEnvironmentType",""),(0,tu._)(this,"logoImageUrl",""),(0,tu._)(this,"organizationProfileUrl",""),(0,tu._)(this,"preferredSignInStrategy","password"),(0,tu._)(this,"privacyPolicyUrl",""),(0,tu._)(this,"showDevModeWarning",!1),(0,tu._)(this,"signInUrl",""),(0,tu._)(this,"signUpUrl",""),(0,tu._)(this,"supportEmail",""),(0,tu._)(this,"termsUrl",""),(0,tu._)(this,"theme",{}),(0,tu._)(this,"userProfileUrl",""),(0,tu._)(this,"waitlistUrl",""),this.fromJSON(t)}}var rm=s(8693),ry='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}),delete workerToTabIds[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';let rw=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"==typeof Worker)return null;try{let i=new Blob([t],{type:"application/javascript; charset=utf-8"}),n=globalThis.URL.createObjectURL(i);return new Worker(n,e)}catch{return console.warn("Clerk: Cannot create worker from blob. Consider adding worker-src blob:; to your CSP"),null}},rb=()=>{let t=0,e=()=>t++,i=new Map,n=(t,e)=>null==t?void 0:t.postMessage(e),r=t=>{var e;null==(e=i.get(t.data.id))||e()},s=rw(ry,{name:"clerk-timers"});if(null==s||s.addEventListener("message",r),!s)return{setTimeout:globalThis.setTimeout.bind(globalThis),setInterval:globalThis.setInterval.bind(globalThis),clearTimeout:globalThis.clearTimeout.bind(globalThis),clearInterval:globalThis.clearInterval.bind(globalThis),cleanup:rm.t};let a=()=>{s||null==(s=rw(ry,{name:"clerk-timers"}))||s.addEventListener("message",r)};return{setTimeout:(t,r)=>{a();let o=e();return i.set(o,()=>{t(),i.delete(o)}),n(s,{type:"setTimeout",id:o,ms:r}),o},setInterval:(t,r)=>{a();let o=e();return i.set(o,t),n(s,{type:"setInterval",id:o,ms:r}),o},clearTimeout:t=>{a(),i.delete(t),n(s,{type:"clearTimeout",id:t})},clearInterval:t=>{a(),i.delete(t),n(s,{type:"clearInterval",id:t})},cleanup:()=>{s&&(s.terminate(),s=null,i.clear())}}};function rk(){let t,{delayInMs:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{delayInMs:1e3},i=rb(),n=!1,r=()=>{t&&(i.clearTimeout(t),i.cleanup()),n=!0},s=async a=>{n=!1,await a(r),n||(t=i.setTimeout(()=>{s(a)},e))};return{run:s,stop:r}}class rS extends nb{create(){return this._basePost({body:{email_address:this.emailAddress}})}fromJSON(t){return t&&(this.id=t.id,this.emailAddress=t.email_address,this.verification=new rM(t.verification),this.matchesSsoConnection=t.matches_sso_connection,this.linkedTo=(t.linked_to||[]).map(t=>new rY(t))),this}__internal_toSnapshot(){return{object:"email_address",id:this.id,email_address:this.emailAddress,verification:this.verification.__internal_toSnapshot(),linked_to:this.linkedTo.map(t=>t.__internal_toSnapshot()),matches_sso_connection:this.matchesSsoConnection}}constructor(t,e){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"emailAddress",""),(0,tu._)(this,"matchesSsoConnection",!1),(0,tu._)(this,"linkedTo",[]),(0,tu._)(this,"verification",void 0),(0,tu._)(this,"prepareVerification",t=>this._basePost({action:"prepare_verification",body:{...t}})),(0,tu._)(this,"attemptVerification",t=>{let{code:e}=t||{};return this._basePost({action:"attempt_verification",body:{code:e}})}),(0,tu._)(this,"createEmailLinkFlow",()=>{let{run:t,stop:e}=rk();return{startEmailLinkFlow:async i=>{let{redirectUrl:n}=i;return await this.prepareVerification({strategy:"email_link",redirectUrl:n}),new Promise((i,n)=>{t(()=>this.reload().then(t=>{"verified"===t.verification.status&&(e(),i(t))}).catch(t=>{e(),n(t)}))})},cancelEmailLinkFlow:e}}),(0,tu._)(this,"createEnterpriseSSOLinkFlow",()=>{let{run:t,stop:e}=rk();return{startEnterpriseSSOLinkFlow:async i=>{let{redirectUrl:n}=i;if(!(await this.prepareVerification({strategy:"enterprise_sso",redirectUrl:n})).verification.externalVerificationRedirectURL)throw Error("Unexpected: External verification redirect URL is missing");return new Promise((i,n)=>{t(()=>this.reload().then(t=>{"verified"===t.verification.status&&(e(),i(t))}).catch(t=>{e(),n(t)}))})},cancelEnterpriseSSOLinkFlow:e}}),(0,tu._)(this,"destroy",()=>this._baseDelete()),(0,tu._)(this,"toString",()=>this.emailAddress),this.pathRoot=e,this.fromJSON(t)}}var rA=class{static encode(t){return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}static decode(t){let e=atob(t.replace(/-/g,"+").replace(/_/g,"/")),i=e.length,n=new Uint8Array(i);for(let t=0;t<i;t++)n[t]=e.charCodeAt(t);return n.buffer}};async function rI(t){try{let e=await navigator.credentials.create({publicKey:t});if(!e)return{error:new tT("Browser failed to create credential",{code:"passkey_registration_failed"}),publicKeyCredential:null};return{publicKeyCredential:e,error:null}}catch(t){var e;return{error:"InvalidStateError"===(e=t).name?new tT(e.message,{code:"passkey_already_exists"}):"NotAllowedError"===e.name?new tT(e.message,{code:"passkey_registration_cancelled"}):rE(e),publicKeyCredential:null}}}let rx=new class{__abort(){if(!this.controller)return;let t=Error();t.name="AbortError",this.controller.abort(t)}createAbortSignal(){this.__abort();let t=new AbortController;return this.controller=t,t.signal}abort(){this.__abort(),this.controller=void 0}constructor(){!function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"controller",void 0)}};async function rU(t){let{publicKeyOptions:e,conditionalUI:i}=t;try{let t=await navigator.credentials.get({publicKey:e,mediation:i?"conditional":"optional",signal:rx.createAbortSignal()});if(!t)return{error:new tT("Browser failed to get credential",{code:"passkey_retrieval_failed"}),publicKeyCredential:null};return{publicKeyCredential:t,error:null}}catch(t){var n;return{error:"NotAllowedError"===(n=t).name?new tT(n.message,{code:"passkey_retrieval_cancelled"}):rE(n),publicKeyCredential:null}}}function rE(t){return"AbortError"===t.name?new tT(t.message,{code:"passkey_operation_aborted"}):"SecurityError"===t.name?new tT(t.message,{code:"passkey_invalid_rpID_or_domain"}):t}function rP(t){let e=rR(t.challenge),i=(t.allowCredentials||[]).map(t=>({...t,id:rR(t.id)}));return{...t,allowCredentials:i,challenge:e}}function rC(t){return{type:t.type,id:t.id,rawId:rT(t.rawId),authenticatorAttachment:t.authenticatorAttachment}}function rO(t){let e=t.response;return{...rC(t),response:{clientDataJSON:rT(e.clientDataJSON),authenticatorData:rT(e.authenticatorData),signature:rT(e.signature),userHandle:e.userHandle?rT(e.userHandle):null}}}let rT=rA.encode.bind(rA),rR=rA.decode.bind(rA);class rM extends nb{fromJSON(t){return t&&(this.status=t.status,this.verifiedAtClient=t.verified_at_client,this.strategy=t.strategy,this.nonce=t.nonce||null,this.message=t.message||null,t.external_verification_redirect_url?this.externalVerificationRedirectURL=new URL(t.external_verification_redirect_url):this.externalVerificationRedirectURL=null,this.attempts=t.attempts,this.expireAt=nk(t.expire_at||void 0),this.error=t.error?new tS(t.error):null,this.channel=t.channel||void 0),this}__internal_toSnapshot(){var t,e,i,n,r,s,a,o,l,c;return{object:"verification",id:this.id||"",status:this.status,strategy:this.strategy,nonce:this.nonce,message:this.message,external_verification_redirect_url:(null==(t=this.externalVerificationRedirectURL)?void 0:t.toString())||null,attempts:this.attempts,expire_at:(null==(e=this.expireAt)?void 0:e.getTime())||null,error:{code:(null==(i=this.error)?void 0:i.code)||"",message:(null==i?void 0:i.message)||"",long_message:null==i?void 0:i.longMessage,meta:{param_name:null==i||null==(n=i.meta)?void 0:n.paramName,session_id:null==i||null==(r=i.meta)?void 0:r.sessionId,email_addresses:null==i||null==(s=i.meta)?void 0:s.emailAddresses,identifiers:null==i||null==(a=i.meta)?void 0:a.identifiers,zxcvbn:null==i||null==(o=i.meta)?void 0:o.zxcvbn,plan:null==i||null==(l=i.meta)?void 0:l.plan,is_plan_upgrade_possible:null==i||null==(c=i.meta)?void 0:c.isPlanUpgradePossible}},verified_at_client:this.verifiedAtClient}}constructor(t){super(),(0,tu._)(this,"pathRoot",""),(0,tu._)(this,"status",null),(0,tu._)(this,"strategy",null),(0,tu._)(this,"nonce",null),(0,tu._)(this,"message",null),(0,tu._)(this,"externalVerificationRedirectURL",null),(0,tu._)(this,"attempts",null),(0,tu._)(this,"expireAt",null),(0,tu._)(this,"error",null),(0,tu._)(this,"verifiedAtClient",null),(0,tu._)(this,"channel",void 0),(0,tu._)(this,"verifiedFromTheSameClient",()=>{var t,e;return this.verifiedAtClient===(null==(e=nb.clerk)||null==(t=e.client)?void 0:t.id)}),this.fromJSON(t)}}class rN extends rM{fromJSON(t){var e;let i,n,r;return super.fromJSON(t),(null==t?void 0:t.nonce)&&(this.publicKey=(i=rR((e=JSON.parse(t.nonce)).user.id),n=rR(e.challenge),r=(e.excludeCredentials||[]).map(t=>({...t,id:rR(t.id)})),{...e,excludeCredentials:r,challenge:n,user:{...e.user,id:i}})),this}constructor(t){super(t),(0,tu._)(this,"publicKey",null),this.fromJSON(t)}}class rW{__internal_toSnapshot(){return{email_address:this.emailAddress.__internal_toSnapshot(),phone_number:this.phoneNumber.__internal_toSnapshot(),web3_wallet:this.web3Wallet.__internal_toSnapshot(),external_account:this.externalAccount.__internal_toSnapshot()}}constructor(t){(0,tu._)(this,"emailAddress",void 0),(0,tu._)(this,"phoneNumber",void 0),(0,tu._)(this,"web3Wallet",void 0),(0,tu._)(this,"externalAccount",void 0),t?(this.emailAddress=new rz(t.email_address),this.phoneNumber=new rz(t.phone_number),this.web3Wallet=new rz(t.web3_wallet),this.externalAccount=new rM(t.external_account)):(this.emailAddress=new rz(null),this.phoneNumber=new rz(null),this.web3Wallet=new rz(null),this.externalAccount=new rM(null))}}class rz extends rM{__internal_toSnapshot(){return{...super.__internal_toSnapshot(),next_action:this.nextAction,supported_strategies:this.supportedStrategies}}constructor(t){super(t),(0,tu._)(this,"nextAction",void 0),(0,tu._)(this,"supportedStrategies",void 0),t?(this.nextAction=t.next_action,this.supportedStrategies=t.supported_strategies):(this.nextAction="",this.supportedStrategies=[])}}class rF extends nb{fromJSON(t){return t&&(this.id=t.id,this.provider=t.provider,this.protocol=t.protocol,this.providerUserId=t.provider_user_id,this.active=t.active,this.emailAddress=t.email_address,this.firstName=t.first_name,this.lastName=t.last_name,this.publicMetadata=t.public_metadata,this.lastAuthenticatedAt=t.last_authenticated_at?nk(t.last_authenticated_at):null,this.enterpriseConnectionId=t.enterprise_connection_id,t.verification&&(this.verification=new rM(t.verification)),t.enterprise_connection&&(this.enterpriseConnection=new rD(t.enterprise_connection))),this}__internal_toSnapshot(){var t,e;return{object:"enterprise_account",id:this.id,provider:this.provider,protocol:this.protocol,provider_user_id:this.providerUserId,active:this.active,email_address:this.emailAddress,first_name:this.firstName,last_name:this.lastName,public_metadata:this.publicMetadata,verification:(null==(t=this.verification)?void 0:t.__internal_toSnapshot())||null,enterprise_connection:(null==(e=this.enterpriseConnection)?void 0:e.__internal_toSnapshot())||null,last_authenticated_at:this.lastAuthenticatedAt?this.lastAuthenticatedAt.getTime():null,enterprise_connection_id:this.enterpriseConnectionId}}constructor(t,e){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"protocol",void 0),(0,tu._)(this,"provider",void 0),(0,tu._)(this,"providerUserId",null),(0,tu._)(this,"active",void 0),(0,tu._)(this,"emailAddress",""),(0,tu._)(this,"firstName",""),(0,tu._)(this,"lastName",""),(0,tu._)(this,"publicMetadata",{}),(0,tu._)(this,"verification",null),(0,tu._)(this,"enterpriseConnection",null),(0,tu._)(this,"lastAuthenticatedAt",null),(0,tu._)(this,"enterpriseConnectionId",null),this.pathRoot=e,this.fromJSON(t)}}class rD extends nb{fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.domain=t.domain,this.active=t.active,this.provider=t.provider,this.logoPublicUrl=t.logo_public_url,this.syncUserAttributes=t.sync_user_attributes,this.allowSubdomains=t.allow_subdomains,this.allowIdpInitiated=t.allow_idp_initiated,this.disableAdditionalIdentifications=t.disable_additional_identifications,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at),this.enterpriseConnectionId=t.enterprise_connection_id),this}__internal_toSnapshot(){return{object:"enterprise_account_connection",id:this.id,name:this.name,domain:this.domain,active:this.active,protocol:this.protocol,provider:this.provider,logo_public_url:this.logoPublicUrl,sync_user_attributes:this.syncUserAttributes,allow_subdomains:this.allowSubdomains,allow_idp_initiated:this.allowIdpInitiated,disable_additional_identifications:this.disableAdditionalIdentifications,enterprise_connection_id:this.enterpriseConnectionId,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"active",void 0),(0,tu._)(this,"allowIdpInitiated",void 0),(0,tu._)(this,"allowSubdomains",void 0),(0,tu._)(this,"disableAdditionalIdentifications",void 0),(0,tu._)(this,"domain",void 0),(0,tu._)(this,"logoPublicUrl",""),(0,tu._)(this,"name",void 0),(0,tu._)(this,"protocol",void 0),(0,tu._)(this,"provider",void 0),(0,tu._)(this,"syncUserAttributes",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"enterpriseConnectionId",""),this.fromJSON(t)}}let rL="token:update",rj="user:signOut",rB="environment:update",rV="session:tokenResolved",rJ=ty();class rK extends nb{fromJSON(t){return t&&(this.user_api_keys_enabled=t.user_api_keys_enabled,this.orgs_api_keys_enabled=t.orgs_api_keys_enabled),this}__internal_toSnapshot(){return{user_api_keys_enabled:this.user_api_keys_enabled,orgs_api_keys_enabled:this.orgs_api_keys_enabled}}constructor(t=null){super(),(0,tu._)(this,"user_api_keys_enabled",!1),(0,tu._)(this,"orgs_api_keys_enabled",!1),this.fromJSON(t)}}class rq extends nb{fromJSON(t){return t&&(t.actions&&(this.actions.adminDelete=this.withDefault(t.actions.admin_delete,this.actions.adminDelete)),t.domains&&(this.domains.enabled=this.withDefault(t.domains.enabled,this.domains.enabled),this.domains.enrollmentModes=this.withDefault(t.domains.enrollment_modes,this.domains.enrollmentModes),this.domains.defaultRole=this.withDefault(t.domains.default_role,this.domains.defaultRole)),t.slug&&(this.slug.disabled=this.withDefault(t.slug.disabled,this.slug.disabled)),this.enabled=this.withDefault(t.enabled,this.enabled),this.maxAllowedMemberships=this.withDefault(t.max_allowed_memberships,this.maxAllowedMemberships),this.forceOrganizationSelection=this.withDefault(t.force_organization_selection,this.forceOrganizationSelection)),this}__internal_toSnapshot(){return{actions:{admin_delete:this.actions.adminDelete},domains:{enabled:this.domains.enabled,enrollment_modes:this.domains.enrollmentModes,default_role:this.domains.defaultRole},enabled:this.enabled,max_allowed_memberships:this.maxAllowedMemberships}}constructor(t=null){super(),(0,tu._)(this,"actions",{adminDelete:!1}),(0,tu._)(this,"domains",{enabled:!1,enrollmentModes:[],defaultRole:null}),(0,tu._)(this,"slug",{disabled:!1}),(0,tu._)(this,"enabled",!1),(0,tu._)(this,"maxAllowedMemberships",1),(0,tu._)(this,"forceOrganizationSelection",void 0),this.fromJSON(t)}}class rH extends nb{static getInstance(){return rH.instance||(rH.instance=new rH),rH.instance}fromJSON(t){return t&&(this.authConfig=new nA(t.auth_config),this.displayConfig=new rv(t.display_config),this.maintenanceMode=this.withDefault(t.maintenance_mode,this.maintenanceMode),this.clientDebugMode=this.withDefault(t.client_debug_mode,this.clientDebugMode),this.organizationSettings=new rq(t.organization_settings),this.userSettings=new sF(t.user_settings),this.commerceSettings=new r_(t.commerce_settings),this.apiKeysSettings=new rK(t.api_keys_settings),this.protectConfig=new se(t.protect_config)),this}fetch(){let{touch:t,fetchMaxTries:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{touch:!1};return(t?this._basePatch({}):this._baseGet({fetchMaxTries:e})).then(t=>(rJ.emit(rB,null),t))}__internal_toSnapshot(){var t;return{object:"environment",auth_config:this.authConfig.__internal_toSnapshot(),display_config:this.displayConfig.__internal_toSnapshot(),id:null!=(t=this.id)?t:"",maintenance_mode:this.maintenanceMode,client_debug_mode:this.clientDebugMode,organization_settings:this.organizationSettings.__internal_toSnapshot(),user_settings:this.userSettings.__internal_toSnapshot(),commerce_settings:this.commerceSettings.__internal_toSnapshot(),api_keys_settings:this.apiKeysSettings.__internal_toSnapshot(),protect_config:this.protectConfig.__internal_toSnapshot()}}async __internal_enableEnvironmentSetting(t){await this._basePatch({path:"/dev_tools/enable_environment_setting",body:t})}constructor(t=null){super(),(0,tu._)(this,"authConfig",new nA),(0,tu._)(this,"displayConfig",new rv),(0,tu._)(this,"maintenanceMode",!1),(0,tu._)(this,"clientDebugMode",!1),(0,tu._)(this,"pathRoot","/environment"),(0,tu._)(this,"userSettings",new sF),(0,tu._)(this,"organizationSettings",new rq),(0,tu._)(this,"commerceSettings",new r_),(0,tu._)(this,"apiKeysSettings",new rK),(0,tu._)(this,"protectConfig",new se),(0,tu._)(this,"isDevelopmentOrStaging",()=>!this.isProduction()),(0,tu._)(this,"isProduction",()=>"production"===this.displayConfig.instanceEnvironmentType),(0,tu._)(this,"isSingleSession",()=>this.authConfig.singleSessionMode),(0,tu._)(this,"onWindowLocationHost",()=>this.displayConfig.backendHost===window.location.host),this.fromJSON(t)}}(0,tu._)(rH,"instance",void 0);class rG extends nb{fromJSON(t){return t&&(this.id=t.id,this.identificationId=t.identification_id,this.providerUserId=t.provider_user_id,this.approvedScopes=t.approved_scopes,this.imageUrl=t.image_url,this.emailAddress=t.email_address,this.firstName=t.first_name,this.lastName=t.last_name,this.provider=(t.provider||"").replace("oauth_",""),this.username=t.username,this.phoneNumber=t.phone_number,this.publicMetadata=t.public_metadata,this.label=t.label,t.verification&&(this.verification=new rM(t.verification))),this}__internal_toSnapshot(){var t;return{object:"external_account",id:this.id,identification_id:this.identificationId,provider:this.provider,provider_user_id:this.providerUserId,email_address:this.emailAddress,approved_scopes:this.approvedScopes,first_name:this.firstName,last_name:this.lastName,image_url:this.imageUrl,username:this.username,phone_number:this.phoneNumber,public_metadata:this.publicMetadata,label:this.label,verification:(null==(t=this.verification)?void 0:t.__internal_toSnapshot())||null}}providerSlug(){return this.provider}providerTitle(){let t;return[(t=this.providerSlug()||"").charAt(0).toUpperCase()+t.slice(1),"Account"].join(" ")}accountIdentifier(){return this.username||this.emailAddress||this.label}constructor(t,e){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"identificationId",void 0),(0,tu._)(this,"provider",void 0),(0,tu._)(this,"providerUserId",""),(0,tu._)(this,"emailAddress",""),(0,tu._)(this,"approvedScopes",""),(0,tu._)(this,"firstName",""),(0,tu._)(this,"lastName",""),(0,tu._)(this,"imageUrl",""),(0,tu._)(this,"username",""),(0,tu._)(this,"phoneNumber",""),(0,tu._)(this,"publicMetadata",{}),(0,tu._)(this,"label",""),(0,tu._)(this,"verification",null),(0,tu._)(this,"reauthorize",t=>{let{additionalScopes:e,redirectUrl:i}=t||{};return this._basePatch({action:"reauthorize",body:{additional_scope:e,redirect_url:i}})}),(0,tu._)(this,"destroy",()=>this._baseDelete()),this.pathRoot=e,this.fromJSON(t)}}class r$ extends nb{fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.description=t.description,this.slug=t.slug,this.avatarUrl=t.avatar_url),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"name",void 0),(0,tu._)(this,"description",null),(0,tu._)(this,"slug",void 0),(0,tu._)(this,"avatarUrl",null),this.fromJSON(t)}}class rY extends nb{fromJSON(t){return t&&(this.id=t.id,this.type=t.type),this}__internal_toSnapshot(){return{object:"identification_link",id:this.id,type:this.type}}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"type",void 0),this.fromJSON(t)}}class rX extends nb{static async create(t){var e;let i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n;return"string"==typeof n.file?(r=n.file,i=new Headers({"Content-Type":"application/octet-stream"})):n.file&&(r=new FormData).append("file",n.file),new rX(null==(e=await nb._fetch({path:t,method:"POST",body:r,headers:i}))?void 0:e.response)}static async delete(t){var e;return new rX(null==(e=await nb._fetch({path:t,method:"DELETE"}))?void 0:e.response)}fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.publicUrl=t.public_url),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"name",null),(0,tu._)(this,"publicUrl",null),this.fromJSON(t)}}class rQ extends nb{static async create(t,e){var i;let{name:n}=e;return new rQ(null==(i=await nb._fetch({path:"/organizations/".concat(t,"/domains"),method:"POST",body:{name:n}}))?void 0:i.response)}fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.organizationId=t.organization_id,this.enrollmentMode=t.enrollment_mode,this.affiliationEmailAddress=t.affiliation_email_address,this.totalPendingSuggestions=t.total_pending_suggestions,this.totalPendingInvitations=t.total_pending_invitations,t.verification?this.verification={status:t.verification.status,strategy:t.verification.strategy,attempts:t.verification.attempts,expiresAt:nk(t.verification.expires_at)}:this.verification=null),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"name",void 0),(0,tu._)(this,"organizationId",void 0),(0,tu._)(this,"enrollmentMode",void 0),(0,tu._)(this,"verification",void 0),(0,tu._)(this,"affiliationEmailAddress",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"totalPendingInvitations",void 0),(0,tu._)(this,"totalPendingSuggestions",void 0),(0,tu._)(this,"prepareAffiliationVerification",async t=>this._basePost({path:"/organizations/".concat(this.organizationId,"/domains/").concat(this.id,"/prepare_affiliation_verification"),method:"POST",body:t})),(0,tu._)(this,"attemptAffiliationVerification",async t=>this._basePost({path:"/organizations/".concat(this.organizationId,"/domains/").concat(this.id,"/attempt_affiliation_verification"),method:"POST",body:t})),(0,tu._)(this,"updateEnrollmentMode",t=>this._basePost({path:"/organizations/".concat(this.organizationId,"/domains/").concat(this.id,"/update_enrollment_mode"),body:t})),(0,tu._)(this,"delete",()=>this._baseDelete({path:"/organizations/".concat(this.organizationId,"/domains/").concat(this.id)})),this.fromJSON(t)}}class rZ extends nb{fromJSON(t){return t&&(this.id=t.id,this.organizationId=t.organization_id,this.status=t.status,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at),t.public_user_data&&(this.publicUserData=new si(t.public_user_data))),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"organizationId",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"publicUserData",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"accept",async()=>await this._basePost({path:"/organizations/".concat(this.organizationId,"/membership_requests/").concat(this.id,"/accept")})),(0,tu._)(this,"reject",async()=>await this._basePost({path:"/organizations/".concat(this.organizationId,"/membership_requests/").concat(this.id,"/reject")})),this.fromJSON(t)}}class r0 extends nb{fromJSON(t){return t&&(this.id=t.id,this.key=t.key,this.name=t.name,this.description=t.description,this.type=t.type,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at)),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"key",void 0),(0,tu._)(this,"name",void 0),(0,tu._)(this,"description",void 0),(0,tu._)(this,"type",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),this.fromJSON(t)}}class r1 extends nb{fromJSON(t){return t&&(this.id=t.id,this.key=t.key,this.name=t.name,this.description=t.description,this.permissions=t.permissions.map(t=>new r0(t)),this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at)),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"key",void 0),(0,tu._)(this,"name",void 0),(0,tu._)(this,"description",void 0),(0,tu._)(this,"permissions",[]),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),this.fromJSON(t)}}class r2 extends nb{static async create(t){var e;return new r2(null==(e=await nb._fetch({path:"/organizations",method:"POST",body:t}))?void 0:e.response)}static async get(t){var e;return new r2(null==(e=await nb._fetch({path:"/organizations/".concat(t),method:"GET"}))?void 0:e.response)}fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.slug=t.slug,this.imageUrl=t.image_url||"",this.hasImage=t.has_image||!1,this.publicMetadata=t.public_metadata||{},this.membersCount=t.members_count||0,this.pendingInvitationsCount=t.pending_invitations_count||0,this.maxAllowedMemberships=t.max_allowed_memberships||0,this.adminDeleteEnabled=t.admin_delete_enabled||!1,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at)),this}__internal_toSnapshot(){return{object:"organization",id:this.id,name:this.name,slug:this.slug,image_url:this.imageUrl,has_image:this.hasImage,public_metadata:this.publicMetadata,members_count:this.membersCount,pending_invitations_count:this.pendingInvitationsCount,max_allowed_memberships:this.maxAllowedMemberships,admin_delete_enabled:this.adminDeleteEnabled,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}async reload(t){var e;let{rotatingTokenNonce:i}=t||{},n=null==(e=await nb._fetch({path:"/organizations/".concat(this.id),method:"GET",rotatingTokenNonce:i},{forceUpdateClient:!0}))?void 0:e.response;return this.fromJSON(n)}constructor(t){super(),(0,tu._)(this,"pathRoot","/organizations"),(0,tu._)(this,"id",void 0),(0,tu._)(this,"name",void 0),(0,tu._)(this,"slug",void 0),(0,tu._)(this,"imageUrl",void 0),(0,tu._)(this,"hasImage",void 0),(0,tu._)(this,"publicMetadata",{}),(0,tu._)(this,"adminDeleteEnabled",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"membersCount",0),(0,tu._)(this,"pendingInvitationsCount",0),(0,tu._)(this,"maxAllowedMemberships",void 0),(0,tu._)(this,"update",async t=>this._basePatch({body:t})),(0,tu._)(this,"getRoles",async t=>await nb._fetch({path:"/organizations/".concat(this.id,"/roles"),method:"GET",search:nH(t)},{forceUpdateClient:!0}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new r1(t))}})),(0,tu._)(this,"getDomains",async t=>await nb._fetch({path:"/organizations/".concat(this.id,"/domains"),method:"GET",search:nH(t)},{forceUpdateClient:!0}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rQ(t))}})),(0,tu._)(this,"getDomain",async t=>{var e;let{domainId:i}=t;return new rQ(null==(e=await nb._fetch({path:"/organizations/".concat(this.id,"/domains/").concat(i),method:"GET"}))?void 0:e.response)}),(0,tu._)(this,"getMembershipRequests",async t=>await nb._fetch({path:"/organizations/".concat(this.id,"/membership_requests"),method:"GET",search:nH(t)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new rZ(t))}})),(0,tu._)(this,"createDomain",async t=>rQ.create(this.id,{name:t})),(0,tu._)(this,"getMemberships",async t=>await nb._fetch({path:"/organizations/".concat(this.id,"/memberships"),method:"GET",search:nH({...t,paginated:!0})}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new r5(t))}})),(0,tu._)(this,"getInvitations",async t=>await nb._fetch({path:"/organizations/".concat(this.id,"/invitations"),method:"GET",search:nH(t)},{forceUpdateClient:!0}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new r3(t))}})),(0,tu._)(this,"addMember",async t=>{let{userId:e,role:i}=t;return await nb._fetch({method:"POST",path:"/organizations/".concat(this.id,"/memberships"),body:{userId:e,role:i}}).then(t=>new r5(null==t?void 0:t.response))}),(0,tu._)(this,"inviteMember",async t=>r3.create(this.id,t)),(0,tu._)(this,"inviteMembers",async t=>r3.createBulk(this.id,t)),(0,tu._)(this,"updateMember",async t=>{let{userId:e,role:i}=t;return await nb._fetch({method:"PATCH",path:"/organizations/".concat(this.id,"/memberships/").concat(e),body:{role:i}}).then(t=>new r5(null==t?void 0:t.response))}),(0,tu._)(this,"removeMember",async t=>await nb._fetch({method:"DELETE",path:"/organizations/".concat(this.id,"/memberships/").concat(t)}).then(t=>new r5(null==t?void 0:t.response))),(0,tu._)(this,"destroy",async()=>this._baseDelete()),(0,tu._)(this,"setLogo",async t=>{let e,i,{file:n}=t;return null===n?await nb._fetch({path:"/organizations/".concat(this.id,"/logo"),method:"DELETE"}).then(t=>new r2(null==t?void 0:t.response)):("string"==typeof n?(e=n,i=new Headers({"Content-Type":"application/octet-stream"})):(e=new FormData).append("file",n),await nb._fetch({path:"/organizations/".concat(this.id,"/logo"),method:"PUT",body:e,headers:i}).then(t=>new r2(null==t?void 0:t.response)))}),(0,tu._)(this,"initializePaymentMethod",t=>rt({...t,orgId:this.id})),(0,tu._)(this,"addPaymentMethod",t=>re({...t,orgId:this.id})),(0,tu._)(this,"getPaymentMethods",t=>ri({...t,orgId:this.id})),this.fromJSON(t)}}class r3 extends nb{static async create(t,e){var i;let{emailAddress:n,role:r}=e;return new r3(null==(i=await nb._fetch({path:"/organizations/".concat(t,"/invitations"),method:"POST",body:{email_address:n,role:r}}))?void 0:i.response)}static async createBulk(t,e){var i;let{emailAddresses:n,role:r}=e;return(null==(i=await nb._fetch({path:"/organizations/".concat(t,"/invitations/bulk"),method:"POST",body:{email_address:n,role:r}}))?void 0:i.response).map(t=>new r3(t))}fromJSON(t){return t&&(this.id=t.id,this.emailAddress=t.email_address,this.organizationId=t.organization_id,this.publicMetadata=t.public_metadata,this.role=t.role,this.roleName=t.role_name,this.status=t.status,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at)),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"emailAddress",void 0),(0,tu._)(this,"organizationId",void 0),(0,tu._)(this,"publicMetadata",{}),(0,tu._)(this,"status",void 0),(0,tu._)(this,"role",void 0),(0,tu._)(this,"roleName",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"revoke",async()=>await this._basePost({path:"/organizations/".concat(this.organizationId,"/invitations/").concat(this.id,"/revoke")})),this.fromJSON(t)}}class r5 extends nb{fromJSON(t){return t&&(this.id=t.id,this.organization=new r2(t.organization),this.publicMetadata=t.public_metadata||{},t.public_user_data&&(this.publicUserData=new si(t.public_user_data)),this.permissions=Array.isArray(t.permissions)?[...t.permissions]:[],this.role=t.role,this.roleName=t.role_name,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at)),this}__internal_toSnapshot(){var t;return{object:"organization_membership",id:this.id,organization:this.organization.__internal_toSnapshot(),public_metadata:this.publicMetadata,public_user_data:null==(t=this.publicUserData)?void 0:t.__internal_toSnapshot(),permissions:this.permissions,role:this.role,role_name:this.roleName,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}reload(t){throw Error("".concat(iL," Calling ").concat("OrganizationMembership",".reload is not currently supported. Please contact support."))}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"publicMetadata",{}),(0,tu._)(this,"publicUserData",void 0),(0,tu._)(this,"organization",void 0),(0,tu._)(this,"permissions",[]),(0,tu._)(this,"role",void 0),(0,tu._)(this,"roleName",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"destroy",async()=>{var t;return await this._baseDelete({path:"/organizations/".concat(this.organization.id,"/memberships/").concat(null==(t=this.publicUserData)?void 0:t.userId)})}),(0,tu._)(this,"update",async t=>{var e;let{role:i}=t;return await this._basePatch({path:"/organizations/".concat(this.organization.id,"/memberships/").concat(null==(e=this.publicUserData)?void 0:e.userId),body:{role:i}})}),this.fromJSON(t)}}(0,tu._)(r5,"retrieve",async t=>await nb._fetch({path:"/me/organization_memberships",method:"GET",search:nH({...t,paginated:!0})}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new r5(t))}}));class r6 extends nb{static async retrieve(t){return await nb._fetch({path:"/me/organization_suggestions",method:"GET",search:nH(t)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new r6(t))}})}fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.publicOrganizationData={hasImage:t.public_organization_data.has_image,imageUrl:t.public_organization_data.image_url,name:t.public_organization_data.name,id:t.public_organization_data.id,slug:t.public_organization_data.slug},this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at)),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"publicOrganizationData",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"accept",async()=>await this._basePost({path:"/me/organization_suggestions/".concat(this.id,"/accept")})),this.fromJSON(t)}}function r4(){return tf()&&"function"==typeof window.PublicKeyCredential}async function r7(){try{return r4()&&await window.PublicKeyCredential.isConditionalMediationAvailable()}catch{return!1}}async function r8(){try{return"undefined"!=typeof window&&await window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()}catch{return!1}}class r9 extends nb{static async create(){return nb._fetch({path:"/me/passkeys",method:"POST"}).then(t=>new r9(null==t?void 0:t.response))}static async attemptVerification(t,e){let i,n=(i=e.response,{...rC(e),response:{clientDataJSON:rT(i.clientDataJSON),attestationObject:rT(i.attestationObject),transports:i.getTransports()}});return nb._fetch({path:"/me/passkeys/".concat(t,"/attempt_verification"),method:"POST",body:{strategy:"passkey",publicKeyCredential:JSON.stringify(n)}}).then(t=>new r9(null==t?void 0:t.response))}static async registerPasskey(){var t;let e=r9.clerk.__internal_isWebAuthnSupported||r4,i=r9.clerk.__internal_createPublicCredentials||rI,n=r9.clerk.__internal_isWebAuthnPlatformAuthenticatorSupported||r8;if(!e())throw new tT("Passkeys are not supported on this device.",{code:"passkey_not_supported"});let r=await this.create(),{verification:s}=r,a=null==s?void 0:s.publicKey;if(a||iG("create"),(null==(t=a.authenticatorSelection)?void 0:t.authenticatorAttachment)==="platform"&&!await n())throw new tT("Registration requires a platform authenticator but the device does not support it.",{code:"passkey_pa_not_supported"});let{publicKeyCredential:o,error:l}=await i(a);if(!o)throw l;return this.attemptVerification(r.id,o)}fromJSON(t){return t&&(this.id=t.id,this.name=t.name,this.lastUsedAt=t.last_used_at?nk(t.last_used_at):null,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at),t.verification&&(this.verification=new rN(t.verification))),this}__internal_toSnapshot(){var t,e;return{object:"passkey",id:this.id,name:this.name,verification:(null==(t=this.verification)?void 0:t.__internal_toSnapshot())||null,last_used_at:(null==(e=this.lastUsedAt)?void 0:e.getTime())||null,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"pathRoot","/me/passkeys"),(0,tu._)(this,"verification",null),(0,tu._)(this,"name",null),(0,tu._)(this,"lastUsedAt",null),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"update",t=>this._basePatch({body:t})),(0,tu._)(this,"delete",async()=>{var t;return new rg(null==(t=await nb._fetch({path:this.path(),method:"DELETE"}))?void 0:t.response)}),this.fromJSON(t)}}class st extends nb{fromJSON(t){return t&&(this.id=t.id,this.phoneNumber=t.phone_number,this.reservedForSecondFactor=t.reserved_for_second_factor,this.defaultSecondFactor=t.default_second_factor,this.verification=new rM(t.verification),this.linkedTo=(t.linked_to||[]).map(t=>new rY(t)),this.backupCodes=t.backup_codes),this}__internal_toSnapshot(){return{object:"phone_number",id:this.id||"",phone_number:this.phoneNumber,reserved_for_second_factor:this.reservedForSecondFactor,default_second_factor:this.defaultSecondFactor,verification:this.verification.__internal_toSnapshot(),linked_to:this.linkedTo.map(t=>t.__internal_toSnapshot()),backup_codes:this.backupCodes}}constructor(t,e){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"phoneNumber",""),(0,tu._)(this,"reservedForSecondFactor",!1),(0,tu._)(this,"defaultSecondFactor",!1),(0,tu._)(this,"linkedTo",[]),(0,tu._)(this,"verification",void 0),(0,tu._)(this,"backupCodes",void 0),(0,tu._)(this,"create",()=>this._basePost({body:{phone_number:this.phoneNumber}})),(0,tu._)(this,"prepareVerification",()=>this._basePost({action:"prepare_verification",body:{strategy:"phone_code"}})),(0,tu._)(this,"attemptVerification",t=>{let{code:e}=t||{};return this._basePost({action:"attempt_verification",body:{code:e}})}),(0,tu._)(this,"setReservedForSecondFactor",t=>{let{reserved:e}=t||{};return this._basePatch({body:{reserved_for_second_factor:e}})}),(0,tu._)(this,"makeDefaultSecondFactor",()=>this._basePatch({body:{default_second_factor:!0}})),(0,tu._)(this,"destroy",()=>this._baseDelete()),(0,tu._)(this,"toString",()=>{let t=this.phoneNumber.match(/^(\d{3})(\d{3})(\d{4})$/);return t?"("+t[1]+") "+t[2]+"-"+t[3]:this.phoneNumber}),this.pathRoot=e,this.fromJSON(t)}}class se extends nb{fromJSON(t){return t&&(this.id=this.withDefault(t.id,this.id),this.loaders=this.withDefault(t.loaders,this.loaders)),this}__internal_toSnapshot(){return{object:"protect_config",id:this.id,loaders:this.loaders}}constructor(t=null){super(),(0,tu._)(this,"id",""),(0,tu._)(this,"loaders",void 0),(0,tu._)(this,"rollout",void 0),this.fromJSON(t)}}class si{fromJSON(t){return t&&(this.firstName=t.first_name||null,this.lastName=t.last_name||null,this.imageUrl=t.image_url||"",this.hasImage=t.has_image||!1,this.identifier=t.identifier||"",this.userId=t.user_id),this}__internal_toSnapshot(){return{first_name:this.firstName,last_name:this.lastName,image_url:this.imageUrl,has_image:this.hasImage,identifier:this.identifier,user_id:this.userId}}constructor(t){(0,tu._)(this,"firstName",void 0),(0,tu._)(this,"lastName",void 0),(0,tu._)(this,"imageUrl",void 0),(0,tu._)(this,"hasImage",void 0),(0,tu._)(this,"identifier",void 0),(0,tu._)(this,"userId",void 0),this.fromJSON(t)}}let sn={strict_mfa:{afterMinutes:10,level:"multi_factor"},strict:{afterMinutes:10,level:"second_factor"},moderate:{afterMinutes:60,level:"second_factor"},lax:{afterMinutes:1440,level:"second_factor"}},sr=new Set(["first_factor","second_factor","multi_factor"]),ss=new Set(["strict_mfa","strict","moderate","lax"]),sa=(t,e)=>{let{org:i,user:n}=so(t),[r,s]=e.split(":"),a=s||r;return"org"===r?i.includes(a):"user"===r?n.includes(a):[...i,...n].includes(a)},so=t=>{let e=t?t.split(",").map(t=>t.trim()):[];return{org:e.filter(t=>t.split(":")[0].includes("o")).map(t=>t.split(":")[1]),user:e.filter(t=>t.split(":")[0].includes("u")).map(t=>t.split(":")[1])}};class sl extends nb{fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.session=new sh(t.session),this.level=t.level,this.supportedFirstFactors=en(t.supported_first_factors),this.supportedSecondFactors=en(t.supported_second_factors),this.firstFactorVerification=new rM(t.first_factor_verification),this.secondFactorVerification=new rM(t.second_factor_verification)),this}constructor(t=null){super(),(0,tu._)(this,"status",void 0),(0,tu._)(this,"level",void 0),(0,tu._)(this,"session",void 0),(0,tu._)(this,"supportedFirstFactors",[]),(0,tu._)(this,"supportedSecondFactors",[]),(0,tu._)(this,"firstFactorVerification",new rM(null)),(0,tu._)(this,"secondFactorVerification",new rM(null)),this.fromJSON(t)}}var sc=new WeakMap,su=new WeakSet;class sh extends nb{static isSessionResource(t){return!!t&&t instanceof sh}fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.expireAt=nk(t.expire_at),this.abandonAt=nk(t.abandon_at),this.factorVerificationAge=t.factor_verification_age,this.lastActiveAt=nk(t.last_active_at||void 0),this.lastActiveOrganizationId=t.last_active_organization_id,this.actor=t.actor||null,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at),this.user=new sM(t.user),this.tasks=t.tasks||null,t.public_user_data&&(this.publicUserData=new si(t.public_user_data)),this.lastActiveToken=t.last_active_token?new sO(t.last_active_token):null),this}__internal_toSnapshot(){var t,e;return{object:"session",id:this.id,status:this.status,expire_at:this.expireAt.getTime(),abandon_at:this.abandonAt.getTime(),factor_verification_age:this.factorVerificationAge,last_active_at:this.lastActiveAt.getTime(),last_active_organization_id:this.lastActiveOrganizationId,actor:this.actor,tasks:this.tasks,user:(null==(t=this.user)?void 0:t.__internal_toSnapshot())||null,public_user_data:this.publicUserData.__internal_toSnapshot(),last_active_token:(null==(e=this.lastActiveToken)?void 0:e.__internal_toSnapshot())||null,created_at:this.createdAt.getTime(),updated_at:this.updatedAt.getTime()}}async _getToken(t){if(!this.user)return null;let{leewayInSeconds:e,template:i,skipCache:n=!1}=t||{},r=void 0===(null==t?void 0:t.organizationId)?this.lastActiveOrganizationId:null==t?void 0:t.organizationId;if(!i&&Number(e)>=60)throw Error("Leeway can not exceed the token lifespan (60 seconds)");let s=h(this,su,sd).call(this,i,r),a=n?void 0:rf.get({tokenId:s},e),o=!i&&r===this.lastActiveOrganizationId;if(a){ib.debug("Using cached token (no fetch needed)",{tokenId:s},"session");let t=await a.tokenResolver;return o&&rJ.emit(rL,{token:t}),t.getRawString()||null}ib.info("Fetching new token from API",{organizationId:r,template:i,tokenId:s},"session");let l=i?"".concat(this.path(),"/tokens/").concat(i):"".concat(this.path(),"/tokens"),c=i?{}:{organizationId:r},u=sO.create(l,c,n);return rf.set({tokenId:s,tokenResolver:u}),u.then(t=>(o&&(rJ.emit(rL,{token:t}),t.jwt&&(this.lastActiveToken=t,rJ.emit(rV,null))),t.getRawString()||null))}get currentTask(){var t;let[e]=null!=(t=this.tasks)?t:[];return e}constructor(t){super(),d(this,su),(0,tu._)(this,"pathRoot","/client/sessions"),(0,tu._)(this,"id",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"lastActiveAt",void 0),(0,tu._)(this,"lastActiveToken",void 0),(0,tu._)(this,"lastActiveOrganizationId",void 0),(0,tu._)(this,"actor",void 0),(0,tu._)(this,"user",void 0),(0,tu._)(this,"publicUserData",void 0),(0,tu._)(this,"factorVerificationAge",null),(0,tu._)(this,"tasks",null),(0,tu._)(this,"expireAt",void 0),(0,tu._)(this,"abandonAt",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"end",()=>(rf.clear(),this._basePost({action:"end"}))),(0,tu._)(this,"remove",()=>(rf.clear(),this._basePost({action:"remove"}))),(0,tu._)(this,"touch",()=>this._basePost({action:"touch",body:{active_organization_id:this.lastActiveOrganizationId}}).then(t=>(t.lastActiveToken&&rJ.emit(rL,{token:t.lastActiveToken}),t))),(0,tu._)(this,"clearCache",()=>rf.clear()),(0,tu._)(this,"getToken",async t=>iI(()=>this._getToken(t),{factor:1.55,initialDelay:3e3,maxDelayBetweenRetries:5e4,jitter:!1,shouldRetry:(t,e)=>!tM(t)&&e<=8})),(0,tu._)(this,"checkAuthorization",t=>{var e,i,n,r,s,a;let o,l=((null==(e=this.user)?void 0:e.organizationMemberships)||[]).find(t=>t.organization.id===this.lastActiveOrganizationId);return(o={userId:null==(i=this.user)?void 0:i.id,factorVerificationAge:this.factorVerificationAge,orgId:null==l?void 0:l.id,orgRole:null==l?void 0:l.role,orgPermissions:null==l?void 0:l.permissions,features:(null==(r=this.lastActiveToken)||null==(n=r.jwt)?void 0:n.claims.fea)||"",plans:(null==(a=this.lastActiveToken)||null==(s=a.jwt)?void 0:s.claims.pla)||""},t=>{if(!o.userId)return!1;let e=((t,e)=>{let{features:i,plans:n}=e;return t.feature&&i?sa(i,t.feature):t.plan&&n?sa(n,t.plan):null})(t,o),i=((t,e)=>{let{orgId:i,orgRole:n,orgPermissions:r}=e;return(t.role||t.permission)&&i&&n&&r?t.permission?r.includes(t.permission.replace(/^(org:)*/,"org:")):t.role?n.replace(/^(org:)*/,"org:")===t.role.replace(/^(org:)*/,"org:"):null:null})(t,o),n=((t,e)=>{let{factorVerificationAge:i}=e;if(!t.reverification||!i)return null;let n=(t=>{let e,i;if(!t)return!1;let n="string"==typeof t&&ss.has(t),r="object"==typeof t&&(e=t.level,sr.has(e))&&"number"==typeof(i=t.afterMinutes)&&i>0;return(!!n||!!r)&&(t=>"string"==typeof t?sn[t]:t).bind(null,t)})(t.reverification);if(!n)return null;let{level:r,afterMinutes:s}=n(),[a,o]=i,l=-1!==a?s>a:null,c=-1!==o?s>o:null;switch(r){case"first_factor":return l;case"second_factor":return -1!==o?c:l;case"multi_factor":return -1===o?l:l&&c}})(t,o);return[e||i,n].some(t=>null===t)?[e||i,n].some(t=>!0===t):[e||i,n].every(t=>!0===t)})(t)}),c(this,sc,{writable:!0,value:t=>{t&&rf.set({tokenId:h(this,su,sd).call(this),tokenResolver:Promise.resolve(t)})}}),(0,tu._)(this,"startVerification",async t=>{var e;let{level:i}=t;return new sl(null==(e=await nb._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify"),body:{level:i}}))?void 0:e.response)}),(0,tu._)(this,"prepareFirstFactorVerification",async t=>{var e;let i;switch(t.strategy){case"email_code":i={emailAddressId:t.emailAddressId};break;case"phone_code":i={phoneNumberId:t.phoneNumberId,default:t.default};break;case"passkey":i={};break;case"enterprise_sso":i={emailAddressId:t.emailAddressId,enterpriseConnectionId:t.enterpriseConnectionId,redirectUrl:t.redirectUrl};break;default:iJ("Session.prepareFirstFactorVerification",t.strategy)}return new sl(null==(e=await nb._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify/prepare_first_factor"),body:{...i,strategy:t.strategy}}))?void 0:e.response)}),(0,tu._)(this,"attemptFirstFactorVerification",async t=>{var e;let i;return i="passkey"===t.strategy?{publicKeyCredential:JSON.stringify(rO(t.publicKeyCredential))}:{...t},new sl(null==(e=await nb._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify/attempt_first_factor"),body:{...i,strategy:t.strategy}}))?void 0:e.response)}),(0,tu._)(this,"verifyWithPasskey",async()=>{let{nonce:t=null}=(await this.prepareFirstFactorVerification({strategy:"passkey"})).firstFactorVerification,e=sh.clerk.__internal_isWebAuthnSupported||r4,i=sh.clerk.__internal_getPublicCredentials||rU;if(!e())throw new tT("Passkeys are not supported",{code:"passkey_not_supported"});let n=t?rP(JSON.parse(t)):null;n||iG("get");let{publicKeyCredential:r,error:s}=await i({publicKeyOptions:n,conditionalUI:!1});if(!r)throw s;return this.attemptFirstFactorVerification({strategy:"passkey",publicKeyCredential:r})}),(0,tu._)(this,"prepareSecondFactorVerification",async t=>{var e;return new sl(null==(e=await nb._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify/prepare_second_factor"),body:t}))?void 0:e.response)}),(0,tu._)(this,"attemptSecondFactorVerification",async t=>{var e;return new sl(null==(e=await nb._fetch({method:"POST",path:"/client/sessions/".concat(this.id,"/verify/attempt_second_factor"),body:t}))?void 0:e.response)}),this.fromJSON(t),o(this,sc).call(this,this.lastActiveToken)}}function sd(t,e){let i=void 0===e?this.lastActiveOrganizationId:e;return iD.build(this.id,t,i)}class sf extends nb{static retrieve(){var t;let e=null==(t=nb.clerk.session)?void 0:t.id;return this.clerk.getFapiClient().request({method:"GET",path:"/me/sessions/active",sessionId:e}).then(t=>t.payload.map(t=>new sf(t,"/me/sessions"))).catch(()=>[])}revoke(){return this._basePost({action:"revoke",body:{}})}fromJSON(t){var e;let i;return t?(this.id=t.id,this.status=t.status,this.expireAt=nk(t.expire_at),this.abandonAt=nk(t.abandon_at),this.lastActiveAt=nk(t.last_active_at||void 0),this.latestActivity={id:(i=null!=(e=t.latest_activity)?e:{}).id,deviceType:i.device_type,browserName:i.browser_name,browserVersion:i.browser_version,country:i.country,city:i.city,isMobile:i.is_mobile,ipAddress:i.ip_address},this.actor=t.actor,this):this}constructor(t,e){super(),(0,tu._)(this,"pathRoot",""),(0,tu._)(this,"id",void 0),(0,tu._)(this,"status",void 0),(0,tu._)(this,"abandonAt",void 0),(0,tu._)(this,"expireAt",void 0),(0,tu._)(this,"lastActiveAt",void 0),(0,tu._)(this,"latestActivity",void 0),(0,tu._)(this,"actor",void 0),this.pathRoot=e,this.fromJSON(t)}}s(526),s(9869);let sp=(t,e,i)=>{let{onValidation:n=rm.t,onValidationComplexity:r=rm.t}=i||{},{show_zxcvbn:s,validatePassword:a}=e,o=t=>((t,e)=>{let{max_length:i,min_length:n,require_special_char:r,require_lowercase:s,require_numbers:a,require_uppercase:o}=e,l=(t=>{let e;if(t.allowed_special_characters){let i=t.allowed_special_characters.replace("[","\\[");i=i.replace("]","\\]"),e=new RegExp("[".concat(i,"]"))}else e=/[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/;return(t,i)=>{let{minLength:n,maxLength:r}=i;return{max_length:t.length<r,min_length:t.length>=n,require_numbers:/\d/.test(t),require_lowercase:/[a-z]/.test(t),require_uppercase:/[A-Z]/.test(t),require_special_char:e.test(t)}}})(e)(t,{maxLength:e.max_length,minLength:e.min_length}),c={max_length:i,min_length:n,require_special_char:r,require_lowercase:s,require_numbers:a,require_uppercase:o},u=new Map;for(let t in c)c[t]&&!l[t]&&u.set(t,!0);return Object.freeze(Object.fromEntries(u))})(t,e),l=(t=>{let{min_zxcvbn_strength:e,onResult:i}=t;return t=>n=>{let r=t(n);return(null==i||i(r),r.score>=e&&r.score<3)?{state:"pass",keys:["unstable__errors.zxcvbn.couldBeStronger"],result:r}:r.score>=e?{state:"excellent",result:r}:{state:"fail",keys:["unstable__errors.zxcvbn.notEnough",...r.feedback.suggestions.map(t=>"unstable__errors.zxcvbn.suggestions.".concat(t))],result:r}}})(e),c={};return(e,i)=>{let{onValidation:u=n,onValidationComplexity:h=r}=i||{};if(!a)return;let d=o(e);h(0===Object.keys(d).length),c={...c,complexity:d},s&&t().then(t=>{let i=l(t)(e);u({...c={...c,strength:i},strength:i})}),c.complexity&&0===Object.keys(c.complexity).length&&s||u(c)}};function s_(t){return t?"https://".concat(t.replace(/clerk\.accountsstage\./,"accountsstage.").replace(/clerk\.accounts\.|clerk\./,"accounts.")):""}async function sg(t,e,i,n,r){if(!t.client||!n.popup)return;let s=s_(t.frontendApi),{redirectUrl:a}=n,o=new URL(a);o.searchParams.set("sign_in_force_redirect_url",n.redirectUrlComplete),o.searchParams.set("sign_up_force_redirect_url",n.redirectUrlComplete),o.searchParams.set("intent",e);let l=t.buildUrlWithAuth(o.toString()),c=t.buildUrlWithAuth("".concat(s,"/popup-callback")),u=t.buildUrlWithAuth("".concat(s,"/popup-callback?return_url=").concat(encodeURIComponent(l))),h=async e=>{if(e.origin!==s)return;let i=!1;if(e.data.session){var r,a;if(!(null==(r=t.client)?void 0:r.sessions.find(t=>t.id===e.data.session)))try{await (null==(a=t.client)?void 0:a.reload())}catch(t){console.error(t)}await t.setActive({session:e.data.session,redirectUrl:n.redirectUrlComplete}),i=!0}else e.data.return_url&&(t.navigate(e.data.return_url),i=!0);i&&window.removeEventListener("message",h)};window.addEventListener("message",h),await i({...n,redirectUrlComplete:c,redirectUrl:u},r)}function sv(t,e){let{redirectCallbackUrl:i,redirectUrl:n}=e,r=s_(t.frontendApi),s=new URL(i);s.searchParams.set("sign_in_force_redirect_url",n),s.searchParams.set("sign_up_force_redirect_url",n);let a=t.buildUrlWithAuth(s.toString()),o=t.buildUrlWithAuth("".concat(r,"/popup-callback"));return{redirectCallbackUrl:t.buildUrlWithAuth("".concat(r,"/popup-callback?return_url=").concat(encodeURIComponent(a))),redirectUrl:o}}function sm(t,e){return new Promise((i,n)=>{if(!t.client||!e.popup)return void n();let r=async e=>{e.origin===s_(t.frontendApi)&&(e.data.session||e.data.return_url?(window.removeEventListener("message",r),i()):n())};window.addEventListener("message",r),e.popup.location.href=e.externalVerificationRedirectURL.toString()})}async function sy(t,e){rJ.emit("resource:error",{resource:t,error:null}),rJ.emit("resource:fetch",{resource:t,status:"fetching"});try{return{result:await e(),error:null}}catch(e){return rJ.emit("resource:error",{resource:t,error:e}),{error:e}}finally{rJ.emit("resource:fetch",{resource:t,status:"idle"})}}let sw=()=>{var t;return(t=new iE,{loadZxcvbn:()=>Promise.all([t.import("@zxcvbn-ts/core"),t.import("@zxcvbn-ts/language-common")]).then(t=>{let[e,i]=t;if(!e||!i)throw Error("Failed to load zxcvbn modules");let{zxcvbnOptions:n,zxcvbn:r}=e,{dictionary:s,adjacencyGraphs:a}=i;return n.setOptions({dictionary:{...s},graphs:a}),r})}).loadZxcvbn};class sb extends nb{get status(){return this._status}set status(t){let e=this._status;this._status=t,t&&e!==t&&ib.debug("SignIn.status",{id:this.id,from:e,to:t})}fromJSON(t){if(t){var e;this.id=t.id,this.status=t.status,this.supportedIdentifiers=t.supported_identifiers,this.identifier=t.identifier,this.supportedFirstFactors=en(t.supported_first_factors),this.supportedSecondFactors=en(t.supported_second_factors),this.firstFactorVerification=new rM(t.first_factor_verification),this.secondFactorVerification=new rM(t.second_factor_verification),this.createdSessionId=t.created_session_id,this.userData=new sN(t.user_data),this.clientTrustState=null!=(e=t.client_trust_state)?e:void 0}return rJ.emit("resource:update",{resource:this}),this}__internal_toSnapshot(){return{object:"sign_in",id:this.id||"",status:this.status||null,supported_identifiers:this.supportedIdentifiers,supported_first_factors:ei(this.supportedFirstFactors),supported_second_factors:ei(this.supportedSecondFactors),first_factor_verification:this.firstFactorVerification.__internal_toSnapshot(),second_factor_verification:this.secondFactorVerification.__internal_toSnapshot(),identifier:this.identifier,created_session_id:this.createdSessionId,user_data:this.userData.__internal_toSnapshot()}}constructor(t=null){super(),(0,tu._)(this,"pathRoot","/client/sign_ins"),(0,tu._)(this,"id",void 0),(0,tu._)(this,"_status",null),(0,tu._)(this,"supportedIdentifiers",[]),(0,tu._)(this,"supportedFirstFactors",[]),(0,tu._)(this,"supportedSecondFactors",null),(0,tu._)(this,"firstFactorVerification",new rM(null)),(0,tu._)(this,"secondFactorVerification",new rM(null)),(0,tu._)(this,"identifier",null),(0,tu._)(this,"createdSessionId",null),(0,tu._)(this,"userData",new sN(null)),(0,tu._)(this,"clientTrustState",void 0),(0,tu._)(this,"__internal_future",new sA(this)),(0,tu._)(this,"__internal_basePost",this._basePost.bind(this)),(0,tu._)(this,"__internal_baseGet",this._baseGet.bind(this)),(0,tu._)(this,"create",t=>{ib.debug("SignIn.create",{id:this.id,strategy:"strategy"in t?t.strategy:void 0});let e=iW();return this._basePost({path:this.pathRoot,body:e?{locale:e,...t}:t})}),(0,tu._)(this,"resetPassword",t=>this._basePost({body:t,action:"reset_password"})),(0,tu._)(this,"prepareFirstFactor",t=>{let e;switch(ib.debug("SignIn.prepareFirstFactor",{id:this.id,strategy:t.strategy}),t.strategy){case"passkey":e={};break;case"email_link":e={emailAddressId:t.emailAddressId,redirectUrl:t.redirectUrl};break;case"email_code":case"reset_password_email_code":e={emailAddressId:t.emailAddressId};break;case"phone_code":e={phoneNumberId:t.phoneNumberId,default:t.default,channel:t.channel};break;case"web3_metamask_signature":case"web3_base_signature":case"web3_coinbase_wallet_signature":case"web3_okx_wallet_signature":case"web3_solana_signature":e={web3WalletId:t.web3WalletId};break;case"reset_password_phone_code":e={phoneNumberId:t.phoneNumberId};break;case"enterprise_sso":e={redirectUrl:t.redirectUrl,actionCompleteRedirectUrl:t.actionCompleteRedirectUrl,oidcPrompt:t.oidcPrompt,enterpriseConnectionId:t.enterpriseConnectionId};break;default:iJ("SignIn.prepareFirstFactor",t.strategy)}return this._basePost({body:{...e,strategy:t.strategy},action:"prepare_first_factor"})}),(0,tu._)(this,"attemptFirstFactor",t=>{let e;return ib.debug("SignIn.attemptFirstFactor",{id:this.id,strategy:t.strategy}),e="passkey"===t.strategy?{publicKeyCredential:JSON.stringify(rO(t.publicKeyCredential))}:{...t},this._basePost({body:{...e,strategy:t.strategy},action:"attempt_first_factor"})}),(0,tu._)(this,"createEmailLinkFlow",()=>{let{run:t,stop:e}=rk();return{startEmailLinkFlow:async i=>{let{emailAddressId:n,redirectUrl:r}=i;this.id||iV("SignIn");let s={strategy:"email_link",emailAddressId:n,redirectUrl:r},a="needs_second_factor"===this.status||"needs_client_trust"===this.status,o=a?"secondFactorVerification":"firstFactorVerification";return a?await this.prepareSecondFactor(s):await this.prepareFirstFactor(s),new Promise((i,n)=>{t(()=>this.reload().then(t=>{let n=t[o].status;("verified"===n||"expired"===n)&&(e(),i(t))}).catch(t=>{e(),n(t)}))})},cancelEmailLinkFlow:e}}),(0,tu._)(this,"prepareSecondFactor",t=>(ib.debug("SignIn.prepareSecondFactor",{id:this.id,strategy:t.strategy}),this._basePost({body:t,action:"prepare_second_factor"}))),(0,tu._)(this,"attemptSecondFactor",t=>(ib.debug("SignIn.attemptSecondFactor",{id:this.id,strategy:t.strategy}),this._basePost({body:t,action:"attempt_second_factor"}))),(0,tu._)(this,"authenticateWithRedirectOrPopup",async(t,e)=>{let{strategy:i,redirectUrlComplete:n,identifier:r,oidcPrompt:s,continueSignIn:a,enterpriseConnectionId:o}=t||{},l=sb.clerk.buildUrlWithAuth(t.redirectUrl);this.id&&a||await this.create({strategy:i,identifier:r,redirectUrl:l,actionCompleteRedirectUrl:n}),"enterprise_sso"===i&&await this.prepareFirstFactor({strategy:i,redirectUrl:l,actionCompleteRedirectUrl:n,oidcPrompt:s,enterpriseConnectionId:o});let{status:c,externalVerificationRedirectURL:u}=this.firstFactorVerification;"unverified"===c&&u?e(u):iH(c,sb.fapiClient.buildEmailAddress("support"))}),(0,tu._)(this,"authenticateWithRedirect",async t=>this.authenticateWithRedirectOrPopup(t,eJ)),(0,tu._)(this,"authenticateWithPopup",async t=>{let{popup:e}=t||{};return e||iq("popup"),sg(sb.clerk,"signIn",this.authenticateWithRedirectOrPopup,t,t=>{e.location.href=t.toString()})}),(0,tu._)(this,"authenticateWithWeb3",async t=>{var e;let i,{identifier:n,generateSignature:r,strategy:s="web3_metamask_signature",walletName:a}=t||{},o=s.replace("web3_","").replace("_signature","");"function"!=typeof r&&iq("generateSignature"),"solana"!==o||a||iq("walletName"),await this.create({identifier:n});let l=null==(e=this.supportedFirstFactors)?void 0:e.find(t=>t.strategy===s);l||iK("SignIn"),await this.prepareFirstFactor(l);let{message:c}=this.firstFactorVerification;c||iK("SignIn");try{i=await r({identifier:n,nonce:c,walletName:a,provider:o})}catch(t){if("coinbase_wallet"===o&&4001===t.code)i=await r({identifier:n,nonce:c,provider:o,walletName:a});else throw t}return this.attemptFirstFactor({signature:i,strategy:s})}),(0,tu._)(this,"authenticateWithMetamask",async()=>{let t=await nl().getMetamaskIdentifier();return this.authenticateWithWeb3({identifier:t,generateSignature:nl().generateSignatureWithMetamask,strategy:"web3_metamask_signature"})}),(0,tu._)(this,"authenticateWithCoinbaseWallet",async()=>{let t=await nl().getCoinbaseWalletIdentifier();return this.authenticateWithWeb3({identifier:t,generateSignature:nl().generateSignatureWithCoinbaseWallet,strategy:"web3_coinbase_wallet_signature"})}),(0,tu._)(this,"authenticateWithBase",async()=>{let t=await nl().getBaseIdentifier();return this.authenticateWithWeb3({identifier:t,generateSignature:nl().generateSignatureWithBase,strategy:"web3_base_signature"})}),(0,tu._)(this,"authenticateWithOKXWallet",async()=>{let t=await nl().getOKXWalletIdentifier();return this.authenticateWithWeb3({identifier:t,generateSignature:nl().generateSignatureWithOKXWallet,strategy:"web3_okx_wallet_signature"})}),(0,tu._)(this,"authenticateWithSolana",async t=>{let{walletName:e}=t,i=await nl().getSolanaIdentifier(e);return this.authenticateWithWeb3({identifier:i,generateSignature:t=>nl().generateSignatureWithSolana({...t,walletName:e}),strategy:"web3_solana_signature",walletName:e})}),(0,tu._)(this,"authenticateWithPasskey",async t=>{let{flow:e}=t||{},i=sb.clerk.__internal_isWebAuthnSupported||r4,n=sb.clerk.__internal_getPublicCredentials||rU,r=sb.clerk.__internal_isWebAuthnAutofillSupported||r7;if(!i())throw new tT("Passkeys are not supported",{code:"passkey_not_supported"});if("autofill"===e||"discoverable"===e)await this.create({strategy:"passkey"});else{let t=this.supportedFirstFactors.find(t=>"passkey"===t.strategy);t||function(){throw Error("".concat(iL," You need to start a SignIn flow by calling SignIn.create({ strategy: 'passkey' }) first"))}(),await this.prepareFirstFactor(t)}let{nonce:s}=this.firstFactorVerification,a=s?rP(JSON.parse(s)):null;a||iG("get");let o=!1;"autofill"===e&&(o=await r());let{publicKeyCredential:l,error:c}=await n({publicKeyOptions:a,conditionalUI:o});if(!l)throw c;return this.attemptFirstFactor({publicKeyCredential:l,strategy:"passkey"})}),(0,tu._)(this,"validatePassword",(t,e)=>{var i,n;if(null==(i=sb.clerk.__internal_environment)?void 0:i.userSettings.passwordSettings)return sp(sw(),{...null==(n=sb.clerk.__internal_environment)?void 0:n.userSettings.passwordSettings,validatePassword:!0})(t,e)}),this.fromJSON(t)}}var sk=new WeakMap,sS=new WeakMap;class sA{get id(){return o(this,sS).id}get identifier(){return o(this,sS).identifier}get createdSessionId(){return o(this,sS).createdSessionId}get userData(){return o(this,sS).userData}get status(){return o(this,sS).status||"needs_identifier"}get supportedFirstFactors(){var t;return null!=(t=o(this,sS).supportedFirstFactors)?t:[]}get supportedSecondFactors(){var t;return null!=(t=o(this,sS).supportedSecondFactors)?t:[]}get isTransferable(){return"transferable"===o(this,sS).firstFactorVerification.status}get existingSession(){var t,e,i,n,r;if("failed"===o(this,sS).firstFactorVerification.status&&(null==(t=o(this,sS).firstFactorVerification.error)?void 0:t.code)==="identifier_already_signed_in"&&(null==(i=o(this,sS).firstFactorVerification.error)||null==(e=i.meta)?void 0:e.sessionId))return{sessionId:null==(r=o(this,sS).firstFactorVerification.error)||null==(n=r.meta)?void 0:n.sessionId}}get firstFactorVerification(){return o(this,sS).firstFactorVerification}get secondFactorVerification(){return o(this,sS).secondFactorVerification}get hasBeenFinalized(){return o(this,sk)}async sendResetPasswordEmailCode(){if(!o(this,sS).id)throw Error("Cannot reset password without a sign in.");return sy(o(this,sS),async()=>{var t;let e=null==(t=o(this,sS).supportedFirstFactors)?void 0:t.find(t=>"reset_password_email_code"===t.strategy);if(!e)throw new tC("Reset password email code factor not found",{code:"factor_not_found"});let{emailAddressId:i}=e;await o(this,sS).__internal_basePost({body:{emailAddressId:i,strategy:"reset_password_email_code"},action:"prepare_first_factor"})})}async verifyResetPasswordEmailCode(t){let{code:e}=t;return sy(o(this,sS),async()=>{await o(this,sS).__internal_basePost({body:{code:e,strategy:"reset_password_email_code"},action:"attempt_first_factor"})})}async submitResetPassword(t){let{password:e,signOutOfOtherSessions:i=!0}=t;return sy(o(this,sS),async()=>{await o(this,sS).__internal_basePost({body:{password:e,signOutOfOtherSessions:i},action:"reset_password"})})}async _create(t){let e=iW();await o(this,sS).__internal_basePost({path:o(this,sS).pathRoot,body:e?{locale:e,...t}:t})}async create(t){return sy(o(this,sS),async()=>{await this._create(t)})}async password(t){if([t.identifier,t.emailAddress,t.phoneNumber].filter(Boolean).length>1)throw Error("Only one of identifier, emailAddress, or phoneNumber can be provided");return sy(o(this,sS),async()=>{let e=t.identifier||t.emailAddress||t.phoneNumber,i=o(this,sS).identifier,n=iW();await o(this,sS).__internal_basePost({path:o(this,sS).pathRoot,body:{identifier:e||i,password:t.password,...n?{locale:n}:{}}})})}async sendEmailCode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{emailAddress:e,emailAddressId:i}=t;if(!o(this,sS).id&&i)throw Error("signIn.emailCode.sendCode() cannot be called with an emailAddressId if an existing signIn does not exist.");if(!o(this,sS).id&&!e)throw Error("signIn.emailCode.sendCode() cannot be called without an emailAddress if an existing signIn does not exist.");return sy(o(this,sS),async()=>{e&&await this._create({identifier:e});let t=this.selectFirstFactor({strategy:"email_code",emailAddressId:i});if(!t)throw new tC("Email code factor not found",{code:"factor_not_found"});await o(this,sS).__internal_basePost({body:{emailAddressId:t.emailAddressId,strategy:"email_code"},action:"prepare_first_factor"})})}async verifyEmailCode(t){let{code:e}=t;return sy(o(this,sS),async()=>{await o(this,sS).__internal_basePost({body:{code:e,strategy:"email_code"},action:"attempt_first_factor"})})}async sendEmailLink(t){let{emailAddress:e,verificationUrl:i,emailAddressId:n}=t;if(!o(this,sS).id&&n)throw Error("signIn.emailLink.sendLink() cannot be called with an emailAddressId if an existing signIn does not exist.");if(!o(this,sS).id&&!e)throw Error("signIn.emailLink.sendLink() cannot be called without an emailAddress if an existing signIn does not exist.");return sy(o(this,sS),async()=>{e&&await this._create({identifier:e});let t=this.selectFirstFactor({strategy:"email_link",emailAddressId:n});if(!t)throw new tC("Email link factor not found",{code:"factor_not_found"});let r=i;try{new URL(i)}catch{r=window.location.origin+i}await o(this,sS).__internal_basePost({body:{emailAddressId:t.emailAddressId,redirectUrl:r,strategy:"email_link"},action:"prepare_first_factor"})})}async waitForEmailLinkVerification(){return sy(o(this,sS),async()=>{let{run:t,stop:e}=rk();await new Promise((i,n)=>{t(async()=>{try{let t=await o(this,sS).__internal_baseGet(),n=t.firstFactorVerification.status;("verified"===n||"expired"===n)&&(e(),i(t))}catch(t){e(),n(t)}})})})}async sendPhoneCode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{phoneNumber:e,phoneNumberId:i,channel:n="sms"}=t;if(!o(this,sS).id&&i)throw Error("signIn.phoneCode.sendCode() cannot be called with an phoneNumberId if an existing signIn does not exist.");if(!o(this,sS).id&&!e)throw Error("signIn.phoneCode.sendCode() cannot be called without an phoneNumber if an existing signIn does not exist.");return sy(o(this,sS),async()=>{e&&await this._create({identifier:e});let t=this.selectFirstFactor({strategy:"phone_code",phoneNumberId:i});if(!t)throw new tC("Phone code factor not found",{code:"factor_not_found"});await o(this,sS).__internal_basePost({body:{phoneNumberId:t.phoneNumberId,strategy:"phone_code",channel:n},action:"prepare_first_factor"})})}async verifyPhoneCode(t){let{code:e}=t;return sy(o(this,sS),async()=>{await o(this,sS).__internal_basePost({body:{code:e,strategy:"phone_code"},action:"attempt_first_factor"})})}async sso(t){let{strategy:e,redirectUrl:i,redirectCallbackUrl:n,popup:r,oidcPrompt:s,enterpriseConnectionId:a,identifier:l}=t;return sy(o(this,sS),async()=>{let t=i;try{new URL(i)}catch{t=window.location.origin+i}let c={redirectUrl:sb.clerk.buildUrlWithAuth(n),actionCompleteRedirectUrl:t};if(r){let e=sv(sb.clerk,{redirectCallbackUrl:c.redirectUrl,redirectUrl:t});c.redirectUrl=e.redirectCallbackUrl,c.actionCompleteRedirectUrl=e.redirectUrl}await this._create({strategy:e,...c,identifier:l}),"enterprise_sso"===e&&await o(this,sS).__internal_basePost({body:{...c,oidcPrompt:s,enterpriseConnectionId:a,strategy:"enterprise_sso"},action:"prepare_first_factor"});let{status:u,externalVerificationRedirectURL:h}=o(this,sS).firstFactorVerification;"unverified"===u&&h&&(r?(await sm(sb.clerk,{popup:r,externalVerificationRedirectURL:h}),await o(this,sS).reload()):eJ(h))})}async web3(t){let{strategy:e}=t,i=e.replace("web3_","").replace("_signature","");return sy(o(this,sS),async()=>{var n;let r,s,a;switch(i){case"metamask":r=await nl().getMetamaskIdentifier(),s=nl().generateSignatureWithMetamask;break;case"coinbase_wallet":r=await nl().getCoinbaseWalletIdentifier(),s=nl().generateSignatureWithCoinbaseWallet;break;case"base":r=await nl().getBaseIdentifier(),s=nl().generateSignatureWithBase;break;case"okx_wallet":r=await nl().getOKXWalletIdentifier(),s=nl().generateSignatureWithOKXWallet;break;case"solana":if(!t.walletName)throw new tC("Wallet name is required for Solana authentication.",{code:"web3_solana_wallet_name_required"});r=await nl().getSolanaIdentifier(t.walletName),s=e=>nl().generateSignatureWithSolana({...e,walletName:t.walletName});break;default:throw Error("Unsupported Web3 provider: ".concat(i))}await this._create({identifier:r});let l=null==(n=o(this,sS).supportedFirstFactors)?void 0:n.find(t=>t.strategy===e);if(!l)throw new tC("Web3 first factor not found",{code:"factor_not_found"});await o(this,sS).__internal_basePost({body:{web3WalletId:l.web3WalletId,strategy:e},action:"prepare_first_factor"});let{message:c}=this.firstFactorVerification;if(!c)throw new tC("Web3 nonce not found",{code:"web3_nonce_not_found"});try{a=await s({identifier:r,nonce:c,walletName:null==t?void 0:t.walletName,provider:i})}catch(t){if("coinbase_wallet"===i&&4001===t.code)a=await s({identifier:r,nonce:c,provider:i});else throw t}await o(this,sS).__internal_basePost({body:{signature:a,strategy:e},action:"attempt_first_factor"})})}async passkey(t){let{flow:e}=t||{},i=sb.clerk.__internal_isWebAuthnSupported||r4,n=sb.clerk.__internal_getPublicCredentials||rU,r=sb.clerk.__internal_isWebAuthnAutofillSupported||r7;if(!i())throw new tT("Passkeys are not supported",{code:"passkey_not_supported"});return sy(o(this,sS),async()=>{if("autofill"===e||"discoverable"===e)await this._create({strategy:"passkey"});else{if(!this.supportedFirstFactors.find(t=>"passkey"===t.strategy))throw new tC("Passkey factor not found",{code:"factor_not_found"});await o(this,sS).__internal_basePost({body:{strategy:"passkey"},action:"prepare_first_factor"})}let{nonce:t}=this.firstFactorVerification,i=t?rP(JSON.parse(t)):null;if(!i)throw new tC("Missing public key options",{code:"missing_public_key_options"});let s=!1;"autofill"===e&&(s=await r());let{publicKeyCredential:a,error:l}=await n({publicKeyOptions:i,conditionalUI:s});if(!a)throw new tT(l.message,{code:"passkey_retrieval_failed"});await o(this,sS).__internal_basePost({body:{publicKeyCredential:JSON.stringify(rO(a)),strategy:"passkey"},action:"attempt_first_factor"})})}async sendMFAPhoneCode(){return sy(o(this,sS),async()=>{var t;let e=null==(t=o(this,sS).supportedSecondFactors)?void 0:t.find(t=>"phone_code"===t.strategy);if(!e)throw new tC("Phone code factor not found",{code:"factor_not_found"});let{phoneNumberId:i}=e;await o(this,sS).__internal_basePost({body:{phoneNumberId:i,strategy:"phone_code"},action:"prepare_second_factor"})})}async verifyMFAPhoneCode(t){let{code:e}=t;return sy(o(this,sS),async()=>{await o(this,sS).__internal_basePost({body:{code:e,strategy:"phone_code"},action:"attempt_second_factor"})})}async verifyTOTP(t){let{code:e}=t;return sy(o(this,sS),async()=>{await o(this,sS).__internal_basePost({body:{code:e,strategy:"totp"},action:"attempt_second_factor"})})}async verifyBackupCode(t){let{code:e}=t;return sy(o(this,sS),async()=>{await o(this,sS).__internal_basePost({body:{code:e,strategy:"backup_code"},action:"attempt_second_factor"})})}async ticket(t){var e;let i=null!=(e=null==t?void 0:t.ticket)?e:eM("__clerk_ticket");return this.create({ticket:null!=i?i:void 0})}async finalize(t){let{navigate:e}=t||{};if(!o(this,sS).createdSessionId)throw Error("Cannot finalize sign-in without a created session.");return sy(o(this,sS),async()=>{sb.clerk.client&&!sb.clerk.client.sessions.some(t=>t.id===o(this,sS).createdSessionId)&&await sb.clerk.client.reload(),u(this,sk,!0),await sb.clerk.setActive({session:o(this,sS).createdSessionId,navigate:e})})}selectFirstFactor(t){let{strategy:e,emailAddressId:i,phoneNumberId:n}=t;if(!o(this,sS).supportedFirstFactors)return null;if(i){let t=o(this,sS).supportedFirstFactors.find(t=>t.strategy===e&&t.emailAddressId===i);if(t)return t}if(n){let t=o(this,sS).supportedFirstFactors.find(t=>t.strategy===e&&t.phoneNumberId===n);if(t)return t}let r=o(this,sS).supportedFirstFactors.find(t=>t.strategy===e&&t.safeIdentifier===o(this,sS).identifier);if(r)return r;let s=o(this,sS).supportedFirstFactors.find(t=>t.strategy===e);return s||null}constructor(t){(0,tu._)(this,"emailCode",{sendCode:this.sendEmailCode.bind(this),verifyCode:this.verifyEmailCode.bind(this)}),(0,tu._)(this,"emailLink",{sendLink:this.sendEmailLink.bind(this),waitForVerification:this.waitForEmailLinkVerification.bind(this),get verification(){if(!th())return null;const t=eM("__clerk_status"),e=eM("__clerk_created_session");if(!t||!e)return null;const i="verified"===t&&void 0!==sb.clerk.client&&sb.clerk.client.sessions.some(t=>t.id===e);return{status:t,createdSessionId:e,verifiedFromTheSameClient:i}}}),(0,tu._)(this,"resetPasswordEmailCode",{sendCode:this.sendResetPasswordEmailCode.bind(this),verifyCode:this.verifyResetPasswordEmailCode.bind(this),submitPassword:this.submitResetPassword.bind(this)}),(0,tu._)(this,"phoneCode",{sendCode:this.sendPhoneCode.bind(this),verifyCode:this.verifyPhoneCode.bind(this)}),(0,tu._)(this,"mfa",{sendPhoneCode:this.sendMFAPhoneCode.bind(this),verifyPhoneCode:this.verifyMFAPhoneCode.bind(this),verifyTOTP:this.verifyTOTP.bind(this),verifyBackupCode:this.verifyBackupCode.bind(this)}),c(this,sk,{writable:!0,value:!1}),c(this,sS,{writable:!0,value:void 0}),u(this,sS,t)}}function sI(t){let{unsafeMetadata:e}={...t},i=e?"object"==typeof e?JSON.stringify(e):e:"";return{...t,...e?{unsafeMetadata:i}:{}}}class sx extends nb{get status(){return this._status}set status(t){let e=this._status;this._status=t,t&&e!==t&&ib.debug("SignUp.status",{id:this.id,from:e,to:t})}fromJSON(t){return t&&(this.id=t.id,this.status=t.status,this.requiredFields=t.required_fields,this.optionalFields=t.optional_fields,this.missingFields=t.missing_fields,this.unverifiedFields=t.unverified_fields,this.verifications=new rW(t.verifications),this.username=t.username,this.firstName=t.first_name,this.lastName=t.last_name,this.emailAddress=t.email_address,this.phoneNumber=t.phone_number,this.hasPassword=t.has_password,this.unsafeMetadata=t.unsafe_metadata,this.createdSessionId=t.created_session_id,this.createdUserId=t.created_user_id,this.abandonAt=t.abandon_at,this.web3wallet=t.web3_wallet,this.legalAcceptedAt=t.legal_accepted_at,this.locale=t.locale),rJ.emit("resource:update",{resource:this}),this}__internal_toSnapshot(){var t;return{object:"sign_up",id:this.id||"",status:this.status||null,required_fields:this.requiredFields,optional_fields:this.optionalFields,missing_fields:this.missingFields,unverified_fields:this.unverifiedFields,verifications:this.verifications.__internal_toSnapshot(),username:this.username,first_name:this.firstName,last_name:this.lastName,email_address:this.emailAddress,phone_number:this.phoneNumber,has_password:this.hasPassword,unsafe_metadata:this.unsafeMetadata,created_session_id:this.createdSessionId,created_user_id:this.createdUserId,abandon_at:this.abandonAt,web3_wallet:this.web3wallet,legal_accepted_at:this.legalAcceptedAt,locale:this.locale,external_account:this.externalAccount,external_account_strategy:null==(t=this.externalAccount)?void 0:t.strategy}}clientBypass(){var t;return null==(t=sx.clerk.client)?void 0:t.captchaBypass}shouldBypassCaptchaForAttempt(t){if(!t.strategy)return!1;let e=sx.clerk.__internal_environment.displayConfig.captchaOauthBypass;return!!(e.some(e=>e===t.strategy)||t.transfer&&e.some(t=>t===sx.clerk.client.signIn.firstFactorVerification.strategy))}constructor(t=null){super(),(0,tu._)(this,"pathRoot","/client/sign_ups"),(0,tu._)(this,"id",void 0),(0,tu._)(this,"_status",null),(0,tu._)(this,"requiredFields",[]),(0,tu._)(this,"missingFields",[]),(0,tu._)(this,"optionalFields",[]),(0,tu._)(this,"unverifiedFields",[]),(0,tu._)(this,"verifications",new rW(null)),(0,tu._)(this,"username",null),(0,tu._)(this,"firstName",null),(0,tu._)(this,"lastName",null),(0,tu._)(this,"emailAddress",null),(0,tu._)(this,"phoneNumber",null),(0,tu._)(this,"web3wallet",null),(0,tu._)(this,"externalAccount",void 0),(0,tu._)(this,"hasPassword",!1),(0,tu._)(this,"unsafeMetadata",{}),(0,tu._)(this,"createdSessionId",null),(0,tu._)(this,"createdUserId",null),(0,tu._)(this,"abandonAt",null),(0,tu._)(this,"legalAcceptedAt",null),(0,tu._)(this,"locale",null),(0,tu._)(this,"__internal_future",new sP(this)),(0,tu._)(this,"__internal_basePost",this._basePost.bind(this)),(0,tu._)(this,"__internal_basePatch",this._basePatch.bind(this)),(0,tu._)(this,"create",async t=>{ib.debug("SignUp.create",{id:this.id,strategy:t.strategy});let e={...t};if(!e.locale){let t=iW();t&&(e.locale=t)}if(!this.clientBypass()&&!this.shouldBypassCaptchaForAttempt(t)){let t=new ny(sx.clerk),i=await t.managedOrInvisible({action:"signup"});if(!i)throw new tC("",{code:"captcha_unavailable"});e={...e,...i}}if(e.transfer&&this.shouldBypassCaptchaForAttempt(e)){var i;let t=null==(i=sx.clerk.client)?void 0:i.signIn.firstFactorVerification.strategy;t&&(e={...e,strategy:t})}return this._basePost({path:this.pathRoot,body:sI(e)})}),(0,tu._)(this,"prepareVerification",t=>(ib.debug("SignUp.prepareVerification",{id:this.id,strategy:t.strategy}),this._basePost({body:t,action:"prepare_verification"}))),(0,tu._)(this,"attemptVerification",t=>(ib.debug("SignUp.attemptVerification",{id:this.id,strategy:t.strategy}),this._basePost({body:t,action:"attempt_verification"}))),(0,tu._)(this,"prepareEmailAddressVerification",t=>this.prepareVerification(t||{strategy:"email_code"})),(0,tu._)(this,"attemptEmailAddressVerification",t=>this.attemptVerification({...t,strategy:"email_code"})),(0,tu._)(this,"createEmailLinkFlow",()=>{let{run:t,stop:e}=rk();return{startEmailLinkFlow:async i=>{let{redirectUrl:n}=i;return this.id||iV("SignUp"),await this.prepareEmailAddressVerification({strategy:"email_link",redirectUrl:n}),new Promise((i,n)=>{t(()=>this.reload().then(t=>{let n=t.verifications.emailAddress.status;("verified"===n||"expired"===n)&&(e(),i(t))}).catch(t=>{e(),n(t)}))})},cancelEmailLinkFlow:e}}),(0,tu._)(this,"preparePhoneNumberVerification",t=>this.prepareVerification(t||{strategy:"phone_code"})),(0,tu._)(this,"attemptPhoneNumberVerification",t=>this.attemptVerification({...t,strategy:"phone_code"})),(0,tu._)(this,"prepareWeb3WalletVerification",t=>this.prepareVerification({strategy:"web3_metamask_signature",...t})),(0,tu._)(this,"attemptWeb3WalletVerification",async t=>{let{signature:e,strategy:i="web3_metamask_signature"}=t;return this.attemptVerification({signature:e,strategy:i})}),(0,tu._)(this,"authenticateWithWeb3",async t=>{let e,{generateSignature:i,identifier:n,unsafeMetadata:r,strategy:s="web3_metamask_signature",legalAccepted:a,walletName:o}=t||{},l=s.replace("web3_","").replace("_signature","");"function"!=typeof i&&iq("generateSignature");let c=n||this.web3wallet;await this.create({web3Wallet:c,unsafeMetadata:r,legalAccepted:a}),await this.prepareWeb3WalletVerification({strategy:s});let{message:u}=this.verifications.web3Wallet;u||iK("SignUp");try{e=await i({identifier:n,nonce:u,provider:l,walletName:o})}catch(t){if("coinbase_wallet"===l&&4001===t.code)e=await i({identifier:n,nonce:u,provider:l});else throw t}return this.attemptWeb3WalletVerification({signature:e,strategy:s})}),(0,tu._)(this,"authenticateWithMetamask",async t=>{let e=await nl().getMetamaskIdentifier();return this.authenticateWithWeb3({identifier:e,generateSignature:nl().generateSignatureWithMetamask,unsafeMetadata:null==t?void 0:t.unsafeMetadata,strategy:"web3_metamask_signature",legalAccepted:null==t?void 0:t.legalAccepted})}),(0,tu._)(this,"authenticateWithCoinbaseWallet",async t=>{let e=await nl().getCoinbaseWalletIdentifier();return this.authenticateWithWeb3({identifier:e,generateSignature:nl().generateSignatureWithCoinbaseWallet,unsafeMetadata:null==t?void 0:t.unsafeMetadata,strategy:"web3_coinbase_wallet_signature",legalAccepted:null==t?void 0:t.legalAccepted})}),(0,tu._)(this,"authenticateWithBase",async t=>{let e=await nl().getBaseIdentifier();return this.authenticateWithWeb3({identifier:e,generateSignature:nl().generateSignatureWithBase,unsafeMetadata:null==t?void 0:t.unsafeMetadata,strategy:"web3_base_signature",legalAccepted:null==t?void 0:t.legalAccepted})}),(0,tu._)(this,"authenticateWithOKXWallet",async t=>{let e=await nl().getOKXWalletIdentifier();return this.authenticateWithWeb3({identifier:e,generateSignature:nl().generateSignatureWithOKXWallet,unsafeMetadata:null==t?void 0:t.unsafeMetadata,strategy:"web3_okx_wallet_signature",legalAccepted:null==t?void 0:t.legalAccepted})}),(0,tu._)(this,"authenticateWithSolana",async t=>{let{walletName:e,unsafeMetadata:i,legalAccepted:n}=t,r=await nl().getSolanaIdentifier(e);return this.authenticateWithWeb3({identifier:r,generateSignature:t=>nl().generateSignatureWithSolana({...t,walletName:e}),unsafeMetadata:i,strategy:"web3_solana_signature",legalAccepted:n,walletName:e})}),(0,tu._)(this,"authenticateWithRedirectOrPopup",async(t,e)=>{let{redirectUrl:i,redirectUrlComplete:n,strategy:r,continueSignUp:s=!1,unsafeMetadata:a,emailAddress:o,legalAccepted:l,oidcPrompt:c,enterpriseConnectionId:u}=t,h=sx.clerk.buildUrlWithAuth(i),d=()=>{let t={strategy:r,redirectUrl:h,actionCompleteRedirectUrl:n,unsafeMetadata:a,emailAddress:o,legalAccepted:l,oidcPrompt:c,enterpriseConnectionId:u};return s&&this.id?this.update(t):this.create(t)},{verifications:f}=await d().catch(async t=>{if(tN(t)&&tR(t))return await sx.clerk.__internal_environment.reload(),d();throw t}),{externalAccount:p}=f,{status:_,externalVerificationRedirectURL:g}=p;"unverified"===_&&g?e(g):iH(_,sx.fapiClient.buildEmailAddress("support"))}),(0,tu._)(this,"authenticateWithRedirect",async t=>this.authenticateWithRedirectOrPopup(t,eJ)),(0,tu._)(this,"authenticateWithPopup",async t=>{let{popup:e}=t||{};return e||iq("popup"),sg(sx.clerk,"signUp",this.authenticateWithRedirectOrPopup,t,t=>{e.location.href=t instanceof URL?t.toString():t})}),(0,tu._)(this,"update",t=>this._basePatch({body:sI(t)})),(0,tu._)(this,"upsert",t=>this.id?this.update(t):this.create(t)),(0,tu._)(this,"validatePassword",(t,e)=>{var i,n;if(null==(i=sx.clerk.__internal_environment)?void 0:i.userSettings.passwordSettings)return sp(sw(),{...null==(n=sx.clerk.__internal_environment)?void 0:n.userSettings.passwordSettings,validatePassword:!0})(t,e)}),(0,tu._)(this,"__experimental_getEnterpriseConnections",()=>nb._fetch({path:"/client/sign_ups/".concat(this.id,"/enterprise_connections"),method:"GET"}).then(t=>(null==t?void 0:t.response).map(t=>new sC(t)))),this.fromJSON(t)}}var sU=new WeakMap,sE=new WeakMap;class sP{get id(){return o(this,sE).id}get requiredFields(){return o(this,sE).requiredFields}get optionalFields(){return o(this,sE).optionalFields}get missingFields(){return o(this,sE).missingFields}get status(){return o(this,sE).status||"missing_requirements"}get username(){return o(this,sE).username}get firstName(){return o(this,sE).firstName}get lastName(){return o(this,sE).lastName}get emailAddress(){return o(this,sE).emailAddress}get phoneNumber(){return o(this,sE).phoneNumber}get web3Wallet(){return o(this,sE).web3wallet}get hasPassword(){return o(this,sE).hasPassword}get unsafeMetadata(){return o(this,sE).unsafeMetadata}get createdSessionId(){return o(this,sE).createdSessionId}get createdUserId(){return o(this,sE).createdUserId}get abandonAt(){return o(this,sE).abandonAt}get legalAcceptedAt(){return o(this,sE).legalAcceptedAt}get locale(){return o(this,sE).locale}get unverifiedFields(){return o(this,sE).unverifiedFields}get isTransferable(){var t;return"transferable"===o(this,sE).verifications.externalAccount.status&&(null==(t=o(this,sE).verifications.externalAccount.error)?void 0:t.code)==="external_account_exists"}get existingSession(){var t,e,i,n,r;if(("failed"===o(this,sE).verifications.externalAccount.status||"unverified"===o(this,sE).verifications.externalAccount.status)&&(null==(t=o(this,sE).verifications.externalAccount.error)?void 0:t.code)==="identifier_already_signed_in"&&(null==(i=o(this,sE).verifications.externalAccount.error)||null==(e=i.meta)?void 0:e.sessionId))return{sessionId:null==(r=o(this,sE).verifications.externalAccount.error)||null==(n=r.meta)?void 0:n.sessionId}}get hasBeenFinalized(){return o(this,sU)}async getCaptchaToken(){let t=new ny(sx.clerk),e=await t.managedOrInvisible({action:"signup"});if(!e)throw Error("Captcha challenge failed");let{captchaError:i,captchaToken:n,captchaWidgetType:r}=e;return{captchaToken:n,captchaWidgetType:r,captchaError:i}}async _create(t){var e;let{captchaToken:i,captchaWidgetType:n,captchaError:r}=await this.getCaptchaToken(),s={transfer:t.transfer,captchaToken:i,captchaWidgetType:n,captchaError:r,...t,unsafeMetadata:t.unsafeMetadata?sI(t.unsafeMetadata):void 0,locale:null!=(e=t.locale)?e:iW()};await o(this,sE).__internal_basePost({path:o(this,sE).pathRoot,body:s})}async create(t){return sy(o(this,sE),async()=>{await this._create(t)})}async update(t){return sy(o(this,sE),async()=>{let e={...t,unsafeMetadata:t.unsafeMetadata?sI(t.unsafeMetadata):void 0};await o(this,sE).__internal_basePatch({path:o(this,sE).pathRoot,body:e})})}async password(t){return sy(o(this,sE),async()=>{let{captchaToken:e,captchaWidgetType:i,captchaError:n}=await this.getCaptchaToken(),r={strategy:"password",captchaToken:e,captchaWidgetType:i,captchaError:n,...t,unsafeMetadata:t.unsafeMetadata?sI(t.unsafeMetadata):void 0};await o(this,sE).__internal_basePost({path:o(this,sE).pathRoot,body:r})})}async sendEmailCode(){return sy(o(this,sE),async()=>{await o(this,sE).__internal_basePost({body:{strategy:"email_code"},action:"prepare_verification"})})}async verifyEmailCode(t){let{code:e}=t;return sy(o(this,sE),async()=>{await o(this,sE).__internal_basePost({body:{strategy:"email_code",code:e},action:"attempt_verification"})})}async sendPhoneCode(t){let{phoneNumber:e,channel:i="sms"}=t;return sy(o(this,sE),async()=>{if(!o(this,sE).id){let{captchaToken:t,captchaWidgetType:i,captchaError:n}=await this.getCaptchaToken();await o(this,sE).__internal_basePost({path:o(this,sE).pathRoot,body:{phoneNumber:e,captchaToken:t,captchaWidgetType:i,captchaError:n}})}await o(this,sE).__internal_basePost({body:{strategy:"phone_code",channel:i},action:"prepare_verification"})})}async verifyPhoneCode(t){let{code:e}=t;return sy(o(this,sE),async()=>{await o(this,sE).__internal_basePost({body:{strategy:"phone_code",code:e},action:"attempt_verification"})})}async sso(t){let{strategy:e,redirectUrl:i,redirectCallbackUrl:n,unsafeMetadata:r,legalAccepted:s,oidcPrompt:a,enterpriseConnectionId:l,emailAddress:c,popup:u}=t;return sy(o(this,sE),async()=>{let{captchaToken:t,captchaWidgetType:h,captchaError:d}=await this.getCaptchaToken(),f=i;try{new URL(i)}catch{f=window.location.origin+i}let p={redirectUrl:sx.clerk.buildUrlWithAuth(n),actionCompleteRedirectUrl:f};if(u){let t=sv(sx.clerk,{redirectCallbackUrl:p.redirectUrl,redirectUrl:f});p.redirectUrl=t.redirectCallbackUrl,p.actionCompleteRedirectUrl=t.redirectUrl}let _=()=>o(this,sE).__internal_basePost({path:o(this,sE).pathRoot,body:{strategy:e,...p,unsafeMetadata:r,legalAccepted:s,oidcPrompt:a,enterpriseConnectionId:l,emailAddress:c,captchaToken:t,captchaWidgetType:h,captchaError:d}});await _().catch(async t=>{if(tN(t)&&tR(t))return await sx.clerk.__internal_environment.reload(),_();throw t});let{status:g,externalVerificationRedirectURL:v}=o(this,sE).verifications.externalAccount;"unverified"===g&&v&&(u?(await sm(sx.clerk,{popup:u,externalVerificationRedirectURL:v}),await o(this,sE).reload()):eJ(v))})}async web3(t){let{strategy:e,unsafeMetadata:i,legalAccepted:n}=t,r=e.replace("web3_","").replace("_signature","");return sy(o(this,sE),async()=>{let t,s,a;switch(r){case"metamask":t=await nl().getMetamaskIdentifier(),s=nl().generateSignatureWithMetamask;break;case"coinbase_wallet":t=await nl().getCoinbaseWalletIdentifier(),s=nl().generateSignatureWithCoinbaseWallet;break;case"base":t=await nl().getBaseIdentifier(),s=nl().generateSignatureWithBase;break;case"okx_wallet":t=await nl().getOKXWalletIdentifier(),s=nl().generateSignatureWithOKXWallet;break;default:throw Error("Unsupported Web3 provider: ".concat(r))}let l=t||o(this,sE).web3wallet;await this._create({web3Wallet:l,unsafeMetadata:i,legalAccepted:n}),await o(this,sE).__internal_basePost({body:{strategy:e},action:"prepare_verification"});let{message:c}=o(this,sE).verifications.web3Wallet;c||iK("SignUp");try{a=await s({identifier:t,nonce:c})}catch(e){if("coinbase_wallet"===r&&4001===e.code)a=await s({identifier:t,nonce:c});else throw e}await o(this,sE).__internal_basePost({body:{signature:a,strategy:e},action:"attempt_verification"})})}async ticket(t){var e;let i=null!=(e=null==t?void 0:t.ticket)?e:eM("__clerk_ticket");return this.create({...t,ticket:null!=i?i:void 0})}async finalize(t){let{navigate:e}=t||{};return sy(o(this,sE),async()=>{if(!o(this,sE).createdSessionId)throw Error("Cannot finalize sign-up without a created session.");u(this,sU,!0),await sx.clerk.setActive({session:o(this,sE).createdSessionId,navigate:e})})}constructor(t){(0,tu._)(this,"verifications",{sendEmailCode:this.sendEmailCode.bind(this),verifyEmailCode:this.verifyEmailCode.bind(this),sendPhoneCode:this.sendPhoneCode.bind(this),verifyPhoneCode:this.verifyPhoneCode.bind(this)}),c(this,sU,{writable:!0,value:!1}),c(this,sE,{writable:!0,value:void 0}),u(this,sE,t)}}class sC extends nb{fromJSON(t){return t&&(this.id=t.id,this.name=t.name),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"name",void 0),this.fromJSON(t)}}class sO extends nb{static async create(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new sO(await nb._fetch({body:e,method:"POST",path:t,search:i?"debug=skip_cache":void 0}),t)}fromJSON(t){return t&&(this.jwt=iN(t.jwt)),this}__internal_toSnapshot(){return{object:"token",id:this.id||"",jwt:this.getRawString()}}constructor(t,e){super(),(0,tu._)(this,"pathRoot","tokens"),(0,tu._)(this,"jwt",void 0),(0,tu._)(this,"getRawString",()=>{var t;return(null==(t=this.jwt)?void 0:t.claims.__raw)||""}),e&&(this.pathRoot=e),(null==t?void 0:t.jwt)&&(this.jwt=iN(t.jwt))}}class sT extends nb{fromJSON(t){return t&&(this.id=t.id,this.secret=t.secret,this.uri=t.uri,this.verified=t.verified,this.backupCodes=t.backup_codes,this.updatedAt=nk(t.updated_at),this.createdAt=nk(t.created_at)),this}constructor(t){super(),(0,tu._)(this,"pathRoot","/me"),(0,tu._)(this,"id",""),(0,tu._)(this,"secret",void 0),(0,tu._)(this,"uri",void 0),(0,tu._)(this,"verified",!1),(0,tu._)(this,"backupCodes",void 0),(0,tu._)(this,"updatedAt",null),(0,tu._)(this,"createdAt",null),this.fromJSON(t)}}class sR extends nb{fromJSON(t){return t&&(this.id=t.id,this.codes=t.codes,this.updatedAt=nk(t.updated_at),this.createdAt=nk(t.created_at)),this}constructor(t){super(),(0,tu._)(this,"pathRoot","/me"),(0,tu._)(this,"id",void 0),(0,tu._)(this,"codes",[]),(0,tu._)(this,"updatedAt",null),(0,tu._)(this,"createdAt",null),this.fromJSON(t)}}class sM extends nb{static isUserResource(t){return!!t&&t instanceof sM}path(){return this.pathRoot}get verifiedExternalAccounts(){return this.externalAccounts.filter(t=>{var e;return(null==(e=t.verification)?void 0:e.status)=="verified"})}get unverifiedExternalAccounts(){return this.externalAccounts.filter(t=>{var e;return(null==(e=t.verification)?void 0:e.status)!="verified"})}get verifiedWeb3Wallets(){return this.web3Wallets.filter(t=>{var e;return(null==(e=t.verification)?void 0:e.status)=="verified"})}get hasVerifiedEmailAddress(){return this.emailAddresses.filter(t=>"verified"===t.verification.status).length>0}get hasVerifiedPhoneNumber(){return this.phoneNumbers.filter(t=>"verified"===t.verification.status).length>0}fromJSON(t){return t&&(this.id=t.id,this.externalId=t.external_id||null,this.firstName=t.first_name||null,this.lastName=t.last_name||null,(this.firstName||this.lastName)&&(this.fullName=(t=>{let{firstName:e,lastName:i,name:n}=t;return n||[e,i].join(" ").trim()||""})({firstName:this.firstName,lastName:this.lastName})),this.imageUrl=t.image_url||"",this.hasImage=t.has_image||!1,this.username=t.username||null,this.passwordEnabled=t.password_enabled||!1,this.emailAddresses=(t.email_addresses||[]).map(t=>new rS(t,this.path()+"/email_addresses")),this.primaryEmailAddressId=t.primary_email_address_id||null,this.primaryEmailAddress=this.emailAddresses.find(t=>{let{id:e}=t;return e===this.primaryEmailAddressId})||null,this.phoneNumbers=(t.phone_numbers||[]).map(t=>new st(t,this.path()+"/phone_numbers")),this.primaryPhoneNumberId=t.primary_phone_number_id||null,this.primaryPhoneNumber=this.phoneNumbers.find(t=>{let{id:e}=t;return e===this.primaryPhoneNumberId})||null,this.web3Wallets=(t.web3_wallets||[]).map(t=>new sD(t,this.path()+"/web3_wallets")),this.primaryWeb3WalletId=t.primary_web3_wallet_id||null,this.primaryWeb3Wallet=this.web3Wallets.find(t=>{let{id:e}=t;return e===this.primaryWeb3WalletId})||null,this.externalAccounts=(t.external_accounts||[]).map(t=>new rG(t,this.path()+"/external_accounts")),this.passkeys=(t.passkeys||[]).map(t=>new r9(t)),this.organizationMemberships=(t.organization_memberships||[]).map(t=>new r5(t)),this.enterpriseAccounts=(t.enterprise_accounts||[]).map(t=>new rF(t,this.path()+"/enterprise_accounts")),this.publicMetadata=t.public_metadata||{},this.unsafeMetadata=t.unsafe_metadata||{},this.totpEnabled=t.totp_enabled||!1,this.backupCodeEnabled=t.backup_code_enabled||!1,this.twoFactorEnabled=t.two_factor_enabled||!1,this.createOrganizationEnabled=t.create_organization_enabled||!1,this.createOrganizationsLimit=t.create_organizations_limit||null,this.deleteSelfEnabled=t.delete_self_enabled||!1,t.last_sign_in_at&&(this.lastSignInAt=nk(t.last_sign_in_at)),t.legal_accepted_at&&(this.legalAcceptedAt=nk(t.legal_accepted_at)),this.updatedAt=nk(t.updated_at||void 0),this.createdAt=nk(t.created_at||void 0)),this}__internal_toSnapshot(){var t,e,i,n;return{object:"user",id:this.id,external_id:this.externalId,first_name:this.firstName,last_name:this.lastName,username:this.username,public_metadata:this.publicMetadata,unsafe_metadata:this.unsafeMetadata,image_url:this.imageUrl,has_image:this.hasImage,email_addresses:this.emailAddresses.map(t=>t.__internal_toSnapshot()),phone_numbers:this.phoneNumbers.map(t=>t.__internal_toSnapshot()),web3_wallets:this.web3Wallets.map(t=>t.__internal_toSnapshot()),external_accounts:this.externalAccounts.map(t=>t.__internal_toSnapshot()),passkeys:this.passkeys.map(t=>t.__internal_toSnapshot()),organization_memberships:this.organizationMemberships.map(t=>t.__internal_toSnapshot()),enterprise_accounts:this.enterpriseAccounts.map(t=>t.__internal_toSnapshot()),totp_enabled:this.totpEnabled,backup_code_enabled:this.backupCodeEnabled,two_factor_enabled:this.twoFactorEnabled,create_organization_enabled:this.createOrganizationEnabled,create_organizations_limit:this.createOrganizationsLimit,delete_self_enabled:this.deleteSelfEnabled,primary_email_address_id:this.primaryEmailAddressId,primary_phone_number_id:this.primaryPhoneNumberId,primary_web3_wallet_id:this.primaryWeb3WalletId,password_enabled:this.passwordEnabled,profile_image_id:this.imageUrl,last_sign_in_at:(null==(t=this.lastSignInAt)?void 0:t.getTime())||null,legal_accepted_at:(null==(e=this.legalAcceptedAt)?void 0:e.getTime())||null,updated_at:(null==(i=this.updatedAt)?void 0:i.getTime())||null,created_at:(null==(n=this.createdAt)?void 0:n.getTime())||null}}constructor(t){super(),(0,tu._)(this,"pathRoot","/me"),(0,tu._)(this,"id",""),(0,tu._)(this,"externalId",null),(0,tu._)(this,"username",null),(0,tu._)(this,"emailAddresses",[]),(0,tu._)(this,"phoneNumbers",[]),(0,tu._)(this,"web3Wallets",[]),(0,tu._)(this,"externalAccounts",[]),(0,tu._)(this,"enterpriseAccounts",[]),(0,tu._)(this,"passkeys",[]),(0,tu._)(this,"organizationMemberships",[]),(0,tu._)(this,"passwordEnabled",!1),(0,tu._)(this,"firstName",null),(0,tu._)(this,"lastName",null),(0,tu._)(this,"fullName",null),(0,tu._)(this,"primaryEmailAddressId",null),(0,tu._)(this,"primaryEmailAddress",null),(0,tu._)(this,"primaryPhoneNumberId",null),(0,tu._)(this,"primaryPhoneNumber",null),(0,tu._)(this,"primaryWeb3WalletId",null),(0,tu._)(this,"primaryWeb3Wallet",null),(0,tu._)(this,"imageUrl",""),(0,tu._)(this,"hasImage",!1),(0,tu._)(this,"twoFactorEnabled",!1),(0,tu._)(this,"totpEnabled",!1),(0,tu._)(this,"backupCodeEnabled",!1),(0,tu._)(this,"publicMetadata",{}),(0,tu._)(this,"unsafeMetadata",{}),(0,tu._)(this,"createOrganizationEnabled",!1),(0,tu._)(this,"createOrganizationsLimit",null),(0,tu._)(this,"deleteSelfEnabled",!1),(0,tu._)(this,"lastSignInAt",null),(0,tu._)(this,"legalAcceptedAt",null),(0,tu._)(this,"updatedAt",null),(0,tu._)(this,"createdAt",null),(0,tu._)(this,"cachedSessionsWithActivities",null),(0,tu._)(this,"isPrimaryIdentification",t=>{switch(t.constructor){case rS:return this.primaryEmailAddressId===t.id;case st:return this.primaryPhoneNumberId===t.id;case sD:return this.primaryWeb3WalletId===t.id;default:return!1}}),(0,tu._)(this,"createEmailAddress",t=>{let{email:e}=t||{};return new rS({email_address:e},this.path()+"/email_addresses/").create()}),(0,tu._)(this,"createPasskey",()=>r9.registerPasskey()),(0,tu._)(this,"createPhoneNumber",t=>{let{phoneNumber:e}=t||{};return new st({phone_number:e},this.path()+"/phone_numbers/").create()}),(0,tu._)(this,"createWeb3Wallet",t=>{let{web3Wallet:e}=t||{};return new sD({web3_wallet:e},this.path()+"/web3_wallets/").create()}),(0,tu._)(this,"createExternalAccount",async t=>{var e;let{strategy:i,redirectUrl:n,additionalScopes:r}=t||{};return new rG(null==(e=await nb._fetch({path:"/me/external_accounts",method:"POST",body:{strategy:i,redirect_url:n,additional_scope:r}}))?void 0:e.response,this.path()+"/external_accounts")}),(0,tu._)(this,"createTOTP",async()=>{var t;return new sT(null==(t=await nb._fetch({path:"/me/totp",method:"POST"}))?void 0:t.response)}),(0,tu._)(this,"verifyTOTP",async t=>{var e;let{code:i}=t;return new sT(null==(e=await nb._fetch({path:"/me/totp/attempt_verification",method:"POST",body:{code:i}}))?void 0:e.response)}),(0,tu._)(this,"disableTOTP",async()=>{var t;return new rg(null==(t=await nb._fetch({path:"/me/totp",method:"DELETE"}))?void 0:t.response)}),(0,tu._)(this,"createBackupCode",async()=>{var t;return new sR(null==(t=await nb._fetch({path:this.path()+"/backup_codes/",method:"POST"}))?void 0:t.response)}),(0,tu._)(this,"update",t=>this._basePatch({body:sI(t)})),(0,tu._)(this,"updatePassword",t=>this._basePost({body:t,path:"".concat(this.path(),"/change_password")})),(0,tu._)(this,"removePassword",t=>this._basePost({body:t,path:"".concat(this.path(),"/remove_password")})),(0,tu._)(this,"delete",()=>this._baseDelete({path:"/me"}).then(t=>(rJ.emit(rj,null),t))),(0,tu._)(this,"getSessions",async()=>{if(this.cachedSessionsWithActivities)return this.cachedSessionsWithActivities;let t=await sf.retrieve();return this.cachedSessionsWithActivities=t,t}),(0,tu._)(this,"setProfileImage",t=>{let{file:e}=t||{};return null===e?rX.delete("".concat(this.path(),"/profile_image")):rX.create("".concat(this.path(),"/profile_image"),{file:e})}),(0,tu._)(this,"getOrganizationInvitations",t=>sW.retrieve(t)),(0,tu._)(this,"getOrganizationSuggestions",t=>r6.retrieve(t)),(0,tu._)(this,"getOrganizationMemberships",t=>r5.retrieve(t)),(0,tu._)(this,"leaveOrganization",async t=>{var e;return new rg(null==(e=await nb._fetch({path:"".concat(this.path(),"/organization_memberships/").concat(t),method:"DELETE"}))?void 0:e.response)}),(0,tu._)(this,"initializePaymentMethod",t=>rt(t)),(0,tu._)(this,"addPaymentMethod",t=>re(t)),(0,tu._)(this,"getPaymentMethods",t=>ri(t)),this.fromJSON(t)}}class sN{fromJSON(t){if(t){var e,i;this.firstName=t.first_name,this.lastName=t.last_name,this.imageUrl=null!=(e=t.image_url)?e:void 0,this.hasImage=null!=(i=t.has_image)?i:void 0}return this}__internal_toSnapshot(){return{first_name:this.firstName,last_name:this.lastName,image_url:this.imageUrl||null,has_image:this.hasImage||null}}constructor(t){(0,tu._)(this,"firstName",void 0),(0,tu._)(this,"lastName",void 0),(0,tu._)(this,"imageUrl",void 0),(0,tu._)(this,"hasImage",void 0),this.fromJSON(t)}}class sW extends nb{static async retrieve(t){return await nb._fetch({path:"/me/organization_invitations",method:"GET",search:nH(t)}).then(t=>{let{data:e,total_count:i}=null==t?void 0:t.response;return{total_count:i,data:e.map(t=>new sW(t))}})}fromJSON(t){return t&&(this.id=t.id,this.emailAddress=t.email_address,this.publicOrganizationData={hasImage:t.public_organization_data.has_image,imageUrl:t.public_organization_data.image_url,name:t.public_organization_data.name,id:t.public_organization_data.id,slug:t.public_organization_data.slug},this.publicMetadata=t.public_metadata,this.role=t.role,this.status=t.status,this.createdAt=nk(t.created_at),this.updatedAt=nk(t.updated_at)),this}constructor(t){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"emailAddress",void 0),(0,tu._)(this,"publicOrganizationData",void 0),(0,tu._)(this,"publicMetadata",{}),(0,tu._)(this,"status",void 0),(0,tu._)(this,"role",void 0),(0,tu._)(this,"createdAt",void 0),(0,tu._)(this,"updatedAt",void 0),(0,tu._)(this,"accept",async()=>await this._basePost({path:"/me/organization_invitations/".concat(this.id,"/accept")})),this.fromJSON(t)}}let sz={enabled:!1,first_factors:[],name:"phone_number",required:!1,second_factors:[],used_for_first_factor:!1,used_for_second_factor:!1,verifications:[],verify_at_sign_up:!1};class sF extends nb{get authenticatableSocialStrategies(){return this.social?Object.entries(this.social).filter(t=>{let[,e]=t;return e.enabled&&e.authenticatable}).map(t=>{let[,e]=t;return e.strategy}).sort():[]}get enabledFirstFactorIdentifiers(){return this.attributes?Object.entries(this.attributes).filter(t=>{let[e,i]=t;return i.used_for_first_factor&&!e.startsWith("web3")}).map(t=>{let[e]=t;return e}):[]}get socialProviderStrategies(){return this.social?Object.entries(this.social).filter(t=>{let[,e]=t;return e.enabled}).map(t=>{let[,e]=t;return e.strategy}).sort():[]}get web3FirstFactors(){return this.attributes?Object.entries(this.attributes).filter(t=>{let[e,i]=t;return i.used_for_first_factor&&e.startsWith("web3")}).map(t=>{let[,e]=t;return e.first_factors}).flat():[]}get alternativePhoneCodeChannels(){return this.attributes?Object.entries(this.attributes).filter(t=>{let[e,i]=t;return i.used_for_first_factor&&"phone_number"===e}).map(t=>{var e;let[,i]=t;return(null==i||null==(e=i.channels)?void 0:e.filter(t=>"sms"!==t))||[]}).flat():[]}get instanceIsPasswordBased(){var t,e,i;return!!((null==(e=this.attributes)||null==(t=e.password)?void 0:t.enabled)&&(null==(i=this.attributes.password)?void 0:i.required))}get hasValidAuthFactor(){var t,e,i,n,r,s;return!!((null==(e=this.attributes)||null==(t=e.email_address)?void 0:t.enabled)||(null==(n=this.attributes)||null==(i=n.phone_number)?void 0:i.enabled)||(null==(r=this.attributes.password)?void 0:r.required)&&(null==(s=this.attributes.username)?void 0:s.required))}fromJSON(t){var e,i,n,r,s,a,o,l,c;return t&&(this.attributes=this.withDefault(t.attributes?Object.fromEntries(Object.entries(t.attributes).map(t=>[t[0],{...t[1],name:t[0]}])):null,this.attributes),this.actions=this.withDefault(t.actions,this.actions),this.enterpriseSSO=this.withDefault(t.enterprise_sso,this.enterpriseSSO),this.passkeySettings=this.withDefault(t.passkey_settings,this.passkeySettings),this.passwordSettings=t.password_settings?{...t.password_settings,min_length:Math.max(null!=(a=null==(e=t.password_settings)?void 0:e.min_length)?a:8,8),max_length:(null==(i=t.password_settings)?void 0:i.max_length)===0?72:Math.min(null!=(o=null==(n=t.password_settings)?void 0:n.max_length)?o:72,72)}:this.passwordSettings,this.signIn=this.withDefault(t.sign_in,this.signIn),this.signUp=this.withDefault(t.sign_up,this.signUp),this.social=this.withDefault(t.social,this.social),this.usernameSettings=t.username_settings?{...t.username_settings,min_length:Math.max(null!=(l=null==(r=t.username_settings)?void 0:r.min_length)?l:4,4),max_length:Math.min(null!=(c=null==(s=t.username_settings)?void 0:s.max_length)?c:64,64)}:this.usernameSettings),this}__internal_toSnapshot(){return{actions:this.actions,attributes:this.attributes,passkey_settings:this.passkeySettings,password_settings:this.passwordSettings,sign_in:this.signIn,sign_up:this.signUp,social:this.social}}constructor(t=null){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"actions",{create_organization:!1,delete_self:!1}),(0,tu._)(this,"attributes",{email_address:{enabled:!0,first_factors:["email_code"],name:"email_address",required:!0,second_factors:[],used_for_first_factor:!0,used_for_second_factor:!1,verifications:["email_code"],verify_at_sign_up:!0},phone_number:{...sz,name:"phone_number"},username:{...sz,name:"username"},web3_wallet:{...sz,name:"web3_wallet"},first_name:{...sz,name:"first_name"},last_name:{...sz,name:"last_name"},password:{enabled:!0,first_factors:[],name:"password",required:!0,second_factors:[],used_for_first_factor:!1,used_for_second_factor:!1,verifications:[],verify_at_sign_up:!1},authenticator_app:{...sz,name:"authenticator_app"},backup_code:{...sz,name:"backup_code"},passkey:{...sz,name:"passkey"}}),(0,tu._)(this,"enterpriseSSO",{enabled:!1}),(0,tu._)(this,"passkeySettings",{allow_autofill:!1,show_sign_in_button:!1}),(0,tu._)(this,"passwordSettings",{}),(0,tu._)(this,"signIn",{second_factor:{required:!1,enabled:!1}}),(0,tu._)(this,"signUp",{allowlist_only:!1,captcha_enabled:!1,legal_consent_enabled:!1,mode:"public",progressive:!0}),(0,tu._)(this,"social",{}),(0,tu._)(this,"usernameSettings",{}),this.fromJSON(t)}}class sD extends nb{create(){return this._basePost({body:{web3_wallet:this.web3Wallet}})}destroy(){return this._baseDelete()}toString(){return this.web3Wallet}fromJSON(t){return t&&(this.id=t.id,this.web3Wallet=t.web3_wallet,this.verification=new rM(t.verification)),this}__internal_toSnapshot(){return{object:"web3_wallet",id:this.id,web3_wallet:this.web3Wallet,verification:this.verification.__internal_toSnapshot()}}constructor(t,e){super(),(0,tu._)(this,"id",void 0),(0,tu._)(this,"web3Wallet",""),(0,tu._)(this,"verification",void 0),(0,tu._)(this,"prepareVerification",t=>this._basePost({action:"prepare_verification",body:{...t}})),(0,tu._)(this,"attemptVerification",t=>{let{signature:e}=t;return this._basePost({action:"attempt_verification",body:{signature:e}})}),this.pathRoot=e,this.fromJSON(t)}}class sL extends nb{fromJSON(t){return t&&(this.id=t.id,this.updatedAt=nk(t.updated_at),this.createdAt=nk(t.created_at)),this}static async join(t){var e;return new sL(null==(e=await nb._fetch({path:"/waitlist",method:"POST",body:t}))?void 0:e.response)}constructor(t){super(),(0,tu._)(this,"pathRoot","/waitlist"),(0,tu._)(this,"id",""),(0,tu._)(this,"updatedAt",null),(0,tu._)(this,"createdAt",null),this.fromJSON(t)}}function sj(t,e){var i,n,r,s;return t.id!==e.id||t.updatedAt.getTime()<e.updatedAt.getTime()||(i=e,n=t,i.organizationMemberships.length!==n.organizationMemberships.length||(null==(r=i.organizationMemberships[0])?void 0:r.updatedAt)!==(null==(s=n.organizationMemberships[0])?void 0:s.updatedAt))}function sB(t,e){return!function(t,e){if(!t&&e||t&&!e)return!0;if(!t&&t===e)return!1;if(!t||!e)return!0;try{var i,n,r,s,a,o,l,c;if(rp.isClientResource(t))return t.id!==e.id||t.updatedAt.getTime()<e.updatedAt.getTime()||t.sessions.length!==e.sessions.length;if(sh.isSessionResource(t)){return t.id!==e.id||t.updatedAt.getTime()<e.updatedAt.getTime()||(null==(r=t.lastActiveToken)||null==(n=r.jwt)||null==(i=n.claims)?void 0:i.__raw)!==(null==(o=e.lastActiveToken)||null==(a=o.jwt)||null==(s=a.claims)?void 0:s.__raw)||function(t,e){var i,n,r,s,a,o;if(t.lastActiveOrganizationId!==e.lastActiveOrganizationId)return!0;let l=null==(n=t.user)||null==(i=n.organizationMemberships)?void 0:i.find(e=>e.organization.id===t.lastActiveOrganizationId),c=null==(s=e.user)||null==(r=s.organizationMemberships)?void 0:r.find(e=>e.organization.id===t.lastActiveOrganizationId);return(null==l||null==(a=l.permissions)?void 0:a.length)!==(null==c||null==(o=c.permissions)?void 0:o.length)}(t,e)||(l=t,c=e,!!l.user!=!!c.user||!!l.user&&!!c.user&&sj(l.user,c.user))}if(sM.isUserResource(t))return sj(t,e)}catch{}return!0}(t,e)?t:e}let sV="__clerk_db_jwt";function sJ(t,e){let i=new URL(t),n=i.searchParams.get(sV);i.searchParams.delete(sV);let r=n||e;return r&&i.searchParams.set(sV,r),i}let sK=t=>{let e=new URL(t);return e.searchParams.delete(sV),e},sq=t=>{let e=new URL(t);return e.searchParams.delete("__dev_session"),e.hash=decodeURI(e.hash).replace(/__clerk_db_jwt\[(.*)\]/,""),e.href.endsWith("#")&&(e.hash=""),e};function sH(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}var sG=function t(e,i){function n(t,n,r){if("undefined"!=typeof document){"number"==typeof(r=sH({},i,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in r)r[a]&&(s+="; "+a,!0!==r[a]&&(s+="="+r[a].split(";")[0]));return document.cookie=t+"="+e.write(n,t)+s}}return Object.create({set:n,get:function(t){if("undefined"!=typeof document&&(!arguments.length||t)){for(var i=document.cookie?document.cookie.split("; "):[],n={},r=0;r<i.length;r++){var s=i[r].split("="),a=s.slice(1).join("=");try{var o=decodeURIComponent(s[0]);if(n[o]=e.read(a,o),t===o)break}catch(t){}}return t?n[t]:n}},remove:function(t,e){n(t,"",sH({},e,{expires:-1}))},withAttributes:function(e){return t(this.converter,sH({},this.attributes,e))},withConverter:function(e){return t(sH({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(e)}})}({read:function(t){return'"'===t[0]&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function s$(t){return{get:()=>sG.get(t),set(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};sG.set(t,e,i)},remove(e){sG.remove(t,e)}}}let sY=t=>"https:"===window.location.protocol||"None"===t&&void 0===window.safari&&(void 0!==window.isSecureContext?window.isSecureContext:"localhost"===window.location.hostname);function sX(t,e){let i=function(t){try{return new Date(t||new Date)}catch{return new Date}}(t);return i.setFullYear(i.getFullYear()+e),i}let sQ=s$("__clerk_test_etld"),sZ="__client_uat",s0="__session",s1=()=>{let t=iF()?"None":"Lax",e=sY(t);return{sameSite:t,secure:e,partitioned:!1}};async function s2(t){let e;try{e=await t1(t)}catch(o){var i;i="Suffixed cookie failed due to ".concat(o.message," (secure-context: ").concat(window.isSecureContext,", url: ").concat(window.location.href,")"),t6.has(i)||(console.log(i),t6.add(i));let{default:n}=await Promise.all([s.e("545"),s.e("811")]).then(s.t.bind(s,180,23)),{default:r}=await Promise.all([s.e("545"),s.e("811")]).then(s.t.bind(s,3413,23)),a=n(t);e=r.stringify(a).replace(/\+/gi,"-").replace(/\//gi,"_").substring(0,8)}return e}let s3=()=>{let t=iF()?"None":"Lax",e=sY(t);return{sameSite:t,secure:e}};var s5=s(8326),s6=s.n(s5);class s4{startPollingForSessionToken(t){if(this.timerId||this.initiated)return;let e=async()=>{this.initiated=!0,await this.lock.acquireLockAndRun(t),this.timerId=this.workerTimers.setTimeout(e,5e3)};e()}stopPollingForSessionToken(){null!=this.timerId&&(this.workerTimers.clearTimeout(this.timerId),this.timerId=null),this.initiated=!1}constructor(){(0,tu._)(this,"lock",function(t){let e=new(s6());return window.addEventListener("beforeunload",async()=>{await e.releaseLock(t)}),{acquireLockAndRun:async i=>{if("locks"in navigator&&isSecureContext){let e=new AbortController,n=setTimeout(()=>e.abort(),4999);return await navigator.locks.request(t,{signal:e.signal},async()=>(clearTimeout(n),await i())).catch(()=>!1)}if(await e.acquireLock(t,5e3))try{return await i()}finally{await e.releaseLock(t)}}}}("clerk.lock.refreshSessionToken")),(0,tu._)(this,"workerTimers",rb()),(0,tu._)(this,"timerId",null),(0,tu._)(this,"initiated",!1)}}class s7{static async create(t,e,i,n){let r=await s2(t.publishableKey),s=new s7(t,e,r,i,n);return await s.setup(),s}async setup(){return"production"===this.instanceType?this.setupProduction():this.setupDevelopment()}isSignedOut(){return this.clerk.loaded?!!this.clerk.user:0>=this.clientUat.get()}async handleUnauthenticatedDevBrowser(){this.devBrowser.clear(),await this.devBrowser.setup()}decorateUrlWithDevBrowserToken(t){let e=this.devBrowser.getDevBrowserJWT();if(!e)throw Error("".concat(iL," Missing dev browser jwt. Please contact support."));return sJ(t,e)}async setupDevelopment(){await this.devBrowser.setup()}setupProduction(){this.devBrowser.clear()}startPollingForToken(){this.poller||(this.poller=new s4,this.poller.startPollingForSessionToken(()=>this.refreshSessionToken()))}stopPollingForToken(){this.poller&&(this.poller.stopPollingForSessionToken(),this.poller=null)}refreshTokenOnFocus(){window.addEventListener("focus",()=>{"visible"===document.visibilityState&&this.refreshSessionToken({updateCookieImmediately:!0})})}async refreshSessionToken(){let{updateCookieImmediately:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.clerk.session)try{let e=await this.clerk.session.getToken();t&&this.updateSessionCookie(e)}catch(t){return this.handleGetTokenError(t)}}updateSessionCookie(t){if(document.hasFocus()||this.isCurrentContextActive()){if(!t&&!t_()){var e;ib.warn("Removing session cookie (offline)",{sessionId:null==(e=this.clerk.session)?void 0:e.id},"authCookieService")}return this.setActiveContextInStorage(),t?this.sessionCookie.set(t):this.sessionCookie.remove()}}setClientUatCookieForDevelopmentInstances(){"production"!==this.instanceType&&this.inCustomDevelopmentDomain()&&this.clientUat.set(this.clerk.client)}inCustomDevelopmentDomain(){let t=this.clerk.frontendApi.replace("clerk.","");return!window.location.host.endsWith(t)}handleGetTokenError(t){if(tN(t)||tW(t)||("".concat(t.message).concat(t.name)||"").toLowerCase().replace(/\s+/g,"").includes("networkerror")){if(tM(t))return void this.clerk.handleUnauthenticated().catch(ip.lQ);this.clerkEventBus.emit(tw,"degraded")}}handleSignOut(){this.activeCookie.remove(),this.sessionCookie.remove(),this.setClientUatCookieForDevelopmentInstances()}setActiveContextInStorage(){var t,e;let i=(null==(t=this.clerk.session)?void 0:t.id)||"",n=(null==(e=this.clerk.organization)?void 0:e.id)||"",r="".concat(i,":").concat(n);":"!==r?this.activeCookie.set(r):this.activeCookie.remove()}isCurrentContextActive(){var t,e;let i=this.activeCookie.get();if(!i)return!0;let[n,r]=i.split(":"),s=(null==(t=this.clerk.session)?void 0:t.id)||"",a=(null==(e=this.clerk.organization)?void 0:e.id)||"";return n===s&&r===a}getSessionCookie(){return this.sessionCookie.get()}constructor(t,e,n,r,s){(0,tu._)(this,"clerk",void 0),(0,tu._)(this,"instanceType",void 0),(0,tu._)(this,"clerkEventBus",void 0),(0,tu._)(this,"poller",void 0),(0,tu._)(this,"clientUat",void 0),(0,tu._)(this,"sessionCookie",void 0),(0,tu._)(this,"activeCookie",void 0),(0,tu._)(this,"devBrowser",void 0),this.clerk=t,this.instanceType=r,this.clerkEventBus=s,this.poller=null,rJ.on(rL,t=>{let{token:e}=t;this.updateSessionCookie(e&&e.getRawString()),this.setClientUatCookieForDevelopmentInstances()}),rJ.on(rj,()=>this.handleSignOut()),this.refreshTokenOnFocus(),this.startPollingForToken(),this.clientUat=(t=>{let e=s$(sZ),n=s$(t2(sZ,t));return{set:t=>{let r=sX(Date.now(),1),s=iF()?"None":"Strict",a=sY(s),o=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.hostname,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sQ;if(i)return i;if(["localhost","127.0.0.1","0.0.0.0"].includes(t))return t;let n=t.split(".");if(1===n.length)return t;for(let t=n.length-2;t>=0;t--){let r=n.slice(t).join(".");if(e.set("1",{domain:r}),"1"===e.get())return e.remove({domain:r}),i=r,r;e.remove({domain:r})}}(),l="0";t&&t.updatedAt&&t.signedInSessions.length>0&&(l=Math.floor(t.updatedAt.getTime()/1e3).toString()),n.remove(),e.remove(),n.set(l,{domain:o,expires:r,partitioned:!1,sameSite:s,secure:a}),e.set(l,{domain:o,expires:r,partitioned:!1,sameSite:s,secure:a})},get:()=>parseInt(n.get()||e.get()||"0",10)}})(n),this.sessionCookie=(t=>{let e=s$(s0),i=s$(t2(s0,t)),n=()=>{let t=s1();e.remove(t),i.remove(t)};return{set:t=>{let r=sX(Date.now(),1),{sameSite:s,secure:a,partitioned:o}=s1();o&&n(),e.set(t,{expires:r,sameSite:s,secure:a,partitioned:o}),i.set(t,{expires:r,sameSite:s,secure:a,partitioned:o})},remove:n,get:()=>i.get()||e.get()}})(n),this.activeCookie=(()=>{let t=s$("clerk_active_context"),e={secure:sY("None")};return{set:i=>{t.set(i,e)},get:()=>t.get(),remove:()=>t.remove(e)}})(),this.devBrowser=function(t){let e,i,{cookieSuffix:n,frontendApi:r,fapiClient:s}=t,a=(e=s$(sV),i=s$(t2(sV,n)),{get:()=>i.get()||e.get(),set:t=>{let n=sX(Date.now(),1),{sameSite:r,secure:s}=s3();i.set(t,{expires:n,sameSite:r,secure:s}),e.set(t,{expires:n,sameSite:r,secure:s})},remove:()=>{let t=s3();i.remove(t),e.remove(t)}});function o(){return a.get()}function l(t){a.set(t)}function c(){a.remove()}return{clear:function(){c()},setup:async function(){var t;let e;if(!ec(r))return;s.onBeforeRequest(t=>{let e=o();e&&(null==t?void 0:t.url)&&(t.url=sJ(t.url,e))}),s.onAfterResponse((t,e)=>{var i;let n=null==e||null==(i=e.headers)?void 0:i.get("Clerk-Db-Jwt");n&&l(n)});let i=(e=(t=new URL(window.location.href)).searchParams.get(sV)||"",sK(sq(t)).href!==t.href&&void 0!==globalThis.history&&globalThis.history.replaceState(null,"",sK(sq(t))),e);if(i)return void l(i);if(a.get())return;let n=s.buildUrl({path:"/dev_browser"}),c=await fetch(n.toString(),{method:"POST"});if(!c.ok){let t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.length>0?t.map(t=>new tS(t)):[]}((await c.json()).errors);t[0]?ij(t[0].longMessage):ij()}let u=await c.json();l(null==u?void 0:u.id)},getDevBrowserJWT:o,setDevBrowserJWT:l,removeDevBrowserJWT:c}}({frontendApi:t.frontendApi,fapiClient:e,cookieSuffix:n})}}class s8{async start(){this.isEnabled()&&(await this.challengeAndSend(),this.timers.setInterval(()=>{this.challengeAndSend()},this.intervalInMs()))}async challengeAndSend(){if(!(!this.clerk.client||this.clientBypass()))try{let t=await this.captchaChallenge.invisible({action:"heartbeat"});await this.clerk.client.__internal_sendCaptchaToken(t)}catch{}}isEnabled(){var t,e;return!!(null==(e=this.clerk.__internal_environment)||null==(t=e.displayConfig)?void 0:t.captchaHeartbeat)}clientBypass(){var t;return null==(t=this.clerk.client)?void 0:t.captchaBypass}intervalInMs(){var t,e,i;return null!=(i=null==(e=this.clerk.__internal_environment)||null==(t=e.displayConfig)?void 0:t.captchaHeartbeatIntervalMs)?i:6e5}constructor(t,e=new ny(t),i=rb()){(0,tu._)(this,"clerk",void 0),(0,tu._)(this,"captchaChallenge",void 0),(0,tu._)(this,"timers",void 0),this.clerk=t,this.captchaChallenge=e,this.timers=i}}let s9=["/client","/waitlist"];class at{async getBaseFapiProxyOptions(){var t;let e=await (null==(t=nb.clerk.session)?void 0:t.getToken());if(!e)throw new tC("No valid session token available",{code:"no_session_token"});return{pathPrefix:"",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},credentials:"same-origin"}}async getAll(t){var e,i,n,r,s,a;return nb._fetch({...await this.getBaseFapiProxyOptions(),method:"GET",path:"/api_keys",search:nH({...t,subject:null!=(s=null!=(r=null!=(n=null==t?void 0:t.subject)?n:null==(e=nb.clerk.organization)?void 0:e.id)?r:null==(i=nb.clerk.user)?void 0:i.id)?s:"",query:null!=(a=null==t?void 0:t.query)?a:""})}).then(t=>{let{data:e,total_count:i}=t;return{total_count:i,data:e.map(t=>new nS(t))}})}async create(t){var e,i,n,r,s;return new nS(await nb._fetch({...await this.getBaseFapiProxyOptions(),path:"/api_keys",method:"POST",body:JSON.stringify({type:"api_key",name:t.name,subject:null!=(s=null!=(r=null!=(n=t.subject)?n:null==(e=nb.clerk.organization)?void 0:e.id)?r:null==(i=nb.clerk.user)?void 0:i.id)?s:"",description:t.description,seconds_until_expiration:t.secondsUntilExpiration})}))}async revoke(t){return new nS(await nb._fetch({...await this.getBaseFapiProxyOptions(),method:"POST",path:"/api_keys/".concat(t.apiKeyID,"/revoke"),body:JSON.stringify({revocation_reason:t.revocationReason})}))}}let ae=new Map;var ai=new WeakMap;class an{load(t){let e=null==t?void 0:t.protectConfig;if(!(!(null==e?void 0:e.loaders)||!Array.isArray(e.loaders)||0===e.loaders.length||o(this,ai))){if(th())for(let t of(u(this,ai,!0),e.loaders))try{this.applyLoader(t)}catch(t){t4("[protect] failed to apply loader: ".concat(t))}}}applyLoader(t){if(void 0!==t.rollout){let e=t.rollout;if("number"!=typeof e||e<0)return void t4("[protect] loader rollout value is invalid: ".concat(e));if(0===e||Math.random()>e)return}let e=t.type||"script",i=t.target||"body",n=document.createElement(e);if(t.attributes)for(let[e,i]of Object.entries(t.attributes))switch(typeof i){case"string":case"number":case"boolean":n.setAttribute(e,String(i));break;default:t4("[protect] loader attribute is invalid type: ".concat(e,"=").concat(i))}switch(t.textContent&&"string"==typeof t.textContent&&(n.textContent=t.textContent),i){case"head":document.head.appendChild(n);break;case"body":document.body.appendChild(n);break;default:if(null==i?void 0:i.startsWith("#")){let t=document.getElementById(i.substring(1));if(!t)return void t4("[protect] loader target element not found: ".concat(i));t.appendChild(n);return}t4("[protect] loader target is invalid: ".concat(i))}}constructor(){c(this,ai,{writable:!0,value:!1})}}class ar{constructor(){(0,tu._)(this,"signInResourceSignal",nY),(0,tu._)(this,"signInErrorSignal",nX),(0,tu._)(this,"signInFetchSignal",nQ),(0,tu._)(this,"signInSignal",nZ),(0,tu._)(this,"signUpResourceSignal",n0),(0,tu._)(this,"signUpErrorSignal",n1),(0,tu._)(this,"signUpFetchSignal",n2),(0,tu._)(this,"signUpSignal",n3),(0,tu._)(this,"__internal_effect",nD),(0,tu._)(this,"__internal_computed",nF),(0,tu._)(this,"onResourceError",t=>{t.resource instanceof sb&&this.signInErrorSignal({error:t.error}),t.resource instanceof sx&&this.signUpErrorSignal({error:t.error})}),(0,tu._)(this,"onResourceUpdated",t=>{if(t.resource instanceof sb){if(as(this.signInResourceSignal().resource,t.resource))return;this.signInResourceSignal({resource:t.resource})}if(t.resource instanceof sx){if(as(this.signUpResourceSignal().resource,t.resource))return;this.signUpResourceSignal({resource:t.resource})}}),(0,tu._)(this,"onResourceFetch",t=>{t.resource instanceof sb&&this.signInFetchSignal({status:t.status}),t.resource instanceof sx&&this.signUpFetchSignal({status:t.status})}),rJ.on("resource:update",this.onResourceUpdated),rJ.on("resource:error",this.onResourceError),rJ.on("resource:fetch",this.onResourceFetch)}}function as(t,e){var i;return!(null==e?void 0:e.id)&&t&&(null==(i=t.__internal_future)?void 0:i.hasBeenFinalized)===!1}let aa="cannot_render_billing_disabled",ao="cannot_render_user_missing",al="cannot_render_organizations_disabled",ac="cannot_render_organization_missing",au="cannot_render_single_session_enabled",ah={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,newSubscriptionRedirectUrl:void 0};var ad=new WeakMap,af=new WeakMap,ap=new WeakMap,a_=new WeakMap,ag=new WeakMap,av=new WeakMap,am=new WeakMap,ay=new WeakMap,aw=new WeakMap,ab=new WeakMap,ak=new WeakMap,aS=new WeakMap,aA=new WeakMap,aI=new WeakMap,ax=new WeakMap,aU=new WeakMap,aE=new WeakMap,aP=new WeakMap,aC=new WeakSet,aO=new WeakMap,aT=new WeakMap,aR=new WeakMap,aM=new WeakMap,aN=new WeakMap,aW=new WeakMap,az=new WeakMap,aF=new WeakMap,aD=new WeakMap,aL=new WeakMap,aj=new WeakMap,aB=new WeakMap,aV=new WeakMap,aJ=new WeakMap,aK=new WeakMap,aq=new WeakMap,aH=new WeakMap,aG=new WeakMap,a$=new WeakMap,aY=new WeakMap,aX=new WeakMap,aQ=new WeakMap,aZ=new WeakMap,a0=new WeakMap,a1=new WeakMap,a2=new WeakMap;class a3{get __internal_queryClient(){return o(this,ad)||Promise.all([s.e("662"),s.e("527")]).then(s.bind(s,250)).then(t=>t.QueryClient).then(t=>{o(this,ad)||(u(this,ad,new t),o(this,aP).emit("queryClientStatus","ready"))}),o(this,ad)?{__tag:"clerk-rq-client",client:o(this,ad)}:void 0}get publishableKey(){return o(this,af)}get version(){return a3.version}set sdkMetadata(t){a3.sdkMetadata=t}get sdkMetadata(){return a3.sdkMetadata}get loaded(){return"degraded"===this.status||"ready"===this.status}get status(){return o(this,aS)}get isSatellite(){return!!iz()&&(0,ip.VK)(o(this,ax).isSatellite,new URL(window.location.href),!1)}get domain(){if(iz()){let t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(t||"").replace(/^.+:\/\//,"")}((0,ip.VK)(o(this,ap),new URL(window.location.href)));if("production"===o(this,ak)){let e;if(!t)return"";if(t.match(/^(clerk\.)+\w*$/))e=/(clerk\.)*(?=clerk\.)/;else{if(t.match(/\.clerk.accounts/))return t;e=/^(clerk\.)*/gi}return"clerk.".concat(t.replace(e,""))}return t}return""}get proxyUrl(){if(iz()){let t=(0,ip.VK)(o(this,a_),new URL(window.location.href));return!t||eK(t)||eq(t)||iM.throwInvalidProxyUrl({url:t}),t?eq(t)?new URL(t,window.location.origin).toString():t:""}return""}get frontendApi(){let t=tZ(this.publishableKey);return t?t.frontendApi:iM.throwInvalidPublishableKeyError({key:this.publishableKey})}get instanceType(){return o(this,ak)}get isStandardBrowser(){return o(this,ax).standardBrowser||!1}get billing(){return a3._billing||(a3._billing=new nG),a3._billing}get apiKeys(){return a3._apiKeys||(a3._apiKeys=new at),a3._apiKeys}__experimental_checkout(t){return this._checkout||(this._checkout=t=>(function(t,e){var i,n,r;let s,a,o,l,{for:c,planId:u,planPeriod:h}=e;if(null===t.user)throw Error("Clerk: User is not authenticated");if("organization"===c&&null===t.organization)throw Error("Clerk: The current session does not have an active organization. Use `setActive` to set the organization");let d=function(t){let{userId:e,orgId:i,planId:n,planPeriod:r}=t;return"".concat(e,"-").concat(i||"user","-").concat(n,"-").concat(r)}({userId:(null==(i=t.user)?void 0:i.id)||"",orgId:"organization"===c?null==(n=t.organization)?void 0:n.id:void 0,planId:u,planPeriod:h}),f=ae.get(d);if(f)return f.signals.computedSignal();let p=(s=nz({resource:null}),a=nz({error:null}),o=nz({status:"idle"}),l=nF(()=>{let t=s().resource,e=a().error,i=o().status;return{errors:n5(e,{}),fetchStatus:i,checkout:t}}),{resourceSignal:s,errorSignal:a,fetchSignal:o,computedSignal:l}),_=new n7(p,{..."organization"===c?{orgId:null==(r=t.organization)?void 0:r.id}:{},planId:u,planPeriod:h});return ae.set(d,{resource:_,signals:p}),p.computedSignal()})(this,t)),this._checkout(t)}__internal_getOption(t){return o(this,ax)[t]}get isSignedIn(){var t;return(null===this||void 0===this||null==(t=this.session)?void 0:t.status)!=="pending"&&!!this.session}buildUrlWithAuth(t){if("production"===o(this,ak))return t;let e=new URL(t,window.location.origin);return e.origin!==window.location.origin&&o(this,ag)?o(this,ag).decorateUrlWithDevBrowserToken(e).href:e.href}buildSignInUrl(t){return o(this,aQ).call(this,"signInUrl",{...t,redirectUrl:(null==t?void 0:t.redirectUrl)||window.location.href},null==t?void 0:t.initialValues)}buildSignUpUrl(t){return o(this,aQ).call(this,"signUpUrl",{...t,redirectUrl:(null==t?void 0:t.redirectUrl)||window.location.href},null==t?void 0:t.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(){let{params:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buildUrlWithAuth(new eA(o(this,ax),{},t).getAfterSignInUrl())}buildAfterSignUpUrl(){let{params:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buildUrlWithAuth(new eA(o(this,ax),{},t).getAfterSignUpUrl())}buildAfterSignOutUrl(){return o(this,ax).afterSignOutUrl?this.buildUrlWithAuth(o(this,ax).afterSignOutUrl):"/"}buildNewSubscriptionRedirectUrl(){return o(this,ax).newSubscriptionRedirectUrl?o(this,ax).newSubscriptionRedirectUrl:this.buildAfterSignInUrl()}buildWaitlistUrl(t){return this.environment&&this.environment.displayConfig?ed({base:o(this,ax).waitlistUrl||this.environment.displayConfig.waitlistUrl,hashSearchParams:[new URLSearchParams((null==t?void 0:t.initialValues)||{})]},{stringify:!0}):""}buildAfterMultiSessionSingleSignOutUrl(){return this.environment?o(this,ax).afterMultiSessionSingleSignOutUrl?this.buildUrlWithAuth(o(this,ax).afterMultiSessionSingleSignOutUrl):o(this,ax).signInUrl?this.buildUrlWithAuth(ed({base:o(this,ax).signInUrl,hashPath:"choose"},{stringify:!0})):this.buildUrlWithAuth(this.environment.displayConfig.afterSignOutOneUrl):""}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):""}buildTasksUrl(t){var e,i;let n=null==(e=this.session)?void 0:e.currentTask;if(!n)return"";let r=null==(i=o(this,ax).taskUrls)?void 0:i[n.key];return r||ed({base:this.buildSignInUrl(t),hashPath:eF(n)},{stringify:!0})}updateEnvironment(t){this.environment=t}get __internal_last_error(){let t=this.internal_last_error;return this.internal_last_error=null,t}set __internal_last_error(t){this.internal_last_error=t}get __internal_environment(){return this.environment}__internal_navigateWithError(t,e){return this.__internal_last_error=e,this.navigate(t)}assertComponentsReady(t){if(!t)throw Error("Clerk was not loaded with Ui components")}constructor(t,e){var i=this;if(d(this,aC),c(this,a2,{get:a6,set:void 0}),(0,tu._)(this,"_checkout",void 0),(0,tu._)(this,"client",void 0),(0,tu._)(this,"session",void 0),(0,tu._)(this,"organization",void 0),(0,tu._)(this,"user",void 0),(0,tu._)(this,"__internal_country",void 0),(0,tu._)(this,"telemetry",void 0),(0,tu._)(this,"__internal_state",new ar),(0,tu._)(this,"internal_last_error",null),(0,tu._)(this,"environment",void 0),c(this,ad,{writable:!0,value:void 0}),c(this,af,{writable:!0,value:""}),c(this,ap,{writable:!0,value:void 0}),c(this,a_,{writable:!0,value:void 0}),c(this,ag,{writable:!0,value:void 0}),c(this,av,{writable:!0,value:void 0}),c(this,am,{writable:!0,value:void 0}),c(this,ay,{writable:!0,value:null}),c(this,aw,{writable:!0,value:void 0}),c(this,ab,{writable:!0,value:void 0}),c(this,ak,{writable:!0,value:void 0}),c(this,aS,{writable:!0,value:"loading"}),c(this,aA,{writable:!0,value:[]}),c(this,aI,{writable:!0,value:[]}),c(this,ax,{writable:!0,value:{}}),c(this,aU,{writable:!0,value:null}),c(this,aE,{writable:!0,value:0}),c(this,aP,{writable:!0,value:ty()}),(0,tu._)(this,"__internal_getCachedResources",void 0),(0,tu._)(this,"__internal_createPublicCredentials",void 0),(0,tu._)(this,"__internal_getPublicCredentials",void 0),(0,tu._)(this,"__internal_isWebAuthnSupported",void 0),(0,tu._)(this,"__internal_isWebAuthnAutofillSupported",void 0),(0,tu._)(this,"__internal_isWebAuthnPlatformAuthenticatorSupported",void 0),(0,tu._)(this,"__internal_setActiveInProgress",!1),(0,tu._)(this,"getFapiClient",()=>o(this,ab)),(0,tu._)(this,"load",async t=>{if(ib.info("load() start",{},"clerk"),!this.loaded){if("development"!==o(this,ak)||(null==t?void 0:t.unsafe_disableDevelopmentModeConsoleWarning)||t4("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"),u(this,ax,o(this,a0).call(this,t)),o(this,ax).clerkUiCtor&&u(this,aw,Promise.resolve(o(this,ax).clerkUiCtor).then(t=>new t(()=>this,()=>this.environment,o(this,ax),new iE))),"development"===o(this,ak)&&(o(this,ax).routerPush||o(this,ax).routerReplace)&&(!o(this,ax).routerPush||!o(this,ax).routerReplace)){let t=o(this,ax).routerPush?"routerReplace":"routerPush";t4("Clerk: Both `routerPush` and `routerReplace` need to be defined, but `".concat(t,"` is not defined. This may cause issues with navigation in your application."))}rJ.on(rV,()=>{o(this,aG).call(this,this.session),o(this,aJ).call(this)}),o(this,ax).sdkMetadata&&(a3.sdkMetadata=o(this,ax).sdkMetadata),!1!==o(this,ax).telemetry&&(this.telemetry=new e5({clerkVersion:a3.version,samplingRate:1,perEventSampling:!o(this,ax).__internal_keyless_claimKeylessApplicationUrl&&void 0,publishableKey:this.publishableKey,...o(this,ax).telemetry}),o(this,ax).appearance&&this.telemetry.record({event:"THEME_USAGE",eventSamplingRate:1,payload:function(t){let e;if(!t||"object"!=typeof t)return{};let i=t.theme;if(!i)return{};if(Array.isArray(i))for(let t of i){let i=it(t);if(i){e=i;break}}else e=it(i);return{themeName:e}}(o(this,ax).appearance)}));try{var e,i,n,r,s;o(this,ax).standardBrowser?await o(this,aD).call(this):await o(this,aL).call(this);let t=o(this,ax).telemetry,a=!1!==t&&!(null==t?void 0:t.disabled),l=!!o(this,ax).__internal_keyless_claimKeylessApplicationUrl,c=!!(null==(e=this.environment)?void 0:e.clientDebugMode),u=null!=(s=null==(n=this.environment)||null==(i=n.isProduction)?void 0:i.call(n))&&s,h=c||l&&!u,d=l&&!c?"error":void 0;h&&function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(iv)return;let{enabled:e=!1,...i}=t;e&&(i_=!0,iv=!0,iw(i))}({enabled:!0,...d?{logLevel:d}:{},...a&&this.telemetry?{telemetryCollector:this.telemetry}:{}}),null==(r=o(this,av))||r.load(this.environment),ib.info("load() complete",{},"clerk")}catch(t){throw o(this,aP).emit(tw,"error"),ib.error("load() failed",{error:t},"clerk"),t}}}),(0,tu._)(this,"signOut",async(t,e)=>{var i,n,r,s,a,l;if(!this.client||0===this.client.sessions.length)return;let c="undefined"!=typeof window&&"function"==typeof window.__internal_onBeforeSetActive?window.__internal_onBeforeSetActive:ip.lQ,u="undefined"!=typeof window&&"function"==typeof window.__internal_onAfterSetActive?window.__internal_onAfterSetActive:ip.lQ,h=t&&"object"==typeof t?t:e||{},d=(null==h?void 0:h.redirectUrl)||this.buildAfterSignOutUrl();ib.debug("signOut() start",{hasClient:!!this.client,multiSessionCount:null!=(r=null==(i=this.client)?void 0:i.signedInSessions.length)?r:0,redirectUrl:d,sessionTarget:null!=(s=null==h?void 0:h.sessionId)?s:null},"clerk");let f="function"==typeof t?t:void 0,p=async()=>{let t=iP(o(this,ax).standardBrowser);rJ.emit(rj,null),o(this,aq).call(this),await t.track(async()=>{f?await f():await this.navigate(d)}),t.isUnloading()||(o(this,aG).call(this),o(this,aJ).call(this),await u())};if(await c(),!h.sessionId||1===this.client.signedInSessions.length){null==(l=null==(a=o(this,ax).experimental)?void 0:a.persistClient)||l?await this.client.removeSessions():await this.client.destroy(),await p(),ib.info("signOut() complete",{redirectUrl:ef(d)},"clerk");return}let _=this.client.signedInSessions.find(t=>t.id===h.sessionId),g=(null==_?void 0:_.id)&&(null==(n=this.session)?void 0:n.id)===_.id;await (null==_?void 0:_.remove()),g&&(await p(),ib.info("signOut() complete",{redirectUrl:ef(d)},"clerk"))}),(0,tu._)(this,"openGoogleOneTap",t=>{var e;this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openModal("googleOneTap",t||{})),null==(e=this.telemetry)||e.record(e9("GoogleOneTap",t))}),(0,tu._)(this,"closeGoogleOneTap",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("googleOneTap"))}),(0,tu._)(this,"openSignIn",t=>{var e,i;if(tF(this,this.environment)){if("development"===o(this,ak))throw new tC(ej.cannotOpenSignInOrSignUp,{code:au});return}this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openModal("signIn",t||{}));let n={withSignUp:null!=(i=null==t?void 0:t.withSignUp)?i:h(this,aC,a5).call(this)};null==(e=this.telemetry)||e.record(e9("SignIn",t,n))}),(0,tu._)(this,"closeSignIn",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("signIn"))}),(0,tu._)(this,"__internal_openCheckout",t=>{if(tD(this,this.environment)){if("development"===o(this,ak))throw new tC(ej.cannotRenderAnyBillingComponent("Checkout"),{code:aa});return}if(!this.user){if("development"===o(this,ak))throw new tC(ej.cannotOpenCheckout,{code:ao});return}this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openDrawer("checkout",t||{}))}),(0,tu._)(this,"__internal_closeCheckout",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeDrawer("checkout"))}),(0,tu._)(this,"__internal_openPlanDetails",t=>{var e;if(tD(this,this.environment)){if("development"===o(this,ak))throw new tC(ej.cannotRenderAnyBillingComponent("PlanDetails"),{code:aa});return}this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openDrawer("planDetails",t||{})),null==(e=this.telemetry)||e.record(e9("PlanDetails",t))}),(0,tu._)(this,"__internal_closePlanDetails",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeDrawer("planDetails"))}),(0,tu._)(this,"__internal_openSubscriptionDetails",t=>{this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openDrawer("subscriptionDetails",t||{}))}),(0,tu._)(this,"__internal_closeSubscriptionDetails",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeDrawer("subscriptionDetails"))}),(0,tu._)(this,"__internal_openReverification",t=>{var e;if(!this.user){if("development"===o(this,ak))throw new tC(ej.cannotOpenUserProfile,{code:ao});return}this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openModal("userVerification",t||{})),null==(e=this.telemetry)||e.record(e9("UserVerification",t))}),(0,tu._)(this,"__internal_closeReverification",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("userVerification"))}),(0,tu._)(this,"__internal_attemptToEnableEnvironmentSetting",t=>{let{for:e,caller:i}=t;if(this.user||"development"!==o(this,ak)||t4('Clerk: "'.concat(i,'" requires an active user session. Ensure a user is signed in before executing ').concat(i,".")),"organizations"===e){var n,r;let e;return(null==(e=this.environment)?void 0:e.organizationSettings.enabled)||(null==(r=this.session)||null==(n=r.currentTask)?void 0:n.key)==="choose-organization"?{isEnabled:!0}:("development"===o(this,ak)&&this.__internal_openEnableOrganizationsPrompt({caller:i,onSuccess:()=>window.location.reload(),onClose:t.onClose}),{isEnabled:!1})}throw Error('Attempted to enable an unknown or unsupported setting "'.concat(e,'".'))}),(0,tu._)(this,"__internal_openEnableOrganizationsPrompt",t=>{var e;this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted({preloadHint:"EnableOrganizationsPrompt"})).then(e=>e.openModal("enableOrganizationsPrompt",t||{})),null==(e=this.telemetry)||e.record(e8("EnableOrganizationsPrompt",t))}),(0,tu._)(this,"__internal_closeEnableOrganizationsPrompt",()=>{var t;this.assertComponentsReady(o(this,aw)),null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("enableOrganizationsPrompt"))}),(0,tu._)(this,"__internal_openBlankCaptchaModal",()=>(this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(t=>t.openModal("blankCaptcha",{})))),(0,tu._)(this,"__internal_closeBlankCaptchaModal",()=>(this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(t=>t.closeModal("blankCaptcha")))),(0,tu._)(this,"__internal_loadStripeJs",async()=>{let{loadStripe:t}=await s.e("279").then(s.bind(s,5608));return t}),(0,tu._)(this,"openSignUp",t=>{var e;if(tF(this,this.environment)){if("development"===o(this,ak))throw new tC(ej.cannotOpenSignInOrSignUp,{code:au});return}this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openModal("signUp",t||{})),null==(e=this.telemetry)||e.record(e9("SignUp",t))}),(0,tu._)(this,"closeSignUp",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("signUp"))}),(0,tu._)(this,"openUserProfile",t=>{var e,i;if(!this.user){if("development"===o(this,ak))throw new tC(ej.cannotOpenUserProfile,{code:ao});return}this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openModal("userProfile",t||{}));let n=((null==t||null==(e=t.customPages)?void 0:e.length)||0)>0?{customPages:!0}:void 0;null==(i=this.telemetry)||i.record(e9("UserProfile",t,n))}),(0,tu._)(this,"closeUserProfile",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("userProfile"))}),(0,tu._)(this,"openOrganizationProfile",t=>{var e;let{isEnabled:i}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"OrganizationProfile",onClose:()=>{throw new tC(ej.cannotRenderAnyOrganizationComponent("OrganizationProfile"),{code:al})}});if(i){if(!this.organization){if("development"===o(this,ak))throw new tC(ej.cannotRenderComponentWhenOrgDoesNotExist,{code:ac});return}this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openModal("organizationProfile",t||{})),null==(e=this.telemetry)||e.record(e9("OrganizationProfile",t))}}),(0,tu._)(this,"closeOrganizationProfile",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("organizationProfile"))}),(0,tu._)(this,"openCreateOrganization",t=>{var e;let{isEnabled:i}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"CreateOrganization",onClose:()=>{throw new tC(ej.cannotRenderAnyOrganizationComponent("CreateOrganization"),{code:al})}});i&&(this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openModal("createOrganization",t||{})),null==(e=this.telemetry)||e.record(e9("CreateOrganization",t)))}),(0,tu._)(this,"closeCreateOrganization",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("createOrganization"))}),(0,tu._)(this,"openWaitlist",t=>{var e;this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(e=>e.openModal("waitlist",t||{})),null==(e=this.telemetry)||e.record(e9("Waitlist",t))}),(0,tu._)(this,"closeWaitlist",()=>{var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>t.closeModal("waitlist"))}),(0,tu._)(this,"mountSignIn",(t,e)=>{var i,n;this.assertComponentsReady(o(this,aw));let r="SignIn";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"signIn",node:t,props:e}));let s={withSignUp:null!=(n=null==e?void 0:e.withSignUp)?n:h(this,aC,a5).call(this)};null==(i=this.telemetry)||i.record(e8(r,e,s))}),(0,tu._)(this,"unmountSignIn",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountUserAvatar",(t,e)=>{var i;this.assertComponentsReady(o(this,aw));let n="UserAvatar";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:n,appearanceKey:"userAvatar",node:t,props:e})),null==(i=this.telemetry)||i.record(e8(n,e))}),(0,tu._)(this,"unmountUserAvatar",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountSignUp",(t,e)=>{var i;this.assertComponentsReady(o(this,aw));let n="SignUp";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:n,appearanceKey:"signUp",node:t,props:e})),null==(i=this.telemetry)||i.record(e8(n,e))}),(0,tu._)(this,"unmountSignUp",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountUserProfile",(t,e)=>{var i,n;if(!this.user){if("development"===o(this,ak))throw new tC(ej.cannotRenderComponentWhenUserDoesNotExist,{code:ao});return}this.assertComponentsReady(o(this,aw));let r="UserProfile";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"userProfile",node:t,props:e}));let s=((null==e||null==(i=e.customPages)?void 0:i.length)||0)>0?{customPages:!0}:void 0;null==(n=this.telemetry)||n.record(e8(r,e,s))}),(0,tu._)(this,"unmountUserProfile",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountOrganizationProfile",(t,e)=>{var i;let{isEnabled:n}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"OrganizationProfile",onClose:()=>{throw new tC(ej.cannotRenderAnyOrganizationComponent("OrganizationProfile"),{code:al})}});if(!n)return;let r=!!this.user;if(!this.organization&&r){if("development"===o(this,ak))throw new tC(ej.cannotRenderComponentWhenOrgDoesNotExist,{code:ac});return}this.assertComponentsReady(o(this,aw));let s="OrganizationProfile";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:s,appearanceKey:"userProfile",node:t,props:e})),null==(i=this.telemetry)||i.record(e8(s,e))}),(0,tu._)(this,"unmountOrganizationProfile",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountCreateOrganization",(t,e)=>{var i;let{isEnabled:n}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"CreateOrganization",onClose:()=>{throw new tC(ej.cannotRenderAnyOrganizationComponent("CreateOrganization"),{code:al})}});if(!n)return;this.assertComponentsReady(o(this,aw));let r="CreateOrganization";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"createOrganization",node:t,props:e})),null==(i=this.telemetry)||i.record(e8(r,e))}),(0,tu._)(this,"unmountCreateOrganization",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountOrganizationSwitcher",(t,e)=>{var i,n;let{isEnabled:r}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"OrganizationSwitcher",onClose:()=>{throw new tC(ej.cannotRenderAnyOrganizationComponent("OrganizationSwitcher"),{code:al})}});if(!r)return;this.assertComponentsReady(o(this,aw));let s="OrganizationSwitcher";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:s,appearanceKey:"organizationSwitcher",node:t,props:e})),null==(n=this.telemetry)||n.record(e8(s,{...e,forceOrganizationSelection:null==(i=this.environment)?void 0:i.organizationSettings.forceOrganizationSelection}))}),(0,tu._)(this,"unmountOrganizationSwitcher",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"__experimental_prefetchOrganizationSwitcher",()=>{this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(t=>t.prefetch("organizationSwitcher"))}),(0,tu._)(this,"mountOrganizationList",(t,e)=>{var i,n;let{isEnabled:r}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"OrganizationList",onClose:()=>{throw new tC(ej.cannotRenderAnyOrganizationComponent("OrganizationList"),{code:al})}});if(!r)return;this.assertComponentsReady(o(this,aw));let s="OrganizationList";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:s,appearanceKey:"organizationList",node:t,props:e})),null==(n=this.telemetry)||n.record(e8(s,{...e,forceOrganizationSelection:null==(i=this.environment)?void 0:i.organizationSettings.forceOrganizationSelection}))}),(0,tu._)(this,"unmountOrganizationList",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountUserButton",(t,e)=>{var i,n;this.assertComponentsReady(o(this,aw));let r="UserButton";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"userButton",node:t,props:e}));let s={...(null==e||null==(i=e.customMenuItems)?void 0:i.length)||0?{customItems:!0}:void 0,...(null==e?void 0:e.__experimental_asStandalone)?{standalone:!0}:void 0};null==(n=this.telemetry)||n.record(e8(r,e,s))}),(0,tu._)(this,"unmountUserButton",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountWaitlist",(t,e)=>{var i;this.assertComponentsReady(o(this,aw));let n="Waitlist";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:n,appearanceKey:"waitlist",node:t,props:e})),null==(i=this.telemetry)||i.record(e8(n,e))}),(0,tu._)(this,"unmountWaitlist",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountPricingTable",(t,e)=>{var i;if(tD(this,this.environment)){if("development"===o(this,ak))throw new tC(ej.cannotRenderAnyBillingComponent("PricingTable"),{code:aa});return}this.assertComponentsReady(o(this,aw));let n="PricingTable";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:n,appearanceKey:"pricingTable",node:t,props:e})),null==(i=this.telemetry)||i.record(e8(n,e))}),(0,tu._)(this,"unmountPricingTable",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"__internal_mountOAuthConsent",(t,e)=>{this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:"OAuthConsent",appearanceKey:"__internal_oauthConsent",node:t,props:e}))}),(0,tu._)(this,"__internal_unmountOAuthConsent",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountAPIKeys",(t,e)=>{var i;let n;if(t4("Clerk: <APIKeys /> component is in early access and not yet recommended for production use."),tL(this,n=this.environment)&&tj(this,n)){if("development"===o(this,ak))throw new tC(ej.cannotRenderAPIKeysComponent,{code:"cannot_render_api_keys_disabled"});return}if(this.organization&&tj(this,this.environment)){if("development"===o(this,ak))throw new tC(ej.cannotRenderAPIKeysComponentForOrgWhenDisabled,{code:"cannot_render_api_keys_org_disabled"});return}if(tL(this,this.environment)){if("development"===o(this,ak))throw new tC(ej.cannotRenderAPIKeysComponentForUserWhenDisabled,{code:"cannot_render_api_keys_user_disabled"});return}this.assertComponentsReady(o(this,aw));let r="APIKeys";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"apiKeys",node:t,props:e})),null==(i=this.telemetry)||i.record(e8(r,e))}),(0,tu._)(this,"unmountAPIKeys",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountTaskChooseOrganization",(t,e)=>{var i;let{isEnabled:n}=this.__internal_attemptToEnableEnvironmentSetting({for:"organizations",caller:"TaskChooseOrganization",onClose:()=>{throw new tC(ej.cannotRenderAnyOrganizationComponent("TaskChooseOrganization"),{code:al})}});if(!n)return;this.assertComponentsReady(o(this,aw));let r="TaskChooseOrganization";o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:r,appearanceKey:"taskChooseOrganization",node:t,props:e})),null==(i=this.telemetry)||i.record(e8(r,e))}),(0,tu._)(this,"unmountTaskChooseOrganization",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"mountTaskResetPassword",(t,e)=>{var i;this.assertComponentsReady(o(this,aw)),o(this,aw).then(t=>t.ensureMounted()).then(i=>i.mountComponent({name:"TaskResetPassword",appearanceKey:"taskResetPassword",node:t,props:e})),null==(i=this.telemetry)||i.record(e8("TaskResetPassword",e))}),(0,tu._)(this,"unmountTaskResetPassword",t=>{var e;null==(e=o(this,aw))||e.then(t=>t.ensureMounted()).then(e=>e.unmountComponent({node:t}))}),(0,tu._)(this,"setActive",async t=>{var e,i,n,r,s,a,l,c;let{organization:u,redirectUrl:h,navigate:d}=t,{session:f}=t;this.__internal_setActiveInProgress=!0,ib.debug("setActive() start",{hasClient:!!this.client,sessionTarget:"string"==typeof f?f:null!=(i=null!=(e=null==f?void 0:f.id)?e:f)?i:null,organizationTarget:"string"==typeof u?u:null!=(r=null!=(n=null==u?void 0:u.id)?n:u)?r:null,redirectUrl:null!=h?h:null},"clerk");try{let e;if(!this.client)throw ib.warn("Clerk setActive called before client is loaded",{},"clerk"),Error("setActive is being called before the client is loaded. Wait for init.");if(void 0===f&&!this.session)throw ib.warn("Clerk setActive precondition not met: no target session and no active session",{},"clerk"),Error("setActive should either be called with a session param or there should be already an active session.");"string"==typeof f&&(f=this.client.sessions.find(t=>t.id===f)||null);let i="undefined"!=typeof window&&"function"==typeof window.__internal_onBeforeSetActive?window.__internal_onBeforeSetActive:ip.lQ,n="undefined"!=typeof window&&"function"==typeof window.__internal_onAfterSetActive?window.__internal_onAfterSetActive:ip.lQ,r=void 0===f?this.session:f;(null==r?void 0:r.status)==="pending"&&(c={...o(this,ax),...t},e=["taskUrls","navigate"],Object.keys(c).some(t=>e.includes(t))||t4('Clerk: Session has pending tasks but no handling is configured. To handle pending tasks, provide either "taskUrls" for navigation to custom URLs or "navigate" for programmatic navigation. Without these options, users may get stuck on incomplete flows.'));let p=void 0!==u;if(r&&p){let t="string"==typeof u?u:null==u?void 0:u.id;if("string"==typeof t&&t.startsWith("org_"))r.lastActiveOrganizationId=t||null;else{let e=r.user.organizationMemberships.find(e=>e.organization.slug===t),i=(null==e?void 0:e.organization.id)||null,n=null===i;if((null==(l=this.environment)||null==(a=l.organizationSettings)?void 0:a.forceOrganizationSelection)&&n)return;r.lastActiveOrganizationId=i}}(null==r?void 0:r.status)!=="pending"&&await i(null===r?"sign-out":void 0),(iz()&&globalThis.document.hasFocus()||!o(this,ax).standardBrowser)&&(await o(this,aV).call(this,r),r=o(this,a$).call(this,null==r?void 0:r.id)),await (null==r?void 0:r.getToken())||(t_()||ib.warn("Token is null when setting active session (offline)",{sessionId:null==r?void 0:r.id},"clerk"),rJ.emit(rL,{token:null}));let _=iP(o(this,ax).standardBrowser),g=(null==r?void 0:r.status)==="pending"&&(null==r?void 0:r.currentTask)&&(null==(s=o(this,ax).taskUrls)?void 0:s[null==r?void 0:r.currentTask.key]);if((h||g||d)&&await _.track(async()=>{if(this.client){if((null==r?void 0:r.status)!=="pending"&&o(this,aq).call(this),g){let t=h?ed({base:g,hashSearchParams:{redirectUrl:h}},{stringify:!0}):g;await this.navigate(t)}else if(d&&r)await d({session:r});else if(h){if(this.client.isEligibleForTouch()){let t=new URL(h,window.location.href),e=this.buildUrlWithAuth(this.client.buildTouchUrl({redirectUrl:t}));await this.navigate(e)}await this.navigate(h)}}}),_.isUnloading())return;o(this,aG).call(this,r),o(this,aJ).call(this),(null==r?void 0:r.status)!=="pending"&&await n()}finally{this.__internal_setActiveInProgress=!1}}),(0,tu._)(this,"addListener",t=>{var e;let i;return e=t,t=t=>{var n;i||(i={...t}),e(i={...{client:sB((n=i).client,t.client),session:sB(n.session,t.session),user:sB(n.user,t.user),organization:sB(n.organization,t.organization)}})},o(this,aA).push(t),this.client&&t({client:this.client,session:this.session,user:this.user,organization:this.organization}),()=>{u(this,aA,o(this,aA).filter(e=>e!==t))}}),(0,tu._)(this,"on",function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];o(i,aP).on(...e)}),(0,tu._)(this,"off",function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];o(i,aP).off(...e)}),(0,tu._)(this,"__internal_addNavigationListener",t=>(o(this,aI).push(t),()=>{u(this,aI,o(this,aI).filter(e=>e!==t))})),(0,tu._)(this,"navigate",async(t,e)=>{if(!t||!iz())return;setTimeout(()=>{o(this,aK).call(this)},0);let i=new URL(t,window.location.href);o(this,a2).includes(i.protocol)||(console.warn('Clerk: "'.concat(i.protocol,'" is not a valid protocol. Redirecting to "/" instead. If you think this is a mistake, please open an issue.')),i=new URL("/",window.location.href));let n=(null==e?void 0:e.replace)&&o(this,ax).routerReplace?o(this,ax).routerReplace:o(this,ax).routerPush;if(ib.info("Clerk is navigating to: ".concat(i)),o(this,ax).routerDebug&&console.log("Clerk is navigating to: ".concat(i)),"null"!==i.origin&&i.origin!==window.location.origin||!n)return void eJ(i);let r={...(null==e?void 0:e.metadata)?{__internal_metadata:null==e?void 0:e.metadata}:{},windowNavigate:eJ};return await n(ef(i),r)}),c(this,aO,{writable:!0,value:async()=>{if(!iz())return;let t=new URLSearchParams({[tB]:"true"}),e=eM(tJ);e&&eK(e)||function(){throw Error("".concat(iL," Invalid redirect_url. A valid http or https url should be used for the redirection."))}();let i=ed({base:eM(tJ),searchParams:t},{stringify:!0});return this.navigate(this.buildUrlWithAuth(i))}}),(0,tu._)(this,"redirectWithAuth",async t=>{if(iz())return this.navigate(this.buildUrlWithAuth(t))}),(0,tu._)(this,"redirectToSignIn",async t=>{if(iz())return this.navigate(this.buildSignInUrl(t))}),(0,tu._)(this,"redirectToSignUp",async t=>{if(iz())return this.navigate(this.buildSignUpUrl(t))}),(0,tu._)(this,"redirectToUserProfile",async()=>{if(iz())return this.navigate(this.buildUserProfileUrl())}),(0,tu._)(this,"redirectToCreateOrganization",async()=>{if(iz())return this.navigate(this.buildCreateOrganizationUrl())}),(0,tu._)(this,"redirectToOrganizationProfile",async()=>{if(iz())return this.navigate(this.buildOrganizationProfileUrl())}),(0,tu._)(this,"redirectToAfterSignIn",async()=>{if(iz())return this.navigate(this.buildAfterSignInUrl())}),(0,tu._)(this,"redirectToAfterSignUp",async()=>{if(iz())return this.navigate(this.buildAfterSignUpUrl())}),(0,tu._)(this,"redirectToAfterSignOut",async()=>{if(iz())return this.navigate(this.buildAfterSignOutUrl())}),(0,tu._)(this,"redirectToWaitlist",async()=>{if(iz())return this.navigate(this.buildWaitlistUrl())}),(0,tu._)(this,"redirectToTasks",async t=>{if(iz())return this.navigate(this.buildTasksUrl(t))}),(0,tu._)(this,"handleEmailLinkVerification",async(t,e)=>{if(!this.client)return;let i=eM("__clerk_status");if("expired"===i)throw new tP("expired");if("client_mismatch"===i)throw new tP("client_mismatch");if("verified"!==i)throw new tP("failed");let n=eM("__clerk_created_session"),{signIn:r,signUp:s,sessions:a}=this.client,o=a.some(t=>t.id===n),l="needs_second_factor"===r.status||"missing_requirements"===s.status,c=t=>e&&"function"==typeof e?e(t):this.navigate(t),u=t.redirectUrl?()=>c(t.redirectUrl):ip.lQ;return o?this.setActive({session:n,redirectUrl:t.redirectUrlComplete}):l?u():("function"==typeof t.onVerifiedOnOtherDevice&&t.onVerifiedOnOtherDevice(),null)}),(0,tu._)(this,"handleGoogleOneTapCallback",async(t,e,i)=>{if(!this.loaded||!this.environment||!this.client)return;let{signIn:n,signUp:r}=this.client,s="identifier"in(t||{})?t:n,a="missingFields"in(t||{})?t:r,o=t=>i&&"function"==typeof i?i(this.buildUrlWithAuth(t)):this.navigate(this.buildUrlWithAuth(t));return this._handleRedirectCallback(e,{signUp:a,signIn:s,navigate:o})}),(0,tu._)(this,"_handleRedirectCallback",async(t,e)=>{var i,n,r,s,a,l,c,u;let{signIn:h,signUp:d,navigate:f}=e;if(!this.loaded||!this.environment||!this.client)return;if(!window.opener&&t.reloadResource)try{"signIn"===t.reloadResource?await h.reload():"signUp"===t.reloadResource&&await d.reload()}catch{}let{displayConfig:p}=this.environment,{firstFactorVerification:_}=h,{externalAccount:g}=d.verifications,v={status:d.status,missingFields:d.missingFields,externalAccountStatus:g.status,externalAccountErrorCode:null==(i=g.error)?void 0:i.code,externalAccountSessionId:null==(r=g.error)||null==(n=r.meta)?void 0:n.sessionId,sessionId:d.createdSessionId},m={status:h.status,firstFactorVerificationStatus:_.status,firstFactorVerificationErrorCode:null==(s=_.error)?void 0:s.code,firstFactorVerificationSessionId:null==(l=_.error)||null==(a=l.meta)?void 0:a.sessionId,sessionId:h.createdSessionId},y=t=>()=>f(t),w=y(t.signInUrl||p.signInUrl),b=y(t.signUpUrl||p.signUpUrl),k=y(t.firstFactorUrl||ed({base:p.signInUrl,hashPath:"/factor-one"},{stringify:!0})),S=y(t.secondFactorUrl||ed({base:p.signInUrl,hashPath:"/factor-two"},{stringify:!0})),A=y(t.resetPasswordUrl||ed({base:p.signInUrl,hashPath:"/reset-password"},{stringify:!0})),I=new eA(o(this,ax),t),x=y(t.continueSignUpUrl||ed({base:p.signUpUrl,hashPath:"/continue"},{stringify:!0})),U=e=>{let{missingFields:i}=e;return i.length?x():(t=>{let{signUp:e,verifyEmailPath:i,verifyPhonePath:n,continuePath:r,navigate:s,handleComplete:a,redirectUrl:o="",redirectUrlComplete:l="",oidcPrompt:c}=t;if("complete"===e.status)return a&&a();if("missing_requirements"===e.status){var u,h;if(e.missingFields.some(t=>"enterprise_sso"===t))return e.authenticateWithRedirect({strategy:"enterprise_sso",redirectUrl:o,redirectUrlComplete:l,continueSignUp:!0,oidcPrompt:c});let t=eW();if((null==(u=e.unverifiedFields)?void 0:u.includes("email_address"))&&i)return s(i,{searchParams:t});if((null==(h=e.unverifiedFields)?void 0:h.includes("phone_number"))&&n)return s(n,{searchParams:t});if(r)return s(r,{searchParams:t})}})({signUp:d,verifyEmailPath:t.verifyEmailAddressUrl||ed({base:p.signUpUrl,hashPath:"/verify-email-address"},{stringify:!0}),verifyPhonePath:t.verifyPhoneNumberUrl||ed({base:p.signUpUrl,hashPath:"/verify-phone-number"},{stringify:!0}),navigate:f})},E=t.signInUrl||p.signInUrl,P=t.signUpUrl||p.signUpUrl,C=async t=>{let{session:e,baseUrl:i,redirectUrl:n}=t;e.currentTask?await eD(e,{baseUrl:i,navigate:this.navigate}):await this.navigate(n)};if("complete"===m.status)return this.setActive({session:m.sessionId,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:E,redirectUrl:I.getAfterSignInUrl()})}});if("transferable"===v.externalAccountStatus&&"external_account_exists"===v.externalAccountErrorCode){let t=await h.create({transfer:!0});switch(t.status){case"complete":return this.setActive({session:t.createdSessionId,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:P,redirectUrl:I.getAfterSignInUrl()})}});case"needs_first_factor":return k();case"needs_second_factor":return S();case"needs_new_password":return A();default:iB("sign in")}}let O="user_locked"===v.externalAccountErrorCode,T="user_locked"===m.firstFactorVerificationErrorCode;if(O)return b();if(T)return w();if("needs_first_factor"===m.status&&!(null==(c=h.supportedFirstFactors)?void 0:c.every(t=>"enterprise_sso"===t.strategy)))return k();if("needs_new_password"===m.status)return A();if("transferable"===m.firstFactorVerificationStatus){if(!1===t.transferable)return w();let e=await d.create({transfer:!0});switch(e.status){case"complete":return this.setActive({session:e.createdSessionId,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:P,redirectUrl:I.getAfterSignUpUrl()})}});case"missing_requirements":return U({missingFields:e.missingFields});default:iB("sign in")}}if("complete"===v.status)return this.setActive({session:v.sessionId,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:P,redirectUrl:I.getAfterSignUpUrl()})}});if("needs_second_factor"===m.status)return S();let R=("failed"===v.externalAccountStatus||"unverified"===v.externalAccountStatus)&&"identifier_already_signed_in"===v.externalAccountErrorCode&&v.externalAccountSessionId,M="failed"===m.firstFactorVerificationStatus&&"identifier_already_signed_in"===m.firstFactorVerificationErrorCode&&m.firstFactorVerificationSessionId;if(R||M){let t=m.firstFactorVerificationSessionId||v.externalAccountSessionId;if(t)return this.setActive({session:t,navigate:async t=>{let{session:e}=t;await C({session:e,baseUrl:R?P:E,redirectUrl:I.getAfterSignInUrl()})}})}return(t=>{let{externalAccount:e}=t.verifications;return!!e.error})(d)?b():"verified"===v.externalAccountStatus&&"missing_requirements"===v.status?U({missingFields:d.missingFields}):(null==(u=this.session)?void 0:u.currentTask)?void await this.redirectToTasks({redirectUrl:this.buildAfterSignInUrl()}):w()}),(0,tu._)(this,"handleRedirectCallback",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if(!i.loaded||!i.environment||!i.client)return;let{signIn:n,signUp:r}=i.client;return i._handleRedirectCallback(t,{signUp:r,signIn:n,navigate:t=>e&&"function"==typeof e?e(t):i.navigate(t)})}),(0,tu._)(this,"handleUnauthenticated",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{broadcast:!0};if(i.client&&i.session)try{let e=await rp.getOrCreateInstance().fetch();if(i.updateClient(e),i.session)return;return t.broadcast&&rJ.emit(rj,null),i.setActive({session:null})}catch(t){if(tN(t)&&[403,500].includes(t.status))return i.setActive({session:null});throw t}}),(0,tu._)(this,"authenticateWithGoogleOneTap",async t=>{var e;return null==(e=this.client)?void 0:e.signIn.create({strategy:"google_one_tap",token:t.token}).catch(e=>{if(tN(e)&&"external_account_not_found"===e.errors[0].code){var i;return null==(i=this.client)?void 0:i.signUp.create({strategy:"google_one_tap",token:t.token,legalAccepted:t.legalAccepted})}throw e})}),(0,tu._)(this,"authenticateWithMetamask",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await i.authenticateWithWeb3({...t,strategy:"web3_metamask_signature"})}),(0,tu._)(this,"authenticateWithCoinbaseWallet",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await i.authenticateWithWeb3({...t,strategy:"web3_coinbase_wallet_signature"})}),(0,tu._)(this,"authenticateWithBase",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await i.authenticateWithWeb3({...t,strategy:"web3_base_signature"})}),(0,tu._)(this,"authenticateWithOKXWallet",async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};await i.authenticateWithWeb3({...t,strategy:"web3_okx_wallet_signature"})}),(0,tu._)(this,"authenticateWithSolana",async t=>{await this.authenticateWithWeb3({...t,strategy:"web3_solana_signature"})}),(0,tu._)(this,"authenticateWithWeb3",async t=>{let e,i,{redirectUrl:n,signUpContinueUrl:r,customNavigate:s,unsafeMetadata:a,strategy:o,legalAccepted:l,secondFactorUrl:c,walletName:u}=t;if(!this.client||!this.environment)return;let{displayConfig:h}=this.environment,d=o.replace("web3_","").replace("_signature",""),f=await nl().getWeb3Identifier({provider:d,walletName:u});switch(d){case"metamask":e=nl().generateSignatureWithMetamask;break;case"base":e=nl().generateSignatureWithBase;break;case"coinbase_wallet":e=nl().generateSignatureWithCoinbaseWallet;break;case"solana":if(!u)throw new tC("Wallet name is required for Solana authentication.",{code:"web3_solana_wallet_name_required"});e=t=>nl().generateSignatureWithSolana({...t,walletName:u});break;default:e=nl().generateSignatureWithOKXWallet}let p=t=>()=>s&&"function"==typeof s?s(t):this.navigate(t),_=p(c||ed({base:h.signInUrl,hashPath:"/factor-two"},{stringify:!0})),g=p(r||ed({base:h.signUpUrl,hashPath:"/continue"},{stringify:!0}));try{i=await this.client.signIn.authenticateWithWeb3({identifier:f,generateSignature:e,strategy:o,walletName:u})}catch(t){if(iR(t,"form_identifier_not_found"))i=await this.client.signUp.authenticateWithWeb3({identifier:f,generateSignature:e,unsafeMetadata:a,strategy:o,legalAccepted:l,walletName:u}),r&&"missing_requirements"===i.status&&"verified"===i.verifications.web3Wallet.status&&await g();else throw t}let v=async t=>{let{session:e,redirectUrl:i}=t;e.currentTask?await eD(e,{baseUrl:h.signInUrl,navigate:this.navigate}):await this.navigate(i)};switch(i.status){case"needs_second_factor":await _();break;case"complete":i.createdSessionId&&await this.setActive({session:i.createdSessionId,navigate:async t=>{let{session:e}=t;await v({session:e,redirectUrl:null!=n?n:this.buildAfterSignInUrl()})}});break;default:return}}),(0,tu._)(this,"createOrganization",async t=>{let{name:e,slug:i}=t;return r2.create({name:e,slug:i})}),(0,tu._)(this,"getOrganization",async t=>r2.get(t)),(0,tu._)(this,"joinWaitlist",async t=>{let{emailAddress:e}=t;return sL.join({emailAddress:e})}),(0,tu._)(this,"__internal_setCountry",t=>{this.__internal_country||(this.__internal_country=t)}),(0,tu._)(this,"updateClient",t=>{if(!this.client){let e=o(this,ax).selectInitialSession?o(this,ax).selectInitialSession(t):o(this,aj).call(this,t);o(this,aG).call(this,e)}if(this.client=t,this.session){var e,i,n;let t=o(this,a$).call(this,this.session.id);"active"===this.session.status&&(null==t?void 0:t.status)==="pending"&&("undefined"!=typeof window&&"function"==typeof window.__internal_onAfterSetActive?window.__internal_onAfterSetActive:ip.lQ)(),o(this,aG).call(this,t),(null==(e=this.session)?void 0:e.lastActiveToken)||t_()||ib.warn("No last active token when updating client (offline)",{sessionId:null==(n=this.session)?void 0:n.id},"clerk"),rJ.emit(rL,{token:null==(i=this.session)?void 0:i.lastActiveToken})}o(this,aJ).call(this)}),(0,tu._)(this,"__internal_setEnvironment",async t=>{this.environment=new rH(t)}),(0,tu._)(this,"__internal_onBeforeRequest",t=>{o(this,ab).onBeforeRequest(t)}),(0,tu._)(this,"__internal_onAfterResponse",t=>{o(this,ab).onAfterResponse(t)}),(0,tu._)(this,"__internal_updateProps",t=>{var e;let i={...t,options:o(this,a0).call(this,{...o(this,ax),...t.options})};return null==(e=o(this,aw))?void 0:e.then(t=>t.ensureMounted()).then(t=>t.updateProps(i))}),c(this,aT,{writable:!0,value:()=>{let t=new URLSearchParams({[tJ]:window.location.href});return ed({base:o(this,ax).signInUrl,searchParams:t},{stringify:!0})}}),c(this,aR,{writable:!0,value:()=>{let t;if(this.proxyUrl){let e=new URL(this.proxyUrl);t=new URL("".concat(e.pathname,"/v1/client/sync"),e.origin)}else this.domain&&(t=new URL("/v1/client/sync","https://".concat(this.domain)));return null==t||t.searchParams.append("redirect_url",window.location.href),(null==t?void 0:t.toString())||""}}),c(this,aM,{writable:!0,value:()=>{var t;return"true"!==eM(tB)&&!!this.isSatellite&&!!(null==(t=o(this,ag))?void 0:t.isSignedOut())}}),c(this,aN,{writable:!0,value:()=>"production"!==o(this,ak)&&!this.isSatellite&&!!eM(tJ)}),c(this,aW,{writable:!0,value:async()=>{"development"===this.instanceType?await this.navigate(o(this,aT).call(this)):"production"===this.instanceType&&await this.navigate(o(this,aR).call(this))}}),c(this,az,{writable:!0,value:(t,e)=>{let i;try{i=new URL(t)}catch{throw Error("".concat(iL," The signInUrl needs to have a absolute url format."))}i.origin===e&&function(){throw Error("".concat(iL," The signInUrl needs to be on a different origin than your satellite application."))}()}}),c(this,aF,{writable:!0,value:()=>{this.isSatellite&&("development"!==o(this,ak)||o(this,ax).signInUrl||function(){throw Error("".concat(iL," Missing signInUrl. A satellite application needs to specify the signInUrl for development instances."))}(),this.proxyUrl||this.domain||function(){throw Error("".concat(iL," Missing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl."))}(),o(this,ax).signInUrl&&o(this,az).call(this,o(this,ax).signInUrl,window.location.origin))}}),c(this,aD,{writable:!0,value:async()=>{var t,e;if(u(this,ag,await s7.create(this,o(this,ab),o(this,ak),o(this,aP))),o(this,aF).call(this),o(this,aM).call(this))return void await o(this,aW).call(this);if(o(this,aN).call(this))return void await o(this,aO).call(this);u(this,aU,(()=>{if(!th())return{onPageFocus:ip.lQ};let t=[];return window.addEventListener("focus",()=>{"visible"===document.visibilityState&&t.forEach(t=>t())}),{onPageFocus:e=>{t.push(e)}}})()),"undefined"!=typeof BroadcastChannel&&u(this,ay,new BroadcastChannel("clerk")),o(this,aB).call(this);let i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.hostname;if(!t)return!1;let e=eu.get(t);void 0===e&&(e=tG.some(e=>t.startsWith("accounts.")&&t.endsWith(e))||t$.some(e=>t.endsWith(e)&&!t.endsWith(".clerk"+e)),eu.set(t,e));return e}(null==(t=window)?void 0:t.location.hostname),n="development"===o(this,ak)&&!i,r=0,s=0;for(;s<2;){s++;try{let t=rH.getInstance().fetch({touch:n}).then(t=>this.updateEnvironment(t)).catch(()=>{++r;let t=nd.getItem(nc,null);t&&this.updateEnvironment(new rH(t))}),i=async()=>rp.getOrCreateInstance().fetch().then(t=>this.updateClient(t)).catch(async t=>{var e,i,n;if(tM(t))throw t;++r;let s=null==(e=o(this,ag))?void 0:e.getSessionCookie(),a=function(t){let e;try{e=new sO({jwt:t||"",object:"token",id:void 0})}catch{e=null}if(rp.clearInstance(),!(null==e?void 0:e.jwt))return rp.getOrCreateInstance({object:"client",last_active_session_id:null,id:"client_init",sessions:[]});let{sessionId:i,userId:n,orgId:r,orgRole:s,orgPermissions:a,orgSlug:o,factorVerificationAge:l}=(t=>{var e,i,n,r,s,a,o,l;let c,u,h,d,f=null!=(e=t.fva)?e:null,p=null!=(i=t.sts)?i:null;if(2===t.v){if(t.o){c=null==(n=t.o)?void 0:n.id,h=null==(r=t.o)?void 0:r.slg,(null==(s=t.o)?void 0:s.rol)&&(u="org:".concat(null==(a=t.o)?void 0:a.rol));let{org:e}=so(t.fea),{permissions:i,featurePermissionMap:f}=(t=>{let{per:e,fpm:i}=t;if(!e||!i)return{permissions:[],featurePermissionMap:[]};let n=e.split(",").map(t=>t.trim());return{permissions:n,featurePermissionMap:i.split(",").map(t=>Number.parseInt(t.trim(),10)).map(t=>t.toString(2).padStart(n.length,"0").split("").map(t=>Number.parseInt(t,10)).reverse()).filter(Boolean)}})({per:null==(o=t.o)?void 0:o.per,fpm:null==(l=t.o)?void 0:l.fpm});d=function(t){let{features:e,permissions:i,featurePermissionMap:n}=t;if(!e||!i||!n)return[];let r=[];for(let t=0;t<e.length;t++){let s=e[t];if(t>=n.length)continue;let a=n[t];if(a)for(let t=0;t<a.length;t++)1===a[t]&&r.push("org:".concat(s,":").concat(i[t]))}return r}({features:e,featurePermissionMap:f,permissions:i})}}else c=t.org_id,u=t.org_role,h=t.org_slug,d=t.org_permissions;return{sessionClaims:t,sessionId:t.sid,sessionStatus:p,actor:t.act,userId:t.sub,orgId:c,orgRole:u,orgSlug:h,orgPermissions:d,factorVerificationAge:f}})(e.jwt.claims),c={object:"client",last_active_session_id:i,id:"client_init",sessions:[{object:"session",id:i,status:"active",last_active_organization_id:r||null,last_active_token:{id:void 0,object:"token",jwt:t},factor_verification_age:l||null,public_user_data:{user_id:n},user:{object:"user",id:n,organization_memberships:r&&o&&s?[{object:"organization_membership",id:r,role:s,permissions:a||[],organization:{object:"organization",id:r,name:o,slug:o,members_count:1,max_allowed_memberships:1}}]:[]}}]};return rp.getOrCreateInstance(c)}(s);return this.updateClient(a),null==(i=o(this,ag))||i.stopPollingForToken(),await (null==(n=this.session)?void 0:n.getToken({skipCache:!0}).catch(()=>null).finally(()=>{var t;null==(t=o(this,ag))||t.startPollingForToken()})),null}),[,s]=await (0,ip.vd)([t,i()]);if("rejected"===s.status){let t=s.reason;if(iR(t,"requires_captcha"))await i();else throw t}if(null==(e=o(this,ag))||e.setClientUatCookieForDevelopmentInstances(),await o(this,aZ).call(this))return;break}catch(t){if(iR(t,"dev_browser_unauthenticated"))await o(this,ag).handleUnauthenticatedDevBrowser();else if(!t_())return void console.warn(t);else throw t}s>=2&&function(){throw Error("".concat(iL," Something went wrong initializing Clerk."))}()}u(this,am,new s8(this)),o(this,am).start(),o(this,a1).call(this),o(this,aY).call(this),o(this,aX).call(this),o(this,aP).emit(tw,r>0?"degraded":"ready")}}),(0,tu._)(this,"shouldFallbackToCachedResources",()=>!!this.__internal_getCachedResources),c(this,aL,{writable:!0,value:async()=>{let t,e,i=this.shouldFallbackToCachedResources()?1:void 0,n=0;try{[t,e]=await Promise.all([rH.getInstance().fetch({touch:!1,fetchMaxTries:i}),rp.getOrCreateInstance().fetch({fetchMaxTries:i})])}catch(i){if(tW(i)&&"network_error"===i.code&&this.shouldFallbackToCachedResources()){var r;let i=await (null==(r=this.__internal_getCachedResources)?void 0:r.call(this));t=new rH(null==i?void 0:i.environment),rp.clearInstance(),e=rp.getOrCreateInstance(null==i?void 0:i.client),++n}else throw i}this.updateClient(e),this.updateEnvironment(t),o(this,aP).emit(tw,n>0?"degraded":"ready")}}),(0,tu._)(this,"__internal_reloadInitialResources",async()=>{let[t,e]=await Promise.all([rH.getInstance().fetch({touch:!1,fetchMaxTries:1}),rp.getOrCreateInstance().fetch({fetchMaxTries:1})]);this.updateClient(e),this.updateEnvironment(t),o(this,aJ).call(this)}),c(this,aj,{writable:!0,value:t=>{if(t.lastActiveSessionId){let e=t.signedInSessions.find(e=>e.id===t.lastActiveSessionId);if(e)return e}return t.signedInSessions[0]||null}}),c(this,aB,{writable:!0,value:()=>{var t,e;th()&&(null==(t=o(this,aU))||t.onPageFocus(()=>{this.session&&!(!(this.environment&&!this.environment.authConfig.singleSessionMode)&&o(this,aE)>Date.now())&&(u(this,aE,Date.now()+5e3),o(this,ax).touchSession&&o(this,aV).call(this,this.session))}),null==(e=o(this,ay))||e.addEventListener("message",t=>{var e;(null==(e=t.data)?void 0:e.type)==="signout"&&this.handleUnauthenticated({broadcast:!1})}),rJ.on(rj,()=>{var t;null==(t=o(this,ay))||t.postMessage({type:"signout"})}),rJ.on(rB,()=>{var t;nd.setItem(nc,null==(t=this.environment)?void 0:t.__internal_toSnapshot(),864e5)}))}}),c(this,aV,{writable:!0,value:async t=>{if(!t)return Promise.resolve();await t.touch().catch(t=>{tM(t)&&this.handleUnauthenticated()})}}),c(this,aJ,{writable:!0,value:()=>{if(this.client)for(let t of o(this,aA))t({client:this.client,session:this.session,user:this.user,organization:this.organization})}}),c(this,aK,{writable:!0,value:()=>{for(let t of o(this,aI))t()}}),c(this,aq,{writable:!0,value:()=>{this.session=void 0,this.organization=void 0,this.user=void 0,o(this,aJ).call(this)}}),c(this,aH,{writable:!0,value:()=>{var t;return((null==(t=this.session)?void 0:t.user.organizationMemberships)||[]).map(t=>t.organization).find(t=>{var e;return t.id===(null==(e=this.session)?void 0:e.lastActiveOrganizationId)})||null}}),c(this,aG,{writable:!0,value:t=>{this.session=t||null,this.organization=o(this,aH).call(this),this.user=this.session?this.session.user:null}}),c(this,a$,{writable:!0,value:t=>{var e;return(null==(e=this.client)?void 0:e.signedInSessions.find(e=>e.id===t))||null}}),c(this,aY,{writable:!0,value:()=>{this.addListener(t=>{let{session:e}=t;if(null==e?void 0:e.actor){var i;null==(i=o(this,aw))||i.then(t=>t.ensureMounted()).then(t=>t.mountImpersonationFab())}})}}),c(this,aX,{writable:!0,value:()=>{if(o(this,ax).__internal_keyless_claimKeylessApplicationUrl){var t;null==(t=o(this,aw))||t.then(t=>t.ensureMounted()).then(t=>{t.updateProps({options:{__internal_keyless_claimKeylessApplicationUrl:o(this,ax).__internal_keyless_claimKeylessApplicationUrl,__internal_keyless_copyInstanceKeysUrl:o(this,ax).__internal_keyless_copyInstanceKeysUrl,__internal_keyless_dismissPrompt:o(this,ax).__internal_keyless_dismissPrompt}})})}}}),c(this,aQ,{writable:!0,value:(t,e,i)=>{if(!t||!this.loaded||!this.environment||!this.environment.displayConfig)return"";let n=o(this,ax)[t]||this.environment.displayConfig[t];h(this,aC,a5).call(this)&&(n=o(this,ax).signInUrl);let r=new eA(o(this,ax),e).toSearchParams(),s=new URLSearchParams(i||{}),a=ed({base:n,hashPath:h(this,aC,a5).call(this)&&"signUpUrl"===t?"/create":"",hashSearchParams:[s,r]},{stringify:!0});return this.buildUrlWithAuth(a)}}),c(this,aZ,{writable:!0,value:async()=>{var t,e,i;let n,r,s,a,l=new URLSearchParams(window.location.search).get("redirect_url"),c="production"===this.instanceType,u=null!==l&&(i=this.frontendApi,r=(n=new URL(l,eo)).pathname,s=ev.includes(r)||em.includes(r),i===n.host&&s);if(c||!u)return!1;let h=this.session,d=o(this,ax).signInUrl||(null==(t=this.environment)?void 0:t.displayConfig.signInUrl),f=d&&window.location.href.startsWith(d),p=o(this,ax).signUpUrl||(null==(e=this.environment)?void 0:e.displayConfig.signUpUrl),_=p&&window.location.href.startsWith(p);return a=new URL(l,eo),(!ev.includes(a.pathname)||!!h||!f&&!_)&&(await this.navigate(this.buildUrlWithAuth(l)),!0)}}),c(this,a0,{writable:!0,value:t=>({...ah,...t,allowedRedirectOrigins:function(t,e,i){if(Array.isArray(t)&&t.length)return t;let n=[];return"undefined"!=typeof window&&window.location&&n.push(window.location.origin),n.push("https://".concat(eh(e))),n.push("https://*.".concat(eh(e))),"development"===i&&n.push("https://".concat(e)),n}(null==t?void 0:t.allowedRedirectOrigins,this.frontendApi,this.instanceType)})}),c(this,a1,{writable:!0,value:()=>{try{eN(tB),eN(eT),eN(tV),eN("__clerk_handshake"),eN("__clerk_handshake_nonce"),eN("__clerk_help")}catch{}}}),!(t=(t||"").trim()))return iM.throwMissingPublishableKeyError();const n=tZ(t);if(!n)return iM.throwInvalidPublishableKeyError({key:t});u(this,ap,null==e?void 0:e.domain),u(this,a_,null==e?void 0:e.proxyUrl),this.environment=rH.getInstance(),u(this,ak,n.instanceType),u(this,af,t),u(this,ab,function(t){let e=[],i=[];async function n(t){for await(let i of["undefined"!=typeof window&&window.__internal_onBeforeRequest,...e].filter(t=>t))if(await i(t)===!1)return!1;return!0}async function r(t,e){for await(let n of["undefined"!=typeof window&&window.__internal_onAfterResponse,...i].filter(t=>t))if(await n(t,e)===!1)return!1;return!0}function s(e){let{method:i,path:n,sessionId:r,search:s,rotatingTokenNonce:a}=e,o=new URLSearchParams(s);return o.append("__clerk_api_version","2025-11-10"),o.append("_clerk_js_version","6.0.0-snapshot.v20251218183643"),a&&o.append("rotating_token_nonce",a),t.domain&&"development"===t.instanceType&&t.isSatellite&&o.append("__domain",t.domain),i&&"GET"!==i&&"POST"!==i&&o.append("_method",i),n&&!s9.some(t=>n.startsWith(t))&&r&&o.append("_clerk_session_id",r),ea([...o.entries()].reduce((t,e)=>{let[i,n]=e;return t[i]=n.includes(",")?n.split(","):n,t},{}))}function a(e){let{path:i,pathPrefix:n="v1"}=e;if(t.proxyUrl){let r=new URL(t.proxyUrl),a=r.pathname.slice(1);return a.endsWith("/")&&(a=a.slice(0,-1)),ed({base:r.origin,pathname:"".concat(a,"/").concat(n).concat(i),search:s(e)},{stringify:!1})}let r="production"===t.instanceType?t.domain:"";return ed({base:"https://".concat(r||t.frontendApi),pathname:"".concat(n).concat(i),search:s(e)},{stringify:!1})}async function o(e,i){let s,o={...e},{method:l="GET",body:c}=o;!c||"object"!=typeof c||c instanceof FormData||(o.body=function(t){if(!t||"object"!=typeof t||Object.getPrototypeOf(t)!==Object.prototype)return t;let e={};for(let[i,n]of Object.entries(t))void 0!==n&&(e[i]=n);return e}(c)),o.url=a({...o,sessionId:t.getSessionId()}),o.headers=new Headers(o.headers),"GET"===l||c instanceof FormData||o.headers.has("content-type")||o.headers.set("content-type","application/x-www-form-urlencoded"),"application/x-www-form-urlencoded"===o.headers.get("content-type")&&(o.body=c?ea(c,{keyEncoder:et}):c);let u=await n(o),h="GET"===l?"GET":"POST",d=o.url,f={...o,method:h,credentials:o.credentials||"include"};try{if(u){var p;let t=null!=(p=null==i?void 0:i.fetchMaxTries)?p:tp()?4:11;s=await iI(()=>fetch(d,f),{retryImmediately:!0,initialDelay:700,maxDelayBetweenRetries:5e3,shouldRetry:(e,i)=>"GET"===h&&i<t,onBeforeRetry:t=>{d.searchParams.set("_clerk_retry_attempt",t.toString())}})}else s=new Response("{}",o)}catch(e){let t=d.toString();ib.error("network error",{error:e,url:t,method:l},"fapiClient");throw Error("".concat(iL,' Network error at "').concat(t,'" - ').concat(e,". Please try again."))}let _=204!==s.status?await s.json():null,g=Object.assign(s,{payload:_});return s.ok||ib.error("request failed",{method:l,path:o.path,status:s.status},"fapiClient"),await r(o,g),g}return{buildEmailAddress:function(e){return function(t){let{localPart:e,frontendApi:i}=t;return"".concat(e,"@").concat(i?i.replace("clerk.",""):"clerk.com")}({localPart:e,frontendApi:t.frontendApi})},buildUrl:a,onAfterResponse:function(t){i.push(t)},onBeforeRequest:function(t){e.push(t)},request:o}}({domain:this.domain,frontendApi:this.frontendApi,instanceType:this.instanceType,isSatellite:this.isSatellite,getSessionId:()=>{var t;return null==(t=this.session)?void 0:t.id},proxyUrl:this.proxyUrl})),o(this,aP).emit(tw,"loading"),o(this,aP).prioritizedOn(tw,t=>u(this,aS,t)),nb.clerk=this,u(this,av,new an)}}function a5(){let t;return!!(!o(this,ax).signUpUrl&&o(this,ax).signInUrl&&(t=o(this,ax).signInUrl,!t5.test(t)))}function a6(){let t=eV;return o(this,ax).allowedRedirectProtocols&&(t=t.concat(o(this,ax).allowedRedirectProtocols)),t}(0,tu._)(a3,"version","6.0.0-snapshot.v20251218183643"),(0,tu._)(a3,"sdkMetadata",{name:"@clerk/clerk-js",version:"6.0.0-snapshot.v20251218183643"}),(0,tu._)(a3,"_billing",void 0),(0,tu._)(a3,"_apiKeys",void 0);let a4=(null==(to=document.querySelector("script[data-clerk-publishable-key]"))?void 0:to.getAttribute("data-clerk-publishable-key"))||window.__clerk_publishable_key||"",a7=(null==(tl=document.querySelector("script[data-clerk-proxy-url]"))?void 0:tl.getAttribute("data-clerk-proxy-url"))||window.__clerk_proxy_url||"",a8=(null==(tc=document.querySelector("script[data-clerk-domain]"))?void 0:tc.getAttribute("data-clerk-domain"))||window.__clerk_domain||"";window.Clerk||(window.Clerk=new a3(a4,{proxyUrl:a7,domain:a8}))})(),{}})());
|