import{rn as e}from"./DRAiiyBy.mjs";import"./DOa9RD2F.mjs";import{z as t}from"./BF6TA2-F.mjs";import{an as n}from"./BZecBhUN.mjs";import{t as r}from"./Da3zqOpz.mjs";import{f as i,u as a}from"./C3A_u7bk.mjs";import{i as o}from"./Duo7wYpB.mjs";import"./4wEmR0yk.mjs";import{t as s}from"./C3-3c3M6.mjs";import{n as c}from"./BMp7cOJR.mjs";import{n as l}from"./DDq3sxt7.mjs";import{t as u}from"./5EcwwInY.mjs";import{n as d}from"./CFKRsHZu.mjs";import{n as f}from"./CfWZUDe_.mjs";import{t as p}from"./B_1wnK3k.mjs";import{n as m}from"./BuDrDqr1.mjs";import{n as ee,t as te}from"./LDvQtmP_.mjs";import{t as ne}from"./B_hsDNZv.mjs";import{t as re}from"./hxcfbL5i.mjs";import{t as h}from"./DpBYHBiv.mjs";function g(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function _(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;ee};function y(e){let{id:t}=e;return{...e,id:_(t),transports:e.transports}}function b(e){return e===`localhost`||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}var x=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function ae({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new x({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new x({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new x({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new x({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new x({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new x({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new x({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new x({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!b(t))return new x({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new x({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new x({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new x({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var S=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},oe=[`cross-platform`,`platform`];function C(e){if(e&&!(oe.indexOf(e)<0))return e}async function se(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!v())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:_(t.challenge),user:{...t.user,id:_(t.user.id)},excludeCredentials:t.excludeCredentials?.map(y)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=S.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw ae({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){w(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=g(e))}catch(e){w(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=g(c.getAuthenticatorData())}catch(e){w(`getAuthenticatorData()`,e)}return{id:o,rawId:g(s),response:{attestationObject:g(c.attestationObject),clientDataJSON:g(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:C(a.authenticatorAttachment)}}function w(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function T(){if(!v())return E.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?E.stubThis(new Promise(e=>e(!1))):E.stubThis(e.isConditionalMediationAvailable())}var E={stubThis:e=>e};function ce({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new x({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new x({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!b(t))return new x({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new x({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new x({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function le(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!v())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(y));let a={...t,challenge:_(t.challenge),allowCredentials:i},o={};if(n){if(!await T())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=S.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw ce({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=g(u.userHandle)),{id:c,rawId:g(l),response:{authenticatorData:g(u.authenticatorData),clientDataJSON:g(u.clientDataJSON),signature:g(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:C(s.authenticatorAttachment)}}function ue(){return v()?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():new Promise(e=>e(!1))}var D=e=>({title:e.title,body:e.body,icon:ne,type:e.positive?`positive`:`negative`,persistent:e.persistent??!1}),O=!1,k=null,A=()=>O,j=e=>{O=e},M=e=>{k=e},de=()=>k,fe=(e,t)=>{e&&(d.updateFeatureFlag(e),t&&j(e.config?.enabled??!1))};function N(e,t,n){m.open(D({positive:e,title:t,body:n}))}var pe=e=>({...e,pubKeyCredParams:e.pubKeyCredParams.map(e=>({...e,type:`public-key`})),excludeCredentials:e.excludeCredentials?.map(e=>({id:e.id,type:`public-key`,transports:e.transports}))??void 0,authenticatorSelection:e.authenticatorSelection?{...e.authenticatorSelection,authenticatorAttachment:e.authenticatorSelection.authenticatorAttachment,requireResidentKey:e.authenticatorSelection.requireResidentKey??void 0,userVerification:e.authenticatorSelection.userVerification,residentKey:e.authenticatorSelection.residentKey}:void 0,hints:e.hints?.map(e=>e)??void 0,attestation:e.attestation,attestationFormats:e.attestationFormats?.filter(e=>e!==null),rp:{...e.rp,id:e.rp.id??void 0},extensions:e.extensions?{...e.extensions,appid:e.extensions.appid??void 0,credProps:e.extensions.credProps??void 0,hmacCreateSecret:e.extensions.hmacCreateSecret??void 0,minPinLength:e.extensions.minPinLength??void 0}:void 0}),P=e=>({...e,id:e.id,rawId:e.rawId,response:{...e.response,attestationObject:e.response.attestationObject,clientDataJSON:e.response.clientDataJSON,transports:e.response.transports?.join(`,`)||``},type:e.type,clientExtensionResults:JSON.stringify(e.clientExtensionResults),authenticatorAttachment:e.authenticatorAttachment}),F=e=>({...e,allowCredentials:e.allowCredentials?.map(e=>({id:e.id,type:`public-key`,transports:e.transports}))??void 0,extensions:e.extensions?{appid:e.extensions.appid??void 0,credProps:e.extensions.credProps??void 0,hmacCreateSecret:e.extensions.hmacCreateSecret??void 0,minPinLength:e.extensions.minPinLength??void 0}:void 0,hints:e.hints?.map(e=>e)??void 0,rpId:e.rpId??void 0,userVerification:e.userVerification}),I=e=>({...e,clientExtensionResults:JSON.stringify(e.clientExtensionResults)}),L={username:{id:`7sNhEz`},usernameRequired:{id:`QF4a34`},usernameEnterYourUsername:{id:`HrfgEC`},usernamePlaceholder:{id:`7sNhEz`},usernameInvalid:{id:`j_TuGf`},usernameExists:{id:`Kc8Qf8`},usernameHint:{id:`IEEMAJ`}},R={password:{id:`8ZsakT`},passwordRequired:{id:`oYD-Xz`},passwordPlaceholder:{id:`8ZsakT`},passwordHint:{id:`l6QHW1`},invalidPasswordUsernameMatches:{id:`IDbi4e`}},z={email:{id:`O3oNi5`},emailPlaceholder:{id:`O3oNi5`},invalidEmail:{id:`OtjenF`},invalidEmailMissingAtSymbol:{id:`yOYm9l`},invalidEmailMissingFullStop:{id:`OuywHR`}},B={firstName:{id:`kODvZJ`},firstNamePlaceholder:{id:`pgNYQS`},firstNameRequired:{id:`eQ1huZ`}},me={middleName:{id:`s9MOJP`}},he={lastName:{id:`UXBCwc`},lastNamePlaceholder:{id:`5LDrMI`},lastNameRequired:{id:`ZURk8I`}},ge={dob:{id:`7uHWR-`},dobPlaceholder:{id:`zyVc2J`},dateOfBirthRequired:{id:`32VjLp`},minimumAge:e=>({id:`KRIN5n`,values:{age:e}}),maximumAge:{id:`gU74SW`}},_e={province:{id:`pOticu`},provinceRequired:{id:`bxO8R2`},provinceInvalid:{id:`9m7Wwp`}},ve={referralCode:{id:`mi6YQ1`},referralCodePlaceholder:{id:`mi6YQ1`},code:{id:`EWPtMO`},codePlaceholder:{id:`by33ET`},signupCodeError:{id:`lngFax`},signUpStepDesc:{id:`zxFkQf`}},ye={termsAndConditionsAgeCheck:e=>({id:`hs6CmX`,values:{age:e}}),termsAndConditionsPlayingForSelf:{id:`GIsQTa`},termsAndConditionsIsNotBanned:{id:`IPJ2Vz`},termsAndConditionsInfoIsCorrect:{id:`Hqzta5`},termsAndConditionsUnderstandAndAdhere:{id:`juvGrV`},termsDesc:{id:`RI44eX`},checkboxValidation:{id:`QDS5xt`},checkboxValidationPrivacyPolicy:{id:`jqyAxu`},termsStepDesc:{id:`HFoaKN`},ageAndTermsCheck:{id:`JjnJib`},termsAndPrivacyCheck:{id:`CXIR0p`},termsAndPrivacyRequired:{id:`GPbNvL`},thirdPartyVerificationConsentRequired:{id:`B8AaMI`},termsAndConditions:{id:`KWUgwY`},termsAndConditionsAndPrivacyPolicy:{id:`gSkLn0`},privacyPolicy:{id:`LcET2C`},termsFetchError:{id:`MEzKlO`},agree:{id:`-XyQiK`},goBack:{id:`sr0UJD`}},be={checkBox:{id:`BGQXlj`},checkboxRequired:{id:`B8AaMI`},pepDeclaration:{id:`vVkmUA`},thirdPartyDeclaration:{id:`ilRiik`},thirdPartyVerificationConsent:{id:`L8GwXe`},marketingConsent:{id:`-RcbPf`}},xe={continue:{id:`xGVfLh`},register:{id:`IS0nrP`},loginLink:{id:`n1ekoW`},back:{id:`iH8pgl`},createAccount:{id:`IS0nrP`}},Se={minimumCharacters:(e,t)=>({id:`ccw8Ue`,values:{field:e,characters:t}}),maximumCharacters:(e,t)=>({id:`hvJwkg`,values:{field:e,characters:t}}),phoneInvalid:{id:`VwQOL9`},hostBanned:{id:`6vIFC5`},stateBanned:{id:`ycwH4T`}},Ce={unknownErrorAccount:{id:`E_1NgD`},unknownError:{id:`Uz5zWc`},errorLoadingData:{id:`-Blwp4`},failedToLoadData:{id:`oi4zIm`},captchaNotLoaded:{id:`VjzDRh`}},V={createAccountHeader:{id:`7pjlOd`},personalDetails:{id:`njgRbU`},tellUsAboutYou:{id:`tZ2zgl`},accountDetails:{id:`Eeyyzj`},state:{id:`RS0o7b`},orContinueWith:{id:`zW-FpA`},or:{id:`ZAVklK`},phoneNumber:{id:`H0Kdjh`},loginText:{id:`8wYDMp`},welcomeToStake:{id:`njgRbU`}},we={responsibleGamblingCommitment:{id:`0CFVFG`},responsibleGambling:{id:`_QiZO9`},responsibleGamblingResources:{id:`UE3f3_`}},Te={...L,...R,...z,...B,...me,...he,...ge,...ve,...ye,...be,...xe,...Se,...Ce,...V,..._e,...we},Ee=function(e){return e.Text=`text`,e.Email=`email`,e.Password=`password`,e.Number=`number`,e.Date=`date`,e.Checkbox=`checkbox`,e.Select=`select`,e.Radio=`radio`,e.Textarea=`textarea`,e.Telephone=`telephone`,e}({}),De=function(e){return e.Username=`name`,e.Email=`email`,e.Password=`password`,e.SignupCode=`signupCode`,e.PhoneNumber=`phoneNumber`,e.CountryCode=`countryCode`,e.TermsAndConditions=`termsAndConditions`,e.DateOfBirth=`dob`,e.CprNumber=`cprNumber`,e.FirstName=`firstName`,e.MiddleName=`middleName`,e.LastName=`lastName`,e.SecondName=`secondName`,e.PaternalLastName=`paternalLastName`,e.MaternalLastName=`maternalLastName`,e.State=`state`,e.TermsAndPrivacy=`termsAndPrivacy`,e.PepDeclaration=`pepDeclaration`,e.ThirdPartyDeclaration=`thirdPartyDeclaration`,e.MarketingConsent=`marketingConsent`,e.ThirdPartyVerificationConsent=`thirdPartyVerificationConsent`,e}({}),Oe=function(e){return e.ViewTerms=`viewTerms`,e.GoBack=`goBack`,e.AgreeTermsAndConditions=`agreeTermsAndConditions`,e.ToggleGeneralCheckbox=`toggleGeneralCheckbox`,e.ToggleTermsAndConditions=`toggleTermsAndConditions`,e.TogglePep=`togglePep`,e.ToggleThirdParty=`toggleThirdParty`,e.TermsOfServiceLoaded=`termsOfServiceLoaded`,e}({}),ke=function(e){return e.RegistrationDetailsView=`registration_details_view`,e.RegistrationDetailsOauthView=`registration_details_oauth_view`,e.RegistrationDetailsContinue=`registration_details_continue`,e.RegistrationDetailsTermsAndConditionsView=`registration_details_t&c_view`,e.RegistrationDetailsTermsAndConditionsCreateAccount=`registration_details_t&c_create_account`,e.RegistrationDetailsOauthTermsAndConditionsCreateAccount=`registration_details_oauth_t&c_create_account`,e.RegistrationTermsAndConditionsView=`registration_t&c_view`,e.RegistrationTermsAndConditionsCreateAccount=`registration_t&c_create_account`,e.RegistrationDetailsOauth=`registration_details_oauth`,e.RegistrationDetailsPhoneAdded=`registration_details_phone_added`,e.RegistrationDetailsCodeAdded=`registration_details_code_added`,e.RegistrationReferralPrepopulated=`registration_referral_prepopulated`,e.RegistrationReferralTypingStarted=`registration_referral_typing_started`,e.RegistrationEmailTypingStarted=`registration_email_typing_started`,e.RegistrationUsernameTypingStarted=`registration_username_typing_started`,e.RegistrationUsernameValidationError=`registration_username_validation_error`,e.RegistrationPasswordTypingStarted=`registration_password_typing_started`,e.RegistrationPasswordValidationError=`registration_password_validation_error`,e.RegistrationOauthClickedFacebook=`registration_oauth_clicked_Facebook`,e.RegistrationOauthClickedGoogle=`registration_oauth_clicked_Google`,e.RegistrationStep1View=`registration_step_1_view`,e.RegistrationStep1Continue=`registration_step_1_continue`,e.RegistrationFinalStepView=`registration_final_step_view`,e.RegistrationFinalStepCreateAccount=`registration_final_step_create_account`,e.RegistrationFirstNameTypingStarted=`registration_first_name_typing_started`,e.RegistrationLastNameTypingStarted=`registration_last_name_typing_started`,e.RegistrationSecondNameTypingStarted=`registration_second_name_typing_started`,e.RegistrationPaternalLastNameTypingStarted=`registration_paternal_last_name_typing_started`,e.RegistrationMaternalLastNameTypingStarted=`registration_maternal_last_name_typing_started`,e.RegistrationStateTypingStarted=`registration_state_typing_started`,e}({}),H={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`PreparePasskeyAuthentication`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`supportsRelatedOrigins`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Boolean`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`preparePasskeyAuthentication`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`supportsRelatedOrigins`},value:{kind:`Variable`,name:{kind:`Name`,value:`supportsRelatedOrigins`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`sessionId`}},{kind:`Field`,name:{kind:`Name`,value:`options`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`challenge`}},{kind:`Field`,name:{kind:`Name`,value:`timeout`}},{kind:`Field`,name:{kind:`Name`,value:`rpId`}},{kind:`Field`,name:{kind:`Name`,value:`allowCredentials`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`transports`}}]}},{kind:`Field`,name:{kind:`Name`,value:`userVerification`}},{kind:`Field`,name:{kind:`Name`,value:`hints`}},{kind:`Field`,name:{kind:`Name`,value:`extensions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`appid`}},{kind:`Field`,name:{kind:`Name`,value:`credProps`}},{kind:`Field`,name:{kind:`Name`,value:`hmacCreateSecret`}},{kind:`Field`,name:{kind:`Name`,value:`minPinLength`}}]}}]}}]}}]}}]},Ae={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`VerifyPasskeyAuthentication`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`sessionId`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`authenticationResponse`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`VerifyPasskeyAuthenticationAuthenticationResponseInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`verifyPasskeyAuthentication`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`sessionId`},value:{kind:`Variable`,name:{kind:`Name`,value:`sessionId`}}},{kind:`Argument`,name:{kind:`Name`,value:`authenticationResponse`},value:{kind:`Variable`,name:{kind:`Name`,value:`authenticationResponse`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`verified`}},{kind:`Field`,name:{kind:`Name`,value:`deviceType`}},{kind:`Field`,name:{kind:`Name`,value:`authenticatorName`}},{kind:`Field`,name:{kind:`Name`,value:`lastUsed`}},{kind:`Field`,name:{kind:`Name`,value:`notifyUnknownCredential`}},{kind:`Field`,name:{kind:`Name`,value:`userLogin`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`loginToken`}},{kind:`Field`,name:{kind:`Name`,value:`user`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`name`}}]}}]}}]}}]}}]},U={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`PreparePasskeyRegistration`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`supportsRelatedOrigins`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Boolean`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`preparePasskeyRegistration`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`supportsRelatedOrigins`},value:{kind:`Variable`,name:{kind:`Name`,value:`supportsRelatedOrigins`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`challengeId`}},{kind:`Field`,name:{kind:`Name`,value:`options`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`challenge`}},{kind:`Field`,name:{kind:`Name`,value:`rp`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`id`}}]}},{kind:`Field`,name:{kind:`Name`,value:`user`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`displayName`}}]}},{kind:`Field`,name:{kind:`Name`,value:`pubKeyCredParams`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`alg`}}]}},{kind:`Field`,name:{kind:`Name`,value:`timeout`}},{kind:`Field`,name:{kind:`Name`,value:`excludeCredentials`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`transports`}}]}},{kind:`Field`,name:{kind:`Name`,value:`authenticatorSelection`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`authenticatorAttachment`}},{kind:`Field`,name:{kind:`Name`,value:`requireResidentKey`}},{kind:`Field`,name:{kind:`Name`,value:`userVerification`}}]}},{kind:`Field`,name:{kind:`Name`,value:`hints`}},{kind:`Field`,name:{kind:`Name`,value:`attestation`}},{kind:`Field`,name:{kind:`Name`,value:`attestationFormats`}},{kind:`Field`,name:{kind:`Name`,value:`extensions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`appid`}},{kind:`Field`,name:{kind:`Name`,value:`credProps`}},{kind:`Field`,name:{kind:`Name`,value:`hmacCreateSecret`}},{kind:`Field`,name:{kind:`Name`,value:`minPinLength`}}]}}]}}]}}]}}]},je={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`VerifyPasskeyRegistration`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`challengeId`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`registrationResponse`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`VerifyPasskeyRegistrationRegistrationResponseInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`deviceName`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`verifyPasskeyRegistration`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`challengeId`},value:{kind:`Variable`,name:{kind:`Name`,value:`challengeId`}}},{kind:`Argument`,name:{kind:`Name`,value:`registrationResponse`},value:{kind:`Variable`,name:{kind:`Name`,value:`registrationResponse`}}},{kind:`Argument`,name:{kind:`Name`,value:`deviceName`},value:{kind:`Variable`,name:{kind:`Name`,value:`deviceName`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`verified`}},{kind:`Field`,name:{kind:`Name`,value:`deviceType`}},{kind:`Field`,name:{kind:`Name`,value:`authenticatorName`}}]}}]}}]},W={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`query`,name:{kind:`Name`,value:`GetUserPasskeys`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`user`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`getUserPasskeys`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`authenticatorName`}},{kind:`Field`,name:{kind:`Name`,value:`deviceName`}},{kind:`Field`,name:{kind:`Name`,value:`createdAt`}},{kind:`Field`,name:{kind:`Name`,value:`lastUsedAt`}}]}}]}}]}}]},G={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`CompleteLoginUser`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`loginToken`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`tfaToken`}},type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`sessionName`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`blackbox`}},type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`loginCode`}},type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`loginMethod`}},type:{kind:`NamedType`,name:{kind:`Name`,value:`LoginMethod`}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`termsOfServiceJurisdictionKey`}},type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`offerDisabled`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`Boolean`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`completeLoginUser`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`loginToken`},value:{kind:`Variable`,name:{kind:`Name`,value:`loginToken`}}},{kind:`Argument`,name:{kind:`Name`,value:`tfaToken`},value:{kind:`Variable`,name:{kind:`Name`,value:`tfaToken`}}},{kind:`Argument`,name:{kind:`Name`,value:`sessionName`},value:{kind:`Variable`,name:{kind:`Name`,value:`sessionName`}}},{kind:`Argument`,name:{kind:`Name`,value:`blackbox`},value:{kind:`Variable`,name:{kind:`Name`,value:`blackbox`}}},{kind:`Argument`,name:{kind:`Name`,value:`loginCode`},value:{kind:`Variable`,name:{kind:`Name`,value:`loginCode`}}},{kind:`Argument`,name:{kind:`Name`,value:`loginMethod`},value:{kind:`Variable`,name:{kind:`Name`,value:`loginMethod`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`FragmentSpread`,name:{kind:`Name`,value:`UserAuthenticatedSessionLogin`}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`UserAuthenticatedSessionLogin`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`UserAuthenticatedSession`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`token`}},{kind:`Field`,name:{kind:`Name`,value:`session`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`FragmentSpread`,name:{kind:`Name`,value:`UserSession`}},{kind:`Field`,name:{kind:`Name`,value:`user`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`FragmentSpread`,name:{kind:`Name`,value:`UserAuth`}},{kind:`FragmentSpread`,name:{kind:`Name`,value:`UserTermsOfServiceStatus`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`UserSession`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`UserSession`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`sessionName`}},{kind:`Field`,name:{kind:`Name`,value:`ip`}},{kind:`Field`,name:{kind:`Name`,value:`country`}},{kind:`Field`,name:{kind:`Name`,value:`city`}},{kind:`Field`,name:{kind:`Name`,value:`active`}},{kind:`Field`,name:{kind:`Name`,value:`updatedAt`}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`UserAuth`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`User`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`email`}},{kind:`Field`,name:{kind:`Name`,value:`dob`}},{kind:`Field`,name:{kind:`Name`,value:`phoneNumber`}},{kind:`Field`,name:{kind:`Name`,value:`hasPhoneNumberVerified`}},{kind:`Field`,name:{kind:`Name`,value:`hasEmailVerified`}},{kind:`Field`,name:{kind:`Name`,value:`hasPassword`}},{kind:`Field`,name:{kind:`Name`,value:`intercomHash`}},{kind:`Field`,name:{kind:`Name`,value:`intercomJwt`}},{kind:`Field`,name:{kind:`Name`,value:`createdAt`}},{kind:`Field`,name:{kind:`Name`,value:`hasTfaEnabled`}},{kind:`Field`,name:{kind:`Name`,value:`hasOauth`}},{kind:`Field`,name:{kind:`Name`,value:`isMaxBetEnabled`}},{kind:`Field`,name:{kind:`Name`,value:`isReferred`}},{kind:`Field`,name:{kind:`Name`,value:`isSportsbookExcluded`}},{kind:`Field`,name:{kind:`Name`,value:`hasEmailSubscribed`}},{kind:`Field`,name:{kind:`Name`,value:`sbAthleteCheck`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`isAthlete`}},{kind:`Field`,name:{kind:`Name`,value:`sports`}}]}},{kind:`Field`,name:{kind:`Name`,value:`registeredWithVpn`}},{kind:`Field`,name:{kind:`Name`,value:`kycBasic`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`country`}},{kind:`Field`,name:{kind:`Name`,value:`birthday`}}]}},{kind:`Field`,name:{kind:`Name`,value:`kycDenmark`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`isValid`}}]}},{kind:`Field`,name:{kind:`Name`,value:`flags`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`flag`}},{kind:`Field`,name:{kind:`Name`,value:`createdAt`}}]}},{kind:`Field`,name:{kind:`Name`,value:`signupCode`},directives:[{kind:`Directive`,name:{kind:`Name`,value:`skip`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`if`},value:{kind:`Variable`,name:{kind:`Name`,value:`offerDisabled`}}}]}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`code`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`code`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`roles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`category`}},{kind:`Field`,name:{kind:`Name`,value:`expireAt`}}]}},{kind:`Field`,name:{kind:`Name`,value:`optionalFeatures`}},{kind:`Field`,name:{kind:`Name`,value:`balances`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`FragmentSpread`,name:{kind:`Name`,value:`UserBalance`}}]}},{kind:`Field`,name:{kind:`Name`,value:`activeClientSeed`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`seed`}}]}},{kind:`Field`,name:{kind:`Name`,value:`previousServerSeed`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`seed`}}]}},{kind:`Field`,name:{kind:`Name`,value:`activeServerSeed`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`seedHash`}},{kind:`Field`,name:{kind:`Name`,value:`nextSeedHash`}},{kind:`Field`,name:{kind:`Name`,value:`nonce`}},{kind:`Field`,name:{kind:`Name`,value:`blocked`}}]}},{kind:`Field`,name:{kind:`Name`,value:`veriffStatus`}},{kind:`Field`,name:{kind:`Name`,value:`veriffBiometricVerificationStatus`}},{kind:`Field`,name:{kind:`Name`,value:`notificationCount`}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`UserBalance`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`UserBalance`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`available`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`amount`}},{kind:`Field`,name:{kind:`Name`,value:`currency`}}]}},{kind:`Field`,name:{kind:`Name`,value:`vault`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`amount`}},{kind:`Field`,name:{kind:`Name`,value:`currency`}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`UserTermsOfServiceStatus`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`User`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`termsOfService`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`__typename`}},{kind:`Field`,name:{kind:`Name`,value:`status`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`jurisdictionKey`},value:{kind:`Variable`,name:{kind:`Name`,value:`termsOfServiceJurisdictionKey`}}}]}]}}]}}]},Me={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`InvalidatePasskeySession`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`sessionId`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`String`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`invalidatePasskeySession`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`sessionId`},value:{kind:`Variable`,name:{kind:`Name`,value:`sessionId`}}}]}]}}]},Ne=(e,t,n)=>e===`authenticate`&&t===`login`&&n!==`passkey`,Pe=()=>u.subscribe({authenticate:async({type:e,subtype:t,code:n})=>{if(A()&&Ne(e,t,n))try{let e=de();e&&(S.cancelCeremony(),await a(Me,{sessionId:e}),M(null))}catch{}}}),K={action:{id:`bwRvnp`},authenticator:{id:`7aHZWF`},authenticatorNotAvailableTitle:{id:`fQ6DIp`},authenticatorNotAvailableMessage:{id:`8SJ0pm`},browserNotSupportedTitle:{id:`RmrgTh`},browserNotSupportedMessage:{id:`AWsuZP`},createdOn:{id:`45O6zJ`},createPasskey:{id:`AKqzR1`},delete:{id:`cnGeoo`},deleteErrorTitle:{id:`xXlwzh`},deleteGenericError:{id:`tJCq8g`},device:{id:`PEHQTf`},enable2faTitle:{id:`DCRKbe`},enable2faMessage:{id:`PL3pJq`},helpCentre:{id:`3jQ-Tr`},lastUsedAt:{id:`tKCBU0`},none:{id:`TJmoQ7`},passkeyAlreadyExistsTitle:{id:`37bT5y`},passkeyAlreadyExistsMessage:{id:`yM785w`},passkeyCreatedMessage:{id:`F70qXB`},passkeyCreatedFromHomeMessage:{id:`Kg3aXU`},passkeyCreatedTitle:{id:`3Afw5T`},passkeyRegistrationFailedGenericMessage:{id:`ps6gb4`},passkeyRegistrationFailedGenericTitle:{id:`xqZxK1`},passkeysDescription:{id:`_EV4IH`},passkeysTitle:({count:e,maxCount:t})=>({id:`cl-6qH`,values:{count:e,maxCount:t}}),unknown:{id:`Ef7StM`}},Fe=()=>{let e=Pe(),n=u.subscribe({authenticate:async({userAuthenticatedSession:e,type:n,subtype:r,code:a})=>{if(A()&&n===`authenticate`&&r===`login`&&a!==`passkey`)try{if(t===`production`&&e.session.user.hasTfaEnabled){let{data:e}=await i({doc:W,load:{fetch},variables:{}});e?.user?.getUserPasskeys.length===0&&await Z(`home`)}}catch{}}});return()=>{e(),n()}},q=async()=>{if(window.PublicKeyCredential&&PublicKeyCredential.getClientCapabilities)try{return!!(await PublicKeyCredential.getClientCapabilities())?.relatedOrigins}catch{return!1}return!1},J=async(e,t,n=!1)=>{let r=t===`settings`||t===`login`&&!n;return v()?await ue()?!0:(r&&N(!1,e._(K.authenticatorNotAvailableTitle),e._(K.authenticatorNotAvailableMessage)),t!==`login`&&f.track(`passkey_creation_not_supported`,{reason:`authenticator_not_available`}),!1):(r&&N(!1,e._(K.browserNotSupportedTitle),e._(K.browserNotSupportedMessage)),t!==`login`&&f.track(`passkey_creation_not_supported`,{reason:`browser_not_supported`}),!1)},Y=async(e,t,n)=>{let r=await a(U,{supportsRelatedOrigins:e});return(!r?.data||!r.data.preparePasskeyRegistration)&&(e&&(r=await a(U,{supportsRelatedOrigins:!1})),!r?.data||!r.data.preparePasskeyRegistration)?(n===`settings`&&N(!1,t._(K.passkeyRegistrationFailedGenericTitle),t._(K.passkeyRegistrationFailedGenericMessage)),f.track(`passkey_creation_not_supported`,{reason:`api_error`}),null):r},Ie=(e,t,n)=>{e instanceof x&&e.name===`InvalidStateError`?(N(!1,t._(K.passkeyAlreadyExistsTitle),t._(K.passkeyAlreadyExistsMessage)),f.track(`passkey_creation_not_supported`,{error_message:`passkey_already_exists`})):e instanceof x&&(e.name===`NotAllowedError`||e.name===`AbortError`)?f.track(`passkey_creation_not_supported`,{error_message:`user_cancelled`}):(N(!1,t._(K.passkeyRegistrationFailedGenericTitle),t._(K.passkeyRegistrationFailedGenericMessage)),f.track(`passkey_creation_not_supported`,{error_message:`api_error`})),o(`passkey_start_registration_FE_error`,{touchpoint:n},e)},X=async(e,t,n,r)=>{try{let t=await se({optionsJSON:pe(e)});if(!t?.response)throw Error(`Failed to start registration`);return f.track(`passkey_creation_started`,{touchpoint:n}),{startRegistrationResponse:t,shouldRetry:!1}}catch(e){let i=r&&e instanceof x&&e.name===`SecurityError`;return i||Ie(e,t,n),{startRegistrationResponse:null,shouldRetry:i}}},Le=async(e,t,n,r,i)=>{let o=te()?.device||n._(K.unknown),s=(await a(je,{challengeId:e,registrationResponse:t,deviceName:o})).data?.verifyPasskeyRegistration;s?.verified?(i!==void 0&&i(),N(!0,n._(K.passkeyCreatedTitle),r===`settings`?n._(K.passkeyCreatedMessage):n._(K.passkeyCreatedFromHomeMessage)),p.next({type:`passkeyCreated`}),f.track(`passkey_created`,{authenticator_name:s.authenticatorName,device_type:s.deviceType,touchpoint:r})):(N(!1,n._(K.passkeyRegistrationFailedGenericTitle),n._(K.passkeyRegistrationFailedGenericMessage)),f.track(`passkey_creation_failed`,{error_message:`verification_failed`}))},Z=async(t,n)=>{let r=e(s);if(!await J(r,t))return;let i=await q(),a=await Y(i,r,t);if(!a||!a.data)return;let{startRegistrationResponse:o,shouldRetry:c}=await X(a.data.preparePasskeyRegistration.options,r,t,i);if(!o){if(c){if(a=await Y(!1,r,t),!a||!a.data||({startRegistrationResponse:o,shouldRetry:c}=await X(a.data.preparePasskeyRegistration.options,r,t,!1),!o))return}else return}let l=P(o);await Le(a.data.preparePasskeyRegistration.challengeId,l,r,t,n)},Q=async e=>{let t=await a(H,{supportsRelatedOrigins:e});if(!t?.data||!t.data.preparePasskeyAuthentication){if(e){if(t=await a(H,{supportsRelatedOrigins:!1}),!t.data||t.errors)throw Error(`Failed to prepare passkey authentication`)}else throw Error(`Failed to prepare passkey authentication`)}return t},$=async(e,t,n)=>{try{let n=await le({optionsJSON:F(e),useBrowserAutofill:t});if(!n?.response)throw Error(`Failed to start authentication`);return{startAuthenticationResponse:n,shouldRetry:!1}}catch(e){let r=e,i=n&&e instanceof x&&e.name===`SecurityError`;return i||o(`passkey_start_authentication_FE_error`,{useBrowserAutofill:t},r),{startAuthenticationResponse:r,shouldRetry:i}}},Re=async(e,t)=>{let i=await a(G,{loginToken:e,tfaToken:void 0,sessionName:ee(),blackbox:re(),loginMethod:n.passkey,...l(),offerDisabled:!!r.affiliate.offerDisabled});i.data&&(await c(`auth`),t?.(i.data),u.next({type:`authenticate`,subtype:`login`,userAuthenticatedSession:i.data.completeLoginUser,code:`passkey`}),u.next({type:`firstUserResponse`,user:i.data.completeLoginUser.session.user}))},ze=async(e,t,n,r,i)=>{let o=await a(Ae,{sessionId:e,authenticationResponse:t});if(M(null),o.errors||!o.data||!o.data.verifyPasskeyAuthentication.verified){if(o.data?.verifyPasskeyAuthentication.notifyUnknownCredential){console.error(`request login: `,`Invalid passkey authentication`),m.open(D({title:i._(h.invalidPasskeyTitle),body:i._(h.invalidPasskeyMessage),positive:!1,persistent:!1})),f.track(`passkey_sign_in_failed`,{error_message:`invalid_passkey`,browser_autofill:n});return}throw Error(`Failed to verify passkey authentication`)}let s=o.data.verifyPasskeyAuthentication.userLogin;if(!s)throw Error(`No user found that matches the credentials provided`);f.track(`passkey_sign_in_successful`,{browser_autofill:n,device_type:o.data.verifyPasskeyAuthentication.deviceType,authenticator_name:o.data.verifyPasskeyAuthentication.authenticatorName}),f.track(`passkey_last_used`,{last_used_time:o.data.verifyPasskeyAuthentication.lastUsed}),await Re(s.loginToken,r)},Be=(e,t,n,r)=>{(!t||n)&&(e instanceof x?e.name===`AbortError`||e.name===`NotAllowedError`?n&&f.track(`passkey_sign_in_failed`,{error_message:`user_cancelled`,browser_autofill:t}):e.name===`NotSupportedError`&&(n&&f.track(`passkey_sign_in_failed`,{error_message:`browser_not_supported`,browser_autofill:t}),m.open(D({title:r._(K.browserNotSupportedTitle),body:r._(K.browserNotSupportedMessage),positive:!1,persistent:!1}))):(n&&f.track(`passkey_sign_in_failed`,{error_message:`api_error`,browser_autofill:t}),m.open(D({title:r._(h.unableToSignInTitle),body:r._(h.unableToSignInMessage),positive:!1,persistent:!1}))))},Ve=async(e,t,n,r)=>{let i=!1;if(await J(n,`login`,t))try{let a=await q(),o=await Q(a);if(!o||!o.data)throw Error(`Failed to prepare passkey authentication`);M(o.data.preparePasskeyAuthentication.sessionId);let{startAuthenticationResponse:s,shouldRetry:c}=await $(o.data.preparePasskeyAuthentication.options,t,a);if(s instanceof Error){if(c){if(o=await Q(!1),!o||!o.data)throw Error(`Failed to prepare passkey authentication`);if(M(o.data.preparePasskeyAuthentication.sessionId),{startAuthenticationResponse:s,shouldRetry:c}=await $(o.data.preparePasskeyAuthentication.options,t,!1),s instanceof Error)throw s}else throw s}i=!0,r&&r(!0),f.track(`passkey_sign_in_started`,{browser_autofill:t});let l=I(s);await ze(o.data.preparePasskeyAuthentication.sessionId,l,t,e,n)}catch(e){Be(e,t,i,n)}finally{M(null),r&&r(!1)}};export{G as a,Ee as c,Te as d,A as f,T as g,D as h,K as i,De as l,j as m,Z as n,W as o,fe as p,Fe as r,Oe as s,Ve as t,ke as u};