@stytch/vanilla-js 5.44.0 → 5.44.2

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/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- var _templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject0,_templateObject1,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_providerInfo,_templateObject14,_templateObject15,_templateObject16,_templateObject17,_templateObject18,_templateObject19,_templateObject20,_templateObject21,_templateObject22,_templateObject23,_templateObject24,_templateObject25,_templateObject26,_templateObject27,_templateObject28,_templateObject29,_templateObject30,_templateObject31,_templateObject32,_templateObject33,_templateObject34,_templateObject35,_templateObject36,_templateObject37,_templateObject38,_templateObject39,_templateObject40,_templateObject41,_templateObject42,_templateObject43,_templateObject44,_templateObject45,_templateObject46,_templateObject47,_templateObject48,_templateObject49,_templateObject50,_templateObject51,_templateObject52,_templateObject53,_templateObject54,_templateObject55,_templateObject56,_templateObject57,_templateObject58,_templateObject59,_templateObject60,_templateObject61,_templateObject62,_templateObject63,_templateObject64,_templateObject65,_templateObject66,_templateObject67,_templateObject68,_templateObject69,_templateObject70,_templateObject71,_templateObject72,_templateObject73,_templateObject74,_templateObject75,_templateObject76,_templateObject77,_templateObject78,_templateObject79,_templateObject80,_templateObject81,_templateObject82,_templateObject83;var _excluded=["offset"],_excluded2=["children"],_excluded3=["children"],_excluded4=["asChild"],_excluded5=["scope","children"],_excluded6=["scope","children"],_excluded7=["__scopeRovingFocusGroup","orientation","dir","loop","currentTabStopId","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus"],_excluded8=["__scopeRovingFocusGroup","focusable","active"],_excluded9=["__scopeTabs","value","onValueChange","defaultValue","orientation","dir","activationMode"],_excluded0=["__scopeTabs","loop"],_excluded1=["__scopeTabs","value","disabled"],_excluded10=["__scopeTabs","value","children"];function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _wrapNativeSuper2(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper2=function _wrapNativeSuper2(t){if(null===t||!_isNativeFunction2(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct2(t,arguments,_getPrototypeOf2(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf2(Wrapper,t);},_wrapNativeSuper2(t);}function _construct2(t,e,r){if(_isNativeReflectConstruct2())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf2(p,r.prototype),p;}function _isNativeFunction2(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _createForOfIteratorHelper2(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray2(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n6=0,F=function F(){};return{s:F,n:function n(){return _n6>=r.length?{done:!0}:{done:!1,value:r[_n6++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _defineProperty(e,r,t){return(r=_toPropertyKey2(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _slicedToArray2(r,e){return _arrayWithHoles2(r)||_iterableToArrayLimit2(r,e)||_unsupportedIterableToArray2(r,e)||_nonIterableRest2();}function _nonIterableRest2(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit2(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles2(r){if(Array.isArray(r))return r;}function _toConsumableArray2(r){return _arrayWithoutHoles2(r)||_iterableToArray2(r)||_unsupportedIterableToArray2(r)||_nonIterableSpread2();}function _nonIterableSpread2(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray2(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray2(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray2(r,a):void 0;}}function _iterableToArray2(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles2(r){if(Array.isArray(r))return _arrayLikeToArray2(r);}function _arrayLikeToArray2(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _callSuper2(t,o,e){return o=_getPrototypeOf2(o),_possibleConstructorReturn2(t,_isNativeReflectConstruct2()?Reflect.construct(o,e||[],_getPrototypeOf2(t).constructor):o.apply(t,e));}function _possibleConstructorReturn2(t,e){if(e&&("object"==_typeof2(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized2(t);}function _assertThisInitialized2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct2=function _isNativeReflectConstruct2(){return!!t;})();}function _getPrototypeOf2(t){return _getPrototypeOf2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf2(t);}function _inherits2(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf2(t,e);}function _setPrototypeOf2(t,e){return _setPrototypeOf2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf2(t,e);}function _regenerator2(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine4(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine4(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine4(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine4(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine4(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine4(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine4(u),_regeneratorDefine4(u,o,"Generator"),_regeneratorDefine4(u,n,function(){return this;}),_regeneratorDefine4(u,"toString",function(){return"[object Generator]";}),(_regenerator2=function _regenerator2(){return{w:i,m:f};})();}function _regeneratorDefine4(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine4=function _regeneratorDefine3(e,r,n,t){function o(r,n){_regeneratorDefine4(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine4(e,r,n,t);}function _typeof2(o){"@babel/helpers - typeof";return _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof2(o);}function _classCallCheck2(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function __defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey2(o.key),o);}}function _createClass2(e,r,t){return r&&__defineProperties(e.prototype,r),t&&__defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey2(t){var i=_toPrimitive2(t,"string");return"symbol"==_typeof2(i)?i:i+"";}function _toPrimitive2(t,r){if("object"!=_typeof2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof2(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function __rest$1(s,e){var t={};for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0)t[p]=s[p];if(s!=null&&typeof Object.getOwnPropertySymbols==="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++){if(e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i]))t[p[i]]=s[p[i]];}return t;}function __awaiter$1(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}}function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e);}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);}step((generator=generator.apply(thisArg,[])).next());});}typeof SuppressedError==="function"?SuppressedError:function(error,suppressed,message){var e=new Error(message);return e.name="SuppressedError",e.error=error,e.suppressed=suppressed,e;};function _typeof$1(o){"@babel/helpers - typeof";return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof$1(o);}function _defineProperties$1(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$1(o.key),o);}}function _createClass$1(e,r,t){return r&&_defineProperties$1(e.prototype,r),t&&_defineProperties$1(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey$1(t){var i=_toPrimitive$1(t,"string");return"symbol"==_typeof$1(i)?i:i+"";}function _toPrimitive$1(t,r){if("object"!=_typeof$1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r);if("object"!=_typeof$1(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return String(t);}function _classCallCheck$1(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _callSuper$1(t,o,e){return o=_getPrototypeOf$1(o),_possibleConstructorReturn$1(t,_isNativeReflectConstruct$1()?Reflect.construct(o,e||[],_getPrototypeOf$1(t).constructor):o.apply(t,e));}function _possibleConstructorReturn$1(t,e){if(e&&("object"==_typeof$1(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(t);}function _assertThisInitialized$1(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _inherits$1(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf$1(t,e);}function _wrapNativeSuper$1(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper$1=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction$1(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct$1(t,arguments,_getPrototypeOf$1(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$1(Wrapper,t);},_wrapNativeSuper$1(t);}function _construct$1(t,e,r){if(_isNativeReflectConstruct$1())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf$1(p,r.prototype),p;}function _isNativeReflectConstruct$1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct$1=function _isNativeReflectConstruct(){return!!t;})();}function _isNativeFunction$1(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _setPrototypeOf$1(t,e){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf$1(t,e);}function _getPrototypeOf$1(t){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf$1(t);}var Products;(function(Products){Products["emailMagicLinks"]="emailMagicLinks";Products["oauth"]="oauth";Products["otp"]="otp";Products["crypto"]="crypto";Products["passwords"]="passwords";Products["passkeys"]="passkeys";})(Products||(Products={}));var OAuthProviders;(function(OAuthProviders){OAuthProviders["Google"]="google";OAuthProviders["Microsoft"]="microsoft";OAuthProviders["Apple"]="apple";OAuthProviders["Github"]="github";OAuthProviders["GitLab"]="gitlab";OAuthProviders["Facebook"]="facebook";OAuthProviders["Discord"]="discord";OAuthProviders["Salesforce"]="salesforce";OAuthProviders["Slack"]="slack";OAuthProviders["Amazon"]="amazon";OAuthProviders["Bitbucket"]="bitbucket";OAuthProviders["LinkedIn"]="linkedin";OAuthProviders["Coinbase"]="coinbase";OAuthProviders["Twitch"]="twitch";OAuthProviders["Twitter"]="twitter";OAuthProviders["TikTok"]="tiktok";OAuthProviders["Snapchat"]="snapchat";OAuthProviders["Figma"]="figma";OAuthProviders["Yahoo"]="yahoo";})(OAuthProviders||(OAuthProviders={}));var Wallets;(function(Wallets){Wallets["Vessel"]="Vessel";Wallets["Phantom"]="Phantom";Wallets["Metamask"]="Metamask";Wallets["Coinbase"]="Coinbase";Wallets["Binance"]="Binance";Wallets["GenericEthereumWallet"]="Other Ethereum Wallet";Wallets["GenericSolanaWallet"]="Other Solana Wallet";})(Wallets||(Wallets={}));var OneTapPositions;(function(OneTapPositions){OneTapPositions["embedded"]="embedded";OneTapPositions["floating"]="floating";OneTapPositions["embeddedOnly"]="embeddedOnly";OneTapPositions["floatingOrEmbedded"]="floatingOrEmbedded";OneTapPositions["forceLegacyEmbedded"]="forceLegacyEmbedded";})(OneTapPositions||(OneTapPositions={}));var OTPMethods;(function(OTPMethods){OTPMethods["SMS"]="sms";OTPMethods["WhatsApp"]="whatsapp";OTPMethods["Email"]="email";})(OTPMethods||(OTPMethods={}));var StytchEventType;(function(StytchEventType){StytchEventType["MagicLinkLoginOrCreateEvent"]="MAGIC_LINK_LOGIN_OR_CREATE";StytchEventType["OTPsLoginOrCreateEvent"]="OTP_LOGIN_OR_CREATE";StytchEventType["OTPsAuthenticate"]="OTP_AUTHENTICATE";StytchEventType["CryptoWalletAuthenticateStart"]="CRYPTO_WALLET_AUTHENTICATE_START";StytchEventType["CryptoWalletAuthenticate"]="CRYPTO_WALLET_AUTHENTICATE";StytchEventType["PasswordCreate"]="PASSWORD_CREATE";StytchEventType["PasswordAuthenticate"]="PASSWORD_AUTHENTICATE";StytchEventType["PasswordResetByEmailStart"]="PASSWORD_RESET_BY_EMAIL_START";StytchEventType["PasswordResetByEmail"]="PASSWORD_RESET_BY_EMAIL";StytchEventType["PasskeyRegister"]="PASSKEY_REGISTER";StytchEventType["PasskeyAuthenticate"]="PASSKEY_AUTHENTICATE";StytchEventType["PasskeySkip"]="PASSKEY_SKIP";StytchEventType["PasskeyDone"]="PASSKEY_DONE";StytchEventType["AuthenticateFlowComplete"]="AUTHENTICATE_FLOW_COMPLETE";StytchEventType["OAuthAuthorizeFlowStart"]="OAUTH_AUTHORIZE_FLOW_START";StytchEventType["OAuthAuthorizeFlowComplete"]="OAUTH_AUTHORIZE_FLOW_COMPLETE";StytchEventType["OAuthAuthorizeFlowConsentDenied"]="OAUTH_AUTHORIZE_FLOW_CONSENT_DENIED";StytchEventType["B2BMagicLinkEmailLoginOrSignup"]="B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP";StytchEventType["B2BMagicLinkAuthenticate"]="B2B_MAGIC_LINK_AUTHENTICATE";StytchEventType["B2BMagicLinkEmailDiscoverySend"]="B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND";StytchEventType["B2BMagicLinkDiscoveryAuthenticate"]="B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE";StytchEventType["B2BSSOStart"]="B2B_SSO_START";StytchEventType["B2BSSOAuthenticate"]="B2B_SSO_AUTHENTICATE";StytchEventType["B2BSSODiscoverConnections"]="B2B_SSO_DISCOVER_CONNECTIONS";StytchEventType["B2BOAuthAuthenticate"]="B2B_OAUTH_AUTHENTICATE";StytchEventType["B2BOAuthDiscoveryAuthenticate"]="B2B_OAUTH_DISCOVERY_AUTHENTICATE";StytchEventType["B2BDiscoveryOrganizationsCreate"]="B2B_DISCOVERY_ORGANIZATIONS_CREATE";StytchEventType["B2BDiscoveryIntermediateSessionExchange"]="B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE";StytchEventType["B2BPasswordAuthenticate"]="B2B_PASSWORD_AUTHENTICATE";StytchEventType["B2BPasswordDiscoveryAuthenticate"]="B2B_PASSWORD_DISCOVERY_AUTHENTICATE";StytchEventType["B2BPasswordResetByEmailStart"]="B2B_PASSWORD_RESET_BY_EMAIL_START";StytchEventType["B2BPasswordResetByEmail"]="B2B_PASSWORD_RESET_BY_EMAIL";StytchEventType["B2BPasswordResetBySession"]="B2B_PASSWORD_RESET_BY_SESSION";StytchEventType["B2BSMSOTPSend"]="B2B_SMS_OTP_SEND";StytchEventType["B2BSMSOTPAuthenticate"]="B2B_SMS_OTP_AUTHENTICATE";StytchEventType["B2BTOTPCreate"]="B2B_TOTP_CREATE";StytchEventType["B2BTOTPAuthenticate"]="B2B_TOTP_AUTHENTICATE";StytchEventType["B2BRecoveryCodesRecover"]="B2B_RECOVERY_CODES_RECOVER";StytchEventType["B2BPasswordDiscoveryResetStart"]="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL_START";StytchEventType["B2BDiscoveryPasswordReset"]="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL";StytchEventType["B2BImpersonationAuthenticate"]="B2B_IMPERSONATION_AUTHENTICATE";StytchEventType["B2BOTPsEmailAuthenticate"]="B2B_OTPS_EMAIL_AUTHENTICATE";StytchEventType["B2BOTPsEmailDiscoveryAuthenticate"]="B2B_OTPS_EMAIL_DISCOVERY_AUTHENTICATE";StytchEventType["B2BOTPsEmailDiscoverySend"]="B2B_OTPS_EMAIL_DISCOVERY_SEND";StytchEventType["B2BOTPsEmailLoginOrSignup"]="B2B_OTPS_EMAIL_LOGIN_OR_SIGNUP";StytchEventType["B2BOrganizationsGetBySlug"]="B2B_ORGANIZATIONS_GET_BY_SLUG";})(StytchEventType||(StytchEventType={}));var RNUIProducts;(function(RNUIProducts){RNUIProducts[RNUIProducts["emailMagicLinks"]=0]="emailMagicLinks";RNUIProducts[RNUIProducts["oauth"]=1]="oauth";RNUIProducts[RNUIProducts["otp"]=2]="otp";RNUIProducts[RNUIProducts["passwords"]=3]="passwords";})(RNUIProducts||(RNUIProducts={}));var SDKAPIUnreachableError=/*#__PURE__*/function(_Error){function SDKAPIUnreachableError(message,details){var _this;_classCallCheck$1(this,SDKAPIUnreachableError);_this=_callSuper$1(this,SDKAPIUnreachableError,[message+'\n'+details]);_this.message=message+'\n'+details;_this.name='SDKAPIUnreachableError';_this.details=details;Object.setPrototypeOf(_this,SDKAPIUnreachableError.prototype);return _this;}_inherits$1(SDKAPIUnreachableError,_Error);return _createClass$1(SDKAPIUnreachableError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var StytchSDKUsageError=/*#__PURE__*/function(_Error2){function StytchSDKUsageError(methodName,message){var _this2;_classCallCheck$1(this,StytchSDKUsageError);_this2=_callSuper$1(this,StytchSDKUsageError);_this2.name='StytchSDKUsageError';_this2.message="Invalid call to ".concat(methodName,"\n")+message;return _this2;}_inherits$1(StytchSDKUsageError,_Error2);return _createClass$1(StytchSDKUsageError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var StytchSDKSchemaError=/*#__PURE__*/function(_Error3){function StytchSDKSchemaError(schemaError){var _this3;_classCallCheck$1(this,StytchSDKSchemaError);var _a;_this3=_callSuper$1(this,StytchSDKSchemaError);_this3.name='StytchSDKSchemaError';var messages=(_a=schemaError.body)===null||_a===void 0?void 0:_a.map(function(err){return"".concat(err.dataPath,": ").concat(err.message);}).join('\n');_this3.message="[400] Request does not match expected schema\n".concat(messages);return _this3;}_inherits$1(StytchSDKSchemaError,_Error3);return _createClass$1(StytchSDKSchemaError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var StytchSDKAPIError=/*#__PURE__*/function(_Error4){function StytchSDKAPIError(details){var _this4;_classCallCheck$1(this,StytchSDKAPIError);_this4=_callSuper$1(this,StytchSDKAPIError);_this4.name='StytchSDKAPIError';var status_code=details.status_code,error_type=details.error_type,error_message=details.error_message,error_url=details.error_url,request_id=details.request_id,error_details=details.error_details;_this4.error_type=error_type;_this4.error_message=error_message;_this4.error_url=error_url;_this4.request_id=request_id;_this4.status_code=status_code;_this4.error_details=error_details;_this4.message="[".concat(status_code,"] ").concat(error_type,"\n")+"".concat(error_message,"\n")+"See ".concat(error_url," for more information.\n")+(request_id?"request_id: ".concat(request_id,"\n"):'')+(_this4.error_details?"Details: \n"+JSON.stringify(_this4.error_details)+'\n':'');return _this4;}_inherits$1(StytchSDKAPIError,_Error4);return _createClass$1(StytchSDKAPIError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var UNRECOVERABLE_ERROR_TYPES=['unauthorized_credentials','user_unauthenticated','invalid_secret_authentication','session_not_found'];var StytchError=/*#__PURE__*/function(_Error5){function StytchError(name,message){var _this5;_classCallCheck$1(this,StytchError);_this5=_callSuper$1(this,StytchError,[message]);_this5.name=name;return _this5;}_inherits$1(StytchError,_Error5);return _createClass$1(StytchError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var StytchAPIUnreachableError=/*#__PURE__*/function(_StytchError){function StytchAPIUnreachableError(details){var _this6;_classCallCheck$1(this,StytchAPIUnreachableError);_this6=_callSuper$1(this,StytchAPIUnreachableError,['StytchAPIUnreachableError',details]);Object.setPrototypeOf(_this6,StytchAPIUnreachableError.prototype);return _this6;}_inherits$1(StytchAPIUnreachableError,_StytchError);return _createClass$1(StytchAPIUnreachableError);}(StytchError);var StytchAPISchemaError=/*#__PURE__*/function(_StytchError2){function StytchAPISchemaError(schemaError){_classCallCheck$1(this,StytchAPISchemaError);var _a;var messages=(_a=schemaError.body)===null||_a===void 0?void 0:_a.map(function(err){return"".concat(err.dataPath,": ").concat(err.message);}).join('\n');return _callSuper$1(this,StytchAPISchemaError,['StytchAPISchemaError',"Request does not match expected schema\n".concat(messages)]);}_inherits$1(StytchAPISchemaError,_StytchError2);return _createClass$1(StytchAPISchemaError);}(StytchError);var StytchAPIError=/*#__PURE__*/function(_StytchError3){function StytchAPIError(details){var _this7;_classCallCheck$1(this,StytchAPIError);var status_code=details.status_code,error_type=details.error_type,error_message=details.error_message,error_url=details.error_url,request_id=details.request_id,error_details=details.error_details;_this7=_callSuper$1(this,StytchAPIError,['StytchAPIError',"[".concat(status_code,"] ").concat(error_type,"\n")+"".concat(error_message,"\n")+"See ".concat(error_url," for more information.\n")+(request_id?"request_id: ".concat(request_id,"\n"):'')+(error_details?"Details: \n"+JSON.stringify(error_details)+'\n':'')]);_this7.error_type=error_type;_this7.error_message=error_message;_this7.error_url=error_url;_this7.request_id=request_id;_this7.status_code=status_code;_this7.error_details=error_details;return _this7;}_inherits$1(StytchAPIError,_StytchError3);return _createClass$1(StytchAPIError,null,[{key:"from",value:function from(err){if(err instanceof StytchAPIError){return err;}if(err&&_typeof$1(err)==='object'){var maybe=err;if(typeof maybe.status_code==='number'&&typeof maybe.error_type==='string'&&typeof maybe.error_message==='string'&&typeof maybe.error_url==='string'){return new StytchAPIError({status_code:maybe.status_code,error_type:maybe.error_type,error_message:maybe.error_message,error_url:maybe.error_url,request_id:typeof maybe.request_id==='string'?maybe.request_id:undefined,error_details:_typeof$1(maybe.error_details)==='object'?maybe.error_details:undefined});}}var message=err instanceof Error?err.message:'Unknown error: '+String(err);return new StytchAPIError({status_code:400,error_type:'unknown_error',error_message:message,error_url:'',request_id:undefined,error_details:undefined});}}]);}(StytchError);var StytchSDKError=/*#__PURE__*/function(_StytchError4){function StytchSDKError(name,description,options){var _this8;_classCallCheck$1(this,StytchSDKError);_this8=_callSuper$1(this,StytchSDKError,[name,description]);_this8.options=options;return _this8;}_inherits$1(StytchSDKError,_StytchError4);return _createClass$1(StytchSDKError);}(StytchError);var NoCurrentSessionError=/*#__PURE__*/function(_StytchSDKError){function NoCurrentSessionError(){_classCallCheck$1(this,NoCurrentSessionError);return _callSuper$1(this,NoCurrentSessionError,['NoCurrentSessionError','There is no session currently available. Make sure the user is authenticated with a valid session.']);}_inherits$1(NoCurrentSessionError,_StytchSDKError);return _createClass$1(NoCurrentSessionError);}(StytchSDKError);var InternalError=/*#__PURE__*/function(_StytchSDKError2){function InternalError(error){var _this9;_classCallCheck$1(this,InternalError);_this9=_callSuper$1(this,InternalError,[error.name?error.name:'Internal Error',error.message?error.message:'An internal error has occurred. Please contact Stytch if this occurs.']);_this9.nativeStack=error.nativeStackAndroid||error.nativeStackIOS;return _this9;}_inherits$1(InternalError,_StytchSDKError2);return _createClass$1(InternalError);}(StytchSDKError);var NoBiometricsRegistrationError=/*#__PURE__*/function(_StytchSDKError3){function NoBiometricsRegistrationError(){_classCallCheck$1(this,NoBiometricsRegistrationError);return _callSuper$1(this,NoBiometricsRegistrationError,['NoBiometricsRegistrationError','There is no biometric registration available. Authenticate with another method and add a new biometric registration first.']);}_inherits$1(NoBiometricsRegistrationError,_StytchSDKError3);return _createClass$1(NoBiometricsRegistrationError);}(StytchSDKError);var BiometricsUnavailableError=/*#__PURE__*/function(_StytchSDKError4){function BiometricsUnavailableError(){_classCallCheck$1(this,BiometricsUnavailableError);return _callSuper$1(this,BiometricsUnavailableError,['BiometricsUnavailableError','Biometrics is not available on the device.']);}_inherits$1(BiometricsUnavailableError,_StytchSDKError4);return _createClass$1(BiometricsUnavailableError);}(StytchSDKError);var KeyInvalidatedError=/*#__PURE__*/function(_StytchSDKError5){function KeyInvalidatedError(){_classCallCheck$1(this,KeyInvalidatedError);return _callSuper$1(this,KeyInvalidatedError,['KeyInvalidatedError','The biometrics enrollment on the device has changed.']);}_inherits$1(KeyInvalidatedError,_StytchSDKError5);return _createClass$1(KeyInvalidatedError);}(StytchSDKError);var KeystoreUnavailableError=/*#__PURE__*/function(_StytchSDKError6){function KeystoreUnavailableError(){_classCallCheck$1(this,KeystoreUnavailableError);return _callSuper$1(this,KeystoreUnavailableError,['KeystoreUnavailableError','The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true.']);}_inherits$1(KeystoreUnavailableError,_StytchSDKError6);return _createClass$1(KeystoreUnavailableError);}(StytchSDKError);var NoBiometricsEnrolledError=/*#__PURE__*/function(_StytchSDKError7){function NoBiometricsEnrolledError(){_classCallCheck$1(this,NoBiometricsEnrolledError);return _callSuper$1(this,NoBiometricsEnrolledError,['NoBiometricsEnrolledError','There is no biometric factor enrolled on the device. Add a biometric factor in the device settings.']);}_inherits$1(NoBiometricsEnrolledError,_StytchSDKError7);return _createClass$1(NoBiometricsEnrolledError);}(StytchSDKError);var BiometricsAlreadyEnrolledError=/*#__PURE__*/function(_StytchSDKError8){function BiometricsAlreadyEnrolledError(){_classCallCheck$1(this,BiometricsAlreadyEnrolledError);return _callSuper$1(this,BiometricsAlreadyEnrolledError,['BiometricsAlreadyEnrolledError','There is already a biometric factor enrolled on this device. Fully authenticate with all factors and remove the existing registration before attempting to register again.']);}_inherits$1(BiometricsAlreadyEnrolledError,_StytchSDKError8);return _createClass$1(BiometricsAlreadyEnrolledError);}(StytchSDKError);var UserCancellationError=/*#__PURE__*/function(_StytchSDKError9){function UserCancellationError(){_classCallCheck$1(this,UserCancellationError);return _callSuper$1(this,UserCancellationError,['UserCancellationError','The user canceled the prompt. Ask the user to try again.']);}_inherits$1(UserCancellationError,_StytchSDKError9);return _createClass$1(UserCancellationError);}(StytchSDKError);var UserLockedOutError=/*#__PURE__*/function(_StytchSDKError0){function UserLockedOutError(){_classCallCheck$1(this,UserLockedOutError);return _callSuper$1(this,UserLockedOutError,['UserLockedOutError','The user has been locked out due to too many failed attempts. Ask the user to try again later.']);}_inherits$1(UserLockedOutError,_StytchSDKError0);return _createClass$1(UserLockedOutError);}(StytchSDKError);var DeviceCredentialsNotAllowedError=/*#__PURE__*/function(_StytchSDKError1){function DeviceCredentialsNotAllowedError(){_classCallCheck$1(this,DeviceCredentialsNotAllowedError);return _callSuper$1(this,DeviceCredentialsNotAllowedError,['DeviceCredentialsNotAllowedError','The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods.']);}_inherits$1(DeviceCredentialsNotAllowedError,_StytchSDKError1);return _createClass$1(DeviceCredentialsNotAllowedError);}(StytchSDKError);var MissingGoogleClientIDError=/*#__PURE__*/function(_StytchSDKError10){function MissingGoogleClientIDError(){_classCallCheck$1(this,MissingGoogleClientIDError);return _callSuper$1(this,MissingGoogleClientIDError,['MissingGoogleClientIDError','No Google client ID was found in the project.']);}_inherits$1(MissingGoogleClientIDError,_StytchSDKError10);return _createClass$1(MissingGoogleClientIDError);}(StytchSDKError);var MissingPKCEError=/*#__PURE__*/function(_StytchSDKError11){function MissingPKCEError(){_classCallCheck$1(this,MissingPKCEError);return _callSuper$1(this,MissingPKCEError,['MissingPKCEError','Make sure this flow is completed on the same device on which it was started.']);}_inherits$1(MissingPKCEError,_StytchSDKError11);return _createClass$1(MissingPKCEError);}(StytchSDKError);var MissingAuthorizationCredentialIDTokenError=/*#__PURE__*/function(_StytchSDKError12){function MissingAuthorizationCredentialIDTokenError(){_classCallCheck$1(this,MissingAuthorizationCredentialIDTokenError);return _callSuper$1(this,MissingAuthorizationCredentialIDTokenError,['MissingAuthorizationCredentialIDTokenError','The authorization credential is missing an ID token.']);}_inherits$1(MissingAuthorizationCredentialIDTokenError,_StytchSDKError12);return _createClass$1(MissingAuthorizationCredentialIDTokenError);}(StytchSDKError);var InvalidAuthorizationCredentialError=/*#__PURE__*/function(_StytchSDKError13){function InvalidAuthorizationCredentialError(){_classCallCheck$1(this,InvalidAuthorizationCredentialError);return _callSuper$1(this,InvalidAuthorizationCredentialError,['InvalidAuthorizationCredentialError','The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method.']);}_inherits$1(InvalidAuthorizationCredentialError,_StytchSDKError13);return _createClass$1(InvalidAuthorizationCredentialError);}(StytchSDKError);var NoCredentialsPresentError=/*#__PURE__*/function(_StytchSDKError14){function NoCredentialsPresentError(){_classCallCheck$1(this,NoCredentialsPresentError);return _callSuper$1(this,NoCredentialsPresentError,['NoCredentialsPresentError','The user did not provide credentials for a Google OneTap attempt']);}_inherits$1(NoCredentialsPresentError,_StytchSDKError14);return _createClass$1(NoCredentialsPresentError);}(StytchSDKError);var MissingPublicKeyError=/*#__PURE__*/function(_StytchSDKError15){function MissingPublicKeyError(){_classCallCheck$1(this,MissingPublicKeyError);return _callSuper$1(this,MissingPublicKeyError,['MissingPublicKeyError','Failed to retrieve the public key. Add a new biometric registration.']);}_inherits$1(MissingPublicKeyError,_StytchSDKError15);return _createClass$1(MissingPublicKeyError);}(StytchSDKError);var ChallengeSigningFailedError=/*#__PURE__*/function(_StytchSDKError16){function ChallengeSigningFailedError(){_classCallCheck$1(this,ChallengeSigningFailedError);return _callSuper$1(this,ChallengeSigningFailedError,['ChallengeSigningFailedError','Failed to sign the challenge with the key.']);}_inherits$1(ChallengeSigningFailedError,_StytchSDKError16);return _createClass$1(ChallengeSigningFailedError);}(StytchSDKError);var SDKNotConfiguredError=/*#__PURE__*/function(_StytchSDKError17){function SDKNotConfiguredError(){_classCallCheck$1(this,SDKNotConfiguredError);return _callSuper$1(this,SDKNotConfiguredError,['SDKNotConfiguredError','Stytch client is not confiured. You must call the configure method before using the SDK']);}_inherits$1(SDKNotConfiguredError,_StytchSDKError17);return _createClass$1(SDKNotConfiguredError);}(StytchSDKError);var FailedCodeChallengeError=/*#__PURE__*/function(_StytchSDKError18){function FailedCodeChallengeError(){_classCallCheck$1(this,FailedCodeChallengeError);return _callSuper$1(this,FailedCodeChallengeError,['FailedCodeChallengeError','Failed to create a code challenge']);}_inherits$1(FailedCodeChallengeError,_StytchSDKError18);return _createClass$1(FailedCodeChallengeError);}(StytchSDKError);var PasskeysUnsupportedError=/*#__PURE__*/function(_StytchSDKError19){function PasskeysUnsupportedError(){_classCallCheck$1(this,PasskeysUnsupportedError);return _callSuper$1(this,PasskeysUnsupportedError,['PasskeysUnsupportedError','Passkeys are not supported on this device']);}_inherits$1(PasskeysUnsupportedError,_StytchSDKError19);return _createClass$1(PasskeysUnsupportedError);}(StytchSDKError);var FailedToDecryptDataError=/*#__PURE__*/function(_StytchSDKError20){function FailedToDecryptDataError(){_classCallCheck$1(this,FailedToDecryptDataError);return _callSuper$1(this,FailedToDecryptDataError,['FailedToDecryptDataError','Failed to decrypt user data']);}_inherits$1(FailedToDecryptDataError,_StytchSDKError20);return _createClass$1(FailedToDecryptDataError);}(StytchSDKError);var BiometricsFailedError=/*#__PURE__*/function(_StytchSDKError21){function BiometricsFailedError(){_classCallCheck$1(this,BiometricsFailedError);return _callSuper$1(this,BiometricsFailedError,['BiometricsFailedError','Biometric authentication failed']);}_inherits$1(BiometricsFailedError,_StytchSDKError21);return _createClass$1(BiometricsFailedError);}(StytchSDKError);var InvalidStartUrlError=/*#__PURE__*/function(_StytchSDKError22){function InvalidStartUrlError(){_classCallCheck$1(this,InvalidStartUrlError);return _callSuper$1(this,InvalidStartUrlError,['InvalidStartUrlError','The start URL was invalid or improperly formatted.']);}_inherits$1(InvalidStartUrlError,_StytchSDKError22);return _createClass$1(InvalidStartUrlError);}(StytchSDKError);var InvalidRedirectSchemeError=/*#__PURE__*/function(_StytchSDKError23){function InvalidRedirectSchemeError(){_classCallCheck$1(this,InvalidRedirectSchemeError);return _callSuper$1(this,InvalidRedirectSchemeError,['InvalidRedirectSchemeError','The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls.']);}_inherits$1(InvalidRedirectSchemeError,_StytchSDKError23);return _createClass$1(InvalidRedirectSchemeError);}(StytchSDKError);var MissingUrlError=/*#__PURE__*/function(_StytchSDKError24){function MissingUrlError(){_classCallCheck$1(this,MissingUrlError);return _callSuper$1(this,MissingUrlError,['MissingUrlError','The underlying web authentication service failed to return a URL.']);}_inherits$1(MissingUrlError,_StytchSDKError24);return _createClass$1(MissingUrlError);}(StytchSDKError);var InvalidCredentialTypeError=/*#__PURE__*/function(_StytchSDKError25){function InvalidCredentialTypeError(){_classCallCheck$1(this,InvalidCredentialTypeError);return _callSuper$1(this,InvalidCredentialTypeError,['InvalidCredentialTypeError','The public key credential type was not of the expected type.']);}_inherits$1(InvalidCredentialTypeError,_StytchSDKError25);return _createClass$1(InvalidCredentialTypeError);}(StytchSDKError);var MissingAttestationObjectError=/*#__PURE__*/function(_StytchSDKError26){function MissingAttestationObjectError(){_classCallCheck$1(this,MissingAttestationObjectError);return _callSuper$1(this,MissingAttestationObjectError,['MissingAttestationObjectError','The public key credential is missing the attestation object.']);}_inherits$1(MissingAttestationObjectError,_StytchSDKError26);return _createClass$1(MissingAttestationObjectError);}(StytchSDKError);var JSONDataNotConvertibleToStringError=/*#__PURE__*/function(_StytchSDKError27){function JSONDataNotConvertibleToStringError(){_classCallCheck$1(this,JSONDataNotConvertibleToStringError);return _callSuper$1(this,JSONDataNotConvertibleToStringError,['JSONDataNotConvertibleToStringError','JSON data unable to be converted to String type.']);}_inherits$1(JSONDataNotConvertibleToStringError,_StytchSDKError27);return _createClass$1(JSONDataNotConvertibleToStringError);}(StytchSDKError);var RandomNumberGenerationFailed=/*#__PURE__*/function(_StytchSDKError28){function RandomNumberGenerationFailed(){_classCallCheck$1(this,RandomNumberGenerationFailed);return _callSuper$1(this,RandomNumberGenerationFailed,['RandomNumberGenerationFailed','Random number generation failed']);}_inherits$1(RandomNumberGenerationFailed,_StytchSDKError28);return _createClass$1(RandomNumberGenerationFailed);}(StytchSDKError);var PasskeysInvalidEncoding=/*#__PURE__*/function(_StytchSDKError29){function PasskeysInvalidEncoding(){_classCallCheck$1(this,PasskeysInvalidEncoding);return _callSuper$1(this,PasskeysInvalidEncoding,['PasskeysInvalidEncoding','Invalid passkey encoding']);}_inherits$1(PasskeysInvalidEncoding,_StytchSDKError29);return _createClass$1(PasskeysInvalidEncoding);}(StytchSDKError);var PasskeysMisconfigured=/*#__PURE__*/function(_StytchSDKError30){function PasskeysMisconfigured(){_classCallCheck$1(this,PasskeysMisconfigured);return _callSuper$1(this,PasskeysMisconfigured,['PasskeysMisconfigured','Passkeys are misconfigured. Verify that you have added the correct associated domain for your application, and that the signing information is correct.']);}_inherits$1(PasskeysMisconfigured,_StytchSDKError30);return _createClass$1(PasskeysMisconfigured);}(StytchSDKError);var SignInWithAppleMisconfigured=/*#__PURE__*/function(_StytchSDKError31){function SignInWithAppleMisconfigured(){_classCallCheck$1(this,SignInWithAppleMisconfigured);return _callSuper$1(this,SignInWithAppleMisconfigured,['SignInWithAppleMisconfigured','Sign In With Apple is misconfigured. Verify that you have correctly configured Apple OAuth in the Stytch Dashboard and added the Sign In With Apple capability to your project.']);}_inherits$1(SignInWithAppleMisconfigured,_StytchSDKError31);return _createClass$1(SignInWithAppleMisconfigured);}(StytchSDKError);var MissingCipherIv=/*#__PURE__*/function(_StytchSDKError32){function MissingCipherIv(){_classCallCheck$1(this,MissingCipherIv);return _callSuper$1(this,MissingCipherIv,['MissingCipherIv','The expected cipher Iv was not found when attempting to decrypt an existing biometric key.']);}_inherits$1(MissingCipherIv,_StytchSDKError32);return _createClass$1(MissingCipherIv);}(StytchSDKError);var InvalidPrivateKeyLength=/*#__PURE__*/function(_StytchSDKError33){function InvalidPrivateKeyLength(){_classCallCheck$1(this,InvalidPrivateKeyLength);return _callSuper$1(this,InvalidPrivateKeyLength,['InvalidPrivateKeyLength',"The private key was of an incorrect length."]);}_inherits$1(InvalidPrivateKeyLength,_StytchSDKError33);return _createClass$1(InvalidPrivateKeyLength);}(StytchSDKError);var BiometricRegistrationIdIsNullOrBlank=/*#__PURE__*/function(_StytchSDKError34){function BiometricRegistrationIdIsNullOrBlank(){_classCallCheck$1(this,BiometricRegistrationIdIsNullOrBlank);return _callSuper$1(this,BiometricRegistrationIdIsNullOrBlank,['BiometricRegistrationIdIsNullOrBlank','Attempted to set a blank or null biometric registration ID. This is not allowed, and indicates no registration was created on the server. Consider deleting any local keys that may have been generated.']);}_inherits$1(BiometricRegistrationIdIsNullOrBlank,_StytchSDKError34);return _createClass$1(BiometricRegistrationIdIsNullOrBlank);}(StytchSDKError);var DFPNotConfigured=/*#__PURE__*/function(_StytchSDKError35){function DFPNotConfigured(){_classCallCheck$1(this,DFPNotConfigured);return _callSuper$1(this,DFPNotConfigured,['DFPNotConfigured','You have attempted to retrieve a telemetry ID before the DFP client has been configured.']);}_inherits$1(DFPNotConfigured,_StytchSDKError35);return _createClass$1(DFPNotConfigured);}(StytchSDKError);var IDPOAuthFlowMissingParamError=/*#__PURE__*/function(_StytchSDKError36){function IDPOAuthFlowMissingParamError(details){_classCallCheck$1(this,IDPOAuthFlowMissingParamError);return _callSuper$1(this,IDPOAuthFlowMissingParamError,['IDPOAuthFlowMissingParamError',details]);}_inherits$1(IDPOAuthFlowMissingParamError,_StytchSDKError36);return _createClass$1(IDPOAuthFlowMissingParamError);}(StytchSDKError);function errorToStytchError(error){switch(error.message){case'no_current_session':return new NoCurrentSessionError();case'no_biometrics_registration':return new NoBiometricsRegistrationError();case'biometrics_unavailable':return new BiometricsUnavailableError();case'key_invalidated':return new KeyInvalidatedError();case'device_hardware_error':return new BiometricsUnavailableError();case'biometrics_not_available':return new BiometricsUnavailableError();case'no_biometrics_enrolled':return new NoBiometricsEnrolledError();case'keystore_unavailable':return new KeystoreUnavailableError();case'no_biometric_key':return new KeyInvalidatedError();case'device_credentials_not_allowed':return new DeviceCredentialsNotAllowedError();case'user_cancellation':return new UserCancellationError();case'user_locked_out':return new UserLockedOutError();case'google_onetap_missing_id_token':return new MissingAuthorizationCredentialIDTokenError();case'google_onetap_missing_member':return new InvalidAuthorizationCredentialError();case'oauth_apple_missing_id_token':return new MissingAuthorizationCredentialIDTokenError();case'oauth_apple_credential_invalid':return new InvalidAuthorizationCredentialError();case'missing_public_key':return new MissingPublicKeyError();case'challenge_signing_failed':return new ChallengeSigningFailedError();case'missing_authorization_credential_id_token':return new MissingAuthorizationCredentialIDTokenError();case'invalid_authorization_credential':return new InvalidAuthorizationCredentialError();case'no_credentials_present':return new NoCredentialsPresentError();case'sdk_not_configured':return new SDKNotConfiguredError();case'failed_code_challenge':return new FailedCodeChallengeError();case'passkeys_unsupported':return new PasskeysUnsupportedError();case'failed_to_decrypt_data':return new FailedToDecryptDataError();case'biometrics_failed':return new BiometricsFailedError();case'invalid_start_url':return new InvalidStartUrlError();case'invalid_redirect_scheme':return new InvalidRedirectSchemeError();case'missing_url':return new MissingUrlError();case'invalid_credential_type':return new InvalidCredentialTypeError();case'missing_attestation_object':return new MissingAttestationObjectError();case'json_data_not_convertible_to_string':return new JSONDataNotConvertibleToStringError();case'random_number_generation_failed':return new RandomNumberGenerationFailed();case'passkeys_invalid_encoding':return new PasskeysInvalidEncoding();case'passkeys_misconfigured':return new PasskeysMisconfigured();case'signinwithapple_misconfigured':return new SignInWithAppleMisconfigured();case'missing_cipher_iv':return new MissingCipherIv();case'invalid_private_key_length':return new InvalidPrivateKeyLength();case'biometric_registration_id_is_null_or_blank':return new BiometricRegistrationIdIsNullOrBlank();case'dfp_not_configured':return new DFPNotConfigured();default:return new InternalError(error);}}var B2BProducts;(function(B2BProducts){B2BProducts["emailMagicLinks"]="emailMagicLinks";B2BProducts["emailOtp"]="emailOtp";B2BProducts["sso"]="sso";B2BProducts["passwords"]="passwords";B2BProducts["oauth"]="oauth";})(B2BProducts||(B2BProducts={}));var AuthFlowType;(function(AuthFlowType){AuthFlowType["Discovery"]="Discovery";AuthFlowType["Organization"]="Organization";AuthFlowType["PasswordReset"]="PasswordReset";})(AuthFlowType||(AuthFlowType={}));var RedirectURLType;(function(RedirectURLType){RedirectURLType["ResetPassword"]="reset_password";})(RedirectURLType||(RedirectURLType={}));var B2BMFAProducts;(function(B2BMFAProducts){B2BMFAProducts["smsOtp"]="smsOtp";B2BMFAProducts["totp"]="totp";})(B2BMFAProducts||(B2BMFAProducts={}));var B2BOAuthProviders;(function(B2BOAuthProviders){B2BOAuthProviders["Google"]="google";B2BOAuthProviders["Microsoft"]="microsoft";B2BOAuthProviders["HubSpot"]="hubspot";B2BOAuthProviders["Slack"]="slack";B2BOAuthProviders["GitHub"]="github";})(B2BOAuthProviders||(B2BOAuthProviders={}));function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l);else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this;}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]";}),(_regenerator=function _regenerator(){return{w:i,m:f};})();}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine2(e,r,n,t);}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r);if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return String(t);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}var TEST_API_URL='https://test.stytch.com';var LIVE_API_URL='https://api.stytch.com';var CLIENTSIDE_SERVICES_IFRAME_URL='https://js.stytch.com/clientside-services/index.html';var STYTCH_DFP_BACKEND_URL="https://telemetry.stytch.com";var STYTCH_DFP_CDN_URL="https://elements.stytch.com";var GOOGLE_ONE_TAP_HOST='https://accounts.google.com/gsi';var GOOGLE_ONE_TAP_SCRIPT_URL="".concat(GOOGLE_ONE_TAP_HOST,"/client");var DEFAULT_SESSION_DURATION_MINUTES=30;var DEFAULT_OTP_EXPIRATION_MINUTES=5;var MULTIPLE_STYTCH_CLIENTS_DETECTED_WARNING="It looks like you're creating multiple copies of the Stytch client."+' This behavior is unsupported, and unintended side effects may occur. '+"Make sure you are creating the Stytch client at the global level, and not inside a component's render function.";var RetriableErrorType;(function(RetriableErrorType){RetriableErrorType["RequiredCaptcha"]="CAPTCHA required";})(RetriableErrorType||(RetriableErrorType={}));var RetriableError=/*#__PURE__*/function(_Error){function RetriableError(type){var _this;_classCallCheck(this,RetriableError);_this=_callSuper(this,RetriableError,[type]);_this.type=type;return _this;}_inherits(RetriableError,_Error);return _createClass(RetriableError);}(/*#__PURE__*/_wrapNativeSuper(Error));function _retriableFetchSDK(_ref){var method=_ref.method,finalURL=_ref.finalURL,basicAuthHeader=_ref.basicAuthHeader,xSDKClientHeader=_ref.xSDKClientHeader,xSDKParentHostHeader=_ref.xSDKParentHostHeader,body=_ref.body,retryCallback=_ref.retryCallback;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee(){var req,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:req={method:method,finalURL:finalURL,basicAuthHeader:basicAuthHeader,xSDKClientHeader:xSDKClientHeader,xSDKParentHostHeader:xSDKParentHostHeader,body:body};_context.p=1;_context.n=2;return baseFetchSDK(req);case 2:return _context.a(2,_context.v);case 3:_context.p=3;_t=_context.v;if(!(_t instanceof RetriableError)){_context.n=6;break;}_context.n=4;return retryCallback(_t,req);case 4:req=_context.v;_context.n=5;return baseFetchSDK(req);case 5:return _context.a(2,_context.v);case 6:throw _t;case 7:return _context.a(2);}},_callee,null,[[1,3]]);}));}function baseFetchSDK(_ref2){var method=_ref2.method,finalURL=_ref2.finalURL,basicAuthHeader=_ref2.basicAuthHeader,xSDKClientHeader=_ref2.xSDKClientHeader,xSDKParentHostHeader=_ref2.xSDKParentHostHeader,body=_ref2.body;var _a;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee2(){var headers,fetchOpts,resp,_respData,respError,respData,_t2;return _regenerator().w(function(_context2){while(1)switch(_context2.p=_context2.n){case 0:headers={Authorization:basicAuthHeader,'Content-Type':'application/json','X-SDK-Client':xSDKClientHeader};if(xSDKParentHostHeader){headers['X-SDK-Parent-Host']=xSDKParentHostHeader;}fetchOpts={method:method,headers:headers,body:body&&JSON.stringify(body),credentials:'include'};_context2.p=1;_context2.n=2;return fetch(finalURL,fetchOpts);case 2:resp=_context2.v;_context2.n=5;break;case 3:_context2.p=3;_t2=_context2.v;if(!(_t2.message==='Failed to fetch')){_context2.n=4;break;}throw new StytchAPIUnreachableError('Unable to contact our servers.');case 4:throw _t2;case 5:if(!(resp.status<=299)){_context2.n=9;break;}_context2.p=6;_context2.n=7;return resp.json();case 7:_respData=_context2.v;return _context2.a(2,_respData.data);case 8:_context2.p=8;_context2.v;throw new StytchAPIUnreachableError('Invalid JSON response from our servers.');case 9:if(!(resp.status!==200&&((_a=resp.headers.get('content-type'))===null||_a===void 0?void 0:_a.includes('application/json')))){_context2.n=15;break;}_context2.p=10;_context2.n=11;return resp.json();case 11:respError=_context2.v;_context2.n=13;break;case 12:_context2.p=12;_context2.v;throw new StytchAPIUnreachableError('Invalid or no response from server');case 13:if(!('body'in respError||'params'in respError||'query'in respError)){_context2.n=14;break;}throw new StytchAPISchemaError(respError);case 14:throw new StytchAPIError(respError);case 15:_context2.p=15;_context2.n=16;return resp.text();case 16:respData=_context2.v;_context2.n=18;break;case 17:_context2.p=17;_context2.v;throw new StytchAPIUnreachableError('Invalid response from our servers.');case 18:if(!respData.includes('Captcha required')){_context2.n=19;break;}throw new RetriableError(RetriableErrorType.RequiredCaptcha);case 19:throw new StytchAPIUnreachableError('Invalid response from our servers.');case 20:return _context2.a(2);}},_callee2,null,[[15,17],[10,12],[6,8],[1,3]]);}));}function baseSubmitFormSDK(_ref3){var method=_ref3.method,finalURL=_ref3.finalURL,basicAuthHeader=_ref3.basicAuthHeader,xSDKClientHeader=_ref3.xSDKClientHeader,xSDKParentHostHeader=_ref3.xSDKParentHostHeader,body=_ref3.body;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee3(){var bodyParams,finalBody,children,form;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:bodyParams=body||{};finalBody=Object.assign(Object.assign({},bodyParams),{__Authorization:basicAuthHeader,'__X-SDK-Client':xSDKClientHeader});if(xSDKParentHostHeader){finalBody['__X-SDK-Parent-Host']=xSDKParentHostHeader;}children=Object.entries(finalBody).map(function(_ref4){var _ref5=_slicedToArray(_ref4,2),key=_ref5[0],value=_ref5[1];var input=document.createElement('input');input.type='hidden';input.name=key;input.value=value;return input;});form=document.createElement('form');form.method=method;form.action=finalURL;form.append.apply(form,_toConsumableArray(children));document.body.appendChild(form);form.submit();case 1:return _context3.a(2);}},_callee3);}));}var getRandomValues;var rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){getRandomValues=typeof crypto!=='undefined'&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!=='undefined'&&typeof msCrypto.getRandomValues==='function'&&msCrypto.getRandomValues.bind(msCrypto);if(!getRandomValues){throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');}}return getRandomValues(rnds8);}var REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate$1(uuid){return typeof uuid==='string'&&REGEX.test(uuid);}var byteToHex=[];for(var i$3=0;i$3<256;++i$3){byteToHex.push((i$3+0x100).toString(16).substr(1));}function stringify(arr){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var uuid=(byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+'-'+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+'-'+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+'-'+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+'-'+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]).toLowerCase();if(!validate$1(uuid)){throw TypeError('Stringified UUID is invalid');}return uuid;}function v4(options,buf,offset){options=options||{};var rnds=options.random||(options.rng||rng)();rnds[6]=rnds[6]&0x0f|0x40;rnds[8]=rnds[8]&0x3f|0x80;return stringify(rnds);}var ModulePromiseCache={};function loadESModule(url,moduleFromGlobalScope){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee4(){return _regenerator().w(function(_context4){while(1)switch(_context4.n){case 0:if(!(ModulePromiseCache[url]!==undefined)){_context4.n=1;break;}return _context4.a(2,ModulePromiseCache[url]);case 1:ModulePromiseCache[url]=loadESModuleFromNetwork(url,moduleFromGlobalScope);return _context4.a(2,ModulePromiseCache[url]);}},_callee4);}));}function loadESModuleFromNetwork(url,moduleFromGlobalScope){return new Promise(function(resolve,reject){var maybeScript=findScript(url);if(maybeScript&&maybeScript.dataset.loaded==='true'){try{resolve(moduleFromGlobalScope());}catch(err){return reject(new Error("".concat(url," already loaded, but module was not found in global scope: ").concat(err)));}}var script=createScript(url);script.addEventListener('load',function(){script.dataset.loaded='true';try{resolve(moduleFromGlobalScope());}catch(err){reject(new Error("".concat(url," was loaded, but module was not found in global scope: ").concat(err)));}});script.addEventListener('error',function(err){reject(new Error("".concat(url," could not be loaded: ").concat(err)));});});}var findScriptsInDom=function findScriptsInDom(url){return document.querySelectorAll("script[src=\"".concat(url,"\"]"));};function findScript(url){var scripts=findScriptsInDom(url);if(scripts[0]){return scripts[0];}}function createScript(url){var script=document.createElement('script');script.setAttribute('src',url);script.setAttribute('async','true');script.setAttribute('defer','true');document.head.appendChild(script);return script;}var getHttpsUrl=function getHttpsUrl(urlOrDomain){try{var url=new URL(urlOrDomain);return"https://".concat(url.hostname);}catch(_a){}try{var _url=new URL("https://".concat(urlOrDomain));return"https://".concat(_url.hostname);}catch(_b){}return undefined;};var STYTCH_BADGE=['[Stytch]'];var DEBUG=false;var logger={debug:function debug(){return DEBUG;},log:function log(){var _console;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return(_console=console).log.apply(_console,STYTCH_BADGE.concat(args));},warn:function warn(){var _console2;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}return(_console2=console).warn.apply(_console2,STYTCH_BADGE.concat(args));},error:function error(){var _console3;for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3];}return(_console3=console).error.apply(_console3,STYTCH_BADGE.concat(args));}};var getLiveApiURL=function getLiveApiURL(opts){var _a,_b,_c,_d;var domain=(_a=opts===null||opts===void 0?void 0:opts.customBaseUrl)!==null&&_a!==void 0?_a:(_b=opts===null||opts===void 0?void 0:opts.endpointOptions)===null||_b===void 0?void 0:_b.apiDomain;if(domain){var httpsUrl=getHttpsUrl(domain);if(httpsUrl){return httpsUrl;}else{var key=(opts===null||opts===void 0?void 0:opts.customBaseUrl)?'customBaseUrl':'apiDomain';logger.warn("Unable to use custom API domain `".concat(domain,"`. ").concat(key," should be a valid domain."));}}return(_d=(_c=opts===null||opts===void 0?void 0:opts.endpoints)===null||_c===void 0?void 0:_c.liveAPIURL)!==null&&_d!==void 0?_d:LIVE_API_URL;};var getTestApiURL=function getTestApiURL(opts){var _a,_b,_c,_d;var domain=(_a=opts===null||opts===void 0?void 0:opts.customBaseUrl)!==null&&_a!==void 0?_a:(_b=opts===null||opts===void 0?void 0:opts.endpointOptions)===null||_b===void 0?void 0:_b.testApiDomain;if(domain){var httpsUrl=getHttpsUrl(domain);if(httpsUrl){return httpsUrl;}else{var key=(opts===null||opts===void 0?void 0:opts.customBaseUrl)?'customBaseUrl':'testApiDomain';logger.warn("Unable to use custom API domain `".concat(domain,"`. ").concat(key," should be a valid domain."));}}return(_d=(_c=opts===null||opts===void 0?void 0:opts.endpoints)===null||_c===void 0?void 0:_c.testAPIURL)!==null&&_d!==void 0?_d:TEST_API_URL;};var trailer="\nYou can find your public token at https://stytch.com/dashboard/api-keys.";var checkPublicToken=function checkPublicToken(publicToken){if(typeof publicToken!=='string'){logger.warn("Public token is malformed. Expected a string, got ".concat(_typeof(publicToken),".").concat(trailer));}else if(publicToken===''){logger.warn("Public token is malformed. Expected \"public-token-...\", got an empty string.".concat(trailer));}else if(!publicToken.startsWith('public-token-')){logger.warn("Public token is malformed. Expected \"public-token-...\", got ".concat(publicToken,".").concat(trailer));}};var checkNotSSR=function checkNotSSR(clientName){var factoryFunctionName=clientName==='StytchUIClient'?'createStytchUIClient':'createStytchHeadlessClient';if(typeof window==='undefined'){throw new Error("`new ".concat(clientName,"()` is not supported in server environments. If using @stytch/react or @stytch/nextjs, use `").concat(factoryFunctionName,"()` instead."));}};var COUNTRIES_LIST={US:'1',AX:'358',AS:'1684',AG:'1268',AI:'1264',AR:'54',AT:'43',AU:'61',BE:'32',BJ:'229',BO:'591',BR:'55',IO:'246',BN:'673',BG:'359',BF:'226',CM:'237',CA:'1',BQ:'599',CF:'236',CL:'56',CX:'61',CC:'61',CO:'57',CD:'243',CK:'682',CR:'506',HR:'385',CZ:'420',DK:'45',DO:'1829',EC:'593',SV:'503',EE:'372',SZ:'268',FK:'500',FI:'358',FR:'33',GF:'594',DE:'49',GH:'233',GR:'30',GD:'1473',GT:'502',GG:'44',GW:'245',GY:'592',HU:'36',IS:'354',IN:'91',IE:'353',IM:'44',IT:'39',JM:'1876',JP:'81',KZ:'7',KE:'254',KI:'686',KR:'82',LV:'371',LT:'370',LU:'352',MO:'853',MT:'356',MH:'692',MR:'222',MU:'230',YT:'262',MX:'52',MC:'377',ME:'382',NR:'674',NL:'31',NZ:'64',NI:'505',NF:'672',NO:'47',PA:'507',PY:'595',PE:'51',PN:'870',PL:'48',PT:'351',PR:'1',RO:'40',BL:'590',SH:'290',KN:'1869',LC:'1758',MF:'590',PM:'508',SM:'378',ST:'239',SC:'248',SX:'599',SK:'421',SI:'386',ZA:'27',SS:'211',ES:'34',SR:'597',SJ:'47',SE:'46',CH:'41',TW:'886',TZ:'255',TK:'690',TO:'676',TT:'1868',TR:'90',UA:'380',GB:'44',UM:'1',UY:'598',VA:'379',EH:'212'};var getDFPBackendURL=function getDFPBackendURL(opts){var _a,_b,_c,_d;var domain=(_a=opts===null||opts===void 0?void 0:opts.dfppaUrl)!==null&&_a!==void 0?_a:(_b=opts===null||opts===void 0?void 0:opts.endpointOptions)===null||_b===void 0?void 0:_b.dfppaDomain;if(domain){var httpsUrl=getHttpsUrl(domain);if(httpsUrl){return httpsUrl;}else{var key=(opts===null||opts===void 0?void 0:opts.dfppaUrl)?'dfppaUrl':'dfppaDomain';logger.warn("Unable to use custom DFPPA domain `".concat(domain,"`. ").concat(key," should be a valid domain."));}}return(_d=(_c=opts===null||opts===void 0?void 0:opts.endpoints)===null||_c===void 0?void 0:_c.dfpBackendURL)!==null&&_d!==void 0?_d:STYTCH_DFP_BACKEND_URL;};var getDFPCdnURL=function getDFPCdnURL(opts){var _a,_b;var domain=(_a=opts===null||opts===void 0?void 0:opts.dfpCdnUrl)!==null&&_a!==void 0?_a:(_b=opts===null||opts===void 0?void 0:opts.endpointOptions)===null||_b===void 0?void 0:_b.dfpCdnDomain;if(domain){var httpsUrl=getHttpsUrl(domain);if(httpsUrl){return httpsUrl;}else{var key=(opts===null||opts===void 0?void 0:opts.dfpCdnUrl)?'dfpCdnUrl':'dfpCdnDomain';logger.warn("Unable to use custom DFP CDN domain `".concat(domain,"`. ").concat(key," should be a valid domain."));}}return STYTCH_DFP_CDN_URL;};function moveToFront(array,predicate){if(array.length<=1){return[array,false];}var matchingIndex=array.findIndex(predicate);if(matchingIndex===-1){return[array,false];}var reordered=_toConsumableArray(array);reordered.unshift.apply(reordered,_toConsumableArray(reordered.splice(matchingIndex,1)));return[reordered,true];}var arrayUtils={moveToFront:moveToFront};var isTestPublicToken=function isTestPublicToken(token){return token.includes('public-token-test');};var createEventId=function createEventId(){return"event-id-".concat(v4());};var createAppSessionId=function createAppSessionId(){return"app-session-id-".concat(v4());};var createPersistentId=function createPersistentId(){return"persistent-id-".concat(v4());};var validate=function validate(methodName){var validator={isObject:function isObject(fieldName,value){var isObject=_typeof(value)==='object'&&!Array.isArray(value)&&value!==null;if(!isObject){throw new StytchSDKUsageError(methodName,fieldName+' must be an object.');}return validator;},isOptionalObject:function isOptionalObject(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isObject(fieldName,value);},isString:function isString(fieldName,value){if(typeof value!=='string'){throw new StytchSDKUsageError(methodName,fieldName+' must be a string.');}return validator;},isOptionalString:function isOptionalString(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isString(fieldName,value);},isStringArray:function isStringArray(fieldName,value){if(!Array.isArray(value)){throw new StytchSDKUsageError(methodName,fieldName+' must be an array of strings.');}var _iterator=_createForOfIteratorHelper(value),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var str=_step.value;if(typeof str!=='string'){throw new StytchSDKUsageError(methodName,fieldName+' must be an array of strings.');}}}catch(err){_iterator.e(err);}finally{_iterator.f();}return validator;},isOptionalStringArray:function isOptionalStringArray(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isStringArray(fieldName,value);},isNumber:function isNumber(fieldName,value){if(typeof value!=='number'){throw new StytchSDKUsageError(methodName,fieldName+' must be a number.');}return validator;},isOptionalNumber:function isOptionalNumber(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isNumber(fieldName,value);},isBoolean:function isBoolean(fieldName,value){if(typeof value!=='boolean'){throw new StytchSDKUsageError(methodName,fieldName+' must be a boolean.');}return validator;},isOptionalBoolean:function isOptionalBoolean(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isBoolean(fieldName,value);}};return validator;};var removeResponseCommon=function removeResponseCommon(_a){var rest=__rest$1(_a,["request_id","status_code"]);return rest;};var omitUser=function omitUser(resp){var rest=__rest$1(resp,["__user"]);return rest;};var loadTelemetryJS=function loadTelemetryJS(domain){return loadESModule("".concat(domain,"/telemetry.js"),function(){return window.GetTelemetryID;});};var DFPProtectedAuthProvider=/*#__PURE__*/_createClass(function DFPProtectedAuthProvider(publicToken,dfpBackendURL,dfpCdnDomain,bootstrapPromise){var _this2=this;var executeRecaptcha=arguments.length>4&&arguments[4]!==undefined?arguments[4]:function(){return Promise.resolve(undefined);};_classCallCheck(this,DFPProtectedAuthProvider);this.bootstrapPromise=bootstrapPromise;this.isEnabled=function(){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee5(){return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:return _context5.a(2,this.state.then(function(state){return state.enabled;}));}},_callee5,this);}));};this.getTelemetryID=function(){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee6(){var _yield$this$state,publicToken,enabled,dfpBackendURL;return _regenerator().w(function(_context6){while(1)switch(_context6.n){case 0:_context6.n=1;return this.state;case 1:_yield$this$state=_context6.v;publicToken=_yield$this$state.publicToken;enabled=_yield$this$state.enabled;dfpBackendURL=_yield$this$state.dfpBackendURL;if(enabled){_context6.n=2;break;}return _context6.a(2,undefined);case 2:_context6.n=3;return window.GetTelemetryID(publicToken,"".concat(dfpBackendURL,"/submit"));case 3:return _context6.a(2,_context6.v);}},_callee6,this);}));};this.getDFPTelemetryIDAndCaptcha=function(){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee7(){var _yield$this$state2,enabled,executeRecaptcha,mode,dfp_telemetry_id,captcha_token;return _regenerator().w(function(_context7){while(1)switch(_context7.n){case 0:_context7.n=1;return this.state;case 1:_yield$this$state2=_context7.v;enabled=_yield$this$state2.enabled;executeRecaptcha=_yield$this$state2.executeRecaptcha;mode=_yield$this$state2.mode;dfp_telemetry_id=undefined;captcha_token=undefined;if(enabled){_context7.n=3;break;}_context7.n=2;return executeRecaptcha();case 2:captcha_token=_context7.v;case 3:if(!(mode==='DECISIONING')){_context7.n=5;break;}_context7.n=4;return this.getTelemetryID();case 4:dfp_telemetry_id=_context7.v;_context7.n=8;break;case 5:if(!(mode==='OBSERVATION')){_context7.n=8;break;}_context7.n=6;return this.getTelemetryID();case 6:dfp_telemetry_id=_context7.v;_context7.n=7;return executeRecaptcha();case 7:captcha_token=_context7.v;case 8:return _context7.a(2,{dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token});}},_callee7,this);}));};this.retryWithCaptchaAndDFP=function(e,req){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee8(){var _yield$this$state3,enabled,executeRecaptcha;return _regenerator().w(function(_context8){while(1)switch(_context8.n){case 0:_context8.n=1;return this.state;case 1:_yield$this$state3=_context8.v;enabled=_yield$this$state3.enabled;executeRecaptcha=_yield$this$state3.executeRecaptcha;if(!(e.type===RetriableErrorType.RequiredCaptcha&&enabled)){_context8.n=5;break;}if(!req.body){_context8.n=4;break;}_context8.n=2;return this.getTelemetryID();case 2:req.body.dfp_telemetry_id=_context8.v;_context8.n=3;return executeRecaptcha();case 3:req.body.captcha_token=_context8.v;case 4:return _context8.a(2,req);case 5:throw new Error('Unable to query captcha and/or dfp telemetry ID');case 6:return _context8.a(2);}},_callee8,this);}));};this.state=bootstrapPromise.then(function(bootstrapData){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee9(){return _regenerator().w(function(_context9){while(1)switch(_context9.n){case 0:if(bootstrapData.runDFPProtectedAuth){_context9.n=1;break;}return _context9.a(2,{publicToken:publicToken,dfpBackendURL:dfpBackendURL,enabled:false,loaded:false,executeRecaptcha:executeRecaptcha});case 1:_context9.n=2;return loadTelemetryJS(dfpCdnDomain);case 2:return _context9.a(2,{publicToken:publicToken,dfpBackendURL:dfpBackendURL,enabled:true,mode:bootstrapData.dfpProtectedAuthMode||'OBSERVATION',loaded:true,executeRecaptcha:executeRecaptcha});}},_callee9);}));});});var ErrorMarshaller=/*#__PURE__*/function(){function ErrorMarshaller(){_classCallCheck(this,ErrorMarshaller);}return _createClass(ErrorMarshaller,null,[{key:"inflate",value:function inflate(ErrorClass,ErrorData){var err=new ErrorClass(ErrorData);Object.assign(err,ErrorData);Object.setPrototypeOf(err,ErrorClass.prototype);return err;}},{key:"unmarshall",value:function unmarshall(error){if('name'in error){switch(error.name){case'SDKAPIUnreachableError':return ErrorMarshaller.inflate(SDKAPIUnreachableError,error);case'StytchSDKSchemaError':return ErrorMarshaller.inflate(StytchSDKSchemaError,error);case'StytchAPIUnreachableError':return ErrorMarshaller.inflate(StytchAPIUnreachableError,error);case'StytchAPISchemaError':return ErrorMarshaller.inflate(StytchAPISchemaError,error);case'StytchSDKAPIError':return ErrorMarshaller.inflate(StytchSDKAPIError,error);case'StytchAPIError':return ErrorMarshaller.inflate(StytchAPIError,error);case'TypeError':return ErrorMarshaller.inflate(TypeError,error);case'SyntaxError':return ErrorMarshaller.inflate(SyntaxError,error);case'ReferenceError':return ErrorMarshaller.inflate(ReferenceError,error);case'RangeError':return ErrorMarshaller.inflate(RangeError,error);case'EvalError':return ErrorMarshaller.inflate(EvalError,error);case'URIError':return ErrorMarshaller.inflate(URIError,error);}}return ErrorMarshaller.inflate(Error,error);}}]);}();var DEFAULT_MAX_BATCH_SIZE=15;var DEFAULT_INTERVAL_DURATION_MS=800;var EventLogger=/*#__PURE__*/function(){function EventLogger(args){_classCallCheck(this,EventLogger);this.maxBatchSize=args.maxBatchSize;this.logEventURL=args.logEventURL;setInterval(this.flush.bind(this),args.intervalDurationMs);this.batch=[];}return _createClass(EventLogger,[{key:"logEvent",value:function logEvent(telemetry,event){this.batch.push({telemetry:telemetry,event:event});if(this.batch.length>=this.maxBatchSize){this.flush();}}},{key:"flush",value:function flush(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee12(){var batchToSubmit;return _regenerator().w(function(_context12){while(1)switch(_context12.p=_context12.n){case 0:if(this.batch.length){_context12.n=1;break;}return _context12.a(2);case 1:batchToSubmit=this.batch;this.batch=[];_context12.p=2;_context12.n=3;return fetch(this.logEventURL,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(batchToSubmit)});case 3:_context12.n=5;break;case 4:_context12.p=4;_context12.v;case 5:return _context12.a(2);}},_callee12,this,[[2,4]]);}));}}]);}();var EmailSentType;(function(EmailSentType){EmailSentType["LoginOrCreateEML"]="login_or_create_eml";EmailSentType["LoginOrCreateOTP"]="login_or_create_otp";EmailSentType["ResetPassword"]="reset_password";})(EmailSentType||(EmailSentType={}));var HeadlessUserClient=/*#__PURE__*/_createClass(function HeadlessUserClient(_networkClient,_subscriptionService){var _this3=this;_classCallCheck(this,HeadlessUserClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.get=function(){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee13(){var resp,user;return _regenerator().w(function(_context13){while(1)switch(_context13.n){case 0:_context13.n=1;return this._networkClient.fetchSDK({url:'/users/me',method:'GET'});case 1:resp=_context13.v;user=removeResponseCommon(resp);this._subscriptionService.updateUser(user);return _context13.a(2,user);}},_callee13,this);}));};this.getSync=function(){return _this3._subscriptionService.getUser();};this.getInfo=function(){return{user:_this3.getSync(),fromCache:_this3._subscriptionService.getFromCache()};};this.update=function(options){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee14(){var resp,user;return _regenerator().w(function(_context14){while(1)switch(_context14.n){case 0:validate('stytch.user.update').isOptionalObject('untrusted_metadata',options.untrusted_metadata);_context14.n=1;return this._networkClient.fetchSDK({url:'/users/me',body:options,method:'PUT'});case 1:resp=_context14.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context14.a(2,omitUser(resp));}},_callee14,this);}));};this.deleteEmail=function(emailId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee15(){var resp,user;return _regenerator().w(function(_context15){while(1)switch(_context15.n){case 0:_context15.n=1;return this._networkClient.fetchSDK({url:"/users/emails/".concat(emailId),method:'DELETE'});case 1:resp=_context15.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context15.a(2,omitUser(resp));}},_callee15,this);}));};this.deletePhoneNumber=function(phoneId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee16(){var resp,user;return _regenerator().w(function(_context16){while(1)switch(_context16.n){case 0:_context16.n=1;return this._networkClient.fetchSDK({url:"/users/phone_numbers/".concat(phoneId),method:'DELETE'});case 1:resp=_context16.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context16.a(2,omitUser(resp));}},_callee16,this);}));};this.deleteTOTP=function(totpId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee17(){var resp,user;return _regenerator().w(function(_context17){while(1)switch(_context17.n){case 0:_context17.n=1;return this._networkClient.fetchSDK({url:"/users/totps/".concat(totpId),method:'DELETE'});case 1:resp=_context17.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context17.a(2,omitUser(resp));}},_callee17,this);}));};this.deleteCryptoWallet=function(cryptoWalletId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee18(){var resp,user;return _regenerator().w(function(_context18){while(1)switch(_context18.n){case 0:_context18.n=1;return this._networkClient.fetchSDK({url:"/users/crypto_wallets/".concat(cryptoWalletId),method:'DELETE'});case 1:resp=_context18.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context18.a(2,omitUser(resp));}},_callee18,this);}));};this.deleteOAuthRegistration=function(oauthUserRegistrationId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee19(){var resp,user;return _regenerator().w(function(_context19){while(1)switch(_context19.n){case 0:_context19.n=1;return this._networkClient.fetchSDK({url:"/users/oauth/".concat(oauthUserRegistrationId),method:'DELETE'});case 1:resp=_context19.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context19.a(2,omitUser(resp));}},_callee19,this);}));};this.deleteWebauthnRegistration=function(webAuthnId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee20(){var resp,user;return _regenerator().w(function(_context20){while(1)switch(_context20.n){case 0:_context20.n=1;return this._networkClient.fetchSDK({url:"/users/webauthn_registrations/".concat(webAuthnId),method:'DELETE'});case 1:resp=_context20.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context20.a(2,omitUser(resp));}},_callee20,this);}));};this.deleteBiometricRegistration=function(biometricRegistrationId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee21(){var resp,user;return _regenerator().w(function(_context21){while(1)switch(_context21.n){case 0:_context21.n=1;return this._networkClient.fetchSDK({url:"/users/biometric_registrations/".concat(biometricRegistrationId),method:'DELETE'});case 1:resp=_context21.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context21.a(2,omitUser(resp));}},_callee21,this);}));};this.onChange=function(callback){var lastVal=_this3._subscriptionService.getUser();var listener=function listener(state){var _a;if((state===null||state===void 0?void 0:state.user)!==lastVal){lastVal=(_a=state===null||state===void 0?void 0:state.user)!==null&&_a!==void 0?_a:null;callback(lastVal);}};return _this3._subscriptionService.subscribeToState(listener);};this.getConnectedApps=function(){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee22(){return _regenerator().w(function(_context22){while(1)switch(_context22.n){case 0:_context22.n=1;return this._networkClient.fetchSDK({url:'/users/connected_apps',method:'GET'});case 1:return _context22.a(2,_context22.v);}},_callee22,this);}));};this.revokedConnectedApp=function(connectedAppId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee23(){return _regenerator().w(function(_context23){while(1)switch(_context23.n){case 0:_context23.n=1;return this._networkClient.fetchSDK({url:"/users/connected_apps/".concat(connectedAppId,"/revoke"),method:'POST'});case 1:return _context23.a(2,_context23.v);}},_callee23,this);}));};});var HeadlessSessionClient=/*#__PURE__*/function(){function HeadlessSessionClient(_networkClient,_subscriptionService){var _this4=this;_classCallCheck(this,HeadlessSessionClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.getSync=function(){return _this4._subscriptionService.getSession();};this.getInfo=function(){var session=_this4.getSync();var fromCache=_this4._subscriptionService.getFromCache();return{session:session,fromCache:fromCache};};this.onChange=function(callback){var lastVal=_this4._subscriptionService.getSession();var listener=function listener(state){var _a;if((state===null||state===void 0?void 0:state.session)!==lastVal){lastVal=(_a=state===null||state===void 0?void 0:state.session)!==null&&_a!==void 0?_a:null;callback(lastVal);}};return _this4._subscriptionService.subscribeToState(listener);};this.revoke=function(options){return __awaiter$1(_this4,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee24(){var resp,_t7;return _regenerator().w(function(_context24){while(1)switch(_context24.p=_context24.n){case 0:_context24.p=0;_context24.n=1;return this._networkClient.fetchSDK({url:"/sessions/revoke",method:'POST'});case 1:resp=_context24.v;this._subscriptionService.destroyState();return _context24.a(2,resp);case 2:_context24.p=2;_t7=_context24.v;if(options===null||options===void 0?void 0:options.forceClear){this._subscriptionService.destroyState();}else if(UNRECOVERABLE_ERROR_TYPES.includes(_t7.error_type)){this._subscriptionService.destroyState();}throw _t7;case 3:return _context24.a(2);}},_callee24,this,[[0,2]]);}));};this._authenticate=function(options){return __awaiter$1(_this4,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee25(){var _this5=this;var initialSession,isSessionStale,requestBody,resp,_t8;return _regenerator().w(function(_context25){while(1)switch(_context25.p=_context25.n){case 0:initialSession=this._subscriptionService.getSession();isSessionStale=function isSessionStale(){var _a;return(initialSession===null||initialSession===void 0?void 0:initialSession.session_id)!==((_a=_this5._subscriptionService.getSession())===null||_a===void 0?void 0:_a.session_id);};_context25.p=1;requestBody={session_duration_minutes:options===null||options===void 0?void 0:options.session_duration_minutes};_context25.n=2;return this._networkClient.fetchSDK({url:'/sessions/authenticate',body:requestBody,method:'POST'});case 2:resp=_context25.v;if(!isSessionStale()){_context25.n=3;break;}return _context25.a(2,this._authenticate(options));case 3:return _context25.a(2,omitUser(resp));case 4:_context25.p=4;_t8=_context25.v;if(!isSessionStale()){_context25.n=5;break;}return _context25.a(2,this._authenticate(options));case 5:if(UNRECOVERABLE_ERROR_TYPES.includes(_t8.error_type)){this._subscriptionService.destroySession();}throw _t8;case 6:return _context25.a(2);}},_callee25,this,[[1,4]]);}));};this.authenticate=this._subscriptionService.withUpdateSession(this._authenticate);this.exchangeAccessToken=this._subscriptionService.withUpdateSession(function(data){return __awaiter$1(_this4,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee26(){var resp;return _regenerator().w(function(_context26){while(1)switch(_context26.n){case 0:validate('stytch.session.exchangeAccessToken').isString('access_token',data.access_token).isNumber('session_duration_minutes',data.session_duration_minutes);_context26.n=1;return this._networkClient.fetchSDK({url:'/sessions/exchange_access_token',body:data,method:'POST'});case 1:resp=_context26.v;return _context26.a(2,omitUser(resp));}},_callee26,this);}));});this.attest=this._subscriptionService.withUpdateSession(function(data){return __awaiter$1(_this4,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee27(){return _regenerator().w(function(_context27){while(1)switch(_context27.n){case 0:validate('stytch.session.attest').isString('profile_id',data.profile_id).isString('token',data.token).isOptionalNumber('session_duration_minutes',data.session_duration_minutes);return _context27.a(2,this._networkClient.fetchSDK({url:'/sessions/attest',body:data,method:'POST'}));}},_callee27,this);}));});}return _createClass(HeadlessSessionClient,[{key:"getTokens",value:function getTokens(){return this._subscriptionService.getTokens();}},{key:"updateSession",value:function updateSession(tokens){var _a;validate('stytch.session.updateSession').isString('session_token',tokens.session_token).isOptionalString('session_jwt',(_a=tokens.session_jwt)!==null&&_a!==void 0?_a:undefined);this._subscriptionService.updateTokens(tokens);}}]);}();var DefaultDynamicConfig$4=Promise.resolve({pkceRequiredForEmailMagicLinks:false});var HeadlessMagicLinksClient=/*#__PURE__*/function(){function HeadlessMagicLinksClient(_networkClient,_subscriptionService,_pkceManager,_passwordResetPKCEManager){var _this6=this;var _config=arguments.length>4&&arguments[4]!==undefined?arguments[4]:DefaultDynamicConfig$4;var dfpProtectedAuth=arguments.length>5?arguments[5]:undefined;_classCallCheck(this,HeadlessMagicLinksClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this._pkceManager=_pkceManager;this._passwordResetPKCEManager=_passwordResetPKCEManager;this._config=_config;this.dfpProtectedAuth=dfpProtectedAuth;this.email={loginOrCreate:function loginOrCreate(email){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return __awaiter$1(_this6,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee28(){var _yield$this$_config,pkceRequiredForEmailMagicLinks,code_challenge,_yield$this$dfpProtec,dfp_telemetry_id,captcha_token,requestBody;return _regenerator().w(function(_context28){while(1)switch(_context28.n){case 0:_context28.n=1;return this._config;case 1:_yield$this$_config=_context28.v;pkceRequiredForEmailMagicLinks=_yield$this$_config.pkceRequiredForEmailMagicLinks;code_challenge=undefined;if(!pkceRequiredForEmailMagicLinks){_context28.n=3;break;}_context28.n=2;return this.getCodeChallenge();case 2:code_challenge=_context28.v;case 3:_context28.n=4;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 4:_yield$this$dfpProtec=_context28.v;dfp_telemetry_id=_yield$this$dfpProtec.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec.captcha_token;requestBody=Object.assign(Object.assign({},options),{email:email,code_challenge:code_challenge,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});return _context28.a(2,this._networkClient.retriableFetchSDK({url:'/magic_links/email/login_or_create',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee28,this);}));},send:function send(email){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return __awaiter$1(_this6,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee29(){var _yield$this$_config2,pkceRequiredForEmailMagicLinks,code_challenge,_yield$this$dfpProtec2,dfp_telemetry_id,captcha_token,requestBody,isLoggedIn,endpoint;return _regenerator().w(function(_context29){while(1)switch(_context29.n){case 0:_context29.n=1;return this._config;case 1:_yield$this$_config2=_context29.v;pkceRequiredForEmailMagicLinks=_yield$this$_config2.pkceRequiredForEmailMagicLinks;code_challenge=undefined;if(!pkceRequiredForEmailMagicLinks){_context29.n=3;break;}_context29.n=2;return this.getCodeChallenge();case 2:code_challenge=_context29.v;case 3:_context29.n=4;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 4:_yield$this$dfpProtec2=_context29.v;dfp_telemetry_id=_yield$this$dfpProtec2.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec2.captcha_token;requestBody=Object.assign(Object.assign({},options),{email:email,code_challenge:code_challenge,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/magic_links/email/send/secondary':'/magic_links/email/send/primary';return _context29.a(2,this._networkClient.retriableFetchSDK({url:endpoint,body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee29,this);}));}};this.authenticate=this._subscriptionService.withUpdateSession(function(token,options){return __awaiter$1(_this6,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee30(){var passwordResetPKPair,resp,_t9;return _regenerator().w(function(_context30){while(1)switch(_context30.p=_context30.n){case 0:validate('stytch.magicLinks.authenticate').isString('Token',token).isNumber('session_duration_minutes',options.session_duration_minutes);_context30.n=1;return this._passwordResetPKCEManager.getPKPair();case 1:passwordResetPKPair=_context30.v;resp=null;if(!(passwordResetPKPair===null||passwordResetPKPair===void 0?void 0:passwordResetPKPair.code_verifier)){_context30.n=6;break;}_context30.p=2;_context30.n=3;return this.handlePKCEForAuthenticate(this._passwordResetPKCEManager,Object.assign(Object.assign({},options),{token:token}));case 3:resp=_context30.v;_context30.n=6;break;case 4:_context30.p=4;_t9=_context30.v;if(!_t9.message.includes('pkce')){_context30.n=5;break;}console.log('Authenticate with passwords pkce namespace failed. Falling back to authenticate with magic_links namespace.');_context30.n=6;break;case 5:throw _t9;case 6:if(resp){_context30.n=8;break;}_context30.n=7;return this.handlePKCEForAuthenticate(this._pkceManager,Object.assign(Object.assign({},options),{token:token}));case 7:resp=_context30.v;case 8:return _context30.a(2,omitUser(resp));}},_callee30,this,[[2,4]]);}));});}return _createClass(HeadlessMagicLinksClient,[{key:"getCodeChallenge",value:function getCodeChallenge(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee31(){var keyPair;return _regenerator().w(function(_context31){while(1)switch(_context31.n){case 0:_context31.n=1;return this._pkceManager.getPKPair();case 1:keyPair=_context31.v;if(!keyPair){_context31.n=2;break;}return _context31.a(2,keyPair.code_challenge);case 2:_context31.n=3;return this._pkceManager.startPKCETransaction();case 3:keyPair=_context31.v;return _context31.a(2,keyPair.code_challenge);}},_callee31,this);}));}},{key:"handlePKCEForAuthenticate",value:function handlePKCEForAuthenticate(pkceManager,data){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee32(){var pkPair,requestBody,resp;return _regenerator().w(function(_context32){while(1)switch(_context32.n){case 0:_context32.n=1;return pkceManager.getPKPair();case 1:pkPair=_context32.v;requestBody=Object.assign({code_verifier:pkPair===null||pkPair===void 0?void 0:pkPair.code_verifier},data);_context32.n=2;return this._networkClient.fetchSDK({url:'/magic_links/authenticate',body:requestBody,method:'POST'});case 2:resp=_context32.v;pkceManager.clearPKPair();return _context32.a(2,resp);}},_callee32,this);}));}}]);}();var HeadlessOTPClient=/*#__PURE__*/_createClass(function HeadlessOTPClient(_networkClient,_subscriptionService){var _this7=this;var executeRecaptcha=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(){return Promise.resolve(undefined);};var dfpProtectedAuth=arguments.length>3?arguments[3]:undefined;_classCallCheck(this,HeadlessOTPClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.executeRecaptcha=executeRecaptcha;this.dfpProtectedAuth=dfpProtectedAuth;this.sms={loginOrCreate:function loginOrCreate(phone_number,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee33(){var _yield$this$dfpProtec3,dfp_telemetry_id,captcha_token,requestBody;return _regenerator().w(function(_context33){while(1)switch(_context33.n){case 0:_context33.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec3=_context33.v;dfp_telemetry_id=_yield$this$dfpProtec3.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec3.captcha_token;requestBody=Object.assign(Object.assign({},options),{phone_number:phone_number,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});return _context33.a(2,this._networkClient.retriableFetchSDK({url:'/otps/sms/login_or_create',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee33,this);}));},send:function send(phone_number,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee34(){var _yield$this$dfpProtec4,dfp_telemetry_id,captcha_token,requestBody,isLoggedIn,endpoint;return _regenerator().w(function(_context34){while(1)switch(_context34.n){case 0:_context34.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec4=_context34.v;dfp_telemetry_id=_yield$this$dfpProtec4.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec4.captcha_token;requestBody=Object.assign(Object.assign({},options),{phone_number:phone_number,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/otps/sms/send/secondary':'/otps/sms/send/primary';return _context34.a(2,this._networkClient.retriableFetchSDK({url:endpoint,body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee34,this);}));}};this.whatsapp={loginOrCreate:function loginOrCreate(phone_number,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee35(){var _yield$this$dfpProtec5,dfp_telemetry_id,captcha_token,requestBody;return _regenerator().w(function(_context35){while(1)switch(_context35.n){case 0:_context35.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec5=_context35.v;dfp_telemetry_id=_yield$this$dfpProtec5.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec5.captcha_token;requestBody=Object.assign(Object.assign({},options),{phone_number:phone_number,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token});return _context35.a(2,this._networkClient.retriableFetchSDK({url:'/otps/whatsapp/login_or_create',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee35,this);}));},send:function send(phone_number,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee36(){var _yield$this$dfpProtec6,dfp_telemetry_id,captcha_token,requestBody,isLoggedIn,endpoint;return _regenerator().w(function(_context36){while(1)switch(_context36.n){case 0:_context36.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec6=_context36.v;dfp_telemetry_id=_yield$this$dfpProtec6.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec6.captcha_token;requestBody=Object.assign(Object.assign({},options),{phone_number:phone_number,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/otps/whatsapp/send/secondary':'/otps/whatsapp/send/primary';return _context36.a(2,this._networkClient.retriableFetchSDK({url:endpoint,body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee36,this);}));}};this.email={loginOrCreate:function loginOrCreate(email,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee37(){var _yield$this$dfpProtec7,dfp_telemetry_id,captcha_token,requestBody;return _regenerator().w(function(_context37){while(1)switch(_context37.n){case 0:_context37.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec7=_context37.v;dfp_telemetry_id=_yield$this$dfpProtec7.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec7.captcha_token;requestBody=Object.assign(Object.assign({},options),{email:email,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});return _context37.a(2,this._networkClient.retriableFetchSDK({url:'/otps/email/login_or_create',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee37,this);}));},send:function send(email,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee38(){var captcha_token,requestBody,isLoggedIn,endpoint;return _regenerator().w(function(_context38){while(1)switch(_context38.n){case 0:_context38.n=1;return this.executeRecaptcha();case 1:captcha_token=_context38.v;requestBody=Object.assign(Object.assign({},options),{email:email,captcha_token:captcha_token});isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/otps/email/send/secondary':'/otps/email/send/primary';return _context38.a(2,this._networkClient.fetchSDK({url:endpoint,body:requestBody,method:'POST'}));}},_callee38,this);}));}};this.authenticate=this._subscriptionService.withUpdateSession(function(code,method_id,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee39(){var _yield$this$dfpProtec8,dfp_telemetry_id,captcha_token,requestBody,resp;return _regenerator().w(function(_context39){while(1)switch(_context39.n){case 0:validate('stytch.otps.authenticate').isString('Code',code).isNumber('session_duration_minutes',options.session_duration_minutes);_context39.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec8=_context39.v;dfp_telemetry_id=_yield$this$dfpProtec8.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec8.captcha_token;requestBody=Object.assign({token:code,method_id:method_id,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token},options);_context39.n=2;return this._networkClient.retriableFetchSDK({url:'/otps/authenticate',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context39.v;return _context39.a(2,omitUser(resp));}},_callee39,this);}));});});var HeadlessOAuthClient$1=/*#__PURE__*/function(){function HeadlessOAuthClient(_networkClient,_subscriptionService,_pkceManager,_dynamicConfig,_config){var _this8=this;_classCallCheck(this,HeadlessOAuthClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this._pkceManager=_pkceManager;this._dynamicConfig=_dynamicConfig;this._config=_config;this.google={start:this.startOAuthFlow(OAuthProviders.Google)};this.apple={start:this.startOAuthFlow(OAuthProviders.Apple)};this.microsoft={start:this.startOAuthFlow(OAuthProviders.Microsoft)};this.github={start:this.startOAuthFlow(OAuthProviders.Github)};this.gitlab={start:this.startOAuthFlow(OAuthProviders.GitLab)};this.facebook={start:this.startOAuthFlow(OAuthProviders.Facebook)};this.discord={start:this.startOAuthFlow(OAuthProviders.Discord)};this.salesforce={start:this.startOAuthFlow(OAuthProviders.Salesforce)};this.slack={start:this.startOAuthFlow(OAuthProviders.Slack)};this.amazon={start:this.startOAuthFlow(OAuthProviders.Amazon)};this.bitbucket={start:this.startOAuthFlow(OAuthProviders.Bitbucket)};this.linkedin={start:this.startOAuthFlow(OAuthProviders.LinkedIn)};this.coinbase={start:this.startOAuthFlow(OAuthProviders.Coinbase)};this.twitch={start:this.startOAuthFlow(OAuthProviders.Twitch)};this.twitter={start:this.startOAuthFlow(OAuthProviders.Twitter)};this.tiktok={start:this.startOAuthFlow(OAuthProviders.TikTok)};this.snapchat={start:this.startOAuthFlow(OAuthProviders.Snapchat)};this.figma={start:this.startOAuthFlow(OAuthProviders.Figma)};this.yahoo={start:this.startOAuthFlow(OAuthProviders.Yahoo)};this.authenticate=this._subscriptionService.withUpdateSession(function(token,options){return __awaiter$1(_this8,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee40(){var keyPair,resp;return _regenerator().w(function(_context40){while(1)switch(_context40.n){case 0:validate('stytch.oauth.authenticate').isString('Token',token).isNumber('session_duration_minutes',options.session_duration_minutes);_context40.n=1;return this._pkceManager.getPKPair();case 1:keyPair=_context40.v;if(!keyPair){logger.warn('No code verifier found in local storage for OAuth flow.\n'+'Consider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\n'+'See https://stytch.com/docs/oauth#guides_pkce for more information.');}_context40.n=2;return this._networkClient.fetchSDK({url:'/oauth/authenticate',method:'POST',body:Object.assign({token:token,code_verifier:keyPair===null||keyPair===void 0?void 0:keyPair.code_verifier},options)});case 2:resp=_context40.v;this._pkceManager.clearPKPair();return _context40.a(2,omitUser(resp));}},_callee40,this);}));});}return _createClass(HeadlessOAuthClient,[{key:"attach",value:function attach(provider){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee41(){return _regenerator().w(function(_context41){while(1)switch(_context41.n){case 0:validate('stytch.oauth.attach').isString('Provider',provider);_context41.n=1;return this._networkClient.fetchSDK({url:'/oauth/attach',method:'POST',body:{provider:provider}});case 1:return _context41.a(2,_context41.v);}},_callee41,this);}));}},{key:"getBaseApiUrl",value:function getBaseApiUrl(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee42(){var _yield$this$_dynamicC,cnameDomain;return _regenerator().w(function(_context42){while(1)switch(_context42.n){case 0:_context42.n=1;return this._dynamicConfig;case 1:_yield$this$_dynamicC=_context42.v;cnameDomain=_yield$this$_dynamicC.cnameDomain;if(!cnameDomain){_context42.n=2;break;}return _context42.a(2,"https://".concat(cnameDomain));case 2:if(!isTestPublicToken(this._config.publicToken)){_context42.n=3;break;}return _context42.a(2,this._config.testAPIURL);case 3:return _context42.a(2,this._config.liveAPIURL);}},_callee42,this);}));}},{key:"startOAuthFlow",value:function startOAuthFlow(providerType){var _this9=this;return function(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},login_redirect_url=_ref6.login_redirect_url,signup_redirect_url=_ref6.signup_redirect_url,custom_scopes=_ref6.custom_scopes,provider_params=_ref6.provider_params,oauth_attach_token=_ref6.oauth_attach_token;return __awaiter$1(_this9,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee43(){var _yield$this$_dynamicC2,cnameDomain,pkceRequiredForOAuth,baseURL,oauthUrl,keyPair,key;return _regenerator().w(function(_context43){while(1)switch(_context43.n){case 0:_context43.n=1;return this._dynamicConfig;case 1:_yield$this$_dynamicC2=_context43.v;cnameDomain=_yield$this$_dynamicC2.cnameDomain;pkceRequiredForOAuth=_yield$this$_dynamicC2.pkceRequiredForOAuth;_context43.n=2;return this.getBaseApiUrl();case 2:baseURL=_context43.v;this._networkClient.logEvent({name:'start_oauth_flow',details:{provider_type:providerType,custom_scopes:custom_scopes,cname_domain:cnameDomain,pkce:pkceRequiredForOAuth,provider_params:provider_params}});oauthUrl=new URL("".concat(baseURL,"/v1/public/oauth/").concat(providerType,"/start"));oauthUrl.searchParams.set('public_token',this._config.publicToken);if(!pkceRequiredForOAuth){_context43.n=4;break;}_context43.n=3;return this._pkceManager.startPKCETransaction();case 3:keyPair=_context43.v;oauthUrl.searchParams.set('code_challenge',keyPair.code_challenge);_context43.n=5;break;case 4:this._pkceManager.clearPKPair();case 5:if(custom_scopes){validate('startOAuthFlow').isStringArray('custom_scopes',custom_scopes);oauthUrl.searchParams.set('custom_scopes',custom_scopes.join(' '));}if(provider_params){validate('startOAuthFlow').isOptionalObject('provider_params',provider_params);for(key in provider_params){oauthUrl.searchParams.set('provider_'+key,provider_params[key]);}}if(login_redirect_url)oauthUrl.searchParams.set('login_redirect_url',login_redirect_url);if(signup_redirect_url)oauthUrl.searchParams.set('signup_redirect_url',signup_redirect_url);if(oauth_attach_token)oauthUrl.searchParams.set('oauth_attach_token',oauth_attach_token);window.location.href=oauthUrl.toString();case 6:return _context43.a(2);}},_callee43,this);}));};}}]);}();var DefaultDynamicConfig$3=Promise.resolve({siweRequiredForCryptoWallets:false});var HeadlessCryptoWalletClient=/*#__PURE__*/function(){function HeadlessCryptoWalletClient(_networkClient,_apiNetworkClient,_subscriptionService){var _this0=this;var executeRecaptcha=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(){return Promise.resolve(undefined);};var dfpProtectedAuth=arguments.length>4?arguments[4]:undefined;var _config=arguments.length>5&&arguments[5]!==undefined?arguments[5]:DefaultDynamicConfig$3;_classCallCheck(this,HeadlessCryptoWalletClient);this._networkClient=_networkClient;this._apiNetworkClient=_apiNetworkClient;this._subscriptionService=_subscriptionService;this.executeRecaptcha=executeRecaptcha;this.dfpProtectedAuth=dfpProtectedAuth;this._config=_config;this.authenticate=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this0,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee44(){var _yield$this$dfpProtec9,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context44){while(1)switch(_context44.n){case 0:validate('stytch.cryptoWallets.authenticate').isString('signature',options.signature).isString('crypto_wallet_address',options.crypto_wallet_address).isString('crypto_wallet_type',options.crypto_wallet_type).isNumber('session_duration_minutes',options.session_duration_minutes);_context44.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec9=_context44.v;dfp_telemetry_id=_yield$this$dfpProtec9.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec9.captcha_token;_context44.n=2;return this._apiNetworkClient.retriableFetchSDK({url:'/crypto_wallets/authenticate',method:'POST',body:{session_duration_minutes:options.session_duration_minutes,crypto_wallet_address:options.crypto_wallet_address,crypto_wallet_type:options.crypto_wallet_type,signature:options.signature,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context44.v;return _context44.a(2,omitUser(resp));}},_callee44,this);}));});}return _createClass(HeadlessCryptoWalletClient,[{key:"authenticateStart",value:function authenticateStart(options){var _a;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee45(){var isLoggedIn,captcha_token,_yield$this$_config3,siweRequiredForCryptoWallets,body,endpoint,requestBody;return _regenerator().w(function(_context45){while(1)switch(_context45.n){case 0:validate('stytch.cryptoWallets.authenticateStart').isString('crypto_wallet_address',options.crypto_wallet_address).isString('crypto_wallet_type',options.crypto_wallet_type);if(options.siwe_params){validate('stytch.cryptoWallets.authenticateStart').isOptionalString('uri',options.siwe_params.uri).isOptionalString('chain_id',options.siwe_params.chain_id).isOptionalString('issued_at',options.siwe_params.issued_at).isOptionalString('statement',options.siwe_params.statement).isOptionalString('not_before',options.siwe_params.not_before).isOptionalString('message_request_id',options.siwe_params.message_request_id).isOptionalStringArray('resources',options.siwe_params.resources);}isLoggedIn=!!this._subscriptionService.getSession();_context45.n=1;return this.executeRecaptcha();case 1:captcha_token=_context45.v;_context45.n=2;return this._config;case 2:_yield$this$_config3=_context45.v;siweRequiredForCryptoWallets=_yield$this$_config3.siweRequiredForCryptoWallets;body={crypto_wallet_address:options.crypto_wallet_address,crypto_wallet_type:options.crypto_wallet_type};if(siweRequiredForCryptoWallets&&options.crypto_wallet_type=='ethereum'){body.siwe_params=Object.assign(Object.assign({},options.siwe_params),{uri:((_a=options.siwe_params)===null||_a===void 0?void 0:_a.uri)||window.location.origin});}endpoint=isLoggedIn?'/crypto_wallets/authenticate/start/secondary':'/crypto_wallets/authenticate/start/primary';requestBody=Object.assign(Object.assign({},body),{captcha_token:captcha_token});return _context45.a(2,this._apiNetworkClient.fetchSDK({url:endpoint,method:'POST',body:requestBody}));}},_callee45,this);}));}}]);}();var HeadlessTOTPClient=/*#__PURE__*/function(){function HeadlessTOTPClient(_networkClient,_subscriptionService,dfpProtectedAuth){var _this1=this;_classCallCheck(this,HeadlessTOTPClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.dfpProtectedAuth=dfpProtectedAuth;this.authenticate=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this1,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee46(){var _yield$this$dfpProtec0,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context46){while(1)switch(_context46.n){case 0:validate('stytch.totps.authenticate').isNumber('session_duration_minutes',options.session_duration_minutes).isString('totp_code',options.totp_code);_context46.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec0=_context46.v;dfp_telemetry_id=_yield$this$dfpProtec0.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec0.captcha_token;_context46.n=2;return this._networkClient.retriableFetchSDK({url:'/totps/authenticate',method:'POST',body:{session_duration_minutes:options.session_duration_minutes,totp_code:options.totp_code,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context46.v;return _context46.a(2,omitUser(resp));}},_callee46,this);}));});this.recover=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this1,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee47(){var _yield$this$dfpProtec1,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context47){while(1)switch(_context47.n){case 0:validate('stytch.totps.recover').isNumber('session_duration_minutes',options.session_duration_minutes).isString('recovery_code',options.recovery_code);_context47.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec1=_context47.v;dfp_telemetry_id=_yield$this$dfpProtec1.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec1.captcha_token;_context47.n=2;return this._networkClient.retriableFetchSDK({url:'/totps/recover',method:'POST',body:{session_duration_minutes:options.session_duration_minutes,recovery_code:options.recovery_code,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context47.v;return _context47.a(2,omitUser(resp));}},_callee47,this);}));});}return _createClass(HeadlessTOTPClient,[{key:"create",value:function create(options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee48(){var resp;return _regenerator().w(function(_context48){while(1)switch(_context48.n){case 0:validate('stytch.totps.create').isNumber('expiration_minutes',options.expiration_minutes);_context48.n=1;return this._networkClient.fetchSDK({url:'/totps',method:'POST',body:{expiration_minutes:options.expiration_minutes}});case 1:resp=_context48.v;this._subscriptionService.updateUser(resp.__user);return _context48.a(2,omitUser(resp));}},_callee48,this);}));}},{key:"recoveryCodes",value:function recoveryCodes(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee49(){return _regenerator().w(function(_context49){while(1)switch(_context49.n){case 0:return _context49.a(2,this._networkClient.fetchSDK({url:'/totps/recovery_codes',method:'POST'}));}},_callee49,this);}));}}]);}();function base64urlToBuffer(baseurl64String){var padding="==".slice(0,(4-baseurl64String.length%4)%4);var base64String=baseurl64String.replace(/-/g,"+").replace(/_/g,"/")+padding;var str=atob(base64String);var buffer=new ArrayBuffer(str.length);var byteView=new Uint8Array(buffer);for(var _i=0;_i<str.length;_i++){byteView[_i]=str.charCodeAt(_i);}return buffer;}function bufferToBase64url(buffer){var byteView=new Uint8Array(buffer);var str="";var _iterator2=_createForOfIteratorHelper(byteView),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var charCode=_step2.value;str+=String.fromCharCode(charCode);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}var base64String=btoa(str);var base64urlString=base64String.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return base64urlString;}var copyValue="copy";var convertValue="convert";function convert(conversionFn,schema2,input){if(schema2===copyValue){return input;}if(schema2===convertValue){return conversionFn(input);}if(schema2 instanceof Array){return input.map(function(v){return convert(conversionFn,schema2[0],v);});}if(schema2 instanceof Object){var output={};for(var _i2=0,_Object$entries=Object.entries(schema2);_i2<_Object$entries.length;_i2++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i2],2),key=_Object$entries$_i[0],schemaField=_Object$entries$_i[1];if(schemaField.derive){var v=schemaField.derive(input);if(v!==void 0){input[key]=v;}}if(!(key in input)){if(schemaField.required){throw new Error("Missing key: ".concat(key));}continue;}if(input[key]==null){output[key]=null;continue;}output[key]=convert(conversionFn,schemaField.schema,input[key]);}return output;}}function derived(schema2,derive){return{required:true,schema:schema2,derive:derive};}function required(schema2){return{required:true,schema:schema2};}function optional(schema2){return{required:false,schema:schema2};}var publicKeyCredentialDescriptorSchema={type:required(copyValue),id:required(convertValue),transports:optional(copyValue)};var simplifiedExtensionsSchema={appid:optional(copyValue),appidExclude:optional(copyValue),credProps:optional(copyValue)};var simplifiedClientExtensionResultsSchema={appid:optional(copyValue),appidExclude:optional(copyValue),credProps:optional(copyValue)};var credentialCreationOptions={publicKey:required({rp:required(copyValue),user:required({id:required(convertValue),name:required(copyValue),displayName:required(copyValue)}),challenge:required(convertValue),pubKeyCredParams:required(copyValue),timeout:optional(copyValue),excludeCredentials:optional([publicKeyCredentialDescriptorSchema]),authenticatorSelection:optional(copyValue),attestation:optional(copyValue),extensions:optional(simplifiedExtensionsSchema)}),signal:optional(copyValue)};var publicKeyCredentialWithAttestation={type:required(copyValue),id:required(copyValue),rawId:required(convertValue),authenticatorAttachment:optional(copyValue),response:required({clientDataJSON:required(convertValue),attestationObject:required(convertValue),transports:derived(copyValue,function(response){var _a;return((_a=response.getTransports)==null?void 0:_a.call(response))||[];})}),clientExtensionResults:derived(simplifiedClientExtensionResultsSchema,function(pkc){return pkc.getClientExtensionResults();})};var credentialRequestOptions={mediation:optional(copyValue),publicKey:required({challenge:required(convertValue),timeout:optional(copyValue),rpId:optional(copyValue),allowCredentials:optional([publicKeyCredentialDescriptorSchema]),userVerification:optional(copyValue),extensions:optional(simplifiedExtensionsSchema)}),signal:optional(copyValue)};var publicKeyCredentialWithAssertion={type:required(copyValue),id:required(copyValue),rawId:required(convertValue),authenticatorAttachment:optional(copyValue),response:required({clientDataJSON:required(convertValue),authenticatorData:required(convertValue),signature:required(convertValue),userHandle:required(convertValue)}),clientExtensionResults:derived(simplifiedClientExtensionResultsSchema,function(pkc){return pkc.getClientExtensionResults();})};function createRequestFromJSON(requestJSON){return convert(base64urlToBuffer,credentialCreationOptions,requestJSON);}function createResponseToJSON(credential){return convert(bufferToBase64url,publicKeyCredentialWithAttestation,credential);}function create(requestJSON){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee50(){var credential;return _regenerator().w(function(_context50){while(1)switch(_context50.n){case 0:_context50.n=1;return navigator.credentials.create(createRequestFromJSON(requestJSON));case 1:credential=_context50.v;return _context50.a(2,createResponseToJSON(credential));}},_callee50);}));}function getRequestFromJSON(requestJSON){return convert(base64urlToBuffer,credentialRequestOptions,requestJSON);}function getResponseToJSON(credential){return convert(bufferToBase64url,publicKeyCredentialWithAssertion,credential);}function get(requestJSON){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee51(){var credential;return _regenerator().w(function(_context51){while(1)switch(_context51.n){case 0:_context51.n=1;return navigator.credentials.get(getRequestFromJSON(requestJSON));case 1:credential=_context51.v;return _context51.a(2,getResponseToJSON(credential));}},_callee51);}));}var HeadlessWebAuthnClient=/*#__PURE__*/function(){function HeadlessWebAuthnClient(_networkClient,_subscriptionService,dfpProtectedAuth){var _this10=this;_classCallCheck(this,HeadlessWebAuthnClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.dfpProtectedAuth=dfpProtectedAuth;this.register=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this10,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee52(){var _a,_b,startResp,publicKeyCredentialCreationOptions,publicKey,credential,resp;return _regenerator().w(function(_context52){while(1)switch(_context52.n){case 0:validate('stytch.webauthn.register').isOptionalString('domain',options===null||options===void 0?void 0:options.domain).isOptionalString('authenticator_type',options===null||options===void 0?void 0:options.authenticator_type).isOptionalBoolean('is_passkey',options===null||options===void 0?void 0:options.is_passkey).isOptionalNumber('session_duration_minutes',options===null||options===void 0?void 0:options.session_duration_minutes).isOptionalString('override_id',options===null||options===void 0?void 0:options.override_id).isOptionalString('override_name',options===null||options===void 0?void 0:options.override_name).isOptionalString('override_display_name',options===null||options===void 0?void 0:options.override_display_name).isOptionalBoolean('use_base64_url_encoding',options===null||options===void 0?void 0:options.use_base64_url_encoding);_context52.n=1;return this._networkClient.fetchSDK({url:'/webauthn/register/start',method:'POST',body:{domain:(_a=options===null||options===void 0?void 0:options.domain)!==null&&_a!==void 0?_a:window.location.hostname,authenticator_type:(_b=options===null||options===void 0?void 0:options.authenticator_type)!==null&&_b!==void 0?_b:undefined,return_passkey_credential_options:options===null||options===void 0?void 0:options.is_passkey,override_id:options===null||options===void 0?void 0:options.override_id,override_name:options===null||options===void 0?void 0:options.override_name,override_display_name:options===null||options===void 0?void 0:options.override_display_name,user_agent:navigator.userAgent,use_base64_url_encoding:options===null||options===void 0?void 0:options.use_base64_url_encoding}});case 1:startResp=_context52.v;publicKeyCredentialCreationOptions=startResp.public_key_credential_creation_options;publicKey=JSON.parse(publicKeyCredentialCreationOptions);_context52.n=2;return create({publicKey:publicKey});case 2:credential=_context52.v;_context52.n=3;return this._networkClient.fetchSDK({url:'/webauthn/register',method:'POST',body:{public_key_credential:JSON.stringify(credential),session_duration_minutes:options===null||options===void 0?void 0:options.session_duration_minutes}});case 3:resp=_context52.v;return _context52.a(2,omitUser(resp));}},_callee52,this);}));});this.authenticate=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this10,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee53(){var _c,_d,_yield$this$dfpProtec10,dfp_telemetry_id,captcha_token,isLoggedIn,endpoint,startResp,publicKeyCredentialRequestOptions,abortController,credReqOptions,conditionalMediationCredReqOption,credential,authenticationData;return _regenerator().w(function(_context53){while(1)switch(_context53.n){case 0:validate('stytch.webauthn.authenticate').isOptionalString('domain',options.domain).isNumber('session_duration_minutes',options.session_duration_minutes).isOptionalBoolean('is_passkey',options.is_passkey).isOptionalObject('signal',options.signal);_context53.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec10=_context53.v;dfp_telemetry_id=_yield$this$dfpProtec10.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec10.captcha_token;if(!options.conditional_mediation){_context53.n=4;break;}_context53.n=2;return this.browserSupportsAutofill();case 2:if(_context53.v){_context53.n=3;break;}logger.error('Browser does not support WebAuthn autofill');return _context53.a(2,null);case 3:if(this.checkEligibleInputs()){_context53.n=4;break;}return _context53.a(2,null);case 4:isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/webauthn/authenticate/start/secondary':'/webauthn/authenticate/start/primary';_context53.n=5;return this._networkClient.fetchSDK({url:endpoint,method:'POST',body:{domain:(_c=options.domain)!==null&&_c!==void 0?_c:window.location.hostname,return_passkey_credential_options:options===null||options===void 0?void 0:options.is_passkey}});case 5:startResp=_context53.v;publicKeyCredentialRequestOptions=startResp.public_key_credential_request_options;abortController=new AbortController();credReqOptions={publicKey:JSON.parse(publicKeyCredentialRequestOptions),signal:(_d=options.signal)!==null&&_d!==void 0?_d:abortController.signal};conditionalMediationCredReqOption=Object.assign(Object.assign({},credReqOptions),{mediation:'conditional'});_context53.n=6;return get(options.conditional_mediation?conditionalMediationCredReqOption:credReqOptions);case 6:credential=_context53.v;_context53.n=7;return this._networkClient.retriableFetchSDK({url:'/webauthn/authenticate',method:'POST',body:{public_key_credential:JSON.stringify(credential),session_duration_minutes:options.session_duration_minutes,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 7:authenticationData=_context53.v;return _context53.a(2,omitUser(authenticationData));}},_callee53,this);}));});this.checkEligibleInputs=function(){var eligibleInputs=document.querySelectorAll("input[autocomplete*='webauthn']");if(eligibleInputs.length<1){logger.error('No <input> with `"webauthn"` in its `autocomplete` attribute was detected');return false;}return true;};}return _createClass(HeadlessWebAuthnClient,[{key:"update",value:function update(options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee54(){var url;return _regenerator().w(function(_context54){while(1)switch(_context54.n){case 0:validate('stytch.webauthn.update').isString('webauthn_registration_id',options.webauthn_registration_id).isString('name',options.name);url='/webauthn/update/'+options.webauthn_registration_id;_context54.n=1;return this._networkClient.fetchSDK({url:url,method:'PUT',body:{name:options.name}});case 1:return _context54.a(2,_context54.v);}},_callee54,this);}));}},{key:"browserSupportsAutofill",value:function browserSupportsAutofill(){var _a,_b,_c;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee55(){var _t0,_t1,_t10;return _regenerator().w(function(_context55){while(1)switch(_context55.n){case 0:_context55.n=1;return(_b=(_a=window.PublicKeyCredential)===null||_a===void 0?void 0:_a.isConditionalMediationAvailable)===null||_b===void 0?void 0:_b.call(_a);case 1:_t1=_c=_context55.v;_t0=_t1!==null;if(!_t0){_context55.n=2;break;}_t0=_c!==void 0;case 2:if(!_t0){_context55.n=3;break;}_t10=_c;_context55.n=4;break;case 3:_t10=false;case 4:return _context55.a(2,_t10);}},_callee55);}));}}]);}();var DefaultDynamicConfig$2=Promise.resolve({pkceRequiredForPasswordResets:false});var HeadlessPasswordClient=/*#__PURE__*/function(){function HeadlessPasswordClient(_networkClient,_subscriptionService,_pkceManager){var _this11=this;var _config=arguments.length>3&&arguments[3]!==undefined?arguments[3]:DefaultDynamicConfig$2;var dfpProtectedAuth=arguments.length>4?arguments[4]:undefined;_classCallCheck(this,HeadlessPasswordClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this._pkceManager=_pkceManager;this._config=_config;this.dfpProtectedAuth=dfpProtectedAuth;this.create=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee56(){var _yield$this$dfpProtec11,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context56){while(1)switch(_context56.n){case 0:validate('stytch.passwords.create').isString('password',options.password).isString('email',options.email).isNumber('session_duration_minutes',options.session_duration_minutes);_context56.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec11=_context56.v;dfp_telemetry_id=_yield$this$dfpProtec11.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec11.captcha_token;_context56.n=2;return this._networkClient.retriableFetchSDK({url:'/passwords',method:'POST',body:{email:options.email,password:options.password,session_duration_minutes:options.session_duration_minutes,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context56.v;return _context56.a(2,omitUser(resp));}},_callee56,this);}));});this.authenticate=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee57(){var _yield$this$dfpProtec12,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context57){while(1)switch(_context57.n){case 0:validate('stytch.passwords.authenticate').isString('password',options.password).isString('email',options.email).isNumber('session_duration_minutes',options.session_duration_minutes);_context57.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec12=_context57.v;dfp_telemetry_id=_yield$this$dfpProtec12.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec12.captcha_token;_context57.n=2;return this._networkClient.retriableFetchSDK({url:'/passwords/authenticate',method:'POST',body:{email:options.email,password:options.password,session_duration_minutes:options.session_duration_minutes,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context57.v;return _context57.a(2,omitUser(resp));}},_callee57,this);}));});this.resetByEmail=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee58(){var _yield$this$dfpProtec13,dfp_telemetry_id,captcha_token,pkPair,code_verifier,resp;return _regenerator().w(function(_context58){while(1)switch(_context58.n){case 0:validate('stytch.passwords.resetByEmail').isString('token',options.token).isString('password',options.password).isNumber('session_duration_minutes',options.session_duration_minutes);_context58.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec13=_context58.v;dfp_telemetry_id=_yield$this$dfpProtec13.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec13.captcha_token;_context58.n=2;return this._pkceManager.getPKPair();case 2:pkPair=_context58.v;code_verifier=pkPair===null||pkPair===void 0?void 0:pkPair.code_verifier;_context58.n=3;return this._networkClient.retriableFetchSDK({url:'/passwords/email/reset',method:'POST',body:{token:options.token,password:options.password,session_duration_minutes:options.session_duration_minutes,captcha_token:captcha_token,code_verifier:code_verifier,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 3:resp=_context58.v;this._pkceManager.clearPKPair();return _context58.a(2,omitUser(resp));}},_callee58,this);}));});this.resetByExistingPassword=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee59(){var _yield$this$dfpProtec14,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context59){while(1)switch(_context59.n){case 0:validate('stytch.passwords.resetByExistingPassword').isString('email',options.email).isString('existing_password',options.existing_password).isString('new_password',options.new_password).isNumber('session_duration_minutes',options.session_duration_minutes);_context59.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec14=_context59.v;dfp_telemetry_id=_yield$this$dfpProtec14.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec14.captcha_token;_context59.n=2;return this._networkClient.retriableFetchSDK({url:'/passwords/existing_password/reset',method:'POST',body:{email:options.email,existing_password:options.existing_password,new_password:options.new_password,session_duration_minutes:options.session_duration_minutes,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context59.v;return _context59.a(2,omitUser(resp));}},_callee59,this);}));});this.resetBySession=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee60(){var _yield$this$dfpProtec15,dfp_telemetry_id,captcha_token;return _regenerator().w(function(_context60){while(1)switch(_context60.n){case 0:validate('stytch.passwords.resetBySession').isString('password',options.password);_context60.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec15=_context60.v;dfp_telemetry_id=_yield$this$dfpProtec15.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec15.captcha_token;return _context60.a(2,this._networkClient.retriableFetchSDK({url:'/passwords/session/reset',method:'POST',body:{password:options.password,session_duration_minutes:options.session_duration_minutes,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee60,this);}));});}return _createClass(HeadlessPasswordClient,[{key:"getCodeChallenge",value:function getCodeChallenge(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee61(){var _yield$this$_config4,pkceRequiredForPasswordResets,keyPair;return _regenerator().w(function(_context61){while(1)switch(_context61.n){case 0:_context61.n=1;return this._config;case 1:_yield$this$_config4=_context61.v;pkceRequiredForPasswordResets=_yield$this$_config4.pkceRequiredForPasswordResets;if(pkceRequiredForPasswordResets){_context61.n=2;break;}return _context61.a(2,undefined);case 2:_context61.n=3;return this._pkceManager.getPKPair();case 3:keyPair=_context61.v;if(!keyPair){_context61.n=4;break;}return _context61.a(2,keyPair.code_challenge);case 4:_context61.n=5;return this._pkceManager.startPKCETransaction();case 5:keyPair=_context61.v;return _context61.a(2,keyPair.code_challenge);}},_callee61,this);}));}},{key:"resetByEmailStart",value:function resetByEmailStart(options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee62(){var code_challenge,_yield$this$dfpProtec16,dfp_telemetry_id,captcha_token;return _regenerator().w(function(_context62){while(1)switch(_context62.n){case 0:validate('stytch.passwords.resetByEmailStart').isString('email',options.email).isOptionalString('login_redirect_url',options.login_redirect_url).isOptionalString('reset_password_redirect_url',options.reset_password_redirect_url).isOptionalString('reset_password_template_id',options.reset_password_template_id).isOptionalNumber('reset_password_expiration_minutes',options.reset_password_expiration_minutes).isOptionalString('locale',options.locale);_context62.n=1;return this.getCodeChallenge();case 1:code_challenge=_context62.v;_context62.n=2;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 2:_yield$this$dfpProtec16=_context62.v;dfp_telemetry_id=_yield$this$dfpProtec16.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec16.captcha_token;return _context62.a(2,this._networkClient.retriableFetchSDK({url:'/passwords/email/reset/start',method:'POST',body:{email:options.email,login_redirect_url:options.login_redirect_url,reset_password_redirect_url:options.reset_password_redirect_url,reset_password_expiration_minutes:options.reset_password_expiration_minutes,reset_password_template_id:options.reset_password_template_id,locale:options.locale,code_challenge:code_challenge,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee62,this);}));}},{key:"strengthCheck",value:function strengthCheck(options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee63(){return _regenerator().w(function(_context63){while(1)switch(_context63.n){case 0:validate('stytch.passwords.strengthCheck').isOptionalString('email',options.email).isString('password',options.password);return _context63.a(2,this._networkClient.fetchSDK({url:'/passwords/strength_check',method:'POST',body:{email:options.email,password:options.password}}));}},_callee63,this);}));}}]);}();var HeadlessImpersonationClient=/*#__PURE__*/_createClass(function HeadlessImpersonationClient(_networkClient,_subscriptionService,dfpProtectedAuth){var _this12=this;_classCallCheck(this,HeadlessImpersonationClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.dfpProtectedAuth=dfpProtectedAuth;this.authenticate=this._subscriptionService.withUpdateSession(function(data){return __awaiter$1(_this12,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee64(){var _yield$this$dfpProtec17,dfp_telemetry_id,captcha_token;return _regenerator().w(function(_context64){while(1)switch(_context64.n){case 0:validate('stytch.impersonation.authenticate').isString('impersonation_token',data.impersonation_token);_context64.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec17=_context64.v;dfp_telemetry_id=_yield$this$dfpProtec17.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec17.captcha_token;return _context64.a(2,this._networkClient.retriableFetchSDK({url:'/impersonation/authenticate',body:Object.assign(Object.assign({},data),{dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token}),method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee64,this);}));});});var WILDCARD_ACTION='*';var RBACPolicy=/*#__PURE__*/function(){function RBACPolicy(roles,resources){var _this13=this;_classCallCheck(this,RBACPolicy);this.roles=roles;this.resources=resources;this.rolesByID={};roles.forEach(function(role){return _this13.rolesByID[role.role_id]=role;});}return _createClass(RBACPolicy,[{key:"mergeWithCustomRoles",value:function mergeWithCustomRoles(customRoles){var mergedRoles=[].concat(_toConsumableArray(this.roles),_toConsumableArray(customRoles));return new RBACPolicy(mergedRoles,this.resources);}},{key:"callerIsAuthorized",value:function callerIsAuthorized(memberRoles,resourceId,action){var _this14=this;return!!memberRoles.map(function(roleId){return _this14.rolesByID[roleId];}).filter(function(v){return v;}).flatMap(function(role){return role.permissions;}).filter(function(permission){return permission.resource_id===resourceId;}).find(function(permission){return permission.actions.includes(action)||permission.actions.includes(WILDCARD_ACTION);});}},{key:"allPermissionsForCaller",value:function allPermissionsForCaller(memberRoles){var _this15=this;var allPermsMap=Object.create(null);this.resources.forEach(function(resource){allPermsMap[resource.resource_id]={};resource.actions.forEach(function(action){allPermsMap[resource.resource_id][action]=_this15.callerIsAuthorized(memberRoles,resource.resource_id,action);});});return allPermsMap;}}],[{key:"fromJSON",value:function fromJSON(input){return new RBACPolicy(input.roles,input.resources);}}]);}();var HeadlessRBACClient=/*#__PURE__*/function(){function HeadlessRBACClient(cachedConfig,dynamicConfig,_subscriptionService){var _this16=this;_classCallCheck(this,HeadlessRBACClient);this._subscriptionService=_subscriptionService;this.isAuthorizedSync=function(resourceId,action){var _a;return!!((_a=_this16.cachedPolicy)===null||_a===void 0?void 0:_a.callerIsAuthorized(_this16.roleIds(),resourceId,action));};this.isAuthorized=function(resourceId,action){return _this16.policyPromise.then(function(policy){return policy.callerIsAuthorized(_this16.roleIds(),resourceId,action);});};this.cachedPolicy=cachedConfig.rbacPolicy?RBACPolicy.fromJSON(cachedConfig.rbacPolicy):null;this.policyPromise=dynamicConfig.then(function(data){if(!data.rbacPolicy){logger.error('Unable to retrieve RBAC policy from servers. Assuming caller has no permissions.');return new RBACPolicy([],[]);}_this16.cachedPolicy=RBACPolicy.fromJSON(data.rbacPolicy);return _this16.cachedPolicy;});}return _createClass(HeadlessRBACClient,[{key:"allPermissions",value:function allPermissions(){var _this17=this;return this.policyPromise.then(function(policy){return policy.allPermissionsForCaller(_this17.roleIds());});}},{key:"roleIds",value:function roleIds(){var _a;var user=this._subscriptionService.getUser();if(!user){return[];}return(_a=user.roles)!==null&&_a!==void 0?_a:[];}}]);}();var HeadlessIDPClient=/*#__PURE__*/_createClass(function HeadlessIDPClient(_networkClient){var _this18=this;_classCallCheck(this,HeadlessIDPClient);this._networkClient=_networkClient;this.oauthAuthorizeStart=function(data){return __awaiter$1(_this18,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee65(){return _regenerator().w(function(_context65){while(1)switch(_context65.n){case 0:return _context65.a(2,this._networkClient.fetchSDK({url:'/idp/oauth/authorize/start',method:'POST',body:data}));}},_callee65,this);}));};this.oauthAuthorizeSubmit=function(data){return __awaiter$1(_this18,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee66(){return _regenerator().w(function(_context66){while(1)switch(_context66.n){case 0:return _context66.a(2,this._networkClient.fetchSDK({url:'/idp/oauth/authorize/submit',method:'POST',body:data}));}},_callee66,this);}));};this.oauthLogoutStart=function(data){return __awaiter$1(_this18,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee67(){return _regenerator().w(function(_context67){while(1)switch(_context67.n){case 0:return _context67.a(2,this._networkClient.fetchSDK({url:"/oauth/logout/start",method:'POST',body:data}));}},_callee67,this);}));};});Promise.resolve({pkceRequiredForEmailMagicLinks:false});Promise.resolve({pkceRequiredForPasswordResets:false});var IframeHostClient=/*#__PURE__*/function(){function IframeHostClient(iframeURL){_classCallCheck(this,IframeHostClient);this.iframeURL=iframeURL;this.createIframe();}return _createClass(IframeHostClient,[{key:"createIframe",value:function createIframe(){var existingIframe=document.querySelector("[src~=\"".concat(this.iframeURL,"\"]"));if(!existingIframe){existingIframe=document.createElement('iframe');existingIframe.src=this.iframeURL;existingIframe.style.position='absolute';existingIframe.style.width='0';existingIframe.style.height='0';existingIframe.style.border='0';document.body.appendChild(existingIframe);}else{logger.warn(MULTIPLE_STYTCH_CLIENTS_DETECTED_WARNING);}if(existingIframe.dataset.loaded==='true'){this.frame=Promise.resolve(existingIframe);return;}this.frame=new Promise(function(resolve){existingIframe.addEventListener('load',function(){existingIframe.dataset.loaded='true';resolve(existingIframe);},{once:true});});}},{key:"call",value:function call(method,args){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee165(){var _this37=this;var frame,channel;return _regenerator().w(function(_context165){while(1)switch(_context165.n){case 0:_context165.n=1;return this.frame;case 1:frame=_context165.v;channel=new MessageChannel();return _context165.a(2,new Promise(function(resolve,reject){var _a;channel.port1.onmessage=function(event){var resp=event.data;channel.port1.close();if(resp.success){resolve(resp.payload);}else{reject(ErrorMarshaller.unmarshall(resp.error));}};var message={method:method,args:args};(_a=frame.contentWindow)===null||_a===void 0?void 0:_a.postMessage(message,_this37.iframeURL,[channel.port2]);}));}},_callee165,this);}));}}]);}();var SearchDataManager=/*#__PURE__*/function(){function SearchDataManager(_networkClient,dfpProtectedAuth){_classCallCheck(this,SearchDataManager);this._networkClient=_networkClient;this.dfpProtectedAuth=dfpProtectedAuth;}return _createClass(SearchDataManager,[{key:"searchUser",value:function searchUser(email){var _this38=this;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha().then(function(_ref0){var dfp_telemetry_id=_ref0.dfp_telemetry_id,captcha_token=_ref0.captcha_token;return _this38._networkClient.fetchSDK({url:"/users/search",method:'POST',body:{email:email,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token}});});}},{key:"searchMember",value:function searchMember(email,organization_id){return this._networkClient.fetchSDK({url:"/b2b/organizations/members/search",method:'POST',body:{email_address:email,organization_id:organization_id}});}}]);}();var shouldTryRefresh=function shouldTryRefresh(state){return!!(state===null||state===void 0?void 0:state.session);};var SessionManagerRegistry=/*#__PURE__*/function(){function SessionManagerRegistry(){_classCallCheck(this,SessionManagerRegistry);this.hasWarned=false;this.registry=new Map();}return _createClass(SessionManagerRegistry,[{key:"register",value:function register(key,sessionManager){var otherManager=this.registry.get(key);if(otherManager&&otherManager!==sessionManager){if(!this.hasWarned){logger.warn(MULTIPLE_STYTCH_CLIENTS_DETECTED_WARNING);this.hasWarned=true;}otherManager.cancelBackgroundRefresh();}this.registry.set(key,sessionManager);}},{key:"unregister",value:function unregister(publicToken,sessionManager){var otherManager=this.registry.get(publicToken);if(otherManager&&otherManager===sessionManager){this.registry["delete"](publicToken);}}}]);}();var SessionManager=/*#__PURE__*/function(){function SessionManager(_subscriptionService,_headlessSessionClient,_publicToken,_options){var _this39=this;_classCallCheck(this,SessionManager);this._subscriptionService=_subscriptionService;this._headlessSessionClient=_headlessSessionClient;this._publicToken=_publicToken;this._options=_options;this.timeout=null;this._onDataChange=function(state){if(state!=null&&state.sessionDurationMinutes){_this39.lastAuthenticationSessionDuration=state.sessionDurationMinutes;}if(shouldTryRefresh(state)){_this39.scheduleBackgroundRefresh();}else{_this39.cancelBackgroundRefresh();}};this._reauthenticateWithBackoff=function(){return __awaiter$1(_this39,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee166(){var count,options,_t56;return _regenerator().w(function(_context166){while(1)switch(_context166.p=_context166.n){case 0:count=0;case 1:_context166.p=2;options={session_duration_minutes:this._options.keepSessionAlive?this.lastAuthenticationSessionDuration:undefined};_context166.n=3;return this._headlessSessionClient.authenticate(options);case 3:return _context166.a(2,_context166.v);case 4:_context166.p=4;_t56=_context166.v;if(!SessionManager.isUnrecoverableError(_t56)){_context166.n=5;break;}return _context166.a(2,Promise.reject(_t56));case 5:count++;_context166.n=6;return new Promise(function(done){return setTimeout(done,SessionManager.timeoutForAttempt(count));});case 6:_context166.n=1;break;case 7:return _context166.a(2);}},_callee166,this,[[2,4]]);}));};this._subscriptionService.subscribeToState(this._onDataChange);}return _createClass(SessionManager,[{key:"register",value:function register(){SessionManager.registry.register(this._publicToken,this);}},{key:"unregister",value:function unregister(){SessionManager.registry.unregister(this._publicToken,this);}},{key:"performBackgroundRefresh",value:function performBackgroundRefresh(){var _this40=this;this._reauthenticateWithBackoff().then(function(){_this40.scheduleBackgroundRefresh();})["catch"](function(error){logger.warn('Session background refresh failed. Signalling to app that user is logged out.',{error:error});_this40._subscriptionService.destroySession();});}},{key:"scheduleBackgroundRefresh",value:function scheduleBackgroundRefresh(){var _this41=this;this.cancelBackgroundRefresh();this.register();this.timeout=setTimeout(function(){_this41.performBackgroundRefresh();},SessionManager.REFRESH_INTERVAL_MS);}},{key:"cancelBackgroundRefresh",value:function cancelBackgroundRefresh(){if(this.timeout!==null){this.unregister();clearTimeout(this.timeout);this.timeout=null;}}}],[{key:"timeoutForAttempt",value:function timeoutForAttempt(count){count=Math.min(count,7);var jitter=Math.floor(Math.random()*350)-175;var delayMS=2000*Math.pow(2,count);return jitter+delayMS;}},{key:"isUnrecoverableError",value:function isUnrecoverableError(error){return UNRECOVERABLE_ERROR_TYPES.includes(error.error_type);}}]);}();SessionManager.REFRESH_INTERVAL_MS=1000*60*3;SessionManager.registry=new SessionManagerRegistry();var StateChangeClient=/*#__PURE__*/_createClass(function StateChangeClient(_subscriptionService,emptyState){var _this42=this;_classCallCheck(this,StateChangeClient);this._subscriptionService=_subscriptionService;this.emptyState=emptyState;this.onStateChange=function(callback){return _this42._subscriptionService.subscribeToState(function(state){callback(state!==null&&state!==void 0?state:_this42.emptyState);});};});var VERTICAL_B2B='B2B';var BOOTSTRAP_CACHE_KEY='bootstrap';var DEFAULT_BOOTSTRAP=function DEFAULT_BOOTSTRAP(){return{displayWatermark:false,projectName:null,cnameDomain:null,emailDomains:['stytch.com'],captchaSettings:{enabled:false},pkceRequiredForEmailMagicLinks:false,pkceRequiredForPasswordResets:false,pkceRequiredForOAuth:false,pkceRequiredForSso:false,slugPattern:null,createOrganizationEnabled:false,passwordConfig:null,runDFPProtectedAuth:false,rbacPolicy:null,siweRequiredForCryptoWallets:false,vertical:null};};var BootstrapDataManager=/*#__PURE__*/function(){function BootstrapDataManager(_publicToken,_networkClient,_dataLayer){var _this19=this;_classCallCheck2(this,BootstrapDataManager);this._publicToken=_publicToken;this._networkClient=_networkClient;this._dataLayer=_dataLayer;this._bootstrapDataPromise=this._networkClient.fetchSDK({url:"/projects/bootstrap/".concat(this._publicToken),method:'GET'}).then(BootstrapDataManager.mapBootstrapData).then(function(data){_this19._dataLayer.setItem(BOOTSTRAP_CACHE_KEY,JSON.stringify(data));return data;})["catch"](function(error){logger.error(error);return DEFAULT_BOOTSTRAP();});}return _createClass2(BootstrapDataManager,[{key:"getSync",value:function getSync(){var cached=this._dataLayer.getItem(BOOTSTRAP_CACHE_KEY);if(cached===null){return DEFAULT_BOOTSTRAP();}try{return JSON.parse(cached);}catch(_a){return DEFAULT_BOOTSTRAP();}}},{key:"getAsync",value:function getAsync(){return this._bootstrapDataPromise;}}],[{key:"mapBootstrapData",value:function mapBootstrapData(response){var _a,_b;var passwordConfig=response.password_config!==null?{ludsComplexity:response.password_config.luds_complexity,ludsMinimumCount:response.password_config.luds_minimum_count}:null;return{projectName:response.project_name,displayWatermark:!response.disable_sdk_watermark,captchaSettings:response.captcha_settings,cnameDomain:response.cname_domain,emailDomains:response.email_domains,pkceRequiredForEmailMagicLinks:response.pkce_required_for_email_magic_links,pkceRequiredForPasswordResets:response.pkce_required_for_password_resets,pkceRequiredForOAuth:response.pkce_required_for_oauth,pkceRequiredForSso:response.pkce_required_for_sso,slugPattern:response.slug_pattern,createOrganizationEnabled:response.create_organization_enabled,passwordConfig:passwordConfig,runDFPProtectedAuth:(_a=response.dfp_protected_auth_enabled)!==null&&_a!==void 0?_a:false,dfpProtectedAuthMode:response.dfp_protected_auth_mode,rbacPolicy:(_b=response.rbac_policy)!==null&&_b!==void 0?_b:null,siweRequiredForCryptoWallets:response.siwe_required_for_crypto_wallets,vertical:response.vertical};}}]);}();function __rest(s,e){var t={};for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0)t[p]=s[p];if(s!=null&&typeof Object.getOwnPropertySymbols==="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++){if(e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i]))t[p[i]]=s[p[i]];}return t;}function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}}function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e);}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);}step((generator=generator.apply(thisArg,_arguments||[])).next());});}typeof SuppressedError==="function"?SuppressedError:function(error,suppressed,message){var e=new Error(message);return e.name="SuppressedError",e.error=error,e.suppressed=suppressed,e;};var loadRecaptchaClient=function loadRecaptchaClient(siteKey){return loadESModule("https://www.google.com/recaptcha/enterprise.js?render=".concat(siteKey),function(){return window.grecaptcha.enterprise;});};var CaptchaProvider=/*#__PURE__*/_createClass2(function CaptchaProvider(bootstrapPromise){var _this20=this;_classCallCheck2(this,CaptchaProvider);this.bootstrapPromise=bootstrapPromise;this.executeRecaptcha=function(){return __awaiter(_this20,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee0(){var _yield$this$state4,captchaClient,configured,siteKey;return _regenerator2().w(function(_context0){while(1)switch(_context0.n){case 0:_context0.n=1;return this.state;case 1:_yield$this$state4=_context0.v;captchaClient=_yield$this$state4.captchaClient;configured=_yield$this$state4.configured;siteKey=_yield$this$state4.siteKey;if(configured){_context0.n=2;break;}return _context0.a(2,undefined);case 2:_context0.n=3;return new Promise(function(resolve){return captchaClient.ready(resolve);});case 3:return _context0.a(2,captchaClient.execute(siteKey,{action:'LOGIN'}));}},_callee0,this);}));};this.state=bootstrapPromise.then(function(bootstrapData){return __awaiter(_this20,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee1(){var _t3,_t4;return _regenerator2().w(function(_context1){while(1)switch(_context1.n){case 0:if(bootstrapData.captchaSettings.enabled){_context1.n=1;break;}return _context1.a(2,{configured:false});case 1:_context1.n=2;return loadRecaptchaClient(bootstrapData.captchaSettings.siteKey);case 2:_t3=_context1.v;_t4=bootstrapData.captchaSettings.siteKey;return _context1.a(2,{configured:true,captchaClient:_t3,siteKey:_t4});}},_callee1);}));});});var ClientsideServicesProvider=/*#__PURE__*/function(){function ClientsideServicesProvider(iframeURL){var _this21=this;_classCallCheck2(this,ClientsideServicesProvider);this.iframeURL=iframeURL;this.oneTapStart=function(req){return _this21.call('oneTapStart',req);};this.oneTapSubmit=function(req){return _this21.call('oneTapSubmit',req);};this.parsedPhoneNumber=function(req){return _this21.call('parsedPhoneNumber',req);};}return _createClass2(ClientsideServicesProvider,[{key:"frameClient",get:function get(){var _a;this._frameClient=(_a=this._frameClient)!==null&&_a!==void 0?_a:new IframeHostClient(this.iframeURL);return this._frameClient;}},{key:"call",value:function call(handlerName,req){return this.frameClient.call(handlerName,[req]);}}]);}();var HeadlessOAuthClient=/*#__PURE__*/function(_HeadlessOAuthClient$){function HeadlessOAuthClient(_networkClient,_subscriptionService,_pkceManager,_dynamicConfig,_config,_oneTap){var _this22;_classCallCheck2(this,HeadlessOAuthClient);_this22=_callSuper2(this,HeadlessOAuthClient,[_networkClient,_subscriptionService,_pkceManager,_dynamicConfig,_config]);_this22._oneTap=_oneTap;_this22.startOneTap=function(options){return __awaiter(_this22,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee10(){var clientResult,client,onSuccessCallback;return _regenerator2().w(function(_context10){while(1)switch(_context10.n){case 0:_context10.n=1;return this._oneTap.createOneTapClient();case 1:clientResult=_context10.v;if(clientResult.success){_context10.n=2;break;}throw new Error("One Tap could not load: ".concat(clientResult.reason));case 2:client=clientResult.client;onSuccessCallback=this._oneTap.createOnSuccessHandler({signupRedirectUrl:options.signup_redirect_url,loginRedirectUrl:options.login_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return _context10.a(2,client.render({style:{position:OneTapPositions.floating},onOneTapCancelled:options.onOneTapCancelled,callback:onSuccessCallback,cancelOnTapOutside:options.cancel_on_tap_outside}));}},_callee10,this);}));};_this22.googleOneTap={start:_this22.startOneTap};return _this22;}_inherits2(HeadlessOAuthClient,_HeadlessOAuthClient$);return _createClass2(HeadlessOAuthClient);}(HeadlessOAuthClient$1);var version="5.44.0";var NetworkClient=/*#__PURE__*/function(){function NetworkClient(_publicToken,_subscriptionDataLayer,_liveAPIURL,_testAPIURL,additionalTelemetryDataFn){_classCallCheck2(this,NetworkClient);this._publicToken=_publicToken;this._subscriptionDataLayer=_subscriptionDataLayer;this.additionalTelemetryDataFn=additionalTelemetryDataFn;this.updateSessionToken=function(){return null;};this.baseURL=_liveAPIURL;if(isTestPublicToken(_publicToken)){this.baseURL=_testAPIURL;}this.eventLogger=new EventLogger({maxBatchSize:DEFAULT_MAX_BATCH_SIZE,intervalDurationMs:DEFAULT_INTERVAL_DURATION_MS,logEventURL:this.buildSDKUrl('/events')});}return _createClass2(NetworkClient,[{key:"logEvent",value:function logEvent(_ref7){var name=_ref7.name,details=_ref7.details,_ref7$error=_ref7.error,error=_ref7$error===void 0?{}:_ref7$error;this.eventLogger.logEvent(this.createTelemetryBlob(),{public_token:this._publicToken,event_name:name,details:details,error_code:error.error_code,error_description:error.error_description,http_status_code:error.http_status_code});}},{key:"createTelemetryBlob",value:function createTelemetryBlob(){return Object.assign(Object.assign({event_id:createEventId(),app_session_id:createAppSessionId(),persistent_id:createPersistentId(),client_sent_at:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},this.additionalTelemetryDataFn()),{app:{identifier:window.location.hostname},sdk:{identifier:'Stytch.js Javascript SDK',version:version}});}},{key:"fetchSDK",value:function fetchSDK(_ref8){var url=_ref8.url,body=_ref8.body,method=_ref8.method;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee11(){var sessionToken,basicAuthHeader,xSDKClientHeader,xSDKParentHostHeader;return _regenerator2().w(function(_context11){while(1)switch(_context11.n){case 0:sessionToken=this._subscriptionDataLayer.readSessionCookie().session_token;basicAuthHeader='Basic '+window.btoa(this._publicToken+':'+(sessionToken||this._publicToken));xSDKClientHeader=window.btoa(JSON.stringify(this.createTelemetryBlob()));xSDKParentHostHeader=window.location.origin;return _context11.a(2,baseFetchSDK({basicAuthHeader:basicAuthHeader,body:body,finalURL:this.buildSDKUrl(url),method:method,xSDKClientHeader:xSDKClientHeader,xSDKParentHostHeader:xSDKParentHostHeader}));}},_callee11,this);}));}},{key:"submitFormSDK",value:function submitFormSDK(_ref9){var url=_ref9.url,body=_ref9.body,method=_ref9.method;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee68(){var sessionToken,basicAuthHeader,xSDKClientHeader,xSDKParentHostHeader;return _regenerator2().w(function(_context68){while(1)switch(_context68.n){case 0:sessionToken=this._subscriptionDataLayer.readSessionCookie().session_token;basicAuthHeader='Basic '+window.btoa(this._publicToken+':'+(sessionToken||this._publicToken));xSDKClientHeader=window.btoa(JSON.stringify(this.createTelemetryBlob()));xSDKParentHostHeader=window.location.origin;return _context68.a(2,baseSubmitFormSDK({basicAuthHeader:basicAuthHeader,body:body,finalURL:this.buildSDKUrl(url),method:method,xSDKClientHeader:xSDKClientHeader,xSDKParentHostHeader:xSDKParentHostHeader}));}},_callee68,this);}));}},{key:"retriableFetchSDK",value:function retriableFetchSDK(_ref1){var url=_ref1.url,body=_ref1.body,method=_ref1.method,retryCallback=_ref1.retryCallback;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee69(){var sessionToken,basicAuthHeader,xSDKClientHeader,xSDKParentHostHeader;return _regenerator2().w(function(_context69){while(1)switch(_context69.n){case 0:sessionToken=this._subscriptionDataLayer.readSessionCookie().session_token;basicAuthHeader='Basic '+window.btoa(this._publicToken+':'+(sessionToken||this._publicToken));xSDKClientHeader=window.btoa(JSON.stringify(this.createTelemetryBlob()));xSDKParentHostHeader=window.location.origin;return _context69.a(2,_retriableFetchSDK({basicAuthHeader:basicAuthHeader,body:body,finalURL:this.buildSDKUrl(url),method:method,xSDKClientHeader:xSDKClientHeader,xSDKParentHostHeader:xSDKParentHostHeader,retryCallback:retryCallback}));}},_callee69,this);}));}},{key:"buildSDKUrl",value:function buildSDKUrl(url){return"".concat(this.baseURL,"/sdk/v1").concat(url);}}]);}();var navigatorSupportsFedCM=typeof window!=='undefined'&&'IdentityCredential'in window;var getConfiguredEmbeddedMode=function getConfiguredEmbeddedMode(position){if(position===OneTapPositions.forceLegacyEmbedded){return'force';}if(position===OneTapPositions.embeddedOnly||position===OneTapPositions.embedded||position===OneTapPositions.floatingOrEmbedded){return true;}return false;};var getShouldRenderEmbeddedOneTap=function getShouldRenderEmbeddedOneTap(position){var embeddedMode=getConfiguredEmbeddedMode(position);return embeddedMode==='force'||embeddedMode&&!navigatorSupportsFedCM;};var getShouldRenderFloatingOneTap=function getShouldRenderFloatingOneTap(position){return position!==OneTapPositions.embeddedOnly&&!getShouldRenderEmbeddedOneTap(position);};var getRenderedOneTapMode=function getRenderedOneTapMode(position){var embeddedMode=getConfiguredEmbeddedMode(position);if(embeddedMode==='force'||embeddedMode&&!navigatorSupportsFedCM){return'embedded';}if(position!==OneTapPositions.embeddedOnly){return'floating';}return false;};var GoogleOneTapClient=/*#__PURE__*/function(){function GoogleOneTapClient(_googleClient,_clientId){_classCallCheck2(this,GoogleOneTapClient);this._googleClient=_googleClient;this._clientId=_clientId;}return _createClass2(GoogleOneTapClient,[{key:"cancel",value:function cancel(){this._googleClient.cancel();}},{key:"render",value:function render(_ref10){var callback=_ref10.callback,onOneTapCancelled=_ref10.onOneTapCancelled,style=_ref10.style,_ref10$cancelOnTapOut=_ref10.cancelOnTapOutside,cancelOnTapOutside=_ref10$cancelOnTapOut===void 0?true:_ref10$cancelOnTapOut;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee70(){var _this23=this;var embeddedMode,shouldRenderEmbeddedOneTap,config;return _regenerator2().w(function(_context70){while(1)switch(_context70.n){case 0:embeddedMode=getConfiguredEmbeddedMode(style.position);shouldRenderEmbeddedOneTap=getShouldRenderEmbeddedOneTap(style.position);config={client_id:this._clientId,callback:callback,auto_select:false,context:'use',itp_support:true,use_fedcm_for_prompt:embeddedMode!=='force',cancel_on_tap_outside:cancelOnTapOutside};if(shouldRenderEmbeddedOneTap){config.prompt_parent_id='google-parent-prompt';config.cancel_on_tap_outside=false;}this._googleClient.initialize(config);return _context70.a(2,new Promise(function(resolve){_this23._googleClient.prompt(function(notification){var _a,_b,_c,_d,_e;if(notification.isSkippedMoment()){var reason=(_b=(_a=notification.getSkippedReason)===null||_a===void 0?void 0:_a.call(notification))!==null&&_b!==void 0?_b:'unknown_reason';if(reason==='user_cancel'){onOneTapCancelled===null||onOneTapCancelled===void 0?void 0:onOneTapCancelled();}return resolve({success:false,reason:reason});}if(!notification.isNotDisplayed&&shouldRenderEmbeddedOneTap||((_c=notification.isNotDisplayed)===null||_c===void 0?void 0:_c.call(notification))){return resolve({success:false,reason:(_e=(_d=notification.getNotDisplayedReason)===null||_d===void 0?void 0:_d.call(notification))!==null&&_e!==void 0?_e:'unknown_reason'});}if(!notification.isDismissedMoment()){_this23.styleFrame(shouldRenderEmbeddedOneTap);return resolve({success:true});}});}));}},_callee70,this);}));}},{key:"styleFrame",value:function styleFrame(shouldRenderEmbeddedOneTap){if(!shouldRenderEmbeddedOneTap){return;}Array.from(document.getElementsByTagName('iframe')).forEach(function(frame){if(frame.src.includes(GOOGLE_ONE_TAP_HOST)){frame.style.width='100%';}});}}]);}();var loadGoogleOneTapClient=function loadGoogleOneTapClient(){return loadESModule(GOOGLE_ONE_TAP_SCRIPT_URL,function(){return window.google.accounts.id;});};var OneTapProvider=/*#__PURE__*/function(){function OneTapProvider(_publicToken,clientsideServices){var _this24=this;_classCallCheck2(this,OneTapProvider);this._publicToken=_publicToken;this.clientsideServices=clientsideServices;this.createOnSuccessHandler=function(_ref11){var loginRedirectUrl=_ref11.loginRedirectUrl,signupRedirectUrl=_ref11.signupRedirectUrl,onSuccess=_ref11.onSuccess;return function(response){return __awaiter(_this24,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee71(){var credential,_yield$this$submitGoo,redirect_url;return _regenerator2().w(function(_context71){while(1)switch(_context71.n){case 0:credential=response.credential;_context71.n=1;return this.submitGoogleOneTapToken({credential:credential,loginRedirectUrl:loginRedirectUrl,signupRedirectUrl:signupRedirectUrl});case 1:_yield$this$submitGoo=_context71.v;redirect_url=_yield$this$submitGoo.redirect_url;onSuccess(redirect_url);case 2:return _context71.a(2);}},_callee71,this);}));};};this.redirectOnSuccess=function(redirect_url){window.location.href=redirect_url;};}return _createClass2(OneTapProvider,[{key:"createOneTapClient",value:function createOneTapClient(){return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee72(){var googleClientId,_yield$this$fetchGoog,err,client,_t5,_t6,_t11,_t12;return _regenerator2().w(function(_context72){while(1)switch(_context72.p=_context72.n){case 0:_context72.p=0;_context72.n=1;return this.fetchGoogleStart();case 1:_yield$this$fetchGoog=_context72.v;googleClientId=_yield$this$fetchGoog.googleClientId;_context72.n=3;break;case 2:_context72.p=2;_t5=_context72.v;err=StytchAPIError.from(_t5);return _context72.a(2,{success:false,reason:err.error_type});case 3:if(!(googleClientId==='')){_context72.n=4;break;}return _context72.a(2,{success:false,reason:'oauth_config_not_found'});case 4:_t6=GoogleOneTapClient;_context72.n=5;return loadGoogleOneTapClient();case 5:_t11=_context72.v;_t12=googleClientId;client=new _t6(_t11,_t12);return _context72.a(2,{success:true,client:client});}},_callee72,this,[[0,2]]);}));}},{key:"fetchGoogleStart",value:function fetchGoogleStart(){if(this.googleConfig){return this.googleConfig;}this.googleConfig=this.clientsideServices.oneTapStart({publicToken:this._publicToken});return this.googleConfig;}},{key:"submitGoogleOneTapToken",value:function submitGoogleOneTapToken(_ref12){var credential=_ref12.credential,loginRedirectUrl=_ref12.loginRedirectUrl,signupRedirectUrl=_ref12.signupRedirectUrl;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee73(){var _yield$this$fetchGoog2,oauthCallbackId;return _regenerator2().w(function(_context73){while(1)switch(_context73.n){case 0:_context73.n=1;return this.fetchGoogleStart();case 1:_yield$this$fetchGoog2=_context73.v;oauthCallbackId=_yield$this$fetchGoog2.oauthCallbackId;return _context73.a(2,this.clientsideServices.oneTapSubmit({publicToken:this._publicToken,idToken:credential,loginRedirectURL:loginRedirectUrl,oauthCallbackID:oauthCallbackId,signupRedirectURL:signupRedirectUrl}));}},_callee73,this);}));}}],[{key:"willGoogleOneTapShowEmbedded",value:function willGoogleOneTapShowEmbedded(){var ua=arguments.length>0&&arguments[0]!==undefined?arguments[0]:navigator.userAgent;var uaContains=function uaContains(userAgent,searchString){return userAgent.indexOf(searchString)!==-1;};var isTabletUA=uaContains(ua,'iPad')||uaContains(ua,'Android')&&!uaContains(ua,'Mobile')||uaContains(ua,'Silk');var isMobileUA=uaContains(ua,'iPod')||uaContains(ua,'iPhone')||uaContains(ua,'Android')||uaContains(ua,'IEMobile');return!isTabletUA&&isMobileUA;}}]);}();var PKCE_VERIFIER_STORAGE_KEY='PKCE_VERIFIER';function toHex(n){var str=n.toString(16);if(str.length===1){str='0'+str;}return str;}function base64URLEncode(buf){var _String$fromCharCode;return btoa((_String$fromCharCode=String.fromCharCode).call.apply(_String$fromCharCode,[null].concat(_toConsumableArray2(new Uint8Array(buf))))).replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,'');}var PKCEManager=/*#__PURE__*/function(){function PKCEManager(_dataLayer,namespace){_classCallCheck2(this,PKCEManager);this._dataLayer=_dataLayer;this.namespace=namespace;}return _createClass2(PKCEManager,[{key:"key",value:function key(){return"".concat(PKCE_VERIFIER_STORAGE_KEY,":").concat(this.namespace);}},{key:"startPKCETransaction",value:function startPKCETransaction(){return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee74(){var keyPair;return _regenerator2().w(function(_context74){while(1)switch(_context74.n){case 0:_context74.n=1;return PKCEManager.createProofkeyPair();case 1:keyPair=_context74.v;this._dataLayer.setItem(this.key(),JSON.stringify(keyPair));return _context74.a(2,keyPair);}},_callee74,this);}));}},{key:"getPKPair",value:function getPKPair(){var serialized=this._dataLayer.getItem(this.key());if(serialized===null){return undefined;}try{return JSON.parse(serialized);}catch(_a){logger.warn('Found malformed Proof Key pair in localstorage.');return undefined;}}},{key:"clearPKPair",value:function clearPKPair(){return this._dataLayer.removeItem(this.key());}}],[{key:"createProofkeyPair",value:function createProofkeyPair(){return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee75(){var bytes,codeVerifier,digest;return _regenerator2().w(function(_context75){while(1)switch(_context75.n){case 0:bytes=new Uint32Array(16);window.crypto.getRandomValues(bytes);codeVerifier=Array.from(bytes).map(toHex).join('');_context75.n=1;return window.crypto.subtle.digest('SHA-256',new TextEncoder().encode(codeVerifier));case 1:digest=_context75.v;return _context75.a(2,{code_challenge:base64URLEncode(digest),code_verifier:codeVerifier});}},_callee75);}));}}]);}();/*! js-cookie v3.0.1 | MIT */function assign(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){target[key]=source[key];}}return target;}var defaultConverter={read:function read(value){if(value[0]==='"'){value=value.slice(1,-1);}return value.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);},write:function write(value){return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent);}};function init(converter,defaultAttributes){function set(key,value,attributes){if(typeof document==='undefined'){return;}attributes=assign({},defaultAttributes,attributes);if(typeof attributes.expires==='number'){attributes.expires=new Date(Date.now()+attributes.expires*864e5);}if(attributes.expires){attributes.expires=attributes.expires.toUTCString();}key=encodeURIComponent(key).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var stringifiedAttributes='';for(var attributeName in attributes){if(!attributes[attributeName]){continue;}stringifiedAttributes+='; '+attributeName;if(attributes[attributeName]===true){continue;}stringifiedAttributes+='='+attributes[attributeName].split(';')[0];}return document.cookie=key+'='+converter.write(value,key)+stringifiedAttributes;}function get(key){if(typeof document==='undefined'||arguments.length&&!key){return;}var cookies=document.cookie?document.cookie.split('; '):[];var jar={};for(var i=0;i<cookies.length;i++){var parts=cookies[i].split('=');var value=parts.slice(1).join('=');try{var foundKey=decodeURIComponent(parts[0]);jar[foundKey]=converter.read(value,foundKey);if(key===foundKey){break;}}catch(e){}}return key?jar[key]:jar;}return Object.create({set:set,get:get,remove:function remove(key,attributes){set(key,'',assign({},attributes,{expires:-1}));},withAttributes:function withAttributes(attributes){return init(this.converter,assign({},this.attributes,attributes));},withConverter:function withConverter(converter){return init(assign({},this.converter,converter),this.attributes);}},{attributes:{value:Object.freeze(defaultAttributes)},converter:{value:Object.freeze(converter)}});}var api=init(defaultConverter,{path:'/'});var createDeepEqual=function createDeepEqual(){var _ref13=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref13$KEYS_TO_EXCLUD=_ref13.KEYS_TO_EXCLUDE,KEYS_TO_EXCLUDE=_ref13$KEYS_TO_EXCLUD===void 0?[]:_ref13$KEYS_TO_EXCLUD;var _deepEqual=function deepEqual(a,b){if(_typeof2(a)!==_typeof2(b))return false;if(a===null||b===null)return a===b;if(_typeof2(a)==='object'){if(Object.keys(a).length!==Object.keys(b).length||Object.keys(a).some(function(k){return!(k in b);}))return false;return Object.entries(a).filter(function(_ref14){var _ref15=_slicedToArray2(_ref14,1),k=_ref15[0];return!KEYS_TO_EXCLUDE.includes(k);}).every(function(_ref16){var _ref17=_slicedToArray2(_ref16,2),k=_ref17[0],v=_ref17[1];return _deepEqual(v,b[k]);});}return a===b;};return _deepEqual;};var EMAIL_REGEX=/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;var convertMagicLinkOptions=function convertMagicLinkOptions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return{signup_magic_link_url:options.signupRedirectURL,signup_expiration_minutes:options.signupExpirationMinutes,login_magic_link_url:options.loginRedirectURL,login_expiration_minutes:options.loginExpirationMinutes,login_template_id:options.loginTemplateId,signup_template_id:options.signupTemplateId,locale:options.locale};};var convertPasswordResetOptions=function convertPasswordResetOptions(email){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return{email:email,login_redirect_url:options.loginRedirectURL,login_expiration_minutes:options.loginExpirationMinutes,reset_password_redirect_url:options.resetPasswordRedirectURL,reset_password_expiration_minutes:options.resetPasswordExpirationMinutes,reset_password_template_id:options.resetPasswordTemplateId,locale:options.locale};};var debounce=function debounce(func){var waitFor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:500;var timeout;var debounced=function debounced(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4];}clearTimeout(timeout);timeout=setTimeout(function(){return func.apply(void 0,args);},waitFor);};return debounced;};var isLocalhost=function isLocalhost(){return Boolean(window.location.hostname==='localhost'||window.location.hostname==='[::1]'||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));};var hasMultipleCookies=function hasMultipleCookies(cookieName){var cookiePairs=document.cookie?document.cookie.split('; '):[];var matchedCookies=cookiePairs.filter(function(pair){var _pair$split=pair.split('='),_pair$split2=_slicedToArray2(_pair$split,1),name=_pair$split2[0];return cookieName===name;});return matchedCookies.length>1;};var PERSISTENT_STORAGE_KEY_PREFIX='stytch_sdk_state_';var getPersistentStorageKey=function getPersistentStorageKey(publicToken,key){return"".concat(PERSISTENT_STORAGE_KEY_PREFIX).concat(publicToken).concat(key?"::".concat(key):'');};function makeSafeStorage(storage){if(storage==null){return{getItem:function getItem(){return null;},removeItem:function removeItem(){},setItem:function setItem(){}};}return{getItem:function getItem(publicKey,key){var persistentStorageKey=getPersistentStorageKey(publicKey,key);try{return storage.getItem(persistentStorageKey);}catch(_a){return null;}},setItem:function setItem(publicKey,key,value){var persistentStorageKey=getPersistentStorageKey(publicKey,key);try{if(value)storage.setItem(persistentStorageKey,value);}catch(_a){}},removeItem:function removeItem(publicKey,key){var persistentStorageKey=getPersistentStorageKey(publicKey,key);try{storage.removeItem(persistentStorageKey);}catch(_a){}}};}var safeLocalStorage=makeSafeStorage(globalThis.localStorage);var safeSessionStorage=makeSafeStorage(globalThis.sessionStorage);function getKeyBoundStorage(storage,publicToken){return{getItem:function getItem(key){return storage.getItem(publicToken,key);},setItem:function setItem(key,value){storage.setItem(publicToken,key,value);},removeItem:function removeItem(key){storage.removeItem(publicToken,key);}};}var STYTCH_SESSION_COOKIE='stytch_session';var STYTCH_SESSION_JWT_COOKIE='stytch_session_jwt';var STYTCH_INTERMEDIATE_SESSION_TOKEN_COOKIE='stytch_intermediate_session_token';var SEEN_DOMAINS_KEY='seen_domains';var SubscriptionDataLayer=/*#__PURE__*/function(){function SubscriptionDataLayer(publicToken,options){_classCallCheck2(this,SubscriptionDataLayer);this._opaqueTokenCookieName=null;this._jwtCookieName=null;this._cookiePath=null;this._domain=null;this._cookieAvailableToSubdomains=false;this._istCookieName=null;this.publicToken=publicToken;this.state=null;this.stateKeysUpdated=new Set();this.subscriptions={};this._localStorage=getKeyBoundStorage(safeLocalStorage,publicToken);this.browserSessionStorage=getKeyBoundStorage(safeSessionStorage,publicToken);if(options===null||options===void 0?void 0:options.cookieOptions){this._opaqueTokenCookieName=options.cookieOptions.opaqueTokenCookieName||null;this._jwtCookieName=options.cookieOptions.jwtCookieName||null;this._cookiePath=options.cookieOptions.path||null;this._domain=options.cookieOptions.domain||null;this._cookieAvailableToSubdomains=options.cookieOptions.availableToSubdomains||false;this._istCookieName=options.cookieOptions.istCookieName||null;}var localStorageState=this._localStorage.getItem('');if(!localStorageState){return;}var parsedState;try{parsedState=JSON.parse(localStorageState);}catch(_a){this.syncToLocalStorage();return;}this.state=parsedState;}return _createClass2(SubscriptionDataLayer,[{key:"opaqueTokenCookieName",get:function get(){var _a;return(_a=this._opaqueTokenCookieName)!==null&&_a!==void 0?_a:STYTCH_SESSION_COOKIE;}},{key:"jwtCookieName",get:function get(){var _a;return(_a=this._jwtCookieName)!==null&&_a!==void 0?_a:STYTCH_SESSION_JWT_COOKIE;}},{key:"istCookieName",get:function get(){var _a;return(_a=this._istCookieName)!==null&&_a!==void 0?_a:STYTCH_INTERMEDIATE_SESSION_TOKEN_COOKIE;}},{key:"readSessionCookie",value:function readSessionCookie(){return{session_token:api.get(this.opaqueTokenCookieName),session_jwt:api.get(this.jwtCookieName)};}},{key:"readIntermediateSessionTokenCookie",value:function readIntermediateSessionTokenCookie(){return api.get(this.istCookieName);}},{key:"writeSessionCookie",value:function writeSessionCookie(stateDiff){var _a,_b,_c,_d;var state=stateDiff.state,session_token=stateDiff.session_token,session_jwt=stateDiff.session_jwt;var cookieOpts=SubscriptionDataLayer.generateCookieOpts({expiresAt:(_b=(_a=state===null||state===void 0?void 0:state.session)===null||_a===void 0?void 0:_a.expires_at)!==null&&_b!==void 0?_b:'',availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});if(cookieOpts.domain){this.addSeenDomain(cookieOpts.domain);}api.set(this.opaqueTokenCookieName,session_token,cookieOpts);api.set(this.jwtCookieName,session_jwt,cookieOpts);var alternateCookieOptions=SubscriptionDataLayer.generateCookieOpts({expiresAt:(_d=(_c=state===null||state===void 0?void 0:state.session)===null||_c===void 0?void 0:_c.expires_at)!==null&&_d!==void 0?_d:'',availableToSubdomains:!this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});if(alternateCookieOptions.domain){this.addSeenDomain(alternateCookieOptions.domain);}if(hasMultipleCookies(this.jwtCookieName)){api.remove(this.jwtCookieName,alternateCookieOptions);}if(hasMultipleCookies(this.opaqueTokenCookieName)){api.remove(this.opaqueTokenCookieName,alternateCookieOptions);}if(hasMultipleCookies(this.jwtCookieName)){logger.warn('Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior.');}if(hasMultipleCookies(this.opaqueTokenCookieName)){logger.warn('Could not remove extraneous opaque token cookie.');}}},{key:"writeIntermediateSessionTokenCookie",value:function writeIntermediateSessionTokenCookie(IST){var expiresAtTime=new Date(Date.now()+10*60000);var cookieOpts=SubscriptionDataLayer.generateCookieOpts({expiresAt:expiresAtTime.toString(),availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});api.set(this.istCookieName,IST,cookieOpts);}},{key:"removeSessionCookie",value:function removeSessionCookie(){this.removeCookies([this.opaqueTokenCookieName,this.jwtCookieName]);}},{key:"removeISTCookie",value:function removeISTCookie(){this.removeCookies([this.istCookieName]);}},{key:"removeCookies",value:function removeCookies(cookiesToRemove){var _this25=this;var trackedDomains=this.getSeenDomains();var allDomains=[this._domain,null].concat(_toConsumableArray2(trackedDomains));var uniqueDomains=_toConsumableArray2(new Set(allDomains));[true,false].forEach(function(availableToSubdomains){[_this25._cookiePath,null].forEach(function(path){uniqueDomains.forEach(function(domain){var cookieOpts=SubscriptionDataLayer.generateCookieOpts({expiresAt:new Date(0).toString(),availableToSubdomains:availableToSubdomains,path:path,domain:domain});cookiesToRemove.forEach(function(cookieName){api.remove(cookieName,cookieOpts);});});});});}},{key:"syncToLocalStorage",value:function syncToLocalStorage(){this._localStorage.setItem('',JSON.stringify(this.state));}},{key:"getItem",value:function getItem(key){return this._localStorage.getItem(key);}},{key:"setItem",value:function setItem(key,value){this._localStorage.setItem(key,value);}},{key:"removeItem",value:function removeItem(key){this._localStorage.removeItem(key);}},{key:"getSeenDomains",value:function getSeenDomains(){var storedDomains=this.getItem(SEEN_DOMAINS_KEY);if(!storedDomains){return[];}try{var parsed=JSON.parse(storedDomains);return Array.isArray(parsed)?parsed:[];}catch(_a){return[];}}},{key:"addSeenDomain",value:function addSeenDomain(domain){if(!domain){return;}var storedDomains=this.getSeenDomains();if(!storedDomains.includes(domain)){storedDomains.push(domain);this.setItem(SEEN_DOMAINS_KEY,JSON.stringify(storedDomains));}}}],[{key:"generateCookieOpts",value:function generateCookieOpts(_ref18){var path=_ref18.path,domain=_ref18.domain,availableToSubdomains=_ref18.availableToSubdomains,expiresAt=_ref18.expiresAt;var cookieOpts={expires:new Date(expiresAt),sameSite:'lax'};if(path){cookieOpts.path=path;}if(isLocalhost()){cookieOpts.secure=false;}else{if(availableToSubdomains){cookieOpts.domain=domain||window.location.host;}cookieOpts.secure=true;}return cookieOpts;}}]);}();var ConsumerSubscriptionDataLayer=/*#__PURE__*/function(_SubscriptionDataLaye){function ConsumerSubscriptionDataLayer(){_classCallCheck2(this,ConsumerSubscriptionDataLayer);return _callSuper2(this,ConsumerSubscriptionDataLayer,arguments);}_inherits2(ConsumerSubscriptionDataLayer,_SubscriptionDataLaye);return _createClass2(ConsumerSubscriptionDataLayer);}(SubscriptionDataLayer);var consumerDataLayerCacheSymbol=Symbol["for"]('__stytch_DataLayer');var getConsumerDataLayerCache=function getConsumerDataLayerCache(){var wdw=window;if(!wdw[consumerDataLayerCacheSymbol]){wdw[consumerDataLayerCacheSymbol]={};}return wdw[consumerDataLayerCacheSymbol];};var getConsumerDataLayer=function getConsumerDataLayer(publicToken,options){var dataLayerCache=getConsumerDataLayerCache();if(!dataLayerCache[publicToken]){dataLayerCache[publicToken]=new ConsumerSubscriptionDataLayer(publicToken,options);}return dataLayerCache[publicToken];};var addSubscriber=function addSubscriber(collection,subscriber){var uniqueId=Math.random().toString(36).slice(-10);collection[uniqueId]=subscriber;return function(){return delete collection[uniqueId];};};var notifySubscribers=function notifySubscribers(collection,value){Object.values(collection).forEach(function(cb){return cb(value);});};var deepEqualData=createDeepEqual({KEYS_TO_EXCLUDE:['last_accessed_at']});var BaseSubscriptionService=/*#__PURE__*/function(){function BaseSubscriptionService(_publicToken,_datalayer,_ref19){var _this26=this;var usingCustomApiEndpoint=_ref19.usingCustomApiEndpoint;_classCallCheck2(this,BaseSubscriptionService);this._publicToken=_publicToken;this._datalayer=_datalayer;this.fromCache=true;this._listen=function(e){if(e.key!==getPersistentStorageKey(_this26._publicToken,'')){return;}var parsedValue=e.newValue===null||e.newValue==='null'?null:JSON.parse(e.newValue);_this26.updateState(parsedValue,true);};window.addEventListener('storage',this._listen);if(!usingCustomApiEndpoint){var _this$_datalayer$read=this._datalayer.readSessionCookie(),session_token=_this$_datalayer$read.session_token;if(!session_token){this.destroySession();return;}}}return _createClass2(BaseSubscriptionService,[{key:"getTokens",value:function getTokens(){var _this$_datalayer$read2=this._datalayer.readSessionCookie(),session_token=_this$_datalayer$read2.session_token,session_jwt=_this$_datalayer$read2.session_jwt;if(!(typeof session_token==='string')||!(typeof session_jwt==='string')){return null;}return{session_token:session_token,session_jwt:session_jwt};}},{key:"getIntermediateSessionToken",value:function getIntermediateSessionToken(){return this._datalayer.readIntermediateSessionTokenCookie()||null;}},{key:"destroyState",value:function destroyState(){this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:null});}},{key:"destroySession",value:function destroySession(){this._datalayer.removeSessionCookie();this.updateState(null);}},{key:"_updateStateAndTokensInternal",value:function _updateStateAndTokensInternal(stateDiff,options){var oldStateValue=this._datalayer.state;var newStateValue=stateDiff.state===null?null:Object.assign(Object.assign({},this._datalayer.state),stateDiff.state);this._datalayer.state=newStateValue;var wasCached=this.getFromCache();this.setCacheRefreshed();if(wasCached||!deepEqualData(oldStateValue,newStateValue)){var notification;if(newStateValue==null||options.fromCache){notification=newStateValue;}else{notification=Object.assign(Object.assign({},newStateValue),{sessionDurationMinutes:options.sessionDurationMinutes});}notifySubscribers(this._datalayer.subscriptions,notification);}}},{key:"updateStateAndTokens",value:function updateStateAndTokens(stateDiff){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{fromCache:false};if(stateDiff.state){if(typeof stateDiff.session_token==='string'){this._datalayer.writeSessionCookie(stateDiff);}else{this._datalayer.removeSessionCookie();}this._datalayer.removeISTCookie();}else if(stateDiff.intermediate_session_token){if(typeof stateDiff.intermediate_session_token==='string'){this._datalayer.writeIntermediateSessionTokenCookie(stateDiff.intermediate_session_token);}else{this._datalayer.removeISTCookie();}this._datalayer.removeSessionCookie();}else{this._datalayer.removeSessionCookie();this._datalayer.removeISTCookie();}this._updateStateAndTokensInternal(stateDiff,options);this._datalayer.syncToLocalStorage();}},{key:"updateState",value:function updateState(state){var fromExternalSource=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var oldStateValue=this._datalayer.state;var newStateValue=state===null?null:Object.assign(Object.assign({},this._datalayer.state),state);this._datalayer.state=newStateValue;var wasCached=this.getFromCache();this.setCacheRefreshed();var hasStateChanged=!deepEqualData(oldStateValue,newStateValue);if(wasCached||hasStateChanged){notifySubscribers(this._datalayer.subscriptions,newStateValue);if(hasStateChanged&&!fromExternalSource){this._datalayer.syncToLocalStorage();}}}},{key:"updateTokens",value:function updateTokens(tokens){var session_token=tokens.session_token,session_jwt=tokens.session_jwt;var cookie=this._datalayer.readSessionCookie();var diff=Object.assign(Object.assign({},cookie),{session_token:session_token,session_jwt:session_jwt});if(typeof session_token==='string'||typeof session_jwt==='string'){this._datalayer.writeSessionCookie(diff);this._datalayer.removeISTCookie();}else{this._datalayer.removeSessionCookie();}}},{key:"subscribeToState",value:function subscribeToState(callback){return addSubscriber(this._datalayer.subscriptions,callback);}},{key:"getState",value:function getState(){return this._datalayer.state;}},{key:"destroy",value:function destroy(){window.removeEventListener('storage',this._listen);}},{key:"syncFromDeviceStorage",value:function syncFromDeviceStorage(){return null;}},{key:"getFromCache",value:function getFromCache(){return this.fromCache;}},{key:"setCacheRefreshed",value:function setCacheRefreshed(){this.fromCache=false;}}]);}();var ConsumerSubscriptionService=/*#__PURE__*/function(_BaseSubscriptionServ){function ConsumerSubscriptionService(){var _this27;_classCallCheck2(this,ConsumerSubscriptionService);_this27=_callSuper2(this,ConsumerSubscriptionService,arguments);_this27.updateUser=function(user){return _this27.updateState({user:user});};_this27.getUser=function(){var _a,_b;return(_b=(_a=_this27.getState())===null||_a===void 0?void 0:_a.user)!==null&&_b!==void 0?_b:null;};_this27.getSession=function(){var _a,_b;return(_b=(_a=_this27.getState())===null||_a===void 0?void 0:_a.session)!==null&&_b!==void 0?_b:null;};_this27.updateSession=function(resp,options){var session=resp.session,user=resp.user,session_jwt=resp.session_jwt,session_token=resp.session_token;if(session_token&&session_jwt){_this27.updateStateAndTokens({state:{session:session,user:user},session_jwt:session_jwt,session_token:session_token,intermediate_session_token:null},{fromCache:false,sessionDurationMinutes:options===null||options===void 0?void 0:options.sessionDurationMinutes});}else{_this27.updateStateAndTokens({state:{session:session,user:user},session_token:true,session_jwt:true,intermediate_session_token:null},{fromCache:false,sessionDurationMinutes:options===null||options===void 0?void 0:options.sessionDurationMinutes});}};_this27.withUpdateSession=function(authenticate){return function(){for(var _len5=arguments.length,args=new Array(_len5),_key5=0;_key5<_len5;_key5++){args[_key5]=arguments[_key5];}return __awaiter(_this27,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee76(){var resp,options;return _regenerator2().w(function(_context76){while(1)switch(_context76.n){case 0:_context76.n=1;return authenticate.apply(void 0,args);case 1:resp=_context76.v;if(resp!=null){options=args.find(function(a){return a!=null&&!(typeof a==='string');});this.updateSession(resp,{sessionDurationMinutes:options===null||options===void 0?void 0:options.session_duration_minutes});}return _context76.a(2,resp);}},_callee76,this);}));};};return _this27;}_inherits2(ConsumerSubscriptionService,_BaseSubscriptionServ);return _createClass2(ConsumerSubscriptionService);}(BaseSubscriptionService);var internalSymB2C=Symbol["for"]('stytch__internal_b2c');var writeB2CInternals=function writeB2CInternals(obj,internals){Object.assign(obj,_defineProperty({},internalSymB2C,internals));};var readB2CInternals=function readB2CInternals(obj){var casted=obj;if(!casted[internalSymB2C]){throw Error('Internals not found!');}return casted[internalSymB2C];};var buildFinalConfig=function buildFinalConfig(clientName){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _a,_b;var cookieOptions=opts.cookieOptions,keepSessionAlive=opts.keepSessionAlive;var validator=validate(clientName);validator.isOptionalBoolean('keepSessionAlive',keepSessionAlive);if(cookieOptions){validator.isOptionalString('cookieOptions.opaqueTokenCookieName',cookieOptions.opaqueTokenCookieName).isOptionalString('cookieOptions.jwtCookieName',cookieOptions.jwtCookieName).isOptionalString('cookieOptions.istCookieName',cookieOptions.istCookieName).isOptionalString('cookieOptions.path',cookieOptions.path).isOptionalString('cookieOptions.domain',cookieOptions.domain);}return{cookieOptions:cookieOptions,keepSessionAlive:keepSessionAlive,endpoints:{testAPIURL:getTestApiURL(opts),liveAPIURL:getLiveApiURL(opts),dfpBackendURL:getDFPBackendURL(opts),dfpCdnURL:getDFPCdnURL(opts),clientsideServicesIframeURL:(_b=(_a=opts===null||opts===void 0?void 0:opts.endpoints)===null||_a===void 0?void 0:_a.clientsideServicesIframeURL)!==null&&_b!==void 0?_b:CLIENTSIDE_SERVICES_IFRAME_URL}};};function isHandledTokenType(handledTypes,tokenType){return handledTypes.includes(tokenType);}var clearStytchTokenParams=function clearStytchTokenParams(){var url=removeStytchTokenParams(window.location.toString());window.history.replaceState(null,document.title,url);};var createAuthUrlHandler=function createAuthUrlHandler(handlers){var handledTokenTypes=Object.keys(handlers);var parseAuthenticateUrl=function parseAuthenticateUrl(){var href=arguments.length>0&&arguments[0]!==undefined?arguments[0]:window.location.href;var url=new URL(href);var tokenType=url.searchParams.get('stytch_token_type');var token=url.searchParams.get('token');if(!token||!tokenType){return null;}if(isHandledTokenType(handledTokenTypes,tokenType)){return{handled:true,token:token,tokenType:tokenType};}return{handled:false,token:token,tokenType:tokenType};};var authenticateByUrl=function authenticateByUrl(_a,href){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee77(){var clearParams,options,shouldClearParams,parsed,token,tokenType,handler,data;return _regenerator2().w(function(_context77){while(1)switch(_context77.p=_context77.n){case 0:clearParams=_a.clearParams,options=__rest(_a,["clearParams"]);if(href===void 0){href=window.location.href;}shouldClearParams=clearParams!==null&&clearParams!==void 0?clearParams:href===window.location.href;parsed=parseAuthenticateUrl(href);if(!(parsed==null)){_context77.n=1;break;}return _context77.a(2,null);case 1:if(parsed.handled){_context77.n=2;break;}return _context77.a(2,parsed);case 2:token=parsed.token,tokenType=parsed.tokenType;handler=handlers[tokenType];_context77.p=3;_context77.n=4;return handler(token,options);case 4:data=_context77.v;return _context77.a(2,{handled:true,tokenType:tokenType,data:data});case 5:_context77.p=5;if(shouldClearParams){clearStytchTokenParams();}return _context77.f(5);case 6:return _context77.a(2);}},_callee77,null,[[3,,5,6]]);}));};return{authenticateByUrl:authenticateByUrl,parseAuthenticateUrl:parseAuthenticateUrl};};function removeStytchTokenParams(href){var url=new URL(href);var params=url.searchParams;params["delete"]('token');params["delete"]('stytch_token_type');return url;}var StytchHeadlessClient=/*#__PURE__*/_createClass2(function StytchHeadlessClient(publicTokenRaw,options){var _this28=this;_classCallCheck2(this,StytchHeadlessClient);checkNotSSR('StytchHeadlessClient');checkPublicToken(publicTokenRaw);var _PUBLIC_TOKEN=publicTokenRaw!==null&&publicTokenRaw!==void 0?publicTokenRaw:'';var config=buildFinalConfig(this.constructor.name,options);var usingCustomApiEndpoint=!!config.endpoints.liveAPIURL;this._dataLayer=getConsumerDataLayer(_PUBLIC_TOKEN,config);this._subscriptionService=new ConsumerSubscriptionService(_PUBLIC_TOKEN,this._dataLayer,{usingCustomApiEndpoint:usingCustomApiEndpoint});this._stateChangeClient=new StateChangeClient(this._subscriptionService,{});this.onStateChange=function(){var _this28$_stateChangeC;return(_this28$_stateChangeC=_this28._stateChangeClient).onStateChange.apply(_this28$_stateChangeC,arguments);};var additionalTelemetryDataFn=function additionalTelemetryDataFn(){var _a,_b,_c,_d;return{stytch_user_id:(_b=(_a=_this28._dataLayer.state)===null||_a===void 0?void 0:_a.user)===null||_b===void 0?void 0:_b.user_id,stytch_session_id:(_d=(_c=_this28._dataLayer.state)===null||_c===void 0?void 0:_c.session)===null||_d===void 0?void 0:_d.session_id};};var passwordsPKCEManager=new PKCEManager(this._dataLayer,'passwords');var networkClient=new NetworkClient(_PUBLIC_TOKEN,this._dataLayer,config.endpoints.liveAPIURL,config.endpoints.testAPIURL,additionalTelemetryDataFn);this._networkClient=networkClient;var bootstrap=new BootstrapDataManager(_PUBLIC_TOKEN,this._networkClient,this._dataLayer);var captcha=new CaptchaProvider(bootstrap.getAsync());var dfpProtectedAuth=new DFPProtectedAuthProvider(_PUBLIC_TOKEN,config.endpoints.dfpBackendURL,config.endpoints.dfpCdnURL,bootstrap.getAsync(),captcha.executeRecaptcha);var clientsideServices=new ClientsideServicesProvider(config.endpoints.clientsideServicesIframeURL);var oneTap=new OneTapProvider(_PUBLIC_TOKEN,clientsideServices);var searchManager=new SearchDataManager(this._networkClient,dfpProtectedAuth);this.user=new HeadlessUserClient(this._networkClient,this._subscriptionService);this.session=new HeadlessSessionClient(this._networkClient,this._subscriptionService);this.magicLinks=new HeadlessMagicLinksClient(this._networkClient,this._subscriptionService,new PKCEManager(this._dataLayer,'magic_links'),passwordsPKCEManager,bootstrap.getAsync(),dfpProtectedAuth);this.otps=new HeadlessOTPClient(this._networkClient,this._subscriptionService,captcha.executeRecaptcha,dfpProtectedAuth);this.oauth=new HeadlessOAuthClient(this._networkClient,this._subscriptionService,new PKCEManager(this._dataLayer,'oauth'),bootstrap.getAsync(),{publicToken:_PUBLIC_TOKEN,testAPIURL:config.endpoints.testAPIURL,liveAPIURL:config.endpoints.liveAPIURL},oneTap);this.cryptoWallets=new HeadlessCryptoWalletClient(this._networkClient,this._networkClient,this._subscriptionService,captcha.executeRecaptcha,dfpProtectedAuth,bootstrap.getAsync());this.totps=new HeadlessTOTPClient(this._networkClient,this._subscriptionService,dfpProtectedAuth);this.webauthn=new HeadlessWebAuthnClient(this._networkClient,this._subscriptionService,dfpProtectedAuth);this.passwords=new HeadlessPasswordClient(this._networkClient,this._subscriptionService,passwordsPKCEManager,bootstrap.getAsync(),dfpProtectedAuth);this.impersonation=new HeadlessImpersonationClient(this._networkClient,this._subscriptionService,dfpProtectedAuth);this.rbac=new HeadlessRBACClient(bootstrap.getSync(),bootstrap.getAsync(),this._subscriptionService);this.idp=new HeadlessIDPClient(this._networkClient);this._sessionManager=new SessionManager(this._subscriptionService,this.session,_PUBLIC_TOKEN,{keepSessionAlive:config.keepSessionAlive});if(usingCustomApiEndpoint||this._dataLayer.readSessionCookie().session_token){this._sessionManager.performBackgroundRefresh();}this._networkClient.logEvent({name:'sdk_instance_instantiated',details:{event_callback_registered:false,error_callback_registered:false,success_callback_registered:false}});bootstrap.getAsync().then(function(bootstrapData){if(bootstrapData.vertical===VERTICAL_B2B){logger.error('This application is using a Stytch client for Consumer projects, but the public token is for a Stytch B2B project. Use a B2B Stytch client instead, or verify that the public token is correct.');}});var _createAuthUrlHandler=createAuthUrlHandler({magic_links:function magic_links(token,options){return _this28.magicLinks.authenticate(token,options);},oauth:function oauth(token,options){return _this28.oauth.authenticate(token,options);},impersonation:function impersonation(token){return _this28.impersonation.authenticate({impersonation_token:token});}}),authenticateByUrl=_createAuthUrlHandler.authenticateByUrl,parseAuthenticateUrl=_createAuthUrlHandler.parseAuthenticateUrl;this.authenticateByUrl=authenticateByUrl;this.parseAuthenticateUrl=parseAuthenticateUrl;writeB2CInternals(this,{bootstrap:bootstrap,clientsideServices:clientsideServices,captcha:captcha,oneTap:oneTap,searchManager:searchManager,publicToken:_PUBLIC_TOKEN,dataLayer:this._dataLayer,networkClient:this._networkClient});});var n$6,l$7,u$5,i$2,o$3,r$3,f$6,e$4,c$4={},s$2=[],a$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h$6=Array.isArray;function v$6(n,l){for(var u in l)n[u]=l[u];return n;}function p$6(n){var l=n.parentNode;l&&l.removeChild(n);}function y$3(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n$6.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d$6(l,f,i,o,null);}function d$6(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u$5:r,__i:-1,__u:0};return null==r&&null!=l$7.vnode&&l$7.vnode(f),f;}function _$3(){return{current:null};}function g$7(n){return n.children;}function b$7(n,l){this.props=n,this.context=l;}function m$6(n,l){if(null==l)return n.__?m$6(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?m$6(n):null;}function k$5(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break;}return k$5(n);}}function w$7(n){(!n.__d&&(n.__d=!0)&&i$2.push(n)&&!x$4.__r++||o$3!==l$7.debounceRendering)&&((o$3=l$7.debounceRendering)||r$3)(x$4);}function x$4(){var n,u,t,o,r,e,c,s,a;for(i$2.sort(f$6);n=i$2.shift();)n.__d&&(u=i$2.length,o=void 0,e=(r=(t=n).__v).__e,s=[],a=[],(c=t.__P)&&((o=v$6({},r)).__v=r.__v+1,l$7.vnode&&l$7.vnode(o),L$2(c,o,r,t.__n,void 0!==c.ownerSVGElement,32&r.__u?[e]:null,s,null==e?m$6(r):e,!!(32&r.__u),a),o.__.__k[o.__i]=o,M$3(s,o,a),o.__e!=e&&k$5(o)),i$2.length>u&&i$2.sort(f$6));x$4.__r=0;}function C$1(n,l,u,t,i,o,r,f,e,a,h){var v,p,y,d,_,g=t&&t.__k||s$2,b=l.length;for(u.__d=e,P$4(u,l,g),e=u.__d,v=0;v<b;v++)null!=(y=u.__k[v])&&"boolean"!=typeof y&&"function"!=typeof y&&(p=-1===y.__i?c$4:g[y.__i]||c$4,y.__i=v,L$2(n,y,p,i,o,r,f,e,a,h),d=y.__e,y.ref&&p.ref!=y.ref&&(p.ref&&z$4(p.ref,null,y),h.push(y.ref,y.__c||d,y)),null==_&&null!=d&&(_=d),65536&y.__u||p.__k===y.__k?e=S$2(y,e,n):"function"==typeof y.type&&void 0!==y.__d?e=y.__d:d&&(e=d.nextSibling),y.__d=void 0,y.__u&=-196609);u.__d=e,u.__e=_;}function P$4(n,l,u){var t,i,o,r,f,e=l.length,c=u.length,s=c,a=0;for(n.__k=[],t=0;t<e;t++)null!=(i=n.__k[t]=null==(i=l[t])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?d$6(null,i,null,null,i):h$6(i)?d$6(g$7,{children:i},null,null,null):i.__b>0?d$6(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,f=H$2(i,u,r=t+a,s),i.__i=f,o=null,-1!==f&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f===r+1?a++:f>r?s>e-r?a+=f-r:a--:a=f<r&&f==r-1?f-r:0,f!==t+a&&(i.__u|=65536))):(o=u[t])&&null==o.key&&o.__e&&(o.__e==n.__d&&(n.__d=m$6(o)),N$2(o,o,!1),u[t]=null,s--);if(s)for(t=0;t<c;t++)null!=(o=u[t])&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=m$6(o)),N$2(o,o));}function S$2(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=S$2(t[i],l,u));return l;}return n.__e!=l&&(u.insertBefore(n.__e,l||null),l=n.__e),l&&l.nextSibling;}function $$3(n,l){return l=l||[],null==n||"boolean"==typeof n||(h$6(n)?n.some(function(n){$$3(n,l);}):l.push(n)),l;}function H$2(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--;}if(f<l.length){if((e=l[f])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return f;f++;}}return-1;}function I$3(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$2.test(l)?u:u+"px";}function T$4(n,l,u,t,i){var o;n:if("style"===l){if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||I$3(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||I$3(n.style,l,u[l]);}}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?D$2:A$5,o)):n.removeEventListener(l,o?D$2:A$5,o);else{if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n;}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function A$5(n){var u=this.l[n.type+!1];if(n.t){if(n.t<=u.u)return;}else n.t=Date.now();return u(l$7.event?l$7.event(n):n);}function D$2(n){return this.l[n.type+!0](l$7.event?l$7.event(n):n);}function L$2(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,m,k,w,x,P,S,$,H,I,T,A=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[e=u.__e=t.__e]),(a=l$7.__b)&&a(u);n:if("function"==typeof A)try{if(w=u.props,x=(a=A.contextType)&&i[a.__c],P=a?x?x.props.value:a.__:i,t.__c?k=(p=u.__c=t.__c).__=p.__E:("prototype"in A&&A.prototype.render?u.__c=p=new A(w,P):(u.__c=p=new b$7(w,P),p.constructor=A,p.render=O$2),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=P,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=A.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v$6({},p.__s)),v$6(p.__s,A.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==A.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==A.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,P),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,P)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u);}),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&f.push(p);break n;}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,P),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,m);});}if(p.context=P,p.props=w,p.__P=n,p.__e=!1,$=l$7.__r,H=0,"prototype"in A&&A.prototype.render){for(p.state=p.__s,p.__d=!1,$&&$(u),a=p.render(p.props,p.state,p.context),I=0;I<p._sb.length;I++)p.__h.push(p._sb[I]);p._sb=[];}else do{p.__d=!1,$&&$(u),a=p.render(p.props,p.state,p.context),p.state=p.__s;}while(p.__d&&++H<25);p.state=p.__s,null!=p.getChildContext&&(i=v$6(v$6({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(d,_)),C$1(n,h$6(T=null!=a&&a.type===g$7&&null==a.key?a.props.children:a)?T:[T],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__u&=-161,p.__h.length&&f.push(p),k&&(p.__E=p.__=null);}catch(n){u.__v=null,c||null!=r?(u.__e=e,u.__u|=c?160:32,r[r.indexOf(e)]=null):(u.__e=t.__e,u.__k=t.__k),l$7.__e(n,u,t);}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=j$3(t.__e,u,t,i,o,r,f,c,s);(a=l$7.diffed)&&a(u);}function M$3(n,u,t){u.__d=void 0;for(var i=0;i<t.length;i++)z$4(t[i],t[++i],t[++i]);l$7.__c&&l$7.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$7.__e(n,u.__v);}});}function j$3(l,u,t,i,o,r,f,e,s){var a,v,y,d,_,g,b,k=t.props,w=u.props,x=u.type;if("svg"===x&&(o=!0),null!=r)for(a=0;a<r.length;a++)if((_=r[a])&&"setAttribute"in _==!!x&&(x?_.localName===x:3===_.nodeType)){l=_,r[a]=null;break;}if(null==l){if(null===x)return document.createTextNode(w);l=o?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,w.is&&w),r=null,e=!1;}if(null===x)k===w||e&&l.data===w||(l.data=w);else{if(r=r&&n$6.call(l.childNodes),k=t.props||c$4,!e&&null!=r)for(k={},a=0;a<l.attributes.length;a++)k[(_=l.attributes[a]).name]=_.value;for(a in k)_=k[a],"children"==a||("dangerouslySetInnerHTML"==a?y=_:"key"===a||a in w||T$4(l,a,null,_,o));for(a in w)_=w[a],"children"==a?d=_:"dangerouslySetInnerHTML"==a?v=_:"value"==a?g=_:"checked"==a?b=_:"key"===a||e&&"function"!=typeof _||k[a]===_||T$4(l,a,_,k[a],o);if(v)e||y&&(v.__html===y.__html||v.__html===l.innerHTML)||(l.innerHTML=v.__html),u.__k=[];else if(y&&(l.innerHTML=""),C$1(l,h$6(d)?d:[d],u,t,i,o&&"foreignObject"!==x,r,f,r?r[0]:t.__k&&m$6(t,0),e,s),null!=r)for(a=r.length;a--;)null!=r[a]&&p$6(r[a]);e||(a="value",void 0!==g&&(g!==l[a]||"progress"===x&&!g||"option"===x&&g!==k[a])&&T$4(l,a,g,k[a],!1),a="checked",void 0!==b&&b!==l[a]&&T$4(l,a,b,k[a],!1));}return l;}function z$4(n,u,t){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$7.__e(n,t);}}function N$2(n,u,t){var i,o;if(l$7.unmount&&l$7.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||z$4(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$7.__e(n,u);}i.base=i.__P=null,n.__c=void 0;}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&N$2(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p$6(n.__e),n.__=n.__e=n.__d=void 0;}function O$2(n,l,u){return this.constructor(n,u);}function q$5(u,t,i){var o,r,f,e;l$7.__&&l$7.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],L$2(t,u=(!o&&i||t).__k=y$3(g$7,null,[u]),r||c$4,c$4,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n$6.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),M$3(f,u,e);}function B$3(n,l){q$5(n,l,B$3);}function E$2(l,u,t){var i,o,r,f,e=v$6({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n$6.call(arguments,2):t),d$6(l.type,e,i||l.key,o||l.ref,null);}function F$5(n,l){var u={__c:l="__cC"+e$4++,__:n,Consumer:function Consumer(n,l){return n.children(l);},Provider:function Provider(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t;},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,w$7(n);});},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children;}};return u.Provider.__=u.Consumer.contextType=u;}n$6=s$2.slice,l$7={__e:function __e(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i;}catch(l){n=l;}throw n;}},u$5=0,b$7.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v$6({},this.state),"function"==typeof n&&(n=n(v$6({},u),this.props)),n&&v$6(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$7(this));},b$7.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$7(this));},b$7.prototype.render=g$7,i$2=[],r$3="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$6=function f$6(n,l){return n.__v.__b-l.__v.__b;},x$4.__r=0,e$4=0;var t$4,r$2,u$4,i$1,o$2=0,f$5=[],c$3=[],e$3=l$7.__b,a$1=l$7.__r,v$5=l$7.diffed,l$6=l$7.__c,m$5=l$7.unmount;function d$5(t,u){l$7.__h&&l$7.__h(r$2,t,o$2||u),o$2=0;var i=r$2.__H||(r$2.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c$3}),i.__[t];}function h$5(n){return o$2=1,s$1(B$2,n);}function s$1(n,u,i){var o=d$5(t$4++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$2(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$2,!r$2.u)){var f=function f(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return n.__c;});if(u.every(function(n){return!n.__N;}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r));};r$2.u=!0;var c=r$2.shouldComponentUpdate,e=r$2.componentWillUpdate;r$2.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r$2.shouldComponentUpdate=f;}return o.__N||o.__;}function p$5(u,i){var o=d$5(t$4++,3);!l$7.__s&&z$3(o.__H,i)&&(o.__=u,o.i=i,r$2.__H.__h.push(o));}function y$2(u,i){var o=d$5(t$4++,4);!l$7.__s&&z$3(o.__H,i)&&(o.__=u,o.i=i,r$2.__h.push(o));}function _$2(n){return o$2=5,F$4(function(){return{current:n};},[]);}function A$4(n,t,r){o$2=6,y$2(function(){return"function"==typeof n?(n(t()),function(){return n(null);}):n?(n.current=t(),function(){return n.current=null;}):void 0;},null==r?r:r.concat(n));}function F$4(n,r){var u=d$5(t$4++,7);return z$3(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__;}function T$3(n,t){return o$2=8,F$4(function(){return n;},t);}function q$4(n){var u=r$2.context[n.__c],i=d$5(t$4++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r$2)),u.props.value):n.__;}function x$3(t,r){l$7.useDebugValue&&l$7.useDebugValue(r?r(t):t);}function P$3(n){var u=d$5(t$4++,10),i=h$5();return u.__=n,r$2.componentDidCatch||(r$2.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n);}),[i[0],function(){i[1](void 0);}];}function V$3(){var n=d$5(t$4++,11);if(!n.__){for(var u=r$2.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++;}return n.__;}function b$6(){for(var t;t=f$5.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k$4),t.__H.__h.forEach(w$6),t.__H.__h=[];}catch(r){t.__H.__h=[],l$7.__e(r,t.__v);}}l$7.__b=function(n){r$2=null,e$3&&e$3(n);},l$7.__r=function(n){a$1&&a$1(n),t$4=0;var i=(r$2=n.__c).__H;i&&(u$4===r$2?(i.__h=[],r$2.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c$3,n.__N=n.i=void 0;})):(i.__h.forEach(k$4),i.__h.forEach(w$6),i.__h=[],t$4=0)),u$4=r$2;},l$7.diffed=function(t){v$5&&v$5(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f$5.push(o)&&i$1===l$7.requestAnimationFrame||((i$1=l$7.requestAnimationFrame)||j$2)(b$6)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c$3&&(n.__=n.__V),n.i=void 0,n.__V=c$3;})),u$4=r$2=null;},l$7.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k$4),t.__h=t.__h.filter(function(n){return!n.__||w$6(n);});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$7.__e(u,t.__v);}}),l$6&&l$6(t,r);},l$7.unmount=function(t){m$5&&m$5(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k$4(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$7.__e(r,u.__v));};var g$6="function"==typeof requestAnimationFrame;function j$2(n){var t,r=function r(){clearTimeout(u),g$6&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$6&&(t=requestAnimationFrame(r));}function k$4(n){var t=r$2,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$2=t;}function w$6(n){var t=r$2;n.__c=n.__(),r$2=t;}function z$3(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r];});}function B$2(n,t){return"function"==typeof t?t(n):t;}function g$5(n,t){for(var e in t)n[e]=t[e];return n;}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return!0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return!0;return!1;}function E$1(n){this.props=n;}function w$5(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return!r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:C(this.props,n);}function u(e){return this.shouldComponentUpdate=r,y$3(n,e);}return u.displayName="Memo("+(n.displayName||n.name)+")",u.prototype.isReactComponent=!0,u.__f=!0,u;}(E$1.prototype=new b$7()).isPureReactComponent=!0,E$1.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t);};var x$2=l$7.__b;l$7.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),x$2&&x$2(n);};var R$1="undefined"!=typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.forward_ref")||3911;function N$1(n){function t(t){var e=g$5({},t);return delete e.ref,n(e,t.ref||null);}return t.$$typeof=R$1,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t;}var k$3=function k$3(n,t){return null==n?null:$$3($$3(n).map(t));},A$3={map:k$3,forEach:k$3,count:function count(n){return n?$$3(n).length:0;},only:function only(n){var t=$$3(n);if(1!==t.length)throw"Children.only";return t[0];},toArray:$$3},O$1=l$7.__e;l$7.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);O$1(n,t,e,r);};var T$2=l$7.unmount;function F$3(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g$5({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return F$3(n,t,e);})),n;}function I$2(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return I$2(n,t,e);}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n;}function L$1(){this.__u=0,this.t=null,this.__b=null;}function U$2(n){var t=n.__.__c;return t&&t.__a&&t.__a(n);}function D$1(n){var e,r,u;function o(o){if(e||(e=n()).then(function(n){r=n["default"]||n;},function(n){u=n;}),u)throw u;if(!r)throw e;return y$3(r,o);}return o.displayName="Lazy",o.__f=!0,o;}function M$2(){this.u=null,this.o=null;}l$7.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),T$2&&T$2(n);},(L$1.prototype=new b$7()).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U$2(r.__v),o=!1,i=function i(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function l(){if(! --r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=I$2(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},L$1.prototype.componentWillUnmount=function(){this.t=[];},L$1.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=F$3(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&y$3(g$7,null,n.fallback);return i&&(i.__u&=-33),[y$3(g$7,null,e.__a?null:n.children),i];};var V$2=function V$2(n,t,e){if(++e[1]===e[0]&&n.o["delete"](t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function W$2(n){return this.getChildContext=function(){return n.context;},n.children;}function P$2(n){var e=this,r=n.i;e.componentWillUnmount=function(){q$5(null,e.l),e.l=null,e.i=null;},e.i&&e.i!==r&&e.componentWillUnmount(),e.l||(e.i=r,e.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function appendChild(n){this.childNodes.push(n),e.i.appendChild(n);},insertBefore:function insertBefore(n,t){this.childNodes.push(n),e.i.appendChild(n);},removeChild:function removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.i.removeChild(n);}}),q$5(y$3(W$2,{context:e.context},n.__v),e.l);}function j$1(n,e){var r=y$3(P$2,{__v:n,i:e});return r.containerInfo=e,r;}(M$2.prototype=new b$7()).__a=function(n){var t=this,e=U$2(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function o(){t.props.revealOrder?(r.push(u),V$2(t,n,r)):u();};e?e(o):o();};},M$2.prototype.render=function(n){this.u=null,this.o=new Map();var t=$$3(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children;},M$2.prototype.componentDidUpdate=M$2.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){V$2(n,e,t);});};var z$2="undefined"!=typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,B$1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,H$1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Z$2=/[A-Z0-9]/g,Y$2="undefined"!=typeof document,$$2=function $$2(n){return("undefined"!=typeof Symbol&&"symbol"==_typeof2(Symbol())?/fil|che|rad/:/fil|che|ra/).test(n);};function q$3(n,t,e){return null==t.__k&&(t.textContent=""),q$5(n,t),"function"==typeof e&&e(),n?n.__c:null;}function G$2(n,t,e){return B$3(n,t),"function"==typeof e&&e(),n?n.__c:null;}b$7.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(b$7.prototype,t,{configurable:!0,get:function get(){return this["UNSAFE_"+t];},set:function set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var J$2=l$7.event;function K$1(){}function Q$2(){return this.cancelBubble;}function X$2(){return this.defaultPrevented;}l$7.event=function(n){return J$2&&(n=J$2(n)),n.persist=K$1,n.isPropagationStopped=Q$2,n.isDefaultPrevented=X$2,n.nativeEvent=n;};var nn,tn={enumerable:!1,configurable:!0,get:function get(){return this["class"];}},en=l$7.vnode;l$7.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||Y$2&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||$$2(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":H$1.test(o)?o=l:-1===e.indexOf("-")&&B$1.test(o)?o=o.replace(Z$2,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=$$3(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=$$3(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t["class"]&&!t.className?(u["class"]=t["class"],Object.defineProperty(u,"className",tn)):(t.className&&!t["class"]||t["class"]&&t.className)&&(u["class"]=u.className=t.className),n.props=u;}(n),n.$$typeof=z$2,en&&en(n);};var rn=l$7.__r;l$7.__r=function(n){rn&&rn(n),nn=n.__c;};var un=l$7.diffed;l$7.diffed=function(n){un&&un(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value),nn=null;};var on={ReactCurrentDispatcher:{current:{readContext:function readContext(n){return nn.__n[n.__c].props.value;}}}},ln="17.0.2";function cn(n){return y$3.bind(null,n);}function fn(n){return!!n&&n.$$typeof===z$2;}function an(n){return fn(n)&&n.type===g$7;}function sn(n){return fn(n)?E$2.apply(null,arguments):n;}function hn(n){return!!n.__k&&(q$5(null,n),!0);}function vn(n){return n&&(n.base||1===n.nodeType&&n)||null;}var dn=function dn(n,t){return n(t);},pn=function pn(n,t){return n(t);},mn=g$7;function yn(n){n();}function _n(n){return n;}function bn(){return[!1,yn];}var Sn=y$2,gn=fn;function Cn(n,t){var e=t(),r=h$5({h:{__:e,v:t}}),u=r[0].h,o=r[1];return y$2(function(){u.__=e,u.v=t,En(u)&&o({h:u});},[n,e,t]),p$5(function(){return En(u)&&o({h:u}),n(function(){En(u)&&o({h:u});});},[n]),e;}function En(n){var t,e,r=n.v,u=n.__;try{var o=r();return!((t=u)===(e=o)&&(0!==t||1/t==1/e)||t!=t&&e!=e);}catch(n){return!0;}}var wn={useState:h$5,useId:V$3,useReducer:s$1,useEffect:p$5,useLayoutEffect:y$2,useInsertionEffect:Sn,useTransition:bn,useDeferredValue:_n,useSyncExternalStore:Cn,startTransition:yn,useRef:_$2,useImperativeHandle:A$4,useMemo:F$4,useCallback:T$3,useContext:q$4,useDebugValue:x$3,version:"17.0.2",Children:A$3,render:q$3,hydrate:G$2,unmountComponentAtNode:hn,createPortal:j$1,createElement:y$3,createContext:F$5,createFactory:cn,cloneElement:sn,createRef:_$3,Fragment:g$7,isValidElement:fn,isElement:gn,isFragment:an,findDOMNode:vn,Component:b$7,PureComponent:E$1,memo:w$5,forwardRef:N$1,flushSync:pn,unstable_batchedUpdates:dn,StrictMode:mn,Suspense:L$1,SuspenseList:M$2,lazy:D$1,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:on};var compat_module=/*#__PURE__*/Object.freeze({__proto__:null,Children:A$3,Component:b$7,Fragment:g$7,PureComponent:E$1,StrictMode:mn,Suspense:L$1,SuspenseList:M$2,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:on,cloneElement:sn,createContext:F$5,createElement:y$3,createFactory:cn,createPortal:j$1,createRef:_$3,"default":wn,findDOMNode:vn,flushSync:pn,forwardRef:N$1,hydrate:G$2,isElement:gn,isFragment:an,isValidElement:fn,lazy:D$1,memo:w$5,render:q$3,startTransition:yn,unmountComponentAtNode:hn,unstable_batchedUpdates:dn,useCallback:T$3,useContext:q$4,useDebugValue:x$3,useDeferredValue:_n,useEffect:p$5,useErrorBoundary:P$3,useId:V$3,useImperativeHandle:A$4,useInsertionEffect:Sn,useLayoutEffect:y$2,useMemo:F$4,useReducer:s$1,useRef:_$2,useState:h$5,useSyncExternalStore:Cn,useTransition:bn,version:ln});var commonjsGlobal=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var f=n["default"];if(typeof f=="function"){var a=function a(){if(this instanceof a){return Reflect.construct(f,arguments,this.constructor);}return f.apply(this,arguments);};a.prototype=f.prototype;}else a={};Object.defineProperty(a,'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function get(){return n[k];}});});return a;}var reactIs$2={exports:{}};var reactIs_production_min$1={};var b$5=Symbol["for"]("react.element"),c$2=Symbol["for"]("react.portal"),d$4=Symbol["for"]("react.fragment"),e$2=Symbol["for"]("react.strict_mode"),f$4=Symbol["for"]("react.profiler"),g$4=Symbol["for"]("react.provider"),h$4=Symbol["for"]("react.context"),k$2=Symbol["for"]("react.server_context"),l$5=Symbol["for"]("react.forward_ref"),m$4=Symbol["for"]("react.suspense"),n$5=Symbol["for"]("react.suspense_list"),p$4=Symbol["for"]("react.memo"),q$2=Symbol["for"]("react.lazy"),t$3=Symbol["for"]("react.offscreen"),u$3;u$3=Symbol["for"]("react.module.reference");function v$4(a){if("object"===_typeof2(a)&&null!==a){var r=a.$$typeof;switch(r){case b$5:switch(a=a.type,a){case d$4:case f$4:case e$2:case m$4:case n$5:return a;default:switch(a=a&&a.$$typeof,a){case k$2:case h$4:case l$5:case q$2:case p$4:case g$4:return a;default:return r;}}case c$2:return r;}}}reactIs_production_min$1.ContextConsumer=h$4;reactIs_production_min$1.ContextProvider=g$4;reactIs_production_min$1.Element=b$5;reactIs_production_min$1.ForwardRef=l$5;reactIs_production_min$1.Fragment=d$4;reactIs_production_min$1.Lazy=q$2;reactIs_production_min$1.Memo=p$4;reactIs_production_min$1.Portal=c$2;reactIs_production_min$1.Profiler=f$4;reactIs_production_min$1.StrictMode=e$2;reactIs_production_min$1.Suspense=m$4;reactIs_production_min$1.SuspenseList=n$5;reactIs_production_min$1.isAsyncMode=function(){return!1;};reactIs_production_min$1.isConcurrentMode=function(){return!1;};reactIs_production_min$1.isContextConsumer=function(a){return v$4(a)===h$4;};reactIs_production_min$1.isContextProvider=function(a){return v$4(a)===g$4;};reactIs_production_min$1.isElement=function(a){return"object"===_typeof2(a)&&null!==a&&a.$$typeof===b$5;};reactIs_production_min$1.isForwardRef=function(a){return v$4(a)===l$5;};reactIs_production_min$1.isFragment=function(a){return v$4(a)===d$4;};reactIs_production_min$1.isLazy=function(a){return v$4(a)===q$2;};reactIs_production_min$1.isMemo=function(a){return v$4(a)===p$4;};reactIs_production_min$1.isPortal=function(a){return v$4(a)===c$2;};reactIs_production_min$1.isProfiler=function(a){return v$4(a)===f$4;};reactIs_production_min$1.isStrictMode=function(a){return v$4(a)===e$2;};reactIs_production_min$1.isSuspense=function(a){return v$4(a)===m$4;};reactIs_production_min$1.isSuspenseList=function(a){return v$4(a)===n$5;};reactIs_production_min$1.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d$4||a===f$4||a===e$2||a===m$4||a===n$5||a===t$3||"object"===_typeof2(a)&&null!==a&&(a.$$typeof===q$2||a.$$typeof===p$4||a.$$typeof===g$4||a.$$typeof===h$4||a.$$typeof===l$5||a.$$typeof===u$3||void 0!==a.getModuleId)?!0:!1;};reactIs_production_min$1.typeOf=v$4;{reactIs$2.exports=reactIs_production_min$1;}var reactIsExports$1=reactIs$2.exports;var shallowequal=function shallowEqual(objA,objB,compare,compareContext){var ret=compare?compare.call(compareContext,objA,objB):void 0;if(ret!==void 0){return!!ret;}if(objA===objB){return true;}if(_typeof2(objA)!=="object"||!objA||_typeof2(objB)!=="object"||!objB){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}var bHasOwnProperty=Object.prototype.hasOwnProperty.bind(objB);for(var idx=0;idx<keysA.length;idx++){var key=keysA[idx];if(!bHasOwnProperty(key)){return false;}var valueA=objA[key];var valueB=objB[key];ret=compare?compare.call(compareContext,valueA,valueB,key):void 0;if(ret===false||ret===void 0&&valueA!==valueB){return false;}}return true;};var h$3=/*@__PURE__*/getDefaultExportFromCjs(shallowequal);function stylis_min(W){function M(d,c,e,h,a){for(var m=0,b=0,v=0,n=0,q,g,x=0,K=0,k,u=k=q=0,l=0,r=0,I=0,t=0,B=e.length,J=B-1,y,f='',p='',F='',G='',C;l<B;){g=e.charCodeAt(l);l===J&&0!==b+n+v+m&&(0!==b&&(g=47===b?10:47),n=v=m=0,B++,J++);if(0===b+n+v+m){if(l===J&&(0<r&&(f=f.replace(N,'')),0<f.trim().length)){switch(g){case 32:case 9:case 59:case 13:case 10:break;default:f+=e.charAt(l);}g=59;}switch(g){case 123:f=f.trim();q=f.charCodeAt(0);k=1;for(t=++l;l<B;){switch(g=e.charCodeAt(l)){case 123:k++;break;case 125:k--;break;case 47:switch(g=e.charCodeAt(l+1)){case 42:case 47:a:{for(u=l+1;u<J;++u){switch(e.charCodeAt(u)){case 47:if(42===g&&42===e.charCodeAt(u-1)&&l+2!==u){l=u+1;break a;}break;case 10:if(47===g){l=u+1;break a;}}}l=u;}}break;case 91:g++;case 40:g++;case 34:case 39:for(;l++<J&&e.charCodeAt(l)!==g;){}}if(0===k)break;l++;}k=e.substring(t,l);0===q&&(q=(f=f.replace(ca,'').trim()).charCodeAt(0));switch(q){case 64:0<r&&(f=f.replace(N,''));g=f.charCodeAt(1);switch(g){case 100:case 109:case 115:case 45:r=c;break;default:r=O;}k=M(c,r,k,g,a+1);t=k.length;0<A&&(r=X(O,f,I),C=H(3,k,r,c,D,z,t,g,a,h),f=r.join(''),void 0!==C&&0===(t=(k=C.trim()).length)&&(g=0,k=''));if(0<t)switch(g){case 115:f=f.replace(da,ea);case 100:case 109:case 45:k=f+'{'+k+'}';break;case 107:f=f.replace(fa,'$1 $2');k=f+'{'+k+'}';k=1===w||2===w&&L('@'+k,3)?'@-webkit-'+k+'@'+k:'@'+k;break;default:k=f+k,112===h&&(k=(p+=k,''));}else k='';break;default:k=M(c,X(c,f,I),k,h,a+1);}F+=k;k=I=r=u=q=0;f='';g=e.charCodeAt(++l);break;case 125:case 59:f=(0<r?f.replace(N,''):f).trim();if(1<(t=f.length))switch(0===u&&(q=f.charCodeAt(0),45===q||96<q&&123>q)&&(t=(f=f.replace(' ',':')).length),0<A&&void 0!==(C=H(1,f,c,d,D,z,p.length,h,a,h))&&0===(t=(f=C.trim()).length)&&(f='\x00\x00'),q=f.charCodeAt(0),g=f.charCodeAt(1),q){case 0:break;case 64:if(105===g||99===g){G+=f+e.charAt(l);break;}default:58!==f.charCodeAt(t-1)&&(p+=P(f,q,g,f.charCodeAt(2)));}I=r=u=q=0;f='';g=e.charCodeAt(++l);}}switch(g){case 13:case 10:47===b?b=0:0===1+q&&107!==h&&0<f.length&&(r=1,f+='\x00');0<A*Y&&H(0,f,c,d,D,z,p.length,h,a,h);z=1;D++;break;case 59:case 125:if(0===b+n+v+m){z++;break;}default:z++;y=e.charAt(l);switch(g){case 9:case 32:if(0===n+m+b)switch(x){case 44:case 58:case 9:case 32:y='';break;default:32!==g&&(y=' ');}break;case 0:y='\\0';break;case 12:y='\\f';break;case 11:y='\\v';break;case 38:0===n+b+m&&(r=I=1,y='\f'+y);break;case 108:if(0===n+b+m+E&&0<u)switch(l-u){case 2:112===x&&58===e.charCodeAt(l-3)&&(E=x);case 8:111===K&&(E=K);}break;case 58:0===n+b+m&&(u=l);break;case 44:0===b+v+n+m&&(r=1,y+='\r');break;case 34:case 39:0===b&&(n=n===g?0:0===n?g:n);break;case 91:0===n+b+v&&m++;break;case 93:0===n+b+v&&m--;break;case 41:0===n+b+m&&v--;break;case 40:if(0===n+b+m){if(0===q)switch(2*x+3*K){case 533:break;default:q=1;}v++;}break;case 64:0===b+v+n+m+u+k&&(k=1);break;case 42:case 47:if(!(0<n+m+v))switch(b){case 0:switch(2*g+3*e.charCodeAt(l+1)){case 235:b=47;break;case 220:t=l,b=42;}break;case 42:47===g&&42===x&&t+2!==l&&(33===e.charCodeAt(t+2)&&(p+=e.substring(t,l+1)),y='',b=0);}}0===b&&(f+=y);}K=x;x=g;l++;}t=p.length;if(0<t){r=c;if(0<A&&(C=H(2,p,r,d,D,z,t,h,a,h),void 0!==C&&0===(p=C).length))return G+p+F;p=r.join(',')+'{'+p+'}';if(0!==w*E){2!==w||L(p,2)||(E=0);switch(E){case 111:p=p.replace(ha,':-moz-$1')+p;break;case 112:p=p.replace(Q,'::-webkit-input-$1')+p.replace(Q,'::-moz-$1')+p.replace(Q,':-ms-input-$1')+p;}E=0;}}return G+p+F;}function X(d,c,e){var h=c.trim().split(ia);c=h;var a=h.length,m=d.length;switch(m){case 0:case 1:var b=0;for(d=0===m?'':d[0]+' ';b<a;++b){c[b]=Z(d,c[b],e).trim();}break;default:var v=b=0;for(c=[];b<a;++b){for(var n=0;n<m;++n){c[v++]=Z(d[n]+' ',h[b],e).trim();}}}return c;}function Z(d,c,e){var h=c.charCodeAt(0);33>h&&(h=(c=c.trim()).charCodeAt(0));switch(h){case 38:return c.replace(F,'$1'+d.trim());case 58:return d.trim()+c.replace(F,'$1'+d.trim());default:if(0<1*e&&0<c.indexOf('\f'))return c.replace(F,(58===d.charCodeAt(0)?'':'$1')+d.trim());}return d+c;}function P(d,c,e,h){var a=d+';',m=2*c+3*e+4*h;if(944===m){d=a.indexOf(':',9)+1;var b=a.substring(d,a.length-1).trim();b=a.substring(0,d).trim()+b+';';return 1===w||2===w&&L(b,1)?'-webkit-'+b+b:b;}if(0===w||2===w&&!L(a,1))return a;switch(m){case 1015:return 97===a.charCodeAt(10)?'-webkit-'+a+a:a;case 951:return 116===a.charCodeAt(3)?'-webkit-'+a+a:a;case 963:return 110===a.charCodeAt(5)?'-webkit-'+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return'-webkit-'+a+a;case 978:return'-webkit-'+a+'-moz-'+a+a;case 1019:case 983:return'-webkit-'+a+'-moz-'+a+'-ms-'+a+a;case 883:if(45===a.charCodeAt(8))return'-webkit-'+a+a;if(0<a.indexOf('image-set(',11))return a.replace(ja,'$1-webkit-$2')+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return'-webkit-box-'+a.replace('-grow','')+'-webkit-'+a+'-ms-'+a.replace('grow','positive')+a;case 115:return'-webkit-'+a+'-ms-'+a.replace('shrink','negative')+a;case 98:return'-webkit-'+a+'-ms-'+a.replace('basis','preferred-size')+a;}return'-webkit-'+a+'-ms-'+a+a;case 964:return'-webkit-'+a+'-ms-flex-'+a+a;case 1023:if(99!==a.charCodeAt(8))break;b=a.substring(a.indexOf(':',15)).replace('flex-','').replace('space-between','justify');return'-webkit-box-pack'+b+'-webkit-'+a+'-ms-flex-pack'+b+a;case 1005:return ka.test(a)?a.replace(aa,':-webkit-')+a.replace(aa,':-moz-')+a:a;case 1e3:b=a.substring(13).trim();c=b.indexOf('-')+1;switch(b.charCodeAt(0)+b.charCodeAt(c)){case 226:b=a.replace(G,'tb');break;case 232:b=a.replace(G,'tb-rl');break;case 220:b=a.replace(G,'lr');break;default:return a;}return'-webkit-'+a+'-ms-'+b+a;case 1017:if(-1===a.indexOf('sticky',9))break;case 975:c=(a=d).length-10;b=(33===a.charCodeAt(c)?a.substring(0,c):a).substring(d.indexOf(':',7)+1).trim();switch(m=b.charCodeAt(0)+(b.charCodeAt(7)|0)){case 203:if(111>b.charCodeAt(8))break;case 115:a=a.replace(b,'-webkit-'+b)+';'+a;break;case 207:case 102:a=a.replace(b,'-webkit-'+(102<m?'inline-':'')+'box')+';'+a.replace(b,'-webkit-'+b)+';'+a.replace(b,'-ms-'+b+'box')+';'+a;}return a+';';case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return b=a.replace('-items',''),'-webkit-'+a+'-webkit-box-'+b+'-ms-flex-'+b+a;case 115:return'-webkit-'+a+'-ms-flex-item-'+a.replace(ba,'')+a;default:return'-webkit-'+a+'-ms-flex-line-pack'+a.replace('align-content','').replace(ba,'')+a;}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===la.test(d))return 115===(b=d.substring(d.indexOf(':')+1)).charCodeAt(0)?P(d.replace('stretch','fill-available'),c,e,h).replace(':fill-available',':stretch'):a.replace(b,'-webkit-'+b)+a.replace(b,'-moz-'+b.replace('fill-',''))+a;break;case 962:if(a='-webkit-'+a+(102===a.charCodeAt(5)?'-ms-'+a:'')+a,211===e+h&&105===a.charCodeAt(13)&&0<a.indexOf('transform',10))return a.substring(0,a.indexOf(';',27)+1).replace(ma,'$1-webkit-$2')+a;}return a;}function L(d,c){var e=d.indexOf(1===c?':':'{'),h=d.substring(0,3!==c?e:10);e=d.substring(e+1,d.length-1);return R(2!==c?h:h.replace(na,'$1'),e,c);}function ea(d,c){var e=P(c,c.charCodeAt(0),c.charCodeAt(1),c.charCodeAt(2));return e!==c+';'?e.replace(oa,' or ($1)').substring(4):'('+c+')';}function H(d,c,e,h,a,m,b,v,n,q){for(var g=0,x=c,w;g<A;++g){switch(w=S[g].call(B,d,x,e,h,a,m,b,v,n,q)){case void 0:case!1:case!0:case null:break;default:x=w;}}if(x!==c)return x;}function T(d){switch(d){case void 0:case null:A=S.length=0;break;default:if('function'===typeof d)S[A++]=d;else if('object'===_typeof2(d))for(var c=0,e=d.length;c<e;++c){T(d[c]);}else Y=!!d|0;}return T;}function U(d){d=d.prefix;void 0!==d&&(R=null,d?'function'!==typeof d?w=1:(w=2,R=d):w=0);return U;}function B(d,c){var e=d;33>e.charCodeAt(0)&&(e=e.trim());V=e;e=[V];if(0<A){var h=H(-1,c,e,e,D,z,0,0,0,0);void 0!==h&&'string'===typeof h&&(c=h);}var a=M(O,e,c,0,0);0<A&&(h=H(-2,a,e,e,D,z,a.length,0,0,0),void 0!==h&&(a=h));V='';E=0;z=D=1;return a;}var ca=/^\0+/g,N=/[\0\r\f]/g,aa=/: */g,ka=/zoo|gra/,ma=/([,: ])(transform)/g,ia=/,\r+?/g,F=/([\t\r\n ])*\f?&/g,fa=/@(k\w+)\s*(\S*)\s*/,Q=/::(place)/g,ha=/:(read-only)/g,G=/[svh]\w+-[tblr]{2}/,da=/\(\s*(.*)\s*\)/g,oa=/([\s\S]*?);/g,ba=/-self|flex-/g,na=/[^]*?(:[rp][el]a[\w-]+)[^]*/,la=/stretch|:\s*\w+\-(?:conte|avail)/,ja=/([^-])(image-set\()/,z=1,D=1,E=0,w=1,O=[],S=[],A=0,R=null,Y=0,V='';B.use=T;B.set=U;void 0!==W&&U(W);return B;}var unitlessKeys={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function memoize(fn){var cache=Object.create(null);return function(arg){if(cache[arg]===undefined)cache[arg]=fn(arg);return cache[arg];};}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;var isPropValid=/* #__PURE__ */memoize(function(prop){return reactPropsRegex.test(prop)||prop.charCodeAt(0)===111&&prop.charCodeAt(1)===110&&prop.charCodeAt(2)<91;});var reactIs$1={exports:{}};var reactIs_production_min={};var b$4="function"===typeof Symbol&&Symbol["for"],c$1=b$4?Symbol["for"]("react.element"):60103,d$3=b$4?Symbol["for"]("react.portal"):60106,e$1=b$4?Symbol["for"]("react.fragment"):60107,f$3=b$4?Symbol["for"]("react.strict_mode"):60108,g$3=b$4?Symbol["for"]("react.profiler"):60114,h$2=b$4?Symbol["for"]("react.provider"):60109,k$1=b$4?Symbol["for"]("react.context"):60110,l$4=b$4?Symbol["for"]("react.async_mode"):60111,m$3=b$4?Symbol["for"]("react.concurrent_mode"):60111,n$4=b$4?Symbol["for"]("react.forward_ref"):60112,p$3=b$4?Symbol["for"]("react.suspense"):60113,q$1=b$4?Symbol["for"]("react.suspense_list"):60120,r$1=b$4?Symbol["for"]("react.memo"):60115,t$2=b$4?Symbol["for"]("react.lazy"):60116,v$3=b$4?Symbol["for"]("react.block"):60121,w$4=b$4?Symbol["for"]("react.fundamental"):60117,x$1=b$4?Symbol["for"]("react.responder"):60118,y$1=b$4?Symbol["for"]("react.scope"):60119;function z$1(a){if("object"===_typeof2(a)&&null!==a){var u=a.$$typeof;switch(u){case c$1:switch(a=a.type,a){case l$4:case m$3:case e$1:case g$3:case f$3:case p$3:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$4:case t$2:case r$1:case h$2:return a;default:return u;}}case d$3:return u;}}}function A$2(a){return z$1(a)===m$3;}reactIs_production_min.AsyncMode=l$4;reactIs_production_min.ConcurrentMode=m$3;reactIs_production_min.ContextConsumer=k$1;reactIs_production_min.ContextProvider=h$2;reactIs_production_min.Element=c$1;reactIs_production_min.ForwardRef=n$4;reactIs_production_min.Fragment=e$1;reactIs_production_min.Lazy=t$2;reactIs_production_min.Memo=r$1;reactIs_production_min.Portal=d$3;reactIs_production_min.Profiler=g$3;reactIs_production_min.StrictMode=f$3;reactIs_production_min.Suspense=p$3;reactIs_production_min.isAsyncMode=function(a){return A$2(a)||z$1(a)===l$4;};reactIs_production_min.isConcurrentMode=A$2;reactIs_production_min.isContextConsumer=function(a){return z$1(a)===k$1;};reactIs_production_min.isContextProvider=function(a){return z$1(a)===h$2;};reactIs_production_min.isElement=function(a){return"object"===_typeof2(a)&&null!==a&&a.$$typeof===c$1;};reactIs_production_min.isForwardRef=function(a){return z$1(a)===n$4;};reactIs_production_min.isFragment=function(a){return z$1(a)===e$1;};reactIs_production_min.isLazy=function(a){return z$1(a)===t$2;};reactIs_production_min.isMemo=function(a){return z$1(a)===r$1;};reactIs_production_min.isPortal=function(a){return z$1(a)===d$3;};reactIs_production_min.isProfiler=function(a){return z$1(a)===g$3;};reactIs_production_min.isStrictMode=function(a){return z$1(a)===f$3;};reactIs_production_min.isSuspense=function(a){return z$1(a)===p$3;};reactIs_production_min.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e$1||a===m$3||a===g$3||a===f$3||a===p$3||a===q$1||"object"===_typeof2(a)&&null!==a&&(a.$$typeof===t$2||a.$$typeof===r$1||a.$$typeof===h$2||a.$$typeof===k$1||a.$$typeof===n$4||a.$$typeof===w$4||a.$$typeof===x$1||a.$$typeof===y$1||a.$$typeof===v$3);};reactIs_production_min.typeOf=z$1;{reactIs$1.exports=reactIs_production_min;}var reactIsExports=reactIs$1.exports;var reactIs=reactIsExports;var REACT_STATICS={childContextTypes:true,contextType:true,contextTypes:true,defaultProps:true,displayName:true,getDefaultProps:true,getDerivedStateFromError:true,getDerivedStateFromProps:true,mixins:true,propTypes:true,type:true};var KNOWN_STATICS={name:true,length:true,prototype:true,caller:true,callee:true,arguments:true,arity:true};var FORWARD_REF_STATICS={'$$typeof':true,render:true,defaultProps:true,displayName:true,propTypes:true};var MEMO_STATICS={'$$typeof':true,compare:true,defaultProps:true,displayName:true,propTypes:true,type:true};var TYPE_STATICS={};TYPE_STATICS[reactIs.ForwardRef]=FORWARD_REF_STATICS;TYPE_STATICS[reactIs.Memo]=MEMO_STATICS;function getStatics(component){if(reactIs.isMemo(component)){return MEMO_STATICS;}return TYPE_STATICS[component['$$typeof']]||REACT_STATICS;}var defineProperty=Object.defineProperty;var getOwnPropertyNames=Object.getOwnPropertyNames;var getOwnPropertySymbols=Object.getOwnPropertySymbols;var getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;var getPrototypeOf=Object.getPrototypeOf;var objectPrototype=Object.prototype;function hoistNonReactStatics(targetComponent,sourceComponent,blacklist){if(typeof sourceComponent!=='string'){if(objectPrototype){var inheritedComponent=getPrototypeOf(sourceComponent);if(inheritedComponent&&inheritedComponent!==objectPrototype){hoistNonReactStatics(targetComponent,inheritedComponent,blacklist);}}var keys=getOwnPropertyNames(sourceComponent);if(getOwnPropertySymbols){keys=keys.concat(getOwnPropertySymbols(sourceComponent));}var targetStatics=getStatics(targetComponent);var sourceStatics=getStatics(sourceComponent);for(var i=0;i<keys.length;++i){var key=keys[i];if(!KNOWN_STATICS[key]&&!(blacklist&&blacklist[key])&&!(sourceStatics&&sourceStatics[key])&&!(targetStatics&&targetStatics[key])){var descriptor=getOwnPropertyDescriptor(sourceComponent,key);try{defineProperty(targetComponent,key,descriptor);}catch(e){}}}}return targetComponent;}var hoistNonReactStatics_cjs=hoistNonReactStatics;var y=/*@__PURE__*/getDefaultExportFromCjs(hoistNonReactStatics_cjs);function v$2(){return(v$2=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e;}).apply(this,arguments);}var g$2=function g$2(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n;},S$1=function S$1(t){return null!==t&&"object"==_typeof2(t)&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!reactIsExports$1.typeOf(t);},w$3=Object.freeze([]),E=Object.freeze({});function b$3(e){return"function"==typeof e;}function _$1(e){return e.displayName||e.name||"Component";}function N(e){return e&&"string"==typeof e.styledComponentId;}var A$1="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",I$1="undefined"!=typeof window&&"HTMLElement"in window,P$1=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!=="production");function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""));}var T$1=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e;}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t;},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0;}for(var i=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(i,t[a])&&(this.groupSizes[e]++,i++);},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n);}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t;},e;}(),x=new Map(),k=new Map(),V$1=1,B=function B(e){if(x.has(e))return x.get(e);for(;k.has(V$1);)V$1++;var t=V$1++;return x.set(e,t),k.set(t,e),t;},z=function z(e){return k.get(e);},M$1=function M$1(e,t){t>=V$1&&(V$1=t+1),x.set(e,t),k.set(t,e);},G$1="style["+A$1+'][data-styled-version="5.3.5"]',L=new RegExp("^"+A$1+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),F$2=function F$2(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r);},Y$1=function Y$1(e,t){for(var n=(t.textContent||"").split("/*!sc*/\n"),r=[],o=0,s=n.length;o<s;o++){var i=n[o].trim();if(i){var a=i.match(L);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(M$1(u,c),F$2(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0;}else r.push(i);}}},q=function q(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null;},H=function H(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(A$1))return r;}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(A$1,"active"),r.setAttribute("data-styled-version","5.3.5");var i=q();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r;},$$1=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o;}j(17);}(t),this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0;}catch(e){return!1;}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--;},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:"";},e;}(),W$1=function(){function e(e){var t=this.element=H(e);this.nodes=t.childNodes,this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0;}return!1;},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--;},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:"";},e;}(),U$1=function(){function e(e){this.rules=[],this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0);},t.deleteRule=function(e){this.rules.splice(e,1),this.length--;},t.getRule=function(e){return e<this.length?this.rules[e]:"";},e;}(),J$1=I$1,X$1={isServer:!I$1,useCSSOMInjection:!P$1},Z$1=function(){function e(e,t,n){void 0===e&&(e=E),void 0===t&&(t={}),this.options=v$2({},X$1,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&I$1&&J$1&&(J$1=!1,function(e){for(var t=document.querySelectorAll(G$1),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(A$1)&&(Y$1(e,o),o.parentNode&&o.parentNode.removeChild(o));}}(this));}e.registerId=function(e){return B(e);};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(v$2({},this.options,{},t),this.gs,n&&this.names||void 0);},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1;},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U$1(o):r?new $$1(o):new W$1(o),new T$1(e)));var e,t,n,r,o;},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t);},t.registerName=function(e,t){if(B(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set();n.add(t),this.names.set(e,n);}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(B(e),n);},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear();},t.clearRules=function(e){this.getTag().clearGroup(B(e)),this.clearNames(e);},t.clearTag=function(){this.tag=void 0;},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var s=z(o);if(void 0!==s){var i=e.names.get(s),a=t.getGroup(o);if(i&&a&&i.size){var c=A$1+".g"+o+'[id="'+s+'"]',u="";void 0!==i&&i.forEach(function(e){e.length>0&&(u+=e+",");}),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n';}}}return r;}(this);},e;}(),K=/(a)(d)/gi,Q$1=function Q$1(e){return String.fromCharCode(e+(e>25?39:97));};function ee$1(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Q$1(t%52)+n;return(Q$1(t%52)+n).replace(K,"$1-$2");}var te=function te(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e;},ne$1=function ne$1(e){return te(5381,e);};function re$1(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(b$3(n)&&!N(n))return!1;}return!0;}var oe$1=ne$1("5.3.5"),se$1=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&re$1(e),this.componentId=t,this.baseHash=te(oe$1,t),this.baseStyle=n,Z$1.registerId(t);}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash){if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var s=Ne(this.rules,e,t,n).join(""),i=ee$1(te(this.baseHash,s)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a);}o.push(i),this.staticRulesId=i;}}else{for(var c=this.rules.length,u=te(this.baseHash,n.hash),l="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)l+=h;else if(h){var p=Ne(h,e,t,n),f=Array.isArray(p)?p.join(""):p;u=te(u,f+d),l+=f;}}if(l){var m=ee$1(u>>>0);if(!t.hasNameForId(r,m)){var y=n(l,"."+m,void 0,r);t.insertRules(r,m,y);}o.push(m);}}return o.join(" ");},e;}(),ie=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ce(e){var t,n,r,o,s=void 0===e?E:e,i=s.options,a=void 0===i?E:i,c=s.plugins,u=void 0===c?w$3:c,l=new stylis_min(a),d=[],h=function(e){function t(t){if(t)try{e(t+"}");}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"");}case-2:r.split("/*|*/}").forEach(t);}};}(function(e){d.push(e);}),f=function f(e,r,s){return 0===r&&-1!==ae.indexOf(s[n.length])||s.match(o)?e:"."+t;};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(ie,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u);}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f));},h,function(e){if(-2===e){var t=d;return d=[],t;}}])),m.hash=u.length?u.reduce(function(e,t){return t.name||j(15),te(e,t.name);},5381).toString():"",m;}var ue$1=/*#__PURE__*/wn.createContext();ue$1.Consumer;var de$1=/*#__PURE__*/wn.createContext(),he$1=(de$1.Consumer,new Z$1()),pe$1=ce();function fe$1(){return q$4(ue$1)||he$1;}function me(){return q$4(de$1)||pe$1;}function ye$1(e){var t=h$5(e.stylisPlugins),n=t[0],s=t[1],c=fe$1(),u=F$4(function(){var t=c;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t;},[e.disableCSSOMInjection,e.sheet,e.target]),l=F$4(function(){return ce({options:{prefix:!e.disableVendorPrefixes},plugins:n});},[e.disableVendorPrefixes,n]);return p$5(function(){h$3(n,e.stylisPlugins)||s(e.stylisPlugins);},[e.stylisPlugins]),/*#__PURE__*/wn.createElement(ue$1.Provider,{value:u},/*#__PURE__*/wn.createElement(de$1.Provider,{value:l},e.children));}var ve$1=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=pe$1);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"));},this.toString=function(){return j(12,String(n.name));},this.name=e,this.id="sc-keyframes-"+e,this.rules=t;}return e.prototype.getName=function(e){return void 0===e&&(e=pe$1),this.name+e.hash;},e;}(),ge$1=/([A-Z])/,Se$1=/([A-Z])/g,we=/^ms-/,Ee$1=function Ee$1(e){return"-"+e.toLowerCase();};function be$1(e){return ge$1.test(e)?e.replace(Se$1,Ee$1).replace(we,"-ms-"):e;}var _e=function _e(e){return null==e||!1===e||""===e;};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a<c;a+=1)""!==(s=Ne(e[a],n,r,o))&&(Array.isArray(s)?i.push.apply(i,s):i.push(s));return i;}if(_e(e))return"";if(N(e))return"."+e.styledComponentId;if(b$3(e)){if("function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!n)return e;var u=e(n);return Ne(u,n,r,o);}var l;return e instanceof ve$1?r?(e.inject(r,o),e.getName(o)):e:S$1(e)?function e(t,n){var r,o,s=[];for(var i in t)t.hasOwnProperty(i)&&!_e(t[i])&&(Array.isArray(t[i])&&t[i].isCss||b$3(t[i])?s.push(be$1(i)+":",t[i],";"):S$1(t[i])?s.push.apply(s,e(t[i],i)):s.push(be$1(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in unitlessKeys?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(s,["}"]):s;}(e):e.toString();}var Ae$1=function Ae$1(e){return Array.isArray(e)&&(e.isCss=!0),e;};function Ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return b$3(e)||S$1(e)?Ae$1(Ne(g$2(w$3,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:Ae$1(Ne(g$2(e,n)));}var Re$1=function Re$1(e,t,n){return void 0===n&&(n=E),e.theme!==n.theme&&e.theme||t||n.theme;},De=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Te$1(e){return e.replace(De,"-").replace(je,"");}var xe$1=function xe$1(e){return ee$1(ne$1(e)>>>0);};function ke(e){return"string"==typeof e&&"production"==="production";}var Ve=function Ve(e){return"function"==typeof e||"object"==_typeof2(e)&&null!==e&&!Array.isArray(e);},Be=function Be(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e;};function ze(e,t,n){var r=e[n];Ve(t)&&Ve(r)?Me(r,t):e[n]=t;}function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,s=n;o<s.length;o++){var i=s[o];if(Ve(i))for(var a in i)Be(a)&&ze(e,i[a],a);}return e;}var Ge=/*#__PURE__*/wn.createContext();Ge.Consumer;function Fe(e){var t=q$4(Ge),n=F$4(function(){return function(e,t){if(!e)return j(14);if(b$3(e)){var n=e(t);return n;}return Array.isArray(e)||"object"!=_typeof2(e)?j(8):t?v$2({},t,{},e):e;}(e.theme,t);},[e.theme,t]);return e.children?/*#__PURE__*/wn.createElement(Ge.Provider,{value:n},e.children):null;}var Ye={};function qe(e,t,n){var o=N(e),i=!ke(e),a=t.attrs,c=void 0===a?w$3:a,d=t.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":Te$1(e);Ye[n]=(Ye[n]||0)+1;var r=n+"-"+xe$1("5.3.5"+n+Ye[n]);return t?t+"-"+r:r;}(t.displayName,t.parentComponentId):d,p=t.displayName,f=void 0===p?function(e){return ke(e)?"styled."+e:"Styled("+_$1(e)+")";}(e):p,g=t.displayName&&t.componentId?Te$1(t.displayName)+"-"+t.componentId:t.componentId||h,S=o&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,A=t.shouldForwardProp;o&&e.shouldForwardProp&&(A=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o);}:e.shouldForwardProp);var C,I=new se$1(n,g,o?e.componentStyle:void 0),P=I.isStatic&&0===c.length,O=function O(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,d=e.shouldForwardProp,h=e.styledComponentId,p=e.target;var f=function(e,t,n){void 0===e&&(e=E);var r=v$2({},t,{theme:e}),o={};return n.forEach(function(e){var t,n,s,i=e;for(t in b$3(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],s=i[t],n&&s?n+" "+s:n||s):i[t];}),[r,o];}(Re$1(t,q$4(Ge),a)||E,t,o),y=f[0],g=f[1],S=function(e,t,n,r){var o=fe$1(),s=me(),i=t?e.generateAndInjectStyles(E,o,s):e.generateAndInjectStyles(n,o,s);return i;}(i,r,y),w=n,_=g.$as||t.$as||g.as||t.as||p,N=ke(_),A=g!==t?v$2({},t,{},g):t,C={};for(var I in A)"$"!==I[0]&&"as"!==I&&("forwardedAs"===I?C.as=A[I]:(d?d(I,isPropValid,_):!N||isPropValid(I))&&(C[I]=A[I]));return t.style&&g.style!==t.style&&(C.style=v$2({},t.style,{},g.style)),C.className=Array.prototype.concat(c,h,S!==h?S:null,t.className,g.className).filter(Boolean).join(" "),C.ref=w,/*#__PURE__*/y$3(_,C);}(C,e,t,P);};return O.displayName=f,(C=/*#__PURE__*/wn.forwardRef(O)).attrs=S,C.componentStyle=I,C.displayName=f,C.shouldForwardProp=A,C.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):w$3,C.styledComponentId=g,C.target=o?e.target:e,C.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o;}(t,["componentId"]),s=r&&r+"-"+(ke(e)?e:Te$1(_$1(e)));return qe(e,v$2({},o,{attrs:S,componentId:s}),n);},Object.defineProperty(C,"defaultProps",{get:function get(){return this._foldedDefaultProps;},set:function set(t){this._foldedDefaultProps=o?Me({},e.defaultProps,t):t;}}),C.toString=function(){return"."+C.styledComponentId;},i&&y(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C;}var He=function He(e){return function e(t,r,o){if(void 0===o&&(o=E),!reactIsExports$1.isValidElementType(r))return j(1,String(r));var s=function s(){return t(r,o,Ce.apply(void 0,arguments));};return s.withConfig=function(n){return e(t,r,v$2({},o,{},n));},s.attrs=function(n){return e(t,r,v$2({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}));},s;}(qe,e);};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){He[e]=He(e);});function Ue(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Ce.apply(void 0,[e].concat(n)).join(""),s=xe$1(o);return new ve$1(s,o);}var Ze=function Ze(){return q$4(Ge);};var messages$1={"button.back.ariaLabel":["Back"],"button.cancel":["Cancel"],"button.continue":["Continue"],"button.createPasskey":["Create a Passkey"],"button.createPasswordInstead":["Create a password instead"],"button.delete":["Delete"],"button.done":["Done"],"button.edit":["Edit"],"button.emailLogin":["Continue with email"],"button.emailMagicLink":["Email me a login link"],"button.emailOTP":["Email me a login code"],"button.forgotPassword":["Forgot Password?"],"button.hidePassword":["Hide password"],"button.loginWithPasskey":["Login with a Passkey"],"button.loginWithoutPassword":["Login without a password"],"button.retry":["Try again"],"button.save":["Save"],"button.showPassword":["Show password"],"button.skip":["Skip"],"button.sms":["Continue with text message"],"button.whatsapp":["Continue with WhatsApp"],"createAccount.title":["Choose how you would like to create your account."],"crypto.connectWallet.instructionPopup":["Complete sign in by connecting through the wallet pop up in the right corner of your screen."],"crypto.connectWallet.title":["Connecting to your wallet..."],"crypto.continueWithOtherWallet.title":["Continue with other wallet"],"crypto.error.content":["Your sign in request could not be completed. Use the back arrow to return to the log in screen and try again!"],"crypto.error.title":["Looks like there was an error!"],"crypto.setupNewWallet.content":["Signing in with a crypto wallet can help keep your account private and secure."],"crypto.setupNewWallet.instruction":["Get started by downloading any Ethereum or Solana wallet. We’ve included a few examples of wallet extensions you can find below. Once you’ve set up your wallet, you can use it to sign in!"],"crypto.setupNewWallet.title":["Set up a new crypto wallet"],"crypto.signMessage.instruction":["Complete the signature request through the wallet pop up in the right corner of your screen."],"crypto.signMessage.title":["Completing signature request..."],"crypto.success.content":["You have successfully connected your wallet."],"crypto.success.title":["Success!"],"crypto.troubleHelp":["Having trouble? Use the back arrow to return to the main screen and try logging in again."],"crypto.wallet.binance":["Binance"],"crypto.wallet.coinbase":["Coinbase"],"crypto.wallet.continueWithBinance":["Continue with Binance"],"crypto.wallet.continueWithCoinbase":["Continue with Coinbase"],"crypto.wallet.continueWithEthereum":["Continue with Other Ethereum Wallet"],"crypto.wallet.continueWithMetamask":["Continue with Metamask"],"crypto.wallet.continueWithOtherWallet":["Continue with other Crypto Wallet"],"crypto.wallet.continueWithPhantom":["Continue with Phantom"],"crypto.wallet.continueWithSolana":["Continue with Other Solana Wallet"],"crypto.wallet.continueWithVessel":["Continue with Vessel"],"crypto.wallet.metamask":["Metamask"],"crypto.wallet.otherEthereum":["Other Ethereum Wallet"],"crypto.wallet.otherSolana":["Other Solana Wallet"],"crypto.wallet.phantom":["Phantom"],"crypto.wallet.setupNewWallet":["Set up a new crypto wallet"],"crypto.wallet.vessel":["Vessel"],"emailConfirmation.content":["An email was sent to <bold>",["email"],"</bold>."],"emailConfirmation.title":["Check your email"],"error.breachedPassword":["Password appears in the list of breached passwords and must be reset."],"error.duplicatePasskey":["The Passkey cannot be created as it seems to be already registered. It is possible this Passkey was registered on another device but has synced cross-device."],"error.duplicatePhoneNumber":["A member with the specified phone number already exists for this organization."],"error.emailNotFound":["Email not found."],"error.inactiveEmail":["The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."],"error.invalidCode":["Code format is invalid, please try again."],"error.invalidEmail":["Email format is invalid."],"error.invalidPhoneNumber":["Phone number format is invalid. Ensure the phone number is in the E.164 format."],"error.invalidPhoneNumberCountryCode":["The phone number's country code is invalid, unsupported, or disabled."],"error.invalidSessionToken":["Invalid session token."],"error.memberPasswordNotFound":["Member password not found."],"error.noUserPassword":["Password not found for this user. Please try again."],"error.oauthFlowCallbackError":["An error was encountered in the callback of the OAuth flow. Please try again."],"error.oauthTokenNotFound":["OAuth Token could not be found."],"error.otpCodeNotFound":["Invalid passcode, please try again."],"error.passkeyNotCreated":["Your Passkey was not created. Click “Create a Passkey” to try again or skip without adding a Passkey."],"error.passkeyRegistrationNotFound":["Passkey registration not found. You may have deleted the passkey from your account but not password manager. Please try again."],"error.passkeyUnknown":["Unknown error occurred during passkey authentication. Please try again."],"error.resetPassword":["Password must be reset."],"error.sessionNotFound":["Session not found."],"error.title":["Looks like there was an error!"],"error.unableToAuthMagicLink":["The magic link could not be authenticated because it was either already used or expired. Please try again."],"error.unauthorizedAction":["Unauthorized action."],"error.unauthorizedCredentials":["Unauthorized credentials."],"error.unsubscribedPhoneNumber":["Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."],"error.userLockLimitReached":["Too many failed authentication attempts. Please try again later."],"error.userUnauthenticated":["Must have an active session to call this method. Have you logged in yet?"],"errors.invalidEmail":["Invalid email address."],"formField.countryCode.label":["Country code"],"formField.email.label":["Email"],"formField.email.placeholder":["example@email.com"],"formField.otp.ariaLabel":["One-time passcode"],"formField.passcode.status.verifying":["Verifying passcode..."],"formField.password.label":["Password"],"formField.phone.label":["Phone number"],"idpConsent.allowClientTo":["Allow ",["clientName"]," to:"],"idpConsent.button.allow":["Allow"],"idpConsent.button.deny":["Deny"],"idpConsent.cannotGrantRequest":["You cannot grant ",["clientName"],"'s request to:"],"idpConsent.customScopes.title":[["clientName"]," wants to access your ",["projectName"]," account"],"idpConsent.defaultClientName":["The App"],"idpConsent.denied":["Access to the application was denied."],"idpConsent.noActiveSession":["No active session detected. Please log in to continue."],"idpConsent.noPermissionsToGrant":["You do not have permissions to grant ",["clientName"]," access to some of the requested scopes."],"idpConsent.signIn.title":["Sign in to ",["clientName"]," with ",["projectName"]],"idpLogout.confirmMessage":["Are you sure you want to log out of your ",["projectName"]," account?"],"idpLogout.no":["No"],"idpLogout.notLoggedOut":["You have not been logged out. You may close this page."],"idpLogout.title":["Log out?"],"idpLogout.yes":["Yes"],"link.openInGmail":["Open in Gmail"],"link.openInOutlook":["Open in Outlook"],"link.openInYahoo":["Open in Yahoo"],"login.loading":["Logging in..."],"login.success.content":["You have successfully logged in."],"login.title":["Sign up or log in"],"methodDivider.text":["or"],"oauth.continueWithAmazon":["Continue with Amazon"],"oauth.continueWithApple":["Continue with Apple"],"oauth.continueWithBitbucket":["Continue with Bitbucket"],"oauth.continueWithCoinbase":["Continue with Coinbase"],"oauth.continueWithDiscord":["Continue with Discord"],"oauth.continueWithFacebook":["Continue with Facebook"],"oauth.continueWithFigma":["Continue with Figma"],"oauth.continueWithGitHub":["Continue with GitHub"],"oauth.continueWithGitLab":["Continue with GitLab"],"oauth.continueWithGoogle":["Continue with Google"],"oauth.continueWithLinkedIn":["Continue with LinkedIn"],"oauth.continueWithMicrosoft":["Continue with Microsoft"],"oauth.continueWithSalesforce":["Continue with Salesforce"],"oauth.continueWithSlack":["Continue with Slack"],"oauth.continueWithSnapchat":["Continue with Snapchat"],"oauth.continueWithTikTok":["Continue with TikTok"],"oauth.continueWithTwitch":["Continue with Twitch"],"oauth.continueWithTwitter":["Continue with Twitter"],"oauth.continueWithYahoo":["Continue with Yahoo"],"otp.success.content":["Your passcode has been successfully verified."],"passcode.codeSent":["Code sent"],"passcode.didntGetIt":["Didn't get it?"],"passcode.expirationCountdown":["Your code expires in ",["timeRemaining"],"."],"passcode.expired":["Your code has expired."],"passcode.resendCode":["Resend code"],"passcode.sentConfirmation":["A 6-digit passcode was sent to you at <bold>",["destination"],"</bold>."],"passcode.title":["Enter passcode"],"passkey.editing.label":["Passkey name"],"passkey.registrationStart.description":["Passkeys are encrypted digital keys you create using your fingerprint, face, or screen lock. Creating a Passkey will allow you to easily and securely log in to your account."],"passkey.registrationStart.error.noUser":["Error: Cannot use PasskeyRegistration component without active user authenticated."],"passkey.registrationStart.subtitle":["With Passkeys you don't need to remember complex passwords."],"passkey.registrationStart.title":["Set up a new Passkey"],"passkey.registrationSuccess.deleteWarning":["Once deleted, the passkey cannot be restored."],"passkey.registrationSuccess.existingPasskeys":["Existing Passkeys"],"passkey.registrationSuccess.setupAnother":["Set up another Passkey"],"passkey.registrationSuccess.title":["Passkey successfully created!"],"passkey.success.content":["Your Passkey has been successfully authenticated."],"password.breached.content":["A different site where you use the same password had a security issue recently. For your safety, an email was sent to you at <bold>",["email"],"</bold> to reset your password."],"password.breached.title":["Check your email to set a new password"],"password.createAccount.content":["Finish creating your account by setting a password."],"password.didntGetItResend":["Didn't get it? <resendButton>Resend email</resendButton>"],"password.forgot.content":["A link to reset your password was sent to you at <bold>",["email"],"</bold>."],"password.forgot.title":["Forgot password?"],"password.login.title":["Log In"],"password.reset.loggingInProgress":["Logging in..."],"password.reset.loginWithoutPassword":["Login without a password"],"password.reset.title":["Reset your password"],"password.resetRequired.content":["We want to make sure your account is secure and that it's really you logging in! A login link was sent to you at <bold>",["email"],"</bold>."],"password.resetRequired.title":["Check your email to set a new password!"],"password.setNew.content":["A login link was sent to you at <bold>",["email"],"</bold>."],"password.setNew.title":["Check your email!"],"password.strengthError.breached":["This password may have been used on a different site that experienced a security issue. Please choose another password."],"password.strengthError.complexity":[["complexity","plural",{one:["Must contain ","#"," of the following: uppercase letter, lowercase letter, number, symbol"],other:["Must contain ","#"," of the following: uppercase letter, lowercase letter, number, symbol"]}]],"password.strengthError.minimumLength":[["characterLength","plural",{one:["Must be at least ","#"," character long"],other:["Must be at least ","#"," characters long"]}]],"password.zxcvbn.suggestion.addWords":["Add another word or two. Uncommon words are better."],"password.zxcvbn.suggestion.allUppercase":["All-uppercase is almost as easy to guess as all-lowercase."],"password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou":["Avoid dates and years that are associated with you."],"password.zxcvbn.suggestion.avoidRecentYears":["Avoid recent years."],"password.zxcvbn.suggestion.avoidRepeats":["Avoid repeated words and characters."],"password.zxcvbn.suggestion.avoidSequences":["Avoid sequences."],"password.zxcvbn.suggestion.avoidYearsAssociatedWithYou":["Avoid years that are associated with you."],"password.zxcvbn.suggestion.capitalization":["Capitalization doesn't help very much."],"password.zxcvbn.suggestion.longerKeyboardPattern":["Use a longer keyboard pattern with more turns."],"password.zxcvbn.suggestion.noSymbolsDigitsUppercase":["No need for symbols, digits, or uppercase letters."],"password.zxcvbn.suggestion.predictableSubstitutions":["Predictable substitutions like '@' instead of 'a' don't help very much."],"password.zxcvbn.suggestion.reversed":["Reversed words aren't much harder to guess."],"password.zxcvbn.suggestion.useAFewWords":["Use a few words, avoid common phrases."],"password.zxcvbn.warning.commonNames":["Common names and surnames are easy to guess."],"password.zxcvbn.warning.dates":["Dates are often easy to guess."],"password.zxcvbn.warning.longerRepeats":["Repeats like \"abcabcabc\" are only slightly harder to guess than \"abc\"."],"password.zxcvbn.warning.names":["Names and surnames by themselves are easy to guess."],"password.zxcvbn.warning.recentYears":["Recent years are easy to guess."],"password.zxcvbn.warning.repeats":["Repeats like \"aaa\" are easy to guess."],"password.zxcvbn.warning.sequences":["Sequences like \"abc\" or \"6543\" are easy to guess."],"password.zxcvbn.warning.shortKeyboardPatterns":["Short keyboard patterns are easy to guess."],"password.zxcvbn.warning.similarToCommonPassword":["This is similar to a commonly used password."],"password.zxcvbn.warning.straightRows":["Straight rows of keys are easy to guess."],"password.zxcvbn.warning.top100CommonPassword":["This is a top-100 common password."],"password.zxcvbn.warning.top10CommonPassword":["This is a top-10 common password."],"password.zxcvbn.warning.veryCommonPassword":["This is a very common password."],"password.zxcvbn.warning.wordByItself":["A word by itself is easy to guess."],"provider.lastUsed":["Last used"],"success.title":["Success!"],"tab.email":["Email"],"tab.text":["Text"],"tab.whatsapp":["WhatsApp"],"toast.emailResent":["Email resent"],"watermark.altText":["Powered by Stytch"]};var messages=messages$1;var parser={};var lexer={};var moo={exports:{}};(function(module){(function(root,factory){if(module.exports){module.exports=factory();}else{root.moo=factory();}})(commonjsGlobal,function(){var hasOwnProperty=Object.prototype.hasOwnProperty;var toString=Object.prototype.toString;var hasSticky=typeof new RegExp().sticky==='boolean';function isRegExp(o){return o&&toString.call(o)==='[object RegExp]';}function isObject(o){return o&&_typeof2(o)==='object'&&!isRegExp(o)&&!Array.isArray(o);}function reEscape(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&');}function reGroups(s){var re=new RegExp('|'+s);return re.exec('').length-1;}function reCapture(s){return'('+s+')';}function reUnion(regexps){if(!regexps.length)return'(?!)';var source=regexps.map(function(s){return"(?:"+s+")";}).join('|');return"(?:"+source+")";}function regexpOrLiteral(obj){if(typeof obj==='string'){return'(?:'+reEscape(obj)+')';}else if(isRegExp(obj)){if(obj.ignoreCase)throw new Error('RegExp /i flag not allowed');if(obj.global)throw new Error('RegExp /g flag is implied');if(obj.sticky)throw new Error('RegExp /y flag is implied');if(obj.multiline)throw new Error('RegExp /m flag is implied');return obj.source;}else{throw new Error('Not a pattern: '+obj);}}function pad(s,length){if(s.length>length){return s;}return Array(length-s.length+1).join(" ")+s;}function lastNLines(string,numLines){var position=string.length;var lineBreaks=0;while(true){var idx=string.lastIndexOf("\n",position-1);if(idx===-1){break;}else{lineBreaks++;}position=idx;if(lineBreaks===numLines){break;}if(position===0){break;}}var startPosition=lineBreaks<numLines?0:position+1;return string.substring(startPosition).split("\n");}function objectToRules(object){var keys=Object.getOwnPropertyNames(object);var result=[];for(var i=0;i<keys.length;i++){var key=keys[i];var thing=object[key];var rules=[].concat(thing);if(key==='include'){for(var j=0;j<rules.length;j++){result.push({include:rules[j]});}continue;}var match=[];rules.forEach(function(rule){if(isObject(rule)){if(match.length)result.push(ruleOptions(key,match));result.push(ruleOptions(key,rule));match=[];}else{match.push(rule);}});if(match.length)result.push(ruleOptions(key,match));}return result;}function arrayToRules(array){var result=[];for(var i=0;i<array.length;i++){var obj=array[i];if(obj.include){var include=[].concat(obj.include);for(var j=0;j<include.length;j++){result.push({include:include[j]});}continue;}if(!obj.type){throw new Error('Rule has no type: '+JSON.stringify(obj));}result.push(ruleOptions(obj.type,obj));}return result;}function ruleOptions(type,obj){if(!isObject(obj)){obj={match:obj};}if(obj.include){throw new Error('Matching rules cannot also include states');}var options={defaultType:type,lineBreaks:!!obj.error||!!obj.fallback,pop:false,next:null,push:null,error:false,fallback:false,value:null,type:null,shouldThrow:false};for(var key in obj){if(hasOwnProperty.call(obj,key)){options[key]=obj[key];}}if(typeof options.type==='string'&&type!==options.type){throw new Error("Type transform cannot be a string (type '"+options.type+"' for token '"+type+"')");}var match=options.match;options.match=Array.isArray(match)?match:match?[match]:[];options.match.sort(function(a,b){return isRegExp(a)&&isRegExp(b)?0:isRegExp(b)?-1:isRegExp(a)?+1:b.length-a.length;});return options;}function toRules(spec){return Array.isArray(spec)?arrayToRules(spec):objectToRules(spec);}var defaultErrorRule=ruleOptions('error',{lineBreaks:true,shouldThrow:true});function compileRules(rules,hasStates){var errorRule=null;var fast=Object.create(null);var fastAllowed=true;var unicodeFlag=null;var groups=[];var parts=[];for(var i=0;i<rules.length;i++){if(rules[i].fallback){fastAllowed=false;}}for(var i=0;i<rules.length;i++){var options=rules[i];if(options.include){throw new Error('Inheritance is not allowed in stateless lexers');}if(options.error||options.fallback){if(errorRule){if(!options.fallback===!errorRule.fallback){throw new Error("Multiple "+(options.fallback?"fallback":"error")+" rules not allowed (for token '"+options.defaultType+"')");}else{throw new Error("fallback and error are mutually exclusive (for token '"+options.defaultType+"')");}}errorRule=options;}var match=options.match.slice();if(fastAllowed){while(match.length&&typeof match[0]==='string'&&match[0].length===1){var word=match.shift();fast[word.charCodeAt(0)]=options;}}if(options.pop||options.push||options.next){if(!hasStates){throw new Error("State-switching options are not allowed in stateless lexers (for token '"+options.defaultType+"')");}if(options.fallback){throw new Error("State-switching options are not allowed on fallback tokens (for token '"+options.defaultType+"')");}}if(match.length===0){continue;}fastAllowed=false;groups.push(options);for(var j=0;j<match.length;j++){var obj=match[j];if(!isRegExp(obj)){continue;}if(unicodeFlag===null){unicodeFlag=obj.unicode;}else if(unicodeFlag!==obj.unicode&&options.fallback===false){throw new Error('If one rule is /u then all must be');}}var pat=reUnion(match.map(regexpOrLiteral));var regexp=new RegExp(pat);if(regexp.test("")){throw new Error("RegExp matches empty string: "+regexp);}var groupCount=reGroups(pat);if(groupCount>0){throw new Error("RegExp has capture groups: "+regexp+"\nUse (?: … ) instead");}if(!options.lineBreaks&&regexp.test('\n')){throw new Error('Rule should declare lineBreaks: '+regexp);}parts.push(reCapture(pat));}var fallbackRule=errorRule&&errorRule.fallback;var flags=hasSticky&&!fallbackRule?'ym':'gm';var suffix=hasSticky||fallbackRule?'':'|';if(unicodeFlag===true)flags+="u";var combined=new RegExp(reUnion(parts)+suffix,flags);return{regexp:combined,groups:groups,fast:fast,error:errorRule||defaultErrorRule};}function compile(rules){var result=compileRules(toRules(rules));return new Lexer({start:result},'start');}function checkStateGroup(g,name,map){var state=g&&(g.push||g.next);if(state&&!map[state]){throw new Error("Missing state '"+state+"' (in token '"+g.defaultType+"' of state '"+name+"')");}if(g&&g.pop&&+g.pop!==1){throw new Error("pop must be 1 (in token '"+g.defaultType+"' of state '"+name+"')");}}function compileStates(states,start){var all=states.$all?toRules(states.$all):[];delete states.$all;var keys=Object.getOwnPropertyNames(states);if(!start)start=keys[0];var ruleMap=Object.create(null);for(var i=0;i<keys.length;i++){var key=keys[i];ruleMap[key]=toRules(states[key]).concat(all);}for(var i=0;i<keys.length;i++){var key=keys[i];var rules=ruleMap[key];var included=Object.create(null);for(var j=0;j<rules.length;j++){var rule=rules[j];if(!rule.include)continue;var splice=[j,1];if(rule.include!==key&&!included[rule.include]){included[rule.include]=true;var newRules=ruleMap[rule.include];if(!newRules){throw new Error("Cannot include nonexistent state '"+rule.include+"' (in state '"+key+"')");}for(var k=0;k<newRules.length;k++){var newRule=newRules[k];if(rules.indexOf(newRule)!==-1)continue;splice.push(newRule);}}rules.splice.apply(rules,splice);j--;}}var map=Object.create(null);for(var i=0;i<keys.length;i++){var key=keys[i];map[key]=compileRules(ruleMap[key],true);}for(var i=0;i<keys.length;i++){var name=keys[i];var state=map[name];var groups=state.groups;for(var j=0;j<groups.length;j++){checkStateGroup(groups[j],name,map);}var fastKeys=Object.getOwnPropertyNames(state.fast);for(var j=0;j<fastKeys.length;j++){checkStateGroup(state.fast[fastKeys[j]],name,map);}}return new Lexer(map,start);}function keywordTransform(map){var isMap=typeof Map!=='undefined';var reverseMap=isMap?new Map():Object.create(null);var types=Object.getOwnPropertyNames(map);for(var i=0;i<types.length;i++){var tokenType=types[i];var item=map[tokenType];var keywordList=Array.isArray(item)?item:[item];keywordList.forEach(function(keyword){if(typeof keyword!=='string'){throw new Error("keyword must be string (in keyword '"+tokenType+"')");}if(isMap){reverseMap.set(keyword,tokenType);}else{reverseMap[keyword]=tokenType;}});}return function(k){return isMap?reverseMap.get(k):reverseMap[k];};}var Lexer=function Lexer(states,state){this.startState=state;this.states=states;this.buffer='';this.stack=[];this.reset();};Lexer.prototype.reset=function(data,info){this.buffer=data||'';this.index=0;this.line=info?info.line:1;this.col=info?info.col:1;this.queuedToken=info?info.queuedToken:null;this.queuedText=info?info.queuedText:"";this.queuedThrow=info?info.queuedThrow:null;this.setState(info?info.state:this.startState);this.stack=info&&info.stack?info.stack.slice():[];return this;};Lexer.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow};};Lexer.prototype.setState=function(state){if(!state||this.state===state)return;this.state=state;var info=this.states[state];this.groups=info.groups;this.error=info.error;this.re=info.regexp;this.fast=info.fast;};Lexer.prototype.popState=function(){this.setState(this.stack.pop());};Lexer.prototype.pushState=function(state){this.stack.push(this.state);this.setState(state);};var eat=hasSticky?function(re,buffer){return re.exec(buffer);}:function(re,buffer){var match=re.exec(buffer);if(match[0].length===0){return null;}return match;};Lexer.prototype._getGroup=function(match){var groupCount=this.groups.length;for(var i=0;i<groupCount;i++){if(match[i+1]!==undefined){return this.groups[i];}}throw new Error('Cannot find token type for matched text');};function tokenToString(){return this.value;}Lexer.prototype.next=function(){var index=this.index;if(this.queuedGroup){var token=this._token(this.queuedGroup,this.queuedText,index);this.queuedGroup=null;this.queuedText="";return token;}var buffer=this.buffer;if(index===buffer.length){return;}var group=this.fast[buffer.charCodeAt(index)];if(group){return this._token(group,buffer.charAt(index),index);}var re=this.re;re.lastIndex=index;var match=eat(re,buffer);var error=this.error;if(match==null){return this._token(error,buffer.slice(index,buffer.length),index);}var group=this._getGroup(match);var text=match[0];if(error.fallback&&match.index!==index){this.queuedGroup=group;this.queuedText=text;return this._token(error,buffer.slice(index,match.index),index);}return this._token(group,text,index);};Lexer.prototype._token=function(group,text,offset){var lineBreaks=0;if(group.lineBreaks){var matchNL=/\n/g;var nl=1;if(text==='\n'){lineBreaks=1;}else{while(matchNL.exec(text)){lineBreaks++;nl=matchNL.lastIndex;}}}var token={type:typeof group.type==='function'&&group.type(text)||group.defaultType,value:typeof group.value==='function'?group.value(text):text,text:text,toString:tokenToString,offset:offset,lineBreaks:lineBreaks,line:this.line,col:this.col};var size=text.length;this.index+=size;this.line+=lineBreaks;if(lineBreaks!==0){this.col=size-nl+1;}else{this.col+=size;}if(group.shouldThrow){var err=new Error(this.formatError(token,"invalid syntax"));throw err;}if(group.pop)this.popState();else if(group.push)this.pushState(group.push);else if(group.next)this.setState(group.next);return token;};if(typeof Symbol!=='undefined'&&Symbol.iterator){var LexerIterator=function LexerIterator(lexer){this.lexer=lexer;};LexerIterator.prototype.next=function(){var token=this.lexer.next();return{value:token,done:!token};};LexerIterator.prototype[Symbol.iterator]=function(){return this;};Lexer.prototype[Symbol.iterator]=function(){return new LexerIterator(this);};}Lexer.prototype.formatError=function(token,message){if(token==null){var text=this.buffer.slice(this.index);var token={text:text,offset:this.index,lineBreaks:text.indexOf('\n')===-1?0:1,line:this.line,col:this.col};}var numLinesAround=2;var firstDisplayedLine=Math.max(token.line-numLinesAround,1);var lastDisplayedLine=token.line+numLinesAround;var lastLineDigits=String(lastDisplayedLine).length;var displayedLines=lastNLines(this.buffer,this.line-token.line+numLinesAround+1).slice(0,5);var errorLines=[];errorLines.push(message+" at line "+token.line+" col "+token.col+":");errorLines.push("");for(var i=0;i<displayedLines.length;i++){var line=displayedLines[i];var lineNo=firstDisplayedLine+i;errorLines.push(pad(String(lineNo),lastLineDigits)+" "+line);if(lineNo===token.line){errorLines.push(pad("",lastLineDigits+token.col+1)+"^");}}return errorLines.join("\n");};Lexer.prototype.clone=function(){return new Lexer(this.states,this.state);};Lexer.prototype.has=function(tokenType){return true;};return{compile:compile,states:compileStates,error:Object.freeze({error:true}),fallback:Object.freeze({fallback:true}),keywords:keywordTransform};});})(moo);var mooExports=moo.exports;(function(exports){var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(mod){return mod&&mod.__esModule?mod:{"default":mod};};Object.defineProperty(exports,"__esModule",{value:true});exports.lexer=exports.states=void 0;var moo_1=__importDefault(mooExports);exports.states={body:{doubleapos:{match:"''",value:function value(){return"'";}},quoted:{lineBreaks:true,match:/'[#\{\}](?:(?:[\0-&\(-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|'')*'(?!')/,value:function value(src){return src.slice(1,-1).replace(/''/g,"'");}},argument:{lineBreaks:true,match:/\{[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[\0-\x08\x0E-\x1F0-9A-Z_a-z\x7F-\x84\x86-\xA0\xA8\xAA\xAD\xAF\xB2-\xB5\xB7-\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u200D\u202A-\u202F\u203F\u2040\u2054\u205F-\u218F\u2460-\u24FF\u2776-\u2793\u2C00-\u2DFF\u2E80-\u3000\u3004-\u3007\u3021-\u302F\u3031-\uD7FF\uE000-\uFD3D\uFD40-\uFE44\uFE47-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*/,push:'arg',value:function value(src){return src.substring(1).trim();}},octothorpe:'#',end:{match:'}',pop:1},content:{lineBreaks:true,match:/(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[\0-"\$-&\(-z\|~-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*/}},arg:{select:{lineBreaks:true,match:/,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:plural|select|selectordinal)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*/,next:'select',value:function value(src){return src.split(',')[1].trim();}},'func-args':{lineBreaks:true,match:/,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[\0-\x08\x0E-\x1F0-9A-Z_a-z\x7F-\x84\x86-\xA0\xA8\xAA\xAD\xAF\xB2-\xB5\xB7-\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u200D\u202A-\u202F\u203F\u2040\u2054\u205F-\u218F\u2460-\u24FF\u2776-\u2793\u2C00-\u2DFF\u2E80-\u3000\u3004-\u3007\u3021-\u302F\u3031-\uD7FF\uE000-\uFD3D\uFD40-\uFE44\uFE47-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*,/,next:'body',value:function value(src){return src.split(',')[1].trim();}},'func-simple':{lineBreaks:true,match:/,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[\0-\x08\x0E-\x1F0-9A-Z_a-z\x7F-\x84\x86-\xA0\xA8\xAA\xAD\xAF\xB2-\xB5\xB7-\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u200D\u202A-\u202F\u203F\u2040\u2054\u205F-\u218F\u2460-\u24FF\u2776-\u2793\u2C00-\u2DFF\u2E80-\u3000\u3004-\u3007\u3021-\u302F\u3031-\uD7FF\uE000-\uFD3D\uFD40-\uFE44\uFE47-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*/,value:function value(src){return src.substring(1).trim();}},end:{match:'}',pop:1}},select:{offset:{lineBreaks:true,match:/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*offset[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*:[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*[0-9]+[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*/,value:function value(src){return src.split(':')[1].trim();}},"case":{lineBreaks:true,match:/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:=[0-9]+|(?:[\0-\x08\x0E-\x1F0-9A-Z_a-z\x7F-\x84\x86-\xA0\xA8\xAA\xAD\xAF\xB2-\xB5\xB7-\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u200D\u202A-\u202F\u203F\u2040\u2054\u205F-\u218F\u2460-\u24FF\u2776-\u2793\u2C00-\u2DFF\u2E80-\u3000\u3004-\u3007\u3021-\u302F\u3031-\uD7FF\uE000-\uFD3D\uFD40-\uFE44\uFE47-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\{/,push:'body',value:function value(src){return src.substring(0,src.indexOf('{')).trim();}},end:{match:/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\}/,pop:1}}};exports.lexer=moo_1["default"].states(exports.states);})(lexer);Object.defineProperty(parser,"__esModule",{value:true});parser.ParseError=void 0;var parse_1=parser.parse=parse;var lexer_js_1=lexer;var getContext=function getContext(lt){return{offset:lt.offset,line:lt.line,col:lt.col,text:lt.text,lineBreaks:lt.lineBreaks};};var isSelectType=function isSelectType(type){return type==='plural'||type==='select'||type==='selectordinal';};function strictArgStyleParam(lt,param){var value='';var text='';var _iterator3=_createForOfIteratorHelper2(param),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _p=_step3.value;var pText=_p.ctx.text;text+=pText;switch(_p.type){case'content':value+=_p.value;break;case'argument':case'function':case'octothorpe':value+=pText;break;default:throw new ParseError(lt,"Unsupported part in strict mode function arg style: ".concat(pText));}}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}var c={type:'content',value:value.trim(),ctx:Object.assign({},param[0].ctx,{text:text})};return[c];}var strictArgTypes=['number','date','time','spellout','ordinal','duration'];var defaultPluralKeys=['zero','one','two','few','many','other'];var ParseError=/*#__PURE__*/function(_Error6){function ParseError(lt,msg){_classCallCheck2(this,ParseError);return _callSuper2(this,ParseError,[lexer_js_1.lexer.formatError(lt,msg)]);}_inherits2(ParseError,_Error6);return _createClass2(ParseError);}(/*#__PURE__*/_wrapNativeSuper2(Error));parser.ParseError=ParseError;var Parser=/*#__PURE__*/function(){function Parser(src,opt){_classCallCheck2(this,Parser);var _a,_b,_c,_d;this.lexer=lexer_js_1.lexer.reset(src);this.cardinalKeys=(_a=opt===null||opt===void 0?void 0:opt.cardinal)!==null&&_a!==void 0?_a:defaultPluralKeys;this.ordinalKeys=(_b=opt===null||opt===void 0?void 0:opt.ordinal)!==null&&_b!==void 0?_b:defaultPluralKeys;this.strict=(_c=opt===null||opt===void 0?void 0:opt.strict)!==null&&_c!==void 0?_c:false;this.strictPluralKeys=(_d=opt===null||opt===void 0?void 0:opt.strictPluralKeys)!==null&&_d!==void 0?_d:true;}return _createClass2(Parser,[{key:"parse",value:function parse(){return this.parseBody(false,true);}},{key:"checkSelectKey",value:function checkSelectKey(lt,type,key){if(key[0]==='='){if(type==='select'){throw new ParseError(lt,"The case ".concat(key," is not valid with select"));}}else if(type!=='select'){var keys=type==='plural'?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&keys.length>0&&!keys.includes(key)){var msg="The ".concat(type," case ").concat(key," is not valid in this locale");throw new ParseError(lt,msg);}}}},{key:"parseSelect",value:function parseSelect(_ref20,inPlural,ctx,type){var arg=_ref20.value;var sel={type:type,arg:arg,cases:[],ctx:ctx};if(type==='plural'||type==='selectordinal')inPlural=true;else if(this.strict)inPlural=false;var _iterator4=_createForOfIteratorHelper2(this.lexer),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var lt=_step4.value;switch(lt.type){case'offset':if(type==='select'){throw new ParseError(lt,'Unexpected plural offset for select');}if(sel.cases.length>0){throw new ParseError(lt,'Plural offset must be set before cases');}sel.pluralOffset=Number(lt.value);ctx.text+=lt.text;ctx.lineBreaks+=lt.lineBreaks;break;case'case':{this.checkSelectKey(lt,type,lt.value);sel.cases.push({key:lt.value,tokens:this.parseBody(inPlural),ctx:getContext(lt)});break;}case'end':return sel;default:throw new ParseError(lt,"Unexpected lexer token: ".concat(lt.type));}}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}throw new ParseError(null,'Unexpected message end');}},{key:"parseArgToken",value:function parseArgToken(lt,inPlural){var ctx=getContext(lt);var argType=this.lexer.next();if(!argType)throw new ParseError(null,'Unexpected message end');ctx.text+=argType.text;ctx.lineBreaks+=argType.lineBreaks;if(this.strict&&(argType.type==='func-simple'||argType.type==='func-args')&&!strictArgTypes.includes(argType.value)){var msg="Invalid strict mode function arg type: ".concat(argType.value);throw new ParseError(lt,msg);}switch(argType.type){case'end':return{type:'argument',arg:lt.value,ctx:ctx};case'func-simple':{var end=this.lexer.next();if(!end)throw new ParseError(null,'Unexpected message end');if(end.type!=='end'){throw new ParseError(end,"Unexpected lexer token: ".concat(end.type));}ctx.text+=end.text;if(isSelectType(argType.value.toLowerCase())){throw new ParseError(argType,"Invalid type identifier: ".concat(argType.value));}return{type:'function',arg:lt.value,key:argType.value,ctx:ctx};}case'func-args':{if(isSelectType(argType.value.toLowerCase())){var _msg="Invalid type identifier: ".concat(argType.value);throw new ParseError(argType,_msg);}var param=this.parseBody(this.strict?false:inPlural);if(this.strict&&param.length>0){param=strictArgStyleParam(lt,param);}return{type:'function',arg:lt.value,key:argType.value,param:param,ctx:ctx};}case'select':if(isSelectType(argType.value)){return this.parseSelect(lt,inPlural,ctx,argType.value);}else{throw new ParseError(argType,"Unexpected select type ".concat(argType.value));}default:throw new ParseError(argType,"Unexpected lexer token: ".concat(argType.type));}}},{key:"parseBody",value:function parseBody(inPlural,atRoot){var tokens=[];var content=null;var _iterator5=_createForOfIteratorHelper2(this.lexer),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var lt=_step5.value;if(lt.type==='argument'){if(content)content=null;tokens.push(this.parseArgToken(lt,inPlural));}else if(lt.type==='octothorpe'&&inPlural){if(content)content=null;tokens.push({type:'octothorpe',ctx:getContext(lt)});}else if(lt.type==='end'&&!atRoot){return tokens;}else{var value=lt.value;if(!inPlural&&lt.type==='quoted'&&value[0]==='#'){if(value.includes('{')){var errMsg="Unsupported escape pattern: ".concat(value);throw new ParseError(lt,errMsg);}value=lt.text;}if(content){content.value+=value;content.ctx.text+=lt.text;content.ctx.lineBreaks+=lt.lineBreaks;}else{content={type:'content',value:value,ctx:getContext(lt)};tokens.push(content);}}}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}if(atRoot)return tokens;throw new ParseError(null,'Unexpected message end');}}]);}();function parse(src){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var parser=new Parser(src,options);return parser.parse();}var DateFormatError=/*#__PURE__*/function(_Error7){function DateFormatError(msg,token,type){var _this29;_classCallCheck2(this,DateFormatError);_this29=_callSuper2(this,DateFormatError,[msg]);_this29.token=token;_this29.type=type||'error';return _this29;}_inherits2(DateFormatError,_Error7);return _createClass2(DateFormatError);}(/*#__PURE__*/_wrapNativeSuper2(Error));var alpha=function alpha(width){return width<4?'short':width===4?'long':'narrow';};var numeric=function numeric(width){return width%2===0?'2-digit':'numeric';};function yearOptions(token,onError){switch(token["char"]){case'y':return{year:numeric(token.width)};case'r':return{calendar:'gregory',year:'numeric'};case'u':case'U':case'Y':default:onError("".concat(token.desc," is not supported; falling back to year:numeric"),DateFormatError.WARNING);return{year:'numeric'};}}function monthStyle(token,onError){switch(token.width){case 1:return'numeric';case 2:return'2-digit';case 3:return'short';case 4:return'long';case 5:return'narrow';default:onError("".concat(token.desc," is not supported with width ").concat(token.width));return undefined;}}function dayStyle(token,onError){var _char=token["char"],desc=token.desc,width=token.width;if(_char==='d'){return numeric(width);}else{onError("".concat(desc," is not supported"));return undefined;}}function weekdayStyle(token,onError){var _char2=token["char"],desc=token.desc,width=token.width;if((_char2==='c'||_char2==='e')&&width<3){var msg="Numeric value is not supported for ".concat(desc,"; falling back to weekday:short");onError(msg,DateFormatError.WARNING);}return alpha(width);}function hourOptions(token){var hour=numeric(token.width);var hourCycle;switch(token["char"]){case'h':hourCycle='h12';break;case'H':hourCycle='h23';break;case'k':hourCycle='h24';break;case'K':hourCycle='h11';break;}return hourCycle?{hour:hour,hourCycle:hourCycle}:{hour:hour};}function timeZoneNameStyle(token,onError){var _char3=token["char"],desc=token.desc,width=token.width;switch(_char3){case'v':case'z':return width===4?'long':'short';case'V':if(width===4)return'long';onError("".concat(desc," is not supported with width ").concat(width));return undefined;case'X':onError("".concat(desc," is not supported"));return undefined;}return'short';}function compileOptions(token,onError){switch(token.field){case'era':return{era:alpha(token.width)};case'year':return yearOptions(token,onError);case'month':return{month:monthStyle(token,onError)};case'day':return{day:dayStyle(token,onError)};case'weekday':return{weekday:weekdayStyle(token,onError)};case'period':return undefined;case'hour':return hourOptions(token);case'min':return{minute:numeric(token.width)};case'sec':return{second:numeric(token.width)};case'tz':return{timeZoneName:timeZoneNameStyle(token,onError)};case'quarter':case'week':case'sec-frac':case'ms':onError("".concat(token.desc," is not supported"));}return undefined;}function getDateFormatOptions(tokens,timeZone){var onError=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(error){throw error;};var options={timeZone:timeZone};var fields=[];var _iterator6=_createForOfIteratorHelper2(tokens),_step6;try{var _loop=function _loop(){var token=_step6.value;var error=token.error,field=token.field,str=token.str;if(error){var dte=new DateFormatError(error.message,token);dte.stack=error.stack;onError(dte);}if(str){var msg="Ignoring string part: ".concat(str);onError(new DateFormatError(msg,token,DateFormatError.WARNING));}if(field){if(fields.indexOf(field)===-1)fields.push(field);else onError(new DateFormatError("Duplicate ".concat(field," token"),token));}var opt=compileOptions(token,function(msg,isWarning){return onError(new DateFormatError(msg,token,isWarning));});if(opt)Object.assign(options,opt);};for(_iterator6.s();!(_step6=_iterator6.n()).done;){_loop();}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}return options;}var fields={G:{field:'era',desc:'Era'},y:{field:'year',desc:'Year'},Y:{field:'year',desc:'Year of "Week of Year"'},u:{field:'year',desc:'Extended year'},U:{field:'year',desc:'Cyclic year name'},r:{field:'year',desc:'Related Gregorian year'},Q:{field:'quarter',desc:'Quarter'},q:{field:'quarter',desc:'Stand-alone quarter'},M:{field:'month',desc:'Month in year'},L:{field:'month',desc:'Stand-alone month in year'},w:{field:'week',desc:'Week of year'},W:{field:'week',desc:'Week of month'},d:{field:'day',desc:'Day in month'},D:{field:'day',desc:'Day of year'},F:{field:'day',desc:'Day of week in month'},g:{field:'day',desc:'Modified julian day'},E:{field:'weekday',desc:'Day of week'},e:{field:'weekday',desc:'Local day of week'},c:{field:'weekday',desc:'Stand-alone local day of week'},a:{field:'period',desc:'AM/PM marker'},b:{field:'period',desc:'AM/PM/noon/midnight marker'},B:{field:'period',desc:'Flexible day period'},h:{field:'hour',desc:'Hour in AM/PM (1~12)'},H:{field:'hour',desc:'Hour in day (0~23)'},k:{field:'hour',desc:'Hour in day (1~24)'},K:{field:'hour',desc:'Hour in AM/PM (0~11)'},j:{field:'hour',desc:'Hour in preferred cycle'},J:{field:'hour',desc:'Hour in preferred cycle without marker'},C:{field:'hour',desc:'Hour in preferred cycle with flexible marker'},m:{field:'min',desc:'Minute in hour'},s:{field:'sec',desc:'Second in minute'},S:{field:'sec-frac',desc:'Fractional second'},A:{field:'ms',desc:'Milliseconds in day'},z:{field:'tz',desc:'Time Zone: specific non-location'},Z:{field:'tz',desc:'Time Zone'},O:{field:'tz',desc:'Time Zone: localized'},v:{field:'tz',desc:'Time Zone: generic non-location'},V:{field:'tz',desc:'Time Zone: ID'},X:{field:'tz',desc:'Time Zone: ISO8601 with Z'},x:{field:'tz',desc:'Time Zone: ISO8601'}};var isLetter=function isLetter(_char4){return _char4>='A'&&_char4<='Z'||_char4>='a'&&_char4<='z';};function readFieldToken(src,pos){var _char5=src[pos];var width=1;while(src[++pos]===_char5)++width;var field=fields[_char5];if(!field){var msg="The letter ".concat(_char5," is not a valid field identifier");return{"char":_char5,error:new Error(msg),width:width};}return{"char":_char5,field:field.field,desc:field.desc,width:width};}function readQuotedToken(src,pos){var str=src[++pos];var width=2;if(str==="'")return{"char":"'",str:str,width:width};while(true){var next=src[++pos];++width;if(next===undefined){var msg="Unterminated quoted literal in pattern: ".concat(str||src);return{"char":"'",error:new Error(msg),str:str,width:width};}else if(next==="'"){if(src[++pos]!=="'")return{"char":"'",str:str,width:width};else++width;}str+=next;}}function readToken(src,pos){var _char6=src[pos];if(!_char6)return null;if(isLetter(_char6))return readFieldToken(src,pos);if(_char6==="'")return readQuotedToken(src,pos);var str=_char6;var width=1;while(true){var next=src[++pos];if(!next||isLetter(next)||next==="'")return{"char":_char6,str:str,width:width};str+=next;width+=1;}}function parseDateTokens(src){var tokens=[];var pos=0;while(true){var token=readToken(src,pos);if(!token)return tokens;tokens.push(token);pos+=token.width;}}function processTokens(tokens,mapText){if(!tokens.filter(function(token){return token.type!=="content";}).length){return tokens.map(function(token){return mapText(token.value);});}return tokens.map(function(token){if(token.type==="content"){return mapText(token.value);}else if(token.type==="octothorpe"){return"#";}else if(token.type==="argument"){return[token.arg];}else if(token.type==="function"){var _token$param;var _param=token===null||token===void 0||(_token$param=token.param)===null||_token$param===void 0?void 0:_token$param[0];if(token.key==="date"&&_param){var opts=compileDateExpression(_param.value.trim(),function(e){throw new Error("Unable to compile date expression: ".concat(e.message));});return[token.arg,token.key,opts];}if(_param){return[token.arg,token.key,_param.value.trim()];}else{return[token.arg,token.key];}}var offset=token.pluralOffset;var formatProps={};token.cases.forEach(function(_ref21){var key=_ref21.key,tokens2=_ref21.tokens;var prop=key[0]==="="?key.slice(1):key;formatProps[prop]=processTokens(tokens2,mapText);});return[token.arg,token.type,_objectSpread({offset:offset},formatProps)];});}function compileDateExpression(format,onError){if(/^::/.test(format)){var tokens=parseDateTokens(format.substring(2));return getDateFormatOptions(tokens,void 0,onError);}return format;}function compileMessageOrThrow(message){var mapText=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(v){return v;};return processTokens(parse_1(message),mapText);}function compileMessage(message){var mapText=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(v){return v;};try{return compileMessageOrThrow(message,mapText);}catch(e){console.error("".concat(e.message," \n\nMessage: ").concat(message));return[message];}}var isString=function isString(s){return typeof s==="string";};var isFunction$1=function isFunction$1(f){return typeof f==="function";};var cache$1=/* @__PURE__ */new Map();var defaultLocale="en";function normalizeLocales(locales){var out=Array.isArray(locales)?locales:[locales];return[].concat(_toConsumableArray2(out),[defaultLocale]);}function _date(locales,value,format){var _locales=normalizeLocales(locales);if(!format){format="default";}var o;if(typeof format==="string"){o={day:"numeric",month:"short",year:"numeric"};switch(format){case"full":o.weekday="long";case"long":o.month="long";break;case"short":o.month="numeric";break;}}else{o=format;}var formatter=getMemoized(function(){return cacheKey("date",_locales,format);},function(){return new Intl.DateTimeFormat(_locales,o);});return formatter.format(isString(value)?new Date(value):value);}function _time(locales,value,format){var o;if(!format){format="default";}if(typeof format==="string"){o={second:"numeric",minute:"numeric",hour:"numeric"};switch(format){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second;}}else{o=format;}return _date(locales,value,o);}function _number(locales,value,format){var _locales=normalizeLocales(locales);var formatter=getMemoized(function(){return cacheKey("number",_locales,format);},function(){return new Intl.NumberFormat(_locales,format);});return formatter.format(value);}function _plural(locales,ordinal,value,_ref22){var _ref23,_rules$value;var _ref22$offset=_ref22.offset,offset=_ref22$offset===void 0?0:_ref22$offset,rules=_objectWithoutProperties(_ref22,_excluded);var _locales=normalizeLocales(locales);var plurals=ordinal?getMemoized(function(){return cacheKey("plural-ordinal",_locales);},function(){return new Intl.PluralRules(_locales,{type:"ordinal"});}):getMemoized(function(){return cacheKey("plural-cardinal",_locales);},function(){return new Intl.PluralRules(_locales,{type:"cardinal"});});return(_ref23=(_rules$value=rules[value])!==null&&_rules$value!==void 0?_rules$value:rules[plurals.select(value-offset)])!==null&&_ref23!==void 0?_ref23:rules.other;}function getMemoized(getKey,construct){var key=getKey();var formatter=cache$1.get(key);if(!formatter){formatter=construct();cache$1.set(key,formatter);}return formatter;}function cacheKey(type,locales,options){var localeKey=locales.join("-");return"".concat(type,"-").concat(localeKey,"-").concat(JSON.stringify(options));}var ESCAPE_SEQUENCE_REGEX=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;var decodeEscapeSequences=function decodeEscapeSequences(str){return str.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,function(_,unicode,hex){if(unicode){var codePoint=parseInt(unicode,16);return String.fromCharCode(codePoint);}else{var _codePoint=parseInt(hex,16);return String.fromCharCode(_codePoint);}});};var OCTOTHORPE_PH="%__lingui_octothorpe__%";var getDefaultFormats=function getDefaultFormats(locale,passedLocales){var formats=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var locales=passedLocales||locale;var style=function style(format){if(_typeof2(format)==="object")return format;return formats[format];};var replaceOctothorpe=function replaceOctothorpe(value,message){var numberFormat=Object.keys(formats).length?style("number"):void 0;var valueStr=_number(locales,value,numberFormat);return message.replace(new RegExp(OCTOTHORPE_PH,"g"),valueStr);};return{plural:function plural(value,cases){var _cases$offset=cases.offset,offset=_cases$offset===void 0?0:_cases$offset;var message=_plural(locales,false,value,cases);return replaceOctothorpe(value-offset,message);},selectordinal:function selectordinal(value,cases){var _cases$offset2=cases.offset,offset=_cases$offset2===void 0?0:_cases$offset2;var message=_plural(locales,true,value,cases);return replaceOctothorpe(value-offset,message);},select:selectFormatter,number:function number(value,format){return _number(locales,value,style(format)||{style:format});},date:function date(value,format){return _date(locales,value,style(format)||format);},time:function time(value,format){return _time(locales,value,style(format)||format);}};};var selectFormatter=function selectFormatter(value,rules){var _rules$value2;return(_rules$value2=rules[value])!==null&&_rules$value2!==void 0?_rules$value2:rules.other;};function interpolate(translation,locale,locales){return function(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var formats=arguments.length>1?arguments[1]:undefined;var formatters=getDefaultFormats(locale,locales,formats);var _formatMessage=function formatMessage(tokens){var replaceOctothorpe=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!Array.isArray(tokens))return tokens;return tokens.reduce(function(message,token){if(token==="#"&&replaceOctothorpe){return message+OCTOTHORPE_PH;}if(isString(token)){return message+token;}var _token=_slicedToArray2(token,3),name=_token[0],type=_token[1],format=_token[2];var interpolatedFormat={};if(type==="plural"||type==="selectordinal"||type==="select"){Object.entries(format).forEach(function(_ref24){var _ref25=_slicedToArray2(_ref24,2),key=_ref25[0],value2=_ref25[1];interpolatedFormat[key]=_formatMessage(value2,type==="plural"||type==="selectordinal");});}else{interpolatedFormat=format;}var value;if(type){var formatter=formatters[type];value=formatter(values[name],interpolatedFormat);}else{value=values[name];}if(value==null){return message;}return message+value;},"");};var result=_formatMessage(translation);if(isString(result)&&ESCAPE_SEQUENCE_REGEX.test(result)){return decodeEscapeSequences(result);}if(isString(result))return result;return result?String(result):"";};}var __defProp$1=Object.defineProperty;var __defNormalProp$1=function __defNormalProp$1(obj,key,value){return key in obj?__defProp$1(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value;};var __publicField$1=function __publicField$1(obj,key,value){__defNormalProp$1(obj,key+"",value);return value;};var EventEmitter=/*#__PURE__*/function(){function EventEmitter(){_classCallCheck2(this,EventEmitter);__publicField$1(this,"_events",{});}return _createClass2(EventEmitter,[{key:"on",value:function on(event,listener){var _a$event,_this30=this;var _a;(_a$event=(_a=this._events)[event])!==null&&_a$event!==void 0?_a$event:_a[event]=[];this._events[event].push(listener);return function(){return _this30.removeListener(event,listener);};}},{key:"removeListener",value:function removeListener(event,listener){var maybeListeners=this._getListeners(event);if(!maybeListeners)return;var index=maybeListeners.indexOf(listener);if(~index)maybeListeners.splice(index,1);}},{key:"emit",value:function emit(event){var _this31=this;for(var _len6=arguments.length,args=new Array(_len6>1?_len6-1:0),_key6=1;_key6<_len6;_key6++){args[_key6-1]=arguments[_key6];}var maybeListeners=this._getListeners(event);if(!maybeListeners)return;maybeListeners.map(function(listener){return listener.apply(_this31,args);});}},{key:"_getListeners",value:function _getListeners(event){var maybeListeners=this._events[event];return Array.isArray(maybeListeners)?maybeListeners:false;}}]);}();var __defProp=Object.defineProperty;var __defNormalProp=function __defNormalProp(obj,key,value){return key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value;};var __publicField=function __publicField(obj,key,value){__defNormalProp(obj,_typeof2(key)!=="symbol"?key+"":key,value);return value;};var I18n=/*#__PURE__*/function(_EventEmitter){function I18n(params){var _this32;_classCallCheck2(this,I18n);_this32=_callSuper2(this,I18n);__publicField(_this32,"_locale","");__publicField(_this32,"_locales");__publicField(_this32,"_localeData",{});__publicField(_this32,"_messages",{});__publicField(_this32,"_missing");__publicField(_this32,"_messageCompiler");__publicField(_this32,"t",_this32._.bind(_this32));if(params.missing!=null)_this32._missing=params.missing;if(params.messages!=null)_this32.load(params.messages);if(params.localeData!=null)_this32.loadLocaleData(params.localeData);if(typeof params.locale==="string"||params.locales){var _params$locale;_this32.activate((_params$locale=params.locale)!==null&&_params$locale!==void 0?_params$locale:defaultLocale,params.locales);}return _this32;}_inherits2(I18n,_EventEmitter);return _createClass2(I18n,[{key:"locale",get:function get(){return this._locale;}},{key:"locales",get:function get(){return this._locales;}},{key:"messages",get:function get(){var _this$_messages$this$;return(_this$_messages$this$=this._messages[this._locale])!==null&&_this$_messages$this$!==void 0?_this$_messages$this$:{};}},{key:"localeData",get:function get(){var _this$_localeData$thi;return(_this$_localeData$thi=this._localeData[this._locale])!==null&&_this$_localeData$thi!==void 0?_this$_localeData$thi:{};}},{key:"_loadLocaleData",value:function _loadLocaleData(locale,localeData){var maybeLocaleData=this._localeData[locale];if(!maybeLocaleData){this._localeData[locale]=localeData;}else{Object.assign(maybeLocaleData,localeData);}}},{key:"setMessagesCompiler",value:function setMessagesCompiler(compiler){this._messageCompiler=compiler;return this;}},{key:"loadLocaleData",value:function loadLocaleData(localeOrAllData,localeData){var _this33=this;if(typeof localeOrAllData==="string"){this._loadLocaleData(localeOrAllData,localeData);}else{Object.keys(localeOrAllData).forEach(function(locale){return _this33._loadLocaleData(locale,localeOrAllData[locale]);});}this.emit("change");}},{key:"_load",value:function _load(locale,messages){var maybeMessages=this._messages[locale];if(!maybeMessages){this._messages[locale]=messages;}else{Object.assign(maybeMessages,messages);}}},{key:"load",value:function load(localeOrMessages,messages){var _this34=this;if(typeof localeOrMessages=="string"&&_typeof2(messages)==="object"){this._load(localeOrMessages,messages);}else{Object.entries(localeOrMessages).forEach(function(_ref26){var _ref27=_slicedToArray2(_ref26,2),locale=_ref27[0],messages2=_ref27[1];return _this34._load(locale,messages2);});}this.emit("change");}},{key:"loadAndActivate",value:function loadAndActivate(_ref28){var locale=_ref28.locale,locales=_ref28.locales,messages=_ref28.messages;this._locale=locale;this._locales=locales||void 0;this._messages[this._locale]=messages;this.emit("change");}},{key:"activate",value:function activate(locale,locales){this._locale=locale;this._locales=locales;this.emit("change");}},{key:"_",value:function _(id,values,options){if(!this.locale){throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");}var message=options===null||options===void 0?void 0:options.message;if(!id){id="";}if(!isString(id)){values=id.values||values;message=id.message;id=id.id;}var messageForId=this.messages[id];var messageMissing=messageForId===void 0;var missing=this._missing;if(missing&&messageMissing){return isFunction$1(missing)?missing(this._locale,id):missing;}if(messageMissing){this.emit("missing",{id:id,locale:this._locale});}var translation=messageForId||message||id;if(isString(translation)){if(this._messageCompiler){translation=this._messageCompiler(translation);}else{console.warn("Uncompiled message detected! Message:\n\n> ".concat(translation,"\n\nThat means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.\nICU features such as interpolation and plurals will not work properly for that message. \n\nPlease compile your catalog first. \n"));}}if(isString(translation)&&ESCAPE_SEQUENCE_REGEX.test(translation))return decodeEscapeSequences(translation);if(isString(translation))return translation;return interpolate(translation,this._locale,this._locales)(values,options===null||options===void 0?void 0:options.formats);}},{key:"date",value:function date(value,format){return _date(this._locales||this._locale,value,format);}},{key:"number",value:function number(value,format){return _number(this._locales||this._locale,value,format);}}]);}(EventEmitter);function setupI18n(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new I18n(params);}setupI18n();var tagRe=/<([a-zA-Z0-9]+)>([\s\S]*?)<\/\1>|<([a-zA-Z0-9]+)\/>/;var voidElementTags={area:true,base:true,br:true,col:true,embed:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true};function formatElements(value){var elements=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var uniqueId=makeCounter(0,"$lingui$");var parts=value.split(tagRe);if(parts.length===1)return value;var tree=[];var before=parts.shift();if(before)tree.push(before);var _iterator7=_createForOfIteratorHelper2(getElements(parts)),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray2(_step7.value,3),index=_step7$value[0],children=_step7$value[1],after=_step7$value[2];var element=typeof index!=="undefined"?elements[index]:void 0;if(!element||voidElementTags[element.type]&&children){if(!element){console.error("Can't use element at index '".concat(index,"' as it is not declared in the original translation"));}else{console.error("".concat(element.type," is a void element tag therefore it must have no children"));}element=wn.createElement(wn.Fragment);}if(Array.isArray(element)){element=wn.createElement(wn.Fragment,{},element);}tree.push(wn.cloneElement(element,{key:uniqueId()},children?formatElements(children,elements):element.props.children));if(after)tree.push(after);}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}return tree.length===1?tree[0]:tree;}function getElements(parts){if(!parts.length)return[];var _parts$slice=parts.slice(0,4),_parts$slice2=_slicedToArray2(_parts$slice,4),paired=_parts$slice2[0],children=_parts$slice2[1],unpaired=_parts$slice2[2],after=_parts$slice2[3];var triple=[paired||unpaired,children||"",after];return[triple].concat(getElements(parts.slice(4,parts.length)));}var makeCounter=function makeCounter(){var count=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var prefix=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return function(){return"".concat(prefix,"_").concat(count++);};};function TransNoContext(props){var render=props.render,component=props.component,id=props.id,message=props.message,formats=props.formats,_props$lingui=props.lingui,i18n=_props$lingui.i18n,defaultComponent=_props$lingui.defaultComponent;var values=_objectSpread({},props.values);var components=_objectSpread({},props.components);if(values){Object.keys(values).forEach(function(key){var index=Object.keys(components).length;if(typeof values[key]==="string"||typeof values[key]==="number"){return;}components[index]=/* @__PURE__ */wn.createElement(wn.Fragment,null,values[key]);values[key]="<".concat(index,"/>");});}var _translation=i18n&&typeof i18n._==="function"?i18n._(id,values,{message:message,formats:formats}):id;var translation=_translation?formatElements(_translation,components):null;if(render===null||component===null){return translation;}var FallbackComponent=defaultComponent||RenderFragment;var i18nProps={id:id,message:message,translation:translation,children:translation};if(render&&component){console.error("You can't use both `component` and `render` prop at the same time. `component` is ignored.");}else if(render&&typeof render!=="function"){console.error("Invalid value supplied to prop `render`. It must be a function, provided ".concat(render));}else if(component&&typeof component!=="function"){console.error("Invalid value supplied to prop `component`. It must be a React component, provided ".concat(component));return wn.createElement(FallbackComponent,i18nProps,translation);}if(typeof render==="function"){return render(i18nProps);}var Component=component||FallbackComponent;return wn.createElement(Component,i18nProps,translation);}var RenderFragment=function RenderFragment(_ref29){var children=_ref29.children;return/* @__PURE__ */wn.createElement(wn.Fragment,null,children);};var LinguiContext=wn.createContext(null);var useLinguiInternal=function useLinguiInternal(devErrorMessage){var context=wn.useContext(LinguiContext);return context;};function useLingui(){return useLinguiInternal();}function I18nProvider(_ref30){var i18n=_ref30.i18n,defaultComponent=_ref30.defaultComponent,children=_ref30.children;var latestKnownLocale=wn.useRef(i18n.locale);var makeContext=wn.useCallback(function(){return{i18n:i18n,defaultComponent:defaultComponent,_:i18n.t.bind(i18n)};},[i18n,defaultComponent]);var _wn$useState=wn.useState(makeContext()),_wn$useState2=_slicedToArray2(_wn$useState,2),context=_wn$useState2[0],setContext=_wn$useState2[1];wn.useEffect(function(){var updateContext=function updateContext(){latestKnownLocale.current=i18n.locale;setContext(makeContext());};var unsubscribe=i18n.on("change",updateContext);if(latestKnownLocale.current!==i18n.locale){updateContext();}return unsubscribe;},[i18n,makeContext]);if(!latestKnownLocale.current){return null;}return/* @__PURE__ */wn.createElement(LinguiContext.Provider,{value:context},children);}function Trans(props){var lingui=useLinguiInternal();return wn.createElement(TransNoContext,_objectSpread(_objectSpread({},props),{},{lingui:lingui}));}var I18nProviderWrapper=function I18nProviderWrapper(_ref31){var children=_ref31.children,messages=_ref31.messages,overrides=_ref31.overrides;var mergedMessages=F$4(function(){return Object.assign(Object.assign({},messages),overrides);},[messages,overrides]);var _h$=h$5(function(){var instance=setupI18n({locale:'en',messages:{en:mergedMessages}});instance.setMessagesCompiler(compileMessage);return instance;}),_h$2=_slicedToArray2(_h$,1),i18n=_h$2[0];p$5(function(){i18n.load({en:mergedMessages});},[i18n,mergedMessages]);return/*#__PURE__*/wn.createElement(I18nProvider,{i18n:i18n},children);};var SHADOW_DOM_ONE_TAP_MOUNT_POINT="<div data-prompt_parent_id='g_id_onload' id='google-parent-prompt' style=''></div>";function CreateWebComponent(ReactComponent,webComponentName){var existingRegistry=customElements.get(webComponentName);if(existingRegistry){return existingRegistry;}var ReactWebComponent=/*#__PURE__*/function(_HTMLElement){function ReactWebComponent(props){var _this35;_classCallCheck2(this,ReactWebComponent);_this35=_callSuper2(this,ReactWebComponent);_this35.props=props;_this35.rootRef=document.createElement('div');_this35.append(_this35.rootRef);return _this35;}_inherits2(ReactWebComponent,_HTMLElement);return _createClass2(ReactWebComponent,[{key:"connectedCallback",value:function connectedCallback(){this.styleSlot=document.createElement('section');this.rootRef.appendChild(this.styleSlot);this.mountPoint=document.createElement('span');this.styleSlot.appendChild(this.mountPoint);this.render(this.props);}},{key:"disconnectedCallback",value:function disconnectedCallback(){if(!this.mountPoint){return;}wn.unmountComponentAtNode(this.mountPoint);}},{key:"render",value:function render(props){if(!this.mountPoint){throw Error('Cannot render - no mount point defined');}if(!this.styleSlot){throw Error('Cannot render - no style slot defined');}wn.render(/*#__PURE__*/wn.createElement(ye$1,{target:this.styleSlot},/*#__PURE__*/wn.createElement(ReactComponent,Object.assign({},props))),this.mountPoint);}}]);}(/*#__PURE__*/_wrapNativeSuper2(HTMLElement));customElements.define(webComponentName,ReactWebComponent);return ReactWebComponent;}function CreateShadowWebComponent(ReactComponent,webComponentName){var existingRegistry=customElements.get(webComponentName);if(existingRegistry){return existingRegistry;}var ReactWebComponent=/*#__PURE__*/function(_HTMLElement2){function ReactWebComponent(props){var _this36;_classCallCheck2(this,ReactWebComponent);_this36=_callSuper2(this,ReactWebComponent);_this36.props=props;_this36.rootRef=_this36.attachShadow({mode:'open'});return _this36;}_inherits2(ReactWebComponent,_HTMLElement2);return _createClass2(ReactWebComponent,[{key:"connectedCallback",value:function connectedCallback(){this.styleSlot=document.createElement('section');this.rootRef.appendChild(this.styleSlot);this.mountPoint=document.createElement('span');this.styleSlot.appendChild(this.mountPoint);this.render(this.props);}},{key:"disconnectedCallback",value:function disconnectedCallback(){if(!this.mountPoint){return;}wn.unmountComponentAtNode(this.mountPoint);}},{key:"renderOneTap",value:function renderOneTap(props){var _a,_b,_c;var shouldContainOneTap=(_c=(_b=(_a=props===null||props===void 0?void 0:props.config)===null||_a===void 0?void 0:_a.oauthOptions)===null||_b===void 0?void 0:_b.providers)===null||_c===void 0?void 0:_c.find(function(config){return config.type===OAuthProviders.Google&&config.one_tap;});var containsOneTap=this.innerHTML.includes(SHADOW_DOM_ONE_TAP_MOUNT_POINT);if(shouldContainOneTap){if(!containsOneTap){this.innerHTML=SHADOW_DOM_ONE_TAP_MOUNT_POINT;}}else{this.innerHTML='';}}},{key:"render",value:function render(props){if(!this.mountPoint){throw Error('Cannot render - no mount point defined');}if(!this.styleSlot){throw Error('Cannot render - no style slot defined');}this.renderOneTap(props);wn.render(/*#__PURE__*/wn.createElement(ye$1,{target:this.styleSlot},/*#__PURE__*/wn.createElement(ReactComponent,Object.assign({},props))),this.mountPoint);}}]);}(/*#__PURE__*/_wrapNativeSuper2(HTMLElement));customElements.define(webComponentName,ReactWebComponent);return ReactWebComponent;}function CreateSSRSafeWebComponent(ReactComponent,webComponentName){if(typeof window==='undefined'){return function(){return null;};}return function(props){var _a;var shadowDomEnabled=!!((_a=props.config)===null||_a===void 0?void 0:_a.enableShadowDOM);if(shadowDomEnabled){var Component=CreateShadowWebComponent(ReactComponent,webComponentName);return new Component(props);}else{var _Component=CreateWebComponent(ReactComponent,webComponentName);return new _Component(props);}};}var useIsomorphicLayoutEffect=typeof window!=='undefined'?y$2:p$5;var useEvent=function useEvent(fn){var handlerRef=_$2(fn);useIsomorphicLayoutEffect(function(){handlerRef.current=fn;},[fn]);return T$3(function(){var fn=handlerRef.current;return fn.apply(void 0,arguments);},[]);};var reducer=function reducer(state,action){switch(action.type){case'transition':return Object.assign(Object.assign({},state),{screen:action.screen});case'set_magic_link_email':{return Object.assign(Object.assign({},state),{formState:Object.assign(Object.assign({},state.formState),{magicLinkState:{email:action.email}})});}case'update_otp_state':{return Object.assign(Object.assign({},state),{formState:Object.assign(Object.assign({},state.formState),{otpState:action.otpState})});}case'update_crypto_state':{return Object.assign(Object.assign({},state),{formState:Object.assign(Object.assign({},state.formState),{cryptoState:action.cryptoState})});}case'update_password_state':{return Object.assign(Object.assign({},state),{formState:Object.assign(Object.assign({},state.formState),{passwordState:action.passwordState})});}default:throw new Error();}};var AppScreens$1;(function(AppScreens){AppScreens["Main"]="Main";AppScreens["PasskeyRegistrationStart"]="Register New Passkey";AppScreens["PasskeyRegistrationSuccess"]="Passkey Registration Success";AppScreens["PasskeyConfirmation"]="Passkey Confirmation";AppScreens["PasswordCreateOrLogin"]="Password";AppScreens["PasswordResetForm"]="Password Reset Form";AppScreens["PasswordForgot"]="Password Forgot";AppScreens["PasswordBreached"]="Password Breached";AppScreens["PasswordSetNew"]="Password Set New";AppScreens["PasswordDedupe"]="Password Dedupe";AppScreens["PasswordConfirmation"]="Password Confirmation";AppScreens["EmailConfirmation"]="Email Confirmation";AppScreens["OTPAuthenticate"]="OTP Authenticate";AppScreens["OTPConfirmation"]="OTP Confirmation";AppScreens["CryptoConnect"]="Crypto Connect";AppScreens["CryptoSignMessage"]="Crypto Sign Message";AppScreens["CryptoOtherScreen"]="Crypto Other Screen";AppScreens["CryptoSetupWallet"]="Crypto Setup Wallet";AppScreens["CryptoError"]="Crypto Error";AppScreens["CryptoConfirmation"]="Crypto Confirmation";AppScreens["IDPConsent"]="IDP Consent";})(AppScreens$1||(AppScreens$1={}));var DEFAULT_STATE={screen:AppScreens$1.Main,formState:{magicLinkState:{email:''},otpState:{type:OTPMethods.Email,methodId:'',otpDestination:''},cryptoState:{walletAddress:'',walletOption:Wallets.Metamask,walletChallenge:''},passwordState:{email:'',type:'new'},resetPasswordState:{token:''},errorDescriptor:undefined}};var DEFAULT_CONFIG={products:[Products.emailMagicLinks],emailMagicLinksOptions:{loginRedirectURL:'',loginExpirationMinutes:30,signupRedirectURL:'',signupExpirationMinutes:30,createUserAsPending:false}};var DEFAULT_STYLE_CONFIG={container:{backgroundColor:'#FFFFFF',borderColor:'#ADBCC5',borderRadius:'8px',width:'400px'},colors:{primary:'#19303D',secondary:'#5C727D',success:'#0C5A56',warning:'#FFD94A',error:'#8B1214',accent:'#ECFAFF'},buttons:{primary:{backgroundColor:'#19303D',textColor:'#FFFFFF',borderColor:'#19303D',borderRadius:'4px'},secondary:{backgroundColor:'#FFFFFF',textColor:'#19303D',borderColor:'#19303D',borderRadius:'4px'},disabled:{backgroundColor:'#F3F5F6',textColor:'#8296A1',borderColor:'#F3F5F6',borderRadius:'4px'}},fontFamily:'Arial, Helvetica, sans-serif',hideHeaderText:false,logo:{logoImageUrl:''}};var GlobalContext=/*#__PURE__*/wn.createContext({client:{},config:DEFAULT_CONFIG,state:[DEFAULT_STATE,function(){return null;}]});var GlobalContextProvider=function GlobalContextProvider(_ref32){var children=_ref32.children,client=_ref32.client,config=_ref32.config,callbacks=_ref32.callbacks,initialState=_ref32.initialState;var state=wn.useReducer(reducer,initialState!==null&&initialState!==void 0?initialState:DEFAULT_STATE);return/*#__PURE__*/wn.createElement(GlobalContext.Provider,{value:{client:client,state:state,config:config,callbacks:callbacks}},children);};var noop$1=function noop$1(){};var useGlobalContext=function useGlobalContext(){return q$4(GlobalContext);};var useStytch=function useStytch(){return useGlobalContext().client;};var useGlobalReducer=function useGlobalReducer(){return useGlobalContext().state;};var useConfig=function useConfig(){return useGlobalContext().config;};var useErrorCallback=function useErrorCallback(){var _a,_b;return useEvent((_b=(_a=useGlobalContext().callbacks)===null||_a===void 0?void 0:_a.onError)!==null&&_b!==void 0?_b:noop$1);};var useEventCallback=function useEventCallback(){var _a,_b;return useEvent((_b=(_a=useGlobalContext().callbacks)===null||_a===void 0?void 0:_a.onEvent)!==null&&_b!==void 0?_b:noop$1);};var nanoid=function nanoid(){var size=arguments.length>0&&arguments[0]!==undefined?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(size)).reduce(function(id,_byte){_byte&=63;if(_byte<36){id+=_byte.toString(36);}else if(_byte<62){id+=(_byte-26).toString(36).toUpperCase();}else if(_byte>62){id+='-';}else{id+='_';}return id;},'');};var useUniqueId=function useUniqueId(){var prefix=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'s';var id=_$2(nanoid());return prefix+id.current;};function useErrorProps(error){var errorId=useUniqueId();if(!error){return{error:{id:errorId},input:{}};}else{return{error:{id:errorId},input:{'aria-errormessage':errorId,'aria-invalid':true}};}}var focusedRing=Ce(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n outline: 2px auto -webkit-focus-ring-color;\n outline: 2px auto Highlight;\n outline-offset: 2px;\n"])));var BaseButton=He.button(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n all: unset;\n\n cursor: pointer;\n font-family: ",";\n\n &:focus-visible {\n ","\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n"])),function(props){return props.theme.typography.fontFamily;},focusedRing);var Button=He(BaseButton)(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n width: 100%;\n height: 45px;\n font-size: 18px;\n text-transform: none;\n box-shadow: none;\n text-align: center;\n\n ","\n\n &:disabled {\n background-color: ",";\n color: ",";\n border: ",";\n border-radius: ",";\n }\n"])),function(props){switch(props.variant){case'primary':return"\n border: ".concat(props.theme.buttons.primary.border,";\n border-radius: ").concat(props.theme.buttons.primary.borderRadius,";\n color: ").concat(props.theme.buttons.primary.textColor,";\n background-color: ").concat(props.theme.buttons.primary.backgroundColor,";\n ");case'outlined':return"\n border: ".concat(props.theme.buttons.secondary.border,";\n border-radius: ").concat(props.theme.buttons.secondary.borderRadius,";\n color: ").concat(props.theme.buttons.secondary.textColor,";\n background-color: ").concat(props.theme.buttons.secondary.backgroundColor,";\n ");case'text':return"\n color: ".concat(props.theme.colors.primary,";\n background-color: transparent;\n font-weight: 600;\n ");}},function(props){return props.theme.buttons.disabled.backgroundColor;},function(props){return props.theme.buttons.disabled.textColor;},function(props){return props.theme.buttons.disabled.border;},function(props){return props.theme.buttons.disabled.borderRadius;});Button.defaultProps={variant:'primary'};var itemOrNone=function itemOrNone(item){return item!==null&&item!==void 0?item:undefined;};var spaceOrNone=function spaceOrNone(space){return space?"".concat(space,"px"):undefined;};var Flex=He.div(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n display: ",";\n\n flex-direction: ",";\n justify-content: ",";\n align-items: ",";\n flex-grow: ",";\n flex-shrink: ",";\n order: ",";\n align-self: ",";\n flex-flow: ",";\n flex-wrap: ",";\n\n width: ",";\n height: ",";\n max-width: ",";\n max-height: ",";\n min-width: ",";\n min-height: ",";\n padding: ",";\n margin: ",";\n margin-top: ",";\n margin-right: ",";\n margin-bottom: ",";\n margin-left: ",";\n padding-top: ",";\n padding-right: ",";\n padding-bottom: ",";\n padding-left: ",";\n\n gap: ",";\n"])),function(_ref33){var inline=_ref33.inline;return inline?'inline-flex':'flex';},function(_ref34){var direction=_ref34.direction;return itemOrNone(direction);},function(_ref35){var justifyContent=_ref35.justifyContent,center=_ref35.center;return center?'center':itemOrNone(justifyContent);},function(_ref36){var alignItems=_ref36.alignItems,center=_ref36.center;return center?'center':itemOrNone(alignItems);},function(_ref37){var grow=_ref37.grow;return itemOrNone(grow);},function(_ref38){var shrink=_ref38.shrink;return itemOrNone(shrink);},function(_ref39){var order=_ref39.order;return itemOrNone(order);},function(_ref40){var alignSelf=_ref40.alignSelf;return itemOrNone(alignSelf);},function(_ref41){var flow=_ref41.flow;return itemOrNone(flow);},function(_ref42){var wrap=_ref42.wrap;return itemOrNone(wrap);},function(_ref43){var width=_ref43.width;return typeof width==='string'?width:spaceOrNone(width);},function(_ref44){var height=_ref44.height;return typeof height==='string'?height:spaceOrNone(height);},function(_ref45){var maxWidth=_ref45.maxWidth;return typeof maxWidth==='string'?maxWidth:spaceOrNone(maxWidth);},function(_ref46){var maxHeight=_ref46.maxHeight;return typeof maxHeight==='string'?maxHeight:spaceOrNone(maxHeight);},function(_ref47){var minWidth=_ref47.minWidth;return typeof minWidth==='string'?minWidth:spaceOrNone(minWidth);},function(_ref48){var minHeight=_ref48.minHeight;return typeof minHeight==='string'?minHeight:spaceOrNone(minHeight);},function(_ref49){var padding=_ref49.padding;return spaceOrNone(padding);},function(_ref50){var margin=_ref50.margin;return spaceOrNone(margin);},function(_ref51){var marginTop=_ref51.marginTop;return spaceOrNone(marginTop);},function(_ref52){var marginRight=_ref52.marginRight;return spaceOrNone(marginRight);},function(_ref53){var marginBottom=_ref53.marginBottom;return spaceOrNone(marginBottom);},function(_ref54){var marginLeft=_ref54.marginLeft;return spaceOrNone(marginLeft);},function(_ref55){var paddingTop=_ref55.paddingTop;return spaceOrNone(paddingTop);},function(_ref56){var paddingRight=_ref56.paddingRight;return spaceOrNone(paddingRight);},function(_ref57){var paddingBottom=_ref57.paddingBottom;return spaceOrNone(paddingBottom);},function(_ref58){var paddingLeft=_ref58.paddingLeft;return spaceOrNone(paddingLeft);},function(_ref59){var gap=_ref59.gap;return spaceOrNone(gap);});var Text=He.div(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n color: ",";\n text-align: ",";\n ",";\n"])),function(props){return props.color&&props.theme.colors[props.color];},function(props){return props.align;},function(props){return props.size&&props.theme.typography[props.size];});Text.defaultProps={size:'body',color:'primary',align:'left'};var CreateIcon=function CreateIcon(IconSvgComponent){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{wrapped:true};var IconComponent=function IconComponent(){var component=/*#__PURE__*/wn.createElement(IconSvgComponent,null);return options.wrapped?(/*#__PURE__*/wn.createElement(Flex,{height:24,width:24},component)):component;};return IconComponent;};var GmailIconSvg=function GmailIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},/*#__PURE__*/wn.createElement("path",{fill:"#4caf50",d:"M45,16.2l-5,2.75l-5,4.75L35,40h7c1.657,0,3-1.343,3-3V16.2z"}),/*#__PURE__*/wn.createElement("path",{fill:"#1e88e5",d:"M3,16.2l3.614,1.71L13,23.7V40H6c-1.657,0-3-1.343-3-3V16.2z"}),/*#__PURE__*/wn.createElement("polygon",{fill:"#e53935",points:"35,11.2 24,19.45 13,11.2 12,17 13,23.7 24,31.95 35,23.7 36,17"}),/*#__PURE__*/wn.createElement("path",{fill:"#c62828",d:"M3,12.298V16.2l10,7.5V11.2L9.876,8.859C9.132,8.301,8.228,8,7.298,8h0C4.924,8,3,9.924,3,12.298z"}),/*#__PURE__*/wn.createElement("path",{fill:"#fbc02d",d:"M45,12.298V16.2l-10,7.5V11.2l3.124-2.341C38.868,8.301,39.772,8,40.702,8h0 C43.076,8,45,9.924,45,12.298z"}));};var GmailIcon=CreateIcon(GmailIconSvg);var OutlookIconSvg=function OutlookIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",viewBox:"0 0 103.17322 104.31332",xmlSpace:"preserve"},/*#__PURE__*/wn.createElement("defs",{id:"defs43"}),/*#__PURE__*/wn.createElement("path",{d:"m 64.566509,22.116383 v 20.404273 l 7.130526,4.489881 c 0.188058,0.05485 0.595516,0.05877 0.783574,0 L 103.16929,26.320259 c 0,-2.44867 -2.28412,-4.203876 -3.573094,-4.203876 H 64.566509 z",id:"path3",style:{fill:'#0072c6'}}),/*#__PURE__*/wn.createElement("path",{d:"m 64.566509,50.13308 6.507584,4.470291 c 0.916782,0.673874 2.021622,0 2.021622,0 -1.100922,0.673874 30.077495,-20.035993 30.077495,-20.035993 v 37.501863 c 0,4.082422 -2.61322,5.794531 -5.551621,5.794531 H 64.562591 V 50.13308 z",id:"path5",style:{fill:'#0072c6'}}),/*#__PURE__*/wn.createElement("g",{id:"g23",transform:"matrix(3.9178712,0,0,3.9178712,-13.481403,-41.384473)"},/*#__PURE__*/wn.createElement("path",{d:"m 11.321,20.958 c -0.566,0 -1.017,0.266 -1.35,0.797 -0.333,0.531 -0.5,1.234 -0.5,2.109 0,0.888 0.167,1.59 0.5,2.106 0.333,0.517 0.77,0.774 1.31,0.774 0.557,0 0.999,-0.251 1.325,-0.753 0.326,-0.502 0.49,-1.199 0.49,-2.09 0,-0.929 -0.158,-1.652 -0.475,-2.169 -0.317,-0.516 -0.75,-0.774 -1.3,-0.774 z",id:"path25",style:{fill:'#0072c6'}}),/*#__PURE__*/wn.createElement("path",{d:"m 3.441,13.563 v 20.375 l 15.5,3.25 V 10.563 l -15.5,3 z m 10.372,13.632 c -0.655,0.862 -1.509,1.294 -2.563,1.294 -1.027,0 -1.863,-0.418 -2.51,-1.253 C 8.094,26.4 7.77,25.312 7.77,23.97 c 0,-1.417 0.328,-2.563 0.985,-3.438 0.657,-0.875 1.527,-1.313 2.61,-1.313 1.023,0 1.851,0.418 2.482,1.256 0.632,0.838 0.948,1.942 0.948,3.313 10e-4,1.409 -0.327,2.545 -0.982,3.407 z",id:"path27",style:{fill:'#0072c6'}})));};var OutlookIcon=CreateIcon(OutlookIconSvg);var YahooIconSvg=function YahooIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("rect",{x:"2",y:"2",width:"20",height:"20",rx:"1",fill:"#671BDF"}),/*#__PURE__*/wn.createElement("path",{d:"M5 8.7284H7.71407L9.29444 12.7716L10.8953 8.7284H13.5379L9.55876 18.3H6.89942L7.98865 15.7637L5 8.7284Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M14.2 16.2028C15.108 16.2028 15.8441 15.4667 15.8441 14.5587C15.8441 13.6507 15.108 12.9146 14.2 12.9146C13.292 12.9146 12.5559 13.6507 12.5559 14.5587C12.5559 15.4667 13.292 16.2028 14.2 16.2028Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M16.3842 12.3106H13.4243L16.0512 6H19L16.3842 12.3106Z",fill:"white"}));};var YahooIcon$1=CreateIcon(YahooIconSvg);var emailProviderInfo={gmail:{messageDescriptor:{id:'link.openInGmail',message:"Open in Gmail"},icon:/*#__PURE__*/wn.createElement(GmailIcon,null),getUrl:function getUrl(emailDomain){var gmailQuery=encodeURIComponent(emailDomain?"from:@".concat(emailDomain," in:anywhere"):'in:anywhere');return"https://mail.google.com/mail/u/0/#search/".concat(gmailQuery);}},yahoo:{messageDescriptor:{id:'link.openInYahoo',message:"Open in Yahoo"},icon:/*#__PURE__*/wn.createElement(YahooIcon$1,null),getUrl:function getUrl(emailDomain){return!emailDomain?'https://mail.yahoo.com/d/search/referrer=unread':"https://mail.yahoo.com/d/search/keyword=".concat(emailDomain);}},outlook:{messageDescriptor:{id:'link.openInOutlook',message:"Open in Outlook"},icon:/*#__PURE__*/wn.createElement(OutlookIcon,null),getUrl:function getUrl(){return"https://outlook.office.com/mail/0/inbox";}}};var Link=He.a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n all: unset;\n\n cursor: pointer;\n\n &:hover,\n &:focus-visible {\n text-decoration: underline;\n text-decoration-color: ",";\n }\n"])),function(props){return props.theme.colors.primary;});var EmailProviderLink=function EmailProviderLink(_ref60){var _ref60$providerInfo=_ref60.providerInfo,icon=_ref60$providerInfo.icon,messageDescriptor=_ref60$providerInfo.messageDescriptor,getUrl=_ref60$providerInfo.getUrl,emailDomain=_ref60.emailDomain;var _useLingui=useLingui(),_t=_useLingui._;var href=getUrl(emailDomain);return/*#__PURE__*/wn.createElement(Flex,{gap:4},icon,/*#__PURE__*/wn.createElement(Link,{href:href,target:"_blank",rel:"noopener noreferrer"},/*#__PURE__*/wn.createElement(Text,null,_t(messageDescriptor))));};var EmailConfirmation$1=function EmailConfirmation$1(_ref61){var emailDomain=_ref61.emailDomain,reset=_ref61.reset,email=_ref61.email;var _useLingui2=useLingui(),_t=_useLingui2._;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'emailConfirmation.title',message:"Check your email"})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:12},/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"emailConfirmation.content",message:"An email was sent to <bold>{email}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(EmailProviderLink,{emailDomain:emailDomain,providerInfo:emailProviderInfo.gmail}),/*#__PURE__*/wn.createElement(EmailProviderLink,{emailDomain:emailDomain,providerInfo:emailProviderInfo.yahoo}),/*#__PURE__*/wn.createElement(EmailProviderLink,{emailDomain:emailDomain,providerInfo:emailProviderInfo.outlook}))),/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:reset},_t({id:'button.retry',message:"Try again"})));};var useEmailDomain=function useEmailDomain(){var _a,_b;var stytch=useStytch();var config=useConfig();var _h$3=h$5(function(){var _readB2CInternals$boo=readB2CInternals(stytch).bootstrap.getSync(),emailDomains=_readB2CInternals$boo.emailDomains;return emailDomains;}),_h$4=_slicedToArray2(_h$3,2),emailDomains=_h$4[0],setEmailDomains=_h$4[1];p$5(function(){readB2CInternals(stytch).bootstrap.getAsync().then(function(_ref62){var emailDomains=_ref62.emailDomains;setEmailDomains(emailDomains);});},[stytch]);if((_a=config.emailMagicLinksOptions)===null||_a===void 0?void 0:_a.domainHint){return(_b=config.emailMagicLinksOptions)===null||_b===void 0?void 0:_b.domainHint;}if((emailDomains===null||emailDomains===void 0?void 0:emailDomains.length)===1){return emailDomains[0];}return null;};var EmailConfirmation=function EmailConfirmation(){var stytchClient=useStytch();var _useGlobalReducer=useGlobalReducer(),_useGlobalReducer2=_slicedToArray2(_useGlobalReducer,2),state=_useGlobalReducer2[0],dispatch=_useGlobalReducer2[1];var emailDomain=useEmailDomain();var email=state.formState.magicLinkState.email!==''?state.formState.magicLinkState.email:state.formState.passwordState.email;var reset=function reset(){dispatch({type:'set_magic_link_email',email:''});dispatch({type:'transition',screen:AppScreens$1.Main});readB2CInternals(stytchClient).networkClient.logEvent({name:'email_try_again_clicked',details:{email:email,type:EmailSentType.LoginOrCreateEML}});};return/*#__PURE__*/wn.createElement(EmailConfirmation$1,{emailDomain:emailDomain,reset:reset,email:email});};var useMountEffect=function useMountEffect(effect){var effectRef=_$2(effect);p$5(function(){return effectRef.current();},[]);};var ConfirmationSVG=function ConfirmationSVG(){return/*#__PURE__*/y$3("svg",{width:"201",height:"200",viewBox:"0 0 201 200",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("g",{opacity:"0.1"},/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.5 0C155.729 0 200.5 44.7715 200.5 99.9999C200.5 155.229 155.729 200 100.5 200C45.2715 200 0.5 155.229 0.5 99.9999C0.5 44.7715 45.2715 0 100.5 0Z",fill:"url(#paint0_linear_1356_5135)"})),/*#__PURE__*/y$3("g",{opacity:"0.3"},/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.5 17.5728C146.023 17.5728 182.927 54.4767 182.927 99.9998C182.927 145.523 146.023 182.427 100.5 182.427C54.9768 182.427 18.0729 145.523 18.0729 99.9998C18.0729 54.4767 54.9768 17.5728 100.5 17.5728Z",fill:"url(#paint1_linear_1356_5135)"})),/*#__PURE__*/y$3("g",{opacity:"0.7"},/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.5 32.231C137.988 32.231 168.378 62.6208 168.378 100.109C168.378 137.597 137.988 167.987 100.5 167.987C63.012 167.987 32.6222 137.597 32.6222 100.109C32.6222 62.6208 63.012 32.231 100.5 32.231Z",fill:"url(#paint2_linear_1356_5135)"})),/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.605 48.7734C128.955 48.7734 151.937 71.7553 151.937 100.105C151.937 128.455 128.955 151.437 100.605 151.437C72.255 151.437 49.2731 128.455 49.2731 100.105C49.2731 71.7553 72.255 48.7734 100.605 48.7734Z",fill:"#00AC26",fillOpacity:"0.12"}),/*#__PURE__*/y$3("mask",{id:"mask0_1356_5135",style:{maskType:'alpha'},maskUnits:"userSpaceOnUse",x:"49",y:"48",width:"103",height:"104"},/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.605 48.7734C128.955 48.7734 151.937 71.7553 151.937 100.105C151.937 128.455 128.955 151.437 100.605 151.437C72.255 151.437 49.2731 128.455 49.2731 100.105C49.2731 71.7553 72.255 48.7734 100.605 48.7734Z",fill:"white"})),/*#__PURE__*/y$3("g",{mask:"url(#mask0_1356_5135)"}),/*#__PURE__*/y$3("path",{d:"M88 117.5L70.5 100L64.6667 105.833L88 129.167L138 79.1666L132.167 73.3333L88 117.5Z",fill:"white"}),/*#__PURE__*/y$3("defs",null,/*#__PURE__*/y$3("linearGradient",{id:"paint0_linear_1356_5135",x1:"-86.6375",y1:"160.384",x2:"170.169",y2:"338.297",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/y$3("stop",{stopColor:"white"}),/*#__PURE__*/y$3("stop",{offset:"1",stopColor:"#09F33D"})),/*#__PURE__*/y$3("linearGradient",{id:"paint1_linear_1356_5135",x1:"-86.6374",y1:"160.384",x2:"170.169",y2:"338.297",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/y$3("stop",{stopColor:"#00AC26",stopOpacity:"0.4"}),/*#__PURE__*/y$3("stop",{offset:"1",stopColor:"#BDFFBC",stopOpacity:"0.58"})),/*#__PURE__*/y$3("linearGradient",{id:"paint2_linear_1356_5135",x1:"-86.6375",y1:"160.493",x2:"170.169",y2:"338.406",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/y$3("stop",{stopColor:"#F8FFF5"}),/*#__PURE__*/y$3("stop",{offset:"1",stopColor:"#00AC26",stopOpacity:"0.26"}))));};var Confirmation=function Confirmation(_ref63){var header=_ref63.header,text=_ref63.text;var _useLingui3=useLingui(),_t=_useLingui3._;var defaultHeader=_t({id:'success.title',message:"Success!"});var defaultText=_t({id:'login.success.content',message:"You have successfully logged in."});return/*#__PURE__*/y$3(Flex,{direction:"column",gap:24,alignItems:"center"},/*#__PURE__*/y$3(Text,{size:"header"},header!==null&&header!==void 0?header:defaultHeader),/*#__PURE__*/y$3(Text,null,text!==null&&text!==void 0?text:defaultText),/*#__PURE__*/y$3(ConfirmationSVG,null));};var OTPConfirmation=function OTPConfirmation(){var _useLingui4=useLingui(),_t=_useLingui4._;var onEvent=useEventCallback();useMountEffect(function(){onEvent({type:StytchEventType.AuthenticateFlowComplete,data:{}});});return/*#__PURE__*/y$3(Confirmation,{text:_t({id:'otp.success.content',message:"Your passcode has been successfully verified."})});};var DividerContainer=He(Flex)(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n color: ",";\n"])),function(props){return props.theme.colors.secondary;});var DividerBar=He.div(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n ","\n ","\n border-bottom: 1px solid ",";\n flex-grow: 1;\n"])),function(props){return props.$placement==='left'&&'margin-right: 6px;';},function(props){return props.$placement==='right'&&'margin-left: 6px;';},function(props){return props.theme.colors.secondary;});var StyledText=He(Text)(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n color: ",";\n"])),function(props){return props.theme.colors.secondary;});var Divider=function Divider(){var _useLingui5=useLingui(),_t=_useLingui5._;return/*#__PURE__*/wn.createElement(DividerContainer,{alignItems:"center"},/*#__PURE__*/wn.createElement(DividerBar,{"$placement":"left"}),/*#__PURE__*/wn.createElement(StyledText,null,_t({id:'methodDivider.text',message:"or"})),/*#__PURE__*/wn.createElement(DividerBar,{"$placement":"right"}));};var OAuthButton=function OAuthButton(props){var stytchClient=useStytch();var onButtonClick=function onButtonClick(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee78(){var _a;return _regenerator2().w(function(_context78){while(1)switch(_context78.n){case 0:_context78.n=1;return stytchClient.oauth[props.providerType].start({login_redirect_url:props.loginRedirectUrl,signup_redirect_url:props.signupRedirectUrl,custom_scopes:props.customScopes,provider_params:props.providerParams});case 1:(_a=props.onSuccess)===null||_a===void 0?void 0:_a.call(props);case 2:return _context78.a(2);}},_callee78);}));};return/*#__PURE__*/wn.createElement(Button,{id:"oauth-".concat(props.providerType),type:"button",onClick:onButtonClick,variant:"outlined"},/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center",alignItems:"center",gap:4},props.icon,/*#__PURE__*/wn.createElement("span",{style:{verticalAlign:'middle'}},props.label)));};var GoogleIconSvg=function GoogleIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},/*#__PURE__*/wn.createElement("path",{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"}),/*#__PURE__*/wn.createElement("path",{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"}),/*#__PURE__*/wn.createElement("path",{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"}),/*#__PURE__*/wn.createElement("path",{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"}));};var GoogleIcon=CreateIcon(GoogleIconSvg);var useIsUnmounted=function useIsUnmounted(){var isUnmounted=_$2(false);p$5(function(){return function(){isUnmounted.current=true;};},[]);return isUnmounted;};var OAuthErrorMessage=function OAuthErrorMessage(_ref64){var children=_ref64.children;return/*#__PURE__*/wn.createElement("div",{key:"oauth-error-message"},/*#__PURE__*/wn.createElement(Text,{color:"error"},children));};var OneTapNoConfiguredClientsErrorMessage=function OneTapNoConfiguredClientsErrorMessage(){return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because no Google OAuth client configuration could be found for this project. Please make sure a client is configured in the\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."));};var RedirectUrlsErrorMessage=function RedirectUrlsErrorMessage(_ref65){var niceName=_ref65.niceName,variableName=_ref65.variableName;return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because there are no ",niceName," set for this project so we are unable to verify the",' ',/*#__PURE__*/wn.createElement("code",null,variableName),"\xA0 provided in the configuration. To set ",niceName," for this project please visit\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/dashboard/redirect-urls"},"the Stytch dashboard."),"\xA0 For more information on why this validation is necessary please visit\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/docs/api/url-validation"},"https://stytch.com/docs/api/url-validation."));};var OneTapNoConfiguredLoginRedirectUrlsErrorMessage=function OneTapNoConfiguredLoginRedirectUrlsErrorMessage(){return/*#__PURE__*/wn.createElement(RedirectUrlsErrorMessage,{niceName:"login redirect URLs",variableName:"oauthOptions.loginRedirectURL"});};var OneTapNoConfiguredSignupRedirectUrlsErrorMessage=function OneTapNoConfiguredSignupRedirectUrlsErrorMessage(){return/*#__PURE__*/wn.createElement(RedirectUrlsErrorMessage,{niceName:"signup redirect URLs",variableName:"oauthOptions.signupRedirectURL"});};var OneTapJSOriginErrorMessage=function OneTapJSOriginErrorMessage(){return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because the current host\xA0",/*#__PURE__*/wn.createElement("code",null,"\"".concat(window.location.host,"\""))," is not allowed for this project. Make sure to put your project's host into the Google API console. When using localhost for development, you must add both\xA0",/*#__PURE__*/wn.createElement("code",null,"http://localhost")," and\xA0",/*#__PURE__*/wn.createElement("code",null,"http://localhost:<port_number>"),"\xA0 to the Authorized JavaScript origins box. You can learn more\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/docs/sdks"},"here."));};var OneTapInvalidOAuthClient=function OneTapInvalidOAuthClient(){return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because the client ID configured for your project is not recognized by Google. \xA0 Please check that the client ID saved in ",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/dashboard/oauth/google"},"the Stytch Dashboard"),"\xA0 matches the client ID in your Google Cloud Console.");};var OneTapNoDefaultProviderAllowedErrorMessage=function OneTapNoDefaultProviderAllowedErrorMessage(){return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because the Stytch Default OAuth Provider is not compatible with One Tap. Please configure your own Google client in the\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."));};var circularRotateKeyframe=Ue(_templateObject0||(_templateObject0=_taggedTemplateLiteral(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"])));var circularDashKeyframe=Ue(_templateObject1||(_templateObject1=_taggedTemplateLiteral(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])));var AnimatedCircle=He.circle(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n stroke-dasharray: 80px, 200px;\n stroke-dashoffset: 0;\n animation: "," 1.4s ease-in-out infinite;\n stroke: ",";\n fill: none;\n"])),circularDashKeyframe,function(props){return props.theme.colors.primary;});var CircularProgressRoot=He.div(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n width: ","px;\n height: ","px;\n animation: "," 1.4s ease-in-out infinite;\n"])),function(props){return props.size;},function(props){return props.size;},circularRotateKeyframe);var CircularProgressSVG=He.svg(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n display: block;\n"])));var CircularProgress=function CircularProgress(_ref66){var size=_ref66.size,thickness=_ref66.thickness;return/*#__PURE__*/wn.createElement(CircularProgressRoot,{size:size},/*#__PURE__*/wn.createElement(CircularProgressSVG,{viewBox:"".concat(size/2," ").concat(size/2," ").concat(size," ").concat(size)},/*#__PURE__*/wn.createElement(AnimatedCircle,{cx:size,cy:size,r:(size-thickness)/2,fill:"none",strokeWidth:thickness})));};var useIsOnlyFloatingOneTap=function useIsOnlyFloatingOneTap(){var config=useConfig();var isOnlyFloatingOneTap=F$4(function(){var _a,_b,_c,_d;var position=(_a=config.oauthOptions)===null||_a===void 0?void 0:_a.providers[0].position;return config.products.length===1&&config.products.includes(Products.oauth)&&((_b=config.oauthOptions)===null||_b===void 0?void 0:_b.providers.length)===1&&((_c=config.oauthOptions)===null||_c===void 0?void 0:_c.providers[0].type)===OAuthProviders.Google&&((_d=config.oauthOptions)===null||_d===void 0?void 0:_d.providers[0].one_tap)===true&&getShouldRenderFloatingOneTap(position);},[config]);return isOnlyFloatingOneTap;};function useLastUsedOAuth(){var stytch=useStytch();var _readB2CInternals=readB2CInternals(stytch),publicToken=_readB2CInternals.publicToken;var lastUsedOAuth=F$4(function(){return safeLocalStorage.getItem(publicToken,'b2c_last_used_oauth');},[publicToken]);var setLastUsedOAuth=function setLastUsedOAuth(providerType){safeLocalStorage.setItem(publicToken,'b2c_last_used_oauth',providerType);};return[lastUsedOAuth,setLastUsedOAuth];}var OAUTH_BUTTON_HEIGHT=47;var OneTapMountNode=function OneTapMountNode(_ref67){var enableShadowDOM=_ref67.enableShadowDOM;return enableShadowDOM?/*#__PURE__*/wn.createElement("slot",null):/*#__PURE__*/wn.createElement("div",{"data-prompt_parent_id":"g_id_onload",id:"google-parent-prompt"});};var OneTapErrors;(function(OneTapErrors){OneTapErrors["None"]="none";OneTapErrors["OriginNotAllowedForClient"]="origin_not_allowed_for_client";OneTapErrors["InvalidOAuthClient"]="invalid_client";OneTapErrors["NoConfiguredOAuthClient"]="oauth_config_not_found";OneTapErrors["NoConfiguredLoginRedirectUrls"]="no_login_redirect_urls_set";OneTapErrors["NoConfiguredSignupRedirectUrls"]="no_signup_redirect_urls_set";OneTapErrors["DefaultProviderNotAllowed"]="default_provider_not_allowed";})(OneTapErrors||(OneTapErrors={}));var ErrorMessages=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},OneTapErrors.None,/*#__PURE__*/wn.createElement(wn.Fragment,null)),OneTapErrors.OriginNotAllowedForClient,/*#__PURE__*/wn.createElement(OneTapJSOriginErrorMessage,null)),OneTapErrors.InvalidOAuthClient,/*#__PURE__*/wn.createElement(OneTapInvalidOAuthClient,null)),OneTapErrors.NoConfiguredOAuthClient,/*#__PURE__*/wn.createElement(OneTapNoConfiguredClientsErrorMessage,null)),OneTapErrors.NoConfiguredLoginRedirectUrls,/*#__PURE__*/wn.createElement(OneTapNoConfiguredLoginRedirectUrlsErrorMessage,null)),OneTapErrors.NoConfiguredSignupRedirectUrls,/*#__PURE__*/wn.createElement(OneTapNoConfiguredSignupRedirectUrlsErrorMessage,null)),OneTapErrors.DefaultProviderNotAllowed,/*#__PURE__*/wn.createElement(OneTapNoDefaultProviderAllowedErrorMessage,null));var OneTapContainer=He.div(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n height: ",";\n display: ",";\n transition: all 0.5s ease-out;\n justify-content: center;\n align-items: center;\n"])),function(props){return"".concat(props.$height,"px");},function(props){return props.pending?'flex':'block';});var GoogleOneTap=function GoogleOneTap(_ref68){var position=_ref68.position,customScopes=_ref68.customScopes,providerParams=_ref68.providerParams,cancelOnTapOutside=_ref68.cancelOnTapOutside;var _a,_b,_c,_d;var _useLingui6=useLingui(),_t=_useLingui6._;var oneTapRenderMode=getRenderedOneTapMode(position);var shouldRenderEmbeddedOneTap=oneTapRenderMode==='embedded';var shouldRenderOneTap=!!oneTapRenderMode;var config=useConfig();var stytch=useStytch();var isOnlyFloatingOneTap=useIsOnlyFloatingOneTap();var _h$5=h$5(shouldRenderEmbeddedOneTap),_h$6=_slicedToArray2(_h$5,2),pending=_h$6[0],setPending=_h$6[1];var _h$7=h$5(true),_h$8=_slicedToArray2(_h$7,2),canDisplayOneTap=_h$8[0],setCanDisplayOneTap=_h$8[1];var _h$9=h$5(OAUTH_BUTTON_HEIGHT),_h$0=_slicedToArray2(_h$9,2),height=_h$0[0],setHeight=_h$0[1];var _h$1=h$5(OneTapErrors.None),_h$10=_slicedToArray2(_h$1,2),oneTapError=_h$10[0],setOneTapError=_h$10[1];var resizeCount=_$2(0);var timeout=_$2();var isUnmounted=useIsUnmounted();var _useLastUsedOAuth=useLastUsedOAuth(),_useLastUsedOAuth2=_slicedToArray2(_useLastUsedOAuth,2),lastUsedMethod=_useLastUsedOAuth2[0],setLastUsedOAuth=_useLastUsedOAuth2[1];var onResize=T$3(function(_ref69){var _ref70=_slicedToArray2(_ref69,1),el=_ref70[0];if(timeout.current!=null){clearTimeout(timeout.current);}if(resizeCount.current>1){setHeight(function(currentHeight){return el.contentRect.height===0?canDisplayOneTap?currentHeight:OAUTH_BUTTON_HEIGHT:el.contentRect.height;});}else{timeout.current=setTimeout(function(){return setHeight(function(currentHeight){return el.contentRect.height===0?canDisplayOneTap?currentHeight:OAUTH_BUTTON_HEIGHT:el.contentRect.height;});},100);}resizeCount.current++;},[]);p$5(function(){if(shouldRenderEmbeddedOneTap){var el=document.getElementById('google-parent-prompt');if(el){var resizeObserver=new ResizeObserver(onResize);resizeObserver.observe(el);return function(){return resizeObserver.disconnect();};}}},[onResize,shouldRenderEmbeddedOneTap]);var attemptToLoadOneTap=T$3(function(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee79(){var _e,_f,_readB2CInternals2,oneTap,clientResult,client,onOneTapCancelled,renderResult;return _regenerator2().w(function(_context79){while(1)switch(_context79.n){case 0:if(shouldRenderOneTap){_context79.n=1;break;}return _context79.a(2);case 1:_readB2CInternals2=readB2CInternals(stytch),oneTap=_readB2CInternals2.oneTap;_context79.n=2;return oneTap.createOneTapClient();case 2:clientResult=_context79.v;if(clientResult.success){_context79.n=3;break;}if(clientResult.reason==='oauth_config_not_found'){setOneTapError(OneTapErrors.NoConfiguredOAuthClient);}else if(clientResult.reason==='no_signup_redirect_urls_set'){setOneTapError(OneTapErrors.NoConfiguredSignupRedirectUrls);}else if(clientResult.reason==='no_login_redirect_urls_set'){setOneTapError(OneTapErrors.NoConfiguredLoginRedirectUrls);}else{logger.error('Unable to load One Tap settings for project',clientResult);}return _context79.a(2);case 3:client=clientResult.client;onOneTapCancelled=function onOneTapCancelled(showError){setCanDisplayOneTap(false);setHeight(OAUTH_BUTTON_HEIGHT);if(showError){setOneTapError(OneTapErrors.OriginNotAllowedForClient);}};if(!isUnmounted.current){_context79.n=4;break;}return _context79.a(2);case 4:_context79.n=5;return client.render({callback:oneTap.createOnSuccessHandler({loginRedirectUrl:(_e=config.oauthOptions)===null||_e===void 0?void 0:_e.loginRedirectURL,signupRedirectUrl:(_f=config.oauthOptions)===null||_f===void 0?void 0:_f.signupRedirectURL,onSuccess:oneTap.redirectOnSuccess}),onOneTapCancelled:onOneTapCancelled,style:{position:position},cancelOnTapOutside:cancelOnTapOutside});case 5:renderResult=_context79.v;if(!isUnmounted.current){_context79.n=6;break;}client.cancel();return _context79.a(2);case 6:setCanDisplayOneTap(renderResult.success);setPending(false);if(!renderResult.success){if(renderResult.reason==='unregistered_origin'){setOneTapError(OneTapErrors.OriginNotAllowedForClient);}if(renderResult.reason==='invalid_client'){setOneTapError(OneTapErrors.InvalidOAuthClient);}logger.error('Unable to render One Tap prompt',renderResult);}return _context79.a(2,client);}},_callee79);}));},[shouldRenderOneTap,stytch,isUnmounted,(_a=config.oauthOptions)===null||_a===void 0?void 0:_a.loginRedirectURL,(_b=config.oauthOptions)===null||_b===void 0?void 0:_b.signupRedirectURL,position,cancelOnTapOutside]);p$5(function(){var client;attemptToLoadOneTap().then(function($client){return client=$client;})["catch"](function(err){logger.error('Unable to render One Tap prompt',err);setCanDisplayOneTap(false);setPending(false);});return function(){return client===null||client===void 0?void 0:client.cancel();};},[attemptToLoadOneTap]);var fallbackButton=/*#__PURE__*/wn.createElement(OAuthButton,{key:"oauth-".concat(OAuthProviders.Google),providerType:OAuthProviders.Google,icon:/*#__PURE__*/wn.createElement(GoogleIcon,null),label:_t({id:'oauth.continueWithGoogle',message:"Continue with Google"}),loginRedirectUrl:(_c=config.oauthOptions)===null||_c===void 0?void 0:_c.loginRedirectURL,signupRedirectUrl:(_d=config.oauthOptions)===null||_d===void 0?void 0:_d.signupRedirectURL,customScopes:customScopes,providerParams:providerParams,onSuccess:function onSuccess(){return setLastUsedOAuth(OAuthProviders.Google);}});var fallbackWithLastUsed=lastUsedMethod===OAuthProviders.Google?(/*#__PURE__*/wn.createElement("div",null,/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary",align:"right"},_t({id:'provider.lastUsed',message:"Last used"})),fallbackButton)):fallbackButton;var _readB2CInternals3=readB2CInternals(stytch),publicToken=_readB2CInternals3.publicToken;if(isOnlyFloatingOneTap){return/*#__PURE__*/wn.createElement(OneTapMountNode,{enableShadowDOM:!!config.enableShadowDOM});}if(oneTapError!==OneTapErrors.None){return/*#__PURE__*/wn.createElement(wn.Fragment,null,isTestPublicToken(publicToken)?ErrorMessages[oneTapError]:null,fallbackWithLastUsed);}if(shouldRenderEmbeddedOneTap&&OneTapProvider.willGoogleOneTapShowEmbedded()){return/*#__PURE__*/wn.createElement(OneTapContainer,{pending:pending,"$height":height},pending&&/*#__PURE__*/wn.createElement(CircularProgress,{size:25,thickness:2}),canDisplayOneTap?/*#__PURE__*/wn.createElement(OneTapMountNode,{enableShadowDOM:!!config.enableShadowDOM}):fallbackButton);}return fallbackWithLastUsed;};var AppleIconSvg=function AppleIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12.2227 6.25C13.0547 6.25 14.0977 5.65496 14.7188 4.86157C15.2813 4.14256 15.6914 3.13843 15.6914 2.1343C15.6914 1.99793 15.6797 1.86157 15.6563 1.75C14.7305 1.78719 13.6172 2.40702 12.9492 3.2376C12.4219 3.86983 11.9414 4.86157 11.9414 5.8781C11.9414 6.02686 11.9648 6.17562 11.9766 6.22521C12.0352 6.2376 12.1289 6.25 12.2227 6.25ZM9.29297 21.25C10.4297 21.25 10.9336 20.4442 12.3516 20.4442C13.793 20.4442 14.1094 21.2252 15.375 21.2252C16.6172 21.2252 17.4492 20.0103 18.2344 18.8202C19.1133 17.4566 19.4766 16.1178 19.5 16.0558C19.418 16.031 17.0391 15.0021 17.0391 12.1136C17.0391 9.6095 18.9141 8.4814 19.0195 8.39463C17.7773 6.51033 15.8906 6.46074 15.375 6.46074C13.9805 6.46074 12.8438 7.35331 12.1289 7.35331C11.3555 7.35331 10.3359 6.51033 9.12891 6.51033C6.83203 6.51033 4.5 8.51859 4.5 12.312C4.5 14.6674 5.36719 17.1591 6.43359 18.7707C7.34766 20.1343 8.14453 21.25 9.29297 21.25Z",fill:"black"}));};var AppleIcon=CreateIcon(AppleIconSvg);var GithubIconSvg=function GithubIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("rect",{width:"24",height:"24",rx:"12",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M12.0001 3.875C7.39828 3.875 3.66669 7.6059 3.66669 12.2084C3.66669 15.8903 6.05446 19.014 9.36558 20.1159C9.78205 20.1931 9.93495 19.9352 9.93495 19.7151C9.93495 19.5163 9.92723 18.8599 9.92364 18.1636C7.60528 18.6677 7.11608 17.1803 7.11608 17.1803C6.737 16.2171 6.1908 15.961 6.1908 15.961C5.43471 15.4438 6.2478 15.4544 6.2478 15.4544C7.08461 15.5132 7.52524 16.3131 7.52524 16.3131C8.2685 17.5871 9.47473 17.2188 9.95027 17.0059C10.0251 16.4673 10.241 16.0997 10.4794 15.8916C8.62839 15.6808 6.68263 14.9663 6.68263 11.7732C6.68263 10.8633 7.00816 10.1199 7.54125 9.53635C7.45472 9.32646 7.16948 8.47888 7.62198 7.33101C7.62198 7.33101 8.32176 7.10704 9.91426 8.18522C10.579 8.00058 11.2919 7.90798 12.0001 7.90481C12.7083 7.90798 13.4217 8.00058 14.0877 8.18522C15.6783 7.10704 16.3771 7.33101 16.3771 7.33101C16.8307 8.47888 16.5453 9.32646 16.4588 9.53635C16.9931 10.1199 17.3165 10.8633 17.3165 11.7732C17.3165 14.9739 15.367 15.6786 13.5113 15.8849C13.8102 16.1435 14.0765 16.6507 14.0765 17.4282C14.0765 18.5432 14.0669 19.4406 14.0669 19.7151C14.0669 19.9368 14.2169 20.1967 14.6393 20.1148C17.9486 19.0117 20.3334 15.8891 20.3334 12.2084C20.3334 7.6059 16.6023 3.875 12.0001 3.875ZM6.78782 15.7461C6.76946 15.7875 6.70433 15.7999 6.64499 15.7715C6.58455 15.7443 6.5506 15.6879 6.5702 15.6463C6.58813 15.6037 6.65341 15.5918 6.71371 15.6204C6.77429 15.6476 6.80879 15.7046 6.78782 15.7461ZM7.19773 16.1119C7.15798 16.1487 7.08029 16.1316 7.02758 16.0734C6.97307 16.0153 6.96286 15.9376 7.00315 15.9002C7.04414 15.8633 7.11948 15.8806 7.17413 15.9387C7.22864 15.9975 7.23927 16.0746 7.19773 16.1119ZM7.47894 16.5798C7.42788 16.6153 7.34439 16.582 7.29278 16.5079C7.24172 16.4338 7.24172 16.345 7.29389 16.3094C7.34564 16.2738 7.42788 16.3058 7.48018 16.3793C7.53111 16.4547 7.53111 16.5435 7.47894 16.5798ZM7.95454 17.1218C7.90886 17.1722 7.81157 17.1587 7.74036 17.0899C7.6675 17.0227 7.64722 16.9274 7.69303 16.877C7.73926 16.8265 7.8371 16.8407 7.90886 16.9089C7.98117 16.976 8.00325 17.072 7.95454 17.1218ZM8.56919 17.3048C8.54905 17.3701 8.45535 17.3997 8.36096 17.372C8.2667 17.3434 8.20502 17.267 8.22406 17.201C8.24366 17.1353 8.33777 17.1044 8.43285 17.1341C8.52697 17.1625 8.58879 17.2384 8.56919 17.3048ZM9.2687 17.3824C9.27105 17.4511 9.19101 17.5081 9.09193 17.5094C8.99229 17.5116 8.9117 17.4559 8.9106 17.3883C8.9106 17.3189 8.98884 17.2625 9.08848 17.2608C9.18756 17.2589 9.2687 17.3141 9.2687 17.3824ZM9.95589 17.3561C9.96776 17.4231 9.8989 17.492 9.8005 17.5103C9.70377 17.528 9.61421 17.4866 9.60193 17.4201C9.58992 17.3514 9.66002 17.2825 9.75662 17.2647C9.85515 17.2476 9.94333 17.2879 9.95589 17.3561Z",fill:"#161614"}));};var GithubIcon=CreateIcon(GithubIconSvg);var FacebookIconSVG=function FacebookIconSVG(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M22 12C22 6.47715 17.5229 2 12 2C6.47715 2 2 6.47715 2 12C2 16.9913 5.65685 21.1283 10.4375 21.8785V14.8906H7.89844V12H10.4375V9.79688C10.4375 7.29062 11.9304 5.90626 14.2146 5.90626C15.3087 5.90626 16.4531 6.10156 16.4531 6.10156V8.5625H15.1922C13.9499 8.5625 13.5625 9.33335 13.5625 10.1242V12H16.3359L15.8926 14.8906H13.5625V21.8785C18.3431 21.1283 22 16.9913 22 12Z",fill:"#1877F2"}),/*#__PURE__*/wn.createElement("path",{d:"M15.8926 14.8906L16.3359 12H13.5625V10.1242C13.5625 9.33334 13.9499 8.5625 15.1921 8.5625H16.4531V6.10156C16.4531 6.10156 15.3087 5.90625 14.2146 5.90625C11.9304 5.90625 10.4375 7.29062 10.4375 9.79688V12H7.89844V14.8906H10.4375V21.8785C10.9544 21.9595 11.4768 22.0001 12 22C12.5316 22 13.0534 21.9584 13.5625 21.8785V14.8906H15.8926Z",fill:"white"}));};var FacebookIcon=CreateIcon(FacebookIconSVG);var MicrosoftIconSvg=function MicrosoftIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M9.52382 0.952381H0.952393V9.52381H9.52382V0.952381Z",fill:"#F25022"}),/*#__PURE__*/wn.createElement("path",{d:"M9.52382 10.4762H0.952393V19.0476H9.52382V10.4762Z",fill:"#00A4EF"}),/*#__PURE__*/wn.createElement("path",{d:"M19.0475 0.952381H10.4761V9.52381H19.0475V0.952381Z",fill:"#7FBA00"}),/*#__PURE__*/wn.createElement("path",{d:"M19.0475 10.4762H10.4761V19.0476H19.0475V10.4762Z",fill:"#FFB900"}));};var MicrosoftIcon=CreateIcon(MicrosoftIconSvg);var GitLabIconSvg=function GitLabIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"-.1 .5 960.2 923.9",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"m958.9 442.4c1.1 26.1-2 52.1-9.2 77.2-7.1 25.1-18.3 48.8-33.1 70.3a240.43 240.43 0 0 1 -53.6 56.2l-.5.4-199.9 149.8-98.3 74.5-59.9 45.2c-3.5 2.7-7.4 4.7-11.5 6.1s-8.5 2.1-12.9 2.1c-4.3 0-8.7-.7-12.8-2.1s-8-3.4-11.5-6.1l-59.9-45.2-98.3-74.5-198.7-148.9-1.2-.8-.4-.4c-20.9-15.7-39-34.7-53.8-56.2s-26-45.3-33.2-70.4c-7.2-25.1-10.3-51.2-9.2-77.3 1.2-26.1 6.5-51.8 15.8-76.2l1.3-3.5 130.7-340.5q1-2.5 2.4-4.8 1.3-2.3 3.1-4.3 1.7-2.1 3.7-3.9 2-1.7 4.2-3.2c3.1-1.9 6.3-3.3 9.8-4.1 3.4-.9 7-1.3 10.5-1.1 3.6.2 7.1.9 10.4 2.2 3.3 1.2 6.5 3 9.3 5.2q2 1.7 3.9 3.6 1.8 2 3.2 4.3 1.5 2.2 2.6 4.7 1.1 2.4 1.8 5l88.1 269.7h356.6l88.1-269.7q.7-2.6 1.9-5 1.1-2.4 2.6-4.7 1.4-2.2 3.2-4.2 1.8-2 3.9-3.7c2.8-2.2 5.9-3.9 9.2-5.2 3.4-1.2 6.9-1.9 10.4-2.1 3.6-.2 7.1.1 10.6 1 3.4.9 6.7 2.3 9.7 4.2q2.3 1.4 4.3 3.2 2 1.7 3.7 3.8 1.7 2.1 3.1 4.4 1.3 2.3 2.3 4.8l130.5 340.6 1.3 3.5c9.3 24.3 14.6 50 15.7 76.1z",fill:"#e24329"}),/*#__PURE__*/wn.createElement("path",{d:"m959 442.5c1.1 26-2 52.1-9.2 77.2s-18.4 48.9-33.2 70.4-32.9 40.5-53.7 56.2l-.5.4-199.9 149.8s-84.9-64.1-182.5-138l286.5-216.8c12.9-9.7 26.4-18.6 40.3-26.8 13.9-8.3 28.3-15.7 43-22.3 14.8-6.6 29.9-12.5 45.2-17.4 15.4-5 31-9.1 46.9-12.4l1.3 3.5c9.3 24.4 14.6 50.1 15.8 76.2z",fill:"#fc6d26"}),/*#__PURE__*/wn.createElement("path",{d:"m480 658.5c97.6 73.7 182.6 138 182.6 138l-98.3 74.5-59.9 45.2c-3.5 2.7-7.4 4.7-11.5 6.1s-8.5 2.1-12.9 2.1c-4.3 0-8.7-.7-12.8-2.1s-8-3.4-11.5-6.1l-59.9-45.2-98.3-74.5s84.9-64.3 182.5-138z",fill:"#fca326"}),/*#__PURE__*/wn.createElement("path",{d:"m480 658.3c-97.7 73.9-182.5 138-182.5 138l-198.7-148.9-1.2-.8-.4-.4c-20.9-15.7-39-34.7-53.8-56.2s-26-45.3-33.2-70.4c-7.2-25.1-10.3-51.2-9.2-77.3 1.2-26.1 6.5-51.8 15.8-76.2l1.3-3.5c15.9 3.3 31.5 7.4 46.9 12.4 15.3 5 30.4 10.8 45.2 17.5 14.7 6.6 29.1 14.1 43 22.3s27.3 17.2 40.3 26.9z",fill:"#fc6d26"}));};var GitLabIcon=CreateIcon(GitLabIconSvg);var DiscordIconSvg=function DiscordIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M18.5843 6.16943C17.3733 5.62815 16.0747 5.22936 14.7169 5.00096C14.6922 4.99655 14.6675 5.00757 14.6548 5.0296C14.4877 5.31896 14.3027 5.69645 14.1732 5.99316C12.7128 5.78018 11.2599 5.78018 9.8295 5.99316C9.69993 5.68986 9.50822 5.31896 9.34046 5.0296C9.32772 5.0083 9.30302 4.99729 9.27829 5.00096C7.92126 5.22863 6.62265 5.62742 5.41091 6.16943C5.40042 6.17384 5.39143 6.18119 5.38546 6.19073C2.92227 9.77548 2.2475 13.2721 2.57852 16.7254C2.58002 16.7423 2.58975 16.7584 2.60323 16.7687C4.22837 17.9313 5.8026 18.6371 7.3476 19.1049C7.37232 19.1123 7.39852 19.1035 7.41426 19.0836C7.77973 18.5975 8.10551 18.0848 8.38484 17.5457C8.40132 17.5142 8.38558 17.4767 8.35189 17.4642C7.83515 17.2733 7.3431 17.0405 6.86979 16.7761C6.83235 16.7548 6.82935 16.7026 6.86379 16.6776C6.96339 16.6049 7.06302 16.5293 7.15813 16.4529C7.17534 16.439 7.19932 16.436 7.21955 16.4448C10.329 17.8278 13.6954 17.8278 16.7682 16.4448C16.7884 16.4353 16.8124 16.4382 16.8303 16.4522C16.9255 16.5286 17.0251 16.6049 17.1254 16.6776C17.1599 16.7026 17.1576 16.7548 17.1202 16.7761C16.6469 17.0456 16.1548 17.2733 15.6373 17.4635C15.6036 17.476 15.5886 17.5142 15.6051 17.5457C15.8905 18.0841 16.2162 18.5967 16.575 19.0829C16.5899 19.1035 16.6169 19.1123 16.6416 19.1049C18.1941 18.6371 19.7683 17.9313 21.3935 16.7687C21.4077 16.7584 21.4167 16.743 21.4182 16.7261C21.8144 12.7338 20.7546 9.26579 18.609 6.19146C18.6038 6.18119 18.5948 6.17384 18.5843 6.16943ZM8.84918 14.6227C7.91302 14.6227 7.14165 13.7855 7.14165 12.7573C7.14165 11.7291 7.89806 10.8918 8.84918 10.8918C9.80777 10.8918 10.5717 11.7364 10.5567 12.7573C10.5567 13.7855 9.80028 14.6227 8.84918 14.6227ZM15.1625 14.6227C14.2264 14.6227 13.455 13.7855 13.455 12.7573C13.455 11.7291 14.2114 10.8918 15.1625 10.8918C16.1211 10.8918 16.885 11.7364 16.87 12.7573C16.87 13.7855 16.1211 14.6227 15.1625 14.6227Z",fill:"#5865F2"}));};var DiscordIcon=CreateIcon(DiscordIconSvg);var SlackIconSvg=function SlackIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M6.78176 14.3746C6.78176 15.4153 5.9316 16.2655 4.89088 16.2655C3.85016 16.2655 3 15.4153 3 14.3746C3 13.3339 3.85016 12.4837 4.89088 12.4837H6.78176V14.3746Z",fill:"#E01E5A"}),/*#__PURE__*/wn.createElement("path",{d:"M7.73462 14.3746C7.73462 13.3339 8.58478 12.4837 9.6255 12.4837C10.6662 12.4837 11.5164 13.3339 11.5164 14.3746V19.1091C11.5164 20.1498 10.6662 21 9.6255 21C8.58478 21 7.73462 20.1498 7.73462 19.1091V14.3746Z",fill:"#E01E5A"}),/*#__PURE__*/wn.createElement("path",{d:"M9.6255 6.78176C8.58478 6.78176 7.73462 5.9316 7.73462 4.89088C7.73462 3.85016 8.58478 3 9.6255 3C10.6662 3 11.5164 3.85016 11.5164 4.89088V6.78176H9.6255Z",fill:"#36C5F0"}),/*#__PURE__*/wn.createElement("path",{d:"M9.62541 7.73453C10.6661 7.73453 11.5163 8.58469 11.5163 9.62541C11.5163 10.6661 10.6661 11.5163 9.62541 11.5163H4.89088C3.85016 11.5163 3 10.6661 3 9.62541C3 8.58469 3.85016 7.73453 4.89088 7.73453H9.62541Z",fill:"#36C5F0"}),/*#__PURE__*/wn.createElement("path",{d:"M17.2183 9.62541C17.2183 8.58469 18.0684 7.73453 19.1091 7.73453C20.1499 7.73453 21 8.58469 21 9.62541C21 10.6661 20.1499 11.5163 19.1091 11.5163H17.2183V9.62541Z",fill:"#2EB67D"}),/*#__PURE__*/wn.createElement("path",{d:"M16.2654 9.62541C16.2654 10.6661 15.4152 11.5163 14.3745 11.5163C13.3338 11.5163 12.4836 10.6661 12.4836 9.62541V4.89088C12.4836 3.85016 13.3338 3 14.3745 3C15.4152 3 16.2654 3.85016 16.2654 4.89088V9.62541Z",fill:"#2EB67D"}),/*#__PURE__*/wn.createElement("path",{d:"M14.3745 17.2182C15.4152 17.2182 16.2654 18.0684 16.2654 19.1091C16.2654 20.1498 15.4152 21 14.3745 21C13.3338 21 12.4836 20.1498 12.4836 19.1091V17.2182H14.3745Z",fill:"#ECB22E"}),/*#__PURE__*/wn.createElement("path",{d:"M14.3745 16.2655C13.3338 16.2655 12.4836 15.4153 12.4836 14.3746C12.4836 13.3339 13.3338 12.4837 14.3745 12.4837H19.109C20.1498 12.4837 20.9999 13.3339 20.9999 14.3746C20.9999 15.4153 20.1498 16.2655 19.109 16.2655H14.3745Z",fill:"#ECB22E"}));};var SlackIcon=CreateIcon(SlackIconSvg);var AmazonIconSvg=function AmazonIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M7 11.9273C7 11.0909 7.20605 10.3758 7.61818 9.78182C8.03029 9.18787 8.59393 8.7394 9.30909 8.43636C9.96364 8.15758 10.7697 7.95758 11.7273 7.83636C12.0545 7.8 12.5879 7.75151 13.3273 7.69091V7.38182C13.3273 6.60605 13.2424 6.08485 13.0727 5.81818C12.8182 5.45455 12.4182 5.27273 11.8727 5.27273H11.7273C11.3273 5.30909 10.9818 5.43636 10.6909 5.65455C10.4 5.87273 10.2121 6.17576 10.1273 6.56364C10.0788 6.80605 9.95756 6.94545 9.76364 6.98182L7.67273 6.72727C7.46665 6.67878 7.36364 6.56969 7.36364 6.4C7.36364 6.36364 7.36969 6.32122 7.38182 6.27273C7.58787 5.19395 8.09393 4.39395 8.9 3.87273C9.70605 3.35151 10.6485 3.0606 11.7273 3H12.1818C13.5636 3 14.6424 3.35758 15.4182 4.07273C15.5399 4.19449 15.6523 4.32516 15.7545 4.46364C15.8576 4.60304 15.9394 4.72727 16 4.83636C16.0606 4.94545 16.1151 5.10304 16.1636 5.30909C16.2121 5.51515 16.2485 5.65758 16.2727 5.73636C16.297 5.81515 16.3151 5.98485 16.3273 6.24545C16.3394 6.50605 16.3455 6.6606 16.3455 6.70909V11.1091C16.3455 11.4242 16.3909 11.7121 16.4818 11.9727C16.5727 12.2333 16.6606 12.4212 16.7455 12.5364C16.8303 12.6515 16.9697 12.8364 17.1636 13.0909C17.2364 13.2 17.2727 13.297 17.2727 13.3818C17.2727 13.4788 17.2242 13.5636 17.1273 13.6364C16.1212 14.5091 15.5757 14.9818 15.4909 15.0545C15.3455 15.1636 15.1697 15.1758 14.9636 15.0909C14.7939 14.9455 14.6455 14.8061 14.5182 14.6727C14.3909 14.5394 14.3 14.4424 14.2455 14.3818C14.1909 14.3212 14.103 14.203 13.9818 14.0273C13.8606 13.8515 13.7757 13.7333 13.7273 13.6727C13.0485 14.4121 12.3818 14.8727 11.7273 15.0545C11.3151 15.1758 10.8061 15.2364 10.2 15.2364C9.26665 15.2364 8.5 14.9485 7.9 14.3727C7.3 13.797 7 12.9818 7 11.9273ZM10.1273 11.5636C10.1273 12.0364 10.2455 12.4151 10.4818 12.7C10.7182 12.9849 11.0364 13.1273 11.4364 13.1273C11.4727 13.1273 11.5242 13.1212 11.5909 13.1091C11.6576 13.097 11.703 13.0909 11.7273 13.0909C12.2364 12.9576 12.6303 12.6303 12.9091 12.1091C13.0424 11.8788 13.1424 11.6273 13.2091 11.3545C13.2757 11.0818 13.3121 10.8606 13.3182 10.6909C13.3242 10.5212 13.3273 10.2424 13.3273 9.85455V9.4C12.6242 9.4 12.0909 9.44849 11.7273 9.54545C10.6606 9.84849 10.1273 10.5212 10.1273 11.5636Z",fill:"black"}),/*#__PURE__*/wn.createElement("path",{d:"M2.32727 16.4424C2.19393 16.3576 2.09696 16.3636 2.03636 16.4606C2.01211 16.497 2 16.5333 2 16.5697C2 16.6303 2.03636 16.6909 2.10909 16.7515C3.44242 17.9515 4.95151 18.8818 6.63636 19.5424C8.3212 20.203 10.1091 20.5333 12 20.5333C13.2242 20.5333 14.4788 20.3636 15.7636 20.0242C17.0485 19.6848 18.2121 19.2061 19.2545 18.5879C19.5939 18.3818 19.8727 18.2 20.0909 18.0424C20.2606 17.9212 20.2939 17.7879 20.1909 17.6424C20.0879 17.497 19.9455 17.4606 19.7636 17.5333C19.7151 17.5576 19.6333 17.5939 19.5182 17.6424C19.403 17.6909 19.3151 17.7273 19.2545 17.7515C16.9394 18.6364 14.5939 19.0788 12.2182 19.0788C8.65455 19.0788 5.35756 18.2 2.32727 16.4424Z",fill:"#FF9900"}),/*#__PURE__*/wn.createElement("path",{d:"M18.3818 16.6242C18.3333 16.6727 18.297 16.7212 18.2727 16.7697C18.2606 16.7939 18.2545 16.8121 18.2545 16.8242C18.2424 16.8485 18.2485 16.8727 18.2727 16.897C18.297 16.9212 18.3455 16.9333 18.4182 16.9333C18.6727 16.897 18.9515 16.8606 19.2545 16.8242C19.5333 16.8 19.7757 16.7879 19.9818 16.7879C20.5394 16.7879 20.8788 16.8606 21 17.0061C21.0485 17.0667 21.0727 17.1636 21.0727 17.297C21.0727 17.7091 20.8485 18.4424 20.4 19.497C20.3636 19.5939 20.3818 19.6606 20.4545 19.697C20.4788 19.7091 20.503 19.7152 20.5273 19.7152C20.5757 19.7152 20.6303 19.6909 20.6909 19.6424C21.103 19.2909 21.4242 18.8273 21.6545 18.2515C21.8848 17.6758 22 17.1758 22 16.7515V16.6242C22 16.4788 21.9757 16.3697 21.9273 16.297C21.8182 16.1636 21.4909 16.0727 20.9455 16.0242C20.8364 16 20.7212 15.9939 20.6 16.0061C20.1636 16.0182 19.7151 16.0848 19.2545 16.2061C18.9757 16.2788 18.6848 16.4182 18.3818 16.6242Z",fill:"#FF9900"}));};var AmazonIcon=CreateIcon(AmazonIconSvg);var BitbucketIconSvg=function BitbucketIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M6.98153 7.125C6.68181 7.125 6.45702 7.39974 6.50697 7.67449L8.53009 20.0629C8.58004 20.3877 8.85479 20.6124 9.17948 20.6124H18.9704C19.1952 20.6124 19.395 20.4376 19.4449 20.2128L21.493 7.69947C21.543 7.39974 21.3182 7.14998 21.0185 7.14998L6.98153 7.125ZM15.5736 16.0667H12.4514L11.6272 11.6458H16.3478L15.5736 16.0667Z",fill:"#2684FF"}),/*#__PURE__*/wn.createElement("path",{d:"M20.8186 11.6458H16.3228L15.5735 16.0667H12.4513L8.77979 20.4376C8.77979 20.4376 8.95462 20.5875 9.20439 20.5875H18.9953C19.2201 20.5875 19.4199 20.4126 19.4698 20.1878L20.8186 11.6458Z",fill:"url(#paint0_linear_414_2186)"}),/*#__PURE__*/wn.createElement("path",{d:"M2 2V0.875H0.875V2H2ZM26 2H27.125V0.875H26V2ZM26 26V27.125H27.125V26H26ZM2 26H0.875V27.125H2V26ZM2 3.125H26V0.875H2V3.125ZM24.875 2V26H27.125V2H24.875ZM26 24.875H2V27.125H26V24.875ZM3.125 26V2H0.875V26H3.125Z",fill:"#E5E8EB"}),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("linearGradient",{id:"paint0_linear_414_2186",x1:"21.8703",y1:"12.8916",x2:"14.42",y2:"18.7072",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{offset:"0.176",stopColor:"#0052CC"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#2684FF"}))));};var BitbucketIcon=CreateIcon(BitbucketIconSvg);var LinkedInIconSvg=function LinkedInIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21Z",fill:"#0A66C2"}),/*#__PURE__*/wn.createElement("path",{d:"M18.5 18.5H15.8289V13.9505C15.8289 12.7032 15.3549 12.0061 14.3677 12.0061C13.2937 12.0061 12.7325 12.7315 12.7325 13.9505V18.5H10.1583V9.83333H12.7325V11.0007C12.7325 11.0007 13.5065 9.56855 15.3456 9.56855C17.1839 9.56855 18.5 10.6911 18.5 13.0128V18.5ZM7.08734 8.6985C6.21051 8.6985 5.5 7.98241 5.5 7.09925C5.5 6.21609 6.21051 5.5 7.08734 5.5C7.96416 5.5 8.67425 6.21609 8.67425 7.09925C8.67425 7.98241 7.96416 8.6985 7.08734 8.6985ZM5.75814 18.5H8.44235V9.83333H5.75814V18.5Z",fill:"white"}));};var LinkedInIcon=CreateIcon(LinkedInIconSvg);var CoinbaseIconSvg=function CoinbaseIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.2",baseProfile:"tiny",x:"0px",y:"0px",viewBox:"0 0 1024 1024",overflow:"visible",xmlSpace:"preserve"},/*#__PURE__*/wn.createElement("path",{fill:"#0052FF",d:"M512,0L512,0c282.8,0,512,229.2,512,512l0,0c0,282.8-229.2,512-512,512l0,0C229.2,1024,0,794.8,0,512l0,0 C0,229.2,229.2,0,512,0z"}),/*#__PURE__*/wn.createElement("path",{fill:"#FFFFFF",d:"M512.1,692c-99.4,0-180-80.5-180-180s80.6-180,180-180c89.1,0,163.1,65,177.3,150h181.3 c-15.3-184.8-170-330-358.7-330c-198.8,0-360,161.2-360,360s161.2,360,360,360c188.7,0,343.4-145.2,358.7-330H689.3 C675,627,601.2,692,512.1,692z"}));};var CoinbaseIcon=CreateIcon(CoinbaseIconSvg);var TwitchIconSvg=function TwitchIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 18 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M16.1141 9.78571L13.257 12.6429H10.3998L7.89983 15.1429V12.6429H4.68555V1.92857H16.1141V9.78571Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M3.97133 0.5L0.399902 4.07143V16.9286H4.68562V20.5L8.25704 16.9286H11.1142L17.5428 10.5V0.5H3.97133ZM16.1142 9.78571L13.257 12.6429H10.3999L7.8999 15.1429V12.6429H4.68562V1.92857H16.1142V9.78571Z",fill:"#9146FF"}),/*#__PURE__*/wn.createElement("path",{d:"M13.9713 4.42857H12.5427V8.71428H13.9713V4.42857Z",fill:"#9146FF"}),/*#__PURE__*/wn.createElement("path",{d:"M10.0428 4.42857H8.61426V8.71428H10.0428V4.42857Z",fill:"#9146FF"}));};var TwitchIcon=CreateIcon(TwitchIconSvg);var TwitterIconSvg=function TwitterIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M19.8991 8.13629C19.9112 8.31129 19.9112 8.48629 19.9112 8.66291C19.9112 14.0444 15.8144 20.2508 8.32331 20.2508V20.2476C6.1104 20.2508 3.94347 19.6169 2.08057 18.4218C2.40234 18.4605 2.72573 18.4798 3.04992 18.4806C4.88379 18.4823 6.66524 17.8669 8.10799 16.7339C6.36524 16.7008 4.83702 15.5645 4.30315 13.9056C4.91363 14.0234 5.54266 13.9992 6.14186 13.8355C4.24186 13.4516 2.87492 11.7823 2.87492 9.84355C2.87492 9.82581 2.87492 9.80887 2.87492 9.79194C3.44105 10.1073 4.07492 10.2823 4.72331 10.3016C2.93379 9.10565 2.38218 6.725 3.46282 4.86371C5.53057 7.40807 8.58137 8.95484 11.8564 9.11855C11.5281 7.70403 11.9765 6.22178 13.0346 5.22742C14.6749 3.68549 17.2548 3.76452 18.7967 5.40403C19.7088 5.2242 20.583 4.88952 21.383 4.41532C21.079 5.35807 20.4427 6.15887 19.5927 6.66774C20.3999 6.57258 21.1886 6.35645 21.9314 6.02661C21.3846 6.84597 20.6959 7.55968 19.8991 8.13629Z",fill:"#1D9BF0"}));};var TwitterIcon=CreateIcon(TwitterIconSvg);var TikTokIconSvg=function TikTokIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("circle",{cx:"12",cy:"12",r:"10",fill:"black"}),/*#__PURE__*/wn.createElement("path",{d:"M14.9767 10.0746C15.8641 10.7087 16.9513 11.0817 18.1255 11.0817V8.8234C17.9033 8.82344 17.6816 8.80028 17.4642 8.75425V10.5319C16.2901 10.5319 15.2031 10.1588 14.3154 9.52481V14.1334C14.3154 16.4389 12.4455 18.3077 10.139 18.3077C9.27835 18.3077 8.47845 18.0477 7.81396 17.6017C8.57236 18.3767 9.63 18.8575 10.8001 18.8575C13.1067 18.8575 14.9767 16.9887 14.9767 14.6832V10.0746H14.9767ZM15.7924 7.79623C15.3389 7.30099 15.0411 6.66099 14.9767 5.95344V5.66297H14.35C14.5077 6.56226 15.0458 7.33057 15.7924 7.79623ZM9.27283 15.8325C9.01944 15.5005 8.8825 15.0942 8.88312 14.6766C8.88312 13.6221 9.7384 12.7672 10.7936 12.7672C10.9902 12.7671 11.1857 12.7972 11.3731 12.8567V10.5478C11.1541 10.5178 10.9331 10.5051 10.7121 10.5098V12.3068C10.5246 12.2474 10.329 12.2172 10.1323 12.2174C9.07713 12.2174 8.22189 13.0723 8.22189 14.1268C8.22189 14.8725 8.64939 15.5181 9.27283 15.8325Z",fill:"#FF004F"}),/*#__PURE__*/wn.createElement("path",{d:"M14.3153 9.52476C15.203 10.1588 16.29 10.5318 17.4641 10.5318V8.7542C16.8087 8.61467 16.2285 8.27236 15.7923 7.79623C15.0456 7.33052 14.5076 6.56222 14.3499 5.66297H12.7039V14.6831C12.7001 15.7346 11.8463 16.5861 10.7934 16.5861C10.1729 16.5861 9.6217 16.2905 9.27259 15.8325C8.6492 15.5181 8.2217 14.8725 8.2217 14.1269C8.2217 13.0724 9.07693 12.2175 10.1321 12.2175C10.3343 12.2175 10.5291 12.2489 10.7119 12.3069V10.5098C8.44594 10.5566 6.62354 12.4072 6.62354 14.6831C6.62354 15.8192 7.07736 16.8492 7.81391 17.6017C8.47839 18.0477 9.2783 18.3078 10.1389 18.3078C12.4455 18.3078 14.3153 16.4389 14.3153 14.1334V9.52476H14.3153Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M17.464 8.7542V8.27354C16.873 8.27443 16.2936 8.10901 15.7922 7.79618C16.236 8.28188 16.8205 8.61679 17.464 8.7542ZM14.3498 5.66297C14.3347 5.57703 14.3231 5.49052 14.3151 5.40368V5.1132H12.0424V14.1334C12.0388 15.1848 11.185 16.0363 10.132 16.0363C9.82282 16.0363 9.53093 15.9629 9.27244 15.8326C9.62154 16.2905 10.1728 16.586 10.7932 16.586C11.8461 16.586 12.7 15.7347 12.7037 14.6831V5.66297H14.3498ZM10.7119 10.5098V9.99811C10.522 9.97217 10.3305 9.95915 10.1388 9.95924C7.83206 9.9592 5.96216 11.8281 5.96216 14.1334C5.96216 15.5787 6.69706 16.8524 7.81381 17.6016C7.07725 16.8491 6.62343 15.8191 6.62343 14.6831C6.62343 12.4072 8.44579 10.5566 10.7119 10.5098Z",fill:"#00F2EA"}));};var TikTokIcon=CreateIcon(TikTokIconSvg);var SnapchatIconSvg=function SnapchatIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M18.549 15.4187C16.124 14.2448 15.7375 12.4323 15.7203 12.2978C15.6995 12.135 15.6759 12.007 15.8555 11.8413C16.0288 11.6813 16.7974 11.2055 17.0106 11.0567C17.3631 10.8102 17.5184 10.5642 17.4039 10.2617C17.3239 10.0524 17.1291 9.9736 16.9238 9.9736C16.8591 9.9738 16.7945 9.98105 16.7313 9.99521C16.344 10.0792 15.9679 10.2733 15.7503 10.3257C15.7241 10.3324 15.6973 10.3361 15.6703 10.3365C15.5542 10.3365 15.5102 10.2849 15.5214 10.1453C15.5486 9.72194 15.6062 8.89571 15.5394 8.12391C15.4478 7.06202 15.1053 6.53588 14.6992 6.07055C14.5027 5.84489 13.5905 4.87543 11.83 4.87543C10.0696 4.87543 9.15851 5.84489 8.96326 6.06775C8.55595 6.53308 8.21385 7.05922 8.12303 8.12111C8.05621 8.89291 8.11623 9.71874 8.14104 10.1425C8.14904 10.2753 8.10823 10.3337 7.9922 10.3337C7.96519 10.3332 7.93833 10.3296 7.91217 10.3229C7.69492 10.2705 7.31881 10.0764 6.93151 9.99241C6.86833 9.97825 6.8038 9.971 6.73906 9.9708C6.533 9.9708 6.33895 10.0508 6.25893 10.2589C6.1445 10.5614 6.29894 10.8074 6.65263 11.0539C6.86589 11.2027 7.6345 11.6781 7.80775 11.8385C7.98699 12.0042 7.96379 12.1322 7.94298 12.295C7.92578 12.4315 7.53887 14.244 5.11422 15.4159C4.97218 15.4847 4.73052 15.6303 5.15663 15.8656C5.82561 16.2353 6.27093 16.1957 6.61702 16.4185C6.9107 16.6078 6.73706 17.0159 6.95071 17.1631C7.21319 17.3444 7.98899 17.1503 8.99126 17.4812C9.83149 17.7581 10.342 18.5403 11.832 18.5403C13.322 18.5403 13.8474 17.7545 14.6728 17.4812C15.6731 17.1503 16.4505 17.3444 16.7133 17.1631C16.9266 17.0159 16.7534 16.6078 17.047 16.4185C17.3931 16.1957 17.838 16.2353 18.5074 15.8656C18.9327 15.6331 18.6911 15.4875 18.549 15.4187Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M19.604 15.2806C19.4952 14.9846 19.2879 14.8261 19.0519 14.6949C19.0075 14.6689 18.9666 14.6481 18.9318 14.6321C18.8614 14.5957 18.7894 14.5604 18.7178 14.5232C17.982 14.1331 17.4074 13.641 17.0089 13.0576C16.8957 12.8934 16.7976 12.7193 16.7156 12.5375C16.6816 12.4403 16.6832 12.3851 16.7076 12.3346C16.7318 12.2958 16.7639 12.2624 16.8017 12.2366C16.9281 12.153 17.0585 12.0682 17.147 12.011C17.3046 11.9089 17.4294 11.8281 17.5099 11.7709C17.8119 11.5596 18.0232 11.3352 18.1552 11.0843C18.2473 10.911 18.3011 10.7199 18.3127 10.5239C18.3244 10.328 18.2937 10.1318 18.2228 9.9488C18.0228 9.42226 17.5255 9.09537 16.9229 9.09537C16.7958 9.09525 16.669 9.10866 16.5448 9.13538C16.5116 9.14258 16.4784 9.15019 16.446 9.15859C16.4516 8.79849 16.4436 8.41839 16.4116 8.04429C16.2979 6.72913 15.8374 6.03975 15.3573 5.49C15.0498 5.14551 14.6877 4.85405 14.2854 4.62737C13.5568 4.21126 12.7306 4 11.8299 4C10.9293 4 10.1071 4.21126 9.37766 4.62737C8.9744 4.85412 8.61152 5.14616 8.30377 5.4916C7.82364 6.04135 7.36312 6.73194 7.24949 8.04589C7.21748 8.41999 7.20948 8.80209 7.21468 9.16019C7.18227 9.15179 7.14946 9.14419 7.11625 9.13698C6.992 9.11026 6.86525 9.09685 6.73815 9.09697C6.13519 9.09697 5.63705 9.42386 5.4378 9.9504C5.36658 10.1335 5.33561 10.3298 5.347 10.5259C5.35839 10.7221 5.41188 10.9135 5.50382 11.0871C5.63625 11.338 5.84751 11.5624 6.14959 11.7737C6.22961 11.8297 6.35485 11.9105 6.51249 12.0138C6.59771 12.069 6.72215 12.1498 6.84418 12.2306C6.88687 12.2582 6.92316 12.2946 6.95061 12.3374C6.97621 12.3899 6.97702 12.4463 6.939 12.5503C6.85816 12.7283 6.76162 12.8988 6.65053 13.0596C6.26082 13.6298 5.70307 14.1131 4.99088 14.5C4.61358 14.7001 4.22147 14.8337 4.05583 15.2838C3.93099 15.6235 4.01262 16.01 4.3299 16.3357C4.44635 16.4573 4.58141 16.5595 4.73001 16.6386C5.03921 16.8085 5.368 16.9401 5.70907 17.0303C5.77946 17.0485 5.84628 17.0784 5.90673 17.1187C6.02236 17.22 6.00595 17.3724 6.15999 17.5957C6.23732 17.711 6.33557 17.8109 6.44967 17.8901C6.77296 18.1134 7.13626 18.1274 7.52116 18.1422C7.86885 18.1554 8.26296 18.1706 8.71308 18.3191C8.89953 18.3807 9.09318 18.4999 9.31765 18.6391C9.85659 18.9704 10.5944 19.4238 11.8291 19.4238C13.0639 19.4238 13.8069 18.968 14.3498 18.6355C14.5727 18.4987 14.7651 18.3807 14.9464 18.3207C15.3965 18.1718 15.7906 18.157 16.1383 18.1438C16.5232 18.129 16.8865 18.115 17.2098 17.8917C17.3449 17.7975 17.4575 17.6745 17.5395 17.5316C17.6503 17.3432 17.6475 17.2116 17.7515 17.1195C17.8082 17.0811 17.871 17.0524 17.9372 17.0347C18.2829 16.9442 18.6162 16.8114 18.9294 16.6394C19.0873 16.5547 19.2294 16.4434 19.3495 16.3105L19.3535 16.3057C19.6512 15.9872 19.726 15.6119 19.604 15.2806ZM18.5065 15.8704C17.8371 16.2401 17.3922 16.2005 17.0461 16.4233C16.752 16.6126 16.9261 17.0207 16.7124 17.1679C16.45 17.3492 15.6742 17.1551 14.6719 17.486C13.8453 17.7593 13.3179 18.5451 11.8311 18.5451C10.3443 18.5451 9.82938 17.7609 8.98916 17.484C7.98889 17.1531 7.21148 17.3472 6.94861 17.1659C6.73535 17.0187 6.9086 16.6106 6.61492 16.4213C6.26842 16.1985 5.8235 16.2381 5.15452 15.8704C4.72841 15.6351 4.97007 15.4895 5.11211 15.4207C7.53677 14.2468 7.92367 12.4343 7.94087 12.2998C7.96168 12.137 7.98489 12.009 7.80564 11.8433C7.63239 11.6833 6.86378 11.2075 6.65053 11.0587C6.29763 10.8122 6.14239 10.5662 6.25682 10.2637C6.33684 10.0544 6.5321 9.97561 6.73695 9.97561C6.80169 9.97581 6.86623 9.98305 6.9294 9.99722C7.31671 10.0812 7.69281 10.2753 7.91007 10.3277C7.93623 10.3344 7.96308 10.338 7.99009 10.3385C8.10612 10.3385 8.14693 10.2801 8.13893 10.1473C8.11412 9.72354 8.05411 8.89772 8.12092 8.12591C8.21255 7.06402 8.55464 6.53788 8.96115 6.07256C9.1564 5.8489 10.0738 4.87944 11.8283 4.87944C13.5828 4.87944 14.5026 5.8449 14.6979 6.06776C15.1048 6.53308 15.4473 7.05922 15.5381 8.12111C15.6049 8.89292 15.5473 9.71914 15.5201 10.1425C15.5109 10.2821 15.5529 10.3337 15.669 10.3337C15.696 10.3333 15.7228 10.3296 15.749 10.3229C15.9666 10.2705 16.3427 10.0764 16.73 9.99241C16.7932 9.97825 16.8577 9.97101 16.9225 9.97081C17.1285 9.97081 17.3226 10.0508 17.4026 10.2589C17.5171 10.5614 17.3626 10.8074 17.0093 11.0539C16.7961 11.2027 16.0275 11.6781 15.8542 11.8385C15.6746 12.0042 15.6982 12.1322 15.719 12.295C15.7362 12.4315 16.1227 14.244 18.5477 15.4159C18.691 15.4875 18.9326 15.6331 18.5065 15.8704Z",fill:"black"}));};var SnapchatIcon=CreateIcon(SnapchatIconSvg);var FigmaIconSvg=function FigmaIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12.3157 12C12.3157 10.1591 13.7295 8.66665 15.4736 8.66665C17.2176 8.66665 18.6315 10.1591 18.6315 12C18.6315 13.8409 17.2176 15.3333 15.4736 15.3333C13.7295 15.3333 12.3157 13.8409 12.3157 12Z",fill:"#1ABCFE"}),/*#__PURE__*/wn.createElement("path",{d:"M6 18.6666C6 16.8257 7.41384 15.3333 9.15789 15.3333H12.3158V18.6666C12.3158 20.5076 10.902 22 9.15789 22C7.41384 22 6 20.5076 6 18.6666Z",fill:"#0ACF83"}),/*#__PURE__*/wn.createElement("path",{d:"M12.3157 2V8.66665H15.4736C17.2176 8.66665 18.6315 7.17428 18.6315 5.33333C18.6315 3.49238 17.2176 2 15.4736 2H12.3157Z",fill:"#FF7262"}),/*#__PURE__*/wn.createElement("path",{d:"M6 5.33333C6 7.17428 7.41384 8.66665 9.15789 8.66665H12.3158V2H9.15789C7.41384 2 6 3.49238 6 5.33333Z",fill:"#F24E1E"}),/*#__PURE__*/wn.createElement("path",{d:"M6 12C6 13.8409 7.41384 15.3333 9.15789 15.3333H12.3158V8.66665H9.15789C7.41384 8.66665 6 10.1591 6 12Z",fill:"#A259FF"}));};var FigmaIcon=CreateIcon(FigmaIconSvg);var SalesforceIconSvg=function SalesforceIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("g",{clipPath:"url(#clip0_1550_2151)"},/*#__PURE__*/wn.createElement("path",{d:"M8.3228 1.52737C8.96783 0.855295 9.86583 0.438458 10.859 0.438458C12.1792 0.438458 13.3311 1.17463 13.9445 2.26751C14.4775 2.02935 15.0675 1.89686 15.6883 1.89686C18.0695 1.89686 20 3.84416 20 6.24615C20 8.64841 18.0695 10.5957 15.6883 10.5957C15.4031 10.5959 15.1186 10.5675 14.839 10.5111C14.2989 11.4746 13.2695 12.1256 12.088 12.1256C11.5935 12.1256 11.1256 12.0114 10.7091 11.8082C10.1615 13.0963 8.88577 13.9994 7.39886 13.9994C5.85043 13.9994 4.53077 13.0196 4.02422 11.6456C3.80286 11.6926 3.57351 11.7171 3.33818 11.7171C1.49459 11.7171 0 10.2071 0 8.34416C0 7.09573 0.671511 6.00568 1.66923 5.4225C1.46382 4.94987 1.34957 4.42821 1.34957 3.87976C1.34957 1.73732 3.08889 0.000579834 5.23419 0.000579834C6.49373 0.000579834 7.61311 0.599439 8.3228 1.52737Z",fill:"#00A1E0"}),/*#__PURE__*/wn.createElement("path",{d:"M2.89685 7.26004C2.88432 7.29281 2.90142 7.29966 2.9054 7.30535C2.943 7.33269 2.9812 7.35237 3.01965 7.37429C3.22364 7.48254 3.41625 7.51416 3.61767 7.51416C4.02792 7.51416 4.28262 7.29594 4.28262 6.94465V6.93782C4.28262 6.61301 3.99517 6.49508 3.72536 6.40989L3.69033 6.3985C3.4869 6.33239 3.31141 6.27544 3.31141 6.14152V6.13442C3.31141 6.01988 3.41397 5.93554 3.57295 5.93554C3.74958 5.93554 3.95927 5.99424 4.09431 6.06887C4.09431 6.06887 4.13391 6.09452 4.14844 6.05606C4.15641 6.03554 4.2248 5.85149 4.23193 5.83155C4.23961 5.80989 4.22594 5.79393 4.21199 5.78539C4.05785 5.69165 3.84474 5.62755 3.62424 5.62755L3.58322 5.62783C3.20772 5.62783 2.94562 5.85462 2.94562 6.17968V6.18653C2.94562 6.52925 3.23479 6.64036 3.50574 6.71786L3.54932 6.73125C3.74676 6.79193 3.91685 6.84407 3.91685 6.9831V6.98995C3.91685 7.11702 3.80632 7.21159 3.62796 7.21159C3.55873 7.21159 3.33793 7.21017 3.09947 7.05944C3.07069 7.04262 3.05389 7.03039 3.03167 7.017C3.01999 7.00959 2.99065 6.99676 2.97783 7.03552L2.89685 7.26004ZM8.90282 7.26004C8.89029 7.29281 8.90738 7.29966 8.91137 7.30535C8.94896 7.33269 8.98716 7.35237 9.0256 7.37429C9.22958 7.48254 9.42222 7.51416 9.62362 7.51416C10.0339 7.51416 10.2886 7.29594 10.2886 6.94465V6.93782C10.2886 6.61301 10.0011 6.49508 9.73131 6.40989L9.69627 6.3985C9.49285 6.33239 9.31733 6.27544 9.31733 6.14152V6.13442C9.31733 6.01988 9.41989 5.93554 9.57887 5.93554C9.75551 5.93554 9.9652 5.99424 10.1003 6.06887C10.1003 6.06887 10.1399 6.09452 10.1544 6.05606C10.1623 6.03554 10.2307 5.85149 10.2379 5.83155C10.2456 5.80989 10.2319 5.79393 10.2179 5.78539C10.0638 5.69165 9.85067 5.62755 9.63016 5.62755L9.58912 5.62783C9.21363 5.62783 8.95153 5.85462 8.95153 6.17968V6.18653C8.95153 6.52925 9.2407 6.64036 9.51165 6.71786L9.55523 6.73125C9.75267 6.79193 9.92306 6.84407 9.92306 6.9831V6.98995C9.92306 7.11702 9.81223 7.21159 9.63387 7.21159C9.56466 7.21159 9.34386 7.21017 9.1054 7.05944C9.07661 7.04262 9.05953 7.03095 9.03789 7.017C9.03047 7.01215 8.99571 6.99876 8.98374 7.03552L8.90282 7.26004ZM13.0029 6.57195C13.0029 6.77053 12.9659 6.92693 12.893 7.03748C12.8209 7.14689 12.7118 7.20016 12.5597 7.20016C12.4072 7.20016 12.2987 7.14717 12.2277 7.03748C12.1559 6.92723 12.1195 6.77053 12.1195 6.57195C12.1195 6.37367 12.1559 6.21754 12.2277 6.10813C12.2987 5.99988 12.4072 5.94717 12.5597 5.94717C12.7118 5.94717 12.8209 5.99988 12.8933 6.10813C12.9659 6.21752 13.0029 6.37365 13.0029 6.57195ZM13.3454 6.20386C13.3118 6.09017 13.2594 5.98989 13.1896 5.90643C13.1198 5.82266 13.0314 5.75544 12.9266 5.70643C12.822 5.65772 12.6984 5.63293 12.5597 5.63293C12.4206 5.63293 12.297 5.65772 12.1924 5.70643C12.0876 5.75544 11.9993 5.82268 11.9292 5.90643C11.8597 5.99019 11.8072 6.09047 11.7733 6.20386C11.74 6.31696 11.7232 6.4406 11.7232 6.57195C11.7232 6.7033 11.74 6.82723 11.7733 6.94004C11.8072 7.05343 11.8594 7.15373 11.9295 7.23748C11.9993 7.32124 12.0879 7.38819 12.1924 7.43576C12.2973 7.48334 12.4206 7.50755 12.5597 7.50755C12.6984 7.50755 12.8218 7.48334 12.9266 7.43576C13.0312 7.38819 13.1198 7.32122 13.1896 7.23748C13.2594 7.15399 13.3118 7.05371 13.3454 6.94004C13.3791 6.82695 13.3959 6.703 13.3959 6.57195C13.3959 6.4409 13.379 6.31696 13.3454 6.20386ZM16.1576 7.14713C16.1462 7.11379 16.114 7.12633 16.114 7.12633C16.0641 7.14543 16.0111 7.16308 15.9547 7.17191C15.8974 7.18072 15.8345 7.18531 15.7669 7.18531C15.6012 7.18531 15.4695 7.13602 15.3752 7.03858C15.2806 6.94114 15.2276 6.7836 15.2282 6.57049C15.2288 6.37648 15.2755 6.23059 15.3596 6.1195C15.443 6.00897 15.5701 5.95225 15.7396 5.95225C15.8809 5.95225 15.9886 5.96849 16.1014 6.00411C16.1014 6.00411 16.1285 6.01578 16.1413 5.98046C16.1712 5.89726 16.1934 5.83772 16.2253 5.74627C16.2345 5.72034 16.2122 5.70923 16.2043 5.70609C16.1598 5.68871 16.055 5.66052 15.9758 5.64855C15.9017 5.63716 15.8151 5.63117 15.7188 5.63117C15.5749 5.63117 15.4467 5.65568 15.337 5.70469C15.2276 5.75339 15.1347 5.82062 15.0613 5.90441C14.9877 5.98817 14.9319 6.08843 14.8946 6.20182C14.8576 6.31492 14.8388 6.43914 14.8388 6.57049C14.8388 6.85454 14.9154 7.08415 15.0667 7.25225C15.2182 7.42092 15.4459 7.50667 15.7428 7.50667C15.9183 7.50667 16.0983 7.47107 16.2277 7.42006C16.2277 7.42006 16.2524 7.40809 16.2416 7.37934L16.1576 7.14713ZM16.7567 6.38172C16.773 6.27147 16.8035 6.17972 16.8505 6.10823C16.9214 5.99968 17.0297 5.94014 17.1818 5.94014C17.334 5.94014 17.4345 5.99996 17.5066 6.10823C17.5545 6.17972 17.5753 6.27548 17.5835 6.38172H16.7567ZM17.9097 6.13926C17.8807 6.02957 17.8086 5.91874 17.7613 5.86803C17.6866 5.78769 17.6137 5.73157 17.5414 5.70022C17.4468 5.65976 17.3334 5.63299 17.2092 5.63299C17.0644 5.63299 16.9331 5.65722 16.8265 5.70735C16.7197 5.7575 16.63 5.82589 16.5596 5.91107C16.4892 5.99596 16.4362 6.0971 16.4026 6.21191C16.3687 6.32617 16.3516 6.45067 16.3516 6.58198C16.3516 6.71562 16.3693 6.84012 16.4043 6.95207C16.4397 7.06491 16.496 7.16433 16.5724 7.24665C16.6485 7.32957 16.7465 7.39454 16.8639 7.4398C16.9804 7.48483 17.122 7.50819 17.2847 7.50789C17.6194 7.50675 17.7958 7.43211 17.8684 7.39193C17.8813 7.38483 17.8935 7.37229 17.8781 7.3364L17.8023 7.12413C17.7909 7.09251 17.7587 7.10419 17.7587 7.10419C17.6758 7.13496 17.5579 7.19023 17.2829 7.18967C17.1032 7.18939 16.9698 7.1364 16.8863 7.05347C16.8006 6.96859 16.7587 6.84378 16.7513 6.66773L17.9106 6.66887C17.9106 6.66887 17.941 6.66831 17.9442 6.63866C17.9453 6.62617 17.9841 6.40052 17.9097 6.13926ZM7.47275 6.38172C7.48926 6.27147 7.51947 6.17972 7.56648 6.10823C7.63741 5.99968 7.74568 5.94014 7.89781 5.94014C8.04994 5.94014 8.15053 5.99996 8.22288 6.10823C8.27044 6.17972 8.29125 6.27548 8.29951 6.38172H7.47275ZM8.62544 6.13926C8.59639 6.02957 8.5246 5.91874 8.47731 5.86803C8.40266 5.78769 8.32972 5.73157 8.25737 5.70022C8.16278 5.65976 8.0494 5.63299 7.92518 5.63299C7.78074 5.63299 7.6491 5.65722 7.54256 5.70735C7.43573 5.7575 7.34598 5.82589 7.27561 5.91107C7.20524 5.99596 7.15225 6.0971 7.11863 6.21191C7.08502 6.32617 7.06764 6.45067 7.06764 6.58198C7.06764 6.71562 7.0853 6.84012 7.12036 6.95207C7.15569 7.06491 7.21211 7.16433 7.28844 7.24665C7.36452 7.32957 7.46252 7.39454 7.5799 7.4398C7.69643 7.48483 7.83801 7.50819 8.0007 7.50789C8.33545 7.50675 8.51181 7.43211 8.58446 7.39193C8.59729 7.38483 8.60952 7.37229 8.59415 7.3364L8.51865 7.12413C8.50696 7.09251 8.47479 7.10419 8.47479 7.10419C8.39189 7.13496 8.27421 7.19023 7.99871 7.18967C7.81923 7.18939 7.6859 7.1364 7.60242 7.05347C7.51665 6.96859 7.47479 6.84378 7.46736 6.66773L8.62662 6.66887C8.62662 6.66887 8.65709 6.66831 8.66023 6.63866C8.66134 6.62617 8.70007 6.40052 8.62544 6.13926ZM4.96702 7.14078C4.92172 7.10459 4.91545 7.09548 4.90007 7.07211C4.87727 7.0365 4.8656 6.98579 4.8656 6.9214C4.8656 6.8194 4.89921 6.74619 4.96902 6.6969C4.96818 6.6972 5.06874 6.61001 5.3052 6.61313C5.47129 6.61542 5.61971 6.63992 5.61971 6.63992V7.16699H5.62C5.62 7.16699 5.47271 7.1986 5.3069 7.20857C5.07101 7.22282 4.96616 7.1405 4.96702 7.14078ZM5.42826 6.32625C5.38126 6.32282 5.32028 6.32082 5.24734 6.32082C5.14792 6.32082 5.05191 6.33335 4.96188 6.35758C4.87129 6.38178 4.7898 6.4197 4.71971 6.46981C4.64973 6.51976 4.59221 6.58518 4.55163 6.66098C4.51061 6.73734 4.4898 6.82737 4.4898 6.92823C4.4898 7.03079 4.50746 7.11996 4.5428 7.19291C4.57813 7.26613 4.62912 7.32709 4.69407 7.37412C4.75845 7.42112 4.83795 7.45558 4.93025 7.47638C5.02114 7.49718 5.12426 7.50771 5.23709 7.50771C5.35589 7.50771 5.47441 7.49804 5.58922 7.47836C5.7029 7.45898 5.8425 7.43077 5.88124 7.42196C5.9084 7.41542 5.93547 7.40848 5.96244 7.40116C5.99123 7.39405 5.98894 7.36326 5.98894 7.36326L5.98836 6.30316C5.98836 6.07067 5.92626 5.8983 5.80404 5.79147C5.68238 5.68493 5.50318 5.63105 5.27157 5.63105C5.18466 5.63105 5.04478 5.64304 4.96102 5.65984C4.96102 5.65984 4.70774 5.70885 4.60346 5.79033C4.60346 5.79033 4.58068 5.80459 4.59321 5.8365L4.67527 6.05702C4.68552 6.08551 4.71317 6.07582 4.71317 6.07582C4.71317 6.07582 4.722 6.07239 4.73227 6.06641C4.95535 5.94505 5.23739 5.94875 5.23739 5.94875C5.36276 5.94875 5.45905 5.97381 5.524 6.02366C5.58724 6.07209 5.61943 6.14531 5.61943 6.29972V6.34873C5.51971 6.3345 5.42826 6.32625 5.42826 6.32625ZM14.7782 5.72893C14.787 5.7027 14.7685 5.69017 14.7608 5.68733C14.7412 5.67964 14.6426 5.65884 14.5665 5.65399C14.4209 5.64517 14.34 5.66967 14.2676 5.70214C14.1959 5.73462 14.1161 5.78703 14.0716 5.84659V5.70557C14.0716 5.68591 14.0577 5.67023 14.0383 5.67023H13.7411C13.7218 5.67023 13.7078 5.68589 13.7078 5.70557V7.43462C13.7078 7.45399 13.7238 7.46995 13.7431 7.46995H14.0477C14.057 7.4699 14.066 7.46615 14.0725 7.45952C14.0791 7.4529 14.0828 7.44394 14.0827 7.43462V6.57081C14.0827 6.45486 14.0956 6.3392 14.1212 6.26655C14.1463 6.19474 14.1805 6.1372 14.2226 6.09588C14.2651 6.05486 14.3132 6.02609 14.3659 6.00985C14.4198 5.99331 14.4793 5.98791 14.5215 5.98791C14.5822 5.98791 14.6488 6.00356 14.6488 6.00356C14.671 6.00613 14.6836 5.99245 14.691 5.97223C14.7109 5.91924 14.7674 5.76054 14.7782 5.72893Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M11.9195 4.92756C11.8825 4.91617 11.8489 4.90846 11.805 4.90022C11.7605 4.89225 11.7075 4.88824 11.6474 4.88824C11.4377 4.88824 11.2725 4.9475 11.1566 5.0643C11.0412 5.18056 10.9628 5.35747 10.9235 5.59025L10.9092 5.66858H10.646C10.646 5.66858 10.6141 5.66744 10.6072 5.70222L10.5642 5.94352C10.5611 5.96632 10.5711 5.98084 10.6018 5.98084H10.858L10.5981 7.43155C10.5779 7.54836 10.5545 7.64438 10.5286 7.71729C10.5032 7.78911 10.4785 7.84294 10.4477 7.88226C10.4181 7.91988 10.3901 7.94778 10.3417 7.96402C10.3018 7.97741 10.2557 7.98368 10.2052 7.98368C10.1773 7.98368 10.14 7.9791 10.1124 7.97341C10.085 7.96798 10.0705 7.96202 10.0497 7.95317C10.0497 7.95317 10.0198 7.9418 10.0078 7.97171C9.99839 7.99649 9.93003 8.18422 9.92176 8.20732C9.91379 8.23039 9.92518 8.24834 9.9397 8.25375C9.97389 8.26572 9.99924 8.27369 10.0457 8.2848C10.1101 8.29992 10.1645 8.30076 10.2155 8.30076C10.322 8.30076 10.4195 8.28566 10.5001 8.25661C10.581 8.22726 10.6516 8.17625 10.7143 8.10732C10.7819 8.03267 10.8243 7.95461 10.8648 7.84778C10.9049 7.74236 10.9394 7.61131 10.9668 7.45861L11.228 5.98084H11.6098C11.6098 5.98084 11.642 5.98198 11.6485 5.94694L11.6918 5.70592C11.6947 5.68286 11.685 5.66861 11.6539 5.66861H11.2833C11.2853 5.66036 11.3021 5.52985 11.3445 5.40708C11.3628 5.35495 11.397 5.31249 11.4257 5.28342C11.4543 5.25493 11.487 5.23471 11.5229 5.22302C11.5597 5.21105 11.6016 5.20536 11.6474 5.20536C11.6822 5.20536 11.7166 5.20935 11.7426 5.21475C11.7785 5.22246 11.7924 5.22644 11.8018 5.22931C11.8397 5.2407 11.8448 5.22959 11.8523 5.21137L11.9409 4.96806C11.95 4.9418 11.9275 4.93069 11.9195 4.92756ZM6.74074 7.43469C6.74074 7.45407 6.72678 7.46975 6.7074 7.46975H6.4C6.38062 7.46975 6.36694 7.45407 6.36694 7.43469V4.96062C6.36694 4.94126 6.38062 4.92558 6.4 4.92558H6.7074C6.72678 4.92558 6.74074 4.94126 6.74074 4.96062V7.43469Z",fill:"white"})));};var SalesforceIcon=CreateIcon(SalesforceIconSvg);var YahooLogoIconSvg=function YahooLogoIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg","aria-label":"Yahoo!",role:"img",viewBox:"0 0 512 512",fill:"#ffffff"},/*#__PURE__*/wn.createElement("rect",{width:"512",height:"512",rx:"15%",fill:"#5f01d1"}),/*#__PURE__*/wn.createElement("g",{fill:"#ffffff"},/*#__PURE__*/wn.createElement("path",{d:"M203 404h-62l25-59-69-165h63l37 95 37-95h62m58 76h-69l62-148h69"}),/*#__PURE__*/wn.createElement("circle",{cx:"303",cy:"308",r:"38"})));};var YahooIcon=CreateIcon(YahooLogoIconSvg);var providerInfo=(_providerInfo={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_providerInfo,OAuthProviders.Google,{messageDescriptor:{id:'oauth.continueWithGoogle',message:"Continue with Google"},icon:/*#__PURE__*/wn.createElement(GoogleIcon,null)}),OAuthProviders.Microsoft,{messageDescriptor:{id:'oauth.continueWithMicrosoft',message:"Continue with Microsoft"},icon:/*#__PURE__*/wn.createElement(MicrosoftIcon,null)}),OAuthProviders.Apple,{messageDescriptor:{id:'oauth.continueWithApple',message:"Continue with Apple"},icon:/*#__PURE__*/wn.createElement(AppleIcon,null)}),OAuthProviders.Github,{messageDescriptor:{id:'oauth.continueWithGitHub',message:"Continue with GitHub"},icon:/*#__PURE__*/wn.createElement(GithubIcon,null)}),OAuthProviders.GitLab,{messageDescriptor:{id:'oauth.continueWithGitLab',message:"Continue with GitLab"},icon:/*#__PURE__*/wn.createElement(GitLabIcon,null)}),OAuthProviders.Facebook,{messageDescriptor:{id:'oauth.continueWithFacebook',message:"Continue with Facebook"},icon:/*#__PURE__*/wn.createElement(FacebookIcon,null)}),OAuthProviders.Discord,{messageDescriptor:{id:'oauth.continueWithDiscord',message:"Continue with Discord"},icon:/*#__PURE__*/wn.createElement(DiscordIcon,null)}),OAuthProviders.Salesforce,{messageDescriptor:{id:'oauth.continueWithSalesforce',message:"Continue with Salesforce"},icon:/*#__PURE__*/wn.createElement(SalesforceIcon,null)}),OAuthProviders.Slack,{messageDescriptor:{id:'oauth.continueWithSlack',message:"Continue with Slack"},icon:/*#__PURE__*/wn.createElement(SlackIcon,null)}),OAuthProviders.Amazon,{messageDescriptor:{id:'oauth.continueWithAmazon',message:"Continue with Amazon"},icon:/*#__PURE__*/wn.createElement(AmazonIcon,null)}),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_providerInfo,OAuthProviders.Bitbucket,{messageDescriptor:{id:'oauth.continueWithBitbucket',message:"Continue with Bitbucket"},icon:/*#__PURE__*/wn.createElement(BitbucketIcon,null)}),OAuthProviders.LinkedIn,{messageDescriptor:{id:'oauth.continueWithLinkedIn',message:"Continue with LinkedIn"},icon:/*#__PURE__*/wn.createElement(LinkedInIcon,null)}),OAuthProviders.Coinbase,{messageDescriptor:{id:'oauth.continueWithCoinbase',message:"Continue with Coinbase"},icon:/*#__PURE__*/wn.createElement(CoinbaseIcon,null)}),OAuthProviders.Twitch,{messageDescriptor:{id:'oauth.continueWithTwitch',message:"Continue with Twitch"},icon:/*#__PURE__*/wn.createElement(TwitchIcon,null)}),OAuthProviders.Twitter,{messageDescriptor:{id:'oauth.continueWithTwitter',message:"Continue with Twitter"},icon:/*#__PURE__*/wn.createElement(TwitterIcon,null)}),OAuthProviders.TikTok,{messageDescriptor:{id:'oauth.continueWithTikTok',message:"Continue with TikTok"},icon:/*#__PURE__*/wn.createElement(TikTokIcon,null)}),OAuthProviders.Snapchat,{messageDescriptor:{id:'oauth.continueWithSnapchat',message:"Continue with Snapchat"},icon:/*#__PURE__*/wn.createElement(SnapchatIcon,null)}),OAuthProviders.Figma,{messageDescriptor:{id:'oauth.continueWithFigma',message:"Continue with Figma"},icon:/*#__PURE__*/wn.createElement(FigmaIcon,null)}),OAuthProviders.Yahoo,{messageDescriptor:{id:'oauth.continueWithYahoo',message:"Continue with Yahoo"},icon:/*#__PURE__*/wn.createElement(YahooIcon,null)}));var defaultProviderInfo={messageDescriptor:null,icon:/*#__PURE__*/wn.createElement(wn.Fragment,null)};var OAuthButtons=function OAuthButtons(){var _useLingui7=useLingui(),_t=_useLingui7._;var config=useConfig();var _useLastUsedOAuth3=useLastUsedOAuth(),_useLastUsedOAuth4=_slicedToArray2(_useLastUsedOAuth3,2),lastUsedOAuth=_useLastUsedOAuth4[0],setLastUsedOAuth=_useLastUsedOAuth4[1];if(!config.oauthOptions)return/*#__PURE__*/wn.createElement(wn.Fragment,null);var _config$oauthOptions=config.oauthOptions,providers=_config$oauthOptions.providers,loginRedirectURL=_config$oauthOptions.loginRedirectURL,signupRedirectURL=_config$oauthOptions.signupRedirectURL;var _arrayUtils$moveToFro=arrayUtils.moveToFront(providers,function(provider){return provider.type===lastUsedOAuth;}),_arrayUtils$moveToFro2=_slicedToArray2(_arrayUtils$moveToFro,2),reorderedProviders=_arrayUtils$moveToFro2[0],foundLastUsed=_arrayUtils$moveToFro2[1];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8,className:"oauth-buttons"},reorderedProviders.map(function(provider,index){var _a;var _ref71=(_a=providerInfo[provider.type])!==null&&_a!==void 0?_a:defaultProviderInfo,icon=_ref71.icon,messageDescriptor=_ref71.messageDescriptor;var providerProps={customScopes:provider.custom_scopes,providerParams:provider.provider_params};if(provider.one_tap){return/*#__PURE__*/wn.createElement(GoogleOneTap,Object.assign({position:provider.position,key:"oauth-".concat(provider.type)},providerProps,{cancelOnTapOutside:provider.cancel_on_tap_outside}));}var button=/*#__PURE__*/wn.createElement(OAuthButton,Object.assign({key:"oauth-".concat(provider.type),providerType:provider.type,icon:icon,label:messageDescriptor?_t(messageDescriptor):'',loginRedirectUrl:loginRedirectURL,signupRedirectUrl:signupRedirectURL,onSuccess:function onSuccess(){return setLastUsedOAuth(provider.type);}},providerProps));if(foundLastUsed&&index===0){return/*#__PURE__*/wn.createElement("div",{key:"oauth-".concat(provider.type)},/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary",align:"right"},_t({id:'provider.lastUsed',message:"Last used"})),button);}return button;}));};var useLayoutEffect$1=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?y$2:function(){};var r=compat_module["useId".toString()]||function(){};var n$3=0;function useId(o){var _h$11=h$5(r()),_h$12=_slicedToArray2(_h$11,2),u=_h$12[0],i=_h$12[1];return useLayoutEffect$1(function(){i(function(t){return null!=t?t:String(n$3++);});},[o]),u?"radix-".concat(u):"";}function useCallbackRef(r){var t=_$2(r);return p$5(function(){t.current=r;}),F$4(function(){return function(){var _r;var r;for(var _len7=arguments.length,e=new Array(_len7),_key7=0;_key7<_len7;_key7++){e[_key7]=arguments[_key7];}return null===(r=t.current)||void 0===r?void 0:(_r=r).call.apply(_r,[t].concat(e));};},[]);}function useControllableState(_ref72){var o=_ref72.prop,r=_ref72.defaultProp,_ref72$onChange=_ref72.onChange,n=_ref72$onChange===void 0?function(){}:_ref72$onChange;var _ref73=function(_ref75){var o=_ref75.defaultProp,r=_ref75.onChange;var n=h$5(o),_n2=_slicedToArray2(n,1),a=_n2[0],u=_$2(a),c=useCallbackRef(r);return p$5(function(){u.current!==a&&(c(a),u.current=a);},[a,u,c]),n;}({defaultProp:r,onChange:n}),_ref74=_slicedToArray2(_ref73,2),a=_ref74[0],u=_ref74[1],c=void 0!==o,f=c?o:a,l=useCallbackRef(n);return[f,T$3(function(e){if(c){var _t13=e,_r2="function"==typeof e?_t13(o):e;_r2!==o&&l(_r2);}else u(e);},[c,o,u,l])];}function composeRefs(){for(var _len8=arguments.length,o=new Array(_len8),_key8=0;_key8<_len8;_key8++){o[_key8]=arguments[_key8];}return function(e){return o.forEach(function(o){return function(o,e){"function"==typeof o?o(e):null!=o&&(o.current=e);}(o,e);});};}function useComposedRefs(){for(var _len9=arguments.length,e=new Array(_len9),_key9=0;_key9<_len9;_key9++){e[_key9]=arguments[_key9];}return T$3(composeRefs.apply(void 0,e),e);}function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r]);}return n;},_extends.apply(null,arguments);}var Slot=/*#__PURE__*/N$1(function(e,o){var a=e.children,s=_objectWithoutProperties(e,_excluded2);return A$3.toArray(a).some(l$3)?/*#__PURE__*/y$3(g$7,null,A$3.map(a,function(e){return l$3(e)?/*#__PURE__*/y$3(n$2,_extends({},s,{ref:o}),e.props.children):e;})):/*#__PURE__*/y$3(n$2,_extends({},s,{ref:o}),a);});Slot.displayName="Slot";var n$2=/*#__PURE__*/N$1(function(r,n){var l=r.children,a=_objectWithoutProperties(r,_excluded3);return/*#__PURE__*/fn(l)?/*#__PURE__*/sn(l,_objectSpread(_objectSpread({},o$1(a,l.props)),{},{ref:composeRefs(n,l.ref)})):A$3.count(l)>1?A$3.only(null):null;});n$2.displayName="SlotClone";var Slottable=function Slottable(_ref76){var e=_ref76.children;return/*#__PURE__*/y$3(g$7,null,e);};function l$3(e){return/*#__PURE__*/fn(e)&&e.type===Slottable;}function o$1(e,t){var r=_objectSpread({},t);var _loop2=function _loop2(){var l=e[_n3],o=t[_n3];/^on[A-Z]/.test(_n3)?r[_n3]=function(){null==o||o.apply(void 0,arguments),null==l||l.apply(void 0,arguments);}:"style"===_n3?r[_n3]=_objectSpread(_objectSpread({},l),o):"className"===_n3&&(r[_n3]=[l,o].filter(Boolean).join(" "));};for(var _n3 in t){_loop2();}return _objectSpread(_objectSpread({},e),r);}var Primitive=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce(function(o,i){return _objectSpread(_objectSpread({},o),{},_defineProperty({},i,/*#__PURE__*/N$1(function(o,m){var a=o.asChild,s=_objectWithoutProperties(o,_excluded4),n=a?Slot:i;return p$5(function(){window[Symbol["for"]("radix-ui")]=!0;},[]),/*#__PURE__*/y$3(n,_extends({},s,{ref:m}));})));},{});function createContextScope(n){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var r=[];var c=function c(){var t=r.map(function(t){return/*#__PURE__*/F$5(t);});return function(o){var r=(null==o?void 0:o[n])||t;return F$4(function(){return _defineProperty({},"__scope".concat(n),_objectSpread(_objectSpread({},o),{},_defineProperty({},n,r)));},[o,r]);};};return c.scopeName=n,[function(t,o){var c=/*#__PURE__*/F$5(o),u=r.length;function s(t){var o=t.scope,r=t.children,s=_objectWithoutProperties(t,_excluded5),i=(null==o?void 0:o[n][u])||c,a=F$4(function(){return s;},Object.values(s));return/*#__PURE__*/y$3(i.Provider,{value:a},r);}return r=[].concat(_toConsumableArray2(r),[o]),s.displayName=t+"Provider",[s,function(r,s){var i=(null==s?void 0:s[n][u])||c,a=q$4(i);if(a)return a;if(void 0!==o)return o;throw new Error("`".concat(r,"` must be used within `").concat(t,"`"));}];},t$1.apply(void 0,[c].concat(_toConsumableArray2(o)))];}function t$1(){for(var _len0=arguments.length,t=new Array(_len0),_key0=0;_key0<_len0;_key0++){t[_key0]=arguments[_key0];}var n=t[0];if(1===t.length)return n;var o=function o(){var o=t.map(function(e){return{useScope:e(),scopeName:e.scopeName};});return function(t){var r=o.reduce(function(e,_ref78){var n=_ref78.useScope,o=_ref78.scopeName;return _objectSpread(_objectSpread({},e),n(t)["__scope".concat(o)]);},{});return F$4(function(){return _defineProperty({},"__scope".concat(n.scopeName),r);},[r]);};};return o.scopeName=n.scopeName,o;}function createCollection(c){var n=c+"CollectionProvider",_createContextScope=createContextScope(n),_createContextScope2=_slicedToArray2(_createContextScope,2),l=_createContextScope2[0],i=_createContextScope2[1],_l=l(n,{collectionRef:{current:null},itemMap:new Map()}),_l2=_slicedToArray2(_l,2),f=_l2[0],a=_l2[1],u=function u(e){var r=e.scope,t=e.children,c=wn.useRef(null),n=wn.useRef(new Map()).current;return/*#__PURE__*/wn.createElement(f,{scope:r,itemMap:n,collectionRef:c},t);},m=c+"CollectionSlot",s=/*#__PURE__*/wn.forwardRef(function(t,c){var n=t.scope,l=t.children,i=a(m,n),f=useComposedRefs(c,i.collectionRef);return/*#__PURE__*/wn.createElement(Slot,{ref:f},l);}),p=c+"CollectionItemSlot",d="data-radix-collection-item",R=/*#__PURE__*/wn.forwardRef(function(t,c){var n=t.scope,l=t.children,i=_objectWithoutProperties(t,_excluded6),f=wn.useRef(null),u=useComposedRefs(c,f),m=a(p,n);return wn.useEffect(function(){return m.itemMap.set(f,_objectSpread({ref:f},i)),function(){m.itemMap["delete"](f);};}),/*#__PURE__*/wn.createElement(Slot,_defineProperty(_defineProperty({},d,""),"ref",u),l);});return[{Provider:u,Slot:s,ItemSlot:R},function(e){var r=a(c+"CollectionConsumer",e);return wn.useCallback(function(){var e=r.collectionRef.current;if(!e)return[];var t=Array.from(e.querySelectorAll("[".concat(d,"]")));return Array.from(r.itemMap.values()).sort(function(e,r){return t.indexOf(e.ref.current)-t.indexOf(r.ref.current);});},[r.collectionRef,r.itemMap]);},i];}function composeEventHandlers(e,n){var _ref80=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref80$checkForDefaul=_ref80.checkForDefaultPrevented,t=_ref80$checkForDefaul===void 0?!0:_ref80$checkForDefaul;return function(r){if(null==e||e(r),!1===t||!r.defaultPrevented)return null==n?void 0:n(r);};}var f$2={bubbles:!1,cancelable:!0},_createCollection=createCollection("RovingFocusGroup"),_createCollection2=_slicedToArray2(_createCollection,3),p$2=_createCollection2[0],l$2=_createCollection2[1],m$2=_createCollection2[2],_createContextScope3=createContextScope("RovingFocusGroup",[m$2]),_createContextScope4=_slicedToArray2(_createContextScope3,2),d$2=_createContextScope4[0],v$1=_createContextScope4[1];var _d$=d$2("RovingFocusGroup"),_d$2=_slicedToArray2(_d$,2),g$1=_d$2[0],F$1=_d$2[1];var RovingFocusGroup=/*#__PURE__*/N$1(function(e,o){return/*#__PURE__*/y$3(p$2.Provider,{scope:e.__scopeRovingFocusGroup},/*#__PURE__*/y$3(p$2.Slot,{scope:e.__scopeRovingFocusGroup},/*#__PURE__*/y$3(w$2,_extends({},e,{ref:o}))));});var w$2=/*#__PURE__*/N$1(function(t,n){var c=t.__scopeRovingFocusGroup,p=t.orientation,_t$dir=t.dir,m=_t$dir===void 0?"ltr":_t$dir,_t$loop=t.loop,d=_t$loop===void 0?!1:_t$loop,v=t.currentTabStopId,F=t.defaultCurrentTabStopId,w=t.onCurrentTabStopIdChange,b=t.onEntryFocus,x=_objectWithoutProperties(t,_excluded7),E=_$2(null),I=useComposedRefs(n,E),_useControllableState=useControllableState({prop:v,defaultProp:F,onChange:w}),_useControllableState2=_slicedToArray2(_useControllableState,2),_useControllableState3=_useControllableState2[0],G=_useControllableState3===void 0?null:_useControllableState3,h=_useControllableState2[1],_h$13=h$5(!1),_h$14=_slicedToArray2(_h$13,2),T=_h$14[0],A=_h$14[1],y=useCallbackRef(b),D=l$2(c),S=_$2(!1);return p$5(function(){var e=E.current;if(e)return e.addEventListener("rovingFocusGroup.onEntryFocus",y),function(){return e.removeEventListener("rovingFocusGroup.onEntryFocus",y);};},[y]),/*#__PURE__*/y$3(g$1,{scope:c,orientation:p,dir:m,loop:d,currentTabStopId:G,onItemFocus:T$3(function(e){return h(e);},[h]),onItemShiftTab:T$3(function(){return A(!0);},[])},/*#__PURE__*/y$3(Primitive.div,_extends({tabIndex:T?-1:0,"data-orientation":p},x,{ref:I,style:_objectSpread({outline:"none"},t.style),onMouseDown:composeEventHandlers(t.onMouseDown,function(){S.current=!0;}),onFocus:composeEventHandlers(t.onFocus,function(e){var o=!S.current;if(e.target===e.currentTarget&&o&&!T){var _o=new Event("rovingFocusGroup.onEntryFocus",f$2);if(e.currentTarget.dispatchEvent(_o),!_o.defaultPrevented){var _e2=D().filter(function(e){return e.focusable;});R([_e2.find(function(e){return e.active;}),_e2.find(function(e){return e.id===G;})].concat(_toConsumableArray2(_e2)).filter(Boolean).map(function(e){return e.ref.current;}));}}S.current=!1;}),onBlur:composeEventHandlers(t.onBlur,function(){return A(!1);})})));});var RovingFocusGroupItem=/*#__PURE__*/N$1(function(e,o){var n=e.__scopeRovingFocusGroup,_e$focusable=e.focusable,i=_e$focusable===void 0?!0:_e$focusable,_e$active=e.active,c=_e$active===void 0?!1:_e$active,f=_objectWithoutProperties(e,_excluded8),m=useId(),d=F$1("RovingFocusGroupItem",n),v=d.currentTabStopId===m,g=l$2(n);return/*#__PURE__*/y$3(p$2.ItemSlot,{scope:n,id:m,focusable:i,active:c},/*#__PURE__*/y$3(Primitive.span,_extends({tabIndex:v?0:-1,"data-orientation":d.orientation},f,{ref:o,onMouseDown:composeEventHandlers(e.onMouseDown,function(e){i?d.onItemFocus(m):e.preventDefault();}),onFocus:composeEventHandlers(e.onFocus,function(){return d.onItemFocus(m);}),onKeyDown:composeEventHandlers(e.onKeyDown,function(e){if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;var o=function(e,o,r){var t=function(e,o){return"rtl"!==o?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e;}(e.key,r);return"vertical"===o&&["ArrowLeft","ArrowRight"].includes(t)||"horizontal"===o&&["ArrowUp","ArrowDown"].includes(t)?void 0:b$2[t];}(e,d.orientation,d.dir);if(void 0!==o){e.preventDefault();var _n4=g().filter(function(e){return e.focusable;}).map(function(e){return e.ref.current;});if("last"===o)_n4.reverse();else if("prev"===o||"next"===o){"prev"===o&&_n4.reverse();var _i3=_n4.indexOf(e.currentTarget);_n4=d.loop?(t=_i3+1,(r=_n4).map(function(e,o){return r[(t+o)%r.length];})):_n4.slice(_i3+1);}setTimeout(function(){return R(_n4);});}var r,t;})})));});var b$2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e){var o=document.activeElement;var _iterator8=_createForOfIteratorHelper2(e),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _r3=_step8.value;if(_r3===o)return;if(_r3.focus(),document.activeElement!==o)return;}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}var Root$1=RovingFocusGroup;var Item$1=RovingFocusGroupItem;var _createContextScope5=createContextScope("Tabs",[v$1]),_createContextScope6=_slicedToArray2(_createContextScope5,2),d$1=_createContextScope6[0],l$1=_createContextScope6[1];var u$2=v$1(),_d$3=d$1("Tabs"),_d$4=_slicedToArray2(_d$3,2),b$1=_d$4[0],p$1=_d$4[1];var Tabs=/*#__PURE__*/N$1(function(t,o){var n=t.__scopeTabs,i=t.value,d=t.onValueChange,l=t.defaultValue,_t$orientation=t.orientation,u=_t$orientation===void 0?"horizontal":_t$orientation,_t$dir2=t.dir,p=_t$dir2===void 0?"ltr":_t$dir2,_t$activationMode=t.activationMode,m=_t$activationMode===void 0?"automatic":_t$activationMode,f=_objectWithoutProperties(t,_excluded9),_useControllableState4=useControllableState({prop:i,onChange:d,defaultProp:l}),_useControllableState5=_slicedToArray2(_useControllableState4,2),v=_useControllableState5[0],T=_useControllableState5[1];return/*#__PURE__*/y$3(b$1,{scope:n,baseId:useId(),value:v,onValueChange:T,orientation:u,dir:p,activationMode:m},/*#__PURE__*/y$3(Primitive.div,_extends({"data-orientation":u},f,{ref:o})));});var TabsList=/*#__PURE__*/N$1(function(e,o){var r=e.__scopeTabs,_e$loop=e.loop,n=_e$loop===void 0?!0:_e$loop,i=_objectWithoutProperties(e,_excluded0),d=p$1("TabsList",r),l=u$2(r);return/*#__PURE__*/y$3(Root$1,_extends({asChild:!0},l,{orientation:d.orientation,dir:d.dir,loop:n}),/*#__PURE__*/y$3(Primitive.div,_extends({role:"tablist","aria-orientation":d.orientation,dir:d.dir},i,{ref:o})));});var TabsTrigger=/*#__PURE__*/N$1(function(e,o){var r=e.__scopeTabs,n=e.value,_e$disabled=e.disabled,d=_e$disabled===void 0?!1:_e$disabled,l=_objectWithoutProperties(e,_excluded1),b=p$1("TabsTrigger",r),v=u$2(r),T=m$1(b.baseId,n),x=f$1(b.baseId,n),g=n===b.value;return/*#__PURE__*/y$3(Item$1,_extends({asChild:!0},v,{focusable:!d,active:g}),/*#__PURE__*/y$3(Primitive.button,_extends({type:"button",role:"tab","aria-selected":g,"aria-controls":x,"data-state":g?"active":"inactive","data-disabled":d?"":void 0,disabled:d,id:T},l,{ref:o,onMouseDown:composeEventHandlers(e.onMouseDown,function(e){d||0!==e.button||!1!==e.ctrlKey?e.preventDefault():b.onValueChange(n);}),onKeyDown:composeEventHandlers(e.onKeyDown,function(e){[" ","Enter"].includes(e.key)&&b.onValueChange(n);}),onFocus:composeEventHandlers(e.onFocus,function(){var e="manual"!==b.activationMode;g||d||!e||b.onValueChange(n);})})));});var TabsContent=/*#__PURE__*/N$1(function(e,t){var o=e.__scopeTabs,r=e.value,n=e.children,i=_objectWithoutProperties(e,_excluded10),d=p$1("TabsContent",o),l=m$1(d.baseId,r),u=f$1(d.baseId,r),b=r===d.value;return/*#__PURE__*/y$3(Primitive.div,_extends({"data-state":b?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:u,tabIndex:0},i,{ref:t}),b&&n);});function m$1(e,t){return"".concat(e,"-trigger-").concat(t);}function f$1(e,t){return"".concat(e,"-content-").concat(t);}var Root=Tabs;var List=TabsList;var Trigger=TabsTrigger;var Content=TabsContent;var passwordManagerDisableAutofillProps={'data-1p-ignore':true};var Select=He.select(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n background-color: ",";\n border: 1px solid ",";\n border-radius: ",";\n height: 47px;\n box-sizing: border-box;\n padding: 0 8px;\n color: ",";\n font-family: ",";\n width: 80px;\n font-size: 18px;\n"])),function(props){return props.theme.inputs.backgroundColor;},function(props){return props.theme.inputs.borderColor;},function(props){return props.theme.inputs.borderRadius;},function(props){return props.theme.inputs.textColor;},function(props){return props.theme.typography.fontFamily;});var CountrySelector=function CountrySelector(_ref77){var country=_ref77.country,setCountry=_ref77.setCountry;var _useLingui8=useLingui(),_t=_useLingui8._;var countryFormatter=new Intl.DisplayNames(['en'],{type:'region'});return/*#__PURE__*/wn.createElement(Select,{"data-testid":"select-test-id",name:"country-select","aria-label":_t({id:'formField.countryCode.label',message:"Country code"}),value:country,onChange:function onChange(e){setCountry(e.target.value);}},Object.entries(COUNTRIES_LIST).map(function(_ref79){var _ref81=_slicedToArray2(_ref79,2),countryCode=_ref81[0],countryNumber=_ref81[1];return/*#__PURE__*/wn.createElement("option",{key:countryCode,value:countryCode},countryCode!==country?"+".concat(countryNumber," ").concat(countryFormatter.of(countryCode)):"+".concat(countryNumber));}));};var Input=He.input(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["\n background-color: ",";\n height: 47px;\n padding: 0 8px;\n box-sizing: border-box;\n border: 1px solid ",";\n border-radius: ",";\n color: ",";\n font-family: ",";\n font-size: 18px;\n\n &::placeholder {\n color: ",";\n }\n\n &:disabled {\n border: 1px solid ",";\n color: ",";\n background-color: ",";\n }\n"])),function(props){return props.theme.inputs.backgroundColor;},function(props){return props.theme.inputs.borderColor;},function(props){return props.theme.inputs.borderRadius;},function(props){return props.theme.inputs.textColor;},function(props){return props.theme.typography.fontFamily;},function(props){return props.theme.inputs.placeholderColor;},function(props){return props.theme.colors.disabledText;},function(props){return props.theme.colors.disabledText;},function(props){return props.theme.colors.disabled;});var formatNumber=function formatNumber(_ref82){var parsePhoneNumber=_ref82.parsePhoneNumber,phoneNumber=_ref82.phoneNumber,country=_ref82.country;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee80(){var parsedPhoneNumber,_t14;return _regenerator2().w(function(_context80){while(1)switch(_context80.p=_context80.n){case 0:_context80.p=0;_context80.n=1;return Promise.race([parsePhoneNumber(phoneNumber,country),new Promise(function(done){return setTimeout(function(){return done(undefined);},10000);})]);case 1:parsedPhoneNumber=_context80.v;if(parsedPhoneNumber){_context80.n=2;break;}return _context80.a(2,phoneNumber);case 2:return _context80.a(2,parsedPhoneNumber.national);case 3:_context80.p=3;_t14=_context80.v;return _context80.a(2,phoneNumber);}},_callee80,null,[[0,3]]);}));};var formatNumberToIncludeCountryCode=function formatNumberToIncludeCountryCode(_ref83){var parsePhoneNumber=_ref83.parsePhoneNumber,phoneNumber=_ref83.phoneNumber,country=_ref83.country;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee81(){var code,fallbackNumber,fallback,parsedPhoneNumber,_t15;return _regenerator2().w(function(_context81){while(1)switch(_context81.p=_context81.n){case 0:code=COUNTRIES_LIST[country];fallbackNumber="+".concat(code).concat(phoneNumber);fallback={isValid:true,number:fallbackNumber};_context81.p=1;_context81.n=2;return Promise.race([parsePhoneNumber(phoneNumber,country),new Promise(function(done){return setTimeout(function(){return done(undefined);},2000);})]);case 2:parsedPhoneNumber=_context81.v;if(parsedPhoneNumber){_context81.n=3;break;}return _context81.a(2,fallback);case 3:return _context81.a(2,parsedPhoneNumber);case 4:_context81.p=4;_t15=_context81.v;return _context81.a(2,fallback);}},_callee81,null,[[1,4]]);}));};var PhoneStyledInput=He(Input)(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n flex-grow: 1;\n min-width: 100px;\n"])));var PhoneInput=function PhoneInput(_a){var phone=_a.phone,setPhone=_a.setPhone,country=_a.country,setCountry=_a.setCountry,parsePhoneNumber=_a.parsePhoneNumber,hasPasskeys=_a.hasPasskeys,additionalProps=__rest(_a,["phone","setPhone","country","setCountry","parsePhoneNumber","hasPasskeys"]);return/*#__PURE__*/wn.createElement(Flex,{direction:"row",wrap:"nowrap",justifyContent:"flex-start",alignContent:"stretch",alignItems:"center",gap:8},/*#__PURE__*/wn.createElement(CountrySelector,{country:country,setCountry:setCountry}),/*#__PURE__*/wn.createElement(PhoneStyledInput,Object.assign({name:"phoneNumber",placeholder:"(123) 456-7890",id:"phone-input",autoComplete:hasPasskeys?'username webauthn':undefined,value:phone,type:"text",onChange:function onChange(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee82(){var userInput,national;return _regenerator2().w(function(_context82){while(1)switch(_context82.n){case 0:userInput=e.target.value;_context82.n=1;return formatNumber({parsePhoneNumber:parsePhoneNumber,phoneNumber:userInput,country:country});case 1:national=_context82.v;if(!(userInput!==e.target.value)){_context82.n=2;break;}return _context82.a(2);case 2:setPhone(national);case 3:return _context82.a(2);}},_callee82);}));},required:true},hasPasskeys?passwordManagerDisableAutofillProps:{},additionalProps)));};var EmailInput=function EmailInput(_a){var email=_a.email,setEmail=_a.setEmail,_a$disableInput=_a.disableInput,disableInput=_a$disableInput===void 0?false:_a$disableInput,_a$hasPasskeys=_a.hasPasskeys,hasPasskeys=_a$hasPasskeys===void 0?false:_a$hasPasskeys,additionalProps=__rest(_a,["email","setEmail","disableInput","hasPasskeys"]);var _useLingui9=useLingui(),_t=_useLingui9._;return/*#__PURE__*/wn.createElement(Input,Object.assign({placeholder:_t({id:'formField.email.placeholder',message:"example@email.com"}),name:"email",type:"email",autoComplete:hasPasskeys?'username webauthn':'email',disabled:disableInput,id:"email-input",value:email,onChange:function onChange(e){return setEmail(e.target.value);},required:true},hasPasskeys?passwordManagerDisableAutofillProps:{},additionalProps));};var LoadingButton=function LoadingButton(_a){var children=_a.children,isLoading=_a.isLoading,buttonProps=__rest(_a,["children","isLoading"]);return/*#__PURE__*/wn.createElement(Button,Object.assign({},buttonProps),isLoading?(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center"},/*#__PURE__*/wn.createElement(CircularProgress,{size:18,thickness:1,"data-testid":"loading-icon"}))):children);};var SubmitButton=function SubmitButton(_ref84){var isSubmitting=_ref84.isSubmitting,disabled=_ref84.disabled,text=_ref84.text,variant=_ref84.variant;var buttonDisabled=isSubmitting||disabled;return/*#__PURE__*/wn.createElement(LoadingButton,{isLoading:isSubmitting,type:"submit",disabled:buttonDisabled,variant:variant},text);};var DASHBOARD_REGEX=/https:\/\/stytch\.com\/[#a-zA-Z0-9/-]+/g;var mapURLsToLinks=function mapURLsToLinks(str){var nonLinkChunks=str.split(DASHBOARD_REGEX);var linkChunks=Array.from(str.matchAll(DASHBOARD_REGEX)).map(function(el){return el[0];});var chunkResults=[];while(nonLinkChunks.length||linkChunks.length){if(nonLinkChunks.length){chunkResults.push(nonLinkChunks.shift());}if(linkChunks.length){var chunk=linkChunks.shift();chunkResults.push(/*#__PURE__*/wn.createElement("a",{key:chunk+'__'+String(linkChunks.length),href:chunk,target:"_blank",rel:"noreferrer"},chunk));}}return chunkResults;};var ErrorText=function ErrorText(_ref85){var errorMessage=_ref85.errorMessage,id=_ref85.id;var tokens=F$4(function(){return mapURLsToLinks(errorMessage);},[errorMessage]);return/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"error",id:id},tokens);};var extractErrorType=function extractErrorType(error){if(error&&_typeof2(error)==='object'){if('error_type'in error&&typeof error.error_type==='string'){return error.error_type;}}};var errorMessages={invalid_email:{id:'error.invalidEmail',message:"Email format is invalid."},invalid_phone_number:{id:'error.invalidPhoneNumber',message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."},unsubscribed_phone_number:{id:'error.unsubscribedPhoneNumber',message:"Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."},inactive_email:{id:'error.inactiveEmail',message:"The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."},unauthorized_credentials:{id:'error.unauthorizedCredentials',message:"Unauthorized credentials."},user_unauthenticated:{id:'error.userUnauthenticated',message:"Must have an active session to call this method. Have you logged in yet?"},email_not_found:{id:'error.emailNotFound',message:"Email not found."},unable_to_auth_magic_link:{id:'error.unableToAuthMagicLink',message:"The magic link could not be authenticated because it was either already used or expired. Please try again."},no_user_password:{id:'error.noUserPassword',message:"Password not found for this user. Please try again."},breached_password:{id:'error.breachedPassword',message:"Password appears in the list of breached passwords and must be reset."},reset_password:{id:'error.resetPassword',message:"Password must be reset."},oauth_token_not_found:{id:'error.oauthTokenNotFound',message:"OAuth Token could not be found."},invalid_code:{id:'error.invalidCode',message:"Code format is invalid, please try again."},member_password_not_found:{id:'error.memberPasswordNotFound',message:"Member password not found."},oauth_flow_callback_error:{id:'error.oauthFlowCallbackError',message:"An error was encountered in the callback of the OAuth flow. Please try again."},unauthorized_action:{id:'error.unauthorizedAction',message:"Unauthorized action."},user_lock_limit_reached:{id:'error.userLockLimitReached',message:"Too many failed authentication attempts. Please try again later."},invalid_session_token:{id:'error.invalidSessionToken',message:"Invalid session token."},session_not_found:{id:'error.sessionNotFound',message:"Session not found."},invalid_phone_number_country_code:{id:'error.invalidPhoneNumberCountryCode',message:"The phone number's country code is invalid, unsupported, or disabled."},otp_code_not_found:{id:'error.otpCodeNotFound',message:"Invalid passcode, please try again."},duplicate_member_phone_number:{id:'error.duplicatePhoneNumber',message:"A member with the specified phone number already exists for this organization."}};var getTranslatedError=function getTranslatedError(error,t){var errorType=extractErrorType(error);var messageDescriptor=errorMessages[errorType];if(messageDescriptor){return t(messageDescriptor);}return error.error_message;};var OTPButtonText=_defineProperty(_defineProperty(_defineProperty({},OTPMethods.SMS,{id:'button.sms',message:"Continue with text message"}),OTPMethods.WhatsApp,{id:'button.whatsapp',message:"Continue with WhatsApp"}),OTPMethods.Email,{id:'button.emailLogin',message:"Continue with email"});var OTPEmailForm=function OTPEmailForm(){var _useLingui0=useLingui(),_t=_useLingui0._;var onEvent=useEventCallback();var onError=useErrorCallback();var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer3=useGlobalReducer(),_useGlobalReducer4=_slicedToArray2(_useGlobalReducer3,2),dispatch=_useGlobalReducer4[1];var _h$15=h$5(''),_h$16=_slicedToArray2(_h$15,2),email=_h$16[0],setEmail=_h$16[1];var _h$17=h$5(''),_h$18=_slicedToArray2(_h$17,2),errorMessage=_h$18[0],setErrorMessage=_h$18[1];var _h$19=h$5(false),_h$20=_slicedToArray2(_h$19,2),isSubmitting=_h$20[0],setIsSubmitting=_h$20[1];var hasPasskeys=config.products.includes(Products.passkeys);var emailProps=useErrorProps(errorMessage);var emailInputLabel=_t({id:'formField.email.label',message:"Email"});var stopSubmit=function stopSubmit(errorText){onError({message:errorText});setIsSubmitting(false);return setErrorMessage(errorText);};var handleEmailSubmit=function handleEmailSubmit(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee83(){var _a,_b,_c,_d,_e;return _regenerator2().w(function(_context83){while(1)switch(_context83.n){case 0:e.preventDefault();setIsSubmitting(true);if(email.match(EMAIL_REGEX)){_context83.n=1;break;}return _context83.a(2,stopSubmit(_t({id:'errors.invalidEmail',message:"Invalid email address."})));case 1:setErrorMessage('');setIsSubmitting(true);stytchClient.otps.email.loginOrCreate(email,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES,login_template_id:(_c=config.otpOptions)===null||_c===void 0?void 0:_c.loginTemplateId,signup_template_id:(_d=config.otpOptions)===null||_d===void 0?void 0:_d.signupTemplateId,locale:(_e=config.otpOptions)===null||_e===void 0?void 0:_e.locale}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});dispatch({type:'update_otp_state',otpState:{type:OTPMethods.Email,methodId:data.method_id,otpDestination:email}});dispatch({type:'transition',screen:AppScreens$1.OTPAuthenticate});readB2CInternals(stytchClient).networkClient.logEvent({name:'email_sent',details:{email:email,type:EmailSentType.LoginOrCreateOTP}});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t));});case 2:return _context83.a(2);}},_callee83);}));};return/*#__PURE__*/wn.createElement("form",{onSubmit:handleEmailSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",minHeight:52},/*#__PURE__*/wn.createElement(EmailInput,Object.assign({email:email,setEmail:setEmail,hasPasskeys:hasPasskeys,"aria-label":emailInputLabel},emailProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},emailProps.error))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t(OTPButtonText[OTPMethods.Email])})));};var PhoneForm=function PhoneForm(_ref86){var method=_ref86.method;var _useLingui1=useLingui(),_t2=_useLingui1._;var onEvent=useEventCallback();var onError=useErrorCallback();var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer5=useGlobalReducer(),_useGlobalReducer6=_slicedToArray2(_useGlobalReducer5,2),dispatch=_useGlobalReducer6[1];var _h$21=h$5(''),_h$22=_slicedToArray2(_h$21,2),phoneNumber=_h$22[0],setPhoneNumber=_h$22[1];var _h$23=h$5('US'),_h$24=_slicedToArray2(_h$23,2),country=_h$24[0],setCountry=_h$24[1];var _h$25=h$5(''),_h$26=_slicedToArray2(_h$25,2),errorMessage=_h$26[0],setErrorMessage=_h$26[1];var _h$27=h$5(false),_h$28=_slicedToArray2(_h$27,2),isSubmitting=_h$28[0],setIsSubmitting=_h$28[1];var hasPasskeys=config.products.includes(Products.passkeys);var phoneProps=useErrorProps(errorMessage);var phoneInputLabel=_t2({id:'formField.phone.label',message:"Phone number"});var stopSubmit=function stopSubmit(errorText){onError({message:errorText});setIsSubmitting(false);return setErrorMessage(errorText);};var parsePhoneNumber=function parsePhoneNumber(phoneNumber,countryCode){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee84(){return _regenerator2().w(function(_context84){while(1)switch(_context84.n){case 0:return _context84.a(2,readB2CInternals(stytchClient).clientsideServices.parsedPhoneNumber({phoneNumber:phoneNumber,regionCode:countryCode}));}},_callee84);}));};var handlePhoneSubmit=function handlePhoneSubmit(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee85(){var _a,_b,parsedNumber;return _regenerator2().w(function(_context85){while(1)switch(_context85.n){case 0:e.preventDefault();_context85.n=1;return formatNumberToIncludeCountryCode({parsePhoneNumber:parsePhoneNumber,phoneNumber:phoneNumber,country:country});case 1:parsedNumber=_context85.v;if(parsedNumber.isValid){_context85.n=2;break;}return _context85.a(2,stopSubmit(_t2({id:'error.invalidPhoneNumber',message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."})));case 2:setIsSubmitting(true);setErrorMessage('');stytchClient.otps[method].loginOrCreate(parsedNumber.number,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});dispatch({type:'update_otp_state',otpState:{type:method,methodId:data.method_id,otpDestination:parsedNumber.number}});dispatch({type:'transition',screen:AppScreens$1.OTPAuthenticate});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t2));});case 3:return _context85.a(2);}},_callee85);}));};return/*#__PURE__*/wn.createElement("form",{onSubmit:handlePhoneSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",minHeight:52},/*#__PURE__*/wn.createElement(PhoneInput,Object.assign({phone:phoneNumber,setPhone:setPhoneNumber,country:country,setCountry:setCountry,parsePhoneNumber:parsePhoneNumber,hasPasskeys:hasPasskeys,"aria-label":phoneInputLabel},phoneProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},phoneProps.error))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t2(OTPButtonText[method])})));};var MagicLinkEmailForm=function MagicLinkEmailForm(){var _useLingui10=useLingui(),_t=_useLingui10._;var onEvent=useEventCallback();var onError=useErrorCallback();var _useGlobalReducer7=useGlobalReducer(),_useGlobalReducer8=_slicedToArray2(_useGlobalReducer7,2),dispatch=_useGlobalReducer8[1];var stytchClient=useStytch();var config=useConfig();var emailMagicLinksOptions=config.emailMagicLinksOptions;var hasPasskeys=config.products.includes(Products.passkeys);var _h$29=h$5(''),_h$30=_slicedToArray2(_h$29,2),email=_h$30[0],setEmail=_h$30[1];var _h$31=h$5(''),_h$32=_slicedToArray2(_h$31,2),errorMessage=_h$32[0],setErrorMessage=_h$32[1];var _h$33=h$5(false),_h$34=_slicedToArray2(_h$33,2),isSubmitting=_h$34[0],setIsSubmitting=_h$34[1];var emailProps=useErrorProps(errorMessage);var emailInputLabel=_t({id:'formField.email.label',message:"Email"});var handleSubmit=function handleSubmit(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee86(){var submittingEmail;return _regenerator2().w(function(_context86){while(1)switch(_context86.n){case 0:e.preventDefault();submittingEmail=email;if(!submittingEmail.match(EMAIL_REGEX)){setErrorMessage(_t({id:'error.invalidEmail',message:"Email format is invalid."}));}else{setErrorMessage('');setIsSubmitting(true);stytchClient.magicLinks.email.loginOrCreate(submittingEmail,convertMagicLinkOptions(emailMagicLinksOptions)).then(function(data){onEvent({type:StytchEventType.MagicLinkLoginOrCreateEvent,data:Object.assign(Object.assign({},data),{email:submittingEmail})});setIsSubmitting(false);dispatch({type:'set_magic_link_email',email:submittingEmail});dispatch({type:'transition',screen:AppScreens$1.EmailConfirmation});readB2CInternals(stytchClient).networkClient.logEvent({name:'email_try_again_clicked',details:{email:submittingEmail,type:EmailSentType.LoginOrCreateEML}});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t));});}case 1:return _context86.a(2);}},_callee86);}));};return/*#__PURE__*/wn.createElement("form",{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",minHeight:52},/*#__PURE__*/wn.createElement(EmailInput,Object.assign({email:email,setEmail:setEmail,hasPasskeys:hasPasskeys,"aria-label":emailInputLabel},emailProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},emailProps.error))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.emailLogin',message:"Continue with email"})})));};var PasswordsEmailForm=function PasswordsEmailForm(){var _useLingui11=useLingui(),_t=_useLingui11._;var _useGlobalReducer9=useGlobalReducer(),_useGlobalReducer0=_slicedToArray2(_useGlobalReducer9,2),dispatch=_useGlobalReducer0[1];var config=useConfig();var stytch=useStytch();var onError=useErrorCallback();var hasPasskeys=config.products.includes(Products.passkeys);var _h$35=h$5(''),_h$36=_slicedToArray2(_h$35,2),email=_h$36[0],setEmail=_h$36[1];var _h$37=h$5(''),_h$38=_slicedToArray2(_h$37,2),errorMessage=_h$38[0],setErrorMessage=_h$38[1];var _h$39=h$5(false),_h$40=_slicedToArray2(_h$39,2),isSubmitting=_h$40[0],setIsSubmitting=_h$40[1];var emailProps=useErrorProps(errorMessage);var emailInputLabel=_t({id:'formField.email.label',message:"Email"});var handleSubmit=function handleSubmit(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee87(){return _regenerator2().w(function(_context87){while(1)switch(_context87.n){case 0:e.preventDefault();if(!email.match(EMAIL_REGEX)){setErrorMessage(_t({id:'error.invalidEmail',message:"Email format is invalid."}));}else{setErrorMessage('');setIsSubmitting(true);readB2CInternals(stytch).searchManager.searchUser(email).then(function(_ref87){var userType=_ref87.userType;dispatch({type:'update_password_state',passwordState:{email:email,type:userType}});dispatch({type:'transition',screen:AppScreens$1.PasswordCreateOrLogin});readB2CInternals(stytch).networkClient.logEvent({name:'email_sent',details:{email:email,type:EmailSentType.ResetPassword}});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t));});}case 1:return _context87.a(2);}},_callee87);}));};return/*#__PURE__*/wn.createElement("form",{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",minHeight:52},/*#__PURE__*/wn.createElement(EmailInput,Object.assign({email:email,setEmail:setEmail,hasPasskeys:hasPasskeys,"aria-label":emailInputLabel},emailProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},emailProps.error))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.emailLogin',message:"Continue with email"})})));};var TabList=He(List)(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n width: 100%;\n justify-content: space-between;\n border-bottom: 1px solid ",";\n margin-bottom: 24px;\n"])),function(props){return props.theme.colors.secondary;});var TabTrigger=He(Trigger)(_templateObject18||(_templateObject18=_taggedTemplateLiteral(["\n all: unset;\n width: 100%;\n text-align: center;\n color: ",";\n border-bottom: 3px solid ",";\n font-weight: ",";\n height: 28px;\n\n cursor: pointer;\n font-family: ",";\n line-height: 1;\n\n &:focus-visible {\n ","\n }\n"])),function(props){return props.$active?props.theme.colors.primary:props.theme.colors.secondary;},function(props){return props.$active?props.theme.colors.primary:'transparent';},function(props){return props.$active?'500':'400';},function(props){return props.theme.typography.fontFamily;},focusedRing);var MagicLinkMethods;(function(MagicLinkMethods){MagicLinkMethods["Email"]="emailMagicLink";})(MagicLinkMethods||(MagicLinkMethods={}));var PasswordMethods;(function(PasswordMethods){PasswordMethods["Email"]="passwords";})(PasswordMethods||(PasswordMethods={}));var OTPTabHeaders=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},OTPMethods.SMS,{id:'tab.text',message:"Text"}),OTPMethods.WhatsApp,{id:'tab.whatsapp',message:"WhatsApp"}),OTPMethods.Email,{id:'tab.email',message:"Email"}),MagicLinkMethods.Email,{id:'tab.email',message:"Email"}),PasswordMethods.Email,{id:'tab.email',message:"Email"});var getTabMethods=function getTabMethods(products,otpMethods){var hasPassword=products.includes(Products.passwords);var tabMethodsSet=products.reduce(function(acc,product){switch(product){case Products.emailMagicLinks:acc.add(hasPassword?PasswordMethods.Email:MagicLinkMethods.Email);break;case Products.passwords:acc.add(PasswordMethods.Email);break;case Products.otp:otpMethods.forEach(function(method){acc.add(method===OTPMethods.Email&&hasPassword?PasswordMethods.Email:method);});break;}return acc;},new Set());return Array.from(tabMethodsSet);};var TabMethodToComponent=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},OTPMethods.Email,OTPEmailForm),OTPMethods.WhatsApp,function(){return/*#__PURE__*/wn.createElement(PhoneForm,{method:OTPMethods.WhatsApp});}),OTPMethods.SMS,function(){return/*#__PURE__*/wn.createElement(PhoneForm,{method:OTPMethods.SMS});}),MagicLinkMethods.Email,MagicLinkEmailForm),PasswordMethods.Email,PasswordsEmailForm);var LoginForm=function LoginForm(){var _a,_b;var _useLingui12=useLingui(),_t=_useLingui12._;var config=useConfig();var productsIncludesOtp=config.products.includes(Products.otp);var otpMethods=productsIncludesOtp?(_b=(_a=config===null||config===void 0?void 0:config.otpOptions)===null||_a===void 0?void 0:_a.methods)!==null&&_b!==void 0?_b:[]:[];var hasEmailMagicLink=config.products.includes(Products.emailMagicLinks);var hasOTPEmail=productsIncludesOtp&&otpMethods.includes(OTPMethods.Email);var tabMethods=getTabMethods(config.products,otpMethods);var _h$41=h$5(tabMethods[0]),_h$42=_slicedToArray2(_h$41,2),currentTab=_h$42[0],setCurrentTab=_h$42[1];if(hasEmailMagicLink&&hasOTPEmail)return/*#__PURE__*/wn.createElement(Text,{size:"helper"},"Error: Cannot use both EML and Email OTP");return/*#__PURE__*/wn.createElement(Root,{value:currentTab,onValueChange:function onValueChange(value){return setCurrentTab(value);}},tabMethods.length>1&&(/*#__PURE__*/wn.createElement(TabList,{"aria-label":"otp-tabs"},tabMethods.map(function(method){return/*#__PURE__*/wn.createElement(TabTrigger,{value:method,key:method,"$active":method===currentTab},_t(OTPTabHeaders[method]));}))),tabMethods.map(function(method){var Component=TabMethodToComponent[method];if(tabMethods.length>1){return/*#__PURE__*/wn.createElement(Content,{value:method,key:method},/*#__PURE__*/wn.createElement(Component,null));}else{return/*#__PURE__*/wn.createElement(Component,{key:method});}}));};var WalletButton=function WalletButton(props){return/*#__PURE__*/wn.createElement(Button,{id:"wallet-".concat(props.walletTypeTitle),type:"button",onClick:props.onClick,variant:"outlined"},/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center",alignItems:"center",gap:4},props.icon,/*#__PURE__*/wn.createElement("span",{style:{verticalAlign:'middle'}},props.walletTypeTitle)));};function base(ALPHABET){if(ALPHABET.length>=255){throw new TypeError('Alphabet too long');}var BASE_MAP=new Uint8Array(256);for(var j=0;j<BASE_MAP.length;j++){BASE_MAP[j]=255;}for(var i=0;i<ALPHABET.length;i++){var x=ALPHABET.charAt(i);var xc=x.charCodeAt(0);if(BASE_MAP[xc]!==255){throw new TypeError(x+' is ambiguous');}BASE_MAP[xc]=i;}var BASE=ALPHABET.length;var LEADER=ALPHABET.charAt(0);var FACTOR=Math.log(BASE)/Math.log(256);var iFACTOR=Math.log(256)/Math.log(BASE);function encode(source){if(source instanceof Uint8Array);else if(ArrayBuffer.isView(source)){source=new Uint8Array(source.buffer,source.byteOffset,source.byteLength);}else if(Array.isArray(source)){source=Uint8Array.from(source);}if(!(source instanceof Uint8Array)){throw new TypeError('Expected Uint8Array');}if(source.length===0){return'';}var zeroes=0;var length=0;var pbegin=0;var pend=source.length;while(pbegin!==pend&&source[pbegin]===0){pbegin++;zeroes++;}var size=(pend-pbegin)*iFACTOR+1>>>0;var b58=new Uint8Array(size);while(pbegin!==pend){var carry=source[pbegin];var i=0;for(var it1=size-1;(carry!==0||i<length)&&it1!==-1;it1--,i++){carry+=256*b58[it1]>>>0;b58[it1]=carry%BASE>>>0;carry=carry/BASE>>>0;}if(carry!==0){throw new Error('Non-zero carry');}length=i;pbegin++;}var it2=size-length;while(it2!==size&&b58[it2]===0){it2++;}var str=LEADER.repeat(zeroes);for(;it2<size;++it2){str+=ALPHABET.charAt(b58[it2]);}return str;}function decodeUnsafe(source){if(typeof source!=='string'){throw new TypeError('Expected String');}if(source.length===0){return new Uint8Array();}var psz=0;var zeroes=0;var length=0;while(source[psz]===LEADER){zeroes++;psz++;}var size=(source.length-psz)*FACTOR+1>>>0;var b256=new Uint8Array(size);while(source[psz]){var charCode=source.charCodeAt(psz);if(charCode>255){return;}var carry=BASE_MAP[charCode];if(carry===255){return;}var i=0;for(var it3=size-1;(carry!==0||i<length)&&it3!==-1;it3--,i++){carry+=BASE*b256[it3]>>>0;b256[it3]=carry%256>>>0;carry=carry/256>>>0;}if(carry!==0){throw new Error('Non-zero carry');}length=i;psz++;}var it4=size-length;while(it4!==size&&b256[it4]===0){it4++;}var vch=new Uint8Array(zeroes+(size-it4));var j=zeroes;while(it4!==size){vch[j++]=b256[it4++];}return vch;}function decode(string){var buffer=decodeUnsafe(string);if(buffer){return buffer;}throw new Error('Non-base'+BASE+' character');}return{encode:encode,decodeUnsafe:decodeUnsafe,decode:decode};}var src=base;var basex=src;var ALPHABET='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';var bs58=basex(ALPHABET);var PhantomIconSvg=function PhantomIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20Z",fill:"url(#paint0_linear_2_2)"}),/*#__PURE__*/wn.createElement("path",{d:"M17.2787 10.1428H15.4909C15.4909 6.5258 12.527 3.59375 8.87068 3.59375C5.25956 3.59375 2.32368 6.45402 2.25184 10.0091C2.1775 13.6839 5.66265 16.875 9.3779 16.875H9.84521C13.1207 16.875 17.5108 14.3385 18.1967 11.248C18.3234 10.6783 17.8684 10.1428 17.2787 10.1428ZM6.21389 10.304C6.21389 10.7877 5.81398 11.1833 5.32503 11.1833C4.83607 11.1833 4.43618 10.7875 4.43618 10.304V8.88147C4.43618 8.39777 4.83607 8.00217 5.32503 8.00217C5.81398 8.00217 6.21389 8.39777 6.21389 8.88147V10.304ZM9.30037 10.304C9.30037 10.7877 8.90048 11.1833 8.41153 11.1833C7.92257 11.1833 7.52267 10.7875 7.52267 10.304V8.88147C7.52267 8.39777 7.92275 8.00217 8.41153 8.00217C8.90048 8.00217 9.30037 8.39777 9.30037 8.88147V10.304Z",fill:"url(#paint1_linear_2_2)"}),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("linearGradient",{id:"paint0_linear_2_2",x1:"10",y1:"0",x2:"10",y2:"20",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"#534BB1"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#551BF9"})),/*#__PURE__*/wn.createElement("linearGradient",{id:"paint1_linear_2_2",x1:"10.2343",y1:"3.59375",x2:"10.2343",y2:"16.875",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"white"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"white",stopOpacity:"0.82"}))));};var PhantomIcon=CreateIcon(PhantomIconSvg);var MetamaskIconSvg=function MetamaskIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M17.2065 2.22849L10.9604 6.86753L12.1155 4.13056L17.2065 2.22849Z",fill:"#E2761B",stroke:"#E2761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M2.78717 2.22849L8.98303 6.91147L7.88447 4.13056L2.78717 2.22849Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M14.9592 12.9818L13.2957 15.5304L16.855 16.5097L17.8782 13.0383L14.9592 12.9818Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M2.12805 13.0383L3.145 16.5097L6.70432 15.5304L5.04079 12.9818L2.12805 13.0383Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.50344 8.67544L5.5116 10.1757L9.04581 10.3327L8.92026 6.53482L6.50344 8.67544Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M13.4903 8.67543L11.0421 6.49088L10.9604 10.3327L14.4884 10.1757L13.4903 8.67543Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.70432 15.5304L8.8261 14.4946L6.99308 13.0634L6.70432 15.5304Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.1676 14.4946L13.2957 15.5304L13.0006 13.0634L11.1676 14.4946Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M13.2957 15.5304L11.1676 14.4947L11.3371 15.882L11.3183 16.4658L13.2957 15.5304Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.70435 15.5304L8.68175 16.4658L8.66919 15.882L8.82613 14.4947L6.70435 15.5304Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M8.71312 12.1469L6.94287 11.6259L8.19209 11.0546L8.71312 12.1469Z",fill:"#233447",stroke:"#233447",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.2806 12.1469L11.8016 11.0546L13.0571 11.6259L11.2806 12.1469Z",fill:"#233447",stroke:"#233447",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.70433 15.5305L7.00565 12.9818L5.0408 13.0383L6.70433 15.5305Z",fill:"#CD6116",stroke:"#CD6116",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M12.9944 12.9818L13.2957 15.5305L14.9592 13.0383L12.9944 12.9818Z",fill:"#CD6116",stroke:"#CD6116",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M14.4884 10.1758L10.9604 10.3327L11.2869 12.1469L11.8079 11.0546L13.0634 11.6259L14.4884 10.1758Z",fill:"#CD6116",stroke:"#CD6116",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.94289 11.6259L8.19838 11.0546L8.71313 12.1469L9.04584 10.3327L5.51163 10.1758L6.94289 11.6259Z",fill:"#CD6116",stroke:"#CD6116",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M5.51163 10.1758L6.99311 13.0634L6.94289 11.6259L5.51163 10.1758Z",fill:"#E4751F",stroke:"#E4751F",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M13.0634 11.6259L13.0006 13.0634L14.4884 10.1758L13.0634 11.6259Z",fill:"#E4751F",stroke:"#E4751F",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M9.04584 10.3327L8.71313 12.1469L9.12745 14.2875L9.22161 11.469L9.04584 10.3327Z",fill:"#E4751F",stroke:"#E4751F",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M10.9605 10.3327L10.791 11.4627L10.8663 14.2875L11.2869 12.1469L10.9605 10.3327Z",fill:"#E4751F",stroke:"#E4751F",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.2869 12.1469L10.8663 14.2875L11.1676 14.4947L13.0006 13.0634L13.0634 11.6259L11.2869 12.1469Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.94287 11.6259L6.99309 13.0634L8.82611 14.4947L9.12743 14.2875L8.71312 12.1469L6.94287 11.6259Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.3183 16.4658L11.3371 15.882L11.1802 15.7439H8.81357L8.66919 15.882L8.68175 16.4658L6.70435 15.5305L7.39487 16.0954L8.79474 17.0684H11.199L12.6052 16.0954L13.2957 15.5305L11.3183 16.4658Z",fill:"#C0AD9E",stroke:"#C0AD9E",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.1676 14.4947L10.8663 14.2875H9.12744L8.82613 14.4947L8.66919 15.882L8.81357 15.7439H11.1802L11.3371 15.882L11.1676 14.4947Z",fill:"#161616",stroke:"#161616",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M17.4702 7.16885L18.0038 4.60764L17.2066 2.22849L11.1676 6.71059L13.4903 8.67544L16.7734 9.63589L17.5016 8.78843L17.1877 8.56245L17.6899 8.10419L17.3007 7.80287L17.8029 7.41995L17.4702 7.16885Z",fill:"#763D16",stroke:"#763D16",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M1.99625 4.60764L2.52983 7.16885L2.19085 7.41995L2.69304 7.80287L2.31012 8.10419L2.81232 8.56245L2.49844 8.78843L3.22035 9.63589L6.50347 8.67544L8.82613 6.71059L2.78721 2.22849L1.99625 4.60764Z",fill:"#763D16",stroke:"#763D16",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M16.7734 9.6359L13.4903 8.67545L14.4884 10.1758L13.0006 13.0634L14.9592 13.0383H17.8782L16.7734 9.6359Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.50344 8.67545L3.22033 9.6359L2.12805 13.0383H5.0408L6.99309 13.0634L5.51161 10.1758L6.50344 8.67545Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M10.9604 10.3327L11.1676 6.71062L12.1218 4.13058H7.88449L8.82611 6.71062L9.04582 10.3327L9.12115 11.4752L9.12743 14.2875H10.8663L10.8788 11.4752L10.9604 10.3327Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}));};var MetamaskIcon=CreateIcon(MetamaskIconSvg);var VesselIconSvg=function VesselIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("g",{clipPath:"url(#clip0_517_6831)"},/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.602 3.2325C7.99856 3.2325 4.36714 6.58551 5.54083 11.2565L4.91376 11.414C3.6226 6.27561 7.64076 2.58594 11.602 2.58594C15.8216 2.58594 19.7562 6.44977 18.3304 11.5481L17.7077 11.374C19.0018 6.74671 15.4567 3.2325 11.602 3.2325Z",fill:"#2A384A"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5988 1.29891C6.41566 1.29891 2.05244 6.14046 3.88531 12.8124L3.26184 12.9836C1.32182 5.92165 5.96682 0.652344 11.5988 0.652344C17.5841 0.652344 22.5861 6.77296 19.5889 13.4516L18.9991 13.1869C21.7871 6.97427 17.1579 1.29891 11.5988 1.29891Z",fill:"#2A384A"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.17894 6.94622C7.48133 7.91408 7.24057 9.10031 7.36887 9.96188C7.39522 10.1385 7.27334 10.303 7.09673 10.3292C6.92019 10.3555 6.75568 10.2337 6.72938 10.0571C6.57532 9.0227 6.86195 7.6676 7.65447 6.56814C8.4568 5.45497 9.77856 4.60352 11.6727 4.60352C13.3065 4.60352 14.641 5.40696 15.4926 6.51476C16.3399 7.61698 16.7272 9.0444 16.4408 10.3222C16.4018 10.4965 16.2289 10.606 16.0547 10.567C15.8804 10.5279 15.7709 10.355 15.8099 10.1808C16.0479 9.11899 15.7297 7.88408 14.98 6.9088C14.2346 5.93917 13.0806 5.25008 11.6727 5.25008C9.99793 5.25008 8.86673 5.99201 8.17894 6.94622Z",fill:"#2A384A"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.521 14.6751C19.5048 11.7314 16.1357 10.3576 16.1357 10.3576H13.8259L12.9183 8.46875H11.5936H10.2689L9.36128 10.3576H6.91197L4.36073 12.1829L2.74168 10.3576H0.877319L2.15294 13.7625L0.877319 14.6751L2.15294 15.5981L0.877319 19.0416H2.74168L4.36073 17.1956L6.91197 19.0416H16.1357C16.1357 19.0416 19.5371 17.6188 19.521 14.6751ZM7.69518 15.9039C8.38612 15.9039 8.94625 15.3438 8.94625 14.6528C8.94625 13.9618 8.38612 13.4017 7.69518 13.4017C7.00423 13.4017 6.4441 13.9618 6.4441 14.6528C6.4441 15.3438 7.00423 15.9039 7.69518 15.9039ZM12.8871 14.6528C12.8871 15.3438 12.327 15.9039 11.6361 15.9039C10.9451 15.9039 10.385 15.3438 10.385 14.6528C10.385 13.9618 10.9451 13.4017 11.6361 13.4017C12.327 13.4017 12.8871 13.9618 12.8871 14.6528ZM15.5893 15.9039C16.2803 15.9039 16.8405 15.3438 16.8405 14.6528C16.8405 13.9618 16.2803 13.4017 15.5893 13.4017C14.8984 13.4017 14.3383 13.9618 14.3383 14.6528C14.3383 15.3438 14.8984 15.9039 15.5893 15.9039Z",fill:"url(#paint0_linear_517_6831)"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2704 6.78422C11.2704 6.60567 11.4151 6.46094 11.5936 6.46094H12.858C13.0365 6.46094 13.1813 6.60567 13.1813 6.78422C13.1813 6.96273 13.0365 7.10751 12.858 7.10751H11.9169V8.14474H12.9183C13.0426 8.14474 13.1558 8.216 13.2097 8.32801L14.0293 10.0337H16.1357C16.1775 10.0337 16.219 10.0418 16.2577 10.0576L16.1357 10.3569C16.2577 10.0576 16.2579 10.0576 16.258 10.0577L16.2584 10.0578L16.2592 10.0582L16.2619 10.0593C16.2641 10.0602 16.2672 10.0615 16.271 10.0631C16.2786 10.0663 16.2893 10.0709 16.303 10.0768C16.3302 10.0887 16.3691 10.1061 16.418 10.1291C16.5158 10.1751 16.6538 10.2434 16.8188 10.3347C17.148 10.5167 17.5883 10.7919 18.0306 11.1646C18.9106 11.906 19.8355 13.0668 19.8443 14.6727C19.8531 16.2802 18.9272 17.4542 18.0442 18.2075C17.6001 18.5863 17.157 18.8677 16.8255 19.0544C16.6594 19.1479 16.5203 19.2181 16.4218 19.2655C16.3725 19.2891 16.3333 19.3071 16.3058 19.3193C16.2921 19.3255 16.2814 19.3302 16.2737 19.3335C16.2699 19.3352 16.2669 19.3364 16.2647 19.3374L16.2619 19.3386L16.261 19.339L16.2607 19.3391C16.2606 19.3391 16.2604 19.3392 16.1357 19.041L16.2604 19.3392C16.2209 19.3557 16.1786 19.3642 16.1357 19.3642H6.91201C6.84396 19.3642 6.77763 19.3427 6.72249 19.3029L4.40973 17.6294L2.98477 19.2541C2.92339 19.3241 2.83482 19.3642 2.74172 19.3642H0.877361C0.77156 19.3642 0.672454 19.3125 0.612017 19.2256C0.551579 19.1388 0.537458 19.0278 0.57421 18.9286L1.76453 15.7154L0.687849 14.9363C0.603584 14.8754 0.553802 14.7776 0.55408 14.6735C0.554359 14.5695 0.604664 14.472 0.689255 14.4115L1.76328 13.6431L0.574628 10.4703C0.537435 10.3711 0.551278 10.2599 0.611676 10.1727C0.672073 10.0856 0.771349 10.0337 0.877361 10.0337H2.74172C2.83418 10.0337 2.92222 10.0732 2.98357 10.1424L4.40944 11.7499L6.7239 10.094C6.77877 10.0547 6.84453 10.0337 6.91201 10.0337H9.15798L9.97754 8.32801C10.0314 8.216 10.1447 8.14474 10.2689 8.14474H11.2704V6.78422ZM10.4723 8.79135L9.87534 10.0337H13.3119L12.715 8.79135H10.4723ZM7.01572 10.6802L2.34109 14.0247C2.34102 14.0247 2.34097 14.0248 2.34091 14.0248L1.43088 14.6759L2.34249 15.3355C2.34254 15.3356 2.3426 15.3356 2.34266 15.3356L4.54971 16.9326C4.5499 16.9327 4.55009 16.9329 4.55029 16.933L7.01673 18.7176H16.0672C16.0873 18.7085 16.1123 18.6968 16.1419 18.6827C16.2293 18.6407 16.3558 18.5768 16.5083 18.4909C16.814 18.3188 17.2203 18.0605 17.6246 17.7156C18.4382 17.0215 19.205 16.0124 19.1977 14.6762C19.1904 13.3383 18.4226 12.3403 17.614 11.659C17.2119 11.3203 16.8089 11.068 16.506 10.9005C16.3548 10.8169 16.2295 10.755 16.143 10.7143C16.1135 10.7005 16.0886 10.6891 16.0687 10.6802H7.01572ZM3.88361 17.2487L2.30828 16.1088L1.34187 18.7176H2.59526L3.88361 17.2487ZM2.30778 13.2535L3.88071 12.1282L2.59634 10.6802H1.3437L2.30778 13.2535ZM7.69522 13.7243C7.18283 13.7243 6.76743 14.1397 6.76743 14.6521C6.76743 15.1645 7.18283 15.5799 7.69522 15.5799C8.20761 15.5799 8.62302 15.1645 8.62302 14.6521C8.62302 14.1397 8.20761 13.7243 7.69522 13.7243ZM6.12086 14.6521C6.12086 13.7826 6.82572 13.0778 7.69522 13.0778C8.56471 13.0778 9.26962 13.7826 9.26962 14.6521C9.26962 15.5216 8.56471 16.2264 7.69522 16.2264C6.82572 16.2264 6.12086 15.5216 6.12086 14.6521ZM10.0617 14.6521C10.0617 13.7826 10.7666 13.0778 11.6361 13.0778C12.5056 13.0778 13.2104 13.7826 13.2104 14.6521C13.2104 15.5216 12.5056 16.2264 11.6361 16.2264C10.7666 16.2264 10.0617 15.5216 10.0617 14.6521ZM11.6361 13.7243C11.1236 13.7243 10.7083 14.1397 10.7083 14.6521C10.7083 15.1645 11.1236 15.5799 11.6361 15.5799C12.1485 15.5799 12.5639 15.1645 12.5639 14.6521C12.5639 14.1397 12.1485 13.7243 11.6361 13.7243ZM15.5894 13.7243C15.077 13.7243 14.6616 14.1397 14.6616 14.6521C14.6616 15.1645 15.077 15.5799 15.5894 15.5799C16.1018 15.5799 16.5172 15.1645 16.5172 14.6521C16.5172 14.1397 16.1018 13.7243 15.5894 13.7243ZM14.015 14.6521C14.015 13.7826 14.7199 13.0778 15.5894 13.0778C16.4589 13.0778 17.1638 13.7826 17.1638 14.6521C17.1638 15.5216 16.4589 16.2264 15.5894 16.2264C14.7199 16.2264 14.015 15.5216 14.015 14.6521Z",fill:"#2A384A"})),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("linearGradient",{id:"paint0_linear_517_6831",x1:"10.2255",y1:"6.04818",x2:"8.95738",y2:"20.334",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"#FFFF82"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#FF99B4"})),/*#__PURE__*/wn.createElement("clipPath",{id:"clip0_517_6831"},/*#__PURE__*/wn.createElement("rect",{width:"20",height:"18.805",fill:"white",transform:"translate(0.5 0.597656)"}))));};var VesselIcon=CreateIcon(VesselIconSvg);var BinanceIconSvg=function BinanceIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M20 0H0V20H20V0Z",fill:"#14151A"}),/*#__PURE__*/wn.createElement("path",{d:"M7.26562 10L6.13281 11.1328L5 10L6.13281 8.86719L7.26562 10ZM10 7.25781L11.9375 9.19531L13.0703 8.0625L11.1328 6.13281L10 5L8.875 6.13281L6.9375 8.0625L8.07031 9.19531L10 7.25781ZM13.8672 8.875L12.7422 10L13.875 11.1328L15 10L13.8672 8.875ZM10 12.7422L8.0625 10.8047L6.9375 11.9375L8.875 13.875L10 15L11.1328 13.8672L13.0703 11.9297L11.9375 10.8047L10 12.7422ZM10 11.125L11.1328 10L10 8.86719L8.875 10L10 11.125Z",fill:"#F0B90B"}));};var BinanceIcon=CreateIcon(BinanceIconSvg);var GenericWalletIconSvg=function GenericWalletIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M18.5 4.28V2C18.5 0.9 17.6 0 16.5 0H2.5C1.39 0 0.5 0.9 0.5 2V16C0.5 17.1 1.39 18 2.5 18H16.5C17.6 18 18.5 17.1 18.5 16V13.72C19.09 13.37 19.5 12.74 19.5 12V6C19.5 5.26 19.09 4.63 18.5 4.28ZM17.5 6V12H10.5V6H17.5ZM2.5 16V2H16.5V4H10.5C9.4 4 8.5 4.9 8.5 6V12C8.5 13.1 9.4 14 10.5 14H16.5V16H2.5Z",fill:"black"}),/*#__PURE__*/wn.createElement("path",{d:"M13.5 10.5C14.3284 10.5 15 9.82843 15 9C15 8.17157 14.3284 7.5 13.5 7.5C12.6716 7.5 12 8.17157 12 9C12 9.82843 12.6716 10.5 13.5 10.5Z",fill:"black"}));};var GenericWalletIcon=CreateIcon(GenericWalletIconSvg);var hasMultipleEthereumWallets=function hasMultipleEthereumWallets(){var _a;return!!((_a=window.ethereum)===null||_a===void 0?void 0:_a.providers);};var hasMetaMask=function hasMetaMask(){var _a;return!!(hasMultipleEthereumWallets()?(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return wallet.isMetaMask;}):window.ethereum.isMetaMask);};var hasCoinbaseWallet=function hasCoinbaseWallet(){var _a,_b;return!!(hasMultipleEthereumWallets()?(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return wallet.isCoinbaseWallet;}):(_b=window.ethereum)===null||_b===void 0?void 0:_b.isCoinbaseWallet);};var hasOtherEthereumWallet=function hasOtherEthereumWallet(){return!hasMetaMask()&&!hasCoinbaseWallet()&&!!window.ethereum;};var getMetaMaskProvider=function getMetaMaskProvider(){var _a;return hasMultipleEthereumWallets()?(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return wallet.isMetaMask;}):window.ethereum;};var getCoinbaseProvider=function getCoinbaseProvider(){var _a;return hasMultipleEthereumWallets()?(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return wallet.isCoinbaseWallet;}):window.ethereum;};var getOtherInjectedProvider=function getOtherInjectedProvider(){var _a;return(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return!wallet.isCoinbaseWallet&&!wallet.isMetaMask;});};var WalletToIcon=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Wallets.Phantom,PhantomIcon),Wallets.Vessel,VesselIcon),Wallets.Binance,BinanceIcon),Wallets.Coinbase,CoinbaseIcon),Wallets.Metamask,MetamaskIcon),Wallets.GenericEthereumWallet,GenericWalletIcon),Wallets.GenericSolanaWallet,GenericWalletIcon);var WalletToText=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Wallets.Phantom,{id:'crypto.wallet.phantom',message:"Phantom"}),Wallets.Vessel,{id:'crypto.wallet.vessel',message:"Vessel"}),Wallets.Binance,{id:'crypto.wallet.binance',message:"Binance"}),Wallets.Coinbase,{id:'crypto.wallet.coinbase',message:"Coinbase"}),Wallets.Metamask,{id:'crypto.wallet.metamask',message:"Metamask"}),Wallets.GenericEthereumWallet,{id:'crypto.wallet.otherEthereum',message:"Other Ethereum Wallet"}),Wallets.GenericSolanaWallet,{id:'crypto.wallet.otherSolana',message:"Other Solana Wallet"});var isWalletVisible=function isWalletVisible(wallet){var _a,_b;switch(wallet){case Wallets.Metamask:return!!window.ethereum&&hasMetaMask();case Wallets.Phantom:return(_b=!!window.solana&&((_a=window.solana)===null||_a===void 0?void 0:_a.isPhantom))!==null&&_b!==void 0?_b:false;case Wallets.Vessel:return!!window.vessel;case Wallets.Binance:return!!window.BinanceChain;case Wallets.Coinbase:return!!window.ethereum&&hasCoinbaseWallet();case Wallets.GenericEthereumWallet:return!!window.ethereum&&hasOtherEthereumWallet();case Wallets.GenericSolanaWallet:return!!window.solana&&!window.solana.isPhantom;default:return false;}};var connectWithEthereumProvider=function connectWithEthereumProvider(request){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee88(){var _yield$request,_yield$request2,address;return _regenerator2().w(function(_context88){while(1)switch(_context88.n){case 0:_context88.n=1;return request({method:'eth_requestAccounts'});case 1:_yield$request=_context88.v;_yield$request2=_slicedToArray2(_yield$request,1);address=_yield$request2[0];return _context88.a(2,address);}},_callee88);}));};var connectWithWallet=function connectWithWallet(_ref88){var wallet=_ref88.wallet;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee89(){var provider,connectResp,_provider,_yield$window$vessel$,_yield$window$vessel$2,response,_provider2,_provider3,_connectResp,_t16;return _regenerator2().w(function(_context89){while(1)switch(_context89.n){case 0:_t16=wallet;_context89.n=_t16===Wallets.Metamask?1:_t16===Wallets.Phantom?2:_t16===Wallets.Binance?4:_t16===Wallets.Vessel?5:_t16===Wallets.Coinbase?7:_t16===Wallets.GenericEthereumWallet?8:_t16===Wallets.GenericSolanaWallet?9:11;break;case 1:provider=getMetaMaskProvider();return _context89.a(2,(provider===null||provider===void 0?void 0:provider.request)?connectWithEthereumProvider(provider===null||provider===void 0?void 0:provider.request):'');case 2:_context89.n=3;return window.solana.connect();case 3:connectResp=_context89.v;return _context89.a(2,connectResp.publicKey.toString());case 4:_provider=window.BinanceChain;return _context89.a(2,(_provider===null||_provider===void 0?void 0:_provider.request)?connectWithEthereumProvider(_provider===null||_provider===void 0?void 0:_provider.request):'');case 5:_context89.n=6;return window.vessel.ethereum.request({method:'eth_requestAccounts'});case 6:_yield$window$vessel$=_context89.v;_yield$window$vessel$2=_slicedToArray2(_yield$window$vessel$,1);response=_yield$window$vessel$2[0];return _context89.a(2,response);case 7:_provider2=getCoinbaseProvider();return _context89.a(2,(_provider2===null||_provider2===void 0?void 0:_provider2.request)?connectWithEthereumProvider(_provider2===null||_provider2===void 0?void 0:_provider2.request):'');case 8:_provider3=getOtherInjectedProvider();return _context89.a(2,(_provider3===null||_provider3===void 0?void 0:_provider3.request)?connectWithEthereumProvider(_provider3===null||_provider3===void 0?void 0:_provider3.request):'');case 9:_context89.n=10;return window.solana.connect();case 10:_connectResp=_context89.v;return _context89.a(2,_connectResp.publicKey.toString());case 11:return _context89.a(2,'');case 12:return _context89.a(2);}},_callee89);}));};var signMessageWithSolanaProvider=function signMessageWithSolanaProvider(message){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee90(){var encodedMessage,signResp;return _regenerator2().w(function(_context90){while(1)switch(_context90.n){case 0:encodedMessage=new TextEncoder().encode(message);_context90.n=1;return window.solana.request({method:'signMessage',params:{message:encodedMessage,display:'utf8'}});case 1:signResp=_context90.v;return _context90.a(2,bs58.encode(signResp.signature));}},_callee90);}));};var signMessageWithEthereumProvider=function signMessageWithEthereumProvider(request,message,address){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee91(){var signature;return _regenerator2().w(function(_context91){while(1)switch(_context91.n){case 0:_context91.n=1;return request({method:'personal_sign',params:[message,address]});case 1:signature=_context91.v;return _context91.a(2,signature);}},_callee91);}));};var signMessageWithWallet=function signMessageWithWallet(_ref89){var wallet=_ref89.wallet,message=_ref89.message,address=_ref89.address;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee92(){var provider,_provider4,_provider5,_provider6,_t17;return _regenerator2().w(function(_context92){while(1)switch(_context92.n){case 0:_t17=wallet;_context92.n=_t17===Wallets.Phantom?1:_t17===Wallets.GenericSolanaWallet?1:_t17===Wallets.Metamask?2:_t17===Wallets.Vessel?3:_t17===Wallets.Binance?4:_t17===Wallets.Coinbase?5:_t17===Wallets.GenericEthereumWallet?6:7;break;case 1:return _context92.a(2,signMessageWithSolanaProvider(message));case 2:provider=getMetaMaskProvider();return _context92.a(2,(provider===null||provider===void 0?void 0:provider.request)?signMessageWithEthereumProvider(provider===null||provider===void 0?void 0:provider.request,message,address):'');case 3:return _context92.a(2,signMessageWithEthereumProvider(window.vessel.ethereum.request,message,address));case 4:_provider4=window.BinanceChain;return _context92.a(2,(_provider4===null||_provider4===void 0?void 0:_provider4.request)?signMessageWithEthereumProvider(_provider4===null||_provider4===void 0?void 0:_provider4.request,message,address):'');case 5:_provider5=getCoinbaseProvider();return _context92.a(2,(_provider5===null||_provider5===void 0?void 0:_provider5.request)?signMessageWithEthereumProvider(_provider5===null||_provider5===void 0?void 0:_provider5.request,message,address):'');case 6:_provider6=getOtherInjectedProvider();return _context92.a(2,(_provider6===null||_provider6===void 0?void 0:_provider6.request)?signMessageWithEthereumProvider(_provider6===null||_provider6===void 0?void 0:_provider6.request,message,address):'');case 7:return _context92.a(2,'');case 8:return _context92.a(2);}},_callee92);}));};var isSolanaWallet=function isSolanaWallet(wallet){return[Wallets.Phantom,Wallets.GenericSolanaWallet].includes(wallet);};var MAX_BUTTONS=6;var SetupButton=He(BaseButton)(_templateObject19||(_templateObject19=_taggedTemplateLiteral(["\n width: 100%;\n text-align: center;\n font-weight: 600;\n"])));var walletMessages=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Wallets.Phantom,{id:'crypto.wallet.continueWithPhantom',message:"Continue with Phantom"}),Wallets.Vessel,{id:'crypto.wallet.continueWithVessel',message:"Continue with Vessel"}),Wallets.Binance,{id:'crypto.wallet.continueWithBinance',message:"Continue with Binance"}),Wallets.Coinbase,{id:'crypto.wallet.continueWithCoinbase',message:"Continue with Coinbase"}),Wallets.Metamask,{id:'crypto.wallet.continueWithMetamask',message:"Continue with Metamask"}),Wallets.GenericEthereumWallet,{id:'crypto.wallet.continueWithEthereum',message:"Continue with Other Ethereum Wallet"}),Wallets.GenericSolanaWallet,{id:'crypto.wallet.continueWithSolana',message:"Continue with Other Solana Wallet"});var CryptoWalletButtons=function CryptoWalletButtons(_ref90){var type=_ref90.type;var _a,_b;var _useLingui13=useLingui(),_t=_useLingui13._;var _useGlobalReducer1=useGlobalReducer(),_useGlobalReducer10=_slicedToArray2(_useGlobalReducer1,2),state=_useGlobalReducer10[0],dispatch=_useGlobalReducer10[1];var config=useConfig();var oAuthOptions=(_b=(_a=config.oauthOptions)===null||_a===void 0?void 0:_a.providers.length)!==null&&_b!==void 0?_b:0;var cryptoButtonsOnMainScreen=MAX_BUTTONS-oAuthOptions-1;var onWalletStart=function onWalletStart(wallet){dispatch({type:'update_crypto_state',cryptoState:Object.assign(Object.assign({},state.formState.cryptoState),{walletOption:wallet})});dispatch({type:'transition',screen:AppScreens$1.CryptoConnect});};var allDetectedWallets=Object.keys(Wallets).filter(function(wallet){return isWalletVisible(Wallets[wallet]);});var renderOtherScreenButton=allDetectedWallets.length>cryptoButtonsOnMainScreen;var mainWallets=allDetectedWallets.slice(0,cryptoButtonsOnMainScreen);var otherWallet=allDetectedWallets.slice(cryptoButtonsOnMainScreen);var walletsToRender=type==='main'?mainWallets:otherWallet;var WalletIconComponent=function WalletIconComponent(_ref91){var wallet=_ref91.wallet;var Icon=WalletToIcon[wallet];return/*#__PURE__*/y$3(Icon,null);};return/*#__PURE__*/y$3(Flex,{direction:"column",gap:8,className:"wallet-buttons"},walletsToRender.map(function(wallet){return/*#__PURE__*/y$3(WalletButton,{key:wallet,icon:/*#__PURE__*/y$3(WalletIconComponent,{wallet:Wallets[wallet]}),walletTypeTitle:type==='main'?_t(walletMessages[Wallets[wallet]]):_t(WalletToText[Wallets[wallet]]),onClick:function onClick(){return onWalletStart(Wallets[wallet]);}});}),renderOtherScreenButton&&type==='main'?(/*#__PURE__*/y$3(WalletButton,{walletTypeTitle:_t({id:'crypto.wallet.continueWithOtherWallet',message:"Continue with other Crypto Wallet"}),icon:/*#__PURE__*/y$3(WalletIconComponent,{wallet:Wallets.GenericEthereumWallet}),onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.CryptoOtherScreen});}})):(/*#__PURE__*/y$3(SetupButton,{type:"button",onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.CryptoSetupWallet});}},_t({id:'crypto.wallet.setupNewWallet',message:"Set up a new crypto wallet"}))));};var PasskeyIconSvg=function PasskeyIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M8.75 10C10.8211 10 12.5 8.32107 12.5 6.25C12.5 4.17893 10.8211 2.5 8.75 2.5C6.67893 2.5 5 4.17893 5 6.25C5 8.32107 6.67893 10 8.75 10Z",fill:"#19303D"}),/*#__PURE__*/wn.createElement("path",{d:"M18.7501 10.0001C18.7519 9.47774 18.6134 8.96445 18.349 8.51388C18.0847 8.06332 17.7041 7.69203 17.2472 7.43881C16.7903 7.18559 16.2738 7.05973 15.7516 7.07439C15.2294 7.08905 14.7207 7.24369 14.2787 7.52214C13.8367 7.8006 13.4776 8.19265 13.239 8.65733C13.0003 9.12202 12.8908 9.64227 12.9219 10.1637C12.9531 10.6852 13.1237 11.1887 13.416 11.6217C13.7082 12.0547 14.1114 12.4012 14.5834 12.6251V17.0835L15.8334 18.3335L17.9167 16.2501L16.6667 15.0001L17.9167 13.7501L16.8834 12.7168C17.4322 12.505 17.9042 12.1323 18.2373 11.6474C18.5704 11.1626 18.7492 10.5884 18.7501 10.0001ZM15.8334 10.0001C15.6686 10.0001 15.5075 9.95126 15.3704 9.85969C15.2334 9.76812 15.1266 9.63797 15.0635 9.4857C15.0004 9.33343 14.9839 9.16587 15.0161 9.00422C15.0482 8.84257 15.1276 8.69409 15.2441 8.57754C15.3607 8.461 15.5092 8.38163 15.6708 8.34948C15.8325 8.31732 16 8.33383 16.1523 8.3969C16.3046 8.45997 16.4347 8.56678 16.5263 8.70382C16.6179 8.84086 16.6667 9.00198 16.6667 9.1668C16.6667 9.38781 16.5789 9.59977 16.4227 9.75605C16.2664 9.91233 16.0544 10.0001 15.8334 10.0001Z",fill:"#19303D"}),/*#__PURE__*/wn.createElement("path",{d:"M12.0333 11.6833C11.3934 11.398 10.7007 11.2504 10 11.25H7.5C6.17392 11.25 4.90215 11.7768 3.96447 12.7145C3.02678 13.6521 2.5 14.9239 2.5 16.25V17.9167H13.3333V13.325C12.7713 12.8933 12.3248 12.3293 12.0333 11.6833Z",fill:"#19303D"}));};var PasskeysIcon=CreateIcon(PasskeyIconSvg);var PasskeyButton=function PasskeyButton(_ref92){var startPasskeyAuth=_ref92.startPasskeyAuth;var _useLingui14=useLingui(),_t=_useLingui14._;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"outlined",onClick:startPasskeyAuth},/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center",alignItems:"center",gap:4},/*#__PURE__*/wn.createElement(PasskeysIcon,null),/*#__PURE__*/wn.createElement("span",{style:{verticalAlign:'middle'}},_t({id:'button.loginWithPasskey',message:"Login with a Passkey"})))));};var isTruthy=function isTruthy(value){return Boolean(value);};var extractErrorMessage=function extractErrorMessage(error,messageFallback){if(error&&_typeof2(error)==='object'){if('error_message'in error&&typeof error.error_message==='string'){return error.error_message;}if('message'in error&&typeof error.message==='string'){return error.message;}}};var MAX_ATTEMPTS=5;var usePromptPasskey=function usePromptPasskey(_ref93){var canAutofill=_ref93.canAutofill;var _a,_b;var _useLingui15=useLingui(),_t=_useLingui15._;var stytchClient=useStytch();var config=useConfig();var hasPasskeys=config.products.includes(Products.passkeys);var onEvent=useEventCallback();var onError=useErrorCallback();var _useGlobalReducer11=useGlobalReducer(),_useGlobalReducer12=_slicedToArray2(_useGlobalReducer11,2),dispatch=_useGlobalReducer12[1];var _h$43=h$5(),_h$44=_slicedToArray2(_h$43,2),error=_h$44[0],setError=_h$44[1];var startPasskeyAuth=T$3(function(){var _ref94=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref94$conditionalMed=_ref94.conditionalMediation,conditionalMediation=_ref94$conditionalMed===void 0?false:_ref94$conditionalMed,abortController=_ref94.abortController;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee93(){var _c,_d,_e,resp,message,_t18;return _regenerator2().w(function(_context93){while(1)switch(_context93.p=_context93.n){case 0:_context93.p=0;_context93.n=1;return stytchClient.webauthn.authenticate({domain:(_c=config.passkeyOptions)===null||_c===void 0?void 0:_c.domain,session_duration_minutes:(_e=(_d=config.sessionOptions)===null||_d===void 0?void 0:_d.sessionDurationMinutes)!==null&&_e!==void 0?_e:DEFAULT_SESSION_DURATION_MINUTES,conditional_mediation:conditionalMediation,is_passkey:true,signal:abortController===null||abortController===void 0?void 0:abortController.signal});case 1:resp=_context93.v;if(resp){_context93.n=2;break;}throw new Error('Empty response');case 2:onEvent({type:StytchEventType.PasskeyAuthenticate,data:resp});dispatch({type:'transition',screen:AppScreens$1.PasskeyConfirmation});return _context93.a(2,resp);case 3:_context93.p=3;_t18=_context93.v;if(extractErrorType(_t18)==='webauthn_registration_not_found'){setError(_t({id:'error.passkeyRegistrationNotFound',message:"Passkey registration not found. You may have deleted the passkey from your account but not password manager. Please try again."}));}else if(_t18 instanceof Error&&_t18.name==='StytchAPIError'){setError(_t({id:'error.passkeyUnknown',message:"Unknown error occurred during passkey authentication. Please try again."}));}message=extractErrorMessage(_t18);if(message){onError({message:message});}throw _t18;case 4:return _context93.a(2);}},_callee93,null,[[0,3]]);}));},[(_a=config.passkeyOptions)===null||_a===void 0?void 0:_a.domain,(_b=config.sessionOptions)===null||_b===void 0?void 0:_b.sessionDurationMinutes,dispatch,onError,onEvent,stytchClient.webauthn,_t]);p$5(function(){if(!hasPasskeys||!canAutofill){return;}var abortController=new AbortController();(function(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee94(){var _i4,_t19;return _regenerator2().w(function(_context94){while(1)switch(_context94.p=_context94.n){case 0:_context94.n=1;return stytchClient.webauthn.browserSupportsAutofill();case 1:if(_context94.v){_context94.n=2;break;}return _context94.a(2);case 2:_i4=0;case 3:if(!(_i4<MAX_ATTEMPTS)){_context94.n=8;break;}if(!abortController.signal.aborted){_context94.n=4;break;}return _context94.a(2);case 4:_context94.p=4;_context94.n=5;return startPasskeyAuth({abortController:abortController,conditionalMediation:true});case 5:return _context94.a(2);case 6:_context94.p=6;_t19=_context94.v;if(!(_t19 instanceof DOMException&&_t19.name==='NotAllowedError')){_context94.n=7;break;}return _context94.a(2);case 7:++_i4;_context94.n=3;break;case 8:return _context94.a(2);}},_callee94,null,[[4,6]]);}));})();return function(){abortController.abort();};},[canAutofill,hasPasskeys,startPasskeyAuth,stytchClient.webauthn]);return[startPasskeyAuth,error];};var IconColorOverride=He.div(_templateObject20||(_templateObject20=_taggedTemplateLiteral(["\n display: contents; // Try to be as transparent as possible as a wrapper div\n\n path {\n fill: ",";\n }\n"])),function(props){if('color'in props)return props.color;if('themeColor'in props)return props.theme.colors[props.themeColor];});var WarningIcon=function WarningIcon(){return/*#__PURE__*/wn.createElement("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12.5 6.49L20.03 19.5H4.97L12.5 6.49ZM12.5 2.5L1.5 21.5H23.5L12.5 2.5ZM13.5 16.5H11.5V18.5H13.5V16.5ZM13.5 10.5H11.5V14.5H13.5V10.5Z",fill:"#C28E1F"}));};var WarningIcon$1=CreateIcon(WarningIcon);var SuccessIcon$1=function SuccessIcon$1(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z",fill:"#0C5A56"}));};var SuccessIcon$2=CreateIcon(SuccessIcon$1);var ErrorIcon$1=function ErrorIcon$1(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M9 13H11V15H9V13ZM9 5H11V11H9V5ZM9.99 0C4.47 0 0 4.48 0 10C0 15.52 4.47 20 9.99 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 9.99 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z",fill:"#AD2E30"}));};var ErrorIcon$2=CreateIcon(ErrorIcon$1);var AlertBoxStyled=He(Flex)(_templateObject21||(_templateObject21=_taggedTemplateLiteral(["\n border: 1px solid ",";\n border-left-width: 6px;\n border-radius: 4px;\n padding: 24px;\n"])),function(props){return props.theme.colors[props.variant];});var AlertBox=function AlertBox(_ref95){var variant=_ref95.variant,text=_ref95.text;return/*#__PURE__*/wn.createElement(AlertBoxStyled,{variant:variant,gap:8,alignItems:"center"},/*#__PURE__*/wn.createElement(IconColorOverride,{themeColor:variant},variant==='error'&&/*#__PURE__*/wn.createElement(ErrorIcon$2,null),variant==='warning'&&/*#__PURE__*/wn.createElement(WarningIcon$1,null),variant==='success'&&/*#__PURE__*/wn.createElement(SuccessIcon$2,null)),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"primary"},text));};var Container$1=He(Flex)(_templateObject22||(_templateObject22=_taggedTemplateLiteral(["\n .oauth-buttons + .wallet-buttons {\n margin-top: 8px;\n }\n .wallet-buttons + .oauth-buttons {\n margin-top: 8px;\n }\n > * + * {\n margin-top: 24px;\n }\n"])));var Logo$1=He.img(_templateObject23||(_templateObject23=_taggedTemplateLiteral(["\n max-height: 50px;\n max-width: 100px;\n"])));var MainScreen=function MainScreen(){var stytchClient=useStytch();var config=useConfig();var _Ze=Ze(),displayHeader=_Ze.displayHeader,logo=_Ze.logo;var _useLingui16=useLingui(),_t=_useLingui16._;var _h$45=h$5([]),_h$46=_slicedToArray2(_h$45,2),productComponents=_h$46[0],setProductComponents=_h$46[1];var products=config.products,oauthOptions=config.oauthOptions;var hasButtons=products.includes(Products.oauth)&&oauthOptions||products.includes(Products.crypto);var hasPasskeys=products.includes(Products.passkeys);var hasInput=products.includes(Products.emailMagicLinks)||products.includes(Products.otp)||products.includes(Products.passwords);var _usePromptPasskey=usePromptPasskey({canAutofill:hasInput}),_usePromptPasskey2=_slicedToArray2(_usePromptPasskey,2),startPasskeyAuth=_usePromptPasskey2[0],passkeyError=_usePromptPasskey2[1];p$5(function(){var loadProductComponents=function loadProductComponents(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee95(){var keys,showDivider,_t20,_t21;return _regenerator2().w(function(_context95){while(1)switch(_context95.n){case 0:keys=Array.from(new Set(products.map(function(product){switch(product){case Products.oauth:case Products.crypto:return product;case Products.emailMagicLinks:case Products.otp:case Products.passwords:return'login-form';}}).filter(isTruthy)));showDivider=hasButtons&&hasInput;if(keys.length>1&&showDivider){keys.splice(-1,0,'divider');}_t20=hasPasskeys;if(!_t20){_context95.n=3;break;}_t21=!hasInput;if(_t21){_context95.n=2;break;}_context95.n=1;return stytchClient.webauthn.browserSupportsAutofill();case 1:_t21=!_context95.v;case 2:_t20=_t21;case 3:if(!_t20){_context95.n=4;break;}keys.unshift('passkey-button');case 4:setProductComponents(keys);case 5:return _context95.a(2);}},_callee95);}));};loadProductComponents();},[]);if(hasPasskeys&&products.length===1)return/*#__PURE__*/wn.createElement(Text,{size:"helper"},"Error: Cannot use Passkeys by itself, please add another product to the config.");return/*#__PURE__*/wn.createElement(Container$1,{direction:"column"},logo.logoImageUrl!==''&&(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center"},/*#__PURE__*/wn.createElement(Logo$1,{src:logo.logoImageUrl}))),displayHeader&&(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center"},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'login.title',message:"Sign up or log in"})))),passkeyError&&/*#__PURE__*/wn.createElement(AlertBox,{variant:"warning",text:passkeyError}),productComponents.map(function(key){switch(key){case'oauth':return/*#__PURE__*/wn.createElement(OAuthButtons,{key:key});case'crypto':return/*#__PURE__*/wn.createElement(CryptoWalletButtons,{type:"main",key:key});case'login-form':return/*#__PURE__*/wn.createElement(LoginForm,{key:key});case'passkey-button':return/*#__PURE__*/wn.createElement(PasskeyButton,{startPasskeyAuth:startPasskeyAuth,key:key});case'divider':return/*#__PURE__*/wn.createElement(Divider,{key:key});}}));};var BackButton=He(BaseButton)(_templateObject24||(_templateObject24=_taggedTemplateLiteral(["\n &:focus-visible {\n // Move the focus ring to the inner SVG\n outline: none;\n\n svg {\n ","\n }\n }\n"])),focusedRing);var BackArrowSvg=function BackArrowSvg(_ref96){var color=_ref96.color;return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z",fill:color}));};var BackArrow=function BackArrow(_ref97){var onClick=_ref97.onClick;var theme=Ze();var _useLingui17=useLingui(),_t=_useLingui17._;return/*#__PURE__*/wn.createElement(BackButton,{type:"button",onClick:onClick,"aria-label":_t({id:'button.back.ariaLabel',message:"Back"})},/*#__PURE__*/wn.createElement(BackArrowSvg,{color:theme.colors.primary}));};var StyledButton=He(BaseButton)(_templateObject25||(_templateObject25=_taggedTemplateLiteral(["\n font-weight: bold;\n\n &:focus-visible,\n &:hover {\n outline: none;\n text-decoration: underline;\n text-decoration-color: ",";\n }\n\n &:disabled {\n pointer-events: none;\n }\n"])),function(props){return props.theme.colors.primary;});var InlineButton=function InlineButton(_ref98){var onClick=_ref98.onClick,children=_ref98.children,disabled=_ref98.disabled,className=_ref98.className;return/*#__PURE__*/wn.createElement(StyledButton,{onClick:onClick,disabled:disabled,className:className},children);};var Wrapper=He.div(_templateObject26||(_templateObject26=_taggedTemplateLiteral(["\n display: grid;\n grid-template-rows: ",";\n transition: grid-template-rows 0.15s ease-out;\n"])),function(_ref99){var isOpen=_ref99.isOpen;return isOpen?'1fr':'0fr';});var Inner=He.div(_templateObject27||(_templateObject27=_taggedTemplateLiteral(["\n overflow: hidden;\n"])));var AnimatedContainer=function AnimatedContainer(_ref100){var isOpen=_ref100.isOpen,children=_ref100.children;return/*#__PURE__*/wn.createElement(Wrapper,{isOpen:isOpen},/*#__PURE__*/wn.createElement(Inner,null,children));};var Container=He.div(_templateObject28||(_templateObject28=_taggedTemplateLiteral(["\n height: 4px;\n background-color: ",";\n border-radius: 3px;\n overflow: hidden;\n"])),function(_ref101){var theme=_ref101.theme;return theme.colors.disabled;});var loading=Ue(_templateObject29||(_templateObject29=_taggedTemplateLiteral(["\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(-1%);\n }\n"])));var Progress=He.div(_templateObject30||(_templateObject30=_taggedTemplateLiteral(["\n height: 100%;\n width: 100%;\n background-color: ",";\n animation: "," 10s cubic-bezier(0.22, 1, 0.36, 1);\n"])),function(_ref102){var theme=_ref102.theme;return theme.colors.primary;},loading);var LoadingBar=function LoadingBar(_ref103){var isLoading=_ref103.isLoading;return/*#__PURE__*/wn.createElement(Container,null,isLoading&&/*#__PURE__*/wn.createElement(Progress,null));};var OTP_LENGTH=6;var GAP='8px';var WIDTH='46px';var INPUT_HEIGHT='46px';var Digit=He.div(_templateObject31||(_templateObject31=_taggedTemplateLiteral(["\n border: 1px solid ",";\n border-radius: 4px;\n align-items: center;\n display: flex;\n font-size: 18px;\n justify-content: center;\n height: ",";\n width: ",";\n background: ",";\n color: ",";\n"])),function(_ref104){var disabled=_ref104.disabled,theme=_ref104.theme;return disabled?theme.colors.disabled:'#ADBCC5';},INPUT_HEIGHT,WIDTH,function(_ref105){var disabled=_ref105.disabled,theme=_ref105.theme;return disabled?theme.colors.disabled:theme.inputs.backgroundColor;},function(_ref106){var disabled=_ref106.disabled,theme=_ref106.theme;return disabled?theme.colors.disabledText:theme.inputs.textColor;});var digitsContainerStyles={display:'flex',justifyContent:'space-between',gap:GAP,position:'relative',zIndex:-1};var otpContainerStyles={overflow:'hidden',position:'relative',textAlign:'initial',zIndex:1};var invisibleInputStyles={background:'transparent',border:'none',color:'transparent',height:INPUT_HEIGHT,margin:0,outline:'none',position:'absolute',width:"calc(100% - (0.5 * ".concat(WIDTH,"))"),caretColor:'#ADBCC5',letterSpacing:"calc(".concat(WIDTH," - 1ch + ").concat(GAP,")"),paddingLeft:"calc(0.5 * ".concat(WIDTH,")"),zIndex:10};var DigitAtIndex=function DigitAtIndex(_ref107){var index=_ref107.index,disabled=_ref107.disabled,otp=_ref107.otp;var fill=otp?otp[index]:'';return/*#__PURE__*/wn.createElement(Digit,{disabled:disabled,"data-testid":"otp-".concat(index)},fill);};var OTPInput=function OTPInput(_ref108){var otp=_ref108.otp,setOtp=_ref108.setOtp,disabled=_ref108.disabled;var _useLingui18=useLingui(),_t=_useLingui18._;var ref=_$2(null);p$5(function(){var _a;if(!disabled){(_a=ref.current)===null||_a===void 0?void 0:_a.focus();}},[disabled,ref]);var handleInput=function handleInput(e){var target=e.target;var newValue=target.value.replace(/\D/g,'').slice(0,OTP_LENGTH);target.value=newValue;if(newValue!==otp){setOtp(newValue);}};return/*#__PURE__*/wn.createElement("div",{style:otpContainerStyles},/*#__PURE__*/wn.createElement("input",Object.assign({ref:ref,"aria-label":_t({id:'formField.otp.ariaLabel',message:"One-time passcode"}),autoComplete:"one-time-code",autoFocus:true,disabled:disabled,style:invisibleInputStyles,onInput:handleInput,type:"text",inputMode:"numeric",value:otp},passwordManagerDisableAutofillProps)),/*#__PURE__*/wn.createElement("div",{style:digitsContainerStyles},_toConsumableArray2(Array(OTP_LENGTH).keys()).map(function(i){return/*#__PURE__*/wn.createElement(DigitAtIndex,{key:"digit-".concat(i),index:i,otp:otp,disabled:!!disabled});})));};var OTP_CODE_LENGTH=6;var OTPControl=function OTPControl(_ref109){var isSubmitting=_ref109.isSubmitting,onSubmit=_ref109.onSubmit,errorMessage=_ref109.errorMessage;var _useLingui19=useLingui(),_t=_useLingui19._;var _h$47=h$5(''),_h$48=_slicedToArray2(_h$47,2),otp=_h$48[0],setOtp=_h$48[1];var handleOtpChange=function handleOtpChange(otp){setOtp(otp);if(otp.length===OTP_CODE_LENGTH){onSubmit(otp);}};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",maxWidth:316},/*#__PURE__*/wn.createElement(OTPInput,{otp:otp,setOtp:handleOtpChange,disabled:isSubmitting}),/*#__PURE__*/wn.createElement(AnimatedContainer,{isOpen:isSubmitting},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8,marginTop:8},/*#__PURE__*/wn.createElement(Text,{color:"secondary",size:"helper"},_t({id:'formField.passcode.status.verifying',message:"Verifying passcode..."})),/*#__PURE__*/wn.createElement(LoadingBar,{isLoading:isSubmitting}))),!isSubmitting&&/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:errorMessage!==null&&errorMessage!==void 0?errorMessage:''}));};var OTPEntry=function OTPEntry(_ref110){var header=_ref110.header,helperContent=_ref110.helperContent,instruction=_ref110.instruction,isSubmitting=_ref110.isSubmitting,onSubmit=_ref110.onSubmit,errorMessage=_ref110.errorMessage;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(Text,{size:"header"},header),/*#__PURE__*/wn.createElement(Text,null,instruction),/*#__PURE__*/wn.createElement(OTPControl,{isSubmitting:isSubmitting,onSubmit:onSubmit,errorMessage:errorMessage}),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},helperContent));};var getSecondsRemaining=function getSecondsRemaining(expiration){var now=new Date();return Math.ceil((expiration.getTime()-now.getTime())/1000);};var rollToSuccess=Ue(_templateObject32||(_templateObject32=_taggedTemplateLiteral(["\n from {\n transform: translateY(0%);\n }\n to {\n transform: translateY(-50%);\n }\n"])));var rollToDefault=Ue(_templateObject33||(_templateObject33=_taggedTemplateLiteral(["\n from {\n transform: translateY(-50%);\n }\n to {\n transform: translateY(0%);\n }\n"])));var AnimatedWrapper=He.div(_templateObject34||(_templateObject34=_taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n /* Set an explicit height to create the \"window\" the animation will be displayed in. We match to the line height to ensure it looks inline with the text */\n height: ",";\n"])),function(_ref111){var theme=_ref111.theme;return theme.typography.helper.lineHeight;});var RollingContainer=He.div(_templateObject35||(_templateObject35=_taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n animation: ","\n 0.3s ease-out;\n transform: ",";\n"])),function(_ref112){var displayCodeSent=_ref112.displayCodeSent,shouldAnimate=_ref112.shouldAnimate;if(!shouldAnimate)return'none';return displayCodeSent?rollToSuccess:rollToDefault;},function(_ref113){var displayCodeSent=_ref113.displayCodeSent;return displayCodeSent?'translateY(-50%)':'translateY(0%)';});var StyledInlineButton=He(InlineButton)(_templateObject36||(_templateObject36=_taggedTemplateLiteral(["\n color: ",";\n"])),function(_ref114){var theme=_ref114.theme,isCodeSending=_ref114.isCodeSending;return isCodeSending?theme.colors.success:'inherit';});var ExpirationMessage=function ExpirationMessage(_ref115){var expiration=_ref115.expiration,resendOTP=_ref115.resendOTP,errorMessage=_ref115.errorMessage;var _useLingui20=useLingui(),_t=_useLingui20._;var _h$49=h$5(function(){return getSecondsRemaining(expiration);}),_h$50=_slicedToArray2(_h$49,2),seconds=_h$50[0],setSeconds=_h$50[1];var _h$51=h$5('initial'),_h$52=_slicedToArray2(_h$51,2),resendState=_h$52[0],setResendState=_h$52[1];var codeExpired=seconds<=0;p$5(function(){if(!codeExpired){var updateSeconds=function updateSeconds(){return setSeconds(getSecondsRemaining(expiration));};var interval=setInterval(updateSeconds,1000);updateSeconds();return function(){return clearInterval(interval);};}},[codeExpired,expiration]);var handleResendClick=function handleResendClick(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee96(){var _t22;return _regenerator2().w(function(_context96){while(1)switch(_context96.p=_context96.n){case 0:_context96.p=0;setResendState('sending');_context96.n=1;return resendOTP();case 1:setResendState('sent');setTimeout(function(){setResendState('waiting');},2000);_context96.n=3;break;case 2:_context96.p=2;_t22=_context96.v;setResendState('initial');case 3:return _context96.a(2);}},_callee96,null,[[0,2]]);}));};var displayMinutes=Math.floor(Number(seconds/60));var displaySeconds=seconds-displayMinutes*60;var timeRemaining="".concat(displayMinutes,":").concat(displaySeconds<10?"0".concat(displaySeconds):displaySeconds);var formattedText=seconds>0?_t({id:'passcode.expirationCountdown',message:"Your code expires in {timeRemaining}.",values:{timeRemaining:timeRemaining}}):_t({id:'passcode.expired',message:"Your code has expired."});return/*#__PURE__*/wn.createElement(wn.Fragment,null,formattedText,/*#__PURE__*/wn.createElement(Flex,{direction:"row",gap:8,alignItems:"center"},_t({id:'passcode.didntGetIt',message:"Didn't get it?"}),/*#__PURE__*/wn.createElement(AnimatedWrapper,null,/*#__PURE__*/wn.createElement(RollingContainer,{displayCodeSent:resendState==='sent',shouldAnimate:resendState==='sent'||resendState==='waiting'},/*#__PURE__*/wn.createElement(StyledInlineButton,{onClick:handleResendClick,isCodeSending:false,disabled:resendState==='sending'||resendState==='sent'},_t({id:'passcode.resendCode',message:"Resend code"})),/*#__PURE__*/wn.createElement(StyledInlineButton,{onClick:handleResendClick,isCodeSending:true,disabled:true},_t({id:'passcode.codeSent',message:"Code sent"}))))),/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:errorMessage!==null&&errorMessage!==void 0?errorMessage:''}));};var SentOTPEntry=function SentOTPEntry(_ref116){var expiration=_ref116.expiration,formattedDestination=_ref116.formattedDestination,isSubmitting=_ref116.isSubmitting,onSubmit=_ref116.onSubmit,errorMessage=_ref116.errorMessage,resendOTP=_ref116.resendOTP,resendErrorMessage=_ref116.resendErrorMessage;var _useLingui21=useLingui(),_t2=_useLingui21._;var helperContent=/*#__PURE__*/wn.createElement(ExpirationMessage,{expiration:expiration,resendOTP:resendOTP,errorMessage:resendErrorMessage});return/*#__PURE__*/wn.createElement(OTPEntry,{header:_t2({id:'passcode.title',message:"Enter passcode"}),helperContent:helperContent,instruction:/*#__PURE__*/wn.createElement(Trans,{id:"passcode.sentConfirmation",message:"A 6-digit passcode was sent to you at <bold>{destination}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{destination:formattedDestination}}),isSubmitting:isSubmitting,onSubmit:onSubmit,errorMessage:errorMessage});};var OTPAuthenticate=function OTPAuthenticate(_ref117){var _ref117$hideBackArrow=_ref117.hideBackArrow,hideBackArrow=_ref117$hideBackArrow===void 0?false:_ref117$hideBackArrow;var _useLingui22=useLingui(),_t=_useLingui22._;var onEvent=useEventCallback();var onError=useErrorCallback();var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer13=useGlobalReducer(),_useGlobalReducer14=_slicedToArray2(_useGlobalReducer13,2),state=_useGlobalReducer14[0],dispatch=_useGlobalReducer14[1];var _h$53=h$5(false),_h$54=_slicedToArray2(_h$53,2),isSubmitting=_h$54[0],setIsSubmitting=_h$54[1];var destination=state.formState.otpState.otpDestination;var selectionMethod=state.formState.otpState.type;var _h$55=h$5(''),_h$56=_slicedToArray2(_h$55,2),errorMessage=_h$56[0],setErrorMessage=_h$56[1];var _h$57=h$5(''),_h$58=_slicedToArray2(_h$57,2),resendErrorMessage=_h$58[0],setResendErrorMessage=_h$58[1];var _h$59=h$5(destination),_h$60=_slicedToArray2(_h$59,2),formattedDestination=_h$60[0],setFormattedDestination=_h$60[1];var calculateExpiration=function calculateExpiration(){var _a,_b;return new Date(Date.now()+1000*60*((_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES));};p$5(function(){var parseDestination=function parseDestination(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee97(){var parsePhoneNumber,national;return _regenerator2().w(function(_context97){while(1)switch(_context97.n){case 0:parsePhoneNumber=function parsePhoneNumber(phoneNumber){return readB2CInternals(stytchClient).clientsideServices.parsedPhoneNumber({phoneNumber:phoneNumber});};_context97.n=1;return formatNumber({parsePhoneNumber:parsePhoneNumber,phoneNumber:destination});case 1:national=_context97.v;setFormattedDestination(selectionMethod===OTPMethods.Email?destination:national);case 2:return _context97.a(2);}},_callee97);}));};parseDestination();},[selectionMethod,destination,stytchClient]);var _h$61=h$5(calculateExpiration),_h$62=_slicedToArray2(_h$61,2),expiration=_h$62[0],setExpiration=_h$62[1];var resendOTP=function resendOTP(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee98(){var _a,_b,data,_t23;return _regenerator2().w(function(_context98){while(1)switch(_context98.p=_context98.n){case 0:if(selectionMethod===OTPMethods.Email){readB2CInternals(stytchClient).networkClient.logEvent({name:'email_try_again_clicked',details:{email:destination,type:EmailSentType.LoginOrCreateOTP}});}_context98.p=1;_context98.n=2;return stytchClient.otps[selectionMethod].loginOrCreate(destination,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES});case 2:data=_context98.v;onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});setExpiration(calculateExpiration());dispatch({type:'update_otp_state',otpState:{type:selectionMethod,methodId:data.method_id,otpDestination:destination}});_context98.n=4;break;case 3:_context98.p=3;_t23=_context98.v;onError(_t23);setResendErrorMessage(getTranslatedError(_t23,_t));throw _t23;case 4:return _context98.a(2);}},_callee98,null,[[1,3]]);}));};var handleSubmit=function handleSubmit(otp){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee99(){var _c,_d;return _regenerator2().w(function(_context99){while(1)switch(_context99.n){case 0:setIsSubmitting(true);stytchClient.otps.authenticate(otp,state.formState.otpState.methodId,{session_duration_minutes:(_d=(_c=config.sessionOptions)===null||_c===void 0?void 0:_c.sessionDurationMinutes)!==null&&_d!==void 0?_d:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){onEvent({type:StytchEventType.OTPsAuthenticate,data:data});setIsSubmitting(false);dispatch({type:'transition',screen:AppScreens$1.OTPConfirmation});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t));});case 1:return _context99.a(2);}},_callee99);}));};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},!hideBackArrow&&/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(SentOTPEntry,{expiration:expiration,formattedDestination:formattedDestination,isSubmitting:isSubmitting,onSubmit:handleSubmit,resendOTP:resendOTP,errorMessage:errorMessage,resendErrorMessage:resendErrorMessage}));};var PasswordIconSvg=function PasswordIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12 6.5c3.79 0 7.17 2.13 8.82 5.5-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12C4.83 8.63 8.21 6.5 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5m0 5c1.38 0 2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5-2.5-1.12-2.5-2.5 1.12-2.5 2.5-2.5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5",fill:"currentColor"}));};var PasswordIconVisibleSvg=function PasswordIconVisibleSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6m-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14M2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45zm7.5 7.5 2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13m-3.4-3.4 1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53",fill:"currentColor"}));};var BaseInput=He.input(_templateObject37||(_templateObject37=_taggedTemplateLiteral(["\n border: 0;\n padding: 0;\n width: 100%;\n\n background-color: transparent;\n height: 45px;\n color: ",";\n font-family: ",";\n font-size: 18px;\n\n &::placeholder {\n color: ",";\n }\n\n &:disabled {\n color: ",";\n background-color: ",";\n }\n\n &:focus {\n outline: none;\n }\n"])),function(props){return props.theme.inputs.textColor;},function(props){return props.theme.typography.fontFamily;},function(props){return props.theme.inputs.placeholderColor;},function(props){return props.theme.colors.disabledText;},function(props){return props.theme.colors.disabled;});var InputContainer=He(Flex)(_templateObject38||(_templateObject38=_taggedTemplateLiteral(["\n background-color: ",";\n height: 45px;\n padding-left: 8px;\n padding-right: 8px;\n border: 1px solid ",";\n border-radius: ",";\n color: ",";\n font-family: ",";\n font-size: 18px;\n width: calc(100% - 18px);\n\n &:focus-within {\n outline: 1px auto;\n }\n"])),function(props){return props.theme.inputs.backgroundColor;},function(props){return props.theme.inputs.borderColor;},function(props){return props.theme.inputs.borderRadius;},function(props){return props.theme.inputs.textColor;},function(props){return props.theme.typography.fontFamily;});var PasswordIconButton=He(BaseButton)(_templateObject39||(_templateObject39=_taggedTemplateLiteral(["\n height: 20px;\n color: ",";\n\n &:disabled {\n cursor: default;\n }\n"])),function(props){return props.passwordEntered?props.theme.inputs.textColor:props.theme.colors.disabledText;});var PasswordIcon=function PasswordIcon(_ref118){var onClick=_ref118.onClick,passwordEntered=_ref118.passwordEntered,visible=_ref118.visible;var _useLingui23=useLingui(),_t=_useLingui23._;return/*#__PURE__*/wn.createElement(PasswordIconButton,{onClick:onClick,type:"button",passwordEntered:passwordEntered,"aria-label":visible?_t({id:'button.hidePassword',message:"Hide password"}):_t({id:'button.showPassword',message:"Show password"})},visible?/*#__PURE__*/wn.createElement(PasswordIconVisibleSvg,null):/*#__PURE__*/wn.createElement(PasswordIconSvg,null));};var PasswordInput=function PasswordInput(_a){var password=_a.password,setPassword=_a.setPassword,type=_a.type,additionalProps=__rest(_a,["password","setPassword","type"]);var _h$63=h$5(false),_h$64=_slicedToArray2(_h$63,2),visible=_h$64[0],setVisible=_h$64[1];return/*#__PURE__*/wn.createElement(InputContainer,{gap:2,alignItems:"center"},/*#__PURE__*/wn.createElement(BaseInput,Object.assign({name:"password",id:"".concat(type,"-password"),autoComplete:"".concat(type,"-password"),type:visible?'text':'password',value:password,onChange:function onChange(e){return setPassword(e.target.value);},required:true},additionalProps)),/*#__PURE__*/wn.createElement(PasswordIcon,{onClick:function onClick(){return setVisible(function(visible){return!visible;});},passwordEntered:!!password,visible:visible}));};var Block=He.div(_templateObject40||(_templateObject40=_taggedTemplateLiteral(["\n height: 4px;\n width: 25%;\n background-color: ",";\n"])),function(props){return props.$bgColor;});var PasswordStrengthCheck=function PasswordStrengthCheck(_ref119){var score=_ref119.score;var blocks=[];switch(score){case 0:case 1:blocks=['#8B1214','#ADBCC5','#ADBCC5','#ADBCC5'];break;case 2:blocks=['#8B1214','#8B1214','#ADBCC5','#ADBCC5'];break;case 3:blocks=['#0C5A56','#0C5A56','#0C5A56','#ADBCC5'];break;case 4:blocks=['#0C5A56','#0C5A56','#0C5A56','#0C5A56'];break;default:blocks=['#ADBCC5','#ADBCC5','#ADBCC5','#ADBCC5'];break;}return/*#__PURE__*/wn.createElement(Flex,{gap:2},blocks.map(function(block,i){return/*#__PURE__*/wn.createElement(Block,{key:"".concat(block,"-").concat(i),"$bgColor":block});}));};var CheckIcon=function CheckIcon(){return/*#__PURE__*/y$3(Flex,{height:16,width:16},/*#__PURE__*/y$3("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M5.86332 10.5833L3.08332 7.80333L2.13666 8.74333L5.86332 12.47L13.8633 4.47L12.9233 3.53L5.86332 10.5833Z",fill:"#0C5A56"})));};var CrossIcon=function CrossIcon(){return/*#__PURE__*/y$3(Flex,{height:16,width:16},/*#__PURE__*/y$3("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M12.6667 4.27334L11.7267 3.33334L8.00001 7.06001L4.27334 3.33334L3.33334 4.27334L7.06001 8.00001L3.33334 11.7267L4.27334 12.6667L8.00001 8.94001L11.7267 12.6667L12.6667 11.7267L8.94001 8.00001L12.6667 4.27334Z",fill:"#8B1214"})));};var useBootstrap=function useBootstrap(){var stytchClient=useStytch();var _h$65=h$5({bootstrap:readB2CInternals(stytchClient).bootstrap.getSync(),fromCache:true}),_h$66=_slicedToArray2(_h$65,2),bootstrap=_h$66[0],setBootstrap=_h$66[1];p$5(function(){readB2CInternals(stytchClient).bootstrap.getAsync().then(function(data){return setBootstrap({bootstrap:data,fromCache:false});});},[stytchClient]);return bootstrap;};var useSyncExternalStoreShim_production={};var require$$0=/*@__PURE__*/getAugmentedNamespace(compat_module);var React=require$$0;function is(x,y){return x===y&&(0!==x||1/x===1/y)||x!==x&&y!==y;}var objectIs="function"===typeof Object.is?Object.is:is,useState=React.useState,useEffect=React.useEffect,useLayoutEffect=React.useLayoutEffect,useDebugValue=React.useDebugValue;function useSyncExternalStore$2(subscribe,getSnapshot){var value=getSnapshot(),_useState=useState({inst:{value:value,getSnapshot:getSnapshot}}),inst=_useState[0].inst,forceUpdate=_useState[1];useLayoutEffect(function(){inst.value=value;inst.getSnapshot=getSnapshot;checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst});},[subscribe,value,getSnapshot]);useEffect(function(){checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst});return subscribe(function(){checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst});});},[subscribe]);useDebugValue(value);return value;}function checkIfSnapshotChanged(inst){var latestGetSnapshot=inst.getSnapshot;inst=inst.value;try{var nextValue=latestGetSnapshot();return!objectIs(inst,nextValue);}catch(error){return!0;}}function useSyncExternalStore$1(subscribe,getSnapshot){return getSnapshot();}var shim="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?useSyncExternalStore$1:useSyncExternalStore$2;useSyncExternalStoreShim_production.useSyncExternalStore=void 0!==React.useSyncExternalStore?React.useSyncExternalStore:shim;var SWRGlobalState=new WeakMap();var EMPTY_CACHE={};var INITIAL_CACHE={};var noop=function noop(){};var UNDEFINED=noop();var OBJECT=Object;var isUndefined=function isUndefined(v){return v===UNDEFINED;};var isFunction=function isFunction(v){return typeof v=='function';};var mergeObjects=function mergeObjects(a,b){return _objectSpread(_objectSpread({},a),b);};var STR_UNDEFINED='undefined';var isWindowDefined=(typeof window==="undefined"?"undefined":_typeof2(window))!=STR_UNDEFINED;var isDocumentDefined=(typeof document==="undefined"?"undefined":_typeof2(document))!=STR_UNDEFINED;var createCacheHelper=function createCacheHelper(cache,key){var state=SWRGlobalState.get(cache);return[function(){return cache.get(key)||EMPTY_CACHE;},function(info){if(!isUndefined(key)){var prev=cache.get(key);if(!(key in INITIAL_CACHE)){INITIAL_CACHE[key]=prev;}state[5](key,mergeObjects(prev,info),prev||EMPTY_CACHE);}},state[6],function(){if(!isUndefined(key)){if(key in INITIAL_CACHE)return INITIAL_CACHE[key];}return cache.get(key)||EMPTY_CACHE;}];};var table=new WeakMap();var counter=0;var _stableHash=function stableHash(arg){var type=_typeof2(arg);var constructor=arg&&arg.constructor;var isDate=constructor==Date;var result;var index;if(OBJECT(arg)===arg&&!isDate&&constructor!=RegExp){result=table.get(arg);if(result)return result;result=++counter+'~';table.set(arg,result);if(constructor==Array){result='@';for(index=0;index<arg.length;index++){result+=_stableHash(arg[index])+',';}table.set(arg,result);}if(constructor==OBJECT){result='#';var keys=OBJECT.keys(arg).sort();while(!isUndefined(index=keys.pop())){if(!isUndefined(arg[index])){result+=index+':'+_stableHash(arg[index])+',';}}table.set(arg,result);}}else{result=isDate?arg.toJSON():type=='symbol'?arg.toString():type=='string'?JSON.stringify(arg):''+arg;}return result;};var online=true;var isOnline=function isOnline(){return online;};var _ref120=isWindowDefined&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[noop,noop],_ref121=_slicedToArray2(_ref120,2),onWindowEvent=_ref121[0],offWindowEvent=_ref121[1];var isVisible=function isVisible(){var visibilityState=isDocumentDefined&&document.visibilityState;return isUndefined(visibilityState)||visibilityState!=='hidden';};var initFocus=function initFocus(callback){if(isDocumentDefined){document.addEventListener('visibilitychange',callback);}onWindowEvent('focus',callback);return function(){if(isDocumentDefined){document.removeEventListener('visibilitychange',callback);}offWindowEvent('focus',callback);};};var initReconnect=function initReconnect(callback){var onOnline=function onOnline(){online=true;callback();};var onOffline=function onOffline(){online=false;};onWindowEvent('online',onOnline);onWindowEvent('offline',onOffline);return function(){offWindowEvent('online',onOnline);offWindowEvent('offline',onOffline);};};var preset={isOnline:isOnline,isVisible:isVisible};var defaultConfigOptions={initFocus:initFocus,initReconnect:initReconnect};!wn.useId;var IS_SERVER=!isWindowDefined||'Deno'in window;var navigatorConnection=typeof navigator!=='undefined'&&navigator.connection;var slowConnection=!IS_SERVER&&navigatorConnection&&(['slow-2g','2g'].includes(navigatorConnection.effectiveType)||navigatorConnection.saveData);var serialize=function serialize(key){if(isFunction(key)){try{key=key();}catch(err){key='';}}var args=key;key=typeof key=='string'?key:(Array.isArray(key)?key.length:key)?_stableHash(key):'';return[key,args];};var __timestamp=0;var getTimestamp=function getTimestamp(){return++__timestamp;};var FOCUS_EVENT=0;var RECONNECT_EVENT=1;var MUTATE_EVENT=2;function internalMutate(){return _internalMutate.apply(this,arguments);}function _internalMutate(){_internalMutate=_asyncToGenerator(/*#__PURE__*/_regenerator2().m(function _callee112(){var _len1,args,_key1,cache,_key,_data,_opts,options,populateCache,rollbackOnErrorOption,optimisticData,revalidate,rollbackOnError,throwOnError,keyFilter,matchedKeys,it,keyIt,key,mutateByKey,_mutateByKey,_args11=arguments;return _regenerator2().w(function(_context112){while(1)switch(_context112.n){case 0:_mutateByKey=function _mutateByKey3(){_mutateByKey=_asyncToGenerator(/*#__PURE__*/_regenerator2().m(function _callee111(_k){var _serialize,_serialize2,key,_createCacheHelper,_createCacheHelper2,get,set,_SWRGlobalState$get3,_SWRGlobalState$get4,EVENT_REVALIDATORS,MUTATION,FETCH,revalidators,startRevalidate,data,error,beforeMutationTs,hasOptimisticData,state,displayedData,currentData,committedData,res;return _regenerator2().w(function(_context111){while(1)switch(_context111.n){case 0:_serialize=serialize(_k),_serialize2=_slicedToArray2(_serialize,1),key=_serialize2[0];if(key){_context111.n=1;break;}return _context111.a(2);case 1:_createCacheHelper=createCacheHelper(cache,key),_createCacheHelper2=_slicedToArray2(_createCacheHelper,2),get=_createCacheHelper2[0],set=_createCacheHelper2[1];_SWRGlobalState$get3=SWRGlobalState.get(cache),_SWRGlobalState$get4=_slicedToArray2(_SWRGlobalState$get3,3),EVENT_REVALIDATORS=_SWRGlobalState$get4[0],MUTATION=_SWRGlobalState$get4[1],FETCH=_SWRGlobalState$get4[2];revalidators=EVENT_REVALIDATORS[key];startRevalidate=function startRevalidate(){if(revalidate){delete FETCH[key];if(revalidators&&revalidators[0]){return revalidators[0](MUTATE_EVENT).then(function(){return get().data;});}}return get().data;};if(!(args.length<3)){_context111.n=2;break;}return _context111.a(2,startRevalidate());case 2:data=_data;beforeMutationTs=getTimestamp();MUTATION[key]=[beforeMutationTs,0];hasOptimisticData=!isUndefined(optimisticData);state=get();displayedData=state.data;currentData=state._c;committedData=isUndefined(currentData)?displayedData:currentData;if(hasOptimisticData){optimisticData=isFunction(optimisticData)?optimisticData(committedData):optimisticData;set({data:optimisticData,_c:committedData});}if(isFunction(data)){try{data=data(committedData);}catch(err){error=err;}}if(!(data&&isFunction(data.then))){_context111.n=6;break;}_context111.n=3;return data["catch"](function(err){error=err;});case 3:data=_context111.v;if(!(beforeMutationTs!==MUTATION[key][0])){_context111.n=5;break;}if(!error){_context111.n=4;break;}throw error;case 4:return _context111.a(2,data);case 5:if(error&&hasOptimisticData&&rollbackOnError(error)){populateCache=true;data=committedData;set({data:data,_c:UNDEFINED});}case 6:if(populateCache){if(!error){if(isFunction(populateCache)){data=populateCache(data,committedData);}set({data:data,_c:UNDEFINED});}}MUTATION[key][1]=getTimestamp();_context111.n=7;return startRevalidate();case 7:res=_context111.v;set({_c:UNDEFINED});if(!error){_context111.n=9;break;}if(!throwOnError){_context111.n=8;break;}throw error;case 8:return _context111.a(2);case 9:return _context111.a(2,populateCache?res:data);}},_callee111);}));return _mutateByKey.apply(this,arguments);};mutateByKey=function _mutateByKey2(_x){return _mutateByKey.apply(this,arguments);};for(_len1=_args11.length,args=new Array(_len1),_key1=0;_key1<_len1;_key1++){args[_key1]=_args11[_key1];}cache=args[0],_key=args[1],_data=args[2],_opts=args[3];options=mergeObjects({populateCache:true,throwOnError:true},typeof _opts==='boolean'?{revalidate:_opts}:_opts||{});populateCache=options.populateCache;rollbackOnErrorOption=options.rollbackOnError;optimisticData=options.optimisticData;revalidate=options.revalidate!==false;rollbackOnError=function rollbackOnError(error){return typeof rollbackOnErrorOption==='function'?rollbackOnErrorOption(error):rollbackOnErrorOption!==false;};throwOnError=options.throwOnError;if(!isFunction(_key)){_context112.n=1;break;}keyFilter=_key;matchedKeys=[];it=cache.keys();for(keyIt=it.next();!keyIt.done;keyIt=it.next()){key=keyIt.value;if(!/^\$(inf|sub)\$/.test(key)&&keyFilter(cache.get(key)._k)){matchedKeys.push(key);}}return _context112.a(2,Promise.all(matchedKeys.map(mutateByKey)));case 1:return _context112.a(2,mutateByKey(_key));}},_callee112);}));return _internalMutate.apply(this,arguments);}var revalidateAllKeys=function revalidateAllKeys(revalidators,type){for(var key in revalidators){if(revalidators[key][0])revalidators[key][0](type);}};var initCache=function initCache(provider,options){if(!SWRGlobalState.has(provider)){var opts=mergeObjects(defaultConfigOptions,options);var EVENT_REVALIDATORS={};var _mutate=internalMutate.bind(UNDEFINED,provider);var unmount=noop;var subscriptions={};var subscribe=function subscribe(key,callback){var subs=subscriptions[key]||[];subscriptions[key]=subs;subs.push(callback);return function(){return subs.splice(subs.indexOf(callback),1);};};var setter=function setter(key,value,prev){provider.set(key,value);var subs=subscriptions[key];if(subs){var _iterator9=_createForOfIteratorHelper2(subs),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _fn=_step9.value;_fn(value,prev);}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}}};var initProvider=function initProvider(){if(!SWRGlobalState.has(provider)){SWRGlobalState.set(provider,[EVENT_REVALIDATORS,{},{},{},_mutate,setter,subscribe]);if(!IS_SERVER){var releaseFocus=opts.initFocus(setTimeout.bind(UNDEFINED,revalidateAllKeys.bind(UNDEFINED,EVENT_REVALIDATORS,FOCUS_EVENT)));var releaseReconnect=opts.initReconnect(setTimeout.bind(UNDEFINED,revalidateAllKeys.bind(UNDEFINED,EVENT_REVALIDATORS,RECONNECT_EVENT)));unmount=function unmount(){releaseFocus&&releaseFocus();releaseReconnect&&releaseReconnect();SWRGlobalState["delete"](provider);};}}};initProvider();return[provider,_mutate,initProvider,unmount];}return[provider,SWRGlobalState.get(provider)[4]];};var onErrorRetry=function onErrorRetry(_,__,config,revalidate,opts){var maxRetryCount=config.errorRetryCount;var currentRetryCount=opts.retryCount;var timeout=~~((Math.random()+0.5)*(1<<(currentRetryCount<8?currentRetryCount:8)))*config.errorRetryInterval;if(!isUndefined(maxRetryCount)&&currentRetryCount>maxRetryCount){return;}setTimeout(revalidate,timeout,opts);};var compare=function compare(currentData,newData){return _stableHash(currentData)==_stableHash(newData);};var _initCache=initCache(new Map()),_initCache2=_slicedToArray2(_initCache,2),cache=_initCache2[0],mutate=_initCache2[1];mergeObjects({onLoadingSlow:noop,onSuccess:noop,onError:noop,onErrorRetry:onErrorRetry,onDiscarded:noop,revalidateOnFocus:true,revalidateOnReconnect:true,revalidateIfStale:true,shouldRetryOnError:true,errorRetryInterval:slowConnection?10000:5000,focusThrottleInterval:5*1000,dedupingInterval:2*1000,loadingTimeout:slowConnection?5000:3000,compare:compare,isPaused:function isPaused(){return false;},cache:cache,mutate:mutate,fallback:{}},preset);F$5({});var enableDevtools=isWindowDefined&&window.__SWR_DEVTOOLS_USE__;var use=enableDevtools?window.__SWR_DEVTOOLS_USE__:[];var setupDevTools=function setupDevTools(){if(enableDevtools){window.__SWR_DEVTOOLS_REACT__=wn;}};var middleware=function middleware(useSWRNext){return function(key_,fetcher_,config){var fetcher=fetcher_&&function(){var key=serialize(key_)[0];var _SWRGlobalState$get=SWRGlobalState.get(cache),_SWRGlobalState$get2=_slicedToArray2(_SWRGlobalState$get,4),PRELOAD=_SWRGlobalState$get2[3];var req=PRELOAD[key];if(req){delete PRELOAD[key];return req;}return fetcher_.apply(void 0,arguments);};return useSWRNext(key_,fetcher,config);};};use.concat(middleware);setupDevTools();var DEFAULT_MFA_STATE={primaryInfo:null,isEnrolling:false,smsOtp:{isSending:false,sendError:null,codeExpiration:null,formattedDestination:null,enrolledNumber:null},totp:{isCreating:false,createError:null,enrollment:null}};var ErrorType;(function(ErrorType){ErrorType[ErrorType["Default"]=0]="Default";ErrorType[ErrorType["EmailMagicLink"]=1]="EmailMagicLink";ErrorType[ErrorType["Organization"]=2]="Organization";ErrorType[ErrorType["CannotJoinOrgDueToAuthPolicy"]=3]="CannotJoinOrgDueToAuthPolicy";ErrorType[ErrorType["AdBlockerDetected"]=4]="AdBlockerDetected";ErrorType[ErrorType["OrganizationDiscoveryClaimedDomain"]=5]="OrganizationDiscoveryClaimedDomain";})(ErrorType||(ErrorType={}));var AppScreens;(function(AppScreens){AppScreens["Main"]="Main";AppScreens["EmailConfirmation"]="Email Confirmation";AppScreens["LoggedIn"]="Logged In";AppScreens["Discovery"]="Discovery";AppScreens["Error"]="Error";AppScreens["PasswordEmailForm"]="Password Email";AppScreens["PasswordAuthenticate"]="Password Authenticate";AppScreens["PasswordResetForm"]="Password Reset Form";AppScreens["PasswordResetVerifyConfirmation"]="Password Reset Verify Confirmation";AppScreens["PasswordForgotForm"]="Password Forgot Form";AppScreens["PasswordSetNewConfirmation"]="Password Set New Confirmation";AppScreens["MFAEnrollmentSelection"]="MFA Enrollment Selection";AppScreens["RecoveryCodeEntry"]="Recovery Code Entry";AppScreens["RecoveryCodeSave"]="Recovery Code Save";AppScreens["SMSOTPEnrollment"]="SMS OTP Enrollment";AppScreens["SMSOTPEntry"]="SMS OTP Entry";AppScreens["TOTPEnrollmentManual"]="TOTP Enrollment Manual";AppScreens["TOTPEnrollmentQRCode"]="TOTP Enrollment QR Code";AppScreens["TOTPEntry"]="TOTP Entry";AppScreens["EmailMethodSelection"]="Email Method Selection";AppScreens["EmailOTPEntry"]="Email OTP Entry";AppScreens["SSODiscoveryEmail"]="SSO Discovery Email";AppScreens["SSODiscoveryFallback"]="SSO Discovery Fallback";AppScreens["SSODiscoveryMenu"]="SSO Discovery Menu";AppScreens["IDPConsent"]="IDP Consent";})(AppScreens||(AppScreens={}));[B2BMFAProducts.totp,B2BMFAProducts.smsOtp];({screen:AppScreens.Main,screenHistory:[],formState:{emailState:{userSuppliedEmail:''},otpState:{codeExpiration:null},discoveryState:{email:'',discoveredOrganizations:[]},passwordState:{email:''},ssoDiscoveryState:{connections:[]}},flowState:{type:AuthFlowType.Organization,organization:null},mfa:DEFAULT_MFA_STATE,primary:{},error:{type:ErrorType.Default,canGoBack:false}});({products:[B2BProducts.emailMagicLinks],authFlowType:AuthFlowType.Organization,sessionOptions:{sessionDurationMinutes:60}});({'stytch.magicLinks.authenticate':StytchEventType.B2BMagicLinkAuthenticate,'stytch.sso.authenticate':StytchEventType.B2BSSOAuthenticate,'stytch.sso.discoverConnections':StytchEventType.B2BSSODiscoverConnections,'stytch.magicLinks.discovery.authenticate':StytchEventType.B2BMagicLinkDiscoveryAuthenticate,'stytch.discovery.organizations.create':StytchEventType.B2BDiscoveryOrganizationsCreate,'stytch.discovery.intermediateSessions.exchange':StytchEventType.B2BDiscoveryIntermediateSessionExchange,'stytch.magicLinks.email.loginOrSignup':StytchEventType.B2BMagicLinkEmailLoginOrSignup,'stytch.magicLinks.email.discovery.send':StytchEventType.B2BMagicLinkEmailDiscoverySend,'stytch.oauth.authenticate':StytchEventType.B2BOAuthAuthenticate,'stytch.oauth.discovery.authenticate':StytchEventType.B2BOAuthDiscoveryAuthenticate,'stytch.otps.sms.send':StytchEventType.B2BSMSOTPSend,'stytch.otps.sms.authenticate':StytchEventType.B2BSMSOTPAuthenticate,'stytch.totp.create':StytchEventType.B2BTOTPCreate,'stytch.totp.authenticate':StytchEventType.B2BTOTPAuthenticate,'stytch.recoveryCodes.recover':StytchEventType.B2BRecoveryCodesRecover,'stytch.impersonation.authenticate':StytchEventType.B2BImpersonationAuthenticate,'stytch.otps.email.authenticate':StytchEventType.B2BOTPsEmailAuthenticate,'stytch.otps.email.discovery.authenticate':StytchEventType.B2BOTPsEmailDiscoveryAuthenticate,'stytch.otps.email.discovery.send':StytchEventType.B2BOTPsEmailDiscoverySend,'stytch.otps.email.loginOrSignup':StytchEventType.B2BOTPsEmailLoginOrSignup,'stytch.organization.getBySlug':StytchEventType.B2BOrganizationsGetBySlug});var warnings={'Short keyboard patterns are easy to guess.':{id:'password.zxcvbn.warning.shortKeyboardPatterns',message:"Short keyboard patterns are easy to guess."},'Straight rows of keys are easy to guess.':{id:'password.zxcvbn.warning.straightRows',message:"Straight rows of keys are easy to guess."},'Repeats like "aaa" are easy to guess.':{id:'password.zxcvbn.warning.repeats',message:"Repeats like \"aaa\" are easy to guess."},'Repeats like "abcabcabc" are only slightly harder to guess than "abc".':{id:'password.zxcvbn.warning.longerRepeats',message:"Repeats like \"abcabcabc\" are only slightly harder to guess than \"abc\"."},'Sequences like "abc" or "6543" are easy to guess.':{id:'password.zxcvbn.warning.sequences',message:"Sequences like \"abc\" or \"6543\" are easy to guess."},'Recent years are easy to guess.':{id:'password.zxcvbn.warning.recentYears',message:"Recent years are easy to guess."},'Dates are often easy to guess.':{id:'password.zxcvbn.warning.dates',message:"Dates are often easy to guess."},'This is a top-10 common password.':{id:'password.zxcvbn.warning.top10CommonPassword',message:"This is a top-10 common password."},'This is a top-100 common password.':{id:'password.zxcvbn.warning.top100CommonPassword',message:"This is a top-100 common password."},'This is a very common password.':{id:'password.zxcvbn.warning.veryCommonPassword',message:"This is a very common password."},'This is similar to a commonly used password.':{id:'password.zxcvbn.warning.similarToCommonPassword',message:"This is similar to a commonly used password."},'A word by itself is easy to guess.':{id:'password.zxcvbn.warning.wordByItself',message:"A word by itself is easy to guess."},'Names and surnames by themselves are easy to guess.':{id:'password.zxcvbn.warning.names',message:"Names and surnames by themselves are easy to guess."},'Common names and surnames are easy to guess.':{id:'password.zxcvbn.warning.commonNames',message:"Common names and surnames are easy to guess."}};var suggestions={'Use a few words, avoid common phrases.':{id:'password.zxcvbn.suggestion.useAFewWords',message:"Use a few words, avoid common phrases."},'No need for symbols, digits, or uppercase letters.':{id:'password.zxcvbn.suggestion.noSymbolsDigitsUppercase',message:"No need for symbols, digits, or uppercase letters."},'Add another word or two. Uncommon words are better.':{id:'password.zxcvbn.suggestion.addWords',message:"Add another word or two. Uncommon words are better."},'Use a longer keyboard pattern with more turns.':{id:'password.zxcvbn.suggestion.longerKeyboardPattern',message:"Use a longer keyboard pattern with more turns."},'Avoid repeated words and characters.':{id:'password.zxcvbn.suggestion.avoidRepeats',message:"Avoid repeated words and characters."},'Avoid sequences.':{id:'password.zxcvbn.suggestion.avoidSequences',message:"Avoid sequences."},'Avoid recent years.':{id:'password.zxcvbn.suggestion.avoidRecentYears',message:"Avoid recent years."},'Avoid years that are associated with you.':{id:'password.zxcvbn.suggestion.avoidYearsAssociatedWithYou',message:"Avoid years that are associated with you."},'Avoid dates and years that are associated with you.':{id:'password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou',message:"Avoid dates and years that are associated with you."},"Capitalization doesn't help very much.":{id:'password.zxcvbn.suggestion.capitalization',message:"Capitalization doesn't help very much."},'All-uppercase is almost as easy to guess as all-lowercase.':{id:'password.zxcvbn.suggestion.allUppercase',message:"All-uppercase is almost as easy to guess as all-lowercase."},"Reversed words aren't much harder to guess.":{id:'password.zxcvbn.suggestion.reversed',message:"Reversed words aren't much harder to guess."},"Predictable substitutions like '@' instead of 'a' don't help very much.":{id:'password.zxcvbn.suggestion.predictableSubstitutions',message:"Predictable substitutions like '@' instead of 'a' don't help very much."}};var BulletPoint=He.div(_templateObject41||(_templateObject41=_taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n width: 16px;\n flex-shrink: 0;\n\n &::before {\n content: '\u2022';\n font-size: ",";\n line-height: ",";\n color: ",";\n }\n"])),function(_ref122){var theme=_ref122.theme;return theme.typography.helper.fontSize;},function(_ref123){var theme=_ref123.theme;return theme.typography.helper.lineHeight;},function(_ref124){var theme=_ref124.theme;return theme.colors.secondary;});var CrossIconContainer=He.div(_templateObject42||(_templateObject42=_taggedTemplateLiteral(["\n flex-shrink: 0;\n padding-top: 2px;\n"])));var PasswordError=function PasswordError(_a){var _b,_c,_d,_e,_f;var bootstrap=_a.bootstrap,props=__rest(_a,["bootstrap"]);var _useLingui24=useLingui(),_t=_useLingui24._;var complexity=(_c=(_b=bootstrap.passwordConfig)===null||_b===void 0?void 0:_b.ludsComplexity)!==null&&_c!==void 0?_c:0;var characterLength=(_e=(_d=bootstrap.passwordConfig)===null||_d===void 0?void 0:_d.ludsMinimumCount)!==null&&_e!==void 0?_e:0;if(props.passwordPolicy==='none'){return null;}var passwordBreachedMessage=props.isPasswordBreached&&(/*#__PURE__*/wn.createElement(Flex,{gap:4},/*#__PURE__*/wn.createElement(CrossIcon,null),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"error"},_t({id:'password.strengthError.breached',message:"This password may have been used on a different site that experienced a security issue. Please choose another password."}))));if(props.passwordPolicy==='zxcvbn'){var translatedWarning=props.passwordWarning?(_f=warnings[props.passwordWarning])!==null&&_f!==void 0?_f:props.passwordWarning:null;var uniqueSuggestions=_toConsumableArray2(new Set(props.passwordSuggestions));var translatedSuggestions=uniqueSuggestions.map(function(suggestion){var _a;return(_a=suggestions[suggestion])!==null&&_a!==void 0?_a:suggestion;});return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(PasswordStrengthCheck,{score:props.passwordScore}),props.errorMessage&&/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:props.errorMessage}),translatedWarning&&(/*#__PURE__*/wn.createElement(Flex,{gap:1,alignItems:"flex-start"},/*#__PURE__*/wn.createElement(CrossIconContainer,null,/*#__PURE__*/wn.createElement(CrossIcon,null)),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"error"},_t(translatedWarning)))),translatedSuggestions.map(function(suggestion,index){return/*#__PURE__*/wn.createElement(Flex,{key:index,gap:1,alignItems:"flex-start"},/*#__PURE__*/wn.createElement(BulletPoint,null),' ',/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},_t(suggestion)));}),passwordBreachedMessage);}return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:4},/*#__PURE__*/wn.createElement(Flex,{gap:4},props.missingCharacters===0?/*#__PURE__*/wn.createElement(CheckIcon,null):/*#__PURE__*/wn.createElement(CrossIcon,null),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:props.missingCharacters===0?'success':'error'},_t({id:'password.strengthError.minimumLength',message:"{characterLength, plural, one {Must be at least # character long} other {Must be at least # characters long}}",values:{characterLength:characterLength}}))),/*#__PURE__*/wn.createElement(Flex,{gap:4},props.missingComplexity===0?/*#__PURE__*/wn.createElement(CheckIcon,null):/*#__PURE__*/wn.createElement(CrossIcon,null),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:props.missingComplexity===0?'success':'error'},_t({id:'password.strengthError.complexity',message:"{complexity, plural, one {Must contain # of the following: uppercase letter, lowercase letter, number, symbol} other {Must contain # of the following: uppercase letter, lowercase letter, number, symbol}}",values:{complexity:complexity}}))),passwordBreachedMessage);};var PasswordB2CError=function PasswordB2CError(props){var _useBootstrap=useBootstrap(),bootstrap=_useBootstrap.bootstrap;return/*#__PURE__*/wn.createElement(PasswordError,Object.assign({},props,{bootstrap:bootstrap}));};var Label=He.label(_templateObject43||(_templateObject43=_taggedTemplateLiteral(["\n all: unset;\n display: block;\n cursor: default;\n width: fit-content;\n\n color: ",";\n ",";\n"])),function(props){return props.theme.colors.secondary;},function(props){return props.theme.typography.helper;});var PasswordNewUser=function PasswordNewUser(){var _useLingui25=useLingui(),_t=_useLingui25._;var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var _useGlobalReducer15=useGlobalReducer(),_useGlobalReducer16=_slicedToArray2(_useGlobalReducer15,2),state=_useGlobalReducer16[0],dispatch=_useGlobalReducer16[1];var onEvent=useEventCallback();var onError=useErrorCallback();var _h$67=h$5(state.formState.passwordState.email),_h$68=_slicedToArray2(_h$67,2),email=_h$68[0],setEmail=_h$68[1];var _h$69=h$5(''),_h$70=_slicedToArray2(_h$69,2),password=_h$70[0],setPassword=_h$70[1];var _h$71=h$5(''),_h$72=_slicedToArray2(_h$71,2),errorMessage=_h$72[0],setErrorMessage=_h$72[1];var _h$73=h$5(0),_h$74=_slicedToArray2(_h$73,2),passwordScore=_h$74[0],setPasswordScore=_h$74[1];var _h$75=h$5(''),_h$76=_slicedToArray2(_h$75,2),passwordWarning=_h$76[0],setPasswordWarning=_h$76[1];var _h$77=h$5([]),_h$78=_slicedToArray2(_h$77,2),passwordSuggestions=_h$78[0],setPasswordSuggestions=_h$78[1];var _h$79=h$5(true),_h$80=_slicedToArray2(_h$79,2),invalidPassword=_h$80[0],setInvalidPassword=_h$80[1];var _h$81=h$5(false),_h$82=_slicedToArray2(_h$81,2),isSubmitting=_h$82[0],setIsSubmitting=_h$82[1];var _h$83=h$5('none'),_h$84=_slicedToArray2(_h$83,2),strengthPolicy=_h$84[0],setStrengthPolicy=_h$84[1];var _h$85=h$5(0),_h$86=_slicedToArray2(_h$85,2),missingCharacters=_h$86[0],setMissingCharacters=_h$86[1];var _h$87=h$5(0),_h$88=_slicedToArray2(_h$87,2),missingComplexity=_h$88[0],setMissingComplexity=_h$88[1];var _h$89=h$5(false),_h$90=_slicedToArray2(_h$89,2),isPasswordBreached=_h$90[0],setIsPasswordBreached=_h$90[1];var passwordProps=useErrorProps(errorMessage);var updateStrengthCheck=F$4(function(){return debounce(function(email,password){setErrorMessage('');stytchClient.passwords.strengthCheck({email:email,password:password}).then(function(_ref125){var score=_ref125.score,feedback=_ref125.feedback,valid_password=_ref125.valid_password,strength_policy=_ref125.strength_policy,breached_password=_ref125.breached_password;setStrengthPolicy(strength_policy);if(strength_policy==='zxcvbn'){setPasswordScore(score);setPasswordWarning(feedback.warning);setPasswordSuggestions(feedback.suggestions);setIsPasswordBreached(breached_password);}else if(strength_policy==='luds'){setMissingCharacters(feedback.luds_requirements.missing_characters);setMissingComplexity(feedback.luds_requirements.missing_complexity);setIsPasswordBreached(breached_password);}setInvalidPassword(!valid_password);})["catch"](function(e){setErrorMessage(getTranslatedError(e,_t));});});},[stytchClient.passwords,_t]);var onPasswordChange=function onPasswordChange(password){setPassword(password);updateStrengthCheck(email,password);};var handleSubmit=function handleSubmit(e){var _a,_b;e.preventDefault();setErrorMessage('');setIsSubmitting(true);stytchClient.passwords.create({email:email,password:password,session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.PasswordCreate,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);if(e.error_type==='reset_password'){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordDedupe});});}else{setErrorMessage(getTranslatedError(e,_t));}setIsSubmitting(false);});};return/*#__PURE__*/wn.createElement("form",{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Text,null,_t({id:'password.createAccount.content',message:"Finish creating your account by setting a password."})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:2},/*#__PURE__*/wn.createElement(Label,{htmlFor:"email-input"},_t({id:'formField.email.label',message:"Email"})),/*#__PURE__*/wn.createElement(EmailInput,{email:email,setEmail:setEmail,disableInput:true})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:4},/*#__PURE__*/wn.createElement(Label,{htmlFor:"new-password"},_t({id:'formField.password.label',message:"Password"})),/*#__PURE__*/wn.createElement(PasswordInput,Object.assign({password:password,setPassword:onPasswordChange,type:"new"},passwordProps.input)),/*#__PURE__*/wn.createElement("div",Object.assign({},passwordProps.error),/*#__PURE__*/wn.createElement(PasswordB2CError,{passwordPolicy:strengthPolicy,passwordScore:passwordScore,errorMessage:errorMessage,passwordWarning:passwordWarning,passwordSuggestions:passwordSuggestions,missingCharacters:missingCharacters,missingComplexity:missingComplexity,isPasswordBreached:isPasswordBreached}))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.continue',message:"Continue"}),disabled:invalidPassword})));};var ForgotPassword=He(Text)(_templateObject44||(_templateObject44=_taggedTemplateLiteral(["\n text-decoration: underline;\n cursor: pointer;\n"])));var PasswordAuthenticate=function PasswordAuthenticate(){var _useLingui26=useLingui(),_t=_useLingui26._;var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var _useGlobalReducer17=useGlobalReducer(),_useGlobalReducer18=_slicedToArray2(_useGlobalReducer17,2),state=_useGlobalReducer18[0],dispatch=_useGlobalReducer18[1];var onEvent=useEventCallback();var onError=useErrorCallback();var _h$91=h$5(state.formState.passwordState.email),_h$92=_slicedToArray2(_h$91,2),email=_h$92[0],setEmail=_h$92[1];var _h$93=h$5(''),_h$94=_slicedToArray2(_h$93,2),password=_h$94[0],setPassword=_h$94[1];var _h$95=h$5(''),_h$96=_slicedToArray2(_h$95,2),errorMessage=_h$96[0],setErrorMessage=_h$96[1];var _h$97=h$5(false),_h$98=_slicedToArray2(_h$97,2),isSubmitting=_h$98[0],setIsSubmitting=_h$98[1];var passwordProps=useErrorProps(errorMessage);var handleSubmit=function handleSubmit(e){var _a,_b;e.preventDefault();setErrorMessage('');setIsSubmitting(true);stytchClient.passwords.authenticate({email:email,password:password,session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.PasswordAuthenticate,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);if(e.error_type==='reset_password'){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordDedupe});});}else{setErrorMessage(getTranslatedError(e,_t));}setIsSubmitting(false);});};var onForgot=function onForgot(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordForgot});});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'password.login.title',message:"Log In"})),/*#__PURE__*/wn.createElement("form",{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:2},/*#__PURE__*/wn.createElement(Label,{htmlFor:"email-input"},_t({id:'formField.email.label',message:"Email"})),/*#__PURE__*/wn.createElement(EmailInput,{email:email,setEmail:setEmail,disableInput:true})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:2},/*#__PURE__*/wn.createElement(Label,{htmlFor:"current-password"},_t({id:'formField.password.label',message:"Password"})),/*#__PURE__*/wn.createElement(PasswordInput,Object.assign({password:password,setPassword:setPassword,type:"current"},passwordProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},passwordProps.error))),/*#__PURE__*/wn.createElement(Flex,{justifyContent:"flex-end"},/*#__PURE__*/wn.createElement(ForgotPassword,{onClick:onForgot},_t({id:'button.forgotPassword',message:"Forgot Password?"}))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.continue',message:"Continue"})}))));};var PasswordlessCreate=function PasswordlessCreate(){var _useLingui27=useLingui(),_t=_useLingui27._;var _useGlobalReducer19=useGlobalReducer(),_useGlobalReducer20=_slicedToArray2(_useGlobalReducer19,2),state=_useGlobalReducer20[0],dispatch=_useGlobalReducer20[1];var onError=useErrorCallback();var onEvent=useEventCallback();var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var _h$99=h$5(''),_h$100=_slicedToArray2(_h$99,2),errorMessage=_h$100[0],setErrorMessage=_h$100[1];var resetPassword=function resetPassword(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(data){onEvent({type:StytchEventType.PasswordResetByEmailStart,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordSetNew});})["catch"](function(e){onError(e);setErrorMessage(getTranslatedError(e,_t));});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:4},/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:resetPassword,variant:"text"},_t({id:'button.createPasswordInstead',message:"Create a password instead"})),/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:errorMessage}));};var PasswordSecondaryMethod=function PasswordSecondaryMethod(_ref126){var secondaryType=_ref126.secondaryType;var _useLingui28=useLingui(),_t=_useLingui28._;var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer21=useGlobalReducer(),_useGlobalReducer22=_slicedToArray2(_useGlobalReducer21,2),state=_useGlobalReducer22[0],dispatch=_useGlobalReducer22[1];var _h$101=h$5(false),_h$102=_slicedToArray2(_h$101,2),setIsSubmitting=_h$102[1];var onEvent=useEventCallback();var onError=useErrorCallback();var emailOptions=config.emailMagicLinksOptions;var email=state.formState.passwordState.email;var userType=state.formState.passwordState.type;var sendLink=function sendLink(){stytchClient.magicLinks.email.loginOrCreate(email,convertMagicLinkOptions(emailOptions)).then(function(data){onEvent({type:StytchEventType.MagicLinkLoginOrCreateEvent,data:Object.assign(Object.assign({},data),{email:email})});setIsSubmitting(false);dispatch({type:'set_magic_link_email',email:email});dispatch({type:'transition',screen:AppScreens$1.EmailConfirmation});})["catch"](function(e){onError(e);setIsSubmitting(false);});};var sendCode=function sendCode(){var _a,_b,_c;stytchClient.otps.email.loginOrCreate(email,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES,locale:(_c=config.otpOptions)===null||_c===void 0?void 0:_c.locale}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});dispatch({type:'update_otp_state',otpState:{type:OTPMethods.Email,methodId:data.method_id,otpDestination:email}});dispatch({type:'transition',screen:AppScreens$1.OTPAuthenticate});})["catch"](function(e){onError(e);setIsSubmitting(false);});};var buttonText=secondaryType==='eml'?_t({id:'button.emailMagicLink',message:"Email me a login link"}):_t({id:'button.emailOTP',message:"Email me a login code"});var buttonOnClick=secondaryType==='eml'?sendLink:sendCode;var NewUser=function NewUser(){return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'createAccount.title',message:"Choose how you would like to create your account."})),/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:buttonOnClick},buttonText));};var PasswordUser=function PasswordUser(){return/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",onClick:buttonOnClick},buttonText);};var ComponentToUserType={"new":/*#__PURE__*/wn.createElement(NewUser,null),password:/*#__PURE__*/wn.createElement(PasswordUser,null),passwordless:null};return ComponentToUserType[userType];};var Password=function Password(){var _a,_b;var config=useConfig();var stytchClient=useStytch();var onEvent=useEventCallback();var onError=useErrorCallback();var _useGlobalReducer23=useGlobalReducer(),_useGlobalReducer24=_slicedToArray2(_useGlobalReducer23,2),state=_useGlobalReducer24[0],dispatch=_useGlobalReducer24[1];var email=state.formState.passwordState.email;var otpMethods=(_b=(_a=config===null||config===void 0?void 0:config.otpOptions)===null||_a===void 0?void 0:_a.methods)!==null&&_b!==void 0?_b:[];var hasEmailMagicLink=config.products.includes(Products.emailMagicLinks)&&!!config.emailMagicLinksOptions;var hasOTPEmail=otpMethods.includes(OTPMethods.Email);var secondaryType=hasOTPEmail?'otp':hasEmailMagicLink?'eml':'';var userType=state.formState.passwordState.type;var emailOptions=config.emailMagicLinksOptions;var passwordOptions=config.passwordOptions;p$5(function(){var _a,_b;if(userType!=='passwordless'){return;}switch(secondaryType){case'eml':{stytchClient.magicLinks.email.loginOrCreate(email,convertMagicLinkOptions(emailOptions)).then(function(data){onEvent({type:StytchEventType.MagicLinkLoginOrCreateEvent,data:Object.assign(Object.assign({},data),{email:email})});dispatch({type:'set_magic_link_email',email:email});})["catch"](function(e){onError(e);});return;}case'otp':{stytchClient.otps.email.loginOrCreate(email,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES}).then(function(data){onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});dispatch({type:'update_otp_state',otpState:{type:OTPMethods.Email,methodId:data.method_id,otpDestination:email}});})["catch"](function(e){onError(e);});return;}default:{stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(data){onEvent({type:StytchEventType.PasswordResetByEmailStart,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordSetNew});})["catch"](function(e){onError(e);});return;}}},[userType,secondaryType]);var ComponentToUserType={"new":(/*#__PURE__*/wn.createElement(wn.Fragment,null,secondaryType&&(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(PasswordSecondaryMethod,{secondaryType:secondaryType}),/*#__PURE__*/wn.createElement(Divider,null))),/*#__PURE__*/wn.createElement(PasswordNewUser,null))),password:(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(PasswordAuthenticate,null),secondaryType&&(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(Divider,null),/*#__PURE__*/wn.createElement(PasswordSecondaryMethod,{secondaryType:secondaryType}))))),passwordless:(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(wn.Fragment,null,secondaryType&&(/*#__PURE__*/wn.createElement(wn.Fragment,null,secondaryType==='eml'?/*#__PURE__*/wn.createElement(EmailConfirmation,null):/*#__PURE__*/wn.createElement(OTPAuthenticate,{hideBackArrow:true}),/*#__PURE__*/wn.createElement(Divider,null),/*#__PURE__*/wn.createElement(PasswordlessCreate,null))))))};return/*#__PURE__*/wn.createElement(Flex,{gap:24,direction:"column"},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),ComponentToUserType[userType]);};var ImageContainer$1=He(Flex)(_templateObject45||(_templateObject45=_taggedTemplateLiteral(["\n > div {\n height: 200px;\n width: 200px;\n }\n"])));var ConnectWallet=function ConnectWallet(){var _useLingui29=useLingui(),_t=_useLingui29._;var onEvent=useEventCallback();var onError=useErrorCallback();var handleError=function handleError(){onError({message:'[Error] Could not connect to wallet'});dispatch({type:'transition',screen:AppScreens$1.CryptoError});};var stytchClient=useStytch();var _useGlobalReducer25=useGlobalReducer(),_useGlobalReducer26=_slicedToArray2(_useGlobalReducer25,2),state=_useGlobalReducer26[0],dispatch=_useGlobalReducer26[1];var walletOption=state.formState.cryptoState.walletOption;var walletType=isSolanaWallet(walletOption)?'solana':'ethereum';var onConnectWallet=function onConnectWallet(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee100(){var address;return _regenerator2().w(function(_context100){while(1)switch(_context100.n){case 0:_context100.n=1;return connectWithWallet({wallet:walletOption});case 1:address=_context100.v;stytchClient.cryptoWallets.authenticateStart({crypto_wallet_address:address,crypto_wallet_type:walletType}).then(function(data){onEvent({type:StytchEventType.CryptoWalletAuthenticateStart,data:data});dispatch({type:'update_crypto_state',cryptoState:{walletAddress:address,walletChallenge:data.challenge,walletOption:walletOption}});dispatch({type:'transition',screen:AppScreens$1.CryptoSignMessage});})["catch"](handleError);case 2:return _context100.a(2);}},_callee100);}));};p$5(function(){onConnectWallet();},[]);var WalletImage=WalletToIcon[walletOption];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.connectWallet.title',message:"Connecting to your wallet..."})),/*#__PURE__*/wn.createElement(ImageContainer$1,{justifyContent:"center"},/*#__PURE__*/wn.createElement(WalletImage,null)),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.connectWallet.instructionPopup',message:"Complete sign in by connecting through the wallet pop up in the right corner of your screen."})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.troubleHelp',message:"Having trouble? Use the back arrow to return to the main screen and try logging in again."})));};var ImageContainer=He(Flex)(_templateObject46||(_templateObject46=_taggedTemplateLiteral(["\n > div {\n height: 200px;\n width: 200px;\n }\n"])));var SignMessage=function SignMessage(){var _useLingui30=useLingui(),_t=_useLingui30._;var onEvent=useEventCallback();var onError=useErrorCallback();var handleError=function handleError(){onError({message:'[Error] Could not sign message'});dispatch({type:'transition',screen:AppScreens$1.CryptoError});};var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer27=useGlobalReducer(),_useGlobalReducer28=_slicedToArray2(_useGlobalReducer27,2),state=_useGlobalReducer28[0],dispatch=_useGlobalReducer28[1];var _state$formState$cryp=state.formState.cryptoState,walletChallenge=_state$formState$cryp.walletChallenge,walletAddress=_state$formState$cryp.walletAddress,walletOption=_state$formState$cryp.walletOption;var walletType=isSolanaWallet(walletOption)?'solana':'ethereum';var onSignWallet=function onSignWallet(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee101(){var _a,_b,signature;return _regenerator2().w(function(_context101){while(1)switch(_context101.n){case 0:_context101.n=1;return signMessageWithWallet({wallet:walletOption,message:walletChallenge,address:walletAddress});case 1:signature=_context101.v;stytchClient.cryptoWallets.authenticate({crypto_wallet_address:walletAddress,crypto_wallet_type:walletType,signature:signature,session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){onEvent({type:StytchEventType.CryptoWalletAuthenticate,data:data});dispatch({type:'transition',screen:AppScreens$1.CryptoConfirmation});})["catch"](handleError);case 2:return _context101.a(2);}},_callee101);}));};p$5(function(){onSignWallet();},[]);var WalletImage=WalletToIcon[walletOption];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.signMessage.title',message:"Completing signature request..."})),/*#__PURE__*/wn.createElement(ImageContainer,{justifyContent:"center"},/*#__PURE__*/wn.createElement(WalletImage,null)),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.signMessage.instruction',message:"Complete the signature request through the wallet pop up in the right corner of your screen."})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.troubleHelp',message:"Having trouble? Use the back arrow to return to the main screen and try logging in again."})));};var WalletIcon=function WalletIcon(_ref127){var icon=_ref127.icon,name=_ref127.name,link=_ref127.link;return/*#__PURE__*/wn.createElement("a",{href:link,target:"_blank",rel:"noreferrer",style:{textDecoration:'none',color:'inherit'}},/*#__PURE__*/wn.createElement("div",{style:{display:'flex',flexDirection:'column',justifyContent:'center',alignItems:'center'}},icon,/*#__PURE__*/wn.createElement("span",null,name)));};var SetupNewWallet=function SetupNewWallet(){var _useLingui31=useLingui(),_t=_useLingui31._;var _useGlobalReducer29=useGlobalReducer(),_useGlobalReducer30=_slicedToArray2(_useGlobalReducer29,2),dispatch=_useGlobalReducer30[1];var WalletIconComponent=function WalletIconComponent(_ref128){var wallet=_ref128.wallet;var Icon=WalletToIcon[wallet];return/*#__PURE__*/wn.createElement(Icon,null);};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.setupNewWallet.title',message:"Set up a new crypto wallet"})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.setupNewWallet.content',message:"Signing in with a crypto wallet can help keep your account private and secure."})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.setupNewWallet.instruction',message:"Get started by downloading any Ethereum or Solana wallet. We\u2019ve included a few examples of wallet extensions you can find below. Once you\u2019ve set up your wallet, you can use it to sign in!"})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(Flex,{justifyContent:"space-evenly"},/*#__PURE__*/wn.createElement(WalletIcon,{icon:/*#__PURE__*/wn.createElement(WalletIconComponent,{wallet:Wallets.Metamask}),name:_t({id:'crypto.wallet.metamask',message:"Metamask"}),link:"https://metamask.io/"}),/*#__PURE__*/wn.createElement(WalletIcon,{icon:/*#__PURE__*/wn.createElement(WalletIconComponent,{wallet:Wallets.Phantom}),name:_t({id:'crypto.wallet.phantom',message:"Phantom"}),link:"https://phantom.app/"})),/*#__PURE__*/wn.createElement(Flex,{justifyContent:"space-evenly"},/*#__PURE__*/wn.createElement(WalletIcon,{icon:/*#__PURE__*/wn.createElement(WalletIconComponent,{wallet:Wallets.Coinbase}),name:_t({id:'crypto.wallet.coinbase',message:"Coinbase"}),link:"https://www.coinbase.com/wallet"}),/*#__PURE__*/wn.createElement(WalletIcon,{icon:/*#__PURE__*/wn.createElement(WalletIconComponent,{wallet:Wallets.Binance}),name:_t({id:'crypto.wallet.binance',message:"Binance"}),link:"https://www.bnbchain.world/en/binance-wallet"}))));};var OtherCryptoWallets=function OtherCryptoWallets(){var _useLingui32=useLingui(),_t=_useLingui32._;var _useGlobalReducer31=useGlobalReducer(),_useGlobalReducer32=_slicedToArray2(_useGlobalReducer31,2),dispatch=_useGlobalReducer32[1];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.continueWithOtherWallet.title',message:"Continue with other wallet"})),/*#__PURE__*/wn.createElement(CryptoWalletButtons,{type:"other"}));};var Success=function Success(){var _useLingui33=useLingui(),_t=_useLingui33._;var _useGlobalReducer33=useGlobalReducer(),_useGlobalReducer34=_slicedToArray2(_useGlobalReducer33,2),dispatch=_useGlobalReducer34[1];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Confirmation,{header:_t({id:'crypto.success.title',message:"Success!"}),text:_t({id:'crypto.success.content',message:"You have successfully connected your wallet."})}));};var Error$1=function Error$1(){var _useLingui34=useLingui(),_t=_useLingui34._;var _useGlobalReducer35=useGlobalReducer(),_useGlobalReducer36=_slicedToArray2(_useGlobalReducer35,2),dispatch=_useGlobalReducer36[1];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.error.title',message:"Looks like there was an error!"})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.error.content',message:"Your sign in request could not be completed. Use the back arrow to return to the log in screen and try again!"})));};var e={data:""},t=function t(_t24){if("object"==(typeof window==="undefined"?"undefined":_typeof2(window))){var _e3=(_t24?_t24.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return _e3.nonce=window.__nonce__,_e3.parentNode||(_t24||document.head).appendChild(_e3),_e3.firstChild;}return _t24||e;},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,_o2=function o(e,t){var r="",l="",a="";var _loop3=function _loop3(_n5){var c=e[_n5];"@"==_n5[0]?"i"==_n5[1]?r=_n5+" "+c+";":l+="f"==_n5[1]?_o2(c,_n5):_n5+"{"+_o2(c,"k"==_n5[1]?"":t)+"}":"object"==_typeof2(c)?l+=_o2(c,t?t.replace(/([^,])+/g,function(e){return _n5.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,function(t){return /&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t;});}):_n5):null!=c&&(_n5=/^--/.test(_n5)?_n5:_n5.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=_o2.p?_o2.p(_n5,c):_n5+":"+c+";");};for(var _n5 in e){_loop3(_n5);}return r+(t&&a?t+"{"+a+"}":a)+l;},c={},_s=function s(e){if("object"==_typeof2(e)){var _t25="";for(var _r4 in e)_t25+=_r4+_s(e[_r4]);return _t25;}return e;},i=function i(e,t,r,_i5,p){var u=_s(e),d=c[u]||(c[u]=function(e){var t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r;}(u));if(!c[d]){var _t26=u!==e?e:function(e){var t,r,o=[{}];for(;t=l.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n$1," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n$1," ").trim();return o[0];}(e);c[d]=_o2(p?_defineProperty({},"@keyframes "+d,_t26):_t26,r?"":"."+d);}var f=r&&c.g?c.g:null;return r&&(c.g=c[d]),function(e,t,r,l){l?t.data=t.data.replace(l,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);}(c[d],t,_i5,f),d;},p=function p(e,t,r){return e.reduce(function(e,l,a){var n=t[a];if(n&&n.call){var _e4=n(r),_t27=_e4&&_e4.props&&_e4.props.className||/^go/.test(_e4)&&_e4;n=_t27?"."+_t27:_e4&&"object"==_typeof2(_e4)?_e4.props?"":_o2(_e4,""):!1===_e4?"":_e4;}return e+l+(null==n?"":n);},"");};function u$1(e){var r=this||{},l=e.call?e(r.p):e;return i(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce(function(e,t){return Object.assign(e,t&&t.call?t(r.p):t);},{}):l,t(r.target),r.g,r.o,r.k);}var d,f,g;u$1.bind({g:1});var h$1=u$1.bind({k:1});function m(e,t,r,l){_o2.p=t,d=e,f=r,g=l;}function w$1(e,t){var r=this||{};return function(){var l=arguments;function a(n,o){var c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=u$1.apply(r,l)+(s?" "+s:"");var i=e;return e[0]&&(i=c.as||e,delete c.as),g&&i[0]&&g(c),d(i,c);}return a;};}var W=function W(e){return typeof e=="function";},T=function T(e,t){return W(e)?e(t):e;};var U=function(){var e=0;return function(){return(++e).toString();};}(),b=function(){var e;return function(){if(e===void 0&&(typeof window==="undefined"?"undefined":_typeof2(window))<"u"){var _t28=matchMedia("(prefers-reduced-motion: reduce)");e=!_t28||_t28.matches;}return e;};}();var Q=20;var S=new Map(),X=1e3,$=function $(e){if(S.has(e))return;var t=setTimeout(function(){S["delete"](e),u({type:4,toastId:e});},X);S.set(e,t);},J=function J(e){var t=S.get(e);t&&clearTimeout(t);},_v=function v(e,t){switch(t.type){case 0:return _objectSpread(_objectSpread({},e),{},{toasts:[t.toast].concat(_toConsumableArray2(e.toasts)).slice(0,Q)});case 1:return t.toast.id&&J(t.toast.id),_objectSpread(_objectSpread({},e),{},{toasts:e.toasts.map(function(r){return r.id===t.toast.id?_objectSpread(_objectSpread({},r),t.toast):r;})});case 2:var o=t.toast;return e.toasts.find(function(r){return r.id===o.id;})?_v(e,{type:1,toast:o}):_v(e,{type:0,toast:o});case 3:var s=t.toastId;return s?$(s):e.toasts.forEach(function(r){$(r.id);}),_objectSpread(_objectSpread({},e),{},{toasts:e.toasts.map(function(r){return r.id===s||s===void 0?_objectSpread(_objectSpread({},r),{},{visible:!1}):r;})});case 4:return t.toastId===void 0?_objectSpread(_objectSpread({},e),{},{toasts:[]}):_objectSpread(_objectSpread({},e),{},{toasts:e.toasts.filter(function(r){return r.id!==t.toastId;})});case 5:return _objectSpread(_objectSpread({},e),{},{pausedAt:t.time});case 6:var _a2=t.time-(e.pausedAt||0);return _objectSpread(_objectSpread({},e),{},{pausedAt:void 0,toasts:e.toasts.map(function(r){return _objectSpread(_objectSpread({},r),{},{pauseDuration:r.pauseDuration+_a2});})});}},A=[],P={toasts:[],pausedAt:void 0},u=function u(e){P=_v(P,e),A.forEach(function(t){t(P);});},Y={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},I=function I(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _h$103=h$5(P),_h$104=_slicedToArray2(_h$103,2),t=_h$104[0],o=_h$104[1];p$5(function(){return A.push(o),function(){var a=A.indexOf(o);a>-1&&A.splice(a,1);};},[t]);var s=t.toasts.map(function(a){var r,c;return _objectSpread(_objectSpread(_objectSpread(_objectSpread({},e),e[a.type]),a),{},{duration:a.duration||((r=e[a.type])==null?void 0:r.duration)||(e==null?void 0:e.duration)||Y[a.type],style:_objectSpread(_objectSpread(_objectSpread({},e.style),(c=e[a.type])==null?void 0:c.style),a.style)});});return _objectSpread(_objectSpread({},t),{},{toasts:s});};var G=function G(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"blank";var o=arguments.length>2?arguments[2]:undefined;return _objectSpread(_objectSpread({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0},o),{},{id:(o==null?void 0:o.id)||U()});},h=function h(e){return function(t,o){var s=G(t,e,o);return u({type:2,toast:s}),s.id;};},n=function n(e,t){return h("blank")(e,t);};n.error=h("error");n.success=h("success");n.loading=h("loading");n.custom=h("custom");n.dismiss=function(e){u({type:3,toastId:e});};n.remove=function(e){return u({type:4,toastId:e});};n.promise=function(e,t,o){var s=n.loading(t.loading,_objectSpread(_objectSpread({},o),o==null?void 0:o.loading));return e.then(function(a){return n.success(T(t.success,a),_objectSpread(_objectSpread({id:s},o),o==null?void 0:o.success)),a;})["catch"](function(a){n.error(T(t.error,a),_objectSpread(_objectSpread({id:s},o),o==null?void 0:o.error));}),e;};var Z=function Z(e,t){u({type:1,toast:{id:e,height:t}});},ee=function ee(){u({type:5,time:Date.now()});},D=function D(e){var _I=I(e),t=_I.toasts,o=_I.pausedAt;p$5(function(){if(o)return;var r=Date.now(),c=t.map(function(i){if(i.duration===1/0)return;var d=(i.duration||0)+i.pauseDuration-(r-i.createdAt);if(d<0){i.visible&&n.dismiss(i.id);return;}return setTimeout(function(){return n.dismiss(i.id);},d);});return function(){c.forEach(function(i){return i&&clearTimeout(i);});};},[t,o]);var s=T$3(function(){o&&u({type:6,time:Date.now()});},[o]),a=T$3(function(r,c){var _g$filter;var _ref130=c||{},_ref130$reverseOrder=_ref130.reverseOrder,i=_ref130$reverseOrder===void 0?!1:_ref130$reverseOrder,_ref130$gutter=_ref130.gutter,d=_ref130$gutter===void 0?8:_ref130$gutter,p=_ref130.defaultPosition,g=t.filter(function(m){return(m.position||p)===(r.position||p)&&m.height;}),E=g.findIndex(function(m){return m.id===r.id;}),x=g.filter(function(m,R){return R<E&&m.visible;}).length;return(_g$filter=g.filter(function(m){return m.visible;})).slice.apply(_g$filter,_toConsumableArray2(i?[x+1]:[0,x])).reduce(function(m,R){return m+(R.height||0)+d;},0);},[t]);return{toasts:t,handlers:{updateHeight:Z,startPause:ee,endPause:s,calculateOffset:a}};};var oe=h$1(_templateObject47||(_templateObject47=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0) rotate(45deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(45deg);\n opacity: 1;\n}"]))),re=h$1(_templateObject48||(_templateObject48=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0);\n opacity: 0;\n}\nto {\n transform: scale(1);\n opacity: 1;\n}"]))),se=h$1(_templateObject49||(_templateObject49=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0) rotate(90deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(90deg);\n\topacity: 1;\n}"]))),_=w$1("div")(_templateObject50||(_templateObject50=_taggedTemplateLiteral(["\n width: 20px;\n opacity: 0;\n height: 20px;\n border-radius: 10px;\n background: ",";\n position: relative;\n transform: rotate(45deg);\n\n animation: "," 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n animation-delay: 100ms;\n\n &:after,\n &:before {\n content: '';\n animation: "," 0.15s ease-out forwards;\n animation-delay: 150ms;\n position: absolute;\n border-radius: 3px;\n opacity: 0;\n background: ",";\n bottom: 9px;\n left: 4px;\n height: 2px;\n width: 12px;\n }\n\n &:before {\n animation: "," 0.15s ease-out forwards;\n animation-delay: 180ms;\n transform: rotate(90deg);\n }\n"])),function(e){return e.primary||"#ff4b4b";},oe,re,function(e){return e.secondary||"#fff";},se);var ne=h$1(_templateObject51||(_templateObject51=_taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]))),V=w$1("div")(_templateObject52||(_templateObject52=_taggedTemplateLiteral(["\n width: 12px;\n height: 12px;\n box-sizing: border-box;\n border: 2px solid;\n border-radius: 100%;\n border-color: ",";\n border-right-color: ",";\n animation: "," 1s linear infinite;\n"])),function(e){return e.secondary||"#e0e0e0";},function(e){return e.primary||"#616161";},ne);var pe=h$1(_templateObject53||(_templateObject53=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0) rotate(45deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(45deg);\n\topacity: 1;\n}"]))),de=h$1(_templateObject54||(_templateObject54=_taggedTemplateLiteral(["\n0% {\n\theight: 0;\n\twidth: 0;\n\topacity: 0;\n}\n40% {\n height: 0;\n\twidth: 6px;\n\topacity: 1;\n}\n100% {\n opacity: 1;\n height: 10px;\n}"]))),w=w$1("div")(_templateObject55||(_templateObject55=_taggedTemplateLiteral(["\n width: 20px;\n opacity: 0;\n height: 20px;\n border-radius: 10px;\n background: ",";\n position: relative;\n transform: rotate(45deg);\n\n animation: "," 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n animation-delay: 100ms;\n &:after {\n content: '';\n box-sizing: border-box;\n animation: "," 0.2s ease-out forwards;\n opacity: 0;\n animation-delay: 200ms;\n position: absolute;\n border-right: 2px solid;\n border-bottom: 2px solid;\n border-color: ",";\n bottom: 6px;\n left: 6px;\n height: 10px;\n width: 6px;\n }\n"])),function(e){return e.primary||"#61d345";},pe,de,function(e){return e.secondary||"#fff";});var ue=w$1("div")(_templateObject56||(_templateObject56=_taggedTemplateLiteral(["\n position: absolute;\n"]))),le=w$1("div")(_templateObject57||(_templateObject57=_taggedTemplateLiteral(["\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 20px;\n min-height: 20px;\n"]))),Te=h$1(_templateObject58||(_templateObject58=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0.6);\n opacity: 0.4;\n}\nto {\n transform: scale(1);\n opacity: 1;\n}"]))),fe=w$1("div")(_templateObject59||(_templateObject59=_taggedTemplateLiteral(["\n position: relative;\n transform: scale(0.6);\n opacity: 0.4;\n min-width: 20px;\n animation: "," 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n"])),Te),M=function M(_ref131){var e=_ref131.toast;var t=e.icon,o=e.type,s=e.iconTheme;return t!==void 0?typeof t=="string"?y$3(fe,null,t):t:o==="blank"?null:y$3(le,null,y$3(V,_objectSpread({},s)),o!=="loading"&&y$3(ue,null,o==="error"?y$3(_,_objectSpread({},s)):y$3(w,_objectSpread({},s))));};var ye=function ye(e){return"\n0% {transform: translate3d(0,".concat(e*-200,"%,0) scale(.6); opacity:.5;}\n100% {transform: translate3d(0,0,0) scale(1); opacity:1;}\n");},ge=function ge(e){return"\n0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}\n100% {transform: translate3d(0,".concat(e*-150,"%,-1px) scale(.6); opacity:0;}\n");},he="0%{opacity:0;} 100%{opacity:1;}",xe="0%{opacity:1;} 100%{opacity:0;}",be=w$1("div")(_templateObject60||(_templateObject60=_taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n background: #fff;\n color: #363636;\n line-height: 1.3;\n will-change: transform;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);\n max-width: 350px;\n pointer-events: auto;\n padding: 8px 10px;\n border-radius: 8px;\n"]))),Se=w$1("div")(_templateObject61||(_templateObject61=_taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n margin: 4px 10px;\n color: inherit;\n flex: 1 1 auto;\n white-space: pre-line;\n"]))),Ae=function Ae(e,t){var s=e.includes("top")?1:-1,_ref132=b()?[he,xe]:[ye(s),ge(s)],_ref133=_slicedToArray2(_ref132,2),a=_ref133[0],r=_ref133[1];return{animation:t?"".concat(h$1(a)," 0.35s cubic-bezier(.21,1.02,.73,1) forwards"):"".concat(h$1(r)," 0.4s forwards cubic-bezier(.06,.71,.55,1)")};},F=w$5(function(_ref134){var e=_ref134.toast,t=_ref134.position,o=_ref134.style,s=_ref134.children;var a=e.height?Ae(e.position||t||"top-center",e.visible):{opacity:0},r=y$3(M,{toast:e}),c=y$3(Se,_objectSpread({},e.ariaProps),T(e.message,e));return y$3(be,{className:e.className,style:_objectSpread(_objectSpread(_objectSpread({},a),o),e.style)},typeof s=="function"?s({icon:r,message:c}):y$3(g$7,null,r,c));});m(y$3);var Ee=function Ee(_ref135){var e=_ref135.id,t=_ref135.className,o=_ref135.style,s=_ref135.onHeightUpdate,a=_ref135.children;var r=T$3(function(c){if(c){var _i6=function _i6(){var d=c.getBoundingClientRect().height;s(e,d);};_i6(),new MutationObserver(_i6).observe(c,{subtree:!0,childList:!0,characterData:!0});}},[e,s]);return y$3("div",{ref:r,className:t,style:o},a);},Re=function Re(e,t){var o=e.includes("top"),s=o?{top:0}:{bottom:0},a=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return _objectSpread(_objectSpread({left:0,right:0,display:"flex",position:"absolute",transition:b()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:"translateY(".concat(t*(o?1:-1),"px)")},s),a);},ve=u$1(_templateObject62||(_templateObject62=_taggedTemplateLiteral(["\n z-index: 9999;\n > * {\n pointer-events: auto;\n }\n"]))),O=16,Ie=function Ie(_ref136){var e=_ref136.reverseOrder,_ref136$position=_ref136.position,t=_ref136$position===void 0?"top-center":_ref136$position,o=_ref136.toastOptions,s=_ref136.gutter,a=_ref136.children,r=_ref136.containerStyle,c=_ref136.containerClassName;var _D=D(o),i=_D.toasts,d=_D.handlers;return y$3("div",{style:_objectSpread({position:"fixed",zIndex:9999,top:O,left:O,right:O,bottom:O,pointerEvents:"none"},r),className:c,onMouseEnter:d.startPause,onMouseLeave:d.endPause},i.map(function(p){var g=p.position||t,E=d.calculateOffset(p,{reverseOrder:e,gutter:s,defaultPosition:t}),x=Re(g,E);return y$3(Ee,{id:p.id,key:p.id,onHeightUpdate:d.updateHeight,className:p.visible?ve:"",style:x},p.type==="custom"?T(p.message,p):a?a(p):y$3(F,{toast:p,position:g}));}));};var _t=n;var MagicLinkOption=function MagicLinkOption(){var _useLingui35=useLingui(),_t=_useLingui35._;var _useGlobalReducer37=useGlobalReducer(),_useGlobalReducer38=_slicedToArray2(_useGlobalReducer37,2),state=_useGlobalReducer38[0],dispatch=_useGlobalReducer38[1];var stytchClient=useStytch();var config=useConfig();var emailMagicLinksOptions=config.emailMagicLinksOptions;var email=state.formState.passwordState.email;var sendMagicLink=function sendMagicLink(){stytchClient.magicLinks.email.loginOrCreate(email,convertMagicLinkOptions(emailMagicLinksOptions)).then(function(){dispatch({type:'transition',screen:AppScreens$1.EmailConfirmation});});};return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(Divider,null),/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",onClick:sendMagicLink},_t({id:'button.loginWithoutPassword',message:"Login without a password"})));};var ResendButton$3=function ResendButton$3(_ref137){var onClick=_ref137.onClick,children=_ref137.children;return/*#__PURE__*/wn.createElement("button",{onClick:onClick,style:{all:'unset'}},/*#__PURE__*/wn.createElement("b",{style:{cursor:'pointer'}},children));};var PasswordForgot=function PasswordForgot(){var _useLingui36=useLingui(),_t$1=_useLingui36._;var _useGlobalReducer39=useGlobalReducer(),_useGlobalReducer40=_slicedToArray2(_useGlobalReducer39,2),state=_useGlobalReducer40[0],dispatch=_useGlobalReducer40[1];var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var resendResetPassword=function resendResetPassword(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee102(){return _regenerator2().w(function(_context102){while(1)switch(_context102.n){case 0:readB2CInternals(stytchClient).networkClient.logEvent({name:'email_try_again_clicked',details:{email:email,type:EmailSentType.ResetPassword}});stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){return _t.success(_t$1({id:'toast.emailResent',message:"Email resent"}));});case 1:return _context102.a(2);}},_callee102);}));};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'password.forgot.title',message:"Forgot password?"})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.forgot.content",message:"A link to reset your password was sent to you at <bold>{email}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.didntGetItResend",message:"Didn't get it? <resendButton>Resend email</resendButton>",components:{resendButton:/*#__PURE__*/wn.createElement(ResendButton$3,{onClick:resendResetPassword})}})),/*#__PURE__*/wn.createElement(MagicLinkOption,null));};var ResendButton$2=function ResendButton$2(_ref138){var onClick=_ref138.onClick,children=_ref138.children;return/*#__PURE__*/wn.createElement("button",{type:"button",onClick:onClick,style:{all:'unset'}},/*#__PURE__*/wn.createElement("b",{style:{cursor:'pointer'}},children));};var PasswordBreached=function PasswordBreached(){var _useLingui37=useLingui(),_t$1=_useLingui37._;var _useGlobalReducer41=useGlobalReducer(),_useGlobalReducer42=_slicedToArray2(_useGlobalReducer41,2),state=_useGlobalReducer42[0],dispatch=_useGlobalReducer42[1];var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var resendResetPassword=function resendResetPassword(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){return _t.success(_t$1({id:'toast.emailResent',message:"Email resent"}));});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'password.breached.title',message:"Check your email to set a new password"})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.breached.content",message:"A different site where you use the same password had a security issue recently. For your safety, an email was sent to you at <bold>{email}</bold> to reset your password.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.didntGetItResend",message:"Didn't get it? <resendButton>Resend email</resendButton>",components:{resendButton:/*#__PURE__*/wn.createElement(ResendButton$2,{onClick:resendResetPassword})}})),/*#__PURE__*/wn.createElement(MagicLinkOption,null));};var ResendButton$1=function ResendButton$1(_ref139){var onClick=_ref139.onClick,children=_ref139.children;return/*#__PURE__*/wn.createElement("button",{onClick:onClick,style:{all:'unset'}},/*#__PURE__*/wn.createElement("b",{style:{cursor:'pointer'}},children));};var PasswordSetNew=function PasswordSetNew(){var _useLingui38=useLingui(),_t$1=_useLingui38._;var _useGlobalReducer43=useGlobalReducer(),_useGlobalReducer44=_slicedToArray2(_useGlobalReducer43,2),state=_useGlobalReducer44[0],dispatch=_useGlobalReducer44[1];var onError=useErrorCallback();var onEvent=useEventCallback();var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var resendResetPassword=function resendResetPassword(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(data){_t.success(_t$1({id:'toast.emailResent',message:"Email resent"}));onEvent({type:StytchEventType.PasswordResetByEmailStart,data:data});})["catch"](function(e){onError(e);});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'password.setNew.title',message:"Check your email!"})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.setNew.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.didntGetItResend",message:"Didn't get it? <resendButton>Resend email</resendButton>",components:{resendButton:/*#__PURE__*/wn.createElement(ResendButton$1,{onClick:resendResetPassword})}})));};var ResendButton=function ResendButton(_ref140){var onClick=_ref140.onClick,children=_ref140.children;return/*#__PURE__*/wn.createElement("button",{onClick:onClick,style:{all:'unset'}},/*#__PURE__*/wn.createElement("b",{style:{cursor:'pointer'}},children));};var PasswordDedupe=function PasswordDedupe(){var _useLingui39=useLingui(),_t$1=_useLingui39._;var _useGlobalReducer45=useGlobalReducer(),_useGlobalReducer46=_slicedToArray2(_useGlobalReducer45,2),state=_useGlobalReducer46[0],dispatch=_useGlobalReducer46[1];var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var resendResetPassword=function resendResetPassword(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){return _t.success(_t$1({id:'toast.emailResent',message:"Email resent"}));});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'password.resetRequired.title',message:"Check your email to set a new password!"})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.resetRequired.content",message:"We want to make sure your account is secure and that it's really you logging in! A login link was sent to you at <bold>{email}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.didntGetItResend",message:"Didn't get it? <resendButton>Resend email</resendButton>",components:{resendButton:/*#__PURE__*/wn.createElement(ResendButton,{onClick:resendResetPassword})}})),/*#__PURE__*/wn.createElement(MagicLinkOption,null));};var Form=He.form(_templateObject63||(_templateObject63=_taggedTemplateLiteral(["\n width: 100%;\n"])));var ResetPasswordScreen=function ResetPasswordScreen(){var _useLingui40=useLingui(),_t=_useLingui40._;var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer47=useGlobalReducer(),_useGlobalReducer48=_slicedToArray2(_useGlobalReducer47,2),state=_useGlobalReducer48[0],dispatch=_useGlobalReducer48[1];var passwordToken=state.formState.resetPasswordState.token;var onEvent=useEventCallback();var onError=useErrorCallback();var resetTokenType=F$4(function(){var _a;var parsed=stytchClient.parseAuthenticateUrl();return(_a=parsed===null||parsed===void 0?void 0:parsed.tokenType)!==null&&_a!==void 0?_a:'';},[stytchClient]);var _h$105=h$5(''),_h$106=_slicedToArray2(_h$105,2),password=_h$106[0],setPassword=_h$106[1];var _h$107=h$5(''),_h$108=_slicedToArray2(_h$107,2),errorMessage=_h$108[0],setErrorMessage=_h$108[1];var _h$109=h$5(0),_h$110=_slicedToArray2(_h$109,2),passwordScore=_h$110[0],setPasswordScore=_h$110[1];var _h$111=h$5(''),_h$112=_slicedToArray2(_h$111,2),passwordWarning=_h$112[0],setPasswordWarning=_h$112[1];var _h$113=h$5([]),_h$114=_slicedToArray2(_h$113,2),passwordSuggestions=_h$114[0],setPasswordSuggestions=_h$114[1];var _h$115=h$5(true),_h$116=_slicedToArray2(_h$115,2),invalidPassword=_h$116[0],setInvalidPassword=_h$116[1];var _h$117=h$5(false),_h$118=_slicedToArray2(_h$117,2),isSubmitting=_h$118[0],setIsSubmitting=_h$118[1];var _h$119=h$5('none'),_h$120=_slicedToArray2(_h$119,2),strengthPolicy=_h$120[0],setStrengthPolicy=_h$120[1];var _h$121=h$5(0),_h$122=_slicedToArray2(_h$121,2),missingCharacters=_h$122[0],setMissingCharacters=_h$122[1];var _h$123=h$5(0),_h$124=_slicedToArray2(_h$123,2),missingComplexity=_h$124[0],setMissingComplexity=_h$124[1];var _h$125=h$5(false),_h$126=_slicedToArray2(_h$125,2),isPasswordBreached=_h$126[0],setIsPasswordBreached=_h$126[1];var _h$127=h$5(''),_h$128=_slicedToArray2(_h$127,2),loginErrorMessage=_h$128[0],setLoginErrorMessage=_h$128[1];var _h$129=h$5(false),_h$130=_slicedToArray2(_h$129,2),isLoggingIn=_h$130[0],setIsLoggingIn=_h$130[1];var passwordProps=useErrorProps(errorMessage);var updateStrengthCheck=F$4(function(){return debounce(function(password){return stytchClient.passwords.strengthCheck({password:password}).then(function(_ref141){var score=_ref141.score,feedback=_ref141.feedback,valid_password=_ref141.valid_password,strength_policy=_ref141.strength_policy,breached_password=_ref141.breached_password;setStrengthPolicy(strength_policy);setInvalidPassword(!valid_password);if(strength_policy==='zxcvbn'){setPasswordScore(score);setPasswordWarning(feedback.warning);setPasswordSuggestions(feedback.suggestions);setIsPasswordBreached(breached_password);}else if(strength_policy==='luds'){setMissingCharacters(feedback.luds_requirements.missing_characters);setMissingComplexity(feedback.luds_requirements.missing_complexity);setIsPasswordBreached(breached_password);}});});},[stytchClient.passwords]);p$5(function(){var _a,_b;if(resetTokenType==='login'){stytchClient.magicLinks.authenticate(passwordToken,{session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);});}},[resetTokenType]);var onPasswordChange=function onPasswordChange(password){setPassword(password);updateStrengthCheck(password);};var handleSubmit=function handleSubmit(e){var _a,_b;e.preventDefault();setErrorMessage('');setIsSubmitting(true);stytchClient.passwords.resetByEmail({token:passwordToken,password:password,session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.PasswordResetByEmail,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);setErrorMessage(getTranslatedError(e,_t));setIsSubmitting(false);});};var handleLogin=function handleLogin(){var _a,_b;setLoginErrorMessage('');setIsLoggingIn(true);stytchClient.magicLinks.authenticate(passwordToken,{session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);setLoginErrorMessage(getTranslatedError(e,_t));})["finally"](function(){setIsLoggingIn(false);});};if(resetTokenType==='login'){return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36,className:'resetPasswordContainer',alignItems:"center"},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'password.reset.loggingInProgress',message:"Logging in..."})),/*#__PURE__*/wn.createElement(CircularProgress,{size:100,thickness:2}));}return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36,className:'resetPasswordContainer',alignItems:"center",width:"100%"},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'password.reset.title',message:"Reset your password"})),/*#__PURE__*/wn.createElement(Form,{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:2},/*#__PURE__*/wn.createElement(Label,{htmlFor:"new-password"},_t({id:'formField.password.label',message:"Password"})),/*#__PURE__*/wn.createElement(PasswordInput,Object.assign({password:password,setPassword:onPasswordChange,type:"new"},passwordProps.input)),/*#__PURE__*/wn.createElement("div",Object.assign({},passwordProps.error),/*#__PURE__*/wn.createElement(PasswordB2CError,{passwordPolicy:strengthPolicy,passwordScore:passwordScore,errorMessage:errorMessage,passwordWarning:passwordWarning,passwordSuggestions:passwordSuggestions,missingCharacters:missingCharacters,missingComplexity:missingComplexity,isPasswordBreached:isPasswordBreached}))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.continue',message:"Continue"}),disabled:invalidPassword}))),/*#__PURE__*/wn.createElement(Divider,null),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8,width:"100%"},/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",disabled:isLoggingIn,onClick:handleLogin},isLoggingIn?(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center",alignItems:"center",gap:8},/*#__PURE__*/wn.createElement(CircularProgress,{size:18,thickness:1}),_t({id:'login.loading',message:"Logging in..."}))):_t({id:'password.reset.loginWithoutPassword',message:"Login without a password"})),loginErrorMessage&&/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:loginErrorMessage})));};var PasswordConfirmation=function PasswordConfirmation(){var onEvent=useEventCallback();useMountEffect(function(){onEvent({type:StytchEventType.AuthenticateFlowComplete,data:{}});});return/*#__PURE__*/y$3(Confirmation,null);};var PasskeyCollageSvg=function PasskeyCollageSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"112",height:"96",viewBox:"0 0 112 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("g",{clipPath:"url(#clip0_2877_10121)"},/*#__PURE__*/wn.createElement("ellipse",{cx:"55.9998",cy:"48.0004",rx:"48",ry:"48.0003",fill:"#C7F1FF"}),/*#__PURE__*/wn.createElement("path",{d:"M100.866 74.5461H103.823",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M84.604 67.3945C84.604 67.2618 84.7116 67.1542 84.8442 67.1542H106.54C106.672 67.1542 106.78 67.2618 106.78 67.3945V77.2627C106.78 77.3954 106.672 77.503 106.54 77.503H84.8442C84.7116 77.503 84.604 77.3954 84.604 77.2627V67.3945Z",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M91.2568 70.8503L87.5608 74.5463",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M91.2568 74.5463L87.5608 70.8503",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M97.9096 70.8503L94.2136 74.5463",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M97.9096 74.5463L94.2136 70.8503",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M87.9158 31.7665C87.8368 31.7271 87.7974 31.6629 87.7974 31.5742C87.7974 31.4854 87.8171 31.4015 87.8566 31.3226C89.0799 29.6256 90.6289 28.3135 92.5034 27.3861C94.3779 26.4587 96.3806 25.995 98.5117 25.995C100.643 25.995 102.65 26.4489 104.535 27.3565C106.419 28.2642 107.983 29.5665 109.226 31.2634C109.285 31.362 109.31 31.441 109.3 31.5002C109.29 31.5594 109.256 31.6185 109.196 31.6777C109.137 31.7369 109.063 31.7665 108.974 31.7665C108.886 31.7665 108.802 31.7172 108.723 31.6185C107.559 30.0005 106.074 28.7575 104.268 27.8893C102.463 27.0211 100.544 26.587 98.5117 26.587C96.4793 26.587 94.5752 27.026 92.7993 27.9041C91.0235 28.7821 89.5436 30.0203 88.3597 31.6185C88.2808 31.7172 88.2068 31.7764 88.1377 31.7961C88.0687 31.8159 87.9947 31.806 87.9158 31.7665ZM102.034 46.6541C100.001 46.141 98.3291 45.1249 97.017 43.6055C95.7048 42.0862 95.0487 40.2413 95.0487 38.0708C95.0487 37.1434 95.3891 36.364 96.0699 35.7326C96.7506 35.1012 97.5645 34.7855 98.5117 34.7855C99.4588 34.7855 100.273 35.1012 100.953 35.7326C101.634 36.364 101.975 37.1434 101.975 38.0708C101.975 38.8206 102.266 39.452 102.848 39.965C103.43 40.4781 104.106 40.7346 104.875 40.7346C105.625 40.7346 106.281 40.4781 106.843 39.965C107.406 39.452 107.687 38.8206 107.687 38.0708C107.687 35.6438 106.784 33.6114 104.979 31.9737C103.173 30.336 101.018 29.5171 98.5117 29.5171C96.0057 29.5171 93.85 30.336 92.0446 31.9737C90.2392 33.6114 89.3364 35.6438 89.3364 38.0708C89.3364 38.5444 89.3907 39.161 89.4992 39.9206C89.6077 40.6803 89.8396 41.5436 90.1948 42.5104C90.2342 42.6091 90.2342 42.6831 90.1948 42.7324C90.1553 42.7817 90.106 42.8261 90.0468 42.8656C89.9678 42.9051 89.884 42.9149 89.7952 42.8952C89.7064 42.8755 89.6423 42.8163 89.6028 42.7176C89.3463 41.9678 89.144 41.2032 88.9961 40.4238C88.8481 39.6444 88.7741 38.8601 88.7741 38.0708C88.7741 35.5254 89.7409 33.35 91.6746 31.5446C93.6083 29.7391 95.8873 28.8364 98.5117 28.8364C101.195 28.8364 103.499 29.7243 105.423 31.5002C107.347 33.276 108.308 35.4662 108.308 38.0708C108.308 38.9785 107.973 39.748 107.302 40.3794C106.631 41.0108 105.822 41.3265 104.875 41.3265C103.908 41.3265 103.08 41.0108 102.389 40.3794C101.698 39.748 101.353 38.9785 101.353 38.0708C101.353 37.3013 101.072 36.66 100.509 36.147C99.9471 35.6339 99.2812 35.3774 98.5117 35.3774C97.7421 35.3774 97.0712 35.6339 96.499 36.147C95.9268 36.66 95.6407 37.3013 95.6407 38.0708C95.6407 40.1229 96.2622 41.8346 97.5053 43.206C98.7484 44.5773 100.297 45.5392 102.152 46.0917C102.271 46.1312 102.345 46.1805 102.374 46.2397C102.404 46.2989 102.409 46.368 102.389 46.4469C102.369 46.5455 102.33 46.6146 102.271 46.6541C102.211 46.6935 102.132 46.6935 102.034 46.6541ZM91.5858 25.3439C91.4872 25.3833 91.4132 25.3883 91.3639 25.3587C91.3145 25.3291 91.2701 25.2847 91.2307 25.2255C91.1912 25.186 91.1715 25.1268 91.1715 25.0479C91.1715 24.969 91.2011 24.9098 91.2603 24.8703C92.385 24.2586 93.5639 23.7949 94.7972 23.4792C96.0304 23.1635 97.2686 23.0057 98.5117 23.0057C99.7942 23.0057 101.052 23.1635 102.285 23.4792C103.519 23.7949 104.698 24.2389 105.822 24.8111C105.921 24.8506 105.975 24.9098 105.985 24.9887C105.995 25.0676 105.98 25.1367 105.941 25.1959C105.901 25.2551 105.847 25.3044 105.778 25.3439C105.709 25.3833 105.625 25.3833 105.526 25.3439C104.441 24.8111 103.306 24.3918 102.123 24.086C100.939 23.7801 99.735 23.6272 98.5117 23.6272C97.2883 23.6272 96.0945 23.7703 94.9304 24.0564C93.7662 24.3425 92.6514 24.7717 91.5858 25.3439ZM95.5519 46.3285C94.4075 45.1446 93.5146 43.9015 92.8733 42.5992C92.2321 41.2969 91.9114 39.7875 91.9114 38.0708C91.9114 36.3147 92.5576 34.8348 93.85 33.6312C95.1425 32.4275 96.6963 31.8257 98.5117 31.8257C100.327 31.8257 101.891 32.4275 103.203 33.6312C104.515 34.8348 105.171 36.3147 105.171 38.0708C105.171 38.1695 105.146 38.2435 105.097 38.2928C105.048 38.3421 104.974 38.3668 104.875 38.3668C104.776 38.3668 104.698 38.3421 104.638 38.2928C104.579 38.2435 104.55 38.1695 104.55 38.0708C104.55 36.4725 103.953 35.1308 102.759 34.0455C101.565 32.9603 100.149 32.4177 98.5117 32.4177C96.8739 32.4177 95.468 32.9603 94.294 34.0455C93.12 35.1308 92.533 36.4725 92.533 38.0708C92.533 39.748 92.824 41.1785 93.4061 42.3624C93.9882 43.5463 94.8514 44.7302 95.9959 45.9141C96.0748 45.9931 96.1093 46.0671 96.0995 46.1361C96.0896 46.2052 96.0551 46.2693 95.9959 46.3285C95.9564 46.368 95.8923 46.4025 95.8035 46.4321C95.7147 46.4617 95.6308 46.4272 95.5519 46.3285ZM104.609 44.1679C102.872 44.1679 101.368 43.5907 100.095 42.4364C98.8224 41.2821 98.1861 39.8269 98.1861 38.0708C98.1861 37.9721 98.2107 37.8932 98.2601 37.834C98.3094 37.7748 98.3834 37.7452 98.4821 37.7452C98.5807 37.7452 98.6547 37.7748 98.704 37.834C98.7534 37.8932 98.778 37.9721 98.778 38.0708C98.778 39.6691 99.365 40.9862 100.539 42.0221C101.713 43.058 103.07 43.5759 104.609 43.5759C104.767 43.5759 104.954 43.5661 105.171 43.5463C105.388 43.5266 105.625 43.497 105.881 43.4575C105.98 43.4378 106.059 43.4526 106.118 43.5019C106.177 43.5513 106.217 43.6055 106.237 43.6647C106.256 43.7437 106.251 43.8127 106.222 43.8719C106.192 43.9311 106.128 43.9706 106.029 43.9903C105.674 44.089 105.363 44.1432 105.097 44.1531C104.831 44.1629 104.668 44.1679 104.609 44.1679Z",stroke:"#0C5A56",strokeWidth:"0.721422"}),/*#__PURE__*/wn.createElement("g",{clipPath:"url(#clip1_2877_10121)"},/*#__PURE__*/wn.createElement("path",{d:"M25.7683 49.5923V52.5147C25.7683 52.9022 25.6144 53.2739 25.3403 53.5479C25.0663 53.8219 24.6947 53.9759 24.3071 53.9759H21.3848",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M21.3848 32.0582H24.3071C24.6947 32.0582 25.0663 32.2121 25.3403 32.4861C25.6144 32.7602 25.7683 33.1318 25.7683 33.5193V36.4417",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M3.85059 36.4417V33.5193C3.85059 33.1318 4.00453 32.7602 4.27856 32.4861C4.55258 32.2121 4.92424 32.0582 5.31177 32.0582H8.23413",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M8.23413 53.9759H5.31177C4.92424 53.9759 4.55258 53.8219 4.27856 53.5479C4.00453 53.2739 3.85059 52.9022 3.85059 52.5147V49.5923",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M14.8093 44.1129C17.0285 44.1129 18.8275 42.3139 18.8275 40.0947C18.8275 37.8754 17.0285 36.0764 14.8093 36.0764C12.59 36.0764 10.791 37.8754 10.791 40.0947C10.791 42.3139 12.59 44.1129 14.8093 44.1129Z",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M21.0097 49.9586C20.5564 48.6763 19.7168 47.5662 18.6064 46.781C17.4959 45.9957 16.1694 45.5741 14.8094 45.5741C13.4494 45.5741 12.1229 45.9957 11.0125 46.781C9.90207 47.5662 9.06241 48.6763 8.60913 49.9586",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"})),/*#__PURE__*/wn.createElement("path",{d:"M54.7371 47.9187C57.8367 47.9187 60.3495 45.406 60.3495 42.3064C60.3495 39.2068 57.8367 36.694 54.7371 36.694C51.6375 36.694 49.1248 39.2068 49.1248 42.3064C49.1248 45.406 51.6375 47.9187 54.7371 47.9187Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M69.7034 47.9187C69.7062 47.1369 69.4989 46.3687 69.1032 45.6944C68.7076 45.0201 68.1381 44.4644 67.4542 44.0854C66.7704 43.7064 65.9973 43.518 65.2158 43.54C64.4343 43.5619 63.673 43.7934 63.0115 44.2101C62.35 44.6268 61.8126 45.2136 61.4554 45.9091C61.0982 46.6045 60.9343 47.3832 60.9809 48.1636C61.0275 48.944 61.2828 49.6976 61.7203 50.3457C62.1577 50.9937 62.7611 51.5123 63.4675 51.8474V58.5198L65.3383 60.3906L68.4563 57.2727L66.5855 55.4019L68.4563 53.5311L66.9097 51.9846C67.7311 51.6676 68.4374 51.1097 68.936 50.3841C69.4346 49.6585 69.7021 48.7991 69.7034 47.9187ZM65.3383 47.9187C65.0916 47.9187 64.8505 47.8456 64.6454 47.7085C64.4403 47.5715 64.2804 47.3767 64.186 47.1488C64.0916 46.9209 64.0669 46.6702 64.1151 46.4282C64.1632 46.1863 64.282 45.9641 64.4564 45.7896C64.6308 45.6152 64.853 45.4964 65.095 45.4483C65.3369 45.4002 65.5877 45.4249 65.8156 45.5193C66.0435 45.6137 66.2382 45.7735 66.3753 45.9786C66.5123 46.1837 66.5855 46.4249 66.5855 46.6715C66.5855 47.0023 66.4541 47.3195 66.2202 47.5534C65.9863 47.7873 65.6691 47.9187 65.3383 47.9187Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M59.6512 50.4382C58.6934 50.0111 57.6566 49.7902 56.608 49.7896H52.8664C50.8818 49.7896 48.9784 50.578 47.5751 51.9814C46.1717 53.3847 45.3833 55.2881 45.3833 57.2728V59.7671H61.5968V52.8951C60.7557 52.249 60.0873 51.405 59.6512 50.4382Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("rect",{x:"39.2727",y:"15.4204",width:"35.8443",height:"65.4755",rx:"1.67273",stroke:"#0C5A56",strokeWidth:"2.38962",strokeLinejoin:"round"})),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("clipPath",{id:"clip0_2877_10121"},/*#__PURE__*/wn.createElement("rect",{width:"110.4",height:"96.0005",fill:"white",transform:"translate(0.799805)"})),/*#__PURE__*/wn.createElement("clipPath",{id:"clip1_2877_10121"},/*#__PURE__*/wn.createElement("rect",{width:"23.3789",height:"23.3789",fill:"white",transform:"translate(3.11987 31.3276)"}))));};var Device;(function(Device){Device["DESKTOP"]="Desktop device";Device["MOBILE"]="Mobile device";Device["UNKNOWN"]="Unknown device";})(Device||(Device={}));var SAFARI_CROSS_DEVICE_DUPLICATE_REG_ERROR_MESSAGE='At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.';var CHROME_CROSS_DEVICE_DUPLICATE_REG_ERROR_MESSAGE='The user attempted to register an authenticator that contains one of the credentials already registered with the relying party.';var LoadingScreen=function LoadingScreen(){return/*#__PURE__*/y$3(Flex,{direction:"column",gap:36,alignItems:"center"},/*#__PURE__*/y$3(CircularProgress,{size:100,thickness:8}));};var ContentContainer=He(Flex)(_templateObject64||(_templateObject64=_taggedTemplateLiteral(["\n width: 100%;\n background-color: ",";\n"])),function(props){return props.theme.colors.accent;});var PasskeyRegistrationStart=function PasskeyRegistrationStart(){var _useLingui41=useLingui(),_t=_useLingui41._;var stytchClient=useStytch();var _h$131=h$5(function(){return(stytchClient.user.getSync()!=null?'hasUser':'loading');}),_h$132=_slicedToArray2(_h$131,2),userState=_h$132[0],setUserState=_h$132[1];var _h$133=h$5(),_h$134=_slicedToArray2(_h$133,2),error=_h$134[0],setError=_h$134[1];var config=useConfig();var onEvent=useEventCallback();var onError=useErrorCallback();p$5(function(){stytchClient.user.get().then(function(){setUserState('hasUser');})["catch"](function(e){setUserState('noUser');onError(e);});},[onError,stytchClient]);var _useGlobalReducer49=useGlobalReducer(),_useGlobalReducer50=_slicedToArray2(_useGlobalReducer49,2),dispatch=_useGlobalReducer50[1];var onCreatePasskey=function onCreatePasskey(){var _a,_b,_c;setError(undefined);stytchClient.webauthn.register({domain:(_a=config.passkeyOptions)===null||_a===void 0?void 0:_a.domain,is_passkey:true,session_duration_minutes:(_c=(_b=config.sessionOptions)===null||_b===void 0?void 0:_b.sessionDurationMinutes)!==null&&_c!==void 0?_c:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){onEvent({type:StytchEventType.PasskeyRegister,data:data});dispatch({type:'transition',screen:AppScreens$1.PasskeyRegistrationSuccess});})["catch"](function(e){onError(e);if(e.message.includes(SAFARI_CROSS_DEVICE_DUPLICATE_REG_ERROR_MESSAGE)||e.message.includes(CHROME_CROSS_DEVICE_DUPLICATE_REG_ERROR_MESSAGE)){setError(_t({id:'error.duplicatePasskey',message:"The Passkey cannot be created as it seems to be already registered. It is possible this Passkey was registered on another device but has synced cross-device."}));return;}else{setError(_t({id:'error.passkeyNotCreated',message:"Your Passkey was not created. Click \u201CCreate a Passkey\u201D to try again or skip without adding a Passkey."}));}});};var onSkip=function onSkip(){onEvent({type:StytchEventType.PasskeySkip,data:{}});dispatch({type:'transition',screen:AppScreens$1.PasskeyRegistrationSuccess});};if(userState==='loading'){return/*#__PURE__*/wn.createElement(LoadingScreen,null);}if(userState==='noUser'){return/*#__PURE__*/wn.createElement(AlertBox,{variant:"warning",text:_t({id:'passkey.registrationStart.error.noUser',message:"Error: Cannot use PasskeyRegistration component without active user authenticated."})});}return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36,marginTop:12,marginLeft:6.5,marginRight:6.5},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'passkey.registrationStart.title',message:"Set up a new Passkey"})),error&&/*#__PURE__*/wn.createElement(AlertBox,{variant:"warning",text:error}),/*#__PURE__*/wn.createElement(ContentContainer,{direction:"column",alignItems:"center",gap:20},/*#__PURE__*/wn.createElement(Flex,{direction:"column",padding:20,gap:20,alignItems:"center"},/*#__PURE__*/wn.createElement(PasskeyCollageSvg,null),/*#__PURE__*/wn.createElement(Text,{size:"body"},_t({id:'passkey.registrationStart.subtitle',message:"With Passkeys you don't need to remember complex passwords."})),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},_t({id:'passkey.registrationStart.description',message:"Passkeys are encrypted digital keys you create using your fingerprint, face, or screen lock. Creating a Passkey will allow you to easily and securely log in to your account."})))),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:12},/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return onCreatePasskey();}},_t({id:'button.createPasskey',message:"Create a Passkey"})),/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",onClick:function onClick(){return onSkip();}},_t({id:'button.skip',message:"Skip"}))));};var useStytchUser=function useStytchUser(){var stytch=useStytch();return Cn(stytch.onStateChange,function(){return stytch.user.getSync();});};var Checkmark=function Checkmark(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M7.33317 13.2503L3.83317 9.75033L2.6665 10.917L7.33317 15.5837L17.3332 5.58366L16.1665 4.41699L7.33317 13.2503Z",fill:"#19303D"}));};var Pencil=function Pencil(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M11.7157 7.51667L12.4824 8.28333L4.93236 15.8333H4.16569V15.0667L11.7157 7.51667ZM14.7157 2.5C14.5074 2.5 14.2907 2.58333 14.1324 2.74167L12.6074 4.26667L15.7324 7.39167L17.2574 5.86667C17.5824 5.54167 17.5824 5.01667 17.2574 4.69167L15.3074 2.74167C15.1407 2.575 14.9324 2.5 14.7157 2.5ZM11.7157 5.15833L2.49902 14.375V17.5H5.62402L14.8407 8.28333L11.7157 5.15833Z",fill:"#19303D"}));};var Trash=function Trash(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M5.00008 15.8333C5.00008 16.75 5.75008 17.5 6.66675 17.5H13.3334C14.2501 17.5 15.0001 16.75 15.0001 15.8333V5.83333H5.00008V15.8333ZM6.66675 7.5H13.3334V15.8333H6.66675V7.5ZM12.9167 3.33333L12.0834 2.5H7.91675L7.08341 3.33333H4.16675V5H15.8334V3.33333H12.9167Z",fill:"#19303D"}));};var Cancel=function Cancel(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M9.99984 1.66699C5.3915 1.66699 1.6665 5.39199 1.6665 10.0003C1.6665 14.6087 5.3915 18.3337 9.99984 18.3337C14.6082 18.3337 18.3332 14.6087 18.3332 10.0003C18.3332 5.39199 14.6082 1.66699 9.99984 1.66699ZM9.99984 16.667C6.32484 16.667 3.33317 13.6753 3.33317 10.0003C3.33317 6.32533 6.32484 3.33366 9.99984 3.33366C13.6748 3.33366 16.6665 6.32533 16.6665 10.0003C16.6665 13.6753 13.6748 16.667 9.99984 16.667ZM12.9915 5.83366L9.99984 8.82533L7.00817 5.83366L5.83317 7.00866L8.82484 10.0003L5.83317 12.992L7.00817 14.167L9.99984 11.1753L12.9915 14.167L14.1665 12.992L11.1748 10.0003L14.1665 7.00866L12.9915 5.83366Z",fill:"#19303D"}));};var BaseIconButton=He(Button).attrs({variant:'text'})(_templateObject65||(_templateObject65=_taggedTemplateLiteral(["\n flex: 0 0 32px;\n height: 32px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n"])));var IconButton=function IconButton(_ref142){var _ref142$type=_ref142.type,type=_ref142$type===void 0?'button':_ref142$type,icon=_ref142.icon,onClick=_ref142.onClick,label=_ref142.label;return/*#__PURE__*/wn.createElement(BaseIconButton,{"aria-label":label,onClick:onClick,type:type},/*#__PURE__*/wn.createElement(IconColorOverride,{themeColor:"primary"},icon));};var RowInput=He(Input)(_templateObject66||(_templateObject66=_taggedTemplateLiteral(["\n flex: 1 1 auto;\n background-color: transparent;\n border-color: ",";\n {(props) => props.theme.typography.body}\n\n &:disabled {\n border-color: transparent;\n background: transparent;\n color: ",";\n }\n"])),function(props){return props.isEditing?props.theme.inputs.borderColor:'transparent';},function(props){return props.othersEditing?props.theme.colors.disabledText:props.theme.colors.primary;});var EditableRow=function EditableRow(_ref143){var id=_ref143.id,name=_ref143.name,state=_ref143.state,updateState=_ref143.updateState,handleEdit=_ref143.handleEdit;var _useLingui42=useLingui(),_t=_useLingui42._;var isEditing=isEditingRow(id,state);var inputRef=_$2(null);p$5(function(){var _a;if(isEditing){(_a=inputRef.current)===null||_a===void 0?void 0:_a.focus();}},[isEditing]);return/*#__PURE__*/wn.createElement(Flex,{as:"form",direction:"row",gap:2,alignItems:"center",width:"100%",onSubmit:function onSubmit(evt){evt.preventDefault();if(isEditing){handleEdit(id,state.newName);}},"data-testid":testId(id)},/*#__PURE__*/wn.createElement(RowInput,{ref:inputRef,disabled:!isEditing,isEditing:isEditing,othersEditing:state.type!=='viewing'&&state.id!==id,value:isEditing?state.newName:name,onChange:function onChange(e){if(isEditing){updateState(Object.assign(Object.assign({},state),{newName:e.target.value}));}},"aria-label":_t({id:'passkey.editing.label',message:"Passkey name"})}),function(){switch(state.type){case'viewing':return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(IconButton,{key:"edit",onClick:function onClick(){return updateState({type:'editing',id:id,newName:name});},icon:/*#__PURE__*/wn.createElement(Pencil,null),label:_t({id:'button.edit',message:"Edit"})}),/*#__PURE__*/wn.createElement(IconButton,{onClick:function onClick(){return updateState({type:'deleting',id:id});},icon:/*#__PURE__*/wn.createElement(Trash,null),label:_t({id:'button.delete',message:"Delete"})}));case'editing':if(state.id!==id)return null;return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(IconButton,{key:"submit",type:"submit",icon:/*#__PURE__*/wn.createElement(Checkmark,null),label:_t({id:'button.save',message:"Save"})}),/*#__PURE__*/wn.createElement(IconButton,{onClick:function onClick(){return updateState({type:'viewing'});},icon:/*#__PURE__*/wn.createElement(Cancel,null),label:_t({id:'button.cancel',message:"Cancel"})}));case'deleting':return null;}}());};function isEditingRow(id,state){return state.type==='editing'&&state.id===id;}function testId(id){return"editable-row-".concat(id);}var PasskeyAddedSvg=function PasskeyAddedSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"101",height:"101",viewBox:"0 0 101 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M60.6296 95.0741C56.8399 96.0414 52.8689 96.5556 48.7778 96.5556C22.3908 96.5556 1 75.1647 1 48.7778C1 22.3908 22.3908 1 48.7778 1C75.1647 1 96.5556 22.3908 96.5556 48.7778C96.5556 52.8689 96.0414 56.8398 95.0741 60.6296",stroke:"#0C5A56",strokeWidth:"1.78025",strokeLinecap:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M81 61C78.3736 61 75.7728 61.5173 73.3463 62.5224C70.9198 63.5275 68.715 65.0007 66.8579 66.8579C65.0007 68.715 63.5275 70.9198 62.5224 73.3463C61.5173 75.7728 61 78.3736 61 81C61 83.6264 61.5173 86.2272 62.5224 88.6537C63.5275 91.0802 65.0007 93.285 66.8579 95.1421C68.715 96.9993 70.9198 98.4725 73.3463 99.4776C75.7728 100.483 78.3736 101 81 101C83.6264 101 86.2272 100.483 88.6537 99.4776C91.0802 98.4725 93.285 96.9993 95.1421 95.1421C96.9993 93.285 98.4725 91.0802 99.4776 88.6537C100.483 86.2272 101 83.6264 101 81C101 78.3736 100.483 75.7728 99.4776 73.3463C98.4725 70.9198 96.9993 68.715 95.1421 66.8579C93.285 65.0007 91.0802 63.5275 88.6537 62.5224C86.2272 61.5173 83.6264 61 81 61Z",fill:"#C7F1FF"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M91.9508 71.6043C92.3374 71.8892 92.4199 72.4336 92.135 72.8202L79.9611 89.3419C79.8207 89.5324 79.6088 89.6575 79.3742 89.6883C79.1396 89.7191 78.9026 89.6529 78.7178 89.5051L70.0222 82.5486C69.6472 82.2486 69.5864 81.7014 69.8864 81.3264C70.1864 80.9514 70.7336 80.8906 71.1086 81.1906L79.0977 87.5819L90.7349 71.7886C91.0198 71.4019 91.5642 71.3194 91.9508 71.6043Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M46.1713 49.1485C50.3301 49.1485 53.7015 45.7771 53.7015 41.6183C53.7015 37.4595 50.3301 34.0881 46.1713 34.0881C42.0125 34.0881 38.6411 37.4595 38.6411 41.6183C38.6411 45.7771 42.0125 49.1485 46.1713 49.1485Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M66.2519 49.1485C66.2556 48.0995 65.9775 47.0688 65.4466 46.164C64.9158 45.2593 64.1517 44.5137 63.2341 44.0052C62.3166 43.4967 61.2794 43.244 60.2308 43.2734C59.1822 43.3029 58.1608 43.6134 57.2732 44.1725C56.3857 44.7317 55.6646 45.5189 55.1854 46.4521C54.7061 47.3852 54.4862 48.4299 54.5487 49.477C54.6113 50.5241 54.9539 51.5352 55.5408 52.4047C56.1276 53.2742 56.9373 53.97 57.885 54.4196V63.3722L60.3951 65.8822L64.5786 61.6988L62.0685 59.1887L64.5786 56.6787L62.5036 54.6037C63.6056 54.1784 64.5533 53.4299 65.2222 52.4563C65.8912 51.4828 66.2501 50.3297 66.2519 49.1485ZM60.3951 49.1485C60.0642 49.1485 59.7406 49.0503 59.4654 48.8664C59.1902 48.6826 58.9758 48.4212 58.8491 48.1155C58.7225 47.8097 58.6893 47.4732 58.7539 47.1486C58.8185 46.824 58.9778 46.5259 59.2119 46.2918C59.4459 46.0578 59.744 45.8984 60.0687 45.8339C60.3933 45.7693 60.7297 45.8024 61.0355 45.9291C61.3413 46.0557 61.6026 46.2702 61.7865 46.5454C61.9704 46.8206 62.0685 47.1441 62.0685 47.4751C62.0685 47.9189 61.8922 48.3445 61.5784 48.6583C61.2646 48.9722 60.8389 49.1485 60.3951 49.1485Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M52.7645 52.5288C51.4795 51.9558 50.0884 51.6594 48.6815 51.6586H43.6614C40.9985 51.6586 38.4447 52.7164 36.5618 54.5993C34.6789 56.4822 33.6211 59.036 33.6211 61.6989V65.0456H55.375V55.8253C54.2465 54.9584 53.3497 53.8259 52.7645 52.5288Z",fill:"#0C5A56"}));};var SubHeading=He(Text)(_templateObject67||(_templateObject67=_taggedTemplateLiteral(["\n {\n font-weight: 700;\n text-transform: uppercase;\n }\n"])));var PasskeyRegistrationSuccess=function PasskeyRegistrationSuccess(){var _a;var _useLingui43=useLingui(),_t$1=_useLingui43._;var stytchClient=useStytch();var user=useStytchUser();var _h$135=h$5(),_h$136=_slicedToArray2(_h$135,2),optimisticRegistrations=_h$136[0],setOptimisticRegistrations=_h$136[1];var webAuthnRegistrations=(_a=optimisticRegistrations===null||optimisticRegistrations===void 0?void 0:optimisticRegistrations.registrations)!==null&&_a!==void 0?_a:user===null||user===void 0?void 0:user.webauthn_registrations;var _h$137=h$5({type:'viewing'}),_h$138=_slicedToArray2(_h$137,2),editableRowState=_h$138[0],setEditableRowState=_h$138[1];var onEvent=useEventCallback();var _useGlobalReducer51=useGlobalReducer(),_useGlobalReducer52=_slicedToArray2(_useGlobalReducer51,2),dispatch=_useGlobalReducer52[1];var onSetUpANewPasskey=function onSetUpANewPasskey(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee103(){return _regenerator2().w(function(_context103){while(1)switch(_context103.n){case 0:_context103.n=1;return optimisticRegistrations===null||optimisticRegistrations===void 0?void 0:optimisticRegistrations.update;case 1:dispatch({type:'transition',screen:AppScreens$1.PasskeyRegistrationStart});case 2:return _context103.a(2);}},_callee103);}));};var onDone=function onDone(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee104(){return _regenerator2().w(function(_context104){while(1)switch(_context104.n){case 0:_context104.n=1;return optimisticRegistrations===null||optimisticRegistrations===void 0?void 0:optimisticRegistrations.update;case 1:onEvent({type:StytchEventType.PasskeyDone,data:{}});case 2:return _context104.a(2);}},_callee104);}));};var startOptimisticUpdate=function startOptimisticUpdate(registrations,update){var prevEditableRowState=Object.assign({},editableRowState);setOptimisticRegistrations({registrations:registrations,update:update});setEditableRowState({type:'viewing'});update["catch"](function(error){logger.error(error);_t.error(errorToStytchError(error).message);setEditableRowState(prevEditableRowState);}).then(function(){setOptimisticRegistrations(undefined);});};var deleteReg=function deleteReg(id){if(!user)return;startOptimisticUpdate(user.webauthn_registrations.filter(function(r){return r.webauthn_registration_id!==id;}),stytchClient.user.deleteWebauthnRegistration(id));};var updateReg=function updateReg(id,name){if(!user)return;startOptimisticUpdate(user.webauthn_registrations.map(function(r){return r.webauthn_registration_id===id?Object.assign(Object.assign({},r),{name:name}):r;}),stytchClient.webauthn.update({webauthn_registration_id:id,name:name}).then(function(){return stytchClient.user.get();}));};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36,marginTop:12,marginLeft:6.5,marginRight:6.5},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'passkey.registrationSuccess.title',message:"Passkey successfully created!"})),/*#__PURE__*/wn.createElement(Flex,{alignSelf:"center"},/*#__PURE__*/wn.createElement(PasskeyAddedSvg,null)),webAuthnRegistrations&&webAuthnRegistrations.length>0&&(/*#__PURE__*/wn.createElement(Flex,{"align-items":"left",direction:"column",width:"100%",gap:8},/*#__PURE__*/wn.createElement(SubHeading,{size:"body"},_t$1({id:'passkey.registrationSuccess.existingPasskeys',message:"Existing Passkeys"})),webAuthnRegistrations.map(function(registration){return(/*#__PURE__*/wn.createElement(EditableRow,{key:registration.webauthn_registration_id,id:registration.webauthn_registration_id,name:registration.name,state:editableRowState,updateState:setEditableRowState,handleEdit:updateReg}));}))),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:12},editableRowState.type==='deleting'?(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"outlined",onClick:function onClick(){deleteReg(editableRowState.id);}},_t$1({id:'button.delete',message:"Delete"})),/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",onClick:function onClick(){setEditableRowState({type:'viewing'});}},_t$1({id:'button.cancel',message:"Cancel"})))):(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(Button,{type:"button",disabled:editableRowState.type==='editing',onClick:onSetUpANewPasskey},_t$1({id:'passkey.registrationSuccess.setupAnother',message:"Set up another Passkey"})),/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",disabled:editableRowState.type==='editing',onClick:onDone},_t$1({id:'button.done',message:"Done"}))))),editableRowState.type==='deleting'&&(/*#__PURE__*/wn.createElement(AlertBox,{variant:"error",text:_t$1({id:'passkey.registrationSuccess.deleteWarning',message:"Once deleted, the passkey cannot be restored."})})));};var PasskeyConfirmation=function PasskeyConfirmation(){var _useLingui44=useLingui(),_t=_useLingui44._;var onEvent=useEventCallback();useMountEffect(function(){onEvent({type:StytchEventType.AuthenticateFlowComplete,data:{}});});return/*#__PURE__*/y$3(Confirmation,{text:_t({id:'passkey.success.content',message:"Your Passkey has been successfully authenticated."})});};var SuccessIcon=function SuccessIcon(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM8 15L3 10L4.41 8.59L8 12.17L15.59 4.58L17 6L8 15Z",fill:"#0F4447"}));};var ErrorIcon=function ErrorIcon(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM11 15H9V13H11V15ZM11 11H9V5H11V11Z",fill:"#590607"}));};var baseStyles={display:'flex',gap:'8px',padding:'8px',fontSize:'14px',borderRadius:'4px'};var successStyles=Object.assign(Object.assign({},baseStyles),{background:'#ECFFF5',boxShadow:'0px 5px 10px rgba(15, 68, 71, 0.18)',color:'#0F4447'});var errorStyles=Object.assign(Object.assign({},baseStyles),{background:'#FFEEEC',boxShadow:'0px 5px 10px rgba(89, 6, 7, 0.2)',color:'#590607'});var Snackbar=function Snackbar(){return/*#__PURE__*/wn.createElement(Ie,{containerStyle:{position:'sticky',marginTop:'4px',marginBottom:'24px'},toastOptions:{success:{style:successStyles,icon:/*#__PURE__*/wn.createElement(SuccessIcon,null)},error:{style:errorStyles,icon:/*#__PURE__*/wn.createElement(ErrorIcon,null)}}});};var OuterContainer=He.div(_templateObject68||(_templateObject68=_taggedTemplateLiteral(["\n width: ",";\n font-family: ",";\n box-sizing: border-box;\n * {\n box-sizing: content-box;\n }\n background-color: ",";\n border: ",";\n border-radius: ",";\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom: ",";\n"])),function(_ref144){var theme=_ref144.theme;return theme.container.width;},function(_ref145){var theme=_ref145.theme;return theme.typography.fontFamily;},function(_ref146){var theme=_ref146.theme;return theme.container.backgroundColor;},function(_ref147){var theme=_ref147.theme;return theme.container.border;},function(_ref148){var theme=_ref148.theme;return theme.container.borderRadius;},function(_ref149){var theme=_ref149.theme,displayWatermark=_ref149.displayWatermark;return displayWatermark?'0':theme.container.borderRadius;},function(_ref150){var theme=_ref150.theme,displayWatermark=_ref150.displayWatermark;return displayWatermark?'0':theme.container.borderRadius;},function(_ref151){var theme=_ref151.theme,displayWatermark=_ref151.displayWatermark;return displayWatermark?'none':theme.container.border;});var ChildrenContainer=He.div(_templateObject69||(_templateObject69=_taggedTemplateLiteral(["\n padding: 24px 32px;\n"])));var WatermarkContainer=He.div(_templateObject70||(_templateObject70=_taggedTemplateLiteral(["\n box-sizing: border-box;\n width: ",";\n background-color: ",";\n border: ",";\n border-top: none;\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n overflow: hidden;\n"])),function(_ref152){var theme=_ref152.theme;return theme.container.width;},function(_ref153){var theme=_ref153.theme;return theme.container.backgroundColor;},function(_ref154){var theme=_ref154.theme;return theme.container.border;},function(_ref155){var theme=_ref155.theme;return theme.container.borderRadius;},function(_ref156){var theme=_ref156.theme;return theme.container.borderRadius;});var InnerContainer=He.div(_templateObject71||(_templateObject71=_taggedTemplateLiteral(["\n background-color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0.5;\n"])));var Image=He.img(_templateObject72||(_templateObject72=_taggedTemplateLiteral(["\n width: 150px;\n"])));var POWERED_BY_STYTCH_IMG_URL='https://public-assets.stytch.com/powered_by_stytch_logo_dark.svg';var MainContainer=function MainContainer(_ref157){var children=_ref157.children,displayWatermark=_ref157.displayWatermark;var _useLingui45=useLingui(),_t=_useLingui45._;return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(OuterContainer,{displayWatermark:displayWatermark},/*#__PURE__*/wn.createElement(ChildrenContainer,null,children,/*#__PURE__*/wn.createElement(Snackbar,null))),displayWatermark&&(/*#__PURE__*/wn.createElement(WatermarkContainer,null,/*#__PURE__*/wn.createElement(InnerContainer,null,/*#__PURE__*/wn.createElement("a",{style:{height:32,display:'flex',alignItems:'center',padding:'8px 0px',boxSizing:'border-box'},href:"https://stytch.com/",target:"_blank",rel:"noreferrer"},/*#__PURE__*/wn.createElement(Image,{alt:_t({id:'watermark.altText',message:"Powered by Stytch"}),src:POWERED_BY_STYTCH_IMG_URL}))))));};var ErrorSVG=function ErrorSVG(){return/*#__PURE__*/wn.createElement("svg",{width:"200",height:"200",viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("g",{opacity:"0.1"},/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M99.9999 0C155.229 0 200 44.7715 200 99.9999C200 155.229 155.229 200 99.9999 200C44.7715 200 0 155.229 0 99.9999C0 44.7715 44.7715 0 99.9999 0Z",fill:"url(#paint0_linear_4408_12810)"})),/*#__PURE__*/wn.createElement("g",{opacity:"0.3"},/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M99.9993 17.5723C145.523 17.5723 182.427 54.4762 182.427 99.9993C182.427 145.523 145.523 182.427 99.9993 182.427C54.4762 182.427 17.5723 145.523 17.5723 99.9993C17.5723 54.4762 54.4762 17.5723 99.9993 17.5723Z",fill:"url(#paint1_linear_4408_12810)"})),/*#__PURE__*/wn.createElement("g",{opacity:"0.7"},/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M99.9987 32.2305C137.487 32.2305 167.877 62.6203 167.877 100.108C167.877 137.596 137.487 167.986 99.9987 167.986C62.5109 167.986 32.1211 137.596 32.1211 100.108C32.1211 62.6203 62.5109 32.2305 99.9987 32.2305Z",fill:"url(#paint2_linear_4408_12810)"})),/*#__PURE__*/wn.createElement("path",{d:"M100 45.8334C70.1 45.8334 45.8333 70.1 45.8333 100C45.8333 129.9 70.1 154.167 100 154.167C129.9 154.167 154.167 129.9 154.167 100C154.167 70.1 129.9 45.8334 100 45.8334ZM105.417 127.083H94.5833V116.25H105.417V127.083ZM105.417 105.417H94.5833V72.9167H105.417V105.417Z",fill:"#8B1214"}),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("linearGradient",{id:"paint0_linear_4408_12810",x1:"-87.1375",y1:"160.384",x2:"169.669",y2:"338.297",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"white"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#8B1214"})),/*#__PURE__*/wn.createElement("linearGradient",{id:"paint1_linear_4408_12810",x1:"-87.138",y1:"160.384",x2:"169.668",y2:"338.297",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"#F7F0F0"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#8B1214"})),/*#__PURE__*/wn.createElement("linearGradient",{id:"paint2_linear_4408_12810",x1:"-87.1386",y1:"160.493",x2:"169.668",y2:"338.405",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"#8B1214",stopOpacity:"0.01"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#E4C7C7"}))));};var ErrorHeader=He(Text)(_templateObject73||(_templateObject73=_taggedTemplateLiteral(["\n text-align: center;\n"])));var ErrorDisplay=function ErrorDisplay(_ref158){var text=_ref158.text,onGoBack=_ref158.onGoBack;var _useLingui46=useLingui(),_t=_useLingui46._;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},onGoBack&&/*#__PURE__*/wn.createElement(BackArrow,{onClick:onGoBack}),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24,alignItems:"center"},/*#__PURE__*/wn.createElement(ErrorHeader,{size:"header"},_t({id:'error.title',message:"Looks like there was an error!"})),/*#__PURE__*/wn.createElement(ErrorSVG,null),/*#__PURE__*/wn.createElement(Text,null,text)));};var OPENID_CONSENT_ITEM={text:'Verify your identity',details:['View information stored within your account']};var PROFILE_CONSENT_ITEM={text:'View your personal profile information',details:[]};var OFFLINE_ACCESS_CONSENT_ITEM={text:"Maintain access to your data even when you're not actively using the app",details:['Access your data even when you are offline.','Synchronize data and process background tasks on your behalf.']};var OPENID_SCOPE='openid';var PROFILE_SCOPE='profile';var EMAIL_SCOPE='email';var PHONE_SCOPE='phone';var FULL_ACCESS_SCOPE='full_access';var OFFLINE_ACCESS_SCOPE='offline_access';var DEFAULT_SCOPES=new Set([OPENID_SCOPE,PROFILE_SCOPE,EMAIL_SCOPE,PHONE_SCOPE,FULL_ACCESS_SCOPE,OFFLINE_ACCESS_SCOPE]);var FALLBACK_SCOPES=[OPENID_SCOPE,EMAIL_SCOPE,PROFILE_SCOPE];var containsCustomScopes=function containsCustomScopes(scope){return scope.split(' ').some(function(sc){return!DEFAULT_SCOPES.has(sc);});};var createBuiltinScopeDescriptions=function createBuiltinScopeDescriptions(scopes){var descriptions=[];if(scopes.includes(OPENID_SCOPE)){descriptions.push(OPENID_CONSENT_ITEM);}if(scopes.includes(EMAIL_SCOPE)||scopes.includes(PROFILE_SCOPE)||scopes.includes(PHONE_SCOPE)){descriptions.push(createProfileScopeDescription({containsEmail:scopes.includes(EMAIL_SCOPE),containsPhoneNumber:scopes.includes(PHONE_SCOPE),containsProfile:scopes.includes(PROFILE_SCOPE)}));}if(scopes.includes(OFFLINE_ACCESS_SCOPE)){descriptions.push(OFFLINE_ACCESS_CONSENT_ITEM);}return descriptions;};var createProfileScopeDescription=function createProfileScopeDescription(_ref159){var containsProfile=_ref159.containsProfile,containsEmail=_ref159.containsEmail,containsPhoneNumber=_ref159.containsPhoneNumber;var details=[];if(containsProfile){details.push('Your name, profile picture, and language preferences');}if(containsEmail){details.push('Your email address');}if(containsPhoneNumber){details.push('Your phone number');}return{text:PROFILE_CONSENT_ITEM.text,details:details};};var createCustomScopeDescriptions=function createCustomScopeDescriptions(scopes,rbacPolicy){if(!rbacPolicy)return[];var descriptions=[];var _iterator0=_createForOfIteratorHelper2(scopes),_step0;try{var _loop4=function _loop4(){var scope=_step0.value;if(DEFAULT_SCOPES.has(scope))return 1;var found=rbacPolicy.scopes.find(function(policyScope){return policyScope.scope===scope;});if(found&&found.description){descriptions.push(found.description);}else{descriptions.push("Use the ".concat(scope," scope"));}};for(_iterator0.s();!(_step0=_iterator0.n()).done;){if(_loop4())continue;}}catch(err){_iterator0.e(err);}finally{_iterator0.f();}return descriptions;};var fallbackConsentManifestGenerator=function fallbackConsentManifestGenerator(_ref160){var scopes=_ref160.scopes,clientName=_ref160.clientName,rbacPolicy=_ref160.rbacPolicy;return[{header:"".concat(clientName," is requesting to:"),items:createBuiltinScopeDescriptions(scopes).concat(createCustomScopeDescriptions(scopes,rbacPolicy))}];};var parseOAuthAuthorizeParams=function parseOAuthAuthorizeParams(params){var authorizeParams={client_id:'',redirect_uri:'',response_type:'code',scopes:[].concat(FALLBACK_SCOPES)};var requiredFields=['client_id','redirect_uri'];for(var _i7=0,_requiredFields=requiredFields;_i7<_requiredFields.length;_i7++){var field=_requiredFields[_i7];var value=params.get(field);if(!value){return{error:"Required parameter is missing: ".concat(field,". Please reach out to the application developer."),result:authorizeParams};}authorizeParams[field]=value;}var optionalStringFields=['response_type','scope','code_challenge','state','nonce','prompt'];for(var _i8=0,_optionalStringFields=optionalStringFields;_i8<_optionalStringFields.length;_i8++){var _field=_optionalStringFields[_i8];var _value=params.get(_field);if(_value){if(_field==='scope'){authorizeParams.scopes=_value.split(' ').filter(Boolean);}else{authorizeParams[_field]=_value;}}}if(params.has('resource')){authorizeParams.resources=params.getAll('resource');}return{error:null,result:authorizeParams};};var parseOAuthLogoutParams=function parseOAuthLogoutParams(params){var logoutParams={client_id:'',post_logout_redirect_uri:''};var requiredFields=['client_id','post_logout_redirect_uri'];for(var _i9=0,_requiredFields2=requiredFields;_i9<_requiredFields2.length;_i9++){var field=_requiredFields2[_i9];var value=params.get(field);if(!value){return{error:"Required parameter is missing: ".concat(field,". Please reach out to the application developer."),result:logoutParams};}logoutParams[field]=value;}logoutParams.id_token_hint=params.get('id_token_hint')||undefined;logoutParams.state=params.get('state')||undefined;return{error:null,result:logoutParams};};var parseIDPParams=function parseIDPParams(searchParams){var params=new URLSearchParams(searchParams);if(params.has('post_logout_redirect_uri')){var logoutResult=parseOAuthLogoutParams(params);return{error:logoutResult.error,flow:{type:'Logout',params:logoutResult.result}};}var authorizeResult=parseOAuthAuthorizeParams(params);return{error:authorizeResult.error,flow:{type:'Authorize',params:authorizeResult.result}};};var ScopeList=He.ul(_templateObject74||(_templateObject74=_taggedTemplateLiteral(["\n padding: 0;\n"])));var ScopeListItem=He.li(_templateObject75||(_templateObject75=_taggedTemplateLiteral(["\n padding: 4px;\n box-sizing: border-box;\n position: relative;\n list-style: none;\n\n &:not(:last-child) {\n border-bottom: 1px solid ",";\n }\n"])),function(_ref161){var theme=_ref161.theme;return theme.colors.secondary;});var ItemSummary=He.summary(_templateObject76||(_templateObject76=_taggedTemplateLiteral(["\n list-style: none;\n display: flex;\n justify-content: space-between;\n cursor: ",";\n"])),function(props){return props.expandable?'pointer':'default';});var DropdownArrowSvg=He.svg(_templateObject77||(_templateObject77=_taggedTemplateLiteral(["\n width: 32px;\n height: 32px;\n margin-left: 10px;\n margin-top: -5px;\n vertical-align: top;\n flex-shrink: 0;\n transition: transform 0.3s ease;\n details[open] & {\n transform: rotate(90deg);\n }\n"])));var ItemNestedDetailsList=He.ul(_templateObject78||(_templateObject78=_taggedTemplateLiteral(["\n padding: 4px 24px;\n list-style: none;\n"])));var DropdownArrow=function DropdownArrow(){return/*#__PURE__*/wn.createElement(DropdownArrowSvg,{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M14.5875 11L13.4125 12.175L17.2291 16L13.4125 19.825L14.5875 21L19.5875 16L14.5875 11Z",fill:"currentColor"}));};var Item=function Item(_ref162){var item=_ref162.item;var _a,_b,_c,_d;if(typeof item==='string'){item={text:item};}return/*#__PURE__*/wn.createElement(ScopeListItem,null,/*#__PURE__*/wn.createElement("details",null,/*#__PURE__*/wn.createElement(ItemSummary,{expandable:!!((_a=item.details)===null||_a===void 0?void 0:_a.length)},/*#__PURE__*/wn.createElement(Text,{size:"helper"},"\u2022\xA0",item.text),((_b=item.details)===null||_b===void 0?void 0:_b.length)&&/*#__PURE__*/wn.createElement(DropdownArrow,null)),((_c=item.details)===null||_c===void 0?void 0:_c.length)&&(/*#__PURE__*/wn.createElement(ItemNestedDetailsList,null,(_d=item.details)===null||_d===void 0?void 0:_d.map(function(details){return/*#__PURE__*/wn.createElement("li",{key:details},/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},"\u2022\xA0",details));})))));};var SectionHeader=He(Text)(_templateObject79||(_templateObject79=_taggedTemplateLiteral(["\n font-weight: 600;\n"])));var Section=function Section(_ref163){var section=_ref163.section;return/*#__PURE__*/wn.createElement("div",null,/*#__PURE__*/wn.createElement(SectionHeader,{size:"body"},section.header),/*#__PURE__*/wn.createElement(ScopeList,null,section.items.map(function(item,i){return/*#__PURE__*/wn.createElement(Item,{key:i,item:item});})));};var ConsentManifest=function ConsentManifest(_ref164){var manifest=_ref164.manifest,clientName=_ref164.clientName;var _useLingui47=useLingui(),_t=_useLingui47._;if(_typeof2(manifest[0])==='object'&&'header'in manifest[0]){return/*#__PURE__*/wn.createElement("div",null,manifest.map(function(item,i){return/*#__PURE__*/wn.createElement(Section,{key:i,section:item});}));}return/*#__PURE__*/wn.createElement(Section,{section:{header:_t({id:'idpConsent.allowClientTo',message:"Allow {clientName} to:",values:{clientName:clientName}}),items:manifest}});};var UngrantableSection=He.details(_templateObject80||(_templateObject80=_taggedTemplateLiteral(["\n border: ",";\n border-radius: ",";\n padding: 16px;\n margin-bottom: 36px;\n"])),function(_ref165){var theme=_ref165.theme;return theme.container.border;},function(_ref166){var theme=_ref166.theme;return theme.container.borderRadius;});var UngrantableSummary=He.summary(_templateObject81||(_templateObject81=_taggedTemplateLiteral(["\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n\n details[open] > & {\n padding-bottom: 8px;\n margin-bottom: 8px;\n border-bottom: 1px solid ",";\n }\n"])),function(_ref167){var theme=_ref167.theme;return theme.colors.secondary;});var UngrantableNestedDetailsList=He.ul(_templateObject82||(_templateObject82=_taggedTemplateLiteral(["\n padding: 4px;\n margin: 0;\n list-style: none;\n"])));var UngrantableScopes=function UngrantableScopes(_ref168){var clientName=_ref168.clientName,ungrantableScopeDescriptions=_ref168.ungrantableScopeDescriptions;var _useLingui48=useLingui(),_t2=_useLingui48._;if(!ungrantableScopeDescriptions.length)return null;return/*#__PURE__*/wn.createElement(UngrantableSection,null,/*#__PURE__*/wn.createElement(UngrantableSummary,null,/*#__PURE__*/wn.createElement(Text,{size:"helper"},_t2({id:'idpConsent.noPermissionsToGrant',message:"You do not have permissions to grant {clientName} access to some of the requested scopes.",values:{clientName:clientName}})),/*#__PURE__*/wn.createElement(DropdownArrow,null)),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},_t2({id:'idpConsent.cannotGrantRequest',message:"You cannot grant {clientName}'s request to:",values:{clientName:clientName}})),/*#__PURE__*/wn.createElement(UngrantableNestedDetailsList,null,ungrantableScopeDescriptions.map(function(desc,i){return/*#__PURE__*/wn.createElement("li",{key:i},/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},"\u2022\xA0",desc));})));};var ConsentManifestGeneratorContext=/*#__PURE__*/F$5(undefined);var TrustedAuthTokenParamsContext=/*#__PURE__*/F$5(undefined);var IDPContextProvider=function IDPContextProvider(_ref169){var children=_ref169.children,consentManifestGenerator=_ref169.consentManifestGenerator,authTokenParams=_ref169.authTokenParams;return/*#__PURE__*/wn.createElement(ConsentManifestGeneratorContext.Provider,{value:consentManifestGenerator},/*#__PURE__*/wn.createElement(TrustedAuthTokenParamsContext.Provider,{value:authTokenParams},children));};var useConsentManifestGenerator=function useConsentManifestGenerator(){return q$4(ConsentManifestGeneratorContext);};var useTrustedAuthTokenParams=function useTrustedAuthTokenParams(){return q$4(TrustedAuthTokenParamsContext);};var Logo=He.img(_templateObject83||(_templateObject83=_taggedTemplateLiteral(["\n max-height: 50px;\n max-width: 100px;\n"])));var initialState$1=function initialState$1(error,params){return{loading:!error,preflight:!!error,error:error,success:false,denied:false,consent_required:false,client:null,grantable_scope:'',ungrantable_scope:'',redirect_uri:params.redirect_uri};};var idpStateReducer=function idpStateReducer(state,action){switch(action.type){case'START_SUBMIT':return Object.assign(Object.assign({},state),{loading:true});case'COMPLETE_SUBMIT':return Object.assign(Object.assign({},state),{loading:false,success:true});case'START_PREFLIGHT':return Object.assign(Object.assign({},state),{preflight:true,loading:true});case'PREFLIGHT_ERROR':return Object.assign(Object.assign({},state),{preflight:true,loading:false,error:action.error});case'COMPLETE_PREFLIGHT':return Object.assign(Object.assign({},state),{loading:false,client:action.client,consent_required:action.consent_required,grantable_scope:action.grantable_scope,ungrantable_scope:action.ungrantable_scope});case'CONSENT_DENIED':return Object.assign(Object.assign({},state),{denied:true});default:return state;}};var useIDPState=function useIDPState(_ref170){var initialError=_ref170.initialError,initialParams=_ref170.initialParams,oauthAuthorizeStart=_ref170.oauthAuthorizeStart,oauthAuthorizeSubmit=_ref170.oauthAuthorizeSubmit,onError=_ref170.onError,onEvent=_ref170.onEvent;var _s$=s$1(idpStateReducer,initialState$1(initialError,initialParams)),_s$2=_slicedToArray2(_s$,2),state=_s$2[0],dispatch=_s$2[1];p$5(function(){if(!initialError)return;onError(new IDPOAuthFlowMissingParamError(initialError));},[initialError,onError]);var submitInternal=T$3(function(_ref171){var consent_required=_ref171.consent_required,consent_granted=_ref171.consent_granted;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee105(){var submitResp;return _regenerator2().w(function(_context105){while(1)switch(_context105.n){case 0:dispatch({type:'START_SUBMIT'});_context105.n=1;return oauthAuthorizeSubmit(Object.assign(Object.assign({},initialParams),{consent_granted:consent_granted}));case 1:submitResp=_context105.v;if(submitResp.authorization_code){dispatch({type:'COMPLETE_SUBMIT'});}window.location.href=submitResp.redirect_uri;if(consent_required&&!consent_granted){dispatch({type:'CONSENT_DENIED'});onEvent({type:StytchEventType.OAuthAuthorizeFlowConsentDenied,data:{}});}else{onEvent({type:StytchEventType.OAuthAuthorizeFlowComplete,data:{}});}case 2:return _context105.a(2);}},_callee105);}));},[oauthAuthorizeSubmit,initialParams,onEvent]);var submit=T$3(function(_ref172){var consent_granted=_ref172.consent_granted;return submitInternal({consent_granted:consent_granted,consent_required:true});},[submitInternal]);var loadClient=T$3(function(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee106(){var startResponse,err,message,grantable,ungrantable,_t29;return _regenerator2().w(function(_context106){while(1)switch(_context106.p=_context106.n){case 0:dispatch({type:'START_PREFLIGHT'});onEvent({type:StytchEventType.OAuthAuthorizeFlowStart,data:{client_id:initialParams['client_id'],redirect_uri:initialParams['redirect_uri'],scope:initialParams['scopes'].join(' ')}});_context106.p=1;_context106.n=2;return oauthAuthorizeStart(initialParams);case 2:startResponse=_context106.v;_context106.n=4;break;case 3:_context106.p=3;_t29=_context106.v;err=StytchAPIError.from(_t29);message=err.error_message;dispatch({type:'PREFLIGHT_ERROR',error:message});onError(err);return _context106.a(2);case 4:if(!startResponse.consent_required){_context106.n=5;break;}grantable=startResponse.scope_results.filter(function(s){return s.is_grantable;}).map(function(s){return s.scope;}).join(' ');ungrantable=startResponse.scope_results.filter(function(s){return!s.is_grantable;}).map(function(s){return s.scope;}).join(' ');dispatch({type:'COMPLETE_PREFLIGHT',consent_required:startResponse.consent_required,client:startResponse.client,grantable_scope:grantable,ungrantable_scope:ungrantable});return _context106.a(2);case 5:_context106.n=6;return submitInternal({consent_required:false,consent_granted:false});case 6:return _context106.a(2);}},_callee106,null,[[1,3]]);}));},[onEvent,initialParams,oauthAuthorizeStart,onError,submitInternal]);p$5(function(){if(state.preflight){return;}loadClient();},[loadClient,state.preflight]);return{state:state,submit:submit};};var IDPConsent=function IDPConsent(_ref173){var bootstrap=_ref173.bootstrap,bootstrapNotLoaded=_ref173.bootstrapNotLoaded,state=_ref173.state,submit=_ref173.submit;var _a;var _useLingui49=useLingui(),_t=_useLingui49._;var loading=state.loading,error=state.error,denied=state.denied,success=state.success,client=state.client;var customConsentManifestGenerator=useConsentManifestGenerator();var clientName=F$4(function(){var _a,_b;var name=(_b=(_a=state.client)===null||_a===void 0?void 0:_a.client_name)!==null&&_b!==void 0?_b:'';if(!name){try{var _u=new URL(state.redirect_uri);name=_u.hostname;}catch(e){logger.warn('Unable to parse host from redirect URI.',e);name=_t({id:'idpConsent.defaultClientName',message:"The App"});}}return name;},[(_a=state.client)===null||_a===void 0?void 0:_a.client_name,state.redirect_uri,_t]);var manifest=F$4(function(){if(customConsentManifestGenerator){try{return customConsentManifestGenerator({scopes:state.grantable_scope.split(' '),clientName:clientName});}catch(e){logger.error('Error rendering custom consent screen. Falling back to default consent screen.',e);}}return fallbackConsentManifestGenerator({scopes:state.grantable_scope.split(' '),rbacPolicy:bootstrap.rbacPolicy,clientName:clientName});},[customConsentManifestGenerator,state.grantable_scope,clientName,bootstrap.rbacPolicy]);var ungrantableScopeDescriptions=F$4(function(){if(state.ungrantable_scope==='')return[];return createCustomScopeDescriptions(state.ungrantable_scope.split(' '),bootstrap.rbacPolicy);},[state.ungrantable_scope,bootstrap.rbacPolicy]);if(loading||bootstrapNotLoaded){return/*#__PURE__*/wn.createElement(LoadingScreen,null);}if(error){return/*#__PURE__*/wn.createElement(ErrorDisplay,{text:error});}if(denied){return/*#__PURE__*/wn.createElement(ErrorDisplay,{text:_t({id:'idpConsent.denied',message:"Access to the application was denied."})});}if(success){return/*#__PURE__*/wn.createElement(Confirmation,null);}return/*#__PURE__*/wn.createElement(Consent,{client:client,submit:submit,grantableScope:state.grantable_scope,projectName:bootstrap.projectName},/*#__PURE__*/wn.createElement(UngrantableScopes,{ungrantableScopeDescriptions:ungrantableScopeDescriptions,clientName:clientName}),/*#__PURE__*/wn.createElement(ConsentManifest,{manifest:manifest,clientName:clientName}));};var Consent=function Consent(_ref174){var client=_ref174.client,submit=_ref174.submit,grantableScope=_ref174.grantableScope,projectName=_ref174.projectName,children=_ref174.children;var _useLingui50=useLingui(),_t2=_useLingui50._;var _Ze2=Ze(),logo=_Ze2.logo;var clientName=client.client_name;var title=containsCustomScopes(grantableScope)?_t2({id:'idpConsent.customScopes.title',message:"{clientName} wants to access your {projectName} account",values:{clientName:clientName,projectName:projectName}}):_t2({id:'idpConsent.signIn.title',message:"Sign in to {clientName} with {projectName}",values:{clientName:clientName,projectName:projectName}});return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},logo.logoImageUrl&&(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center"},/*#__PURE__*/wn.createElement(Logo,{src:logo.logoImageUrl}))),/*#__PURE__*/wn.createElement(Text,{size:"header",align:"center"},title),/*#__PURE__*/wn.createElement("div",null,children),/*#__PURE__*/wn.createElement("div",null,/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return submit({consent_granted:true});}},_t2({id:'idpConsent.button.allow',message:"Allow"})),/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return submit({consent_granted:false});},variant:"text"},_t2({id:'idpConsent.button.deny',message:"Deny"}))));};var initialState=function initialState(error){return{loading:!error,preflight:!!error,error:error,denied:false,consent_required:false,redirect_uri:''};};var logoutStateReducer=function logoutStateReducer(state,action){switch(action.type){case'START_PREFLIGHT':return Object.assign(Object.assign({},state),{preflight:true,loading:true});case'PREFLIGHT_ERROR':return Object.assign(Object.assign({},state),{preflight:true,loading:false,error:action.error});case'COMPLETE_PREFLIGHT':return Object.assign(Object.assign({},state),{loading:false,consent_required:action.consent_required,redirect_uri:action.redirect_uri});case'CONSENT_DENIED':return Object.assign(Object.assign({},state),{denied:true});default:return state;}};var useLogoutState=function useLogoutState(_ref175){var initialError=_ref175.initialError,initialParams=_ref175.initialParams,oauthLogoutStart=_ref175.oauthLogoutStart,revokeSession=_ref175.revokeSession,onError=_ref175.onError;var _s$3=s$1(logoutStateReducer,initialState(initialError)),_s$4=_slicedToArray2(_s$3,2),state=_s$4[0],dispatch=_s$4[1];p$5(function(){if(!initialError)return;onError(new IDPOAuthFlowMissingParamError(initialError));},[initialError,onError]);var submitInternal=T$3(function(redirectURI){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee107(){var _t30;return _regenerator2().w(function(_context107){while(1)switch(_context107.p=_context107.n){case 0:_context107.p=0;_context107.n=1;return revokeSession();case 1:_context107.n=3;break;case 2:_context107.p=2;_t30=_context107.v;case 3:window.location.href=redirectURI;case 4:return _context107.a(2);}},_callee107,null,[[0,2]]);}));},[revokeSession]);var logoutPreflight=T$3(function(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee108(){var startResponse,err,message,_t31;return _regenerator2().w(function(_context108){while(1)switch(_context108.p=_context108.n){case 0:dispatch({type:'START_PREFLIGHT'});_context108.p=1;_context108.n=2;return oauthLogoutStart(initialParams);case 2:startResponse=_context108.v;_context108.n=4;break;case 3:_context108.p=3;_t31=_context108.v;err=StytchAPIError.from(_t31);message=err.error_message;dispatch({type:'PREFLIGHT_ERROR',error:message});onError(err);return _context108.a(2);case 4:if(!startResponse.consent_required){_context108.n=5;break;}dispatch({type:'COMPLETE_PREFLIGHT',consent_required:startResponse.consent_required,redirect_uri:startResponse.redirect_uri});return _context108.a(2);case 5:submitInternal(startResponse.redirect_uri);case 6:return _context108.a(2);}},_callee108,null,[[1,3]]);}));},[initialParams,oauthLogoutStart,onError,submitInternal]);p$5(function(){if(state.preflight){return;}logoutPreflight();},[logoutPreflight,state.preflight]);var submit=T$3(function(_ref176){var consent_granted=_ref176.consent_granted;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee109(){return _regenerator2().w(function(_context109){while(1)switch(_context109.n){case 0:if(!consent_granted){_context109.n=1;break;}return _context109.a(2,submitInternal(state.redirect_uri));case 1:dispatch({type:'CONSENT_DENIED'});case 2:return _context109.a(2);}},_callee109);}));},[submitInternal,state]);return{state:state,submit:submit};};var IDPLogout=function IDPLogout(_ref177){var state=_ref177.state,submit=_ref177.submit,bootstrap=_ref177.bootstrap,bootstrapNotLoaded=_ref177.bootstrapNotLoaded;var _useLingui51=useLingui(),_t=_useLingui51._;var loading=state.loading,error=state.error,denied=state.denied;if(loading||bootstrapNotLoaded){return/*#__PURE__*/wn.createElement(LoadingScreen,null);}if(error){return/*#__PURE__*/wn.createElement(ErrorDisplay,{text:error});}if(denied){return/*#__PURE__*/wn.createElement(Confirmation,{text:_t({id:'idpLogout.notLoggedOut',message:"You have not been logged out. You may close this page."})});}var projectName=bootstrap.projectName;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(Text,{size:"header",align:"center"},_t({id:'idpLogout.title',message:"Log out?"})),/*#__PURE__*/wn.createElement("div",null,_t({id:'idpLogout.confirmMessage',message:"Are you sure you want to log out of your {projectName} account?",values:{projectName:projectName}})),/*#__PURE__*/wn.createElement("div",null,/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return submit({consent_granted:true});}},_t({id:'idpLogout.yes',message:"Yes"})),/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return submit({consent_granted:false});},variant:"text"},_t({id:'idpLogout.no',message:"No"}))));};var IDPConsentScreenImpl=function IDPConsentScreenImpl(_ref178){var initialError=_ref178.initialError,initialParams=_ref178.initialParams;var stytchClient=useStytch();var onError=useErrorCallback();var onEvent=useEventCallback();var _stytchClient$idp=stytchClient.idp,oauthAuthorizeStart=_stytchClient$idp.oauthAuthorizeStart,oauthAuthorizeSubmit=_stytchClient$idp.oauthAuthorizeSubmit;var _useBootstrap2=useBootstrap(),bootstrap=_useBootstrap2.bootstrap,bootstrapNotLoaded=_useBootstrap2.fromCache;var idpConsentInfo=useIDPState({initialError:initialError,initialParams:initialParams,oauthAuthorizeStart:oauthAuthorizeStart,oauthAuthorizeSubmit:oauthAuthorizeSubmit,onError:onError,onEvent:onEvent});return/*#__PURE__*/wn.createElement(IDPConsent,Object.assign({bootstrap:bootstrap,bootstrapNotLoaded:bootstrapNotLoaded},idpConsentInfo));};var IDPLogoutScreenImpl=function IDPLogoutScreenImpl(_ref179){var initialError=_ref179.initialError,initialParams=_ref179.initialParams;var stytchClient=useStytch();var onError=useErrorCallback();var oauthLogoutStart=stytchClient.idp.oauthLogoutStart;var revokeSession=function revokeSession(){return stytchClient.session.revoke({forceClear:true});};var _useBootstrap3=useBootstrap(),bootstrap=_useBootstrap3.bootstrap,bootstrapNotLoaded=_useBootstrap3.fromCache;var idpLogoutState=useLogoutState({initialError:initialError,initialParams:initialParams,oauthLogoutStart:oauthLogoutStart,revokeSession:revokeSession,onError:onError});return/*#__PURE__*/wn.createElement(IDPLogout,Object.assign({},idpLogoutState,{bootstrap:bootstrap,bootstrapNotLoaded:bootstrapNotLoaded}));};var IDPConsentScreen=function IDPConsentScreen(){var _h$139=h$5(parseIDPParams(window.location.search)),_h$140=_slicedToArray2(_h$139,1),_h$140$=_h$140[0],flow=_h$140$.flow,error=_h$140$.error;switch(flow.type){case'Authorize':return/*#__PURE__*/wn.createElement(EnsureUserIsLoggedIn,null,/*#__PURE__*/wn.createElement(IDPConsentScreenImpl,{initialError:error,initialParams:flow.params}));case'Logout':return/*#__PURE__*/wn.createElement(IDPLogoutScreenImpl,{initialError:error,initialParams:flow.params});}};var EnsureUserIsLoggedIn=function EnsureUserIsLoggedIn(_ref180){var children=_ref180.children;var _useLingui52=useLingui(),_t=_useLingui52._;var user=useStytchUser();var onError=useErrorCallback();var onErrorRef=_$2(onError);p$5(function(){onErrorRef.current=onError;},[onError]);var stytchClient=useStytch();var authParams=useTrustedAuthTokenParams();var _h$141=h$5(false),_h$142=_slicedToArray2(_h$141,2),attesting=_h$142[0],setAttesting=_h$142[1];var _h$143=h$5(false),_h$144=_slicedToArray2(_h$143,2),attested=_h$144[0],setAttested=_h$144[1];p$5(function(){if(attesting||attested)return;var attestTrustedToken=function attestTrustedToken(authParams){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee110(){var token,profile_id,_t32;return _regenerator2().w(function(_context110){while(1)switch(_context110.p=_context110.n){case 0:if(!((authParams===null||authParams===void 0?void 0:authParams.trustedAuthToken)&&(authParams===null||authParams===void 0?void 0:authParams.tokenProfileID))){_context110.n=5;break;}setAttesting(true);token=authParams.trustedAuthToken;profile_id=authParams.tokenProfileID;if(!stytchClient.user.getSync()){_context110.n=1;break;}_context110.n=1;return stytchClient.session.revoke({forceClear:true});case 1:_context110.p=1;_context110.n=2;return stytchClient.session.attest({token:token,profile_id:profile_id,session_duration_minutes:60});case 2:_context110.n=4;break;case 3:_context110.p=3;_t32=_context110.v;onErrorRef.current(_t32);case 4:_context110.p=4;setAttesting(false);setAttested(true);return _context110.f(4);case 5:setAttested(true);case 6:return _context110.a(2);}},_callee110,null,[[1,3,4,5]]);}));};attestTrustedToken(authParams);},[authParams,attesting,attested,stytchClient]);p$5(function(){if(user)return;onErrorRef.current(new NoCurrentSessionError());},[user]);if(attesting){return/*#__PURE__*/wn.createElement(LoadingScreen,null);}else if(user){return children;}else{return/*#__PURE__*/wn.createElement(ErrorDisplay,{text:_t({id:'idpConsent.noActiveSession',message:"No active session detected. Please log in to continue."})});}};var AppContainer$1=function AppContainer$1(){var _ScreenComponentMap;var _useGlobalReducer53=useGlobalReducer(),_useGlobalReducer54=_slicedToArray2(_useGlobalReducer53,1),state=_useGlobalReducer54[0];var _Ze3=Ze(),displayWatermark=_Ze3.displayWatermark;var isOnlyFloatingOneTap=useIsOnlyFloatingOneTap();var currentScreen=state.screen;var ScreenComponentMap=(_ScreenComponentMap={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ScreenComponentMap,AppScreens$1.Main,/*#__PURE__*/wn.createElement(MainScreen,null)),AppScreens$1.PasskeyRegistrationStart,/*#__PURE__*/wn.createElement(PasskeyRegistrationStart,null)),AppScreens$1.PasskeyRegistrationSuccess,/*#__PURE__*/wn.createElement(PasskeyRegistrationSuccess,null)),AppScreens$1.PasskeyConfirmation,/*#__PURE__*/wn.createElement(PasskeyConfirmation,null)),AppScreens$1.PasswordResetForm,/*#__PURE__*/wn.createElement(ResetPasswordScreen,null)),AppScreens$1.PasswordCreateOrLogin,/*#__PURE__*/wn.createElement(Password,null)),AppScreens$1.PasswordForgot,/*#__PURE__*/wn.createElement(PasswordForgot,null)),AppScreens$1.PasswordBreached,/*#__PURE__*/wn.createElement(PasswordBreached,null)),AppScreens$1.PasswordSetNew,/*#__PURE__*/wn.createElement(PasswordSetNew,null)),AppScreens$1.PasswordDedupe,/*#__PURE__*/wn.createElement(PasswordDedupe,null)),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ScreenComponentMap,AppScreens$1.PasswordConfirmation,/*#__PURE__*/wn.createElement(PasswordConfirmation,null)),AppScreens$1.EmailConfirmation,/*#__PURE__*/wn.createElement(EmailConfirmation,null)),AppScreens$1.OTPAuthenticate,/*#__PURE__*/wn.createElement(OTPAuthenticate,null)),AppScreens$1.OTPConfirmation,/*#__PURE__*/wn.createElement(OTPConfirmation,null)),AppScreens$1.CryptoConnect,/*#__PURE__*/wn.createElement(ConnectWallet,null)),AppScreens$1.CryptoSignMessage,/*#__PURE__*/wn.createElement(SignMessage,null)),AppScreens$1.CryptoOtherScreen,/*#__PURE__*/wn.createElement(OtherCryptoWallets,null)),AppScreens$1.CryptoSetupWallet,/*#__PURE__*/wn.createElement(SetupNewWallet,null)),AppScreens$1.CryptoError,/*#__PURE__*/wn.createElement(Error$1,null)),AppScreens$1.CryptoConfirmation,/*#__PURE__*/wn.createElement(Success,null)),_defineProperty(_ScreenComponentMap,AppScreens$1.IDPConsent,/*#__PURE__*/wn.createElement(IDPConsentScreen,null)));if(isOnlyFloatingOneTap){return/*#__PURE__*/wn.createElement(GoogleOneTap,{position:OneTapPositions.floating});}return/*#__PURE__*/wn.createElement(MainContainer,{displayWatermark:displayWatermark},ScreenComponentMap[currentScreen]);};var lodash_merge={exports:{}};lodash_merge.exports;(function(module,exports){var LARGE_ARRAY_SIZE=200;var HASH_UNDEFINED='__lodash_hash_undefined__';var HOT_COUNT=800,HOT_SPAN=16;var MAX_SAFE_INTEGER=9007199254740991;var argsTag='[object Arguments]',arrayTag='[object Array]',asyncTag='[object AsyncFunction]',boolTag='[object Boolean]',dateTag='[object Date]',errorTag='[object Error]',funcTag='[object Function]',genTag='[object GeneratorFunction]',mapTag='[object Map]',numberTag='[object Number]',nullTag='[object Null]',objectTag='[object Object]',proxyTag='[object Proxy]',regexpTag='[object RegExp]',setTag='[object Set]',stringTag='[object String]',undefinedTag='[object Undefined]',weakMapTag='[object WeakMap]';var arrayBufferTag='[object ArrayBuffer]',dataViewTag='[object DataView]',float32Tag='[object Float32Array]',float64Tag='[object Float64Array]',int8Tag='[object Int8Array]',int16Tag='[object Int16Array]',int32Tag='[object Int32Array]',uint8Tag='[object Uint8Array]',uint8ClampedTag='[object Uint8ClampedArray]',uint16Tag='[object Uint16Array]',uint32Tag='[object Uint32Array]';var reRegExpChar=/[\\^$.*+?()[\]{}|]/g;var reIsHostCtor=/^\[object .+?Constructor\]$/;var reIsUint=/^(?:0|[1-9]\d*)$/;var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;var freeGlobal=_typeof2(commonjsGlobal)=='object'&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;var freeSelf=(typeof self==="undefined"?"undefined":_typeof2(self))=='object'&&self&&self.Object===Object&&self;var root=freeGlobal||freeSelf||Function('return this')();var freeExports=exports&&!exports.nodeType&&exports;var freeModule=freeExports&&'object'=='object'&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports;var freeProcess=moduleExports&&freeGlobal.process;var nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}return freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2]);}return func.apply(thisArg,args);}function baseTimes(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index);}return result;}function baseUnary(func){return function(value){return func(value);};}function getValue(object,key){return object==null?undefined:object[key];}function overArg(func,transform){return function(arg){return func(transform(arg));};}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype;var coreJsData=root['__core-js_shared__'];var funcToString=funcProto.toString;var hasOwnProperty=objectProto.hasOwnProperty;var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||'');return uid?'Symbol(src)_1.'+uid:'';}();var nativeObjectToString=objectProto.toString;var objectCtorString=funcToString.call(Object);var reIsNative=RegExp('^'+funcToString.call(hasOwnProperty).replace(reRegExpChar,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');var Buffer=moduleExports?root.Buffer:undefined,_Symbol=root.Symbol,Uint8Array=root.Uint8Array;Buffer?Buffer.allocUnsafe:undefined;var getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,symToStringTag=_Symbol?_Symbol.toStringTag:undefined;var defineProperty=function(){try{var func=getNative(Object,'defineProperty');func({},'',{});return func;}catch(e){}}();var nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeMax=Math.max,nativeNow=Date.now;var Map=getNative(root,'Map'),nativeCreate=getNative(Object,'create');var baseCreate=function(){function object(){}return function(proto){if(!isObject(proto)){return{};}if(objectCreate){return objectCreate(proto);}object.prototype=proto;var result=new object();object.prototype=undefined;return result;};}();function Hash(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};this.size=0;}function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];this.size-=result?1:0;return result;}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?undefined:result;}return hasOwnProperty.call(data,key)?data[key]:undefined;}function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==undefined:hasOwnProperty.call(data,key);}function hashSet(key,value){var data=this.__data__;this.size+=this.has(key)?0:1;data[key]=nativeCreate&&value===undefined?HASH_UNDEFINED:value;return this;}Hash.prototype.clear=hashClear;Hash.prototype['delete']=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function ListCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}function listCacheClear(){this.__data__=[];this.size=0;}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){return false;}var lastIndex=data.length-1;if(index==lastIndex){data.pop();}else{splice.call(data,index,1);}--this.size;return true;}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?undefined:data[index][1];}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1;}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}ListCache.prototype.clear=listCacheClear;ListCache.prototype['delete']=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}function mapCacheDelete(key){var result=getMapData(this,key)['delete'](key);this.size-=result?1:0;return result;}function mapCacheGet(key){return getMapData(this,key).get(key);}function mapCacheHas(key){return getMapData(this,key).has(key);}function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}MapCache.prototype.clear=mapCacheClear;MapCache.prototype['delete']=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size;}function stackClear(){this.__data__=new ListCache();this.size=0;}function stackDelete(key){var data=this.__data__,result=data['delete'](key);this.size=data.size;return result;}function stackGet(key){return this.__data__.get(key);}function stackHas(key){return this.__data__.has(key);}function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1){pairs.push([key,value]);this.size=++data.size;return this;}data=this.__data__=new MapCache(pairs);}data.set(key,value);this.size=data.size;return this;}Stack.prototype.clear=stackClear;Stack.prototype['delete']=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value){if(!(skipIndexes&&(key=='length'||isBuff&&(key=='offset'||key=='parent')||isType&&(key=='buffer'||key=='byteLength'||key=='byteOffset')||isIndex(key,length)))){result.push(key);}}return result;}function assignMergeValue(object,key,value){if(value!==undefined&&!eq(object[key],value)||value===undefined&&!(key in object)){baseAssignValue(object,key,value);}}function assignValue(object,key,value){var objValue=object[key];if(!(hasOwnProperty.call(object,key)&&eq(objValue,value))||value===undefined&&!(key in object)){baseAssignValue(object,key,value);}}function assocIndexOf(array,key){var length=array.length;while(length--){if(eq(array[length][0],key)){return length;}}return-1;}function baseAssignValue(object,key,value){if(key=='__proto__'&&defineProperty){defineProperty(object,key,{'configurable':true,'enumerable':true,'value':value,'writable':true});}else{object[key]=value;}}var baseFor=createBaseFor();function baseGetTag(value){if(value==null){return value===undefined?undefinedTag:nullTag;}return symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value);}function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag;}function baseIsNative(value){if(!isObject(value)||isMasked(value)){return false;}var pattern=isFunction(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value));}function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)];}function baseKeysIn(object){if(!isObject(object)){return nativeKeysIn(object);}var isProto=isPrototype(object),result=[];for(var key in object){if(!(key=='constructor'&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key);}}return result;}function baseMerge(object,source,srcIndex,customizer,stack){if(object===source){return;}baseFor(source,function(srcValue,key){stack||(stack=new Stack());if(isObject(srcValue)){baseMergeDeep(object,source,key,srcIndex,baseMerge,customizer,stack);}else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+'',object,source,stack):undefined;if(newValue===undefined){newValue=srcValue;}assignMergeValue(object,key,newValue);}},keysIn);}function baseMergeDeep(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked){assignMergeValue(object,key,stacked);return;}var newValue=customizer?customizer(objValue,srcValue,key+'',object,source,stack):undefined;var isCommon=newValue===undefined;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue;if(isArr||isBuff||isTyped){if(isArray(objValue)){newValue=objValue;}else if(isArrayLikeObject(objValue)){newValue=copyArray(objValue);}else if(isBuff){isCommon=false;newValue=cloneBuffer(srcValue);}else if(isTyped){isCommon=false;newValue=cloneTypedArray(srcValue);}else{newValue=[];}}else if(isPlainObject(srcValue)||isArguments(srcValue)){newValue=objValue;if(isArguments(objValue)){newValue=toPlainObject(objValue);}else if(!isObject(objValue)||isFunction(objValue)){newValue=initCloneObject(srcValue);}}else{isCommon=false;}}if(isCommon){stack.set(srcValue,newValue);mergeFunc(newValue,srcValue,srcIndex,customizer,stack);stack['delete'](srcValue);}assignMergeValue(object,key,newValue);}function baseRest(func,start){return setToString(overRest(func,start,identity),func+'');}var baseSetToString=!defineProperty?identity:function(func,string){return defineProperty(func,'toString',{'configurable':true,'enumerable':false,'value':constant(string),'writable':true});};function cloneBuffer(buffer,isDeep){{return buffer.slice();}}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}function cloneTypedArray(typedArray,isDeep){var buffer=cloneArrayBuffer(typedArray.buffer);return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length);}function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index];}return array;}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});var index=-1,length=props.length;while(++index<length){var key=props[index];var newValue=undefined;if(newValue===undefined){newValue=source[key];}if(isNew){baseAssignValue(object,key,newValue);}else{assignValue(object,key,newValue);}}return object;}function createAssigner(assigner){return baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;customizer=assigner.length>3&&typeof customizer=='function'?(length--,customizer):undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1;}object=Object(object);while(++index<length){var source=sources[index];if(source){assigner(object,source,index,customizer);}}return object;});}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;while(length--){var key=props[++index];if(iteratee(iterable[key],key,iterable)===false){break;}}return object;};}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=='string'?'string':'hash']:data.map;}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:undefined;}function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=undefined;var unmasked=true;}catch(e){}var result=nativeObjectToString.call(value);if(unmasked){if(isOwn){value[symToStringTag]=tag;}else{delete value[symToStringTag];}}return result;}function initCloneObject(object){return typeof object.constructor=='function'&&!isPrototype(object)?baseCreate(getPrototype(object)):{};}function isIndex(value,length){var type=_typeof2(value);length=length==null?MAX_SAFE_INTEGER:length;return!!length&&(type=='number'||type!='symbol'&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}function isIterateeCall(value,index,object){if(!isObject(object)){return false;}var type=_typeof2(index);if(type=='number'?isArrayLike(object)&&isIndex(index,object.length):type=='string'&&index in object){return eq(object[index],value);}return false;}function isKeyable(value){var type=_typeof2(value);return type=='string'||type=='number'||type=='symbol'||type=='boolean'?value!=='__proto__':value===null;}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func;}function isPrototype(value){var Ctor=value&&value.constructor,proto=typeof Ctor=='function'&&Ctor.prototype||objectProto;return value===proto;}function nativeKeysIn(object){var result=[];if(object!=null){for(var key in Object(object)){result.push(key);}}return result;}function objectToString(value){return nativeObjectToString.call(value);}function overRest(func,start,transform){start=nativeMax(start===undefined?func.length-1:start,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);while(++index<length){array[index]=args[start+index];}index=-1;var otherArgs=Array(start+1);while(++index<start){otherArgs[index]=args[index];}otherArgs[start]=transform(array);return apply(func,this,otherArgs);};}function safeGet(object,key){if(key==='constructor'&&typeof object[key]==='function'){return;}if(key=='__proto__'){return;}return object[key];}var setToString=shortOut(baseSetToString);function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=HOT_SPAN-(stamp-lastCalled);lastCalled=stamp;if(remaining>0){if(++count>=HOT_COUNT){return arguments[0];}}else{count=0;}return func.apply(undefined,arguments);};}function toSource(func){if(func!=null){try{return funcToString.call(func);}catch(e){}try{return func+'';}catch(e){}}return'';}function eq(value,other){return value===other||value!==value&&other!==other;}var isArguments=baseIsArguments(function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');};var isArray=Array.isArray;function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value);}var isBuffer=nativeIsBuffer||stubFalse;function isFunction(value){if(!isObject(value)){return false;}var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag;}function isLength(value){return typeof value=='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}function isObject(value){var type=_typeof2(value);return value!=null&&(type=='object'||type=='function');}function isObjectLike(value){return value!=null&&_typeof2(value)=='object';}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag){return false;}var proto=getPrototype(value);if(proto===null){return true;}var Ctor=hasOwnProperty.call(proto,'constructor')&&proto.constructor;return typeof Ctor=='function'&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString;}var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;function toPlainObject(value){return copyObject(value,keysIn(value));}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeysIn(object);}var merge=createAssigner(function(object,source,srcIndex){baseMerge(object,source,srcIndex);});function constant(value){return function(){return value;};}function identity(value){return value;}function stubFalse(){return false;}module.exports=merge;})(lodash_merge,lodash_merge.exports);var lodash_mergeExports=lodash_merge.exports;var merge=/*@__PURE__*/getDefaultExportFromCjs(lodash_mergeExports);var defaultDisabledTextColor='#8296A1';var createTheme=function createTheme(styles){var displayWatermark=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var _a,_b,_c,_d,_e;var styleConfig=merge({},DEFAULT_STYLE_CONFIG,styles);var fontFamily=styleConfig.fontFamily,colors=styleConfig.colors,container=styleConfig.container,buttons=styleConfig.buttons,inputs=styleConfig.inputs;return{typography:{fontFamily:fontFamily,header:{fontFamily:fontFamily,fontSize:24,fontWeight:600,lineHeight:'30px'},body:{fontFamily:fontFamily,fontSize:16,fontWeight:'normal',lineHeight:'21px'},helper:{fontFamily:fontFamily,fontSize:14,fontWeight:'400',lineHeight:'20px',whiteSpace:'pre-wrap'}},colors:{primary:colors.primary,secondary:colors.secondary,success:colors.success,warning:colors.warning,error:colors.error,accent:colors.accent,disabled:'#F3F5F6',disabledText:defaultDisabledTextColor},container:{width:container.width,border:"1px solid ".concat(container.borderColor),borderRadius:container.borderRadius,backgroundColor:container.backgroundColor},buttons:{primary:{backgroundColor:buttons.primary.backgroundColor,textColor:buttons.primary.textColor,border:"1px solid ".concat(buttons.primary.borderColor),borderRadius:buttons.primary.borderRadius},secondary:{backgroundColor:buttons.secondary.backgroundColor,textColor:buttons.secondary.textColor,border:"1px solid ".concat(buttons.secondary.borderColor),borderRadius:buttons.secondary.borderRadius},disabled:{textColor:buttons.disabled.textColor,backgroundColor:buttons.disabled.backgroundColor,border:"1px solid ".concat(buttons.disabled.borderColor),borderRadius:buttons.disabled.borderRadius}},inputs:{backgroundColor:(_a=inputs===null||inputs===void 0?void 0:inputs.backgroundColor)!==null&&_a!==void 0?_a:'transparent',textColor:(_b=inputs===null||inputs===void 0?void 0:inputs.textColor)!==null&&_b!==void 0?_b:colors.primary,borderColor:(_c=inputs===null||inputs===void 0?void 0:inputs.borderColor)!==null&&_c!==void 0?_c:colors.primary,borderRadius:(_d=inputs===null||inputs===void 0?void 0:inputs.borderRadius)!==null&&_d!==void 0?_d:'4px',placeholderColor:(_e=inputs===null||inputs===void 0?void 0:inputs.placeholderColor)!==null&&_e!==void 0?_e:defaultDisabledTextColor},displayHeader:!styleConfig.hideHeaderText,displayWatermark:displayWatermark,logo:{logoImageUrl:styleConfig.logo.logoImageUrl}};};var useTheme=function useTheme(_ref181){var styles=_ref181.styles,displayWatermark=_ref181.displayWatermark;return F$4(function(){return createTheme(styles,displayWatermark);},[styles,displayWatermark]);};var AppContainer=function AppContainer(_ref182){var client=_ref182.client,config=_ref182.config,styles=_ref182.styles,callbacks=_ref182.callbacks,strings=_ref182.strings;var _h$145=h$5(function(){var _readB2CInternals$boo2=readB2CInternals(client).bootstrap.getSync(),displayWatermark=_readB2CInternals$boo2.displayWatermark;return displayWatermark;}),_h$146=_slicedToArray2(_h$145,2),displayWatermark=_h$146[0],setDisplayWatermark=_h$146[1];p$5(function(){readB2CInternals(client).bootstrap.getAsync().then(function(data){readB2CInternals(client).networkClient.logEvent({name:'render_login_screen',details:{options:config,bootstrap:data}});setDisplayWatermark(data.displayWatermark);});},[client]);var theme=useTheme({styles:styles,displayWatermark:displayWatermark});return/*#__PURE__*/wn.createElement(GlobalContextProvider,{client:client,config:config,callbacks:callbacks},/*#__PURE__*/wn.createElement(Fe,{theme:theme},/*#__PURE__*/wn.createElement(I18nProviderWrapper,{messages:messages,overrides:strings},/*#__PURE__*/wn.createElement(AppContainer$1,null))));};var ResetPasswordContainer=function ResetPasswordContainer(_ref183){var client=_ref183.client,config=_ref183.config,styles=_ref183.styles,callbacks=_ref183.callbacks,strings=_ref183.strings,passwordResetToken=_ref183.passwordResetToken;var _h$147=h$5(function(){var _readB2CInternals$boo3=readB2CInternals(client).bootstrap.getSync(),displayWatermark=_readB2CInternals$boo3.displayWatermark;return displayWatermark;}),_h$148=_slicedToArray2(_h$147,2),displayWatermark=_h$148[0],setDisplayWatermark=_h$148[1];var initialState=Object.assign(Object.assign({},DEFAULT_STATE),{screen:AppScreens$1.PasswordResetForm,formState:Object.assign(Object.assign({},DEFAULT_STATE.formState),{resetPasswordState:{token:passwordResetToken}})});p$5(function(){readB2CInternals(client).bootstrap.getAsync().then(function(_ref184){var displayWatermark=_ref184.displayWatermark;setDisplayWatermark(displayWatermark);});},[client]);var theme=useTheme({styles:styles,displayWatermark:displayWatermark});return/*#__PURE__*/wn.createElement(GlobalContextProvider,{client:client,config:config,callbacks:callbacks,initialState:initialState},/*#__PURE__*/wn.createElement(Fe,{theme:theme},/*#__PURE__*/wn.createElement(I18nProviderWrapper,{messages:messages,overrides:strings},/*#__PURE__*/wn.createElement(AppContainer$1,null))));};var PasskeyRegistrationContainer=function PasskeyRegistrationContainer(_ref185){var client=_ref185.client,config=_ref185.config,styles=_ref185.styles,callbacks=_ref185.callbacks,strings=_ref185.strings;var _h$149=h$5(function(){var _readB2CInternals$boo4=readB2CInternals(client).bootstrap.getSync(),displayWatermark=_readB2CInternals$boo4.displayWatermark;return displayWatermark;}),_h$150=_slicedToArray2(_h$149,2),displayWatermark=_h$150[0],setDisplayWatermark=_h$150[1];var initialState=Object.assign(Object.assign({},DEFAULT_STATE),{screen:AppScreens$1.PasskeyRegistrationStart,formState:Object.assign({},DEFAULT_STATE.formState)});p$5(function(){readB2CInternals(client).bootstrap.getAsync().then(function(_ref186){var displayWatermark=_ref186.displayWatermark;setDisplayWatermark(displayWatermark);});},[client]);var theme=useTheme({styles:styles,displayWatermark:displayWatermark});return/*#__PURE__*/wn.createElement(GlobalContextProvider,{client:client,config:config,callbacks:callbacks,initialState:initialState},/*#__PURE__*/wn.createElement(Fe,{theme:theme},/*#__PURE__*/wn.createElement(I18nProviderWrapper,{messages:messages,overrides:strings},/*#__PURE__*/wn.createElement(AppContainer$1,null))));};var IDPContainer=function IDPContainer(_ref187){var client=_ref187.client,styles=_ref187.styles,callbacks=_ref187.callbacks,strings=_ref187.strings,getIDPConsentManifest=_ref187.getIDPConsentManifest,authTokenParams=_ref187.authTokenParams;var initialState=Object.assign(Object.assign({},DEFAULT_STATE),{screen:AppScreens$1.IDPConsent});var theme=useTheme({styles:styles,displayWatermark:false});p$5(function(){readB2CInternals(client).bootstrap.getAsync().then(function(data){readB2CInternals(client).networkClient.logEvent({name:'render_idp_screen',details:{bootstrap:data}});});},[client]);return/*#__PURE__*/wn.createElement(GlobalContextProvider,{client:client,config:DEFAULT_CONFIG,callbacks:callbacks,initialState:initialState},/*#__PURE__*/wn.createElement(IDPContextProvider,{consentManifestGenerator:getIDPConsentManifest,authTokenParams:authTokenParams},/*#__PURE__*/wn.createElement(Fe,{theme:theme},/*#__PURE__*/wn.createElement(I18nProviderWrapper,{messages:messages,overrides:strings},/*#__PURE__*/wn.createElement(AppContainer$1,null)))));};var UI_SCREEN_WEB_COMPONENT_NAME='stytch-ui';var UI_RESET_PASSWORD_WEB_COMPONENT_NAME='stytch-reset-password';var UI_PASSKEY_REGISTRATION_WEB_COMPONENT_NAME='stytch-passkey-registration';var UI_IDP_WEB_COMPONENT_NAME='stytch-identity-provider';var UILoginComponent=CreateSSRSafeWebComponent(AppContainer,UI_SCREEN_WEB_COMPONENT_NAME);var UIResetPasswordComponent=CreateSSRSafeWebComponent(ResetPasswordContainer,UI_RESET_PASSWORD_WEB_COMPONENT_NAME);var UIPasskeyRegistrationComponent=CreateSSRSafeWebComponent(PasskeyRegistrationContainer,UI_PASSKEY_REGISTRATION_WEB_COMPONENT_NAME);var UIIdentityProviderComponent=CreateSSRSafeWebComponent(IDPContainer,UI_IDP_WEB_COMPONENT_NAME);var StytchUIClient=/*#__PURE__*/function(_StytchHeadlessClient){function StytchUIClient(){_classCallCheck2(this,StytchUIClient);checkNotSSR('StytchUIClient');for(var _len10=arguments.length,args=new Array(_len10),_key10=0;_key10<_len10;_key10++){args[_key10]=arguments[_key10];}return _callSuper2(this,StytchUIClient,[].concat(args));}_inherits2(StytchUIClient,_StytchHeadlessClient);return _createClass2(StytchUIClient,[{key:"mountLogin",value:function mountLogin(_ref188){var elementId=_ref188.elementId,config=_ref188.config,styles=_ref188.styles,callbacks=_ref188.callbacks,strings=_ref188.strings;var _a;var targetParentDomNode=document.querySelector(elementId);if(!targetParentDomNode){throw new Error("The selector you specified (".concat(elementId,") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin()."));}if(((_a=targetParentDomNode.firstChild)===null||_a===void 0?void 0:_a.nodeName.toLowerCase())===UI_SCREEN_WEB_COMPONENT_NAME.toLowerCase()){var node=targetParentDomNode.firstChild;node.render({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings});return;}var loginElement=UILoginComponent({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings});targetParentDomNode.appendChild(loginElement);}},{key:"mountResetPassword",value:function mountResetPassword(_ref189){var elementId=_ref189.elementId,config=_ref189.config,styles=_ref189.styles,callbacks=_ref189.callbacks,strings=_ref189.strings,passwordResetToken=_ref189.passwordResetToken;var _a;var targetParentDomNode=document.querySelector(elementId);if(!targetParentDomNode){throw new Error("The selector you specified (".concat(elementId,") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin()."));}if(((_a=targetParentDomNode.firstChild)===null||_a===void 0?void 0:_a.nodeName.toLowerCase())===UI_RESET_PASSWORD_WEB_COMPONENT_NAME.toLowerCase()){var node=targetParentDomNode.firstChild;node.render({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings,passwordResetToken:passwordResetToken});return;}var loginElement=UIResetPasswordComponent({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings,passwordResetToken:passwordResetToken});targetParentDomNode.appendChild(loginElement);}},{key:"mountPasskeyRegistration",value:function mountPasskeyRegistration(_ref190){var elementId=_ref190.elementId,config=_ref190.config,styles=_ref190.styles,callbacks=_ref190.callbacks,strings=_ref190.strings;var _a;var targetParentDomNode=document.querySelector(elementId);if(!targetParentDomNode){throw new Error("The selector you specified (".concat(elementId,") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountPasskeyRegistration()."));}if(((_a=targetParentDomNode.firstChild)===null||_a===void 0?void 0:_a.nodeName.toLowerCase())===UI_PASSKEY_REGISTRATION_WEB_COMPONENT_NAME.toLowerCase()){var node=targetParentDomNode.firstChild;node.render({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings});return;}var passkeyRegistrationElement=UIPasskeyRegistrationComponent({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings});targetParentDomNode.appendChild(passkeyRegistrationElement);}},{key:"mountIdentityProvider",value:function mountIdentityProvider(_ref191){var elementId=_ref191.elementId,styles=_ref191.styles,callbacks=_ref191.callbacks,strings=_ref191.strings,getIDPConsentManifest=_ref191.getIDPConsentManifest,authTokenParams=_ref191.authTokenParams;var _a;var targetParentDomNode=document.querySelector(elementId);if(!targetParentDomNode){throw new Error("The selector you specified (".concat(elementId,") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountIdentityProvider()."));}if(((_a=targetParentDomNode.firstChild)===null||_a===void 0?void 0:_a.nodeName.toLowerCase())===UI_IDP_WEB_COMPONENT_NAME.toLowerCase()){var node=targetParentDomNode.firstChild;node.render({client:this,callbacks:callbacks,styles:styles,strings:strings,getIDPConsentManifest:getIDPConsentManifest,authTokenParams:authTokenParams});return;}var idpElement=UIIdentityProviderComponent({client:this,callbacks:callbacks,styles:styles,strings:strings,getIDPConsentManifest:getIDPConsentManifest,authTokenParams:authTokenParams});targetParentDomNode.appendChild(idpElement);}}]);}(StytchHeadlessClient);export{AuthFlowType,B2BMFAProducts,B2BOAuthProviders,B2BProducts,BiometricRegistrationIdIsNullOrBlank,BiometricsAlreadyEnrolledError,BiometricsFailedError,BiometricsUnavailableError,ChallengeSigningFailedError,DFPNotConfigured,DeviceCredentialsNotAllowedError,FailedCodeChallengeError,FailedToDecryptDataError,IDPOAuthFlowMissingParamError,InternalError,InvalidAuthorizationCredentialError,InvalidCredentialTypeError,InvalidPrivateKeyLength,InvalidRedirectSchemeError,InvalidStartUrlError,JSONDataNotConvertibleToStringError,KeyInvalidatedError,KeystoreUnavailableError,MissingAttestationObjectError,MissingAuthorizationCredentialIDTokenError,MissingCipherIv,MissingGoogleClientIDError,MissingPKCEError,MissingPublicKeyError,MissingUrlError,NoBiometricsEnrolledError,NoBiometricsRegistrationError,NoCredentialsPresentError,NoCurrentSessionError,OAuthProviders,OTPMethods,OneTapPositions,PasskeysInvalidEncoding,PasskeysMisconfigured,PasskeysUnsupportedError,Products,RNUIProducts,RandomNumberGenerationFailed,RedirectURLType,SDKAPIUnreachableError,SDKNotConfiguredError,SignInWithAppleMisconfigured,StytchAPIError,StytchAPISchemaError,StytchAPIUnreachableError,StytchError,StytchEventType,StytchSDKAPIError,StytchSDKError,StytchSDKSchemaError,StytchSDKUsageError,StytchUIClient,UNRECOVERABLE_ERROR_TYPES,UserCancellationError,UserLockedOutError,Wallets,errorToStytchError,parseOAuthAuthorizeParams,parseOAuthLogoutParams};
1
+ var _templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject0,_templateObject1,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_providerInfo,_templateObject14,_templateObject15,_templateObject16,_templateObject17,_templateObject18,_templateObject19,_templateObject20,_templateObject21,_templateObject22,_templateObject23,_templateObject24,_templateObject25,_templateObject26,_templateObject27,_templateObject28,_templateObject29,_templateObject30,_templateObject31,_templateObject32,_templateObject33,_templateObject34,_templateObject35,_templateObject36,_templateObject37,_templateObject38,_templateObject39,_templateObject40,_templateObject41,_templateObject42,_templateObject43,_templateObject44,_templateObject45,_templateObject46,_templateObject47,_templateObject48,_templateObject49,_templateObject50,_templateObject51,_templateObject52,_templateObject53,_templateObject54,_templateObject55,_templateObject56,_templateObject57,_templateObject58,_templateObject59,_templateObject60,_templateObject61,_templateObject62,_templateObject63,_templateObject64,_templateObject65,_templateObject66,_templateObject67,_templateObject68,_templateObject69,_templateObject70,_templateObject71,_templateObject72,_templateObject73,_templateObject74,_templateObject75,_templateObject76,_templateObject77,_templateObject78,_templateObject79,_templateObject80,_templateObject81,_templateObject82,_templateObject83;var _excluded=["offset"],_excluded2=["children"],_excluded3=["children"],_excluded4=["asChild"],_excluded5=["scope","children"],_excluded6=["scope","children"],_excluded7=["__scopeRovingFocusGroup","orientation","dir","loop","currentTabStopId","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus"],_excluded8=["__scopeRovingFocusGroup","focusable","active"],_excluded9=["__scopeTabs","value","onValueChange","defaultValue","orientation","dir","activationMode"],_excluded0=["__scopeTabs","loop"],_excluded1=["__scopeTabs","value","disabled"],_excluded10=["__scopeTabs","value","children"];function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _wrapNativeSuper2(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper2=function _wrapNativeSuper2(t){if(null===t||!_isNativeFunction2(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct2(t,arguments,_getPrototypeOf2(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf2(Wrapper,t);},_wrapNativeSuper2(t);}function _construct2(t,e,r){if(_isNativeReflectConstruct2())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf2(p,r.prototype),p;}function _isNativeFunction2(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _createForOfIteratorHelper2(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray2(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n6=0,F=function F(){};return{s:F,n:function n(){return _n6>=r.length?{done:!0}:{done:!1,value:r[_n6++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _defineProperty(e,r,t){return(r=_toPropertyKey2(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _slicedToArray2(r,e){return _arrayWithHoles2(r)||_iterableToArrayLimit2(r,e)||_unsupportedIterableToArray2(r,e)||_nonIterableRest2();}function _nonIterableRest2(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit2(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles2(r){if(Array.isArray(r))return r;}function _toConsumableArray2(r){return _arrayWithoutHoles2(r)||_iterableToArray2(r)||_unsupportedIterableToArray2(r)||_nonIterableSpread2();}function _nonIterableSpread2(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray2(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray2(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray2(r,a):void 0;}}function _iterableToArray2(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles2(r){if(Array.isArray(r))return _arrayLikeToArray2(r);}function _arrayLikeToArray2(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _callSuper2(t,o,e){return o=_getPrototypeOf2(o),_possibleConstructorReturn2(t,_isNativeReflectConstruct2()?Reflect.construct(o,e||[],_getPrototypeOf2(t).constructor):o.apply(t,e));}function _possibleConstructorReturn2(t,e){if(e&&("object"==_typeof2(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized2(t);}function _assertThisInitialized2(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct2=function _isNativeReflectConstruct2(){return!!t;})();}function _getPrototypeOf2(t){return _getPrototypeOf2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf2(t);}function _inherits2(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf2(t,e);}function _setPrototypeOf2(t,e){return _setPrototypeOf2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf2(t,e);}function _regenerator2(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine4(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine4(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine4(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine4(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine4(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine4(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine4(u),_regeneratorDefine4(u,o,"Generator"),_regeneratorDefine4(u,n,function(){return this;}),_regeneratorDefine4(u,"toString",function(){return"[object Generator]";}),(_regenerator2=function _regenerator2(){return{w:i,m:f};})();}function _regeneratorDefine4(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine4=function _regeneratorDefine3(e,r,n,t){function o(r,n){_regeneratorDefine4(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine4(e,r,n,t);}function _typeof2(o){"@babel/helpers - typeof";return _typeof2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof2(o);}function _classCallCheck2(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function __defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey2(o.key),o);}}function _createClass2(e,r,t){return r&&__defineProperties(e.prototype,r),t&&__defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey2(t){var i=_toPrimitive2(t,"string");return"symbol"==_typeof2(i)?i:i+"";}function _toPrimitive2(t,r){if("object"!=_typeof2(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof2(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function __rest$1(s,e){var t={};for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0)t[p]=s[p];if(s!=null&&typeof Object.getOwnPropertySymbols==="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++){if(e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i]))t[p[i]]=s[p[i]];}return t;}function __awaiter$1(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}}function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e);}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);}step((generator=generator.apply(thisArg,[])).next());});}typeof SuppressedError==="function"?SuppressedError:function(error,suppressed,message){var e=new Error(message);return e.name="SuppressedError",e.error=error,e.suppressed=suppressed,e;};function _typeof$1(o){"@babel/helpers - typeof";return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof$1(o);}function _defineProperties$1(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey$1(o.key),o);}}function _createClass$1(e,r,t){return r&&_defineProperties$1(e.prototype,r),t&&_defineProperties$1(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey$1(t){var i=_toPrimitive$1(t,"string");return"symbol"==_typeof$1(i)?i:i+"";}function _toPrimitive$1(t,r){if("object"!=_typeof$1(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r);if("object"!=_typeof$1(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return String(t);}function _classCallCheck$1(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _callSuper$1(t,o,e){return o=_getPrototypeOf$1(o),_possibleConstructorReturn$1(t,_isNativeReflectConstruct$1()?Reflect.construct(o,e||[],_getPrototypeOf$1(t).constructor):o.apply(t,e));}function _possibleConstructorReturn$1(t,e){if(e&&("object"==_typeof$1(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(t);}function _assertThisInitialized$1(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _inherits$1(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf$1(t,e);}function _wrapNativeSuper$1(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper$1=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction$1(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct$1(t,arguments,_getPrototypeOf$1(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf$1(Wrapper,t);},_wrapNativeSuper$1(t);}function _construct$1(t,e,r){if(_isNativeReflectConstruct$1())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf$1(p,r.prototype),p;}function _isNativeReflectConstruct$1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct$1=function _isNativeReflectConstruct(){return!!t;})();}function _isNativeFunction$1(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _setPrototypeOf$1(t,e){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf$1(t,e);}function _getPrototypeOf$1(t){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf$1(t);}var Products;(function(Products){Products["emailMagicLinks"]="emailMagicLinks";Products["oauth"]="oauth";Products["otp"]="otp";Products["crypto"]="crypto";Products["passwords"]="passwords";Products["passkeys"]="passkeys";})(Products||(Products={}));var OAuthProviders;(function(OAuthProviders){OAuthProviders["Google"]="google";OAuthProviders["Microsoft"]="microsoft";OAuthProviders["Apple"]="apple";OAuthProviders["Github"]="github";OAuthProviders["GitLab"]="gitlab";OAuthProviders["Facebook"]="facebook";OAuthProviders["Discord"]="discord";OAuthProviders["Salesforce"]="salesforce";OAuthProviders["Slack"]="slack";OAuthProviders["Amazon"]="amazon";OAuthProviders["Bitbucket"]="bitbucket";OAuthProviders["LinkedIn"]="linkedin";OAuthProviders["Coinbase"]="coinbase";OAuthProviders["Twitch"]="twitch";OAuthProviders["Twitter"]="twitter";OAuthProviders["TikTok"]="tiktok";OAuthProviders["Snapchat"]="snapchat";OAuthProviders["Figma"]="figma";OAuthProviders["Yahoo"]="yahoo";})(OAuthProviders||(OAuthProviders={}));var Wallets;(function(Wallets){Wallets["Vessel"]="Vessel";Wallets["Phantom"]="Phantom";Wallets["Metamask"]="Metamask";Wallets["Coinbase"]="Coinbase";Wallets["Binance"]="Binance";Wallets["GenericEthereumWallet"]="Other Ethereum Wallet";Wallets["GenericSolanaWallet"]="Other Solana Wallet";})(Wallets||(Wallets={}));var OneTapPositions;(function(OneTapPositions){OneTapPositions["embedded"]="embedded";OneTapPositions["floating"]="floating";OneTapPositions["embeddedOnly"]="embeddedOnly";OneTapPositions["floatingOrEmbedded"]="floatingOrEmbedded";OneTapPositions["forceLegacyEmbedded"]="forceLegacyEmbedded";})(OneTapPositions||(OneTapPositions={}));var OTPMethods;(function(OTPMethods){OTPMethods["SMS"]="sms";OTPMethods["WhatsApp"]="whatsapp";OTPMethods["Email"]="email";})(OTPMethods||(OTPMethods={}));var StytchEventType;(function(StytchEventType){StytchEventType["MagicLinkLoginOrCreateEvent"]="MAGIC_LINK_LOGIN_OR_CREATE";StytchEventType["OTPsLoginOrCreateEvent"]="OTP_LOGIN_OR_CREATE";StytchEventType["OTPsAuthenticate"]="OTP_AUTHENTICATE";StytchEventType["CryptoWalletAuthenticateStart"]="CRYPTO_WALLET_AUTHENTICATE_START";StytchEventType["CryptoWalletAuthenticate"]="CRYPTO_WALLET_AUTHENTICATE";StytchEventType["PasswordCreate"]="PASSWORD_CREATE";StytchEventType["PasswordAuthenticate"]="PASSWORD_AUTHENTICATE";StytchEventType["PasswordResetByEmailStart"]="PASSWORD_RESET_BY_EMAIL_START";StytchEventType["PasswordResetByEmail"]="PASSWORD_RESET_BY_EMAIL";StytchEventType["PasskeyRegister"]="PASSKEY_REGISTER";StytchEventType["PasskeyAuthenticate"]="PASSKEY_AUTHENTICATE";StytchEventType["PasskeySkip"]="PASSKEY_SKIP";StytchEventType["PasskeyDone"]="PASSKEY_DONE";StytchEventType["AuthenticateFlowComplete"]="AUTHENTICATE_FLOW_COMPLETE";StytchEventType["OAuthAuthorizeFlowStart"]="OAUTH_AUTHORIZE_FLOW_START";StytchEventType["OAuthAuthorizeFlowComplete"]="OAUTH_AUTHORIZE_FLOW_COMPLETE";StytchEventType["OAuthAuthorizeFlowConsentDenied"]="OAUTH_AUTHORIZE_FLOW_CONSENT_DENIED";StytchEventType["B2BMagicLinkEmailLoginOrSignup"]="B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP";StytchEventType["B2BMagicLinkAuthenticate"]="B2B_MAGIC_LINK_AUTHENTICATE";StytchEventType["B2BMagicLinkEmailDiscoverySend"]="B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND";StytchEventType["B2BMagicLinkDiscoveryAuthenticate"]="B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE";StytchEventType["B2BSSOStart"]="B2B_SSO_START";StytchEventType["B2BSSOAuthenticate"]="B2B_SSO_AUTHENTICATE";StytchEventType["B2BSSODiscoverConnections"]="B2B_SSO_DISCOVER_CONNECTIONS";StytchEventType["B2BOAuthAuthenticate"]="B2B_OAUTH_AUTHENTICATE";StytchEventType["B2BOAuthDiscoveryAuthenticate"]="B2B_OAUTH_DISCOVERY_AUTHENTICATE";StytchEventType["B2BDiscoveryOrganizationsCreate"]="B2B_DISCOVERY_ORGANIZATIONS_CREATE";StytchEventType["B2BDiscoveryIntermediateSessionExchange"]="B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE";StytchEventType["B2BPasswordAuthenticate"]="B2B_PASSWORD_AUTHENTICATE";StytchEventType["B2BPasswordDiscoveryAuthenticate"]="B2B_PASSWORD_DISCOVERY_AUTHENTICATE";StytchEventType["B2BPasswordResetByEmailStart"]="B2B_PASSWORD_RESET_BY_EMAIL_START";StytchEventType["B2BPasswordResetByEmail"]="B2B_PASSWORD_RESET_BY_EMAIL";StytchEventType["B2BPasswordResetBySession"]="B2B_PASSWORD_RESET_BY_SESSION";StytchEventType["B2BSMSOTPSend"]="B2B_SMS_OTP_SEND";StytchEventType["B2BSMSOTPAuthenticate"]="B2B_SMS_OTP_AUTHENTICATE";StytchEventType["B2BTOTPCreate"]="B2B_TOTP_CREATE";StytchEventType["B2BTOTPAuthenticate"]="B2B_TOTP_AUTHENTICATE";StytchEventType["B2BRecoveryCodesRecover"]="B2B_RECOVERY_CODES_RECOVER";StytchEventType["B2BPasswordDiscoveryResetStart"]="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL_START";StytchEventType["B2BDiscoveryPasswordReset"]="B2B_PASSWORD_DISCOVERY_RESET_BY_EMAIL";StytchEventType["B2BImpersonationAuthenticate"]="B2B_IMPERSONATION_AUTHENTICATE";StytchEventType["B2BOTPsEmailAuthenticate"]="B2B_OTPS_EMAIL_AUTHENTICATE";StytchEventType["B2BOTPsEmailDiscoveryAuthenticate"]="B2B_OTPS_EMAIL_DISCOVERY_AUTHENTICATE";StytchEventType["B2BOTPsEmailDiscoverySend"]="B2B_OTPS_EMAIL_DISCOVERY_SEND";StytchEventType["B2BOTPsEmailLoginOrSignup"]="B2B_OTPS_EMAIL_LOGIN_OR_SIGNUP";StytchEventType["B2BOrganizationsGetBySlug"]="B2B_ORGANIZATIONS_GET_BY_SLUG";})(StytchEventType||(StytchEventType={}));var RNUIProducts;(function(RNUIProducts){RNUIProducts[RNUIProducts["emailMagicLinks"]=0]="emailMagicLinks";RNUIProducts[RNUIProducts["oauth"]=1]="oauth";RNUIProducts[RNUIProducts["otp"]=2]="otp";RNUIProducts[RNUIProducts["passwords"]=3]="passwords";})(RNUIProducts||(RNUIProducts={}));var SDKAPIUnreachableError=/*#__PURE__*/function(_Error){function SDKAPIUnreachableError(message,details){var _this;_classCallCheck$1(this,SDKAPIUnreachableError);_this=_callSuper$1(this,SDKAPIUnreachableError,[message+'\n'+details]);_this.message=message+'\n'+details;_this.name='SDKAPIUnreachableError';_this.details=details;Object.setPrototypeOf(_this,SDKAPIUnreachableError.prototype);return _this;}_inherits$1(SDKAPIUnreachableError,_Error);return _createClass$1(SDKAPIUnreachableError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var StytchSDKUsageError=/*#__PURE__*/function(_Error2){function StytchSDKUsageError(methodName,message){var _this2;_classCallCheck$1(this,StytchSDKUsageError);_this2=_callSuper$1(this,StytchSDKUsageError);_this2.name='StytchSDKUsageError';_this2.message="Invalid call to ".concat(methodName,"\n")+message;return _this2;}_inherits$1(StytchSDKUsageError,_Error2);return _createClass$1(StytchSDKUsageError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var StytchSDKSchemaError=/*#__PURE__*/function(_Error3){function StytchSDKSchemaError(schemaError){var _this3;_classCallCheck$1(this,StytchSDKSchemaError);var _a;_this3=_callSuper$1(this,StytchSDKSchemaError);_this3.name='StytchSDKSchemaError';var messages=(_a=schemaError.body)===null||_a===void 0?void 0:_a.map(function(err){return"".concat(err.dataPath,": ").concat(err.message);}).join('\n');_this3.message="[400] Request does not match expected schema\n".concat(messages);return _this3;}_inherits$1(StytchSDKSchemaError,_Error3);return _createClass$1(StytchSDKSchemaError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var StytchSDKAPIError=/*#__PURE__*/function(_Error4){function StytchSDKAPIError(details){var _this4;_classCallCheck$1(this,StytchSDKAPIError);_this4=_callSuper$1(this,StytchSDKAPIError);_this4.name='StytchSDKAPIError';var status_code=details.status_code,error_type=details.error_type,error_message=details.error_message,error_url=details.error_url,request_id=details.request_id,error_details=details.error_details;_this4.error_type=error_type;_this4.error_message=error_message;_this4.error_url=error_url;_this4.request_id=request_id;_this4.status_code=status_code;_this4.error_details=error_details;_this4.message="[".concat(status_code,"] ").concat(error_type,"\n")+"".concat(error_message,"\n")+"See ".concat(error_url," for more information.\n")+(request_id?"request_id: ".concat(request_id,"\n"):'')+(_this4.error_details?"Details: \n"+JSON.stringify(_this4.error_details)+'\n':'');return _this4;}_inherits$1(StytchSDKAPIError,_Error4);return _createClass$1(StytchSDKAPIError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var UNRECOVERABLE_ERROR_TYPES=['unauthorized_credentials','user_unauthenticated','invalid_secret_authentication','session_not_found'];var StytchError=/*#__PURE__*/function(_Error5){function StytchError(name,message){var _this5;_classCallCheck$1(this,StytchError);_this5=_callSuper$1(this,StytchError,[message]);_this5.name=name;return _this5;}_inherits$1(StytchError,_Error5);return _createClass$1(StytchError);}(/*#__PURE__*/_wrapNativeSuper$1(Error));var StytchAPIUnreachableError=/*#__PURE__*/function(_StytchError){function StytchAPIUnreachableError(details){var _this6;_classCallCheck$1(this,StytchAPIUnreachableError);_this6=_callSuper$1(this,StytchAPIUnreachableError,['StytchAPIUnreachableError',details]);Object.setPrototypeOf(_this6,StytchAPIUnreachableError.prototype);return _this6;}_inherits$1(StytchAPIUnreachableError,_StytchError);return _createClass$1(StytchAPIUnreachableError);}(StytchError);var StytchAPISchemaError=/*#__PURE__*/function(_StytchError2){function StytchAPISchemaError(schemaError){_classCallCheck$1(this,StytchAPISchemaError);var _a;var messages=(_a=schemaError.body)===null||_a===void 0?void 0:_a.map(function(err){return"".concat(err.dataPath,": ").concat(err.message);}).join('\n');return _callSuper$1(this,StytchAPISchemaError,['StytchAPISchemaError',"Request does not match expected schema\n".concat(messages)]);}_inherits$1(StytchAPISchemaError,_StytchError2);return _createClass$1(StytchAPISchemaError);}(StytchError);var StytchAPIError=/*#__PURE__*/function(_StytchError3){function StytchAPIError(details){var _this7;_classCallCheck$1(this,StytchAPIError);var status_code=details.status_code,error_type=details.error_type,error_message=details.error_message,error_url=details.error_url,request_id=details.request_id,error_details=details.error_details;_this7=_callSuper$1(this,StytchAPIError,['StytchAPIError',"[".concat(status_code,"] ").concat(error_type,"\n")+"".concat(error_message,"\n")+"See ".concat(error_url," for more information.\n")+(request_id?"request_id: ".concat(request_id,"\n"):'')+(error_details?"Details: \n"+JSON.stringify(error_details)+'\n':'')]);_this7.error_type=error_type;_this7.error_message=error_message;_this7.error_url=error_url;_this7.request_id=request_id;_this7.status_code=status_code;_this7.error_details=error_details;return _this7;}_inherits$1(StytchAPIError,_StytchError3);return _createClass$1(StytchAPIError,null,[{key:"from",value:function from(err){if(err instanceof StytchAPIError){return err;}if(err&&_typeof$1(err)==='object'){var maybe=err;if(typeof maybe.status_code==='number'&&typeof maybe.error_type==='string'&&typeof maybe.error_message==='string'&&typeof maybe.error_url==='string'){return new StytchAPIError({status_code:maybe.status_code,error_type:maybe.error_type,error_message:maybe.error_message,error_url:maybe.error_url,request_id:typeof maybe.request_id==='string'?maybe.request_id:undefined,error_details:_typeof$1(maybe.error_details)==='object'?maybe.error_details:undefined});}}var message=err instanceof Error?err.message:'Unknown error: '+String(err);return new StytchAPIError({status_code:400,error_type:'unknown_error',error_message:message,error_url:'',request_id:undefined,error_details:undefined});}}]);}(StytchError);var StytchSDKError=/*#__PURE__*/function(_StytchError4){function StytchSDKError(name,description,options){var _this8;_classCallCheck$1(this,StytchSDKError);_this8=_callSuper$1(this,StytchSDKError,[name,description]);_this8.options=options;return _this8;}_inherits$1(StytchSDKError,_StytchError4);return _createClass$1(StytchSDKError);}(StytchError);var NoCurrentSessionError=/*#__PURE__*/function(_StytchSDKError){function NoCurrentSessionError(){_classCallCheck$1(this,NoCurrentSessionError);return _callSuper$1(this,NoCurrentSessionError,['NoCurrentSessionError','There is no session currently available. Make sure the user is authenticated with a valid session.']);}_inherits$1(NoCurrentSessionError,_StytchSDKError);return _createClass$1(NoCurrentSessionError);}(StytchSDKError);var InternalError=/*#__PURE__*/function(_StytchSDKError2){function InternalError(error){var _this9;_classCallCheck$1(this,InternalError);_this9=_callSuper$1(this,InternalError,[error.name?error.name:'Internal Error',error.message?error.message:'An internal error has occurred. Please contact Stytch if this occurs.']);_this9.nativeStack=error.nativeStackAndroid||error.nativeStackIOS;return _this9;}_inherits$1(InternalError,_StytchSDKError2);return _createClass$1(InternalError);}(StytchSDKError);var NoBiometricsRegistrationError=/*#__PURE__*/function(_StytchSDKError3){function NoBiometricsRegistrationError(){_classCallCheck$1(this,NoBiometricsRegistrationError);return _callSuper$1(this,NoBiometricsRegistrationError,['NoBiometricsRegistrationError','There is no biometric registration available. Authenticate with another method and add a new biometric registration first.']);}_inherits$1(NoBiometricsRegistrationError,_StytchSDKError3);return _createClass$1(NoBiometricsRegistrationError);}(StytchSDKError);var BiometricsUnavailableError=/*#__PURE__*/function(_StytchSDKError4){function BiometricsUnavailableError(){_classCallCheck$1(this,BiometricsUnavailableError);return _callSuper$1(this,BiometricsUnavailableError,['BiometricsUnavailableError','Biometrics is not available on the device.']);}_inherits$1(BiometricsUnavailableError,_StytchSDKError4);return _createClass$1(BiometricsUnavailableError);}(StytchSDKError);var KeyInvalidatedError=/*#__PURE__*/function(_StytchSDKError5){function KeyInvalidatedError(){_classCallCheck$1(this,KeyInvalidatedError);return _callSuper$1(this,KeyInvalidatedError,['KeyInvalidatedError','The biometrics enrollment on the device has changed.']);}_inherits$1(KeyInvalidatedError,_StytchSDKError5);return _createClass$1(KeyInvalidatedError);}(StytchSDKError);var KeystoreUnavailableError=/*#__PURE__*/function(_StytchSDKError6){function KeystoreUnavailableError(){_classCallCheck$1(this,KeystoreUnavailableError);return _callSuper$1(this,KeystoreUnavailableError,['KeystoreUnavailableError','The Android keystore is unavailable on the device. Consider setting allowFallbackToCleartext to true.']);}_inherits$1(KeystoreUnavailableError,_StytchSDKError6);return _createClass$1(KeystoreUnavailableError);}(StytchSDKError);var NoBiometricsEnrolledError=/*#__PURE__*/function(_StytchSDKError7){function NoBiometricsEnrolledError(){_classCallCheck$1(this,NoBiometricsEnrolledError);return _callSuper$1(this,NoBiometricsEnrolledError,['NoBiometricsEnrolledError','There is no biometric factor enrolled on the device. Add a biometric factor in the device settings.']);}_inherits$1(NoBiometricsEnrolledError,_StytchSDKError7);return _createClass$1(NoBiometricsEnrolledError);}(StytchSDKError);var BiometricsAlreadyEnrolledError=/*#__PURE__*/function(_StytchSDKError8){function BiometricsAlreadyEnrolledError(){_classCallCheck$1(this,BiometricsAlreadyEnrolledError);return _callSuper$1(this,BiometricsAlreadyEnrolledError,['BiometricsAlreadyEnrolledError','There is already a biometric factor enrolled on this device. Fully authenticate with all factors and remove the existing registration before attempting to register again.']);}_inherits$1(BiometricsAlreadyEnrolledError,_StytchSDKError8);return _createClass$1(BiometricsAlreadyEnrolledError);}(StytchSDKError);var UserCancellationError=/*#__PURE__*/function(_StytchSDKError9){function UserCancellationError(){_classCallCheck$1(this,UserCancellationError);return _callSuper$1(this,UserCancellationError,['UserCancellationError','The user canceled the prompt. Ask the user to try again.']);}_inherits$1(UserCancellationError,_StytchSDKError9);return _createClass$1(UserCancellationError);}(StytchSDKError);var UserLockedOutError=/*#__PURE__*/function(_StytchSDKError0){function UserLockedOutError(){_classCallCheck$1(this,UserLockedOutError);return _callSuper$1(this,UserLockedOutError,['UserLockedOutError','The user has been locked out due to too many failed attempts. Ask the user to try again later.']);}_inherits$1(UserLockedOutError,_StytchSDKError0);return _createClass$1(UserLockedOutError);}(StytchSDKError);var DeviceCredentialsNotAllowedError=/*#__PURE__*/function(_StytchSDKError1){function DeviceCredentialsNotAllowedError(){_classCallCheck$1(this,DeviceCredentialsNotAllowedError);return _callSuper$1(this,DeviceCredentialsNotAllowedError,['DeviceCredentialsNotAllowedError','The device credentials allowment is mismatched. Change the allowDeviceCredentials parameter to be the same in both the register and authenticate methods.']);}_inherits$1(DeviceCredentialsNotAllowedError,_StytchSDKError1);return _createClass$1(DeviceCredentialsNotAllowedError);}(StytchSDKError);var MissingGoogleClientIDError=/*#__PURE__*/function(_StytchSDKError10){function MissingGoogleClientIDError(){_classCallCheck$1(this,MissingGoogleClientIDError);return _callSuper$1(this,MissingGoogleClientIDError,['MissingGoogleClientIDError','No Google client ID was found in the project.']);}_inherits$1(MissingGoogleClientIDError,_StytchSDKError10);return _createClass$1(MissingGoogleClientIDError);}(StytchSDKError);var MissingPKCEError=/*#__PURE__*/function(_StytchSDKError11){function MissingPKCEError(){_classCallCheck$1(this,MissingPKCEError);return _callSuper$1(this,MissingPKCEError,['MissingPKCEError','Make sure this flow is completed on the same device on which it was started.']);}_inherits$1(MissingPKCEError,_StytchSDKError11);return _createClass$1(MissingPKCEError);}(StytchSDKError);var MissingAuthorizationCredentialIDTokenError=/*#__PURE__*/function(_StytchSDKError12){function MissingAuthorizationCredentialIDTokenError(){_classCallCheck$1(this,MissingAuthorizationCredentialIDTokenError);return _callSuper$1(this,MissingAuthorizationCredentialIDTokenError,['MissingAuthorizationCredentialIDTokenError','The authorization credential is missing an ID token.']);}_inherits$1(MissingAuthorizationCredentialIDTokenError,_StytchSDKError12);return _createClass$1(MissingAuthorizationCredentialIDTokenError);}(StytchSDKError);var InvalidAuthorizationCredentialError=/*#__PURE__*/function(_StytchSDKError13){function InvalidAuthorizationCredentialError(){_classCallCheck$1(this,InvalidAuthorizationCredentialError);return _callSuper$1(this,InvalidAuthorizationCredentialError,['InvalidAuthorizationCredentialError','The authorization credential is invalid. Verify that OAuth is set up correctly in the developer console, and call the start flow method.']);}_inherits$1(InvalidAuthorizationCredentialError,_StytchSDKError13);return _createClass$1(InvalidAuthorizationCredentialError);}(StytchSDKError);var NoCredentialsPresentError=/*#__PURE__*/function(_StytchSDKError14){function NoCredentialsPresentError(){_classCallCheck$1(this,NoCredentialsPresentError);return _callSuper$1(this,NoCredentialsPresentError,['NoCredentialsPresentError','The user did not provide credentials for a Google OneTap attempt']);}_inherits$1(NoCredentialsPresentError,_StytchSDKError14);return _createClass$1(NoCredentialsPresentError);}(StytchSDKError);var MissingPublicKeyError=/*#__PURE__*/function(_StytchSDKError15){function MissingPublicKeyError(){_classCallCheck$1(this,MissingPublicKeyError);return _callSuper$1(this,MissingPublicKeyError,['MissingPublicKeyError','Failed to retrieve the public key. Add a new biometric registration.']);}_inherits$1(MissingPublicKeyError,_StytchSDKError15);return _createClass$1(MissingPublicKeyError);}(StytchSDKError);var ChallengeSigningFailedError=/*#__PURE__*/function(_StytchSDKError16){function ChallengeSigningFailedError(){_classCallCheck$1(this,ChallengeSigningFailedError);return _callSuper$1(this,ChallengeSigningFailedError,['ChallengeSigningFailedError','Failed to sign the challenge with the key.']);}_inherits$1(ChallengeSigningFailedError,_StytchSDKError16);return _createClass$1(ChallengeSigningFailedError);}(StytchSDKError);var SDKNotConfiguredError=/*#__PURE__*/function(_StytchSDKError17){function SDKNotConfiguredError(){_classCallCheck$1(this,SDKNotConfiguredError);return _callSuper$1(this,SDKNotConfiguredError,['SDKNotConfiguredError','Stytch client is not confiured. You must call the configure method before using the SDK']);}_inherits$1(SDKNotConfiguredError,_StytchSDKError17);return _createClass$1(SDKNotConfiguredError);}(StytchSDKError);var FailedCodeChallengeError=/*#__PURE__*/function(_StytchSDKError18){function FailedCodeChallengeError(){_classCallCheck$1(this,FailedCodeChallengeError);return _callSuper$1(this,FailedCodeChallengeError,['FailedCodeChallengeError','Failed to create a code challenge']);}_inherits$1(FailedCodeChallengeError,_StytchSDKError18);return _createClass$1(FailedCodeChallengeError);}(StytchSDKError);var PasskeysUnsupportedError=/*#__PURE__*/function(_StytchSDKError19){function PasskeysUnsupportedError(){_classCallCheck$1(this,PasskeysUnsupportedError);return _callSuper$1(this,PasskeysUnsupportedError,['PasskeysUnsupportedError','Passkeys are not supported on this device']);}_inherits$1(PasskeysUnsupportedError,_StytchSDKError19);return _createClass$1(PasskeysUnsupportedError);}(StytchSDKError);var FailedToDecryptDataError=/*#__PURE__*/function(_StytchSDKError20){function FailedToDecryptDataError(){_classCallCheck$1(this,FailedToDecryptDataError);return _callSuper$1(this,FailedToDecryptDataError,['FailedToDecryptDataError','Failed to decrypt user data']);}_inherits$1(FailedToDecryptDataError,_StytchSDKError20);return _createClass$1(FailedToDecryptDataError);}(StytchSDKError);var BiometricsFailedError=/*#__PURE__*/function(_StytchSDKError21){function BiometricsFailedError(){_classCallCheck$1(this,BiometricsFailedError);return _callSuper$1(this,BiometricsFailedError,['BiometricsFailedError','Biometric authentication failed']);}_inherits$1(BiometricsFailedError,_StytchSDKError21);return _createClass$1(BiometricsFailedError);}(StytchSDKError);var InvalidStartUrlError=/*#__PURE__*/function(_StytchSDKError22){function InvalidStartUrlError(){_classCallCheck$1(this,InvalidStartUrlError);return _callSuper$1(this,InvalidStartUrlError,['InvalidStartUrlError','The start URL was invalid or improperly formatted.']);}_inherits$1(InvalidStartUrlError,_StytchSDKError22);return _createClass$1(InvalidStartUrlError);}(StytchSDKError);var InvalidRedirectSchemeError=/*#__PURE__*/function(_StytchSDKError23){function InvalidRedirectSchemeError(){_classCallCheck$1(this,InvalidRedirectSchemeError);return _callSuper$1(this,InvalidRedirectSchemeError,['InvalidRedirectSchemeError','The scheme from the given redirect urls was invalid. Possible reasons include: nil scheme, non-custom scheme (using http or https), or differing schemes for login/signup urls.']);}_inherits$1(InvalidRedirectSchemeError,_StytchSDKError23);return _createClass$1(InvalidRedirectSchemeError);}(StytchSDKError);var MissingUrlError=/*#__PURE__*/function(_StytchSDKError24){function MissingUrlError(){_classCallCheck$1(this,MissingUrlError);return _callSuper$1(this,MissingUrlError,['MissingUrlError','The underlying web authentication service failed to return a URL.']);}_inherits$1(MissingUrlError,_StytchSDKError24);return _createClass$1(MissingUrlError);}(StytchSDKError);var InvalidCredentialTypeError=/*#__PURE__*/function(_StytchSDKError25){function InvalidCredentialTypeError(){_classCallCheck$1(this,InvalidCredentialTypeError);return _callSuper$1(this,InvalidCredentialTypeError,['InvalidCredentialTypeError','The public key credential type was not of the expected type.']);}_inherits$1(InvalidCredentialTypeError,_StytchSDKError25);return _createClass$1(InvalidCredentialTypeError);}(StytchSDKError);var MissingAttestationObjectError=/*#__PURE__*/function(_StytchSDKError26){function MissingAttestationObjectError(){_classCallCheck$1(this,MissingAttestationObjectError);return _callSuper$1(this,MissingAttestationObjectError,['MissingAttestationObjectError','The public key credential is missing the attestation object.']);}_inherits$1(MissingAttestationObjectError,_StytchSDKError26);return _createClass$1(MissingAttestationObjectError);}(StytchSDKError);var JSONDataNotConvertibleToStringError=/*#__PURE__*/function(_StytchSDKError27){function JSONDataNotConvertibleToStringError(){_classCallCheck$1(this,JSONDataNotConvertibleToStringError);return _callSuper$1(this,JSONDataNotConvertibleToStringError,['JSONDataNotConvertibleToStringError','JSON data unable to be converted to String type.']);}_inherits$1(JSONDataNotConvertibleToStringError,_StytchSDKError27);return _createClass$1(JSONDataNotConvertibleToStringError);}(StytchSDKError);var RandomNumberGenerationFailed=/*#__PURE__*/function(_StytchSDKError28){function RandomNumberGenerationFailed(){_classCallCheck$1(this,RandomNumberGenerationFailed);return _callSuper$1(this,RandomNumberGenerationFailed,['RandomNumberGenerationFailed','Random number generation failed']);}_inherits$1(RandomNumberGenerationFailed,_StytchSDKError28);return _createClass$1(RandomNumberGenerationFailed);}(StytchSDKError);var PasskeysInvalidEncoding=/*#__PURE__*/function(_StytchSDKError29){function PasskeysInvalidEncoding(){_classCallCheck$1(this,PasskeysInvalidEncoding);return _callSuper$1(this,PasskeysInvalidEncoding,['PasskeysInvalidEncoding','Invalid passkey encoding']);}_inherits$1(PasskeysInvalidEncoding,_StytchSDKError29);return _createClass$1(PasskeysInvalidEncoding);}(StytchSDKError);var PasskeysMisconfigured=/*#__PURE__*/function(_StytchSDKError30){function PasskeysMisconfigured(){_classCallCheck$1(this,PasskeysMisconfigured);return _callSuper$1(this,PasskeysMisconfigured,['PasskeysMisconfigured','Passkeys are misconfigured. Verify that you have added the correct associated domain for your application, and that the signing information is correct.']);}_inherits$1(PasskeysMisconfigured,_StytchSDKError30);return _createClass$1(PasskeysMisconfigured);}(StytchSDKError);var SignInWithAppleMisconfigured=/*#__PURE__*/function(_StytchSDKError31){function SignInWithAppleMisconfigured(){_classCallCheck$1(this,SignInWithAppleMisconfigured);return _callSuper$1(this,SignInWithAppleMisconfigured,['SignInWithAppleMisconfigured','Sign In With Apple is misconfigured. Verify that you have correctly configured Apple OAuth in the Stytch Dashboard and added the Sign In With Apple capability to your project.']);}_inherits$1(SignInWithAppleMisconfigured,_StytchSDKError31);return _createClass$1(SignInWithAppleMisconfigured);}(StytchSDKError);var MissingCipherIv=/*#__PURE__*/function(_StytchSDKError32){function MissingCipherIv(){_classCallCheck$1(this,MissingCipherIv);return _callSuper$1(this,MissingCipherIv,['MissingCipherIv','The expected cipher Iv was not found when attempting to decrypt an existing biometric key.']);}_inherits$1(MissingCipherIv,_StytchSDKError32);return _createClass$1(MissingCipherIv);}(StytchSDKError);var InvalidPrivateKeyLength=/*#__PURE__*/function(_StytchSDKError33){function InvalidPrivateKeyLength(){_classCallCheck$1(this,InvalidPrivateKeyLength);return _callSuper$1(this,InvalidPrivateKeyLength,['InvalidPrivateKeyLength',"The private key was of an incorrect length."]);}_inherits$1(InvalidPrivateKeyLength,_StytchSDKError33);return _createClass$1(InvalidPrivateKeyLength);}(StytchSDKError);var BiometricRegistrationIdIsNullOrBlank=/*#__PURE__*/function(_StytchSDKError34){function BiometricRegistrationIdIsNullOrBlank(){_classCallCheck$1(this,BiometricRegistrationIdIsNullOrBlank);return _callSuper$1(this,BiometricRegistrationIdIsNullOrBlank,['BiometricRegistrationIdIsNullOrBlank','Attempted to set a blank or null biometric registration ID. This is not allowed, and indicates no registration was created on the server. Consider deleting any local keys that may have been generated.']);}_inherits$1(BiometricRegistrationIdIsNullOrBlank,_StytchSDKError34);return _createClass$1(BiometricRegistrationIdIsNullOrBlank);}(StytchSDKError);var DFPNotConfigured=/*#__PURE__*/function(_StytchSDKError35){function DFPNotConfigured(){_classCallCheck$1(this,DFPNotConfigured);return _callSuper$1(this,DFPNotConfigured,['DFPNotConfigured','You have attempted to retrieve a telemetry ID before the DFP client has been configured.']);}_inherits$1(DFPNotConfigured,_StytchSDKError35);return _createClass$1(DFPNotConfigured);}(StytchSDKError);var IDPOAuthFlowMissingParamError=/*#__PURE__*/function(_StytchSDKError36){function IDPOAuthFlowMissingParamError(details){_classCallCheck$1(this,IDPOAuthFlowMissingParamError);return _callSuper$1(this,IDPOAuthFlowMissingParamError,['IDPOAuthFlowMissingParamError',details]);}_inherits$1(IDPOAuthFlowMissingParamError,_StytchSDKError36);return _createClass$1(IDPOAuthFlowMissingParamError);}(StytchSDKError);function errorToStytchError(error){switch(error.message){case'no_current_session':return new NoCurrentSessionError();case'no_biometrics_registration':return new NoBiometricsRegistrationError();case'biometrics_unavailable':return new BiometricsUnavailableError();case'key_invalidated':return new KeyInvalidatedError();case'device_hardware_error':return new BiometricsUnavailableError();case'biometrics_not_available':return new BiometricsUnavailableError();case'no_biometrics_enrolled':return new NoBiometricsEnrolledError();case'keystore_unavailable':return new KeystoreUnavailableError();case'no_biometric_key':return new KeyInvalidatedError();case'device_credentials_not_allowed':return new DeviceCredentialsNotAllowedError();case'user_cancellation':return new UserCancellationError();case'user_locked_out':return new UserLockedOutError();case'google_onetap_missing_id_token':return new MissingAuthorizationCredentialIDTokenError();case'google_onetap_missing_member':return new InvalidAuthorizationCredentialError();case'oauth_apple_missing_id_token':return new MissingAuthorizationCredentialIDTokenError();case'oauth_apple_credential_invalid':return new InvalidAuthorizationCredentialError();case'missing_public_key':return new MissingPublicKeyError();case'challenge_signing_failed':return new ChallengeSigningFailedError();case'missing_authorization_credential_id_token':return new MissingAuthorizationCredentialIDTokenError();case'invalid_authorization_credential':return new InvalidAuthorizationCredentialError();case'no_credentials_present':return new NoCredentialsPresentError();case'sdk_not_configured':return new SDKNotConfiguredError();case'failed_code_challenge':return new FailedCodeChallengeError();case'passkeys_unsupported':return new PasskeysUnsupportedError();case'failed_to_decrypt_data':return new FailedToDecryptDataError();case'biometrics_failed':return new BiometricsFailedError();case'invalid_start_url':return new InvalidStartUrlError();case'invalid_redirect_scheme':return new InvalidRedirectSchemeError();case'missing_url':return new MissingUrlError();case'invalid_credential_type':return new InvalidCredentialTypeError();case'missing_attestation_object':return new MissingAttestationObjectError();case'json_data_not_convertible_to_string':return new JSONDataNotConvertibleToStringError();case'random_number_generation_failed':return new RandomNumberGenerationFailed();case'passkeys_invalid_encoding':return new PasskeysInvalidEncoding();case'passkeys_misconfigured':return new PasskeysMisconfigured();case'signinwithapple_misconfigured':return new SignInWithAppleMisconfigured();case'missing_cipher_iv':return new MissingCipherIv();case'invalid_private_key_length':return new InvalidPrivateKeyLength();case'biometric_registration_id_is_null_or_blank':return new BiometricRegistrationIdIsNullOrBlank();case'dfp_not_configured':return new DFPNotConfigured();default:return new InternalError(error);}}var B2BProducts;(function(B2BProducts){B2BProducts["emailMagicLinks"]="emailMagicLinks";B2BProducts["emailOtp"]="emailOtp";B2BProducts["sso"]="sso";B2BProducts["passwords"]="passwords";B2BProducts["oauth"]="oauth";})(B2BProducts||(B2BProducts={}));var AuthFlowType;(function(AuthFlowType){AuthFlowType["Discovery"]="Discovery";AuthFlowType["Organization"]="Organization";AuthFlowType["PasswordReset"]="PasswordReset";})(AuthFlowType||(AuthFlowType={}));var RedirectURLType;(function(RedirectURLType){RedirectURLType["ResetPassword"]="reset_password";})(RedirectURLType||(RedirectURLType={}));var B2BMFAProducts;(function(B2BMFAProducts){B2BMFAProducts["smsOtp"]="smsOtp";B2BMFAProducts["totp"]="totp";})(B2BMFAProducts||(B2BMFAProducts={}));var B2BOAuthProviders;(function(B2BOAuthProviders){B2BOAuthProviders["Google"]="google";B2BOAuthProviders["Microsoft"]="microsoft";B2BOAuthProviders["HubSpot"]="hubspot";B2BOAuthProviders["Slack"]="slack";B2BOAuthProviders["GitHub"]="github";})(B2BOAuthProviders||(B2BOAuthProviders={}));function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l);else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a;}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0));}if(o||r>1)return a;throw y=!0,n;}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0);}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e;}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break;}catch(t){i=e,c=1,u=t;}finally{f=1;}}return{value:t,done:y};};}(r,o,i),!0),u;}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this;}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e;}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this;}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]";}),(_regenerator=function _regenerator(){return{w:i,m:f};})();}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{});}catch(e){i=0;}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e);});}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2));},_regeneratorDefine2(e,r,n,t);}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r);if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return String(t);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map():void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper);}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor);}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t);},_wrapNativeSuper(t);}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o))();return r&&_setPrototypeOf(p,r.prototype),p;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]");}catch(n){return"function"==typeof t;}}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}var TEST_API_URL='https://test.stytch.com';var LIVE_API_URL='https://api.stytch.com';var CLIENTSIDE_SERVICES_IFRAME_URL='https://js.stytch.com/clientside-services/index.html';var STYTCH_DFP_BACKEND_URL="https://telemetry.stytch.com";var STYTCH_DFP_CDN_URL="https://elements.stytch.com";var GOOGLE_ONE_TAP_HOST='https://accounts.google.com/gsi';var GOOGLE_ONE_TAP_SCRIPT_URL="".concat(GOOGLE_ONE_TAP_HOST,"/client");var DEFAULT_SESSION_DURATION_MINUTES=30;var DEFAULT_OTP_EXPIRATION_MINUTES=5;var MULTIPLE_STYTCH_CLIENTS_DETECTED_WARNING="It looks like you're creating multiple copies of the Stytch client."+' This behavior is unsupported, and unintended side effects may occur. '+"Make sure you are creating the Stytch client at the global level, and not inside a component's render function.";var RetriableErrorType;(function(RetriableErrorType){RetriableErrorType["RequiredCaptcha"]="CAPTCHA required";})(RetriableErrorType||(RetriableErrorType={}));var RetriableError=/*#__PURE__*/function(_Error){function RetriableError(type){var _this;_classCallCheck(this,RetriableError);_this=_callSuper(this,RetriableError,[type]);_this.type=type;return _this;}_inherits(RetriableError,_Error);return _createClass(RetriableError);}(/*#__PURE__*/_wrapNativeSuper(Error));function _retriableFetchSDK(_ref){var method=_ref.method,finalURL=_ref.finalURL,basicAuthHeader=_ref.basicAuthHeader,xSDKClientHeader=_ref.xSDKClientHeader,xSDKParentHostHeader=_ref.xSDKParentHostHeader,body=_ref.body,retryCallback=_ref.retryCallback;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee(){var req,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:req={method:method,finalURL:finalURL,basicAuthHeader:basicAuthHeader,xSDKClientHeader:xSDKClientHeader,xSDKParentHostHeader:xSDKParentHostHeader,body:body};_context.p=1;_context.n=2;return baseFetchSDK(req);case 2:return _context.a(2,_context.v);case 3:_context.p=3;_t=_context.v;if(!(_t instanceof RetriableError)){_context.n=6;break;}_context.n=4;return retryCallback(_t,req);case 4:req=_context.v;_context.n=5;return baseFetchSDK(req);case 5:return _context.a(2,_context.v);case 6:throw _t;case 7:return _context.a(2);}},_callee,null,[[1,3]]);}));}function baseFetchSDK(_ref2){var method=_ref2.method,finalURL=_ref2.finalURL,basicAuthHeader=_ref2.basicAuthHeader,xSDKClientHeader=_ref2.xSDKClientHeader,xSDKParentHostHeader=_ref2.xSDKParentHostHeader,body=_ref2.body;var _a;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee2(){var headers,fetchOpts,resp,_respData,respError,respData,_t2;return _regenerator().w(function(_context2){while(1)switch(_context2.p=_context2.n){case 0:headers={Authorization:basicAuthHeader,'Content-Type':'application/json','X-SDK-Client':xSDKClientHeader};if(xSDKParentHostHeader){headers['X-SDK-Parent-Host']=xSDKParentHostHeader;}fetchOpts={method:method,headers:headers,body:body&&JSON.stringify(body),credentials:'include'};_context2.p=1;_context2.n=2;return fetch(finalURL,fetchOpts);case 2:resp=_context2.v;_context2.n=5;break;case 3:_context2.p=3;_t2=_context2.v;if(!(_t2.message==='Failed to fetch')){_context2.n=4;break;}throw new StytchAPIUnreachableError('Unable to contact our servers.');case 4:throw _t2;case 5:if(!(resp.status<=299)){_context2.n=9;break;}_context2.p=6;_context2.n=7;return resp.json();case 7:_respData=_context2.v;return _context2.a(2,_respData.data);case 8:_context2.p=8;_context2.v;throw new StytchAPIUnreachableError('Invalid JSON response from our servers.');case 9:if(!(resp.status!==200&&((_a=resp.headers.get('content-type'))===null||_a===void 0?void 0:_a.includes('application/json')))){_context2.n=15;break;}_context2.p=10;_context2.n=11;return resp.json();case 11:respError=_context2.v;_context2.n=13;break;case 12:_context2.p=12;_context2.v;throw new StytchAPIUnreachableError('Invalid or no response from server');case 13:if(!('body'in respError||'params'in respError||'query'in respError)){_context2.n=14;break;}throw new StytchAPISchemaError(respError);case 14:throw new StytchAPIError(respError);case 15:_context2.p=15;_context2.n=16;return resp.text();case 16:respData=_context2.v;_context2.n=18;break;case 17:_context2.p=17;_context2.v;throw new StytchAPIUnreachableError('Invalid response from our servers.');case 18:if(!respData.includes('Captcha required')){_context2.n=19;break;}throw new RetriableError(RetriableErrorType.RequiredCaptcha);case 19:throw new StytchAPIUnreachableError('Invalid response from our servers.');case 20:return _context2.a(2);}},_callee2,null,[[15,17],[10,12],[6,8],[1,3]]);}));}function baseSubmitFormSDK(_ref3){var method=_ref3.method,finalURL=_ref3.finalURL,basicAuthHeader=_ref3.basicAuthHeader,xSDKClientHeader=_ref3.xSDKClientHeader,xSDKParentHostHeader=_ref3.xSDKParentHostHeader,body=_ref3.body;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee3(){var bodyParams,finalBody,children,form;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:bodyParams=body||{};finalBody=Object.assign(Object.assign({},bodyParams),{__Authorization:basicAuthHeader,'__X-SDK-Client':xSDKClientHeader});if(xSDKParentHostHeader){finalBody['__X-SDK-Parent-Host']=xSDKParentHostHeader;}children=Object.entries(finalBody).map(function(_ref4){var _ref5=_slicedToArray(_ref4,2),key=_ref5[0],value=_ref5[1];var input=document.createElement('input');input.type='hidden';input.name=key;input.value=value;return input;});form=document.createElement('form');form.method=method;form.action=finalURL;form.append.apply(form,_toConsumableArray(children));document.body.appendChild(form);form.submit();case 1:return _context3.a(2);}},_callee3);}));}var getRandomValues;var rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){getRandomValues=typeof crypto!=='undefined'&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!=='undefined'&&typeof msCrypto.getRandomValues==='function'&&msCrypto.getRandomValues.bind(msCrypto);if(!getRandomValues){throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');}}return getRandomValues(rnds8);}var REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate$1(uuid){return typeof uuid==='string'&&REGEX.test(uuid);}var byteToHex=[];for(var i$3=0;i$3<256;++i$3){byteToHex.push((i$3+0x100).toString(16).substr(1));}function stringify(arr){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var uuid=(byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+'-'+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+'-'+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+'-'+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+'-'+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]).toLowerCase();if(!validate$1(uuid)){throw TypeError('Stringified UUID is invalid');}return uuid;}function v4(options,buf,offset){options=options||{};var rnds=options.random||(options.rng||rng)();rnds[6]=rnds[6]&0x0f|0x40;rnds[8]=rnds[8]&0x3f|0x80;return stringify(rnds);}var ModulePromiseCache={};function loadESModule(url,moduleFromGlobalScope){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee4(){return _regenerator().w(function(_context4){while(1)switch(_context4.n){case 0:if(!(ModulePromiseCache[url]!==undefined)){_context4.n=1;break;}return _context4.a(2,ModulePromiseCache[url]);case 1:ModulePromiseCache[url]=loadESModuleFromNetwork(url,moduleFromGlobalScope);return _context4.a(2,ModulePromiseCache[url]);}},_callee4);}));}function loadESModuleFromNetwork(url,moduleFromGlobalScope){return new Promise(function(resolve,reject){var maybeScript=findScript(url);if(maybeScript&&maybeScript.dataset.loaded==='true'){try{resolve(moduleFromGlobalScope());}catch(err){return reject(new Error("".concat(url," already loaded, but module was not found in global scope: ").concat(err)));}}var script=createScript(url);script.addEventListener('load',function(){script.dataset.loaded='true';try{resolve(moduleFromGlobalScope());}catch(err){reject(new Error("".concat(url," was loaded, but module was not found in global scope: ").concat(err)));}});script.addEventListener('error',function(err){reject(new Error("".concat(url," could not be loaded: ").concat(err)));});});}var findScriptsInDom=function findScriptsInDom(url){return document.querySelectorAll("script[src=\"".concat(url,"\"]"));};function findScript(url){var scripts=findScriptsInDom(url);if(scripts[0]){return scripts[0];}}function createScript(url){var script=document.createElement('script');script.setAttribute('src',url);script.setAttribute('async','true');script.setAttribute('defer','true');document.head.appendChild(script);return script;}var getHttpsUrl=function getHttpsUrl(urlOrDomain){try{var url=new URL(urlOrDomain);return"https://".concat(url.hostname);}catch(_a){}try{var _url=new URL("https://".concat(urlOrDomain));return"https://".concat(_url.hostname);}catch(_b){}return undefined;};var STYTCH_BADGE=['[Stytch]'];var DEBUG=false;var logger={debug:function debug(){return DEBUG;},log:function log(){var _console;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return(_console=console).log.apply(_console,STYTCH_BADGE.concat(args));},warn:function warn(){var _console2;for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}return(_console2=console).warn.apply(_console2,STYTCH_BADGE.concat(args));},error:function error(){var _console3;for(var _len3=arguments.length,args=new Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3];}return(_console3=console).error.apply(_console3,STYTCH_BADGE.concat(args));}};var getLiveApiURL=function getLiveApiURL(opts){var _a,_b,_c,_d;var domain=(_a=opts===null||opts===void 0?void 0:opts.customBaseUrl)!==null&&_a!==void 0?_a:(_b=opts===null||opts===void 0?void 0:opts.endpointOptions)===null||_b===void 0?void 0:_b.apiDomain;if(domain){var httpsUrl=getHttpsUrl(domain);if(httpsUrl){return httpsUrl;}else{var key=(opts===null||opts===void 0?void 0:opts.customBaseUrl)?'customBaseUrl':'apiDomain';logger.warn("Unable to use custom API domain `".concat(domain,"`. ").concat(key," should be a valid domain."));}}return(_d=(_c=opts===null||opts===void 0?void 0:opts.endpoints)===null||_c===void 0?void 0:_c.liveAPIURL)!==null&&_d!==void 0?_d:LIVE_API_URL;};var getTestApiURL=function getTestApiURL(opts){var _a,_b,_c,_d;var domain=(_a=opts===null||opts===void 0?void 0:opts.customBaseUrl)!==null&&_a!==void 0?_a:(_b=opts===null||opts===void 0?void 0:opts.endpointOptions)===null||_b===void 0?void 0:_b.testApiDomain;if(domain){var httpsUrl=getHttpsUrl(domain);if(httpsUrl){return httpsUrl;}else{var key=(opts===null||opts===void 0?void 0:opts.customBaseUrl)?'customBaseUrl':'testApiDomain';logger.warn("Unable to use custom API domain `".concat(domain,"`. ").concat(key," should be a valid domain."));}}return(_d=(_c=opts===null||opts===void 0?void 0:opts.endpoints)===null||_c===void 0?void 0:_c.testAPIURL)!==null&&_d!==void 0?_d:TEST_API_URL;};var trailer="\nYou can find your public token at https://stytch.com/dashboard/api-keys.";var checkPublicToken=function checkPublicToken(publicToken){if(typeof publicToken!=='string'){logger.warn("Public token is malformed. Expected a string, got ".concat(_typeof(publicToken),".").concat(trailer));}else if(publicToken===''){logger.warn("Public token is malformed. Expected \"public-token-...\", got an empty string.".concat(trailer));}else if(!publicToken.startsWith('public-token-')){logger.warn("Public token is malformed. Expected \"public-token-...\", got ".concat(publicToken,".").concat(trailer));}};var checkNotSSR=function checkNotSSR(clientName){var factoryFunctionName=clientName==='StytchUIClient'?'createStytchUIClient':'createStytchHeadlessClient';if(typeof window==='undefined'){throw new Error("`new ".concat(clientName,"()` is not supported in server environments. If using @stytch/react or @stytch/nextjs, use `").concat(factoryFunctionName,"()` instead."));}};var COUNTRIES_LIST={US:'1',AX:'358',AS:'1684',AG:'1268',AI:'1264',AR:'54',AT:'43',AU:'61',BE:'32',BJ:'229',BO:'591',BR:'55',IO:'246',BN:'673',BG:'359',BF:'226',CM:'237',CA:'1',BQ:'599',CF:'236',CL:'56',CX:'61',CC:'61',CO:'57',CD:'243',CK:'682',CR:'506',HR:'385',CZ:'420',DK:'45',DO:'1829',EC:'593',SV:'503',EE:'372',SZ:'268',FK:'500',FI:'358',FR:'33',GF:'594',DE:'49',GH:'233',GR:'30',GD:'1473',GT:'502',GG:'44',GW:'245',GY:'592',HU:'36',IS:'354',IN:'91',IE:'353',IM:'44',IT:'39',JM:'1876',JP:'81',KZ:'7',KE:'254',KI:'686',KR:'82',LV:'371',LT:'370',LU:'352',MO:'853',MT:'356',MH:'692',MR:'222',MU:'230',YT:'262',MX:'52',MC:'377',ME:'382',NR:'674',NL:'31',NZ:'64',NI:'505',NF:'672',NO:'47',PA:'507',PY:'595',PE:'51',PN:'870',PL:'48',PT:'351',PR:'1',RO:'40',BL:'590',SH:'290',KN:'1869',LC:'1758',MF:'590',PM:'508',SM:'378',ST:'239',SC:'248',SX:'599',SK:'421',SI:'386',ZA:'27',SS:'211',ES:'34',SR:'597',SJ:'47',SE:'46',CH:'41',TW:'886',TZ:'255',TK:'690',TO:'676',TT:'1868',TR:'90',UA:'380',GB:'44',UM:'1',UY:'598',VA:'379',EH:'212'};var getDFPBackendURL=function getDFPBackendURL(opts){var _a,_b,_c,_d;var domain=(_a=opts===null||opts===void 0?void 0:opts.dfppaUrl)!==null&&_a!==void 0?_a:(_b=opts===null||opts===void 0?void 0:opts.endpointOptions)===null||_b===void 0?void 0:_b.dfppaDomain;if(domain){var httpsUrl=getHttpsUrl(domain);if(httpsUrl){return httpsUrl;}else{var key=(opts===null||opts===void 0?void 0:opts.dfppaUrl)?'dfppaUrl':'dfppaDomain';logger.warn("Unable to use custom DFPPA domain `".concat(domain,"`. ").concat(key," should be a valid domain."));}}return(_d=(_c=opts===null||opts===void 0?void 0:opts.endpoints)===null||_c===void 0?void 0:_c.dfpBackendURL)!==null&&_d!==void 0?_d:STYTCH_DFP_BACKEND_URL;};var getDFPCdnURL=function getDFPCdnURL(opts){var _a,_b;var domain=(_a=opts===null||opts===void 0?void 0:opts.dfpCdnUrl)!==null&&_a!==void 0?_a:(_b=opts===null||opts===void 0?void 0:opts.endpointOptions)===null||_b===void 0?void 0:_b.dfpCdnDomain;if(domain){var httpsUrl=getHttpsUrl(domain);if(httpsUrl){return httpsUrl;}else{var key=(opts===null||opts===void 0?void 0:opts.dfpCdnUrl)?'dfpCdnUrl':'dfpCdnDomain';logger.warn("Unable to use custom DFP CDN domain `".concat(domain,"`. ").concat(key," should be a valid domain."));}}return STYTCH_DFP_CDN_URL;};function moveToFront(array,predicate){if(array.length<=1){return[array,false];}var matchingIndex=array.findIndex(predicate);if(matchingIndex===-1){return[array,false];}var reordered=_toConsumableArray(array);reordered.unshift.apply(reordered,_toConsumableArray(reordered.splice(matchingIndex,1)));return[reordered,true];}var arrayUtils={moveToFront:moveToFront};var isTestPublicToken=function isTestPublicToken(token){return token.includes('public-token-test');};var createEventId=function createEventId(){return"event-id-".concat(v4());};var createAppSessionId=function createAppSessionId(){return"app-session-id-".concat(v4());};var createPersistentId=function createPersistentId(){return"persistent-id-".concat(v4());};var validate=function validate(methodName){var validator={isObject:function isObject(fieldName,value){var isObject=_typeof(value)==='object'&&!Array.isArray(value)&&value!==null;if(!isObject){throw new StytchSDKUsageError(methodName,fieldName+' must be an object.');}return validator;},isOptionalObject:function isOptionalObject(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isObject(fieldName,value);},isString:function isString(fieldName,value){if(typeof value!=='string'){throw new StytchSDKUsageError(methodName,fieldName+' must be a string.');}return validator;},isOptionalString:function isOptionalString(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isString(fieldName,value);},isStringArray:function isStringArray(fieldName,value){if(!Array.isArray(value)){throw new StytchSDKUsageError(methodName,fieldName+' must be an array of strings.');}var _iterator=_createForOfIteratorHelper(value),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var str=_step.value;if(typeof str!=='string'){throw new StytchSDKUsageError(methodName,fieldName+' must be an array of strings.');}}}catch(err){_iterator.e(err);}finally{_iterator.f();}return validator;},isOptionalStringArray:function isOptionalStringArray(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isStringArray(fieldName,value);},isNumber:function isNumber(fieldName,value){if(typeof value!=='number'){throw new StytchSDKUsageError(methodName,fieldName+' must be a number.');}return validator;},isOptionalNumber:function isOptionalNumber(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isNumber(fieldName,value);},isBoolean:function isBoolean(fieldName,value){if(typeof value!=='boolean'){throw new StytchSDKUsageError(methodName,fieldName+' must be a boolean.');}return validator;},isOptionalBoolean:function isOptionalBoolean(fieldName,value){if(typeof value==='undefined'){return validator;}return validator.isBoolean(fieldName,value);}};return validator;};var removeResponseCommon=function removeResponseCommon(_a){var rest=__rest$1(_a,["request_id","status_code"]);return rest;};var omitUser=function omitUser(resp){var rest=__rest$1(resp,["__user"]);return rest;};var loadTelemetryJS=function loadTelemetryJS(domain){return loadESModule("".concat(domain,"/telemetry.js"),function(){return window.GetTelemetryID;});};var DFPProtectedAuthProvider=/*#__PURE__*/_createClass(function DFPProtectedAuthProvider(publicToken,dfpBackendURL,dfpCdnDomain,bootstrapPromise){var _this2=this;var executeRecaptcha=arguments.length>4&&arguments[4]!==undefined?arguments[4]:function(){return Promise.resolve(undefined);};_classCallCheck(this,DFPProtectedAuthProvider);this.bootstrapPromise=bootstrapPromise;this.isEnabled=function(){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee5(){return _regenerator().w(function(_context5){while(1)switch(_context5.n){case 0:return _context5.a(2,this.state.then(function(state){return state.enabled;}));}},_callee5,this);}));};this.getTelemetryID=function(){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee6(){var _yield$this$state,publicToken,enabled,dfpBackendURL;return _regenerator().w(function(_context6){while(1)switch(_context6.n){case 0:_context6.n=1;return this.state;case 1:_yield$this$state=_context6.v;publicToken=_yield$this$state.publicToken;enabled=_yield$this$state.enabled;dfpBackendURL=_yield$this$state.dfpBackendURL;if(enabled){_context6.n=2;break;}return _context6.a(2,undefined);case 2:_context6.n=3;return window.GetTelemetryID(publicToken,"".concat(dfpBackendURL,"/submit"));case 3:return _context6.a(2,_context6.v);}},_callee6,this);}));};this.getDFPTelemetryIDAndCaptcha=function(){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee7(){var _yield$this$state2,enabled,executeRecaptcha,mode,dfp_telemetry_id,captcha_token;return _regenerator().w(function(_context7){while(1)switch(_context7.n){case 0:_context7.n=1;return this.state;case 1:_yield$this$state2=_context7.v;enabled=_yield$this$state2.enabled;executeRecaptcha=_yield$this$state2.executeRecaptcha;mode=_yield$this$state2.mode;dfp_telemetry_id=undefined;captcha_token=undefined;if(enabled){_context7.n=3;break;}_context7.n=2;return executeRecaptcha();case 2:captcha_token=_context7.v;case 3:if(!(mode==='DECISIONING')){_context7.n=5;break;}_context7.n=4;return this.getTelemetryID();case 4:dfp_telemetry_id=_context7.v;_context7.n=8;break;case 5:if(!(mode==='OBSERVATION')){_context7.n=8;break;}_context7.n=6;return this.getTelemetryID();case 6:dfp_telemetry_id=_context7.v;_context7.n=7;return executeRecaptcha();case 7:captcha_token=_context7.v;case 8:return _context7.a(2,{dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token});}},_callee7,this);}));};this.retryWithCaptchaAndDFP=function(e,req){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee8(){var _yield$this$state3,enabled,executeRecaptcha;return _regenerator().w(function(_context8){while(1)switch(_context8.n){case 0:_context8.n=1;return this.state;case 1:_yield$this$state3=_context8.v;enabled=_yield$this$state3.enabled;executeRecaptcha=_yield$this$state3.executeRecaptcha;if(!(e.type===RetriableErrorType.RequiredCaptcha&&enabled)){_context8.n=5;break;}if(!req.body){_context8.n=4;break;}_context8.n=2;return this.getTelemetryID();case 2:req.body.dfp_telemetry_id=_context8.v;_context8.n=3;return executeRecaptcha();case 3:req.body.captcha_token=_context8.v;case 4:return _context8.a(2,req);case 5:throw new Error('Unable to query captcha and/or dfp telemetry ID');case 6:return _context8.a(2);}},_callee8,this);}));};this.state=bootstrapPromise.then(function(bootstrapData){return __awaiter$1(_this2,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee9(){return _regenerator().w(function(_context9){while(1)switch(_context9.n){case 0:if(bootstrapData.runDFPProtectedAuth){_context9.n=1;break;}return _context9.a(2,{publicToken:publicToken,dfpBackendURL:dfpBackendURL,enabled:false,loaded:false,executeRecaptcha:executeRecaptcha});case 1:_context9.n=2;return loadTelemetryJS(dfpCdnDomain);case 2:return _context9.a(2,{publicToken:publicToken,dfpBackendURL:dfpBackendURL,enabled:true,mode:bootstrapData.dfpProtectedAuthMode||'OBSERVATION',loaded:true,executeRecaptcha:executeRecaptcha});}},_callee9);}));});});var ErrorMarshaller=/*#__PURE__*/function(){function ErrorMarshaller(){_classCallCheck(this,ErrorMarshaller);}return _createClass(ErrorMarshaller,null,[{key:"inflate",value:function inflate(ErrorClass,ErrorData){var err=new ErrorClass(ErrorData);Object.assign(err,ErrorData);Object.setPrototypeOf(err,ErrorClass.prototype);return err;}},{key:"unmarshall",value:function unmarshall(error){if('name'in error){switch(error.name){case'SDKAPIUnreachableError':return ErrorMarshaller.inflate(SDKAPIUnreachableError,error);case'StytchSDKSchemaError':return ErrorMarshaller.inflate(StytchSDKSchemaError,error);case'StytchAPIUnreachableError':return ErrorMarshaller.inflate(StytchAPIUnreachableError,error);case'StytchAPISchemaError':return ErrorMarshaller.inflate(StytchAPISchemaError,error);case'StytchSDKAPIError':return ErrorMarshaller.inflate(StytchSDKAPIError,error);case'StytchAPIError':return ErrorMarshaller.inflate(StytchAPIError,error);case'TypeError':return ErrorMarshaller.inflate(TypeError,error);case'SyntaxError':return ErrorMarshaller.inflate(SyntaxError,error);case'ReferenceError':return ErrorMarshaller.inflate(ReferenceError,error);case'RangeError':return ErrorMarshaller.inflate(RangeError,error);case'EvalError':return ErrorMarshaller.inflate(EvalError,error);case'URIError':return ErrorMarshaller.inflate(URIError,error);}}return ErrorMarshaller.inflate(Error,error);}}]);}();var DEFAULT_MAX_BATCH_SIZE=15;var DEFAULT_INTERVAL_DURATION_MS=800;var EventLogger=/*#__PURE__*/function(){function EventLogger(args){_classCallCheck(this,EventLogger);this.maxBatchSize=args.maxBatchSize;this.logEventURL=args.logEventURL;setInterval(this.flush.bind(this),args.intervalDurationMs);this.batch=[];}return _createClass(EventLogger,[{key:"logEvent",value:function logEvent(telemetry,event){this.batch.push({telemetry:telemetry,event:event});if(this.batch.length>=this.maxBatchSize){this.flush();}}},{key:"flush",value:function flush(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee12(){var batchToSubmit;return _regenerator().w(function(_context12){while(1)switch(_context12.p=_context12.n){case 0:if(this.batch.length){_context12.n=1;break;}return _context12.a(2);case 1:batchToSubmit=this.batch;this.batch=[];_context12.p=2;_context12.n=3;return fetch(this.logEventURL,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(batchToSubmit)});case 3:_context12.n=5;break;case 4:_context12.p=4;_context12.v;case 5:return _context12.a(2);}},_callee12,this,[[2,4]]);}));}}]);}();var EmailSentType;(function(EmailSentType){EmailSentType["LoginOrCreateEML"]="login_or_create_eml";EmailSentType["LoginOrCreateOTP"]="login_or_create_otp";EmailSentType["ResetPassword"]="reset_password";})(EmailSentType||(EmailSentType={}));var HeadlessUserClient=/*#__PURE__*/_createClass(function HeadlessUserClient(_networkClient,_subscriptionService){var _this3=this;_classCallCheck(this,HeadlessUserClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.get=function(){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee13(){var resp,user;return _regenerator().w(function(_context13){while(1)switch(_context13.n){case 0:_context13.n=1;return this._networkClient.fetchSDK({url:'/users/me',method:'GET'});case 1:resp=_context13.v;user=removeResponseCommon(resp);this._subscriptionService.updateUser(user);return _context13.a(2,user);}},_callee13,this);}));};this.getSync=function(){return _this3._subscriptionService.getUser();};this.getInfo=function(){return{user:_this3.getSync(),fromCache:_this3._subscriptionService.getFromCache()};};this.update=function(options){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee14(){var resp,user;return _regenerator().w(function(_context14){while(1)switch(_context14.n){case 0:validate('stytch.user.update').isOptionalObject('untrusted_metadata',options.untrusted_metadata);_context14.n=1;return this._networkClient.fetchSDK({url:'/users/me',body:options,method:'PUT'});case 1:resp=_context14.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context14.a(2,omitUser(resp));}},_callee14,this);}));};this.deleteEmail=function(emailId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee15(){var resp,user;return _regenerator().w(function(_context15){while(1)switch(_context15.n){case 0:_context15.n=1;return this._networkClient.fetchSDK({url:"/users/emails/".concat(emailId),method:'DELETE'});case 1:resp=_context15.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context15.a(2,omitUser(resp));}},_callee15,this);}));};this.deletePhoneNumber=function(phoneId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee16(){var resp,user;return _regenerator().w(function(_context16){while(1)switch(_context16.n){case 0:_context16.n=1;return this._networkClient.fetchSDK({url:"/users/phone_numbers/".concat(phoneId),method:'DELETE'});case 1:resp=_context16.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context16.a(2,omitUser(resp));}},_callee16,this);}));};this.deleteTOTP=function(totpId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee17(){var resp,user;return _regenerator().w(function(_context17){while(1)switch(_context17.n){case 0:_context17.n=1;return this._networkClient.fetchSDK({url:"/users/totps/".concat(totpId),method:'DELETE'});case 1:resp=_context17.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context17.a(2,omitUser(resp));}},_callee17,this);}));};this.deleteCryptoWallet=function(cryptoWalletId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee18(){var resp,user;return _regenerator().w(function(_context18){while(1)switch(_context18.n){case 0:_context18.n=1;return this._networkClient.fetchSDK({url:"/users/crypto_wallets/".concat(cryptoWalletId),method:'DELETE'});case 1:resp=_context18.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context18.a(2,omitUser(resp));}},_callee18,this);}));};this.deleteOAuthRegistration=function(oauthUserRegistrationId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee19(){var resp,user;return _regenerator().w(function(_context19){while(1)switch(_context19.n){case 0:_context19.n=1;return this._networkClient.fetchSDK({url:"/users/oauth/".concat(oauthUserRegistrationId),method:'DELETE'});case 1:resp=_context19.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context19.a(2,omitUser(resp));}},_callee19,this);}));};this.deleteWebauthnRegistration=function(webAuthnId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee20(){var resp,user;return _regenerator().w(function(_context20){while(1)switch(_context20.n){case 0:_context20.n=1;return this._networkClient.fetchSDK({url:"/users/webauthn_registrations/".concat(webAuthnId),method:'DELETE'});case 1:resp=_context20.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context20.a(2,omitUser(resp));}},_callee20,this);}));};this.deleteBiometricRegistration=function(biometricRegistrationId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee21(){var resp,user;return _regenerator().w(function(_context21){while(1)switch(_context21.n){case 0:_context21.n=1;return this._networkClient.fetchSDK({url:"/users/biometric_registrations/".concat(biometricRegistrationId),method:'DELETE'});case 1:resp=_context21.v;user=removeResponseCommon(resp.__user);this._subscriptionService.updateUser(user);return _context21.a(2,omitUser(resp));}},_callee21,this);}));};this.onChange=function(callback){var lastVal=_this3._subscriptionService.getUser();var listener=function listener(state){var _a;if((state===null||state===void 0?void 0:state.user)!==lastVal){lastVal=(_a=state===null||state===void 0?void 0:state.user)!==null&&_a!==void 0?_a:null;callback(lastVal);}};return _this3._subscriptionService.subscribeToState(listener);};this.getConnectedApps=function(){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee22(){return _regenerator().w(function(_context22){while(1)switch(_context22.n){case 0:_context22.n=1;return this._networkClient.fetchSDK({url:'/users/connected_apps',method:'GET'});case 1:return _context22.a(2,_context22.v);}},_callee22,this);}));};this.revokedConnectedApp=function(connectedAppId){return __awaiter$1(_this3,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee23(){return _regenerator().w(function(_context23){while(1)switch(_context23.n){case 0:_context23.n=1;return this._networkClient.fetchSDK({url:"/users/connected_apps/".concat(connectedAppId,"/revoke"),method:'POST'});case 1:return _context23.a(2,_context23.v);}},_callee23,this);}));};});var HeadlessSessionClient=/*#__PURE__*/function(){function HeadlessSessionClient(_networkClient,_subscriptionService){var _this4=this;_classCallCheck(this,HeadlessSessionClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.getSync=function(){return _this4._subscriptionService.getSession();};this.getInfo=function(){var session=_this4.getSync();var fromCache=_this4._subscriptionService.getFromCache();return{session:session,fromCache:fromCache};};this.onChange=function(callback){var lastVal=_this4._subscriptionService.getSession();var listener=function listener(state){var _a;if((state===null||state===void 0?void 0:state.session)!==lastVal){lastVal=(_a=state===null||state===void 0?void 0:state.session)!==null&&_a!==void 0?_a:null;callback(lastVal);}};return _this4._subscriptionService.subscribeToState(listener);};this.revoke=function(options){return __awaiter$1(_this4,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee24(){var resp,_t7;return _regenerator().w(function(_context24){while(1)switch(_context24.p=_context24.n){case 0:_context24.p=0;_context24.n=1;return this._networkClient.fetchSDK({url:"/sessions/revoke",method:'POST'});case 1:resp=_context24.v;this._subscriptionService.destroyState();return _context24.a(2,resp);case 2:_context24.p=2;_t7=_context24.v;if(options===null||options===void 0?void 0:options.forceClear){this._subscriptionService.destroyState();}else if(UNRECOVERABLE_ERROR_TYPES.includes(_t7.error_type)){this._subscriptionService.destroyState();}throw _t7;case 3:return _context24.a(2);}},_callee24,this,[[0,2]]);}));};this._authenticate=function(options){return __awaiter$1(_this4,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee25(){var _this5=this;var initialSession,isSessionStale,requestBody,resp,_t8;return _regenerator().w(function(_context25){while(1)switch(_context25.p=_context25.n){case 0:initialSession=this._subscriptionService.getSession();isSessionStale=function isSessionStale(){var _a;return(initialSession===null||initialSession===void 0?void 0:initialSession.session_id)!==((_a=_this5._subscriptionService.getSession())===null||_a===void 0?void 0:_a.session_id);};_context25.p=1;requestBody={session_duration_minutes:options===null||options===void 0?void 0:options.session_duration_minutes};_context25.n=2;return this._networkClient.fetchSDK({url:'/sessions/authenticate',body:requestBody,method:'POST'});case 2:resp=_context25.v;if(!isSessionStale()){_context25.n=3;break;}return _context25.a(2,this._authenticate(options));case 3:return _context25.a(2,omitUser(resp));case 4:_context25.p=4;_t8=_context25.v;if(!isSessionStale()){_context25.n=5;break;}return _context25.a(2,this._authenticate(options));case 5:if(UNRECOVERABLE_ERROR_TYPES.includes(_t8.error_type)){this._subscriptionService.destroySession();}throw _t8;case 6:return _context25.a(2);}},_callee25,this,[[1,4]]);}));};this.authenticate=this._subscriptionService.withUpdateSession(this._authenticate);this.exchangeAccessToken=this._subscriptionService.withUpdateSession(function(data){return __awaiter$1(_this4,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee26(){var resp;return _regenerator().w(function(_context26){while(1)switch(_context26.n){case 0:validate('stytch.session.exchangeAccessToken').isString('access_token',data.access_token).isNumber('session_duration_minutes',data.session_duration_minutes);_context26.n=1;return this._networkClient.fetchSDK({url:'/sessions/exchange_access_token',body:data,method:'POST'});case 1:resp=_context26.v;return _context26.a(2,omitUser(resp));}},_callee26,this);}));});this.attest=this._subscriptionService.withUpdateSession(function(data){return __awaiter$1(_this4,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee27(){return _regenerator().w(function(_context27){while(1)switch(_context27.n){case 0:validate('stytch.session.attest').isString('profile_id',data.profile_id).isString('token',data.token).isOptionalNumber('session_duration_minutes',data.session_duration_minutes);return _context27.a(2,this._networkClient.fetchSDK({url:'/sessions/attest',body:data,method:'POST'}));}},_callee27,this);}));});}return _createClass(HeadlessSessionClient,[{key:"getTokens",value:function getTokens(){return this._subscriptionService.getTokens();}},{key:"updateSession",value:function updateSession(tokens){var _a;validate('stytch.session.updateSession').isString('session_token',tokens.session_token).isOptionalString('session_jwt',(_a=tokens.session_jwt)!==null&&_a!==void 0?_a:undefined);this._subscriptionService.updateTokens(tokens);}}]);}();var DefaultDynamicConfig$4=Promise.resolve({pkceRequiredForEmailMagicLinks:false});var HeadlessMagicLinksClient=/*#__PURE__*/function(){function HeadlessMagicLinksClient(_networkClient,_subscriptionService,_pkceManager,_passwordResetPKCEManager){var _this6=this;var _config=arguments.length>4&&arguments[4]!==undefined?arguments[4]:DefaultDynamicConfig$4;var dfpProtectedAuth=arguments.length>5?arguments[5]:undefined;_classCallCheck(this,HeadlessMagicLinksClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this._pkceManager=_pkceManager;this._passwordResetPKCEManager=_passwordResetPKCEManager;this._config=_config;this.dfpProtectedAuth=dfpProtectedAuth;this.email={loginOrCreate:function loginOrCreate(email){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return __awaiter$1(_this6,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee28(){var _yield$this$_config,pkceRequiredForEmailMagicLinks,code_challenge,_yield$this$dfpProtec,dfp_telemetry_id,captcha_token,requestBody;return _regenerator().w(function(_context28){while(1)switch(_context28.n){case 0:_context28.n=1;return this._config;case 1:_yield$this$_config=_context28.v;pkceRequiredForEmailMagicLinks=_yield$this$_config.pkceRequiredForEmailMagicLinks;code_challenge=undefined;if(!pkceRequiredForEmailMagicLinks){_context28.n=3;break;}_context28.n=2;return this.getCodeChallenge();case 2:code_challenge=_context28.v;case 3:_context28.n=4;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 4:_yield$this$dfpProtec=_context28.v;dfp_telemetry_id=_yield$this$dfpProtec.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec.captcha_token;requestBody=Object.assign(Object.assign({},options),{email:email,code_challenge:code_challenge,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});return _context28.a(2,this._networkClient.retriableFetchSDK({url:'/magic_links/email/login_or_create',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee28,this);}));},send:function send(email){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return __awaiter$1(_this6,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee29(){var _yield$this$_config2,pkceRequiredForEmailMagicLinks,code_challenge,_yield$this$dfpProtec2,dfp_telemetry_id,captcha_token,requestBody,isLoggedIn,endpoint;return _regenerator().w(function(_context29){while(1)switch(_context29.n){case 0:_context29.n=1;return this._config;case 1:_yield$this$_config2=_context29.v;pkceRequiredForEmailMagicLinks=_yield$this$_config2.pkceRequiredForEmailMagicLinks;code_challenge=undefined;if(!pkceRequiredForEmailMagicLinks){_context29.n=3;break;}_context29.n=2;return this.getCodeChallenge();case 2:code_challenge=_context29.v;case 3:_context29.n=4;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 4:_yield$this$dfpProtec2=_context29.v;dfp_telemetry_id=_yield$this$dfpProtec2.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec2.captcha_token;requestBody=Object.assign(Object.assign({},options),{email:email,code_challenge:code_challenge,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/magic_links/email/send/secondary':'/magic_links/email/send/primary';return _context29.a(2,this._networkClient.retriableFetchSDK({url:endpoint,body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee29,this);}));}};this.authenticate=this._subscriptionService.withUpdateSession(function(token,options){return __awaiter$1(_this6,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee30(){var passwordResetPKPair,resp,_t9;return _regenerator().w(function(_context30){while(1)switch(_context30.p=_context30.n){case 0:validate('stytch.magicLinks.authenticate').isString('Token',token).isNumber('session_duration_minutes',options.session_duration_minutes);_context30.n=1;return this._passwordResetPKCEManager.getPKPair();case 1:passwordResetPKPair=_context30.v;resp=null;if(!(passwordResetPKPair===null||passwordResetPKPair===void 0?void 0:passwordResetPKPair.code_verifier)){_context30.n=6;break;}_context30.p=2;_context30.n=3;return this.handlePKCEForAuthenticate(this._passwordResetPKCEManager,Object.assign(Object.assign({},options),{token:token}));case 3:resp=_context30.v;_context30.n=6;break;case 4:_context30.p=4;_t9=_context30.v;if(!_t9.message.includes('pkce')){_context30.n=5;break;}console.log('Authenticate with passwords pkce namespace failed. Falling back to authenticate with magic_links namespace.');_context30.n=6;break;case 5:throw _t9;case 6:if(resp){_context30.n=8;break;}_context30.n=7;return this.handlePKCEForAuthenticate(this._pkceManager,Object.assign(Object.assign({},options),{token:token}));case 7:resp=_context30.v;case 8:return _context30.a(2,omitUser(resp));}},_callee30,this,[[2,4]]);}));});}return _createClass(HeadlessMagicLinksClient,[{key:"getCodeChallenge",value:function getCodeChallenge(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee31(){var keyPair;return _regenerator().w(function(_context31){while(1)switch(_context31.n){case 0:_context31.n=1;return this._pkceManager.getPKPair();case 1:keyPair=_context31.v;if(!keyPair){_context31.n=2;break;}return _context31.a(2,keyPair.code_challenge);case 2:_context31.n=3;return this._pkceManager.startPKCETransaction();case 3:keyPair=_context31.v;return _context31.a(2,keyPair.code_challenge);}},_callee31,this);}));}},{key:"handlePKCEForAuthenticate",value:function handlePKCEForAuthenticate(pkceManager,data){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee32(){var pkPair,requestBody,resp;return _regenerator().w(function(_context32){while(1)switch(_context32.n){case 0:_context32.n=1;return pkceManager.getPKPair();case 1:pkPair=_context32.v;requestBody=Object.assign({code_verifier:pkPair===null||pkPair===void 0?void 0:pkPair.code_verifier},data);_context32.n=2;return this._networkClient.fetchSDK({url:'/magic_links/authenticate',body:requestBody,method:'POST'});case 2:resp=_context32.v;pkceManager.clearPKPair();return _context32.a(2,resp);}},_callee32,this);}));}}]);}();var HeadlessOTPClient=/*#__PURE__*/_createClass(function HeadlessOTPClient(_networkClient,_subscriptionService){var _this7=this;var executeRecaptcha=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(){return Promise.resolve(undefined);};var dfpProtectedAuth=arguments.length>3?arguments[3]:undefined;_classCallCheck(this,HeadlessOTPClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.executeRecaptcha=executeRecaptcha;this.dfpProtectedAuth=dfpProtectedAuth;this.sms={loginOrCreate:function loginOrCreate(phone_number,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee33(){var _yield$this$dfpProtec3,dfp_telemetry_id,captcha_token,requestBody;return _regenerator().w(function(_context33){while(1)switch(_context33.n){case 0:_context33.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec3=_context33.v;dfp_telemetry_id=_yield$this$dfpProtec3.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec3.captcha_token;requestBody=Object.assign(Object.assign({},options),{phone_number:phone_number,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});return _context33.a(2,this._networkClient.retriableFetchSDK({url:'/otps/sms/login_or_create',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee33,this);}));},send:function send(phone_number,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee34(){var _yield$this$dfpProtec4,dfp_telemetry_id,captcha_token,requestBody,isLoggedIn,endpoint;return _regenerator().w(function(_context34){while(1)switch(_context34.n){case 0:_context34.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec4=_context34.v;dfp_telemetry_id=_yield$this$dfpProtec4.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec4.captcha_token;requestBody=Object.assign(Object.assign({},options),{phone_number:phone_number,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/otps/sms/send/secondary':'/otps/sms/send/primary';return _context34.a(2,this._networkClient.retriableFetchSDK({url:endpoint,body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee34,this);}));}};this.whatsapp={loginOrCreate:function loginOrCreate(phone_number,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee35(){var _yield$this$dfpProtec5,dfp_telemetry_id,captcha_token,requestBody;return _regenerator().w(function(_context35){while(1)switch(_context35.n){case 0:_context35.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec5=_context35.v;dfp_telemetry_id=_yield$this$dfpProtec5.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec5.captcha_token;requestBody=Object.assign(Object.assign({},options),{phone_number:phone_number,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token});return _context35.a(2,this._networkClient.retriableFetchSDK({url:'/otps/whatsapp/login_or_create',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee35,this);}));},send:function send(phone_number,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee36(){var _yield$this$dfpProtec6,dfp_telemetry_id,captcha_token,requestBody,isLoggedIn,endpoint;return _regenerator().w(function(_context36){while(1)switch(_context36.n){case 0:_context36.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec6=_context36.v;dfp_telemetry_id=_yield$this$dfpProtec6.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec6.captcha_token;requestBody=Object.assign(Object.assign({},options),{phone_number:phone_number,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/otps/whatsapp/send/secondary':'/otps/whatsapp/send/primary';return _context36.a(2,this._networkClient.retriableFetchSDK({url:endpoint,body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee36,this);}));}};this.email={loginOrCreate:function loginOrCreate(email,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee37(){var _yield$this$dfpProtec7,dfp_telemetry_id,captcha_token,requestBody;return _regenerator().w(function(_context37){while(1)switch(_context37.n){case 0:_context37.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec7=_context37.v;dfp_telemetry_id=_yield$this$dfpProtec7.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec7.captcha_token;requestBody=Object.assign(Object.assign({},options),{email:email,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id});return _context37.a(2,this._networkClient.retriableFetchSDK({url:'/otps/email/login_or_create',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee37,this);}));},send:function send(email,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee38(){var captcha_token,requestBody,isLoggedIn,endpoint;return _regenerator().w(function(_context38){while(1)switch(_context38.n){case 0:_context38.n=1;return this.executeRecaptcha();case 1:captcha_token=_context38.v;requestBody=Object.assign(Object.assign({},options),{email:email,captcha_token:captcha_token});isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/otps/email/send/secondary':'/otps/email/send/primary';return _context38.a(2,this._networkClient.fetchSDK({url:endpoint,body:requestBody,method:'POST'}));}},_callee38,this);}));}};this.authenticate=this._subscriptionService.withUpdateSession(function(code,method_id,options){return __awaiter$1(_this7,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee39(){var _yield$this$dfpProtec8,dfp_telemetry_id,captcha_token,requestBody,resp;return _regenerator().w(function(_context39){while(1)switch(_context39.n){case 0:validate('stytch.otps.authenticate').isString('Code',code).isNumber('session_duration_minutes',options.session_duration_minutes);_context39.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec8=_context39.v;dfp_telemetry_id=_yield$this$dfpProtec8.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec8.captcha_token;requestBody=Object.assign({token:code,method_id:method_id,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token},options);_context39.n=2;return this._networkClient.retriableFetchSDK({url:'/otps/authenticate',body:requestBody,method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context39.v;return _context39.a(2,omitUser(resp));}},_callee39,this);}));});});var HeadlessOAuthClient$1=/*#__PURE__*/function(){function HeadlessOAuthClient(_networkClient,_subscriptionService,_pkceManager,_dynamicConfig,_config){var _this8=this;_classCallCheck(this,HeadlessOAuthClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this._pkceManager=_pkceManager;this._dynamicConfig=_dynamicConfig;this._config=_config;this.google={start:this.startOAuthFlow(OAuthProviders.Google)};this.apple={start:this.startOAuthFlow(OAuthProviders.Apple)};this.microsoft={start:this.startOAuthFlow(OAuthProviders.Microsoft)};this.github={start:this.startOAuthFlow(OAuthProviders.Github)};this.gitlab={start:this.startOAuthFlow(OAuthProviders.GitLab)};this.facebook={start:this.startOAuthFlow(OAuthProviders.Facebook)};this.discord={start:this.startOAuthFlow(OAuthProviders.Discord)};this.salesforce={start:this.startOAuthFlow(OAuthProviders.Salesforce)};this.slack={start:this.startOAuthFlow(OAuthProviders.Slack)};this.amazon={start:this.startOAuthFlow(OAuthProviders.Amazon)};this.bitbucket={start:this.startOAuthFlow(OAuthProviders.Bitbucket)};this.linkedin={start:this.startOAuthFlow(OAuthProviders.LinkedIn)};this.coinbase={start:this.startOAuthFlow(OAuthProviders.Coinbase)};this.twitch={start:this.startOAuthFlow(OAuthProviders.Twitch)};this.twitter={start:this.startOAuthFlow(OAuthProviders.Twitter)};this.tiktok={start:this.startOAuthFlow(OAuthProviders.TikTok)};this.snapchat={start:this.startOAuthFlow(OAuthProviders.Snapchat)};this.figma={start:this.startOAuthFlow(OAuthProviders.Figma)};this.yahoo={start:this.startOAuthFlow(OAuthProviders.Yahoo)};this.authenticate=this._subscriptionService.withUpdateSession(function(token,options){return __awaiter$1(_this8,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee40(){var keyPair,resp;return _regenerator().w(function(_context40){while(1)switch(_context40.n){case 0:validate('stytch.oauth.authenticate').isString('Token',token).isNumber('session_duration_minutes',options.session_duration_minutes);_context40.n=1;return this._pkceManager.getPKPair();case 1:keyPair=_context40.v;if(!keyPair){logger.warn('No code verifier found in local storage for OAuth flow.\n'+'Consider using stytch.oauth.$provider.start() to add PKCE to your OAuth flows for added security.\n'+'See https://stytch.com/docs/oauth#guides_pkce for more information.');}_context40.n=2;return this._networkClient.fetchSDK({url:'/oauth/authenticate',method:'POST',body:Object.assign({token:token,code_verifier:keyPair===null||keyPair===void 0?void 0:keyPair.code_verifier},options)});case 2:resp=_context40.v;this._pkceManager.clearPKPair();return _context40.a(2,omitUser(resp));}},_callee40,this);}));});}return _createClass(HeadlessOAuthClient,[{key:"attach",value:function attach(provider){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee41(){return _regenerator().w(function(_context41){while(1)switch(_context41.n){case 0:validate('stytch.oauth.attach').isString('Provider',provider);_context41.n=1;return this._networkClient.fetchSDK({url:'/oauth/attach',method:'POST',body:{provider:provider}});case 1:return _context41.a(2,_context41.v);}},_callee41,this);}));}},{key:"getBaseApiUrl",value:function getBaseApiUrl(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee42(){var _yield$this$_dynamicC,cnameDomain;return _regenerator().w(function(_context42){while(1)switch(_context42.n){case 0:_context42.n=1;return this._dynamicConfig;case 1:_yield$this$_dynamicC=_context42.v;cnameDomain=_yield$this$_dynamicC.cnameDomain;if(!cnameDomain){_context42.n=2;break;}return _context42.a(2,"https://".concat(cnameDomain));case 2:if(!isTestPublicToken(this._config.publicToken)){_context42.n=3;break;}return _context42.a(2,this._config.testAPIURL);case 3:return _context42.a(2,this._config.liveAPIURL);}},_callee42,this);}));}},{key:"startOAuthFlow",value:function startOAuthFlow(providerType){var _this9=this;return function(){var _ref6=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},login_redirect_url=_ref6.login_redirect_url,signup_redirect_url=_ref6.signup_redirect_url,custom_scopes=_ref6.custom_scopes,provider_params=_ref6.provider_params,oauth_attach_token=_ref6.oauth_attach_token;return __awaiter$1(_this9,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee43(){var _yield$this$_dynamicC2,cnameDomain,pkceRequiredForOAuth,baseURL,oauthUrl,keyPair,key;return _regenerator().w(function(_context43){while(1)switch(_context43.n){case 0:_context43.n=1;return this._dynamicConfig;case 1:_yield$this$_dynamicC2=_context43.v;cnameDomain=_yield$this$_dynamicC2.cnameDomain;pkceRequiredForOAuth=_yield$this$_dynamicC2.pkceRequiredForOAuth;_context43.n=2;return this.getBaseApiUrl();case 2:baseURL=_context43.v;this._networkClient.logEvent({name:'start_oauth_flow',details:{provider_type:providerType,custom_scopes:custom_scopes,cname_domain:cnameDomain,pkce:pkceRequiredForOAuth,provider_params:provider_params}});oauthUrl=new URL("".concat(baseURL,"/v1/public/oauth/").concat(providerType,"/start"));oauthUrl.searchParams.set('public_token',this._config.publicToken);if(!pkceRequiredForOAuth){_context43.n=4;break;}_context43.n=3;return this._pkceManager.startPKCETransaction();case 3:keyPair=_context43.v;oauthUrl.searchParams.set('code_challenge',keyPair.code_challenge);_context43.n=5;break;case 4:this._pkceManager.clearPKPair();case 5:if(custom_scopes){validate('startOAuthFlow').isStringArray('custom_scopes',custom_scopes);oauthUrl.searchParams.set('custom_scopes',custom_scopes.join(' '));}if(provider_params){validate('startOAuthFlow').isOptionalObject('provider_params',provider_params);for(key in provider_params){oauthUrl.searchParams.set('provider_'+key,provider_params[key]);}}if(login_redirect_url)oauthUrl.searchParams.set('login_redirect_url',login_redirect_url);if(signup_redirect_url)oauthUrl.searchParams.set('signup_redirect_url',signup_redirect_url);if(oauth_attach_token)oauthUrl.searchParams.set('oauth_attach_token',oauth_attach_token);window.location.href=oauthUrl.toString();case 6:return _context43.a(2);}},_callee43,this);}));};}}]);}();var DefaultDynamicConfig$3=Promise.resolve({siweRequiredForCryptoWallets:false});var HeadlessCryptoWalletClient=/*#__PURE__*/function(){function HeadlessCryptoWalletClient(_networkClient,_apiNetworkClient,_subscriptionService){var _this0=this;var executeRecaptcha=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(){return Promise.resolve(undefined);};var dfpProtectedAuth=arguments.length>4?arguments[4]:undefined;var _config=arguments.length>5&&arguments[5]!==undefined?arguments[5]:DefaultDynamicConfig$3;_classCallCheck(this,HeadlessCryptoWalletClient);this._networkClient=_networkClient;this._apiNetworkClient=_apiNetworkClient;this._subscriptionService=_subscriptionService;this.executeRecaptcha=executeRecaptcha;this.dfpProtectedAuth=dfpProtectedAuth;this._config=_config;this.authenticate=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this0,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee44(){var _yield$this$dfpProtec9,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context44){while(1)switch(_context44.n){case 0:validate('stytch.cryptoWallets.authenticate').isString('signature',options.signature).isString('crypto_wallet_address',options.crypto_wallet_address).isString('crypto_wallet_type',options.crypto_wallet_type).isNumber('session_duration_minutes',options.session_duration_minutes);_context44.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec9=_context44.v;dfp_telemetry_id=_yield$this$dfpProtec9.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec9.captcha_token;_context44.n=2;return this._apiNetworkClient.retriableFetchSDK({url:'/crypto_wallets/authenticate',method:'POST',body:{session_duration_minutes:options.session_duration_minutes,crypto_wallet_address:options.crypto_wallet_address,crypto_wallet_type:options.crypto_wallet_type,signature:options.signature,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context44.v;return _context44.a(2,omitUser(resp));}},_callee44,this);}));});}return _createClass(HeadlessCryptoWalletClient,[{key:"authenticateStart",value:function authenticateStart(options){var _a;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee45(){var isLoggedIn,captcha_token,_yield$this$_config3,siweRequiredForCryptoWallets,body,endpoint,requestBody;return _regenerator().w(function(_context45){while(1)switch(_context45.n){case 0:validate('stytch.cryptoWallets.authenticateStart').isString('crypto_wallet_address',options.crypto_wallet_address).isString('crypto_wallet_type',options.crypto_wallet_type);if(options.siwe_params){validate('stytch.cryptoWallets.authenticateStart').isOptionalString('uri',options.siwe_params.uri).isOptionalString('chain_id',options.siwe_params.chain_id).isOptionalString('issued_at',options.siwe_params.issued_at).isOptionalString('statement',options.siwe_params.statement).isOptionalString('not_before',options.siwe_params.not_before).isOptionalString('message_request_id',options.siwe_params.message_request_id).isOptionalStringArray('resources',options.siwe_params.resources);}isLoggedIn=!!this._subscriptionService.getSession();_context45.n=1;return this.executeRecaptcha();case 1:captcha_token=_context45.v;_context45.n=2;return this._config;case 2:_yield$this$_config3=_context45.v;siweRequiredForCryptoWallets=_yield$this$_config3.siweRequiredForCryptoWallets;body={crypto_wallet_address:options.crypto_wallet_address,crypto_wallet_type:options.crypto_wallet_type};if(siweRequiredForCryptoWallets&&options.crypto_wallet_type=='ethereum'){body.siwe_params=Object.assign(Object.assign({},options.siwe_params),{uri:((_a=options.siwe_params)===null||_a===void 0?void 0:_a.uri)||window.location.origin});}endpoint=isLoggedIn?'/crypto_wallets/authenticate/start/secondary':'/crypto_wallets/authenticate/start/primary';requestBody=Object.assign(Object.assign({},body),{captcha_token:captcha_token});return _context45.a(2,this._apiNetworkClient.fetchSDK({url:endpoint,method:'POST',body:requestBody}));}},_callee45,this);}));}}]);}();var HeadlessTOTPClient=/*#__PURE__*/function(){function HeadlessTOTPClient(_networkClient,_subscriptionService,dfpProtectedAuth){var _this1=this;_classCallCheck(this,HeadlessTOTPClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.dfpProtectedAuth=dfpProtectedAuth;this.authenticate=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this1,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee46(){var _yield$this$dfpProtec0,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context46){while(1)switch(_context46.n){case 0:validate('stytch.totps.authenticate').isNumber('session_duration_minutes',options.session_duration_minutes).isString('totp_code',options.totp_code);_context46.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec0=_context46.v;dfp_telemetry_id=_yield$this$dfpProtec0.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec0.captcha_token;_context46.n=2;return this._networkClient.retriableFetchSDK({url:'/totps/authenticate',method:'POST',body:{session_duration_minutes:options.session_duration_minutes,totp_code:options.totp_code,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context46.v;return _context46.a(2,omitUser(resp));}},_callee46,this);}));});this.recover=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this1,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee47(){var _yield$this$dfpProtec1,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context47){while(1)switch(_context47.n){case 0:validate('stytch.totps.recover').isNumber('session_duration_minutes',options.session_duration_minutes).isString('recovery_code',options.recovery_code);_context47.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec1=_context47.v;dfp_telemetry_id=_yield$this$dfpProtec1.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec1.captcha_token;_context47.n=2;return this._networkClient.retriableFetchSDK({url:'/totps/recover',method:'POST',body:{session_duration_minutes:options.session_duration_minutes,recovery_code:options.recovery_code,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context47.v;return _context47.a(2,omitUser(resp));}},_callee47,this);}));});}return _createClass(HeadlessTOTPClient,[{key:"create",value:function create(options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee48(){var resp;return _regenerator().w(function(_context48){while(1)switch(_context48.n){case 0:validate('stytch.totps.create').isNumber('expiration_minutes',options.expiration_minutes);_context48.n=1;return this._networkClient.fetchSDK({url:'/totps',method:'POST',body:{expiration_minutes:options.expiration_minutes}});case 1:resp=_context48.v;this._subscriptionService.updateUser(resp.__user);return _context48.a(2,omitUser(resp));}},_callee48,this);}));}},{key:"recoveryCodes",value:function recoveryCodes(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee49(){return _regenerator().w(function(_context49){while(1)switch(_context49.n){case 0:return _context49.a(2,this._networkClient.fetchSDK({url:'/totps/recovery_codes',method:'POST'}));}},_callee49,this);}));}}]);}();function base64urlToBuffer(baseurl64String){var padding="==".slice(0,(4-baseurl64String.length%4)%4);var base64String=baseurl64String.replace(/-/g,"+").replace(/_/g,"/")+padding;var str=atob(base64String);var buffer=new ArrayBuffer(str.length);var byteView=new Uint8Array(buffer);for(var _i=0;_i<str.length;_i++){byteView[_i]=str.charCodeAt(_i);}return buffer;}function bufferToBase64url(buffer){var byteView=new Uint8Array(buffer);var str="";var _iterator2=_createForOfIteratorHelper(byteView),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var charCode=_step2.value;str+=String.fromCharCode(charCode);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}var base64String=btoa(str);var base64urlString=base64String.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return base64urlString;}var copyValue="copy";var convertValue="convert";function convert(conversionFn,schema2,input){if(schema2===copyValue){return input;}if(schema2===convertValue){return conversionFn(input);}if(schema2 instanceof Array){return input.map(function(v){return convert(conversionFn,schema2[0],v);});}if(schema2 instanceof Object){var output={};for(var _i2=0,_Object$entries=Object.entries(schema2);_i2<_Object$entries.length;_i2++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i2],2),key=_Object$entries$_i[0],schemaField=_Object$entries$_i[1];if(schemaField.derive){var v=schemaField.derive(input);if(v!==void 0){input[key]=v;}}if(!(key in input)){if(schemaField.required){throw new Error("Missing key: ".concat(key));}continue;}if(input[key]==null){output[key]=null;continue;}output[key]=convert(conversionFn,schemaField.schema,input[key]);}return output;}}function derived(schema2,derive){return{required:true,schema:schema2,derive:derive};}function required(schema2){return{required:true,schema:schema2};}function optional(schema2){return{required:false,schema:schema2};}var publicKeyCredentialDescriptorSchema={type:required(copyValue),id:required(convertValue),transports:optional(copyValue)};var simplifiedExtensionsSchema={appid:optional(copyValue),appidExclude:optional(copyValue),credProps:optional(copyValue)};var simplifiedClientExtensionResultsSchema={appid:optional(copyValue),appidExclude:optional(copyValue),credProps:optional(copyValue)};var credentialCreationOptions={publicKey:required({rp:required(copyValue),user:required({id:required(convertValue),name:required(copyValue),displayName:required(copyValue)}),challenge:required(convertValue),pubKeyCredParams:required(copyValue),timeout:optional(copyValue),excludeCredentials:optional([publicKeyCredentialDescriptorSchema]),authenticatorSelection:optional(copyValue),attestation:optional(copyValue),extensions:optional(simplifiedExtensionsSchema)}),signal:optional(copyValue)};var publicKeyCredentialWithAttestation={type:required(copyValue),id:required(copyValue),rawId:required(convertValue),authenticatorAttachment:optional(copyValue),response:required({clientDataJSON:required(convertValue),attestationObject:required(convertValue),transports:derived(copyValue,function(response){var _a;return((_a=response.getTransports)==null?void 0:_a.call(response))||[];})}),clientExtensionResults:derived(simplifiedClientExtensionResultsSchema,function(pkc){return pkc.getClientExtensionResults();})};var credentialRequestOptions={mediation:optional(copyValue),publicKey:required({challenge:required(convertValue),timeout:optional(copyValue),rpId:optional(copyValue),allowCredentials:optional([publicKeyCredentialDescriptorSchema]),userVerification:optional(copyValue),extensions:optional(simplifiedExtensionsSchema)}),signal:optional(copyValue)};var publicKeyCredentialWithAssertion={type:required(copyValue),id:required(copyValue),rawId:required(convertValue),authenticatorAttachment:optional(copyValue),response:required({clientDataJSON:required(convertValue),authenticatorData:required(convertValue),signature:required(convertValue),userHandle:required(convertValue)}),clientExtensionResults:derived(simplifiedClientExtensionResultsSchema,function(pkc){return pkc.getClientExtensionResults();})};function createRequestFromJSON(requestJSON){return convert(base64urlToBuffer,credentialCreationOptions,requestJSON);}function createResponseToJSON(credential){return convert(bufferToBase64url,publicKeyCredentialWithAttestation,credential);}function create(requestJSON){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee50(){var credential;return _regenerator().w(function(_context50){while(1)switch(_context50.n){case 0:_context50.n=1;return navigator.credentials.create(createRequestFromJSON(requestJSON));case 1:credential=_context50.v;return _context50.a(2,createResponseToJSON(credential));}},_callee50);}));}function getRequestFromJSON(requestJSON){return convert(base64urlToBuffer,credentialRequestOptions,requestJSON);}function getResponseToJSON(credential){return convert(bufferToBase64url,publicKeyCredentialWithAssertion,credential);}function get(requestJSON){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee51(){var credential;return _regenerator().w(function(_context51){while(1)switch(_context51.n){case 0:_context51.n=1;return navigator.credentials.get(getRequestFromJSON(requestJSON));case 1:credential=_context51.v;return _context51.a(2,getResponseToJSON(credential));}},_callee51);}));}var HeadlessWebAuthnClient=/*#__PURE__*/function(){function HeadlessWebAuthnClient(_networkClient,_subscriptionService,dfpProtectedAuth){var _this10=this;_classCallCheck(this,HeadlessWebAuthnClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.dfpProtectedAuth=dfpProtectedAuth;this.register=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this10,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee52(){var _a,_b,startResp,publicKeyCredentialCreationOptions,publicKey,credential,resp;return _regenerator().w(function(_context52){while(1)switch(_context52.n){case 0:validate('stytch.webauthn.register').isOptionalString('domain',options===null||options===void 0?void 0:options.domain).isOptionalString('authenticator_type',options===null||options===void 0?void 0:options.authenticator_type).isOptionalBoolean('is_passkey',options===null||options===void 0?void 0:options.is_passkey).isOptionalNumber('session_duration_minutes',options===null||options===void 0?void 0:options.session_duration_minutes).isOptionalString('override_id',options===null||options===void 0?void 0:options.override_id).isOptionalString('override_name',options===null||options===void 0?void 0:options.override_name).isOptionalString('override_display_name',options===null||options===void 0?void 0:options.override_display_name).isOptionalBoolean('use_base64_url_encoding',options===null||options===void 0?void 0:options.use_base64_url_encoding);_context52.n=1;return this._networkClient.fetchSDK({url:'/webauthn/register/start',method:'POST',body:{domain:(_a=options===null||options===void 0?void 0:options.domain)!==null&&_a!==void 0?_a:window.location.hostname,authenticator_type:(_b=options===null||options===void 0?void 0:options.authenticator_type)!==null&&_b!==void 0?_b:undefined,return_passkey_credential_options:options===null||options===void 0?void 0:options.is_passkey,override_id:options===null||options===void 0?void 0:options.override_id,override_name:options===null||options===void 0?void 0:options.override_name,override_display_name:options===null||options===void 0?void 0:options.override_display_name,user_agent:navigator.userAgent,use_base64_url_encoding:options===null||options===void 0?void 0:options.use_base64_url_encoding}});case 1:startResp=_context52.v;publicKeyCredentialCreationOptions=startResp.public_key_credential_creation_options;publicKey=JSON.parse(publicKeyCredentialCreationOptions);_context52.n=2;return create({publicKey:publicKey});case 2:credential=_context52.v;_context52.n=3;return this._networkClient.fetchSDK({url:'/webauthn/register',method:'POST',body:{public_key_credential:JSON.stringify(credential),session_duration_minutes:options===null||options===void 0?void 0:options.session_duration_minutes}});case 3:resp=_context52.v;return _context52.a(2,omitUser(resp));}},_callee52,this);}));});this.authenticate=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this10,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee53(){var _c,_d,_yield$this$dfpProtec10,dfp_telemetry_id,captcha_token,isLoggedIn,endpoint,startResp,publicKeyCredentialRequestOptions,abortController,credReqOptions,conditionalMediationCredReqOption,credential,authenticationData;return _regenerator().w(function(_context53){while(1)switch(_context53.n){case 0:validate('stytch.webauthn.authenticate').isOptionalString('domain',options.domain).isNumber('session_duration_minutes',options.session_duration_minutes).isOptionalBoolean('is_passkey',options.is_passkey).isOptionalObject('signal',options.signal);_context53.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec10=_context53.v;dfp_telemetry_id=_yield$this$dfpProtec10.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec10.captcha_token;if(!options.conditional_mediation){_context53.n=4;break;}_context53.n=2;return this.browserSupportsAutofill();case 2:if(_context53.v){_context53.n=3;break;}logger.error('Browser does not support WebAuthn autofill');return _context53.a(2,null);case 3:if(this.checkEligibleInputs()){_context53.n=4;break;}return _context53.a(2,null);case 4:isLoggedIn=!!this._subscriptionService.getSession();endpoint=isLoggedIn?'/webauthn/authenticate/start/secondary':'/webauthn/authenticate/start/primary';_context53.n=5;return this._networkClient.fetchSDK({url:endpoint,method:'POST',body:{domain:(_c=options.domain)!==null&&_c!==void 0?_c:window.location.hostname,return_passkey_credential_options:options===null||options===void 0?void 0:options.is_passkey}});case 5:startResp=_context53.v;publicKeyCredentialRequestOptions=startResp.public_key_credential_request_options;abortController=new AbortController();credReqOptions={publicKey:JSON.parse(publicKeyCredentialRequestOptions),signal:(_d=options.signal)!==null&&_d!==void 0?_d:abortController.signal};conditionalMediationCredReqOption=Object.assign(Object.assign({},credReqOptions),{mediation:'conditional'});_context53.n=6;return get(options.conditional_mediation?conditionalMediationCredReqOption:credReqOptions);case 6:credential=_context53.v;_context53.n=7;return this._networkClient.retriableFetchSDK({url:'/webauthn/authenticate',method:'POST',body:{public_key_credential:JSON.stringify(credential),session_duration_minutes:options.session_duration_minutes,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 7:authenticationData=_context53.v;return _context53.a(2,omitUser(authenticationData));}},_callee53,this);}));});this.checkEligibleInputs=function(){var eligibleInputs=document.querySelectorAll("input[autocomplete*='webauthn']");if(eligibleInputs.length<1){logger.error('No <input> with `"webauthn"` in its `autocomplete` attribute was detected');return false;}return true;};}return _createClass(HeadlessWebAuthnClient,[{key:"update",value:function update(options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee54(){var url;return _regenerator().w(function(_context54){while(1)switch(_context54.n){case 0:validate('stytch.webauthn.update').isString('webauthn_registration_id',options.webauthn_registration_id).isString('name',options.name);url='/webauthn/update/'+options.webauthn_registration_id;_context54.n=1;return this._networkClient.fetchSDK({url:url,method:'PUT',body:{name:options.name}});case 1:return _context54.a(2,_context54.v);}},_callee54,this);}));}},{key:"browserSupportsAutofill",value:function browserSupportsAutofill(){var _a,_b,_c;return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee55(){var _t0,_t1,_t10;return _regenerator().w(function(_context55){while(1)switch(_context55.n){case 0:_context55.n=1;return(_b=(_a=window.PublicKeyCredential)===null||_a===void 0?void 0:_a.isConditionalMediationAvailable)===null||_b===void 0?void 0:_b.call(_a);case 1:_t1=_c=_context55.v;_t0=_t1!==null;if(!_t0){_context55.n=2;break;}_t0=_c!==void 0;case 2:if(!_t0){_context55.n=3;break;}_t10=_c;_context55.n=4;break;case 3:_t10=false;case 4:return _context55.a(2,_t10);}},_callee55);}));}}]);}();var DefaultDynamicConfig$2=Promise.resolve({pkceRequiredForPasswordResets:false});var HeadlessPasswordClient=/*#__PURE__*/function(){function HeadlessPasswordClient(_networkClient,_subscriptionService,_pkceManager){var _this11=this;var _config=arguments.length>3&&arguments[3]!==undefined?arguments[3]:DefaultDynamicConfig$2;var dfpProtectedAuth=arguments.length>4?arguments[4]:undefined;_classCallCheck(this,HeadlessPasswordClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this._pkceManager=_pkceManager;this._config=_config;this.dfpProtectedAuth=dfpProtectedAuth;this.create=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee56(){var _yield$this$dfpProtec11,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context56){while(1)switch(_context56.n){case 0:validate('stytch.passwords.create').isString('password',options.password).isString('email',options.email).isNumber('session_duration_minutes',options.session_duration_minutes);_context56.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec11=_context56.v;dfp_telemetry_id=_yield$this$dfpProtec11.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec11.captcha_token;_context56.n=2;return this._networkClient.retriableFetchSDK({url:'/passwords',method:'POST',body:{email:options.email,password:options.password,session_duration_minutes:options.session_duration_minutes,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context56.v;return _context56.a(2,omitUser(resp));}},_callee56,this);}));});this.authenticate=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee57(){var _yield$this$dfpProtec12,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context57){while(1)switch(_context57.n){case 0:validate('stytch.passwords.authenticate').isString('password',options.password).isString('email',options.email).isNumber('session_duration_minutes',options.session_duration_minutes);_context57.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec12=_context57.v;dfp_telemetry_id=_yield$this$dfpProtec12.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec12.captcha_token;_context57.n=2;return this._networkClient.retriableFetchSDK({url:'/passwords/authenticate',method:'POST',body:{email:options.email,password:options.password,session_duration_minutes:options.session_duration_minutes,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context57.v;return _context57.a(2,omitUser(resp));}},_callee57,this);}));});this.resetByEmail=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee58(){var _yield$this$dfpProtec13,dfp_telemetry_id,captcha_token,pkPair,code_verifier,resp;return _regenerator().w(function(_context58){while(1)switch(_context58.n){case 0:validate('stytch.passwords.resetByEmail').isString('token',options.token).isString('password',options.password).isNumber('session_duration_minutes',options.session_duration_minutes);_context58.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec13=_context58.v;dfp_telemetry_id=_yield$this$dfpProtec13.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec13.captcha_token;_context58.n=2;return this._pkceManager.getPKPair();case 2:pkPair=_context58.v;code_verifier=pkPair===null||pkPair===void 0?void 0:pkPair.code_verifier;_context58.n=3;return this._networkClient.retriableFetchSDK({url:'/passwords/email/reset',method:'POST',body:{token:options.token,password:options.password,session_duration_minutes:options.session_duration_minutes,captcha_token:captcha_token,code_verifier:code_verifier,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 3:resp=_context58.v;this._pkceManager.clearPKPair();return _context58.a(2,omitUser(resp));}},_callee58,this);}));});this.resetByExistingPassword=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee59(){var _yield$this$dfpProtec14,dfp_telemetry_id,captcha_token,resp;return _regenerator().w(function(_context59){while(1)switch(_context59.n){case 0:validate('stytch.passwords.resetByExistingPassword').isString('email',options.email).isString('existing_password',options.existing_password).isString('new_password',options.new_password).isNumber('session_duration_minutes',options.session_duration_minutes);_context59.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec14=_context59.v;dfp_telemetry_id=_yield$this$dfpProtec14.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec14.captcha_token;_context59.n=2;return this._networkClient.retriableFetchSDK({url:'/passwords/existing_password/reset',method:'POST',body:{email:options.email,existing_password:options.existing_password,new_password:options.new_password,session_duration_minutes:options.session_duration_minutes,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP});case 2:resp=_context59.v;return _context59.a(2,omitUser(resp));}},_callee59,this);}));});this.resetBySession=this._subscriptionService.withUpdateSession(function(options){return __awaiter$1(_this11,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee60(){var _yield$this$dfpProtec15,dfp_telemetry_id,captcha_token;return _regenerator().w(function(_context60){while(1)switch(_context60.n){case 0:validate('stytch.passwords.resetBySession').isString('password',options.password);_context60.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec15=_context60.v;dfp_telemetry_id=_yield$this$dfpProtec15.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec15.captcha_token;return _context60.a(2,this._networkClient.retriableFetchSDK({url:'/passwords/session/reset',method:'POST',body:{password:options.password,session_duration_minutes:options.session_duration_minutes,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee60,this);}));});}return _createClass(HeadlessPasswordClient,[{key:"getCodeChallenge",value:function getCodeChallenge(){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee61(){var _yield$this$_config4,pkceRequiredForPasswordResets,keyPair;return _regenerator().w(function(_context61){while(1)switch(_context61.n){case 0:_context61.n=1;return this._config;case 1:_yield$this$_config4=_context61.v;pkceRequiredForPasswordResets=_yield$this$_config4.pkceRequiredForPasswordResets;if(pkceRequiredForPasswordResets){_context61.n=2;break;}return _context61.a(2,undefined);case 2:_context61.n=3;return this._pkceManager.getPKPair();case 3:keyPair=_context61.v;if(!keyPair){_context61.n=4;break;}return _context61.a(2,keyPair.code_challenge);case 4:_context61.n=5;return this._pkceManager.startPKCETransaction();case 5:keyPair=_context61.v;return _context61.a(2,keyPair.code_challenge);}},_callee61,this);}));}},{key:"resetByEmailStart",value:function resetByEmailStart(options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee62(){var code_challenge,_yield$this$dfpProtec16,dfp_telemetry_id,captcha_token;return _regenerator().w(function(_context62){while(1)switch(_context62.n){case 0:validate('stytch.passwords.resetByEmailStart').isString('email',options.email).isOptionalString('login_redirect_url',options.login_redirect_url).isOptionalString('reset_password_redirect_url',options.reset_password_redirect_url).isOptionalString('reset_password_template_id',options.reset_password_template_id).isOptionalNumber('reset_password_expiration_minutes',options.reset_password_expiration_minutes).isOptionalString('locale',options.locale);_context62.n=1;return this.getCodeChallenge();case 1:code_challenge=_context62.v;_context62.n=2;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 2:_yield$this$dfpProtec16=_context62.v;dfp_telemetry_id=_yield$this$dfpProtec16.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec16.captcha_token;return _context62.a(2,this._networkClient.retriableFetchSDK({url:'/passwords/email/reset/start',method:'POST',body:{email:options.email,login_redirect_url:options.login_redirect_url,reset_password_redirect_url:options.reset_password_redirect_url,reset_password_expiration_minutes:options.reset_password_expiration_minutes,reset_password_template_id:options.reset_password_template_id,locale:options.locale,code_challenge:code_challenge,captcha_token:captcha_token,dfp_telemetry_id:dfp_telemetry_id},retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee62,this);}));}},{key:"strengthCheck",value:function strengthCheck(options){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee63(){return _regenerator().w(function(_context63){while(1)switch(_context63.n){case 0:validate('stytch.passwords.strengthCheck').isOptionalString('email',options.email).isString('password',options.password);return _context63.a(2,this._networkClient.fetchSDK({url:'/passwords/strength_check',method:'POST',body:{email:options.email,password:options.password}}));}},_callee63,this);}));}}]);}();var HeadlessImpersonationClient=/*#__PURE__*/_createClass(function HeadlessImpersonationClient(_networkClient,_subscriptionService,dfpProtectedAuth){var _this12=this;_classCallCheck(this,HeadlessImpersonationClient);this._networkClient=_networkClient;this._subscriptionService=_subscriptionService;this.dfpProtectedAuth=dfpProtectedAuth;this.authenticate=this._subscriptionService.withUpdateSession(function(data){return __awaiter$1(_this12,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee64(){var _yield$this$dfpProtec17,dfp_telemetry_id,captcha_token;return _regenerator().w(function(_context64){while(1)switch(_context64.n){case 0:validate('stytch.impersonation.authenticate').isString('impersonation_token',data.impersonation_token);_context64.n=1;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();case 1:_yield$this$dfpProtec17=_context64.v;dfp_telemetry_id=_yield$this$dfpProtec17.dfp_telemetry_id;captcha_token=_yield$this$dfpProtec17.captcha_token;return _context64.a(2,this._networkClient.retriableFetchSDK({url:'/impersonation/authenticate',body:Object.assign(Object.assign({},data),{dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token}),method:'POST',retryCallback:this.dfpProtectedAuth.retryWithCaptchaAndDFP}));}},_callee64,this);}));});});var WILDCARD_ACTION='*';var RBACPolicy=/*#__PURE__*/function(){function RBACPolicy(roles,resources){var _this13=this;_classCallCheck(this,RBACPolicy);this.roles=roles;this.resources=resources;this.rolesByID={};roles.forEach(function(role){return _this13.rolesByID[role.role_id]=role;});}return _createClass(RBACPolicy,[{key:"mergeWithCustomRoles",value:function mergeWithCustomRoles(customRoles){var mergedRoles=[].concat(_toConsumableArray(this.roles),_toConsumableArray(customRoles));return new RBACPolicy(mergedRoles,this.resources);}},{key:"callerIsAuthorized",value:function callerIsAuthorized(memberRoles,resourceId,action){var _this14=this;return!!memberRoles.map(function(roleId){return _this14.rolesByID[roleId];}).filter(function(v){return v;}).flatMap(function(role){return role.permissions;}).filter(function(permission){return permission.resource_id===resourceId;}).find(function(permission){return permission.actions.includes(action)||permission.actions.includes(WILDCARD_ACTION);});}},{key:"allPermissionsForCaller",value:function allPermissionsForCaller(memberRoles){var _this15=this;var allPermsMap=Object.create(null);this.resources.forEach(function(resource){allPermsMap[resource.resource_id]={};resource.actions.forEach(function(action){allPermsMap[resource.resource_id][action]=_this15.callerIsAuthorized(memberRoles,resource.resource_id,action);});});return allPermsMap;}}],[{key:"fromJSON",value:function fromJSON(input){return new RBACPolicy(input.roles,input.resources);}}]);}();var HeadlessRBACClient=/*#__PURE__*/function(){function HeadlessRBACClient(cachedConfig,dynamicConfig,_subscriptionService){var _this16=this;_classCallCheck(this,HeadlessRBACClient);this._subscriptionService=_subscriptionService;this.isAuthorizedSync=function(resourceId,action){var _a;return!!((_a=_this16.cachedPolicy)===null||_a===void 0?void 0:_a.callerIsAuthorized(_this16.roleIds(),resourceId,action));};this.isAuthorized=function(resourceId,action){return _this16.policyPromise.then(function(policy){return policy.callerIsAuthorized(_this16.roleIds(),resourceId,action);});};this.cachedPolicy=cachedConfig.rbacPolicy?RBACPolicy.fromJSON(cachedConfig.rbacPolicy):null;this.policyPromise=dynamicConfig.then(function(data){if(!data.rbacPolicy){logger.error('Unable to retrieve RBAC policy from servers. Assuming caller has no permissions.');return new RBACPolicy([],[]);}_this16.cachedPolicy=RBACPolicy.fromJSON(data.rbacPolicy);return _this16.cachedPolicy;});}return _createClass(HeadlessRBACClient,[{key:"allPermissions",value:function allPermissions(){var _this17=this;return this.policyPromise.then(function(policy){return policy.allPermissionsForCaller(_this17.roleIds());});}},{key:"roleIds",value:function roleIds(){var _a;var user=this._subscriptionService.getUser();if(!user){return[];}return(_a=user.roles)!==null&&_a!==void 0?_a:[];}}]);}();var HeadlessIDPClient=/*#__PURE__*/_createClass(function HeadlessIDPClient(_networkClient){var _this18=this;_classCallCheck(this,HeadlessIDPClient);this._networkClient=_networkClient;this.oauthAuthorizeStart=function(data){return __awaiter$1(_this18,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee65(){return _regenerator().w(function(_context65){while(1)switch(_context65.n){case 0:return _context65.a(2,this._networkClient.fetchSDK({url:'/idp/oauth/authorize/start',method:'POST',body:data}));}},_callee65,this);}));};this.oauthAuthorizeSubmit=function(data){return __awaiter$1(_this18,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee66(){return _regenerator().w(function(_context66){while(1)switch(_context66.n){case 0:return _context66.a(2,this._networkClient.fetchSDK({url:'/idp/oauth/authorize/submit',method:'POST',body:data}));}},_callee66,this);}));};this.oauthLogoutStart=function(data){return __awaiter$1(_this18,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee67(){return _regenerator().w(function(_context67){while(1)switch(_context67.n){case 0:return _context67.a(2,this._networkClient.fetchSDK({url:"/oauth/logout/start",method:'POST',body:data}));}},_callee67,this);}));};});Promise.resolve({pkceRequiredForEmailMagicLinks:false});Promise.resolve({pkceRequiredForPasswordResets:false});var IframeHostClient=/*#__PURE__*/function(){function IframeHostClient(iframeURL){_classCallCheck(this,IframeHostClient);this.iframeURL=iframeURL;this.createIframe();}return _createClass(IframeHostClient,[{key:"createIframe",value:function createIframe(){var existingIframe=document.querySelector("[src~=\"".concat(this.iframeURL,"\"]"));if(!existingIframe){existingIframe=document.createElement('iframe');existingIframe.src=this.iframeURL;existingIframe.style.position='absolute';existingIframe.style.width='0';existingIframe.style.height='0';existingIframe.style.border='0';document.body.appendChild(existingIframe);}else{logger.warn(MULTIPLE_STYTCH_CLIENTS_DETECTED_WARNING);}if(existingIframe.dataset.loaded==='true'){this.frame=Promise.resolve(existingIframe);return;}this.frame=new Promise(function(resolve){existingIframe.addEventListener('load',function(){existingIframe.dataset.loaded='true';resolve(existingIframe);},{once:true});});}},{key:"call",value:function call(method,args){return __awaiter$1(this,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee165(){var _this37=this;var frame,channel;return _regenerator().w(function(_context165){while(1)switch(_context165.n){case 0:_context165.n=1;return this.frame;case 1:frame=_context165.v;channel=new MessageChannel();return _context165.a(2,new Promise(function(resolve,reject){var _a;channel.port1.onmessage=function(event){var resp=event.data;channel.port1.close();if(resp.success){resolve(resp.payload);}else{reject(ErrorMarshaller.unmarshall(resp.error));}};var message={method:method,args:args};(_a=frame.contentWindow)===null||_a===void 0?void 0:_a.postMessage(message,_this37.iframeURL,[channel.port2]);}));}},_callee165,this);}));}}]);}();var SearchDataManager=/*#__PURE__*/function(){function SearchDataManager(_networkClient,dfpProtectedAuth){_classCallCheck(this,SearchDataManager);this._networkClient=_networkClient;this.dfpProtectedAuth=dfpProtectedAuth;}return _createClass(SearchDataManager,[{key:"searchUser",value:function searchUser(email){var _this38=this;return this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha().then(function(_ref0){var dfp_telemetry_id=_ref0.dfp_telemetry_id,captcha_token=_ref0.captcha_token;return _this38._networkClient.fetchSDK({url:"/users/search",method:'POST',body:{email:email,dfp_telemetry_id:dfp_telemetry_id,captcha_token:captcha_token}});});}},{key:"searchMember",value:function searchMember(email,organization_id){return this._networkClient.fetchSDK({url:"/b2b/organizations/members/search",method:'POST',body:{email_address:email,organization_id:organization_id}});}}]);}();var shouldTryRefresh=function shouldTryRefresh(state){return!!(state===null||state===void 0?void 0:state.session);};var SessionManagerRegistry=/*#__PURE__*/function(){function SessionManagerRegistry(){_classCallCheck(this,SessionManagerRegistry);this.hasWarned=false;this.registry=new Map();}return _createClass(SessionManagerRegistry,[{key:"register",value:function register(key,sessionManager){var otherManager=this.registry.get(key);if(otherManager&&otherManager!==sessionManager){if(!this.hasWarned){logger.warn(MULTIPLE_STYTCH_CLIENTS_DETECTED_WARNING);this.hasWarned=true;}otherManager.cancelBackgroundRefresh();}this.registry.set(key,sessionManager);}},{key:"unregister",value:function unregister(publicToken,sessionManager){var otherManager=this.registry.get(publicToken);if(otherManager&&otherManager===sessionManager){this.registry["delete"](publicToken);}}}]);}();var SessionManager=/*#__PURE__*/function(){function SessionManager(_subscriptionService,_headlessSessionClient,_publicToken,_options){var _this39=this;_classCallCheck(this,SessionManager);this._subscriptionService=_subscriptionService;this._headlessSessionClient=_headlessSessionClient;this._publicToken=_publicToken;this._options=_options;this.timeout=null;this._onDataChange=function(state){if(state!=null&&state.sessionDurationMinutes){_this39.lastAuthenticationSessionDuration=state.sessionDurationMinutes;}if(shouldTryRefresh(state)){_this39.scheduleBackgroundRefresh();}else{_this39.cancelBackgroundRefresh();}};this._reauthenticateWithBackoff=function(){return __awaiter$1(_this39,void 0,void 0,/*#__PURE__*/_regenerator().m(function _callee166(){var count,options,_t56;return _regenerator().w(function(_context166){while(1)switch(_context166.p=_context166.n){case 0:count=0;case 1:_context166.p=2;options={session_duration_minutes:this._options.keepSessionAlive?this.lastAuthenticationSessionDuration:undefined};_context166.n=3;return this._headlessSessionClient.authenticate(options);case 3:return _context166.a(2,_context166.v);case 4:_context166.p=4;_t56=_context166.v;if(!SessionManager.isUnrecoverableError(_t56)){_context166.n=5;break;}return _context166.a(2,Promise.reject(_t56));case 5:count++;_context166.n=6;return new Promise(function(done){return setTimeout(done,SessionManager.timeoutForAttempt(count));});case 6:_context166.n=1;break;case 7:return _context166.a(2);}},_callee166,this,[[2,4]]);}));};this._subscriptionService.subscribeToState(this._onDataChange);}return _createClass(SessionManager,[{key:"register",value:function register(){SessionManager.registry.register(this._publicToken,this);}},{key:"unregister",value:function unregister(){SessionManager.registry.unregister(this._publicToken,this);}},{key:"performBackgroundRefresh",value:function performBackgroundRefresh(){var _this40=this;this._reauthenticateWithBackoff().then(function(){_this40.scheduleBackgroundRefresh();})["catch"](function(error){logger.warn('Session background refresh failed. Signalling to app that user is logged out.',{error:error});_this40._subscriptionService.destroySession();});}},{key:"scheduleBackgroundRefresh",value:function scheduleBackgroundRefresh(){var _this41=this;this.cancelBackgroundRefresh();this.register();this.timeout=setTimeout(function(){_this41.performBackgroundRefresh();},SessionManager.REFRESH_INTERVAL_MS);}},{key:"cancelBackgroundRefresh",value:function cancelBackgroundRefresh(){if(this.timeout!==null){this.unregister();clearTimeout(this.timeout);this.timeout=null;}}}],[{key:"timeoutForAttempt",value:function timeoutForAttempt(count){count=Math.min(count,7);var jitter=Math.floor(Math.random()*350)-175;var delayMS=2000*Math.pow(2,count);return jitter+delayMS;}},{key:"isUnrecoverableError",value:function isUnrecoverableError(error){return UNRECOVERABLE_ERROR_TYPES.includes(error.error_type);}}]);}();SessionManager.REFRESH_INTERVAL_MS=1000*60*3;SessionManager.registry=new SessionManagerRegistry();var StateChangeClient=/*#__PURE__*/_createClass(function StateChangeClient(_subscriptionService,emptyState){var _this42=this;_classCallCheck(this,StateChangeClient);this._subscriptionService=_subscriptionService;this.emptyState=emptyState;this.onStateChange=function(callback){return _this42._subscriptionService.subscribeToState(function(state){callback(state!==null&&state!==void 0?state:_this42.emptyState);});};});var VERTICAL_B2B='B2B';var BOOTSTRAP_CACHE_KEY='bootstrap';var DEFAULT_BOOTSTRAP=function DEFAULT_BOOTSTRAP(){return{displayWatermark:false,projectName:null,cnameDomain:null,emailDomains:['stytch.com'],captchaSettings:{enabled:false},pkceRequiredForEmailMagicLinks:false,pkceRequiredForPasswordResets:false,pkceRequiredForOAuth:false,pkceRequiredForSso:false,slugPattern:null,createOrganizationEnabled:false,passwordConfig:null,runDFPProtectedAuth:false,rbacPolicy:null,siweRequiredForCryptoWallets:false,vertical:null};};var BootstrapDataManager=/*#__PURE__*/function(){function BootstrapDataManager(_publicToken,_networkClient,_dataLayer){var _this19=this;_classCallCheck2(this,BootstrapDataManager);this._publicToken=_publicToken;this._networkClient=_networkClient;this._dataLayer=_dataLayer;this._bootstrapDataPromise=this._networkClient.fetchSDK({url:"/projects/bootstrap/".concat(this._publicToken),method:'GET'}).then(BootstrapDataManager.mapBootstrapData).then(function(data){_this19._dataLayer.setItem(BOOTSTRAP_CACHE_KEY,JSON.stringify(data));return data;})["catch"](function(error){logger.error(error);return DEFAULT_BOOTSTRAP();});}return _createClass2(BootstrapDataManager,[{key:"getSync",value:function getSync(){var cached=this._dataLayer.getItem(BOOTSTRAP_CACHE_KEY);if(cached===null){return DEFAULT_BOOTSTRAP();}try{return JSON.parse(cached);}catch(_a){return DEFAULT_BOOTSTRAP();}}},{key:"getAsync",value:function getAsync(){return this._bootstrapDataPromise;}}],[{key:"mapBootstrapData",value:function mapBootstrapData(response){var _a,_b;var passwordConfig=response.password_config!==null?{ludsComplexity:response.password_config.luds_complexity,ludsMinimumCount:response.password_config.luds_minimum_count}:null;return{projectName:response.project_name,displayWatermark:!response.disable_sdk_watermark,captchaSettings:response.captcha_settings,cnameDomain:response.cname_domain,emailDomains:response.email_domains,pkceRequiredForEmailMagicLinks:response.pkce_required_for_email_magic_links,pkceRequiredForPasswordResets:response.pkce_required_for_password_resets,pkceRequiredForOAuth:response.pkce_required_for_oauth,pkceRequiredForSso:response.pkce_required_for_sso,slugPattern:response.slug_pattern,createOrganizationEnabled:response.create_organization_enabled,passwordConfig:passwordConfig,runDFPProtectedAuth:(_a=response.dfp_protected_auth_enabled)!==null&&_a!==void 0?_a:false,dfpProtectedAuthMode:response.dfp_protected_auth_mode,rbacPolicy:(_b=response.rbac_policy)!==null&&_b!==void 0?_b:null,siweRequiredForCryptoWallets:response.siwe_required_for_crypto_wallets,vertical:response.vertical};}}]);}();function __rest(s,e){var t={};for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0)t[p]=s[p];if(s!=null&&typeof Object.getOwnPropertySymbols==="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++){if(e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i]))t[p[i]]=s[p[i]];}return t;}function __awaiter(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});}return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}}function rejected(value){try{step(generator["throw"](value));}catch(e){reject(e);}}function step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);}step((generator=generator.apply(thisArg,_arguments||[])).next());});}typeof SuppressedError==="function"?SuppressedError:function(error,suppressed,message){var e=new Error(message);return e.name="SuppressedError",e.error=error,e.suppressed=suppressed,e;};var loadRecaptchaClient=function loadRecaptchaClient(siteKey){return loadESModule("https://www.google.com/recaptcha/enterprise.js?render=".concat(siteKey),function(){return window.grecaptcha.enterprise;});};var CaptchaProvider=/*#__PURE__*/_createClass2(function CaptchaProvider(bootstrapPromise){var _this20=this;_classCallCheck2(this,CaptchaProvider);this.bootstrapPromise=bootstrapPromise;this.executeRecaptcha=function(){return __awaiter(_this20,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee0(){var _yield$this$state4,captchaClient,configured,siteKey;return _regenerator2().w(function(_context0){while(1)switch(_context0.n){case 0:_context0.n=1;return this.state;case 1:_yield$this$state4=_context0.v;captchaClient=_yield$this$state4.captchaClient;configured=_yield$this$state4.configured;siteKey=_yield$this$state4.siteKey;if(configured){_context0.n=2;break;}return _context0.a(2,undefined);case 2:_context0.n=3;return new Promise(function(resolve){return captchaClient.ready(resolve);});case 3:return _context0.a(2,captchaClient.execute(siteKey,{action:'LOGIN'}));}},_callee0,this);}));};this.state=bootstrapPromise.then(function(bootstrapData){return __awaiter(_this20,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee1(){var _t3,_t4;return _regenerator2().w(function(_context1){while(1)switch(_context1.n){case 0:if(bootstrapData.captchaSettings.enabled){_context1.n=1;break;}return _context1.a(2,{configured:false});case 1:_context1.n=2;return loadRecaptchaClient(bootstrapData.captchaSettings.siteKey);case 2:_t3=_context1.v;_t4=bootstrapData.captchaSettings.siteKey;return _context1.a(2,{configured:true,captchaClient:_t3,siteKey:_t4});}},_callee1);}));});});var ClientsideServicesProvider=/*#__PURE__*/function(){function ClientsideServicesProvider(iframeURL){var _this21=this;_classCallCheck2(this,ClientsideServicesProvider);this.iframeURL=iframeURL;this.oneTapStart=function(req){return _this21.call('oneTapStart',req);};this.oneTapSubmit=function(req){return _this21.call('oneTapSubmit',req);};this.parsedPhoneNumber=function(req){return _this21.call('parsedPhoneNumber',req);};}return _createClass2(ClientsideServicesProvider,[{key:"frameClient",get:function get(){var _a;this._frameClient=(_a=this._frameClient)!==null&&_a!==void 0?_a:new IframeHostClient(this.iframeURL);return this._frameClient;}},{key:"call",value:function call(handlerName,req){return this.frameClient.call(handlerName,[req]);}}]);}();var HeadlessOAuthClient=/*#__PURE__*/function(_HeadlessOAuthClient$){function HeadlessOAuthClient(_networkClient,_subscriptionService,_pkceManager,_dynamicConfig,_config,_oneTap){var _this22;_classCallCheck2(this,HeadlessOAuthClient);_this22=_callSuper2(this,HeadlessOAuthClient,[_networkClient,_subscriptionService,_pkceManager,_dynamicConfig,_config]);_this22._oneTap=_oneTap;_this22.startOneTap=function(options){return __awaiter(_this22,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee10(){var clientResult,client,onSuccessCallback;return _regenerator2().w(function(_context10){while(1)switch(_context10.n){case 0:_context10.n=1;return this._oneTap.createOneTapClient();case 1:clientResult=_context10.v;if(clientResult.success){_context10.n=2;break;}throw new Error("One Tap could not load: ".concat(clientResult.reason));case 2:client=clientResult.client;onSuccessCallback=this._oneTap.createOnSuccessHandler({signupRedirectUrl:options.signup_redirect_url,loginRedirectUrl:options.login_redirect_url,onSuccess:this._oneTap.redirectOnSuccess});return _context10.a(2,client.render({style:{position:OneTapPositions.floating},onOneTapCancelled:options.onOneTapCancelled,callback:onSuccessCallback,cancelOnTapOutside:options.cancel_on_tap_outside}));}},_callee10,this);}));};_this22.googleOneTap={start:_this22.startOneTap};return _this22;}_inherits2(HeadlessOAuthClient,_HeadlessOAuthClient$);return _createClass2(HeadlessOAuthClient);}(HeadlessOAuthClient$1);var version="5.44.2";var NetworkClient=/*#__PURE__*/function(){function NetworkClient(_publicToken,_subscriptionDataLayer,_liveAPIURL,_testAPIURL,additionalTelemetryDataFn){_classCallCheck2(this,NetworkClient);this._publicToken=_publicToken;this._subscriptionDataLayer=_subscriptionDataLayer;this.additionalTelemetryDataFn=additionalTelemetryDataFn;this.updateSessionToken=function(){return null;};this.baseURL=_liveAPIURL;if(isTestPublicToken(_publicToken)){this.baseURL=_testAPIURL;}this.eventLogger=new EventLogger({maxBatchSize:DEFAULT_MAX_BATCH_SIZE,intervalDurationMs:DEFAULT_INTERVAL_DURATION_MS,logEventURL:this.buildSDKUrl('/events')});}return _createClass2(NetworkClient,[{key:"logEvent",value:function logEvent(_ref7){var name=_ref7.name,details=_ref7.details,_ref7$error=_ref7.error,error=_ref7$error===void 0?{}:_ref7$error;this.eventLogger.logEvent(this.createTelemetryBlob(),{public_token:this._publicToken,event_name:name,details:details,error_code:error.error_code,error_description:error.error_description,http_status_code:error.http_status_code});}},{key:"createTelemetryBlob",value:function createTelemetryBlob(){return Object.assign(Object.assign({event_id:createEventId(),app_session_id:createAppSessionId(),persistent_id:createPersistentId(),client_sent_at:new Date().toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},this.additionalTelemetryDataFn()),{app:{identifier:window.location.hostname},sdk:{identifier:'Stytch.js Javascript SDK',version:version}});}},{key:"fetchSDK",value:function fetchSDK(_ref8){var url=_ref8.url,body=_ref8.body,method=_ref8.method;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee11(){var sessionToken,basicAuthHeader,xSDKClientHeader,xSDKParentHostHeader;return _regenerator2().w(function(_context11){while(1)switch(_context11.n){case 0:sessionToken=this._subscriptionDataLayer.readSessionCookie().session_token;basicAuthHeader='Basic '+window.btoa(this._publicToken+':'+(sessionToken||this._publicToken));xSDKClientHeader=window.btoa(JSON.stringify(this.createTelemetryBlob()));xSDKParentHostHeader=window.location.origin;return _context11.a(2,baseFetchSDK({basicAuthHeader:basicAuthHeader,body:body,finalURL:this.buildSDKUrl(url),method:method,xSDKClientHeader:xSDKClientHeader,xSDKParentHostHeader:xSDKParentHostHeader}));}},_callee11,this);}));}},{key:"submitFormSDK",value:function submitFormSDK(_ref9){var url=_ref9.url,body=_ref9.body,method=_ref9.method;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee68(){var sessionToken,basicAuthHeader,xSDKClientHeader,xSDKParentHostHeader;return _regenerator2().w(function(_context68){while(1)switch(_context68.n){case 0:sessionToken=this._subscriptionDataLayer.readSessionCookie().session_token;basicAuthHeader='Basic '+window.btoa(this._publicToken+':'+(sessionToken||this._publicToken));xSDKClientHeader=window.btoa(JSON.stringify(this.createTelemetryBlob()));xSDKParentHostHeader=window.location.origin;return _context68.a(2,baseSubmitFormSDK({basicAuthHeader:basicAuthHeader,body:body,finalURL:this.buildSDKUrl(url),method:method,xSDKClientHeader:xSDKClientHeader,xSDKParentHostHeader:xSDKParentHostHeader}));}},_callee68,this);}));}},{key:"retriableFetchSDK",value:function retriableFetchSDK(_ref1){var url=_ref1.url,body=_ref1.body,method=_ref1.method,retryCallback=_ref1.retryCallback;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee69(){var sessionToken,basicAuthHeader,xSDKClientHeader,xSDKParentHostHeader;return _regenerator2().w(function(_context69){while(1)switch(_context69.n){case 0:sessionToken=this._subscriptionDataLayer.readSessionCookie().session_token;basicAuthHeader='Basic '+window.btoa(this._publicToken+':'+(sessionToken||this._publicToken));xSDKClientHeader=window.btoa(JSON.stringify(this.createTelemetryBlob()));xSDKParentHostHeader=window.location.origin;return _context69.a(2,_retriableFetchSDK({basicAuthHeader:basicAuthHeader,body:body,finalURL:this.buildSDKUrl(url),method:method,xSDKClientHeader:xSDKClientHeader,xSDKParentHostHeader:xSDKParentHostHeader,retryCallback:retryCallback}));}},_callee69,this);}));}},{key:"buildSDKUrl",value:function buildSDKUrl(url){return"".concat(this.baseURL,"/sdk/v1").concat(url);}}]);}();var navigatorSupportsFedCM=typeof window!=='undefined'&&'IdentityCredential'in window;var getConfiguredEmbeddedMode=function getConfiguredEmbeddedMode(position){if(position===OneTapPositions.forceLegacyEmbedded){return'force';}if(position===OneTapPositions.embeddedOnly||position===OneTapPositions.embedded||position===OneTapPositions.floatingOrEmbedded){return true;}return false;};var getShouldRenderEmbeddedOneTap=function getShouldRenderEmbeddedOneTap(position){var embeddedMode=getConfiguredEmbeddedMode(position);return embeddedMode==='force'||embeddedMode&&!navigatorSupportsFedCM;};var getShouldRenderFloatingOneTap=function getShouldRenderFloatingOneTap(position){return position!==OneTapPositions.embeddedOnly&&!getShouldRenderEmbeddedOneTap(position);};var getRenderedOneTapMode=function getRenderedOneTapMode(position){var embeddedMode=getConfiguredEmbeddedMode(position);if(embeddedMode==='force'||embeddedMode&&!navigatorSupportsFedCM){return'embedded';}if(position!==OneTapPositions.embeddedOnly){return'floating';}return false;};var GoogleOneTapClient=/*#__PURE__*/function(){function GoogleOneTapClient(_googleClient,_clientId){_classCallCheck2(this,GoogleOneTapClient);this._googleClient=_googleClient;this._clientId=_clientId;}return _createClass2(GoogleOneTapClient,[{key:"cancel",value:function cancel(){this._googleClient.cancel();}},{key:"render",value:function render(_ref10){var callback=_ref10.callback,onOneTapCancelled=_ref10.onOneTapCancelled,style=_ref10.style,_ref10$cancelOnTapOut=_ref10.cancelOnTapOutside,cancelOnTapOutside=_ref10$cancelOnTapOut===void 0?true:_ref10$cancelOnTapOut;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee70(){var _this23=this;var embeddedMode,shouldRenderEmbeddedOneTap,config;return _regenerator2().w(function(_context70){while(1)switch(_context70.n){case 0:embeddedMode=getConfiguredEmbeddedMode(style.position);shouldRenderEmbeddedOneTap=getShouldRenderEmbeddedOneTap(style.position);config={client_id:this._clientId,callback:callback,auto_select:false,context:'use',itp_support:true,use_fedcm_for_prompt:embeddedMode!=='force',cancel_on_tap_outside:cancelOnTapOutside};if(shouldRenderEmbeddedOneTap){config.prompt_parent_id='google-parent-prompt';config.cancel_on_tap_outside=false;}this._googleClient.initialize(config);return _context70.a(2,new Promise(function(resolve){_this23._googleClient.prompt(function(notification){var _a,_b,_c,_d,_e;if(notification.isSkippedMoment()){var reason=(_b=(_a=notification.getSkippedReason)===null||_a===void 0?void 0:_a.call(notification))!==null&&_b!==void 0?_b:'unknown_reason';if(reason==='user_cancel'){onOneTapCancelled===null||onOneTapCancelled===void 0?void 0:onOneTapCancelled();}return resolve({success:false,reason:reason});}if(!notification.isNotDisplayed&&shouldRenderEmbeddedOneTap||((_c=notification.isNotDisplayed)===null||_c===void 0?void 0:_c.call(notification))){return resolve({success:false,reason:(_e=(_d=notification.getNotDisplayedReason)===null||_d===void 0?void 0:_d.call(notification))!==null&&_e!==void 0?_e:'unknown_reason'});}if(!notification.isDismissedMoment()){_this23.styleFrame(shouldRenderEmbeddedOneTap);return resolve({success:true});}});}));}},_callee70,this);}));}},{key:"styleFrame",value:function styleFrame(shouldRenderEmbeddedOneTap){if(!shouldRenderEmbeddedOneTap){return;}Array.from(document.getElementsByTagName('iframe')).forEach(function(frame){if(frame.src.includes(GOOGLE_ONE_TAP_HOST)){frame.style.width='100%';}});}}]);}();var loadGoogleOneTapClient=function loadGoogleOneTapClient(){return loadESModule(GOOGLE_ONE_TAP_SCRIPT_URL,function(){return window.google.accounts.id;});};var OneTapProvider=/*#__PURE__*/function(){function OneTapProvider(_publicToken,clientsideServices){var _this24=this;_classCallCheck2(this,OneTapProvider);this._publicToken=_publicToken;this.clientsideServices=clientsideServices;this.createOnSuccessHandler=function(_ref11){var loginRedirectUrl=_ref11.loginRedirectUrl,signupRedirectUrl=_ref11.signupRedirectUrl,onSuccess=_ref11.onSuccess;return function(response){return __awaiter(_this24,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee71(){var credential,_yield$this$submitGoo,redirect_url;return _regenerator2().w(function(_context71){while(1)switch(_context71.n){case 0:credential=response.credential;_context71.n=1;return this.submitGoogleOneTapToken({credential:credential,loginRedirectUrl:loginRedirectUrl,signupRedirectUrl:signupRedirectUrl});case 1:_yield$this$submitGoo=_context71.v;redirect_url=_yield$this$submitGoo.redirect_url;onSuccess(redirect_url);case 2:return _context71.a(2);}},_callee71,this);}));};};this.redirectOnSuccess=function(redirect_url){window.location.href=redirect_url;};}return _createClass2(OneTapProvider,[{key:"createOneTapClient",value:function createOneTapClient(){return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee72(){var googleClientId,_yield$this$fetchGoog,err,client,_t5,_t6,_t11,_t12;return _regenerator2().w(function(_context72){while(1)switch(_context72.p=_context72.n){case 0:_context72.p=0;_context72.n=1;return this.fetchGoogleStart();case 1:_yield$this$fetchGoog=_context72.v;googleClientId=_yield$this$fetchGoog.googleClientId;_context72.n=3;break;case 2:_context72.p=2;_t5=_context72.v;err=StytchAPIError.from(_t5);return _context72.a(2,{success:false,reason:err.error_type});case 3:if(!(googleClientId==='')){_context72.n=4;break;}return _context72.a(2,{success:false,reason:'oauth_config_not_found'});case 4:_t6=GoogleOneTapClient;_context72.n=5;return loadGoogleOneTapClient();case 5:_t11=_context72.v;_t12=googleClientId;client=new _t6(_t11,_t12);return _context72.a(2,{success:true,client:client});}},_callee72,this,[[0,2]]);}));}},{key:"fetchGoogleStart",value:function fetchGoogleStart(){if(this.googleConfig){return this.googleConfig;}this.googleConfig=this.clientsideServices.oneTapStart({publicToken:this._publicToken});return this.googleConfig;}},{key:"submitGoogleOneTapToken",value:function submitGoogleOneTapToken(_ref12){var credential=_ref12.credential,loginRedirectUrl=_ref12.loginRedirectUrl,signupRedirectUrl=_ref12.signupRedirectUrl;return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee73(){var _yield$this$fetchGoog2,oauthCallbackId;return _regenerator2().w(function(_context73){while(1)switch(_context73.n){case 0:_context73.n=1;return this.fetchGoogleStart();case 1:_yield$this$fetchGoog2=_context73.v;oauthCallbackId=_yield$this$fetchGoog2.oauthCallbackId;return _context73.a(2,this.clientsideServices.oneTapSubmit({publicToken:this._publicToken,idToken:credential,loginRedirectURL:loginRedirectUrl,oauthCallbackID:oauthCallbackId,signupRedirectURL:signupRedirectUrl}));}},_callee73,this);}));}}],[{key:"willGoogleOneTapShowEmbedded",value:function willGoogleOneTapShowEmbedded(){var ua=arguments.length>0&&arguments[0]!==undefined?arguments[0]:navigator.userAgent;var uaContains=function uaContains(userAgent,searchString){return userAgent.indexOf(searchString)!==-1;};var isTabletUA=uaContains(ua,'iPad')||uaContains(ua,'Android')&&!uaContains(ua,'Mobile')||uaContains(ua,'Silk');var isMobileUA=uaContains(ua,'iPod')||uaContains(ua,'iPhone')||uaContains(ua,'Android')||uaContains(ua,'IEMobile');return!isTabletUA&&isMobileUA;}}]);}();var PKCE_VERIFIER_STORAGE_KEY='PKCE_VERIFIER';function toHex(n){var str=n.toString(16);if(str.length===1){str='0'+str;}return str;}function base64URLEncode(buf){var _String$fromCharCode;return btoa((_String$fromCharCode=String.fromCharCode).call.apply(_String$fromCharCode,[null].concat(_toConsumableArray2(new Uint8Array(buf))))).replace(/\+/g,'-').replace(/\//g,'_').replace(/=+$/,'');}var PKCEManager=/*#__PURE__*/function(){function PKCEManager(_dataLayer,namespace){_classCallCheck2(this,PKCEManager);this._dataLayer=_dataLayer;this.namespace=namespace;}return _createClass2(PKCEManager,[{key:"key",value:function key(){return"".concat(PKCE_VERIFIER_STORAGE_KEY,":").concat(this.namespace);}},{key:"startPKCETransaction",value:function startPKCETransaction(){return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee74(){var keyPair;return _regenerator2().w(function(_context74){while(1)switch(_context74.n){case 0:_context74.n=1;return PKCEManager.createProofkeyPair();case 1:keyPair=_context74.v;this._dataLayer.setItem(this.key(),JSON.stringify(keyPair));return _context74.a(2,keyPair);}},_callee74,this);}));}},{key:"getPKPair",value:function getPKPair(){var serialized=this._dataLayer.getItem(this.key());if(serialized===null){return undefined;}try{return JSON.parse(serialized);}catch(_a){logger.warn('Found malformed Proof Key pair in localstorage.');return undefined;}}},{key:"clearPKPair",value:function clearPKPair(){return this._dataLayer.removeItem(this.key());}}],[{key:"createProofkeyPair",value:function createProofkeyPair(){return __awaiter(this,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee75(){var bytes,codeVerifier,digest;return _regenerator2().w(function(_context75){while(1)switch(_context75.n){case 0:bytes=new Uint32Array(16);window.crypto.getRandomValues(bytes);codeVerifier=Array.from(bytes).map(toHex).join('');_context75.n=1;return window.crypto.subtle.digest('SHA-256',new TextEncoder().encode(codeVerifier));case 1:digest=_context75.v;return _context75.a(2,{code_challenge:base64URLEncode(digest),code_verifier:codeVerifier});}},_callee75);}));}}]);}();/*! js-cookie v3.0.1 | MIT */function assign(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){target[key]=source[key];}}return target;}var defaultConverter={read:function read(value){if(value[0]==='"'){value=value.slice(1,-1);}return value.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);},write:function write(value){return encodeURIComponent(value).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent);}};function init(converter,defaultAttributes){function set(key,value,attributes){if(typeof document==='undefined'){return;}attributes=assign({},defaultAttributes,attributes);if(typeof attributes.expires==='number'){attributes.expires=new Date(Date.now()+attributes.expires*864e5);}if(attributes.expires){attributes.expires=attributes.expires.toUTCString();}key=encodeURIComponent(key).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var stringifiedAttributes='';for(var attributeName in attributes){if(!attributes[attributeName]){continue;}stringifiedAttributes+='; '+attributeName;if(attributes[attributeName]===true){continue;}stringifiedAttributes+='='+attributes[attributeName].split(';')[0];}return document.cookie=key+'='+converter.write(value,key)+stringifiedAttributes;}function get(key){if(typeof document==='undefined'||arguments.length&&!key){return;}var cookies=document.cookie?document.cookie.split('; '):[];var jar={};for(var i=0;i<cookies.length;i++){var parts=cookies[i].split('=');var value=parts.slice(1).join('=');try{var foundKey=decodeURIComponent(parts[0]);jar[foundKey]=converter.read(value,foundKey);if(key===foundKey){break;}}catch(e){}}return key?jar[key]:jar;}return Object.create({set:set,get:get,remove:function remove(key,attributes){set(key,'',assign({},attributes,{expires:-1}));},withAttributes:function withAttributes(attributes){return init(this.converter,assign({},this.attributes,attributes));},withConverter:function withConverter(converter){return init(assign({},this.converter,converter),this.attributes);}},{attributes:{value:Object.freeze(defaultAttributes)},converter:{value:Object.freeze(converter)}});}var api=init(defaultConverter,{path:'/'});var createDeepEqual=function createDeepEqual(){var _ref13=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref13$KEYS_TO_EXCLUD=_ref13.KEYS_TO_EXCLUDE,KEYS_TO_EXCLUDE=_ref13$KEYS_TO_EXCLUD===void 0?[]:_ref13$KEYS_TO_EXCLUD;var _deepEqual=function deepEqual(a,b){if(_typeof2(a)!==_typeof2(b))return false;if(a===null||b===null)return a===b;if(_typeof2(a)==='object'){if(Object.keys(a).length!==Object.keys(b).length||Object.keys(a).some(function(k){return!(k in b);}))return false;return Object.entries(a).filter(function(_ref14){var _ref15=_slicedToArray2(_ref14,1),k=_ref15[0];return!KEYS_TO_EXCLUDE.includes(k);}).every(function(_ref16){var _ref17=_slicedToArray2(_ref16,2),k=_ref17[0],v=_ref17[1];return _deepEqual(v,b[k]);});}return a===b;};return _deepEqual;};var EMAIL_REGEX=/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;var convertMagicLinkOptions=function convertMagicLinkOptions(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return{signup_magic_link_url:options.signupRedirectURL,signup_expiration_minutes:options.signupExpirationMinutes,login_magic_link_url:options.loginRedirectURL,login_expiration_minutes:options.loginExpirationMinutes,login_template_id:options.loginTemplateId,signup_template_id:options.signupTemplateId,locale:options.locale};};var convertPasswordResetOptions=function convertPasswordResetOptions(email){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return{email:email,login_redirect_url:options.loginRedirectURL,login_expiration_minutes:options.loginExpirationMinutes,reset_password_redirect_url:options.resetPasswordRedirectURL,reset_password_expiration_minutes:options.resetPasswordExpirationMinutes,reset_password_template_id:options.resetPasswordTemplateId,locale:options.locale};};var debounce=function debounce(func){var waitFor=arguments.length>1&&arguments[1]!==undefined?arguments[1]:500;var timeout;var debounced=function debounced(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4];}clearTimeout(timeout);timeout=setTimeout(function(){return func.apply(void 0,args);},waitFor);};return debounced;};var isLocalhost=function isLocalhost(){return Boolean(window.location.hostname==='localhost'||window.location.hostname==='[::1]'||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));};var hasMultipleCookies=function hasMultipleCookies(cookieName){var cookiePairs=document.cookie?document.cookie.split('; '):[];var matchedCookies=cookiePairs.filter(function(pair){var _pair$split=pair.split('='),_pair$split2=_slicedToArray2(_pair$split,1),name=_pair$split2[0];return cookieName===name;});return matchedCookies.length>1;};var PERSISTENT_STORAGE_KEY_PREFIX='stytch_sdk_state_';var getPersistentStorageKey=function getPersistentStorageKey(publicToken,key){return"".concat(PERSISTENT_STORAGE_KEY_PREFIX).concat(publicToken).concat(key?"::".concat(key):'');};function makeSafeStorage(storage){if(storage==null){return{getItem:function getItem(){return null;},removeItem:function removeItem(){},setItem:function setItem(){}};}return{getItem:function getItem(publicKey,key){var persistentStorageKey=getPersistentStorageKey(publicKey,key);try{return storage.getItem(persistentStorageKey);}catch(_a){return null;}},setItem:function setItem(publicKey,key,value){var persistentStorageKey=getPersistentStorageKey(publicKey,key);try{if(value)storage.setItem(persistentStorageKey,value);}catch(_a){}},removeItem:function removeItem(publicKey,key){var persistentStorageKey=getPersistentStorageKey(publicKey,key);try{storage.removeItem(persistentStorageKey);}catch(_a){}}};}var safeLocalStorage=makeSafeStorage(globalThis.localStorage);var safeSessionStorage=makeSafeStorage(globalThis.sessionStorage);function getKeyBoundStorage(storage,publicToken){return{getItem:function getItem(key){return storage.getItem(publicToken,key);},setItem:function setItem(key,value){storage.setItem(publicToken,key,value);},removeItem:function removeItem(key){storage.removeItem(publicToken,key);}};}var STYTCH_SESSION_COOKIE='stytch_session';var STYTCH_SESSION_JWT_COOKIE='stytch_session_jwt';var STYTCH_INTERMEDIATE_SESSION_TOKEN_COOKIE='stytch_intermediate_session_token';var SEEN_DOMAINS_KEY='seen_domains';var SubscriptionDataLayer=/*#__PURE__*/function(){function SubscriptionDataLayer(publicToken,options){_classCallCheck2(this,SubscriptionDataLayer);this._opaqueTokenCookieName=null;this._jwtCookieName=null;this._cookiePath=null;this._domain=null;this._cookieAvailableToSubdomains=false;this._istCookieName=null;this.publicToken=publicToken;this.state=null;this.stateKeysUpdated=new Set();this.subscriptions={};this._localStorage=getKeyBoundStorage(safeLocalStorage,publicToken);this.browserSessionStorage=getKeyBoundStorage(safeSessionStorage,publicToken);if(options===null||options===void 0?void 0:options.cookieOptions){this._opaqueTokenCookieName=options.cookieOptions.opaqueTokenCookieName||null;this._jwtCookieName=options.cookieOptions.jwtCookieName||null;this._cookiePath=options.cookieOptions.path||null;this._domain=options.cookieOptions.domain||null;this._cookieAvailableToSubdomains=options.cookieOptions.availableToSubdomains||false;this._istCookieName=options.cookieOptions.istCookieName||null;}var localStorageState=this._localStorage.getItem('');if(!localStorageState){return;}var parsedState;try{parsedState=JSON.parse(localStorageState);}catch(_a){this.syncToLocalStorage();return;}this.state=parsedState;}return _createClass2(SubscriptionDataLayer,[{key:"opaqueTokenCookieName",get:function get(){var _a;return(_a=this._opaqueTokenCookieName)!==null&&_a!==void 0?_a:STYTCH_SESSION_COOKIE;}},{key:"jwtCookieName",get:function get(){var _a;return(_a=this._jwtCookieName)!==null&&_a!==void 0?_a:STYTCH_SESSION_JWT_COOKIE;}},{key:"istCookieName",get:function get(){var _a;return(_a=this._istCookieName)!==null&&_a!==void 0?_a:STYTCH_INTERMEDIATE_SESSION_TOKEN_COOKIE;}},{key:"readSessionCookie",value:function readSessionCookie(){return{session_token:api.get(this.opaqueTokenCookieName),session_jwt:api.get(this.jwtCookieName)};}},{key:"readIntermediateSessionTokenCookie",value:function readIntermediateSessionTokenCookie(){return api.get(this.istCookieName);}},{key:"writeSessionCookie",value:function writeSessionCookie(stateDiff){var _a,_b,_c,_d;var state=stateDiff.state,session_token=stateDiff.session_token,session_jwt=stateDiff.session_jwt;var cookieOpts=SubscriptionDataLayer.generateCookieOpts({expiresAt:(_b=(_a=state===null||state===void 0?void 0:state.session)===null||_a===void 0?void 0:_a.expires_at)!==null&&_b!==void 0?_b:'',availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});if(cookieOpts.domain){this.addSeenDomain(cookieOpts.domain);}api.set(this.opaqueTokenCookieName,session_token,cookieOpts);api.set(this.jwtCookieName,session_jwt,cookieOpts);var alternateCookieOptions=SubscriptionDataLayer.generateCookieOpts({expiresAt:(_d=(_c=state===null||state===void 0?void 0:state.session)===null||_c===void 0?void 0:_c.expires_at)!==null&&_d!==void 0?_d:'',availableToSubdomains:!this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});if(alternateCookieOptions.domain){this.addSeenDomain(alternateCookieOptions.domain);}if(hasMultipleCookies(this.jwtCookieName)){api.remove(this.jwtCookieName,alternateCookieOptions);}if(hasMultipleCookies(this.opaqueTokenCookieName)){api.remove(this.opaqueTokenCookieName,alternateCookieOptions);}if(hasMultipleCookies(this.jwtCookieName)){logger.warn('Could not remove extraneous JWT cookie. This might happen if the cookie has been set using multiple `path` settings, and may produce unwanted behavior.');}if(hasMultipleCookies(this.opaqueTokenCookieName)){logger.warn('Could not remove extraneous opaque token cookie.');}}},{key:"writeIntermediateSessionTokenCookie",value:function writeIntermediateSessionTokenCookie(IST){var expiresAtTime=new Date(Date.now()+10*60000);var cookieOpts=SubscriptionDataLayer.generateCookieOpts({expiresAt:expiresAtTime.toString(),availableToSubdomains:this._cookieAvailableToSubdomains,path:this._cookiePath,domain:this._domain});api.set(this.istCookieName,IST,cookieOpts);}},{key:"removeSessionCookie",value:function removeSessionCookie(){this.removeCookies([this.opaqueTokenCookieName,this.jwtCookieName]);}},{key:"removeISTCookie",value:function removeISTCookie(){this.removeCookies([this.istCookieName]);}},{key:"removeCookies",value:function removeCookies(cookiesToRemove){var _this25=this;var trackedDomains=this.getSeenDomains();var allDomains=[this._domain,null].concat(_toConsumableArray2(trackedDomains));var uniqueDomains=_toConsumableArray2(new Set(allDomains));[true,false].forEach(function(availableToSubdomains){[_this25._cookiePath,null].forEach(function(path){uniqueDomains.forEach(function(domain){var cookieOpts=SubscriptionDataLayer.generateCookieOpts({expiresAt:new Date(0).toString(),availableToSubdomains:availableToSubdomains,path:path,domain:domain});cookiesToRemove.forEach(function(cookieName){api.remove(cookieName,cookieOpts);});});});});}},{key:"syncToLocalStorage",value:function syncToLocalStorage(){this._localStorage.setItem('',JSON.stringify(this.state));}},{key:"getItem",value:function getItem(key){return this._localStorage.getItem(key);}},{key:"setItem",value:function setItem(key,value){this._localStorage.setItem(key,value);}},{key:"removeItem",value:function removeItem(key){this._localStorage.removeItem(key);}},{key:"getSeenDomains",value:function getSeenDomains(){var storedDomains=this.getItem(SEEN_DOMAINS_KEY);if(!storedDomains){return[];}try{var parsed=JSON.parse(storedDomains);return Array.isArray(parsed)?parsed:[];}catch(_a){return[];}}},{key:"addSeenDomain",value:function addSeenDomain(domain){if(!domain){return;}var storedDomains=this.getSeenDomains();if(!storedDomains.includes(domain)){storedDomains.push(domain);this.setItem(SEEN_DOMAINS_KEY,JSON.stringify(storedDomains));}}}],[{key:"generateCookieOpts",value:function generateCookieOpts(_ref18){var path=_ref18.path,domain=_ref18.domain,availableToSubdomains=_ref18.availableToSubdomains,expiresAt=_ref18.expiresAt;var cookieOpts={expires:new Date(expiresAt),sameSite:'lax'};if(path){cookieOpts.path=path;}if(isLocalhost()){cookieOpts.secure=false;}else{if(availableToSubdomains){cookieOpts.domain=domain||window.location.host;}cookieOpts.secure=true;}return cookieOpts;}}]);}();var ConsumerSubscriptionDataLayer=/*#__PURE__*/function(_SubscriptionDataLaye){function ConsumerSubscriptionDataLayer(){_classCallCheck2(this,ConsumerSubscriptionDataLayer);return _callSuper2(this,ConsumerSubscriptionDataLayer,arguments);}_inherits2(ConsumerSubscriptionDataLayer,_SubscriptionDataLaye);return _createClass2(ConsumerSubscriptionDataLayer);}(SubscriptionDataLayer);var consumerDataLayerCacheSymbol=Symbol["for"]('__stytch_DataLayer');var getConsumerDataLayerCache=function getConsumerDataLayerCache(){var wdw=window;if(!wdw[consumerDataLayerCacheSymbol]){wdw[consumerDataLayerCacheSymbol]={};}return wdw[consumerDataLayerCacheSymbol];};var getConsumerDataLayer=function getConsumerDataLayer(publicToken,options){var dataLayerCache=getConsumerDataLayerCache();if(!dataLayerCache[publicToken]){dataLayerCache[publicToken]=new ConsumerSubscriptionDataLayer(publicToken,options);}return dataLayerCache[publicToken];};var addSubscriber=function addSubscriber(collection,subscriber){var uniqueId=Math.random().toString(36).slice(-10);collection[uniqueId]=subscriber;return function(){return delete collection[uniqueId];};};var notifySubscribers=function notifySubscribers(collection,value){Object.values(collection).forEach(function(cb){return cb(value);});};var deepEqualData=createDeepEqual({KEYS_TO_EXCLUDE:['last_accessed_at']});var BaseSubscriptionService=/*#__PURE__*/function(){function BaseSubscriptionService(_publicToken,_datalayer,_ref19){var _this26=this;var usingCustomApiEndpoint=_ref19.usingCustomApiEndpoint;_classCallCheck2(this,BaseSubscriptionService);this._publicToken=_publicToken;this._datalayer=_datalayer;this.fromCache=true;this._listen=function(e){if(e.key!==getPersistentStorageKey(_this26._publicToken,'')){return;}var parsedValue=e.newValue===null||e.newValue==='null'?null:JSON.parse(e.newValue);_this26.updateState(parsedValue,true);};window.addEventListener('storage',this._listen);if(!usingCustomApiEndpoint){var _this$_datalayer$read=this._datalayer.readSessionCookie(),session_token=_this$_datalayer$read.session_token;if(!session_token){this.destroySession();return;}}}return _createClass2(BaseSubscriptionService,[{key:"getTokens",value:function getTokens(){var _this$_datalayer$read2=this._datalayer.readSessionCookie(),session_token=_this$_datalayer$read2.session_token,session_jwt=_this$_datalayer$read2.session_jwt;if(!(typeof session_token==='string')||!(typeof session_jwt==='string')){return null;}return{session_token:session_token,session_jwt:session_jwt};}},{key:"getIntermediateSessionToken",value:function getIntermediateSessionToken(){return this._datalayer.readIntermediateSessionTokenCookie()||null;}},{key:"destroyState",value:function destroyState(){this.updateStateAndTokens({state:null,session_token:null,session_jwt:null,intermediate_session_token:null});}},{key:"destroySession",value:function destroySession(){this._datalayer.removeSessionCookie();this.updateState(null);}},{key:"_updateStateAndTokensInternal",value:function _updateStateAndTokensInternal(stateDiff,options){var oldStateValue=this._datalayer.state;var newStateValue=stateDiff.state===null?null:Object.assign(Object.assign({},this._datalayer.state),stateDiff.state);this._datalayer.state=newStateValue;var wasCached=this.getFromCache();this.setCacheRefreshed();if(wasCached||!deepEqualData(oldStateValue,newStateValue)){var notification;if(newStateValue==null||options.fromCache){notification=newStateValue;}else{notification=Object.assign(Object.assign({},newStateValue),{sessionDurationMinutes:options.sessionDurationMinutes});}notifySubscribers(this._datalayer.subscriptions,notification);}}},{key:"updateStateAndTokens",value:function updateStateAndTokens(stateDiff){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{fromCache:false};if(stateDiff.state){if(typeof stateDiff.session_token==='string'){this._datalayer.writeSessionCookie(stateDiff);}else{this._datalayer.removeSessionCookie();}this._datalayer.removeISTCookie();}else if(stateDiff.intermediate_session_token){if(typeof stateDiff.intermediate_session_token==='string'){this._datalayer.writeIntermediateSessionTokenCookie(stateDiff.intermediate_session_token);}else{this._datalayer.removeISTCookie();}this._datalayer.removeSessionCookie();}else{this._datalayer.removeSessionCookie();this._datalayer.removeISTCookie();}this._updateStateAndTokensInternal(stateDiff,options);this._datalayer.syncToLocalStorage();}},{key:"updateState",value:function updateState(state){var fromExternalSource=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var oldStateValue=this._datalayer.state;var newStateValue=state===null?null:Object.assign(Object.assign({},this._datalayer.state),state);this._datalayer.state=newStateValue;var wasCached=this.getFromCache();this.setCacheRefreshed();var hasStateChanged=!deepEqualData(oldStateValue,newStateValue);if(wasCached||hasStateChanged){notifySubscribers(this._datalayer.subscriptions,newStateValue);if(hasStateChanged&&!fromExternalSource){this._datalayer.syncToLocalStorage();}}}},{key:"updateTokens",value:function updateTokens(tokens){var session_token=tokens.session_token,session_jwt=tokens.session_jwt;var cookie=this._datalayer.readSessionCookie();var diff=Object.assign(Object.assign({},cookie),{session_token:session_token,session_jwt:session_jwt});if(typeof session_token==='string'||typeof session_jwt==='string'){this._datalayer.writeSessionCookie(diff);this._datalayer.removeISTCookie();}else{this._datalayer.removeSessionCookie();}}},{key:"subscribeToState",value:function subscribeToState(callback){return addSubscriber(this._datalayer.subscriptions,callback);}},{key:"getState",value:function getState(){return this._datalayer.state;}},{key:"destroy",value:function destroy(){window.removeEventListener('storage',this._listen);}},{key:"syncFromDeviceStorage",value:function syncFromDeviceStorage(){return null;}},{key:"getFromCache",value:function getFromCache(){return this.fromCache;}},{key:"setCacheRefreshed",value:function setCacheRefreshed(){this.fromCache=false;}}]);}();var ConsumerSubscriptionService=/*#__PURE__*/function(_BaseSubscriptionServ){function ConsumerSubscriptionService(){var _this27;_classCallCheck2(this,ConsumerSubscriptionService);_this27=_callSuper2(this,ConsumerSubscriptionService,arguments);_this27.updateUser=function(user){return _this27.updateState({user:user});};_this27.getUser=function(){var _a,_b;return(_b=(_a=_this27.getState())===null||_a===void 0?void 0:_a.user)!==null&&_b!==void 0?_b:null;};_this27.getSession=function(){var _a,_b;return(_b=(_a=_this27.getState())===null||_a===void 0?void 0:_a.session)!==null&&_b!==void 0?_b:null;};_this27.updateSession=function(resp,options){var session=resp.session,user=resp.user,session_jwt=resp.session_jwt,session_token=resp.session_token;if(session_token&&session_jwt){_this27.updateStateAndTokens({state:{session:session,user:user},session_jwt:session_jwt,session_token:session_token,intermediate_session_token:null},{fromCache:false,sessionDurationMinutes:options===null||options===void 0?void 0:options.sessionDurationMinutes});}else{_this27.updateStateAndTokens({state:{session:session,user:user},session_token:true,session_jwt:true,intermediate_session_token:null},{fromCache:false,sessionDurationMinutes:options===null||options===void 0?void 0:options.sessionDurationMinutes});}};_this27.withUpdateSession=function(authenticate){return function(){for(var _len5=arguments.length,args=new Array(_len5),_key5=0;_key5<_len5;_key5++){args[_key5]=arguments[_key5];}return __awaiter(_this27,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee76(){var resp,options;return _regenerator2().w(function(_context76){while(1)switch(_context76.n){case 0:_context76.n=1;return authenticate.apply(void 0,args);case 1:resp=_context76.v;if(resp!=null){options=args.find(function(a){return a!=null&&!(typeof a==='string');});this.updateSession(resp,{sessionDurationMinutes:options===null||options===void 0?void 0:options.session_duration_minutes});}return _context76.a(2,resp);}},_callee76,this);}));};};return _this27;}_inherits2(ConsumerSubscriptionService,_BaseSubscriptionServ);return _createClass2(ConsumerSubscriptionService);}(BaseSubscriptionService);var internalSymB2C=Symbol["for"]('stytch__internal_b2c');var writeB2CInternals=function writeB2CInternals(obj,internals){Object.assign(obj,_defineProperty({},internalSymB2C,internals));};var readB2CInternals=function readB2CInternals(obj){var casted=obj;if(!casted[internalSymB2C]){throw Error('Internals not found!');}return casted[internalSymB2C];};var buildFinalConfig=function buildFinalConfig(clientName){var opts=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _a,_b;var cookieOptions=opts.cookieOptions,keepSessionAlive=opts.keepSessionAlive;var validator=validate(clientName);validator.isOptionalBoolean('keepSessionAlive',keepSessionAlive);if(cookieOptions){validator.isOptionalString('cookieOptions.opaqueTokenCookieName',cookieOptions.opaqueTokenCookieName).isOptionalString('cookieOptions.jwtCookieName',cookieOptions.jwtCookieName).isOptionalString('cookieOptions.istCookieName',cookieOptions.istCookieName).isOptionalString('cookieOptions.path',cookieOptions.path).isOptionalString('cookieOptions.domain',cookieOptions.domain);}return{cookieOptions:cookieOptions,keepSessionAlive:keepSessionAlive,endpoints:{testAPIURL:getTestApiURL(opts),liveAPIURL:getLiveApiURL(opts),dfpBackendURL:getDFPBackendURL(opts),dfpCdnURL:getDFPCdnURL(opts),clientsideServicesIframeURL:(_b=(_a=opts===null||opts===void 0?void 0:opts.endpoints)===null||_a===void 0?void 0:_a.clientsideServicesIframeURL)!==null&&_b!==void 0?_b:CLIENTSIDE_SERVICES_IFRAME_URL}};};var hasCustomApiEndpoint=function hasCustomApiEndpoint(token){var rawOptions=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var customBaseUrl=rawOptions.customBaseUrl,endpointOptions=rawOptions.endpointOptions;return isTestPublicToken(token)?!!(customBaseUrl||(endpointOptions===null||endpointOptions===void 0?void 0:endpointOptions.testApiDomain)):!!(customBaseUrl||(endpointOptions===null||endpointOptions===void 0?void 0:endpointOptions.apiDomain));};function isHandledTokenType(handledTypes,tokenType){return handledTypes.includes(tokenType);}var clearStytchTokenParams=function clearStytchTokenParams(){var url=removeStytchTokenParams(window.location.toString());window.history.replaceState(null,document.title,url);};var createAuthUrlHandler=function createAuthUrlHandler(handlers){var handledTokenTypes=Object.keys(handlers);var parseAuthenticateUrl=function parseAuthenticateUrl(){var href=arguments.length>0&&arguments[0]!==undefined?arguments[0]:window.location.href;var url=new URL(href);var tokenType=url.searchParams.get('stytch_token_type');var token=url.searchParams.get('token');if(!token||!tokenType){return null;}if(isHandledTokenType(handledTokenTypes,tokenType)){return{handled:true,token:token,tokenType:tokenType};}return{handled:false,token:token,tokenType:tokenType};};var authenticateByUrl=function authenticateByUrl(_a,href){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee77(){var clearParams,options,shouldClearParams,parsed,token,tokenType,handler,data;return _regenerator2().w(function(_context77){while(1)switch(_context77.p=_context77.n){case 0:clearParams=_a.clearParams,options=__rest(_a,["clearParams"]);if(href===void 0){href=window.location.href;}shouldClearParams=clearParams!==null&&clearParams!==void 0?clearParams:href===window.location.href;parsed=parseAuthenticateUrl(href);if(!(parsed==null)){_context77.n=1;break;}return _context77.a(2,null);case 1:if(parsed.handled){_context77.n=2;break;}return _context77.a(2,parsed);case 2:token=parsed.token,tokenType=parsed.tokenType;handler=handlers[tokenType];_context77.p=3;_context77.n=4;return handler(token,options);case 4:data=_context77.v;return _context77.a(2,{handled:true,tokenType:tokenType,data:data});case 5:_context77.p=5;if(shouldClearParams){clearStytchTokenParams();}return _context77.f(5);case 6:return _context77.a(2);}},_callee77,null,[[3,,5,6]]);}));};return{authenticateByUrl:authenticateByUrl,parseAuthenticateUrl:parseAuthenticateUrl};};function removeStytchTokenParams(href){var url=new URL(href);var params=url.searchParams;params["delete"]('token');params["delete"]('stytch_token_type');return url;}var StytchHeadlessClient=/*#__PURE__*/_createClass2(function StytchHeadlessClient(publicTokenRaw,options){var _this28=this;_classCallCheck2(this,StytchHeadlessClient);checkNotSSR('StytchHeadlessClient');checkPublicToken(publicTokenRaw);var _PUBLIC_TOKEN=publicTokenRaw!==null&&publicTokenRaw!==void 0?publicTokenRaw:'';var config=buildFinalConfig(this.constructor.name,options);var usingCustomApiEndpoint=hasCustomApiEndpoint(_PUBLIC_TOKEN,options);this._dataLayer=getConsumerDataLayer(_PUBLIC_TOKEN,config);this._subscriptionService=new ConsumerSubscriptionService(_PUBLIC_TOKEN,this._dataLayer,{usingCustomApiEndpoint:usingCustomApiEndpoint});this._stateChangeClient=new StateChangeClient(this._subscriptionService,{});this.onStateChange=function(){var _this28$_stateChangeC;return(_this28$_stateChangeC=_this28._stateChangeClient).onStateChange.apply(_this28$_stateChangeC,arguments);};var additionalTelemetryDataFn=function additionalTelemetryDataFn(){var _a,_b,_c,_d;return{stytch_user_id:(_b=(_a=_this28._dataLayer.state)===null||_a===void 0?void 0:_a.user)===null||_b===void 0?void 0:_b.user_id,stytch_session_id:(_d=(_c=_this28._dataLayer.state)===null||_c===void 0?void 0:_c.session)===null||_d===void 0?void 0:_d.session_id};};var passwordsPKCEManager=new PKCEManager(this._dataLayer,'passwords');var networkClient=new NetworkClient(_PUBLIC_TOKEN,this._dataLayer,config.endpoints.liveAPIURL,config.endpoints.testAPIURL,additionalTelemetryDataFn);this._networkClient=networkClient;var bootstrap=new BootstrapDataManager(_PUBLIC_TOKEN,this._networkClient,this._dataLayer);var captcha=new CaptchaProvider(bootstrap.getAsync());var dfpProtectedAuth=new DFPProtectedAuthProvider(_PUBLIC_TOKEN,config.endpoints.dfpBackendURL,config.endpoints.dfpCdnURL,bootstrap.getAsync(),captcha.executeRecaptcha);var clientsideServices=new ClientsideServicesProvider(config.endpoints.clientsideServicesIframeURL);var oneTap=new OneTapProvider(_PUBLIC_TOKEN,clientsideServices);var searchManager=new SearchDataManager(this._networkClient,dfpProtectedAuth);this.user=new HeadlessUserClient(this._networkClient,this._subscriptionService);this.session=new HeadlessSessionClient(this._networkClient,this._subscriptionService);this.magicLinks=new HeadlessMagicLinksClient(this._networkClient,this._subscriptionService,new PKCEManager(this._dataLayer,'magic_links'),passwordsPKCEManager,bootstrap.getAsync(),dfpProtectedAuth);this.otps=new HeadlessOTPClient(this._networkClient,this._subscriptionService,captcha.executeRecaptcha,dfpProtectedAuth);this.oauth=new HeadlessOAuthClient(this._networkClient,this._subscriptionService,new PKCEManager(this._dataLayer,'oauth'),bootstrap.getAsync(),{publicToken:_PUBLIC_TOKEN,testAPIURL:config.endpoints.testAPIURL,liveAPIURL:config.endpoints.liveAPIURL},oneTap);this.cryptoWallets=new HeadlessCryptoWalletClient(this._networkClient,this._networkClient,this._subscriptionService,captcha.executeRecaptcha,dfpProtectedAuth,bootstrap.getAsync());this.totps=new HeadlessTOTPClient(this._networkClient,this._subscriptionService,dfpProtectedAuth);this.webauthn=new HeadlessWebAuthnClient(this._networkClient,this._subscriptionService,dfpProtectedAuth);this.passwords=new HeadlessPasswordClient(this._networkClient,this._subscriptionService,passwordsPKCEManager,bootstrap.getAsync(),dfpProtectedAuth);this.impersonation=new HeadlessImpersonationClient(this._networkClient,this._subscriptionService,dfpProtectedAuth);this.rbac=new HeadlessRBACClient(bootstrap.getSync(),bootstrap.getAsync(),this._subscriptionService);this.idp=new HeadlessIDPClient(this._networkClient);this._sessionManager=new SessionManager(this._subscriptionService,this.session,_PUBLIC_TOKEN,{keepSessionAlive:config.keepSessionAlive});if(usingCustomApiEndpoint||this._dataLayer.readSessionCookie().session_token){this._sessionManager.performBackgroundRefresh();}this._networkClient.logEvent({name:'sdk_instance_instantiated',details:{event_callback_registered:false,error_callback_registered:false,success_callback_registered:false}});bootstrap.getAsync().then(function(bootstrapData){if(bootstrapData.vertical===VERTICAL_B2B){logger.error('This application is using a Stytch client for Consumer projects, but the public token is for a Stytch B2B project. Use a B2B Stytch client instead, or verify that the public token is correct.');}});var _createAuthUrlHandler=createAuthUrlHandler({magic_links:function magic_links(token,options){return _this28.magicLinks.authenticate(token,options);},oauth:function oauth(token,options){return _this28.oauth.authenticate(token,options);},impersonation:function impersonation(token){return _this28.impersonation.authenticate({impersonation_token:token});}}),authenticateByUrl=_createAuthUrlHandler.authenticateByUrl,parseAuthenticateUrl=_createAuthUrlHandler.parseAuthenticateUrl;this.authenticateByUrl=authenticateByUrl;this.parseAuthenticateUrl=parseAuthenticateUrl;writeB2CInternals(this,{bootstrap:bootstrap,clientsideServices:clientsideServices,captcha:captcha,oneTap:oneTap,searchManager:searchManager,publicToken:_PUBLIC_TOKEN,dataLayer:this._dataLayer,networkClient:this._networkClient});});var n$6,l$7,u$5,i$2,o$3,r$3,f$6,e$4,c$4={},s$2=[],a$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,h$6=Array.isArray;function v$6(n,l){for(var u in l)n[u]=l[u];return n;}function p$6(n){var l=n.parentNode;l&&l.removeChild(n);}function y$3(l,u,t){var i,o,r,f={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n$6.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return d$6(l,f,i,o,null);}function d$6(n,t,i,o,r){var f={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++u$5:r,__i:-1,__u:0};return null==r&&null!=l$7.vnode&&l$7.vnode(f),f;}function _$3(){return{current:null};}function g$7(n){return n.children;}function b$7(n,l){this.props=n,this.context=l;}function m$6(n,l){if(null==l)return n.__?m$6(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?m$6(n):null;}function k$5(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break;}return k$5(n);}}function w$7(n){(!n.__d&&(n.__d=!0)&&i$2.push(n)&&!x$4.__r++||o$3!==l$7.debounceRendering)&&((o$3=l$7.debounceRendering)||r$3)(x$4);}function x$4(){var n,u,t,o,r,e,c,s,a;for(i$2.sort(f$6);n=i$2.shift();)n.__d&&(u=i$2.length,o=void 0,e=(r=(t=n).__v).__e,s=[],a=[],(c=t.__P)&&((o=v$6({},r)).__v=r.__v+1,l$7.vnode&&l$7.vnode(o),L$2(c,o,r,t.__n,void 0!==c.ownerSVGElement,32&r.__u?[e]:null,s,null==e?m$6(r):e,!!(32&r.__u),a),o.__.__k[o.__i]=o,M$3(s,o,a),o.__e!=e&&k$5(o)),i$2.length>u&&i$2.sort(f$6));x$4.__r=0;}function C$1(n,l,u,t,i,o,r,f,e,a,h){var v,p,y,d,_,g=t&&t.__k||s$2,b=l.length;for(u.__d=e,P$4(u,l,g),e=u.__d,v=0;v<b;v++)null!=(y=u.__k[v])&&"boolean"!=typeof y&&"function"!=typeof y&&(p=-1===y.__i?c$4:g[y.__i]||c$4,y.__i=v,L$2(n,y,p,i,o,r,f,e,a,h),d=y.__e,y.ref&&p.ref!=y.ref&&(p.ref&&z$4(p.ref,null,y),h.push(y.ref,y.__c||d,y)),null==_&&null!=d&&(_=d),65536&y.__u||p.__k===y.__k?e=S$2(y,e,n):"function"==typeof y.type&&void 0!==y.__d?e=y.__d:d&&(e=d.nextSibling),y.__d=void 0,y.__u&=-196609);u.__d=e,u.__e=_;}function P$4(n,l,u){var t,i,o,r,f,e=l.length,c=u.length,s=c,a=0;for(n.__k=[],t=0;t<e;t++)null!=(i=n.__k[t]=null==(i=l[t])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?d$6(null,i,null,null,i):h$6(i)?d$6(g$7,{children:i},null,null,null):i.__b>0?d$6(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=n,i.__b=n.__b+1,f=H$2(i,u,r=t+a,s),i.__i=f,o=null,-1!==f&&(s--,(o=u[f])&&(o.__u|=131072)),null==o||null===o.__v?(-1==f&&a--,"function"!=typeof i.type&&(i.__u|=65536)):f!==r&&(f===r+1?a++:f>r?s>e-r?a+=f-r:a--:a=f<r&&f==r-1?f-r:0,f!==t+a&&(i.__u|=65536))):(o=u[t])&&null==o.key&&o.__e&&(o.__e==n.__d&&(n.__d=m$6(o)),N$2(o,o,!1),u[t]=null,s--);if(s)for(t=0;t<c;t++)null!=(o=u[t])&&0==(131072&o.__u)&&(o.__e==n.__d&&(n.__d=m$6(o)),N$2(o,o));}function S$2(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=S$2(t[i],l,u));return l;}return n.__e!=l&&(u.insertBefore(n.__e,l||null),l=n.__e),l&&l.nextSibling;}function $$3(n,l){return l=l||[],null==n||"boolean"==typeof n||(h$6(n)?n.some(function(n){$$3(n,l);}):l.push(n)),l;}function H$2(n,l,u,t){var i=n.key,o=n.type,r=u-1,f=u+1,e=l[u];if(null===e||e&&i==e.key&&o===e.type)return u;if(t>(null!=e&&0==(131072&e.__u)?1:0))for(;r>=0||f<l.length;){if(r>=0){if((e=l[r])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return r;r--;}if(f<l.length){if((e=l[f])&&0==(131072&e.__u)&&i==e.key&&o===e.type)return f;f++;}}return-1;}function I$3(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||a$2.test(l)?u:u+"px";}function T$4(n,l,u,t,i){var o;n:if("style"===l){if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||I$3(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||I$3(n.style,l,u[l]);}}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/(PointerCapture)$|Capture$/,"$1")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=Date.now(),n.addEventListener(l,o?D$2:A$5,o)):n.removeEventListener(l,o?D$2:A$5,o);else{if(i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==l&&"height"!==l&&"href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&"rowSpan"!==l&&"colSpan"!==l&&"role"!==l&&l in n)try{n[l]=null==u?"":u;break n;}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,u));}}function A$5(n){var u=this.l[n.type+!1];if(n.t){if(n.t<=u.u)return;}else n.t=Date.now();return u(l$7.event?l$7.event(n):n);}function D$2(n){return this.l[n.type+!0](l$7.event?l$7.event(n):n);}function L$2(n,u,t,i,o,r,f,e,c,s){var a,p,y,d,_,m,k,w,x,P,S,$,H,I,T,A=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[e=u.__e=t.__e]),(a=l$7.__b)&&a(u);n:if("function"==typeof A)try{if(w=u.props,x=(a=A.contextType)&&i[a.__c],P=a?x?x.props.value:a.__:i,t.__c?k=(p=u.__c=t.__c).__=p.__E:("prototype"in A&&A.prototype.render?u.__c=p=new A(w,P):(u.__c=p=new b$7(w,P),p.constructor=A,p.render=O$2),x&&x.sub(p),p.props=w,p.state||(p.state={}),p.context=P,p.__n=i,y=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=A.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=v$6({},p.__s)),v$6(p.__s,A.getDerivedStateFromProps(w,p.__s))),d=p.props,_=p.state,p.__v=u,y)null==A.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==A.getDerivedStateFromProps&&w!==d&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(w,P),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(w,p.__s,P)||u.__v===t.__v)){for(u.__v!==t.__v&&(p.props=w,p.state=p.__s,p.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.forEach(function(n){n&&(n.__=u);}),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&f.push(p);break n;}null!=p.componentWillUpdate&&p.componentWillUpdate(w,p.__s,P),null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(d,_,m);});}if(p.context=P,p.props=w,p.__P=n,p.__e=!1,$=l$7.__r,H=0,"prototype"in A&&A.prototype.render){for(p.state=p.__s,p.__d=!1,$&&$(u),a=p.render(p.props,p.state,p.context),I=0;I<p._sb.length;I++)p.__h.push(p._sb[I]);p._sb=[];}else do{p.__d=!1,$&&$(u),a=p.render(p.props,p.state,p.context),p.state=p.__s;}while(p.__d&&++H<25);p.state=p.__s,null!=p.getChildContext&&(i=v$6(v$6({},i),p.getChildContext())),y||null==p.getSnapshotBeforeUpdate||(m=p.getSnapshotBeforeUpdate(d,_)),C$1(n,h$6(T=null!=a&&a.type===g$7&&null==a.key?a.props.children:a)?T:[T],u,t,i,o,r,f,e,c,s),p.base=u.__e,u.__u&=-161,p.__h.length&&f.push(p),k&&(p.__E=p.__=null);}catch(n){u.__v=null,c||null!=r?(u.__e=e,u.__u|=c?160:32,r[r.indexOf(e)]=null):(u.__e=t.__e,u.__k=t.__k),l$7.__e(n,u,t);}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):u.__e=j$3(t.__e,u,t,i,o,r,f,c,s);(a=l$7.diffed)&&a(u);}function M$3(n,u,t){u.__d=void 0;for(var i=0;i<t.length;i++)z$4(t[i],t[++i],t[++i]);l$7.__c&&l$7.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$7.__e(n,u.__v);}});}function j$3(l,u,t,i,o,r,f,e,s){var a,v,y,d,_,g,b,k=t.props,w=u.props,x=u.type;if("svg"===x&&(o=!0),null!=r)for(a=0;a<r.length;a++)if((_=r[a])&&"setAttribute"in _==!!x&&(x?_.localName===x:3===_.nodeType)){l=_,r[a]=null;break;}if(null==l){if(null===x)return document.createTextNode(w);l=o?document.createElementNS("http://www.w3.org/2000/svg",x):document.createElement(x,w.is&&w),r=null,e=!1;}if(null===x)k===w||e&&l.data===w||(l.data=w);else{if(r=r&&n$6.call(l.childNodes),k=t.props||c$4,!e&&null!=r)for(k={},a=0;a<l.attributes.length;a++)k[(_=l.attributes[a]).name]=_.value;for(a in k)_=k[a],"children"==a||("dangerouslySetInnerHTML"==a?y=_:"key"===a||a in w||T$4(l,a,null,_,o));for(a in w)_=w[a],"children"==a?d=_:"dangerouslySetInnerHTML"==a?v=_:"value"==a?g=_:"checked"==a?b=_:"key"===a||e&&"function"!=typeof _||k[a]===_||T$4(l,a,_,k[a],o);if(v)e||y&&(v.__html===y.__html||v.__html===l.innerHTML)||(l.innerHTML=v.__html),u.__k=[];else if(y&&(l.innerHTML=""),C$1(l,h$6(d)?d:[d],u,t,i,o&&"foreignObject"!==x,r,f,r?r[0]:t.__k&&m$6(t,0),e,s),null!=r)for(a=r.length;a--;)null!=r[a]&&p$6(r[a]);e||(a="value",void 0!==g&&(g!==l[a]||"progress"===x&&!g||"option"===x&&g!==k[a])&&T$4(l,a,g,k[a],!1),a="checked",void 0!==b&&b!==l[a]&&T$4(l,a,b,k[a],!1));}return l;}function z$4(n,u,t){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$7.__e(n,t);}}function N$2(n,u,t){var i,o;if(l$7.unmount&&l$7.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||z$4(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(n){l$7.__e(n,u);}i.base=i.__P=null,n.__c=void 0;}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&N$2(i[o],u,t||"function"!=typeof n.type);t||null==n.__e||p$6(n.__e),n.__=n.__e=n.__d=void 0;}function O$2(n,l,u){return this.constructor(n,u);}function q$5(u,t,i){var o,r,f,e;l$7.__&&l$7.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,f=[],e=[],L$2(t,u=(!o&&i||t).__k=y$3(g$7,null,[u]),r||c$4,c$4,void 0!==t.ownerSVGElement,!o&&i?[i]:r?null:t.firstChild?n$6.call(t.childNodes):null,f,!o&&i?i:r?r.__e:t.firstChild,o,e),M$3(f,u,e);}function B$3(n,l){q$5(n,l,B$3);}function E$2(l,u,t){var i,o,r,f,e=v$6({},l.props);for(r in l.type&&l.type.defaultProps&&(f=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=void 0===u[r]&&void 0!==f?f[r]:u[r];return arguments.length>2&&(e.children=arguments.length>3?n$6.call(arguments,2):t),d$6(l.type,e,i||l.key,o||l.ref,null);}function F$5(n,l){var u={__c:l="__cC"+e$4++,__:n,Consumer:function Consumer(n,l){return n.children(l);},Provider:function Provider(n){var u,t;return this.getChildContext||(u=[],(t={})[l]=this,this.getChildContext=function(){return t;},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(function(n){n.__e=!0,w$7(n);});},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children;}};return u.Provider.__=u.Consumer.contextType=u;}n$6=s$2.slice,l$7={__e:function __e(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i;}catch(l){n=l;}throw n;}},u$5=0,b$7.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v$6({},this.state),"function"==typeof n&&(n=n(v$6({},u),this.props)),n&&v$6(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),w$7(this));},b$7.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),w$7(this));},b$7.prototype.render=g$7,i$2=[],r$3="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,f$6=function f$6(n,l){return n.__v.__b-l.__v.__b;},x$4.__r=0,e$4=0;var t$4,r$2,u$4,i$1,o$2=0,f$5=[],c$3=[],e$3=l$7.__b,a$1=l$7.__r,v$5=l$7.diffed,l$6=l$7.__c,m$5=l$7.unmount;function d$5(t,u){l$7.__h&&l$7.__h(r$2,t,o$2||u),o$2=0;var i=r$2.__H||(r$2.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c$3}),i.__[t];}function h$5(n){return o$2=1,s$1(B$2,n);}function s$1(n,u,i){var o=d$5(t$4++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$2(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r$2,!r$2.u)){var f=function f(n,t,r){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(n){return n.__c;});if(u.every(function(n){return!n.__N;}))return!c||c.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!c||c.call(this,n,t,r));};r$2.u=!0;var c=r$2.shouldComponentUpdate,e=r$2.componentWillUpdate;r$2.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u;}e&&e.call(this,n,t,r);},r$2.shouldComponentUpdate=f;}return o.__N||o.__;}function p$5(u,i){var o=d$5(t$4++,3);!l$7.__s&&z$3(o.__H,i)&&(o.__=u,o.i=i,r$2.__H.__h.push(o));}function y$2(u,i){var o=d$5(t$4++,4);!l$7.__s&&z$3(o.__H,i)&&(o.__=u,o.i=i,r$2.__h.push(o));}function _$2(n){return o$2=5,F$4(function(){return{current:n};},[]);}function A$4(n,t,r){o$2=6,y$2(function(){return"function"==typeof n?(n(t()),function(){return n(null);}):n?(n.current=t(),function(){return n.current=null;}):void 0;},null==r?r:r.concat(n));}function F$4(n,r){var u=d$5(t$4++,7);return z$3(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__;}function T$3(n,t){return o$2=8,F$4(function(){return n;},t);}function q$4(n){var u=r$2.context[n.__c],i=d$5(t$4++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r$2)),u.props.value):n.__;}function x$3(t,r){l$7.useDebugValue&&l$7.useDebugValue(r?r(t):t);}function P$3(n){var u=d$5(t$4++,10),i=h$5();return u.__=n,r$2.componentDidCatch||(r$2.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n);}),[i[0],function(){i[1](void 0);}];}function V$3(){var n=d$5(t$4++,11);if(!n.__){for(var u=r$2.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__="P"+i[0]+"-"+i[1]++;}return n.__;}function b$6(){for(var t;t=f$5.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k$4),t.__H.__h.forEach(w$6),t.__H.__h=[];}catch(r){t.__H.__h=[],l$7.__e(r,t.__v);}}l$7.__b=function(n){r$2=null,e$3&&e$3(n);},l$7.__r=function(n){a$1&&a$1(n),t$4=0;var i=(r$2=n.__c).__H;i&&(u$4===r$2?(i.__h=[],r$2.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c$3,n.__N=n.i=void 0;})):(i.__h.forEach(k$4),i.__h.forEach(w$6),i.__h=[],t$4=0)),u$4=r$2;},l$7.diffed=function(t){v$5&&v$5(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f$5.push(o)&&i$1===l$7.requestAnimationFrame||((i$1=l$7.requestAnimationFrame)||j$2)(b$6)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c$3&&(n.__=n.__V),n.i=void 0,n.__V=c$3;})),u$4=r$2=null;},l$7.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k$4),t.__h=t.__h.filter(function(n){return!n.__||w$6(n);});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$7.__e(u,t.__v);}}),l$6&&l$6(t,r);},l$7.unmount=function(t){m$5&&m$5(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k$4(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$7.__e(r,u.__v));};var g$6="function"==typeof requestAnimationFrame;function j$2(n){var t,r=function r(){clearTimeout(u),g$6&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g$6&&(t=requestAnimationFrame(r));}function k$4(n){var t=r$2,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r$2=t;}function w$6(n){var t=r$2;n.__c=n.__(),r$2=t;}function z$3(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r];});}function B$2(n,t){return"function"==typeof t?t(n):t;}function g$5(n,t){for(var e in t)n[e]=t[e];return n;}function C(n,t){for(var e in n)if("__source"!==e&&!(e in t))return!0;for(var r in t)if("__source"!==r&&n[r]!==t[r])return!0;return!1;}function E$1(n){this.props=n;}function w$5(n,e){function r(n){var t=this.props.ref,r=t==n.ref;return!r&&t&&(t.call?t(null):t.current=null),e?!e(this.props,n)||!r:C(this.props,n);}function u(e){return this.shouldComponentUpdate=r,y$3(n,e);}return u.displayName="Memo("+(n.displayName||n.name)+")",u.prototype.isReactComponent=!0,u.__f=!0,u;}(E$1.prototype=new b$7()).isPureReactComponent=!0,E$1.prototype.shouldComponentUpdate=function(n,t){return C(this.props,n)||C(this.state,t);};var x$2=l$7.__b;l$7.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),x$2&&x$2(n);};var R$1="undefined"!=typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.forward_ref")||3911;function N$1(n){function t(t){var e=g$5({},t);return delete e.ref,n(e,t.ref||null);}return t.$$typeof=R$1,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(n.displayName||n.name)+")",t;}var k$3=function k$3(n,t){return null==n?null:$$3($$3(n).map(t));},A$3={map:k$3,forEach:k$3,count:function count(n){return n?$$3(n).length:0;},only:function only(n){var t=$$3(n);if(1!==t.length)throw"Children.only";return t[0];},toArray:$$3},O$1=l$7.__e;l$7.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k),u.__c(n,t);O$1(n,t,e,r);};var T$2=l$7.unmount;function F$3(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){"function"==typeof n.__c&&n.__c();}),n.__c.__H=null),null!=(n=g$5({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return F$3(n,t,e);})),n;}function I$2(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return I$2(n,t,e);}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n;}function L$1(){this.__u=0,this.t=null,this.__b=null;}function U$2(n){var t=n.__.__c;return t&&t.__a&&t.__a(n);}function D$1(n){var e,r,u;function o(o){if(e||(e=n()).then(function(n){r=n["default"]||n;},function(n){u=n;}),u)throw u;if(!r)throw e;return y$3(r,o);}return o.displayName="Lazy",o.__f=!0,o;}function M$2(){this.u=null,this.o=null;}l$7.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),T$2&&T$2(n);},(L$1.prototype=new b$7()).__c=function(n,t){var e=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(e);var u=U$2(r.__v),o=!1,i=function i(){o||(o=!0,e.__R=null,u?u(l):l());};e.__R=i;var l=function l(){if(! --r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=I$2(n,n.__c.__P,n.__c.__O);}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate();}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i);},L$1.prototype.componentWillUnmount=function(){this.t=[];},L$1.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=F$3(this.__b,r,o.__O=o.__P);}this.__b=null;}var i=e.__a&&y$3(g$7,null,n.fallback);return i&&(i.__u&=-33),[y$3(g$7,null,e.__a?null:n.children),i];};var V$2=function V$2(n,t,e){if(++e[1]===e[0]&&n.o["delete"](t),n.props.revealOrder&&("t"!==n.props.revealOrder[0]||!n.o.size))for(e=n.u;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.u=e=e[2];}};function W$2(n){return this.getChildContext=function(){return n.context;},n.children;}function P$2(n){var e=this,r=n.i;e.componentWillUnmount=function(){q$5(null,e.l),e.l=null,e.i=null;},e.i&&e.i!==r&&e.componentWillUnmount(),e.l||(e.i=r,e.l={nodeType:1,parentNode:r,childNodes:[],appendChild:function appendChild(n){this.childNodes.push(n),e.i.appendChild(n);},insertBefore:function insertBefore(n,t){this.childNodes.push(n),e.i.appendChild(n);},removeChild:function removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e.i.removeChild(n);}}),q$5(y$3(W$2,{context:e.context},n.__v),e.l);}function j$1(n,e){var r=y$3(P$2,{__v:n,i:e});return r.containerInfo=e,r;}(M$2.prototype=new b$7()).__a=function(n){var t=this,e=U$2(t.__v),r=t.o.get(n);return r[0]++,function(u){var o=function o(){t.props.revealOrder?(r.push(u),V$2(t,n,r)):u();};e?e(o):o();};},M$2.prototype.render=function(n){this.u=null,this.o=new Map();var t=$$3(n.children);n.revealOrder&&"b"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.o.set(t[e],this.u=[1,0,this.u]);return n.children;},M$2.prototype.componentDidUpdate=M$2.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(t,e){V$2(n,e,t);});};var z$2="undefined"!=typeof Symbol&&Symbol["for"]&&Symbol["for"]("react.element")||60103,B$1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,H$1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Z$2=/[A-Z0-9]/g,Y$2="undefined"!=typeof document,$$2=function $$2(n){return("undefined"!=typeof Symbol&&"symbol"==_typeof2(Symbol())?/fil|che|rad/:/fil|che|ra/).test(n);};function q$3(n,t,e){return null==t.__k&&(t.textContent=""),q$5(n,t),"function"==typeof e&&e(),n?n.__c:null;}function G$2(n,t,e){return B$3(n,t),"function"==typeof e&&e(),n?n.__c:null;}b$7.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty(b$7.prototype,t,{configurable:!0,get:function get(){return this["UNSAFE_"+t];},set:function set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n});}});});var J$2=l$7.event;function K$1(){}function Q$2(){return this.cancelBubble;}function X$2(){return this.defaultPrevented;}l$7.event=function(n){return J$2&&(n=J$2(n)),n.persist=K$1,n.isPropagationStopped=Q$2,n.isDefaultPrevented=X$2,n.nativeEvent=n;};var nn,tn={enumerable:!1,configurable:!0,get:function get(){return this["class"];}},en=l$7.vnode;l$7.vnode=function(n){"string"==typeof n.type&&function(n){var t=n.props,e=n.type,u={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||Y$2&&"children"===o&&"noscript"===e||"class"===o||"className"===o)){var l=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"ondoubleclick"===l?o="ondblclick":"onchange"!==l||"input"!==e&&"textarea"!==e||$$2(t.type)?"onfocus"===l?o="onfocusin":"onblur"===l?o="onfocusout":H$1.test(o)?o=l:-1===e.indexOf("-")&&B$1.test(o)?o=o.replace(Z$2,"-$&").toLowerCase():null===i&&(i=void 0):l=o="oninput","oninput"===l&&u[o=l]&&(o="oninputCapture"),u[o]=i;}}"select"==e&&u.multiple&&Array.isArray(u.value)&&(u.value=$$3(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value);})),"select"==e&&null!=u.defaultValue&&(u.value=$$3(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value;})),t["class"]&&!t.className?(u["class"]=t["class"],Object.defineProperty(u,"className",tn)):(t.className&&!t["class"]||t["class"]&&t.className)&&(u["class"]=u.className=t.className),n.props=u;}(n),n.$$typeof=z$2,en&&en(n);};var rn=l$7.__r;l$7.__r=function(n){rn&&rn(n),nn=n.__c;};var un=l$7.diffed;l$7.diffed=function(n){un&&un(n);var t=n.props,e=n.__e;null!=e&&"textarea"===n.type&&"value"in t&&t.value!==e.value&&(e.value=null==t.value?"":t.value),nn=null;};var on={ReactCurrentDispatcher:{current:{readContext:function readContext(n){return nn.__n[n.__c].props.value;}}}},ln="17.0.2";function cn(n){return y$3.bind(null,n);}function fn(n){return!!n&&n.$$typeof===z$2;}function an(n){return fn(n)&&n.type===g$7;}function sn(n){return fn(n)?E$2.apply(null,arguments):n;}function hn(n){return!!n.__k&&(q$5(null,n),!0);}function vn(n){return n&&(n.base||1===n.nodeType&&n)||null;}var dn=function dn(n,t){return n(t);},pn=function pn(n,t){return n(t);},mn=g$7;function yn(n){n();}function _n(n){return n;}function bn(){return[!1,yn];}var Sn=y$2,gn=fn;function Cn(n,t){var e=t(),r=h$5({h:{__:e,v:t}}),u=r[0].h,o=r[1];return y$2(function(){u.__=e,u.v=t,En(u)&&o({h:u});},[n,e,t]),p$5(function(){return En(u)&&o({h:u}),n(function(){En(u)&&o({h:u});});},[n]),e;}function En(n){var t,e,r=n.v,u=n.__;try{var o=r();return!((t=u)===(e=o)&&(0!==t||1/t==1/e)||t!=t&&e!=e);}catch(n){return!0;}}var wn={useState:h$5,useId:V$3,useReducer:s$1,useEffect:p$5,useLayoutEffect:y$2,useInsertionEffect:Sn,useTransition:bn,useDeferredValue:_n,useSyncExternalStore:Cn,startTransition:yn,useRef:_$2,useImperativeHandle:A$4,useMemo:F$4,useCallback:T$3,useContext:q$4,useDebugValue:x$3,version:"17.0.2",Children:A$3,render:q$3,hydrate:G$2,unmountComponentAtNode:hn,createPortal:j$1,createElement:y$3,createContext:F$5,createFactory:cn,cloneElement:sn,createRef:_$3,Fragment:g$7,isValidElement:fn,isElement:gn,isFragment:an,findDOMNode:vn,Component:b$7,PureComponent:E$1,memo:w$5,forwardRef:N$1,flushSync:pn,unstable_batchedUpdates:dn,StrictMode:mn,Suspense:L$1,SuspenseList:M$2,lazy:D$1,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:on};var compat_module=/*#__PURE__*/Object.freeze({__proto__:null,Children:A$3,Component:b$7,Fragment:g$7,PureComponent:E$1,StrictMode:mn,Suspense:L$1,SuspenseList:M$2,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:on,cloneElement:sn,createContext:F$5,createElement:y$3,createFactory:cn,createPortal:j$1,createRef:_$3,"default":wn,findDOMNode:vn,flushSync:pn,forwardRef:N$1,hydrate:G$2,isElement:gn,isFragment:an,isValidElement:fn,lazy:D$1,memo:w$5,render:q$3,startTransition:yn,unmountComponentAtNode:hn,unstable_batchedUpdates:dn,useCallback:T$3,useContext:q$4,useDebugValue:x$3,useDeferredValue:_n,useEffect:p$5,useErrorBoundary:P$3,useId:V$3,useImperativeHandle:A$4,useInsertionEffect:Sn,useLayoutEffect:y$2,useMemo:F$4,useReducer:s$1,useRef:_$2,useState:h$5,useSyncExternalStore:Cn,useTransition:bn,version:ln});var commonjsGlobal=typeof globalThis!=='undefined'?globalThis:typeof window!=='undefined'?window:typeof global!=='undefined'?global:typeof self!=='undefined'?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,'default')?x['default']:x;}function getAugmentedNamespace(n){if(n.__esModule)return n;var f=n["default"];if(typeof f=="function"){var a=function a(){if(this instanceof a){return Reflect.construct(f,arguments,this.constructor);}return f.apply(this,arguments);};a.prototype=f.prototype;}else a={};Object.defineProperty(a,'__esModule',{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function get(){return n[k];}});});return a;}var reactIs$2={exports:{}};var reactIs_production_min$1={};var b$5=Symbol["for"]("react.element"),c$2=Symbol["for"]("react.portal"),d$4=Symbol["for"]("react.fragment"),e$2=Symbol["for"]("react.strict_mode"),f$4=Symbol["for"]("react.profiler"),g$4=Symbol["for"]("react.provider"),h$4=Symbol["for"]("react.context"),k$2=Symbol["for"]("react.server_context"),l$5=Symbol["for"]("react.forward_ref"),m$4=Symbol["for"]("react.suspense"),n$5=Symbol["for"]("react.suspense_list"),p$4=Symbol["for"]("react.memo"),q$2=Symbol["for"]("react.lazy"),t$3=Symbol["for"]("react.offscreen"),u$3;u$3=Symbol["for"]("react.module.reference");function v$4(a){if("object"===_typeof2(a)&&null!==a){var r=a.$$typeof;switch(r){case b$5:switch(a=a.type,a){case d$4:case f$4:case e$2:case m$4:case n$5:return a;default:switch(a=a&&a.$$typeof,a){case k$2:case h$4:case l$5:case q$2:case p$4:case g$4:return a;default:return r;}}case c$2:return r;}}}reactIs_production_min$1.ContextConsumer=h$4;reactIs_production_min$1.ContextProvider=g$4;reactIs_production_min$1.Element=b$5;reactIs_production_min$1.ForwardRef=l$5;reactIs_production_min$1.Fragment=d$4;reactIs_production_min$1.Lazy=q$2;reactIs_production_min$1.Memo=p$4;reactIs_production_min$1.Portal=c$2;reactIs_production_min$1.Profiler=f$4;reactIs_production_min$1.StrictMode=e$2;reactIs_production_min$1.Suspense=m$4;reactIs_production_min$1.SuspenseList=n$5;reactIs_production_min$1.isAsyncMode=function(){return!1;};reactIs_production_min$1.isConcurrentMode=function(){return!1;};reactIs_production_min$1.isContextConsumer=function(a){return v$4(a)===h$4;};reactIs_production_min$1.isContextProvider=function(a){return v$4(a)===g$4;};reactIs_production_min$1.isElement=function(a){return"object"===_typeof2(a)&&null!==a&&a.$$typeof===b$5;};reactIs_production_min$1.isForwardRef=function(a){return v$4(a)===l$5;};reactIs_production_min$1.isFragment=function(a){return v$4(a)===d$4;};reactIs_production_min$1.isLazy=function(a){return v$4(a)===q$2;};reactIs_production_min$1.isMemo=function(a){return v$4(a)===p$4;};reactIs_production_min$1.isPortal=function(a){return v$4(a)===c$2;};reactIs_production_min$1.isProfiler=function(a){return v$4(a)===f$4;};reactIs_production_min$1.isStrictMode=function(a){return v$4(a)===e$2;};reactIs_production_min$1.isSuspense=function(a){return v$4(a)===m$4;};reactIs_production_min$1.isSuspenseList=function(a){return v$4(a)===n$5;};reactIs_production_min$1.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===d$4||a===f$4||a===e$2||a===m$4||a===n$5||a===t$3||"object"===_typeof2(a)&&null!==a&&(a.$$typeof===q$2||a.$$typeof===p$4||a.$$typeof===g$4||a.$$typeof===h$4||a.$$typeof===l$5||a.$$typeof===u$3||void 0!==a.getModuleId)?!0:!1;};reactIs_production_min$1.typeOf=v$4;{reactIs$2.exports=reactIs_production_min$1;}var reactIsExports$1=reactIs$2.exports;var shallowequal=function shallowEqual(objA,objB,compare,compareContext){var ret=compare?compare.call(compareContext,objA,objB):void 0;if(ret!==void 0){return!!ret;}if(objA===objB){return true;}if(_typeof2(objA)!=="object"||!objA||_typeof2(objB)!=="object"||!objB){return false;}var keysA=Object.keys(objA);var keysB=Object.keys(objB);if(keysA.length!==keysB.length){return false;}var bHasOwnProperty=Object.prototype.hasOwnProperty.bind(objB);for(var idx=0;idx<keysA.length;idx++){var key=keysA[idx];if(!bHasOwnProperty(key)){return false;}var valueA=objA[key];var valueB=objB[key];ret=compare?compare.call(compareContext,valueA,valueB,key):void 0;if(ret===false||ret===void 0&&valueA!==valueB){return false;}}return true;};var h$3=/*@__PURE__*/getDefaultExportFromCjs(shallowequal);function stylis_min(W){function M(d,c,e,h,a){for(var m=0,b=0,v=0,n=0,q,g,x=0,K=0,k,u=k=q=0,l=0,r=0,I=0,t=0,B=e.length,J=B-1,y,f='',p='',F='',G='',C;l<B;){g=e.charCodeAt(l);l===J&&0!==b+n+v+m&&(0!==b&&(g=47===b?10:47),n=v=m=0,B++,J++);if(0===b+n+v+m){if(l===J&&(0<r&&(f=f.replace(N,'')),0<f.trim().length)){switch(g){case 32:case 9:case 59:case 13:case 10:break;default:f+=e.charAt(l);}g=59;}switch(g){case 123:f=f.trim();q=f.charCodeAt(0);k=1;for(t=++l;l<B;){switch(g=e.charCodeAt(l)){case 123:k++;break;case 125:k--;break;case 47:switch(g=e.charCodeAt(l+1)){case 42:case 47:a:{for(u=l+1;u<J;++u){switch(e.charCodeAt(u)){case 47:if(42===g&&42===e.charCodeAt(u-1)&&l+2!==u){l=u+1;break a;}break;case 10:if(47===g){l=u+1;break a;}}}l=u;}}break;case 91:g++;case 40:g++;case 34:case 39:for(;l++<J&&e.charCodeAt(l)!==g;){}}if(0===k)break;l++;}k=e.substring(t,l);0===q&&(q=(f=f.replace(ca,'').trim()).charCodeAt(0));switch(q){case 64:0<r&&(f=f.replace(N,''));g=f.charCodeAt(1);switch(g){case 100:case 109:case 115:case 45:r=c;break;default:r=O;}k=M(c,r,k,g,a+1);t=k.length;0<A&&(r=X(O,f,I),C=H(3,k,r,c,D,z,t,g,a,h),f=r.join(''),void 0!==C&&0===(t=(k=C.trim()).length)&&(g=0,k=''));if(0<t)switch(g){case 115:f=f.replace(da,ea);case 100:case 109:case 45:k=f+'{'+k+'}';break;case 107:f=f.replace(fa,'$1 $2');k=f+'{'+k+'}';k=1===w||2===w&&L('@'+k,3)?'@-webkit-'+k+'@'+k:'@'+k;break;default:k=f+k,112===h&&(k=(p+=k,''));}else k='';break;default:k=M(c,X(c,f,I),k,h,a+1);}F+=k;k=I=r=u=q=0;f='';g=e.charCodeAt(++l);break;case 125:case 59:f=(0<r?f.replace(N,''):f).trim();if(1<(t=f.length))switch(0===u&&(q=f.charCodeAt(0),45===q||96<q&&123>q)&&(t=(f=f.replace(' ',':')).length),0<A&&void 0!==(C=H(1,f,c,d,D,z,p.length,h,a,h))&&0===(t=(f=C.trim()).length)&&(f='\x00\x00'),q=f.charCodeAt(0),g=f.charCodeAt(1),q){case 0:break;case 64:if(105===g||99===g){G+=f+e.charAt(l);break;}default:58!==f.charCodeAt(t-1)&&(p+=P(f,q,g,f.charCodeAt(2)));}I=r=u=q=0;f='';g=e.charCodeAt(++l);}}switch(g){case 13:case 10:47===b?b=0:0===1+q&&107!==h&&0<f.length&&(r=1,f+='\x00');0<A*Y&&H(0,f,c,d,D,z,p.length,h,a,h);z=1;D++;break;case 59:case 125:if(0===b+n+v+m){z++;break;}default:z++;y=e.charAt(l);switch(g){case 9:case 32:if(0===n+m+b)switch(x){case 44:case 58:case 9:case 32:y='';break;default:32!==g&&(y=' ');}break;case 0:y='\\0';break;case 12:y='\\f';break;case 11:y='\\v';break;case 38:0===n+b+m&&(r=I=1,y='\f'+y);break;case 108:if(0===n+b+m+E&&0<u)switch(l-u){case 2:112===x&&58===e.charCodeAt(l-3)&&(E=x);case 8:111===K&&(E=K);}break;case 58:0===n+b+m&&(u=l);break;case 44:0===b+v+n+m&&(r=1,y+='\r');break;case 34:case 39:0===b&&(n=n===g?0:0===n?g:n);break;case 91:0===n+b+v&&m++;break;case 93:0===n+b+v&&m--;break;case 41:0===n+b+m&&v--;break;case 40:if(0===n+b+m){if(0===q)switch(2*x+3*K){case 533:break;default:q=1;}v++;}break;case 64:0===b+v+n+m+u+k&&(k=1);break;case 42:case 47:if(!(0<n+m+v))switch(b){case 0:switch(2*g+3*e.charCodeAt(l+1)){case 235:b=47;break;case 220:t=l,b=42;}break;case 42:47===g&&42===x&&t+2!==l&&(33===e.charCodeAt(t+2)&&(p+=e.substring(t,l+1)),y='',b=0);}}0===b&&(f+=y);}K=x;x=g;l++;}t=p.length;if(0<t){r=c;if(0<A&&(C=H(2,p,r,d,D,z,t,h,a,h),void 0!==C&&0===(p=C).length))return G+p+F;p=r.join(',')+'{'+p+'}';if(0!==w*E){2!==w||L(p,2)||(E=0);switch(E){case 111:p=p.replace(ha,':-moz-$1')+p;break;case 112:p=p.replace(Q,'::-webkit-input-$1')+p.replace(Q,'::-moz-$1')+p.replace(Q,':-ms-input-$1')+p;}E=0;}}return G+p+F;}function X(d,c,e){var h=c.trim().split(ia);c=h;var a=h.length,m=d.length;switch(m){case 0:case 1:var b=0;for(d=0===m?'':d[0]+' ';b<a;++b){c[b]=Z(d,c[b],e).trim();}break;default:var v=b=0;for(c=[];b<a;++b){for(var n=0;n<m;++n){c[v++]=Z(d[n]+' ',h[b],e).trim();}}}return c;}function Z(d,c,e){var h=c.charCodeAt(0);33>h&&(h=(c=c.trim()).charCodeAt(0));switch(h){case 38:return c.replace(F,'$1'+d.trim());case 58:return d.trim()+c.replace(F,'$1'+d.trim());default:if(0<1*e&&0<c.indexOf('\f'))return c.replace(F,(58===d.charCodeAt(0)?'':'$1')+d.trim());}return d+c;}function P(d,c,e,h){var a=d+';',m=2*c+3*e+4*h;if(944===m){d=a.indexOf(':',9)+1;var b=a.substring(d,a.length-1).trim();b=a.substring(0,d).trim()+b+';';return 1===w||2===w&&L(b,1)?'-webkit-'+b+b:b;}if(0===w||2===w&&!L(a,1))return a;switch(m){case 1015:return 97===a.charCodeAt(10)?'-webkit-'+a+a:a;case 951:return 116===a.charCodeAt(3)?'-webkit-'+a+a:a;case 963:return 110===a.charCodeAt(5)?'-webkit-'+a+a:a;case 1009:if(100!==a.charCodeAt(4))break;case 969:case 942:return'-webkit-'+a+a;case 978:return'-webkit-'+a+'-moz-'+a+a;case 1019:case 983:return'-webkit-'+a+'-moz-'+a+'-ms-'+a+a;case 883:if(45===a.charCodeAt(8))return'-webkit-'+a+a;if(0<a.indexOf('image-set(',11))return a.replace(ja,'$1-webkit-$2')+a;break;case 932:if(45===a.charCodeAt(4))switch(a.charCodeAt(5)){case 103:return'-webkit-box-'+a.replace('-grow','')+'-webkit-'+a+'-ms-'+a.replace('grow','positive')+a;case 115:return'-webkit-'+a+'-ms-'+a.replace('shrink','negative')+a;case 98:return'-webkit-'+a+'-ms-'+a.replace('basis','preferred-size')+a;}return'-webkit-'+a+'-ms-'+a+a;case 964:return'-webkit-'+a+'-ms-flex-'+a+a;case 1023:if(99!==a.charCodeAt(8))break;b=a.substring(a.indexOf(':',15)).replace('flex-','').replace('space-between','justify');return'-webkit-box-pack'+b+'-webkit-'+a+'-ms-flex-pack'+b+a;case 1005:return ka.test(a)?a.replace(aa,':-webkit-')+a.replace(aa,':-moz-')+a:a;case 1e3:b=a.substring(13).trim();c=b.indexOf('-')+1;switch(b.charCodeAt(0)+b.charCodeAt(c)){case 226:b=a.replace(G,'tb');break;case 232:b=a.replace(G,'tb-rl');break;case 220:b=a.replace(G,'lr');break;default:return a;}return'-webkit-'+a+'-ms-'+b+a;case 1017:if(-1===a.indexOf('sticky',9))break;case 975:c=(a=d).length-10;b=(33===a.charCodeAt(c)?a.substring(0,c):a).substring(d.indexOf(':',7)+1).trim();switch(m=b.charCodeAt(0)+(b.charCodeAt(7)|0)){case 203:if(111>b.charCodeAt(8))break;case 115:a=a.replace(b,'-webkit-'+b)+';'+a;break;case 207:case 102:a=a.replace(b,'-webkit-'+(102<m?'inline-':'')+'box')+';'+a.replace(b,'-webkit-'+b)+';'+a.replace(b,'-ms-'+b+'box')+';'+a;}return a+';';case 938:if(45===a.charCodeAt(5))switch(a.charCodeAt(6)){case 105:return b=a.replace('-items',''),'-webkit-'+a+'-webkit-box-'+b+'-ms-flex-'+b+a;case 115:return'-webkit-'+a+'-ms-flex-item-'+a.replace(ba,'')+a;default:return'-webkit-'+a+'-ms-flex-line-pack'+a.replace('align-content','').replace(ba,'')+a;}break;case 973:case 989:if(45!==a.charCodeAt(3)||122===a.charCodeAt(4))break;case 931:case 953:if(!0===la.test(d))return 115===(b=d.substring(d.indexOf(':')+1)).charCodeAt(0)?P(d.replace('stretch','fill-available'),c,e,h).replace(':fill-available',':stretch'):a.replace(b,'-webkit-'+b)+a.replace(b,'-moz-'+b.replace('fill-',''))+a;break;case 962:if(a='-webkit-'+a+(102===a.charCodeAt(5)?'-ms-'+a:'')+a,211===e+h&&105===a.charCodeAt(13)&&0<a.indexOf('transform',10))return a.substring(0,a.indexOf(';',27)+1).replace(ma,'$1-webkit-$2')+a;}return a;}function L(d,c){var e=d.indexOf(1===c?':':'{'),h=d.substring(0,3!==c?e:10);e=d.substring(e+1,d.length-1);return R(2!==c?h:h.replace(na,'$1'),e,c);}function ea(d,c){var e=P(c,c.charCodeAt(0),c.charCodeAt(1),c.charCodeAt(2));return e!==c+';'?e.replace(oa,' or ($1)').substring(4):'('+c+')';}function H(d,c,e,h,a,m,b,v,n,q){for(var g=0,x=c,w;g<A;++g){switch(w=S[g].call(B,d,x,e,h,a,m,b,v,n,q)){case void 0:case!1:case!0:case null:break;default:x=w;}}if(x!==c)return x;}function T(d){switch(d){case void 0:case null:A=S.length=0;break;default:if('function'===typeof d)S[A++]=d;else if('object'===_typeof2(d))for(var c=0,e=d.length;c<e;++c){T(d[c]);}else Y=!!d|0;}return T;}function U(d){d=d.prefix;void 0!==d&&(R=null,d?'function'!==typeof d?w=1:(w=2,R=d):w=0);return U;}function B(d,c){var e=d;33>e.charCodeAt(0)&&(e=e.trim());V=e;e=[V];if(0<A){var h=H(-1,c,e,e,D,z,0,0,0,0);void 0!==h&&'string'===typeof h&&(c=h);}var a=M(O,e,c,0,0);0<A&&(h=H(-2,a,e,e,D,z,a.length,0,0,0),void 0!==h&&(a=h));V='';E=0;z=D=1;return a;}var ca=/^\0+/g,N=/[\0\r\f]/g,aa=/: */g,ka=/zoo|gra/,ma=/([,: ])(transform)/g,ia=/,\r+?/g,F=/([\t\r\n ])*\f?&/g,fa=/@(k\w+)\s*(\S*)\s*/,Q=/::(place)/g,ha=/:(read-only)/g,G=/[svh]\w+-[tblr]{2}/,da=/\(\s*(.*)\s*\)/g,oa=/([\s\S]*?);/g,ba=/-self|flex-/g,na=/[^]*?(:[rp][el]a[\w-]+)[^]*/,la=/stretch|:\s*\w+\-(?:conte|avail)/,ja=/([^-])(image-set\()/,z=1,D=1,E=0,w=1,O=[],S=[],A=0,R=null,Y=0,V='';B.use=T;B.set=U;void 0!==W&&U(W);return B;}var unitlessKeys={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function memoize(fn){var cache=Object.create(null);return function(arg){if(cache[arg]===undefined)cache[arg]=fn(arg);return cache[arg];};}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;var isPropValid=/* #__PURE__ */memoize(function(prop){return reactPropsRegex.test(prop)||prop.charCodeAt(0)===111&&prop.charCodeAt(1)===110&&prop.charCodeAt(2)<91;});var reactIs$1={exports:{}};var reactIs_production_min={};var b$4="function"===typeof Symbol&&Symbol["for"],c$1=b$4?Symbol["for"]("react.element"):60103,d$3=b$4?Symbol["for"]("react.portal"):60106,e$1=b$4?Symbol["for"]("react.fragment"):60107,f$3=b$4?Symbol["for"]("react.strict_mode"):60108,g$3=b$4?Symbol["for"]("react.profiler"):60114,h$2=b$4?Symbol["for"]("react.provider"):60109,k$1=b$4?Symbol["for"]("react.context"):60110,l$4=b$4?Symbol["for"]("react.async_mode"):60111,m$3=b$4?Symbol["for"]("react.concurrent_mode"):60111,n$4=b$4?Symbol["for"]("react.forward_ref"):60112,p$3=b$4?Symbol["for"]("react.suspense"):60113,q$1=b$4?Symbol["for"]("react.suspense_list"):60120,r$1=b$4?Symbol["for"]("react.memo"):60115,t$2=b$4?Symbol["for"]("react.lazy"):60116,v$3=b$4?Symbol["for"]("react.block"):60121,w$4=b$4?Symbol["for"]("react.fundamental"):60117,x$1=b$4?Symbol["for"]("react.responder"):60118,y$1=b$4?Symbol["for"]("react.scope"):60119;function z$1(a){if("object"===_typeof2(a)&&null!==a){var u=a.$$typeof;switch(u){case c$1:switch(a=a.type,a){case l$4:case m$3:case e$1:case g$3:case f$3:case p$3:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$4:case t$2:case r$1:case h$2:return a;default:return u;}}case d$3:return u;}}}function A$2(a){return z$1(a)===m$3;}reactIs_production_min.AsyncMode=l$4;reactIs_production_min.ConcurrentMode=m$3;reactIs_production_min.ContextConsumer=k$1;reactIs_production_min.ContextProvider=h$2;reactIs_production_min.Element=c$1;reactIs_production_min.ForwardRef=n$4;reactIs_production_min.Fragment=e$1;reactIs_production_min.Lazy=t$2;reactIs_production_min.Memo=r$1;reactIs_production_min.Portal=d$3;reactIs_production_min.Profiler=g$3;reactIs_production_min.StrictMode=f$3;reactIs_production_min.Suspense=p$3;reactIs_production_min.isAsyncMode=function(a){return A$2(a)||z$1(a)===l$4;};reactIs_production_min.isConcurrentMode=A$2;reactIs_production_min.isContextConsumer=function(a){return z$1(a)===k$1;};reactIs_production_min.isContextProvider=function(a){return z$1(a)===h$2;};reactIs_production_min.isElement=function(a){return"object"===_typeof2(a)&&null!==a&&a.$$typeof===c$1;};reactIs_production_min.isForwardRef=function(a){return z$1(a)===n$4;};reactIs_production_min.isFragment=function(a){return z$1(a)===e$1;};reactIs_production_min.isLazy=function(a){return z$1(a)===t$2;};reactIs_production_min.isMemo=function(a){return z$1(a)===r$1;};reactIs_production_min.isPortal=function(a){return z$1(a)===d$3;};reactIs_production_min.isProfiler=function(a){return z$1(a)===g$3;};reactIs_production_min.isStrictMode=function(a){return z$1(a)===f$3;};reactIs_production_min.isSuspense=function(a){return z$1(a)===p$3;};reactIs_production_min.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e$1||a===m$3||a===g$3||a===f$3||a===p$3||a===q$1||"object"===_typeof2(a)&&null!==a&&(a.$$typeof===t$2||a.$$typeof===r$1||a.$$typeof===h$2||a.$$typeof===k$1||a.$$typeof===n$4||a.$$typeof===w$4||a.$$typeof===x$1||a.$$typeof===y$1||a.$$typeof===v$3);};reactIs_production_min.typeOf=z$1;{reactIs$1.exports=reactIs_production_min;}var reactIsExports=reactIs$1.exports;var reactIs=reactIsExports;var REACT_STATICS={childContextTypes:true,contextType:true,contextTypes:true,defaultProps:true,displayName:true,getDefaultProps:true,getDerivedStateFromError:true,getDerivedStateFromProps:true,mixins:true,propTypes:true,type:true};var KNOWN_STATICS={name:true,length:true,prototype:true,caller:true,callee:true,arguments:true,arity:true};var FORWARD_REF_STATICS={'$$typeof':true,render:true,defaultProps:true,displayName:true,propTypes:true};var MEMO_STATICS={'$$typeof':true,compare:true,defaultProps:true,displayName:true,propTypes:true,type:true};var TYPE_STATICS={};TYPE_STATICS[reactIs.ForwardRef]=FORWARD_REF_STATICS;TYPE_STATICS[reactIs.Memo]=MEMO_STATICS;function getStatics(component){if(reactIs.isMemo(component)){return MEMO_STATICS;}return TYPE_STATICS[component['$$typeof']]||REACT_STATICS;}var defineProperty=Object.defineProperty;var getOwnPropertyNames=Object.getOwnPropertyNames;var getOwnPropertySymbols=Object.getOwnPropertySymbols;var getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;var getPrototypeOf=Object.getPrototypeOf;var objectPrototype=Object.prototype;function hoistNonReactStatics(targetComponent,sourceComponent,blacklist){if(typeof sourceComponent!=='string'){if(objectPrototype){var inheritedComponent=getPrototypeOf(sourceComponent);if(inheritedComponent&&inheritedComponent!==objectPrototype){hoistNonReactStatics(targetComponent,inheritedComponent,blacklist);}}var keys=getOwnPropertyNames(sourceComponent);if(getOwnPropertySymbols){keys=keys.concat(getOwnPropertySymbols(sourceComponent));}var targetStatics=getStatics(targetComponent);var sourceStatics=getStatics(sourceComponent);for(var i=0;i<keys.length;++i){var key=keys[i];if(!KNOWN_STATICS[key]&&!(blacklist&&blacklist[key])&&!(sourceStatics&&sourceStatics[key])&&!(targetStatics&&targetStatics[key])){var descriptor=getOwnPropertyDescriptor(sourceComponent,key);try{defineProperty(targetComponent,key,descriptor);}catch(e){}}}}return targetComponent;}var hoistNonReactStatics_cjs=hoistNonReactStatics;var y=/*@__PURE__*/getDefaultExportFromCjs(hoistNonReactStatics_cjs);function v$2(){return(v$2=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e;}).apply(this,arguments);}var g$2=function g$2(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n;},S$1=function S$1(t){return null!==t&&"object"==_typeof2(t)&&"[object Object]"===(t.toString?t.toString():Object.prototype.toString.call(t))&&!reactIsExports$1.typeOf(t);},w$3=Object.freeze([]),E=Object.freeze({});function b$3(e){return"function"==typeof e;}function _$1(e){return e.displayName||e.name||"Component";}function N(e){return e&&"string"==typeof e.styledComponentId;}var A$1="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",I$1="undefined"!=typeof window&&"HTMLElement"in window,P$1=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!=="production");function j(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""));}var T$1=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e;}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t;},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0;}for(var i=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(i,t[a])&&(this.groupSizes[e]++,i++);},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n);}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s<o;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t;},e;}(),x=new Map(),k=new Map(),V$1=1,B=function B(e){if(x.has(e))return x.get(e);for(;k.has(V$1);)V$1++;var t=V$1++;return x.set(e,t),k.set(t,e),t;},z=function z(e){return k.get(e);},M$1=function M$1(e,t){t>=V$1&&(V$1=t+1),x.set(e,t),k.set(t,e);},G$1="style["+A$1+'][data-styled-version="5.3.5"]',L=new RegExp("^"+A$1+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),F$2=function F$2(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s<i;s++)(r=o[s])&&e.registerName(t,r);},Y$1=function Y$1(e,t){for(var n=(t.textContent||"").split("/*!sc*/\n"),r=[],o=0,s=n.length;o<s;o++){var i=n[o].trim();if(i){var a=i.match(L);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(M$1(u,c),F$2(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0;}else r.push(i);}}},q=function q(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null;},H=function H(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(A$1))return r;}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(A$1,"active"),r.setAttribute("data-styled-version","5.3.5");var i=q();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r;},$$1=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o;}j(17);}(t),this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0;}catch(e){return!1;}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--;},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:"";},e;}(),W$1=function(){function e(e){var t=this.element=H(e);this.nodes=t.childNodes,this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0;}return!1;},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--;},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:"";},e;}(),U$1=function(){function e(e){this.rules=[],this.length=0;}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0);},t.deleteRule=function(e){this.rules.splice(e,1),this.length--;},t.getRule=function(e){return e<this.length?this.rules[e]:"";},e;}(),J$1=I$1,X$1={isServer:!I$1,useCSSOMInjection:!P$1},Z$1=function(){function e(e,t,n){void 0===e&&(e=E),void 0===t&&(t={}),this.options=v$2({},X$1,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&I$1&&J$1&&(J$1=!1,function(e){for(var t=document.querySelectorAll(G$1),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(A$1)&&(Y$1(e,o),o.parentNode&&o.parentNode.removeChild(o));}}(this));}e.registerId=function(e){return B(e);};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(v$2({},this.options,{},t),this.gs,n&&this.names||void 0);},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1;},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U$1(o):r?new $$1(o):new W$1(o),new T$1(e)));var e,t,n,r,o;},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t);},t.registerName=function(e,t){if(B(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set();n.add(t),this.names.set(e,n);}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(B(e),n);},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear();},t.clearRules=function(e){this.getTag().clearGroup(B(e)),this.clearNames(e);},t.clearTag=function(){this.tag=void 0;},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var s=z(o);if(void 0!==s){var i=e.names.get(s),a=t.getGroup(o);if(i&&a&&i.size){var c=A$1+".g"+o+'[id="'+s+'"]',u="";void 0!==i&&i.forEach(function(e){e.length>0&&(u+=e+",");}),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n';}}}return r;}(this);},e;}(),K=/(a)(d)/gi,Q$1=function Q$1(e){return String.fromCharCode(e+(e>25?39:97));};function ee$1(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Q$1(t%52)+n;return(Q$1(t%52)+n).replace(K,"$1-$2");}var te=function te(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e;},ne$1=function ne$1(e){return te(5381,e);};function re$1(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(b$3(n)&&!N(n))return!1;}return!0;}var oe$1=ne$1("5.3.5"),se$1=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&re$1(e),this.componentId=t,this.baseHash=te(oe$1,t),this.baseStyle=n,Z$1.registerId(t);}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash){if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var s=Ne(this.rules,e,t,n).join(""),i=ee$1(te(this.baseHash,s)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a);}o.push(i),this.staticRulesId=i;}}else{for(var c=this.rules.length,u=te(this.baseHash,n.hash),l="",d=0;d<c;d++){var h=this.rules[d];if("string"==typeof h)l+=h;else if(h){var p=Ne(h,e,t,n),f=Array.isArray(p)?p.join(""):p;u=te(u,f+d),l+=f;}}if(l){var m=ee$1(u>>>0);if(!t.hasNameForId(r,m)){var y=n(l,"."+m,void 0,r);t.insertRules(r,m,y);}o.push(m);}}return o.join(" ");},e;}(),ie=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ce(e){var t,n,r,o,s=void 0===e?E:e,i=s.options,a=void 0===i?E:i,c=s.plugins,u=void 0===c?w$3:c,l=new stylis_min(a),d=[],h=function(e){function t(t){if(t)try{e(t+"}");}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"");}case-2:r.split("/*|*/}").forEach(t);}};}(function(e){d.push(e);}),f=function f(e,r,s){return 0===r&&-1!==ae.indexOf(s[n.length])||s.match(o)?e:"."+t;};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(ie,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u);}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f));},h,function(e){if(-2===e){var t=d;return d=[],t;}}])),m.hash=u.length?u.reduce(function(e,t){return t.name||j(15),te(e,t.name);},5381).toString():"",m;}var ue$1=/*#__PURE__*/wn.createContext();ue$1.Consumer;var de$1=/*#__PURE__*/wn.createContext(),he$1=(de$1.Consumer,new Z$1()),pe$1=ce();function fe$1(){return q$4(ue$1)||he$1;}function me(){return q$4(de$1)||pe$1;}function ye$1(e){var t=h$5(e.stylisPlugins),n=t[0],s=t[1],c=fe$1(),u=F$4(function(){var t=c;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t;},[e.disableCSSOMInjection,e.sheet,e.target]),l=F$4(function(){return ce({options:{prefix:!e.disableVendorPrefixes},plugins:n});},[e.disableVendorPrefixes,n]);return p$5(function(){h$3(n,e.stylisPlugins)||s(e.stylisPlugins);},[e.stylisPlugins]),/*#__PURE__*/wn.createElement(ue$1.Provider,{value:u},/*#__PURE__*/wn.createElement(de$1.Provider,{value:l},e.children));}var ve$1=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=pe$1);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"));},this.toString=function(){return j(12,String(n.name));},this.name=e,this.id="sc-keyframes-"+e,this.rules=t;}return e.prototype.getName=function(e){return void 0===e&&(e=pe$1),this.name+e.hash;},e;}(),ge$1=/([A-Z])/,Se$1=/([A-Z])/g,we=/^ms-/,Ee$1=function Ee$1(e){return"-"+e.toLowerCase();};function be$1(e){return ge$1.test(e)?e.replace(Se$1,Ee$1).replace(we,"-ms-"):e;}var _e=function _e(e){return null==e||!1===e||""===e;};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a<c;a+=1)""!==(s=Ne(e[a],n,r,o))&&(Array.isArray(s)?i.push.apply(i,s):i.push(s));return i;}if(_e(e))return"";if(N(e))return"."+e.styledComponentId;if(b$3(e)){if("function"!=typeof(l=e)||l.prototype&&l.prototype.isReactComponent||!n)return e;var u=e(n);return Ne(u,n,r,o);}var l;return e instanceof ve$1?r?(e.inject(r,o),e.getName(o)):e:S$1(e)?function e(t,n){var r,o,s=[];for(var i in t)t.hasOwnProperty(i)&&!_e(t[i])&&(Array.isArray(t[i])&&t[i].isCss||b$3(t[i])?s.push(be$1(i)+":",t[i],";"):S$1(t[i])?s.push.apply(s,e(t[i],i)):s.push(be$1(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in unitlessKeys?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(s,["}"]):s;}(e):e.toString();}var Ae$1=function Ae$1(e){return Array.isArray(e)&&(e.isCss=!0),e;};function Ce(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return b$3(e)||S$1(e)?Ae$1(Ne(g$2(w$3,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:Ae$1(Ne(g$2(e,n)));}var Re$1=function Re$1(e,t,n){return void 0===n&&(n=E),e.theme!==n.theme&&e.theme||t||n.theme;},De=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Te$1(e){return e.replace(De,"-").replace(je,"");}var xe$1=function xe$1(e){return ee$1(ne$1(e)>>>0);};function ke(e){return"string"==typeof e&&"production"==="production";}var Ve=function Ve(e){return"function"==typeof e||"object"==_typeof2(e)&&null!==e&&!Array.isArray(e);},Be=function Be(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e;};function ze(e,t,n){var r=e[n];Ve(t)&&Ve(r)?Me(r,t):e[n]=t;}function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,s=n;o<s.length;o++){var i=s[o];if(Ve(i))for(var a in i)Be(a)&&ze(e,i[a],a);}return e;}var Ge=/*#__PURE__*/wn.createContext();Ge.Consumer;function Fe(e){var t=q$4(Ge),n=F$4(function(){return function(e,t){if(!e)return j(14);if(b$3(e)){var n=e(t);return n;}return Array.isArray(e)||"object"!=_typeof2(e)?j(8):t?v$2({},t,{},e):e;}(e.theme,t);},[e.theme,t]);return e.children?/*#__PURE__*/wn.createElement(Ge.Provider,{value:n},e.children):null;}var Ye={};function qe(e,t,n){var o=N(e),i=!ke(e),a=t.attrs,c=void 0===a?w$3:a,d=t.componentId,h=void 0===d?function(e,t){var n="string"!=typeof e?"sc":Te$1(e);Ye[n]=(Ye[n]||0)+1;var r=n+"-"+xe$1("5.3.5"+n+Ye[n]);return t?t+"-"+r:r;}(t.displayName,t.parentComponentId):d,p=t.displayName,f=void 0===p?function(e){return ke(e)?"styled."+e:"Styled("+_$1(e)+")";}(e):p,g=t.displayName&&t.componentId?Te$1(t.displayName)+"-"+t.componentId:t.componentId||h,S=o&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,A=t.shouldForwardProp;o&&e.shouldForwardProp&&(A=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o);}:e.shouldForwardProp);var C,I=new se$1(n,g,o?e.componentStyle:void 0),P=I.isStatic&&0===c.length,O=function O(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,d=e.shouldForwardProp,h=e.styledComponentId,p=e.target;var f=function(e,t,n){void 0===e&&(e=E);var r=v$2({},t,{theme:e}),o={};return n.forEach(function(e){var t,n,s,i=e;for(t in b$3(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],s=i[t],n&&s?n+" "+s:n||s):i[t];}),[r,o];}(Re$1(t,q$4(Ge),a)||E,t,o),y=f[0],g=f[1],S=function(e,t,n,r){var o=fe$1(),s=me(),i=t?e.generateAndInjectStyles(E,o,s):e.generateAndInjectStyles(n,o,s);return i;}(i,r,y),w=n,_=g.$as||t.$as||g.as||t.as||p,N=ke(_),A=g!==t?v$2({},t,{},g):t,C={};for(var I in A)"$"!==I[0]&&"as"!==I&&("forwardedAs"===I?C.as=A[I]:(d?d(I,isPropValid,_):!N||isPropValid(I))&&(C[I]=A[I]));return t.style&&g.style!==t.style&&(C.style=v$2({},t.style,{},g.style)),C.className=Array.prototype.concat(c,h,S!==h?S:null,t.className,g.className).filter(Boolean).join(" "),C.ref=w,/*#__PURE__*/y$3(_,C);}(C,e,t,P);};return O.displayName=f,(C=/*#__PURE__*/wn.forwardRef(O)).attrs=S,C.componentStyle=I,C.displayName=f,C.shouldForwardProp=A,C.foldedComponentIds=o?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):w$3,C.styledComponentId=g,C.target=o?e.target:e,C.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(o[n]=e[n]);return o;}(t,["componentId"]),s=r&&r+"-"+(ke(e)?e:Te$1(_$1(e)));return qe(e,v$2({},o,{attrs:S,componentId:s}),n);},Object.defineProperty(C,"defaultProps",{get:function get(){return this._foldedDefaultProps;},set:function set(t){this._foldedDefaultProps=o?Me({},e.defaultProps,t):t;}}),C.toString=function(){return"."+C.styledComponentId;},i&&y(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C;}var He=function He(e){return function e(t,r,o){if(void 0===o&&(o=E),!reactIsExports$1.isValidElementType(r))return j(1,String(r));var s=function s(){return t(r,o,Ce.apply(void 0,arguments));};return s.withConfig=function(n){return e(t,r,v$2({},o,{},n));},s.attrs=function(n){return e(t,r,v$2({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}));},s;}(qe,e);};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){He[e]=He(e);});function Ue(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Ce.apply(void 0,[e].concat(n)).join(""),s=xe$1(o);return new ve$1(s,o);}var Ze=function Ze(){return q$4(Ge);};var messages$1={"button.back.ariaLabel":["Back"],"button.cancel":["Cancel"],"button.continue":["Continue"],"button.createPasskey":["Create a Passkey"],"button.createPasswordInstead":["Create a password instead"],"button.delete":["Delete"],"button.done":["Done"],"button.edit":["Edit"],"button.emailLogin":["Continue with email"],"button.emailMagicLink":["Email me a login link"],"button.emailOTP":["Email me a login code"],"button.forgotPassword":["Forgot Password?"],"button.hidePassword":["Hide password"],"button.loginWithPasskey":["Login with a Passkey"],"button.loginWithoutPassword":["Login without a password"],"button.retry":["Try again"],"button.save":["Save"],"button.showPassword":["Show password"],"button.skip":["Skip"],"button.sms":["Continue with text message"],"button.whatsapp":["Continue with WhatsApp"],"createAccount.title":["Choose how you would like to create your account."],"crypto.connectWallet.instructionPopup":["Complete sign in by connecting through the wallet pop up in the right corner of your screen."],"crypto.connectWallet.title":["Connecting to your wallet..."],"crypto.continueWithOtherWallet.title":["Continue with other wallet"],"crypto.error.content":["Your sign in request could not be completed. Use the back arrow to return to the log in screen and try again!"],"crypto.error.title":["Looks like there was an error!"],"crypto.setupNewWallet.content":["Signing in with a crypto wallet can help keep your account private and secure."],"crypto.setupNewWallet.instruction":["Get started by downloading any Ethereum or Solana wallet. We’ve included a few examples of wallet extensions you can find below. Once you’ve set up your wallet, you can use it to sign in!"],"crypto.setupNewWallet.title":["Set up a new crypto wallet"],"crypto.signMessage.instruction":["Complete the signature request through the wallet pop up in the right corner of your screen."],"crypto.signMessage.title":["Completing signature request..."],"crypto.success.content":["You have successfully connected your wallet."],"crypto.success.title":["Success!"],"crypto.troubleHelp":["Having trouble? Use the back arrow to return to the main screen and try logging in again."],"crypto.wallet.binance":["Binance"],"crypto.wallet.coinbase":["Coinbase"],"crypto.wallet.continueWithBinance":["Continue with Binance"],"crypto.wallet.continueWithCoinbase":["Continue with Coinbase"],"crypto.wallet.continueWithEthereum":["Continue with Other Ethereum Wallet"],"crypto.wallet.continueWithMetamask":["Continue with Metamask"],"crypto.wallet.continueWithOtherWallet":["Continue with other Crypto Wallet"],"crypto.wallet.continueWithPhantom":["Continue with Phantom"],"crypto.wallet.continueWithSolana":["Continue with Other Solana Wallet"],"crypto.wallet.continueWithVessel":["Continue with Vessel"],"crypto.wallet.metamask":["Metamask"],"crypto.wallet.otherEthereum":["Other Ethereum Wallet"],"crypto.wallet.otherSolana":["Other Solana Wallet"],"crypto.wallet.phantom":["Phantom"],"crypto.wallet.setupNewWallet":["Set up a new crypto wallet"],"crypto.wallet.vessel":["Vessel"],"emailConfirmation.content":["An email was sent to <bold>",["email"],"</bold>."],"emailConfirmation.title":["Check your email"],"error.breachedPassword":["Password appears in the list of breached passwords and must be reset."],"error.duplicatePasskey":["The Passkey cannot be created as it seems to be already registered. It is possible this Passkey was registered on another device but has synced cross-device."],"error.duplicatePhoneNumber":["A member with the specified phone number already exists for this organization."],"error.emailNotFound":["Email not found."],"error.inactiveEmail":["The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."],"error.invalidCode":["Code format is invalid, please try again."],"error.invalidEmail":["Email format is invalid."],"error.invalidPhoneNumber":["Phone number format is invalid. Ensure the phone number is in the E.164 format."],"error.invalidPhoneNumberCountryCode":["The phone number's country code is invalid, unsupported, or disabled."],"error.invalidSessionToken":["Invalid session token."],"error.memberPasswordNotFound":["Member password not found."],"error.noUserPassword":["Password not found for this user. Please try again."],"error.oauthFlowCallbackError":["An error was encountered in the callback of the OAuth flow. Please try again."],"error.oauthTokenNotFound":["OAuth Token could not be found."],"error.otpCodeNotFound":["Invalid passcode, please try again."],"error.passkeyNotCreated":["Your Passkey was not created. Click “Create a Passkey” to try again or skip without adding a Passkey."],"error.passkeyRegistrationNotFound":["Passkey registration not found. You may have deleted the passkey from your account but not password manager. Please try again."],"error.passkeyUnknown":["Unknown error occurred during passkey authentication. Please try again."],"error.resetPassword":["Password must be reset."],"error.sessionNotFound":["Session not found."],"error.title":["Looks like there was an error!"],"error.unableToAuthMagicLink":["The magic link could not be authenticated because it was either already used or expired. Please try again."],"error.unauthorizedAction":["Unauthorized action."],"error.unauthorizedCredentials":["Unauthorized credentials."],"error.unsubscribedPhoneNumber":["Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."],"error.userLockLimitReached":["Too many failed authentication attempts. Please try again later."],"error.userUnauthenticated":["Must have an active session to call this method. Have you logged in yet?"],"errors.invalidEmail":["Invalid email address."],"formField.countryCode.label":["Country code"],"formField.email.label":["Email"],"formField.email.placeholder":["example@email.com"],"formField.otp.ariaLabel":["One-time passcode"],"formField.passcode.status.verifying":["Verifying passcode..."],"formField.password.label":["Password"],"formField.phone.label":["Phone number"],"idpConsent.allowClientTo":["Allow ",["clientName"]," to:"],"idpConsent.button.allow":["Allow"],"idpConsent.button.deny":["Deny"],"idpConsent.cannotGrantRequest":["You cannot grant ",["clientName"],"'s request to:"],"idpConsent.customScopes.title":[["clientName"]," wants to access your ",["projectName"]," account"],"idpConsent.defaultClientName":["The App"],"idpConsent.denied":["Access to the application was denied."],"idpConsent.noActiveSession":["No active session detected. Please log in to continue."],"idpConsent.noPermissionsToGrant":["You do not have permissions to grant ",["clientName"]," access to some of the requested scopes."],"idpConsent.signIn.title":["Sign in to ",["clientName"]," with ",["projectName"]],"idpLogout.confirmMessage":["Are you sure you want to log out of your ",["projectName"]," account?"],"idpLogout.no":["No"],"idpLogout.notLoggedOut":["You have not been logged out. You may close this page."],"idpLogout.title":["Log out?"],"idpLogout.yes":["Yes"],"link.openInGmail":["Open in Gmail"],"link.openInOutlook":["Open in Outlook"],"link.openInYahoo":["Open in Yahoo"],"login.loading":["Logging in..."],"login.success.content":["You have successfully logged in."],"login.title":["Sign up or log in"],"methodDivider.text":["or"],"oauth.continueWithAmazon":["Continue with Amazon"],"oauth.continueWithApple":["Continue with Apple"],"oauth.continueWithBitbucket":["Continue with Bitbucket"],"oauth.continueWithCoinbase":["Continue with Coinbase"],"oauth.continueWithDiscord":["Continue with Discord"],"oauth.continueWithFacebook":["Continue with Facebook"],"oauth.continueWithFigma":["Continue with Figma"],"oauth.continueWithGitHub":["Continue with GitHub"],"oauth.continueWithGitLab":["Continue with GitLab"],"oauth.continueWithGoogle":["Continue with Google"],"oauth.continueWithLinkedIn":["Continue with LinkedIn"],"oauth.continueWithMicrosoft":["Continue with Microsoft"],"oauth.continueWithSalesforce":["Continue with Salesforce"],"oauth.continueWithSlack":["Continue with Slack"],"oauth.continueWithSnapchat":["Continue with Snapchat"],"oauth.continueWithTikTok":["Continue with TikTok"],"oauth.continueWithTwitch":["Continue with Twitch"],"oauth.continueWithTwitter":["Continue with Twitter"],"oauth.continueWithYahoo":["Continue with Yahoo"],"otp.success.content":["Your passcode has been successfully verified."],"passcode.codeSent":["Code sent"],"passcode.didntGetIt":["Didn't get it?"],"passcode.expirationCountdown":["Your code expires in ",["timeRemaining"],"."],"passcode.expired":["Your code has expired."],"passcode.resendCode":["Resend code"],"passcode.sentConfirmation":["A 6-digit passcode was sent to you at <bold>",["destination"],"</bold>."],"passcode.title":["Enter passcode"],"passkey.editing.label":["Passkey name"],"passkey.registrationStart.description":["Passkeys are encrypted digital keys you create using your fingerprint, face, or screen lock. Creating a Passkey will allow you to easily and securely log in to your account."],"passkey.registrationStart.error.noUser":["Error: Cannot use PasskeyRegistration component without active user authenticated."],"passkey.registrationStart.subtitle":["With Passkeys you don't need to remember complex passwords."],"passkey.registrationStart.title":["Set up a new Passkey"],"passkey.registrationSuccess.deleteWarning":["Once deleted, the passkey cannot be restored."],"passkey.registrationSuccess.existingPasskeys":["Existing Passkeys"],"passkey.registrationSuccess.setupAnother":["Set up another Passkey"],"passkey.registrationSuccess.title":["Passkey successfully created!"],"passkey.success.content":["Your Passkey has been successfully authenticated."],"password.breached.content":["A different site where you use the same password had a security issue recently. For your safety, an email was sent to you at <bold>",["email"],"</bold> to reset your password."],"password.breached.title":["Check your email to set a new password"],"password.createAccount.content":["Finish creating your account by setting a password."],"password.didntGetItResend":["Didn't get it? <resendButton>Resend email</resendButton>"],"password.forgot.content":["A link to reset your password was sent to you at <bold>",["email"],"</bold>."],"password.forgot.title":["Forgot password?"],"password.login.title":["Log In"],"password.reset.loggingInProgress":["Logging in..."],"password.reset.loginWithoutPassword":["Login without a password"],"password.reset.title":["Reset your password"],"password.resetRequired.content":["We want to make sure your account is secure and that it's really you logging in! A login link was sent to you at <bold>",["email"],"</bold>."],"password.resetRequired.title":["Check your email to set a new password!"],"password.setNew.content":["A login link was sent to you at <bold>",["email"],"</bold>."],"password.setNew.title":["Check your email!"],"password.strengthError.breached":["This password may have been used on a different site that experienced a security issue. Please choose another password."],"password.strengthError.complexity":[["complexity","plural",{one:["Must contain ","#"," of the following: uppercase letter, lowercase letter, number, symbol"],other:["Must contain ","#"," of the following: uppercase letter, lowercase letter, number, symbol"]}]],"password.strengthError.minimumLength":[["characterLength","plural",{one:["Must be at least ","#"," character long"],other:["Must be at least ","#"," characters long"]}]],"password.zxcvbn.suggestion.addWords":["Add another word or two. Uncommon words are better."],"password.zxcvbn.suggestion.allUppercase":["All-uppercase is almost as easy to guess as all-lowercase."],"password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou":["Avoid dates and years that are associated with you."],"password.zxcvbn.suggestion.avoidRecentYears":["Avoid recent years."],"password.zxcvbn.suggestion.avoidRepeats":["Avoid repeated words and characters."],"password.zxcvbn.suggestion.avoidSequences":["Avoid sequences."],"password.zxcvbn.suggestion.avoidYearsAssociatedWithYou":["Avoid years that are associated with you."],"password.zxcvbn.suggestion.capitalization":["Capitalization doesn't help very much."],"password.zxcvbn.suggestion.longerKeyboardPattern":["Use a longer keyboard pattern with more turns."],"password.zxcvbn.suggestion.noSymbolsDigitsUppercase":["No need for symbols, digits, or uppercase letters."],"password.zxcvbn.suggestion.predictableSubstitutions":["Predictable substitutions like '@' instead of 'a' don't help very much."],"password.zxcvbn.suggestion.reversed":["Reversed words aren't much harder to guess."],"password.zxcvbn.suggestion.useAFewWords":["Use a few words, avoid common phrases."],"password.zxcvbn.warning.commonNames":["Common names and surnames are easy to guess."],"password.zxcvbn.warning.dates":["Dates are often easy to guess."],"password.zxcvbn.warning.longerRepeats":["Repeats like \"abcabcabc\" are only slightly harder to guess than \"abc\"."],"password.zxcvbn.warning.names":["Names and surnames by themselves are easy to guess."],"password.zxcvbn.warning.recentYears":["Recent years are easy to guess."],"password.zxcvbn.warning.repeats":["Repeats like \"aaa\" are easy to guess."],"password.zxcvbn.warning.sequences":["Sequences like \"abc\" or \"6543\" are easy to guess."],"password.zxcvbn.warning.shortKeyboardPatterns":["Short keyboard patterns are easy to guess."],"password.zxcvbn.warning.similarToCommonPassword":["This is similar to a commonly used password."],"password.zxcvbn.warning.straightRows":["Straight rows of keys are easy to guess."],"password.zxcvbn.warning.top100CommonPassword":["This is a top-100 common password."],"password.zxcvbn.warning.top10CommonPassword":["This is a top-10 common password."],"password.zxcvbn.warning.veryCommonPassword":["This is a very common password."],"password.zxcvbn.warning.wordByItself":["A word by itself is easy to guess."],"provider.lastUsed":["Last used"],"success.title":["Success!"],"tab.email":["Email"],"tab.text":["Text"],"tab.whatsapp":["WhatsApp"],"toast.emailResent":["Email resent"],"watermark.altText":["Powered by Stytch"]};var messages=messages$1;var parser={};var lexer={};var moo={exports:{}};(function(module){(function(root,factory){if(module.exports){module.exports=factory();}else{root.moo=factory();}})(commonjsGlobal,function(){var hasOwnProperty=Object.prototype.hasOwnProperty;var toString=Object.prototype.toString;var hasSticky=typeof new RegExp().sticky==='boolean';function isRegExp(o){return o&&toString.call(o)==='[object RegExp]';}function isObject(o){return o&&_typeof2(o)==='object'&&!isRegExp(o)&&!Array.isArray(o);}function reEscape(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&');}function reGroups(s){var re=new RegExp('|'+s);return re.exec('').length-1;}function reCapture(s){return'('+s+')';}function reUnion(regexps){if(!regexps.length)return'(?!)';var source=regexps.map(function(s){return"(?:"+s+")";}).join('|');return"(?:"+source+")";}function regexpOrLiteral(obj){if(typeof obj==='string'){return'(?:'+reEscape(obj)+')';}else if(isRegExp(obj)){if(obj.ignoreCase)throw new Error('RegExp /i flag not allowed');if(obj.global)throw new Error('RegExp /g flag is implied');if(obj.sticky)throw new Error('RegExp /y flag is implied');if(obj.multiline)throw new Error('RegExp /m flag is implied');return obj.source;}else{throw new Error('Not a pattern: '+obj);}}function pad(s,length){if(s.length>length){return s;}return Array(length-s.length+1).join(" ")+s;}function lastNLines(string,numLines){var position=string.length;var lineBreaks=0;while(true){var idx=string.lastIndexOf("\n",position-1);if(idx===-1){break;}else{lineBreaks++;}position=idx;if(lineBreaks===numLines){break;}if(position===0){break;}}var startPosition=lineBreaks<numLines?0:position+1;return string.substring(startPosition).split("\n");}function objectToRules(object){var keys=Object.getOwnPropertyNames(object);var result=[];for(var i=0;i<keys.length;i++){var key=keys[i];var thing=object[key];var rules=[].concat(thing);if(key==='include'){for(var j=0;j<rules.length;j++){result.push({include:rules[j]});}continue;}var match=[];rules.forEach(function(rule){if(isObject(rule)){if(match.length)result.push(ruleOptions(key,match));result.push(ruleOptions(key,rule));match=[];}else{match.push(rule);}});if(match.length)result.push(ruleOptions(key,match));}return result;}function arrayToRules(array){var result=[];for(var i=0;i<array.length;i++){var obj=array[i];if(obj.include){var include=[].concat(obj.include);for(var j=0;j<include.length;j++){result.push({include:include[j]});}continue;}if(!obj.type){throw new Error('Rule has no type: '+JSON.stringify(obj));}result.push(ruleOptions(obj.type,obj));}return result;}function ruleOptions(type,obj){if(!isObject(obj)){obj={match:obj};}if(obj.include){throw new Error('Matching rules cannot also include states');}var options={defaultType:type,lineBreaks:!!obj.error||!!obj.fallback,pop:false,next:null,push:null,error:false,fallback:false,value:null,type:null,shouldThrow:false};for(var key in obj){if(hasOwnProperty.call(obj,key)){options[key]=obj[key];}}if(typeof options.type==='string'&&type!==options.type){throw new Error("Type transform cannot be a string (type '"+options.type+"' for token '"+type+"')");}var match=options.match;options.match=Array.isArray(match)?match:match?[match]:[];options.match.sort(function(a,b){return isRegExp(a)&&isRegExp(b)?0:isRegExp(b)?-1:isRegExp(a)?+1:b.length-a.length;});return options;}function toRules(spec){return Array.isArray(spec)?arrayToRules(spec):objectToRules(spec);}var defaultErrorRule=ruleOptions('error',{lineBreaks:true,shouldThrow:true});function compileRules(rules,hasStates){var errorRule=null;var fast=Object.create(null);var fastAllowed=true;var unicodeFlag=null;var groups=[];var parts=[];for(var i=0;i<rules.length;i++){if(rules[i].fallback){fastAllowed=false;}}for(var i=0;i<rules.length;i++){var options=rules[i];if(options.include){throw new Error('Inheritance is not allowed in stateless lexers');}if(options.error||options.fallback){if(errorRule){if(!options.fallback===!errorRule.fallback){throw new Error("Multiple "+(options.fallback?"fallback":"error")+" rules not allowed (for token '"+options.defaultType+"')");}else{throw new Error("fallback and error are mutually exclusive (for token '"+options.defaultType+"')");}}errorRule=options;}var match=options.match.slice();if(fastAllowed){while(match.length&&typeof match[0]==='string'&&match[0].length===1){var word=match.shift();fast[word.charCodeAt(0)]=options;}}if(options.pop||options.push||options.next){if(!hasStates){throw new Error("State-switching options are not allowed in stateless lexers (for token '"+options.defaultType+"')");}if(options.fallback){throw new Error("State-switching options are not allowed on fallback tokens (for token '"+options.defaultType+"')");}}if(match.length===0){continue;}fastAllowed=false;groups.push(options);for(var j=0;j<match.length;j++){var obj=match[j];if(!isRegExp(obj)){continue;}if(unicodeFlag===null){unicodeFlag=obj.unicode;}else if(unicodeFlag!==obj.unicode&&options.fallback===false){throw new Error('If one rule is /u then all must be');}}var pat=reUnion(match.map(regexpOrLiteral));var regexp=new RegExp(pat);if(regexp.test("")){throw new Error("RegExp matches empty string: "+regexp);}var groupCount=reGroups(pat);if(groupCount>0){throw new Error("RegExp has capture groups: "+regexp+"\nUse (?: … ) instead");}if(!options.lineBreaks&&regexp.test('\n')){throw new Error('Rule should declare lineBreaks: '+regexp);}parts.push(reCapture(pat));}var fallbackRule=errorRule&&errorRule.fallback;var flags=hasSticky&&!fallbackRule?'ym':'gm';var suffix=hasSticky||fallbackRule?'':'|';if(unicodeFlag===true)flags+="u";var combined=new RegExp(reUnion(parts)+suffix,flags);return{regexp:combined,groups:groups,fast:fast,error:errorRule||defaultErrorRule};}function compile(rules){var result=compileRules(toRules(rules));return new Lexer({start:result},'start');}function checkStateGroup(g,name,map){var state=g&&(g.push||g.next);if(state&&!map[state]){throw new Error("Missing state '"+state+"' (in token '"+g.defaultType+"' of state '"+name+"')");}if(g&&g.pop&&+g.pop!==1){throw new Error("pop must be 1 (in token '"+g.defaultType+"' of state '"+name+"')");}}function compileStates(states,start){var all=states.$all?toRules(states.$all):[];delete states.$all;var keys=Object.getOwnPropertyNames(states);if(!start)start=keys[0];var ruleMap=Object.create(null);for(var i=0;i<keys.length;i++){var key=keys[i];ruleMap[key]=toRules(states[key]).concat(all);}for(var i=0;i<keys.length;i++){var key=keys[i];var rules=ruleMap[key];var included=Object.create(null);for(var j=0;j<rules.length;j++){var rule=rules[j];if(!rule.include)continue;var splice=[j,1];if(rule.include!==key&&!included[rule.include]){included[rule.include]=true;var newRules=ruleMap[rule.include];if(!newRules){throw new Error("Cannot include nonexistent state '"+rule.include+"' (in state '"+key+"')");}for(var k=0;k<newRules.length;k++){var newRule=newRules[k];if(rules.indexOf(newRule)!==-1)continue;splice.push(newRule);}}rules.splice.apply(rules,splice);j--;}}var map=Object.create(null);for(var i=0;i<keys.length;i++){var key=keys[i];map[key]=compileRules(ruleMap[key],true);}for(var i=0;i<keys.length;i++){var name=keys[i];var state=map[name];var groups=state.groups;for(var j=0;j<groups.length;j++){checkStateGroup(groups[j],name,map);}var fastKeys=Object.getOwnPropertyNames(state.fast);for(var j=0;j<fastKeys.length;j++){checkStateGroup(state.fast[fastKeys[j]],name,map);}}return new Lexer(map,start);}function keywordTransform(map){var isMap=typeof Map!=='undefined';var reverseMap=isMap?new Map():Object.create(null);var types=Object.getOwnPropertyNames(map);for(var i=0;i<types.length;i++){var tokenType=types[i];var item=map[tokenType];var keywordList=Array.isArray(item)?item:[item];keywordList.forEach(function(keyword){if(typeof keyword!=='string'){throw new Error("keyword must be string (in keyword '"+tokenType+"')");}if(isMap){reverseMap.set(keyword,tokenType);}else{reverseMap[keyword]=tokenType;}});}return function(k){return isMap?reverseMap.get(k):reverseMap[k];};}var Lexer=function Lexer(states,state){this.startState=state;this.states=states;this.buffer='';this.stack=[];this.reset();};Lexer.prototype.reset=function(data,info){this.buffer=data||'';this.index=0;this.line=info?info.line:1;this.col=info?info.col:1;this.queuedToken=info?info.queuedToken:null;this.queuedText=info?info.queuedText:"";this.queuedThrow=info?info.queuedThrow:null;this.setState(info?info.state:this.startState);this.stack=info&&info.stack?info.stack.slice():[];return this;};Lexer.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow};};Lexer.prototype.setState=function(state){if(!state||this.state===state)return;this.state=state;var info=this.states[state];this.groups=info.groups;this.error=info.error;this.re=info.regexp;this.fast=info.fast;};Lexer.prototype.popState=function(){this.setState(this.stack.pop());};Lexer.prototype.pushState=function(state){this.stack.push(this.state);this.setState(state);};var eat=hasSticky?function(re,buffer){return re.exec(buffer);}:function(re,buffer){var match=re.exec(buffer);if(match[0].length===0){return null;}return match;};Lexer.prototype._getGroup=function(match){var groupCount=this.groups.length;for(var i=0;i<groupCount;i++){if(match[i+1]!==undefined){return this.groups[i];}}throw new Error('Cannot find token type for matched text');};function tokenToString(){return this.value;}Lexer.prototype.next=function(){var index=this.index;if(this.queuedGroup){var token=this._token(this.queuedGroup,this.queuedText,index);this.queuedGroup=null;this.queuedText="";return token;}var buffer=this.buffer;if(index===buffer.length){return;}var group=this.fast[buffer.charCodeAt(index)];if(group){return this._token(group,buffer.charAt(index),index);}var re=this.re;re.lastIndex=index;var match=eat(re,buffer);var error=this.error;if(match==null){return this._token(error,buffer.slice(index,buffer.length),index);}var group=this._getGroup(match);var text=match[0];if(error.fallback&&match.index!==index){this.queuedGroup=group;this.queuedText=text;return this._token(error,buffer.slice(index,match.index),index);}return this._token(group,text,index);};Lexer.prototype._token=function(group,text,offset){var lineBreaks=0;if(group.lineBreaks){var matchNL=/\n/g;var nl=1;if(text==='\n'){lineBreaks=1;}else{while(matchNL.exec(text)){lineBreaks++;nl=matchNL.lastIndex;}}}var token={type:typeof group.type==='function'&&group.type(text)||group.defaultType,value:typeof group.value==='function'?group.value(text):text,text:text,toString:tokenToString,offset:offset,lineBreaks:lineBreaks,line:this.line,col:this.col};var size=text.length;this.index+=size;this.line+=lineBreaks;if(lineBreaks!==0){this.col=size-nl+1;}else{this.col+=size;}if(group.shouldThrow){var err=new Error(this.formatError(token,"invalid syntax"));throw err;}if(group.pop)this.popState();else if(group.push)this.pushState(group.push);else if(group.next)this.setState(group.next);return token;};if(typeof Symbol!=='undefined'&&Symbol.iterator){var LexerIterator=function LexerIterator(lexer){this.lexer=lexer;};LexerIterator.prototype.next=function(){var token=this.lexer.next();return{value:token,done:!token};};LexerIterator.prototype[Symbol.iterator]=function(){return this;};Lexer.prototype[Symbol.iterator]=function(){return new LexerIterator(this);};}Lexer.prototype.formatError=function(token,message){if(token==null){var text=this.buffer.slice(this.index);var token={text:text,offset:this.index,lineBreaks:text.indexOf('\n')===-1?0:1,line:this.line,col:this.col};}var numLinesAround=2;var firstDisplayedLine=Math.max(token.line-numLinesAround,1);var lastDisplayedLine=token.line+numLinesAround;var lastLineDigits=String(lastDisplayedLine).length;var displayedLines=lastNLines(this.buffer,this.line-token.line+numLinesAround+1).slice(0,5);var errorLines=[];errorLines.push(message+" at line "+token.line+" col "+token.col+":");errorLines.push("");for(var i=0;i<displayedLines.length;i++){var line=displayedLines[i];var lineNo=firstDisplayedLine+i;errorLines.push(pad(String(lineNo),lastLineDigits)+" "+line);if(lineNo===token.line){errorLines.push(pad("",lastLineDigits+token.col+1)+"^");}}return errorLines.join("\n");};Lexer.prototype.clone=function(){return new Lexer(this.states,this.state);};Lexer.prototype.has=function(tokenType){return true;};return{compile:compile,states:compileStates,error:Object.freeze({error:true}),fallback:Object.freeze({fallback:true}),keywords:keywordTransform};});})(moo);var mooExports=moo.exports;(function(exports){var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(mod){return mod&&mod.__esModule?mod:{"default":mod};};Object.defineProperty(exports,"__esModule",{value:true});exports.lexer=exports.states=void 0;var moo_1=__importDefault(mooExports);exports.states={body:{doubleapos:{match:"''",value:function value(){return"'";}},quoted:{lineBreaks:true,match:/'[#\{\}](?:(?:[\0-&\(-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|'')*'(?!')/,value:function value(src){return src.slice(1,-1).replace(/''/g,"'");}},argument:{lineBreaks:true,match:/\{[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[\0-\x08\x0E-\x1F0-9A-Z_a-z\x7F-\x84\x86-\xA0\xA8\xAA\xAD\xAF\xB2-\xB5\xB7-\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u200D\u202A-\u202F\u203F\u2040\u2054\u205F-\u218F\u2460-\u24FF\u2776-\u2793\u2C00-\u2DFF\u2E80-\u3000\u3004-\u3007\u3021-\u302F\u3031-\uD7FF\uE000-\uFD3D\uFD40-\uFE44\uFE47-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*/,push:'arg',value:function value(src){return src.substring(1).trim();}},octothorpe:'#',end:{match:'}',pop:1},content:{lineBreaks:true,match:/(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[\0-"\$-&\(-z\|~-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*/}},arg:{select:{lineBreaks:true,match:/,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:plural|select|selectordinal)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*/,next:'select',value:function value(src){return src.split(',')[1].trim();}},'func-args':{lineBreaks:true,match:/,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[\0-\x08\x0E-\x1F0-9A-Z_a-z\x7F-\x84\x86-\xA0\xA8\xAA\xAD\xAF\xB2-\xB5\xB7-\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u200D\u202A-\u202F\u203F\u2040\u2054\u205F-\u218F\u2460-\u24FF\u2776-\u2793\u2C00-\u2DFF\u2E80-\u3000\u3004-\u3007\u3021-\u302F\u3031-\uD7FF\uE000-\uFD3D\uFD40-\uFE44\uFE47-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*,/,next:'body',value:function value(src){return src.split(',')[1].trim();}},'func-simple':{lineBreaks:true,match:/,[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[\0-\x08\x0E-\x1F0-9A-Z_a-z\x7F-\x84\x86-\xA0\xA8\xAA\xAD\xAF\xB2-\xB5\xB7-\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u200D\u202A-\u202F\u203F\u2040\u2054\u205F-\u218F\u2460-\u24FF\u2776-\u2793\u2C00-\u2DFF\u2E80-\u3000\u3004-\u3007\u3021-\u302F\u3031-\uD7FF\uE000-\uFD3D\uFD40-\uFE44\uFE47-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*/,value:function value(src){return src.substring(1).trim();}},end:{match:'}',pop:1}},select:{offset:{lineBreaks:true,match:/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*offset[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*:[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*[0-9]+[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*/,value:function value(src){return src.split(':')[1].trim();}},"case":{lineBreaks:true,match:/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:=[0-9]+|(?:[\0-\x08\x0E-\x1F0-9A-Z_a-z\x7F-\x84\x86-\xA0\xA8\xAA\xAD\xAF\xB2-\xB5\xB7-\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u200D\u202A-\u202F\u203F\u2040\u2054\u205F-\u218F\u2460-\u24FF\u2776-\u2793\u2C00-\u2DFF\u2E80-\u3000\u3004-\u3007\u3021-\u302F\u3031-\uD7FF\uE000-\uFD3D\uFD40-\uFE44\uFE47-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\{/,push:'body',value:function value(src){return src.substring(0,src.indexOf('{')).trim();}},end:{match:/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\}/,pop:1}}};exports.lexer=moo_1["default"].states(exports.states);})(lexer);Object.defineProperty(parser,"__esModule",{value:true});parser.ParseError=void 0;var parse_1=parser.parse=parse;var lexer_js_1=lexer;var getContext=function getContext(lt){return{offset:lt.offset,line:lt.line,col:lt.col,text:lt.text,lineBreaks:lt.lineBreaks};};var isSelectType=function isSelectType(type){return type==='plural'||type==='select'||type==='selectordinal';};function strictArgStyleParam(lt,param){var value='';var text='';var _iterator3=_createForOfIteratorHelper2(param),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _p=_step3.value;var pText=_p.ctx.text;text+=pText;switch(_p.type){case'content':value+=_p.value;break;case'argument':case'function':case'octothorpe':value+=pText;break;default:throw new ParseError(lt,"Unsupported part in strict mode function arg style: ".concat(pText));}}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}var c={type:'content',value:value.trim(),ctx:Object.assign({},param[0].ctx,{text:text})};return[c];}var strictArgTypes=['number','date','time','spellout','ordinal','duration'];var defaultPluralKeys=['zero','one','two','few','many','other'];var ParseError=/*#__PURE__*/function(_Error6){function ParseError(lt,msg){_classCallCheck2(this,ParseError);return _callSuper2(this,ParseError,[lexer_js_1.lexer.formatError(lt,msg)]);}_inherits2(ParseError,_Error6);return _createClass2(ParseError);}(/*#__PURE__*/_wrapNativeSuper2(Error));parser.ParseError=ParseError;var Parser=/*#__PURE__*/function(){function Parser(src,opt){_classCallCheck2(this,Parser);var _a,_b,_c,_d;this.lexer=lexer_js_1.lexer.reset(src);this.cardinalKeys=(_a=opt===null||opt===void 0?void 0:opt.cardinal)!==null&&_a!==void 0?_a:defaultPluralKeys;this.ordinalKeys=(_b=opt===null||opt===void 0?void 0:opt.ordinal)!==null&&_b!==void 0?_b:defaultPluralKeys;this.strict=(_c=opt===null||opt===void 0?void 0:opt.strict)!==null&&_c!==void 0?_c:false;this.strictPluralKeys=(_d=opt===null||opt===void 0?void 0:opt.strictPluralKeys)!==null&&_d!==void 0?_d:true;}return _createClass2(Parser,[{key:"parse",value:function parse(){return this.parseBody(false,true);}},{key:"checkSelectKey",value:function checkSelectKey(lt,type,key){if(key[0]==='='){if(type==='select'){throw new ParseError(lt,"The case ".concat(key," is not valid with select"));}}else if(type!=='select'){var keys=type==='plural'?this.cardinalKeys:this.ordinalKeys;if(this.strictPluralKeys&&keys.length>0&&!keys.includes(key)){var msg="The ".concat(type," case ").concat(key," is not valid in this locale");throw new ParseError(lt,msg);}}}},{key:"parseSelect",value:function parseSelect(_ref20,inPlural,ctx,type){var arg=_ref20.value;var sel={type:type,arg:arg,cases:[],ctx:ctx};if(type==='plural'||type==='selectordinal')inPlural=true;else if(this.strict)inPlural=false;var _iterator4=_createForOfIteratorHelper2(this.lexer),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var lt=_step4.value;switch(lt.type){case'offset':if(type==='select'){throw new ParseError(lt,'Unexpected plural offset for select');}if(sel.cases.length>0){throw new ParseError(lt,'Plural offset must be set before cases');}sel.pluralOffset=Number(lt.value);ctx.text+=lt.text;ctx.lineBreaks+=lt.lineBreaks;break;case'case':{this.checkSelectKey(lt,type,lt.value);sel.cases.push({key:lt.value,tokens:this.parseBody(inPlural),ctx:getContext(lt)});break;}case'end':return sel;default:throw new ParseError(lt,"Unexpected lexer token: ".concat(lt.type));}}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}throw new ParseError(null,'Unexpected message end');}},{key:"parseArgToken",value:function parseArgToken(lt,inPlural){var ctx=getContext(lt);var argType=this.lexer.next();if(!argType)throw new ParseError(null,'Unexpected message end');ctx.text+=argType.text;ctx.lineBreaks+=argType.lineBreaks;if(this.strict&&(argType.type==='func-simple'||argType.type==='func-args')&&!strictArgTypes.includes(argType.value)){var msg="Invalid strict mode function arg type: ".concat(argType.value);throw new ParseError(lt,msg);}switch(argType.type){case'end':return{type:'argument',arg:lt.value,ctx:ctx};case'func-simple':{var end=this.lexer.next();if(!end)throw new ParseError(null,'Unexpected message end');if(end.type!=='end'){throw new ParseError(end,"Unexpected lexer token: ".concat(end.type));}ctx.text+=end.text;if(isSelectType(argType.value.toLowerCase())){throw new ParseError(argType,"Invalid type identifier: ".concat(argType.value));}return{type:'function',arg:lt.value,key:argType.value,ctx:ctx};}case'func-args':{if(isSelectType(argType.value.toLowerCase())){var _msg="Invalid type identifier: ".concat(argType.value);throw new ParseError(argType,_msg);}var param=this.parseBody(this.strict?false:inPlural);if(this.strict&&param.length>0){param=strictArgStyleParam(lt,param);}return{type:'function',arg:lt.value,key:argType.value,param:param,ctx:ctx};}case'select':if(isSelectType(argType.value)){return this.parseSelect(lt,inPlural,ctx,argType.value);}else{throw new ParseError(argType,"Unexpected select type ".concat(argType.value));}default:throw new ParseError(argType,"Unexpected lexer token: ".concat(argType.type));}}},{key:"parseBody",value:function parseBody(inPlural,atRoot){var tokens=[];var content=null;var _iterator5=_createForOfIteratorHelper2(this.lexer),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var lt=_step5.value;if(lt.type==='argument'){if(content)content=null;tokens.push(this.parseArgToken(lt,inPlural));}else if(lt.type==='octothorpe'&&inPlural){if(content)content=null;tokens.push({type:'octothorpe',ctx:getContext(lt)});}else if(lt.type==='end'&&!atRoot){return tokens;}else{var value=lt.value;if(!inPlural&&lt.type==='quoted'&&value[0]==='#'){if(value.includes('{')){var errMsg="Unsupported escape pattern: ".concat(value);throw new ParseError(lt,errMsg);}value=lt.text;}if(content){content.value+=value;content.ctx.text+=lt.text;content.ctx.lineBreaks+=lt.lineBreaks;}else{content={type:'content',value:value,ctx:getContext(lt)};tokens.push(content);}}}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}if(atRoot)return tokens;throw new ParseError(null,'Unexpected message end');}}]);}();function parse(src){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var parser=new Parser(src,options);return parser.parse();}var DateFormatError=/*#__PURE__*/function(_Error7){function DateFormatError(msg,token,type){var _this29;_classCallCheck2(this,DateFormatError);_this29=_callSuper2(this,DateFormatError,[msg]);_this29.token=token;_this29.type=type||'error';return _this29;}_inherits2(DateFormatError,_Error7);return _createClass2(DateFormatError);}(/*#__PURE__*/_wrapNativeSuper2(Error));var alpha=function alpha(width){return width<4?'short':width===4?'long':'narrow';};var numeric=function numeric(width){return width%2===0?'2-digit':'numeric';};function yearOptions(token,onError){switch(token["char"]){case'y':return{year:numeric(token.width)};case'r':return{calendar:'gregory',year:'numeric'};case'u':case'U':case'Y':default:onError("".concat(token.desc," is not supported; falling back to year:numeric"),DateFormatError.WARNING);return{year:'numeric'};}}function monthStyle(token,onError){switch(token.width){case 1:return'numeric';case 2:return'2-digit';case 3:return'short';case 4:return'long';case 5:return'narrow';default:onError("".concat(token.desc," is not supported with width ").concat(token.width));return undefined;}}function dayStyle(token,onError){var _char=token["char"],desc=token.desc,width=token.width;if(_char==='d'){return numeric(width);}else{onError("".concat(desc," is not supported"));return undefined;}}function weekdayStyle(token,onError){var _char2=token["char"],desc=token.desc,width=token.width;if((_char2==='c'||_char2==='e')&&width<3){var msg="Numeric value is not supported for ".concat(desc,"; falling back to weekday:short");onError(msg,DateFormatError.WARNING);}return alpha(width);}function hourOptions(token){var hour=numeric(token.width);var hourCycle;switch(token["char"]){case'h':hourCycle='h12';break;case'H':hourCycle='h23';break;case'k':hourCycle='h24';break;case'K':hourCycle='h11';break;}return hourCycle?{hour:hour,hourCycle:hourCycle}:{hour:hour};}function timeZoneNameStyle(token,onError){var _char3=token["char"],desc=token.desc,width=token.width;switch(_char3){case'v':case'z':return width===4?'long':'short';case'V':if(width===4)return'long';onError("".concat(desc," is not supported with width ").concat(width));return undefined;case'X':onError("".concat(desc," is not supported"));return undefined;}return'short';}function compileOptions(token,onError){switch(token.field){case'era':return{era:alpha(token.width)};case'year':return yearOptions(token,onError);case'month':return{month:monthStyle(token,onError)};case'day':return{day:dayStyle(token,onError)};case'weekday':return{weekday:weekdayStyle(token,onError)};case'period':return undefined;case'hour':return hourOptions(token);case'min':return{minute:numeric(token.width)};case'sec':return{second:numeric(token.width)};case'tz':return{timeZoneName:timeZoneNameStyle(token,onError)};case'quarter':case'week':case'sec-frac':case'ms':onError("".concat(token.desc," is not supported"));}return undefined;}function getDateFormatOptions(tokens,timeZone){var onError=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(error){throw error;};var options={timeZone:timeZone};var fields=[];var _iterator6=_createForOfIteratorHelper2(tokens),_step6;try{var _loop=function _loop(){var token=_step6.value;var error=token.error,field=token.field,str=token.str;if(error){var dte=new DateFormatError(error.message,token);dte.stack=error.stack;onError(dte);}if(str){var msg="Ignoring string part: ".concat(str);onError(new DateFormatError(msg,token,DateFormatError.WARNING));}if(field){if(fields.indexOf(field)===-1)fields.push(field);else onError(new DateFormatError("Duplicate ".concat(field," token"),token));}var opt=compileOptions(token,function(msg,isWarning){return onError(new DateFormatError(msg,token,isWarning));});if(opt)Object.assign(options,opt);};for(_iterator6.s();!(_step6=_iterator6.n()).done;){_loop();}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}return options;}var fields={G:{field:'era',desc:'Era'},y:{field:'year',desc:'Year'},Y:{field:'year',desc:'Year of "Week of Year"'},u:{field:'year',desc:'Extended year'},U:{field:'year',desc:'Cyclic year name'},r:{field:'year',desc:'Related Gregorian year'},Q:{field:'quarter',desc:'Quarter'},q:{field:'quarter',desc:'Stand-alone quarter'},M:{field:'month',desc:'Month in year'},L:{field:'month',desc:'Stand-alone month in year'},w:{field:'week',desc:'Week of year'},W:{field:'week',desc:'Week of month'},d:{field:'day',desc:'Day in month'},D:{field:'day',desc:'Day of year'},F:{field:'day',desc:'Day of week in month'},g:{field:'day',desc:'Modified julian day'},E:{field:'weekday',desc:'Day of week'},e:{field:'weekday',desc:'Local day of week'},c:{field:'weekday',desc:'Stand-alone local day of week'},a:{field:'period',desc:'AM/PM marker'},b:{field:'period',desc:'AM/PM/noon/midnight marker'},B:{field:'period',desc:'Flexible day period'},h:{field:'hour',desc:'Hour in AM/PM (1~12)'},H:{field:'hour',desc:'Hour in day (0~23)'},k:{field:'hour',desc:'Hour in day (1~24)'},K:{field:'hour',desc:'Hour in AM/PM (0~11)'},j:{field:'hour',desc:'Hour in preferred cycle'},J:{field:'hour',desc:'Hour in preferred cycle without marker'},C:{field:'hour',desc:'Hour in preferred cycle with flexible marker'},m:{field:'min',desc:'Minute in hour'},s:{field:'sec',desc:'Second in minute'},S:{field:'sec-frac',desc:'Fractional second'},A:{field:'ms',desc:'Milliseconds in day'},z:{field:'tz',desc:'Time Zone: specific non-location'},Z:{field:'tz',desc:'Time Zone'},O:{field:'tz',desc:'Time Zone: localized'},v:{field:'tz',desc:'Time Zone: generic non-location'},V:{field:'tz',desc:'Time Zone: ID'},X:{field:'tz',desc:'Time Zone: ISO8601 with Z'},x:{field:'tz',desc:'Time Zone: ISO8601'}};var isLetter=function isLetter(_char4){return _char4>='A'&&_char4<='Z'||_char4>='a'&&_char4<='z';};function readFieldToken(src,pos){var _char5=src[pos];var width=1;while(src[++pos]===_char5)++width;var field=fields[_char5];if(!field){var msg="The letter ".concat(_char5," is not a valid field identifier");return{"char":_char5,error:new Error(msg),width:width};}return{"char":_char5,field:field.field,desc:field.desc,width:width};}function readQuotedToken(src,pos){var str=src[++pos];var width=2;if(str==="'")return{"char":"'",str:str,width:width};while(true){var next=src[++pos];++width;if(next===undefined){var msg="Unterminated quoted literal in pattern: ".concat(str||src);return{"char":"'",error:new Error(msg),str:str,width:width};}else if(next==="'"){if(src[++pos]!=="'")return{"char":"'",str:str,width:width};else++width;}str+=next;}}function readToken(src,pos){var _char6=src[pos];if(!_char6)return null;if(isLetter(_char6))return readFieldToken(src,pos);if(_char6==="'")return readQuotedToken(src,pos);var str=_char6;var width=1;while(true){var next=src[++pos];if(!next||isLetter(next)||next==="'")return{"char":_char6,str:str,width:width};str+=next;width+=1;}}function parseDateTokens(src){var tokens=[];var pos=0;while(true){var token=readToken(src,pos);if(!token)return tokens;tokens.push(token);pos+=token.width;}}function processTokens(tokens,mapText){if(!tokens.filter(function(token){return token.type!=="content";}).length){return tokens.map(function(token){return mapText(token.value);});}return tokens.map(function(token){if(token.type==="content"){return mapText(token.value);}else if(token.type==="octothorpe"){return"#";}else if(token.type==="argument"){return[token.arg];}else if(token.type==="function"){var _token$param;var _param=token===null||token===void 0||(_token$param=token.param)===null||_token$param===void 0?void 0:_token$param[0];if(token.key==="date"&&_param){var opts=compileDateExpression(_param.value.trim(),function(e){throw new Error("Unable to compile date expression: ".concat(e.message));});return[token.arg,token.key,opts];}if(_param){return[token.arg,token.key,_param.value.trim()];}else{return[token.arg,token.key];}}var offset=token.pluralOffset;var formatProps={};token.cases.forEach(function(_ref21){var key=_ref21.key,tokens2=_ref21.tokens;var prop=key[0]==="="?key.slice(1):key;formatProps[prop]=processTokens(tokens2,mapText);});return[token.arg,token.type,_objectSpread({offset:offset},formatProps)];});}function compileDateExpression(format,onError){if(/^::/.test(format)){var tokens=parseDateTokens(format.substring(2));return getDateFormatOptions(tokens,void 0,onError);}return format;}function compileMessageOrThrow(message){var mapText=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(v){return v;};return processTokens(parse_1(message),mapText);}function compileMessage(message){var mapText=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(v){return v;};try{return compileMessageOrThrow(message,mapText);}catch(e){console.error("".concat(e.message," \n\nMessage: ").concat(message));return[message];}}var isString=function isString(s){return typeof s==="string";};var isFunction$1=function isFunction$1(f){return typeof f==="function";};var cache$1=/* @__PURE__ */new Map();var defaultLocale="en";function normalizeLocales(locales){var out=Array.isArray(locales)?locales:[locales];return[].concat(_toConsumableArray2(out),[defaultLocale]);}function _date(locales,value,format){var _locales=normalizeLocales(locales);if(!format){format="default";}var o;if(typeof format==="string"){o={day:"numeric",month:"short",year:"numeric"};switch(format){case"full":o.weekday="long";case"long":o.month="long";break;case"short":o.month="numeric";break;}}else{o=format;}var formatter=getMemoized(function(){return cacheKey("date",_locales,format);},function(){return new Intl.DateTimeFormat(_locales,o);});return formatter.format(isString(value)?new Date(value):value);}function _time(locales,value,format){var o;if(!format){format="default";}if(typeof format==="string"){o={second:"numeric",minute:"numeric",hour:"numeric"};switch(format){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second;}}else{o=format;}return _date(locales,value,o);}function _number(locales,value,format){var _locales=normalizeLocales(locales);var formatter=getMemoized(function(){return cacheKey("number",_locales,format);},function(){return new Intl.NumberFormat(_locales,format);});return formatter.format(value);}function _plural(locales,ordinal,value,_ref22){var _ref23,_rules$value;var _ref22$offset=_ref22.offset,offset=_ref22$offset===void 0?0:_ref22$offset,rules=_objectWithoutProperties(_ref22,_excluded);var _locales=normalizeLocales(locales);var plurals=ordinal?getMemoized(function(){return cacheKey("plural-ordinal",_locales);},function(){return new Intl.PluralRules(_locales,{type:"ordinal"});}):getMemoized(function(){return cacheKey("plural-cardinal",_locales);},function(){return new Intl.PluralRules(_locales,{type:"cardinal"});});return(_ref23=(_rules$value=rules[value])!==null&&_rules$value!==void 0?_rules$value:rules[plurals.select(value-offset)])!==null&&_ref23!==void 0?_ref23:rules.other;}function getMemoized(getKey,construct){var key=getKey();var formatter=cache$1.get(key);if(!formatter){formatter=construct();cache$1.set(key,formatter);}return formatter;}function cacheKey(type,locales,options){var localeKey=locales.join("-");return"".concat(type,"-").concat(localeKey,"-").concat(JSON.stringify(options));}var ESCAPE_SEQUENCE_REGEX=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;var decodeEscapeSequences=function decodeEscapeSequences(str){return str.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,function(_,unicode,hex){if(unicode){var codePoint=parseInt(unicode,16);return String.fromCharCode(codePoint);}else{var _codePoint=parseInt(hex,16);return String.fromCharCode(_codePoint);}});};var OCTOTHORPE_PH="%__lingui_octothorpe__%";var getDefaultFormats=function getDefaultFormats(locale,passedLocales){var formats=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var locales=passedLocales||locale;var style=function style(format){if(_typeof2(format)==="object")return format;return formats[format];};var replaceOctothorpe=function replaceOctothorpe(value,message){var numberFormat=Object.keys(formats).length?style("number"):void 0;var valueStr=_number(locales,value,numberFormat);return message.replace(new RegExp(OCTOTHORPE_PH,"g"),valueStr);};return{plural:function plural(value,cases){var _cases$offset=cases.offset,offset=_cases$offset===void 0?0:_cases$offset;var message=_plural(locales,false,value,cases);return replaceOctothorpe(value-offset,message);},selectordinal:function selectordinal(value,cases){var _cases$offset2=cases.offset,offset=_cases$offset2===void 0?0:_cases$offset2;var message=_plural(locales,true,value,cases);return replaceOctothorpe(value-offset,message);},select:selectFormatter,number:function number(value,format){return _number(locales,value,style(format)||{style:format});},date:function date(value,format){return _date(locales,value,style(format)||format);},time:function time(value,format){return _time(locales,value,style(format)||format);}};};var selectFormatter=function selectFormatter(value,rules){var _rules$value2;return(_rules$value2=rules[value])!==null&&_rules$value2!==void 0?_rules$value2:rules.other;};function interpolate(translation,locale,locales){return function(){var values=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var formats=arguments.length>1?arguments[1]:undefined;var formatters=getDefaultFormats(locale,locales,formats);var _formatMessage=function formatMessage(tokens){var replaceOctothorpe=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!Array.isArray(tokens))return tokens;return tokens.reduce(function(message,token){if(token==="#"&&replaceOctothorpe){return message+OCTOTHORPE_PH;}if(isString(token)){return message+token;}var _token=_slicedToArray2(token,3),name=_token[0],type=_token[1],format=_token[2];var interpolatedFormat={};if(type==="plural"||type==="selectordinal"||type==="select"){Object.entries(format).forEach(function(_ref24){var _ref25=_slicedToArray2(_ref24,2),key=_ref25[0],value2=_ref25[1];interpolatedFormat[key]=_formatMessage(value2,type==="plural"||type==="selectordinal");});}else{interpolatedFormat=format;}var value;if(type){var formatter=formatters[type];value=formatter(values[name],interpolatedFormat);}else{value=values[name];}if(value==null){return message;}return message+value;},"");};var result=_formatMessage(translation);if(isString(result)&&ESCAPE_SEQUENCE_REGEX.test(result)){return decodeEscapeSequences(result);}if(isString(result))return result;return result?String(result):"";};}var __defProp$1=Object.defineProperty;var __defNormalProp$1=function __defNormalProp$1(obj,key,value){return key in obj?__defProp$1(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value;};var __publicField$1=function __publicField$1(obj,key,value){__defNormalProp$1(obj,key+"",value);return value;};var EventEmitter=/*#__PURE__*/function(){function EventEmitter(){_classCallCheck2(this,EventEmitter);__publicField$1(this,"_events",{});}return _createClass2(EventEmitter,[{key:"on",value:function on(event,listener){var _a$event,_this30=this;var _a;(_a$event=(_a=this._events)[event])!==null&&_a$event!==void 0?_a$event:_a[event]=[];this._events[event].push(listener);return function(){return _this30.removeListener(event,listener);};}},{key:"removeListener",value:function removeListener(event,listener){var maybeListeners=this._getListeners(event);if(!maybeListeners)return;var index=maybeListeners.indexOf(listener);if(~index)maybeListeners.splice(index,1);}},{key:"emit",value:function emit(event){var _this31=this;for(var _len6=arguments.length,args=new Array(_len6>1?_len6-1:0),_key6=1;_key6<_len6;_key6++){args[_key6-1]=arguments[_key6];}var maybeListeners=this._getListeners(event);if(!maybeListeners)return;maybeListeners.map(function(listener){return listener.apply(_this31,args);});}},{key:"_getListeners",value:function _getListeners(event){var maybeListeners=this._events[event];return Array.isArray(maybeListeners)?maybeListeners:false;}}]);}();var __defProp=Object.defineProperty;var __defNormalProp=function __defNormalProp(obj,key,value){return key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value;};var __publicField=function __publicField(obj,key,value){__defNormalProp(obj,_typeof2(key)!=="symbol"?key+"":key,value);return value;};var I18n=/*#__PURE__*/function(_EventEmitter){function I18n(params){var _this32;_classCallCheck2(this,I18n);_this32=_callSuper2(this,I18n);__publicField(_this32,"_locale","");__publicField(_this32,"_locales");__publicField(_this32,"_localeData",{});__publicField(_this32,"_messages",{});__publicField(_this32,"_missing");__publicField(_this32,"_messageCompiler");__publicField(_this32,"t",_this32._.bind(_this32));if(params.missing!=null)_this32._missing=params.missing;if(params.messages!=null)_this32.load(params.messages);if(params.localeData!=null)_this32.loadLocaleData(params.localeData);if(typeof params.locale==="string"||params.locales){var _params$locale;_this32.activate((_params$locale=params.locale)!==null&&_params$locale!==void 0?_params$locale:defaultLocale,params.locales);}return _this32;}_inherits2(I18n,_EventEmitter);return _createClass2(I18n,[{key:"locale",get:function get(){return this._locale;}},{key:"locales",get:function get(){return this._locales;}},{key:"messages",get:function get(){var _this$_messages$this$;return(_this$_messages$this$=this._messages[this._locale])!==null&&_this$_messages$this$!==void 0?_this$_messages$this$:{};}},{key:"localeData",get:function get(){var _this$_localeData$thi;return(_this$_localeData$thi=this._localeData[this._locale])!==null&&_this$_localeData$thi!==void 0?_this$_localeData$thi:{};}},{key:"_loadLocaleData",value:function _loadLocaleData(locale,localeData){var maybeLocaleData=this._localeData[locale];if(!maybeLocaleData){this._localeData[locale]=localeData;}else{Object.assign(maybeLocaleData,localeData);}}},{key:"setMessagesCompiler",value:function setMessagesCompiler(compiler){this._messageCompiler=compiler;return this;}},{key:"loadLocaleData",value:function loadLocaleData(localeOrAllData,localeData){var _this33=this;if(typeof localeOrAllData==="string"){this._loadLocaleData(localeOrAllData,localeData);}else{Object.keys(localeOrAllData).forEach(function(locale){return _this33._loadLocaleData(locale,localeOrAllData[locale]);});}this.emit("change");}},{key:"_load",value:function _load(locale,messages){var maybeMessages=this._messages[locale];if(!maybeMessages){this._messages[locale]=messages;}else{Object.assign(maybeMessages,messages);}}},{key:"load",value:function load(localeOrMessages,messages){var _this34=this;if(typeof localeOrMessages=="string"&&_typeof2(messages)==="object"){this._load(localeOrMessages,messages);}else{Object.entries(localeOrMessages).forEach(function(_ref26){var _ref27=_slicedToArray2(_ref26,2),locale=_ref27[0],messages2=_ref27[1];return _this34._load(locale,messages2);});}this.emit("change");}},{key:"loadAndActivate",value:function loadAndActivate(_ref28){var locale=_ref28.locale,locales=_ref28.locales,messages=_ref28.messages;this._locale=locale;this._locales=locales||void 0;this._messages[this._locale]=messages;this.emit("change");}},{key:"activate",value:function activate(locale,locales){this._locale=locale;this._locales=locales;this.emit("change");}},{key:"_",value:function _(id,values,options){if(!this.locale){throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");}var message=options===null||options===void 0?void 0:options.message;if(!id){id="";}if(!isString(id)){values=id.values||values;message=id.message;id=id.id;}var messageForId=this.messages[id];var messageMissing=messageForId===void 0;var missing=this._missing;if(missing&&messageMissing){return isFunction$1(missing)?missing(this._locale,id):missing;}if(messageMissing){this.emit("missing",{id:id,locale:this._locale});}var translation=messageForId||message||id;if(isString(translation)){if(this._messageCompiler){translation=this._messageCompiler(translation);}else{console.warn("Uncompiled message detected! Message:\n\n> ".concat(translation,"\n\nThat means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.\nICU features such as interpolation and plurals will not work properly for that message. \n\nPlease compile your catalog first. \n"));}}if(isString(translation)&&ESCAPE_SEQUENCE_REGEX.test(translation))return decodeEscapeSequences(translation);if(isString(translation))return translation;return interpolate(translation,this._locale,this._locales)(values,options===null||options===void 0?void 0:options.formats);}},{key:"date",value:function date(value,format){return _date(this._locales||this._locale,value,format);}},{key:"number",value:function number(value,format){return _number(this._locales||this._locale,value,format);}}]);}(EventEmitter);function setupI18n(){var params=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new I18n(params);}setupI18n();var tagRe=/<([a-zA-Z0-9]+)>([\s\S]*?)<\/\1>|<([a-zA-Z0-9]+)\/>/;var voidElementTags={area:true,base:true,br:true,col:true,embed:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true};function formatElements(value){var elements=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var uniqueId=makeCounter(0,"$lingui$");var parts=value.split(tagRe);if(parts.length===1)return value;var tree=[];var before=parts.shift();if(before)tree.push(before);var _iterator7=_createForOfIteratorHelper2(getElements(parts)),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value=_slicedToArray2(_step7.value,3),index=_step7$value[0],children=_step7$value[1],after=_step7$value[2];var element=typeof index!=="undefined"?elements[index]:void 0;if(!element||voidElementTags[element.type]&&children){if(!element){console.error("Can't use element at index '".concat(index,"' as it is not declared in the original translation"));}else{console.error("".concat(element.type," is a void element tag therefore it must have no children"));}element=wn.createElement(wn.Fragment);}if(Array.isArray(element)){element=wn.createElement(wn.Fragment,{},element);}tree.push(wn.cloneElement(element,{key:uniqueId()},children?formatElements(children,elements):element.props.children));if(after)tree.push(after);}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}return tree.length===1?tree[0]:tree;}function getElements(parts){if(!parts.length)return[];var _parts$slice=parts.slice(0,4),_parts$slice2=_slicedToArray2(_parts$slice,4),paired=_parts$slice2[0],children=_parts$slice2[1],unpaired=_parts$slice2[2],after=_parts$slice2[3];var triple=[paired||unpaired,children||"",after];return[triple].concat(getElements(parts.slice(4,parts.length)));}var makeCounter=function makeCounter(){var count=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var prefix=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return function(){return"".concat(prefix,"_").concat(count++);};};function TransNoContext(props){var render=props.render,component=props.component,id=props.id,message=props.message,formats=props.formats,_props$lingui=props.lingui,i18n=_props$lingui.i18n,defaultComponent=_props$lingui.defaultComponent;var values=_objectSpread({},props.values);var components=_objectSpread({},props.components);if(values){Object.keys(values).forEach(function(key){var index=Object.keys(components).length;if(typeof values[key]==="string"||typeof values[key]==="number"){return;}components[index]=/* @__PURE__ */wn.createElement(wn.Fragment,null,values[key]);values[key]="<".concat(index,"/>");});}var _translation=i18n&&typeof i18n._==="function"?i18n._(id,values,{message:message,formats:formats}):id;var translation=_translation?formatElements(_translation,components):null;if(render===null||component===null){return translation;}var FallbackComponent=defaultComponent||RenderFragment;var i18nProps={id:id,message:message,translation:translation,children:translation};if(render&&component){console.error("You can't use both `component` and `render` prop at the same time. `component` is ignored.");}else if(render&&typeof render!=="function"){console.error("Invalid value supplied to prop `render`. It must be a function, provided ".concat(render));}else if(component&&typeof component!=="function"){console.error("Invalid value supplied to prop `component`. It must be a React component, provided ".concat(component));return wn.createElement(FallbackComponent,i18nProps,translation);}if(typeof render==="function"){return render(i18nProps);}var Component=component||FallbackComponent;return wn.createElement(Component,i18nProps,translation);}var RenderFragment=function RenderFragment(_ref29){var children=_ref29.children;return/* @__PURE__ */wn.createElement(wn.Fragment,null,children);};var LinguiContext=wn.createContext(null);var useLinguiInternal=function useLinguiInternal(devErrorMessage){var context=wn.useContext(LinguiContext);return context;};function useLingui(){return useLinguiInternal();}function I18nProvider(_ref30){var i18n=_ref30.i18n,defaultComponent=_ref30.defaultComponent,children=_ref30.children;var latestKnownLocale=wn.useRef(i18n.locale);var makeContext=wn.useCallback(function(){return{i18n:i18n,defaultComponent:defaultComponent,_:i18n.t.bind(i18n)};},[i18n,defaultComponent]);var _wn$useState=wn.useState(makeContext()),_wn$useState2=_slicedToArray2(_wn$useState,2),context=_wn$useState2[0],setContext=_wn$useState2[1];wn.useEffect(function(){var updateContext=function updateContext(){latestKnownLocale.current=i18n.locale;setContext(makeContext());};var unsubscribe=i18n.on("change",updateContext);if(latestKnownLocale.current!==i18n.locale){updateContext();}return unsubscribe;},[i18n,makeContext]);if(!latestKnownLocale.current){return null;}return/* @__PURE__ */wn.createElement(LinguiContext.Provider,{value:context},children);}function Trans(props){var lingui=useLinguiInternal();return wn.createElement(TransNoContext,_objectSpread(_objectSpread({},props),{},{lingui:lingui}));}var I18nProviderWrapper=function I18nProviderWrapper(_ref31){var children=_ref31.children,messages=_ref31.messages,overrides=_ref31.overrides;var mergedMessages=F$4(function(){return Object.assign(Object.assign({},messages),overrides);},[messages,overrides]);var _h$=h$5(function(){var instance=setupI18n({locale:'en',messages:{en:mergedMessages}});instance.setMessagesCompiler(compileMessage);return instance;}),_h$2=_slicedToArray2(_h$,1),i18n=_h$2[0];p$5(function(){i18n.load({en:mergedMessages});},[i18n,mergedMessages]);return/*#__PURE__*/wn.createElement(I18nProvider,{i18n:i18n},children);};var SHADOW_DOM_ONE_TAP_MOUNT_POINT="<div data-prompt_parent_id='g_id_onload' id='google-parent-prompt' style=''></div>";function CreateWebComponent(ReactComponent,webComponentName){var existingRegistry=customElements.get(webComponentName);if(existingRegistry){return existingRegistry;}var ReactWebComponent=/*#__PURE__*/function(_HTMLElement){function ReactWebComponent(props){var _this35;_classCallCheck2(this,ReactWebComponent);_this35=_callSuper2(this,ReactWebComponent);_this35.props=props;_this35.rootRef=document.createElement('div');_this35.append(_this35.rootRef);return _this35;}_inherits2(ReactWebComponent,_HTMLElement);return _createClass2(ReactWebComponent,[{key:"connectedCallback",value:function connectedCallback(){this.styleSlot=document.createElement('section');this.rootRef.appendChild(this.styleSlot);this.mountPoint=document.createElement('span');this.styleSlot.appendChild(this.mountPoint);this.render(this.props);}},{key:"disconnectedCallback",value:function disconnectedCallback(){if(!this.mountPoint){return;}wn.unmountComponentAtNode(this.mountPoint);}},{key:"render",value:function render(props){if(!this.mountPoint){throw Error('Cannot render - no mount point defined');}if(!this.styleSlot){throw Error('Cannot render - no style slot defined');}wn.render(/*#__PURE__*/wn.createElement(ye$1,{target:this.styleSlot},/*#__PURE__*/wn.createElement(ReactComponent,Object.assign({},props))),this.mountPoint);}}]);}(/*#__PURE__*/_wrapNativeSuper2(HTMLElement));customElements.define(webComponentName,ReactWebComponent);return ReactWebComponent;}function CreateShadowWebComponent(ReactComponent,webComponentName){var existingRegistry=customElements.get(webComponentName);if(existingRegistry){return existingRegistry;}var ReactWebComponent=/*#__PURE__*/function(_HTMLElement2){function ReactWebComponent(props){var _this36;_classCallCheck2(this,ReactWebComponent);_this36=_callSuper2(this,ReactWebComponent);_this36.props=props;_this36.rootRef=_this36.attachShadow({mode:'open'});return _this36;}_inherits2(ReactWebComponent,_HTMLElement2);return _createClass2(ReactWebComponent,[{key:"connectedCallback",value:function connectedCallback(){this.styleSlot=document.createElement('section');this.rootRef.appendChild(this.styleSlot);this.mountPoint=document.createElement('span');this.styleSlot.appendChild(this.mountPoint);this.render(this.props);}},{key:"disconnectedCallback",value:function disconnectedCallback(){if(!this.mountPoint){return;}wn.unmountComponentAtNode(this.mountPoint);}},{key:"renderOneTap",value:function renderOneTap(props){var _a,_b,_c;var shouldContainOneTap=(_c=(_b=(_a=props===null||props===void 0?void 0:props.config)===null||_a===void 0?void 0:_a.oauthOptions)===null||_b===void 0?void 0:_b.providers)===null||_c===void 0?void 0:_c.find(function(config){return config.type===OAuthProviders.Google&&config.one_tap;});var containsOneTap=this.innerHTML.includes(SHADOW_DOM_ONE_TAP_MOUNT_POINT);if(shouldContainOneTap){if(!containsOneTap){this.innerHTML=SHADOW_DOM_ONE_TAP_MOUNT_POINT;}}else{this.innerHTML='';}}},{key:"render",value:function render(props){if(!this.mountPoint){throw Error('Cannot render - no mount point defined');}if(!this.styleSlot){throw Error('Cannot render - no style slot defined');}this.renderOneTap(props);wn.render(/*#__PURE__*/wn.createElement(ye$1,{target:this.styleSlot},/*#__PURE__*/wn.createElement(ReactComponent,Object.assign({},props))),this.mountPoint);}}]);}(/*#__PURE__*/_wrapNativeSuper2(HTMLElement));customElements.define(webComponentName,ReactWebComponent);return ReactWebComponent;}function CreateSSRSafeWebComponent(ReactComponent,webComponentName){if(typeof window==='undefined'){return function(){return null;};}return function(props){var _a;var shadowDomEnabled=!!((_a=props.config)===null||_a===void 0?void 0:_a.enableShadowDOM);if(shadowDomEnabled){var Component=CreateShadowWebComponent(ReactComponent,webComponentName);return new Component(props);}else{var _Component=CreateWebComponent(ReactComponent,webComponentName);return new _Component(props);}};}var useIsomorphicLayoutEffect=typeof window!=='undefined'?y$2:p$5;var useEvent=function useEvent(fn){var handlerRef=_$2(fn);useIsomorphicLayoutEffect(function(){handlerRef.current=fn;},[fn]);return T$3(function(){var fn=handlerRef.current;return fn.apply(void 0,arguments);},[]);};var reducer=function reducer(state,action){switch(action.type){case'transition':return Object.assign(Object.assign({},state),{screen:action.screen});case'set_magic_link_email':{return Object.assign(Object.assign({},state),{formState:Object.assign(Object.assign({},state.formState),{magicLinkState:{email:action.email}})});}case'update_otp_state':{return Object.assign(Object.assign({},state),{formState:Object.assign(Object.assign({},state.formState),{otpState:action.otpState})});}case'update_crypto_state':{return Object.assign(Object.assign({},state),{formState:Object.assign(Object.assign({},state.formState),{cryptoState:action.cryptoState})});}case'update_password_state':{return Object.assign(Object.assign({},state),{formState:Object.assign(Object.assign({},state.formState),{passwordState:action.passwordState})});}default:throw new Error();}};var AppScreens$1;(function(AppScreens){AppScreens["Main"]="Main";AppScreens["PasskeyRegistrationStart"]="Register New Passkey";AppScreens["PasskeyRegistrationSuccess"]="Passkey Registration Success";AppScreens["PasskeyConfirmation"]="Passkey Confirmation";AppScreens["PasswordCreateOrLogin"]="Password";AppScreens["PasswordResetForm"]="Password Reset Form";AppScreens["PasswordForgot"]="Password Forgot";AppScreens["PasswordBreached"]="Password Breached";AppScreens["PasswordSetNew"]="Password Set New";AppScreens["PasswordDedupe"]="Password Dedupe";AppScreens["PasswordConfirmation"]="Password Confirmation";AppScreens["EmailConfirmation"]="Email Confirmation";AppScreens["OTPAuthenticate"]="OTP Authenticate";AppScreens["OTPConfirmation"]="OTP Confirmation";AppScreens["CryptoConnect"]="Crypto Connect";AppScreens["CryptoSignMessage"]="Crypto Sign Message";AppScreens["CryptoOtherScreen"]="Crypto Other Screen";AppScreens["CryptoSetupWallet"]="Crypto Setup Wallet";AppScreens["CryptoError"]="Crypto Error";AppScreens["CryptoConfirmation"]="Crypto Confirmation";AppScreens["IDPConsent"]="IDP Consent";})(AppScreens$1||(AppScreens$1={}));var DEFAULT_STATE={screen:AppScreens$1.Main,formState:{magicLinkState:{email:''},otpState:{type:OTPMethods.Email,methodId:'',otpDestination:''},cryptoState:{walletAddress:'',walletOption:Wallets.Metamask,walletChallenge:''},passwordState:{email:'',type:'new'},resetPasswordState:{token:''},errorDescriptor:undefined}};var DEFAULT_CONFIG={products:[Products.emailMagicLinks],emailMagicLinksOptions:{loginRedirectURL:'',loginExpirationMinutes:30,signupRedirectURL:'',signupExpirationMinutes:30,createUserAsPending:false}};var DEFAULT_STYLE_CONFIG={container:{backgroundColor:'#FFFFFF',borderColor:'#ADBCC5',borderRadius:'8px',width:'400px'},colors:{primary:'#19303D',secondary:'#5C727D',success:'#0C5A56',warning:'#FFD94A',error:'#8B1214',accent:'#ECFAFF'},buttons:{primary:{backgroundColor:'#19303D',textColor:'#FFFFFF',borderColor:'#19303D',borderRadius:'4px'},secondary:{backgroundColor:'#FFFFFF',textColor:'#19303D',borderColor:'#19303D',borderRadius:'4px'},disabled:{backgroundColor:'#F3F5F6',textColor:'#8296A1',borderColor:'#F3F5F6',borderRadius:'4px'}},fontFamily:'Arial, Helvetica, sans-serif',hideHeaderText:false,logo:{logoImageUrl:''}};var GlobalContext=/*#__PURE__*/wn.createContext({client:{},config:DEFAULT_CONFIG,state:[DEFAULT_STATE,function(){return null;}]});var GlobalContextProvider=function GlobalContextProvider(_ref32){var children=_ref32.children,client=_ref32.client,config=_ref32.config,callbacks=_ref32.callbacks,initialState=_ref32.initialState;var state=wn.useReducer(reducer,initialState!==null&&initialState!==void 0?initialState:DEFAULT_STATE);return/*#__PURE__*/wn.createElement(GlobalContext.Provider,{value:{client:client,state:state,config:config,callbacks:callbacks}},children);};var noop$1=function noop$1(){};var useGlobalContext=function useGlobalContext(){return q$4(GlobalContext);};var useStytch=function useStytch(){return useGlobalContext().client;};var useGlobalReducer=function useGlobalReducer(){return useGlobalContext().state;};var useConfig=function useConfig(){return useGlobalContext().config;};var useErrorCallback=function useErrorCallback(){var _a,_b;return useEvent((_b=(_a=useGlobalContext().callbacks)===null||_a===void 0?void 0:_a.onError)!==null&&_b!==void 0?_b:noop$1);};var useEventCallback=function useEventCallback(){var _a,_b;return useEvent((_b=(_a=useGlobalContext().callbacks)===null||_a===void 0?void 0:_a.onEvent)!==null&&_b!==void 0?_b:noop$1);};var nanoid=function nanoid(){var size=arguments.length>0&&arguments[0]!==undefined?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(size)).reduce(function(id,_byte){_byte&=63;if(_byte<36){id+=_byte.toString(36);}else if(_byte<62){id+=(_byte-26).toString(36).toUpperCase();}else if(_byte>62){id+='-';}else{id+='_';}return id;},'');};var useUniqueId=function useUniqueId(){var prefix=arguments.length>0&&arguments[0]!==undefined?arguments[0]:'s';var id=_$2(nanoid());return prefix+id.current;};function useErrorProps(error){var errorId=useUniqueId();if(!error){return{error:{id:errorId},input:{}};}else{return{error:{id:errorId},input:{'aria-errormessage':errorId,'aria-invalid':true}};}}var focusedRing=Ce(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n outline: 2px auto -webkit-focus-ring-color;\n outline: 2px auto Highlight;\n outline-offset: 2px;\n"])));var BaseButton=He.button(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n all: unset;\n\n cursor: pointer;\n font-family: ",";\n\n &:focus-visible {\n ","\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n"])),function(props){return props.theme.typography.fontFamily;},focusedRing);var Button=He(BaseButton)(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n width: 100%;\n height: 45px;\n font-size: 18px;\n text-transform: none;\n box-shadow: none;\n text-align: center;\n\n ","\n\n &:disabled {\n background-color: ",";\n color: ",";\n border: ",";\n border-radius: ",";\n }\n"])),function(props){switch(props.variant){case'primary':return"\n border: ".concat(props.theme.buttons.primary.border,";\n border-radius: ").concat(props.theme.buttons.primary.borderRadius,";\n color: ").concat(props.theme.buttons.primary.textColor,";\n background-color: ").concat(props.theme.buttons.primary.backgroundColor,";\n ");case'outlined':return"\n border: ".concat(props.theme.buttons.secondary.border,";\n border-radius: ").concat(props.theme.buttons.secondary.borderRadius,";\n color: ").concat(props.theme.buttons.secondary.textColor,";\n background-color: ").concat(props.theme.buttons.secondary.backgroundColor,";\n ");case'text':return"\n color: ".concat(props.theme.colors.primary,";\n background-color: transparent;\n font-weight: 600;\n ");}},function(props){return props.theme.buttons.disabled.backgroundColor;},function(props){return props.theme.buttons.disabled.textColor;},function(props){return props.theme.buttons.disabled.border;},function(props){return props.theme.buttons.disabled.borderRadius;});Button.defaultProps={variant:'primary'};var itemOrNone=function itemOrNone(item){return item!==null&&item!==void 0?item:undefined;};var spaceOrNone=function spaceOrNone(space){return space?"".concat(space,"px"):undefined;};var Flex=He.div(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n display: ",";\n\n flex-direction: ",";\n justify-content: ",";\n align-items: ",";\n flex-grow: ",";\n flex-shrink: ",";\n order: ",";\n align-self: ",";\n flex-flow: ",";\n flex-wrap: ",";\n\n width: ",";\n height: ",";\n max-width: ",";\n max-height: ",";\n min-width: ",";\n min-height: ",";\n padding: ",";\n margin: ",";\n margin-top: ",";\n margin-right: ",";\n margin-bottom: ",";\n margin-left: ",";\n padding-top: ",";\n padding-right: ",";\n padding-bottom: ",";\n padding-left: ",";\n\n gap: ",";\n"])),function(_ref33){var inline=_ref33.inline;return inline?'inline-flex':'flex';},function(_ref34){var direction=_ref34.direction;return itemOrNone(direction);},function(_ref35){var justifyContent=_ref35.justifyContent,center=_ref35.center;return center?'center':itemOrNone(justifyContent);},function(_ref36){var alignItems=_ref36.alignItems,center=_ref36.center;return center?'center':itemOrNone(alignItems);},function(_ref37){var grow=_ref37.grow;return itemOrNone(grow);},function(_ref38){var shrink=_ref38.shrink;return itemOrNone(shrink);},function(_ref39){var order=_ref39.order;return itemOrNone(order);},function(_ref40){var alignSelf=_ref40.alignSelf;return itemOrNone(alignSelf);},function(_ref41){var flow=_ref41.flow;return itemOrNone(flow);},function(_ref42){var wrap=_ref42.wrap;return itemOrNone(wrap);},function(_ref43){var width=_ref43.width;return typeof width==='string'?width:spaceOrNone(width);},function(_ref44){var height=_ref44.height;return typeof height==='string'?height:spaceOrNone(height);},function(_ref45){var maxWidth=_ref45.maxWidth;return typeof maxWidth==='string'?maxWidth:spaceOrNone(maxWidth);},function(_ref46){var maxHeight=_ref46.maxHeight;return typeof maxHeight==='string'?maxHeight:spaceOrNone(maxHeight);},function(_ref47){var minWidth=_ref47.minWidth;return typeof minWidth==='string'?minWidth:spaceOrNone(minWidth);},function(_ref48){var minHeight=_ref48.minHeight;return typeof minHeight==='string'?minHeight:spaceOrNone(minHeight);},function(_ref49){var padding=_ref49.padding;return spaceOrNone(padding);},function(_ref50){var margin=_ref50.margin;return spaceOrNone(margin);},function(_ref51){var marginTop=_ref51.marginTop;return spaceOrNone(marginTop);},function(_ref52){var marginRight=_ref52.marginRight;return spaceOrNone(marginRight);},function(_ref53){var marginBottom=_ref53.marginBottom;return spaceOrNone(marginBottom);},function(_ref54){var marginLeft=_ref54.marginLeft;return spaceOrNone(marginLeft);},function(_ref55){var paddingTop=_ref55.paddingTop;return spaceOrNone(paddingTop);},function(_ref56){var paddingRight=_ref56.paddingRight;return spaceOrNone(paddingRight);},function(_ref57){var paddingBottom=_ref57.paddingBottom;return spaceOrNone(paddingBottom);},function(_ref58){var paddingLeft=_ref58.paddingLeft;return spaceOrNone(paddingLeft);},function(_ref59){var gap=_ref59.gap;return spaceOrNone(gap);});var Text=He.div(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n color: ",";\n text-align: ",";\n ",";\n"])),function(props){return props.color&&props.theme.colors[props.color];},function(props){return props.align;},function(props){return props.size&&props.theme.typography[props.size];});Text.defaultProps={size:'body',color:'primary',align:'left'};var CreateIcon=function CreateIcon(IconSvgComponent){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{wrapped:true};var IconComponent=function IconComponent(){var component=/*#__PURE__*/wn.createElement(IconSvgComponent,null);return options.wrapped?(/*#__PURE__*/wn.createElement(Flex,{height:24,width:24},component)):component;};return IconComponent;};var GmailIconSvg=function GmailIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},/*#__PURE__*/wn.createElement("path",{fill:"#4caf50",d:"M45,16.2l-5,2.75l-5,4.75L35,40h7c1.657,0,3-1.343,3-3V16.2z"}),/*#__PURE__*/wn.createElement("path",{fill:"#1e88e5",d:"M3,16.2l3.614,1.71L13,23.7V40H6c-1.657,0-3-1.343-3-3V16.2z"}),/*#__PURE__*/wn.createElement("polygon",{fill:"#e53935",points:"35,11.2 24,19.45 13,11.2 12,17 13,23.7 24,31.95 35,23.7 36,17"}),/*#__PURE__*/wn.createElement("path",{fill:"#c62828",d:"M3,12.298V16.2l10,7.5V11.2L9.876,8.859C9.132,8.301,8.228,8,7.298,8h0C4.924,8,3,9.924,3,12.298z"}),/*#__PURE__*/wn.createElement("path",{fill:"#fbc02d",d:"M45,12.298V16.2l-10,7.5V11.2l3.124-2.341C38.868,8.301,39.772,8,40.702,8h0 C43.076,8,45,9.924,45,12.298z"}));};var GmailIcon=CreateIcon(GmailIconSvg);var OutlookIconSvg=function OutlookIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",viewBox:"0 0 103.17322 104.31332",xmlSpace:"preserve"},/*#__PURE__*/wn.createElement("defs",{id:"defs43"}),/*#__PURE__*/wn.createElement("path",{d:"m 64.566509,22.116383 v 20.404273 l 7.130526,4.489881 c 0.188058,0.05485 0.595516,0.05877 0.783574,0 L 103.16929,26.320259 c 0,-2.44867 -2.28412,-4.203876 -3.573094,-4.203876 H 64.566509 z",id:"path3",style:{fill:'#0072c6'}}),/*#__PURE__*/wn.createElement("path",{d:"m 64.566509,50.13308 6.507584,4.470291 c 0.916782,0.673874 2.021622,0 2.021622,0 -1.100922,0.673874 30.077495,-20.035993 30.077495,-20.035993 v 37.501863 c 0,4.082422 -2.61322,5.794531 -5.551621,5.794531 H 64.562591 V 50.13308 z",id:"path5",style:{fill:'#0072c6'}}),/*#__PURE__*/wn.createElement("g",{id:"g23",transform:"matrix(3.9178712,0,0,3.9178712,-13.481403,-41.384473)"},/*#__PURE__*/wn.createElement("path",{d:"m 11.321,20.958 c -0.566,0 -1.017,0.266 -1.35,0.797 -0.333,0.531 -0.5,1.234 -0.5,2.109 0,0.888 0.167,1.59 0.5,2.106 0.333,0.517 0.77,0.774 1.31,0.774 0.557,0 0.999,-0.251 1.325,-0.753 0.326,-0.502 0.49,-1.199 0.49,-2.09 0,-0.929 -0.158,-1.652 -0.475,-2.169 -0.317,-0.516 -0.75,-0.774 -1.3,-0.774 z",id:"path25",style:{fill:'#0072c6'}}),/*#__PURE__*/wn.createElement("path",{d:"m 3.441,13.563 v 20.375 l 15.5,3.25 V 10.563 l -15.5,3 z m 10.372,13.632 c -0.655,0.862 -1.509,1.294 -2.563,1.294 -1.027,0 -1.863,-0.418 -2.51,-1.253 C 8.094,26.4 7.77,25.312 7.77,23.97 c 0,-1.417 0.328,-2.563 0.985,-3.438 0.657,-0.875 1.527,-1.313 2.61,-1.313 1.023,0 1.851,0.418 2.482,1.256 0.632,0.838 0.948,1.942 0.948,3.313 10e-4,1.409 -0.327,2.545 -0.982,3.407 z",id:"path27",style:{fill:'#0072c6'}})));};var OutlookIcon=CreateIcon(OutlookIconSvg);var YahooIconSvg=function YahooIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("rect",{x:"2",y:"2",width:"20",height:"20",rx:"1",fill:"#671BDF"}),/*#__PURE__*/wn.createElement("path",{d:"M5 8.7284H7.71407L9.29444 12.7716L10.8953 8.7284H13.5379L9.55876 18.3H6.89942L7.98865 15.7637L5 8.7284Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M14.2 16.2028C15.108 16.2028 15.8441 15.4667 15.8441 14.5587C15.8441 13.6507 15.108 12.9146 14.2 12.9146C13.292 12.9146 12.5559 13.6507 12.5559 14.5587C12.5559 15.4667 13.292 16.2028 14.2 16.2028Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M16.3842 12.3106H13.4243L16.0512 6H19L16.3842 12.3106Z",fill:"white"}));};var YahooIcon$1=CreateIcon(YahooIconSvg);var emailProviderInfo={gmail:{messageDescriptor:{id:'link.openInGmail',message:"Open in Gmail"},icon:/*#__PURE__*/wn.createElement(GmailIcon,null),getUrl:function getUrl(emailDomain){var gmailQuery=encodeURIComponent(emailDomain?"from:@".concat(emailDomain," in:anywhere"):'in:anywhere');return"https://mail.google.com/mail/u/0/#search/".concat(gmailQuery);}},yahoo:{messageDescriptor:{id:'link.openInYahoo',message:"Open in Yahoo"},icon:/*#__PURE__*/wn.createElement(YahooIcon$1,null),getUrl:function getUrl(emailDomain){return!emailDomain?'https://mail.yahoo.com/d/search/referrer=unread':"https://mail.yahoo.com/d/search/keyword=".concat(emailDomain);}},outlook:{messageDescriptor:{id:'link.openInOutlook',message:"Open in Outlook"},icon:/*#__PURE__*/wn.createElement(OutlookIcon,null),getUrl:function getUrl(){return"https://outlook.office.com/mail/0/inbox";}}};var Link=He.a(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n all: unset;\n\n cursor: pointer;\n\n &:hover,\n &:focus-visible {\n text-decoration: underline;\n text-decoration-color: ",";\n }\n"])),function(props){return props.theme.colors.primary;});var EmailProviderLink=function EmailProviderLink(_ref60){var _ref60$providerInfo=_ref60.providerInfo,icon=_ref60$providerInfo.icon,messageDescriptor=_ref60$providerInfo.messageDescriptor,getUrl=_ref60$providerInfo.getUrl,emailDomain=_ref60.emailDomain;var _useLingui=useLingui(),_t=_useLingui._;var href=getUrl(emailDomain);return/*#__PURE__*/wn.createElement(Flex,{gap:4},icon,/*#__PURE__*/wn.createElement(Link,{href:href,target:"_blank",rel:"noopener noreferrer"},/*#__PURE__*/wn.createElement(Text,null,_t(messageDescriptor))));};var EmailConfirmation$1=function EmailConfirmation$1(_ref61){var emailDomain=_ref61.emailDomain,reset=_ref61.reset,email=_ref61.email;var _useLingui2=useLingui(),_t=_useLingui2._;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'emailConfirmation.title',message:"Check your email"})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:12},/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"emailConfirmation.content",message:"An email was sent to <bold>{email}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(EmailProviderLink,{emailDomain:emailDomain,providerInfo:emailProviderInfo.gmail}),/*#__PURE__*/wn.createElement(EmailProviderLink,{emailDomain:emailDomain,providerInfo:emailProviderInfo.yahoo}),/*#__PURE__*/wn.createElement(EmailProviderLink,{emailDomain:emailDomain,providerInfo:emailProviderInfo.outlook}))),/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:reset},_t({id:'button.retry',message:"Try again"})));};var useEmailDomain=function useEmailDomain(){var _a,_b;var stytch=useStytch();var config=useConfig();var _h$3=h$5(function(){var _readB2CInternals$boo=readB2CInternals(stytch).bootstrap.getSync(),emailDomains=_readB2CInternals$boo.emailDomains;return emailDomains;}),_h$4=_slicedToArray2(_h$3,2),emailDomains=_h$4[0],setEmailDomains=_h$4[1];p$5(function(){readB2CInternals(stytch).bootstrap.getAsync().then(function(_ref62){var emailDomains=_ref62.emailDomains;setEmailDomains(emailDomains);});},[stytch]);if((_a=config.emailMagicLinksOptions)===null||_a===void 0?void 0:_a.domainHint){return(_b=config.emailMagicLinksOptions)===null||_b===void 0?void 0:_b.domainHint;}if((emailDomains===null||emailDomains===void 0?void 0:emailDomains.length)===1){return emailDomains[0];}return null;};var EmailConfirmation=function EmailConfirmation(){var stytchClient=useStytch();var _useGlobalReducer=useGlobalReducer(),_useGlobalReducer2=_slicedToArray2(_useGlobalReducer,2),state=_useGlobalReducer2[0],dispatch=_useGlobalReducer2[1];var emailDomain=useEmailDomain();var email=state.formState.magicLinkState.email!==''?state.formState.magicLinkState.email:state.formState.passwordState.email;var reset=function reset(){dispatch({type:'set_magic_link_email',email:''});dispatch({type:'transition',screen:AppScreens$1.Main});readB2CInternals(stytchClient).networkClient.logEvent({name:'email_try_again_clicked',details:{email:email,type:EmailSentType.LoginOrCreateEML}});};return/*#__PURE__*/wn.createElement(EmailConfirmation$1,{emailDomain:emailDomain,reset:reset,email:email});};var useMountEffect=function useMountEffect(effect){var effectRef=_$2(effect);p$5(function(){return effectRef.current();},[]);};var ConfirmationSVG=function ConfirmationSVG(){return/*#__PURE__*/y$3("svg",{width:"201",height:"200",viewBox:"0 0 201 200",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("g",{opacity:"0.1"},/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.5 0C155.729 0 200.5 44.7715 200.5 99.9999C200.5 155.229 155.729 200 100.5 200C45.2715 200 0.5 155.229 0.5 99.9999C0.5 44.7715 45.2715 0 100.5 0Z",fill:"url(#paint0_linear_1356_5135)"})),/*#__PURE__*/y$3("g",{opacity:"0.3"},/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.5 17.5728C146.023 17.5728 182.927 54.4767 182.927 99.9998C182.927 145.523 146.023 182.427 100.5 182.427C54.9768 182.427 18.0729 145.523 18.0729 99.9998C18.0729 54.4767 54.9768 17.5728 100.5 17.5728Z",fill:"url(#paint1_linear_1356_5135)"})),/*#__PURE__*/y$3("g",{opacity:"0.7"},/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.5 32.231C137.988 32.231 168.378 62.6208 168.378 100.109C168.378 137.597 137.988 167.987 100.5 167.987C63.012 167.987 32.6222 137.597 32.6222 100.109C32.6222 62.6208 63.012 32.231 100.5 32.231Z",fill:"url(#paint2_linear_1356_5135)"})),/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.605 48.7734C128.955 48.7734 151.937 71.7553 151.937 100.105C151.937 128.455 128.955 151.437 100.605 151.437C72.255 151.437 49.2731 128.455 49.2731 100.105C49.2731 71.7553 72.255 48.7734 100.605 48.7734Z",fill:"#00AC26",fillOpacity:"0.12"}),/*#__PURE__*/y$3("mask",{id:"mask0_1356_5135",style:{maskType:'alpha'},maskUnits:"userSpaceOnUse",x:"49",y:"48",width:"103",height:"104"},/*#__PURE__*/y$3("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.605 48.7734C128.955 48.7734 151.937 71.7553 151.937 100.105C151.937 128.455 128.955 151.437 100.605 151.437C72.255 151.437 49.2731 128.455 49.2731 100.105C49.2731 71.7553 72.255 48.7734 100.605 48.7734Z",fill:"white"})),/*#__PURE__*/y$3("g",{mask:"url(#mask0_1356_5135)"}),/*#__PURE__*/y$3("path",{d:"M88 117.5L70.5 100L64.6667 105.833L88 129.167L138 79.1666L132.167 73.3333L88 117.5Z",fill:"white"}),/*#__PURE__*/y$3("defs",null,/*#__PURE__*/y$3("linearGradient",{id:"paint0_linear_1356_5135",x1:"-86.6375",y1:"160.384",x2:"170.169",y2:"338.297",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/y$3("stop",{stopColor:"white"}),/*#__PURE__*/y$3("stop",{offset:"1",stopColor:"#09F33D"})),/*#__PURE__*/y$3("linearGradient",{id:"paint1_linear_1356_5135",x1:"-86.6374",y1:"160.384",x2:"170.169",y2:"338.297",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/y$3("stop",{stopColor:"#00AC26",stopOpacity:"0.4"}),/*#__PURE__*/y$3("stop",{offset:"1",stopColor:"#BDFFBC",stopOpacity:"0.58"})),/*#__PURE__*/y$3("linearGradient",{id:"paint2_linear_1356_5135",x1:"-86.6375",y1:"160.493",x2:"170.169",y2:"338.406",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/y$3("stop",{stopColor:"#F8FFF5"}),/*#__PURE__*/y$3("stop",{offset:"1",stopColor:"#00AC26",stopOpacity:"0.26"}))));};var Confirmation=function Confirmation(_ref63){var header=_ref63.header,text=_ref63.text;var _useLingui3=useLingui(),_t=_useLingui3._;var defaultHeader=_t({id:'success.title',message:"Success!"});var defaultText=_t({id:'login.success.content',message:"You have successfully logged in."});return/*#__PURE__*/y$3(Flex,{direction:"column",gap:24,alignItems:"center"},/*#__PURE__*/y$3(Text,{size:"header"},header!==null&&header!==void 0?header:defaultHeader),/*#__PURE__*/y$3(Text,null,text!==null&&text!==void 0?text:defaultText),/*#__PURE__*/y$3(ConfirmationSVG,null));};var OTPConfirmation=function OTPConfirmation(){var _useLingui4=useLingui(),_t=_useLingui4._;var onEvent=useEventCallback();useMountEffect(function(){onEvent({type:StytchEventType.AuthenticateFlowComplete,data:{}});});return/*#__PURE__*/y$3(Confirmation,{text:_t({id:'otp.success.content',message:"Your passcode has been successfully verified."})});};var DividerContainer=He(Flex)(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n color: ",";\n"])),function(props){return props.theme.colors.secondary;});var DividerBar=He.div(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n ","\n ","\n border-bottom: 1px solid ",";\n flex-grow: 1;\n"])),function(props){return props.$placement==='left'&&'margin-right: 6px;';},function(props){return props.$placement==='right'&&'margin-left: 6px;';},function(props){return props.theme.colors.secondary;});var StyledText=He(Text)(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n color: ",";\n"])),function(props){return props.theme.colors.secondary;});var Divider=function Divider(){var _useLingui5=useLingui(),_t=_useLingui5._;return/*#__PURE__*/wn.createElement(DividerContainer,{alignItems:"center"},/*#__PURE__*/wn.createElement(DividerBar,{"$placement":"left"}),/*#__PURE__*/wn.createElement(StyledText,null,_t({id:'methodDivider.text',message:"or"})),/*#__PURE__*/wn.createElement(DividerBar,{"$placement":"right"}));};var OAuthButton=function OAuthButton(props){var stytchClient=useStytch();var onButtonClick=function onButtonClick(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee78(){var _a;return _regenerator2().w(function(_context78){while(1)switch(_context78.n){case 0:_context78.n=1;return stytchClient.oauth[props.providerType].start({login_redirect_url:props.loginRedirectUrl,signup_redirect_url:props.signupRedirectUrl,custom_scopes:props.customScopes,provider_params:props.providerParams});case 1:(_a=props.onSuccess)===null||_a===void 0?void 0:_a.call(props);case 2:return _context78.a(2);}},_callee78);}));};return/*#__PURE__*/wn.createElement(Button,{id:"oauth-".concat(props.providerType),type:"button",onClick:onButtonClick,variant:"outlined"},/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center",alignItems:"center",gap:4},props.icon,/*#__PURE__*/wn.createElement("span",{style:{verticalAlign:'middle'}},props.label)));};var GoogleIconSvg=function GoogleIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},/*#__PURE__*/wn.createElement("path",{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"}),/*#__PURE__*/wn.createElement("path",{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"}),/*#__PURE__*/wn.createElement("path",{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"}),/*#__PURE__*/wn.createElement("path",{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"}));};var GoogleIcon=CreateIcon(GoogleIconSvg);var useIsUnmounted=function useIsUnmounted(){var isUnmounted=_$2(false);p$5(function(){return function(){isUnmounted.current=true;};},[]);return isUnmounted;};var OAuthErrorMessage=function OAuthErrorMessage(_ref64){var children=_ref64.children;return/*#__PURE__*/wn.createElement("div",{key:"oauth-error-message"},/*#__PURE__*/wn.createElement(Text,{color:"error"},children));};var OneTapNoConfiguredClientsErrorMessage=function OneTapNoConfiguredClientsErrorMessage(){return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because no Google OAuth client configuration could be found for this project. Please make sure a client is configured in the\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."));};var RedirectUrlsErrorMessage=function RedirectUrlsErrorMessage(_ref65){var niceName=_ref65.niceName,variableName=_ref65.variableName;return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because there are no ",niceName," set for this project so we are unable to verify the",' ',/*#__PURE__*/wn.createElement("code",null,variableName),"\xA0 provided in the configuration. To set ",niceName," for this project please visit\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/dashboard/redirect-urls"},"the Stytch dashboard."),"\xA0 For more information on why this validation is necessary please visit\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/docs/api/url-validation"},"https://stytch.com/docs/api/url-validation."));};var OneTapNoConfiguredLoginRedirectUrlsErrorMessage=function OneTapNoConfiguredLoginRedirectUrlsErrorMessage(){return/*#__PURE__*/wn.createElement(RedirectUrlsErrorMessage,{niceName:"login redirect URLs",variableName:"oauthOptions.loginRedirectURL"});};var OneTapNoConfiguredSignupRedirectUrlsErrorMessage=function OneTapNoConfiguredSignupRedirectUrlsErrorMessage(){return/*#__PURE__*/wn.createElement(RedirectUrlsErrorMessage,{niceName:"signup redirect URLs",variableName:"oauthOptions.signupRedirectURL"});};var OneTapJSOriginErrorMessage=function OneTapJSOriginErrorMessage(){return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because the current host\xA0",/*#__PURE__*/wn.createElement("code",null,"\"".concat(window.location.host,"\""))," is not allowed for this project. Make sure to put your project's host into the Google API console. When using localhost for development, you must add both\xA0",/*#__PURE__*/wn.createElement("code",null,"http://localhost")," and\xA0",/*#__PURE__*/wn.createElement("code",null,"http://localhost:<port_number>"),"\xA0 to the Authorized JavaScript origins box. You can learn more\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/docs/sdks"},"here."));};var OneTapInvalidOAuthClient=function OneTapInvalidOAuthClient(){return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because the client ID configured for your project is not recognized by Google. \xA0 Please check that the client ID saved in ",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/dashboard/oauth/google"},"the Stytch Dashboard"),"\xA0 matches the client ID in your Google Cloud Console.");};var OneTapNoDefaultProviderAllowedErrorMessage=function OneTapNoDefaultProviderAllowedErrorMessage(){return/*#__PURE__*/wn.createElement(OAuthErrorMessage,null,"One Tap cannot render because the Stytch Default OAuth Provider is not compatible with One Tap. Please configure your own Google client in the\xA0",/*#__PURE__*/wn.createElement("a",{href:"https://stytch.com/dashboard/oauth"},"dashboard."));};var circularRotateKeyframe=Ue(_templateObject0||(_templateObject0=_taggedTemplateLiteral(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"])));var circularDashKeyframe=Ue(_templateObject1||(_templateObject1=_taggedTemplateLiteral(["\n 0% {\n stroke-dasharray: 1px, 200px;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -15px;\n }\n 100% {\n stroke-dasharray: 100px, 200px;\n stroke-dashoffset: -125px;\n }\n"])));var AnimatedCircle=He.circle(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n stroke-dasharray: 80px, 200px;\n stroke-dashoffset: 0;\n animation: "," 1.4s ease-in-out infinite;\n stroke: ",";\n fill: none;\n"])),circularDashKeyframe,function(props){return props.theme.colors.primary;});var CircularProgressRoot=He.div(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n width: ","px;\n height: ","px;\n animation: "," 1.4s ease-in-out infinite;\n"])),function(props){return props.size;},function(props){return props.size;},circularRotateKeyframe);var CircularProgressSVG=He.svg(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["\n display: block;\n"])));var CircularProgress=function CircularProgress(_ref66){var size=_ref66.size,thickness=_ref66.thickness;return/*#__PURE__*/wn.createElement(CircularProgressRoot,{size:size},/*#__PURE__*/wn.createElement(CircularProgressSVG,{viewBox:"".concat(size/2," ").concat(size/2," ").concat(size," ").concat(size)},/*#__PURE__*/wn.createElement(AnimatedCircle,{cx:size,cy:size,r:(size-thickness)/2,fill:"none",strokeWidth:thickness})));};var useIsOnlyFloatingOneTap=function useIsOnlyFloatingOneTap(){var config=useConfig();var isOnlyFloatingOneTap=F$4(function(){var _a,_b,_c,_d;var position=(_a=config.oauthOptions)===null||_a===void 0?void 0:_a.providers[0].position;return config.products.length===1&&config.products.includes(Products.oauth)&&((_b=config.oauthOptions)===null||_b===void 0?void 0:_b.providers.length)===1&&((_c=config.oauthOptions)===null||_c===void 0?void 0:_c.providers[0].type)===OAuthProviders.Google&&((_d=config.oauthOptions)===null||_d===void 0?void 0:_d.providers[0].one_tap)===true&&getShouldRenderFloatingOneTap(position);},[config]);return isOnlyFloatingOneTap;};function useLastUsedOAuth(){var stytch=useStytch();var _readB2CInternals=readB2CInternals(stytch),publicToken=_readB2CInternals.publicToken;var lastUsedOAuth=F$4(function(){return safeLocalStorage.getItem(publicToken,'b2c_last_used_oauth');},[publicToken]);var setLastUsedOAuth=function setLastUsedOAuth(providerType){safeLocalStorage.setItem(publicToken,'b2c_last_used_oauth',providerType);};return[lastUsedOAuth,setLastUsedOAuth];}var OAUTH_BUTTON_HEIGHT=47;var OneTapMountNode=function OneTapMountNode(_ref67){var enableShadowDOM=_ref67.enableShadowDOM;return enableShadowDOM?/*#__PURE__*/wn.createElement("slot",null):/*#__PURE__*/wn.createElement("div",{"data-prompt_parent_id":"g_id_onload",id:"google-parent-prompt"});};var OneTapErrors;(function(OneTapErrors){OneTapErrors["None"]="none";OneTapErrors["OriginNotAllowedForClient"]="origin_not_allowed_for_client";OneTapErrors["InvalidOAuthClient"]="invalid_client";OneTapErrors["NoConfiguredOAuthClient"]="oauth_config_not_found";OneTapErrors["NoConfiguredLoginRedirectUrls"]="no_login_redirect_urls_set";OneTapErrors["NoConfiguredSignupRedirectUrls"]="no_signup_redirect_urls_set";OneTapErrors["DefaultProviderNotAllowed"]="default_provider_not_allowed";})(OneTapErrors||(OneTapErrors={}));var ErrorMessages=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},OneTapErrors.None,/*#__PURE__*/wn.createElement(wn.Fragment,null)),OneTapErrors.OriginNotAllowedForClient,/*#__PURE__*/wn.createElement(OneTapJSOriginErrorMessage,null)),OneTapErrors.InvalidOAuthClient,/*#__PURE__*/wn.createElement(OneTapInvalidOAuthClient,null)),OneTapErrors.NoConfiguredOAuthClient,/*#__PURE__*/wn.createElement(OneTapNoConfiguredClientsErrorMessage,null)),OneTapErrors.NoConfiguredLoginRedirectUrls,/*#__PURE__*/wn.createElement(OneTapNoConfiguredLoginRedirectUrlsErrorMessage,null)),OneTapErrors.NoConfiguredSignupRedirectUrls,/*#__PURE__*/wn.createElement(OneTapNoConfiguredSignupRedirectUrlsErrorMessage,null)),OneTapErrors.DefaultProviderNotAllowed,/*#__PURE__*/wn.createElement(OneTapNoDefaultProviderAllowedErrorMessage,null));var OneTapContainer=He.div(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n height: ",";\n display: ",";\n transition: all 0.5s ease-out;\n justify-content: center;\n align-items: center;\n"])),function(props){return"".concat(props.$height,"px");},function(props){return props.pending?'flex':'block';});var GoogleOneTap=function GoogleOneTap(_ref68){var position=_ref68.position,customScopes=_ref68.customScopes,providerParams=_ref68.providerParams,cancelOnTapOutside=_ref68.cancelOnTapOutside;var _a,_b,_c,_d;var _useLingui6=useLingui(),_t=_useLingui6._;var oneTapRenderMode=getRenderedOneTapMode(position);var shouldRenderEmbeddedOneTap=oneTapRenderMode==='embedded';var shouldRenderOneTap=!!oneTapRenderMode;var config=useConfig();var stytch=useStytch();var isOnlyFloatingOneTap=useIsOnlyFloatingOneTap();var _h$5=h$5(shouldRenderEmbeddedOneTap),_h$6=_slicedToArray2(_h$5,2),pending=_h$6[0],setPending=_h$6[1];var _h$7=h$5(true),_h$8=_slicedToArray2(_h$7,2),canDisplayOneTap=_h$8[0],setCanDisplayOneTap=_h$8[1];var _h$9=h$5(OAUTH_BUTTON_HEIGHT),_h$0=_slicedToArray2(_h$9,2),height=_h$0[0],setHeight=_h$0[1];var _h$1=h$5(OneTapErrors.None),_h$10=_slicedToArray2(_h$1,2),oneTapError=_h$10[0],setOneTapError=_h$10[1];var resizeCount=_$2(0);var timeout=_$2();var isUnmounted=useIsUnmounted();var _useLastUsedOAuth=useLastUsedOAuth(),_useLastUsedOAuth2=_slicedToArray2(_useLastUsedOAuth,2),lastUsedMethod=_useLastUsedOAuth2[0],setLastUsedOAuth=_useLastUsedOAuth2[1];var onResize=T$3(function(_ref69){var _ref70=_slicedToArray2(_ref69,1),el=_ref70[0];if(timeout.current!=null){clearTimeout(timeout.current);}if(resizeCount.current>1){setHeight(function(currentHeight){return el.contentRect.height===0?canDisplayOneTap?currentHeight:OAUTH_BUTTON_HEIGHT:el.contentRect.height;});}else{timeout.current=setTimeout(function(){return setHeight(function(currentHeight){return el.contentRect.height===0?canDisplayOneTap?currentHeight:OAUTH_BUTTON_HEIGHT:el.contentRect.height;});},100);}resizeCount.current++;},[]);p$5(function(){if(shouldRenderEmbeddedOneTap){var el=document.getElementById('google-parent-prompt');if(el){var resizeObserver=new ResizeObserver(onResize);resizeObserver.observe(el);return function(){return resizeObserver.disconnect();};}}},[onResize,shouldRenderEmbeddedOneTap]);var attemptToLoadOneTap=T$3(function(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee79(){var _e,_f,_readB2CInternals2,oneTap,clientResult,client,onOneTapCancelled,renderResult;return _regenerator2().w(function(_context79){while(1)switch(_context79.n){case 0:if(shouldRenderOneTap){_context79.n=1;break;}return _context79.a(2);case 1:_readB2CInternals2=readB2CInternals(stytch),oneTap=_readB2CInternals2.oneTap;_context79.n=2;return oneTap.createOneTapClient();case 2:clientResult=_context79.v;if(clientResult.success){_context79.n=3;break;}if(clientResult.reason==='oauth_config_not_found'){setOneTapError(OneTapErrors.NoConfiguredOAuthClient);}else if(clientResult.reason==='no_signup_redirect_urls_set'){setOneTapError(OneTapErrors.NoConfiguredSignupRedirectUrls);}else if(clientResult.reason==='no_login_redirect_urls_set'){setOneTapError(OneTapErrors.NoConfiguredLoginRedirectUrls);}else{logger.error('Unable to load One Tap settings for project',clientResult);}return _context79.a(2);case 3:client=clientResult.client;onOneTapCancelled=function onOneTapCancelled(showError){setCanDisplayOneTap(false);setHeight(OAUTH_BUTTON_HEIGHT);if(showError){setOneTapError(OneTapErrors.OriginNotAllowedForClient);}};if(!isUnmounted.current){_context79.n=4;break;}return _context79.a(2);case 4:_context79.n=5;return client.render({callback:oneTap.createOnSuccessHandler({loginRedirectUrl:(_e=config.oauthOptions)===null||_e===void 0?void 0:_e.loginRedirectURL,signupRedirectUrl:(_f=config.oauthOptions)===null||_f===void 0?void 0:_f.signupRedirectURL,onSuccess:oneTap.redirectOnSuccess}),onOneTapCancelled:onOneTapCancelled,style:{position:position},cancelOnTapOutside:cancelOnTapOutside});case 5:renderResult=_context79.v;if(!isUnmounted.current){_context79.n=6;break;}client.cancel();return _context79.a(2);case 6:setCanDisplayOneTap(renderResult.success);setPending(false);if(!renderResult.success){if(renderResult.reason==='unregistered_origin'){setOneTapError(OneTapErrors.OriginNotAllowedForClient);}if(renderResult.reason==='invalid_client'){setOneTapError(OneTapErrors.InvalidOAuthClient);}logger.error('Unable to render One Tap prompt',renderResult);}return _context79.a(2,client);}},_callee79);}));},[shouldRenderOneTap,stytch,isUnmounted,(_a=config.oauthOptions)===null||_a===void 0?void 0:_a.loginRedirectURL,(_b=config.oauthOptions)===null||_b===void 0?void 0:_b.signupRedirectURL,position,cancelOnTapOutside]);p$5(function(){var client;attemptToLoadOneTap().then(function($client){return client=$client;})["catch"](function(err){logger.error('Unable to render One Tap prompt',err);setCanDisplayOneTap(false);setPending(false);});return function(){return client===null||client===void 0?void 0:client.cancel();};},[attemptToLoadOneTap]);var fallbackButton=/*#__PURE__*/wn.createElement(OAuthButton,{key:"oauth-".concat(OAuthProviders.Google),providerType:OAuthProviders.Google,icon:/*#__PURE__*/wn.createElement(GoogleIcon,null),label:_t({id:'oauth.continueWithGoogle',message:"Continue with Google"}),loginRedirectUrl:(_c=config.oauthOptions)===null||_c===void 0?void 0:_c.loginRedirectURL,signupRedirectUrl:(_d=config.oauthOptions)===null||_d===void 0?void 0:_d.signupRedirectURL,customScopes:customScopes,providerParams:providerParams,onSuccess:function onSuccess(){return setLastUsedOAuth(OAuthProviders.Google);}});var fallbackWithLastUsed=lastUsedMethod===OAuthProviders.Google?(/*#__PURE__*/wn.createElement("div",null,/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary",align:"right"},_t({id:'provider.lastUsed',message:"Last used"})),fallbackButton)):fallbackButton;var _readB2CInternals3=readB2CInternals(stytch),publicToken=_readB2CInternals3.publicToken;if(isOnlyFloatingOneTap){return/*#__PURE__*/wn.createElement(OneTapMountNode,{enableShadowDOM:!!config.enableShadowDOM});}if(oneTapError!==OneTapErrors.None){return/*#__PURE__*/wn.createElement(wn.Fragment,null,isTestPublicToken(publicToken)?ErrorMessages[oneTapError]:null,fallbackWithLastUsed);}if(shouldRenderEmbeddedOneTap&&OneTapProvider.willGoogleOneTapShowEmbedded()){return/*#__PURE__*/wn.createElement(OneTapContainer,{pending:pending,"$height":height},pending&&/*#__PURE__*/wn.createElement(CircularProgress,{size:25,thickness:2}),canDisplayOneTap?/*#__PURE__*/wn.createElement(OneTapMountNode,{enableShadowDOM:!!config.enableShadowDOM}):fallbackButton);}return fallbackWithLastUsed;};var AppleIconSvg=function AppleIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12.2227 6.25C13.0547 6.25 14.0977 5.65496 14.7188 4.86157C15.2813 4.14256 15.6914 3.13843 15.6914 2.1343C15.6914 1.99793 15.6797 1.86157 15.6563 1.75C14.7305 1.78719 13.6172 2.40702 12.9492 3.2376C12.4219 3.86983 11.9414 4.86157 11.9414 5.8781C11.9414 6.02686 11.9648 6.17562 11.9766 6.22521C12.0352 6.2376 12.1289 6.25 12.2227 6.25ZM9.29297 21.25C10.4297 21.25 10.9336 20.4442 12.3516 20.4442C13.793 20.4442 14.1094 21.2252 15.375 21.2252C16.6172 21.2252 17.4492 20.0103 18.2344 18.8202C19.1133 17.4566 19.4766 16.1178 19.5 16.0558C19.418 16.031 17.0391 15.0021 17.0391 12.1136C17.0391 9.6095 18.9141 8.4814 19.0195 8.39463C17.7773 6.51033 15.8906 6.46074 15.375 6.46074C13.9805 6.46074 12.8438 7.35331 12.1289 7.35331C11.3555 7.35331 10.3359 6.51033 9.12891 6.51033C6.83203 6.51033 4.5 8.51859 4.5 12.312C4.5 14.6674 5.36719 17.1591 6.43359 18.7707C7.34766 20.1343 8.14453 21.25 9.29297 21.25Z",fill:"black"}));};var AppleIcon=CreateIcon(AppleIconSvg);var GithubIconSvg=function GithubIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("rect",{width:"24",height:"24",rx:"12",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M12.0001 3.875C7.39828 3.875 3.66669 7.6059 3.66669 12.2084C3.66669 15.8903 6.05446 19.014 9.36558 20.1159C9.78205 20.1931 9.93495 19.9352 9.93495 19.7151C9.93495 19.5163 9.92723 18.8599 9.92364 18.1636C7.60528 18.6677 7.11608 17.1803 7.11608 17.1803C6.737 16.2171 6.1908 15.961 6.1908 15.961C5.43471 15.4438 6.2478 15.4544 6.2478 15.4544C7.08461 15.5132 7.52524 16.3131 7.52524 16.3131C8.2685 17.5871 9.47473 17.2188 9.95027 17.0059C10.0251 16.4673 10.241 16.0997 10.4794 15.8916C8.62839 15.6808 6.68263 14.9663 6.68263 11.7732C6.68263 10.8633 7.00816 10.1199 7.54125 9.53635C7.45472 9.32646 7.16948 8.47888 7.62198 7.33101C7.62198 7.33101 8.32176 7.10704 9.91426 8.18522C10.579 8.00058 11.2919 7.90798 12.0001 7.90481C12.7083 7.90798 13.4217 8.00058 14.0877 8.18522C15.6783 7.10704 16.3771 7.33101 16.3771 7.33101C16.8307 8.47888 16.5453 9.32646 16.4588 9.53635C16.9931 10.1199 17.3165 10.8633 17.3165 11.7732C17.3165 14.9739 15.367 15.6786 13.5113 15.8849C13.8102 16.1435 14.0765 16.6507 14.0765 17.4282C14.0765 18.5432 14.0669 19.4406 14.0669 19.7151C14.0669 19.9368 14.2169 20.1967 14.6393 20.1148C17.9486 19.0117 20.3334 15.8891 20.3334 12.2084C20.3334 7.6059 16.6023 3.875 12.0001 3.875ZM6.78782 15.7461C6.76946 15.7875 6.70433 15.7999 6.64499 15.7715C6.58455 15.7443 6.5506 15.6879 6.5702 15.6463C6.58813 15.6037 6.65341 15.5918 6.71371 15.6204C6.77429 15.6476 6.80879 15.7046 6.78782 15.7461ZM7.19773 16.1119C7.15798 16.1487 7.08029 16.1316 7.02758 16.0734C6.97307 16.0153 6.96286 15.9376 7.00315 15.9002C7.04414 15.8633 7.11948 15.8806 7.17413 15.9387C7.22864 15.9975 7.23927 16.0746 7.19773 16.1119ZM7.47894 16.5798C7.42788 16.6153 7.34439 16.582 7.29278 16.5079C7.24172 16.4338 7.24172 16.345 7.29389 16.3094C7.34564 16.2738 7.42788 16.3058 7.48018 16.3793C7.53111 16.4547 7.53111 16.5435 7.47894 16.5798ZM7.95454 17.1218C7.90886 17.1722 7.81157 17.1587 7.74036 17.0899C7.6675 17.0227 7.64722 16.9274 7.69303 16.877C7.73926 16.8265 7.8371 16.8407 7.90886 16.9089C7.98117 16.976 8.00325 17.072 7.95454 17.1218ZM8.56919 17.3048C8.54905 17.3701 8.45535 17.3997 8.36096 17.372C8.2667 17.3434 8.20502 17.267 8.22406 17.201C8.24366 17.1353 8.33777 17.1044 8.43285 17.1341C8.52697 17.1625 8.58879 17.2384 8.56919 17.3048ZM9.2687 17.3824C9.27105 17.4511 9.19101 17.5081 9.09193 17.5094C8.99229 17.5116 8.9117 17.4559 8.9106 17.3883C8.9106 17.3189 8.98884 17.2625 9.08848 17.2608C9.18756 17.2589 9.2687 17.3141 9.2687 17.3824ZM9.95589 17.3561C9.96776 17.4231 9.8989 17.492 9.8005 17.5103C9.70377 17.528 9.61421 17.4866 9.60193 17.4201C9.58992 17.3514 9.66002 17.2825 9.75662 17.2647C9.85515 17.2476 9.94333 17.2879 9.95589 17.3561Z",fill:"#161614"}));};var GithubIcon=CreateIcon(GithubIconSvg);var FacebookIconSVG=function FacebookIconSVG(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M22 12C22 6.47715 17.5229 2 12 2C6.47715 2 2 6.47715 2 12C2 16.9913 5.65685 21.1283 10.4375 21.8785V14.8906H7.89844V12H10.4375V9.79688C10.4375 7.29062 11.9304 5.90626 14.2146 5.90626C15.3087 5.90626 16.4531 6.10156 16.4531 6.10156V8.5625H15.1922C13.9499 8.5625 13.5625 9.33335 13.5625 10.1242V12H16.3359L15.8926 14.8906H13.5625V21.8785C18.3431 21.1283 22 16.9913 22 12Z",fill:"#1877F2"}),/*#__PURE__*/wn.createElement("path",{d:"M15.8926 14.8906L16.3359 12H13.5625V10.1242C13.5625 9.33334 13.9499 8.5625 15.1921 8.5625H16.4531V6.10156C16.4531 6.10156 15.3087 5.90625 14.2146 5.90625C11.9304 5.90625 10.4375 7.29062 10.4375 9.79688V12H7.89844V14.8906H10.4375V21.8785C10.9544 21.9595 11.4768 22.0001 12 22C12.5316 22 13.0534 21.9584 13.5625 21.8785V14.8906H15.8926Z",fill:"white"}));};var FacebookIcon=CreateIcon(FacebookIconSVG);var MicrosoftIconSvg=function MicrosoftIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M9.52382 0.952381H0.952393V9.52381H9.52382V0.952381Z",fill:"#F25022"}),/*#__PURE__*/wn.createElement("path",{d:"M9.52382 10.4762H0.952393V19.0476H9.52382V10.4762Z",fill:"#00A4EF"}),/*#__PURE__*/wn.createElement("path",{d:"M19.0475 0.952381H10.4761V9.52381H19.0475V0.952381Z",fill:"#7FBA00"}),/*#__PURE__*/wn.createElement("path",{d:"M19.0475 10.4762H10.4761V19.0476H19.0475V10.4762Z",fill:"#FFB900"}));};var MicrosoftIcon=CreateIcon(MicrosoftIconSvg);var GitLabIconSvg=function GitLabIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"-.1 .5 960.2 923.9",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"m958.9 442.4c1.1 26.1-2 52.1-9.2 77.2-7.1 25.1-18.3 48.8-33.1 70.3a240.43 240.43 0 0 1 -53.6 56.2l-.5.4-199.9 149.8-98.3 74.5-59.9 45.2c-3.5 2.7-7.4 4.7-11.5 6.1s-8.5 2.1-12.9 2.1c-4.3 0-8.7-.7-12.8-2.1s-8-3.4-11.5-6.1l-59.9-45.2-98.3-74.5-198.7-148.9-1.2-.8-.4-.4c-20.9-15.7-39-34.7-53.8-56.2s-26-45.3-33.2-70.4c-7.2-25.1-10.3-51.2-9.2-77.3 1.2-26.1 6.5-51.8 15.8-76.2l1.3-3.5 130.7-340.5q1-2.5 2.4-4.8 1.3-2.3 3.1-4.3 1.7-2.1 3.7-3.9 2-1.7 4.2-3.2c3.1-1.9 6.3-3.3 9.8-4.1 3.4-.9 7-1.3 10.5-1.1 3.6.2 7.1.9 10.4 2.2 3.3 1.2 6.5 3 9.3 5.2q2 1.7 3.9 3.6 1.8 2 3.2 4.3 1.5 2.2 2.6 4.7 1.1 2.4 1.8 5l88.1 269.7h356.6l88.1-269.7q.7-2.6 1.9-5 1.1-2.4 2.6-4.7 1.4-2.2 3.2-4.2 1.8-2 3.9-3.7c2.8-2.2 5.9-3.9 9.2-5.2 3.4-1.2 6.9-1.9 10.4-2.1 3.6-.2 7.1.1 10.6 1 3.4.9 6.7 2.3 9.7 4.2q2.3 1.4 4.3 3.2 2 1.7 3.7 3.8 1.7 2.1 3.1 4.4 1.3 2.3 2.3 4.8l130.5 340.6 1.3 3.5c9.3 24.3 14.6 50 15.7 76.1z",fill:"#e24329"}),/*#__PURE__*/wn.createElement("path",{d:"m959 442.5c1.1 26-2 52.1-9.2 77.2s-18.4 48.9-33.2 70.4-32.9 40.5-53.7 56.2l-.5.4-199.9 149.8s-84.9-64.1-182.5-138l286.5-216.8c12.9-9.7 26.4-18.6 40.3-26.8 13.9-8.3 28.3-15.7 43-22.3 14.8-6.6 29.9-12.5 45.2-17.4 15.4-5 31-9.1 46.9-12.4l1.3 3.5c9.3 24.4 14.6 50.1 15.8 76.2z",fill:"#fc6d26"}),/*#__PURE__*/wn.createElement("path",{d:"m480 658.5c97.6 73.7 182.6 138 182.6 138l-98.3 74.5-59.9 45.2c-3.5 2.7-7.4 4.7-11.5 6.1s-8.5 2.1-12.9 2.1c-4.3 0-8.7-.7-12.8-2.1s-8-3.4-11.5-6.1l-59.9-45.2-98.3-74.5s84.9-64.3 182.5-138z",fill:"#fca326"}),/*#__PURE__*/wn.createElement("path",{d:"m480 658.3c-97.7 73.9-182.5 138-182.5 138l-198.7-148.9-1.2-.8-.4-.4c-20.9-15.7-39-34.7-53.8-56.2s-26-45.3-33.2-70.4c-7.2-25.1-10.3-51.2-9.2-77.3 1.2-26.1 6.5-51.8 15.8-76.2l1.3-3.5c15.9 3.3 31.5 7.4 46.9 12.4 15.3 5 30.4 10.8 45.2 17.5 14.7 6.6 29.1 14.1 43 22.3s27.3 17.2 40.3 26.9z",fill:"#fc6d26"}));};var GitLabIcon=CreateIcon(GitLabIconSvg);var DiscordIconSvg=function DiscordIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M18.5843 6.16943C17.3733 5.62815 16.0747 5.22936 14.7169 5.00096C14.6922 4.99655 14.6675 5.00757 14.6548 5.0296C14.4877 5.31896 14.3027 5.69645 14.1732 5.99316C12.7128 5.78018 11.2599 5.78018 9.8295 5.99316C9.69993 5.68986 9.50822 5.31896 9.34046 5.0296C9.32772 5.0083 9.30302 4.99729 9.27829 5.00096C7.92126 5.22863 6.62265 5.62742 5.41091 6.16943C5.40042 6.17384 5.39143 6.18119 5.38546 6.19073C2.92227 9.77548 2.2475 13.2721 2.57852 16.7254C2.58002 16.7423 2.58975 16.7584 2.60323 16.7687C4.22837 17.9313 5.8026 18.6371 7.3476 19.1049C7.37232 19.1123 7.39852 19.1035 7.41426 19.0836C7.77973 18.5975 8.10551 18.0848 8.38484 17.5457C8.40132 17.5142 8.38558 17.4767 8.35189 17.4642C7.83515 17.2733 7.3431 17.0405 6.86979 16.7761C6.83235 16.7548 6.82935 16.7026 6.86379 16.6776C6.96339 16.6049 7.06302 16.5293 7.15813 16.4529C7.17534 16.439 7.19932 16.436 7.21955 16.4448C10.329 17.8278 13.6954 17.8278 16.7682 16.4448C16.7884 16.4353 16.8124 16.4382 16.8303 16.4522C16.9255 16.5286 17.0251 16.6049 17.1254 16.6776C17.1599 16.7026 17.1576 16.7548 17.1202 16.7761C16.6469 17.0456 16.1548 17.2733 15.6373 17.4635C15.6036 17.476 15.5886 17.5142 15.6051 17.5457C15.8905 18.0841 16.2162 18.5967 16.575 19.0829C16.5899 19.1035 16.6169 19.1123 16.6416 19.1049C18.1941 18.6371 19.7683 17.9313 21.3935 16.7687C21.4077 16.7584 21.4167 16.743 21.4182 16.7261C21.8144 12.7338 20.7546 9.26579 18.609 6.19146C18.6038 6.18119 18.5948 6.17384 18.5843 6.16943ZM8.84918 14.6227C7.91302 14.6227 7.14165 13.7855 7.14165 12.7573C7.14165 11.7291 7.89806 10.8918 8.84918 10.8918C9.80777 10.8918 10.5717 11.7364 10.5567 12.7573C10.5567 13.7855 9.80028 14.6227 8.84918 14.6227ZM15.1625 14.6227C14.2264 14.6227 13.455 13.7855 13.455 12.7573C13.455 11.7291 14.2114 10.8918 15.1625 10.8918C16.1211 10.8918 16.885 11.7364 16.87 12.7573C16.87 13.7855 16.1211 14.6227 15.1625 14.6227Z",fill:"#5865F2"}));};var DiscordIcon=CreateIcon(DiscordIconSvg);var SlackIconSvg=function SlackIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M6.78176 14.3746C6.78176 15.4153 5.9316 16.2655 4.89088 16.2655C3.85016 16.2655 3 15.4153 3 14.3746C3 13.3339 3.85016 12.4837 4.89088 12.4837H6.78176V14.3746Z",fill:"#E01E5A"}),/*#__PURE__*/wn.createElement("path",{d:"M7.73462 14.3746C7.73462 13.3339 8.58478 12.4837 9.6255 12.4837C10.6662 12.4837 11.5164 13.3339 11.5164 14.3746V19.1091C11.5164 20.1498 10.6662 21 9.6255 21C8.58478 21 7.73462 20.1498 7.73462 19.1091V14.3746Z",fill:"#E01E5A"}),/*#__PURE__*/wn.createElement("path",{d:"M9.6255 6.78176C8.58478 6.78176 7.73462 5.9316 7.73462 4.89088C7.73462 3.85016 8.58478 3 9.6255 3C10.6662 3 11.5164 3.85016 11.5164 4.89088V6.78176H9.6255Z",fill:"#36C5F0"}),/*#__PURE__*/wn.createElement("path",{d:"M9.62541 7.73453C10.6661 7.73453 11.5163 8.58469 11.5163 9.62541C11.5163 10.6661 10.6661 11.5163 9.62541 11.5163H4.89088C3.85016 11.5163 3 10.6661 3 9.62541C3 8.58469 3.85016 7.73453 4.89088 7.73453H9.62541Z",fill:"#36C5F0"}),/*#__PURE__*/wn.createElement("path",{d:"M17.2183 9.62541C17.2183 8.58469 18.0684 7.73453 19.1091 7.73453C20.1499 7.73453 21 8.58469 21 9.62541C21 10.6661 20.1499 11.5163 19.1091 11.5163H17.2183V9.62541Z",fill:"#2EB67D"}),/*#__PURE__*/wn.createElement("path",{d:"M16.2654 9.62541C16.2654 10.6661 15.4152 11.5163 14.3745 11.5163C13.3338 11.5163 12.4836 10.6661 12.4836 9.62541V4.89088C12.4836 3.85016 13.3338 3 14.3745 3C15.4152 3 16.2654 3.85016 16.2654 4.89088V9.62541Z",fill:"#2EB67D"}),/*#__PURE__*/wn.createElement("path",{d:"M14.3745 17.2182C15.4152 17.2182 16.2654 18.0684 16.2654 19.1091C16.2654 20.1498 15.4152 21 14.3745 21C13.3338 21 12.4836 20.1498 12.4836 19.1091V17.2182H14.3745Z",fill:"#ECB22E"}),/*#__PURE__*/wn.createElement("path",{d:"M14.3745 16.2655C13.3338 16.2655 12.4836 15.4153 12.4836 14.3746C12.4836 13.3339 13.3338 12.4837 14.3745 12.4837H19.109C20.1498 12.4837 20.9999 13.3339 20.9999 14.3746C20.9999 15.4153 20.1498 16.2655 19.109 16.2655H14.3745Z",fill:"#ECB22E"}));};var SlackIcon=CreateIcon(SlackIconSvg);var AmazonIconSvg=function AmazonIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M7 11.9273C7 11.0909 7.20605 10.3758 7.61818 9.78182C8.03029 9.18787 8.59393 8.7394 9.30909 8.43636C9.96364 8.15758 10.7697 7.95758 11.7273 7.83636C12.0545 7.8 12.5879 7.75151 13.3273 7.69091V7.38182C13.3273 6.60605 13.2424 6.08485 13.0727 5.81818C12.8182 5.45455 12.4182 5.27273 11.8727 5.27273H11.7273C11.3273 5.30909 10.9818 5.43636 10.6909 5.65455C10.4 5.87273 10.2121 6.17576 10.1273 6.56364C10.0788 6.80605 9.95756 6.94545 9.76364 6.98182L7.67273 6.72727C7.46665 6.67878 7.36364 6.56969 7.36364 6.4C7.36364 6.36364 7.36969 6.32122 7.38182 6.27273C7.58787 5.19395 8.09393 4.39395 8.9 3.87273C9.70605 3.35151 10.6485 3.0606 11.7273 3H12.1818C13.5636 3 14.6424 3.35758 15.4182 4.07273C15.5399 4.19449 15.6523 4.32516 15.7545 4.46364C15.8576 4.60304 15.9394 4.72727 16 4.83636C16.0606 4.94545 16.1151 5.10304 16.1636 5.30909C16.2121 5.51515 16.2485 5.65758 16.2727 5.73636C16.297 5.81515 16.3151 5.98485 16.3273 6.24545C16.3394 6.50605 16.3455 6.6606 16.3455 6.70909V11.1091C16.3455 11.4242 16.3909 11.7121 16.4818 11.9727C16.5727 12.2333 16.6606 12.4212 16.7455 12.5364C16.8303 12.6515 16.9697 12.8364 17.1636 13.0909C17.2364 13.2 17.2727 13.297 17.2727 13.3818C17.2727 13.4788 17.2242 13.5636 17.1273 13.6364C16.1212 14.5091 15.5757 14.9818 15.4909 15.0545C15.3455 15.1636 15.1697 15.1758 14.9636 15.0909C14.7939 14.9455 14.6455 14.8061 14.5182 14.6727C14.3909 14.5394 14.3 14.4424 14.2455 14.3818C14.1909 14.3212 14.103 14.203 13.9818 14.0273C13.8606 13.8515 13.7757 13.7333 13.7273 13.6727C13.0485 14.4121 12.3818 14.8727 11.7273 15.0545C11.3151 15.1758 10.8061 15.2364 10.2 15.2364C9.26665 15.2364 8.5 14.9485 7.9 14.3727C7.3 13.797 7 12.9818 7 11.9273ZM10.1273 11.5636C10.1273 12.0364 10.2455 12.4151 10.4818 12.7C10.7182 12.9849 11.0364 13.1273 11.4364 13.1273C11.4727 13.1273 11.5242 13.1212 11.5909 13.1091C11.6576 13.097 11.703 13.0909 11.7273 13.0909C12.2364 12.9576 12.6303 12.6303 12.9091 12.1091C13.0424 11.8788 13.1424 11.6273 13.2091 11.3545C13.2757 11.0818 13.3121 10.8606 13.3182 10.6909C13.3242 10.5212 13.3273 10.2424 13.3273 9.85455V9.4C12.6242 9.4 12.0909 9.44849 11.7273 9.54545C10.6606 9.84849 10.1273 10.5212 10.1273 11.5636Z",fill:"black"}),/*#__PURE__*/wn.createElement("path",{d:"M2.32727 16.4424C2.19393 16.3576 2.09696 16.3636 2.03636 16.4606C2.01211 16.497 2 16.5333 2 16.5697C2 16.6303 2.03636 16.6909 2.10909 16.7515C3.44242 17.9515 4.95151 18.8818 6.63636 19.5424C8.3212 20.203 10.1091 20.5333 12 20.5333C13.2242 20.5333 14.4788 20.3636 15.7636 20.0242C17.0485 19.6848 18.2121 19.2061 19.2545 18.5879C19.5939 18.3818 19.8727 18.2 20.0909 18.0424C20.2606 17.9212 20.2939 17.7879 20.1909 17.6424C20.0879 17.497 19.9455 17.4606 19.7636 17.5333C19.7151 17.5576 19.6333 17.5939 19.5182 17.6424C19.403 17.6909 19.3151 17.7273 19.2545 17.7515C16.9394 18.6364 14.5939 19.0788 12.2182 19.0788C8.65455 19.0788 5.35756 18.2 2.32727 16.4424Z",fill:"#FF9900"}),/*#__PURE__*/wn.createElement("path",{d:"M18.3818 16.6242C18.3333 16.6727 18.297 16.7212 18.2727 16.7697C18.2606 16.7939 18.2545 16.8121 18.2545 16.8242C18.2424 16.8485 18.2485 16.8727 18.2727 16.897C18.297 16.9212 18.3455 16.9333 18.4182 16.9333C18.6727 16.897 18.9515 16.8606 19.2545 16.8242C19.5333 16.8 19.7757 16.7879 19.9818 16.7879C20.5394 16.7879 20.8788 16.8606 21 17.0061C21.0485 17.0667 21.0727 17.1636 21.0727 17.297C21.0727 17.7091 20.8485 18.4424 20.4 19.497C20.3636 19.5939 20.3818 19.6606 20.4545 19.697C20.4788 19.7091 20.503 19.7152 20.5273 19.7152C20.5757 19.7152 20.6303 19.6909 20.6909 19.6424C21.103 19.2909 21.4242 18.8273 21.6545 18.2515C21.8848 17.6758 22 17.1758 22 16.7515V16.6242C22 16.4788 21.9757 16.3697 21.9273 16.297C21.8182 16.1636 21.4909 16.0727 20.9455 16.0242C20.8364 16 20.7212 15.9939 20.6 16.0061C20.1636 16.0182 19.7151 16.0848 19.2545 16.2061C18.9757 16.2788 18.6848 16.4182 18.3818 16.6242Z",fill:"#FF9900"}));};var AmazonIcon=CreateIcon(AmazonIconSvg);var BitbucketIconSvg=function BitbucketIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M6.98153 7.125C6.68181 7.125 6.45702 7.39974 6.50697 7.67449L8.53009 20.0629C8.58004 20.3877 8.85479 20.6124 9.17948 20.6124H18.9704C19.1952 20.6124 19.395 20.4376 19.4449 20.2128L21.493 7.69947C21.543 7.39974 21.3182 7.14998 21.0185 7.14998L6.98153 7.125ZM15.5736 16.0667H12.4514L11.6272 11.6458H16.3478L15.5736 16.0667Z",fill:"#2684FF"}),/*#__PURE__*/wn.createElement("path",{d:"M20.8186 11.6458H16.3228L15.5735 16.0667H12.4513L8.77979 20.4376C8.77979 20.4376 8.95462 20.5875 9.20439 20.5875H18.9953C19.2201 20.5875 19.4199 20.4126 19.4698 20.1878L20.8186 11.6458Z",fill:"url(#paint0_linear_414_2186)"}),/*#__PURE__*/wn.createElement("path",{d:"M2 2V0.875H0.875V2H2ZM26 2H27.125V0.875H26V2ZM26 26V27.125H27.125V26H26ZM2 26H0.875V27.125H2V26ZM2 3.125H26V0.875H2V3.125ZM24.875 2V26H27.125V2H24.875ZM26 24.875H2V27.125H26V24.875ZM3.125 26V2H0.875V26H3.125Z",fill:"#E5E8EB"}),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("linearGradient",{id:"paint0_linear_414_2186",x1:"21.8703",y1:"12.8916",x2:"14.42",y2:"18.7072",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{offset:"0.176",stopColor:"#0052CC"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#2684FF"}))));};var BitbucketIcon=CreateIcon(BitbucketIconSvg);var LinkedInIconSvg=function LinkedInIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21Z",fill:"#0A66C2"}),/*#__PURE__*/wn.createElement("path",{d:"M18.5 18.5H15.8289V13.9505C15.8289 12.7032 15.3549 12.0061 14.3677 12.0061C13.2937 12.0061 12.7325 12.7315 12.7325 13.9505V18.5H10.1583V9.83333H12.7325V11.0007C12.7325 11.0007 13.5065 9.56855 15.3456 9.56855C17.1839 9.56855 18.5 10.6911 18.5 13.0128V18.5ZM7.08734 8.6985C6.21051 8.6985 5.5 7.98241 5.5 7.09925C5.5 6.21609 6.21051 5.5 7.08734 5.5C7.96416 5.5 8.67425 6.21609 8.67425 7.09925C8.67425 7.98241 7.96416 8.6985 7.08734 8.6985ZM5.75814 18.5H8.44235V9.83333H5.75814V18.5Z",fill:"white"}));};var LinkedInIcon=CreateIcon(LinkedInIconSvg);var CoinbaseIconSvg=function CoinbaseIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.2",baseProfile:"tiny",x:"0px",y:"0px",viewBox:"0 0 1024 1024",overflow:"visible",xmlSpace:"preserve"},/*#__PURE__*/wn.createElement("path",{fill:"#0052FF",d:"M512,0L512,0c282.8,0,512,229.2,512,512l0,0c0,282.8-229.2,512-512,512l0,0C229.2,1024,0,794.8,0,512l0,0 C0,229.2,229.2,0,512,0z"}),/*#__PURE__*/wn.createElement("path",{fill:"#FFFFFF",d:"M512.1,692c-99.4,0-180-80.5-180-180s80.6-180,180-180c89.1,0,163.1,65,177.3,150h181.3 c-15.3-184.8-170-330-358.7-330c-198.8,0-360,161.2-360,360s161.2,360,360,360c188.7,0,343.4-145.2,358.7-330H689.3 C675,627,601.2,692,512.1,692z"}));};var CoinbaseIcon=CreateIcon(CoinbaseIconSvg);var TwitchIconSvg=function TwitchIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 18 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M16.1141 9.78571L13.257 12.6429H10.3998L7.89983 15.1429V12.6429H4.68555V1.92857H16.1141V9.78571Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M3.97133 0.5L0.399902 4.07143V16.9286H4.68562V20.5L8.25704 16.9286H11.1142L17.5428 10.5V0.5H3.97133ZM16.1142 9.78571L13.257 12.6429H10.3999L7.8999 15.1429V12.6429H4.68562V1.92857H16.1142V9.78571Z",fill:"#9146FF"}),/*#__PURE__*/wn.createElement("path",{d:"M13.9713 4.42857H12.5427V8.71428H13.9713V4.42857Z",fill:"#9146FF"}),/*#__PURE__*/wn.createElement("path",{d:"M10.0428 4.42857H8.61426V8.71428H10.0428V4.42857Z",fill:"#9146FF"}));};var TwitchIcon=CreateIcon(TwitchIconSvg);var TwitterIconSvg=function TwitterIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M19.8991 8.13629C19.9112 8.31129 19.9112 8.48629 19.9112 8.66291C19.9112 14.0444 15.8144 20.2508 8.32331 20.2508V20.2476C6.1104 20.2508 3.94347 19.6169 2.08057 18.4218C2.40234 18.4605 2.72573 18.4798 3.04992 18.4806C4.88379 18.4823 6.66524 17.8669 8.10799 16.7339C6.36524 16.7008 4.83702 15.5645 4.30315 13.9056C4.91363 14.0234 5.54266 13.9992 6.14186 13.8355C4.24186 13.4516 2.87492 11.7823 2.87492 9.84355C2.87492 9.82581 2.87492 9.80887 2.87492 9.79194C3.44105 10.1073 4.07492 10.2823 4.72331 10.3016C2.93379 9.10565 2.38218 6.725 3.46282 4.86371C5.53057 7.40807 8.58137 8.95484 11.8564 9.11855C11.5281 7.70403 11.9765 6.22178 13.0346 5.22742C14.6749 3.68549 17.2548 3.76452 18.7967 5.40403C19.7088 5.2242 20.583 4.88952 21.383 4.41532C21.079 5.35807 20.4427 6.15887 19.5927 6.66774C20.3999 6.57258 21.1886 6.35645 21.9314 6.02661C21.3846 6.84597 20.6959 7.55968 19.8991 8.13629Z",fill:"#1D9BF0"}));};var TwitterIcon=CreateIcon(TwitterIconSvg);var TikTokIconSvg=function TikTokIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("circle",{cx:"12",cy:"12",r:"10",fill:"black"}),/*#__PURE__*/wn.createElement("path",{d:"M14.9767 10.0746C15.8641 10.7087 16.9513 11.0817 18.1255 11.0817V8.8234C17.9033 8.82344 17.6816 8.80028 17.4642 8.75425V10.5319C16.2901 10.5319 15.2031 10.1588 14.3154 9.52481V14.1334C14.3154 16.4389 12.4455 18.3077 10.139 18.3077C9.27835 18.3077 8.47845 18.0477 7.81396 17.6017C8.57236 18.3767 9.63 18.8575 10.8001 18.8575C13.1067 18.8575 14.9767 16.9887 14.9767 14.6832V10.0746H14.9767ZM15.7924 7.79623C15.3389 7.30099 15.0411 6.66099 14.9767 5.95344V5.66297H14.35C14.5077 6.56226 15.0458 7.33057 15.7924 7.79623ZM9.27283 15.8325C9.01944 15.5005 8.8825 15.0942 8.88312 14.6766C8.88312 13.6221 9.7384 12.7672 10.7936 12.7672C10.9902 12.7671 11.1857 12.7972 11.3731 12.8567V10.5478C11.1541 10.5178 10.9331 10.5051 10.7121 10.5098V12.3068C10.5246 12.2474 10.329 12.2172 10.1323 12.2174C9.07713 12.2174 8.22189 13.0723 8.22189 14.1268C8.22189 14.8725 8.64939 15.5181 9.27283 15.8325Z",fill:"#FF004F"}),/*#__PURE__*/wn.createElement("path",{d:"M14.3153 9.52476C15.203 10.1588 16.29 10.5318 17.4641 10.5318V8.7542C16.8087 8.61467 16.2285 8.27236 15.7923 7.79623C15.0456 7.33052 14.5076 6.56222 14.3499 5.66297H12.7039V14.6831C12.7001 15.7346 11.8463 16.5861 10.7934 16.5861C10.1729 16.5861 9.6217 16.2905 9.27259 15.8325C8.6492 15.5181 8.2217 14.8725 8.2217 14.1269C8.2217 13.0724 9.07693 12.2175 10.1321 12.2175C10.3343 12.2175 10.5291 12.2489 10.7119 12.3069V10.5098C8.44594 10.5566 6.62354 12.4072 6.62354 14.6831C6.62354 15.8192 7.07736 16.8492 7.81391 17.6017C8.47839 18.0477 9.2783 18.3078 10.1389 18.3078C12.4455 18.3078 14.3153 16.4389 14.3153 14.1334V9.52476H14.3153Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M17.464 8.7542V8.27354C16.873 8.27443 16.2936 8.10901 15.7922 7.79618C16.236 8.28188 16.8205 8.61679 17.464 8.7542ZM14.3498 5.66297C14.3347 5.57703 14.3231 5.49052 14.3151 5.40368V5.1132H12.0424V14.1334C12.0388 15.1848 11.185 16.0363 10.132 16.0363C9.82282 16.0363 9.53093 15.9629 9.27244 15.8326C9.62154 16.2905 10.1728 16.586 10.7932 16.586C11.8461 16.586 12.7 15.7347 12.7037 14.6831V5.66297H14.3498ZM10.7119 10.5098V9.99811C10.522 9.97217 10.3305 9.95915 10.1388 9.95924C7.83206 9.9592 5.96216 11.8281 5.96216 14.1334C5.96216 15.5787 6.69706 16.8524 7.81381 17.6016C7.07725 16.8491 6.62343 15.8191 6.62343 14.6831C6.62343 12.4072 8.44579 10.5566 10.7119 10.5098Z",fill:"#00F2EA"}));};var TikTokIcon=CreateIcon(TikTokIconSvg);var SnapchatIconSvg=function SnapchatIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M18.549 15.4187C16.124 14.2448 15.7375 12.4323 15.7203 12.2978C15.6995 12.135 15.6759 12.007 15.8555 11.8413C16.0288 11.6813 16.7974 11.2055 17.0106 11.0567C17.3631 10.8102 17.5184 10.5642 17.4039 10.2617C17.3239 10.0524 17.1291 9.9736 16.9238 9.9736C16.8591 9.9738 16.7945 9.98105 16.7313 9.99521C16.344 10.0792 15.9679 10.2733 15.7503 10.3257C15.7241 10.3324 15.6973 10.3361 15.6703 10.3365C15.5542 10.3365 15.5102 10.2849 15.5214 10.1453C15.5486 9.72194 15.6062 8.89571 15.5394 8.12391C15.4478 7.06202 15.1053 6.53588 14.6992 6.07055C14.5027 5.84489 13.5905 4.87543 11.83 4.87543C10.0696 4.87543 9.15851 5.84489 8.96326 6.06775C8.55595 6.53308 8.21385 7.05922 8.12303 8.12111C8.05621 8.89291 8.11623 9.71874 8.14104 10.1425C8.14904 10.2753 8.10823 10.3337 7.9922 10.3337C7.96519 10.3332 7.93833 10.3296 7.91217 10.3229C7.69492 10.2705 7.31881 10.0764 6.93151 9.99241C6.86833 9.97825 6.8038 9.971 6.73906 9.9708C6.533 9.9708 6.33895 10.0508 6.25893 10.2589C6.1445 10.5614 6.29894 10.8074 6.65263 11.0539C6.86589 11.2027 7.6345 11.6781 7.80775 11.8385C7.98699 12.0042 7.96379 12.1322 7.94298 12.295C7.92578 12.4315 7.53887 14.244 5.11422 15.4159C4.97218 15.4847 4.73052 15.6303 5.15663 15.8656C5.82561 16.2353 6.27093 16.1957 6.61702 16.4185C6.9107 16.6078 6.73706 17.0159 6.95071 17.1631C7.21319 17.3444 7.98899 17.1503 8.99126 17.4812C9.83149 17.7581 10.342 18.5403 11.832 18.5403C13.322 18.5403 13.8474 17.7545 14.6728 17.4812C15.6731 17.1503 16.4505 17.3444 16.7133 17.1631C16.9266 17.0159 16.7534 16.6078 17.047 16.4185C17.3931 16.1957 17.838 16.2353 18.5074 15.8656C18.9327 15.6331 18.6911 15.4875 18.549 15.4187Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M19.604 15.2806C19.4952 14.9846 19.2879 14.8261 19.0519 14.6949C19.0075 14.6689 18.9666 14.6481 18.9318 14.6321C18.8614 14.5957 18.7894 14.5604 18.7178 14.5232C17.982 14.1331 17.4074 13.641 17.0089 13.0576C16.8957 12.8934 16.7976 12.7193 16.7156 12.5375C16.6816 12.4403 16.6832 12.3851 16.7076 12.3346C16.7318 12.2958 16.7639 12.2624 16.8017 12.2366C16.9281 12.153 17.0585 12.0682 17.147 12.011C17.3046 11.9089 17.4294 11.8281 17.5099 11.7709C17.8119 11.5596 18.0232 11.3352 18.1552 11.0843C18.2473 10.911 18.3011 10.7199 18.3127 10.5239C18.3244 10.328 18.2937 10.1318 18.2228 9.9488C18.0228 9.42226 17.5255 9.09537 16.9229 9.09537C16.7958 9.09525 16.669 9.10866 16.5448 9.13538C16.5116 9.14258 16.4784 9.15019 16.446 9.15859C16.4516 8.79849 16.4436 8.41839 16.4116 8.04429C16.2979 6.72913 15.8374 6.03975 15.3573 5.49C15.0498 5.14551 14.6877 4.85405 14.2854 4.62737C13.5568 4.21126 12.7306 4 11.8299 4C10.9293 4 10.1071 4.21126 9.37766 4.62737C8.9744 4.85412 8.61152 5.14616 8.30377 5.4916C7.82364 6.04135 7.36312 6.73194 7.24949 8.04589C7.21748 8.41999 7.20948 8.80209 7.21468 9.16019C7.18227 9.15179 7.14946 9.14419 7.11625 9.13698C6.992 9.11026 6.86525 9.09685 6.73815 9.09697C6.13519 9.09697 5.63705 9.42386 5.4378 9.9504C5.36658 10.1335 5.33561 10.3298 5.347 10.5259C5.35839 10.7221 5.41188 10.9135 5.50382 11.0871C5.63625 11.338 5.84751 11.5624 6.14959 11.7737C6.22961 11.8297 6.35485 11.9105 6.51249 12.0138C6.59771 12.069 6.72215 12.1498 6.84418 12.2306C6.88687 12.2582 6.92316 12.2946 6.95061 12.3374C6.97621 12.3899 6.97702 12.4463 6.939 12.5503C6.85816 12.7283 6.76162 12.8988 6.65053 13.0596C6.26082 13.6298 5.70307 14.1131 4.99088 14.5C4.61358 14.7001 4.22147 14.8337 4.05583 15.2838C3.93099 15.6235 4.01262 16.01 4.3299 16.3357C4.44635 16.4573 4.58141 16.5595 4.73001 16.6386C5.03921 16.8085 5.368 16.9401 5.70907 17.0303C5.77946 17.0485 5.84628 17.0784 5.90673 17.1187C6.02236 17.22 6.00595 17.3724 6.15999 17.5957C6.23732 17.711 6.33557 17.8109 6.44967 17.8901C6.77296 18.1134 7.13626 18.1274 7.52116 18.1422C7.86885 18.1554 8.26296 18.1706 8.71308 18.3191C8.89953 18.3807 9.09318 18.4999 9.31765 18.6391C9.85659 18.9704 10.5944 19.4238 11.8291 19.4238C13.0639 19.4238 13.8069 18.968 14.3498 18.6355C14.5727 18.4987 14.7651 18.3807 14.9464 18.3207C15.3965 18.1718 15.7906 18.157 16.1383 18.1438C16.5232 18.129 16.8865 18.115 17.2098 17.8917C17.3449 17.7975 17.4575 17.6745 17.5395 17.5316C17.6503 17.3432 17.6475 17.2116 17.7515 17.1195C17.8082 17.0811 17.871 17.0524 17.9372 17.0347C18.2829 16.9442 18.6162 16.8114 18.9294 16.6394C19.0873 16.5547 19.2294 16.4434 19.3495 16.3105L19.3535 16.3057C19.6512 15.9872 19.726 15.6119 19.604 15.2806ZM18.5065 15.8704C17.8371 16.2401 17.3922 16.2005 17.0461 16.4233C16.752 16.6126 16.9261 17.0207 16.7124 17.1679C16.45 17.3492 15.6742 17.1551 14.6719 17.486C13.8453 17.7593 13.3179 18.5451 11.8311 18.5451C10.3443 18.5451 9.82938 17.7609 8.98916 17.484C7.98889 17.1531 7.21148 17.3472 6.94861 17.1659C6.73535 17.0187 6.9086 16.6106 6.61492 16.4213C6.26842 16.1985 5.8235 16.2381 5.15452 15.8704C4.72841 15.6351 4.97007 15.4895 5.11211 15.4207C7.53677 14.2468 7.92367 12.4343 7.94087 12.2998C7.96168 12.137 7.98489 12.009 7.80564 11.8433C7.63239 11.6833 6.86378 11.2075 6.65053 11.0587C6.29763 10.8122 6.14239 10.5662 6.25682 10.2637C6.33684 10.0544 6.5321 9.97561 6.73695 9.97561C6.80169 9.97581 6.86623 9.98305 6.9294 9.99722C7.31671 10.0812 7.69281 10.2753 7.91007 10.3277C7.93623 10.3344 7.96308 10.338 7.99009 10.3385C8.10612 10.3385 8.14693 10.2801 8.13893 10.1473C8.11412 9.72354 8.05411 8.89772 8.12092 8.12591C8.21255 7.06402 8.55464 6.53788 8.96115 6.07256C9.1564 5.8489 10.0738 4.87944 11.8283 4.87944C13.5828 4.87944 14.5026 5.8449 14.6979 6.06776C15.1048 6.53308 15.4473 7.05922 15.5381 8.12111C15.6049 8.89292 15.5473 9.71914 15.5201 10.1425C15.5109 10.2821 15.5529 10.3337 15.669 10.3337C15.696 10.3333 15.7228 10.3296 15.749 10.3229C15.9666 10.2705 16.3427 10.0764 16.73 9.99241C16.7932 9.97825 16.8577 9.97101 16.9225 9.97081C17.1285 9.97081 17.3226 10.0508 17.4026 10.2589C17.5171 10.5614 17.3626 10.8074 17.0093 11.0539C16.7961 11.2027 16.0275 11.6781 15.8542 11.8385C15.6746 12.0042 15.6982 12.1322 15.719 12.295C15.7362 12.4315 16.1227 14.244 18.5477 15.4159C18.691 15.4875 18.9326 15.6331 18.5065 15.8704Z",fill:"black"}));};var SnapchatIcon=CreateIcon(SnapchatIconSvg);var FigmaIconSvg=function FigmaIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12.3157 12C12.3157 10.1591 13.7295 8.66665 15.4736 8.66665C17.2176 8.66665 18.6315 10.1591 18.6315 12C18.6315 13.8409 17.2176 15.3333 15.4736 15.3333C13.7295 15.3333 12.3157 13.8409 12.3157 12Z",fill:"#1ABCFE"}),/*#__PURE__*/wn.createElement("path",{d:"M6 18.6666C6 16.8257 7.41384 15.3333 9.15789 15.3333H12.3158V18.6666C12.3158 20.5076 10.902 22 9.15789 22C7.41384 22 6 20.5076 6 18.6666Z",fill:"#0ACF83"}),/*#__PURE__*/wn.createElement("path",{d:"M12.3157 2V8.66665H15.4736C17.2176 8.66665 18.6315 7.17428 18.6315 5.33333C18.6315 3.49238 17.2176 2 15.4736 2H12.3157Z",fill:"#FF7262"}),/*#__PURE__*/wn.createElement("path",{d:"M6 5.33333C6 7.17428 7.41384 8.66665 9.15789 8.66665H12.3158V2H9.15789C7.41384 2 6 3.49238 6 5.33333Z",fill:"#F24E1E"}),/*#__PURE__*/wn.createElement("path",{d:"M6 12C6 13.8409 7.41384 15.3333 9.15789 15.3333H12.3158V8.66665H9.15789C7.41384 8.66665 6 10.1591 6 12Z",fill:"#A259FF"}));};var FigmaIcon=CreateIcon(FigmaIconSvg);var SalesforceIconSvg=function SalesforceIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("g",{clipPath:"url(#clip0_1550_2151)"},/*#__PURE__*/wn.createElement("path",{d:"M8.3228 1.52737C8.96783 0.855295 9.86583 0.438458 10.859 0.438458C12.1792 0.438458 13.3311 1.17463 13.9445 2.26751C14.4775 2.02935 15.0675 1.89686 15.6883 1.89686C18.0695 1.89686 20 3.84416 20 6.24615C20 8.64841 18.0695 10.5957 15.6883 10.5957C15.4031 10.5959 15.1186 10.5675 14.839 10.5111C14.2989 11.4746 13.2695 12.1256 12.088 12.1256C11.5935 12.1256 11.1256 12.0114 10.7091 11.8082C10.1615 13.0963 8.88577 13.9994 7.39886 13.9994C5.85043 13.9994 4.53077 13.0196 4.02422 11.6456C3.80286 11.6926 3.57351 11.7171 3.33818 11.7171C1.49459 11.7171 0 10.2071 0 8.34416C0 7.09573 0.671511 6.00568 1.66923 5.4225C1.46382 4.94987 1.34957 4.42821 1.34957 3.87976C1.34957 1.73732 3.08889 0.000579834 5.23419 0.000579834C6.49373 0.000579834 7.61311 0.599439 8.3228 1.52737Z",fill:"#00A1E0"}),/*#__PURE__*/wn.createElement("path",{d:"M2.89685 7.26004C2.88432 7.29281 2.90142 7.29966 2.9054 7.30535C2.943 7.33269 2.9812 7.35237 3.01965 7.37429C3.22364 7.48254 3.41625 7.51416 3.61767 7.51416C4.02792 7.51416 4.28262 7.29594 4.28262 6.94465V6.93782C4.28262 6.61301 3.99517 6.49508 3.72536 6.40989L3.69033 6.3985C3.4869 6.33239 3.31141 6.27544 3.31141 6.14152V6.13442C3.31141 6.01988 3.41397 5.93554 3.57295 5.93554C3.74958 5.93554 3.95927 5.99424 4.09431 6.06887C4.09431 6.06887 4.13391 6.09452 4.14844 6.05606C4.15641 6.03554 4.2248 5.85149 4.23193 5.83155C4.23961 5.80989 4.22594 5.79393 4.21199 5.78539C4.05785 5.69165 3.84474 5.62755 3.62424 5.62755L3.58322 5.62783C3.20772 5.62783 2.94562 5.85462 2.94562 6.17968V6.18653C2.94562 6.52925 3.23479 6.64036 3.50574 6.71786L3.54932 6.73125C3.74676 6.79193 3.91685 6.84407 3.91685 6.9831V6.98995C3.91685 7.11702 3.80632 7.21159 3.62796 7.21159C3.55873 7.21159 3.33793 7.21017 3.09947 7.05944C3.07069 7.04262 3.05389 7.03039 3.03167 7.017C3.01999 7.00959 2.99065 6.99676 2.97783 7.03552L2.89685 7.26004ZM8.90282 7.26004C8.89029 7.29281 8.90738 7.29966 8.91137 7.30535C8.94896 7.33269 8.98716 7.35237 9.0256 7.37429C9.22958 7.48254 9.42222 7.51416 9.62362 7.51416C10.0339 7.51416 10.2886 7.29594 10.2886 6.94465V6.93782C10.2886 6.61301 10.0011 6.49508 9.73131 6.40989L9.69627 6.3985C9.49285 6.33239 9.31733 6.27544 9.31733 6.14152V6.13442C9.31733 6.01988 9.41989 5.93554 9.57887 5.93554C9.75551 5.93554 9.9652 5.99424 10.1003 6.06887C10.1003 6.06887 10.1399 6.09452 10.1544 6.05606C10.1623 6.03554 10.2307 5.85149 10.2379 5.83155C10.2456 5.80989 10.2319 5.79393 10.2179 5.78539C10.0638 5.69165 9.85067 5.62755 9.63016 5.62755L9.58912 5.62783C9.21363 5.62783 8.95153 5.85462 8.95153 6.17968V6.18653C8.95153 6.52925 9.2407 6.64036 9.51165 6.71786L9.55523 6.73125C9.75267 6.79193 9.92306 6.84407 9.92306 6.9831V6.98995C9.92306 7.11702 9.81223 7.21159 9.63387 7.21159C9.56466 7.21159 9.34386 7.21017 9.1054 7.05944C9.07661 7.04262 9.05953 7.03095 9.03789 7.017C9.03047 7.01215 8.99571 6.99876 8.98374 7.03552L8.90282 7.26004ZM13.0029 6.57195C13.0029 6.77053 12.9659 6.92693 12.893 7.03748C12.8209 7.14689 12.7118 7.20016 12.5597 7.20016C12.4072 7.20016 12.2987 7.14717 12.2277 7.03748C12.1559 6.92723 12.1195 6.77053 12.1195 6.57195C12.1195 6.37367 12.1559 6.21754 12.2277 6.10813C12.2987 5.99988 12.4072 5.94717 12.5597 5.94717C12.7118 5.94717 12.8209 5.99988 12.8933 6.10813C12.9659 6.21752 13.0029 6.37365 13.0029 6.57195ZM13.3454 6.20386C13.3118 6.09017 13.2594 5.98989 13.1896 5.90643C13.1198 5.82266 13.0314 5.75544 12.9266 5.70643C12.822 5.65772 12.6984 5.63293 12.5597 5.63293C12.4206 5.63293 12.297 5.65772 12.1924 5.70643C12.0876 5.75544 11.9993 5.82268 11.9292 5.90643C11.8597 5.99019 11.8072 6.09047 11.7733 6.20386C11.74 6.31696 11.7232 6.4406 11.7232 6.57195C11.7232 6.7033 11.74 6.82723 11.7733 6.94004C11.8072 7.05343 11.8594 7.15373 11.9295 7.23748C11.9993 7.32124 12.0879 7.38819 12.1924 7.43576C12.2973 7.48334 12.4206 7.50755 12.5597 7.50755C12.6984 7.50755 12.8218 7.48334 12.9266 7.43576C13.0312 7.38819 13.1198 7.32122 13.1896 7.23748C13.2594 7.15399 13.3118 7.05371 13.3454 6.94004C13.3791 6.82695 13.3959 6.703 13.3959 6.57195C13.3959 6.4409 13.379 6.31696 13.3454 6.20386ZM16.1576 7.14713C16.1462 7.11379 16.114 7.12633 16.114 7.12633C16.0641 7.14543 16.0111 7.16308 15.9547 7.17191C15.8974 7.18072 15.8345 7.18531 15.7669 7.18531C15.6012 7.18531 15.4695 7.13602 15.3752 7.03858C15.2806 6.94114 15.2276 6.7836 15.2282 6.57049C15.2288 6.37648 15.2755 6.23059 15.3596 6.1195C15.443 6.00897 15.5701 5.95225 15.7396 5.95225C15.8809 5.95225 15.9886 5.96849 16.1014 6.00411C16.1014 6.00411 16.1285 6.01578 16.1413 5.98046C16.1712 5.89726 16.1934 5.83772 16.2253 5.74627C16.2345 5.72034 16.2122 5.70923 16.2043 5.70609C16.1598 5.68871 16.055 5.66052 15.9758 5.64855C15.9017 5.63716 15.8151 5.63117 15.7188 5.63117C15.5749 5.63117 15.4467 5.65568 15.337 5.70469C15.2276 5.75339 15.1347 5.82062 15.0613 5.90441C14.9877 5.98817 14.9319 6.08843 14.8946 6.20182C14.8576 6.31492 14.8388 6.43914 14.8388 6.57049C14.8388 6.85454 14.9154 7.08415 15.0667 7.25225C15.2182 7.42092 15.4459 7.50667 15.7428 7.50667C15.9183 7.50667 16.0983 7.47107 16.2277 7.42006C16.2277 7.42006 16.2524 7.40809 16.2416 7.37934L16.1576 7.14713ZM16.7567 6.38172C16.773 6.27147 16.8035 6.17972 16.8505 6.10823C16.9214 5.99968 17.0297 5.94014 17.1818 5.94014C17.334 5.94014 17.4345 5.99996 17.5066 6.10823C17.5545 6.17972 17.5753 6.27548 17.5835 6.38172H16.7567ZM17.9097 6.13926C17.8807 6.02957 17.8086 5.91874 17.7613 5.86803C17.6866 5.78769 17.6137 5.73157 17.5414 5.70022C17.4468 5.65976 17.3334 5.63299 17.2092 5.63299C17.0644 5.63299 16.9331 5.65722 16.8265 5.70735C16.7197 5.7575 16.63 5.82589 16.5596 5.91107C16.4892 5.99596 16.4362 6.0971 16.4026 6.21191C16.3687 6.32617 16.3516 6.45067 16.3516 6.58198C16.3516 6.71562 16.3693 6.84012 16.4043 6.95207C16.4397 7.06491 16.496 7.16433 16.5724 7.24665C16.6485 7.32957 16.7465 7.39454 16.8639 7.4398C16.9804 7.48483 17.122 7.50819 17.2847 7.50789C17.6194 7.50675 17.7958 7.43211 17.8684 7.39193C17.8813 7.38483 17.8935 7.37229 17.8781 7.3364L17.8023 7.12413C17.7909 7.09251 17.7587 7.10419 17.7587 7.10419C17.6758 7.13496 17.5579 7.19023 17.2829 7.18967C17.1032 7.18939 16.9698 7.1364 16.8863 7.05347C16.8006 6.96859 16.7587 6.84378 16.7513 6.66773L17.9106 6.66887C17.9106 6.66887 17.941 6.66831 17.9442 6.63866C17.9453 6.62617 17.9841 6.40052 17.9097 6.13926ZM7.47275 6.38172C7.48926 6.27147 7.51947 6.17972 7.56648 6.10823C7.63741 5.99968 7.74568 5.94014 7.89781 5.94014C8.04994 5.94014 8.15053 5.99996 8.22288 6.10823C8.27044 6.17972 8.29125 6.27548 8.29951 6.38172H7.47275ZM8.62544 6.13926C8.59639 6.02957 8.5246 5.91874 8.47731 5.86803C8.40266 5.78769 8.32972 5.73157 8.25737 5.70022C8.16278 5.65976 8.0494 5.63299 7.92518 5.63299C7.78074 5.63299 7.6491 5.65722 7.54256 5.70735C7.43573 5.7575 7.34598 5.82589 7.27561 5.91107C7.20524 5.99596 7.15225 6.0971 7.11863 6.21191C7.08502 6.32617 7.06764 6.45067 7.06764 6.58198C7.06764 6.71562 7.0853 6.84012 7.12036 6.95207C7.15569 7.06491 7.21211 7.16433 7.28844 7.24665C7.36452 7.32957 7.46252 7.39454 7.5799 7.4398C7.69643 7.48483 7.83801 7.50819 8.0007 7.50789C8.33545 7.50675 8.51181 7.43211 8.58446 7.39193C8.59729 7.38483 8.60952 7.37229 8.59415 7.3364L8.51865 7.12413C8.50696 7.09251 8.47479 7.10419 8.47479 7.10419C8.39189 7.13496 8.27421 7.19023 7.99871 7.18967C7.81923 7.18939 7.6859 7.1364 7.60242 7.05347C7.51665 6.96859 7.47479 6.84378 7.46736 6.66773L8.62662 6.66887C8.62662 6.66887 8.65709 6.66831 8.66023 6.63866C8.66134 6.62617 8.70007 6.40052 8.62544 6.13926ZM4.96702 7.14078C4.92172 7.10459 4.91545 7.09548 4.90007 7.07211C4.87727 7.0365 4.8656 6.98579 4.8656 6.9214C4.8656 6.8194 4.89921 6.74619 4.96902 6.6969C4.96818 6.6972 5.06874 6.61001 5.3052 6.61313C5.47129 6.61542 5.61971 6.63992 5.61971 6.63992V7.16699H5.62C5.62 7.16699 5.47271 7.1986 5.3069 7.20857C5.07101 7.22282 4.96616 7.1405 4.96702 7.14078ZM5.42826 6.32625C5.38126 6.32282 5.32028 6.32082 5.24734 6.32082C5.14792 6.32082 5.05191 6.33335 4.96188 6.35758C4.87129 6.38178 4.7898 6.4197 4.71971 6.46981C4.64973 6.51976 4.59221 6.58518 4.55163 6.66098C4.51061 6.73734 4.4898 6.82737 4.4898 6.92823C4.4898 7.03079 4.50746 7.11996 4.5428 7.19291C4.57813 7.26613 4.62912 7.32709 4.69407 7.37412C4.75845 7.42112 4.83795 7.45558 4.93025 7.47638C5.02114 7.49718 5.12426 7.50771 5.23709 7.50771C5.35589 7.50771 5.47441 7.49804 5.58922 7.47836C5.7029 7.45898 5.8425 7.43077 5.88124 7.42196C5.9084 7.41542 5.93547 7.40848 5.96244 7.40116C5.99123 7.39405 5.98894 7.36326 5.98894 7.36326L5.98836 6.30316C5.98836 6.07067 5.92626 5.8983 5.80404 5.79147C5.68238 5.68493 5.50318 5.63105 5.27157 5.63105C5.18466 5.63105 5.04478 5.64304 4.96102 5.65984C4.96102 5.65984 4.70774 5.70885 4.60346 5.79033C4.60346 5.79033 4.58068 5.80459 4.59321 5.8365L4.67527 6.05702C4.68552 6.08551 4.71317 6.07582 4.71317 6.07582C4.71317 6.07582 4.722 6.07239 4.73227 6.06641C4.95535 5.94505 5.23739 5.94875 5.23739 5.94875C5.36276 5.94875 5.45905 5.97381 5.524 6.02366C5.58724 6.07209 5.61943 6.14531 5.61943 6.29972V6.34873C5.51971 6.3345 5.42826 6.32625 5.42826 6.32625ZM14.7782 5.72893C14.787 5.7027 14.7685 5.69017 14.7608 5.68733C14.7412 5.67964 14.6426 5.65884 14.5665 5.65399C14.4209 5.64517 14.34 5.66967 14.2676 5.70214C14.1959 5.73462 14.1161 5.78703 14.0716 5.84659V5.70557C14.0716 5.68591 14.0577 5.67023 14.0383 5.67023H13.7411C13.7218 5.67023 13.7078 5.68589 13.7078 5.70557V7.43462C13.7078 7.45399 13.7238 7.46995 13.7431 7.46995H14.0477C14.057 7.4699 14.066 7.46615 14.0725 7.45952C14.0791 7.4529 14.0828 7.44394 14.0827 7.43462V6.57081C14.0827 6.45486 14.0956 6.3392 14.1212 6.26655C14.1463 6.19474 14.1805 6.1372 14.2226 6.09588C14.2651 6.05486 14.3132 6.02609 14.3659 6.00985C14.4198 5.99331 14.4793 5.98791 14.5215 5.98791C14.5822 5.98791 14.6488 6.00356 14.6488 6.00356C14.671 6.00613 14.6836 5.99245 14.691 5.97223C14.7109 5.91924 14.7674 5.76054 14.7782 5.72893Z",fill:"white"}),/*#__PURE__*/wn.createElement("path",{d:"M11.9195 4.92756C11.8825 4.91617 11.8489 4.90846 11.805 4.90022C11.7605 4.89225 11.7075 4.88824 11.6474 4.88824C11.4377 4.88824 11.2725 4.9475 11.1566 5.0643C11.0412 5.18056 10.9628 5.35747 10.9235 5.59025L10.9092 5.66858H10.646C10.646 5.66858 10.6141 5.66744 10.6072 5.70222L10.5642 5.94352C10.5611 5.96632 10.5711 5.98084 10.6018 5.98084H10.858L10.5981 7.43155C10.5779 7.54836 10.5545 7.64438 10.5286 7.71729C10.5032 7.78911 10.4785 7.84294 10.4477 7.88226C10.4181 7.91988 10.3901 7.94778 10.3417 7.96402C10.3018 7.97741 10.2557 7.98368 10.2052 7.98368C10.1773 7.98368 10.14 7.9791 10.1124 7.97341C10.085 7.96798 10.0705 7.96202 10.0497 7.95317C10.0497 7.95317 10.0198 7.9418 10.0078 7.97171C9.99839 7.99649 9.93003 8.18422 9.92176 8.20732C9.91379 8.23039 9.92518 8.24834 9.9397 8.25375C9.97389 8.26572 9.99924 8.27369 10.0457 8.2848C10.1101 8.29992 10.1645 8.30076 10.2155 8.30076C10.322 8.30076 10.4195 8.28566 10.5001 8.25661C10.581 8.22726 10.6516 8.17625 10.7143 8.10732C10.7819 8.03267 10.8243 7.95461 10.8648 7.84778C10.9049 7.74236 10.9394 7.61131 10.9668 7.45861L11.228 5.98084H11.6098C11.6098 5.98084 11.642 5.98198 11.6485 5.94694L11.6918 5.70592C11.6947 5.68286 11.685 5.66861 11.6539 5.66861H11.2833C11.2853 5.66036 11.3021 5.52985 11.3445 5.40708C11.3628 5.35495 11.397 5.31249 11.4257 5.28342C11.4543 5.25493 11.487 5.23471 11.5229 5.22302C11.5597 5.21105 11.6016 5.20536 11.6474 5.20536C11.6822 5.20536 11.7166 5.20935 11.7426 5.21475C11.7785 5.22246 11.7924 5.22644 11.8018 5.22931C11.8397 5.2407 11.8448 5.22959 11.8523 5.21137L11.9409 4.96806C11.95 4.9418 11.9275 4.93069 11.9195 4.92756ZM6.74074 7.43469C6.74074 7.45407 6.72678 7.46975 6.7074 7.46975H6.4C6.38062 7.46975 6.36694 7.45407 6.36694 7.43469V4.96062C6.36694 4.94126 6.38062 4.92558 6.4 4.92558H6.7074C6.72678 4.92558 6.74074 4.94126 6.74074 4.96062V7.43469Z",fill:"white"})));};var SalesforceIcon=CreateIcon(SalesforceIconSvg);var YahooLogoIconSvg=function YahooLogoIconSvg(){return/*#__PURE__*/wn.createElement("svg",{xmlns:"http://www.w3.org/2000/svg","aria-label":"Yahoo!",role:"img",viewBox:"0 0 512 512",fill:"#ffffff"},/*#__PURE__*/wn.createElement("rect",{width:"512",height:"512",rx:"15%",fill:"#5f01d1"}),/*#__PURE__*/wn.createElement("g",{fill:"#ffffff"},/*#__PURE__*/wn.createElement("path",{d:"M203 404h-62l25-59-69-165h63l37 95 37-95h62m58 76h-69l62-148h69"}),/*#__PURE__*/wn.createElement("circle",{cx:"303",cy:"308",r:"38"})));};var YahooIcon=CreateIcon(YahooLogoIconSvg);var providerInfo=(_providerInfo={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_providerInfo,OAuthProviders.Google,{messageDescriptor:{id:'oauth.continueWithGoogle',message:"Continue with Google"},icon:/*#__PURE__*/wn.createElement(GoogleIcon,null)}),OAuthProviders.Microsoft,{messageDescriptor:{id:'oauth.continueWithMicrosoft',message:"Continue with Microsoft"},icon:/*#__PURE__*/wn.createElement(MicrosoftIcon,null)}),OAuthProviders.Apple,{messageDescriptor:{id:'oauth.continueWithApple',message:"Continue with Apple"},icon:/*#__PURE__*/wn.createElement(AppleIcon,null)}),OAuthProviders.Github,{messageDescriptor:{id:'oauth.continueWithGitHub',message:"Continue with GitHub"},icon:/*#__PURE__*/wn.createElement(GithubIcon,null)}),OAuthProviders.GitLab,{messageDescriptor:{id:'oauth.continueWithGitLab',message:"Continue with GitLab"},icon:/*#__PURE__*/wn.createElement(GitLabIcon,null)}),OAuthProviders.Facebook,{messageDescriptor:{id:'oauth.continueWithFacebook',message:"Continue with Facebook"},icon:/*#__PURE__*/wn.createElement(FacebookIcon,null)}),OAuthProviders.Discord,{messageDescriptor:{id:'oauth.continueWithDiscord',message:"Continue with Discord"},icon:/*#__PURE__*/wn.createElement(DiscordIcon,null)}),OAuthProviders.Salesforce,{messageDescriptor:{id:'oauth.continueWithSalesforce',message:"Continue with Salesforce"},icon:/*#__PURE__*/wn.createElement(SalesforceIcon,null)}),OAuthProviders.Slack,{messageDescriptor:{id:'oauth.continueWithSlack',message:"Continue with Slack"},icon:/*#__PURE__*/wn.createElement(SlackIcon,null)}),OAuthProviders.Amazon,{messageDescriptor:{id:'oauth.continueWithAmazon',message:"Continue with Amazon"},icon:/*#__PURE__*/wn.createElement(AmazonIcon,null)}),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_providerInfo,OAuthProviders.Bitbucket,{messageDescriptor:{id:'oauth.continueWithBitbucket',message:"Continue with Bitbucket"},icon:/*#__PURE__*/wn.createElement(BitbucketIcon,null)}),OAuthProviders.LinkedIn,{messageDescriptor:{id:'oauth.continueWithLinkedIn',message:"Continue with LinkedIn"},icon:/*#__PURE__*/wn.createElement(LinkedInIcon,null)}),OAuthProviders.Coinbase,{messageDescriptor:{id:'oauth.continueWithCoinbase',message:"Continue with Coinbase"},icon:/*#__PURE__*/wn.createElement(CoinbaseIcon,null)}),OAuthProviders.Twitch,{messageDescriptor:{id:'oauth.continueWithTwitch',message:"Continue with Twitch"},icon:/*#__PURE__*/wn.createElement(TwitchIcon,null)}),OAuthProviders.Twitter,{messageDescriptor:{id:'oauth.continueWithTwitter',message:"Continue with Twitter"},icon:/*#__PURE__*/wn.createElement(TwitterIcon,null)}),OAuthProviders.TikTok,{messageDescriptor:{id:'oauth.continueWithTikTok',message:"Continue with TikTok"},icon:/*#__PURE__*/wn.createElement(TikTokIcon,null)}),OAuthProviders.Snapchat,{messageDescriptor:{id:'oauth.continueWithSnapchat',message:"Continue with Snapchat"},icon:/*#__PURE__*/wn.createElement(SnapchatIcon,null)}),OAuthProviders.Figma,{messageDescriptor:{id:'oauth.continueWithFigma',message:"Continue with Figma"},icon:/*#__PURE__*/wn.createElement(FigmaIcon,null)}),OAuthProviders.Yahoo,{messageDescriptor:{id:'oauth.continueWithYahoo',message:"Continue with Yahoo"},icon:/*#__PURE__*/wn.createElement(YahooIcon,null)}));var defaultProviderInfo={messageDescriptor:null,icon:/*#__PURE__*/wn.createElement(wn.Fragment,null)};var OAuthButtons=function OAuthButtons(){var _useLingui7=useLingui(),_t=_useLingui7._;var config=useConfig();var _useLastUsedOAuth3=useLastUsedOAuth(),_useLastUsedOAuth4=_slicedToArray2(_useLastUsedOAuth3,2),lastUsedOAuth=_useLastUsedOAuth4[0],setLastUsedOAuth=_useLastUsedOAuth4[1];if(!config.oauthOptions)return/*#__PURE__*/wn.createElement(wn.Fragment,null);var _config$oauthOptions=config.oauthOptions,providers=_config$oauthOptions.providers,loginRedirectURL=_config$oauthOptions.loginRedirectURL,signupRedirectURL=_config$oauthOptions.signupRedirectURL;var _arrayUtils$moveToFro=arrayUtils.moveToFront(providers,function(provider){return provider.type===lastUsedOAuth;}),_arrayUtils$moveToFro2=_slicedToArray2(_arrayUtils$moveToFro,2),reorderedProviders=_arrayUtils$moveToFro2[0],foundLastUsed=_arrayUtils$moveToFro2[1];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8,className:"oauth-buttons"},reorderedProviders.map(function(provider,index){var _a;var _ref71=(_a=providerInfo[provider.type])!==null&&_a!==void 0?_a:defaultProviderInfo,icon=_ref71.icon,messageDescriptor=_ref71.messageDescriptor;var providerProps={customScopes:provider.custom_scopes,providerParams:provider.provider_params};if(provider.one_tap){return/*#__PURE__*/wn.createElement(GoogleOneTap,Object.assign({position:provider.position,key:"oauth-".concat(provider.type)},providerProps,{cancelOnTapOutside:provider.cancel_on_tap_outside}));}var button=/*#__PURE__*/wn.createElement(OAuthButton,Object.assign({key:"oauth-".concat(provider.type),providerType:provider.type,icon:icon,label:messageDescriptor?_t(messageDescriptor):'',loginRedirectUrl:loginRedirectURL,signupRedirectUrl:signupRedirectURL,onSuccess:function onSuccess(){return setLastUsedOAuth(provider.type);}},providerProps));if(foundLastUsed&&index===0){return/*#__PURE__*/wn.createElement("div",{key:"oauth-".concat(provider.type)},/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary",align:"right"},_t({id:'provider.lastUsed',message:"Last used"})),button);}return button;}));};var useLayoutEffect$1=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?y$2:function(){};var r=compat_module["useId".toString()]||function(){};var n$3=0;function useId(o){var _h$11=h$5(r()),_h$12=_slicedToArray2(_h$11,2),u=_h$12[0],i=_h$12[1];return useLayoutEffect$1(function(){i(function(t){return null!=t?t:String(n$3++);});},[o]),u?"radix-".concat(u):"";}function useCallbackRef(r){var t=_$2(r);return p$5(function(){t.current=r;}),F$4(function(){return function(){var _r;var r;for(var _len7=arguments.length,e=new Array(_len7),_key7=0;_key7<_len7;_key7++){e[_key7]=arguments[_key7];}return null===(r=t.current)||void 0===r?void 0:(_r=r).call.apply(_r,[t].concat(e));};},[]);}function useControllableState(_ref72){var o=_ref72.prop,r=_ref72.defaultProp,_ref72$onChange=_ref72.onChange,n=_ref72$onChange===void 0?function(){}:_ref72$onChange;var _ref73=function(_ref75){var o=_ref75.defaultProp,r=_ref75.onChange;var n=h$5(o),_n2=_slicedToArray2(n,1),a=_n2[0],u=_$2(a),c=useCallbackRef(r);return p$5(function(){u.current!==a&&(c(a),u.current=a);},[a,u,c]),n;}({defaultProp:r,onChange:n}),_ref74=_slicedToArray2(_ref73,2),a=_ref74[0],u=_ref74[1],c=void 0!==o,f=c?o:a,l=useCallbackRef(n);return[f,T$3(function(e){if(c){var _t13=e,_r2="function"==typeof e?_t13(o):e;_r2!==o&&l(_r2);}else u(e);},[c,o,u,l])];}function composeRefs(){for(var _len8=arguments.length,o=new Array(_len8),_key8=0;_key8<_len8;_key8++){o[_key8]=arguments[_key8];}return function(e){return o.forEach(function(o){return function(o,e){"function"==typeof o?o(e):null!=o&&(o.current=e);}(o,e);});};}function useComposedRefs(){for(var _len9=arguments.length,e=new Array(_len9),_key9=0;_key9<_len9;_key9++){e[_key9]=arguments[_key9];}return T$3(composeRefs.apply(void 0,e),e);}function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r]);}return n;},_extends.apply(null,arguments);}var Slot=/*#__PURE__*/N$1(function(e,o){var a=e.children,s=_objectWithoutProperties(e,_excluded2);return A$3.toArray(a).some(l$3)?/*#__PURE__*/y$3(g$7,null,A$3.map(a,function(e){return l$3(e)?/*#__PURE__*/y$3(n$2,_extends({},s,{ref:o}),e.props.children):e;})):/*#__PURE__*/y$3(n$2,_extends({},s,{ref:o}),a);});Slot.displayName="Slot";var n$2=/*#__PURE__*/N$1(function(r,n){var l=r.children,a=_objectWithoutProperties(r,_excluded3);return/*#__PURE__*/fn(l)?/*#__PURE__*/sn(l,_objectSpread(_objectSpread({},o$1(a,l.props)),{},{ref:composeRefs(n,l.ref)})):A$3.count(l)>1?A$3.only(null):null;});n$2.displayName="SlotClone";var Slottable=function Slottable(_ref76){var e=_ref76.children;return/*#__PURE__*/y$3(g$7,null,e);};function l$3(e){return/*#__PURE__*/fn(e)&&e.type===Slottable;}function o$1(e,t){var r=_objectSpread({},t);var _loop2=function _loop2(){var l=e[_n3],o=t[_n3];/^on[A-Z]/.test(_n3)?r[_n3]=function(){null==o||o.apply(void 0,arguments),null==l||l.apply(void 0,arguments);}:"style"===_n3?r[_n3]=_objectSpread(_objectSpread({},l),o):"className"===_n3&&(r[_n3]=[l,o].filter(Boolean).join(" "));};for(var _n3 in t){_loop2();}return _objectSpread(_objectSpread({},e),r);}var Primitive=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"].reduce(function(o,i){return _objectSpread(_objectSpread({},o),{},_defineProperty({},i,/*#__PURE__*/N$1(function(o,m){var a=o.asChild,s=_objectWithoutProperties(o,_excluded4),n=a?Slot:i;return p$5(function(){window[Symbol["for"]("radix-ui")]=!0;},[]),/*#__PURE__*/y$3(n,_extends({},s,{ref:m}));})));},{});function createContextScope(n){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var r=[];var c=function c(){var t=r.map(function(t){return/*#__PURE__*/F$5(t);});return function(o){var r=(null==o?void 0:o[n])||t;return F$4(function(){return _defineProperty({},"__scope".concat(n),_objectSpread(_objectSpread({},o),{},_defineProperty({},n,r)));},[o,r]);};};return c.scopeName=n,[function(t,o){var c=/*#__PURE__*/F$5(o),u=r.length;function s(t){var o=t.scope,r=t.children,s=_objectWithoutProperties(t,_excluded5),i=(null==o?void 0:o[n][u])||c,a=F$4(function(){return s;},Object.values(s));return/*#__PURE__*/y$3(i.Provider,{value:a},r);}return r=[].concat(_toConsumableArray2(r),[o]),s.displayName=t+"Provider",[s,function(r,s){var i=(null==s?void 0:s[n][u])||c,a=q$4(i);if(a)return a;if(void 0!==o)return o;throw new Error("`".concat(r,"` must be used within `").concat(t,"`"));}];},t$1.apply(void 0,[c].concat(_toConsumableArray2(o)))];}function t$1(){for(var _len0=arguments.length,t=new Array(_len0),_key0=0;_key0<_len0;_key0++){t[_key0]=arguments[_key0];}var n=t[0];if(1===t.length)return n;var o=function o(){var o=t.map(function(e){return{useScope:e(),scopeName:e.scopeName};});return function(t){var r=o.reduce(function(e,_ref78){var n=_ref78.useScope,o=_ref78.scopeName;return _objectSpread(_objectSpread({},e),n(t)["__scope".concat(o)]);},{});return F$4(function(){return _defineProperty({},"__scope".concat(n.scopeName),r);},[r]);};};return o.scopeName=n.scopeName,o;}function createCollection(c){var n=c+"CollectionProvider",_createContextScope=createContextScope(n),_createContextScope2=_slicedToArray2(_createContextScope,2),l=_createContextScope2[0],i=_createContextScope2[1],_l=l(n,{collectionRef:{current:null},itemMap:new Map()}),_l2=_slicedToArray2(_l,2),f=_l2[0],a=_l2[1],u=function u(e){var r=e.scope,t=e.children,c=wn.useRef(null),n=wn.useRef(new Map()).current;return/*#__PURE__*/wn.createElement(f,{scope:r,itemMap:n,collectionRef:c},t);},m=c+"CollectionSlot",s=/*#__PURE__*/wn.forwardRef(function(t,c){var n=t.scope,l=t.children,i=a(m,n),f=useComposedRefs(c,i.collectionRef);return/*#__PURE__*/wn.createElement(Slot,{ref:f},l);}),p=c+"CollectionItemSlot",d="data-radix-collection-item",R=/*#__PURE__*/wn.forwardRef(function(t,c){var n=t.scope,l=t.children,i=_objectWithoutProperties(t,_excluded6),f=wn.useRef(null),u=useComposedRefs(c,f),m=a(p,n);return wn.useEffect(function(){return m.itemMap.set(f,_objectSpread({ref:f},i)),function(){m.itemMap["delete"](f);};}),/*#__PURE__*/wn.createElement(Slot,_defineProperty(_defineProperty({},d,""),"ref",u),l);});return[{Provider:u,Slot:s,ItemSlot:R},function(e){var r=a(c+"CollectionConsumer",e);return wn.useCallback(function(){var e=r.collectionRef.current;if(!e)return[];var t=Array.from(e.querySelectorAll("[".concat(d,"]")));return Array.from(r.itemMap.values()).sort(function(e,r){return t.indexOf(e.ref.current)-t.indexOf(r.ref.current);});},[r.collectionRef,r.itemMap]);},i];}function composeEventHandlers(e,n){var _ref80=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref80$checkForDefaul=_ref80.checkForDefaultPrevented,t=_ref80$checkForDefaul===void 0?!0:_ref80$checkForDefaul;return function(r){if(null==e||e(r),!1===t||!r.defaultPrevented)return null==n?void 0:n(r);};}var f$2={bubbles:!1,cancelable:!0},_createCollection=createCollection("RovingFocusGroup"),_createCollection2=_slicedToArray2(_createCollection,3),p$2=_createCollection2[0],l$2=_createCollection2[1],m$2=_createCollection2[2],_createContextScope3=createContextScope("RovingFocusGroup",[m$2]),_createContextScope4=_slicedToArray2(_createContextScope3,2),d$2=_createContextScope4[0],v$1=_createContextScope4[1];var _d$=d$2("RovingFocusGroup"),_d$2=_slicedToArray2(_d$,2),g$1=_d$2[0],F$1=_d$2[1];var RovingFocusGroup=/*#__PURE__*/N$1(function(e,o){return/*#__PURE__*/y$3(p$2.Provider,{scope:e.__scopeRovingFocusGroup},/*#__PURE__*/y$3(p$2.Slot,{scope:e.__scopeRovingFocusGroup},/*#__PURE__*/y$3(w$2,_extends({},e,{ref:o}))));});var w$2=/*#__PURE__*/N$1(function(t,n){var c=t.__scopeRovingFocusGroup,p=t.orientation,_t$dir=t.dir,m=_t$dir===void 0?"ltr":_t$dir,_t$loop=t.loop,d=_t$loop===void 0?!1:_t$loop,v=t.currentTabStopId,F=t.defaultCurrentTabStopId,w=t.onCurrentTabStopIdChange,b=t.onEntryFocus,x=_objectWithoutProperties(t,_excluded7),E=_$2(null),I=useComposedRefs(n,E),_useControllableState=useControllableState({prop:v,defaultProp:F,onChange:w}),_useControllableState2=_slicedToArray2(_useControllableState,2),_useControllableState3=_useControllableState2[0],G=_useControllableState3===void 0?null:_useControllableState3,h=_useControllableState2[1],_h$13=h$5(!1),_h$14=_slicedToArray2(_h$13,2),T=_h$14[0],A=_h$14[1],y=useCallbackRef(b),D=l$2(c),S=_$2(!1);return p$5(function(){var e=E.current;if(e)return e.addEventListener("rovingFocusGroup.onEntryFocus",y),function(){return e.removeEventListener("rovingFocusGroup.onEntryFocus",y);};},[y]),/*#__PURE__*/y$3(g$1,{scope:c,orientation:p,dir:m,loop:d,currentTabStopId:G,onItemFocus:T$3(function(e){return h(e);},[h]),onItemShiftTab:T$3(function(){return A(!0);},[])},/*#__PURE__*/y$3(Primitive.div,_extends({tabIndex:T?-1:0,"data-orientation":p},x,{ref:I,style:_objectSpread({outline:"none"},t.style),onMouseDown:composeEventHandlers(t.onMouseDown,function(){S.current=!0;}),onFocus:composeEventHandlers(t.onFocus,function(e){var o=!S.current;if(e.target===e.currentTarget&&o&&!T){var _o=new Event("rovingFocusGroup.onEntryFocus",f$2);if(e.currentTarget.dispatchEvent(_o),!_o.defaultPrevented){var _e2=D().filter(function(e){return e.focusable;});R([_e2.find(function(e){return e.active;}),_e2.find(function(e){return e.id===G;})].concat(_toConsumableArray2(_e2)).filter(Boolean).map(function(e){return e.ref.current;}));}}S.current=!1;}),onBlur:composeEventHandlers(t.onBlur,function(){return A(!1);})})));});var RovingFocusGroupItem=/*#__PURE__*/N$1(function(e,o){var n=e.__scopeRovingFocusGroup,_e$focusable=e.focusable,i=_e$focusable===void 0?!0:_e$focusable,_e$active=e.active,c=_e$active===void 0?!1:_e$active,f=_objectWithoutProperties(e,_excluded8),m=useId(),d=F$1("RovingFocusGroupItem",n),v=d.currentTabStopId===m,g=l$2(n);return/*#__PURE__*/y$3(p$2.ItemSlot,{scope:n,id:m,focusable:i,active:c},/*#__PURE__*/y$3(Primitive.span,_extends({tabIndex:v?0:-1,"data-orientation":d.orientation},f,{ref:o,onMouseDown:composeEventHandlers(e.onMouseDown,function(e){i?d.onItemFocus(m):e.preventDefault();}),onFocus:composeEventHandlers(e.onFocus,function(){return d.onItemFocus(m);}),onKeyDown:composeEventHandlers(e.onKeyDown,function(e){if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;var o=function(e,o,r){var t=function(e,o){return"rtl"!==o?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e;}(e.key,r);return"vertical"===o&&["ArrowLeft","ArrowRight"].includes(t)||"horizontal"===o&&["ArrowUp","ArrowDown"].includes(t)?void 0:b$2[t];}(e,d.orientation,d.dir);if(void 0!==o){e.preventDefault();var _n4=g().filter(function(e){return e.focusable;}).map(function(e){return e.ref.current;});if("last"===o)_n4.reverse();else if("prev"===o||"next"===o){"prev"===o&&_n4.reverse();var _i3=_n4.indexOf(e.currentTarget);_n4=d.loop?(t=_i3+1,(r=_n4).map(function(e,o){return r[(t+o)%r.length];})):_n4.slice(_i3+1);}setTimeout(function(){return R(_n4);});}var r,t;})})));});var b$2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R(e){var o=document.activeElement;var _iterator8=_createForOfIteratorHelper2(e),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _r3=_step8.value;if(_r3===o)return;if(_r3.focus(),document.activeElement!==o)return;}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}var Root$1=RovingFocusGroup;var Item$1=RovingFocusGroupItem;var _createContextScope5=createContextScope("Tabs",[v$1]),_createContextScope6=_slicedToArray2(_createContextScope5,2),d$1=_createContextScope6[0],l$1=_createContextScope6[1];var u$2=v$1(),_d$3=d$1("Tabs"),_d$4=_slicedToArray2(_d$3,2),b$1=_d$4[0],p$1=_d$4[1];var Tabs=/*#__PURE__*/N$1(function(t,o){var n=t.__scopeTabs,i=t.value,d=t.onValueChange,l=t.defaultValue,_t$orientation=t.orientation,u=_t$orientation===void 0?"horizontal":_t$orientation,_t$dir2=t.dir,p=_t$dir2===void 0?"ltr":_t$dir2,_t$activationMode=t.activationMode,m=_t$activationMode===void 0?"automatic":_t$activationMode,f=_objectWithoutProperties(t,_excluded9),_useControllableState4=useControllableState({prop:i,onChange:d,defaultProp:l}),_useControllableState5=_slicedToArray2(_useControllableState4,2),v=_useControllableState5[0],T=_useControllableState5[1];return/*#__PURE__*/y$3(b$1,{scope:n,baseId:useId(),value:v,onValueChange:T,orientation:u,dir:p,activationMode:m},/*#__PURE__*/y$3(Primitive.div,_extends({"data-orientation":u},f,{ref:o})));});var TabsList=/*#__PURE__*/N$1(function(e,o){var r=e.__scopeTabs,_e$loop=e.loop,n=_e$loop===void 0?!0:_e$loop,i=_objectWithoutProperties(e,_excluded0),d=p$1("TabsList",r),l=u$2(r);return/*#__PURE__*/y$3(Root$1,_extends({asChild:!0},l,{orientation:d.orientation,dir:d.dir,loop:n}),/*#__PURE__*/y$3(Primitive.div,_extends({role:"tablist","aria-orientation":d.orientation,dir:d.dir},i,{ref:o})));});var TabsTrigger=/*#__PURE__*/N$1(function(e,o){var r=e.__scopeTabs,n=e.value,_e$disabled=e.disabled,d=_e$disabled===void 0?!1:_e$disabled,l=_objectWithoutProperties(e,_excluded1),b=p$1("TabsTrigger",r),v=u$2(r),T=m$1(b.baseId,n),x=f$1(b.baseId,n),g=n===b.value;return/*#__PURE__*/y$3(Item$1,_extends({asChild:!0},v,{focusable:!d,active:g}),/*#__PURE__*/y$3(Primitive.button,_extends({type:"button",role:"tab","aria-selected":g,"aria-controls":x,"data-state":g?"active":"inactive","data-disabled":d?"":void 0,disabled:d,id:T},l,{ref:o,onMouseDown:composeEventHandlers(e.onMouseDown,function(e){d||0!==e.button||!1!==e.ctrlKey?e.preventDefault():b.onValueChange(n);}),onKeyDown:composeEventHandlers(e.onKeyDown,function(e){[" ","Enter"].includes(e.key)&&b.onValueChange(n);}),onFocus:composeEventHandlers(e.onFocus,function(){var e="manual"!==b.activationMode;g||d||!e||b.onValueChange(n);})})));});var TabsContent=/*#__PURE__*/N$1(function(e,t){var o=e.__scopeTabs,r=e.value,n=e.children,i=_objectWithoutProperties(e,_excluded10),d=p$1("TabsContent",o),l=m$1(d.baseId,r),u=f$1(d.baseId,r),b=r===d.value;return/*#__PURE__*/y$3(Primitive.div,_extends({"data-state":b?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:u,tabIndex:0},i,{ref:t}),b&&n);});function m$1(e,t){return"".concat(e,"-trigger-").concat(t);}function f$1(e,t){return"".concat(e,"-content-").concat(t);}var Root=Tabs;var List=TabsList;var Trigger=TabsTrigger;var Content=TabsContent;var passwordManagerDisableAutofillProps={'data-1p-ignore':true};var Select=He.select(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n background-color: ",";\n border: 1px solid ",";\n border-radius: ",";\n height: 47px;\n box-sizing: border-box;\n padding: 0 8px;\n color: ",";\n font-family: ",";\n width: 80px;\n font-size: 18px;\n"])),function(props){return props.theme.inputs.backgroundColor;},function(props){return props.theme.inputs.borderColor;},function(props){return props.theme.inputs.borderRadius;},function(props){return props.theme.inputs.textColor;},function(props){return props.theme.typography.fontFamily;});var CountrySelector=function CountrySelector(_ref77){var country=_ref77.country,setCountry=_ref77.setCountry;var _useLingui8=useLingui(),_t=_useLingui8._;var countryFormatter=new Intl.DisplayNames(['en'],{type:'region'});return/*#__PURE__*/wn.createElement(Select,{"data-testid":"select-test-id",name:"country-select","aria-label":_t({id:'formField.countryCode.label',message:"Country code"}),value:country,onChange:function onChange(e){setCountry(e.target.value);}},Object.entries(COUNTRIES_LIST).map(function(_ref79){var _ref81=_slicedToArray2(_ref79,2),countryCode=_ref81[0],countryNumber=_ref81[1];return/*#__PURE__*/wn.createElement("option",{key:countryCode,value:countryCode},countryCode!==country?"+".concat(countryNumber," ").concat(countryFormatter.of(countryCode)):"+".concat(countryNumber));}));};var Input=He.input(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["\n background-color: ",";\n height: 47px;\n padding: 0 8px;\n box-sizing: border-box;\n border: 1px solid ",";\n border-radius: ",";\n color: ",";\n font-family: ",";\n font-size: 18px;\n\n &::placeholder {\n color: ",";\n }\n\n &:disabled {\n border: 1px solid ",";\n color: ",";\n background-color: ",";\n }\n"])),function(props){return props.theme.inputs.backgroundColor;},function(props){return props.theme.inputs.borderColor;},function(props){return props.theme.inputs.borderRadius;},function(props){return props.theme.inputs.textColor;},function(props){return props.theme.typography.fontFamily;},function(props){return props.theme.inputs.placeholderColor;},function(props){return props.theme.colors.disabledText;},function(props){return props.theme.colors.disabledText;},function(props){return props.theme.colors.disabled;});var formatNumber=function formatNumber(_ref82){var parsePhoneNumber=_ref82.parsePhoneNumber,phoneNumber=_ref82.phoneNumber,country=_ref82.country;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee80(){var parsedPhoneNumber,_t14;return _regenerator2().w(function(_context80){while(1)switch(_context80.p=_context80.n){case 0:_context80.p=0;_context80.n=1;return Promise.race([parsePhoneNumber(phoneNumber,country),new Promise(function(done){return setTimeout(function(){return done(undefined);},10000);})]);case 1:parsedPhoneNumber=_context80.v;if(parsedPhoneNumber){_context80.n=2;break;}return _context80.a(2,phoneNumber);case 2:return _context80.a(2,parsedPhoneNumber.national);case 3:_context80.p=3;_t14=_context80.v;return _context80.a(2,phoneNumber);}},_callee80,null,[[0,3]]);}));};var formatNumberToIncludeCountryCode=function formatNumberToIncludeCountryCode(_ref83){var parsePhoneNumber=_ref83.parsePhoneNumber,phoneNumber=_ref83.phoneNumber,country=_ref83.country;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee81(){var code,fallbackNumber,fallback,parsedPhoneNumber,_t15;return _regenerator2().w(function(_context81){while(1)switch(_context81.p=_context81.n){case 0:code=COUNTRIES_LIST[country];fallbackNumber="+".concat(code).concat(phoneNumber);fallback={isValid:true,number:fallbackNumber};_context81.p=1;_context81.n=2;return Promise.race([parsePhoneNumber(phoneNumber,country),new Promise(function(done){return setTimeout(function(){return done(undefined);},2000);})]);case 2:parsedPhoneNumber=_context81.v;if(parsedPhoneNumber){_context81.n=3;break;}return _context81.a(2,fallback);case 3:return _context81.a(2,parsedPhoneNumber);case 4:_context81.p=4;_t15=_context81.v;return _context81.a(2,fallback);}},_callee81,null,[[1,4]]);}));};var PhoneStyledInput=He(Input)(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n flex-grow: 1;\n min-width: 100px;\n"])));var PhoneInput=function PhoneInput(_a){var phone=_a.phone,setPhone=_a.setPhone,country=_a.country,setCountry=_a.setCountry,parsePhoneNumber=_a.parsePhoneNumber,hasPasskeys=_a.hasPasskeys,additionalProps=__rest(_a,["phone","setPhone","country","setCountry","parsePhoneNumber","hasPasskeys"]);return/*#__PURE__*/wn.createElement(Flex,{direction:"row",wrap:"nowrap",justifyContent:"flex-start",alignContent:"stretch",alignItems:"center",gap:8},/*#__PURE__*/wn.createElement(CountrySelector,{country:country,setCountry:setCountry}),/*#__PURE__*/wn.createElement(PhoneStyledInput,Object.assign({name:"phoneNumber",placeholder:"(123) 456-7890",id:"phone-input",autoComplete:hasPasskeys?'username webauthn':undefined,value:phone,type:"text",onChange:function onChange(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee82(){var userInput,national;return _regenerator2().w(function(_context82){while(1)switch(_context82.n){case 0:userInput=e.target.value;_context82.n=1;return formatNumber({parsePhoneNumber:parsePhoneNumber,phoneNumber:userInput,country:country});case 1:national=_context82.v;if(!(userInput!==e.target.value)){_context82.n=2;break;}return _context82.a(2);case 2:setPhone(national);case 3:return _context82.a(2);}},_callee82);}));},required:true},hasPasskeys?passwordManagerDisableAutofillProps:{},additionalProps)));};var EmailInput=function EmailInput(_a){var email=_a.email,setEmail=_a.setEmail,_a$disableInput=_a.disableInput,disableInput=_a$disableInput===void 0?false:_a$disableInput,_a$hasPasskeys=_a.hasPasskeys,hasPasskeys=_a$hasPasskeys===void 0?false:_a$hasPasskeys,additionalProps=__rest(_a,["email","setEmail","disableInput","hasPasskeys"]);var _useLingui9=useLingui(),_t=_useLingui9._;return/*#__PURE__*/wn.createElement(Input,Object.assign({placeholder:_t({id:'formField.email.placeholder',message:"example@email.com"}),name:"email",type:"email",autoComplete:hasPasskeys?'username webauthn':'email',disabled:disableInput,id:"email-input",value:email,onChange:function onChange(e){return setEmail(e.target.value);},required:true},hasPasskeys?passwordManagerDisableAutofillProps:{},additionalProps));};var LoadingButton=function LoadingButton(_a){var children=_a.children,isLoading=_a.isLoading,buttonProps=__rest(_a,["children","isLoading"]);return/*#__PURE__*/wn.createElement(Button,Object.assign({},buttonProps),isLoading?(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center"},/*#__PURE__*/wn.createElement(CircularProgress,{size:18,thickness:1,"data-testid":"loading-icon"}))):children);};var SubmitButton=function SubmitButton(_ref84){var isSubmitting=_ref84.isSubmitting,disabled=_ref84.disabled,text=_ref84.text,variant=_ref84.variant;var buttonDisabled=isSubmitting||disabled;return/*#__PURE__*/wn.createElement(LoadingButton,{isLoading:isSubmitting,type:"submit",disabled:buttonDisabled,variant:variant},text);};var DASHBOARD_REGEX=/https:\/\/stytch\.com\/[#a-zA-Z0-9/-]+/g;var mapURLsToLinks=function mapURLsToLinks(str){var nonLinkChunks=str.split(DASHBOARD_REGEX);var linkChunks=Array.from(str.matchAll(DASHBOARD_REGEX)).map(function(el){return el[0];});var chunkResults=[];while(nonLinkChunks.length||linkChunks.length){if(nonLinkChunks.length){chunkResults.push(nonLinkChunks.shift());}if(linkChunks.length){var chunk=linkChunks.shift();chunkResults.push(/*#__PURE__*/wn.createElement("a",{key:chunk+'__'+String(linkChunks.length),href:chunk,target:"_blank",rel:"noreferrer"},chunk));}}return chunkResults;};var ErrorText=function ErrorText(_ref85){var errorMessage=_ref85.errorMessage,id=_ref85.id;var tokens=F$4(function(){return mapURLsToLinks(errorMessage);},[errorMessage]);return/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"error",id:id},tokens);};var extractErrorType=function extractErrorType(error){if(error&&_typeof2(error)==='object'){if('error_type'in error&&typeof error.error_type==='string'){return error.error_type;}}};var errorMessages={invalid_email:{id:'error.invalidEmail',message:"Email format is invalid."},invalid_phone_number:{id:'error.invalidPhoneNumber',message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."},unsubscribed_phone_number:{id:'error.unsubscribedPhoneNumber',message:"Phone number is unsubscribed. User has unsubscribed. Resubscribe by texting 'START' before messages can be sent."},inactive_email:{id:'error.inactiveEmail',message:"The email address is marked as inactive. Please try another email address, or contact your admin if you think this is a mistake."},unauthorized_credentials:{id:'error.unauthorizedCredentials',message:"Unauthorized credentials."},user_unauthenticated:{id:'error.userUnauthenticated',message:"Must have an active session to call this method. Have you logged in yet?"},email_not_found:{id:'error.emailNotFound',message:"Email not found."},unable_to_auth_magic_link:{id:'error.unableToAuthMagicLink',message:"The magic link could not be authenticated because it was either already used or expired. Please try again."},no_user_password:{id:'error.noUserPassword',message:"Password not found for this user. Please try again."},breached_password:{id:'error.breachedPassword',message:"Password appears in the list of breached passwords and must be reset."},reset_password:{id:'error.resetPassword',message:"Password must be reset."},oauth_token_not_found:{id:'error.oauthTokenNotFound',message:"OAuth Token could not be found."},invalid_code:{id:'error.invalidCode',message:"Code format is invalid, please try again."},member_password_not_found:{id:'error.memberPasswordNotFound',message:"Member password not found."},oauth_flow_callback_error:{id:'error.oauthFlowCallbackError',message:"An error was encountered in the callback of the OAuth flow. Please try again."},unauthorized_action:{id:'error.unauthorizedAction',message:"Unauthorized action."},user_lock_limit_reached:{id:'error.userLockLimitReached',message:"Too many failed authentication attempts. Please try again later."},invalid_session_token:{id:'error.invalidSessionToken',message:"Invalid session token."},session_not_found:{id:'error.sessionNotFound',message:"Session not found."},invalid_phone_number_country_code:{id:'error.invalidPhoneNumberCountryCode',message:"The phone number's country code is invalid, unsupported, or disabled."},otp_code_not_found:{id:'error.otpCodeNotFound',message:"Invalid passcode, please try again."},duplicate_member_phone_number:{id:'error.duplicatePhoneNumber',message:"A member with the specified phone number already exists for this organization."}};var getTranslatedError=function getTranslatedError(error,t){var errorType=extractErrorType(error);var messageDescriptor=errorMessages[errorType];if(messageDescriptor){return t(messageDescriptor);}return error.error_message;};var OTPButtonText=_defineProperty(_defineProperty(_defineProperty({},OTPMethods.SMS,{id:'button.sms',message:"Continue with text message"}),OTPMethods.WhatsApp,{id:'button.whatsapp',message:"Continue with WhatsApp"}),OTPMethods.Email,{id:'button.emailLogin',message:"Continue with email"});var OTPEmailForm=function OTPEmailForm(){var _useLingui0=useLingui(),_t=_useLingui0._;var onEvent=useEventCallback();var onError=useErrorCallback();var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer3=useGlobalReducer(),_useGlobalReducer4=_slicedToArray2(_useGlobalReducer3,2),dispatch=_useGlobalReducer4[1];var _h$15=h$5(''),_h$16=_slicedToArray2(_h$15,2),email=_h$16[0],setEmail=_h$16[1];var _h$17=h$5(''),_h$18=_slicedToArray2(_h$17,2),errorMessage=_h$18[0],setErrorMessage=_h$18[1];var _h$19=h$5(false),_h$20=_slicedToArray2(_h$19,2),isSubmitting=_h$20[0],setIsSubmitting=_h$20[1];var hasPasskeys=config.products.includes(Products.passkeys);var emailProps=useErrorProps(errorMessage);var emailInputLabel=_t({id:'formField.email.label',message:"Email"});var stopSubmit=function stopSubmit(errorText){onError({message:errorText});setIsSubmitting(false);return setErrorMessage(errorText);};var handleEmailSubmit=function handleEmailSubmit(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee83(){var _a,_b,_c,_d,_e;return _regenerator2().w(function(_context83){while(1)switch(_context83.n){case 0:e.preventDefault();setIsSubmitting(true);if(email.match(EMAIL_REGEX)){_context83.n=1;break;}return _context83.a(2,stopSubmit(_t({id:'errors.invalidEmail',message:"Invalid email address."})));case 1:setErrorMessage('');setIsSubmitting(true);stytchClient.otps.email.loginOrCreate(email,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES,login_template_id:(_c=config.otpOptions)===null||_c===void 0?void 0:_c.loginTemplateId,signup_template_id:(_d=config.otpOptions)===null||_d===void 0?void 0:_d.signupTemplateId,locale:(_e=config.otpOptions)===null||_e===void 0?void 0:_e.locale}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});dispatch({type:'update_otp_state',otpState:{type:OTPMethods.Email,methodId:data.method_id,otpDestination:email}});dispatch({type:'transition',screen:AppScreens$1.OTPAuthenticate});readB2CInternals(stytchClient).networkClient.logEvent({name:'email_sent',details:{email:email,type:EmailSentType.LoginOrCreateOTP}});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t));});case 2:return _context83.a(2);}},_callee83);}));};return/*#__PURE__*/wn.createElement("form",{onSubmit:handleEmailSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",minHeight:52},/*#__PURE__*/wn.createElement(EmailInput,Object.assign({email:email,setEmail:setEmail,hasPasskeys:hasPasskeys,"aria-label":emailInputLabel},emailProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},emailProps.error))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t(OTPButtonText[OTPMethods.Email])})));};var PhoneForm=function PhoneForm(_ref86){var method=_ref86.method;var _useLingui1=useLingui(),_t2=_useLingui1._;var onEvent=useEventCallback();var onError=useErrorCallback();var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer5=useGlobalReducer(),_useGlobalReducer6=_slicedToArray2(_useGlobalReducer5,2),dispatch=_useGlobalReducer6[1];var _h$21=h$5(''),_h$22=_slicedToArray2(_h$21,2),phoneNumber=_h$22[0],setPhoneNumber=_h$22[1];var _h$23=h$5('US'),_h$24=_slicedToArray2(_h$23,2),country=_h$24[0],setCountry=_h$24[1];var _h$25=h$5(''),_h$26=_slicedToArray2(_h$25,2),errorMessage=_h$26[0],setErrorMessage=_h$26[1];var _h$27=h$5(false),_h$28=_slicedToArray2(_h$27,2),isSubmitting=_h$28[0],setIsSubmitting=_h$28[1];var hasPasskeys=config.products.includes(Products.passkeys);var phoneProps=useErrorProps(errorMessage);var phoneInputLabel=_t2({id:'formField.phone.label',message:"Phone number"});var stopSubmit=function stopSubmit(errorText){onError({message:errorText});setIsSubmitting(false);return setErrorMessage(errorText);};var parsePhoneNumber=function parsePhoneNumber(phoneNumber,countryCode){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee84(){return _regenerator2().w(function(_context84){while(1)switch(_context84.n){case 0:return _context84.a(2,readB2CInternals(stytchClient).clientsideServices.parsedPhoneNumber({phoneNumber:phoneNumber,regionCode:countryCode}));}},_callee84);}));};var handlePhoneSubmit=function handlePhoneSubmit(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee85(){var _a,_b,parsedNumber;return _regenerator2().w(function(_context85){while(1)switch(_context85.n){case 0:e.preventDefault();_context85.n=1;return formatNumberToIncludeCountryCode({parsePhoneNumber:parsePhoneNumber,phoneNumber:phoneNumber,country:country});case 1:parsedNumber=_context85.v;if(parsedNumber.isValid){_context85.n=2;break;}return _context85.a(2,stopSubmit(_t2({id:'error.invalidPhoneNumber',message:"Phone number format is invalid. Ensure the phone number is in the E.164 format."})));case 2:setIsSubmitting(true);setErrorMessage('');stytchClient.otps[method].loginOrCreate(parsedNumber.number,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});dispatch({type:'update_otp_state',otpState:{type:method,methodId:data.method_id,otpDestination:parsedNumber.number}});dispatch({type:'transition',screen:AppScreens$1.OTPAuthenticate});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t2));});case 3:return _context85.a(2);}},_callee85);}));};return/*#__PURE__*/wn.createElement("form",{onSubmit:handlePhoneSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",minHeight:52},/*#__PURE__*/wn.createElement(PhoneInput,Object.assign({phone:phoneNumber,setPhone:setPhoneNumber,country:country,setCountry:setCountry,parsePhoneNumber:parsePhoneNumber,hasPasskeys:hasPasskeys,"aria-label":phoneInputLabel},phoneProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},phoneProps.error))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t2(OTPButtonText[method])})));};var MagicLinkEmailForm=function MagicLinkEmailForm(){var _useLingui10=useLingui(),_t=_useLingui10._;var onEvent=useEventCallback();var onError=useErrorCallback();var _useGlobalReducer7=useGlobalReducer(),_useGlobalReducer8=_slicedToArray2(_useGlobalReducer7,2),dispatch=_useGlobalReducer8[1];var stytchClient=useStytch();var config=useConfig();var emailMagicLinksOptions=config.emailMagicLinksOptions;var hasPasskeys=config.products.includes(Products.passkeys);var _h$29=h$5(''),_h$30=_slicedToArray2(_h$29,2),email=_h$30[0],setEmail=_h$30[1];var _h$31=h$5(''),_h$32=_slicedToArray2(_h$31,2),errorMessage=_h$32[0],setErrorMessage=_h$32[1];var _h$33=h$5(false),_h$34=_slicedToArray2(_h$33,2),isSubmitting=_h$34[0],setIsSubmitting=_h$34[1];var emailProps=useErrorProps(errorMessage);var emailInputLabel=_t({id:'formField.email.label',message:"Email"});var handleSubmit=function handleSubmit(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee86(){var submittingEmail;return _regenerator2().w(function(_context86){while(1)switch(_context86.n){case 0:e.preventDefault();submittingEmail=email;if(!submittingEmail.match(EMAIL_REGEX)){setErrorMessage(_t({id:'error.invalidEmail',message:"Email format is invalid."}));}else{setErrorMessage('');setIsSubmitting(true);stytchClient.magicLinks.email.loginOrCreate(submittingEmail,convertMagicLinkOptions(emailMagicLinksOptions)).then(function(data){onEvent({type:StytchEventType.MagicLinkLoginOrCreateEvent,data:Object.assign(Object.assign({},data),{email:submittingEmail})});setIsSubmitting(false);dispatch({type:'set_magic_link_email',email:submittingEmail});dispatch({type:'transition',screen:AppScreens$1.EmailConfirmation});readB2CInternals(stytchClient).networkClient.logEvent({name:'email_try_again_clicked',details:{email:submittingEmail,type:EmailSentType.LoginOrCreateEML}});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t));});}case 1:return _context86.a(2);}},_callee86);}));};return/*#__PURE__*/wn.createElement("form",{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",minHeight:52},/*#__PURE__*/wn.createElement(EmailInput,Object.assign({email:email,setEmail:setEmail,hasPasskeys:hasPasskeys,"aria-label":emailInputLabel},emailProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},emailProps.error))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.emailLogin',message:"Continue with email"})})));};var PasswordsEmailForm=function PasswordsEmailForm(){var _useLingui11=useLingui(),_t=_useLingui11._;var _useGlobalReducer9=useGlobalReducer(),_useGlobalReducer0=_slicedToArray2(_useGlobalReducer9,2),dispatch=_useGlobalReducer0[1];var config=useConfig();var stytch=useStytch();var onError=useErrorCallback();var hasPasskeys=config.products.includes(Products.passkeys);var _h$35=h$5(''),_h$36=_slicedToArray2(_h$35,2),email=_h$36[0],setEmail=_h$36[1];var _h$37=h$5(''),_h$38=_slicedToArray2(_h$37,2),errorMessage=_h$38[0],setErrorMessage=_h$38[1];var _h$39=h$5(false),_h$40=_slicedToArray2(_h$39,2),isSubmitting=_h$40[0],setIsSubmitting=_h$40[1];var emailProps=useErrorProps(errorMessage);var emailInputLabel=_t({id:'formField.email.label',message:"Email"});var handleSubmit=function handleSubmit(e){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee87(){return _regenerator2().w(function(_context87){while(1)switch(_context87.n){case 0:e.preventDefault();if(!email.match(EMAIL_REGEX)){setErrorMessage(_t({id:'error.invalidEmail',message:"Email format is invalid."}));}else{setErrorMessage('');setIsSubmitting(true);readB2CInternals(stytch).searchManager.searchUser(email).then(function(_ref87){var userType=_ref87.userType;dispatch({type:'update_password_state',passwordState:{email:email,type:userType}});dispatch({type:'transition',screen:AppScreens$1.PasswordCreateOrLogin});readB2CInternals(stytch).networkClient.logEvent({name:'email_sent',details:{email:email,type:EmailSentType.ResetPassword}});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t));});}case 1:return _context87.a(2);}},_callee87);}));};return/*#__PURE__*/wn.createElement("form",{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",minHeight:52},/*#__PURE__*/wn.createElement(EmailInput,Object.assign({email:email,setEmail:setEmail,hasPasskeys:hasPasskeys,"aria-label":emailInputLabel},emailProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},emailProps.error))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.emailLogin',message:"Continue with email"})})));};var TabList=He(List)(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n width: 100%;\n justify-content: space-between;\n border-bottom: 1px solid ",";\n margin-bottom: 24px;\n"])),function(props){return props.theme.colors.secondary;});var TabTrigger=He(Trigger)(_templateObject18||(_templateObject18=_taggedTemplateLiteral(["\n all: unset;\n width: 100%;\n text-align: center;\n color: ",";\n border-bottom: 3px solid ",";\n font-weight: ",";\n height: 28px;\n\n cursor: pointer;\n font-family: ",";\n line-height: 1;\n\n &:focus-visible {\n ","\n }\n"])),function(props){return props.$active?props.theme.colors.primary:props.theme.colors.secondary;},function(props){return props.$active?props.theme.colors.primary:'transparent';},function(props){return props.$active?'500':'400';},function(props){return props.theme.typography.fontFamily;},focusedRing);var MagicLinkMethods;(function(MagicLinkMethods){MagicLinkMethods["Email"]="emailMagicLink";})(MagicLinkMethods||(MagicLinkMethods={}));var PasswordMethods;(function(PasswordMethods){PasswordMethods["Email"]="passwords";})(PasswordMethods||(PasswordMethods={}));var OTPTabHeaders=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},OTPMethods.SMS,{id:'tab.text',message:"Text"}),OTPMethods.WhatsApp,{id:'tab.whatsapp',message:"WhatsApp"}),OTPMethods.Email,{id:'tab.email',message:"Email"}),MagicLinkMethods.Email,{id:'tab.email',message:"Email"}),PasswordMethods.Email,{id:'tab.email',message:"Email"});var getTabMethods=function getTabMethods(products,otpMethods){var hasPassword=products.includes(Products.passwords);var tabMethodsSet=products.reduce(function(acc,product){switch(product){case Products.emailMagicLinks:acc.add(hasPassword?PasswordMethods.Email:MagicLinkMethods.Email);break;case Products.passwords:acc.add(PasswordMethods.Email);break;case Products.otp:otpMethods.forEach(function(method){acc.add(method===OTPMethods.Email&&hasPassword?PasswordMethods.Email:method);});break;}return acc;},new Set());return Array.from(tabMethodsSet);};var TabMethodToComponent=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},OTPMethods.Email,OTPEmailForm),OTPMethods.WhatsApp,function(){return/*#__PURE__*/wn.createElement(PhoneForm,{method:OTPMethods.WhatsApp});}),OTPMethods.SMS,function(){return/*#__PURE__*/wn.createElement(PhoneForm,{method:OTPMethods.SMS});}),MagicLinkMethods.Email,MagicLinkEmailForm),PasswordMethods.Email,PasswordsEmailForm);var LoginForm=function LoginForm(){var _a,_b;var _useLingui12=useLingui(),_t=_useLingui12._;var config=useConfig();var productsIncludesOtp=config.products.includes(Products.otp);var otpMethods=productsIncludesOtp?(_b=(_a=config===null||config===void 0?void 0:config.otpOptions)===null||_a===void 0?void 0:_a.methods)!==null&&_b!==void 0?_b:[]:[];var hasEmailMagicLink=config.products.includes(Products.emailMagicLinks);var hasOTPEmail=productsIncludesOtp&&otpMethods.includes(OTPMethods.Email);var tabMethods=getTabMethods(config.products,otpMethods);var _h$41=h$5(tabMethods[0]),_h$42=_slicedToArray2(_h$41,2),currentTab=_h$42[0],setCurrentTab=_h$42[1];if(hasEmailMagicLink&&hasOTPEmail)return/*#__PURE__*/wn.createElement(Text,{size:"helper"},"Error: Cannot use both EML and Email OTP");return/*#__PURE__*/wn.createElement(Root,{value:currentTab,onValueChange:function onValueChange(value){return setCurrentTab(value);}},tabMethods.length>1&&(/*#__PURE__*/wn.createElement(TabList,{"aria-label":"otp-tabs"},tabMethods.map(function(method){return/*#__PURE__*/wn.createElement(TabTrigger,{value:method,key:method,"$active":method===currentTab},_t(OTPTabHeaders[method]));}))),tabMethods.map(function(method){var Component=TabMethodToComponent[method];if(tabMethods.length>1){return/*#__PURE__*/wn.createElement(Content,{value:method,key:method},/*#__PURE__*/wn.createElement(Component,null));}else{return/*#__PURE__*/wn.createElement(Component,{key:method});}}));};var WalletButton=function WalletButton(props){return/*#__PURE__*/wn.createElement(Button,{id:"wallet-".concat(props.walletTypeTitle),type:"button",onClick:props.onClick,variant:"outlined"},/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center",alignItems:"center",gap:4},props.icon,/*#__PURE__*/wn.createElement("span",{style:{verticalAlign:'middle'}},props.walletTypeTitle)));};function base(ALPHABET){if(ALPHABET.length>=255){throw new TypeError('Alphabet too long');}var BASE_MAP=new Uint8Array(256);for(var j=0;j<BASE_MAP.length;j++){BASE_MAP[j]=255;}for(var i=0;i<ALPHABET.length;i++){var x=ALPHABET.charAt(i);var xc=x.charCodeAt(0);if(BASE_MAP[xc]!==255){throw new TypeError(x+' is ambiguous');}BASE_MAP[xc]=i;}var BASE=ALPHABET.length;var LEADER=ALPHABET.charAt(0);var FACTOR=Math.log(BASE)/Math.log(256);var iFACTOR=Math.log(256)/Math.log(BASE);function encode(source){if(source instanceof Uint8Array);else if(ArrayBuffer.isView(source)){source=new Uint8Array(source.buffer,source.byteOffset,source.byteLength);}else if(Array.isArray(source)){source=Uint8Array.from(source);}if(!(source instanceof Uint8Array)){throw new TypeError('Expected Uint8Array');}if(source.length===0){return'';}var zeroes=0;var length=0;var pbegin=0;var pend=source.length;while(pbegin!==pend&&source[pbegin]===0){pbegin++;zeroes++;}var size=(pend-pbegin)*iFACTOR+1>>>0;var b58=new Uint8Array(size);while(pbegin!==pend){var carry=source[pbegin];var i=0;for(var it1=size-1;(carry!==0||i<length)&&it1!==-1;it1--,i++){carry+=256*b58[it1]>>>0;b58[it1]=carry%BASE>>>0;carry=carry/BASE>>>0;}if(carry!==0){throw new Error('Non-zero carry');}length=i;pbegin++;}var it2=size-length;while(it2!==size&&b58[it2]===0){it2++;}var str=LEADER.repeat(zeroes);for(;it2<size;++it2){str+=ALPHABET.charAt(b58[it2]);}return str;}function decodeUnsafe(source){if(typeof source!=='string'){throw new TypeError('Expected String');}if(source.length===0){return new Uint8Array();}var psz=0;var zeroes=0;var length=0;while(source[psz]===LEADER){zeroes++;psz++;}var size=(source.length-psz)*FACTOR+1>>>0;var b256=new Uint8Array(size);while(source[psz]){var charCode=source.charCodeAt(psz);if(charCode>255){return;}var carry=BASE_MAP[charCode];if(carry===255){return;}var i=0;for(var it3=size-1;(carry!==0||i<length)&&it3!==-1;it3--,i++){carry+=BASE*b256[it3]>>>0;b256[it3]=carry%256>>>0;carry=carry/256>>>0;}if(carry!==0){throw new Error('Non-zero carry');}length=i;psz++;}var it4=size-length;while(it4!==size&&b256[it4]===0){it4++;}var vch=new Uint8Array(zeroes+(size-it4));var j=zeroes;while(it4!==size){vch[j++]=b256[it4++];}return vch;}function decode(string){var buffer=decodeUnsafe(string);if(buffer){return buffer;}throw new Error('Non-base'+BASE+' character');}return{encode:encode,decodeUnsafe:decodeUnsafe,decode:decode};}var src=base;var basex=src;var ALPHABET='123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';var bs58=basex(ALPHABET);var PhantomIconSvg=function PhantomIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20Z",fill:"url(#paint0_linear_2_2)"}),/*#__PURE__*/wn.createElement("path",{d:"M17.2787 10.1428H15.4909C15.4909 6.5258 12.527 3.59375 8.87068 3.59375C5.25956 3.59375 2.32368 6.45402 2.25184 10.0091C2.1775 13.6839 5.66265 16.875 9.3779 16.875H9.84521C13.1207 16.875 17.5108 14.3385 18.1967 11.248C18.3234 10.6783 17.8684 10.1428 17.2787 10.1428ZM6.21389 10.304C6.21389 10.7877 5.81398 11.1833 5.32503 11.1833C4.83607 11.1833 4.43618 10.7875 4.43618 10.304V8.88147C4.43618 8.39777 4.83607 8.00217 5.32503 8.00217C5.81398 8.00217 6.21389 8.39777 6.21389 8.88147V10.304ZM9.30037 10.304C9.30037 10.7877 8.90048 11.1833 8.41153 11.1833C7.92257 11.1833 7.52267 10.7875 7.52267 10.304V8.88147C7.52267 8.39777 7.92275 8.00217 8.41153 8.00217C8.90048 8.00217 9.30037 8.39777 9.30037 8.88147V10.304Z",fill:"url(#paint1_linear_2_2)"}),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("linearGradient",{id:"paint0_linear_2_2",x1:"10",y1:"0",x2:"10",y2:"20",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"#534BB1"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#551BF9"})),/*#__PURE__*/wn.createElement("linearGradient",{id:"paint1_linear_2_2",x1:"10.2343",y1:"3.59375",x2:"10.2343",y2:"16.875",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"white"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"white",stopOpacity:"0.82"}))));};var PhantomIcon=CreateIcon(PhantomIconSvg);var MetamaskIconSvg=function MetamaskIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M17.2065 2.22849L10.9604 6.86753L12.1155 4.13056L17.2065 2.22849Z",fill:"#E2761B",stroke:"#E2761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M2.78717 2.22849L8.98303 6.91147L7.88447 4.13056L2.78717 2.22849Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M14.9592 12.9818L13.2957 15.5304L16.855 16.5097L17.8782 13.0383L14.9592 12.9818Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M2.12805 13.0383L3.145 16.5097L6.70432 15.5304L5.04079 12.9818L2.12805 13.0383Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.50344 8.67544L5.5116 10.1757L9.04581 10.3327L8.92026 6.53482L6.50344 8.67544Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M13.4903 8.67543L11.0421 6.49088L10.9604 10.3327L14.4884 10.1757L13.4903 8.67543Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.70432 15.5304L8.8261 14.4946L6.99308 13.0634L6.70432 15.5304Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.1676 14.4946L13.2957 15.5304L13.0006 13.0634L11.1676 14.4946Z",fill:"#E4761B",stroke:"#E4761B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M13.2957 15.5304L11.1676 14.4947L11.3371 15.882L11.3183 16.4658L13.2957 15.5304Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.70435 15.5304L8.68175 16.4658L8.66919 15.882L8.82613 14.4947L6.70435 15.5304Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M8.71312 12.1469L6.94287 11.6259L8.19209 11.0546L8.71312 12.1469Z",fill:"#233447",stroke:"#233447",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.2806 12.1469L11.8016 11.0546L13.0571 11.6259L11.2806 12.1469Z",fill:"#233447",stroke:"#233447",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.70433 15.5305L7.00565 12.9818L5.0408 13.0383L6.70433 15.5305Z",fill:"#CD6116",stroke:"#CD6116",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M12.9944 12.9818L13.2957 15.5305L14.9592 13.0383L12.9944 12.9818Z",fill:"#CD6116",stroke:"#CD6116",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M14.4884 10.1758L10.9604 10.3327L11.2869 12.1469L11.8079 11.0546L13.0634 11.6259L14.4884 10.1758Z",fill:"#CD6116",stroke:"#CD6116",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.94289 11.6259L8.19838 11.0546L8.71313 12.1469L9.04584 10.3327L5.51163 10.1758L6.94289 11.6259Z",fill:"#CD6116",stroke:"#CD6116",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M5.51163 10.1758L6.99311 13.0634L6.94289 11.6259L5.51163 10.1758Z",fill:"#E4751F",stroke:"#E4751F",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M13.0634 11.6259L13.0006 13.0634L14.4884 10.1758L13.0634 11.6259Z",fill:"#E4751F",stroke:"#E4751F",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M9.04584 10.3327L8.71313 12.1469L9.12745 14.2875L9.22161 11.469L9.04584 10.3327Z",fill:"#E4751F",stroke:"#E4751F",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M10.9605 10.3327L10.791 11.4627L10.8663 14.2875L11.2869 12.1469L10.9605 10.3327Z",fill:"#E4751F",stroke:"#E4751F",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.2869 12.1469L10.8663 14.2875L11.1676 14.4947L13.0006 13.0634L13.0634 11.6259L11.2869 12.1469Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.94287 11.6259L6.99309 13.0634L8.82611 14.4947L9.12743 14.2875L8.71312 12.1469L6.94287 11.6259Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.3183 16.4658L11.3371 15.882L11.1802 15.7439H8.81357L8.66919 15.882L8.68175 16.4658L6.70435 15.5305L7.39487 16.0954L8.79474 17.0684H11.199L12.6052 16.0954L13.2957 15.5305L11.3183 16.4658Z",fill:"#C0AD9E",stroke:"#C0AD9E",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M11.1676 14.4947L10.8663 14.2875H9.12744L8.82613 14.4947L8.66919 15.882L8.81357 15.7439H11.1802L11.3371 15.882L11.1676 14.4947Z",fill:"#161616",stroke:"#161616",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M17.4702 7.16885L18.0038 4.60764L17.2066 2.22849L11.1676 6.71059L13.4903 8.67544L16.7734 9.63589L17.5016 8.78843L17.1877 8.56245L17.6899 8.10419L17.3007 7.80287L17.8029 7.41995L17.4702 7.16885Z",fill:"#763D16",stroke:"#763D16",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M1.99625 4.60764L2.52983 7.16885L2.19085 7.41995L2.69304 7.80287L2.31012 8.10419L2.81232 8.56245L2.49844 8.78843L3.22035 9.63589L6.50347 8.67544L8.82613 6.71059L2.78721 2.22849L1.99625 4.60764Z",fill:"#763D16",stroke:"#763D16",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M16.7734 9.6359L13.4903 8.67545L14.4884 10.1758L13.0006 13.0634L14.9592 13.0383H17.8782L16.7734 9.6359Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M6.50344 8.67545L3.22033 9.6359L2.12805 13.0383H5.0408L6.99309 13.0634L5.51161 10.1758L6.50344 8.67545Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M10.9604 10.3327L11.1676 6.71062L12.1218 4.13058H7.88449L8.82611 6.71062L9.04582 10.3327L9.12115 11.4752L9.12743 14.2875H10.8663L10.8788 11.4752L10.9604 10.3327Z",fill:"#F6851B",stroke:"#F6851B",strokeLinecap:"round",strokeLinejoin:"round"}));};var MetamaskIcon=CreateIcon(MetamaskIconSvg);var VesselIconSvg=function VesselIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("g",{clipPath:"url(#clip0_517_6831)"},/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.602 3.2325C7.99856 3.2325 4.36714 6.58551 5.54083 11.2565L4.91376 11.414C3.6226 6.27561 7.64076 2.58594 11.602 2.58594C15.8216 2.58594 19.7562 6.44977 18.3304 11.5481L17.7077 11.374C19.0018 6.74671 15.4567 3.2325 11.602 3.2325Z",fill:"#2A384A"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5988 1.29891C6.41566 1.29891 2.05244 6.14046 3.88531 12.8124L3.26184 12.9836C1.32182 5.92165 5.96682 0.652344 11.5988 0.652344C17.5841 0.652344 22.5861 6.77296 19.5889 13.4516L18.9991 13.1869C21.7871 6.97427 17.1579 1.29891 11.5988 1.29891Z",fill:"#2A384A"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.17894 6.94622C7.48133 7.91408 7.24057 9.10031 7.36887 9.96188C7.39522 10.1385 7.27334 10.303 7.09673 10.3292C6.92019 10.3555 6.75568 10.2337 6.72938 10.0571C6.57532 9.0227 6.86195 7.6676 7.65447 6.56814C8.4568 5.45497 9.77856 4.60352 11.6727 4.60352C13.3065 4.60352 14.641 5.40696 15.4926 6.51476C16.3399 7.61698 16.7272 9.0444 16.4408 10.3222C16.4018 10.4965 16.2289 10.606 16.0547 10.567C15.8804 10.5279 15.7709 10.355 15.8099 10.1808C16.0479 9.11899 15.7297 7.88408 14.98 6.9088C14.2346 5.93917 13.0806 5.25008 11.6727 5.25008C9.99793 5.25008 8.86673 5.99201 8.17894 6.94622Z",fill:"#2A384A"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.521 14.6751C19.5048 11.7314 16.1357 10.3576 16.1357 10.3576H13.8259L12.9183 8.46875H11.5936H10.2689L9.36128 10.3576H6.91197L4.36073 12.1829L2.74168 10.3576H0.877319L2.15294 13.7625L0.877319 14.6751L2.15294 15.5981L0.877319 19.0416H2.74168L4.36073 17.1956L6.91197 19.0416H16.1357C16.1357 19.0416 19.5371 17.6188 19.521 14.6751ZM7.69518 15.9039C8.38612 15.9039 8.94625 15.3438 8.94625 14.6528C8.94625 13.9618 8.38612 13.4017 7.69518 13.4017C7.00423 13.4017 6.4441 13.9618 6.4441 14.6528C6.4441 15.3438 7.00423 15.9039 7.69518 15.9039ZM12.8871 14.6528C12.8871 15.3438 12.327 15.9039 11.6361 15.9039C10.9451 15.9039 10.385 15.3438 10.385 14.6528C10.385 13.9618 10.9451 13.4017 11.6361 13.4017C12.327 13.4017 12.8871 13.9618 12.8871 14.6528ZM15.5893 15.9039C16.2803 15.9039 16.8405 15.3438 16.8405 14.6528C16.8405 13.9618 16.2803 13.4017 15.5893 13.4017C14.8984 13.4017 14.3383 13.9618 14.3383 14.6528C14.3383 15.3438 14.8984 15.9039 15.5893 15.9039Z",fill:"url(#paint0_linear_517_6831)"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2704 6.78422C11.2704 6.60567 11.4151 6.46094 11.5936 6.46094H12.858C13.0365 6.46094 13.1813 6.60567 13.1813 6.78422C13.1813 6.96273 13.0365 7.10751 12.858 7.10751H11.9169V8.14474H12.9183C13.0426 8.14474 13.1558 8.216 13.2097 8.32801L14.0293 10.0337H16.1357C16.1775 10.0337 16.219 10.0418 16.2577 10.0576L16.1357 10.3569C16.2577 10.0576 16.2579 10.0576 16.258 10.0577L16.2584 10.0578L16.2592 10.0582L16.2619 10.0593C16.2641 10.0602 16.2672 10.0615 16.271 10.0631C16.2786 10.0663 16.2893 10.0709 16.303 10.0768C16.3302 10.0887 16.3691 10.1061 16.418 10.1291C16.5158 10.1751 16.6538 10.2434 16.8188 10.3347C17.148 10.5167 17.5883 10.7919 18.0306 11.1646C18.9106 11.906 19.8355 13.0668 19.8443 14.6727C19.8531 16.2802 18.9272 17.4542 18.0442 18.2075C17.6001 18.5863 17.157 18.8677 16.8255 19.0544C16.6594 19.1479 16.5203 19.2181 16.4218 19.2655C16.3725 19.2891 16.3333 19.3071 16.3058 19.3193C16.2921 19.3255 16.2814 19.3302 16.2737 19.3335C16.2699 19.3352 16.2669 19.3364 16.2647 19.3374L16.2619 19.3386L16.261 19.339L16.2607 19.3391C16.2606 19.3391 16.2604 19.3392 16.1357 19.041L16.2604 19.3392C16.2209 19.3557 16.1786 19.3642 16.1357 19.3642H6.91201C6.84396 19.3642 6.77763 19.3427 6.72249 19.3029L4.40973 17.6294L2.98477 19.2541C2.92339 19.3241 2.83482 19.3642 2.74172 19.3642H0.877361C0.77156 19.3642 0.672454 19.3125 0.612017 19.2256C0.551579 19.1388 0.537458 19.0278 0.57421 18.9286L1.76453 15.7154L0.687849 14.9363C0.603584 14.8754 0.553802 14.7776 0.55408 14.6735C0.554359 14.5695 0.604664 14.472 0.689255 14.4115L1.76328 13.6431L0.574628 10.4703C0.537435 10.3711 0.551278 10.2599 0.611676 10.1727C0.672073 10.0856 0.771349 10.0337 0.877361 10.0337H2.74172C2.83418 10.0337 2.92222 10.0732 2.98357 10.1424L4.40944 11.7499L6.7239 10.094C6.77877 10.0547 6.84453 10.0337 6.91201 10.0337H9.15798L9.97754 8.32801C10.0314 8.216 10.1447 8.14474 10.2689 8.14474H11.2704V6.78422ZM10.4723 8.79135L9.87534 10.0337H13.3119L12.715 8.79135H10.4723ZM7.01572 10.6802L2.34109 14.0247C2.34102 14.0247 2.34097 14.0248 2.34091 14.0248L1.43088 14.6759L2.34249 15.3355C2.34254 15.3356 2.3426 15.3356 2.34266 15.3356L4.54971 16.9326C4.5499 16.9327 4.55009 16.9329 4.55029 16.933L7.01673 18.7176H16.0672C16.0873 18.7085 16.1123 18.6968 16.1419 18.6827C16.2293 18.6407 16.3558 18.5768 16.5083 18.4909C16.814 18.3188 17.2203 18.0605 17.6246 17.7156C18.4382 17.0215 19.205 16.0124 19.1977 14.6762C19.1904 13.3383 18.4226 12.3403 17.614 11.659C17.2119 11.3203 16.8089 11.068 16.506 10.9005C16.3548 10.8169 16.2295 10.755 16.143 10.7143C16.1135 10.7005 16.0886 10.6891 16.0687 10.6802H7.01572ZM3.88361 17.2487L2.30828 16.1088L1.34187 18.7176H2.59526L3.88361 17.2487ZM2.30778 13.2535L3.88071 12.1282L2.59634 10.6802H1.3437L2.30778 13.2535ZM7.69522 13.7243C7.18283 13.7243 6.76743 14.1397 6.76743 14.6521C6.76743 15.1645 7.18283 15.5799 7.69522 15.5799C8.20761 15.5799 8.62302 15.1645 8.62302 14.6521C8.62302 14.1397 8.20761 13.7243 7.69522 13.7243ZM6.12086 14.6521C6.12086 13.7826 6.82572 13.0778 7.69522 13.0778C8.56471 13.0778 9.26962 13.7826 9.26962 14.6521C9.26962 15.5216 8.56471 16.2264 7.69522 16.2264C6.82572 16.2264 6.12086 15.5216 6.12086 14.6521ZM10.0617 14.6521C10.0617 13.7826 10.7666 13.0778 11.6361 13.0778C12.5056 13.0778 13.2104 13.7826 13.2104 14.6521C13.2104 15.5216 12.5056 16.2264 11.6361 16.2264C10.7666 16.2264 10.0617 15.5216 10.0617 14.6521ZM11.6361 13.7243C11.1236 13.7243 10.7083 14.1397 10.7083 14.6521C10.7083 15.1645 11.1236 15.5799 11.6361 15.5799C12.1485 15.5799 12.5639 15.1645 12.5639 14.6521C12.5639 14.1397 12.1485 13.7243 11.6361 13.7243ZM15.5894 13.7243C15.077 13.7243 14.6616 14.1397 14.6616 14.6521C14.6616 15.1645 15.077 15.5799 15.5894 15.5799C16.1018 15.5799 16.5172 15.1645 16.5172 14.6521C16.5172 14.1397 16.1018 13.7243 15.5894 13.7243ZM14.015 14.6521C14.015 13.7826 14.7199 13.0778 15.5894 13.0778C16.4589 13.0778 17.1638 13.7826 17.1638 14.6521C17.1638 15.5216 16.4589 16.2264 15.5894 16.2264C14.7199 16.2264 14.015 15.5216 14.015 14.6521Z",fill:"#2A384A"})),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("linearGradient",{id:"paint0_linear_517_6831",x1:"10.2255",y1:"6.04818",x2:"8.95738",y2:"20.334",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"#FFFF82"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#FF99B4"})),/*#__PURE__*/wn.createElement("clipPath",{id:"clip0_517_6831"},/*#__PURE__*/wn.createElement("rect",{width:"20",height:"18.805",fill:"white",transform:"translate(0.5 0.597656)"}))));};var VesselIcon=CreateIcon(VesselIconSvg);var BinanceIconSvg=function BinanceIconSvg(){return/*#__PURE__*/wn.createElement("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M20 0H0V20H20V0Z",fill:"#14151A"}),/*#__PURE__*/wn.createElement("path",{d:"M7.26562 10L6.13281 11.1328L5 10L6.13281 8.86719L7.26562 10ZM10 7.25781L11.9375 9.19531L13.0703 8.0625L11.1328 6.13281L10 5L8.875 6.13281L6.9375 8.0625L8.07031 9.19531L10 7.25781ZM13.8672 8.875L12.7422 10L13.875 11.1328L15 10L13.8672 8.875ZM10 12.7422L8.0625 10.8047L6.9375 11.9375L8.875 13.875L10 15L11.1328 13.8672L13.0703 11.9297L11.9375 10.8047L10 12.7422ZM10 11.125L11.1328 10L10 8.86719L8.875 10L10 11.125Z",fill:"#F0B90B"}));};var BinanceIcon=CreateIcon(BinanceIconSvg);var GenericWalletIconSvg=function GenericWalletIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 20 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M18.5 4.28V2C18.5 0.9 17.6 0 16.5 0H2.5C1.39 0 0.5 0.9 0.5 2V16C0.5 17.1 1.39 18 2.5 18H16.5C17.6 18 18.5 17.1 18.5 16V13.72C19.09 13.37 19.5 12.74 19.5 12V6C19.5 5.26 19.09 4.63 18.5 4.28ZM17.5 6V12H10.5V6H17.5ZM2.5 16V2H16.5V4H10.5C9.4 4 8.5 4.9 8.5 6V12C8.5 13.1 9.4 14 10.5 14H16.5V16H2.5Z",fill:"black"}),/*#__PURE__*/wn.createElement("path",{d:"M13.5 10.5C14.3284 10.5 15 9.82843 15 9C15 8.17157 14.3284 7.5 13.5 7.5C12.6716 7.5 12 8.17157 12 9C12 9.82843 12.6716 10.5 13.5 10.5Z",fill:"black"}));};var GenericWalletIcon=CreateIcon(GenericWalletIconSvg);var hasMultipleEthereumWallets=function hasMultipleEthereumWallets(){var _a;return!!((_a=window.ethereum)===null||_a===void 0?void 0:_a.providers);};var hasMetaMask=function hasMetaMask(){var _a;return!!(hasMultipleEthereumWallets()?(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return wallet.isMetaMask;}):window.ethereum.isMetaMask);};var hasCoinbaseWallet=function hasCoinbaseWallet(){var _a,_b;return!!(hasMultipleEthereumWallets()?(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return wallet.isCoinbaseWallet;}):(_b=window.ethereum)===null||_b===void 0?void 0:_b.isCoinbaseWallet);};var hasOtherEthereumWallet=function hasOtherEthereumWallet(){return!hasMetaMask()&&!hasCoinbaseWallet()&&!!window.ethereum;};var getMetaMaskProvider=function getMetaMaskProvider(){var _a;return hasMultipleEthereumWallets()?(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return wallet.isMetaMask;}):window.ethereum;};var getCoinbaseProvider=function getCoinbaseProvider(){var _a;return hasMultipleEthereumWallets()?(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return wallet.isCoinbaseWallet;}):window.ethereum;};var getOtherInjectedProvider=function getOtherInjectedProvider(){var _a;return(_a=window.ethereum.providers)===null||_a===void 0?void 0:_a.find(function(wallet){return!wallet.isCoinbaseWallet&&!wallet.isMetaMask;});};var WalletToIcon=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Wallets.Phantom,PhantomIcon),Wallets.Vessel,VesselIcon),Wallets.Binance,BinanceIcon),Wallets.Coinbase,CoinbaseIcon),Wallets.Metamask,MetamaskIcon),Wallets.GenericEthereumWallet,GenericWalletIcon),Wallets.GenericSolanaWallet,GenericWalletIcon);var WalletToText=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Wallets.Phantom,{id:'crypto.wallet.phantom',message:"Phantom"}),Wallets.Vessel,{id:'crypto.wallet.vessel',message:"Vessel"}),Wallets.Binance,{id:'crypto.wallet.binance',message:"Binance"}),Wallets.Coinbase,{id:'crypto.wallet.coinbase',message:"Coinbase"}),Wallets.Metamask,{id:'crypto.wallet.metamask',message:"Metamask"}),Wallets.GenericEthereumWallet,{id:'crypto.wallet.otherEthereum',message:"Other Ethereum Wallet"}),Wallets.GenericSolanaWallet,{id:'crypto.wallet.otherSolana',message:"Other Solana Wallet"});var isWalletVisible=function isWalletVisible(wallet){var _a,_b;switch(wallet){case Wallets.Metamask:return!!window.ethereum&&hasMetaMask();case Wallets.Phantom:return(_b=!!window.solana&&((_a=window.solana)===null||_a===void 0?void 0:_a.isPhantom))!==null&&_b!==void 0?_b:false;case Wallets.Vessel:return!!window.vessel;case Wallets.Binance:return!!window.BinanceChain;case Wallets.Coinbase:return!!window.ethereum&&hasCoinbaseWallet();case Wallets.GenericEthereumWallet:return!!window.ethereum&&hasOtherEthereumWallet();case Wallets.GenericSolanaWallet:return!!window.solana&&!window.solana.isPhantom;default:return false;}};var connectWithEthereumProvider=function connectWithEthereumProvider(request){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee88(){var _yield$request,_yield$request2,address;return _regenerator2().w(function(_context88){while(1)switch(_context88.n){case 0:_context88.n=1;return request({method:'eth_requestAccounts'});case 1:_yield$request=_context88.v;_yield$request2=_slicedToArray2(_yield$request,1);address=_yield$request2[0];return _context88.a(2,address);}},_callee88);}));};var connectWithWallet=function connectWithWallet(_ref88){var wallet=_ref88.wallet;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee89(){var provider,connectResp,_provider,_yield$window$vessel$,_yield$window$vessel$2,response,_provider2,_provider3,_connectResp,_t16;return _regenerator2().w(function(_context89){while(1)switch(_context89.n){case 0:_t16=wallet;_context89.n=_t16===Wallets.Metamask?1:_t16===Wallets.Phantom?2:_t16===Wallets.Binance?4:_t16===Wallets.Vessel?5:_t16===Wallets.Coinbase?7:_t16===Wallets.GenericEthereumWallet?8:_t16===Wallets.GenericSolanaWallet?9:11;break;case 1:provider=getMetaMaskProvider();return _context89.a(2,(provider===null||provider===void 0?void 0:provider.request)?connectWithEthereumProvider(provider===null||provider===void 0?void 0:provider.request):'');case 2:_context89.n=3;return window.solana.connect();case 3:connectResp=_context89.v;return _context89.a(2,connectResp.publicKey.toString());case 4:_provider=window.BinanceChain;return _context89.a(2,(_provider===null||_provider===void 0?void 0:_provider.request)?connectWithEthereumProvider(_provider===null||_provider===void 0?void 0:_provider.request):'');case 5:_context89.n=6;return window.vessel.ethereum.request({method:'eth_requestAccounts'});case 6:_yield$window$vessel$=_context89.v;_yield$window$vessel$2=_slicedToArray2(_yield$window$vessel$,1);response=_yield$window$vessel$2[0];return _context89.a(2,response);case 7:_provider2=getCoinbaseProvider();return _context89.a(2,(_provider2===null||_provider2===void 0?void 0:_provider2.request)?connectWithEthereumProvider(_provider2===null||_provider2===void 0?void 0:_provider2.request):'');case 8:_provider3=getOtherInjectedProvider();return _context89.a(2,(_provider3===null||_provider3===void 0?void 0:_provider3.request)?connectWithEthereumProvider(_provider3===null||_provider3===void 0?void 0:_provider3.request):'');case 9:_context89.n=10;return window.solana.connect();case 10:_connectResp=_context89.v;return _context89.a(2,_connectResp.publicKey.toString());case 11:return _context89.a(2,'');case 12:return _context89.a(2);}},_callee89);}));};var signMessageWithSolanaProvider=function signMessageWithSolanaProvider(message){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee90(){var encodedMessage,signResp;return _regenerator2().w(function(_context90){while(1)switch(_context90.n){case 0:encodedMessage=new TextEncoder().encode(message);_context90.n=1;return window.solana.request({method:'signMessage',params:{message:encodedMessage,display:'utf8'}});case 1:signResp=_context90.v;return _context90.a(2,bs58.encode(signResp.signature));}},_callee90);}));};var signMessageWithEthereumProvider=function signMessageWithEthereumProvider(request,message,address){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee91(){var signature;return _regenerator2().w(function(_context91){while(1)switch(_context91.n){case 0:_context91.n=1;return request({method:'personal_sign',params:[message,address]});case 1:signature=_context91.v;return _context91.a(2,signature);}},_callee91);}));};var signMessageWithWallet=function signMessageWithWallet(_ref89){var wallet=_ref89.wallet,message=_ref89.message,address=_ref89.address;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee92(){var provider,_provider4,_provider5,_provider6,_t17;return _regenerator2().w(function(_context92){while(1)switch(_context92.n){case 0:_t17=wallet;_context92.n=_t17===Wallets.Phantom?1:_t17===Wallets.GenericSolanaWallet?1:_t17===Wallets.Metamask?2:_t17===Wallets.Vessel?3:_t17===Wallets.Binance?4:_t17===Wallets.Coinbase?5:_t17===Wallets.GenericEthereumWallet?6:7;break;case 1:return _context92.a(2,signMessageWithSolanaProvider(message));case 2:provider=getMetaMaskProvider();return _context92.a(2,(provider===null||provider===void 0?void 0:provider.request)?signMessageWithEthereumProvider(provider===null||provider===void 0?void 0:provider.request,message,address):'');case 3:return _context92.a(2,signMessageWithEthereumProvider(window.vessel.ethereum.request,message,address));case 4:_provider4=window.BinanceChain;return _context92.a(2,(_provider4===null||_provider4===void 0?void 0:_provider4.request)?signMessageWithEthereumProvider(_provider4===null||_provider4===void 0?void 0:_provider4.request,message,address):'');case 5:_provider5=getCoinbaseProvider();return _context92.a(2,(_provider5===null||_provider5===void 0?void 0:_provider5.request)?signMessageWithEthereumProvider(_provider5===null||_provider5===void 0?void 0:_provider5.request,message,address):'');case 6:_provider6=getOtherInjectedProvider();return _context92.a(2,(_provider6===null||_provider6===void 0?void 0:_provider6.request)?signMessageWithEthereumProvider(_provider6===null||_provider6===void 0?void 0:_provider6.request,message,address):'');case 7:return _context92.a(2,'');case 8:return _context92.a(2);}},_callee92);}));};var isSolanaWallet=function isSolanaWallet(wallet){return[Wallets.Phantom,Wallets.GenericSolanaWallet].includes(wallet);};var MAX_BUTTONS=6;var SetupButton=He(BaseButton)(_templateObject19||(_templateObject19=_taggedTemplateLiteral(["\n width: 100%;\n text-align: center;\n font-weight: 600;\n"])));var walletMessages=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Wallets.Phantom,{id:'crypto.wallet.continueWithPhantom',message:"Continue with Phantom"}),Wallets.Vessel,{id:'crypto.wallet.continueWithVessel',message:"Continue with Vessel"}),Wallets.Binance,{id:'crypto.wallet.continueWithBinance',message:"Continue with Binance"}),Wallets.Coinbase,{id:'crypto.wallet.continueWithCoinbase',message:"Continue with Coinbase"}),Wallets.Metamask,{id:'crypto.wallet.continueWithMetamask',message:"Continue with Metamask"}),Wallets.GenericEthereumWallet,{id:'crypto.wallet.continueWithEthereum',message:"Continue with Other Ethereum Wallet"}),Wallets.GenericSolanaWallet,{id:'crypto.wallet.continueWithSolana',message:"Continue with Other Solana Wallet"});var CryptoWalletButtons=function CryptoWalletButtons(_ref90){var type=_ref90.type;var _a,_b;var _useLingui13=useLingui(),_t=_useLingui13._;var _useGlobalReducer1=useGlobalReducer(),_useGlobalReducer10=_slicedToArray2(_useGlobalReducer1,2),state=_useGlobalReducer10[0],dispatch=_useGlobalReducer10[1];var config=useConfig();var oAuthOptions=(_b=(_a=config.oauthOptions)===null||_a===void 0?void 0:_a.providers.length)!==null&&_b!==void 0?_b:0;var cryptoButtonsOnMainScreen=MAX_BUTTONS-oAuthOptions-1;var onWalletStart=function onWalletStart(wallet){dispatch({type:'update_crypto_state',cryptoState:Object.assign(Object.assign({},state.formState.cryptoState),{walletOption:wallet})});dispatch({type:'transition',screen:AppScreens$1.CryptoConnect});};var allDetectedWallets=Object.keys(Wallets).filter(function(wallet){return isWalletVisible(Wallets[wallet]);});var renderOtherScreenButton=allDetectedWallets.length>cryptoButtonsOnMainScreen;var mainWallets=allDetectedWallets.slice(0,cryptoButtonsOnMainScreen);var otherWallet=allDetectedWallets.slice(cryptoButtonsOnMainScreen);var walletsToRender=type==='main'?mainWallets:otherWallet;var WalletIconComponent=function WalletIconComponent(_ref91){var wallet=_ref91.wallet;var Icon=WalletToIcon[wallet];return/*#__PURE__*/y$3(Icon,null);};return/*#__PURE__*/y$3(Flex,{direction:"column",gap:8,className:"wallet-buttons"},walletsToRender.map(function(wallet){return/*#__PURE__*/y$3(WalletButton,{key:wallet,icon:/*#__PURE__*/y$3(WalletIconComponent,{wallet:Wallets[wallet]}),walletTypeTitle:type==='main'?_t(walletMessages[Wallets[wallet]]):_t(WalletToText[Wallets[wallet]]),onClick:function onClick(){return onWalletStart(Wallets[wallet]);}});}),renderOtherScreenButton&&type==='main'?(/*#__PURE__*/y$3(WalletButton,{walletTypeTitle:_t({id:'crypto.wallet.continueWithOtherWallet',message:"Continue with other Crypto Wallet"}),icon:/*#__PURE__*/y$3(WalletIconComponent,{wallet:Wallets.GenericEthereumWallet}),onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.CryptoOtherScreen});}})):(/*#__PURE__*/y$3(SetupButton,{type:"button",onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.CryptoSetupWallet});}},_t({id:'crypto.wallet.setupNewWallet',message:"Set up a new crypto wallet"}))));};var PasskeyIconSvg=function PasskeyIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M8.75 10C10.8211 10 12.5 8.32107 12.5 6.25C12.5 4.17893 10.8211 2.5 8.75 2.5C6.67893 2.5 5 4.17893 5 6.25C5 8.32107 6.67893 10 8.75 10Z",fill:"#19303D"}),/*#__PURE__*/wn.createElement("path",{d:"M18.7501 10.0001C18.7519 9.47774 18.6134 8.96445 18.349 8.51388C18.0847 8.06332 17.7041 7.69203 17.2472 7.43881C16.7903 7.18559 16.2738 7.05973 15.7516 7.07439C15.2294 7.08905 14.7207 7.24369 14.2787 7.52214C13.8367 7.8006 13.4776 8.19265 13.239 8.65733C13.0003 9.12202 12.8908 9.64227 12.9219 10.1637C12.9531 10.6852 13.1237 11.1887 13.416 11.6217C13.7082 12.0547 14.1114 12.4012 14.5834 12.6251V17.0835L15.8334 18.3335L17.9167 16.2501L16.6667 15.0001L17.9167 13.7501L16.8834 12.7168C17.4322 12.505 17.9042 12.1323 18.2373 11.6474C18.5704 11.1626 18.7492 10.5884 18.7501 10.0001ZM15.8334 10.0001C15.6686 10.0001 15.5075 9.95126 15.3704 9.85969C15.2334 9.76812 15.1266 9.63797 15.0635 9.4857C15.0004 9.33343 14.9839 9.16587 15.0161 9.00422C15.0482 8.84257 15.1276 8.69409 15.2441 8.57754C15.3607 8.461 15.5092 8.38163 15.6708 8.34948C15.8325 8.31732 16 8.33383 16.1523 8.3969C16.3046 8.45997 16.4347 8.56678 16.5263 8.70382C16.6179 8.84086 16.6667 9.00198 16.6667 9.1668C16.6667 9.38781 16.5789 9.59977 16.4227 9.75605C16.2664 9.91233 16.0544 10.0001 15.8334 10.0001Z",fill:"#19303D"}),/*#__PURE__*/wn.createElement("path",{d:"M12.0333 11.6833C11.3934 11.398 10.7007 11.2504 10 11.25H7.5C6.17392 11.25 4.90215 11.7768 3.96447 12.7145C3.02678 13.6521 2.5 14.9239 2.5 16.25V17.9167H13.3333V13.325C12.7713 12.8933 12.3248 12.3293 12.0333 11.6833Z",fill:"#19303D"}));};var PasskeysIcon=CreateIcon(PasskeyIconSvg);var PasskeyButton=function PasskeyButton(_ref92){var startPasskeyAuth=_ref92.startPasskeyAuth;var _useLingui14=useLingui(),_t=_useLingui14._;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"outlined",onClick:startPasskeyAuth},/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center",alignItems:"center",gap:4},/*#__PURE__*/wn.createElement(PasskeysIcon,null),/*#__PURE__*/wn.createElement("span",{style:{verticalAlign:'middle'}},_t({id:'button.loginWithPasskey',message:"Login with a Passkey"})))));};var isTruthy=function isTruthy(value){return Boolean(value);};var extractErrorMessage=function extractErrorMessage(error,messageFallback){if(error&&_typeof2(error)==='object'){if('error_message'in error&&typeof error.error_message==='string'){return error.error_message;}if('message'in error&&typeof error.message==='string'){return error.message;}}};var MAX_ATTEMPTS=5;var usePromptPasskey=function usePromptPasskey(_ref93){var canAutofill=_ref93.canAutofill;var _a,_b;var _useLingui15=useLingui(),_t=_useLingui15._;var stytchClient=useStytch();var config=useConfig();var hasPasskeys=config.products.includes(Products.passkeys);var onEvent=useEventCallback();var onError=useErrorCallback();var _useGlobalReducer11=useGlobalReducer(),_useGlobalReducer12=_slicedToArray2(_useGlobalReducer11,2),dispatch=_useGlobalReducer12[1];var _h$43=h$5(),_h$44=_slicedToArray2(_h$43,2),error=_h$44[0],setError=_h$44[1];var startPasskeyAuth=T$3(function(){var _ref94=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref94$conditionalMed=_ref94.conditionalMediation,conditionalMediation=_ref94$conditionalMed===void 0?false:_ref94$conditionalMed,abortController=_ref94.abortController;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee93(){var _c,_d,_e,resp,message,_t18;return _regenerator2().w(function(_context93){while(1)switch(_context93.p=_context93.n){case 0:_context93.p=0;_context93.n=1;return stytchClient.webauthn.authenticate({domain:(_c=config.passkeyOptions)===null||_c===void 0?void 0:_c.domain,session_duration_minutes:(_e=(_d=config.sessionOptions)===null||_d===void 0?void 0:_d.sessionDurationMinutes)!==null&&_e!==void 0?_e:DEFAULT_SESSION_DURATION_MINUTES,conditional_mediation:conditionalMediation,is_passkey:true,signal:abortController===null||abortController===void 0?void 0:abortController.signal});case 1:resp=_context93.v;if(resp){_context93.n=2;break;}throw new Error('Empty response');case 2:onEvent({type:StytchEventType.PasskeyAuthenticate,data:resp});dispatch({type:'transition',screen:AppScreens$1.PasskeyConfirmation});return _context93.a(2,resp);case 3:_context93.p=3;_t18=_context93.v;if(extractErrorType(_t18)==='webauthn_registration_not_found'){setError(_t({id:'error.passkeyRegistrationNotFound',message:"Passkey registration not found. You may have deleted the passkey from your account but not password manager. Please try again."}));}else if(_t18 instanceof Error&&_t18.name==='StytchAPIError'){setError(_t({id:'error.passkeyUnknown',message:"Unknown error occurred during passkey authentication. Please try again."}));}message=extractErrorMessage(_t18);if(message){onError({message:message});}throw _t18;case 4:return _context93.a(2);}},_callee93,null,[[0,3]]);}));},[(_a=config.passkeyOptions)===null||_a===void 0?void 0:_a.domain,(_b=config.sessionOptions)===null||_b===void 0?void 0:_b.sessionDurationMinutes,dispatch,onError,onEvent,stytchClient.webauthn,_t]);p$5(function(){if(!hasPasskeys||!canAutofill){return;}var abortController=new AbortController();(function(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee94(){var _i4,_t19;return _regenerator2().w(function(_context94){while(1)switch(_context94.p=_context94.n){case 0:_context94.n=1;return stytchClient.webauthn.browserSupportsAutofill();case 1:if(_context94.v){_context94.n=2;break;}return _context94.a(2);case 2:_i4=0;case 3:if(!(_i4<MAX_ATTEMPTS)){_context94.n=8;break;}if(!abortController.signal.aborted){_context94.n=4;break;}return _context94.a(2);case 4:_context94.p=4;_context94.n=5;return startPasskeyAuth({abortController:abortController,conditionalMediation:true});case 5:return _context94.a(2);case 6:_context94.p=6;_t19=_context94.v;if(!(_t19 instanceof DOMException&&_t19.name==='NotAllowedError')){_context94.n=7;break;}return _context94.a(2);case 7:++_i4;_context94.n=3;break;case 8:return _context94.a(2);}},_callee94,null,[[4,6]]);}));})();return function(){abortController.abort();};},[canAutofill,hasPasskeys,startPasskeyAuth,stytchClient.webauthn]);return[startPasskeyAuth,error];};var IconColorOverride=He.div(_templateObject20||(_templateObject20=_taggedTemplateLiteral(["\n display: contents; // Try to be as transparent as possible as a wrapper div\n\n path {\n fill: ",";\n }\n"])),function(props){if('color'in props)return props.color;if('themeColor'in props)return props.theme.colors[props.themeColor];});var WarningIcon=function WarningIcon(){return/*#__PURE__*/wn.createElement("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12.5 6.49L20.03 19.5H4.97L12.5 6.49ZM12.5 2.5L1.5 21.5H23.5L12.5 2.5ZM13.5 16.5H11.5V18.5H13.5V16.5ZM13.5 10.5H11.5V14.5H13.5V10.5Z",fill:"#C28E1F"}));};var WarningIcon$1=CreateIcon(WarningIcon);var SuccessIcon$1=function SuccessIcon$1(){return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z",fill:"#0C5A56"}));};var SuccessIcon$2=CreateIcon(SuccessIcon$1);var ErrorIcon$1=function ErrorIcon$1(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M9 13H11V15H9V13ZM9 5H11V11H9V5ZM9.99 0C4.47 0 0 4.48 0 10C0 15.52 4.47 20 9.99 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 9.99 0ZM10 18C5.58 18 2 14.42 2 10C2 5.58 5.58 2 10 2C14.42 2 18 5.58 18 10C18 14.42 14.42 18 10 18Z",fill:"#AD2E30"}));};var ErrorIcon$2=CreateIcon(ErrorIcon$1);var AlertBoxStyled=He(Flex)(_templateObject21||(_templateObject21=_taggedTemplateLiteral(["\n border: 1px solid ",";\n border-left-width: 6px;\n border-radius: 4px;\n padding: 24px;\n"])),function(props){return props.theme.colors[props.variant];});var AlertBox=function AlertBox(_ref95){var variant=_ref95.variant,text=_ref95.text;return/*#__PURE__*/wn.createElement(AlertBoxStyled,{variant:variant,gap:8,alignItems:"center"},/*#__PURE__*/wn.createElement(IconColorOverride,{themeColor:variant},variant==='error'&&/*#__PURE__*/wn.createElement(ErrorIcon$2,null),variant==='warning'&&/*#__PURE__*/wn.createElement(WarningIcon$1,null),variant==='success'&&/*#__PURE__*/wn.createElement(SuccessIcon$2,null)),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"primary"},text));};var Container$1=He(Flex)(_templateObject22||(_templateObject22=_taggedTemplateLiteral(["\n .oauth-buttons + .wallet-buttons {\n margin-top: 8px;\n }\n .wallet-buttons + .oauth-buttons {\n margin-top: 8px;\n }\n > * + * {\n margin-top: 24px;\n }\n"])));var Logo$1=He.img(_templateObject23||(_templateObject23=_taggedTemplateLiteral(["\n max-height: 50px;\n max-width: 100px;\n"])));var MainScreen=function MainScreen(){var stytchClient=useStytch();var config=useConfig();var _Ze=Ze(),displayHeader=_Ze.displayHeader,logo=_Ze.logo;var _useLingui16=useLingui(),_t=_useLingui16._;var _h$45=h$5([]),_h$46=_slicedToArray2(_h$45,2),productComponents=_h$46[0],setProductComponents=_h$46[1];var products=config.products,oauthOptions=config.oauthOptions;var hasButtons=products.includes(Products.oauth)&&oauthOptions||products.includes(Products.crypto);var hasPasskeys=products.includes(Products.passkeys);var hasInput=products.includes(Products.emailMagicLinks)||products.includes(Products.otp)||products.includes(Products.passwords);var _usePromptPasskey=usePromptPasskey({canAutofill:hasInput}),_usePromptPasskey2=_slicedToArray2(_usePromptPasskey,2),startPasskeyAuth=_usePromptPasskey2[0],passkeyError=_usePromptPasskey2[1];p$5(function(){var loadProductComponents=function loadProductComponents(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee95(){var keys,showDivider,_t20,_t21;return _regenerator2().w(function(_context95){while(1)switch(_context95.n){case 0:keys=Array.from(new Set(products.map(function(product){switch(product){case Products.oauth:case Products.crypto:return product;case Products.emailMagicLinks:case Products.otp:case Products.passwords:return'login-form';}}).filter(isTruthy)));showDivider=hasButtons&&hasInput;if(keys.length>1&&showDivider){keys.splice(-1,0,'divider');}_t20=hasPasskeys;if(!_t20){_context95.n=3;break;}_t21=!hasInput;if(_t21){_context95.n=2;break;}_context95.n=1;return stytchClient.webauthn.browserSupportsAutofill();case 1:_t21=!_context95.v;case 2:_t20=_t21;case 3:if(!_t20){_context95.n=4;break;}keys.unshift('passkey-button');case 4:setProductComponents(keys);case 5:return _context95.a(2);}},_callee95);}));};loadProductComponents();},[]);if(hasPasskeys&&products.length===1)return/*#__PURE__*/wn.createElement(Text,{size:"helper"},"Error: Cannot use Passkeys by itself, please add another product to the config.");return/*#__PURE__*/wn.createElement(Container$1,{direction:"column"},logo.logoImageUrl!==''&&(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center"},/*#__PURE__*/wn.createElement(Logo$1,{src:logo.logoImageUrl}))),displayHeader&&(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center"},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'login.title',message:"Sign up or log in"})))),passkeyError&&/*#__PURE__*/wn.createElement(AlertBox,{variant:"warning",text:passkeyError}),productComponents.map(function(key){switch(key){case'oauth':return/*#__PURE__*/wn.createElement(OAuthButtons,{key:key});case'crypto':return/*#__PURE__*/wn.createElement(CryptoWalletButtons,{type:"main",key:key});case'login-form':return/*#__PURE__*/wn.createElement(LoginForm,{key:key});case'passkey-button':return/*#__PURE__*/wn.createElement(PasskeyButton,{startPasskeyAuth:startPasskeyAuth,key:key});case'divider':return/*#__PURE__*/wn.createElement(Divider,{key:key});}}));};var BackButton=He(BaseButton)(_templateObject24||(_templateObject24=_taggedTemplateLiteral(["\n &:focus-visible {\n // Move the focus ring to the inner SVG\n outline: none;\n\n svg {\n ","\n }\n }\n"])),focusedRing);var BackArrowSvg=function BackArrowSvg(_ref96){var color=_ref96.color;return/*#__PURE__*/wn.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M20 11H7.83L13.42 5.41L12 4L4 12L12 20L13.41 18.59L7.83 13H20V11Z",fill:color}));};var BackArrow=function BackArrow(_ref97){var onClick=_ref97.onClick;var theme=Ze();var _useLingui17=useLingui(),_t=_useLingui17._;return/*#__PURE__*/wn.createElement(BackButton,{type:"button",onClick:onClick,"aria-label":_t({id:'button.back.ariaLabel',message:"Back"})},/*#__PURE__*/wn.createElement(BackArrowSvg,{color:theme.colors.primary}));};var StyledButton=He(BaseButton)(_templateObject25||(_templateObject25=_taggedTemplateLiteral(["\n font-weight: bold;\n\n &:focus-visible,\n &:hover {\n outline: none;\n text-decoration: underline;\n text-decoration-color: ",";\n }\n\n &:disabled {\n pointer-events: none;\n }\n"])),function(props){return props.theme.colors.primary;});var InlineButton=function InlineButton(_ref98){var onClick=_ref98.onClick,children=_ref98.children,disabled=_ref98.disabled,className=_ref98.className;return/*#__PURE__*/wn.createElement(StyledButton,{onClick:onClick,disabled:disabled,className:className},children);};var Wrapper=He.div(_templateObject26||(_templateObject26=_taggedTemplateLiteral(["\n display: grid;\n grid-template-rows: ",";\n transition: grid-template-rows 0.15s ease-out;\n"])),function(_ref99){var isOpen=_ref99.isOpen;return isOpen?'1fr':'0fr';});var Inner=He.div(_templateObject27||(_templateObject27=_taggedTemplateLiteral(["\n overflow: hidden;\n"])));var AnimatedContainer=function AnimatedContainer(_ref100){var isOpen=_ref100.isOpen,children=_ref100.children;return/*#__PURE__*/wn.createElement(Wrapper,{isOpen:isOpen},/*#__PURE__*/wn.createElement(Inner,null,children));};var Container=He.div(_templateObject28||(_templateObject28=_taggedTemplateLiteral(["\n height: 4px;\n background-color: ",";\n border-radius: 3px;\n overflow: hidden;\n"])),function(_ref101){var theme=_ref101.theme;return theme.colors.disabled;});var loading=Ue(_templateObject29||(_templateObject29=_taggedTemplateLiteral(["\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(-1%);\n }\n"])));var Progress=He.div(_templateObject30||(_templateObject30=_taggedTemplateLiteral(["\n height: 100%;\n width: 100%;\n background-color: ",";\n animation: "," 10s cubic-bezier(0.22, 1, 0.36, 1);\n"])),function(_ref102){var theme=_ref102.theme;return theme.colors.primary;},loading);var LoadingBar=function LoadingBar(_ref103){var isLoading=_ref103.isLoading;return/*#__PURE__*/wn.createElement(Container,null,isLoading&&/*#__PURE__*/wn.createElement(Progress,null));};var OTP_LENGTH=6;var GAP='8px';var WIDTH='46px';var INPUT_HEIGHT='46px';var Digit=He.div(_templateObject31||(_templateObject31=_taggedTemplateLiteral(["\n border: 1px solid ",";\n border-radius: 4px;\n align-items: center;\n display: flex;\n font-size: 18px;\n justify-content: center;\n height: ",";\n width: ",";\n background: ",";\n color: ",";\n"])),function(_ref104){var disabled=_ref104.disabled,theme=_ref104.theme;return disabled?theme.colors.disabled:'#ADBCC5';},INPUT_HEIGHT,WIDTH,function(_ref105){var disabled=_ref105.disabled,theme=_ref105.theme;return disabled?theme.colors.disabled:theme.inputs.backgroundColor;},function(_ref106){var disabled=_ref106.disabled,theme=_ref106.theme;return disabled?theme.colors.disabledText:theme.inputs.textColor;});var digitsContainerStyles={display:'flex',justifyContent:'space-between',gap:GAP,position:'relative',zIndex:-1};var otpContainerStyles={overflow:'hidden',position:'relative',textAlign:'initial',zIndex:1};var invisibleInputStyles={background:'transparent',border:'none',color:'transparent',height:INPUT_HEIGHT,margin:0,outline:'none',position:'absolute',width:"calc(100% - (0.5 * ".concat(WIDTH,"))"),caretColor:'#ADBCC5',letterSpacing:"calc(".concat(WIDTH," - 1ch + ").concat(GAP,")"),paddingLeft:"calc(0.5 * ".concat(WIDTH,")"),zIndex:10};var DigitAtIndex=function DigitAtIndex(_ref107){var index=_ref107.index,disabled=_ref107.disabled,otp=_ref107.otp;var fill=otp?otp[index]:'';return/*#__PURE__*/wn.createElement(Digit,{disabled:disabled,"data-testid":"otp-".concat(index)},fill);};var OTPInput=function OTPInput(_ref108){var otp=_ref108.otp,setOtp=_ref108.setOtp,disabled=_ref108.disabled;var _useLingui18=useLingui(),_t=_useLingui18._;var ref=_$2(null);p$5(function(){var _a;if(!disabled){(_a=ref.current)===null||_a===void 0?void 0:_a.focus();}},[disabled,ref]);var handleInput=function handleInput(e){var target=e.target;var newValue=target.value.replace(/\D/g,'').slice(0,OTP_LENGTH);target.value=newValue;if(newValue!==otp){setOtp(newValue);}};return/*#__PURE__*/wn.createElement("div",{style:otpContainerStyles},/*#__PURE__*/wn.createElement("input",Object.assign({ref:ref,"aria-label":_t({id:'formField.otp.ariaLabel',message:"One-time passcode"}),autoComplete:"one-time-code",autoFocus:true,disabled:disabled,style:invisibleInputStyles,onInput:handleInput,type:"text",inputMode:"numeric",value:otp},passwordManagerDisableAutofillProps)),/*#__PURE__*/wn.createElement("div",{style:digitsContainerStyles},_toConsumableArray2(Array(OTP_LENGTH).keys()).map(function(i){return/*#__PURE__*/wn.createElement(DigitAtIndex,{key:"digit-".concat(i),index:i,otp:otp,disabled:!!disabled});})));};var OTP_CODE_LENGTH=6;var OTPControl=function OTPControl(_ref109){var isSubmitting=_ref109.isSubmitting,onSubmit=_ref109.onSubmit,errorMessage=_ref109.errorMessage;var _useLingui19=useLingui(),_t=_useLingui19._;var _h$47=h$5(''),_h$48=_slicedToArray2(_h$47,2),otp=_h$48[0],setOtp=_h$48[1];var handleOtpChange=function handleOtpChange(otp){setOtp(otp);if(otp.length===OTP_CODE_LENGTH){onSubmit(otp);}};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",maxWidth:316},/*#__PURE__*/wn.createElement(OTPInput,{otp:otp,setOtp:handleOtpChange,disabled:isSubmitting}),/*#__PURE__*/wn.createElement(AnimatedContainer,{isOpen:isSubmitting},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8,marginTop:8},/*#__PURE__*/wn.createElement(Text,{color:"secondary",size:"helper"},_t({id:'formField.passcode.status.verifying',message:"Verifying passcode..."})),/*#__PURE__*/wn.createElement(LoadingBar,{isLoading:isSubmitting}))),!isSubmitting&&/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:errorMessage!==null&&errorMessage!==void 0?errorMessage:''}));};var OTPEntry=function OTPEntry(_ref110){var header=_ref110.header,helperContent=_ref110.helperContent,instruction=_ref110.instruction,isSubmitting=_ref110.isSubmitting,onSubmit=_ref110.onSubmit,errorMessage=_ref110.errorMessage;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(Text,{size:"header"},header),/*#__PURE__*/wn.createElement(Text,null,instruction),/*#__PURE__*/wn.createElement(OTPControl,{isSubmitting:isSubmitting,onSubmit:onSubmit,errorMessage:errorMessage}),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},helperContent));};var getSecondsRemaining=function getSecondsRemaining(expiration){var now=new Date();return Math.ceil((expiration.getTime()-now.getTime())/1000);};var rollToSuccess=Ue(_templateObject32||(_templateObject32=_taggedTemplateLiteral(["\n from {\n transform: translateY(0%);\n }\n to {\n transform: translateY(-50%);\n }\n"])));var rollToDefault=Ue(_templateObject33||(_templateObject33=_taggedTemplateLiteral(["\n from {\n transform: translateY(-50%);\n }\n to {\n transform: translateY(0%);\n }\n"])));var AnimatedWrapper=He.div(_templateObject34||(_templateObject34=_taggedTemplateLiteral(["\n position: relative;\n overflow: hidden;\n /* Set an explicit height to create the \"window\" the animation will be displayed in. We match to the line height to ensure it looks inline with the text */\n height: ",";\n"])),function(_ref111){var theme=_ref111.theme;return theme.typography.helper.lineHeight;});var RollingContainer=He.div(_templateObject35||(_templateObject35=_taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n animation: ","\n 0.3s ease-out;\n transform: ",";\n"])),function(_ref112){var displayCodeSent=_ref112.displayCodeSent,shouldAnimate=_ref112.shouldAnimate;if(!shouldAnimate)return'none';return displayCodeSent?rollToSuccess:rollToDefault;},function(_ref113){var displayCodeSent=_ref113.displayCodeSent;return displayCodeSent?'translateY(-50%)':'translateY(0%)';});var StyledInlineButton=He(InlineButton)(_templateObject36||(_templateObject36=_taggedTemplateLiteral(["\n color: ",";\n"])),function(_ref114){var theme=_ref114.theme,isCodeSending=_ref114.isCodeSending;return isCodeSending?theme.colors.success:'inherit';});var ExpirationMessage=function ExpirationMessage(_ref115){var expiration=_ref115.expiration,resendOTP=_ref115.resendOTP,errorMessage=_ref115.errorMessage;var _useLingui20=useLingui(),_t=_useLingui20._;var _h$49=h$5(function(){return getSecondsRemaining(expiration);}),_h$50=_slicedToArray2(_h$49,2),seconds=_h$50[0],setSeconds=_h$50[1];var _h$51=h$5('initial'),_h$52=_slicedToArray2(_h$51,2),resendState=_h$52[0],setResendState=_h$52[1];var codeExpired=seconds<=0;p$5(function(){if(!codeExpired){var updateSeconds=function updateSeconds(){return setSeconds(getSecondsRemaining(expiration));};var interval=setInterval(updateSeconds,1000);updateSeconds();return function(){return clearInterval(interval);};}},[codeExpired,expiration]);var handleResendClick=function handleResendClick(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee96(){var _t22;return _regenerator2().w(function(_context96){while(1)switch(_context96.p=_context96.n){case 0:_context96.p=0;setResendState('sending');_context96.n=1;return resendOTP();case 1:setResendState('sent');setTimeout(function(){setResendState('waiting');},2000);_context96.n=3;break;case 2:_context96.p=2;_t22=_context96.v;setResendState('initial');case 3:return _context96.a(2);}},_callee96,null,[[0,2]]);}));};var displayMinutes=Math.floor(Number(seconds/60));var displaySeconds=seconds-displayMinutes*60;var timeRemaining="".concat(displayMinutes,":").concat(displaySeconds<10?"0".concat(displaySeconds):displaySeconds);var formattedText=seconds>0?_t({id:'passcode.expirationCountdown',message:"Your code expires in {timeRemaining}.",values:{timeRemaining:timeRemaining}}):_t({id:'passcode.expired',message:"Your code has expired."});return/*#__PURE__*/wn.createElement(wn.Fragment,null,formattedText,/*#__PURE__*/wn.createElement(Flex,{direction:"row",gap:8,alignItems:"center"},_t({id:'passcode.didntGetIt',message:"Didn't get it?"}),/*#__PURE__*/wn.createElement(AnimatedWrapper,null,/*#__PURE__*/wn.createElement(RollingContainer,{displayCodeSent:resendState==='sent',shouldAnimate:resendState==='sent'||resendState==='waiting'},/*#__PURE__*/wn.createElement(StyledInlineButton,{onClick:handleResendClick,isCodeSending:false,disabled:resendState==='sending'||resendState==='sent'},_t({id:'passcode.resendCode',message:"Resend code"})),/*#__PURE__*/wn.createElement(StyledInlineButton,{onClick:handleResendClick,isCodeSending:true,disabled:true},_t({id:'passcode.codeSent',message:"Code sent"}))))),/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:errorMessage!==null&&errorMessage!==void 0?errorMessage:''}));};var SentOTPEntry=function SentOTPEntry(_ref116){var expiration=_ref116.expiration,formattedDestination=_ref116.formattedDestination,isSubmitting=_ref116.isSubmitting,onSubmit=_ref116.onSubmit,errorMessage=_ref116.errorMessage,resendOTP=_ref116.resendOTP,resendErrorMessage=_ref116.resendErrorMessage;var _useLingui21=useLingui(),_t2=_useLingui21._;var helperContent=/*#__PURE__*/wn.createElement(ExpirationMessage,{expiration:expiration,resendOTP:resendOTP,errorMessage:resendErrorMessage});return/*#__PURE__*/wn.createElement(OTPEntry,{header:_t2({id:'passcode.title',message:"Enter passcode"}),helperContent:helperContent,instruction:/*#__PURE__*/wn.createElement(Trans,{id:"passcode.sentConfirmation",message:"A 6-digit passcode was sent to you at <bold>{destination}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{destination:formattedDestination}}),isSubmitting:isSubmitting,onSubmit:onSubmit,errorMessage:errorMessage});};var OTPAuthenticate=function OTPAuthenticate(_ref117){var _ref117$hideBackArrow=_ref117.hideBackArrow,hideBackArrow=_ref117$hideBackArrow===void 0?false:_ref117$hideBackArrow;var _useLingui22=useLingui(),_t=_useLingui22._;var onEvent=useEventCallback();var onError=useErrorCallback();var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer13=useGlobalReducer(),_useGlobalReducer14=_slicedToArray2(_useGlobalReducer13,2),state=_useGlobalReducer14[0],dispatch=_useGlobalReducer14[1];var _h$53=h$5(false),_h$54=_slicedToArray2(_h$53,2),isSubmitting=_h$54[0],setIsSubmitting=_h$54[1];var destination=state.formState.otpState.otpDestination;var selectionMethod=state.formState.otpState.type;var _h$55=h$5(''),_h$56=_slicedToArray2(_h$55,2),errorMessage=_h$56[0],setErrorMessage=_h$56[1];var _h$57=h$5(''),_h$58=_slicedToArray2(_h$57,2),resendErrorMessage=_h$58[0],setResendErrorMessage=_h$58[1];var _h$59=h$5(destination),_h$60=_slicedToArray2(_h$59,2),formattedDestination=_h$60[0],setFormattedDestination=_h$60[1];var calculateExpiration=function calculateExpiration(){var _a,_b;return new Date(Date.now()+1000*60*((_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES));};p$5(function(){var parseDestination=function parseDestination(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee97(){var parsePhoneNumber,national;return _regenerator2().w(function(_context97){while(1)switch(_context97.n){case 0:parsePhoneNumber=function parsePhoneNumber(phoneNumber){return readB2CInternals(stytchClient).clientsideServices.parsedPhoneNumber({phoneNumber:phoneNumber});};_context97.n=1;return formatNumber({parsePhoneNumber:parsePhoneNumber,phoneNumber:destination});case 1:national=_context97.v;setFormattedDestination(selectionMethod===OTPMethods.Email?destination:national);case 2:return _context97.a(2);}},_callee97);}));};parseDestination();},[selectionMethod,destination,stytchClient]);var _h$61=h$5(calculateExpiration),_h$62=_slicedToArray2(_h$61,2),expiration=_h$62[0],setExpiration=_h$62[1];var resendOTP=function resendOTP(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee98(){var _a,_b,data,_t23;return _regenerator2().w(function(_context98){while(1)switch(_context98.p=_context98.n){case 0:if(selectionMethod===OTPMethods.Email){readB2CInternals(stytchClient).networkClient.logEvent({name:'email_try_again_clicked',details:{email:destination,type:EmailSentType.LoginOrCreateOTP}});}_context98.p=1;_context98.n=2;return stytchClient.otps[selectionMethod].loginOrCreate(destination,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES});case 2:data=_context98.v;onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});setExpiration(calculateExpiration());dispatch({type:'update_otp_state',otpState:{type:selectionMethod,methodId:data.method_id,otpDestination:destination}});_context98.n=4;break;case 3:_context98.p=3;_t23=_context98.v;onError(_t23);setResendErrorMessage(getTranslatedError(_t23,_t));throw _t23;case 4:return _context98.a(2);}},_callee98,null,[[1,3]]);}));};var handleSubmit=function handleSubmit(otp){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee99(){var _c,_d;return _regenerator2().w(function(_context99){while(1)switch(_context99.n){case 0:setIsSubmitting(true);stytchClient.otps.authenticate(otp,state.formState.otpState.methodId,{session_duration_minutes:(_d=(_c=config.sessionOptions)===null||_c===void 0?void 0:_c.sessionDurationMinutes)!==null&&_d!==void 0?_d:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){onEvent({type:StytchEventType.OTPsAuthenticate,data:data});setIsSubmitting(false);dispatch({type:'transition',screen:AppScreens$1.OTPConfirmation});})["catch"](function(e){onError(e);setIsSubmitting(false);setErrorMessage(getTranslatedError(e,_t));});case 1:return _context99.a(2);}},_callee99);}));};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},!hideBackArrow&&/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(SentOTPEntry,{expiration:expiration,formattedDestination:formattedDestination,isSubmitting:isSubmitting,onSubmit:handleSubmit,resendOTP:resendOTP,errorMessage:errorMessage,resendErrorMessage:resendErrorMessage}));};var PasswordIconSvg=function PasswordIconSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12 6.5c3.79 0 7.17 2.13 8.82 5.5-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12C4.83 8.63 8.21 6.5 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5m0 5c1.38 0 2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5-2.5-1.12-2.5-2.5 1.12-2.5 2.5-2.5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5",fill:"currentColor"}));};var PasswordIconVisibleSvg=function PasswordIconVisibleSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6m-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14M2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45zm7.5 7.5 2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13m-3.4-3.4 1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53",fill:"currentColor"}));};var BaseInput=He.input(_templateObject37||(_templateObject37=_taggedTemplateLiteral(["\n border: 0;\n padding: 0;\n width: 100%;\n\n background-color: transparent;\n height: 45px;\n color: ",";\n font-family: ",";\n font-size: 18px;\n\n &::placeholder {\n color: ",";\n }\n\n &:disabled {\n color: ",";\n background-color: ",";\n }\n\n &:focus {\n outline: none;\n }\n"])),function(props){return props.theme.inputs.textColor;},function(props){return props.theme.typography.fontFamily;},function(props){return props.theme.inputs.placeholderColor;},function(props){return props.theme.colors.disabledText;},function(props){return props.theme.colors.disabled;});var InputContainer=He(Flex)(_templateObject38||(_templateObject38=_taggedTemplateLiteral(["\n background-color: ",";\n height: 45px;\n padding-left: 8px;\n padding-right: 8px;\n border: 1px solid ",";\n border-radius: ",";\n color: ",";\n font-family: ",";\n font-size: 18px;\n width: calc(100% - 18px);\n\n &:focus-within {\n outline: 1px auto;\n }\n"])),function(props){return props.theme.inputs.backgroundColor;},function(props){return props.theme.inputs.borderColor;},function(props){return props.theme.inputs.borderRadius;},function(props){return props.theme.inputs.textColor;},function(props){return props.theme.typography.fontFamily;});var PasswordIconButton=He(BaseButton)(_templateObject39||(_templateObject39=_taggedTemplateLiteral(["\n height: 20px;\n color: ",";\n\n &:disabled {\n cursor: default;\n }\n"])),function(props){return props.passwordEntered?props.theme.inputs.textColor:props.theme.colors.disabledText;});var PasswordIcon=function PasswordIcon(_ref118){var onClick=_ref118.onClick,passwordEntered=_ref118.passwordEntered,visible=_ref118.visible;var _useLingui23=useLingui(),_t=_useLingui23._;return/*#__PURE__*/wn.createElement(PasswordIconButton,{onClick:onClick,type:"button",passwordEntered:passwordEntered,"aria-label":visible?_t({id:'button.hidePassword',message:"Hide password"}):_t({id:'button.showPassword',message:"Show password"})},visible?/*#__PURE__*/wn.createElement(PasswordIconVisibleSvg,null):/*#__PURE__*/wn.createElement(PasswordIconSvg,null));};var PasswordInput=function PasswordInput(_a){var password=_a.password,setPassword=_a.setPassword,type=_a.type,additionalProps=__rest(_a,["password","setPassword","type"]);var _h$63=h$5(false),_h$64=_slicedToArray2(_h$63,2),visible=_h$64[0],setVisible=_h$64[1];return/*#__PURE__*/wn.createElement(InputContainer,{gap:2,alignItems:"center"},/*#__PURE__*/wn.createElement(BaseInput,Object.assign({name:"password",id:"".concat(type,"-password"),autoComplete:"".concat(type,"-password"),type:visible?'text':'password',value:password,onChange:function onChange(e){return setPassword(e.target.value);},required:true},additionalProps)),/*#__PURE__*/wn.createElement(PasswordIcon,{onClick:function onClick(){return setVisible(function(visible){return!visible;});},passwordEntered:!!password,visible:visible}));};var Block=He.div(_templateObject40||(_templateObject40=_taggedTemplateLiteral(["\n height: 4px;\n width: 25%;\n background-color: ",";\n"])),function(props){return props.$bgColor;});var PasswordStrengthCheck=function PasswordStrengthCheck(_ref119){var score=_ref119.score;var blocks=[];switch(score){case 0:case 1:blocks=['#8B1214','#ADBCC5','#ADBCC5','#ADBCC5'];break;case 2:blocks=['#8B1214','#8B1214','#ADBCC5','#ADBCC5'];break;case 3:blocks=['#0C5A56','#0C5A56','#0C5A56','#ADBCC5'];break;case 4:blocks=['#0C5A56','#0C5A56','#0C5A56','#0C5A56'];break;default:blocks=['#ADBCC5','#ADBCC5','#ADBCC5','#ADBCC5'];break;}return/*#__PURE__*/wn.createElement(Flex,{gap:2},blocks.map(function(block,i){return/*#__PURE__*/wn.createElement(Block,{key:"".concat(block,"-").concat(i),"$bgColor":block});}));};var CheckIcon=function CheckIcon(){return/*#__PURE__*/y$3(Flex,{height:16,width:16},/*#__PURE__*/y$3("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M5.86332 10.5833L3.08332 7.80333L2.13666 8.74333L5.86332 12.47L13.8633 4.47L12.9233 3.53L5.86332 10.5833Z",fill:"#0C5A56"})));};var CrossIcon=function CrossIcon(){return/*#__PURE__*/y$3(Flex,{height:16,width:16},/*#__PURE__*/y$3("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M12.6667 4.27334L11.7267 3.33334L8.00001 7.06001L4.27334 3.33334L3.33334 4.27334L7.06001 8.00001L3.33334 11.7267L4.27334 12.6667L8.00001 8.94001L11.7267 12.6667L12.6667 11.7267L8.94001 8.00001L12.6667 4.27334Z",fill:"#8B1214"})));};var useBootstrap=function useBootstrap(){var stytchClient=useStytch();var _h$65=h$5({bootstrap:readB2CInternals(stytchClient).bootstrap.getSync(),fromCache:true}),_h$66=_slicedToArray2(_h$65,2),bootstrap=_h$66[0],setBootstrap=_h$66[1];p$5(function(){readB2CInternals(stytchClient).bootstrap.getAsync().then(function(data){return setBootstrap({bootstrap:data,fromCache:false});});},[stytchClient]);return bootstrap;};var useSyncExternalStoreShim_production={};var require$$0=/*@__PURE__*/getAugmentedNamespace(compat_module);var React=require$$0;function is(x,y){return x===y&&(0!==x||1/x===1/y)||x!==x&&y!==y;}var objectIs="function"===typeof Object.is?Object.is:is,useState=React.useState,useEffect=React.useEffect,useLayoutEffect=React.useLayoutEffect,useDebugValue=React.useDebugValue;function useSyncExternalStore$2(subscribe,getSnapshot){var value=getSnapshot(),_useState=useState({inst:{value:value,getSnapshot:getSnapshot}}),inst=_useState[0].inst,forceUpdate=_useState[1];useLayoutEffect(function(){inst.value=value;inst.getSnapshot=getSnapshot;checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst});},[subscribe,value,getSnapshot]);useEffect(function(){checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst});return subscribe(function(){checkIfSnapshotChanged(inst)&&forceUpdate({inst:inst});});},[subscribe]);useDebugValue(value);return value;}function checkIfSnapshotChanged(inst){var latestGetSnapshot=inst.getSnapshot;inst=inst.value;try{var nextValue=latestGetSnapshot();return!objectIs(inst,nextValue);}catch(error){return!0;}}function useSyncExternalStore$1(subscribe,getSnapshot){return getSnapshot();}var shim="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?useSyncExternalStore$1:useSyncExternalStore$2;useSyncExternalStoreShim_production.useSyncExternalStore=void 0!==React.useSyncExternalStore?React.useSyncExternalStore:shim;var SWRGlobalState=new WeakMap();var EMPTY_CACHE={};var INITIAL_CACHE={};var noop=function noop(){};var UNDEFINED=noop();var OBJECT=Object;var isUndefined=function isUndefined(v){return v===UNDEFINED;};var isFunction=function isFunction(v){return typeof v=='function';};var mergeObjects=function mergeObjects(a,b){return _objectSpread(_objectSpread({},a),b);};var STR_UNDEFINED='undefined';var isWindowDefined=(typeof window==="undefined"?"undefined":_typeof2(window))!=STR_UNDEFINED;var isDocumentDefined=(typeof document==="undefined"?"undefined":_typeof2(document))!=STR_UNDEFINED;var createCacheHelper=function createCacheHelper(cache,key){var state=SWRGlobalState.get(cache);return[function(){return cache.get(key)||EMPTY_CACHE;},function(info){if(!isUndefined(key)){var prev=cache.get(key);if(!(key in INITIAL_CACHE)){INITIAL_CACHE[key]=prev;}state[5](key,mergeObjects(prev,info),prev||EMPTY_CACHE);}},state[6],function(){if(!isUndefined(key)){if(key in INITIAL_CACHE)return INITIAL_CACHE[key];}return cache.get(key)||EMPTY_CACHE;}];};var table=new WeakMap();var counter=0;var _stableHash=function stableHash(arg){var type=_typeof2(arg);var constructor=arg&&arg.constructor;var isDate=constructor==Date;var result;var index;if(OBJECT(arg)===arg&&!isDate&&constructor!=RegExp){result=table.get(arg);if(result)return result;result=++counter+'~';table.set(arg,result);if(constructor==Array){result='@';for(index=0;index<arg.length;index++){result+=_stableHash(arg[index])+',';}table.set(arg,result);}if(constructor==OBJECT){result='#';var keys=OBJECT.keys(arg).sort();while(!isUndefined(index=keys.pop())){if(!isUndefined(arg[index])){result+=index+':'+_stableHash(arg[index])+',';}}table.set(arg,result);}}else{result=isDate?arg.toJSON():type=='symbol'?arg.toString():type=='string'?JSON.stringify(arg):''+arg;}return result;};var online=true;var isOnline=function isOnline(){return online;};var _ref120=isWindowDefined&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[noop,noop],_ref121=_slicedToArray2(_ref120,2),onWindowEvent=_ref121[0],offWindowEvent=_ref121[1];var isVisible=function isVisible(){var visibilityState=isDocumentDefined&&document.visibilityState;return isUndefined(visibilityState)||visibilityState!=='hidden';};var initFocus=function initFocus(callback){if(isDocumentDefined){document.addEventListener('visibilitychange',callback);}onWindowEvent('focus',callback);return function(){if(isDocumentDefined){document.removeEventListener('visibilitychange',callback);}offWindowEvent('focus',callback);};};var initReconnect=function initReconnect(callback){var onOnline=function onOnline(){online=true;callback();};var onOffline=function onOffline(){online=false;};onWindowEvent('online',onOnline);onWindowEvent('offline',onOffline);return function(){offWindowEvent('online',onOnline);offWindowEvent('offline',onOffline);};};var preset={isOnline:isOnline,isVisible:isVisible};var defaultConfigOptions={initFocus:initFocus,initReconnect:initReconnect};!wn.useId;var IS_SERVER=!isWindowDefined||'Deno'in window;var navigatorConnection=typeof navigator!=='undefined'&&navigator.connection;var slowConnection=!IS_SERVER&&navigatorConnection&&(['slow-2g','2g'].includes(navigatorConnection.effectiveType)||navigatorConnection.saveData);var serialize=function serialize(key){if(isFunction(key)){try{key=key();}catch(err){key='';}}var args=key;key=typeof key=='string'?key:(Array.isArray(key)?key.length:key)?_stableHash(key):'';return[key,args];};var __timestamp=0;var getTimestamp=function getTimestamp(){return++__timestamp;};var FOCUS_EVENT=0;var RECONNECT_EVENT=1;var MUTATE_EVENT=2;function internalMutate(){return _internalMutate.apply(this,arguments);}function _internalMutate(){_internalMutate=_asyncToGenerator(/*#__PURE__*/_regenerator2().m(function _callee112(){var _len1,args,_key1,cache,_key,_data,_opts,options,populateCache,rollbackOnErrorOption,optimisticData,revalidate,rollbackOnError,throwOnError,keyFilter,matchedKeys,it,keyIt,key,mutateByKey,_mutateByKey,_args11=arguments;return _regenerator2().w(function(_context112){while(1)switch(_context112.n){case 0:_mutateByKey=function _mutateByKey3(){_mutateByKey=_asyncToGenerator(/*#__PURE__*/_regenerator2().m(function _callee111(_k){var _serialize,_serialize2,key,_createCacheHelper,_createCacheHelper2,get,set,_SWRGlobalState$get3,_SWRGlobalState$get4,EVENT_REVALIDATORS,MUTATION,FETCH,revalidators,startRevalidate,data,error,beforeMutationTs,hasOptimisticData,state,displayedData,currentData,committedData,res;return _regenerator2().w(function(_context111){while(1)switch(_context111.n){case 0:_serialize=serialize(_k),_serialize2=_slicedToArray2(_serialize,1),key=_serialize2[0];if(key){_context111.n=1;break;}return _context111.a(2);case 1:_createCacheHelper=createCacheHelper(cache,key),_createCacheHelper2=_slicedToArray2(_createCacheHelper,2),get=_createCacheHelper2[0],set=_createCacheHelper2[1];_SWRGlobalState$get3=SWRGlobalState.get(cache),_SWRGlobalState$get4=_slicedToArray2(_SWRGlobalState$get3,3),EVENT_REVALIDATORS=_SWRGlobalState$get4[0],MUTATION=_SWRGlobalState$get4[1],FETCH=_SWRGlobalState$get4[2];revalidators=EVENT_REVALIDATORS[key];startRevalidate=function startRevalidate(){if(revalidate){delete FETCH[key];if(revalidators&&revalidators[0]){return revalidators[0](MUTATE_EVENT).then(function(){return get().data;});}}return get().data;};if(!(args.length<3)){_context111.n=2;break;}return _context111.a(2,startRevalidate());case 2:data=_data;beforeMutationTs=getTimestamp();MUTATION[key]=[beforeMutationTs,0];hasOptimisticData=!isUndefined(optimisticData);state=get();displayedData=state.data;currentData=state._c;committedData=isUndefined(currentData)?displayedData:currentData;if(hasOptimisticData){optimisticData=isFunction(optimisticData)?optimisticData(committedData):optimisticData;set({data:optimisticData,_c:committedData});}if(isFunction(data)){try{data=data(committedData);}catch(err){error=err;}}if(!(data&&isFunction(data.then))){_context111.n=6;break;}_context111.n=3;return data["catch"](function(err){error=err;});case 3:data=_context111.v;if(!(beforeMutationTs!==MUTATION[key][0])){_context111.n=5;break;}if(!error){_context111.n=4;break;}throw error;case 4:return _context111.a(2,data);case 5:if(error&&hasOptimisticData&&rollbackOnError(error)){populateCache=true;data=committedData;set({data:data,_c:UNDEFINED});}case 6:if(populateCache){if(!error){if(isFunction(populateCache)){data=populateCache(data,committedData);}set({data:data,_c:UNDEFINED});}}MUTATION[key][1]=getTimestamp();_context111.n=7;return startRevalidate();case 7:res=_context111.v;set({_c:UNDEFINED});if(!error){_context111.n=9;break;}if(!throwOnError){_context111.n=8;break;}throw error;case 8:return _context111.a(2);case 9:return _context111.a(2,populateCache?res:data);}},_callee111);}));return _mutateByKey.apply(this,arguments);};mutateByKey=function _mutateByKey2(_x){return _mutateByKey.apply(this,arguments);};for(_len1=_args11.length,args=new Array(_len1),_key1=0;_key1<_len1;_key1++){args[_key1]=_args11[_key1];}cache=args[0],_key=args[1],_data=args[2],_opts=args[3];options=mergeObjects({populateCache:true,throwOnError:true},typeof _opts==='boolean'?{revalidate:_opts}:_opts||{});populateCache=options.populateCache;rollbackOnErrorOption=options.rollbackOnError;optimisticData=options.optimisticData;revalidate=options.revalidate!==false;rollbackOnError=function rollbackOnError(error){return typeof rollbackOnErrorOption==='function'?rollbackOnErrorOption(error):rollbackOnErrorOption!==false;};throwOnError=options.throwOnError;if(!isFunction(_key)){_context112.n=1;break;}keyFilter=_key;matchedKeys=[];it=cache.keys();for(keyIt=it.next();!keyIt.done;keyIt=it.next()){key=keyIt.value;if(!/^\$(inf|sub)\$/.test(key)&&keyFilter(cache.get(key)._k)){matchedKeys.push(key);}}return _context112.a(2,Promise.all(matchedKeys.map(mutateByKey)));case 1:return _context112.a(2,mutateByKey(_key));}},_callee112);}));return _internalMutate.apply(this,arguments);}var revalidateAllKeys=function revalidateAllKeys(revalidators,type){for(var key in revalidators){if(revalidators[key][0])revalidators[key][0](type);}};var initCache=function initCache(provider,options){if(!SWRGlobalState.has(provider)){var opts=mergeObjects(defaultConfigOptions,options);var EVENT_REVALIDATORS={};var _mutate=internalMutate.bind(UNDEFINED,provider);var unmount=noop;var subscriptions={};var subscribe=function subscribe(key,callback){var subs=subscriptions[key]||[];subscriptions[key]=subs;subs.push(callback);return function(){return subs.splice(subs.indexOf(callback),1);};};var setter=function setter(key,value,prev){provider.set(key,value);var subs=subscriptions[key];if(subs){var _iterator9=_createForOfIteratorHelper2(subs),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _fn=_step9.value;_fn(value,prev);}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}}};var initProvider=function initProvider(){if(!SWRGlobalState.has(provider)){SWRGlobalState.set(provider,[EVENT_REVALIDATORS,{},{},{},_mutate,setter,subscribe]);if(!IS_SERVER){var releaseFocus=opts.initFocus(setTimeout.bind(UNDEFINED,revalidateAllKeys.bind(UNDEFINED,EVENT_REVALIDATORS,FOCUS_EVENT)));var releaseReconnect=opts.initReconnect(setTimeout.bind(UNDEFINED,revalidateAllKeys.bind(UNDEFINED,EVENT_REVALIDATORS,RECONNECT_EVENT)));unmount=function unmount(){releaseFocus&&releaseFocus();releaseReconnect&&releaseReconnect();SWRGlobalState["delete"](provider);};}}};initProvider();return[provider,_mutate,initProvider,unmount];}return[provider,SWRGlobalState.get(provider)[4]];};var onErrorRetry=function onErrorRetry(_,__,config,revalidate,opts){var maxRetryCount=config.errorRetryCount;var currentRetryCount=opts.retryCount;var timeout=~~((Math.random()+0.5)*(1<<(currentRetryCount<8?currentRetryCount:8)))*config.errorRetryInterval;if(!isUndefined(maxRetryCount)&&currentRetryCount>maxRetryCount){return;}setTimeout(revalidate,timeout,opts);};var compare=function compare(currentData,newData){return _stableHash(currentData)==_stableHash(newData);};var _initCache=initCache(new Map()),_initCache2=_slicedToArray2(_initCache,2),cache=_initCache2[0],mutate=_initCache2[1];mergeObjects({onLoadingSlow:noop,onSuccess:noop,onError:noop,onErrorRetry:onErrorRetry,onDiscarded:noop,revalidateOnFocus:true,revalidateOnReconnect:true,revalidateIfStale:true,shouldRetryOnError:true,errorRetryInterval:slowConnection?10000:5000,focusThrottleInterval:5*1000,dedupingInterval:2*1000,loadingTimeout:slowConnection?5000:3000,compare:compare,isPaused:function isPaused(){return false;},cache:cache,mutate:mutate,fallback:{}},preset);F$5({});var enableDevtools=isWindowDefined&&window.__SWR_DEVTOOLS_USE__;var use=enableDevtools?window.__SWR_DEVTOOLS_USE__:[];var setupDevTools=function setupDevTools(){if(enableDevtools){window.__SWR_DEVTOOLS_REACT__=wn;}};var middleware=function middleware(useSWRNext){return function(key_,fetcher_,config){var fetcher=fetcher_&&function(){var key=serialize(key_)[0];var _SWRGlobalState$get=SWRGlobalState.get(cache),_SWRGlobalState$get2=_slicedToArray2(_SWRGlobalState$get,4),PRELOAD=_SWRGlobalState$get2[3];var req=PRELOAD[key];if(req){delete PRELOAD[key];return req;}return fetcher_.apply(void 0,arguments);};return useSWRNext(key_,fetcher,config);};};use.concat(middleware);setupDevTools();var DEFAULT_MFA_STATE={primaryInfo:null,isEnrolling:false,smsOtp:{isSending:false,sendError:null,codeExpiration:null,formattedDestination:null,enrolledNumber:null},totp:{isCreating:false,createError:null,enrollment:null}};var ErrorType;(function(ErrorType){ErrorType[ErrorType["Default"]=0]="Default";ErrorType[ErrorType["EmailMagicLink"]=1]="EmailMagicLink";ErrorType[ErrorType["Organization"]=2]="Organization";ErrorType[ErrorType["CannotJoinOrgDueToAuthPolicy"]=3]="CannotJoinOrgDueToAuthPolicy";ErrorType[ErrorType["AdBlockerDetected"]=4]="AdBlockerDetected";ErrorType[ErrorType["OrganizationDiscoveryClaimedDomain"]=5]="OrganizationDiscoveryClaimedDomain";})(ErrorType||(ErrorType={}));var AppScreens;(function(AppScreens){AppScreens["Main"]="Main";AppScreens["EmailConfirmation"]="Email Confirmation";AppScreens["LoggedIn"]="Logged In";AppScreens["Discovery"]="Discovery";AppScreens["Error"]="Error";AppScreens["PasswordEmailForm"]="Password Email";AppScreens["PasswordAuthenticate"]="Password Authenticate";AppScreens["PasswordResetForm"]="Password Reset Form";AppScreens["PasswordResetVerifyConfirmation"]="Password Reset Verify Confirmation";AppScreens["PasswordForgotForm"]="Password Forgot Form";AppScreens["PasswordSetNewConfirmation"]="Password Set New Confirmation";AppScreens["MFAEnrollmentSelection"]="MFA Enrollment Selection";AppScreens["RecoveryCodeEntry"]="Recovery Code Entry";AppScreens["RecoveryCodeSave"]="Recovery Code Save";AppScreens["SMSOTPEnrollment"]="SMS OTP Enrollment";AppScreens["SMSOTPEntry"]="SMS OTP Entry";AppScreens["TOTPEnrollmentManual"]="TOTP Enrollment Manual";AppScreens["TOTPEnrollmentQRCode"]="TOTP Enrollment QR Code";AppScreens["TOTPEntry"]="TOTP Entry";AppScreens["EmailMethodSelection"]="Email Method Selection";AppScreens["EmailOTPEntry"]="Email OTP Entry";AppScreens["SSODiscoveryEmail"]="SSO Discovery Email";AppScreens["SSODiscoveryFallback"]="SSO Discovery Fallback";AppScreens["SSODiscoveryMenu"]="SSO Discovery Menu";AppScreens["IDPConsent"]="IDP Consent";})(AppScreens||(AppScreens={}));[B2BMFAProducts.totp,B2BMFAProducts.smsOtp];({screen:AppScreens.Main,screenHistory:[],formState:{emailState:{userSuppliedEmail:''},otpState:{codeExpiration:null},discoveryState:{email:'',discoveredOrganizations:[]},passwordState:{email:''},ssoDiscoveryState:{connections:[]}},flowState:{type:AuthFlowType.Organization,organization:null},mfa:DEFAULT_MFA_STATE,primary:{},error:{type:ErrorType.Default,canGoBack:false}});({products:[B2BProducts.emailMagicLinks],authFlowType:AuthFlowType.Organization,sessionOptions:{sessionDurationMinutes:60}});({'stytch.magicLinks.authenticate':StytchEventType.B2BMagicLinkAuthenticate,'stytch.sso.authenticate':StytchEventType.B2BSSOAuthenticate,'stytch.sso.discoverConnections':StytchEventType.B2BSSODiscoverConnections,'stytch.magicLinks.discovery.authenticate':StytchEventType.B2BMagicLinkDiscoveryAuthenticate,'stytch.discovery.organizations.create':StytchEventType.B2BDiscoveryOrganizationsCreate,'stytch.discovery.intermediateSessions.exchange':StytchEventType.B2BDiscoveryIntermediateSessionExchange,'stytch.magicLinks.email.loginOrSignup':StytchEventType.B2BMagicLinkEmailLoginOrSignup,'stytch.magicLinks.email.discovery.send':StytchEventType.B2BMagicLinkEmailDiscoverySend,'stytch.oauth.authenticate':StytchEventType.B2BOAuthAuthenticate,'stytch.oauth.discovery.authenticate':StytchEventType.B2BOAuthDiscoveryAuthenticate,'stytch.otps.sms.send':StytchEventType.B2BSMSOTPSend,'stytch.otps.sms.authenticate':StytchEventType.B2BSMSOTPAuthenticate,'stytch.totp.create':StytchEventType.B2BTOTPCreate,'stytch.totp.authenticate':StytchEventType.B2BTOTPAuthenticate,'stytch.recoveryCodes.recover':StytchEventType.B2BRecoveryCodesRecover,'stytch.impersonation.authenticate':StytchEventType.B2BImpersonationAuthenticate,'stytch.otps.email.authenticate':StytchEventType.B2BOTPsEmailAuthenticate,'stytch.otps.email.discovery.authenticate':StytchEventType.B2BOTPsEmailDiscoveryAuthenticate,'stytch.otps.email.discovery.send':StytchEventType.B2BOTPsEmailDiscoverySend,'stytch.otps.email.loginOrSignup':StytchEventType.B2BOTPsEmailLoginOrSignup,'stytch.organization.getBySlug':StytchEventType.B2BOrganizationsGetBySlug});var warnings={'Short keyboard patterns are easy to guess.':{id:'password.zxcvbn.warning.shortKeyboardPatterns',message:"Short keyboard patterns are easy to guess."},'Straight rows of keys are easy to guess.':{id:'password.zxcvbn.warning.straightRows',message:"Straight rows of keys are easy to guess."},'Repeats like "aaa" are easy to guess.':{id:'password.zxcvbn.warning.repeats',message:"Repeats like \"aaa\" are easy to guess."},'Repeats like "abcabcabc" are only slightly harder to guess than "abc".':{id:'password.zxcvbn.warning.longerRepeats',message:"Repeats like \"abcabcabc\" are only slightly harder to guess than \"abc\"."},'Sequences like "abc" or "6543" are easy to guess.':{id:'password.zxcvbn.warning.sequences',message:"Sequences like \"abc\" or \"6543\" are easy to guess."},'Recent years are easy to guess.':{id:'password.zxcvbn.warning.recentYears',message:"Recent years are easy to guess."},'Dates are often easy to guess.':{id:'password.zxcvbn.warning.dates',message:"Dates are often easy to guess."},'This is a top-10 common password.':{id:'password.zxcvbn.warning.top10CommonPassword',message:"This is a top-10 common password."},'This is a top-100 common password.':{id:'password.zxcvbn.warning.top100CommonPassword',message:"This is a top-100 common password."},'This is a very common password.':{id:'password.zxcvbn.warning.veryCommonPassword',message:"This is a very common password."},'This is similar to a commonly used password.':{id:'password.zxcvbn.warning.similarToCommonPassword',message:"This is similar to a commonly used password."},'A word by itself is easy to guess.':{id:'password.zxcvbn.warning.wordByItself',message:"A word by itself is easy to guess."},'Names and surnames by themselves are easy to guess.':{id:'password.zxcvbn.warning.names',message:"Names and surnames by themselves are easy to guess."},'Common names and surnames are easy to guess.':{id:'password.zxcvbn.warning.commonNames',message:"Common names and surnames are easy to guess."}};var suggestions={'Use a few words, avoid common phrases.':{id:'password.zxcvbn.suggestion.useAFewWords',message:"Use a few words, avoid common phrases."},'No need for symbols, digits, or uppercase letters.':{id:'password.zxcvbn.suggestion.noSymbolsDigitsUppercase',message:"No need for symbols, digits, or uppercase letters."},'Add another word or two. Uncommon words are better.':{id:'password.zxcvbn.suggestion.addWords',message:"Add another word or two. Uncommon words are better."},'Use a longer keyboard pattern with more turns.':{id:'password.zxcvbn.suggestion.longerKeyboardPattern',message:"Use a longer keyboard pattern with more turns."},'Avoid repeated words and characters.':{id:'password.zxcvbn.suggestion.avoidRepeats',message:"Avoid repeated words and characters."},'Avoid sequences.':{id:'password.zxcvbn.suggestion.avoidSequences',message:"Avoid sequences."},'Avoid recent years.':{id:'password.zxcvbn.suggestion.avoidRecentYears',message:"Avoid recent years."},'Avoid years that are associated with you.':{id:'password.zxcvbn.suggestion.avoidYearsAssociatedWithYou',message:"Avoid years that are associated with you."},'Avoid dates and years that are associated with you.':{id:'password.zxcvbn.suggestion.avoidDatesAndYearsAssociatedWithYou',message:"Avoid dates and years that are associated with you."},"Capitalization doesn't help very much.":{id:'password.zxcvbn.suggestion.capitalization',message:"Capitalization doesn't help very much."},'All-uppercase is almost as easy to guess as all-lowercase.':{id:'password.zxcvbn.suggestion.allUppercase',message:"All-uppercase is almost as easy to guess as all-lowercase."},"Reversed words aren't much harder to guess.":{id:'password.zxcvbn.suggestion.reversed',message:"Reversed words aren't much harder to guess."},"Predictable substitutions like '@' instead of 'a' don't help very much.":{id:'password.zxcvbn.suggestion.predictableSubstitutions',message:"Predictable substitutions like '@' instead of 'a' don't help very much."}};var BulletPoint=He.div(_templateObject41||(_templateObject41=_taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n width: 16px;\n flex-shrink: 0;\n\n &::before {\n content: '\u2022';\n font-size: ",";\n line-height: ",";\n color: ",";\n }\n"])),function(_ref122){var theme=_ref122.theme;return theme.typography.helper.fontSize;},function(_ref123){var theme=_ref123.theme;return theme.typography.helper.lineHeight;},function(_ref124){var theme=_ref124.theme;return theme.colors.secondary;});var CrossIconContainer=He.div(_templateObject42||(_templateObject42=_taggedTemplateLiteral(["\n flex-shrink: 0;\n padding-top: 2px;\n"])));var PasswordError=function PasswordError(_a){var _b,_c,_d,_e,_f;var bootstrap=_a.bootstrap,props=__rest(_a,["bootstrap"]);var _useLingui24=useLingui(),_t=_useLingui24._;var complexity=(_c=(_b=bootstrap.passwordConfig)===null||_b===void 0?void 0:_b.ludsComplexity)!==null&&_c!==void 0?_c:0;var characterLength=(_e=(_d=bootstrap.passwordConfig)===null||_d===void 0?void 0:_d.ludsMinimumCount)!==null&&_e!==void 0?_e:0;if(props.passwordPolicy==='none'){return null;}var passwordBreachedMessage=props.isPasswordBreached&&(/*#__PURE__*/wn.createElement(Flex,{gap:4},/*#__PURE__*/wn.createElement(CrossIcon,null),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"error"},_t({id:'password.strengthError.breached',message:"This password may have been used on a different site that experienced a security issue. Please choose another password."}))));if(props.passwordPolicy==='zxcvbn'){var translatedWarning=props.passwordWarning?(_f=warnings[props.passwordWarning])!==null&&_f!==void 0?_f:props.passwordWarning:null;var uniqueSuggestions=_toConsumableArray2(new Set(props.passwordSuggestions));var translatedSuggestions=uniqueSuggestions.map(function(suggestion){var _a;return(_a=suggestions[suggestion])!==null&&_a!==void 0?_a:suggestion;});return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(PasswordStrengthCheck,{score:props.passwordScore}),props.errorMessage&&/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:props.errorMessage}),translatedWarning&&(/*#__PURE__*/wn.createElement(Flex,{gap:1,alignItems:"flex-start"},/*#__PURE__*/wn.createElement(CrossIconContainer,null,/*#__PURE__*/wn.createElement(CrossIcon,null)),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"error"},_t(translatedWarning)))),translatedSuggestions.map(function(suggestion,index){return/*#__PURE__*/wn.createElement(Flex,{key:index,gap:1,alignItems:"flex-start"},/*#__PURE__*/wn.createElement(BulletPoint,null),' ',/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},_t(suggestion)));}),passwordBreachedMessage);}return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:4},/*#__PURE__*/wn.createElement(Flex,{gap:4},props.missingCharacters===0?/*#__PURE__*/wn.createElement(CheckIcon,null):/*#__PURE__*/wn.createElement(CrossIcon,null),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:props.missingCharacters===0?'success':'error'},_t({id:'password.strengthError.minimumLength',message:"{characterLength, plural, one {Must be at least # character long} other {Must be at least # characters long}}",values:{characterLength:characterLength}}))),/*#__PURE__*/wn.createElement(Flex,{gap:4},props.missingComplexity===0?/*#__PURE__*/wn.createElement(CheckIcon,null):/*#__PURE__*/wn.createElement(CrossIcon,null),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:props.missingComplexity===0?'success':'error'},_t({id:'password.strengthError.complexity',message:"{complexity, plural, one {Must contain # of the following: uppercase letter, lowercase letter, number, symbol} other {Must contain # of the following: uppercase letter, lowercase letter, number, symbol}}",values:{complexity:complexity}}))),passwordBreachedMessage);};var PasswordB2CError=function PasswordB2CError(props){var _useBootstrap=useBootstrap(),bootstrap=_useBootstrap.bootstrap;return/*#__PURE__*/wn.createElement(PasswordError,Object.assign({},props,{bootstrap:bootstrap}));};var Label=He.label(_templateObject43||(_templateObject43=_taggedTemplateLiteral(["\n all: unset;\n display: block;\n cursor: default;\n width: fit-content;\n\n color: ",";\n ",";\n"])),function(props){return props.theme.colors.secondary;},function(props){return props.theme.typography.helper;});var PasswordNewUser=function PasswordNewUser(){var _useLingui25=useLingui(),_t=_useLingui25._;var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var _useGlobalReducer15=useGlobalReducer(),_useGlobalReducer16=_slicedToArray2(_useGlobalReducer15,2),state=_useGlobalReducer16[0],dispatch=_useGlobalReducer16[1];var onEvent=useEventCallback();var onError=useErrorCallback();var _h$67=h$5(state.formState.passwordState.email),_h$68=_slicedToArray2(_h$67,2),email=_h$68[0],setEmail=_h$68[1];var _h$69=h$5(''),_h$70=_slicedToArray2(_h$69,2),password=_h$70[0],setPassword=_h$70[1];var _h$71=h$5(''),_h$72=_slicedToArray2(_h$71,2),errorMessage=_h$72[0],setErrorMessage=_h$72[1];var _h$73=h$5(0),_h$74=_slicedToArray2(_h$73,2),passwordScore=_h$74[0],setPasswordScore=_h$74[1];var _h$75=h$5(''),_h$76=_slicedToArray2(_h$75,2),passwordWarning=_h$76[0],setPasswordWarning=_h$76[1];var _h$77=h$5([]),_h$78=_slicedToArray2(_h$77,2),passwordSuggestions=_h$78[0],setPasswordSuggestions=_h$78[1];var _h$79=h$5(true),_h$80=_slicedToArray2(_h$79,2),invalidPassword=_h$80[0],setInvalidPassword=_h$80[1];var _h$81=h$5(false),_h$82=_slicedToArray2(_h$81,2),isSubmitting=_h$82[0],setIsSubmitting=_h$82[1];var _h$83=h$5('none'),_h$84=_slicedToArray2(_h$83,2),strengthPolicy=_h$84[0],setStrengthPolicy=_h$84[1];var _h$85=h$5(0),_h$86=_slicedToArray2(_h$85,2),missingCharacters=_h$86[0],setMissingCharacters=_h$86[1];var _h$87=h$5(0),_h$88=_slicedToArray2(_h$87,2),missingComplexity=_h$88[0],setMissingComplexity=_h$88[1];var _h$89=h$5(false),_h$90=_slicedToArray2(_h$89,2),isPasswordBreached=_h$90[0],setIsPasswordBreached=_h$90[1];var passwordProps=useErrorProps(errorMessage);var updateStrengthCheck=F$4(function(){return debounce(function(email,password){setErrorMessage('');stytchClient.passwords.strengthCheck({email:email,password:password}).then(function(_ref125){var score=_ref125.score,feedback=_ref125.feedback,valid_password=_ref125.valid_password,strength_policy=_ref125.strength_policy,breached_password=_ref125.breached_password;setStrengthPolicy(strength_policy);if(strength_policy==='zxcvbn'){setPasswordScore(score);setPasswordWarning(feedback.warning);setPasswordSuggestions(feedback.suggestions);setIsPasswordBreached(breached_password);}else if(strength_policy==='luds'){setMissingCharacters(feedback.luds_requirements.missing_characters);setMissingComplexity(feedback.luds_requirements.missing_complexity);setIsPasswordBreached(breached_password);}setInvalidPassword(!valid_password);})["catch"](function(e){setErrorMessage(getTranslatedError(e,_t));});});},[stytchClient.passwords,_t]);var onPasswordChange=function onPasswordChange(password){setPassword(password);updateStrengthCheck(email,password);};var handleSubmit=function handleSubmit(e){var _a,_b;e.preventDefault();setErrorMessage('');setIsSubmitting(true);stytchClient.passwords.create({email:email,password:password,session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.PasswordCreate,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);if(e.error_type==='reset_password'){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordDedupe});});}else{setErrorMessage(getTranslatedError(e,_t));}setIsSubmitting(false);});};return/*#__PURE__*/wn.createElement("form",{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Text,null,_t({id:'password.createAccount.content',message:"Finish creating your account by setting a password."})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:2},/*#__PURE__*/wn.createElement(Label,{htmlFor:"email-input"},_t({id:'formField.email.label',message:"Email"})),/*#__PURE__*/wn.createElement(EmailInput,{email:email,setEmail:setEmail,disableInput:true})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:4},/*#__PURE__*/wn.createElement(Label,{htmlFor:"new-password"},_t({id:'formField.password.label',message:"Password"})),/*#__PURE__*/wn.createElement(PasswordInput,Object.assign({password:password,setPassword:onPasswordChange,type:"new"},passwordProps.input)),/*#__PURE__*/wn.createElement("div",Object.assign({},passwordProps.error),/*#__PURE__*/wn.createElement(PasswordB2CError,{passwordPolicy:strengthPolicy,passwordScore:passwordScore,errorMessage:errorMessage,passwordWarning:passwordWarning,passwordSuggestions:passwordSuggestions,missingCharacters:missingCharacters,missingComplexity:missingComplexity,isPasswordBreached:isPasswordBreached}))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.continue',message:"Continue"}),disabled:invalidPassword})));};var ForgotPassword=He(Text)(_templateObject44||(_templateObject44=_taggedTemplateLiteral(["\n text-decoration: underline;\n cursor: pointer;\n"])));var PasswordAuthenticate=function PasswordAuthenticate(){var _useLingui26=useLingui(),_t=_useLingui26._;var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var _useGlobalReducer17=useGlobalReducer(),_useGlobalReducer18=_slicedToArray2(_useGlobalReducer17,2),state=_useGlobalReducer18[0],dispatch=_useGlobalReducer18[1];var onEvent=useEventCallback();var onError=useErrorCallback();var _h$91=h$5(state.formState.passwordState.email),_h$92=_slicedToArray2(_h$91,2),email=_h$92[0],setEmail=_h$92[1];var _h$93=h$5(''),_h$94=_slicedToArray2(_h$93,2),password=_h$94[0],setPassword=_h$94[1];var _h$95=h$5(''),_h$96=_slicedToArray2(_h$95,2),errorMessage=_h$96[0],setErrorMessage=_h$96[1];var _h$97=h$5(false),_h$98=_slicedToArray2(_h$97,2),isSubmitting=_h$98[0],setIsSubmitting=_h$98[1];var passwordProps=useErrorProps(errorMessage);var handleSubmit=function handleSubmit(e){var _a,_b;e.preventDefault();setErrorMessage('');setIsSubmitting(true);stytchClient.passwords.authenticate({email:email,password:password,session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.PasswordAuthenticate,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);if(e.error_type==='reset_password'){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordDedupe});});}else{setErrorMessage(getTranslatedError(e,_t));}setIsSubmitting(false);});};var onForgot=function onForgot(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordForgot});});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'password.login.title',message:"Log In"})),/*#__PURE__*/wn.createElement("form",{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:2},/*#__PURE__*/wn.createElement(Label,{htmlFor:"email-input"},_t({id:'formField.email.label',message:"Email"})),/*#__PURE__*/wn.createElement(EmailInput,{email:email,setEmail:setEmail,disableInput:true})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:2},/*#__PURE__*/wn.createElement(Label,{htmlFor:"current-password"},_t({id:'formField.password.label',message:"Password"})),/*#__PURE__*/wn.createElement(PasswordInput,Object.assign({password:password,setPassword:setPassword,type:"current"},passwordProps.input)),/*#__PURE__*/wn.createElement(ErrorText,Object.assign({errorMessage:errorMessage},passwordProps.error))),/*#__PURE__*/wn.createElement(Flex,{justifyContent:"flex-end"},/*#__PURE__*/wn.createElement(ForgotPassword,{onClick:onForgot},_t({id:'button.forgotPassword',message:"Forgot Password?"}))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.continue',message:"Continue"})}))));};var PasswordlessCreate=function PasswordlessCreate(){var _useLingui27=useLingui(),_t=_useLingui27._;var _useGlobalReducer19=useGlobalReducer(),_useGlobalReducer20=_slicedToArray2(_useGlobalReducer19,2),state=_useGlobalReducer20[0],dispatch=_useGlobalReducer20[1];var onError=useErrorCallback();var onEvent=useEventCallback();var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var _h$99=h$5(''),_h$100=_slicedToArray2(_h$99,2),errorMessage=_h$100[0],setErrorMessage=_h$100[1];var resetPassword=function resetPassword(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(data){onEvent({type:StytchEventType.PasswordResetByEmailStart,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordSetNew});})["catch"](function(e){onError(e);setErrorMessage(getTranslatedError(e,_t));});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:4},/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:resetPassword,variant:"text"},_t({id:'button.createPasswordInstead',message:"Create a password instead"})),/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:errorMessage}));};var PasswordSecondaryMethod=function PasswordSecondaryMethod(_ref126){var secondaryType=_ref126.secondaryType;var _useLingui28=useLingui(),_t=_useLingui28._;var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer21=useGlobalReducer(),_useGlobalReducer22=_slicedToArray2(_useGlobalReducer21,2),state=_useGlobalReducer22[0],dispatch=_useGlobalReducer22[1];var _h$101=h$5(false),_h$102=_slicedToArray2(_h$101,2),setIsSubmitting=_h$102[1];var onEvent=useEventCallback();var onError=useErrorCallback();var emailOptions=config.emailMagicLinksOptions;var email=state.formState.passwordState.email;var userType=state.formState.passwordState.type;var sendLink=function sendLink(){stytchClient.magicLinks.email.loginOrCreate(email,convertMagicLinkOptions(emailOptions)).then(function(data){onEvent({type:StytchEventType.MagicLinkLoginOrCreateEvent,data:Object.assign(Object.assign({},data),{email:email})});setIsSubmitting(false);dispatch({type:'set_magic_link_email',email:email});dispatch({type:'transition',screen:AppScreens$1.EmailConfirmation});})["catch"](function(e){onError(e);setIsSubmitting(false);});};var sendCode=function sendCode(){var _a,_b,_c;stytchClient.otps.email.loginOrCreate(email,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES,locale:(_c=config.otpOptions)===null||_c===void 0?void 0:_c.locale}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});dispatch({type:'update_otp_state',otpState:{type:OTPMethods.Email,methodId:data.method_id,otpDestination:email}});dispatch({type:'transition',screen:AppScreens$1.OTPAuthenticate});})["catch"](function(e){onError(e);setIsSubmitting(false);});};var buttonText=secondaryType==='eml'?_t({id:'button.emailMagicLink',message:"Email me a login link"}):_t({id:'button.emailOTP',message:"Email me a login code"});var buttonOnClick=secondaryType==='eml'?sendLink:sendCode;var NewUser=function NewUser(){return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'createAccount.title',message:"Choose how you would like to create your account."})),/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:buttonOnClick},buttonText));};var PasswordUser=function PasswordUser(){return/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",onClick:buttonOnClick},buttonText);};var ComponentToUserType={"new":/*#__PURE__*/wn.createElement(NewUser,null),password:/*#__PURE__*/wn.createElement(PasswordUser,null),passwordless:null};return ComponentToUserType[userType];};var Password=function Password(){var _a,_b;var config=useConfig();var stytchClient=useStytch();var onEvent=useEventCallback();var onError=useErrorCallback();var _useGlobalReducer23=useGlobalReducer(),_useGlobalReducer24=_slicedToArray2(_useGlobalReducer23,2),state=_useGlobalReducer24[0],dispatch=_useGlobalReducer24[1];var email=state.formState.passwordState.email;var otpMethods=(_b=(_a=config===null||config===void 0?void 0:config.otpOptions)===null||_a===void 0?void 0:_a.methods)!==null&&_b!==void 0?_b:[];var hasEmailMagicLink=config.products.includes(Products.emailMagicLinks)&&!!config.emailMagicLinksOptions;var hasOTPEmail=otpMethods.includes(OTPMethods.Email);var secondaryType=hasOTPEmail?'otp':hasEmailMagicLink?'eml':'';var userType=state.formState.passwordState.type;var emailOptions=config.emailMagicLinksOptions;var passwordOptions=config.passwordOptions;p$5(function(){var _a,_b;if(userType!=='passwordless'){return;}switch(secondaryType){case'eml':{stytchClient.magicLinks.email.loginOrCreate(email,convertMagicLinkOptions(emailOptions)).then(function(data){onEvent({type:StytchEventType.MagicLinkLoginOrCreateEvent,data:Object.assign(Object.assign({},data),{email:email})});dispatch({type:'set_magic_link_email',email:email});})["catch"](function(e){onError(e);});return;}case'otp':{stytchClient.otps.email.loginOrCreate(email,{expiration_minutes:(_b=(_a=config.otpOptions)===null||_a===void 0?void 0:_a.expirationMinutes)!==null&&_b!==void 0?_b:DEFAULT_OTP_EXPIRATION_MINUTES}).then(function(data){onEvent({type:StytchEventType.OTPsLoginOrCreateEvent,data:data});dispatch({type:'update_otp_state',otpState:{type:OTPMethods.Email,methodId:data.method_id,otpDestination:email}});})["catch"](function(e){onError(e);});return;}default:{stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(data){onEvent({type:StytchEventType.PasswordResetByEmailStart,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordSetNew});})["catch"](function(e){onError(e);});return;}}},[userType,secondaryType]);var ComponentToUserType={"new":(/*#__PURE__*/wn.createElement(wn.Fragment,null,secondaryType&&(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(PasswordSecondaryMethod,{secondaryType:secondaryType}),/*#__PURE__*/wn.createElement(Divider,null))),/*#__PURE__*/wn.createElement(PasswordNewUser,null))),password:(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(PasswordAuthenticate,null),secondaryType&&(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(Divider,null),/*#__PURE__*/wn.createElement(PasswordSecondaryMethod,{secondaryType:secondaryType}))))),passwordless:(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(wn.Fragment,null,secondaryType&&(/*#__PURE__*/wn.createElement(wn.Fragment,null,secondaryType==='eml'?/*#__PURE__*/wn.createElement(EmailConfirmation,null):/*#__PURE__*/wn.createElement(OTPAuthenticate,{hideBackArrow:true}),/*#__PURE__*/wn.createElement(Divider,null),/*#__PURE__*/wn.createElement(PasswordlessCreate,null))))))};return/*#__PURE__*/wn.createElement(Flex,{gap:24,direction:"column"},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),ComponentToUserType[userType]);};var ImageContainer$1=He(Flex)(_templateObject45||(_templateObject45=_taggedTemplateLiteral(["\n > div {\n height: 200px;\n width: 200px;\n }\n"])));var ConnectWallet=function ConnectWallet(){var _useLingui29=useLingui(),_t=_useLingui29._;var onEvent=useEventCallback();var onError=useErrorCallback();var handleError=function handleError(){onError({message:'[Error] Could not connect to wallet'});dispatch({type:'transition',screen:AppScreens$1.CryptoError});};var stytchClient=useStytch();var _useGlobalReducer25=useGlobalReducer(),_useGlobalReducer26=_slicedToArray2(_useGlobalReducer25,2),state=_useGlobalReducer26[0],dispatch=_useGlobalReducer26[1];var walletOption=state.formState.cryptoState.walletOption;var walletType=isSolanaWallet(walletOption)?'solana':'ethereum';var onConnectWallet=function onConnectWallet(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee100(){var address;return _regenerator2().w(function(_context100){while(1)switch(_context100.n){case 0:_context100.n=1;return connectWithWallet({wallet:walletOption});case 1:address=_context100.v;stytchClient.cryptoWallets.authenticateStart({crypto_wallet_address:address,crypto_wallet_type:walletType}).then(function(data){onEvent({type:StytchEventType.CryptoWalletAuthenticateStart,data:data});dispatch({type:'update_crypto_state',cryptoState:{walletAddress:address,walletChallenge:data.challenge,walletOption:walletOption}});dispatch({type:'transition',screen:AppScreens$1.CryptoSignMessage});})["catch"](handleError);case 2:return _context100.a(2);}},_callee100);}));};p$5(function(){onConnectWallet();},[]);var WalletImage=WalletToIcon[walletOption];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.connectWallet.title',message:"Connecting to your wallet..."})),/*#__PURE__*/wn.createElement(ImageContainer$1,{justifyContent:"center"},/*#__PURE__*/wn.createElement(WalletImage,null)),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.connectWallet.instructionPopup',message:"Complete sign in by connecting through the wallet pop up in the right corner of your screen."})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.troubleHelp',message:"Having trouble? Use the back arrow to return to the main screen and try logging in again."})));};var ImageContainer=He(Flex)(_templateObject46||(_templateObject46=_taggedTemplateLiteral(["\n > div {\n height: 200px;\n width: 200px;\n }\n"])));var SignMessage=function SignMessage(){var _useLingui30=useLingui(),_t=_useLingui30._;var onEvent=useEventCallback();var onError=useErrorCallback();var handleError=function handleError(){onError({message:'[Error] Could not sign message'});dispatch({type:'transition',screen:AppScreens$1.CryptoError});};var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer27=useGlobalReducer(),_useGlobalReducer28=_slicedToArray2(_useGlobalReducer27,2),state=_useGlobalReducer28[0],dispatch=_useGlobalReducer28[1];var _state$formState$cryp=state.formState.cryptoState,walletChallenge=_state$formState$cryp.walletChallenge,walletAddress=_state$formState$cryp.walletAddress,walletOption=_state$formState$cryp.walletOption;var walletType=isSolanaWallet(walletOption)?'solana':'ethereum';var onSignWallet=function onSignWallet(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee101(){var _a,_b,signature;return _regenerator2().w(function(_context101){while(1)switch(_context101.n){case 0:_context101.n=1;return signMessageWithWallet({wallet:walletOption,message:walletChallenge,address:walletAddress});case 1:signature=_context101.v;stytchClient.cryptoWallets.authenticate({crypto_wallet_address:walletAddress,crypto_wallet_type:walletType,signature:signature,session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){onEvent({type:StytchEventType.CryptoWalletAuthenticate,data:data});dispatch({type:'transition',screen:AppScreens$1.CryptoConfirmation});})["catch"](handleError);case 2:return _context101.a(2);}},_callee101);}));};p$5(function(){onSignWallet();},[]);var WalletImage=WalletToIcon[walletOption];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.signMessage.title',message:"Completing signature request..."})),/*#__PURE__*/wn.createElement(ImageContainer,{justifyContent:"center"},/*#__PURE__*/wn.createElement(WalletImage,null)),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.signMessage.instruction',message:"Complete the signature request through the wallet pop up in the right corner of your screen."})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.troubleHelp',message:"Having trouble? Use the back arrow to return to the main screen and try logging in again."})));};var WalletIcon=function WalletIcon(_ref127){var icon=_ref127.icon,name=_ref127.name,link=_ref127.link;return/*#__PURE__*/wn.createElement("a",{href:link,target:"_blank",rel:"noreferrer",style:{textDecoration:'none',color:'inherit'}},/*#__PURE__*/wn.createElement("div",{style:{display:'flex',flexDirection:'column',justifyContent:'center',alignItems:'center'}},icon,/*#__PURE__*/wn.createElement("span",null,name)));};var SetupNewWallet=function SetupNewWallet(){var _useLingui31=useLingui(),_t=_useLingui31._;var _useGlobalReducer29=useGlobalReducer(),_useGlobalReducer30=_slicedToArray2(_useGlobalReducer29,2),dispatch=_useGlobalReducer30[1];var WalletIconComponent=function WalletIconComponent(_ref128){var wallet=_ref128.wallet;var Icon=WalletToIcon[wallet];return/*#__PURE__*/wn.createElement(Icon,null);};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.setupNewWallet.title',message:"Set up a new crypto wallet"})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.setupNewWallet.content',message:"Signing in with a crypto wallet can help keep your account private and secure."})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.setupNewWallet.instruction',message:"Get started by downloading any Ethereum or Solana wallet. We\u2019ve included a few examples of wallet extensions you can find below. Once you\u2019ve set up your wallet, you can use it to sign in!"})),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(Flex,{justifyContent:"space-evenly"},/*#__PURE__*/wn.createElement(WalletIcon,{icon:/*#__PURE__*/wn.createElement(WalletIconComponent,{wallet:Wallets.Metamask}),name:_t({id:'crypto.wallet.metamask',message:"Metamask"}),link:"https://metamask.io/"}),/*#__PURE__*/wn.createElement(WalletIcon,{icon:/*#__PURE__*/wn.createElement(WalletIconComponent,{wallet:Wallets.Phantom}),name:_t({id:'crypto.wallet.phantom',message:"Phantom"}),link:"https://phantom.app/"})),/*#__PURE__*/wn.createElement(Flex,{justifyContent:"space-evenly"},/*#__PURE__*/wn.createElement(WalletIcon,{icon:/*#__PURE__*/wn.createElement(WalletIconComponent,{wallet:Wallets.Coinbase}),name:_t({id:'crypto.wallet.coinbase',message:"Coinbase"}),link:"https://www.coinbase.com/wallet"}),/*#__PURE__*/wn.createElement(WalletIcon,{icon:/*#__PURE__*/wn.createElement(WalletIconComponent,{wallet:Wallets.Binance}),name:_t({id:'crypto.wallet.binance',message:"Binance"}),link:"https://www.bnbchain.world/en/binance-wallet"}))));};var OtherCryptoWallets=function OtherCryptoWallets(){var _useLingui32=useLingui(),_t=_useLingui32._;var _useGlobalReducer31=useGlobalReducer(),_useGlobalReducer32=_slicedToArray2(_useGlobalReducer31,2),dispatch=_useGlobalReducer32[1];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.continueWithOtherWallet.title',message:"Continue with other wallet"})),/*#__PURE__*/wn.createElement(CryptoWalletButtons,{type:"other"}));};var Success=function Success(){var _useLingui33=useLingui(),_t=_useLingui33._;var _useGlobalReducer33=useGlobalReducer(),_useGlobalReducer34=_slicedToArray2(_useGlobalReducer33,2),dispatch=_useGlobalReducer34[1];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Confirmation,{header:_t({id:'crypto.success.title',message:"Success!"}),text:_t({id:'crypto.success.content',message:"You have successfully connected your wallet."})}));};var Error$1=function Error$1(){var _useLingui34=useLingui(),_t=_useLingui34._;var _useGlobalReducer35=useGlobalReducer(),_useGlobalReducer36=_slicedToArray2(_useGlobalReducer35,2),dispatch=_useGlobalReducer36[1];return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'crypto.error.title',message:"Looks like there was an error!"})),/*#__PURE__*/wn.createElement(Text,null,_t({id:'crypto.error.content',message:"Your sign in request could not be completed. Use the back arrow to return to the log in screen and try again!"})));};var e={data:""},t=function t(_t24){if("object"==(typeof window==="undefined"?"undefined":_typeof2(window))){var _e3=(_t24?_t24.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return _e3.nonce=window.__nonce__,_e3.parentNode||(_t24||document.head).appendChild(_e3),_e3.firstChild;}return _t24||e;},l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,_o2=function o(e,t){var r="",l="",a="";var _loop3=function _loop3(_n5){var c=e[_n5];"@"==_n5[0]?"i"==_n5[1]?r=_n5+" "+c+";":l+="f"==_n5[1]?_o2(c,_n5):_n5+"{"+_o2(c,"k"==_n5[1]?"":t)+"}":"object"==_typeof2(c)?l+=_o2(c,t?t.replace(/([^,])+/g,function(e){return _n5.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,function(t){return /&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t;});}):_n5):null!=c&&(_n5=/^--/.test(_n5)?_n5:_n5.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=_o2.p?_o2.p(_n5,c):_n5+":"+c+";");};for(var _n5 in e){_loop3(_n5);}return r+(t&&a?t+"{"+a+"}":a)+l;},c={},_s=function s(e){if("object"==_typeof2(e)){var _t25="";for(var _r4 in e)_t25+=_r4+_s(e[_r4]);return _t25;}return e;},i=function i(e,t,r,_i5,p){var u=_s(e),d=c[u]||(c[u]=function(e){var t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r;}(u));if(!c[d]){var _t26=u!==e?e:function(e){var t,r,o=[{}];for(;t=l.exec(e.replace(a,""));)t[4]?o.shift():t[3]?(r=t[3].replace(n$1," ").trim(),o.unshift(o[0][r]=o[0][r]||{})):o[0][t[1]]=t[2].replace(n$1," ").trim();return o[0];}(e);c[d]=_o2(p?_defineProperty({},"@keyframes "+d,_t26):_t26,r?"":"."+d);}var f=r&&c.g?c.g:null;return r&&(c.g=c[d]),function(e,t,r,l){l?t.data=t.data.replace(l,e):-1===t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);}(c[d],t,_i5,f),d;},p=function p(e,t,r){return e.reduce(function(e,l,a){var n=t[a];if(n&&n.call){var _e4=n(r),_t27=_e4&&_e4.props&&_e4.props.className||/^go/.test(_e4)&&_e4;n=_t27?"."+_t27:_e4&&"object"==_typeof2(_e4)?_e4.props?"":_o2(_e4,""):!1===_e4?"":_e4;}return e+l+(null==n?"":n);},"");};function u$1(e){var r=this||{},l=e.call?e(r.p):e;return i(l.unshift?l.raw?p(l,[].slice.call(arguments,1),r.p):l.reduce(function(e,t){return Object.assign(e,t&&t.call?t(r.p):t);},{}):l,t(r.target),r.g,r.o,r.k);}var d,f,g;u$1.bind({g:1});var h$1=u$1.bind({k:1});function m(e,t,r,l){_o2.p=t,d=e,f=r,g=l;}function w$1(e,t){var r=this||{};return function(){var l=arguments;function a(n,o){var c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=u$1.apply(r,l)+(s?" "+s:"");var i=e;return e[0]&&(i=c.as||e,delete c.as),g&&i[0]&&g(c),d(i,c);}return a;};}var W=function W(e){return typeof e=="function";},T=function T(e,t){return W(e)?e(t):e;};var U=function(){var e=0;return function(){return(++e).toString();};}(),b=function(){var e;return function(){if(e===void 0&&(typeof window==="undefined"?"undefined":_typeof2(window))<"u"){var _t28=matchMedia("(prefers-reduced-motion: reduce)");e=!_t28||_t28.matches;}return e;};}();var Q=20;var S=new Map(),X=1e3,$=function $(e){if(S.has(e))return;var t=setTimeout(function(){S["delete"](e),u({type:4,toastId:e});},X);S.set(e,t);},J=function J(e){var t=S.get(e);t&&clearTimeout(t);},_v=function v(e,t){switch(t.type){case 0:return _objectSpread(_objectSpread({},e),{},{toasts:[t.toast].concat(_toConsumableArray2(e.toasts)).slice(0,Q)});case 1:return t.toast.id&&J(t.toast.id),_objectSpread(_objectSpread({},e),{},{toasts:e.toasts.map(function(r){return r.id===t.toast.id?_objectSpread(_objectSpread({},r),t.toast):r;})});case 2:var o=t.toast;return e.toasts.find(function(r){return r.id===o.id;})?_v(e,{type:1,toast:o}):_v(e,{type:0,toast:o});case 3:var s=t.toastId;return s?$(s):e.toasts.forEach(function(r){$(r.id);}),_objectSpread(_objectSpread({},e),{},{toasts:e.toasts.map(function(r){return r.id===s||s===void 0?_objectSpread(_objectSpread({},r),{},{visible:!1}):r;})});case 4:return t.toastId===void 0?_objectSpread(_objectSpread({},e),{},{toasts:[]}):_objectSpread(_objectSpread({},e),{},{toasts:e.toasts.filter(function(r){return r.id!==t.toastId;})});case 5:return _objectSpread(_objectSpread({},e),{},{pausedAt:t.time});case 6:var _a2=t.time-(e.pausedAt||0);return _objectSpread(_objectSpread({},e),{},{pausedAt:void 0,toasts:e.toasts.map(function(r){return _objectSpread(_objectSpread({},r),{},{pauseDuration:r.pauseDuration+_a2});})});}},A=[],P={toasts:[],pausedAt:void 0},u=function u(e){P=_v(P,e),A.forEach(function(t){t(P);});},Y={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},I=function I(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _h$103=h$5(P),_h$104=_slicedToArray2(_h$103,2),t=_h$104[0],o=_h$104[1];p$5(function(){return A.push(o),function(){var a=A.indexOf(o);a>-1&&A.splice(a,1);};},[t]);var s=t.toasts.map(function(a){var r,c;return _objectSpread(_objectSpread(_objectSpread(_objectSpread({},e),e[a.type]),a),{},{duration:a.duration||((r=e[a.type])==null?void 0:r.duration)||(e==null?void 0:e.duration)||Y[a.type],style:_objectSpread(_objectSpread(_objectSpread({},e.style),(c=e[a.type])==null?void 0:c.style),a.style)});});return _objectSpread(_objectSpread({},t),{},{toasts:s});};var G=function G(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"blank";var o=arguments.length>2?arguments[2]:undefined;return _objectSpread(_objectSpread({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0},o),{},{id:(o==null?void 0:o.id)||U()});},h=function h(e){return function(t,o){var s=G(t,e,o);return u({type:2,toast:s}),s.id;};},n=function n(e,t){return h("blank")(e,t);};n.error=h("error");n.success=h("success");n.loading=h("loading");n.custom=h("custom");n.dismiss=function(e){u({type:3,toastId:e});};n.remove=function(e){return u({type:4,toastId:e});};n.promise=function(e,t,o){var s=n.loading(t.loading,_objectSpread(_objectSpread({},o),o==null?void 0:o.loading));return e.then(function(a){return n.success(T(t.success,a),_objectSpread(_objectSpread({id:s},o),o==null?void 0:o.success)),a;})["catch"](function(a){n.error(T(t.error,a),_objectSpread(_objectSpread({id:s},o),o==null?void 0:o.error));}),e;};var Z=function Z(e,t){u({type:1,toast:{id:e,height:t}});},ee=function ee(){u({type:5,time:Date.now()});},D=function D(e){var _I=I(e),t=_I.toasts,o=_I.pausedAt;p$5(function(){if(o)return;var r=Date.now(),c=t.map(function(i){if(i.duration===1/0)return;var d=(i.duration||0)+i.pauseDuration-(r-i.createdAt);if(d<0){i.visible&&n.dismiss(i.id);return;}return setTimeout(function(){return n.dismiss(i.id);},d);});return function(){c.forEach(function(i){return i&&clearTimeout(i);});};},[t,o]);var s=T$3(function(){o&&u({type:6,time:Date.now()});},[o]),a=T$3(function(r,c){var _g$filter;var _ref130=c||{},_ref130$reverseOrder=_ref130.reverseOrder,i=_ref130$reverseOrder===void 0?!1:_ref130$reverseOrder,_ref130$gutter=_ref130.gutter,d=_ref130$gutter===void 0?8:_ref130$gutter,p=_ref130.defaultPosition,g=t.filter(function(m){return(m.position||p)===(r.position||p)&&m.height;}),E=g.findIndex(function(m){return m.id===r.id;}),x=g.filter(function(m,R){return R<E&&m.visible;}).length;return(_g$filter=g.filter(function(m){return m.visible;})).slice.apply(_g$filter,_toConsumableArray2(i?[x+1]:[0,x])).reduce(function(m,R){return m+(R.height||0)+d;},0);},[t]);return{toasts:t,handlers:{updateHeight:Z,startPause:ee,endPause:s,calculateOffset:a}};};var oe=h$1(_templateObject47||(_templateObject47=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0) rotate(45deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(45deg);\n opacity: 1;\n}"]))),re=h$1(_templateObject48||(_templateObject48=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0);\n opacity: 0;\n}\nto {\n transform: scale(1);\n opacity: 1;\n}"]))),se=h$1(_templateObject49||(_templateObject49=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0) rotate(90deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(90deg);\n\topacity: 1;\n}"]))),_=w$1("div")(_templateObject50||(_templateObject50=_taggedTemplateLiteral(["\n width: 20px;\n opacity: 0;\n height: 20px;\n border-radius: 10px;\n background: ",";\n position: relative;\n transform: rotate(45deg);\n\n animation: "," 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n animation-delay: 100ms;\n\n &:after,\n &:before {\n content: '';\n animation: "," 0.15s ease-out forwards;\n animation-delay: 150ms;\n position: absolute;\n border-radius: 3px;\n opacity: 0;\n background: ",";\n bottom: 9px;\n left: 4px;\n height: 2px;\n width: 12px;\n }\n\n &:before {\n animation: "," 0.15s ease-out forwards;\n animation-delay: 180ms;\n transform: rotate(90deg);\n }\n"])),function(e){return e.primary||"#ff4b4b";},oe,re,function(e){return e.secondary||"#fff";},se);var ne=h$1(_templateObject51||(_templateObject51=_taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"]))),V=w$1("div")(_templateObject52||(_templateObject52=_taggedTemplateLiteral(["\n width: 12px;\n height: 12px;\n box-sizing: border-box;\n border: 2px solid;\n border-radius: 100%;\n border-color: ",";\n border-right-color: ",";\n animation: "," 1s linear infinite;\n"])),function(e){return e.secondary||"#e0e0e0";},function(e){return e.primary||"#616161";},ne);var pe=h$1(_templateObject53||(_templateObject53=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0) rotate(45deg);\n\topacity: 0;\n}\nto {\n transform: scale(1) rotate(45deg);\n\topacity: 1;\n}"]))),de=h$1(_templateObject54||(_templateObject54=_taggedTemplateLiteral(["\n0% {\n\theight: 0;\n\twidth: 0;\n\topacity: 0;\n}\n40% {\n height: 0;\n\twidth: 6px;\n\topacity: 1;\n}\n100% {\n opacity: 1;\n height: 10px;\n}"]))),w=w$1("div")(_templateObject55||(_templateObject55=_taggedTemplateLiteral(["\n width: 20px;\n opacity: 0;\n height: 20px;\n border-radius: 10px;\n background: ",";\n position: relative;\n transform: rotate(45deg);\n\n animation: "," 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n animation-delay: 100ms;\n &:after {\n content: '';\n box-sizing: border-box;\n animation: "," 0.2s ease-out forwards;\n opacity: 0;\n animation-delay: 200ms;\n position: absolute;\n border-right: 2px solid;\n border-bottom: 2px solid;\n border-color: ",";\n bottom: 6px;\n left: 6px;\n height: 10px;\n width: 6px;\n }\n"])),function(e){return e.primary||"#61d345";},pe,de,function(e){return e.secondary||"#fff";});var ue=w$1("div")(_templateObject56||(_templateObject56=_taggedTemplateLiteral(["\n position: absolute;\n"]))),le=w$1("div")(_templateObject57||(_templateObject57=_taggedTemplateLiteral(["\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 20px;\n min-height: 20px;\n"]))),Te=h$1(_templateObject58||(_templateObject58=_taggedTemplateLiteral(["\nfrom {\n transform: scale(0.6);\n opacity: 0.4;\n}\nto {\n transform: scale(1);\n opacity: 1;\n}"]))),fe=w$1("div")(_templateObject59||(_templateObject59=_taggedTemplateLiteral(["\n position: relative;\n transform: scale(0.6);\n opacity: 0.4;\n min-width: 20px;\n animation: "," 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)\n forwards;\n"])),Te),M=function M(_ref131){var e=_ref131.toast;var t=e.icon,o=e.type,s=e.iconTheme;return t!==void 0?typeof t=="string"?y$3(fe,null,t):t:o==="blank"?null:y$3(le,null,y$3(V,_objectSpread({},s)),o!=="loading"&&y$3(ue,null,o==="error"?y$3(_,_objectSpread({},s)):y$3(w,_objectSpread({},s))));};var ye=function ye(e){return"\n0% {transform: translate3d(0,".concat(e*-200,"%,0) scale(.6); opacity:.5;}\n100% {transform: translate3d(0,0,0) scale(1); opacity:1;}\n");},ge=function ge(e){return"\n0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}\n100% {transform: translate3d(0,".concat(e*-150,"%,-1px) scale(.6); opacity:0;}\n");},he="0%{opacity:0;} 100%{opacity:1;}",xe="0%{opacity:1;} 100%{opacity:0;}",be=w$1("div")(_templateObject60||(_templateObject60=_taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n background: #fff;\n color: #363636;\n line-height: 1.3;\n will-change: transform;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);\n max-width: 350px;\n pointer-events: auto;\n padding: 8px 10px;\n border-radius: 8px;\n"]))),Se=w$1("div")(_templateObject61||(_templateObject61=_taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n margin: 4px 10px;\n color: inherit;\n flex: 1 1 auto;\n white-space: pre-line;\n"]))),Ae=function Ae(e,t){var s=e.includes("top")?1:-1,_ref132=b()?[he,xe]:[ye(s),ge(s)],_ref133=_slicedToArray2(_ref132,2),a=_ref133[0],r=_ref133[1];return{animation:t?"".concat(h$1(a)," 0.35s cubic-bezier(.21,1.02,.73,1) forwards"):"".concat(h$1(r)," 0.4s forwards cubic-bezier(.06,.71,.55,1)")};},F=w$5(function(_ref134){var e=_ref134.toast,t=_ref134.position,o=_ref134.style,s=_ref134.children;var a=e.height?Ae(e.position||t||"top-center",e.visible):{opacity:0},r=y$3(M,{toast:e}),c=y$3(Se,_objectSpread({},e.ariaProps),T(e.message,e));return y$3(be,{className:e.className,style:_objectSpread(_objectSpread(_objectSpread({},a),o),e.style)},typeof s=="function"?s({icon:r,message:c}):y$3(g$7,null,r,c));});m(y$3);var Ee=function Ee(_ref135){var e=_ref135.id,t=_ref135.className,o=_ref135.style,s=_ref135.onHeightUpdate,a=_ref135.children;var r=T$3(function(c){if(c){var _i6=function _i6(){var d=c.getBoundingClientRect().height;s(e,d);};_i6(),new MutationObserver(_i6).observe(c,{subtree:!0,childList:!0,characterData:!0});}},[e,s]);return y$3("div",{ref:r,className:t,style:o},a);},Re=function Re(e,t){var o=e.includes("top"),s=o?{top:0}:{bottom:0},a=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return _objectSpread(_objectSpread({left:0,right:0,display:"flex",position:"absolute",transition:b()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:"translateY(".concat(t*(o?1:-1),"px)")},s),a);},ve=u$1(_templateObject62||(_templateObject62=_taggedTemplateLiteral(["\n z-index: 9999;\n > * {\n pointer-events: auto;\n }\n"]))),O=16,Ie=function Ie(_ref136){var e=_ref136.reverseOrder,_ref136$position=_ref136.position,t=_ref136$position===void 0?"top-center":_ref136$position,o=_ref136.toastOptions,s=_ref136.gutter,a=_ref136.children,r=_ref136.containerStyle,c=_ref136.containerClassName;var _D=D(o),i=_D.toasts,d=_D.handlers;return y$3("div",{style:_objectSpread({position:"fixed",zIndex:9999,top:O,left:O,right:O,bottom:O,pointerEvents:"none"},r),className:c,onMouseEnter:d.startPause,onMouseLeave:d.endPause},i.map(function(p){var g=p.position||t,E=d.calculateOffset(p,{reverseOrder:e,gutter:s,defaultPosition:t}),x=Re(g,E);return y$3(Ee,{id:p.id,key:p.id,onHeightUpdate:d.updateHeight,className:p.visible?ve:"",style:x},p.type==="custom"?T(p.message,p):a?a(p):y$3(F,{toast:p,position:g}));}));};var _t=n;var MagicLinkOption=function MagicLinkOption(){var _useLingui35=useLingui(),_t=_useLingui35._;var _useGlobalReducer37=useGlobalReducer(),_useGlobalReducer38=_slicedToArray2(_useGlobalReducer37,2),state=_useGlobalReducer38[0],dispatch=_useGlobalReducer38[1];var stytchClient=useStytch();var config=useConfig();var emailMagicLinksOptions=config.emailMagicLinksOptions;var email=state.formState.passwordState.email;var sendMagicLink=function sendMagicLink(){stytchClient.magicLinks.email.loginOrCreate(email,convertMagicLinkOptions(emailMagicLinksOptions)).then(function(){dispatch({type:'transition',screen:AppScreens$1.EmailConfirmation});});};return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(Divider,null),/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",onClick:sendMagicLink},_t({id:'button.loginWithoutPassword',message:"Login without a password"})));};var ResendButton$3=function ResendButton$3(_ref137){var onClick=_ref137.onClick,children=_ref137.children;return/*#__PURE__*/wn.createElement("button",{onClick:onClick,style:{all:'unset'}},/*#__PURE__*/wn.createElement("b",{style:{cursor:'pointer'}},children));};var PasswordForgot=function PasswordForgot(){var _useLingui36=useLingui(),_t$1=_useLingui36._;var _useGlobalReducer39=useGlobalReducer(),_useGlobalReducer40=_slicedToArray2(_useGlobalReducer39,2),state=_useGlobalReducer40[0],dispatch=_useGlobalReducer40[1];var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var resendResetPassword=function resendResetPassword(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee102(){return _regenerator2().w(function(_context102){while(1)switch(_context102.n){case 0:readB2CInternals(stytchClient).networkClient.logEvent({name:'email_try_again_clicked',details:{email:email,type:EmailSentType.ResetPassword}});stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){return _t.success(_t$1({id:'toast.emailResent',message:"Email resent"}));});case 1:return _context102.a(2);}},_callee102);}));};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'password.forgot.title',message:"Forgot password?"})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.forgot.content",message:"A link to reset your password was sent to you at <bold>{email}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.didntGetItResend",message:"Didn't get it? <resendButton>Resend email</resendButton>",components:{resendButton:/*#__PURE__*/wn.createElement(ResendButton$3,{onClick:resendResetPassword})}})),/*#__PURE__*/wn.createElement(MagicLinkOption,null));};var ResendButton$2=function ResendButton$2(_ref138){var onClick=_ref138.onClick,children=_ref138.children;return/*#__PURE__*/wn.createElement("button",{type:"button",onClick:onClick,style:{all:'unset'}},/*#__PURE__*/wn.createElement("b",{style:{cursor:'pointer'}},children));};var PasswordBreached=function PasswordBreached(){var _useLingui37=useLingui(),_t$1=_useLingui37._;var _useGlobalReducer41=useGlobalReducer(),_useGlobalReducer42=_slicedToArray2(_useGlobalReducer41,2),state=_useGlobalReducer42[0],dispatch=_useGlobalReducer42[1];var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var resendResetPassword=function resendResetPassword(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){return _t.success(_t$1({id:'toast.emailResent',message:"Email resent"}));});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'password.breached.title',message:"Check your email to set a new password"})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.breached.content",message:"A different site where you use the same password had a security issue recently. For your safety, an email was sent to you at <bold>{email}</bold> to reset your password.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.didntGetItResend",message:"Didn't get it? <resendButton>Resend email</resendButton>",components:{resendButton:/*#__PURE__*/wn.createElement(ResendButton$2,{onClick:resendResetPassword})}})),/*#__PURE__*/wn.createElement(MagicLinkOption,null));};var ResendButton$1=function ResendButton$1(_ref139){var onClick=_ref139.onClick,children=_ref139.children;return/*#__PURE__*/wn.createElement("button",{onClick:onClick,style:{all:'unset'}},/*#__PURE__*/wn.createElement("b",{style:{cursor:'pointer'}},children));};var PasswordSetNew=function PasswordSetNew(){var _useLingui38=useLingui(),_t$1=_useLingui38._;var _useGlobalReducer43=useGlobalReducer(),_useGlobalReducer44=_slicedToArray2(_useGlobalReducer43,2),state=_useGlobalReducer44[0],dispatch=_useGlobalReducer44[1];var onError=useErrorCallback();var onEvent=useEventCallback();var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var resendResetPassword=function resendResetPassword(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(data){_t.success(_t$1({id:'toast.emailResent',message:"Email resent"}));onEvent({type:StytchEventType.PasswordResetByEmailStart,data:data});})["catch"](function(e){onError(e);});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'password.setNew.title',message:"Check your email!"})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.setNew.content",message:"A login link was sent to you at <bold>{email}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.didntGetItResend",message:"Didn't get it? <resendButton>Resend email</resendButton>",components:{resendButton:/*#__PURE__*/wn.createElement(ResendButton$1,{onClick:resendResetPassword})}})));};var ResendButton=function ResendButton(_ref140){var onClick=_ref140.onClick,children=_ref140.children;return/*#__PURE__*/wn.createElement("button",{onClick:onClick,style:{all:'unset'}},/*#__PURE__*/wn.createElement("b",{style:{cursor:'pointer'}},children));};var PasswordDedupe=function PasswordDedupe(){var _useLingui39=useLingui(),_t$1=_useLingui39._;var _useGlobalReducer45=useGlobalReducer(),_useGlobalReducer46=_slicedToArray2(_useGlobalReducer45,2),state=_useGlobalReducer46[0],dispatch=_useGlobalReducer46[1];var stytchClient=useStytch();var config=useConfig();var passwordOptions=config.passwordOptions;var email=state.formState.passwordState.email;var resendResetPassword=function resendResetPassword(){stytchClient.passwords.resetByEmailStart(convertPasswordResetOptions(email,passwordOptions)).then(function(){return _t.success(_t$1({id:'toast.emailResent',message:"Email resent"}));});};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(BackArrow,{onClick:function onClick(){return dispatch({type:'transition',screen:AppScreens$1.Main});}}),/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'password.resetRequired.title',message:"Check your email to set a new password!"})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.resetRequired.content",message:"We want to make sure your account is secure and that it's really you logging in! A login link was sent to you at <bold>{email}</bold>.",components:{bold:/*#__PURE__*/wn.createElement("b",null)},values:{email:email}})),/*#__PURE__*/wn.createElement(Text,null,/*#__PURE__*/wn.createElement(Trans,{id:"password.didntGetItResend",message:"Didn't get it? <resendButton>Resend email</resendButton>",components:{resendButton:/*#__PURE__*/wn.createElement(ResendButton,{onClick:resendResetPassword})}})),/*#__PURE__*/wn.createElement(MagicLinkOption,null));};var Form=He.form(_templateObject63||(_templateObject63=_taggedTemplateLiteral(["\n width: 100%;\n"])));var ResetPasswordScreen=function ResetPasswordScreen(){var _useLingui40=useLingui(),_t=_useLingui40._;var stytchClient=useStytch();var config=useConfig();var _useGlobalReducer47=useGlobalReducer(),_useGlobalReducer48=_slicedToArray2(_useGlobalReducer47,2),state=_useGlobalReducer48[0],dispatch=_useGlobalReducer48[1];var passwordToken=state.formState.resetPasswordState.token;var onEvent=useEventCallback();var onError=useErrorCallback();var resetTokenType=F$4(function(){var _a;var parsed=stytchClient.parseAuthenticateUrl();return(_a=parsed===null||parsed===void 0?void 0:parsed.tokenType)!==null&&_a!==void 0?_a:'';},[stytchClient]);var _h$105=h$5(''),_h$106=_slicedToArray2(_h$105,2),password=_h$106[0],setPassword=_h$106[1];var _h$107=h$5(''),_h$108=_slicedToArray2(_h$107,2),errorMessage=_h$108[0],setErrorMessage=_h$108[1];var _h$109=h$5(0),_h$110=_slicedToArray2(_h$109,2),passwordScore=_h$110[0],setPasswordScore=_h$110[1];var _h$111=h$5(''),_h$112=_slicedToArray2(_h$111,2),passwordWarning=_h$112[0],setPasswordWarning=_h$112[1];var _h$113=h$5([]),_h$114=_slicedToArray2(_h$113,2),passwordSuggestions=_h$114[0],setPasswordSuggestions=_h$114[1];var _h$115=h$5(true),_h$116=_slicedToArray2(_h$115,2),invalidPassword=_h$116[0],setInvalidPassword=_h$116[1];var _h$117=h$5(false),_h$118=_slicedToArray2(_h$117,2),isSubmitting=_h$118[0],setIsSubmitting=_h$118[1];var _h$119=h$5('none'),_h$120=_slicedToArray2(_h$119,2),strengthPolicy=_h$120[0],setStrengthPolicy=_h$120[1];var _h$121=h$5(0),_h$122=_slicedToArray2(_h$121,2),missingCharacters=_h$122[0],setMissingCharacters=_h$122[1];var _h$123=h$5(0),_h$124=_slicedToArray2(_h$123,2),missingComplexity=_h$124[0],setMissingComplexity=_h$124[1];var _h$125=h$5(false),_h$126=_slicedToArray2(_h$125,2),isPasswordBreached=_h$126[0],setIsPasswordBreached=_h$126[1];var _h$127=h$5(''),_h$128=_slicedToArray2(_h$127,2),loginErrorMessage=_h$128[0],setLoginErrorMessage=_h$128[1];var _h$129=h$5(false),_h$130=_slicedToArray2(_h$129,2),isLoggingIn=_h$130[0],setIsLoggingIn=_h$130[1];var passwordProps=useErrorProps(errorMessage);var updateStrengthCheck=F$4(function(){return debounce(function(password){return stytchClient.passwords.strengthCheck({password:password}).then(function(_ref141){var score=_ref141.score,feedback=_ref141.feedback,valid_password=_ref141.valid_password,strength_policy=_ref141.strength_policy,breached_password=_ref141.breached_password;setStrengthPolicy(strength_policy);setInvalidPassword(!valid_password);if(strength_policy==='zxcvbn'){setPasswordScore(score);setPasswordWarning(feedback.warning);setPasswordSuggestions(feedback.suggestions);setIsPasswordBreached(breached_password);}else if(strength_policy==='luds'){setMissingCharacters(feedback.luds_requirements.missing_characters);setMissingComplexity(feedback.luds_requirements.missing_complexity);setIsPasswordBreached(breached_password);}});});},[stytchClient.passwords]);p$5(function(){var _a,_b;if(resetTokenType==='login'){stytchClient.magicLinks.authenticate(passwordToken,{session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);});}},[resetTokenType]);var onPasswordChange=function onPasswordChange(password){setPassword(password);updateStrengthCheck(password);};var handleSubmit=function handleSubmit(e){var _a,_b;e.preventDefault();setErrorMessage('');setIsSubmitting(true);stytchClient.passwords.resetByEmail({token:passwordToken,password:password,session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){setIsSubmitting(false);onEvent({type:StytchEventType.PasswordResetByEmail,data:data});dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);setErrorMessage(getTranslatedError(e,_t));setIsSubmitting(false);});};var handleLogin=function handleLogin(){var _a,_b;setLoginErrorMessage('');setIsLoggingIn(true);stytchClient.magicLinks.authenticate(passwordToken,{session_duration_minutes:(_b=(_a=config.sessionOptions)===null||_a===void 0?void 0:_a.sessionDurationMinutes)!==null&&_b!==void 0?_b:DEFAULT_SESSION_DURATION_MINUTES}).then(function(){dispatch({type:'transition',screen:AppScreens$1.PasswordConfirmation});})["catch"](function(e){onError(e);setLoginErrorMessage(getTranslatedError(e,_t));})["finally"](function(){setIsLoggingIn(false);});};if(resetTokenType==='login'){return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36,className:'resetPasswordContainer',alignItems:"center"},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'password.reset.loggingInProgress',message:"Logging in..."})),/*#__PURE__*/wn.createElement(CircularProgress,{size:100,thickness:2}));}return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36,className:'resetPasswordContainer',alignItems:"center",width:"100%"},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'password.reset.title',message:"Reset your password"})),/*#__PURE__*/wn.createElement(Form,{onSubmit:handleSubmit},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8},/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:2},/*#__PURE__*/wn.createElement(Label,{htmlFor:"new-password"},_t({id:'formField.password.label',message:"Password"})),/*#__PURE__*/wn.createElement(PasswordInput,Object.assign({password:password,setPassword:onPasswordChange,type:"new"},passwordProps.input)),/*#__PURE__*/wn.createElement("div",Object.assign({},passwordProps.error),/*#__PURE__*/wn.createElement(PasswordB2CError,{passwordPolicy:strengthPolicy,passwordScore:passwordScore,errorMessage:errorMessage,passwordWarning:passwordWarning,passwordSuggestions:passwordSuggestions,missingCharacters:missingCharacters,missingComplexity:missingComplexity,isPasswordBreached:isPasswordBreached}))),/*#__PURE__*/wn.createElement(SubmitButton,{isSubmitting:isSubmitting,text:_t({id:'button.continue',message:"Continue"}),disabled:invalidPassword}))),/*#__PURE__*/wn.createElement(Divider,null),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:8,width:"100%"},/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",disabled:isLoggingIn,onClick:handleLogin},isLoggingIn?(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center",alignItems:"center",gap:8},/*#__PURE__*/wn.createElement(CircularProgress,{size:18,thickness:1}),_t({id:'login.loading',message:"Logging in..."}))):_t({id:'password.reset.loginWithoutPassword',message:"Login without a password"})),loginErrorMessage&&/*#__PURE__*/wn.createElement(ErrorText,{errorMessage:loginErrorMessage})));};var PasswordConfirmation=function PasswordConfirmation(){var onEvent=useEventCallback();useMountEffect(function(){onEvent({type:StytchEventType.AuthenticateFlowComplete,data:{}});});return/*#__PURE__*/y$3(Confirmation,null);};var PasskeyCollageSvg=function PasskeyCollageSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"112",height:"96",viewBox:"0 0 112 96",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("g",{clipPath:"url(#clip0_2877_10121)"},/*#__PURE__*/wn.createElement("ellipse",{cx:"55.9998",cy:"48.0004",rx:"48",ry:"48.0003",fill:"#C7F1FF"}),/*#__PURE__*/wn.createElement("path",{d:"M100.866 74.5461H103.823",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M84.604 67.3945C84.604 67.2618 84.7116 67.1542 84.8442 67.1542H106.54C106.672 67.1542 106.78 67.2618 106.78 67.3945V77.2627C106.78 77.3954 106.672 77.503 106.54 77.503H84.8442C84.7116 77.503 84.604 77.3954 84.604 77.2627V67.3945Z",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M91.2568 70.8503L87.5608 74.5463",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M91.2568 74.5463L87.5608 70.8503",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M97.9096 70.8503L94.2136 74.5463",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M97.9096 74.5463L94.2136 70.8503",stroke:"#0C5A56",strokeWidth:"1.28124",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M87.9158 31.7665C87.8368 31.7271 87.7974 31.6629 87.7974 31.5742C87.7974 31.4854 87.8171 31.4015 87.8566 31.3226C89.0799 29.6256 90.6289 28.3135 92.5034 27.3861C94.3779 26.4587 96.3806 25.995 98.5117 25.995C100.643 25.995 102.65 26.4489 104.535 27.3565C106.419 28.2642 107.983 29.5665 109.226 31.2634C109.285 31.362 109.31 31.441 109.3 31.5002C109.29 31.5594 109.256 31.6185 109.196 31.6777C109.137 31.7369 109.063 31.7665 108.974 31.7665C108.886 31.7665 108.802 31.7172 108.723 31.6185C107.559 30.0005 106.074 28.7575 104.268 27.8893C102.463 27.0211 100.544 26.587 98.5117 26.587C96.4793 26.587 94.5752 27.026 92.7993 27.9041C91.0235 28.7821 89.5436 30.0203 88.3597 31.6185C88.2808 31.7172 88.2068 31.7764 88.1377 31.7961C88.0687 31.8159 87.9947 31.806 87.9158 31.7665ZM102.034 46.6541C100.001 46.141 98.3291 45.1249 97.017 43.6055C95.7048 42.0862 95.0487 40.2413 95.0487 38.0708C95.0487 37.1434 95.3891 36.364 96.0699 35.7326C96.7506 35.1012 97.5645 34.7855 98.5117 34.7855C99.4588 34.7855 100.273 35.1012 100.953 35.7326C101.634 36.364 101.975 37.1434 101.975 38.0708C101.975 38.8206 102.266 39.452 102.848 39.965C103.43 40.4781 104.106 40.7346 104.875 40.7346C105.625 40.7346 106.281 40.4781 106.843 39.965C107.406 39.452 107.687 38.8206 107.687 38.0708C107.687 35.6438 106.784 33.6114 104.979 31.9737C103.173 30.336 101.018 29.5171 98.5117 29.5171C96.0057 29.5171 93.85 30.336 92.0446 31.9737C90.2392 33.6114 89.3364 35.6438 89.3364 38.0708C89.3364 38.5444 89.3907 39.161 89.4992 39.9206C89.6077 40.6803 89.8396 41.5436 90.1948 42.5104C90.2342 42.6091 90.2342 42.6831 90.1948 42.7324C90.1553 42.7817 90.106 42.8261 90.0468 42.8656C89.9678 42.9051 89.884 42.9149 89.7952 42.8952C89.7064 42.8755 89.6423 42.8163 89.6028 42.7176C89.3463 41.9678 89.144 41.2032 88.9961 40.4238C88.8481 39.6444 88.7741 38.8601 88.7741 38.0708C88.7741 35.5254 89.7409 33.35 91.6746 31.5446C93.6083 29.7391 95.8873 28.8364 98.5117 28.8364C101.195 28.8364 103.499 29.7243 105.423 31.5002C107.347 33.276 108.308 35.4662 108.308 38.0708C108.308 38.9785 107.973 39.748 107.302 40.3794C106.631 41.0108 105.822 41.3265 104.875 41.3265C103.908 41.3265 103.08 41.0108 102.389 40.3794C101.698 39.748 101.353 38.9785 101.353 38.0708C101.353 37.3013 101.072 36.66 100.509 36.147C99.9471 35.6339 99.2812 35.3774 98.5117 35.3774C97.7421 35.3774 97.0712 35.6339 96.499 36.147C95.9268 36.66 95.6407 37.3013 95.6407 38.0708C95.6407 40.1229 96.2622 41.8346 97.5053 43.206C98.7484 44.5773 100.297 45.5392 102.152 46.0917C102.271 46.1312 102.345 46.1805 102.374 46.2397C102.404 46.2989 102.409 46.368 102.389 46.4469C102.369 46.5455 102.33 46.6146 102.271 46.6541C102.211 46.6935 102.132 46.6935 102.034 46.6541ZM91.5858 25.3439C91.4872 25.3833 91.4132 25.3883 91.3639 25.3587C91.3145 25.3291 91.2701 25.2847 91.2307 25.2255C91.1912 25.186 91.1715 25.1268 91.1715 25.0479C91.1715 24.969 91.2011 24.9098 91.2603 24.8703C92.385 24.2586 93.5639 23.7949 94.7972 23.4792C96.0304 23.1635 97.2686 23.0057 98.5117 23.0057C99.7942 23.0057 101.052 23.1635 102.285 23.4792C103.519 23.7949 104.698 24.2389 105.822 24.8111C105.921 24.8506 105.975 24.9098 105.985 24.9887C105.995 25.0676 105.98 25.1367 105.941 25.1959C105.901 25.2551 105.847 25.3044 105.778 25.3439C105.709 25.3833 105.625 25.3833 105.526 25.3439C104.441 24.8111 103.306 24.3918 102.123 24.086C100.939 23.7801 99.735 23.6272 98.5117 23.6272C97.2883 23.6272 96.0945 23.7703 94.9304 24.0564C93.7662 24.3425 92.6514 24.7717 91.5858 25.3439ZM95.5519 46.3285C94.4075 45.1446 93.5146 43.9015 92.8733 42.5992C92.2321 41.2969 91.9114 39.7875 91.9114 38.0708C91.9114 36.3147 92.5576 34.8348 93.85 33.6312C95.1425 32.4275 96.6963 31.8257 98.5117 31.8257C100.327 31.8257 101.891 32.4275 103.203 33.6312C104.515 34.8348 105.171 36.3147 105.171 38.0708C105.171 38.1695 105.146 38.2435 105.097 38.2928C105.048 38.3421 104.974 38.3668 104.875 38.3668C104.776 38.3668 104.698 38.3421 104.638 38.2928C104.579 38.2435 104.55 38.1695 104.55 38.0708C104.55 36.4725 103.953 35.1308 102.759 34.0455C101.565 32.9603 100.149 32.4177 98.5117 32.4177C96.8739 32.4177 95.468 32.9603 94.294 34.0455C93.12 35.1308 92.533 36.4725 92.533 38.0708C92.533 39.748 92.824 41.1785 93.4061 42.3624C93.9882 43.5463 94.8514 44.7302 95.9959 45.9141C96.0748 45.9931 96.1093 46.0671 96.0995 46.1361C96.0896 46.2052 96.0551 46.2693 95.9959 46.3285C95.9564 46.368 95.8923 46.4025 95.8035 46.4321C95.7147 46.4617 95.6308 46.4272 95.5519 46.3285ZM104.609 44.1679C102.872 44.1679 101.368 43.5907 100.095 42.4364C98.8224 41.2821 98.1861 39.8269 98.1861 38.0708C98.1861 37.9721 98.2107 37.8932 98.2601 37.834C98.3094 37.7748 98.3834 37.7452 98.4821 37.7452C98.5807 37.7452 98.6547 37.7748 98.704 37.834C98.7534 37.8932 98.778 37.9721 98.778 38.0708C98.778 39.6691 99.365 40.9862 100.539 42.0221C101.713 43.058 103.07 43.5759 104.609 43.5759C104.767 43.5759 104.954 43.5661 105.171 43.5463C105.388 43.5266 105.625 43.497 105.881 43.4575C105.98 43.4378 106.059 43.4526 106.118 43.5019C106.177 43.5513 106.217 43.6055 106.237 43.6647C106.256 43.7437 106.251 43.8127 106.222 43.8719C106.192 43.9311 106.128 43.9706 106.029 43.9903C105.674 44.089 105.363 44.1432 105.097 44.1531C104.831 44.1629 104.668 44.1679 104.609 44.1679Z",stroke:"#0C5A56",strokeWidth:"0.721422"}),/*#__PURE__*/wn.createElement("g",{clipPath:"url(#clip1_2877_10121)"},/*#__PURE__*/wn.createElement("path",{d:"M25.7683 49.5923V52.5147C25.7683 52.9022 25.6144 53.2739 25.3403 53.5479C25.0663 53.8219 24.6947 53.9759 24.3071 53.9759H21.3848",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M21.3848 32.0582H24.3071C24.6947 32.0582 25.0663 32.2121 25.3403 32.4861C25.6144 32.7602 25.7683 33.1318 25.7683 33.5193V36.4417",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M3.85059 36.4417V33.5193C3.85059 33.1318 4.00453 32.7602 4.27856 32.4861C4.55258 32.2121 4.92424 32.0582 5.31177 32.0582H8.23413",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M8.23413 53.9759H5.31177C4.92424 53.9759 4.55258 53.8219 4.27856 53.5479C4.00453 53.2739 3.85059 52.9022 3.85059 52.5147V49.5923",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M14.8093 44.1129C17.0285 44.1129 18.8275 42.3139 18.8275 40.0947C18.8275 37.8754 17.0285 36.0764 14.8093 36.0764C12.59 36.0764 10.791 37.8754 10.791 40.0947C10.791 42.3139 12.59 44.1129 14.8093 44.1129Z",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M21.0097 49.9586C20.5564 48.6763 19.7168 47.5662 18.6064 46.781C17.4959 45.9957 16.1694 45.5741 14.8094 45.5741C13.4494 45.5741 12.1229 45.9957 11.0125 46.781C9.90207 47.5662 9.06241 48.6763 8.60913 49.9586",stroke:"#0C5A56",strokeWidth:"1.42772",strokeLinecap:"round",strokeLinejoin:"round"})),/*#__PURE__*/wn.createElement("path",{d:"M54.7371 47.9187C57.8367 47.9187 60.3495 45.406 60.3495 42.3064C60.3495 39.2068 57.8367 36.694 54.7371 36.694C51.6375 36.694 49.1248 39.2068 49.1248 42.3064C49.1248 45.406 51.6375 47.9187 54.7371 47.9187Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M69.7034 47.9187C69.7062 47.1369 69.4989 46.3687 69.1032 45.6944C68.7076 45.0201 68.1381 44.4644 67.4542 44.0854C66.7704 43.7064 65.9973 43.518 65.2158 43.54C64.4343 43.5619 63.673 43.7934 63.0115 44.2101C62.35 44.6268 61.8126 45.2136 61.4554 45.9091C61.0982 46.6045 60.9343 47.3832 60.9809 48.1636C61.0275 48.944 61.2828 49.6976 61.7203 50.3457C62.1577 50.9937 62.7611 51.5123 63.4675 51.8474V58.5198L65.3383 60.3906L68.4563 57.2727L66.5855 55.4019L68.4563 53.5311L66.9097 51.9846C67.7311 51.6676 68.4374 51.1097 68.936 50.3841C69.4346 49.6585 69.7021 48.7991 69.7034 47.9187ZM65.3383 47.9187C65.0916 47.9187 64.8505 47.8456 64.6454 47.7085C64.4403 47.5715 64.2804 47.3767 64.186 47.1488C64.0916 46.9209 64.0669 46.6702 64.1151 46.4282C64.1632 46.1863 64.282 45.9641 64.4564 45.7896C64.6308 45.6152 64.853 45.4964 65.095 45.4483C65.3369 45.4002 65.5877 45.4249 65.8156 45.5193C66.0435 45.6137 66.2382 45.7735 66.3753 45.9786C66.5123 46.1837 66.5855 46.4249 66.5855 46.6715C66.5855 47.0023 66.4541 47.3195 66.2202 47.5534C65.9863 47.7873 65.6691 47.9187 65.3383 47.9187Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M59.6512 50.4382C58.6934 50.0111 57.6566 49.7902 56.608 49.7896H52.8664C50.8818 49.7896 48.9784 50.578 47.5751 51.9814C46.1717 53.3847 45.3833 55.2881 45.3833 57.2728V59.7671H61.5968V52.8951C60.7557 52.249 60.0873 51.405 59.6512 50.4382Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("rect",{x:"39.2727",y:"15.4204",width:"35.8443",height:"65.4755",rx:"1.67273",stroke:"#0C5A56",strokeWidth:"2.38962",strokeLinejoin:"round"})),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("clipPath",{id:"clip0_2877_10121"},/*#__PURE__*/wn.createElement("rect",{width:"110.4",height:"96.0005",fill:"white",transform:"translate(0.799805)"})),/*#__PURE__*/wn.createElement("clipPath",{id:"clip1_2877_10121"},/*#__PURE__*/wn.createElement("rect",{width:"23.3789",height:"23.3789",fill:"white",transform:"translate(3.11987 31.3276)"}))));};var Device;(function(Device){Device["DESKTOP"]="Desktop device";Device["MOBILE"]="Mobile device";Device["UNKNOWN"]="Unknown device";})(Device||(Device={}));var SAFARI_CROSS_DEVICE_DUPLICATE_REG_ERROR_MESSAGE='At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator.';var CHROME_CROSS_DEVICE_DUPLICATE_REG_ERROR_MESSAGE='The user attempted to register an authenticator that contains one of the credentials already registered with the relying party.';var LoadingScreen=function LoadingScreen(){return/*#__PURE__*/y$3(Flex,{direction:"column",gap:36,alignItems:"center"},/*#__PURE__*/y$3(CircularProgress,{size:100,thickness:8}));};var ContentContainer=He(Flex)(_templateObject64||(_templateObject64=_taggedTemplateLiteral(["\n width: 100%;\n background-color: ",";\n"])),function(props){return props.theme.colors.accent;});var PasskeyRegistrationStart=function PasskeyRegistrationStart(){var _useLingui41=useLingui(),_t=_useLingui41._;var stytchClient=useStytch();var _h$131=h$5(function(){return(stytchClient.user.getSync()!=null?'hasUser':'loading');}),_h$132=_slicedToArray2(_h$131,2),userState=_h$132[0],setUserState=_h$132[1];var _h$133=h$5(),_h$134=_slicedToArray2(_h$133,2),error=_h$134[0],setError=_h$134[1];var config=useConfig();var onEvent=useEventCallback();var onError=useErrorCallback();p$5(function(){stytchClient.user.get().then(function(){setUserState('hasUser');})["catch"](function(e){setUserState('noUser');onError(e);});},[onError,stytchClient]);var _useGlobalReducer49=useGlobalReducer(),_useGlobalReducer50=_slicedToArray2(_useGlobalReducer49,2),dispatch=_useGlobalReducer50[1];var onCreatePasskey=function onCreatePasskey(){var _a,_b,_c;setError(undefined);stytchClient.webauthn.register({domain:(_a=config.passkeyOptions)===null||_a===void 0?void 0:_a.domain,is_passkey:true,session_duration_minutes:(_c=(_b=config.sessionOptions)===null||_b===void 0?void 0:_b.sessionDurationMinutes)!==null&&_c!==void 0?_c:DEFAULT_SESSION_DURATION_MINUTES}).then(function(data){onEvent({type:StytchEventType.PasskeyRegister,data:data});dispatch({type:'transition',screen:AppScreens$1.PasskeyRegistrationSuccess});})["catch"](function(e){onError(e);if(e.message.includes(SAFARI_CROSS_DEVICE_DUPLICATE_REG_ERROR_MESSAGE)||e.message.includes(CHROME_CROSS_DEVICE_DUPLICATE_REG_ERROR_MESSAGE)){setError(_t({id:'error.duplicatePasskey',message:"The Passkey cannot be created as it seems to be already registered. It is possible this Passkey was registered on another device but has synced cross-device."}));return;}else{setError(_t({id:'error.passkeyNotCreated',message:"Your Passkey was not created. Click \u201CCreate a Passkey\u201D to try again or skip without adding a Passkey."}));}});};var onSkip=function onSkip(){onEvent({type:StytchEventType.PasskeySkip,data:{}});dispatch({type:'transition',screen:AppScreens$1.PasskeyRegistrationSuccess});};if(userState==='loading'){return/*#__PURE__*/wn.createElement(LoadingScreen,null);}if(userState==='noUser'){return/*#__PURE__*/wn.createElement(AlertBox,{variant:"warning",text:_t({id:'passkey.registrationStart.error.noUser',message:"Error: Cannot use PasskeyRegistration component without active user authenticated."})});}return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36,marginTop:12,marginLeft:6.5,marginRight:6.5},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t({id:'passkey.registrationStart.title',message:"Set up a new Passkey"})),error&&/*#__PURE__*/wn.createElement(AlertBox,{variant:"warning",text:error}),/*#__PURE__*/wn.createElement(ContentContainer,{direction:"column",alignItems:"center",gap:20},/*#__PURE__*/wn.createElement(Flex,{direction:"column",padding:20,gap:20,alignItems:"center"},/*#__PURE__*/wn.createElement(PasskeyCollageSvg,null),/*#__PURE__*/wn.createElement(Text,{size:"body"},_t({id:'passkey.registrationStart.subtitle',message:"With Passkeys you don't need to remember complex passwords."})),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},_t({id:'passkey.registrationStart.description',message:"Passkeys are encrypted digital keys you create using your fingerprint, face, or screen lock. Creating a Passkey will allow you to easily and securely log in to your account."})))),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:12},/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return onCreatePasskey();}},_t({id:'button.createPasskey',message:"Create a Passkey"})),/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",onClick:function onClick(){return onSkip();}},_t({id:'button.skip',message:"Skip"}))));};var useStytchUser=function useStytchUser(){var stytch=useStytch();return Cn(stytch.onStateChange,function(){return stytch.user.getSync();});};var Checkmark=function Checkmark(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M7.33317 13.2503L3.83317 9.75033L2.6665 10.917L7.33317 15.5837L17.3332 5.58366L16.1665 4.41699L7.33317 13.2503Z",fill:"#19303D"}));};var Pencil=function Pencil(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M11.7157 7.51667L12.4824 8.28333L4.93236 15.8333H4.16569V15.0667L11.7157 7.51667ZM14.7157 2.5C14.5074 2.5 14.2907 2.58333 14.1324 2.74167L12.6074 4.26667L15.7324 7.39167L17.2574 5.86667C17.5824 5.54167 17.5824 5.01667 17.2574 4.69167L15.3074 2.74167C15.1407 2.575 14.9324 2.5 14.7157 2.5ZM11.7157 5.15833L2.49902 14.375V17.5H5.62402L14.8407 8.28333L11.7157 5.15833Z",fill:"#19303D"}));};var Trash=function Trash(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M5.00008 15.8333C5.00008 16.75 5.75008 17.5 6.66675 17.5H13.3334C14.2501 17.5 15.0001 16.75 15.0001 15.8333V5.83333H5.00008V15.8333ZM6.66675 7.5H13.3334V15.8333H6.66675V7.5ZM12.9167 3.33333L12.0834 2.5H7.91675L7.08341 3.33333H4.16675V5H15.8334V3.33333H12.9167Z",fill:"#19303D"}));};var Cancel=function Cancel(){return/*#__PURE__*/wn.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M9.99984 1.66699C5.3915 1.66699 1.6665 5.39199 1.6665 10.0003C1.6665 14.6087 5.3915 18.3337 9.99984 18.3337C14.6082 18.3337 18.3332 14.6087 18.3332 10.0003C18.3332 5.39199 14.6082 1.66699 9.99984 1.66699ZM9.99984 16.667C6.32484 16.667 3.33317 13.6753 3.33317 10.0003C3.33317 6.32533 6.32484 3.33366 9.99984 3.33366C13.6748 3.33366 16.6665 6.32533 16.6665 10.0003C16.6665 13.6753 13.6748 16.667 9.99984 16.667ZM12.9915 5.83366L9.99984 8.82533L7.00817 5.83366L5.83317 7.00866L8.82484 10.0003L5.83317 12.992L7.00817 14.167L9.99984 11.1753L12.9915 14.167L14.1665 12.992L11.1748 10.0003L14.1665 7.00866L12.9915 5.83366Z",fill:"#19303D"}));};var BaseIconButton=He(Button).attrs({variant:'text'})(_templateObject65||(_templateObject65=_taggedTemplateLiteral(["\n flex: 0 0 32px;\n height: 32px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n"])));var IconButton=function IconButton(_ref142){var _ref142$type=_ref142.type,type=_ref142$type===void 0?'button':_ref142$type,icon=_ref142.icon,onClick=_ref142.onClick,label=_ref142.label;return/*#__PURE__*/wn.createElement(BaseIconButton,{"aria-label":label,onClick:onClick,type:type},/*#__PURE__*/wn.createElement(IconColorOverride,{themeColor:"primary"},icon));};var RowInput=He(Input)(_templateObject66||(_templateObject66=_taggedTemplateLiteral(["\n flex: 1 1 auto;\n background-color: transparent;\n border-color: ",";\n {(props) => props.theme.typography.body}\n\n &:disabled {\n border-color: transparent;\n background: transparent;\n color: ",";\n }\n"])),function(props){return props.isEditing?props.theme.inputs.borderColor:'transparent';},function(props){return props.othersEditing?props.theme.colors.disabledText:props.theme.colors.primary;});var EditableRow=function EditableRow(_ref143){var id=_ref143.id,name=_ref143.name,state=_ref143.state,updateState=_ref143.updateState,handleEdit=_ref143.handleEdit;var _useLingui42=useLingui(),_t=_useLingui42._;var isEditing=isEditingRow(id,state);var inputRef=_$2(null);p$5(function(){var _a;if(isEditing){(_a=inputRef.current)===null||_a===void 0?void 0:_a.focus();}},[isEditing]);return/*#__PURE__*/wn.createElement(Flex,{as:"form",direction:"row",gap:2,alignItems:"center",width:"100%",onSubmit:function onSubmit(evt){evt.preventDefault();if(isEditing){handleEdit(id,state.newName);}},"data-testid":testId(id)},/*#__PURE__*/wn.createElement(RowInput,{ref:inputRef,disabled:!isEditing,isEditing:isEditing,othersEditing:state.type!=='viewing'&&state.id!==id,value:isEditing?state.newName:name,onChange:function onChange(e){if(isEditing){updateState(Object.assign(Object.assign({},state),{newName:e.target.value}));}},"aria-label":_t({id:'passkey.editing.label',message:"Passkey name"})}),function(){switch(state.type){case'viewing':return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(IconButton,{key:"edit",onClick:function onClick(){return updateState({type:'editing',id:id,newName:name});},icon:/*#__PURE__*/wn.createElement(Pencil,null),label:_t({id:'button.edit',message:"Edit"})}),/*#__PURE__*/wn.createElement(IconButton,{onClick:function onClick(){return updateState({type:'deleting',id:id});},icon:/*#__PURE__*/wn.createElement(Trash,null),label:_t({id:'button.delete',message:"Delete"})}));case'editing':if(state.id!==id)return null;return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(IconButton,{key:"submit",type:"submit",icon:/*#__PURE__*/wn.createElement(Checkmark,null),label:_t({id:'button.save',message:"Save"})}),/*#__PURE__*/wn.createElement(IconButton,{onClick:function onClick(){return updateState({type:'viewing'});},icon:/*#__PURE__*/wn.createElement(Cancel,null),label:_t({id:'button.cancel',message:"Cancel"})}));case'deleting':return null;}}());};function isEditingRow(id,state){return state.type==='editing'&&state.id===id;}function testId(id){return"editable-row-".concat(id);}var PasskeyAddedSvg=function PasskeyAddedSvg(){return/*#__PURE__*/wn.createElement("svg",{width:"101",height:"101",viewBox:"0 0 101 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M60.6296 95.0741C56.8399 96.0414 52.8689 96.5556 48.7778 96.5556C22.3908 96.5556 1 75.1647 1 48.7778C1 22.3908 22.3908 1 48.7778 1C75.1647 1 96.5556 22.3908 96.5556 48.7778C96.5556 52.8689 96.0414 56.8398 95.0741 60.6296",stroke:"#0C5A56",strokeWidth:"1.78025",strokeLinecap:"round"}),/*#__PURE__*/wn.createElement("path",{d:"M81 61C78.3736 61 75.7728 61.5173 73.3463 62.5224C70.9198 63.5275 68.715 65.0007 66.8579 66.8579C65.0007 68.715 63.5275 70.9198 62.5224 73.3463C61.5173 75.7728 61 78.3736 61 81C61 83.6264 61.5173 86.2272 62.5224 88.6537C63.5275 91.0802 65.0007 93.285 66.8579 95.1421C68.715 96.9993 70.9198 98.4725 73.3463 99.4776C75.7728 100.483 78.3736 101 81 101C83.6264 101 86.2272 100.483 88.6537 99.4776C91.0802 98.4725 93.285 96.9993 95.1421 95.1421C96.9993 93.285 98.4725 91.0802 99.4776 88.6537C100.483 86.2272 101 83.6264 101 81C101 78.3736 100.483 75.7728 99.4776 73.3463C98.4725 70.9198 96.9993 68.715 95.1421 66.8579C93.285 65.0007 91.0802 63.5275 88.6537 62.5224C86.2272 61.5173 83.6264 61 81 61Z",fill:"#C7F1FF"}),/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M91.9508 71.6043C92.3374 71.8892 92.4199 72.4336 92.135 72.8202L79.9611 89.3419C79.8207 89.5324 79.6088 89.6575 79.3742 89.6883C79.1396 89.7191 78.9026 89.6529 78.7178 89.5051L70.0222 82.5486C69.6472 82.2486 69.5864 81.7014 69.8864 81.3264C70.1864 80.9514 70.7336 80.8906 71.1086 81.1906L79.0977 87.5819L90.7349 71.7886C91.0198 71.4019 91.5642 71.3194 91.9508 71.6043Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M46.1713 49.1485C50.3301 49.1485 53.7015 45.7771 53.7015 41.6183C53.7015 37.4595 50.3301 34.0881 46.1713 34.0881C42.0125 34.0881 38.6411 37.4595 38.6411 41.6183C38.6411 45.7771 42.0125 49.1485 46.1713 49.1485Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M66.2519 49.1485C66.2556 48.0995 65.9775 47.0688 65.4466 46.164C64.9158 45.2593 64.1517 44.5137 63.2341 44.0052C62.3166 43.4967 61.2794 43.244 60.2308 43.2734C59.1822 43.3029 58.1608 43.6134 57.2732 44.1725C56.3857 44.7317 55.6646 45.5189 55.1854 46.4521C54.7061 47.3852 54.4862 48.4299 54.5487 49.477C54.6113 50.5241 54.9539 51.5352 55.5408 52.4047C56.1276 53.2742 56.9373 53.97 57.885 54.4196V63.3722L60.3951 65.8822L64.5786 61.6988L62.0685 59.1887L64.5786 56.6787L62.5036 54.6037C63.6056 54.1784 64.5533 53.4299 65.2222 52.4563C65.8912 51.4828 66.2501 50.3297 66.2519 49.1485ZM60.3951 49.1485C60.0642 49.1485 59.7406 49.0503 59.4654 48.8664C59.1902 48.6826 58.9758 48.4212 58.8491 48.1155C58.7225 47.8097 58.6893 47.4732 58.7539 47.1486C58.8185 46.824 58.9778 46.5259 59.2119 46.2918C59.4459 46.0578 59.744 45.8984 60.0687 45.8339C60.3933 45.7693 60.7297 45.8024 61.0355 45.9291C61.3413 46.0557 61.6026 46.2702 61.7865 46.5454C61.9704 46.8206 62.0685 47.1441 62.0685 47.4751C62.0685 47.9189 61.8922 48.3445 61.5784 48.6583C61.2646 48.9722 60.8389 49.1485 60.3951 49.1485Z",fill:"#0C5A56"}),/*#__PURE__*/wn.createElement("path",{d:"M52.7645 52.5288C51.4795 51.9558 50.0884 51.6594 48.6815 51.6586H43.6614C40.9985 51.6586 38.4447 52.7164 36.5618 54.5993C34.6789 56.4822 33.6211 59.036 33.6211 61.6989V65.0456H55.375V55.8253C54.2465 54.9584 53.3497 53.8259 52.7645 52.5288Z",fill:"#0C5A56"}));};var SubHeading=He(Text)(_templateObject67||(_templateObject67=_taggedTemplateLiteral(["\n {\n font-weight: 700;\n text-transform: uppercase;\n }\n"])));var PasskeyRegistrationSuccess=function PasskeyRegistrationSuccess(){var _a;var _useLingui43=useLingui(),_t$1=_useLingui43._;var stytchClient=useStytch();var user=useStytchUser();var _h$135=h$5(),_h$136=_slicedToArray2(_h$135,2),optimisticRegistrations=_h$136[0],setOptimisticRegistrations=_h$136[1];var webAuthnRegistrations=(_a=optimisticRegistrations===null||optimisticRegistrations===void 0?void 0:optimisticRegistrations.registrations)!==null&&_a!==void 0?_a:user===null||user===void 0?void 0:user.webauthn_registrations;var _h$137=h$5({type:'viewing'}),_h$138=_slicedToArray2(_h$137,2),editableRowState=_h$138[0],setEditableRowState=_h$138[1];var onEvent=useEventCallback();var _useGlobalReducer51=useGlobalReducer(),_useGlobalReducer52=_slicedToArray2(_useGlobalReducer51,2),dispatch=_useGlobalReducer52[1];var onSetUpANewPasskey=function onSetUpANewPasskey(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee103(){return _regenerator2().w(function(_context103){while(1)switch(_context103.n){case 0:_context103.n=1;return optimisticRegistrations===null||optimisticRegistrations===void 0?void 0:optimisticRegistrations.update;case 1:dispatch({type:'transition',screen:AppScreens$1.PasskeyRegistrationStart});case 2:return _context103.a(2);}},_callee103);}));};var onDone=function onDone(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee104(){return _regenerator2().w(function(_context104){while(1)switch(_context104.n){case 0:_context104.n=1;return optimisticRegistrations===null||optimisticRegistrations===void 0?void 0:optimisticRegistrations.update;case 1:onEvent({type:StytchEventType.PasskeyDone,data:{}});case 2:return _context104.a(2);}},_callee104);}));};var startOptimisticUpdate=function startOptimisticUpdate(registrations,update){var prevEditableRowState=Object.assign({},editableRowState);setOptimisticRegistrations({registrations:registrations,update:update});setEditableRowState({type:'viewing'});update["catch"](function(error){logger.error(error);_t.error(errorToStytchError(error).message);setEditableRowState(prevEditableRowState);}).then(function(){setOptimisticRegistrations(undefined);});};var deleteReg=function deleteReg(id){if(!user)return;startOptimisticUpdate(user.webauthn_registrations.filter(function(r){return r.webauthn_registration_id!==id;}),stytchClient.user.deleteWebauthnRegistration(id));};var updateReg=function updateReg(id,name){if(!user)return;startOptimisticUpdate(user.webauthn_registrations.map(function(r){return r.webauthn_registration_id===id?Object.assign(Object.assign({},r),{name:name}):r;}),stytchClient.webauthn.update({webauthn_registration_id:id,name:name}).then(function(){return stytchClient.user.get();}));};return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:36,marginTop:12,marginLeft:6.5,marginRight:6.5},/*#__PURE__*/wn.createElement(Text,{size:"header"},_t$1({id:'passkey.registrationSuccess.title',message:"Passkey successfully created!"})),/*#__PURE__*/wn.createElement(Flex,{alignSelf:"center"},/*#__PURE__*/wn.createElement(PasskeyAddedSvg,null)),webAuthnRegistrations&&webAuthnRegistrations.length>0&&(/*#__PURE__*/wn.createElement(Flex,{"align-items":"left",direction:"column",width:"100%",gap:8},/*#__PURE__*/wn.createElement(SubHeading,{size:"body"},_t$1({id:'passkey.registrationSuccess.existingPasskeys',message:"Existing Passkeys"})),webAuthnRegistrations.map(function(registration){return(/*#__PURE__*/wn.createElement(EditableRow,{key:registration.webauthn_registration_id,id:registration.webauthn_registration_id,name:registration.name,state:editableRowState,updateState:setEditableRowState,handleEdit:updateReg}));}))),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:12},editableRowState.type==='deleting'?(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"outlined",onClick:function onClick(){deleteReg(editableRowState.id);}},_t$1({id:'button.delete',message:"Delete"})),/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",onClick:function onClick(){setEditableRowState({type:'viewing'});}},_t$1({id:'button.cancel',message:"Cancel"})))):(/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(Button,{type:"button",disabled:editableRowState.type==='editing',onClick:onSetUpANewPasskey},_t$1({id:'passkey.registrationSuccess.setupAnother',message:"Set up another Passkey"})),/*#__PURE__*/wn.createElement(Button,{type:"button",variant:"text",disabled:editableRowState.type==='editing',onClick:onDone},_t$1({id:'button.done',message:"Done"}))))),editableRowState.type==='deleting'&&(/*#__PURE__*/wn.createElement(AlertBox,{variant:"error",text:_t$1({id:'passkey.registrationSuccess.deleteWarning',message:"Once deleted, the passkey cannot be restored."})})));};var PasskeyConfirmation=function PasskeyConfirmation(){var _useLingui44=useLingui(),_t=_useLingui44._;var onEvent=useEventCallback();useMountEffect(function(){onEvent({type:StytchEventType.AuthenticateFlowComplete,data:{}});});return/*#__PURE__*/y$3(Confirmation,{text:_t({id:'passkey.success.content',message:"Your Passkey has been successfully authenticated."})});};var SuccessIcon=function SuccessIcon(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM8 15L3 10L4.41 8.59L8 12.17L15.59 4.58L17 6L8 15Z",fill:"#0F4447"}));};var ErrorIcon=function ErrorIcon(){return/*#__PURE__*/y$3("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/y$3("path",{d:"M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM11 15H9V13H11V15ZM11 11H9V5H11V11Z",fill:"#590607"}));};var baseStyles={display:'flex',gap:'8px',padding:'8px',fontSize:'14px',borderRadius:'4px'};var successStyles=Object.assign(Object.assign({},baseStyles),{background:'#ECFFF5',boxShadow:'0px 5px 10px rgba(15, 68, 71, 0.18)',color:'#0F4447'});var errorStyles=Object.assign(Object.assign({},baseStyles),{background:'#FFEEEC',boxShadow:'0px 5px 10px rgba(89, 6, 7, 0.2)',color:'#590607'});var Snackbar=function Snackbar(){return/*#__PURE__*/wn.createElement(Ie,{containerStyle:{position:'sticky',marginTop:'4px',marginBottom:'24px'},toastOptions:{success:{style:successStyles,icon:/*#__PURE__*/wn.createElement(SuccessIcon,null)},error:{style:errorStyles,icon:/*#__PURE__*/wn.createElement(ErrorIcon,null)}}});};var OuterContainer=He.div(_templateObject68||(_templateObject68=_taggedTemplateLiteral(["\n width: ",";\n font-family: ",";\n box-sizing: border-box;\n * {\n box-sizing: content-box;\n }\n background-color: ",";\n border: ",";\n border-radius: ",";\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n border-bottom: ",";\n"])),function(_ref144){var theme=_ref144.theme;return theme.container.width;},function(_ref145){var theme=_ref145.theme;return theme.typography.fontFamily;},function(_ref146){var theme=_ref146.theme;return theme.container.backgroundColor;},function(_ref147){var theme=_ref147.theme;return theme.container.border;},function(_ref148){var theme=_ref148.theme;return theme.container.borderRadius;},function(_ref149){var theme=_ref149.theme,displayWatermark=_ref149.displayWatermark;return displayWatermark?'0':theme.container.borderRadius;},function(_ref150){var theme=_ref150.theme,displayWatermark=_ref150.displayWatermark;return displayWatermark?'0':theme.container.borderRadius;},function(_ref151){var theme=_ref151.theme,displayWatermark=_ref151.displayWatermark;return displayWatermark?'none':theme.container.border;});var ChildrenContainer=He.div(_templateObject69||(_templateObject69=_taggedTemplateLiteral(["\n padding: 24px 32px;\n"])));var WatermarkContainer=He.div(_templateObject70||(_templateObject70=_taggedTemplateLiteral(["\n box-sizing: border-box;\n width: ",";\n background-color: ",";\n border: ",";\n border-top: none;\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n overflow: hidden;\n"])),function(_ref152){var theme=_ref152.theme;return theme.container.width;},function(_ref153){var theme=_ref153.theme;return theme.container.backgroundColor;},function(_ref154){var theme=_ref154.theme;return theme.container.border;},function(_ref155){var theme=_ref155.theme;return theme.container.borderRadius;},function(_ref156){var theme=_ref156.theme;return theme.container.borderRadius;});var InnerContainer=He.div(_templateObject71||(_templateObject71=_taggedTemplateLiteral(["\n background-color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0.5;\n"])));var Image=He.img(_templateObject72||(_templateObject72=_taggedTemplateLiteral(["\n width: 150px;\n"])));var POWERED_BY_STYTCH_IMG_URL='https://public-assets.stytch.com/powered_by_stytch_logo_dark.svg';var MainContainer=function MainContainer(_ref157){var children=_ref157.children,displayWatermark=_ref157.displayWatermark;var _useLingui45=useLingui(),_t=_useLingui45._;return/*#__PURE__*/wn.createElement(wn.Fragment,null,/*#__PURE__*/wn.createElement(OuterContainer,{displayWatermark:displayWatermark},/*#__PURE__*/wn.createElement(ChildrenContainer,null,children,/*#__PURE__*/wn.createElement(Snackbar,null))),displayWatermark&&(/*#__PURE__*/wn.createElement(WatermarkContainer,null,/*#__PURE__*/wn.createElement(InnerContainer,null,/*#__PURE__*/wn.createElement("a",{style:{height:32,display:'flex',alignItems:'center',padding:'8px 0px',boxSizing:'border-box'},href:"https://stytch.com/",target:"_blank",rel:"noreferrer"},/*#__PURE__*/wn.createElement(Image,{alt:_t({id:'watermark.altText',message:"Powered by Stytch"}),src:POWERED_BY_STYTCH_IMG_URL}))))));};var ErrorSVG=function ErrorSVG(){return/*#__PURE__*/wn.createElement("svg",{width:"200",height:"200",viewBox:"0 0 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("g",{opacity:"0.1"},/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M99.9999 0C155.229 0 200 44.7715 200 99.9999C200 155.229 155.229 200 99.9999 200C44.7715 200 0 155.229 0 99.9999C0 44.7715 44.7715 0 99.9999 0Z",fill:"url(#paint0_linear_4408_12810)"})),/*#__PURE__*/wn.createElement("g",{opacity:"0.3"},/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M99.9993 17.5723C145.523 17.5723 182.427 54.4762 182.427 99.9993C182.427 145.523 145.523 182.427 99.9993 182.427C54.4762 182.427 17.5723 145.523 17.5723 99.9993C17.5723 54.4762 54.4762 17.5723 99.9993 17.5723Z",fill:"url(#paint1_linear_4408_12810)"})),/*#__PURE__*/wn.createElement("g",{opacity:"0.7"},/*#__PURE__*/wn.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M99.9987 32.2305C137.487 32.2305 167.877 62.6203 167.877 100.108C167.877 137.596 137.487 167.986 99.9987 167.986C62.5109 167.986 32.1211 137.596 32.1211 100.108C32.1211 62.6203 62.5109 32.2305 99.9987 32.2305Z",fill:"url(#paint2_linear_4408_12810)"})),/*#__PURE__*/wn.createElement("path",{d:"M100 45.8334C70.1 45.8334 45.8333 70.1 45.8333 100C45.8333 129.9 70.1 154.167 100 154.167C129.9 154.167 154.167 129.9 154.167 100C154.167 70.1 129.9 45.8334 100 45.8334ZM105.417 127.083H94.5833V116.25H105.417V127.083ZM105.417 105.417H94.5833V72.9167H105.417V105.417Z",fill:"#8B1214"}),/*#__PURE__*/wn.createElement("defs",null,/*#__PURE__*/wn.createElement("linearGradient",{id:"paint0_linear_4408_12810",x1:"-87.1375",y1:"160.384",x2:"169.669",y2:"338.297",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"white"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#8B1214"})),/*#__PURE__*/wn.createElement("linearGradient",{id:"paint1_linear_4408_12810",x1:"-87.138",y1:"160.384",x2:"169.668",y2:"338.297",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"#F7F0F0"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#8B1214"})),/*#__PURE__*/wn.createElement("linearGradient",{id:"paint2_linear_4408_12810",x1:"-87.1386",y1:"160.493",x2:"169.668",y2:"338.405",gradientUnits:"userSpaceOnUse"},/*#__PURE__*/wn.createElement("stop",{stopColor:"#8B1214",stopOpacity:"0.01"}),/*#__PURE__*/wn.createElement("stop",{offset:"1",stopColor:"#E4C7C7"}))));};var ErrorHeader=He(Text)(_templateObject73||(_templateObject73=_taggedTemplateLiteral(["\n text-align: center;\n"])));var ErrorDisplay=function ErrorDisplay(_ref158){var text=_ref158.text,onGoBack=_ref158.onGoBack;var _useLingui46=useLingui(),_t=_useLingui46._;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},onGoBack&&/*#__PURE__*/wn.createElement(BackArrow,{onClick:onGoBack}),/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24,alignItems:"center"},/*#__PURE__*/wn.createElement(ErrorHeader,{size:"header"},_t({id:'error.title',message:"Looks like there was an error!"})),/*#__PURE__*/wn.createElement(ErrorSVG,null),/*#__PURE__*/wn.createElement(Text,null,text)));};var OPENID_CONSENT_ITEM={text:'Verify your identity',details:['View information stored within your account']};var PROFILE_CONSENT_ITEM={text:'View your personal profile information',details:[]};var OFFLINE_ACCESS_CONSENT_ITEM={text:"Maintain access to your data even when you're not actively using the app",details:['Access your data even when you are offline.','Synchronize data and process background tasks on your behalf.']};var OPENID_SCOPE='openid';var PROFILE_SCOPE='profile';var EMAIL_SCOPE='email';var PHONE_SCOPE='phone';var FULL_ACCESS_SCOPE='full_access';var OFFLINE_ACCESS_SCOPE='offline_access';var DEFAULT_SCOPES=new Set([OPENID_SCOPE,PROFILE_SCOPE,EMAIL_SCOPE,PHONE_SCOPE,FULL_ACCESS_SCOPE,OFFLINE_ACCESS_SCOPE]);var FALLBACK_SCOPES=[OPENID_SCOPE,EMAIL_SCOPE,PROFILE_SCOPE];var containsCustomScopes=function containsCustomScopes(scope){return scope.split(' ').some(function(sc){return!DEFAULT_SCOPES.has(sc);});};var createBuiltinScopeDescriptions=function createBuiltinScopeDescriptions(scopes){var descriptions=[];if(scopes.includes(OPENID_SCOPE)){descriptions.push(OPENID_CONSENT_ITEM);}if(scopes.includes(EMAIL_SCOPE)||scopes.includes(PROFILE_SCOPE)||scopes.includes(PHONE_SCOPE)){descriptions.push(createProfileScopeDescription({containsEmail:scopes.includes(EMAIL_SCOPE),containsPhoneNumber:scopes.includes(PHONE_SCOPE),containsProfile:scopes.includes(PROFILE_SCOPE)}));}if(scopes.includes(OFFLINE_ACCESS_SCOPE)){descriptions.push(OFFLINE_ACCESS_CONSENT_ITEM);}return descriptions;};var createProfileScopeDescription=function createProfileScopeDescription(_ref159){var containsProfile=_ref159.containsProfile,containsEmail=_ref159.containsEmail,containsPhoneNumber=_ref159.containsPhoneNumber;var details=[];if(containsProfile){details.push('Your name, profile picture, and language preferences');}if(containsEmail){details.push('Your email address');}if(containsPhoneNumber){details.push('Your phone number');}return{text:PROFILE_CONSENT_ITEM.text,details:details};};var createCustomScopeDescriptions=function createCustomScopeDescriptions(scopes,rbacPolicy){if(!rbacPolicy)return[];var descriptions=[];var _iterator0=_createForOfIteratorHelper2(scopes),_step0;try{var _loop4=function _loop4(){var scope=_step0.value;if(DEFAULT_SCOPES.has(scope))return 1;var found=rbacPolicy.scopes.find(function(policyScope){return policyScope.scope===scope;});if(found&&found.description){descriptions.push(found.description);}else{descriptions.push("Use the ".concat(scope," scope"));}};for(_iterator0.s();!(_step0=_iterator0.n()).done;){if(_loop4())continue;}}catch(err){_iterator0.e(err);}finally{_iterator0.f();}return descriptions;};var fallbackConsentManifestGenerator=function fallbackConsentManifestGenerator(_ref160){var scopes=_ref160.scopes,clientName=_ref160.clientName,rbacPolicy=_ref160.rbacPolicy;return[{header:"".concat(clientName," is requesting to:"),items:createBuiltinScopeDescriptions(scopes).concat(createCustomScopeDescriptions(scopes,rbacPolicy))}];};var parseOAuthAuthorizeParams=function parseOAuthAuthorizeParams(params){var authorizeParams={client_id:'',redirect_uri:'',response_type:'code',scopes:[].concat(FALLBACK_SCOPES)};var requiredFields=['client_id','redirect_uri'];for(var _i7=0,_requiredFields=requiredFields;_i7<_requiredFields.length;_i7++){var field=_requiredFields[_i7];var value=params.get(field);if(!value){return{error:"Required parameter is missing: ".concat(field,". Please reach out to the application developer."),result:authorizeParams};}authorizeParams[field]=value;}var optionalStringFields=['response_type','scope','code_challenge','state','nonce','prompt'];for(var _i8=0,_optionalStringFields=optionalStringFields;_i8<_optionalStringFields.length;_i8++){var _field=_optionalStringFields[_i8];var _value=params.get(_field);if(_value){if(_field==='scope'){authorizeParams.scopes=_value.split(' ').filter(Boolean);}else{authorizeParams[_field]=_value;}}}if(params.has('resource')){authorizeParams.resources=params.getAll('resource');}return{error:null,result:authorizeParams};};var parseOAuthLogoutParams=function parseOAuthLogoutParams(params){var logoutParams={client_id:'',post_logout_redirect_uri:''};var requiredFields=['client_id','post_logout_redirect_uri'];for(var _i9=0,_requiredFields2=requiredFields;_i9<_requiredFields2.length;_i9++){var field=_requiredFields2[_i9];var value=params.get(field);if(!value){return{error:"Required parameter is missing: ".concat(field,". Please reach out to the application developer."),result:logoutParams};}logoutParams[field]=value;}logoutParams.id_token_hint=params.get('id_token_hint')||undefined;logoutParams.state=params.get('state')||undefined;return{error:null,result:logoutParams};};var parseIDPParams=function parseIDPParams(searchParams){var params=new URLSearchParams(searchParams);if(params.has('post_logout_redirect_uri')){var logoutResult=parseOAuthLogoutParams(params);return{error:logoutResult.error,flow:{type:'Logout',params:logoutResult.result}};}var authorizeResult=parseOAuthAuthorizeParams(params);return{error:authorizeResult.error,flow:{type:'Authorize',params:authorizeResult.result}};};var ScopeList=He.ul(_templateObject74||(_templateObject74=_taggedTemplateLiteral(["\n padding: 0;\n"])));var ScopeListItem=He.li(_templateObject75||(_templateObject75=_taggedTemplateLiteral(["\n padding: 4px;\n box-sizing: border-box;\n position: relative;\n list-style: none;\n\n &:not(:last-child) {\n border-bottom: 1px solid ",";\n }\n"])),function(_ref161){var theme=_ref161.theme;return theme.colors.secondary;});var ItemSummary=He.summary(_templateObject76||(_templateObject76=_taggedTemplateLiteral(["\n list-style: none;\n display: flex;\n justify-content: space-between;\n cursor: ",";\n"])),function(props){return props.expandable?'pointer':'default';});var DropdownArrowSvg=He.svg(_templateObject77||(_templateObject77=_taggedTemplateLiteral(["\n width: 32px;\n height: 32px;\n margin-left: 10px;\n margin-top: -5px;\n vertical-align: top;\n flex-shrink: 0;\n transition: transform 0.3s ease;\n details[open] & {\n transform: rotate(90deg);\n }\n"])));var ItemNestedDetailsList=He.ul(_templateObject78||(_templateObject78=_taggedTemplateLiteral(["\n padding: 4px 24px;\n list-style: none;\n"])));var DropdownArrow=function DropdownArrow(){return/*#__PURE__*/wn.createElement(DropdownArrowSvg,{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},/*#__PURE__*/wn.createElement("path",{d:"M14.5875 11L13.4125 12.175L17.2291 16L13.4125 19.825L14.5875 21L19.5875 16L14.5875 11Z",fill:"currentColor"}));};var Item=function Item(_ref162){var item=_ref162.item;var _a,_b,_c,_d;if(typeof item==='string'){item={text:item};}return/*#__PURE__*/wn.createElement(ScopeListItem,null,/*#__PURE__*/wn.createElement("details",null,/*#__PURE__*/wn.createElement(ItemSummary,{expandable:!!((_a=item.details)===null||_a===void 0?void 0:_a.length)},/*#__PURE__*/wn.createElement(Text,{size:"helper"},"\u2022\xA0",item.text),((_b=item.details)===null||_b===void 0?void 0:_b.length)&&/*#__PURE__*/wn.createElement(DropdownArrow,null)),((_c=item.details)===null||_c===void 0?void 0:_c.length)&&(/*#__PURE__*/wn.createElement(ItemNestedDetailsList,null,(_d=item.details)===null||_d===void 0?void 0:_d.map(function(details){return/*#__PURE__*/wn.createElement("li",{key:details},/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},"\u2022\xA0",details));})))));};var SectionHeader=He(Text)(_templateObject79||(_templateObject79=_taggedTemplateLiteral(["\n font-weight: 600;\n"])));var Section=function Section(_ref163){var section=_ref163.section;return/*#__PURE__*/wn.createElement("div",null,/*#__PURE__*/wn.createElement(SectionHeader,{size:"body"},section.header),/*#__PURE__*/wn.createElement(ScopeList,null,section.items.map(function(item,i){return/*#__PURE__*/wn.createElement(Item,{key:i,item:item});})));};var ConsentManifest=function ConsentManifest(_ref164){var manifest=_ref164.manifest,clientName=_ref164.clientName;var _useLingui47=useLingui(),_t=_useLingui47._;if(_typeof2(manifest[0])==='object'&&'header'in manifest[0]){return/*#__PURE__*/wn.createElement("div",null,manifest.map(function(item,i){return/*#__PURE__*/wn.createElement(Section,{key:i,section:item});}));}return/*#__PURE__*/wn.createElement(Section,{section:{header:_t({id:'idpConsent.allowClientTo',message:"Allow {clientName} to:",values:{clientName:clientName}}),items:manifest}});};var UngrantableSection=He.details(_templateObject80||(_templateObject80=_taggedTemplateLiteral(["\n border: ",";\n border-radius: ",";\n padding: 16px;\n margin-bottom: 36px;\n"])),function(_ref165){var theme=_ref165.theme;return theme.container.border;},function(_ref166){var theme=_ref166.theme;return theme.container.borderRadius;});var UngrantableSummary=He.summary(_templateObject81||(_templateObject81=_taggedTemplateLiteral(["\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n\n details[open] > & {\n padding-bottom: 8px;\n margin-bottom: 8px;\n border-bottom: 1px solid ",";\n }\n"])),function(_ref167){var theme=_ref167.theme;return theme.colors.secondary;});var UngrantableNestedDetailsList=He.ul(_templateObject82||(_templateObject82=_taggedTemplateLiteral(["\n padding: 4px;\n margin: 0;\n list-style: none;\n"])));var UngrantableScopes=function UngrantableScopes(_ref168){var clientName=_ref168.clientName,ungrantableScopeDescriptions=_ref168.ungrantableScopeDescriptions;var _useLingui48=useLingui(),_t2=_useLingui48._;if(!ungrantableScopeDescriptions.length)return null;return/*#__PURE__*/wn.createElement(UngrantableSection,null,/*#__PURE__*/wn.createElement(UngrantableSummary,null,/*#__PURE__*/wn.createElement(Text,{size:"helper"},_t2({id:'idpConsent.noPermissionsToGrant',message:"You do not have permissions to grant {clientName} access to some of the requested scopes.",values:{clientName:clientName}})),/*#__PURE__*/wn.createElement(DropdownArrow,null)),/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},_t2({id:'idpConsent.cannotGrantRequest',message:"You cannot grant {clientName}'s request to:",values:{clientName:clientName}})),/*#__PURE__*/wn.createElement(UngrantableNestedDetailsList,null,ungrantableScopeDescriptions.map(function(desc,i){return/*#__PURE__*/wn.createElement("li",{key:i},/*#__PURE__*/wn.createElement(Text,{size:"helper",color:"secondary"},"\u2022\xA0",desc));})));};var ConsentManifestGeneratorContext=/*#__PURE__*/F$5(undefined);var TrustedAuthTokenParamsContext=/*#__PURE__*/F$5(undefined);var IDPContextProvider=function IDPContextProvider(_ref169){var children=_ref169.children,consentManifestGenerator=_ref169.consentManifestGenerator,authTokenParams=_ref169.authTokenParams;return/*#__PURE__*/wn.createElement(ConsentManifestGeneratorContext.Provider,{value:consentManifestGenerator},/*#__PURE__*/wn.createElement(TrustedAuthTokenParamsContext.Provider,{value:authTokenParams},children));};var useConsentManifestGenerator=function useConsentManifestGenerator(){return q$4(ConsentManifestGeneratorContext);};var useTrustedAuthTokenParams=function useTrustedAuthTokenParams(){return q$4(TrustedAuthTokenParamsContext);};var Logo=He.img(_templateObject83||(_templateObject83=_taggedTemplateLiteral(["\n max-height: 50px;\n max-width: 100px;\n"])));var initialState$1=function initialState$1(error,params){return{loading:!error,preflight:!!error,error:error,success:false,denied:false,consent_required:false,client:null,grantable_scope:'',ungrantable_scope:'',redirect_uri:params.redirect_uri};};var idpStateReducer=function idpStateReducer(state,action){switch(action.type){case'START_SUBMIT':return Object.assign(Object.assign({},state),{loading:true});case'COMPLETE_SUBMIT':return Object.assign(Object.assign({},state),{loading:false,success:true});case'START_PREFLIGHT':return Object.assign(Object.assign({},state),{preflight:true,loading:true});case'PREFLIGHT_ERROR':return Object.assign(Object.assign({},state),{preflight:true,loading:false,error:action.error});case'COMPLETE_PREFLIGHT':return Object.assign(Object.assign({},state),{loading:false,client:action.client,consent_required:action.consent_required,grantable_scope:action.grantable_scope,ungrantable_scope:action.ungrantable_scope});case'CONSENT_DENIED':return Object.assign(Object.assign({},state),{denied:true});default:return state;}};var useIDPState=function useIDPState(_ref170){var initialError=_ref170.initialError,initialParams=_ref170.initialParams,oauthAuthorizeStart=_ref170.oauthAuthorizeStart,oauthAuthorizeSubmit=_ref170.oauthAuthorizeSubmit,onError=_ref170.onError,onEvent=_ref170.onEvent;var _s$=s$1(idpStateReducer,initialState$1(initialError,initialParams)),_s$2=_slicedToArray2(_s$,2),state=_s$2[0],dispatch=_s$2[1];p$5(function(){if(!initialError)return;onError(new IDPOAuthFlowMissingParamError(initialError));},[initialError,onError]);var submitInternal=T$3(function(_ref171){var consent_required=_ref171.consent_required,consent_granted=_ref171.consent_granted;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee105(){var submitResp;return _regenerator2().w(function(_context105){while(1)switch(_context105.n){case 0:dispatch({type:'START_SUBMIT'});_context105.n=1;return oauthAuthorizeSubmit(Object.assign(Object.assign({},initialParams),{consent_granted:consent_granted}));case 1:submitResp=_context105.v;if(submitResp.authorization_code){dispatch({type:'COMPLETE_SUBMIT'});}window.location.href=submitResp.redirect_uri;if(consent_required&&!consent_granted){dispatch({type:'CONSENT_DENIED'});onEvent({type:StytchEventType.OAuthAuthorizeFlowConsentDenied,data:{}});}else{onEvent({type:StytchEventType.OAuthAuthorizeFlowComplete,data:{}});}case 2:return _context105.a(2);}},_callee105);}));},[oauthAuthorizeSubmit,initialParams,onEvent]);var submit=T$3(function(_ref172){var consent_granted=_ref172.consent_granted;return submitInternal({consent_granted:consent_granted,consent_required:true});},[submitInternal]);var loadClient=T$3(function(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee106(){var startResponse,err,message,grantable,ungrantable,_t29;return _regenerator2().w(function(_context106){while(1)switch(_context106.p=_context106.n){case 0:dispatch({type:'START_PREFLIGHT'});onEvent({type:StytchEventType.OAuthAuthorizeFlowStart,data:{client_id:initialParams['client_id'],redirect_uri:initialParams['redirect_uri'],scope:initialParams['scopes'].join(' ')}});_context106.p=1;_context106.n=2;return oauthAuthorizeStart(initialParams);case 2:startResponse=_context106.v;_context106.n=4;break;case 3:_context106.p=3;_t29=_context106.v;err=StytchAPIError.from(_t29);message=err.error_message;dispatch({type:'PREFLIGHT_ERROR',error:message});onError(err);return _context106.a(2);case 4:if(!startResponse.consent_required){_context106.n=5;break;}grantable=startResponse.scope_results.filter(function(s){return s.is_grantable;}).map(function(s){return s.scope;}).join(' ');ungrantable=startResponse.scope_results.filter(function(s){return!s.is_grantable;}).map(function(s){return s.scope;}).join(' ');dispatch({type:'COMPLETE_PREFLIGHT',consent_required:startResponse.consent_required,client:startResponse.client,grantable_scope:grantable,ungrantable_scope:ungrantable});return _context106.a(2);case 5:_context106.n=6;return submitInternal({consent_required:false,consent_granted:false});case 6:return _context106.a(2);}},_callee106,null,[[1,3]]);}));},[onEvent,initialParams,oauthAuthorizeStart,onError,submitInternal]);p$5(function(){if(state.preflight){return;}loadClient();},[loadClient,state.preflight]);return{state:state,submit:submit};};var IDPConsent=function IDPConsent(_ref173){var bootstrap=_ref173.bootstrap,bootstrapNotLoaded=_ref173.bootstrapNotLoaded,state=_ref173.state,submit=_ref173.submit;var _a;var _useLingui49=useLingui(),_t=_useLingui49._;var loading=state.loading,error=state.error,denied=state.denied,success=state.success,client=state.client;var customConsentManifestGenerator=useConsentManifestGenerator();var clientName=F$4(function(){var _a,_b;var name=(_b=(_a=state.client)===null||_a===void 0?void 0:_a.client_name)!==null&&_b!==void 0?_b:'';if(!name){try{var _u=new URL(state.redirect_uri);name=_u.hostname;}catch(e){logger.warn('Unable to parse host from redirect URI.',e);name=_t({id:'idpConsent.defaultClientName',message:"The App"});}}return name;},[(_a=state.client)===null||_a===void 0?void 0:_a.client_name,state.redirect_uri,_t]);var manifest=F$4(function(){if(customConsentManifestGenerator){try{return customConsentManifestGenerator({scopes:state.grantable_scope.split(' '),clientName:clientName});}catch(e){logger.error('Error rendering custom consent screen. Falling back to default consent screen.',e);}}return fallbackConsentManifestGenerator({scopes:state.grantable_scope.split(' '),rbacPolicy:bootstrap.rbacPolicy,clientName:clientName});},[customConsentManifestGenerator,state.grantable_scope,clientName,bootstrap.rbacPolicy]);var ungrantableScopeDescriptions=F$4(function(){if(state.ungrantable_scope==='')return[];return createCustomScopeDescriptions(state.ungrantable_scope.split(' '),bootstrap.rbacPolicy);},[state.ungrantable_scope,bootstrap.rbacPolicy]);if(loading||bootstrapNotLoaded){return/*#__PURE__*/wn.createElement(LoadingScreen,null);}if(error){return/*#__PURE__*/wn.createElement(ErrorDisplay,{text:error});}if(denied){return/*#__PURE__*/wn.createElement(ErrorDisplay,{text:_t({id:'idpConsent.denied',message:"Access to the application was denied."})});}if(success){return/*#__PURE__*/wn.createElement(Confirmation,null);}return/*#__PURE__*/wn.createElement(Consent,{client:client,submit:submit,grantableScope:state.grantable_scope,projectName:bootstrap.projectName},/*#__PURE__*/wn.createElement(UngrantableScopes,{ungrantableScopeDescriptions:ungrantableScopeDescriptions,clientName:clientName}),/*#__PURE__*/wn.createElement(ConsentManifest,{manifest:manifest,clientName:clientName}));};var Consent=function Consent(_ref174){var client=_ref174.client,submit=_ref174.submit,grantableScope=_ref174.grantableScope,projectName=_ref174.projectName,children=_ref174.children;var _useLingui50=useLingui(),_t2=_useLingui50._;var _Ze2=Ze(),logo=_Ze2.logo;var clientName=client.client_name;var title=containsCustomScopes(grantableScope)?_t2({id:'idpConsent.customScopes.title',message:"{clientName} wants to access your {projectName} account",values:{clientName:clientName,projectName:projectName}}):_t2({id:'idpConsent.signIn.title',message:"Sign in to {clientName} with {projectName}",values:{clientName:clientName,projectName:projectName}});return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},logo.logoImageUrl&&(/*#__PURE__*/wn.createElement(Flex,{justifyContent:"center"},/*#__PURE__*/wn.createElement(Logo,{src:logo.logoImageUrl}))),/*#__PURE__*/wn.createElement(Text,{size:"header",align:"center"},title),/*#__PURE__*/wn.createElement("div",null,children),/*#__PURE__*/wn.createElement("div",null,/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return submit({consent_granted:true});}},_t2({id:'idpConsent.button.allow',message:"Allow"})),/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return submit({consent_granted:false});},variant:"text"},_t2({id:'idpConsent.button.deny',message:"Deny"}))));};var initialState=function initialState(error){return{loading:!error,preflight:!!error,error:error,denied:false,consent_required:false,redirect_uri:''};};var logoutStateReducer=function logoutStateReducer(state,action){switch(action.type){case'START_PREFLIGHT':return Object.assign(Object.assign({},state),{preflight:true,loading:true});case'PREFLIGHT_ERROR':return Object.assign(Object.assign({},state),{preflight:true,loading:false,error:action.error});case'COMPLETE_PREFLIGHT':return Object.assign(Object.assign({},state),{loading:false,consent_required:action.consent_required,redirect_uri:action.redirect_uri});case'CONSENT_DENIED':return Object.assign(Object.assign({},state),{denied:true});default:return state;}};var useLogoutState=function useLogoutState(_ref175){var initialError=_ref175.initialError,initialParams=_ref175.initialParams,oauthLogoutStart=_ref175.oauthLogoutStart,revokeSession=_ref175.revokeSession,onError=_ref175.onError;var _s$3=s$1(logoutStateReducer,initialState(initialError)),_s$4=_slicedToArray2(_s$3,2),state=_s$4[0],dispatch=_s$4[1];p$5(function(){if(!initialError)return;onError(new IDPOAuthFlowMissingParamError(initialError));},[initialError,onError]);var submitInternal=T$3(function(redirectURI){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee107(){var _t30;return _regenerator2().w(function(_context107){while(1)switch(_context107.p=_context107.n){case 0:_context107.p=0;_context107.n=1;return revokeSession();case 1:_context107.n=3;break;case 2:_context107.p=2;_t30=_context107.v;case 3:window.location.href=redirectURI;case 4:return _context107.a(2);}},_callee107,null,[[0,2]]);}));},[revokeSession]);var logoutPreflight=T$3(function(){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee108(){var startResponse,err,message,_t31;return _regenerator2().w(function(_context108){while(1)switch(_context108.p=_context108.n){case 0:dispatch({type:'START_PREFLIGHT'});_context108.p=1;_context108.n=2;return oauthLogoutStart(initialParams);case 2:startResponse=_context108.v;_context108.n=4;break;case 3:_context108.p=3;_t31=_context108.v;err=StytchAPIError.from(_t31);message=err.error_message;dispatch({type:'PREFLIGHT_ERROR',error:message});onError(err);return _context108.a(2);case 4:if(!startResponse.consent_required){_context108.n=5;break;}dispatch({type:'COMPLETE_PREFLIGHT',consent_required:startResponse.consent_required,redirect_uri:startResponse.redirect_uri});return _context108.a(2);case 5:submitInternal(startResponse.redirect_uri);case 6:return _context108.a(2);}},_callee108,null,[[1,3]]);}));},[initialParams,oauthLogoutStart,onError,submitInternal]);p$5(function(){if(state.preflight){return;}logoutPreflight();},[logoutPreflight,state.preflight]);var submit=T$3(function(_ref176){var consent_granted=_ref176.consent_granted;return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee109(){return _regenerator2().w(function(_context109){while(1)switch(_context109.n){case 0:if(!consent_granted){_context109.n=1;break;}return _context109.a(2,submitInternal(state.redirect_uri));case 1:dispatch({type:'CONSENT_DENIED'});case 2:return _context109.a(2);}},_callee109);}));},[submitInternal,state]);return{state:state,submit:submit};};var IDPLogout=function IDPLogout(_ref177){var state=_ref177.state,submit=_ref177.submit,bootstrap=_ref177.bootstrap,bootstrapNotLoaded=_ref177.bootstrapNotLoaded;var _useLingui51=useLingui(),_t=_useLingui51._;var loading=state.loading,error=state.error,denied=state.denied;if(loading||bootstrapNotLoaded){return/*#__PURE__*/wn.createElement(LoadingScreen,null);}if(error){return/*#__PURE__*/wn.createElement(ErrorDisplay,{text:error});}if(denied){return/*#__PURE__*/wn.createElement(Confirmation,{text:_t({id:'idpLogout.notLoggedOut',message:"You have not been logged out. You may close this page."})});}var projectName=bootstrap.projectName;return/*#__PURE__*/wn.createElement(Flex,{direction:"column",gap:24},/*#__PURE__*/wn.createElement(Text,{size:"header",align:"center"},_t({id:'idpLogout.title',message:"Log out?"})),/*#__PURE__*/wn.createElement("div",null,_t({id:'idpLogout.confirmMessage',message:"Are you sure you want to log out of your {projectName} account?",values:{projectName:projectName}})),/*#__PURE__*/wn.createElement("div",null,/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return submit({consent_granted:true});}},_t({id:'idpLogout.yes',message:"Yes"})),/*#__PURE__*/wn.createElement(Button,{type:"button",onClick:function onClick(){return submit({consent_granted:false});},variant:"text"},_t({id:'idpLogout.no',message:"No"}))));};var IDPConsentScreenImpl=function IDPConsentScreenImpl(_ref178){var initialError=_ref178.initialError,initialParams=_ref178.initialParams;var stytchClient=useStytch();var onError=useErrorCallback();var onEvent=useEventCallback();var _stytchClient$idp=stytchClient.idp,oauthAuthorizeStart=_stytchClient$idp.oauthAuthorizeStart,oauthAuthorizeSubmit=_stytchClient$idp.oauthAuthorizeSubmit;var _useBootstrap2=useBootstrap(),bootstrap=_useBootstrap2.bootstrap,bootstrapNotLoaded=_useBootstrap2.fromCache;var idpConsentInfo=useIDPState({initialError:initialError,initialParams:initialParams,oauthAuthorizeStart:oauthAuthorizeStart,oauthAuthorizeSubmit:oauthAuthorizeSubmit,onError:onError,onEvent:onEvent});return/*#__PURE__*/wn.createElement(IDPConsent,Object.assign({bootstrap:bootstrap,bootstrapNotLoaded:bootstrapNotLoaded},idpConsentInfo));};var IDPLogoutScreenImpl=function IDPLogoutScreenImpl(_ref179){var initialError=_ref179.initialError,initialParams=_ref179.initialParams;var stytchClient=useStytch();var onError=useErrorCallback();var oauthLogoutStart=stytchClient.idp.oauthLogoutStart;var revokeSession=function revokeSession(){return stytchClient.session.revoke({forceClear:true});};var _useBootstrap3=useBootstrap(),bootstrap=_useBootstrap3.bootstrap,bootstrapNotLoaded=_useBootstrap3.fromCache;var idpLogoutState=useLogoutState({initialError:initialError,initialParams:initialParams,oauthLogoutStart:oauthLogoutStart,revokeSession:revokeSession,onError:onError});return/*#__PURE__*/wn.createElement(IDPLogout,Object.assign({},idpLogoutState,{bootstrap:bootstrap,bootstrapNotLoaded:bootstrapNotLoaded}));};var IDPConsentScreen=function IDPConsentScreen(){var _h$139=h$5(parseIDPParams(window.location.search)),_h$140=_slicedToArray2(_h$139,1),_h$140$=_h$140[0],flow=_h$140$.flow,error=_h$140$.error;switch(flow.type){case'Authorize':return/*#__PURE__*/wn.createElement(EnsureUserIsLoggedIn,null,/*#__PURE__*/wn.createElement(IDPConsentScreenImpl,{initialError:error,initialParams:flow.params}));case'Logout':return/*#__PURE__*/wn.createElement(IDPLogoutScreenImpl,{initialError:error,initialParams:flow.params});}};var EnsureUserIsLoggedIn=function EnsureUserIsLoggedIn(_ref180){var children=_ref180.children;var _useLingui52=useLingui(),_t=_useLingui52._;var user=useStytchUser();var onError=useErrorCallback();var onErrorRef=_$2(onError);p$5(function(){onErrorRef.current=onError;},[onError]);var stytchClient=useStytch();var authParams=useTrustedAuthTokenParams();var _h$141=h$5(false),_h$142=_slicedToArray2(_h$141,2),attesting=_h$142[0],setAttesting=_h$142[1];var _h$143=h$5(false),_h$144=_slicedToArray2(_h$143,2),attested=_h$144[0],setAttested=_h$144[1];p$5(function(){if(attesting||attested)return;var attestTrustedToken=function attestTrustedToken(authParams){return __awaiter(void 0,void 0,void 0,/*#__PURE__*/_regenerator2().m(function _callee110(){var token,profile_id,_t32;return _regenerator2().w(function(_context110){while(1)switch(_context110.p=_context110.n){case 0:if(!((authParams===null||authParams===void 0?void 0:authParams.trustedAuthToken)&&(authParams===null||authParams===void 0?void 0:authParams.tokenProfileID))){_context110.n=5;break;}setAttesting(true);token=authParams.trustedAuthToken;profile_id=authParams.tokenProfileID;if(!stytchClient.user.getSync()){_context110.n=1;break;}_context110.n=1;return stytchClient.session.revoke({forceClear:true});case 1:_context110.p=1;_context110.n=2;return stytchClient.session.attest({token:token,profile_id:profile_id,session_duration_minutes:60});case 2:_context110.n=4;break;case 3:_context110.p=3;_t32=_context110.v;onErrorRef.current(_t32);case 4:_context110.p=4;setAttesting(false);setAttested(true);return _context110.f(4);case 5:setAttested(true);case 6:return _context110.a(2);}},_callee110,null,[[1,3,4,5]]);}));};attestTrustedToken(authParams);},[authParams,attesting,attested,stytchClient]);p$5(function(){if(user)return;onErrorRef.current(new NoCurrentSessionError());},[user]);if(attesting){return/*#__PURE__*/wn.createElement(LoadingScreen,null);}else if(user){return children;}else{return/*#__PURE__*/wn.createElement(ErrorDisplay,{text:_t({id:'idpConsent.noActiveSession',message:"No active session detected. Please log in to continue."})});}};var AppContainer$1=function AppContainer$1(){var _ScreenComponentMap;var _useGlobalReducer53=useGlobalReducer(),_useGlobalReducer54=_slicedToArray2(_useGlobalReducer53,1),state=_useGlobalReducer54[0];var _Ze3=Ze(),displayWatermark=_Ze3.displayWatermark;var isOnlyFloatingOneTap=useIsOnlyFloatingOneTap();var currentScreen=state.screen;var ScreenComponentMap=(_ScreenComponentMap={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ScreenComponentMap,AppScreens$1.Main,/*#__PURE__*/wn.createElement(MainScreen,null)),AppScreens$1.PasskeyRegistrationStart,/*#__PURE__*/wn.createElement(PasskeyRegistrationStart,null)),AppScreens$1.PasskeyRegistrationSuccess,/*#__PURE__*/wn.createElement(PasskeyRegistrationSuccess,null)),AppScreens$1.PasskeyConfirmation,/*#__PURE__*/wn.createElement(PasskeyConfirmation,null)),AppScreens$1.PasswordResetForm,/*#__PURE__*/wn.createElement(ResetPasswordScreen,null)),AppScreens$1.PasswordCreateOrLogin,/*#__PURE__*/wn.createElement(Password,null)),AppScreens$1.PasswordForgot,/*#__PURE__*/wn.createElement(PasswordForgot,null)),AppScreens$1.PasswordBreached,/*#__PURE__*/wn.createElement(PasswordBreached,null)),AppScreens$1.PasswordSetNew,/*#__PURE__*/wn.createElement(PasswordSetNew,null)),AppScreens$1.PasswordDedupe,/*#__PURE__*/wn.createElement(PasswordDedupe,null)),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ScreenComponentMap,AppScreens$1.PasswordConfirmation,/*#__PURE__*/wn.createElement(PasswordConfirmation,null)),AppScreens$1.EmailConfirmation,/*#__PURE__*/wn.createElement(EmailConfirmation,null)),AppScreens$1.OTPAuthenticate,/*#__PURE__*/wn.createElement(OTPAuthenticate,null)),AppScreens$1.OTPConfirmation,/*#__PURE__*/wn.createElement(OTPConfirmation,null)),AppScreens$1.CryptoConnect,/*#__PURE__*/wn.createElement(ConnectWallet,null)),AppScreens$1.CryptoSignMessage,/*#__PURE__*/wn.createElement(SignMessage,null)),AppScreens$1.CryptoOtherScreen,/*#__PURE__*/wn.createElement(OtherCryptoWallets,null)),AppScreens$1.CryptoSetupWallet,/*#__PURE__*/wn.createElement(SetupNewWallet,null)),AppScreens$1.CryptoError,/*#__PURE__*/wn.createElement(Error$1,null)),AppScreens$1.CryptoConfirmation,/*#__PURE__*/wn.createElement(Success,null)),_defineProperty(_ScreenComponentMap,AppScreens$1.IDPConsent,/*#__PURE__*/wn.createElement(IDPConsentScreen,null)));if(isOnlyFloatingOneTap){return/*#__PURE__*/wn.createElement(GoogleOneTap,{position:OneTapPositions.floating});}return/*#__PURE__*/wn.createElement(MainContainer,{displayWatermark:displayWatermark},ScreenComponentMap[currentScreen]);};var lodash_merge={exports:{}};lodash_merge.exports;(function(module,exports){var LARGE_ARRAY_SIZE=200;var HASH_UNDEFINED='__lodash_hash_undefined__';var HOT_COUNT=800,HOT_SPAN=16;var MAX_SAFE_INTEGER=9007199254740991;var argsTag='[object Arguments]',arrayTag='[object Array]',asyncTag='[object AsyncFunction]',boolTag='[object Boolean]',dateTag='[object Date]',errorTag='[object Error]',funcTag='[object Function]',genTag='[object GeneratorFunction]',mapTag='[object Map]',numberTag='[object Number]',nullTag='[object Null]',objectTag='[object Object]',proxyTag='[object Proxy]',regexpTag='[object RegExp]',setTag='[object Set]',stringTag='[object String]',undefinedTag='[object Undefined]',weakMapTag='[object WeakMap]';var arrayBufferTag='[object ArrayBuffer]',dataViewTag='[object DataView]',float32Tag='[object Float32Array]',float64Tag='[object Float64Array]',int8Tag='[object Int8Array]',int16Tag='[object Int16Array]',int32Tag='[object Int32Array]',uint8Tag='[object Uint8Array]',uint8ClampedTag='[object Uint8ClampedArray]',uint16Tag='[object Uint16Array]',uint32Tag='[object Uint32Array]';var reRegExpChar=/[\\^$.*+?()[\]{}|]/g;var reIsHostCtor=/^\[object .+?Constructor\]$/;var reIsUint=/^(?:0|[1-9]\d*)$/;var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;var freeGlobal=_typeof2(commonjsGlobal)=='object'&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;var freeSelf=(typeof self==="undefined"?"undefined":_typeof2(self))=='object'&&self&&self.Object===Object&&self;var root=freeGlobal||freeSelf||Function('return this')();var freeExports=exports&&!exports.nodeType&&exports;var freeModule=freeExports&&'object'=='object'&&module&&!module.nodeType&&module;var moduleExports=freeModule&&freeModule.exports===freeExports;var freeProcess=moduleExports&&freeGlobal.process;var nodeUtil=function(){try{var types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}return freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();var nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2]);}return func.apply(thisArg,args);}function baseTimes(n,iteratee){var index=-1,result=Array(n);while(++index<n){result[index]=iteratee(index);}return result;}function baseUnary(func){return function(value){return func(value);};}function getValue(object,key){return object==null?undefined:object[key];}function overArg(func,transform){return function(arg){return func(transform(arg));};}var arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype;var coreJsData=root['__core-js_shared__'];var funcToString=funcProto.toString;var hasOwnProperty=objectProto.hasOwnProperty;var maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||'');return uid?'Symbol(src)_1.'+uid:'';}();var nativeObjectToString=objectProto.toString;var objectCtorString=funcToString.call(Object);var reIsNative=RegExp('^'+funcToString.call(hasOwnProperty).replace(reRegExpChar,'\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,'$1.*?')+'$');var Buffer=moduleExports?root.Buffer:undefined,_Symbol=root.Symbol,Uint8Array=root.Uint8Array;Buffer?Buffer.allocUnsafe:undefined;var getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,symToStringTag=_Symbol?_Symbol.toStringTag:undefined;var defineProperty=function(){try{var func=getNative(Object,'defineProperty');func({},'',{});return func;}catch(e){}}();var nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeMax=Math.max,nativeNow=Date.now;var Map=getNative(root,'Map'),nativeCreate=getNative(Object,'create');var baseCreate=function(){function object(){}return function(proto){if(!isObject(proto)){return{};}if(objectCreate){return objectCreate(proto);}object.prototype=proto;var result=new object();object.prototype=undefined;return result;};}();function Hash(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};this.size=0;}function hashDelete(key){var result=this.has(key)&&delete this.__data__[key];this.size-=result?1:0;return result;}function hashGet(key){var data=this.__data__;if(nativeCreate){var result=data[key];return result===HASH_UNDEFINED?undefined:result;}return hasOwnProperty.call(data,key)?data[key]:undefined;}function hashHas(key){var data=this.__data__;return nativeCreate?data[key]!==undefined:hasOwnProperty.call(data,key);}function hashSet(key,value){var data=this.__data__;this.size+=this.has(key)?0:1;data[key]=nativeCreate&&value===undefined?HASH_UNDEFINED:value;return this;}Hash.prototype.clear=hashClear;Hash.prototype['delete']=hashDelete;Hash.prototype.get=hashGet;Hash.prototype.has=hashHas;Hash.prototype.set=hashSet;function ListCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}function listCacheClear(){this.__data__=[];this.size=0;}function listCacheDelete(key){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){return false;}var lastIndex=data.length-1;if(index==lastIndex){data.pop();}else{splice.call(data,index,1);}--this.size;return true;}function listCacheGet(key){var data=this.__data__,index=assocIndexOf(data,key);return index<0?undefined:data[index][1];}function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1;}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else{data[index][1]=value;}return this;}ListCache.prototype.clear=listCacheClear;ListCache.prototype['delete']=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index<length){var entry=entries[index];this.set(entry[0],entry[1]);}}function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}function mapCacheDelete(key){var result=getMapData(this,key)['delete'](key);this.size-=result?1:0;return result;}function mapCacheGet(key){return getMapData(this,key).get(key);}function mapCacheHas(key){return getMapData(this,key).has(key);}function mapCacheSet(key,value){var data=getMapData(this,key),size=data.size;data.set(key,value);this.size+=data.size==size?0:1;return this;}MapCache.prototype.clear=mapCacheClear;MapCache.prototype['delete']=mapCacheDelete;MapCache.prototype.get=mapCacheGet;MapCache.prototype.has=mapCacheHas;MapCache.prototype.set=mapCacheSet;function Stack(entries){var data=this.__data__=new ListCache(entries);this.size=data.size;}function stackClear(){this.__data__=new ListCache();this.size=0;}function stackDelete(key){var data=this.__data__,result=data['delete'](key);this.size=data.size;return result;}function stackGet(key){return this.__data__.get(key);}function stackHas(key){return this.__data__.has(key);}function stackSet(key,value){var data=this.__data__;if(data instanceof ListCache){var pairs=data.__data__;if(!Map||pairs.length<LARGE_ARRAY_SIZE-1){pairs.push([key,value]);this.size=++data.size;return this;}data=this.__data__=new MapCache(pairs);}data.set(key,value);this.size=data.size;return this;}Stack.prototype.clear=stackClear;Stack.prototype['delete']=stackDelete;Stack.prototype.get=stackGet;Stack.prototype.has=stackHas;Stack.prototype.set=stackSet;function arrayLikeKeys(value,inherited){var isArr=isArray(value),isArg=!isArr&&isArguments(value),isBuff=!isArr&&!isArg&&isBuffer(value),isType=!isArr&&!isArg&&!isBuff&&isTypedArray(value),skipIndexes=isArr||isArg||isBuff||isType,result=skipIndexes?baseTimes(value.length,String):[],length=result.length;for(var key in value){if(!(skipIndexes&&(key=='length'||isBuff&&(key=='offset'||key=='parent')||isType&&(key=='buffer'||key=='byteLength'||key=='byteOffset')||isIndex(key,length)))){result.push(key);}}return result;}function assignMergeValue(object,key,value){if(value!==undefined&&!eq(object[key],value)||value===undefined&&!(key in object)){baseAssignValue(object,key,value);}}function assignValue(object,key,value){var objValue=object[key];if(!(hasOwnProperty.call(object,key)&&eq(objValue,value))||value===undefined&&!(key in object)){baseAssignValue(object,key,value);}}function assocIndexOf(array,key){var length=array.length;while(length--){if(eq(array[length][0],key)){return length;}}return-1;}function baseAssignValue(object,key,value){if(key=='__proto__'&&defineProperty){defineProperty(object,key,{'configurable':true,'enumerable':true,'value':value,'writable':true});}else{object[key]=value;}}var baseFor=createBaseFor();function baseGetTag(value){if(value==null){return value===undefined?undefinedTag:nullTag;}return symToStringTag&&symToStringTag in Object(value)?getRawTag(value):objectToString(value);}function baseIsArguments(value){return isObjectLike(value)&&baseGetTag(value)==argsTag;}function baseIsNative(value){if(!isObject(value)||isMasked(value)){return false;}var pattern=isFunction(value)?reIsNative:reIsHostCtor;return pattern.test(toSource(value));}function baseIsTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&!!typedArrayTags[baseGetTag(value)];}function baseKeysIn(object){if(!isObject(object)){return nativeKeysIn(object);}var isProto=isPrototype(object),result=[];for(var key in object){if(!(key=='constructor'&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key);}}return result;}function baseMerge(object,source,srcIndex,customizer,stack){if(object===source){return;}baseFor(source,function(srcValue,key){stack||(stack=new Stack());if(isObject(srcValue)){baseMergeDeep(object,source,key,srcIndex,baseMerge,customizer,stack);}else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+'',object,source,stack):undefined;if(newValue===undefined){newValue=srcValue;}assignMergeValue(object,key,newValue);}},keysIn);}function baseMergeDeep(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet(object,key),srcValue=safeGet(source,key),stacked=stack.get(srcValue);if(stacked){assignMergeValue(object,key,stacked);return;}var newValue=customizer?customizer(objValue,srcValue,key+'',object,source,stack):undefined;var isCommon=newValue===undefined;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue;if(isArr||isBuff||isTyped){if(isArray(objValue)){newValue=objValue;}else if(isArrayLikeObject(objValue)){newValue=copyArray(objValue);}else if(isBuff){isCommon=false;newValue=cloneBuffer(srcValue);}else if(isTyped){isCommon=false;newValue=cloneTypedArray(srcValue);}else{newValue=[];}}else if(isPlainObject(srcValue)||isArguments(srcValue)){newValue=objValue;if(isArguments(objValue)){newValue=toPlainObject(objValue);}else if(!isObject(objValue)||isFunction(objValue)){newValue=initCloneObject(srcValue);}}else{isCommon=false;}}if(isCommon){stack.set(srcValue,newValue);mergeFunc(newValue,srcValue,srcIndex,customizer,stack);stack['delete'](srcValue);}assignMergeValue(object,key,newValue);}function baseRest(func,start){return setToString(overRest(func,start,identity),func+'');}var baseSetToString=!defineProperty?identity:function(func,string){return defineProperty(func,'toString',{'configurable':true,'enumerable':false,'value':constant(string),'writable':true});};function cloneBuffer(buffer,isDeep){{return buffer.slice();}}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}function cloneTypedArray(typedArray,isDeep){var buffer=cloneArrayBuffer(typedArray.buffer);return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length);}function copyArray(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index];}return array;}function copyObject(source,props,object,customizer){var isNew=!object;object||(object={});var index=-1,length=props.length;while(++index<length){var key=props[index];var newValue=undefined;if(newValue===undefined){newValue=source[key];}if(isNew){baseAssignValue(object,key,newValue);}else{assignValue(object,key,newValue);}}return object;}function createAssigner(assigner){return baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;customizer=assigner.length>3&&typeof customizer=='function'?(length--,customizer):undefined;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined:customizer;length=1;}object=Object(object);while(++index<length){var source=sources[index];if(source){assigner(object,source,index,customizer);}}return object;});}function createBaseFor(fromRight){return function(object,iteratee,keysFunc){var index=-1,iterable=Object(object),props=keysFunc(object),length=props.length;while(length--){var key=props[++index];if(iteratee(iterable[key],key,iterable)===false){break;}}return object;};}function getMapData(map,key){var data=map.__data__;return isKeyable(key)?data[typeof key=='string'?'string':'hash']:data.map;}function getNative(object,key){var value=getValue(object,key);return baseIsNative(value)?value:undefined;}function getRawTag(value){var isOwn=hasOwnProperty.call(value,symToStringTag),tag=value[symToStringTag];try{value[symToStringTag]=undefined;var unmasked=true;}catch(e){}var result=nativeObjectToString.call(value);if(unmasked){if(isOwn){value[symToStringTag]=tag;}else{delete value[symToStringTag];}}return result;}function initCloneObject(object){return typeof object.constructor=='function'&&!isPrototype(object)?baseCreate(getPrototype(object)):{};}function isIndex(value,length){var type=_typeof2(value);length=length==null?MAX_SAFE_INTEGER:length;return!!length&&(type=='number'||type!='symbol'&&reIsUint.test(value))&&value>-1&&value%1==0&&value<length;}function isIterateeCall(value,index,object){if(!isObject(object)){return false;}var type=_typeof2(index);if(type=='number'?isArrayLike(object)&&isIndex(index,object.length):type=='string'&&index in object){return eq(object[index],value);}return false;}function isKeyable(value){var type=_typeof2(value);return type=='string'||type=='number'||type=='symbol'||type=='boolean'?value!=='__proto__':value===null;}function isMasked(func){return!!maskSrcKey&&maskSrcKey in func;}function isPrototype(value){var Ctor=value&&value.constructor,proto=typeof Ctor=='function'&&Ctor.prototype||objectProto;return value===proto;}function nativeKeysIn(object){var result=[];if(object!=null){for(var key in Object(object)){result.push(key);}}return result;}function objectToString(value){return nativeObjectToString.call(value);}function overRest(func,start,transform){start=nativeMax(start===undefined?func.length-1:start,0);return function(){var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);while(++index<length){array[index]=args[start+index];}index=-1;var otherArgs=Array(start+1);while(++index<start){otherArgs[index]=args[index];}otherArgs[start]=transform(array);return apply(func,this,otherArgs);};}function safeGet(object,key){if(key==='constructor'&&typeof object[key]==='function'){return;}if(key=='__proto__'){return;}return object[key];}var setToString=shortOut(baseSetToString);function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=HOT_SPAN-(stamp-lastCalled);lastCalled=stamp;if(remaining>0){if(++count>=HOT_COUNT){return arguments[0];}}else{count=0;}return func.apply(undefined,arguments);};}function toSource(func){if(func!=null){try{return funcToString.call(func);}catch(e){}try{return func+'';}catch(e){}}return'';}function eq(value,other){return value===other||value!==value&&other!==other;}var isArguments=baseIsArguments(function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');};var isArray=Array.isArray;function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value);}var isBuffer=nativeIsBuffer||stubFalse;function isFunction(value){if(!isObject(value)){return false;}var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag;}function isLength(value){return typeof value=='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}function isObject(value){var type=_typeof2(value);return value!=null&&(type=='object'||type=='function');}function isObjectLike(value){return value!=null&&_typeof2(value)=='object';}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag){return false;}var proto=getPrototype(value);if(proto===null){return true;}var Ctor=hasOwnProperty.call(proto,'constructor')&&proto.constructor;return typeof Ctor=='function'&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString;}var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;function toPlainObject(value){return copyObject(value,keysIn(value));}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeysIn(object);}var merge=createAssigner(function(object,source,srcIndex){baseMerge(object,source,srcIndex);});function constant(value){return function(){return value;};}function identity(value){return value;}function stubFalse(){return false;}module.exports=merge;})(lodash_merge,lodash_merge.exports);var lodash_mergeExports=lodash_merge.exports;var merge=/*@__PURE__*/getDefaultExportFromCjs(lodash_mergeExports);var defaultDisabledTextColor='#8296A1';var createTheme=function createTheme(styles){var displayWatermark=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var _a,_b,_c,_d,_e;var styleConfig=merge({},DEFAULT_STYLE_CONFIG,styles);var fontFamily=styleConfig.fontFamily,colors=styleConfig.colors,container=styleConfig.container,buttons=styleConfig.buttons,inputs=styleConfig.inputs;return{typography:{fontFamily:fontFamily,header:{fontFamily:fontFamily,fontSize:24,fontWeight:600,lineHeight:'30px'},body:{fontFamily:fontFamily,fontSize:16,fontWeight:'normal',lineHeight:'21px'},helper:{fontFamily:fontFamily,fontSize:14,fontWeight:'400',lineHeight:'20px',whiteSpace:'pre-wrap'}},colors:{primary:colors.primary,secondary:colors.secondary,success:colors.success,warning:colors.warning,error:colors.error,accent:colors.accent,disabled:'#F3F5F6',disabledText:defaultDisabledTextColor},container:{width:container.width,border:"1px solid ".concat(container.borderColor),borderRadius:container.borderRadius,backgroundColor:container.backgroundColor},buttons:{primary:{backgroundColor:buttons.primary.backgroundColor,textColor:buttons.primary.textColor,border:"1px solid ".concat(buttons.primary.borderColor),borderRadius:buttons.primary.borderRadius},secondary:{backgroundColor:buttons.secondary.backgroundColor,textColor:buttons.secondary.textColor,border:"1px solid ".concat(buttons.secondary.borderColor),borderRadius:buttons.secondary.borderRadius},disabled:{textColor:buttons.disabled.textColor,backgroundColor:buttons.disabled.backgroundColor,border:"1px solid ".concat(buttons.disabled.borderColor),borderRadius:buttons.disabled.borderRadius}},inputs:{backgroundColor:(_a=inputs===null||inputs===void 0?void 0:inputs.backgroundColor)!==null&&_a!==void 0?_a:'transparent',textColor:(_b=inputs===null||inputs===void 0?void 0:inputs.textColor)!==null&&_b!==void 0?_b:colors.primary,borderColor:(_c=inputs===null||inputs===void 0?void 0:inputs.borderColor)!==null&&_c!==void 0?_c:colors.primary,borderRadius:(_d=inputs===null||inputs===void 0?void 0:inputs.borderRadius)!==null&&_d!==void 0?_d:'4px',placeholderColor:(_e=inputs===null||inputs===void 0?void 0:inputs.placeholderColor)!==null&&_e!==void 0?_e:defaultDisabledTextColor},displayHeader:!styleConfig.hideHeaderText,displayWatermark:displayWatermark,logo:{logoImageUrl:styleConfig.logo.logoImageUrl}};};var useTheme=function useTheme(_ref181){var styles=_ref181.styles,displayWatermark=_ref181.displayWatermark;return F$4(function(){return createTheme(styles,displayWatermark);},[styles,displayWatermark]);};var AppContainer=function AppContainer(_ref182){var client=_ref182.client,config=_ref182.config,styles=_ref182.styles,callbacks=_ref182.callbacks,strings=_ref182.strings;var _h$145=h$5(function(){var _readB2CInternals$boo2=readB2CInternals(client).bootstrap.getSync(),displayWatermark=_readB2CInternals$boo2.displayWatermark;return displayWatermark;}),_h$146=_slicedToArray2(_h$145,2),displayWatermark=_h$146[0],setDisplayWatermark=_h$146[1];p$5(function(){readB2CInternals(client).bootstrap.getAsync().then(function(data){readB2CInternals(client).networkClient.logEvent({name:'render_login_screen',details:{options:config,bootstrap:data}});setDisplayWatermark(data.displayWatermark);});},[client]);var theme=useTheme({styles:styles,displayWatermark:displayWatermark});return/*#__PURE__*/wn.createElement(GlobalContextProvider,{client:client,config:config,callbacks:callbacks},/*#__PURE__*/wn.createElement(Fe,{theme:theme},/*#__PURE__*/wn.createElement(I18nProviderWrapper,{messages:messages,overrides:strings},/*#__PURE__*/wn.createElement(AppContainer$1,null))));};var ResetPasswordContainer=function ResetPasswordContainer(_ref183){var client=_ref183.client,config=_ref183.config,styles=_ref183.styles,callbacks=_ref183.callbacks,strings=_ref183.strings,passwordResetToken=_ref183.passwordResetToken;var _h$147=h$5(function(){var _readB2CInternals$boo3=readB2CInternals(client).bootstrap.getSync(),displayWatermark=_readB2CInternals$boo3.displayWatermark;return displayWatermark;}),_h$148=_slicedToArray2(_h$147,2),displayWatermark=_h$148[0],setDisplayWatermark=_h$148[1];var initialState=Object.assign(Object.assign({},DEFAULT_STATE),{screen:AppScreens$1.PasswordResetForm,formState:Object.assign(Object.assign({},DEFAULT_STATE.formState),{resetPasswordState:{token:passwordResetToken}})});p$5(function(){readB2CInternals(client).bootstrap.getAsync().then(function(_ref184){var displayWatermark=_ref184.displayWatermark;setDisplayWatermark(displayWatermark);});},[client]);var theme=useTheme({styles:styles,displayWatermark:displayWatermark});return/*#__PURE__*/wn.createElement(GlobalContextProvider,{client:client,config:config,callbacks:callbacks,initialState:initialState},/*#__PURE__*/wn.createElement(Fe,{theme:theme},/*#__PURE__*/wn.createElement(I18nProviderWrapper,{messages:messages,overrides:strings},/*#__PURE__*/wn.createElement(AppContainer$1,null))));};var PasskeyRegistrationContainer=function PasskeyRegistrationContainer(_ref185){var client=_ref185.client,config=_ref185.config,styles=_ref185.styles,callbacks=_ref185.callbacks,strings=_ref185.strings;var _h$149=h$5(function(){var _readB2CInternals$boo4=readB2CInternals(client).bootstrap.getSync(),displayWatermark=_readB2CInternals$boo4.displayWatermark;return displayWatermark;}),_h$150=_slicedToArray2(_h$149,2),displayWatermark=_h$150[0],setDisplayWatermark=_h$150[1];var initialState=Object.assign(Object.assign({},DEFAULT_STATE),{screen:AppScreens$1.PasskeyRegistrationStart,formState:Object.assign({},DEFAULT_STATE.formState)});p$5(function(){readB2CInternals(client).bootstrap.getAsync().then(function(_ref186){var displayWatermark=_ref186.displayWatermark;setDisplayWatermark(displayWatermark);});},[client]);var theme=useTheme({styles:styles,displayWatermark:displayWatermark});return/*#__PURE__*/wn.createElement(GlobalContextProvider,{client:client,config:config,callbacks:callbacks,initialState:initialState},/*#__PURE__*/wn.createElement(Fe,{theme:theme},/*#__PURE__*/wn.createElement(I18nProviderWrapper,{messages:messages,overrides:strings},/*#__PURE__*/wn.createElement(AppContainer$1,null))));};var IDPContainer=function IDPContainer(_ref187){var client=_ref187.client,styles=_ref187.styles,callbacks=_ref187.callbacks,strings=_ref187.strings,getIDPConsentManifest=_ref187.getIDPConsentManifest,authTokenParams=_ref187.authTokenParams;var initialState=Object.assign(Object.assign({},DEFAULT_STATE),{screen:AppScreens$1.IDPConsent});var theme=useTheme({styles:styles,displayWatermark:false});p$5(function(){readB2CInternals(client).bootstrap.getAsync().then(function(data){readB2CInternals(client).networkClient.logEvent({name:'render_idp_screen',details:{bootstrap:data}});});},[client]);return/*#__PURE__*/wn.createElement(GlobalContextProvider,{client:client,config:DEFAULT_CONFIG,callbacks:callbacks,initialState:initialState},/*#__PURE__*/wn.createElement(IDPContextProvider,{consentManifestGenerator:getIDPConsentManifest,authTokenParams:authTokenParams},/*#__PURE__*/wn.createElement(Fe,{theme:theme},/*#__PURE__*/wn.createElement(I18nProviderWrapper,{messages:messages,overrides:strings},/*#__PURE__*/wn.createElement(AppContainer$1,null)))));};var UI_SCREEN_WEB_COMPONENT_NAME='stytch-ui';var UI_RESET_PASSWORD_WEB_COMPONENT_NAME='stytch-reset-password';var UI_PASSKEY_REGISTRATION_WEB_COMPONENT_NAME='stytch-passkey-registration';var UI_IDP_WEB_COMPONENT_NAME='stytch-identity-provider';var UILoginComponent=CreateSSRSafeWebComponent(AppContainer,UI_SCREEN_WEB_COMPONENT_NAME);var UIResetPasswordComponent=CreateSSRSafeWebComponent(ResetPasswordContainer,UI_RESET_PASSWORD_WEB_COMPONENT_NAME);var UIPasskeyRegistrationComponent=CreateSSRSafeWebComponent(PasskeyRegistrationContainer,UI_PASSKEY_REGISTRATION_WEB_COMPONENT_NAME);var UIIdentityProviderComponent=CreateSSRSafeWebComponent(IDPContainer,UI_IDP_WEB_COMPONENT_NAME);var StytchUIClient=/*#__PURE__*/function(_StytchHeadlessClient){function StytchUIClient(){_classCallCheck2(this,StytchUIClient);checkNotSSR('StytchUIClient');for(var _len10=arguments.length,args=new Array(_len10),_key10=0;_key10<_len10;_key10++){args[_key10]=arguments[_key10];}return _callSuper2(this,StytchUIClient,[].concat(args));}_inherits2(StytchUIClient,_StytchHeadlessClient);return _createClass2(StytchUIClient,[{key:"mountLogin",value:function mountLogin(_ref188){var elementId=_ref188.elementId,config=_ref188.config,styles=_ref188.styles,callbacks=_ref188.callbacks,strings=_ref188.strings;var _a;var targetParentDomNode=document.querySelector(elementId);if(!targetParentDomNode){throw new Error("The selector you specified (".concat(elementId,") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin()."));}if(((_a=targetParentDomNode.firstChild)===null||_a===void 0?void 0:_a.nodeName.toLowerCase())===UI_SCREEN_WEB_COMPONENT_NAME.toLowerCase()){var node=targetParentDomNode.firstChild;node.render({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings});return;}var loginElement=UILoginComponent({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings});targetParentDomNode.appendChild(loginElement);}},{key:"mountResetPassword",value:function mountResetPassword(_ref189){var elementId=_ref189.elementId,config=_ref189.config,styles=_ref189.styles,callbacks=_ref189.callbacks,strings=_ref189.strings,passwordResetToken=_ref189.passwordResetToken;var _a;var targetParentDomNode=document.querySelector(elementId);if(!targetParentDomNode){throw new Error("The selector you specified (".concat(elementId,") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountLogin()."));}if(((_a=targetParentDomNode.firstChild)===null||_a===void 0?void 0:_a.nodeName.toLowerCase())===UI_RESET_PASSWORD_WEB_COMPONENT_NAME.toLowerCase()){var node=targetParentDomNode.firstChild;node.render({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings,passwordResetToken:passwordResetToken});return;}var loginElement=UIResetPasswordComponent({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings,passwordResetToken:passwordResetToken});targetParentDomNode.appendChild(loginElement);}},{key:"mountPasskeyRegistration",value:function mountPasskeyRegistration(_ref190){var elementId=_ref190.elementId,config=_ref190.config,styles=_ref190.styles,callbacks=_ref190.callbacks,strings=_ref190.strings;var _a;var targetParentDomNode=document.querySelector(elementId);if(!targetParentDomNode){throw new Error("The selector you specified (".concat(elementId,") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountPasskeyRegistration()."));}if(((_a=targetParentDomNode.firstChild)===null||_a===void 0?void 0:_a.nodeName.toLowerCase())===UI_PASSKEY_REGISTRATION_WEB_COMPONENT_NAME.toLowerCase()){var node=targetParentDomNode.firstChild;node.render({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings});return;}var passkeyRegistrationElement=UIPasskeyRegistrationComponent({client:this,config:config,callbacks:callbacks,styles:styles,strings:strings});targetParentDomNode.appendChild(passkeyRegistrationElement);}},{key:"mountIdentityProvider",value:function mountIdentityProvider(_ref191){var elementId=_ref191.elementId,styles=_ref191.styles,callbacks=_ref191.callbacks,strings=_ref191.strings,getIDPConsentManifest=_ref191.getIDPConsentManifest,authTokenParams=_ref191.authTokenParams;var _a;var targetParentDomNode=document.querySelector(elementId);if(!targetParentDomNode){throw new Error("The selector you specified (".concat(elementId,") applies to no DOM elements that are currently on the page. Make sure the element exists on the page before calling mountIdentityProvider()."));}if(((_a=targetParentDomNode.firstChild)===null||_a===void 0?void 0:_a.nodeName.toLowerCase())===UI_IDP_WEB_COMPONENT_NAME.toLowerCase()){var node=targetParentDomNode.firstChild;node.render({client:this,callbacks:callbacks,styles:styles,strings:strings,getIDPConsentManifest:getIDPConsentManifest,authTokenParams:authTokenParams});return;}var idpElement=UIIdentityProviderComponent({client:this,callbacks:callbacks,styles:styles,strings:strings,getIDPConsentManifest:getIDPConsentManifest,authTokenParams:authTokenParams});targetParentDomNode.appendChild(idpElement);}}]);}(StytchHeadlessClient);export{AuthFlowType,B2BMFAProducts,B2BOAuthProviders,B2BProducts,BiometricRegistrationIdIsNullOrBlank,BiometricsAlreadyEnrolledError,BiometricsFailedError,BiometricsUnavailableError,ChallengeSigningFailedError,DFPNotConfigured,DeviceCredentialsNotAllowedError,FailedCodeChallengeError,FailedToDecryptDataError,IDPOAuthFlowMissingParamError,InternalError,InvalidAuthorizationCredentialError,InvalidCredentialTypeError,InvalidPrivateKeyLength,InvalidRedirectSchemeError,InvalidStartUrlError,JSONDataNotConvertibleToStringError,KeyInvalidatedError,KeystoreUnavailableError,MissingAttestationObjectError,MissingAuthorizationCredentialIDTokenError,MissingCipherIv,MissingGoogleClientIDError,MissingPKCEError,MissingPublicKeyError,MissingUrlError,NoBiometricsEnrolledError,NoBiometricsRegistrationError,NoCredentialsPresentError,NoCurrentSessionError,OAuthProviders,OTPMethods,OneTapPositions,PasskeysInvalidEncoding,PasskeysMisconfigured,PasskeysUnsupportedError,Products,RNUIProducts,RandomNumberGenerationFailed,RedirectURLType,SDKAPIUnreachableError,SDKNotConfiguredError,SignInWithAppleMisconfigured,StytchAPIError,StytchAPISchemaError,StytchAPIUnreachableError,StytchError,StytchEventType,StytchSDKAPIError,StytchSDKError,StytchSDKSchemaError,StytchSDKUsageError,StytchUIClient,UNRECOVERABLE_ERROR_TYPES,UserCancellationError,UserLockedOutError,Wallets,errorToStytchError,parseOAuthAuthorizeParams,parseOAuthLogoutParams};
2
2
  //# sourceMappingURL=index.esm.js.map