@syncfy/authentication-widget 1.4.0 → 1.6.0
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Zn,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(Zn=typeof globalThis<"u"?globalThis:Zn||self,Zn.SyncfyAuthenticationWidget=e())})(this,function(){"use strict";var li=Object.defineProperty;var ui=(Zn,e,t)=>e in Zn?li(Zn,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):Zn[e]=t;var $n=(Zn,e,t)=>ui(Zn,typeof e!="symbol"?e+"":e,t);const resource$1={accounts_selection:{done:e=>{const{normalize:t}=e;return t(["Done"])},error:e=>{const{normalize:t}=e;return t(["An error occurred while fetching the accounts."])},fetching:e=>{const{normalize:t}=e;return t(["Fetching accounts"])},form_error:e=>{const{normalize:t}=e;return t(["Please select at least one account."])},form_label:e=>{const{normalize:t}=e;return t(["Syncfy will only share the data you select."])},form_label_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Syncfy will only share the data you select with ",n(a("client")),"."])},title:e=>{const{normalize:t}=e;return t(["Select Accounts"])}},api_errors:{400:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Some API request params are incorrect."])},short_description:e=>{const{normalize:t}=e;return t(["Bad Request"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Authentication failed."])},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},402:{long_description:e=>{const{normalize:t}=e;return t(["Something went wrong when trying to access this service. Please contact the support team for more information."])},real:{long_description:e=>{const{normalize:t}=e;return t(["API is disabled for non-payment."])},short_description:e=>{const{normalize:t}=e;return t(["Payment Required"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Forbidden."])},short_description:e=>{const{normalize:t}=e;return t(["Forbidden"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},404:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Not Found."])},short_description:e=>{const{normalize:t}=e;return t(["Not Found"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},429:{long_description:e=>{const{normalize:t}=e;return t(["Too many requests have been made in a short time. Please try again later"])},real:{long_description:e=>{const{normalize:t}=e;return t(["Too Many Requests."])},short_description:e=>{const{normalize:t}=e;return t(["Too Many Requests"])}},short_description:e=>{const{normalize:t}=e;return t(["Requests Rate Limit Exceeded"])}},449:{long_description:e=>{const{normalize:t}=e;return t(["The provided entrypoint.credential parameter is no longer valid, as the site it belongs to has been deactivated or is obsolete."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The provided entrypoint.credential parameter is no longer valid, as the site it belongs to has been deactivated or is obsolete."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Internal Server Error."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Server Error"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},503:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Service Unavailable."])},short_description:e=>{const{normalize:t}=e;return t(["Service Unavailable"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},credential_error:{long_description:e=>{const{normalize:t}=e;return t(["Credential error, please consider updating credential password."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Credential error, please consider updating credential password."])},short_description:e=>{const{normalize:t}=e;return t(["Credential error"])}},short_description:e=>{const{normalize:t}=e;return t(["Credential error"])}},credential_not_found:{long_description:e=>{const{normalize:t}=e;return t(["The given credential was invalid or not found."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The given credential was invalid or not found."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},no_internet:{long_description:e=>{const{normalize:t}=e;return t(["There is no internet connection, check your connection and try again."])},real:{long_description:e=>{const{normalize:t}=e;return t(["There is no internet connection, check your connection and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Connection error"])}},short_description:e=>{const{normalize:t}=e;return t(["Connection error"])}},site_not_found:{long_description:e=>{const{normalize:t}=e;return t(["The given entrypoint.site was invalid or not found."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The given entrypoint.site was invalid or not found."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid entrypoint.site"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid entrypoint.site"])}},unauthorized:{long_description:e=>{const{normalize:t}=e;return t(["Your session has expired."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Your session has expired."])},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}}},back_up_connection:{description:e=>{const{normalize:t}=e;return t(["Something went wrong when trying to connect to the institution, but you can upload your statement and we will extract the information."])},title:e=>{const{normalize:t}=e;return t(["An error occurred in the connection"])}},bridge:{114:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},116:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3e3:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3001:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3008:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3010:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3014:{long_description:e=>{const{normalize:t}=e;return t(["Se ha detectado más de una Llave Inteligente BBVA u ocurrió un error de comunicación."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3015:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3016:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3020:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3021:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3022:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3333:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3334:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3335:{long_description:e=>{const{normalize:t}=e;return t(["No se ha detectado una Llave Inteligente BBVA, verifique que esté conectada correctamente a su equipo."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3336:{long_description:e=>{const{normalize:t}=e;return t(["Error de comunicación durante el proceso de validación de su Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_config_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass configuration script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},host_update_available:{long_description:e=>{const{normalize:t}=e;return t(["Host application update available."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},not_ready:{long_description:e=>{const{normalize:t}=e;return t(["Bridge is not ready"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}}},common:{add_other:e=>{const{normalize:t}=e;return t(["Add another institution"])},back:e=>{const{normalize:t}=e;return t(["Back"])},cancel:e=>{const{normalize:t}=e;return t(["Cancel"])},continue:e=>{const{normalize:t}=e;return t(["Continue"])},close:e=>{const{normalize:t}=e;return t(["Close"])},data_error:e=>{const{normalize:t}=e;return t(["Sorry, an error occurred when loading the initial data"])},error:e=>{const{normalize:t}=e;return t(["Error"])},expand:e=>{const{normalize:t}=e;return t(["Expand"])},find_your_institution:e=>{const{normalize:t}=e;return t(["Find Your Institution"])},finish:e=>{const{normalize:t}=e;return t(["Finish"])},header:{login:e=>{const{normalize:t}=e;return t(["Login Information"])},link:e=>{const{normalize:t}=e;return t(["Link your Institution"])},select:e=>{const{normalize:t}=e;return t(["Select the institution"])}},hide:e=>{const{normalize:t}=e;return t(["Hide"])},intro:e=>{const{normalize:t}=e;return t(["Connect accounts from different institutions and extract data automatically"])},less:e=>{const{normalize:t}=e;return t(["less"])},long_description:e=>{const{normalize:t}=e;return t(["Connect accounts from different institutions and extract data automatically"])},more:e=>{const{normalize:t}=e;return t(["more"])},next:e=>{const{normalize:t}=e;return t(["Next"])},no_filtered_data:e=>{const{normalize:t}=e;return t(["There are no institutions available with the search criteria."])},process_running:e=>{const{normalize:t}=e;return t(["There is an institution being connected at this moment. Please, wait for this connection to finish."])},refresh:e=>{const{normalize:t}=e;return t(["Refresh"])},retry:e=>{const{normalize:t}=e;return t(["Try Again"])},search:e=>{const{normalize:t}=e;return t(["Search..."])},security_banner_content:e=>{const{normalize:t}=e;return t(["Your information is transferred encrypted end-to-end with the same standard Banks and Financial Institutions utilize."])},security_banner_title:e=>{const{normalize:t}=e;return t(["Secure and Private"])},session_error:e=>{const{normalize:t}=e;return t(["Something went wrong."])},session_refreshed_message:e=>{const{normalize:t}=e;return t(["Your session has been updated."])},session_refreshed:e=>{const{normalize:t}=e;return t(["Session refreshed"])},show:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Show ",n(a("msg"))])},show_password:e=>{const{normalize:t}=e;return t(["Show"])},test_mode:e=>{const{normalize:t}=e;return t(["You are currently running in Test Mode"])},unauthorized_message:e=>{const{normalize:t}=e;return t(["Your session expired, do you want refresh your session?"])},unauthorized:e=>{const{normalize:t}=e;return t(["Unauthorized"])},update_title:e=>{const{normalize:t}=e;return t(["Update Institution"])},webapp_add_banks:e=>{const{normalize:t}=e;return t(["Banks"])},webapp_add_blockchain:e=>{const{normalize:t}=e;return t(["Blockchain"])},webapp_add_government:e=>{const{normalize:t}=e;return t(["Government"])},webapp_add_utilities:e=>{const{normalize:t}=e;return t(["Utilities"])},webapp_add_wallet:e=>{const{normalize:t}=e;return t(["Digital Wallets"])}},credential:{api_error:{message:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},title:e=>{const{normalize:t}=e;return t(["Error"])}},found:{message:e=>{const{normalize:t}=e;return t(["Waiting to establish connection."])},title:e=>{const{normalize:t}=e;return t(["Credential found"])}},header_title:{sync:e=>{const{normalize:t}=e;return t(["Syncing credential"])},update:e=>{const{normalize:t}=e;return t(["Updating credential"])}},loading:{message:e=>{const{normalize:t}=e;return t(["Please wait a moment while we connect to the institution."])},title:e=>{const{normalize:t}=e;return t(["Connecting to institution"])}},search:{message:e=>{const{normalize:t}=e;return t(["Please wait a moment while we verify your information."])},title:e=>{const{normalize:t}=e;return t(["Validating credentials"])}}},download_options:{date_range_end:e=>{const{normalize:t}=e;return t(["End date"])},date_range_start:e=>{const{normalize:t}=e;return t(["Start date"])},label:e=>{const{normalize:t}=e;return t(["Download date range"])},switch:e=>{const{normalize:t}=e;return t(["Define download date range"])}},file:{click:e=>{const{normalize:t}=e;return t(["Clic to upload"])},invalid:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["The file extension must be ",n(a("extension")),"."])},invalid_multiple:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["The file extension must be one of these: ",n(a("extensions")),"."])},no_chosen:e=>{const{normalize:t}=e;return t(["No file chosen."])},remove:e=>{const{normalize:t}=e;return t(["Remove file."])},required:e=>{const{normalize:t}=e;return t(["is required."])}},form_errors:{regex:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Introduced value is not of type ",n(a("label")),"."])},required:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("label"))," is required."])}},privacy:{link:e=>{const{normalize:t}=e;return t(["Syncfy's Privacy Policy"])},list:{first:e=>{const{normalize:t}=e;return t(["Your data belongs to you!"])},second:e=>{const{normalize:t}=e;return t(["Connect easy and safely to your accounts."])},third:e=>{const{normalize:t}=e;return t(["Trusted by more than +100K users."])}},message:e=>{const{normalize:t}=e;return t(["By selecting ”Continue” you agree to"])},title:e=>{const{normalize:t}=e;return t(["You are using Syncfy for bank connectivity."])},title_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("client"))," partners with Syncfy for bank connectivity."])},url:e=>{const{normalize:t}=e;return t(["https://help.paybook.com/en/article/privacy-and-security-policy-k33bgf/"])}},santander_ws:{error:{long_description:e=>{const{normalize:t}=e;return t(["There was an error generating the token."])},short_description:e=>{const{normalize:t}=e;return t(["Token error"])}},script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Script not loaded."])},short_description:e=>{const{normalize:t}=e;return t(["Token error"])}}},site:{login:{authenticating:e=>{const{normalize:t}=e;return t(["Authenticating"])},error:e=>{const{normalize:t}=e;return t(["Authentication Error"])},success:e=>{const{normalize:t}=e;return t(["Successful Authentication"])}}},socket:{error:{long_description:e=>{const{normalize:t}=e;return t(["Socket connection ended, check your connection and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Socket error"])}},message:{100:{long_description:e=>{const{normalize:t}=e;return t(["Establishing connection with the institution..."])},short_description:e=>{const{normalize:t}=e;return t(["Establishing Connection"])}},101:{long_description:e=>{const{normalize:t}=e;return t(["Connection established with the institution, credentials are being validated..."])},short_description:e=>{const{normalize:t}=e;return t(["Validating Credentials"])}},102:{long_description:e=>{const{normalize:t}=e;return t(["Successfully logged into the institution"])},short_description:e=>{const{normalize:t}=e;return t(["Login Successful"])}},103:{long_description:e=>{const{normalize:t}=e;return t(["The token has been sent and is being validated..."])},short_description:e=>{const{normalize:t}=e;return t(["Validating Token"])}},200:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. Data has been extracted"])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},201:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. We have partially extracted information, but data will still be extracted in background processes."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},202:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, no transactions were found."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},203:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, more than one account does not have transactions."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},204:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, the data downloaded is incomplete."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},206:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, there were no accounts linked to the given credentials."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},400:{long_description:e=>{const{normalize:t}=e;return t(["The value of one of the parameters is incorrect."])},short_description:e=>{const{normalize:t}=e;return t(["Bad request"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["The value of one of the given Authentication Fields was not accepted by the institution. Please verify the information and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid Credentials"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["The given token value introduced was not accepted by the institution or the expiration time was reached."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid Token"])}},405:{long_description:e=>{const{normalize:t}=e;return t(["The institution has blocked the given credential, please contact your institution and make sure your connection to the site is working properly before trying again."])},short_description:e=>{const{normalize:t}=e;return t(["Credential Locked"])}},406:{long_description:e=>{const{normalize:t}=e;return t(["The institution does not allow to have more than one user logged in. If you have logged into your institution using another device, please make sure to log out before trying again."])},short_description:e=>{const{normalize:t}=e;return t(["Already Logged In"])}},408:{long_description:e=>{const{normalize:t}=e;return t(["The institution requires attention from the user. We advise you to log into the institution to confirm everything is working properly. Upon confirmation, try again."])},short_description:e=>{const{normalize:t}=e;return t(["Attention Required"])}},409:{long_description:e=>{const{normalize:t}=e;return t(["The given credentials seem to be valid, but they belong to a different site from the same organization."])},short_description:e=>{const{normalize:t}=e;return t(["Incorrect Site"])}},410:{long_description:e=>{const{normalize:t}=e;return t(["Waiting for token..."])},short_description:e=>{const{normalize:t}=e;return t(["Authenticating"])}},411:{long_description:e=>{const{normalize:t}=e;return t(["The time to introduce the token value has been exceeded."])},short_description:e=>{const{normalize:t}=e;return t(["Token Not Received"])}},413:{long_description:e=>{const{normalize:t}=e;return t(["There was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}},501:{long_description:e=>{const{normalize:t}=e;return t(["The institution has informed to us that there was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},504:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}},507:{long_description:e=>{const{normalize:t}=e;return t(["The institution has informed to us that there was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},509:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, the institution is in maintenance."])},short_description:e=>{const{normalize:t}=e;return t(["Site in Maintenance"])}}},quick_answer:{long_description:e=>{const{normalize:t}=e;return t(["Successfully logged into the institution. The data will be extracted by background processes."])},short_description:e=>{const{normalize:t}=e;return t(["Login Successful"])}},timeout:{long_description:e=>{const{normalize:t}=e;return t(["Server is taking too long to respond."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}}},twofa:{waiting:e=>{const{normalize:t}=e;return t(["Waiting for token"])}}},resource={accounts_selection:{done:e=>{const{normalize:t}=e;return t(["Terminar"])},error:e=>{const{normalize:t}=e;return t(["Pasó un error al obtener las cuentas."])},fetching:e=>{const{normalize:t}=e;return t(["Obteniendo cuentas"])},form_error:e=>{const{normalize:t}=e;return t(["Por favor selecciona al menos una cuenta."])},form_label:e=>{const{normalize:t}=e;return t(["Syncfy sólo compartirá los datos que selecciones."])},form_label_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Syncfy sólo compartirá los datos que selecciones con ",n(a("client")),"."])},title:e=>{const{normalize:t}=e;return t(["Seleccionar cuentas"])}},api_errors:{400:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Algunos parámetros de la petición son incorrectos."])},short_description:e=>{const{normalize:t}=e;return t(["Petición incorrecta"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["La autenticación falló."])},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},402:{long_description:e=>{const{normalize:t}=e;return t(["Algo salió mal al intentar acceder a este servicio. Comunícate con el equipo de soporte para obtener más información."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El API se deshabilitó por falta de pago."])},short_description:e=>{const{normalize:t}=e;return t(["Pago requerido"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Prohibido."])},short_description:e=>{const{normalize:t}=e;return t(["Prohibido"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},404:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["No encontrado."])},short_description:e=>{const{normalize:t}=e;return t(["No encontrado"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},429:{long_description:e=>{const{normalize:t}=e;return t(["Se han realizado muchas peticiones en un periodo corto de tiempo. Por favor intentar nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Se han realizado muchas peticiones en un periodo corto de tiempo. Por favor intentar nuevamente más tarde."])},short_description:e=>{const{normalize:t}=e;return t(["Límite de peticiones excedido"])}},short_description:e=>{const{normalize:t}=e;return t(["Límite de peticiones excedido"])}},449:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.credential proporcionado ya no es válido, ya que el sitio al que pertenece ha sido dado de baja o se encuentra obsoleto."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.credential proporcionado ya no es válido, ya que el sitio al que pertenece ha sido dado de baja o se encuentra obsoleto."])},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Error interno del servidor."])},short_description:e=>{const{normalize:t}=e;return t(["Error interno del servidor"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},503:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Servicio no disponible."])},short_description:e=>{const{normalize:t}=e;return t(["Servicio no disponible"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},credential_error:{long_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales, por favor considera actualizar la contraseña de las credenciales."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales, por favor considera actualizar la contraseña de las credenciales."])},short_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales"])}},short_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales"])}},credential_not_found:{long_description:e=>{const{normalize:t}=e;return t(["La credencial proporcionada es inválida o no se encontró."])},real:{long_description:e=>{const{normalize:t}=e;return t(["La credencial proporcionada es inválida o no se encontró."])},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},no_internet:{long_description:e=>{const{normalize:t}=e;return t(["No hay conexión a internet, revisa tu conexión e intenta nuevamente."])},real:{long_description:e=>{const{normalize:t}=e;return t(["No hay conexión a internet, revisa tu conexión e intenta nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Error de conexión"])}},short_description:e=>{const{normalize:t}=e;return t(["Error de conexión"])}},site_not_found:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.site proporcionado es inválido o no se encontró."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.site proporcionado es inválido o no se encontró."])},short_description:e=>{const{normalize:t}=e;return t(["entrypoint.site inválido"])}},short_description:e=>{const{normalize:t}=e;return t(["entrypoint.site inválido"])}},unauthorized:{long_description:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado."])},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}}},back_up_connection:{description:e=>{const{normalize:t}=e;return t(["Algo salió mal al intentar realizar la conexión, pero puedes subir tu estado de cuenta y extraeremos la información."])},title:e=>{const{normalize:t}=e;return t(["Se produjo un error en la conexión"])}},bridge:{114:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},116:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3e3:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3001:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3008:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3010:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3014:{long_description:e=>{const{normalize:t}=e;return t(["Se ha detectado más de una Llave Inteligente BBVA u ocurrió un error de comunicación."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3015:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3016:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3020:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3021:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3022:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3333:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3334:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3335:{long_description:e=>{const{normalize:t}=e;return t(["No se ha detectado una Llave Inteligente BBVA, verifique que esté conectada correctamente a su equipo."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3336:{long_description:e=>{const{normalize:t}=e;return t(["Error de comunicación durante el proceso de validación de su Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_config_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass configuration script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},host_update_available:{long_description:e=>{const{normalize:t}=e;return t(["Host application update available."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},not_ready:{long_description:e=>{const{normalize:t}=e;return t(["Bridge is not ready"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}}},common:{add_other:e=>{const{normalize:t}=e;return t(["Agregar Otra Institución"])},back:e=>{const{normalize:t}=e;return t(["Atrás"])},cancel:e=>{const{normalize:t}=e;return t(["Cancelar"])},close:e=>{const{normalize:t}=e;return t(["Cerrar"])},continue:e=>{const{normalize:t}=e;return t(["Continuar"])},data_error:e=>{const{normalize:t}=e;return t(["Lo sentimos, ocurrió un error al cargar la información inicial"])},error:e=>{const{normalize:t}=e;return t(["Error"])},expand:e=>{const{normalize:t}=e;return t(["Expandir"])},find_your_institution:e=>{const{normalize:t}=e;return t(["Encuentra tu institución"])},finish:e=>{const{normalize:t}=e;return t(["Finalizar"])},header:{login:e=>{const{normalize:t}=e;return t(["Información de inicio de sesión"])},link:e=>{const{normalize:t}=e;return t(["Conecta tu institución"])},select:e=>{const{normalize:t}=e;return t(["Seleccione la institución"])}},hide:e=>{const{normalize:t}=e;return t(["Ocultar"])},intro:e=>{const{normalize:t}=e;return t(["Conecta cuentas de diferentes instituciones y extrae datos automáticamente"])},less:e=>{const{normalize:t}=e;return t(["menos"])},long_description:e=>{const{normalize:t}=e;return t(["Conecta cuentas de diferentes instituciones y extrae datos automáticamente"])},more:e=>{const{normalize:t}=e;return t(["más"])},next:e=>{const{normalize:t}=e;return t(["Siguiente"])},no_filtered_data:e=>{const{normalize:t}=e;return t(["No hay instituciones disponibles con el criterio de búsqueda."])},process_running:e=>{const{normalize:t}=e;return t(["Actualmente existe una institución procesándose en este momento. Por favor, espera a que este proceso termine."])},refresh:e=>{const{normalize:t}=e;return t(["Renovar"])},retry:e=>{const{normalize:t}=e;return t(["Intentar Nuevamente"])},search:e=>{const{normalize:t}=e;return t(["Buscar..."])},security_banner_content:e=>{const{normalize:t}=e;return t(["Tu información se transfiere cifrada de extremo a extremo con el mismo estándar que utilizan los bancos e instituciones financieras."])},security_banner_title:e=>{const{normalize:t}=e;return t(["Seguro y privado"])},session_error:e=>{const{normalize:t}=e;return t(["Algo salió mal al actualizar la sesión."])},session_refreshed_message:e=>{const{normalize:t}=e;return t(["Tu sesión ha sido actualizada."])},session_refreshed:e=>{const{normalize:t}=e;return t(["Sesión renovada"])},show:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Mostrar ",n(a("msg"))])},show_password:e=>{const{normalize:t}=e;return t(["Mostrar"])},test_mode:e=>{const{normalize:t}=e;return t(["Actualmente estás operando en Modo de Prueba"])},unauthorized_message:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado, ¿Quieres renovar tu sesión?"])},unauthorized:e=>{const{normalize:t}=e;return t(["Sin autorización"])},update_title:e=>{const{normalize:t}=e;return t(["Actualizar Institución"])},webapp_add_banks:e=>{const{normalize:t}=e;return t(["Bancos"])},webapp_add_blockchain:e=>{const{normalize:t}=e;return t(["Blockchain"])},webapp_add_government:e=>{const{normalize:t}=e;return t(["Gobierno"])},webapp_add_utilities:e=>{const{normalize:t}=e;return t(["Servicios"])},webapp_add_wallet:e=>{const{normalize:t}=e;return t(["Carteras Digitales"])}},credential:{api_error:{message:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},title:e=>{const{normalize:t}=e;return t(["Error"])}},found:{message:e=>{const{normalize:t}=e;return t(["Espere un momento mientras conectamos con la institución."])},title:e=>{const{normalize:t}=e;return t(["Credenciales encontradas"])}},header_title:{sync:e=>{const{normalize:t}=e;return t(["Sincronizando credencial"])},update:e=>{const{normalize:t}=e;return t(["Actualizando credencial"])}},loading:{message:e=>{const{normalize:t}=e;return t(["Espere un momento mientras conectamos con la institución."])},title:e=>{const{normalize:t}=e;return t(["Conectando con la institución"])}},search:{message:e=>{const{normalize:t}=e;return t(["Por favor espera un momento mientras validamos tus credenciales."])},title:e=>{const{normalize:t}=e;return t(["Validando credenciales"])}}},download_options:{date_range_end:e=>{const{normalize:t}=e;return t(["Fecha final"])},date_range_start:e=>{const{normalize:t}=e;return t(["Fecha de inicio"])},label:e=>{const{normalize:t}=e;return t(["Periodo de descarga"])},switch:e=>{const{normalize:t}=e;return t(["Definir periodo de descarga"])}},file:{click:e=>{const{normalize:t}=e;return t(["Clic para subir"])},invalid:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["La extensión del archivo debe ser ",n(a("extension")),"."])},invalid_multiple:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["La extensión del archivo debe ser alguna de estas: ",n(a("extensions")),"."])},no_chosen:e=>{const{normalize:t}=e;return t(["Ningún archivo seleccionado."])},remove:e=>{const{normalize:t}=e;return t(["Quitar archivo."])},required:e=>{const{normalize:t}=e;return t(["es requerido."])}},form_errors:{regex:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["El valor ingresado no es de tipo ",n(a("label")),"."])},required:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("label"))," es requerido."])}},privacy:{link:e=>{const{normalize:t}=e;return t(["Política de privacidad de Syncfy"])},list:{first:e=>{const{normalize:t}=e;return t(["¡Tus datos te pertenecen!"])},second:e=>{const{normalize:t}=e;return t(["Conecta tus cuentas de forma fácil y segura."])},third:e=>{const{normalize:t}=e;return t(["Más de 100k usuarios confían en nosotros."])}},message:e=>{const{normalize:t}=e;return t(["Al seleccionar ”Continuar”, aceptas la"])},title:e=>{const{normalize:t}=e;return t(["Estás usando Syncfy para conectar tus cuentas."])},title_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("client"))," se une a Syncfy para conectar tus cuentas."])},url:e=>{const{normalize:t}=e;return t(["https://help.paybook.com/es/article/politica-de-privacidad-y-seguridad-4b9oho/"])}},santander_ws:{error:{long_description:e=>{const{normalize:t}=e;return t(["Hubo un error al generar el token."])},short_description:e=>{const{normalize:t}=e;return t(["Error del token"])}},script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["No se cargó el script."])},short_description:e=>{const{normalize:t}=e;return t(["Error del token"])}}},site:{login:{authenticating:e=>{const{normalize:t}=e;return t(["Autenticando"])},error:e=>{const{normalize:t}=e;return t(["Error de Autenticación"])},success:e=>{const{normalize:t}=e;return t(["Autenticación Exitosa"])}}},socket:{error:{long_description:e=>{const{normalize:t}=e;return t(["La conexión con el socket finalizó, revisa tu conexión e intenta nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Error del socket"])}},message:{100:{long_description:e=>{const{normalize:t}=e;return t(["Estableciendo conexión con la institución..."])},short_description:e=>{const{normalize:t}=e;return t(["Estableciendo Conexión"])}},101:{long_description:e=>{const{normalize:t}=e;return t(["Conexión establecida con la institución, las credenciales se encuentran en proceso de validación..."])},short_description:e=>{const{normalize:t}=e;return t(["Validando Credenciales"])}},102:{long_description:e=>{const{normalize:t}=e;return t(["Se ha iniciado sesión exitosamente en el sitio de la institución."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Iniciada Exitosamente"])}},103:{long_description:e=>{const{normalize:t}=e;return t(["El token ha sido enviado al sitio y se encuentra en proceso de validación..."])},short_description:e=>{const{normalize:t}=e;return t(["Validando Token"])}},200:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha descargado la información."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},201:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha descargado parte de la información, pero se continuará descargando información en segundo plano."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},202:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Sin embargo, no se encontraron transacciones."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},203:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha detectado que una o más cuentas no tienen transacciones."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},204:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha concluido. Sin embargo, se ha detectado que la información obtenida está incompleta."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},206:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Sin embargo, no se encontraron cuentas vinculadas a las credenciales proporcionadas."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},400:{long_description:e=>{const{normalize:t}=e;return t(["El valor de alguno de los parámetros es incorrecto."])},short_description:e=>{const{normalize:t}=e;return t(["Solicitud incorrecta"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["El valor de alguno de los elementos de autenticación que proporcionaste no fue aceptado por la institución. Por favor verifica la información e intenta de nuevo."])},short_description:e=>{const{normalize:t}=e;return t(["Credenciales Inválidas"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["El valor del token introducido no aceptado por la institución o ha expirado el tiempo para utilizarlo."])},short_description:e=>{const{normalize:t}=e;return t(["Token Inválido"])}},405:{long_description:e=>{const{normalize:t}=e;return t(["La institución ha bloqueado las credenciales proporcionadas. Por favor contacta a tu institución y asegúrate que tu banca en línea está funcionando correctamente antes de intentarlo nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Credenciales Bloqueadas"])}},406:{long_description:e=>{const{normalize:t}=e;return t(["La institución no permite iniciar más de una sesión para las credenciales proporcionadas. Si has iniciado sesión en otro lado por favor asegúrate de haberla cerrado antes de intentarlo nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Abierta"])}},408:{long_description:e=>{const{normalize:t}=e;return t(["La institución solicita atención del usuario para las credenciales proporcionadas. Te recomendamos iniciar sesión en el portal de la institución para confirmar que todo está en orden, posterior a eso favor de intentar nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Atención Requerida"])}},409:{long_description:e=>{const{normalize:t}=e;return t(["Las credenciales parecen ser válidas sin embargo corresponden a un sitio diferente de la misma organización."])},short_description:e=>{const{normalize:t}=e;return t(["Sitio Incorrecto"])}},410:{long_description:e=>{const{normalize:t}=e;return t(["Esperando token..."])},short_description:e=>{const{normalize:t}=e;return t(["Autenticando"])}},411:{long_description:e=>{const{normalize:t}=e;return t(["Se excedió el tiempo de espera para introducir el valor del token."])},short_description:e=>{const{normalize:t}=e;return t(["Token no recibido"])}},413:{long_description:e=>{const{normalize:t}=e;return t(["Hubo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, ha ocurrido un error interno al procesar tu institución."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}},501:{long_description:e=>{const{normalize:t}=e;return t(["La institución nos ha informado que tuvo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},504:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, ha ocurrido un error interno al procesar tu institución."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}},507:{long_description:e=>{const{normalize:t}=e;return t(["La institución nos ha informado que tuvo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},509:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra en mantenimiento."])},short_description:e=>{const{normalize:t}=e;return t(["Sitio en Mantenimiento"])}}},quick_answer:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. La información se continuará descargando información en segundo plano."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Iniciada Exitosamente."])}},timeout:{long_description:e=>{const{normalize:t}=e;return t(["El servidor ha tardado en responder."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}}},twofa:{waiting:e=>{const{normalize:t}=e;return t(["Esperando token"])}}};function isElement$1(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"}const global$1=globalThis||void 0||self;function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser$d={exports:{}},process=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch{try{return cachedSetTimeout.call(null,e,0)}catch{return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch{try{return cachedClearTimeout.call(null,e)}catch{return cachedClearTimeout.call(this,e)}}}var queue$1=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue$1=currentQueue.concat(queue$1):queueIndex=-1,queue$1.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue$1.length;t;){for(currentQueue=queue$1,queue$1=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue$1.length}currentQueue=null,draining=!1,runClearTimeout(e)}}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue$1.push(new Item(e,t)),queue$1.length===1&&!draining&&runTimeout(drainQueue)};function Item(e,t){this.fun=e,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$2(){}process.on=noop$2,process.addListener=noop$2,process.once=noop$2,process.off=noop$2,process.removeListener=noop$2,process.removeAllListeners=noop$2,process.emit=noop$2,process.prependListener=noop$2,process.prependOnceListener=noop$2,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$d.exports;const process$1=getDefaultExportFromCjs$1(browserExports),getDefaultsFromPostinstall=()=>{};/**
|
|
1
|
+
(function(Zn,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(Zn=typeof globalThis<"u"?globalThis:Zn||self,e(Zn.SyncfyAuthenticationWidget={}))})(this,function(exports){"use strict";var li=Object.defineProperty;var ui=(Zn,e,t)=>e in Zn?li(Zn,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):Zn[e]=t;var $n=(Zn,e,t)=>ui(Zn,typeof e!="symbol"?e+"":e,t);const resource$1={accounts_selection:{done:e=>{const{normalize:t}=e;return t(["Done"])},error:e=>{const{normalize:t}=e;return t(["An error occurred while fetching the accounts."])},fetching:e=>{const{normalize:t}=e;return t(["Fetching accounts"])},form_error:e=>{const{normalize:t}=e;return t(["Please select at least one account."])},form_label:e=>{const{normalize:t}=e;return t(["Syncfy will only share the data you select."])},form_label_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Syncfy will only share the data you select with ",n(a("client")),"."])},title:e=>{const{normalize:t}=e;return t(["Select Accounts"])}},api_errors:{400:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Some API request params are incorrect."])},short_description:e=>{const{normalize:t}=e;return t(["Bad Request"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Authentication failed."])},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},402:{long_description:e=>{const{normalize:t}=e;return t(["Something went wrong when trying to access this service. Please contact the support team for more information."])},real:{long_description:e=>{const{normalize:t}=e;return t(["API is disabled for non-payment."])},short_description:e=>{const{normalize:t}=e;return t(["Payment Required"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Forbidden."])},short_description:e=>{const{normalize:t}=e;return t(["Forbidden"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},404:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Not Found."])},short_description:e=>{const{normalize:t}=e;return t(["Not Found"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},429:{long_description:e=>{const{normalize:t}=e;return t(["Too many requests have been made in a short time. Please try again later"])},real:{long_description:e=>{const{normalize:t}=e;return t(["Too Many Requests."])},short_description:e=>{const{normalize:t}=e;return t(["Too Many Requests"])}},short_description:e=>{const{normalize:t}=e;return t(["Requests Rate Limit Exceeded"])}},449:{long_description:e=>{const{normalize:t}=e;return t(["The provided entrypoint.credential parameter is no longer valid, as the site it belongs to has been deactivated or is obsolete."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The provided entrypoint.credential parameter is no longer valid, as the site it belongs to has been deactivated or is obsolete."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Internal Server Error."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Server Error"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},503:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Service Unavailable."])},short_description:e=>{const{normalize:t}=e;return t(["Service Unavailable"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},credential_error:{long_description:e=>{const{normalize:t}=e;return t(["Credential error, please consider updating credential password."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Credential error, please consider updating credential password."])},short_description:e=>{const{normalize:t}=e;return t(["Credential error"])}},short_description:e=>{const{normalize:t}=e;return t(["Credential error"])}},credential_not_found:{long_description:e=>{const{normalize:t}=e;return t(["The given credential was invalid or not found."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The given credential was invalid or not found."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid credential"])}},no_internet:{long_description:e=>{const{normalize:t}=e;return t(["There is no internet connection, check your connection and try again."])},real:{long_description:e=>{const{normalize:t}=e;return t(["There is no internet connection, check your connection and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Connection error"])}},short_description:e=>{const{normalize:t}=e;return t(["Connection error"])}},site_not_found:{long_description:e=>{const{normalize:t}=e;return t(["The given entrypoint.site was invalid or not found."])},real:{long_description:e=>{const{normalize:t}=e;return t(["The given entrypoint.site was invalid or not found."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid entrypoint.site"])}},short_description:e=>{const{normalize:t}=e;return t(["Invalid entrypoint.site"])}},unauthorized:{long_description:e=>{const{normalize:t}=e;return t(["Your session has expired."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Your session has expired."])},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}},short_description:e=>{const{normalize:t}=e;return t(["Unauthorized"])}}},back_up_connection:{description:e=>{const{normalize:t}=e;return t(["Something went wrong when trying to connect to the institution, but you can upload your statement and we will extract the information."])},title:e=>{const{normalize:t}=e;return t(["An error occurred in the connection"])}},bridge:{114:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},116:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3e3:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3001:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3008:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3010:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3014:{long_description:e=>{const{normalize:t}=e;return t(["Se ha detectado más de una Llave Inteligente BBVA u ocurrió un error de comunicación."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3015:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3016:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3020:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3021:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3022:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3333:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3334:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3335:{long_description:e=>{const{normalize:t}=e;return t(["No se ha detectado una Llave Inteligente BBVA, verifique que esté conectada correctamente a su equipo."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3336:{long_description:e=>{const{normalize:t}=e;return t(["Error de comunicación durante el proceso de validación de su Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_config_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass configuration script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},host_update_available:{long_description:e=>{const{normalize:t}=e;return t(["Host application update available."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},not_ready:{long_description:e=>{const{normalize:t}=e;return t(["Bridge is not ready"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}}},common:{add_other:e=>{const{normalize:t}=e;return t(["Add another institution"])},back:e=>{const{normalize:t}=e;return t(["Back"])},cancel:e=>{const{normalize:t}=e;return t(["Cancel"])},continue:e=>{const{normalize:t}=e;return t(["Continue"])},close:e=>{const{normalize:t}=e;return t(["Close"])},data_error:e=>{const{normalize:t}=e;return t(["Sorry, an error occurred when loading the initial data"])},error:e=>{const{normalize:t}=e;return t(["Error"])},expand:e=>{const{normalize:t}=e;return t(["Expand"])},find_your_institution:e=>{const{normalize:t}=e;return t(["Find Your Institution"])},finish:e=>{const{normalize:t}=e;return t(["Finish"])},header:{login:e=>{const{normalize:t}=e;return t(["Login Information"])},link:e=>{const{normalize:t}=e;return t(["Link your Institution"])},select:e=>{const{normalize:t}=e;return t(["Select the institution"])}},hide:e=>{const{normalize:t}=e;return t(["Hide"])},intro:e=>{const{normalize:t}=e;return t(["Connect accounts from different institutions and extract data automatically"])},less:e=>{const{normalize:t}=e;return t(["less"])},long_description:e=>{const{normalize:t}=e;return t(["Connect accounts from different institutions and extract data automatically"])},more:e=>{const{normalize:t}=e;return t(["more"])},next:e=>{const{normalize:t}=e;return t(["Next"])},no_filtered_data:e=>{const{normalize:t}=e;return t(["There are no institutions available with the search criteria."])},process_running:e=>{const{normalize:t}=e;return t(["There is an institution being connected at this moment. Please, wait for this connection to finish."])},refresh:e=>{const{normalize:t}=e;return t(["Refresh"])},retry:e=>{const{normalize:t}=e;return t(["Try Again"])},search:e=>{const{normalize:t}=e;return t(["Search..."])},security_banner_content:e=>{const{normalize:t}=e;return t(["Your information is transferred encrypted end-to-end with the same standard Banks and Financial Institutions utilize."])},security_banner_title:e=>{const{normalize:t}=e;return t(["Secure and Private"])},session_error:e=>{const{normalize:t}=e;return t(["Something went wrong."])},session_refreshed_message:e=>{const{normalize:t}=e;return t(["Your session has been updated."])},session_refreshed:e=>{const{normalize:t}=e;return t(["Session refreshed"])},show:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Show ",n(a("msg"))])},show_password:e=>{const{normalize:t}=e;return t(["Show"])},test_mode:e=>{const{normalize:t}=e;return t(["You are currently running in Test Mode"])},unauthorized_message:e=>{const{normalize:t}=e;return t(["Your session expired, do you want refresh your session?"])},unauthorized:e=>{const{normalize:t}=e;return t(["Unauthorized"])},update_title:e=>{const{normalize:t}=e;return t(["Update Institution"])},webapp_add_banks:e=>{const{normalize:t}=e;return t(["Banks"])},webapp_add_blockchain:e=>{const{normalize:t}=e;return t(["Blockchain"])},webapp_add_government:e=>{const{normalize:t}=e;return t(["Government"])},webapp_add_utilities:e=>{const{normalize:t}=e;return t(["Utilities"])},webapp_add_wallet:e=>{const{normalize:t}=e;return t(["Digital Wallets"])}},credential:{api_error:{message:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},title:e=>{const{normalize:t}=e;return t(["Error"])}},found:{message:e=>{const{normalize:t}=e;return t(["Waiting to establish connection."])},title:e=>{const{normalize:t}=e;return t(["Credential found"])}},header_title:{sync:e=>{const{normalize:t}=e;return t(["Syncing credential"])},update:e=>{const{normalize:t}=e;return t(["Updating credential"])}},loading:{message:e=>{const{normalize:t}=e;return t(["Please wait a moment while we connect to the institution."])},title:e=>{const{normalize:t}=e;return t(["Connecting to institution"])}},search:{message:e=>{const{normalize:t}=e;return t(["Please wait a moment while we verify your information."])},title:e=>{const{normalize:t}=e;return t(["Validating credentials"])}}},download_options:{date_range_end:e=>{const{normalize:t}=e;return t(["End date"])},date_range_start:e=>{const{normalize:t}=e;return t(["Start date"])},label:e=>{const{normalize:t}=e;return t(["Download date range"])},switch:e=>{const{normalize:t}=e;return t(["Define download date range"])}},file:{click:e=>{const{normalize:t}=e;return t(["Clic to upload"])},invalid:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["The file extension must be ",n(a("extension")),"."])},invalid_multiple:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["The file extension must be one of these: ",n(a("extensions")),"."])},no_chosen:e=>{const{normalize:t}=e;return t(["No file chosen."])},remove:e=>{const{normalize:t}=e;return t(["Remove file."])},required:e=>{const{normalize:t}=e;return t(["is required."])}},form_errors:{regex:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Introduced value is not of type ",n(a("label")),"."])},required:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("label"))," is required."])}},privacy:{link:e=>{const{normalize:t}=e;return t(["Syncfy's Privacy Policy"])},list:{first:e=>{const{normalize:t}=e;return t(["Your data belongs to you!"])},second:e=>{const{normalize:t}=e;return t(["Connect easy and safely to your accounts."])},third:e=>{const{normalize:t}=e;return t(["Trusted by more than +100K users."])}},message:e=>{const{normalize:t}=e;return t(["By selecting ”Continue” you agree to"])},title:e=>{const{normalize:t}=e;return t(["You are using Syncfy for bank connectivity."])},title_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("client"))," partners with Syncfy for bank connectivity."])},url:e=>{const{normalize:t}=e;return t(["https://help.paybook.com/en/article/privacy-and-security-policy-k33bgf/"])}},santander_ws:{error:{long_description:e=>{const{normalize:t}=e;return t(["There was an error generating the token."])},short_description:e=>{const{normalize:t}=e;return t(["Token error"])}},script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Script not loaded."])},short_description:e=>{const{normalize:t}=e;return t(["Token error"])}}},site:{login:{authenticating:e=>{const{normalize:t}=e;return t(["Authenticating"])},error:e=>{const{normalize:t}=e;return t(["Authentication Error"])},success:e=>{const{normalize:t}=e;return t(["Successful Authentication"])}}},socket:{error:{long_description:e=>{const{normalize:t}=e;return t(["Socket connection ended, check your connection and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Socket error"])}},message:{100:{long_description:e=>{const{normalize:t}=e;return t(["Establishing connection with the institution..."])},short_description:e=>{const{normalize:t}=e;return t(["Establishing Connection"])}},101:{long_description:e=>{const{normalize:t}=e;return t(["Connection established with the institution, credentials are being validated..."])},short_description:e=>{const{normalize:t}=e;return t(["Validating Credentials"])}},102:{long_description:e=>{const{normalize:t}=e;return t(["Successfully logged into the institution"])},short_description:e=>{const{normalize:t}=e;return t(["Login Successful"])}},103:{long_description:e=>{const{normalize:t}=e;return t(["The token has been sent and is being validated..."])},short_description:e=>{const{normalize:t}=e;return t(["Validating Token"])}},200:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. Data has been extracted"])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},201:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. We have partially extracted information, but data will still be extracted in background processes."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},202:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, no transactions were found."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},203:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, more than one account does not have transactions."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},204:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, the data downloaded is incomplete."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},206:{long_description:e=>{const{normalize:t}=e;return t(["The connection has been successful. However, there were no accounts linked to the given credentials."])},short_description:e=>{const{normalize:t}=e;return t(["Institution Connected Successfully"])}},400:{long_description:e=>{const{normalize:t}=e;return t(["The value of one of the parameters is incorrect."])},short_description:e=>{const{normalize:t}=e;return t(["Bad request"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["The value of one of the given Authentication Fields was not accepted by the institution. Please verify the information and try again."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid Credentials"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["The given token value introduced was not accepted by the institution or the expiration time was reached."])},short_description:e=>{const{normalize:t}=e;return t(["Invalid Token"])}},405:{long_description:e=>{const{normalize:t}=e;return t(["The institution has blocked the given credential, please contact your institution and make sure your connection to the site is working properly before trying again."])},short_description:e=>{const{normalize:t}=e;return t(["Credential Locked"])}},406:{long_description:e=>{const{normalize:t}=e;return t(["The institution does not allow to have more than one user logged in. If you have logged into your institution using another device, please make sure to log out before trying again."])},short_description:e=>{const{normalize:t}=e;return t(["Already Logged In"])}},408:{long_description:e=>{const{normalize:t}=e;return t(["The institution requires attention from the user. We advise you to log into the institution to confirm everything is working properly. Upon confirmation, try again."])},short_description:e=>{const{normalize:t}=e;return t(["Attention Required"])}},409:{long_description:e=>{const{normalize:t}=e;return t(["The given credentials seem to be valid, but they belong to a different site from the same organization."])},short_description:e=>{const{normalize:t}=e;return t(["Incorrect Site"])}},410:{long_description:e=>{const{normalize:t}=e;return t(["Waiting for token..."])},short_description:e=>{const{normalize:t}=e;return t(["Authenticating"])}},411:{long_description:e=>{const{normalize:t}=e;return t(["The time to introduce the token value has been exceeded."])},short_description:e=>{const{normalize:t}=e;return t(["Token Not Received"])}},413:{long_description:e=>{const{normalize:t}=e;return t(["There was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}},501:{long_description:e=>{const{normalize:t}=e;return t(["The institution has informed to us that there was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},504:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, an internal error has been occurred while connecting to the institution."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}},507:{long_description:e=>{const{normalize:t}=e;return t(["The institution has informed to us that there was a problem in the connection. Please wait 15 minutes and try again. If the problem persists contact Technical Support."])},short_description:e=>{const{normalize:t}=e;return t(["Connection Error"])}},509:{long_description:e=>{const{normalize:t}=e;return t(["Sorry, the institution is in maintenance."])},short_description:e=>{const{normalize:t}=e;return t(["Site in Maintenance"])}}},quick_answer:{long_description:e=>{const{normalize:t}=e;return t(["Successfully logged into the institution. The data will be extracted by background processes."])},short_description:e=>{const{normalize:t}=e;return t(["Login Successful"])}},timeout:{long_description:e=>{const{normalize:t}=e;return t(["Server is taking too long to respond."])},short_description:e=>{const{normalize:t}=e;return t(["Internal Error"])}}},twofa:{waiting:e=>{const{normalize:t}=e;return t(["Waiting for token"])}}},resource={accounts_selection:{done:e=>{const{normalize:t}=e;return t(["Terminar"])},error:e=>{const{normalize:t}=e;return t(["Pasó un error al obtener las cuentas."])},fetching:e=>{const{normalize:t}=e;return t(["Obteniendo cuentas"])},form_error:e=>{const{normalize:t}=e;return t(["Por favor selecciona al menos una cuenta."])},form_label:e=>{const{normalize:t}=e;return t(["Syncfy sólo compartirá los datos que selecciones."])},form_label_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Syncfy sólo compartirá los datos que selecciones con ",n(a("client")),"."])},title:e=>{const{normalize:t}=e;return t(["Seleccionar cuentas"])}},api_errors:{400:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Algunos parámetros de la petición son incorrectos."])},short_description:e=>{const{normalize:t}=e;return t(["Petición incorrecta"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["La autenticación falló."])},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},402:{long_description:e=>{const{normalize:t}=e;return t(["Algo salió mal al intentar acceder a este servicio. Comunícate con el equipo de soporte para obtener más información."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El API se deshabilitó por falta de pago."])},short_description:e=>{const{normalize:t}=e;return t(["Pago requerido"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Prohibido."])},short_description:e=>{const{normalize:t}=e;return t(["Prohibido"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},404:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra temporalmente fuera de servicio."])},real:{long_description:e=>{const{normalize:t}=e;return t(["No encontrado."])},short_description:e=>{const{normalize:t}=e;return t(["No encontrado"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},429:{long_description:e=>{const{normalize:t}=e;return t(["Se han realizado muchas peticiones en un periodo corto de tiempo. Por favor intentar nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Se han realizado muchas peticiones en un periodo corto de tiempo. Por favor intentar nuevamente más tarde."])},short_description:e=>{const{normalize:t}=e;return t(["Límite de peticiones excedido"])}},short_description:e=>{const{normalize:t}=e;return t(["Límite de peticiones excedido"])}},449:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.credential proporcionado ya no es válido, ya que el sitio al que pertenece ha sido dado de baja o se encuentra obsoleto."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.credential proporcionado ya no es válido, ya que el sitio al que pertenece ha sido dado de baja o se encuentra obsoleto."])},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Error interno del servidor."])},short_description:e=>{const{normalize:t}=e;return t(["Error interno del servidor"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},503:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Servicio no disponible."])},short_description:e=>{const{normalize:t}=e;return t(["Servicio no disponible"])}},short_description:e=>{const{normalize:t}=e;return t(["Error"])}},credential_error:{long_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales, por favor considera actualizar la contraseña de las credenciales."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales, por favor considera actualizar la contraseña de las credenciales."])},short_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales"])}},short_description:e=>{const{normalize:t}=e;return t(["Error en las credenciales"])}},credential_not_found:{long_description:e=>{const{normalize:t}=e;return t(["La credencial proporcionada es inválida o no se encontró."])},real:{long_description:e=>{const{normalize:t}=e;return t(["La credencial proporcionada es inválida o no se encontró."])},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},short_description:e=>{const{normalize:t}=e;return t(["Credencial inválida"])}},no_internet:{long_description:e=>{const{normalize:t}=e;return t(["No hay conexión a internet, revisa tu conexión e intenta nuevamente."])},real:{long_description:e=>{const{normalize:t}=e;return t(["No hay conexión a internet, revisa tu conexión e intenta nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Error de conexión"])}},short_description:e=>{const{normalize:t}=e;return t(["Error de conexión"])}},site_not_found:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.site proporcionado es inválido o no se encontró."])},real:{long_description:e=>{const{normalize:t}=e;return t(["El parámetro entrypoint.site proporcionado es inválido o no se encontró."])},short_description:e=>{const{normalize:t}=e;return t(["entrypoint.site inválido"])}},short_description:e=>{const{normalize:t}=e;return t(["entrypoint.site inválido"])}},unauthorized:{long_description:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado."])},real:{long_description:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado."])},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}},short_description:e=>{const{normalize:t}=e;return t(["No autorizado"])}}},back_up_connection:{description:e=>{const{normalize:t}=e;return t(["Algo salió mal al intentar realizar la conexión, pero puedes subir tu estado de cuenta y extraeremos la información."])},title:e=>{const{normalize:t}=e;return t(["Se produjo un error en la conexión"])}},bridge:{114:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},116:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3e3:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3001:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3008:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3010:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3014:{long_description:e=>{const{normalize:t}=e;return t(["Se ha detectado más de una Llave Inteligente BBVA u ocurrió un error de comunicación."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3015:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3016:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3020:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3021:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3022:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3333:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3334:{long_description:e=>{const{normalize:t}=e;return t(["Error en validación de Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3335:{long_description:e=>{const{normalize:t}=e;return t(["No se ha detectado una Llave Inteligente BBVA, verifique que esté conectada correctamente a su equipo."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},3336:{long_description:e=>{const{normalize:t}=e;return t(["Error de comunicación durante el proceso de validación de su Llave Inteligente BBVA."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_config_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass configuration script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},digipass_script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["Digipass script not loaded"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},host_update_available:{long_description:e=>{const{normalize:t}=e;return t(["Host application update available."])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}},not_ready:{long_description:e=>{const{normalize:t}=e;return t(["Bridge is not ready"])},short_description:e=>{const{normalize:t}=e;return t(["Bridge error"])}}},common:{add_other:e=>{const{normalize:t}=e;return t(["Agregar Otra Institución"])},back:e=>{const{normalize:t}=e;return t(["Atrás"])},cancel:e=>{const{normalize:t}=e;return t(["Cancelar"])},close:e=>{const{normalize:t}=e;return t(["Cerrar"])},continue:e=>{const{normalize:t}=e;return t(["Continuar"])},data_error:e=>{const{normalize:t}=e;return t(["Lo sentimos, ocurrió un error al cargar la información inicial"])},error:e=>{const{normalize:t}=e;return t(["Error"])},expand:e=>{const{normalize:t}=e;return t(["Expandir"])},find_your_institution:e=>{const{normalize:t}=e;return t(["Encuentra tu institución"])},finish:e=>{const{normalize:t}=e;return t(["Finalizar"])},header:{login:e=>{const{normalize:t}=e;return t(["Información de inicio de sesión"])},link:e=>{const{normalize:t}=e;return t(["Conecta tu institución"])},select:e=>{const{normalize:t}=e;return t(["Seleccione la institución"])}},hide:e=>{const{normalize:t}=e;return t(["Ocultar"])},intro:e=>{const{normalize:t}=e;return t(["Conecta cuentas de diferentes instituciones y extrae datos automáticamente"])},less:e=>{const{normalize:t}=e;return t(["menos"])},long_description:e=>{const{normalize:t}=e;return t(["Conecta cuentas de diferentes instituciones y extrae datos automáticamente"])},more:e=>{const{normalize:t}=e;return t(["más"])},next:e=>{const{normalize:t}=e;return t(["Siguiente"])},no_filtered_data:e=>{const{normalize:t}=e;return t(["No hay instituciones disponibles con el criterio de búsqueda."])},process_running:e=>{const{normalize:t}=e;return t(["Actualmente existe una institución procesándose en este momento. Por favor, espera a que este proceso termine."])},refresh:e=>{const{normalize:t}=e;return t(["Renovar"])},retry:e=>{const{normalize:t}=e;return t(["Intentar Nuevamente"])},search:e=>{const{normalize:t}=e;return t(["Buscar..."])},security_banner_content:e=>{const{normalize:t}=e;return t(["Tu información se transfiere cifrada de extremo a extremo con el mismo estándar que utilizan los bancos e instituciones financieras."])},security_banner_title:e=>{const{normalize:t}=e;return t(["Seguro y privado"])},session_error:e=>{const{normalize:t}=e;return t(["Algo salió mal al actualizar la sesión."])},session_refreshed_message:e=>{const{normalize:t}=e;return t(["Tu sesión ha sido actualizada."])},session_refreshed:e=>{const{normalize:t}=e;return t(["Sesión renovada"])},show:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["Mostrar ",n(a("msg"))])},show_password:e=>{const{normalize:t}=e;return t(["Mostrar"])},test_mode:e=>{const{normalize:t}=e;return t(["Actualmente estás operando en Modo de Prueba"])},unauthorized_message:e=>{const{normalize:t}=e;return t(["Tu sesión ha expirado, ¿Quieres renovar tu sesión?"])},unauthorized:e=>{const{normalize:t}=e;return t(["Sin autorización"])},update_title:e=>{const{normalize:t}=e;return t(["Actualizar Institución"])},webapp_add_banks:e=>{const{normalize:t}=e;return t(["Bancos"])},webapp_add_blockchain:e=>{const{normalize:t}=e;return t(["Blockchain"])},webapp_add_government:e=>{const{normalize:t}=e;return t(["Gobierno"])},webapp_add_utilities:e=>{const{normalize:t}=e;return t(["Servicios"])},webapp_add_wallet:e=>{const{normalize:t}=e;return t(["Carteras Digitales"])}},credential:{api_error:{message:e=>{const{normalize:t}=e;return t(["Lo sentimos, un error interno ha ocurrido. Por favor intenta nuevamente más tarde."])},title:e=>{const{normalize:t}=e;return t(["Error"])}},found:{message:e=>{const{normalize:t}=e;return t(["Espere un momento mientras conectamos con la institución."])},title:e=>{const{normalize:t}=e;return t(["Credenciales encontradas"])}},header_title:{sync:e=>{const{normalize:t}=e;return t(["Sincronizando credencial"])},update:e=>{const{normalize:t}=e;return t(["Actualizando credencial"])}},loading:{message:e=>{const{normalize:t}=e;return t(["Espere un momento mientras conectamos con la institución."])},title:e=>{const{normalize:t}=e;return t(["Conectando con la institución"])}},search:{message:e=>{const{normalize:t}=e;return t(["Por favor espera un momento mientras validamos tus credenciales."])},title:e=>{const{normalize:t}=e;return t(["Validando credenciales"])}}},download_options:{date_range_end:e=>{const{normalize:t}=e;return t(["Fecha final"])},date_range_start:e=>{const{normalize:t}=e;return t(["Fecha de inicio"])},label:e=>{const{normalize:t}=e;return t(["Periodo de descarga"])},switch:e=>{const{normalize:t}=e;return t(["Definir periodo de descarga"])}},file:{click:e=>{const{normalize:t}=e;return t(["Clic para subir"])},invalid:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["La extensión del archivo debe ser ",n(a("extension")),"."])},invalid_multiple:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["La extensión del archivo debe ser alguna de estas: ",n(a("extensions")),"."])},no_chosen:e=>{const{normalize:t}=e;return t(["Ningún archivo seleccionado."])},remove:e=>{const{normalize:t}=e;return t(["Quitar archivo."])},required:e=>{const{normalize:t}=e;return t(["es requerido."])}},form_errors:{regex:e=>{const{normalize:t,interpolate:n,named:a}=e;return t(["El valor ingresado no es de tipo ",n(a("label")),"."])},required:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("label"))," es requerido."])}},privacy:{link:e=>{const{normalize:t}=e;return t(["Política de privacidad de Syncfy"])},list:{first:e=>{const{normalize:t}=e;return t(["¡Tus datos te pertenecen!"])},second:e=>{const{normalize:t}=e;return t(["Conecta tus cuentas de forma fácil y segura."])},third:e=>{const{normalize:t}=e;return t(["Más de 100k usuarios confían en nosotros."])}},message:e=>{const{normalize:t}=e;return t(["Al seleccionar ”Continuar”, aceptas la"])},title:e=>{const{normalize:t}=e;return t(["Estás usando Syncfy para conectar tus cuentas."])},title_client:e=>{const{normalize:t,interpolate:n,named:a}=e;return t([n(a("client"))," se une a Syncfy para conectar tus cuentas."])},url:e=>{const{normalize:t}=e;return t(["https://help.paybook.com/es/article/politica-de-privacidad-y-seguridad-4b9oho/"])}},santander_ws:{error:{long_description:e=>{const{normalize:t}=e;return t(["Hubo un error al generar el token."])},short_description:e=>{const{normalize:t}=e;return t(["Error del token"])}},script_not_loaded:{long_description:e=>{const{normalize:t}=e;return t(["No se cargó el script."])},short_description:e=>{const{normalize:t}=e;return t(["Error del token"])}}},site:{login:{authenticating:e=>{const{normalize:t}=e;return t(["Autenticando"])},error:e=>{const{normalize:t}=e;return t(["Error de Autenticación"])},success:e=>{const{normalize:t}=e;return t(["Autenticación Exitosa"])}}},socket:{error:{long_description:e=>{const{normalize:t}=e;return t(["La conexión con el socket finalizó, revisa tu conexión e intenta nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Error del socket"])}},message:{100:{long_description:e=>{const{normalize:t}=e;return t(["Estableciendo conexión con la institución..."])},short_description:e=>{const{normalize:t}=e;return t(["Estableciendo Conexión"])}},101:{long_description:e=>{const{normalize:t}=e;return t(["Conexión establecida con la institución, las credenciales se encuentran en proceso de validación..."])},short_description:e=>{const{normalize:t}=e;return t(["Validando Credenciales"])}},102:{long_description:e=>{const{normalize:t}=e;return t(["Se ha iniciado sesión exitosamente en el sitio de la institución."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Iniciada Exitosamente"])}},103:{long_description:e=>{const{normalize:t}=e;return t(["El token ha sido enviado al sitio y se encuentra en proceso de validación..."])},short_description:e=>{const{normalize:t}=e;return t(["Validando Token"])}},200:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha descargado la información."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},201:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha descargado parte de la información, pero se continuará descargando información en segundo plano."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},202:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Sin embargo, no se encontraron transacciones."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},203:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Se ha detectado que una o más cuentas no tienen transacciones."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},204:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha concluido. Sin embargo, se ha detectado que la información obtenida está incompleta."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},206:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. Sin embargo, no se encontraron cuentas vinculadas a las credenciales proporcionadas."])},short_description:e=>{const{normalize:t}=e;return t(["Institución Conectada Exitosamente"])}},400:{long_description:e=>{const{normalize:t}=e;return t(["El valor de alguno de los parámetros es incorrecto."])},short_description:e=>{const{normalize:t}=e;return t(["Solicitud incorrecta"])}},401:{long_description:e=>{const{normalize:t}=e;return t(["El valor de alguno de los elementos de autenticación que proporcionaste no fue aceptado por la institución. Por favor verifica la información e intenta de nuevo."])},short_description:e=>{const{normalize:t}=e;return t(["Credenciales Inválidas"])}},403:{long_description:e=>{const{normalize:t}=e;return t(["El valor del token introducido no aceptado por la institución o ha expirado el tiempo para utilizarlo."])},short_description:e=>{const{normalize:t}=e;return t(["Token Inválido"])}},405:{long_description:e=>{const{normalize:t}=e;return t(["La institución ha bloqueado las credenciales proporcionadas. Por favor contacta a tu institución y asegúrate que tu banca en línea está funcionando correctamente antes de intentarlo nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Credenciales Bloqueadas"])}},406:{long_description:e=>{const{normalize:t}=e;return t(["La institución no permite iniciar más de una sesión para las credenciales proporcionadas. Si has iniciado sesión en otro lado por favor asegúrate de haberla cerrado antes de intentarlo nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Abierta"])}},408:{long_description:e=>{const{normalize:t}=e;return t(["La institución solicita atención del usuario para las credenciales proporcionadas. Te recomendamos iniciar sesión en el portal de la institución para confirmar que todo está en orden, posterior a eso favor de intentar nuevamente."])},short_description:e=>{const{normalize:t}=e;return t(["Atención Requerida"])}},409:{long_description:e=>{const{normalize:t}=e;return t(["Las credenciales parecen ser válidas sin embargo corresponden a un sitio diferente de la misma organización."])},short_description:e=>{const{normalize:t}=e;return t(["Sitio Incorrecto"])}},410:{long_description:e=>{const{normalize:t}=e;return t(["Esperando token..."])},short_description:e=>{const{normalize:t}=e;return t(["Autenticando"])}},411:{long_description:e=>{const{normalize:t}=e;return t(["Se excedió el tiempo de espera para introducir el valor del token."])},short_description:e=>{const{normalize:t}=e;return t(["Token no recibido"])}},413:{long_description:e=>{const{normalize:t}=e;return t(["Hubo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},500:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, ha ocurrido un error interno al procesar tu institución."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}},501:{long_description:e=>{const{normalize:t}=e;return t(["La institución nos ha informado que tuvo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},504:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, ha ocurrido un error interno al procesar tu institución."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}},507:{long_description:e=>{const{normalize:t}=e;return t(["La institución nos ha informado que tuvo un problema durante el proceso de conexión. Por favor esperar 15 minutos e intentar nuevamente. Si persiste el problema contacte a Soporte Técnico."])},short_description:e=>{const{normalize:t}=e;return t(["Error de Conexión"])}},509:{long_description:e=>{const{normalize:t}=e;return t(["Lo sentimos, la institución se encuentra en mantenimiento."])},short_description:e=>{const{normalize:t}=e;return t(["Sitio en Mantenimiento"])}}},quick_answer:{long_description:e=>{const{normalize:t}=e;return t(["La conexión ha sido exitosa. La información se continuará descargando información en segundo plano."])},short_description:e=>{const{normalize:t}=e;return t(["Sesión Iniciada Exitosamente."])}},timeout:{long_description:e=>{const{normalize:t}=e;return t(["El servidor ha tardado en responder."])},short_description:e=>{const{normalize:t}=e;return t(["Error Interno"])}}},twofa:{waiting:e=>{const{normalize:t}=e;return t(["Esperando token"])}}};function isElement$1(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e!==null&&e.nodeType===1&&typeof e.nodeName=="string"}const global$1=globalThis||void 0||self;function getDefaultExportFromCjs$1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browser$d={exports:{}},process=browser$d.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch{try{return cachedSetTimeout.call(null,e,0)}catch{return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch{try{return cachedClearTimeout.call(null,e)}catch{return cachedClearTimeout.call(this,e)}}}var queue$1=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue$1=currentQueue.concat(queue$1):queueIndex=-1,queue$1.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue$1.length;t;){for(currentQueue=queue$1,queue$1=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue$1.length}currentQueue=null,draining=!1,runClearTimeout(e)}}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue$1.push(new Item(e,t)),queue$1.length===1&&!draining&&runTimeout(drainQueue)};function Item(e,t){this.fun=e,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={};function noop$2(){}process.on=noop$2,process.addListener=noop$2,process.once=noop$2,process.off=noop$2,process.removeListener=noop$2,process.removeAllListeners=noop$2,process.emit=noop$2,process.prependListener=noop$2,process.prependOnceListener=noop$2,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var browserExports=browser$d.exports;const process$1=getDefaultExportFromCjs$1(browserExports),getDefaultsFromPostinstall=()=>{};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
*
|
|
@@ -676,7 +676,7 @@
|
|
|
676
676
|
*/registerVersion(name,version$3,"app");function initFirebase(){const t=initializeApp({apiKey:"AIzaSyC9JxQ4ULW2nC-tBNwsZ52OTQnS9mIeeS8",authDomain:"syncfy-widget.firebaseapp.com",projectId:"syncfy-widget",storageBucket:"syncfy-widget.appspot.com",messagingSenderId:"406921126981",appId:"1:406921126981:web:788d7d85203868101aaf2c",measurementId:"G-FYDLPN68N8"});getAnalytics(t),measureEvent("load")}function measureEvent(e,t){const n=getAnalytics();logEvent(n,e,{environment:void 0,eventAction:e,...t||{}})}var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var propertyExpr,hasRequiredPropertyExpr;function requirePropertyExpr(){if(hasRequiredPropertyExpr)return propertyExpr;hasRequiredPropertyExpr=1;function e(pe){this._maxSize=pe,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(pe){return this._values[pe]},e.prototype.set=function(pe,Ce){return this._size>=this._maxSize&&this.clear(),pe in this._values||this._size++,this._values[pe]=Ce};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,a=/^\d/,s=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,o=/^\s*(['"]?)(.*?)(\1)\s*$/,c=512,f=new e(c),y=new e(c),m=new e(c);propertyExpr={Cache:e,split:z,normalizePath:g,setter:function(pe){var Ce=g(pe);return y.get(pe)||y.set(pe,function(qe,At){for(var Et=0,ze=Ce.length,kt=qe;Et<ze-1;){var Pt=Ce[Et];if(Pt==="__proto__"||Pt==="constructor"||Pt==="prototype")return qe;kt=kt[Ce[Et++]]}kt[Ce[Et]]=At})},getter:function(pe,Ce){var Oe=g(pe);return m.get(pe)||m.set(pe,function(At){for(var Et=0,ze=Oe.length;Et<ze;)if(At!=null||!Ce)At=At[Oe[Et++]];else return;return At})},join:function(pe){return pe.reduce(function(Ce,Oe){return Ce+(re(Oe)||n.test(Oe)?"["+Oe+"]":(Ce?".":"")+Oe)},"")},forEach:function(pe,Ce,Oe){ie(Array.isArray(pe)?pe:z(pe),Ce,Oe)}};function g(pe){return f.get(pe)||f.set(pe,z(pe).map(function(Ce){return Ce.replace(o,"$2")}))}function z(pe){return pe.match(t)||[""]}function ie(pe,Ce,Oe){var qe=pe.length,At,Et,ze,kt;for(Et=0;Et<qe;Et++)At=pe[Et],At&&($e(At)&&(At='"'+At+'"'),kt=re(At),ze=!kt&&/^\d+$/.test(At),Ce.call(Oe,At,kt,ze,Et,pe))}function re(pe){return typeof pe=="string"&&pe&&["'",'"'].indexOf(pe.charAt(0))!==-1}function he(pe){return pe.match(a)&&!pe.match(n)}function _e(pe){return s.test(pe)}function $e(pe){return!re(pe)&&(he(pe)||_e(pe))}return propertyExpr}var propertyExprExports=requirePropertyExpr(),tinyCase,hasRequiredTinyCase;function requireTinyCase(){if(hasRequiredTinyCase)return tinyCase;hasRequiredTinyCase=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=g=>g.match(e)||[],n=g=>g[0].toUpperCase()+g.slice(1),a=(g,z)=>t(g).join(z).toLowerCase(),s=g=>t(g).reduce((z,ie)=>`${z}${z?ie[0].toUpperCase()+ie.slice(1).toLowerCase():ie.toLowerCase()}`,"");return tinyCase={words:t,upperFirst:n,camelCase:s,pascalCase:g=>n(s(g)),snakeCase:g=>a(g,"_"),kebabCase:g=>a(g,"-"),sentenceCase:g=>n(a(g," ")),titleCase:g=>t(g).map(n).join(" ")},tinyCase}var tinyCaseExports=requireTinyCase(),toposort$1={exports:{}},hasRequiredToposort;function requireToposort(){if(hasRequiredToposort)return toposort$1.exports;hasRequiredToposort=1,toposort$1.exports=function(s){return e(t(s),s)},toposort$1.exports.array=e;function e(s,o){var c=s.length,f=new Array(c),y={},m=c,g=n(o),z=a(s);for(o.forEach(function(re){if(!z.has(re[0])||!z.has(re[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});m--;)y[m]||ie(s[m],m,new Set);return f;function ie(re,he,_e){if(_e.has(re)){var $e;try{$e=", node was:"+JSON.stringify(re)}catch{$e=""}throw new Error("Cyclic dependency"+$e)}if(!z.has(re))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(re));if(!y[he]){y[he]=!0;var pe=g.get(re)||new Set;if(pe=Array.from(pe),he=pe.length){_e.add(re);do{var Ce=pe[--he];ie(Ce,z.get(Ce),_e)}while(he);_e.delete(re)}f[--c]=re}}}function t(s){for(var o=new Set,c=0,f=s.length;c<f;c++){var y=s[c];o.add(y[0]),o.add(y[1])}return Array.from(o)}function n(s){for(var o=new Map,c=0,f=s.length;c<f;c++){var y=s[c];o.has(y[0])||o.set(y[0],new Set),o.has(y[1])||o.set(y[1],new Set),o.get(y[0]).add(y[1])}return o}function a(s){for(var o=new Map,c=0,f=s.length;c<f;c++)o.set(s[c],c);return o}return toposort$1.exports}var toposortExports=requireToposort();const toposort=getDefaultExportFromCjs(toposortExports),toString$2=Object.prototype.toString,errorToString=Error.prototype.toString,regExpToString=RegExp.prototype.toString,symbolToString$1=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",SYMBOL_REGEXP=/^Symbol\((.*)\)(.*)$/;function printNumber(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function printSimpleValue(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return printNumber(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return symbolToString$1.call(e).replace(SYMBOL_REGEXP,"Symbol($1)");const a=toString$2.call(e).slice(8,-1);return a==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):a==="Error"||e instanceof Error?"["+errorToString.call(e)+"]":a==="RegExp"?regExpToString.call(e):null}function printValue(e,t){let n=printSimpleValue(e,t);return n!==null?n:JSON.stringify(e,function(a,s){let o=printSimpleValue(this[a],t);return o!==null?o:s},2)}function toArray$1(e){return e==null?[]:[].concat(e)}let _Symbol$toStringTag,_Symbol$hasInstance,_Symbol$toStringTag2,strReg=/\$\{\s*(\w+)\s*\}/g;_Symbol$toStringTag=Symbol.toStringTag;class ValidationErrorNoStack{constructor(t,n,a,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[_Symbol$toStringTag]="Error",this.name="ValidationError",this.value=n,this.path=a,this.type=s,this.errors=[],this.inner=[],toArray$1(t).forEach(o=>{if(ValidationError.isError(o)){this.errors.push(...o.errors);const c=o.inner.length?o.inner:[o];this.inner.push(...c)}else this.errors.push(o)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}_Symbol$hasInstance=Symbol.hasInstance,_Symbol$toStringTag2=Symbol.toStringTag;class ValidationError extends Error{static formatError(t,n){const a=n.label||n.path||"this";return n=Object.assign({},n,{path:a,originalPath:n.path}),typeof t=="string"?t.replace(strReg,(s,o)=>printValue(n[o])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,a,s,o){const c=new ValidationErrorNoStack(t,n,a,s);if(o)return c;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[_Symbol$toStringTag2]="Error",this.name=c.name,this.message=c.message,this.type=c.type,this.value=c.value,this.path=c.path,this.errors=c.errors,this.inner=c.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ValidationError)}static[_Symbol$hasInstance](t){return ValidationErrorNoStack[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let mixed={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:a})=>{const s=a!=null&&a!==n?` (cast from the value \`${printValue(a,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${printValue(n,!0)}\``+s:`${e} must match the configured type. The validated value was: \`${printValue(n,!0)}\``+s}},string$1={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},number$2={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},date$1={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},boolean={isValue:"${path} field must be ${value}"},object$1={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},array$1={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},tuple={notType:e=>{const{path:t,value:n,spec:a}=e,s=a.types.length;if(Array.isArray(n)){if(n.length<s)return`${t} tuple value has too few items, expected a length of ${s} but got ${n.length} for value: \`${printValue(n,!0)}\``;if(n.length>s)return`${t} tuple value has too many items, expected a length of ${s} but got ${n.length} for value: \`${printValue(n,!0)}\``}return ValidationError.formatError(mixed.notType,e)}};Object.assign(Object.create(null),{mixed,string:string$1,number:number$2,date:date$1,object:object$1,array:array$1,boolean,tuple});const isSchema=e=>e&&e.__isYupSchema__;class Condition{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:a,then:s,otherwise:o}=n,c=typeof a=="function"?a:(...f)=>f.every(y=>y===a);return new Condition(t,(f,y)=>{var m;let g=c(...f)?s:o;return(m=g==null?void 0:g(y))!=null?m:y})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let a=this.refs.map(o=>o.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),s=this.fn(a,t,n);if(s===void 0||s===t)return t;if(!isSchema(s))throw new TypeError("conditions must return a schema object");return s.resolve(n)}}const prefixes$1={context:"$",value:"."};class Reference{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===prefixes$1.context,this.isValue=this.key[0]===prefixes$1.value,this.isSibling=!this.isContext&&!this.isValue;let a=this.isContext?prefixes$1.context:this.isValue?prefixes$1.value:"";this.path=this.key.slice(a.length),this.getter=this.path&&propertyExprExports.getter(this.path,!0),this.map=n.map}getValue(t,n,a){let s=this.isContext?a:this.isValue?t:n;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Reference.prototype.__isYupRef=!0;const isAbsent=e=>e==null;function createValidation(e){function t({value:n,path:a="",options:s,originalValue:o,schema:c},f,y){const{name:m,test:g,params:z,message:ie,skipAbsent:re}=e;let{parent:he,context:_e,abortEarly:$e=c.spec.abortEarly,disableStackTrace:pe=c.spec.disableStackTrace}=s;const Ce={value:n,parent:he,context:_e};function Oe(Ie={}){const u=resolveParams(Object.assign({value:n,originalValue:o,label:c.spec.label,path:Ie.path||a,spec:c.spec,disableStackTrace:Ie.disableStackTrace||pe},z,Ie.params),Ce),v=new ValidationError(ValidationError.formatError(Ie.message||ie,u),n,u.path,Ie.type||m,u.disableStackTrace);return v.params=u,v}const qe=$e?f:y;let At={path:a,parent:he,type:m,from:s.from,createError:Oe,resolve(Ie){return resolveMaybeRef(Ie,Ce)},options:s,originalValue:o,schema:c};const Et=Ie=>{ValidationError.isError(Ie)?qe(Ie):Ie?y(null):qe(Oe())},ze=Ie=>{ValidationError.isError(Ie)?qe(Ie):f(Ie)};if(re&&isAbsent(n))return Et(!0);let Pt;try{var jt;if(Pt=g.call(At,n,At),typeof((jt=Pt)==null?void 0:jt.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${At.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(Pt).then(Et,ze)}}catch(Ie){ze(Ie);return}Et(Pt)}return t.OPTIONS=e,t}function resolveParams(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=resolveMaybeRef(e[n],t);return e}function resolveMaybeRef(e,t){return Reference.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function getIn(e,t,n,a=n){let s,o,c;return t?(propertyExprExports.forEach(t,(f,y,m)=>{let g=y?f.slice(1,f.length-1):f;e=e.resolve({context:a,parent:s,value:n});let z=e.type==="tuple",ie=m?parseInt(g,10):0;if(e.innerType||z){if(z&&!m)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${c}" must contain an index to the tuple element, e.g. "${c}[0]"`);if(n&&ie>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${f}, in the path: ${t}. because there is no value at that index. `);s=n,n=n&&n[ie],e=z?e.spec.types[ie]:e.innerType}if(!m){if(!e.fields||!e.fields[g])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${c} which is a type: "${e.type}")`);s=n,n=n&&n[g],e=e.fields[g]}o=g,c=y?"["+f+"]":"."+f}),{schema:e,parent:s,parentPath:o}):{parent:s,parentPath:t,schema:e}}class ReferenceSet extends Set{describe(){const t=[];for(const n of this.values())t.push(Reference.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const a of this.values())n.push(t(a));return n}clone(){return new ReferenceSet(this.values())}merge(t,n){const a=this.clone();return t.forEach(s=>a.add(s)),n.forEach(s=>a.delete(s)),a}}function clone$1(e,t=new Map){if(isSchema(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let a=0;a<e.length;a++)n[a]=clone$1(e[a],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[a,s]of e.entries())n.set(a,clone$1(s,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const a of e)n.add(clone$1(a,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[a,s]of Object.entries(e))n[a]=clone$1(s,t)}else throw Error(`Unable to clone ${e}`);return n}function createStandardPath(e){if(!(e!=null&&e.length))return;const t=[];let n="",a=!1,s=!1;for(let o=0;o<e.length;o++){const c=e[o];if(c==="["&&!s){n&&(t.push(...n.split(".").filter(Boolean)),n=""),a=!0;continue}if(c==="]"&&!s){n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),a=!1;continue}if(c==='"'){s=!s;continue}if(c==="."&&!a&&!s){n&&(t.push(n),n="");continue}n+=c}return n&&t.push(...n.split(".").filter(Boolean)),t}function createStandardIssues(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(a=>({message:a,path:createStandardPath(n)}))}function issuesFromValidationError(e,t){var n;if(!((n=e.inner)!=null&&n.length)&&e.errors.length)return createStandardIssues(e,t);const a=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(s=>issuesFromValidationError(s,a))}let Schema$1=class{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ReferenceSet,this._blacklist=new ReferenceSet,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(mixed.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=clone$1(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let a=t(this);return this._mutate=n,a}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,a=t.clone();const s=Object.assign({},n.spec,a.spec);return a.spec=s,a.internalTests=Object.assign({},n.internalTests,a.internalTests),a._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),a._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),a.tests=n.tests,a.exclusiveTests=n.exclusiveTests,a.withMutation(o=>{t.tests.forEach(c=>{o.test(c.OPTIONS)})}),a.transforms=[...n.transforms,...a.transforms],a}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let a=n.conditions;n=n.clone(),n.conditions=[],n=a.reduce((s,o)=>o.resolve(s,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,a,s,o;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(a=t.abortEarly)!=null?a:this.spec.abortEarly,recursive:(s=t.recursive)!=null?s:this.spec.recursive,disableStackTrace:(o=t.disableStackTrace)!=null?o:this.spec.disableStackTrace})}cast(t,n={}){let a=this.resolve(Object.assign({value:t},n)),s=n.assert==="ignore-optionality",o=a._cast(t,n);if(n.assert!==!1&&!a.isType(o)){if(s&&isAbsent(o))return o;let c=printValue(t),f=printValue(o);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${a.type}".
|
|
677
677
|
|
|
678
678
|
attempted value: ${c}
|
|
679
|
-
`+(f!==c?`result of cast: ${f}`:""))}return o}_cast(t,n){let a=t===void 0?t:this.transforms.reduce((s,o)=>o.call(this,s,t,this),t);return a===void 0&&(a=this.getDefault(n)),a}_validate(t,n={},a,s){let{path:o,originalValue:c=t,strict:f=this.spec.strict}=n,y=t;f||(y=this._cast(y,Object.assign({assert:!1},n)));let m=[];for(let g of Object.values(this.internalTests))g&&m.push(g);this.runTests({path:o,value:y,originalValue:c,options:n,tests:m},a,g=>{if(g.length)return s(g,y);this.runTests({path:o,value:y,originalValue:c,options:n,tests:this.tests},a,s)})}runTests(t,n,a){let s=!1,{tests:o,value:c,originalValue:f,path:y,options:m}=t,g=_e=>{s||(s=!0,n(_e,c))},z=_e=>{s||(s=!0,a(_e,c))},ie=o.length,re=[];if(!ie)return z([]);let he={value:c,originalValue:f,path:y,options:m,schema:this};for(let _e=0;_e<o.length;_e++){const $e=o[_e];$e(he,g,function(Ce){Ce&&(Array.isArray(Ce)?re.push(...Ce):re.push(Ce)),--ie<=0&&z(re)})}}asNestedTest({key:t,index:n,parent:a,parentPath:s,originalParent:o,options:c}){const f=t??n;if(f==null)throw TypeError("Must include `key` or `index` for nested validations");const y=typeof f=="number";let m=a[f];const g=Object.assign({},c,{strict:!0,parent:a,value:m,originalValue:o[f],key:void 0,[y?"index":"key"]:f,path:y||f.includes(".")?`${s||""}[${y?f:`"${f}"`}]`:(s?`${s}.`:"")+t});return(z,ie,re)=>this.resolve(g)._validate(m,g,ie,re)}validate(t,n){var a;let s=this.resolve(Object.assign({},n,{value:t})),o=(a=n==null?void 0:n.disableStackTrace)!=null?a:s.spec.disableStackTrace;return new Promise((c,f)=>s._validate(t,n,(y,m)=>{ValidationError.isError(y)&&(y.value=m),f(y)},(y,m)=>{y.length?f(new ValidationError(y,m,void 0,void 0,o)):c(m)}))}validateSync(t,n){var a;let s=this.resolve(Object.assign({},n,{value:t})),o,c=(a=n==null?void 0:n.disableStackTrace)!=null?a:s.spec.disableStackTrace;return s._validate(t,Object.assign({},n,{sync:!0}),(f,y)=>{throw ValidationError.isError(f)&&(f.value=y),f},(f,y)=>{if(f.length)throw new ValidationError(f,t,void 0,void 0,c);o=y}),o}isValid(t,n){return this.validate(t,n).then(()=>!0,a=>{if(ValidationError.isError(a))return!1;throw a})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(a){if(ValidationError.isError(a))return!1;throw a}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):clone$1(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const a=this.clone({nullable:t});return a.internalTests.nullable=createValidation({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),a}optionality(t,n){const a=this.clone({optional:t});return a.internalTests.optionality=createValidation({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),a}optional(){return this.optionality(!0)}defined(t=mixed.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=mixed.notNull){return this.nullability(!1,t)}required(t=mixed.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=mixed.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let a=this.clone(),s=createValidation(n),o=n.exclusive||n.name&&a.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(a.exclusiveTests[n.name]=!!n.exclusive),a.tests=a.tests.filter(c=>!(c.OPTIONS.name===n.name&&(o||c.OPTIONS.test===s.OPTIONS.test))),a.tests.push(s),a}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let a=this.clone(),s=toArray$1(t).map(o=>new Reference(o));return s.forEach(o=>{o.isSibling&&a.deps.push(o.key)}),a.conditions.push(typeof n=="function"?new Condition(s,n):Condition.fromOptions(s,n)),a}typeError(t){let n=this.clone();return n.internalTests.typeError=createValidation({message:t,name:"typeError",skipAbsent:!0,test(a){return this.schema._typeCheck(a)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=mixed.oneOf){let a=this.clone();return t.forEach(s=>{a._whitelist.add(s),a._blacklist.delete(s)}),a.internalTests.whiteList=createValidation({message:n,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,c=o.resolveAll(this.resolve);return c.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:c}})}}),a}notOneOf(t,n=mixed.notOneOf){let a=this.clone();return t.forEach(s=>{a._blacklist.add(s),a._whitelist.delete(s)}),a.internalTests.blacklist=createValidation({message:n,name:"notOneOf",test(s){let o=this.schema._blacklist,c=o.resolveAll(this.resolve);return c.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:c}}):!0}}),a}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:a,meta:s,optional:o,nullable:c}=n.spec;return{meta:s,label:a,optional:o,nullable:c,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((y,m,g)=>g.findIndex(z=>z.OPTIONS.name===y.OPTIONS.name)===m).map(y=>{const m=y.OPTIONS.params&&t?resolveParams(Object.assign({},y.OPTIONS.params),t):y.OPTIONS.params;return{name:y.OPTIONS.name,params:m}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await t.validate(a,{abortEarly:!1})}}catch(s){if(s instanceof ValidationError)return{issues:issuesFromValidationError(s)};throw s}}}}};Schema$1.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Schema$1.prototype[`${e}At`]=function(t,n,a={}){const{parent:s,parentPath:o,schema:c}=getIn(this,t,n,a.context);return c[e](s&&s[o],Object.assign({},a,{parent:s,path:t}))};for(const e of["equals","is"])Schema$1.prototype[e]=Schema$1.prototype.oneOf;for(const e of["not","nope"])Schema$1.prototype[e]=Schema$1.prototype.notOneOf;const returnsTrue=()=>!0;function create$8(e){return new MixedSchema(e)}class MixedSchema extends Schema$1{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:returnsTrue},t))}}create$8.prototype=MixedSchema.prototype;function create$7(){return new BooleanSchema}class BooleanSchema extends Schema$1{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(a.spec.coerce&&!a.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return isAbsent(n)||n===!0}})}isFalse(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return isAbsent(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}create$7.prototype=BooleanSchema.prototype;const isoReg=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function parseIsoDate(e){const t=parseDateStruct(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function parseDateStruct(e){var t,n;const a=isoReg.exec(e);return a?{year:toNumber$2(a[1]),month:toNumber$2(a[2],1)-1,day:toNumber$2(a[3],1),hour:toNumber$2(a[4]),minute:toNumber$2(a[5]),second:toNumber$2(a[6]),millisecond:a[7]?toNumber$2(a[7].substring(0,3)):0,precision:(t=(n=a[7])==null?void 0:n.length)!=null?t:void 0,z:a[8]||void 0,plusMinus:a[9]||void 0,hourOffset:toNumber$2(a[10]),minuteOffset:toNumber$2(a[11])}:null}function toNumber$2(e,t=0){return Number(e)||t}let rEmail=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rUrl=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,rUUID=/^(?:[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,yearMonthDay="^\\d{4}-\\d{2}-\\d{2}",hourMinuteSecond="\\d{2}:\\d{2}:\\d{2}",zOrOffset="(([+-]\\d{2}(:?\\d{2})?)|Z)",rIsoDateTime=new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`),isTrimmed=e=>isAbsent(e)||e===e.trim(),objStringTag={}.toString();function create$6(){return new StringSchema}class StringSchema extends Schema$1{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(!a.spec.coerce||a.isType(t)||Array.isArray(t))return t;const s=t!=null&&t.toString?t.toString():t;return s===objStringTag?t:s})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||mixed.required,name:"required",skipAbsent:!0,test:a=>!!a.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=string$1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(a){return a.length===this.resolve(t)}})}min(t,n=string$1.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a.length>=this.resolve(t)}})}max(t,n=string$1.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(a){return a.length<=this.resolve(t)}})}matches(t,n){let a=!1,s,o;return n&&(typeof n=="object"?{excludeEmptyString:a=!1,message:s,name:o}=n:s=n),this.test({name:o||"matches",message:s||string$1.matches,params:{regex:t},skipAbsent:!0,test:c=>c===""&&a||c.search(t)!==-1})}email(t=string$1.email){return this.matches(rEmail,{name:"email",message:t,excludeEmptyString:!0})}url(t=string$1.url){return this.matches(rUrl,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=string$1.uuid){return this.matches(rUUID,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",a,s;return t&&(typeof t=="object"?{message:n="",allowOffset:a=!1,precision:s=void 0}=t:n=t),this.matches(rIsoDateTime,{name:"datetime",message:n||string$1.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||string$1.datetime_offset,params:{allowOffset:a},skipAbsent:!0,test:o=>{if(!o||a)return!0;const c=parseDateStruct(o);return c?!!c.z:!1}}).test({name:"datetime_precision",message:n||string$1.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const c=parseDateStruct(o);return c?c.precision===s:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=string$1.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:isTrimmed})}lowercase(t=string$1.lowercase){return this.transform(n=>isAbsent(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>isAbsent(n)||n===n.toLowerCase()})}uppercase(t=string$1.uppercase){return this.transform(n=>isAbsent(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>isAbsent(n)||n===n.toUpperCase()})}}create$6.prototype=StringSchema.prototype;let isNaN$1=e=>e!=+e;function create$5(){return new NumberSchema}class NumberSchema extends Schema$1{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!isNaN$1(t)}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(!a.spec.coerce)return t;let s=t;if(typeof s=="string"){if(s=s.replace(/\s/g,""),s==="")return NaN;s=+s}return a.isType(s)||s===null?s:parseFloat(s)})})}min(t,n=number$2.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(t)}})}max(t,n=number$2.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(t)}})}lessThan(t,n=number$2.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(a){return a<this.resolve(t)}})}moreThan(t,n=number$2.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(a){return a>this.resolve(t)}})}positive(t=number$2.positive){return this.moreThan(0,t)}negative(t=number$2.negative){return this.lessThan(0,t)}integer(t=number$2.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>isAbsent(t)?t:t|0)}round(t){var n;let a=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(a.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+a.join(", "));return this.transform(s=>isAbsent(s)?s:Math[t](s))}}create$5.prototype=NumberSchema.prototype;let invalidDate=new Date(""),isDate$3=e=>Object.prototype.toString.call(e)==="[object Date]";class DateSchema extends Schema$1{constructor(){super({type:"date",check(t){return isDate$3(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,a)=>!a.spec.coerce||a.isType(t)||t===null?t:(t=parseIsoDate(t),isNaN(t)?DateSchema.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let a;if(Reference.isRef(t))a=t;else{let s=this.cast(t);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);a=s}return a}min(t,n=date$1.min){let a=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(a)}})}max(t,n=date$1.max){let a=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(a)}})}}DateSchema.INVALID_DATE=invalidDate;function sortFields(e,t=[]){let n=[],a=new Set,s=new Set(t.map(([c,f])=>`${c}-${f}`));function o(c,f){let y=propertyExprExports.split(c)[0];a.add(y),s.has(`${f}-${y}`)||n.push([f,y])}for(const c of Object.keys(e)){let f=e[c];a.add(c),Reference.isRef(f)&&f.isSibling?o(f.path,c):isSchema(f)&&"deps"in f&&f.deps.forEach(y=>o(y,c))}return toposort.array(Array.from(a),n).reverse()}function findIndex(e,t){let n=1/0;return e.some((a,s)=>{var o;if((o=t.path)!=null&&o.includes(a))return n=s,!0}),n}function sortByKeyOrder(e){return(t,n)=>findIndex(e,t)-findIndex(e,n)}const parseJson=(e,t,n)=>{if(typeof e!="string")return e;let a=e;try{a=JSON.parse(e)}catch{}return n.isType(a)?a:e};function deepPartial(e){if("fields"in e){const t={};for(const[n,a]of Object.entries(e.fields))t[n]=deepPartial(a);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=deepPartial(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(deepPartial)}):"optional"in e?e.optional():e}const deepHas=(e,t)=>{const n=[...propertyExprExports.normalizePath(t)];if(n.length===1)return n[0]in e;let a=n.pop(),s=propertyExprExports.getter(propertyExprExports.join(n),!0)(e);return!!(s&&a in s)};let isObject$5=e=>Object.prototype.toString.call(e)==="[object Object]";function unknown(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(a=>n.indexOf(a)===-1)}const defaultSort=sortByKeyOrder([]);function create$3(e){return new ObjectSchema(e)}class ObjectSchema extends Schema$1{constructor(t){super({type:"object",check(n){return isObject$5(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=defaultSort,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var a;let s=super._cast(t,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let o=this.fields,c=(a=n.stripUnknown)!=null?a:this.spec.noUnknown,f=[].concat(this._nodes,Object.keys(s).filter(z=>!this._nodes.includes(z))),y={},m=Object.assign({},n,{parent:y,__validating:n.__validating||!1}),g=!1;for(const z of f){let ie=o[z],re=z in s;if(ie){let he,_e=s[z];m.path=(n.path?`${n.path}.`:"")+z,ie=ie.resolve({value:_e,context:n.context,parent:y});let $e=ie instanceof Schema$1?ie.spec:void 0,pe=$e==null?void 0:$e.strict;if($e!=null&&$e.strip){g=g||z in s;continue}he=!n.__validating||!pe?ie.cast(s[z],m):s[z],he!==void 0&&(y[z]=he)}else re&&!c&&(y[z]=s[z]);(re!==z in y||y[z]!==s[z])&&(g=!0)}return g?y:s}_validate(t,n={},a,s){let{from:o=[],originalValue:c=t,recursive:f=this.spec.recursive}=n;n.from=[{schema:this,value:c},...o],n.__validating=!0,n.originalValue=c,super._validate(t,n,a,(y,m)=>{if(!f||!isObject$5(m)){s(y,m);return}c=c||m;let g=[];for(let z of this._nodes){let ie=this.fields[z];!ie||Reference.isRef(ie)||g.push(ie.asNestedTest({options:n,key:z,parent:m,parentPath:n.path,originalParent:c}))}this.runTests({tests:g,value:m,originalValue:c,options:n},a,z=>{s(z.sort(this._sortErrors).concat(y),m)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),a=n.fields;for(let[s,o]of Object.entries(this.fields)){const c=a[s];a[s]=c===void 0?o:c}return n.withMutation(s=>s.setFields(a,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(a=>{var s;const o=this.fields[a];let c=t;(s=c)!=null&&s.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[a]})),n[a]=o&&"getDefault"in o?o.getDefault(c):void 0}),n}setFields(t,n){let a=this.clone();return a.fields=t,a._nodes=sortFields(t,n),a._sortErrors=sortByKeyOrder(Object.keys(t)),n&&(a._excludedEdges=n),a}shape(t,n=[]){return this.clone().withMutation(a=>{let s=a._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...a._excludedEdges,...n]),a.setFields(Object.assign(a.fields,t),s)})}partial(){const t={};for(const[n,a]of Object.entries(this.fields))t[n]="optional"in a&&a.optional instanceof Function?a.optional():a;return this.setFields(t)}deepPartial(){return deepPartial(this)}pick(t){const n={};for(const a of t)this.fields[a]&&(n[a]=this.fields[a]);return this.setFields(n,this._excludedEdges.filter(([a,s])=>t.includes(a)&&t.includes(s)))}omit(t){const n=[];for(const a of Object.keys(this.fields))t.includes(a)||n.push(a);return this.pick(n)}from(t,n,a){let s=propertyExprExports.getter(t,!0);return this.transform(o=>{if(!o)return o;let c=o;return deepHas(o,t)&&(c=Object.assign({},o),a||delete c[t],c[n]=s(o)),c})}json(){return this.transform(parseJson)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||object$1.exact,test(n){if(n==null)return!0;const a=unknown(this.schema,n);return a.length===0||this.createError({params:{properties:a.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=object$1.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let a=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const o=unknown(this.schema,s);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return a.spec.noUnknown=t,a}unknown(t=!0,n=object$1.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const a={};for(const s of Object.keys(n))a[t(s)]=n[s];return a})}camelCase(){return this.transformKeys(tinyCaseExports.camelCase)}snakeCase(){return this.transformKeys(tinyCaseExports.snakeCase)}constantCase(){return this.transformKeys(t=>tinyCaseExports.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),a=super.describe(t);a.fields={};for(const[o,c]of Object.entries(n.fields)){var s;let f=t;(s=f)!=null&&s.value&&(f=Object.assign({},f,{parent:f.value,value:f.value[o]})),a.fields[o]=c.describe(f)}return a}}create$3.prototype=ObjectSchema.prototype;function create$2(e){return new ArraySchema(e)}class ArraySchema extends Schema$1{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const a=super._cast(t,n);if(!this._typeCheck(a)||!this.innerType)return a;let s=!1;const o=a.map((c,f)=>{const y=this.innerType.cast(c,Object.assign({},n,{path:`${n.path||""}[${f}]`}));return y!==c&&(s=!0),y});return s?o:a}_validate(t,n={},a,s){var o;let c=this.innerType,f=(o=n.recursive)!=null?o:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,a,(y,m)=>{var g;if(!f||!c||!this._typeCheck(m)){s(y,m);return}let z=new Array(m.length);for(let re=0;re<m.length;re++){var ie;z[re]=c.asNestedTest({options:n,index:re,parent:m,parentPath:n.path,originalParent:(ie=n.originalValue)!=null?ie:t})}this.runTests({value:m,tests:z,originalValue:(g=n.originalValue)!=null?g:t,options:n},a,re=>s(re.concat(y),m))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(parseJson)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!isSchema(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+printValue(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=array$1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(a){return a.length===this.resolve(t)}})}min(t,n){return n=n||array$1.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a.length>=this.resolve(t)}})}max(t,n){return n=n||array$1.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(a,s,o)=>!t(a,s,o):a=>!!a;return this.transform(a=>a!=null?a.filter(n):a)}describe(t){const n=(t?this.resolve(t):this).clone(),a=super.describe(t);if(n.innerType){var s;let o=t;(s=o)!=null&&s.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[0]})),a.innerType=n.innerType.describe(o)}return a}}create$2.prototype=ArraySchema.prototype;function create$4(e){return new Lazy(e)}function catchValidationError(e){try{return e()}catch(t){if(ValidationError.isError(t))return Promise.reject(t);throw t}}class Lazy{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(n,a={})=>{let s=this.builder(n,a);if(!isSchema(s))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(s=s.optional()),s.resolve(a)},this.builder=t,this.spec={meta:void 0,optional:!1}}clone(t){const n=new Lazy(this.builder);return n.spec=Object.assign({},this.spec,t),n}optionality(t){return this.clone({optional:t})}optional(){return this.optionality(!0)}resolve(t){return this._resolve(t.value,t)}cast(t,n){return this._resolve(t,n).cast(t,n)}asNestedTest(t){let{key:n,index:a,parent:s,options:o}=t,c=s[a??n];return this._resolve(c,Object.assign({},o,{value:c,parent:s})).asNestedTest(t)}validate(t,n){return catchValidationError(()=>this._resolve(t,n).validate(t,n))}validateSync(t,n){return this._resolve(t,n).validateSync(t,n)}validateAt(t,n,a){return catchValidationError(()=>this._resolve(n,a).validateAt(t,n,a))}validateSyncAt(t,n,a){return this._resolve(n,a).validateSyncAt(t,n,a)}isValid(t,n){try{return this._resolve(t,n).isValid(t,n)}catch(a){if(ValidationError.isError(a))return Promise.resolve(!1);throw a}}isValidSync(t,n){return this._resolve(t,n).isValidSync(t,n)}describe(t){return t?this.resolve(t).describe(t):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await t.validate(a,{abortEarly:!1})}}catch(s){if(ValidationError.isError(s))return{issues:issuesFromValidationError(s)};throw s}}}}}const configValidator=create$3().noUnknown().shape({client:create$3().noUnknown().shape({logo:create$6(),name:create$6()}),entrypoint:create$3().noUnknown().shape({account:create$6(),country:create$6(),credential:create$6(),site:create$6(),siteOrganizationType:create$6(),updateCredential:create$6()}),locale:create$6().oneOf(["es","en"]),navigation:create$3().noUnknown().shape({disableFormAutocomplete:create$7(),displayAccountsSelection:create$7(),displayBusinessSites:create$7(),displayCredentialInModal:create$7(),displayErrorsInToast:create$7(),displayLogoImages:create$7(),displayLongDescription:create$7(),displayPersonalSites:create$7(),displayPrivacyScreen:create$7(),displaySiteOrganizations:create$2().of(create$6()),displaySiteOrganizationTypes:create$2().of(create$6()),displaySites:create$2().of(create$6()),displayStatusInToast:create$7(),enableBackNavigation:create$7(),enableTwofaBackNavigation:create$7(),formButtonsDisabledStyle:create$7(),formShowPasswordStyle:create$6().oneOf(["icon","none","text"]),getSelectedAccounts:create$8().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),hideSelectCountry:create$7(),hideSiteOrganizations:create$2().of(create$6()),hideSiteOrganizationTypes:create$2().of(create$6()),hideSites:create$2().of(create$6()),oneSiteFlow:create$7(),quickAnswer:create$7(),returnToSiteFormOnUserError:create$4(e=>typeof e=="object"?create$2().of(create$5().oneOf([401,403,411])):create$7()),saveCredential:create$7(),selectClass:create$6(),socketTimeout:create$5().min(1),toastDuration:create$5().min(0),toastPosition:create$6().oneOf(["bottom-left","bottom-right","top-left","top-right"])}),__internal__:create$3().noUnknown().shape({apiBaseUrl:create$6(),apiEnv:create$6().oneOf(["development","production"]),assetsBaseUrl:create$6(),plaidSites:create$7(),defaultHttpParams:create$3()})}),paramsValidator=create$3().shape({token:create$6().required(),element:create$4(e=>{switch(typeof e){case"string":return create$6().test("isElement","${path} is not an Element",t=>{if(!document.querySelector(t))throw new ValidationError(`Invalid selector: Element "${t}" not found.`);return!0});case"object":return create$3().test("isElement","${path} is not an Element",t=>{if(!isElement$1(t))throw new ValidationError("Invalid element: Object should be a valid HtmlElement.");return!0});default:return create$6()}}),refreshTokenFunction:create$8().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),enableTestMode:create$7(),strict:create$3().noUnknown().nullable().shape({authorization:create$3().noUnknown().required().shape({type:create$6().oneOf(["jwk"]).required(),key:create$6().required()}),body:create$3().noUnknown().required().shape({type:create$6().oneOf(["jwk"]).required(),key:create$6().required().test("isBase64","${path} is not a base64 encoded",e=>e&&/^(?:[A-Za-z0-9+/]{2}[A-Za-z0-9+/]{2})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))})}),config:configValidator}).strict().noUnknown();let __VERSION__={git:{hash:"g532aa80",distance:0,tag:"v1.4.0"}};function getVersion(){let e=`${__VERSION__.git.tag}.${__VERSION__.git.distance}`;return e=`${e}-${__VERSION__.git.hash}`,e}function getBridgeData(e,t){const n=parseInt("0x4",16),a="38060000000000000000000000000000000000000000000F00000000000000000000000000000000000D9802010000010101000000000000";let s;return getBridgeScripts$2().then(()=>(s=new digipass.nativebridge.DP110,new Promise((c,f)=>{s.onError(()=>f("bridge.not_ready")),s.onReady(y=>{if(y.versionCode<s.versionCode&&f("bridge.host_update_available"),s.isReady())s.getTokenInfo(n,function(g){if(g.returnCode!==0)return f(`bridge.${Math.abs(g.returnCode)}`);s.generateOTP(a,t,function(z){if(z.returnCode!==0)return f(`bridge.${Math.abs(z.returnCode)}`);c({token:`${e}XX${z.otp}XX${g.info}XX${y.versionCode}`,challenge:t})})});else return Promise.reject("bridge.not_ready")})})))}function getBridgeScripts$2(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeUsb"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeUsb"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dp110.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}function generateResponseOnlyOTP(){const e=window.bridgeBluetooth;if(e.timeoutValidation=!1,e.cryptoAppOTP=7,!e.bridge.isReady()){e.bridge.reconnect();return}clearTimeout(e.varSetTime),e.bridge.generateResponseOnlyOTP(e.cryptoAppOTP,function(t){t.returnCode!=0?(t.returnCode==-6014||t.returnCode==-6015||t.returnCode==-6016)&&turnOn(!1,!1):e.timeoutValidation||(e.validOTP=!0,e.valFinalFlow=!0,e.token=t.otp,e.acceptB?sendRequestDP785():(otpDP785ConnectedServices(),otpDP785Connected()))})}function getBridgeBluetoothFakeToken(e){const t=window.bridgeBluetooth;return new Promise((n,a)=>{t.resolve=n,t.reject=a,getSetTimeRequest(e)})}function getBridgeBluetoothFinalToken(e){const t=window.bridgeBluetooth;return new Promise((n,a)=>{t.resolve=n,t.reject=a,getChallengeResponseRequestContinue(e)})}function getBridgeBluetoothTimeChallengeV1(e,t){window.bridgeBluetooth={acceptB:null,accesLogin:!0,bridge:null,cancelB:!1,cancelB2:!1,changeIdNameOtp:!1,claveInsSegOTP:null,contNB:2,contNBReady:0,contNBVersion:0,cryptoAppOTP:null,digipassSerial:null,eai_firma_DP110:null,eai_serial_DP110:null,isChequeLineaOrSAT:null,jspDesafio:t,jspToken:e,nbProcessIsComplete:!1,resolve:null,reject:null,setTimeReady:!1,switchState:!0,timeoutValidation:!1,token:"",valFinalFlow:!1,validOTP:!1,varSetTime:null,versionCode:null};const n=window.bridgeBluetooth;return getBridgeScripts$1().then(()=>new Promise((s,o)=>{n.resolve=s,n.reject=o,initNativeBrigde()}))}function getBridgeScripts$1(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeBluetooth"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeBluetooth"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dptoken.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}function getChallengeResponseRequest(){const e=window.bridgeBluetooth;e.accesLogin&&(e.cancelB||(e.valFinalFlow=!0,e.token="********",e.resolve(e.token)),e.accesLogin=!1)}function getChallengeResponseRequestContinue(e){const t=window.bridgeBluetooth,n=JSON.parse(e);n.estado!=="OK"||t.cancelB2||processRequestMessage(n.requestMessage)}function getSetTimeRequest(e){const t=JSON.parse(e);t.estado!=="OK"||processRequestMessageSetTime(t.requestMessage)}function initializeDigipass$1(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.initializeDigipass(e.digipassSerial,function(t){t.returnCode!=0||e.bridge.getDigipassTimeChallenge(function(n){n.returnCode!=0?timeEvents(function(){e.switchState&&listDigipass()},5e3,"timeOut"):(clearTimeout(e.varSetTime),e.timeoutValidation=!1,e.setTimeReady?getChallengeResponseRequest():setDPTime())})})}function initNativeBrigde(){const e=window.bridgeBluetooth;try{e.bridge=new digipass.nativebridge.DPToken,e.bridge.getDigipassTimeChallenge(function(){turnOn(!0,!1)}),e.bridge.onError(function(){e.contNB++,e.nbProcessIsComplete||e.contNB<=4&&(e.accesLogin?e.bridge.reconnect():e.bridge.getDigipassTimeChallenge(function(){}))}),e.bridge.onReady(function(){clearTimeout(e.varSetTime),e.contNB=0,e.contNBReady===0&&(e.validOTP||(timeEvents(function(){e.timeoutValidation=!0},3e4,"timeOut"),e.switchState&&listDigipass()),e.contNBReady++)})}catch(t){e.reject(t)}}function listDigipass(){const e=window.bridgeBluetooth;if(e.digipassSerial=null,!e.bridge.isReady()){e.bridge.reconnect();return}if(e.contNBVersion===0&&e.bridge.getNativeBridgeVersion(function(t){e.versionCode=t.versionCode,e.contNBVersion++}),!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassList(function(t){e.timeoutValidation||t.returnCode!=0||(t.devices.length==0?e.switchState&&listDigipass():(t.devices.forEach(n=>{n.digipassSerial===e.jspToken&&(e.digipassSerial=n.digipassSerial,e.jspDesafio!=="null"&&(e.eai_serial_DP110=e.jspToken))}),e.digipassSerial===null?e.switchState&&listDigipass():e.timeoutValidation||initializeDigipass$1()))})}function otpDP785Connected(){const e=window.bridgeBluetooth;if(e.switchState){let t="";e.token!==void 0?(t=e.token,e.token=t+e.cryptoAppOTP):(t=e.claveInsSegOTP,e.claveInsSegOTP=t+e.cryptoAppOTP)}e.resolve(`${e.token}XX${e.eai_firma_DP110}XX${e.eai_serial_DP110}XX${e.versionCode}`)}function otpDP785ConnectedServices(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!0}function otpDP785DisconnectedServices(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!1}function parseResponseMessage(e,t){const n=window.bridgeBluetooth;if(!n.bridge.isReady()){n.bridge.reconnect();return}n.bridge.parseResponseMessage(e,t,function(a){a.returnCode!=0?(a.returnCode==-6014||a.returnCode==-6015||a.returnCode==-6016)&&turnOn(!1,!1):n.timeoutValidation||(n.validOTP=!0,n.jspDesafio!=="null"&&(n.eai_firma_DP110=a.messageSignature),generateResponseOnlyOTP())})}function parseResponseMessageSetTime(e,t){const n=window.bridgeBluetooth;if(!n.bridge.isReady()){n.bridge.reconnect();return}n.bridge.parseResponseMessage(e,t,function(a){a.returnCode!=0||(n.setTimeReady=!0,getChallengeResponseRequest())})}function processRequestMessage(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(n){n.returnCode!=0||parseResponseMessage(n.responseMessage,e)})}function processRequestMessageSetTime(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(n){n.returnCode!=0||parseResponseMessageSetTime(n.responseMessage,e)})}function sendRequestDP785(){const e=window.bridgeBluetooth;clearTimeout(e.varSetTime),otpDP785Connected()}function setDPTime(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassTimeChallenge(function(t){t.returnCode!=0||e.resolve(t.timeChallenge)})}function timeEvents(e,t,n){const a=window.bridgeBluetooth;switch(n){case"timeOut":a.varSetTime=setTimeout(e,t);break;case"interval":setInterval(e,t);break}}function turnOn(e,t){const n=window.bridgeBluetooth,a="";if(n.timeoutValidation=!1,n.acceptB=t,clearTimeout(n.varSetTime),n.token.length!=8&&!t&&(n.validOTP=!1),t||(n.switchState=e),e)if(n.contNBVersion=0,n.valFinalFlow=!1,t||(n.accesLogin=!0,n.cancelB=!1),n.validOTP)sendRequestDP785(),n.valFinalFlow=!0;else{if(n.contNBVersion=0,n.cancelB2=!1,n.contNB=2,t||(n.token=a),n.bridge===void 0&&initNativeBrigde(),!n.bridge.isReady()){n.bridge.reconnect();return}clearTimeout(n.varSetTime),timeEvents(function(){n.timeoutValidation=!0},3e4,"timeOut"),n.contNBReady!==0?listDigipass():n.bridge.reconnect()}else clearTimeout(n.varSetTime),n.validOTP=!0,n.cancelB=!0,n.cancelB2=!0,otpDP785DisconnectedServices(),n.claveInsSegOTP=a,n.token=a}function turnOnBridgeBluetoothBeforeSendingTwofa(){turnOn(!0,!0)}const appStateWindowProperty="bridgeBluetooth";function continueDPToken(e){const t=window[appStateWindowProperty];return new Promise((a,s)=>{t.resolve=a,t.reject=s;let o,c;const{authenticationData:f}=e.authenticationResponse;f[0].idAuthenticationData==="signedMessage"?([o]=f[0].authenticationData,[c]=f[1].authenticationData):([o]=f[1].authenticationData,[c]=f[0].authenticationData),secondPartDPToken({signedMessage:o,signedTimeMessage:c})})}async function generateTimeChallenge(){const e=window[appStateWindowProperty];return new Promise(async(t,n)=>{if(e.nativeBridgeInstance.isReady())try{const a=await async function(s){return new Promise((o,c)=>{s.getDigipassTimeChallenge(f=>{if(f.returnCode!==0){const m={title:"Generar - TimeChallenge",response:{message:"Se ha producido un error al generar el TimeChallenge. Por favor, asegúrate de tener tu token conectado y encendido.",returnCode:f.returnCode}};return void c(m)}const y={title:"Generar - TimeChallenge",response:{message:`El TimeChallenge es: ${f.timeChallenge}`,timeChallenge:f.timeChallenge,errorCode:""}};o(y)})})}(e.nativeBridgeInstance);t(a)}catch(a){n(a)}else n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:""}})})}function getBridgeBluetoothTimeChallengeV2(e){window[appStateWindowProperty]={isDp785Signature:!1,nativeBridgeInstance:null,resolve:null,reject:null};const t=window[appStateWindowProperty];return getBridgeScripts().then(()=>new Promise((a,s)=>{t.resolve=a,t.reject=s,t.isDp785Signature=e!=="214",t.nativeBridgeInstance=new window.digipass.nativebridge.DPToken,onProcessDPToken()}))}function getBridgeScripts(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","undefineddigipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeBluetooth"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeBluetooth"),s.setAttribute("src","undefineddigipass.nativebridge.dptoken.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}async function initDPToken(){const e=window[appStateWindowProperty];try{const t=await initializeDevice(e.isDp785Signature);if(t.length===1){const[n]=t;await initializeDigipass(n.serial);const a=await generateTimeChallenge();e.resolve(a.response.timeChallenge)}}catch(t){e.reject(t),alert("Por favor, asegúrate de tener tu token conectado y encendido.")}}async function initializeDevice(e){const t=window[appStateWindowProperty];return new Promise(async(n,a)=>{const s=e?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(t.nativeBridgeInstance.isReady())try{const o=await async function(y){return new Promise((m,g)=>{y.getDigipassList(z=>{if(z.returnCode===0)m(z.devices);else{const ie={title:"Listar dispositivos",response:{message:"Error al obtener la lista de dispositivos disponibles.",returnCode:z.returnCode}};g(ie)}})})}(t.nativeBridgeInstance),c=o.map(y=>({name:y.deviceName,serial:y.digipassSerial})),[f]=c;if(!f||!f.serial)return void a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:s}});n(c)}catch(o){a(o)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:s}})})}async function initializeDigipass(e){const t=window[appStateWindowProperty];return new Promise((n,a)=>{t.nativeBridgeInstance.initializeDigipass(e,s=>{if(s.returnCode!==0){const c={title:"Inicializar dispositivo",response:{message:"Error al intentar inicializar el dispositivo.",returnCode:s.returnCode}};return void a(c)}const o={title:"Inicializar dispositivo",response:{message:`El dispositivo con serial: ${e} está listo para ser usado.`,errorCode:""}};n(o)})})}async function generateResponseOnlyOTPBridge(e){const t=window[appStateWindowProperty];return new Promise(async(n,a)=>{if(t.nativeBridgeInstance.isReady())try{const s=await async function(o,c){return new Promise((f,y)=>{o.generateResponseOnlyOTP(c,m=>{if(m.returnCode!==0){const z={title:"Generar OTP con PIN",response:{message:"No fue posible generar la OTP.",returnCode:m.returnCode}};return void y(z)}const g={title:"Generar OTP con PIN",response:{message:`La OTP se generó correctamente: ${m.otp}`,otp:m.otp,errorCode:"",processType:"DP785_T4_LINKED"}};f(g)})})}(t.nativeBridgeInstance,e);n(s)}catch(s){a(s)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:"DP785_T4_NOT_LINKED"}})})}async function onProcessDPToken(){const e=window[appStateWindowProperty],t=await startNativeBridgeValidation();if(t.response.errorCode!==""){alert(t.response.message),e.reject(t.response.errorCode);return}else await initDPToken()}async function secondPartDPToken({signedMessage:e="",signedTimeMessage:t=""}){const n=window[appStateWindowProperty];try{await transmitRequestMessageBridge(t,n.isDp785Signature);const a=await transmitRequestMessageBridge(e,n.isDp785Signature),{response:{messageSignature:s}}=a,o=7,c=await generateResponseOnlyOTPBridge(o),{response:{otp:f}}=c,y={};y.otpChallenge=s;const m=`${f}${o}`;y.otp=m,n.resolve(`${y.otpChallenge}XX${y.otp}`)}catch(a){n.reject(a),alert("Error al intentar validar la sesión desde el dispositivo de acceso seguro.")}}async function startNativeBridgeValidation(){const e=window[appStateWindowProperty];return new Promise((t,n)=>{e.nativeBridgeInstance.onReady(()=>{e.nativeBridgeInstance.getNativeBridgeVersion(a=>{const s={title:"Conexión con Native Bridge",response:{errorCode:"",message:"El software Native Bridge se encuentra instalado en tu ordenador.",updateAvailable:!(a.versionCode>=e.nativeBridgeInstance.versionCode)}};t(s)})}),e.nativeBridgeInstance.onError(()=>{n({title:"Conexión con Native Bridge",response:{errorCode:"222",message:"El software Native Bridge no se encontró instalado en tu ordenador.",processType:"DP785_T4_NOT_LINKED"}})})})}async function transmitRequestMessageBridge(e,t){const n=window[appStateWindowProperty];return new Promise(async(a,s)=>{const o=t?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(n.nativeBridgeInstance.isReady())try{const{responseMessage:c}=await async function(y,m){return new Promise((g,z)=>{y.transmitRequestMessage(m,ie=>{if(ie.returnCode===0)g(ie);else{const re={title:"Firmar mensaje",response:{message:"No fue posible transmitir el mensaje.",returnCode:ie.returnCode}};z(re)}})})}(n.nativeBridgeInstance,e),f=await async function(y,m,g){return new Promise((z,ie)=>{y.parseResponseMessage(m,g,re=>{if(re.returnCode!==0){const _e={title:"Firmar mensaje",response:{message:"No fue posible parsear el mensaje.",returnCode:re.returnCode}};return void ie(_e)}const he={title:"Firmar mensaje",response:{message:`Se realizó la firma del mensaje correctamente: ${re.messageSignature}`,messageSignature:re.messageSignature,errorCode:"",processType:"DP785_T4_LINKED"}};z(he)})})}(n.nativeBridgeInstance,c,e);a(f)}catch(c){s(c)}else s({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:o}})})}const DOWNLOAD_OPTIONS_ACTIVE={enables:["download_options"],name:"download_options_active",required:!1,translate_label:"download_options.switch",type:"switch",validation:null},DOWNLOAD_OPTIONS={name:"download_options",required:!1,enabled_by:"download_options_active",translate_error_label:"download_options.label",type:"date_range",validation:null},DOWNLOAD_OPTIONS_SITES=["56cf5728784806f72b8b456f","5da784f1f9de2a06483abec1"];var buffer$2={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var a=n===t?0:4-n%4;return[n,a]}function byteLength(e){var t=getLens(e),n=t[0],a=t[1];return(n+a)*3/4-a}function _byteLength(e,t,n){return(t+n)*3/4-n}function toByteArray(e){var t,n=getLens(e),a=n[0],s=n[1],o=new Arr(_byteLength(e,a,s)),c=0,f=s>0?a-4:a,y;for(y=0;y<f;y+=4)t=revLookup[e.charCodeAt(y)]<<18|revLookup[e.charCodeAt(y+1)]<<12|revLookup[e.charCodeAt(y+2)]<<6|revLookup[e.charCodeAt(y+3)],o[c++]=t>>16&255,o[c++]=t>>8&255,o[c++]=t&255;return s===2&&(t=revLookup[e.charCodeAt(y)]<<2|revLookup[e.charCodeAt(y+1)]>>4,o[c++]=t&255),s===1&&(t=revLookup[e.charCodeAt(y)]<<10|revLookup[e.charCodeAt(y+1)]<<4|revLookup[e.charCodeAt(y+2)]>>2,o[c++]=t>>8&255,o[c++]=t&255),o}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,t,n){for(var a,s=[],o=t;o<n;o+=3)a=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),s.push(tripletToBase64(a));return s.join("")}function fromByteArray(e){for(var t,n=e.length,a=n%3,s=[],o=16383,c=0,f=n-a;c<f;c+=o)s.push(encodeChunk(e,c,c+o>f?f:c+o));return a===1?(t=e[n-1],s.push(lookup[t>>2]+lookup[t<<4&63]+"==")):a===2&&(t=(e[n-2]<<8)+e[n-1],s.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),s.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(e,t,n,a,s){var o,c,f=s*8-a-1,y=(1<<f)-1,m=y>>1,g=-7,z=n?s-1:0,ie=n?-1:1,re=e[t+z];for(z+=ie,o=re&(1<<-g)-1,re>>=-g,g+=f;g>0;o=o*256+e[t+z],z+=ie,g-=8);for(c=o&(1<<-g)-1,o>>=-g,g+=a;g>0;c=c*256+e[t+z],z+=ie,g-=8);if(o===0)o=1-m;else{if(o===y)return c?NaN:(re?-1:1)*(1/0);c=c+Math.pow(2,a),o=o-m}return(re?-1:1)*c*Math.pow(2,o-a)},ieee754.write=function(e,t,n,a,s,o){var c,f,y,m=o*8-s-1,g=(1<<m)-1,z=g>>1,ie=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,re=a?0:o-1,he=a?1:-1,_e=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,c=g):(c=Math.floor(Math.log(t)/Math.LN2),t*(y=Math.pow(2,-c))<1&&(c--,y*=2),c+z>=1?t+=ie/y:t+=ie*Math.pow(2,1-z),t*y>=2&&(c++,y/=2),c+z>=g?(f=0,c=g):c+z>=1?(f=(t*y-1)*Math.pow(2,s),c=c+z):(f=t*Math.pow(2,z-1)*Math.pow(2,s),c=0));s>=8;e[n+re]=f&255,re+=he,f/=256,s-=8);for(c=c<<s|f,m+=s;m>0;e[n+re]=c&255,re+=he,c/=256,m-=8);e[n+re-he]|=_e*128};/*!
|
|
679
|
+
`+(f!==c?`result of cast: ${f}`:""))}return o}_cast(t,n){let a=t===void 0?t:this.transforms.reduce((s,o)=>o.call(this,s,t,this),t);return a===void 0&&(a=this.getDefault(n)),a}_validate(t,n={},a,s){let{path:o,originalValue:c=t,strict:f=this.spec.strict}=n,y=t;f||(y=this._cast(y,Object.assign({assert:!1},n)));let m=[];for(let g of Object.values(this.internalTests))g&&m.push(g);this.runTests({path:o,value:y,originalValue:c,options:n,tests:m},a,g=>{if(g.length)return s(g,y);this.runTests({path:o,value:y,originalValue:c,options:n,tests:this.tests},a,s)})}runTests(t,n,a){let s=!1,{tests:o,value:c,originalValue:f,path:y,options:m}=t,g=_e=>{s||(s=!0,n(_e,c))},z=_e=>{s||(s=!0,a(_e,c))},ie=o.length,re=[];if(!ie)return z([]);let he={value:c,originalValue:f,path:y,options:m,schema:this};for(let _e=0;_e<o.length;_e++){const $e=o[_e];$e(he,g,function(Ce){Ce&&(Array.isArray(Ce)?re.push(...Ce):re.push(Ce)),--ie<=0&&z(re)})}}asNestedTest({key:t,index:n,parent:a,parentPath:s,originalParent:o,options:c}){const f=t??n;if(f==null)throw TypeError("Must include `key` or `index` for nested validations");const y=typeof f=="number";let m=a[f];const g=Object.assign({},c,{strict:!0,parent:a,value:m,originalValue:o[f],key:void 0,[y?"index":"key"]:f,path:y||f.includes(".")?`${s||""}[${y?f:`"${f}"`}]`:(s?`${s}.`:"")+t});return(z,ie,re)=>this.resolve(g)._validate(m,g,ie,re)}validate(t,n){var a;let s=this.resolve(Object.assign({},n,{value:t})),o=(a=n==null?void 0:n.disableStackTrace)!=null?a:s.spec.disableStackTrace;return new Promise((c,f)=>s._validate(t,n,(y,m)=>{ValidationError.isError(y)&&(y.value=m),f(y)},(y,m)=>{y.length?f(new ValidationError(y,m,void 0,void 0,o)):c(m)}))}validateSync(t,n){var a;let s=this.resolve(Object.assign({},n,{value:t})),o,c=(a=n==null?void 0:n.disableStackTrace)!=null?a:s.spec.disableStackTrace;return s._validate(t,Object.assign({},n,{sync:!0}),(f,y)=>{throw ValidationError.isError(f)&&(f.value=y),f},(f,y)=>{if(f.length)throw new ValidationError(f,t,void 0,void 0,c);o=y}),o}isValid(t,n){return this.validate(t,n).then(()=>!0,a=>{if(ValidationError.isError(a))return!1;throw a})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(a){if(ValidationError.isError(a))return!1;throw a}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):clone$1(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const a=this.clone({nullable:t});return a.internalTests.nullable=createValidation({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),a}optionality(t,n){const a=this.clone({optional:t});return a.internalTests.optionality=createValidation({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),a}optional(){return this.optionality(!0)}defined(t=mixed.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=mixed.notNull){return this.nullability(!1,t)}required(t=mixed.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=mixed.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let a=this.clone(),s=createValidation(n),o=n.exclusive||n.name&&a.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(a.exclusiveTests[n.name]=!!n.exclusive),a.tests=a.tests.filter(c=>!(c.OPTIONS.name===n.name&&(o||c.OPTIONS.test===s.OPTIONS.test))),a.tests.push(s),a}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let a=this.clone(),s=toArray$1(t).map(o=>new Reference(o));return s.forEach(o=>{o.isSibling&&a.deps.push(o.key)}),a.conditions.push(typeof n=="function"?new Condition(s,n):Condition.fromOptions(s,n)),a}typeError(t){let n=this.clone();return n.internalTests.typeError=createValidation({message:t,name:"typeError",skipAbsent:!0,test(a){return this.schema._typeCheck(a)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=mixed.oneOf){let a=this.clone();return t.forEach(s=>{a._whitelist.add(s),a._blacklist.delete(s)}),a.internalTests.whiteList=createValidation({message:n,name:"oneOf",skipAbsent:!0,test(s){let o=this.schema._whitelist,c=o.resolveAll(this.resolve);return c.includes(s)?!0:this.createError({params:{values:Array.from(o).join(", "),resolved:c}})}}),a}notOneOf(t,n=mixed.notOneOf){let a=this.clone();return t.forEach(s=>{a._blacklist.add(s),a._whitelist.delete(s)}),a.internalTests.blacklist=createValidation({message:n,name:"notOneOf",test(s){let o=this.schema._blacklist,c=o.resolveAll(this.resolve);return c.includes(s)?this.createError({params:{values:Array.from(o).join(", "),resolved:c}}):!0}}),a}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:a,meta:s,optional:o,nullable:c}=n.spec;return{meta:s,label:a,optional:o,nullable:c,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((y,m,g)=>g.findIndex(z=>z.OPTIONS.name===y.OPTIONS.name)===m).map(y=>{const m=y.OPTIONS.params&&t?resolveParams(Object.assign({},y.OPTIONS.params),t):y.OPTIONS.params;return{name:y.OPTIONS.name,params:m}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await t.validate(a,{abortEarly:!1})}}catch(s){if(s instanceof ValidationError)return{issues:issuesFromValidationError(s)};throw s}}}}};Schema$1.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Schema$1.prototype[`${e}At`]=function(t,n,a={}){const{parent:s,parentPath:o,schema:c}=getIn(this,t,n,a.context);return c[e](s&&s[o],Object.assign({},a,{parent:s,path:t}))};for(const e of["equals","is"])Schema$1.prototype[e]=Schema$1.prototype.oneOf;for(const e of["not","nope"])Schema$1.prototype[e]=Schema$1.prototype.notOneOf;const returnsTrue=()=>!0;function create$8(e){return new MixedSchema(e)}class MixedSchema extends Schema$1{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:returnsTrue},t))}}create$8.prototype=MixedSchema.prototype;function create$7(){return new BooleanSchema}class BooleanSchema extends Schema$1{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(a.spec.coerce&&!a.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(n){return isAbsent(n)||n===!0}})}isFalse(t=boolean.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(n){return isAbsent(n)||n===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}create$7.prototype=BooleanSchema.prototype;const isoReg=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function parseIsoDate(e){const t=parseDateStruct(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function parseDateStruct(e){var t,n;const a=isoReg.exec(e);return a?{year:toNumber$2(a[1]),month:toNumber$2(a[2],1)-1,day:toNumber$2(a[3],1),hour:toNumber$2(a[4]),minute:toNumber$2(a[5]),second:toNumber$2(a[6]),millisecond:a[7]?toNumber$2(a[7].substring(0,3)):0,precision:(t=(n=a[7])==null?void 0:n.length)!=null?t:void 0,z:a[8]||void 0,plusMinus:a[9]||void 0,hourOffset:toNumber$2(a[10]),minuteOffset:toNumber$2(a[11])}:null}function toNumber$2(e,t=0){return Number(e)||t}let rEmail=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rUrl=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,rUUID=/^(?:[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,yearMonthDay="^\\d{4}-\\d{2}-\\d{2}",hourMinuteSecond="\\d{2}:\\d{2}:\\d{2}",zOrOffset="(([+-]\\d{2}(:?\\d{2})?)|Z)",rIsoDateTime=new RegExp(`${yearMonthDay}T${hourMinuteSecond}(\\.\\d+)?${zOrOffset}$`),isTrimmed=e=>isAbsent(e)||e===e.trim(),objStringTag={}.toString();function create$6(){return new StringSchema}class StringSchema extends Schema$1{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(!a.spec.coerce||a.isType(t)||Array.isArray(t))return t;const s=t!=null&&t.toString?t.toString():t;return s===objStringTag?t:s})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||mixed.required,name:"required",skipAbsent:!0,test:a=>!!a.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=string$1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(a){return a.length===this.resolve(t)}})}min(t,n=string$1.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a.length>=this.resolve(t)}})}max(t,n=string$1.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(a){return a.length<=this.resolve(t)}})}matches(t,n){let a=!1,s,o;return n&&(typeof n=="object"?{excludeEmptyString:a=!1,message:s,name:o}=n:s=n),this.test({name:o||"matches",message:s||string$1.matches,params:{regex:t},skipAbsent:!0,test:c=>c===""&&a||c.search(t)!==-1})}email(t=string$1.email){return this.matches(rEmail,{name:"email",message:t,excludeEmptyString:!0})}url(t=string$1.url){return this.matches(rUrl,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=string$1.uuid){return this.matches(rUUID,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",a,s;return t&&(typeof t=="object"?{message:n="",allowOffset:a=!1,precision:s=void 0}=t:n=t),this.matches(rIsoDateTime,{name:"datetime",message:n||string$1.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||string$1.datetime_offset,params:{allowOffset:a},skipAbsent:!0,test:o=>{if(!o||a)return!0;const c=parseDateStruct(o);return c?!!c.z:!1}}).test({name:"datetime_precision",message:n||string$1.datetime_precision,params:{precision:s},skipAbsent:!0,test:o=>{if(!o||s==null)return!0;const c=parseDateStruct(o);return c?c.precision===s:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=string$1.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:isTrimmed})}lowercase(t=string$1.lowercase){return this.transform(n=>isAbsent(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>isAbsent(n)||n===n.toLowerCase()})}uppercase(t=string$1.uppercase){return this.transform(n=>isAbsent(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>isAbsent(n)||n===n.toUpperCase()})}}create$6.prototype=StringSchema.prototype;let isNaN$1=e=>e!=+e;function create$5(){return new NumberSchema}class NumberSchema extends Schema$1{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!isNaN$1(t)}}),this.withMutation(()=>{this.transform((t,n,a)=>{if(!a.spec.coerce)return t;let s=t;if(typeof s=="string"){if(s=s.replace(/\s/g,""),s==="")return NaN;s=+s}return a.isType(s)||s===null?s:parseFloat(s)})})}min(t,n=number$2.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(t)}})}max(t,n=number$2.max){return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(t)}})}lessThan(t,n=number$2.lessThan){return this.test({message:n,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(a){return a<this.resolve(t)}})}moreThan(t,n=number$2.moreThan){return this.test({message:n,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(a){return a>this.resolve(t)}})}positive(t=number$2.positive){return this.moreThan(0,t)}negative(t=number$2.negative){return this.lessThan(0,t)}integer(t=number$2.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:n=>Number.isInteger(n)})}truncate(){return this.transform(t=>isAbsent(t)?t:t|0)}round(t){var n;let a=["ceil","floor","round","trunc"];if(t=((n=t)==null?void 0:n.toLowerCase())||"round",t==="trunc")return this.truncate();if(a.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+a.join(", "));return this.transform(s=>isAbsent(s)?s:Math[t](s))}}create$5.prototype=NumberSchema.prototype;let invalidDate=new Date(""),isDate$3=e=>Object.prototype.toString.call(e)==="[object Date]";class DateSchema extends Schema$1{constructor(){super({type:"date",check(t){return isDate$3(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,a)=>!a.spec.coerce||a.isType(t)||t===null?t:(t=parseIsoDate(t),isNaN(t)?DateSchema.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let a;if(Reference.isRef(t))a=t;else{let s=this.cast(t);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);a=s}return a}min(t,n=date$1.min){let a=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(a)}})}max(t,n=date$1.max){let a=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(a)}})}}DateSchema.INVALID_DATE=invalidDate;function sortFields(e,t=[]){let n=[],a=new Set,s=new Set(t.map(([c,f])=>`${c}-${f}`));function o(c,f){let y=propertyExprExports.split(c)[0];a.add(y),s.has(`${f}-${y}`)||n.push([f,y])}for(const c of Object.keys(e)){let f=e[c];a.add(c),Reference.isRef(f)&&f.isSibling?o(f.path,c):isSchema(f)&&"deps"in f&&f.deps.forEach(y=>o(y,c))}return toposort.array(Array.from(a),n).reverse()}function findIndex(e,t){let n=1/0;return e.some((a,s)=>{var o;if((o=t.path)!=null&&o.includes(a))return n=s,!0}),n}function sortByKeyOrder(e){return(t,n)=>findIndex(e,t)-findIndex(e,n)}const parseJson=(e,t,n)=>{if(typeof e!="string")return e;let a=e;try{a=JSON.parse(e)}catch{}return n.isType(a)?a:e};function deepPartial(e){if("fields"in e){const t={};for(const[n,a]of Object.entries(e.fields))t[n]=deepPartial(a);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=deepPartial(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(deepPartial)}):"optional"in e?e.optional():e}const deepHas=(e,t)=>{const n=[...propertyExprExports.normalizePath(t)];if(n.length===1)return n[0]in e;let a=n.pop(),s=propertyExprExports.getter(propertyExprExports.join(n),!0)(e);return!!(s&&a in s)};let isObject$5=e=>Object.prototype.toString.call(e)==="[object Object]";function unknown(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(a=>n.indexOf(a)===-1)}const defaultSort=sortByKeyOrder([]);function create$3(e){return new ObjectSchema(e)}class ObjectSchema extends Schema$1{constructor(t){super({type:"object",check(n){return isObject$5(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=defaultSort,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var a;let s=super._cast(t,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let o=this.fields,c=(a=n.stripUnknown)!=null?a:this.spec.noUnknown,f=[].concat(this._nodes,Object.keys(s).filter(z=>!this._nodes.includes(z))),y={},m=Object.assign({},n,{parent:y,__validating:n.__validating||!1}),g=!1;for(const z of f){let ie=o[z],re=z in s;if(ie){let he,_e=s[z];m.path=(n.path?`${n.path}.`:"")+z,ie=ie.resolve({value:_e,context:n.context,parent:y});let $e=ie instanceof Schema$1?ie.spec:void 0,pe=$e==null?void 0:$e.strict;if($e!=null&&$e.strip){g=g||z in s;continue}he=!n.__validating||!pe?ie.cast(s[z],m):s[z],he!==void 0&&(y[z]=he)}else re&&!c&&(y[z]=s[z]);(re!==z in y||y[z]!==s[z])&&(g=!0)}return g?y:s}_validate(t,n={},a,s){let{from:o=[],originalValue:c=t,recursive:f=this.spec.recursive}=n;n.from=[{schema:this,value:c},...o],n.__validating=!0,n.originalValue=c,super._validate(t,n,a,(y,m)=>{if(!f||!isObject$5(m)){s(y,m);return}c=c||m;let g=[];for(let z of this._nodes){let ie=this.fields[z];!ie||Reference.isRef(ie)||g.push(ie.asNestedTest({options:n,key:z,parent:m,parentPath:n.path,originalParent:c}))}this.runTests({tests:g,value:m,originalValue:c,options:n},a,z=>{s(z.sort(this._sortErrors).concat(y),m)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),a=n.fields;for(let[s,o]of Object.entries(this.fields)){const c=a[s];a[s]=c===void 0?o:c}return n.withMutation(s=>s.setFields(a,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(a=>{var s;const o=this.fields[a];let c=t;(s=c)!=null&&s.value&&(c=Object.assign({},c,{parent:c.value,value:c.value[a]})),n[a]=o&&"getDefault"in o?o.getDefault(c):void 0}),n}setFields(t,n){let a=this.clone();return a.fields=t,a._nodes=sortFields(t,n),a._sortErrors=sortByKeyOrder(Object.keys(t)),n&&(a._excludedEdges=n),a}shape(t,n=[]){return this.clone().withMutation(a=>{let s=a._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...a._excludedEdges,...n]),a.setFields(Object.assign(a.fields,t),s)})}partial(){const t={};for(const[n,a]of Object.entries(this.fields))t[n]="optional"in a&&a.optional instanceof Function?a.optional():a;return this.setFields(t)}deepPartial(){return deepPartial(this)}pick(t){const n={};for(const a of t)this.fields[a]&&(n[a]=this.fields[a]);return this.setFields(n,this._excludedEdges.filter(([a,s])=>t.includes(a)&&t.includes(s)))}omit(t){const n=[];for(const a of Object.keys(this.fields))t.includes(a)||n.push(a);return this.pick(n)}from(t,n,a){let s=propertyExprExports.getter(t,!0);return this.transform(o=>{if(!o)return o;let c=o;return deepHas(o,t)&&(c=Object.assign({},o),a||delete c[t],c[n]=s(o)),c})}json(){return this.transform(parseJson)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||object$1.exact,test(n){if(n==null)return!0;const a=unknown(this.schema,n);return a.length===0||this.createError({params:{properties:a.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=object$1.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let a=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const o=unknown(this.schema,s);return!t||o.length===0||this.createError({params:{unknown:o.join(", ")}})}});return a.spec.noUnknown=t,a}unknown(t=!0,n=object$1.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const a={};for(const s of Object.keys(n))a[t(s)]=n[s];return a})}camelCase(){return this.transformKeys(tinyCaseExports.camelCase)}snakeCase(){return this.transformKeys(tinyCaseExports.snakeCase)}constantCase(){return this.transformKeys(t=>tinyCaseExports.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),a=super.describe(t);a.fields={};for(const[o,c]of Object.entries(n.fields)){var s;let f=t;(s=f)!=null&&s.value&&(f=Object.assign({},f,{parent:f.value,value:f.value[o]})),a.fields[o]=c.describe(f)}return a}}create$3.prototype=ObjectSchema.prototype;function create$2(e){return new ArraySchema(e)}class ArraySchema extends Schema$1{constructor(t){super({type:"array",spec:{types:t},check(n){return Array.isArray(n)}}),this.innerType=void 0,this.innerType=t}_cast(t,n){const a=super._cast(t,n);if(!this._typeCheck(a)||!this.innerType)return a;let s=!1;const o=a.map((c,f)=>{const y=this.innerType.cast(c,Object.assign({},n,{path:`${n.path||""}[${f}]`}));return y!==c&&(s=!0),y});return s?o:a}_validate(t,n={},a,s){var o;let c=this.innerType,f=(o=n.recursive)!=null?o:this.spec.recursive;n.originalValue!=null&&n.originalValue,super._validate(t,n,a,(y,m)=>{var g;if(!f||!c||!this._typeCheck(m)){s(y,m);return}let z=new Array(m.length);for(let re=0;re<m.length;re++){var ie;z[re]=c.asNestedTest({options:n,index:re,parent:m,parentPath:n.path,originalParent:(ie=n.originalValue)!=null?ie:t})}this.runTests({value:m,tests:z,originalValue:(g=n.originalValue)!=null?g:t,options:n},a,re=>s(re.concat(y),m))})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}json(){return this.transform(parseJson)}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!isSchema(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+printValue(t));return n.innerType=t,n.spec=Object.assign({},n.spec,{types:t}),n}length(t,n=array$1.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(a){return a.length===this.resolve(t)}})}min(t,n){return n=n||array$1.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a.length>=this.resolve(t)}})}max(t,n){return n=n||array$1.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(a,s,o)=>!t(a,s,o):a=>!!a;return this.transform(a=>a!=null?a.filter(n):a)}describe(t){const n=(t?this.resolve(t):this).clone(),a=super.describe(t);if(n.innerType){var s;let o=t;(s=o)!=null&&s.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[0]})),a.innerType=n.innerType.describe(o)}return a}}create$2.prototype=ArraySchema.prototype;function create$4(e){return new Lazy(e)}function catchValidationError(e){try{return e()}catch(t){if(ValidationError.isError(t))return Promise.reject(t);throw t}}class Lazy{constructor(t){this.type="lazy",this.__isYupSchema__=!0,this.spec=void 0,this._resolve=(n,a={})=>{let s=this.builder(n,a);if(!isSchema(s))throw new TypeError("lazy() functions must return a valid schema");return this.spec.optional&&(s=s.optional()),s.resolve(a)},this.builder=t,this.spec={meta:void 0,optional:!1}}clone(t){const n=new Lazy(this.builder);return n.spec=Object.assign({},this.spec,t),n}optionality(t){return this.clone({optional:t})}optional(){return this.optionality(!0)}resolve(t){return this._resolve(t.value,t)}cast(t,n){return this._resolve(t,n).cast(t,n)}asNestedTest(t){let{key:n,index:a,parent:s,options:o}=t,c=s[a??n];return this._resolve(c,Object.assign({},o,{value:c,parent:s})).asNestedTest(t)}validate(t,n){return catchValidationError(()=>this._resolve(t,n).validate(t,n))}validateSync(t,n){return this._resolve(t,n).validateSync(t,n)}validateAt(t,n,a){return catchValidationError(()=>this._resolve(n,a).validateAt(t,n,a))}validateSyncAt(t,n,a){return this._resolve(n,a).validateSyncAt(t,n,a)}isValid(t,n){try{return this._resolve(t,n).isValid(t,n)}catch(a){if(ValidationError.isError(a))return Promise.resolve(!1);throw a}}isValidSync(t,n){return this._resolve(t,n).isValidSync(t,n)}describe(t){return t?this.resolve(t).describe(t):{type:"lazy",meta:this.spec.meta,label:void 0}}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await t.validate(a,{abortEarly:!1})}}catch(s){if(ValidationError.isError(s))return{issues:issuesFromValidationError(s)};throw s}}}}}const configValidator=create$3().noUnknown().shape({client:create$3().noUnknown().shape({logo:create$6(),name:create$6()}),entrypoint:create$3().noUnknown().shape({account:create$6(),country:create$6(),credential:create$6(),site:create$6(),siteOrganizationType:create$6(),updateCredential:create$6()}),locale:create$6().oneOf(["es","en"]),navigation:create$3().noUnknown().shape({disableFormAutocomplete:create$7(),displayAccountsSelection:create$7(),displayBusinessSites:create$7(),displayCredentialInModal:create$7(),displayErrorsInToast:create$7(),displayLogoImages:create$7(),displayLongDescription:create$7(),displayPersonalSites:create$7(),displayPrivacyScreen:create$7(),displaySiteOrganizations:create$2().of(create$6()),displaySiteOrganizationTypes:create$2().of(create$6()),displaySites:create$2().of(create$6()),displayStatusInToast:create$7(),enableBackNavigation:create$7(),enableTwofaBackNavigation:create$7(),formButtonsDisabledStyle:create$7(),formShowPasswordStyle:create$6().oneOf(["icon","none","text"]),getSelectedAccounts:create$8().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),hideSelectCountry:create$7(),hideSiteOrganizations:create$2().of(create$6()),hideSiteOrganizationTypes:create$2().of(create$6()),hideSites:create$2().of(create$6()),oneSiteFlow:create$7(),quickAnswer:create$7(),returnToSiteFormOnUserError:create$4(e=>typeof e=="object"?create$2().of(create$5().oneOf([401,403,411])):create$7()),saveCredential:create$7(),selectClass:create$6(),socketTimeout:create$5().min(1),toastDuration:create$5().min(0),toastPosition:create$6().oneOf(["bottom-left","bottom-right","top-left","top-right"])}),__internal__:create$3().noUnknown().shape({apiBaseUrl:create$6(),apiEnv:create$6().oneOf(["development","production"]),assetsBaseUrl:create$6(),plaidSites:create$7(),defaultHttpParams:create$3()})}),paramsValidator=create$3().shape({token:create$6().required(),element:create$4(e=>{switch(typeof e){case"string":return create$6().test("isElement","${path} is not an Element",t=>{if(!document.querySelector(t))throw new ValidationError(`Invalid selector: Element "${t}" not found.`);return!0});case"object":return create$3().test("isElement","${path} is not an Element",t=>{if(!isElement$1(t))throw new ValidationError("Invalid element: Object should be a valid HtmlElement.");return!0});default:return create$6()}}),refreshTokenFunction:create$8().test("isFunction","${path} is not a function",e=>e?Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function:!0),enableTestMode:create$7(),strict:create$3().noUnknown().nullable().shape({authorization:create$3().noUnknown().required().shape({type:create$6().oneOf(["jwk"]).required(),key:create$6().required()}),body:create$3().noUnknown().required().shape({type:create$6().oneOf(["jwk"]).required(),key:create$6().required().test("isBase64","${path} is not a base64 encoded",e=>e&&/^(?:[A-Za-z0-9+/]{2}[A-Za-z0-9+/]{2})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e))})}),config:configValidator}).strict().noUnknown();let __VERSION__={git:{hash:"gcf2b3dc",distance:0,tag:"v1.6.0"}};function getVersion(){let e=`${__VERSION__.git.tag}.${__VERSION__.git.distance}`;return e=`${e}-${__VERSION__.git.hash}`,e}function getBridgeData(e,t){const n=parseInt("0x4",16),a="38060000000000000000000000000000000000000000000F00000000000000000000000000000000000D9802010000010101000000000000";let s;return getBridgeScripts$2().then(()=>(s=new digipass.nativebridge.DP110,new Promise((c,f)=>{s.onError(()=>f("bridge.not_ready")),s.onReady(y=>{if(y.versionCode<s.versionCode&&f("bridge.host_update_available"),s.isReady())s.getTokenInfo(n,function(g){if(g.returnCode!==0)return f(`bridge.${Math.abs(g.returnCode)}`);s.generateOTP(a,t,function(z){if(z.returnCode!==0)return f(`bridge.${Math.abs(z.returnCode)}`);c({token:`${e}XX${z.otp}XX${g.info}XX${y.versionCode}`,challenge:t})})});else return Promise.reject("bridge.not_ready")})})))}function getBridgeScripts$2(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeUsb"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeUsb"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dp110.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}function generateResponseOnlyOTP(){const e=window.bridgeBluetooth;if(e.timeoutValidation=!1,e.cryptoAppOTP=7,!e.bridge.isReady()){e.bridge.reconnect();return}clearTimeout(e.varSetTime),e.bridge.generateResponseOnlyOTP(e.cryptoAppOTP,function(t){t.returnCode!=0?(t.returnCode==-6014||t.returnCode==-6015||t.returnCode==-6016)&&turnOn(!1,!1):e.timeoutValidation||(e.validOTP=!0,e.valFinalFlow=!0,e.token=t.otp,e.acceptB?sendRequestDP785():(otpDP785ConnectedServices(),otpDP785Connected()))})}function getBridgeBluetoothFakeToken(e){const t=window.bridgeBluetooth;return new Promise((n,a)=>{t.resolve=n,t.reject=a,getSetTimeRequest(e)})}function getBridgeBluetoothFinalToken(e){const t=window.bridgeBluetooth;return new Promise((n,a)=>{t.resolve=n,t.reject=a,getChallengeResponseRequestContinue(e)})}function getBridgeBluetoothTimeChallengeV1(e,t){window.bridgeBluetooth={acceptB:null,accesLogin:!0,bridge:null,cancelB:!1,cancelB2:!1,changeIdNameOtp:!1,claveInsSegOTP:null,contNB:2,contNBReady:0,contNBVersion:0,cryptoAppOTP:null,digipassSerial:null,eai_firma_DP110:null,eai_serial_DP110:null,isChequeLineaOrSAT:null,jspDesafio:t,jspToken:e,nbProcessIsComplete:!1,resolve:null,reject:null,setTimeReady:!1,switchState:!0,timeoutValidation:!1,token:"",valFinalFlow:!1,validOTP:!1,varSetTime:null,versionCode:null};const n=window.bridgeBluetooth;return getBridgeScripts$1().then(()=>new Promise((s,o)=>{n.resolve=s,n.reject=o,initNativeBrigde()}))}function getBridgeScripts$1(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeBluetooth"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeBluetooth"),s.setAttribute("src","https://www.paybook.com/lib/syncfy/digipass.nativebridge.dptoken.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}function getChallengeResponseRequest(){const e=window.bridgeBluetooth;e.accesLogin&&(e.cancelB||(e.valFinalFlow=!0,e.token="********",e.resolve(e.token)),e.accesLogin=!1)}function getChallengeResponseRequestContinue(e){const t=window.bridgeBluetooth,n=JSON.parse(e);n.estado!=="OK"||t.cancelB2||processRequestMessage(n.requestMessage)}function getSetTimeRequest(e){const t=JSON.parse(e);t.estado!=="OK"||processRequestMessageSetTime(t.requestMessage)}function initializeDigipass$1(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.initializeDigipass(e.digipassSerial,function(t){t.returnCode!=0||e.bridge.getDigipassTimeChallenge(function(n){n.returnCode!=0?timeEvents(function(){e.switchState&&listDigipass()},5e3,"timeOut"):(clearTimeout(e.varSetTime),e.timeoutValidation=!1,e.setTimeReady?getChallengeResponseRequest():setDPTime())})})}function initNativeBrigde(){const e=window.bridgeBluetooth;try{e.bridge=new digipass.nativebridge.DPToken,e.bridge.getDigipassTimeChallenge(function(){turnOn(!0,!1)}),e.bridge.onError(function(){e.contNB++,e.nbProcessIsComplete||e.contNB<=4&&(e.accesLogin?e.bridge.reconnect():e.bridge.getDigipassTimeChallenge(function(){}))}),e.bridge.onReady(function(){clearTimeout(e.varSetTime),e.contNB=0,e.contNBReady===0&&(e.validOTP||(timeEvents(function(){e.timeoutValidation=!0},3e4,"timeOut"),e.switchState&&listDigipass()),e.contNBReady++)})}catch(t){e.reject(t)}}function listDigipass(){const e=window.bridgeBluetooth;if(e.digipassSerial=null,!e.bridge.isReady()){e.bridge.reconnect();return}if(e.contNBVersion===0&&e.bridge.getNativeBridgeVersion(function(t){e.versionCode=t.versionCode,e.contNBVersion++}),!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassList(function(t){e.timeoutValidation||t.returnCode!=0||(t.devices.length==0?e.switchState&&listDigipass():(t.devices.forEach(n=>{n.digipassSerial===e.jspToken&&(e.digipassSerial=n.digipassSerial,e.jspDesafio!=="null"&&(e.eai_serial_DP110=e.jspToken))}),e.digipassSerial===null?e.switchState&&listDigipass():e.timeoutValidation||initializeDigipass$1()))})}function otpDP785Connected(){const e=window.bridgeBluetooth;if(e.switchState){let t="";e.token!==void 0?(t=e.token,e.token=t+e.cryptoAppOTP):(t=e.claveInsSegOTP,e.claveInsSegOTP=t+e.cryptoAppOTP)}e.resolve(`${e.token}XX${e.eai_firma_DP110}XX${e.eai_serial_DP110}XX${e.versionCode}`)}function otpDP785ConnectedServices(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!0}function otpDP785DisconnectedServices(){const e=window.bridgeBluetooth;e.changeIdNameOtp=!1}function parseResponseMessage(e,t){const n=window.bridgeBluetooth;if(!n.bridge.isReady()){n.bridge.reconnect();return}n.bridge.parseResponseMessage(e,t,function(a){a.returnCode!=0?(a.returnCode==-6014||a.returnCode==-6015||a.returnCode==-6016)&&turnOn(!1,!1):n.timeoutValidation||(n.validOTP=!0,n.jspDesafio!=="null"&&(n.eai_firma_DP110=a.messageSignature),generateResponseOnlyOTP())})}function parseResponseMessageSetTime(e,t){const n=window.bridgeBluetooth;if(!n.bridge.isReady()){n.bridge.reconnect();return}n.bridge.parseResponseMessage(e,t,function(a){a.returnCode!=0||(n.setTimeReady=!0,getChallengeResponseRequest())})}function processRequestMessage(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(n){n.returnCode!=0||parseResponseMessage(n.responseMessage,e)})}function processRequestMessageSetTime(e){const t=window.bridgeBluetooth;if(!t.bridge.isReady()){t.bridge.reconnect();return}t.bridge.transmitRequestMessage(e,function(n){n.returnCode!=0||parseResponseMessageSetTime(n.responseMessage,e)})}function sendRequestDP785(){const e=window.bridgeBluetooth;clearTimeout(e.varSetTime),otpDP785Connected()}function setDPTime(){const e=window.bridgeBluetooth;if(!e.bridge.isReady()){e.bridge.reconnect();return}e.bridge.getDigipassTimeChallenge(function(t){t.returnCode!=0||e.resolve(t.timeChallenge)})}function timeEvents(e,t,n){const a=window.bridgeBluetooth;switch(n){case"timeOut":a.varSetTime=setTimeout(e,t);break;case"interval":setInterval(e,t);break}}function turnOn(e,t){const n=window.bridgeBluetooth,a="";if(n.timeoutValidation=!1,n.acceptB=t,clearTimeout(n.varSetTime),n.token.length!=8&&!t&&(n.validOTP=!1),t||(n.switchState=e),e)if(n.contNBVersion=0,n.valFinalFlow=!1,t||(n.accesLogin=!0,n.cancelB=!1),n.validOTP)sendRequestDP785(),n.valFinalFlow=!0;else{if(n.contNBVersion=0,n.cancelB2=!1,n.contNB=2,t||(n.token=a),n.bridge===void 0&&initNativeBrigde(),!n.bridge.isReady()){n.bridge.reconnect();return}clearTimeout(n.varSetTime),timeEvents(function(){n.timeoutValidation=!0},3e4,"timeOut"),n.contNBReady!==0?listDigipass():n.bridge.reconnect()}else clearTimeout(n.varSetTime),n.validOTP=!0,n.cancelB=!0,n.cancelB2=!0,otpDP785DisconnectedServices(),n.claveInsSegOTP=a,n.token=a}function turnOnBridgeBluetoothBeforeSendingTwofa(){turnOn(!0,!0)}const appStateWindowProperty="bridgeBluetooth";function continueDPToken(e){const t=window[appStateWindowProperty];return new Promise((a,s)=>{t.resolve=a,t.reject=s;let o,c;const{authenticationData:f}=e.authenticationResponse;f[0].idAuthenticationData==="signedMessage"?([o]=f[0].authenticationData,[c]=f[1].authenticationData):([o]=f[1].authenticationData,[c]=f[0].authenticationData),secondPartDPToken({signedMessage:o,signedTimeMessage:c})})}async function generateTimeChallenge(){const e=window[appStateWindowProperty];return new Promise(async(t,n)=>{if(e.nativeBridgeInstance.isReady())try{const a=await async function(s){return new Promise((o,c)=>{s.getDigipassTimeChallenge(f=>{if(f.returnCode!==0){const m={title:"Generar - TimeChallenge",response:{message:"Se ha producido un error al generar el TimeChallenge. Por favor, asegúrate de tener tu token conectado y encendido.",returnCode:f.returnCode}};return void c(m)}const y={title:"Generar - TimeChallenge",response:{message:`El TimeChallenge es: ${f.timeChallenge}`,timeChallenge:f.timeChallenge,errorCode:""}};o(y)})})}(e.nativeBridgeInstance);t(a)}catch(a){n(a)}else n({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:""}})})}function getBridgeBluetoothTimeChallengeV2(e){window[appStateWindowProperty]={isDp785Signature:!1,nativeBridgeInstance:null,resolve:null,reject:null};const t=window[appStateWindowProperty];return getBridgeScripts().then(()=>new Promise((a,s)=>{t.resolve=a,t.reject=s,t.isDp785Signature=e!=="214",t.nativeBridgeInstance=new window.digipass.nativebridge.DPToken,onProcessDPToken()}))}function getBridgeScripts(){const e=new Promise((n,a)=>{if(document.getElementById("widgetBridgeConfig"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeConfig"),s.setAttribute("src","undefineddigipass.nativebridge.config.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_config_script_not_loaded")}}),t=new Promise((n,a)=>{if(document.getElementById("widgetBridgeBluetooth"))return n();const s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("id","widgetBridgeBluetooth"),s.setAttribute("src","undefineddigipass.nativebridge.dptoken.min.js"),(document.head||document.body).appendChild(s),s.onload=()=>n(),s.onerror=()=>{a("bridge.digipass_script_not_loaded")}});return Promise.all([e,t])}async function initDPToken(){const e=window[appStateWindowProperty];try{const t=await initializeDevice(e.isDp785Signature);if(t.length===1){const[n]=t;await initializeDigipass(n.serial);const a=await generateTimeChallenge();e.resolve(a.response.timeChallenge)}}catch(t){e.reject(t),alert("Por favor, asegúrate de tener tu token conectado y encendido.")}}async function initializeDevice(e){const t=window[appStateWindowProperty];return new Promise(async(n,a)=>{const s=e?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(t.nativeBridgeInstance.isReady())try{const o=await async function(y){return new Promise((m,g)=>{y.getDigipassList(z=>{if(z.returnCode===0)m(z.devices);else{const ie={title:"Listar dispositivos",response:{message:"Error al obtener la lista de dispositivos disponibles.",returnCode:z.returnCode}};g(ie)}})})}(t.nativeBridgeInstance),c=o.map(y=>({name:y.deviceName,serial:y.digipassSerial})),[f]=c;if(!f||!f.serial)return void a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:s}});n(c)}catch(o){a(o)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:s}})})}async function initializeDigipass(e){const t=window[appStateWindowProperty];return new Promise((n,a)=>{t.nativeBridgeInstance.initializeDigipass(e,s=>{if(s.returnCode!==0){const c={title:"Inicializar dispositivo",response:{message:"Error al intentar inicializar el dispositivo.",returnCode:s.returnCode}};return void a(c)}const o={title:"Inicializar dispositivo",response:{message:`El dispositivo con serial: ${e} está listo para ser usado.`,errorCode:""}};n(o)})})}async function generateResponseOnlyOTPBridge(e){const t=window[appStateWindowProperty];return new Promise(async(n,a)=>{if(t.nativeBridgeInstance.isReady())try{const s=await async function(o,c){return new Promise((f,y)=>{o.generateResponseOnlyOTP(c,m=>{if(m.returnCode!==0){const z={title:"Generar OTP con PIN",response:{message:"No fue posible generar la OTP.",returnCode:m.returnCode}};return void y(z)}const g={title:"Generar OTP con PIN",response:{message:`La OTP se generó correctamente: ${m.otp}`,otp:m.otp,errorCode:"",processType:"DP785_T4_LINKED"}};f(g)})})}(t.nativeBridgeInstance,e);n(s)}catch(s){a(s)}else a({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:"DP785_T4_NOT_LINKED"}})})}async function onProcessDPToken(){const e=window[appStateWindowProperty],t=await startNativeBridgeValidation();if(t.response.errorCode!==""){alert(t.response.message),e.reject(t.response.errorCode);return}else await initDPToken()}async function secondPartDPToken({signedMessage:e="",signedTimeMessage:t=""}){const n=window[appStateWindowProperty];try{await transmitRequestMessageBridge(t,n.isDp785Signature);const a=await transmitRequestMessageBridge(e,n.isDp785Signature),{response:{messageSignature:s}}=a,o=7,c=await generateResponseOnlyOTPBridge(o),{response:{otp:f}}=c,y={};y.otpChallenge=s;const m=`${f}${o}`;y.otp=m,n.resolve(`${y.otpChallenge}XX${y.otp}`)}catch(a){n.reject(a),alert("Error al intentar validar la sesión desde el dispositivo de acceso seguro.")}}async function startNativeBridgeValidation(){const e=window[appStateWindowProperty];return new Promise((t,n)=>{e.nativeBridgeInstance.onReady(()=>{e.nativeBridgeInstance.getNativeBridgeVersion(a=>{const s={title:"Conexión con Native Bridge",response:{errorCode:"",message:"El software Native Bridge se encuentra instalado en tu ordenador.",updateAvailable:!(a.versionCode>=e.nativeBridgeInstance.versionCode)}};t(s)})}),e.nativeBridgeInstance.onError(()=>{n({title:"Conexión con Native Bridge",response:{errorCode:"222",message:"El software Native Bridge no se encontró instalado en tu ordenador.",processType:"DP785_T4_NOT_LINKED"}})})})}async function transmitRequestMessageBridge(e,t){const n=window[appStateWindowProperty];return new Promise(async(a,s)=>{const o=t?"DP785_T4_MANUAL":"DP785_T4_NOT_LINKED";if(n.nativeBridgeInstance.isReady())try{const{responseMessage:c}=await async function(y,m){return new Promise((g,z)=>{y.transmitRequestMessage(m,ie=>{if(ie.returnCode===0)g(ie);else{const re={title:"Firmar mensaje",response:{message:"No fue posible transmitir el mensaje.",returnCode:ie.returnCode}};z(re)}})})}(n.nativeBridgeInstance,e),f=await async function(y,m,g){return new Promise((z,ie)=>{y.parseResponseMessage(m,g,re=>{if(re.returnCode!==0){const _e={title:"Firmar mensaje",response:{message:"No fue posible parsear el mensaje.",returnCode:re.returnCode}};return void ie(_e)}const he={title:"Firmar mensaje",response:{message:`Se realizó la firma del mensaje correctamente: ${re.messageSignature}`,messageSignature:re.messageSignature,errorCode:"",processType:"DP785_T4_LINKED"}};z(he)})})}(n.nativeBridgeInstance,c,e);a(f)}catch(c){s(c)}else s({title:"Error de conexión",response:{message:"No es posible interactuar con el dispositivo.",errorCode:"",processType:o}})})}const DOWNLOAD_OPTIONS_ACTIVE={enables:["download_options"],name:"download_options_active",required:!1,translate_label:"download_options.switch",type:"switch",validation:null},DOWNLOAD_OPTIONS={name:"download_options",required:!1,enabled_by:"download_options_active",translate_error_label:"download_options.label",type:"date_range",validation:null},DOWNLOAD_OPTIONS_SITES=["56cf5728784806f72b8b456f","5da784f1f9de2a06483abec1"];var buffer$2={},base64Js={};base64Js.byteLength=byteLength,base64Js.toByteArray=toByteArray,base64Js.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62,revLookup[95]=63;function getLens(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var a=n===t?0:4-n%4;return[n,a]}function byteLength(e){var t=getLens(e),n=t[0],a=t[1];return(n+a)*3/4-a}function _byteLength(e,t,n){return(t+n)*3/4-n}function toByteArray(e){var t,n=getLens(e),a=n[0],s=n[1],o=new Arr(_byteLength(e,a,s)),c=0,f=s>0?a-4:a,y;for(y=0;y<f;y+=4)t=revLookup[e.charCodeAt(y)]<<18|revLookup[e.charCodeAt(y+1)]<<12|revLookup[e.charCodeAt(y+2)]<<6|revLookup[e.charCodeAt(y+3)],o[c++]=t>>16&255,o[c++]=t>>8&255,o[c++]=t&255;return s===2&&(t=revLookup[e.charCodeAt(y)]<<2|revLookup[e.charCodeAt(y+1)]>>4,o[c++]=t&255),s===1&&(t=revLookup[e.charCodeAt(y)]<<10|revLookup[e.charCodeAt(y+1)]<<4|revLookup[e.charCodeAt(y+2)]>>2,o[c++]=t>>8&255,o[c++]=t&255),o}function tripletToBase64(e){return lookup[e>>18&63]+lookup[e>>12&63]+lookup[e>>6&63]+lookup[e&63]}function encodeChunk(e,t,n){for(var a,s=[],o=t;o<n;o+=3)a=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),s.push(tripletToBase64(a));return s.join("")}function fromByteArray(e){for(var t,n=e.length,a=n%3,s=[],o=16383,c=0,f=n-a;c<f;c+=o)s.push(encodeChunk(e,c,c+o>f?f:c+o));return a===1?(t=e[n-1],s.push(lookup[t>>2]+lookup[t<<4&63]+"==")):a===2&&(t=(e[n-2]<<8)+e[n-1],s.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),s.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ieee754.read=function(e,t,n,a,s){var o,c,f=s*8-a-1,y=(1<<f)-1,m=y>>1,g=-7,z=n?s-1:0,ie=n?-1:1,re=e[t+z];for(z+=ie,o=re&(1<<-g)-1,re>>=-g,g+=f;g>0;o=o*256+e[t+z],z+=ie,g-=8);for(c=o&(1<<-g)-1,o>>=-g,g+=a;g>0;c=c*256+e[t+z],z+=ie,g-=8);if(o===0)o=1-m;else{if(o===y)return c?NaN:(re?-1:1)*(1/0);c=c+Math.pow(2,a),o=o-m}return(re?-1:1)*c*Math.pow(2,o-a)},ieee754.write=function(e,t,n,a,s,o){var c,f,y,m=o*8-s-1,g=(1<<m)-1,z=g>>1,ie=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,re=a?0:o-1,he=a?1:-1,_e=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,c=g):(c=Math.floor(Math.log(t)/Math.LN2),t*(y=Math.pow(2,-c))<1&&(c--,y*=2),c+z>=1?t+=ie/y:t+=ie*Math.pow(2,1-z),t*y>=2&&(c++,y/=2),c+z>=g?(f=0,c=g):c+z>=1?(f=(t*y-1)*Math.pow(2,s),c=c+z):(f=t*Math.pow(2,z-1)*Math.pow(2,s),c=0));s>=8;e[n+re]=f&255,re+=he,f/=256,s-=8);for(c=c<<s|f,m+=s;m>0;e[n+re]=c&255,re+=he,c/=256,m-=8);e[n+re-he]|=_e*128};/*!
|
|
680
680
|
* The buffer module from node.js, for the browser.
|
|
681
681
|
*
|
|
682
682
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
@@ -874,4 +874,4 @@ For more detail, please visit: ${s}
|
|
|
874
874
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const a=new this(t);return n.forEach(s=>a.set(s)),a}static accessor(t){const a=(this[$internals]=this[$internals]={accessors:{}}).accessors,s=this.prototype;function o(c){const f=normalizeHeader(c);a[f]||(buildAccessors(s,c),a[f]=!0)}return utils$1.isArray(t)?t.forEach(o):o(t),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(a){this[n]=a}}}),utils$1.freezeMethods(AxiosHeaders$1);function transformData(e,t){const n=this||defaults,a=t||n,s=AxiosHeaders$1.from(a.headers);let o=a.data;return utils$1.forEach(e,function(f){o=f.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function isCancel$1(e){return!!(e&&e.__CANCEL__)}function CanceledError$1(e,t,n){AxiosError$1.call(this,e??"canceled",AxiosError$1.ERR_CANCELED,t,n),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(e,t,n){const a=n.config.validateStatus;!n.status||!a||a(n.status)?e(n):t(new AxiosError$1("Request failed with status code "+n.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function parseProtocol(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;const n=new Array(e),a=new Array(e);let s=0,o=0,c;return t=t!==void 0?t:1e3,function(y){const m=Date.now(),g=a[o];c||(c=m),n[s]=y,a[s]=m;let z=o,ie=0;for(;z!==s;)ie+=n[z++],z=z%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),m-c<t)return;const re=g&&m-g;return re?Math.round(ie*1e3/re):void 0}}function throttle$1(e,t){let n=0,a=1e3/t,s,o;const c=(m,g=Date.now())=>{n=g,s=null,o&&(clearTimeout(o),o=null),e.apply(null,m)};return[(...m)=>{const g=Date.now(),z=g-n;z>=a?c(m,g):(s=m,o||(o=setTimeout(()=>{o=null,c(s)},a-z)))},()=>s&&c(s)]}const progressEventReducer=(e,t,n=3)=>{let a=0;const s=speedometer(50,250);return throttle$1(o=>{const c=o.loaded,f=o.lengthComputable?o.total:void 0,y=c-a,m=s(y),g=c<=f;a=c;const z={loaded:c,total:f,progress:f?c/f:void 0,bytes:y,rate:m||void 0,estimated:m&&f&&g?(f-c)/m:void 0,event:o,lengthComputable:f!=null,[t?"download":"upload"]:!0};e(z)},n)},progressEventDecorator=(e,t)=>{const n=e!=null;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},asyncDecorator=e=>(...t)=>utils$1.asap(()=>e(...t)),isURLSameOrigin=platform.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,platform.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(e,t,n,a,s,o){const c=[e+"="+encodeURIComponent(t)];utils$1.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),utils$1.isString(a)&&c.push("path="+a),utils$1.isString(s)&&c.push("domain="+s),o===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t,n){let a=!isAbsoluteURL(t);return e&&(a||n==!1)?combineURLs(e,t):t}const headersToObject=e=>e instanceof AxiosHeaders$1?{...e}:e;function mergeConfig$1(e,t){t=t||{};const n={};function a(m,g,z,ie){return utils$1.isPlainObject(m)&&utils$1.isPlainObject(g)?utils$1.merge.call({caseless:ie},m,g):utils$1.isPlainObject(g)?utils$1.merge({},g):utils$1.isArray(g)?g.slice():g}function s(m,g,z,ie){if(utils$1.isUndefined(g)){if(!utils$1.isUndefined(m))return a(void 0,m,z,ie)}else return a(m,g,z,ie)}function o(m,g){if(!utils$1.isUndefined(g))return a(void 0,g)}function c(m,g){if(utils$1.isUndefined(g)){if(!utils$1.isUndefined(m))return a(void 0,m)}else return a(void 0,g)}function f(m,g,z){if(z in t)return a(m,g);if(z in e)return a(void 0,m)}const y={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:f,headers:(m,g,z)=>s(headersToObject(m),headersToObject(g),z,!0)};return utils$1.forEach(Object.keys(Object.assign({},e,t)),function(g){const z=y[g]||s,ie=z(e[g],t[g],g);utils$1.isUndefined(ie)&&z!==f||(n[g]=ie)}),n}const resolveConfig=e=>{const t=mergeConfig$1({},e);let{data:n,withXSRFToken:a,xsrfHeaderName:s,xsrfCookieName:o,headers:c,auth:f}=t;t.headers=c=AxiosHeaders$1.from(c),t.url=buildURL(buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),f&&c.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):"")));let y;if(utils$1.isFormData(n)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((y=c.getContentType())!==!1){const[m,...g]=y?y.split(";").map(z=>z.trim()).filter(Boolean):[];c.setContentType([m||"multipart/form-data",...g].join("; "))}}if(platform.hasStandardBrowserEnv&&(a&&utils$1.isFunction(a)&&(a=a(t)),a||a!==!1&&isURLSameOrigin(t.url))){const m=s&&o&&cookies.read(o);m&&c.set(s,m)}return t},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise(function(n,a){const s=resolveConfig(e);let o=s.data;const c=AxiosHeaders$1.from(s.headers).normalize();let{responseType:f,onUploadProgress:y,onDownloadProgress:m}=s,g,z,ie,re,he;function _e(){re&&re(),he&&he(),s.cancelToken&&s.cancelToken.unsubscribe(g),s.signal&&s.signal.removeEventListener("abort",g)}let $e=new XMLHttpRequest;$e.open(s.method.toUpperCase(),s.url,!0),$e.timeout=s.timeout;function pe(){if(!$e)return;const Oe=AxiosHeaders$1.from("getAllResponseHeaders"in $e&&$e.getAllResponseHeaders()),At={data:!f||f==="text"||f==="json"?$e.responseText:$e.response,status:$e.status,statusText:$e.statusText,headers:Oe,config:e,request:$e};settle(function(ze){n(ze),_e()},function(ze){a(ze),_e()},At),$e=null}"onloadend"in $e?$e.onloadend=pe:$e.onreadystatechange=function(){!$e||$e.readyState!==4||$e.status===0&&!($e.responseURL&&$e.responseURL.indexOf("file:")===0)||setTimeout(pe)},$e.onabort=function(){$e&&(a(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,e,$e)),$e=null)},$e.onerror=function(){a(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,$e)),$e=null},$e.ontimeout=function(){let qe=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const At=s.transitional||transitionalDefaults;s.timeoutErrorMessage&&(qe=s.timeoutErrorMessage),a(new AxiosError$1(qe,At.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,e,$e)),$e=null},o===void 0&&c.setContentType(null),"setRequestHeader"in $e&&utils$1.forEach(c.toJSON(),function(qe,At){$e.setRequestHeader(At,qe)}),utils$1.isUndefined(s.withCredentials)||($e.withCredentials=!!s.withCredentials),f&&f!=="json"&&($e.responseType=s.responseType),m&&([ie,he]=progressEventReducer(m,!0),$e.addEventListener("progress",ie)),y&&$e.upload&&([z,re]=progressEventReducer(y),$e.upload.addEventListener("progress",z),$e.upload.addEventListener("loadend",re)),(s.cancelToken||s.signal)&&(g=Oe=>{$e&&(a(!Oe||Oe.type?new CanceledError$1(null,e,$e):Oe),$e.abort(),$e=null)},s.cancelToken&&s.cancelToken.subscribe(g),s.signal&&(s.signal.aborted?g():s.signal.addEventListener("abort",g)));const Ce=parseProtocol(s.url);if(Ce&&platform.protocols.indexOf(Ce)===-1){a(new AxiosError$1("Unsupported protocol "+Ce+":",AxiosError$1.ERR_BAD_REQUEST,e));return}$e.send(o||null)})},composeSignals=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let a=new AbortController,s;const o=function(m){if(!s){s=!0,f();const g=m instanceof Error?m:this.reason;a.abort(g instanceof AxiosError$1?g:new CanceledError$1(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,o(new AxiosError$1(`timeout ${t} of ms exceeded`,AxiosError$1.ETIMEDOUT))},t);const f=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(o):m.removeEventListener("abort",o)}),e=null)};e.forEach(m=>m.addEventListener("abort",o));const{signal:y}=a;return y.unsubscribe=()=>utils$1.asap(f),y}},streamChunk=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let a=0,s;for(;a<n;)s=a+t,yield e.slice(a,s),a=s},readBytes=async function*(e,t){for await(const n of readStream(e))yield*streamChunk(n,t)},readStream=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:a}=await t.read();if(n)break;yield a}}finally{await t.cancel()}},trackStream=(e,t,n,a)=>{const s=readBytes(e,t);let o=0,c,f=y=>{c||(c=!0,a&&a(y))};return new ReadableStream({async pull(y){try{const{done:m,value:g}=await s.next();if(m){f(),y.close();return}let z=g.byteLength;if(n){let ie=o+=z;n(ie)}y.enqueue(new Uint8Array(g))}catch(m){throw f(m),m}},cancel(y){return f(y),s.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),test=(e,...t)=>{try{return!!e(...t)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let e=!1;const t=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(e=>e.body)};isFetchSupported&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!resolvers[t]&&(resolvers[t]=utils$1.isFunction(e[t])?n=>n[t]():(n,a)=>{throw new AxiosError$1(`Response type '${t}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,a)})})})(new Response);const getBodyLength=async e=>{if(e==null)return 0;if(utils$1.isBlob(e))return e.size;if(utils$1.isSpecCompliantForm(e))return(await new Request(platform.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(e)||utils$1.isArrayBuffer(e))return e.byteLength;if(utils$1.isURLSearchParams(e)&&(e=e+""),utils$1.isString(e))return(await encodeText(e)).byteLength},resolveBodyLength=async(e,t)=>{const n=utils$1.toFiniteNumber(e.getContentLength());return n??getBodyLength(t)},fetchAdapter=isFetchSupported&&(async e=>{let{url:t,method:n,data:a,signal:s,cancelToken:o,timeout:c,onDownloadProgress:f,onUploadProgress:y,responseType:m,headers:g,withCredentials:z="same-origin",fetchOptions:ie}=resolveConfig(e);m=m?(m+"").toLowerCase():"text";let re=composeSignals([s,o&&o.toAbortSignal()],c),he;const _e=re&&re.unsubscribe&&(()=>{re.unsubscribe()});let $e;try{if(y&&supportsRequestStream&&n!=="get"&&n!=="head"&&($e=await resolveBodyLength(g,a))!==0){let At=new Request(t,{method:"POST",body:a,duplex:"half"}),Et;if(utils$1.isFormData(a)&&(Et=At.headers.get("content-type"))&&g.setContentType(Et),At.body){const[ze,kt]=progressEventDecorator($e,progressEventReducer(asyncDecorator(y)));a=trackStream(At.body,DEFAULT_CHUNK_SIZE,ze,kt)}}utils$1.isString(z)||(z=z?"include":"omit");const pe="credentials"in Request.prototype;he=new Request(t,{...ie,signal:re,method:n.toUpperCase(),headers:g.normalize().toJSON(),body:a,duplex:"half",credentials:pe?z:void 0});let Ce=await fetch(he);const Oe=supportsResponseStream&&(m==="stream"||m==="response");if(supportsResponseStream&&(f||Oe&&_e)){const At={};["status","statusText","headers"].forEach(Pt=>{At[Pt]=Ce[Pt]});const Et=utils$1.toFiniteNumber(Ce.headers.get("content-length")),[ze,kt]=f&&progressEventDecorator(Et,progressEventReducer(asyncDecorator(f),!0))||[];Ce=new Response(trackStream(Ce.body,DEFAULT_CHUNK_SIZE,ze,()=>{kt&&kt(),_e&&_e()}),At)}m=m||"text";let qe=await resolvers[utils$1.findKey(resolvers,m)||"text"](Ce,e);return!Oe&&_e&&_e(),await new Promise((At,Et)=>{settle(At,Et,{data:qe,headers:AxiosHeaders$1.from(Ce.headers),status:Ce.status,statusText:Ce.statusText,config:e,request:he})})}catch(pe){throw _e&&_e(),pe&&pe.name==="TypeError"&&/Load failed|fetch/i.test(pe.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,e,he),{cause:pe.cause||pe}):AxiosError$1.from(pe,pe&&pe.code,e,he)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const renderReason=e=>`- ${e}`,isResolvedHandle=e=>utils$1.isFunction(e)||e===null||e===!1,adapters={getAdapter:e=>{e=utils$1.isArray(e)?e:[e];const{length:t}=e;let n,a;const s={};for(let o=0;o<t;o++){n=e[o];let c;if(a=n,!isResolvedHandle(n)&&(a=knownAdapters[(c=String(n)).toLowerCase()],a===void 0))throw new AxiosError$1(`Unknown adapter '${c}'`);if(a)break;s[c||"#"+o]=a}if(!a){const o=Object.entries(s).map(([f,y])=>`adapter ${f} `+(y===!1?"is not supported by the environment":"is not available in the build"));let c=t?o.length>1?`since :
|
|
875
875
|
`+o.map(renderReason).join(`
|
|
876
876
|
`):" "+renderReason(o[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return a},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError$1(null,e)}function dispatchRequest(e){return throwIfCancellationRequested(e),e.headers=AxiosHeaders$1.from(e.headers),e.data=transformData.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(e.adapter||defaults.adapter)(e).then(function(a){return throwIfCancellationRequested(e),a.data=transformData.call(e,e.transformResponse,a),a.headers=AxiosHeaders$1.from(a.headers),a},function(a){return isCancel$1(a)||(throwIfCancellationRequested(e),a&&a.response&&(a.response.data=transformData.call(e,e.transformResponse,a.response),a.response.headers=AxiosHeaders$1.from(a.response.headers))),Promise.reject(a)})}const VERSION$1="1.9.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{validators$1[e]=function(a){return typeof a===e||"a"+(t<1?"n ":" ")+e}});const deprecatedWarnings={};validators$1.transitional=function e(t,n,a){function s(o,c){return"[Axios v"+VERSION$1+"] Transitional option '"+o+"'"+c+(a?". "+a:"")}return(o,c,f)=>{if(t===!1)throw new AxiosError$1(s(c," has been removed"+(n?" in "+n:"")),AxiosError$1.ERR_DEPRECATED);return n&&!deprecatedWarnings[c]&&(deprecatedWarnings[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,c,f):!0}},validators$1.spelling=function e(t){return(n,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function assertOptions(e,t,n){if(typeof e!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let s=a.length;for(;s-- >0;){const o=a[s],c=t[o];if(c){const f=e[o],y=f===void 0||c(f,o,e);if(y!==!0)throw new AxiosError$1("option "+o+" must be "+y,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new AxiosError$1("Unknown option "+o,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(t){this.defaults=t||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(t,n){try{return await this._request(t,n)}catch(a){if(a instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{a.stack?o&&!String(a.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
877
|
-
`+o):a.stack=o}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=mergeConfig$1(this.defaults,n);const{transitional:a,paramsSerializer:s,headers:o}=n;a!==void 0&&validator.assertOptions(a,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),s!=null&&(utils$1.isFunction(s)?n.paramsSerializer={serialize:s}:validator.assertOptions(s,{encode:validators.function,serialize:validators.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),validator.assertOptions(n,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&utils$1.merge(o.common,o[n.method]);o&&utils$1.forEach(["delete","get","head","post","put","patch","common"],he=>{delete o[he]}),n.headers=AxiosHeaders$1.concat(c,o);const f=[];let y=!0;this.interceptors.request.forEach(function(_e){typeof _e.runWhen=="function"&&_e.runWhen(n)===!1||(y=y&&_e.synchronous,f.unshift(_e.fulfilled,_e.rejected))});const m=[];this.interceptors.response.forEach(function(_e){m.push(_e.fulfilled,_e.rejected)});let g,z=0,ie;if(!y){const he=[dispatchRequest.bind(this),void 0];for(he.unshift.apply(he,f),he.push.apply(he,m),ie=he.length,g=Promise.resolve(n);z<ie;)g=g.then(he[z++],he[z++]);return g}ie=f.length;let re=n;for(z=0;z<ie;){const he=f[z++],_e=f[z++];try{re=he(re)}catch($e){_e.call(this,$e);break}}try{g=dispatchRequest.call(this,re)}catch(he){return Promise.reject(he)}for(z=0,ie=m.length;z<ie;)g=g.then(m[z++],m[z++]);return g}getUri(t){t=mergeConfig$1(this.defaults,t);const n=buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls);return buildURL(n,t.params,t.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function e(t){Axios$1.prototype[t]=function(n,a){return this.request(mergeConfig$1(a||{},{method:t,url:n,data:(a||{}).data}))}}),utils$1.forEach(["post","put","patch"],function e(t){function n(a){return function(o,c,f){return this.request(mergeConfig$1(f||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}Axios$1.prototype[t]=n(),Axios$1.prototype[t+"Form"]=n(!0)});let CancelToken$1=class si{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const a=this;this.promise.then(s=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](s);a._listeners=null}),this.promise.then=s=>{let o;const c=new Promise(f=>{a.subscribe(f),o=f}).then(s);return c.cancel=function(){a.unsubscribe(o)},c},t(function(o,c,f){a.reason||(a.reason=new CanceledError$1(o,c,f),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new si(function(s){t=s}),cancel:t}}};function spread$1(e){return function(n){return e.apply(null,n)}}function isAxiosError$1(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([e,t])=>{HttpStatusCode$1[t]=e});function createInstance(e){const t=new Axios$1(e),n=bind(Axios$1.prototype.request,t);return utils$1.extend(n,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return createInstance(mergeConfig$1(e,s))},n}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function e(t){return Promise.all(t)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function throttle(e,t,n){var a=n||{},s=a.noTrailing,o=s===void 0?!1:s,c=a.noLeading,f=c===void 0?!1:c,y=a.debounceMode,m=y===void 0?void 0:y,g,z=!1,ie=0;function re(){g&&clearTimeout(g)}function he($e){var pe=$e||{},Ce=pe.upcomingOnly,Oe=Ce===void 0?!1:Ce;re(),z=!Oe}function _e(){for(var $e=arguments.length,pe=new Array($e),Ce=0;Ce<$e;Ce++)pe[Ce]=arguments[Ce];var Oe=this,qe=Date.now()-ie;if(z)return;function At(){ie=Date.now(),t.apply(Oe,pe)}function Et(){g=void 0}!f&&m&&!g&&At(),re(),m===void 0&&qe>e?f?(ie=Date.now(),o||(g=setTimeout(m?Et:At,e))):At():o!==!0&&(g=setTimeout(m?Et:At,m===void 0?e-qe:e))}return _e.cancel=he,_e}function debounce(e,t,n){var a={},s=a.atBegin,o=s===void 0?!1:s;return throttle(e,t,{debounceMode:o!==!1})}class Credential extends eventsExports.EventEmitter{constructor(n,a,s,o,c,f=!1){super();$n(this,"loading",!1);$n(this,"response");$n(this,"_config");$n(this,"_error");$n(this,"_message");$n(this,"_status","searching");$n(this,"_twofa");$n(this,"http");$n(this,"isSocketOpen",!1);$n(this,"options",{});$n(this,"socket");$n(this,"socketOpened",!1);$n(this,"socketTimeoutAfterError");$n(this,"timer",null);this.syncService=s,this.httpService=o,this.socketTimeoutTime=c,this.isHeadless=f,this.http=this.httpService.getInstance(),this.getSitefromCredential(n).then(({site:y,credential:m})=>{this.config={...m,avatar:y.site_organization.avatar,cover:y.site_organization.cover,name:y.name,quickAnswer:this.syncService.quickAnswer,site:y},this.status="found",a||this.sync().then(()=>{this.status="loading"}).catch(g=>{this.error=g,this.status="error"})}).catch(y=>{this.error=y,this.status="not-found"})}get config(){return this._config}set config(n){this._config=n}get error(){return this._error}set error(n){this._error=n}get message(){return this._message}set message(n){this._message=n}get status(){return this._status}set status(n){const a=this._status!==n;this._status=n,a&&(this.emit(n),this.emit("status-updated",n))}get twofa(){return this._twofa}set twofa(n){this._twofa=n,n&&(this.status="twofa",n.on("loading",()=>{this._twofa===n&&this.status==="twofa"&&(this.status="twofa-loading")}),n.on("twofa-api-error",()=>{this.status="twofa-api-error",this.socketClose()}))}getAvatar(){return this.config.avatar}getCover(){return this.config.cover}getCredentialData(){return{...this.config}}getName(){return this.config.name}getSite(){return{...this.config.site}}getSiteService(){return this.syncService.siteConnection(this.config.site)}setOption(n,a){this.options[n]=a}sync(){return this.configuredMeasureEvent("sync_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),this.loading=!0,this.startTimer(),this.http.put(`/v1/credentials/${this.config.id_credential}/sync`,{...this.spreadOptions()}).then(n=>(this.response=n,this.setSocket(n.ws),n)).catch(n=>(this.loading=!1,this.configuredMeasureEvent("sync_credential_error",{code:n.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(n)))}update(n,a,s,o){let c;return this.configuredMeasureEvent("update_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),isSiteV1Service(n)?c=n.getConnectData(a):isSiteV3Service(n)?c=n.getConnectData(s,a):c=n.getConnectData(s,a,o),this.startTimer(),this.http.put(`${n.config.endpoint}/${this.config.id_credential}`,c).then(f=>(this.status="loading",this.loading=!0,this.response=f,this.setSocket(f.ws),f)).catch(f=>(this.error=f,this.status="error",this.configuredMeasureEvent("update_credential_error",{code:f.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(f)))}clearTimer(){clearTimeout(this.timer)}configuredMeasureEvent(n,a){this.isHeadless||measureEvent(n,a)}getSitefromCredential(n){return this.http.get("/v1/credentials",{params:{...this.syncService.defaultParams,id_credential:n}}).then(a=>a.length?this.syncService.getOrganizationSites({id_site_organization:a[0].id_site_organization}).then(s=>{if(!s.length)return Promise.reject({response:{status:"449"}});let o=s[0].sites.find(c=>c.id_site===a[0].id_site);if(o)o={...o};else return Promise.reject({response:{status:"credential_not_found"}});return o.site_organization=s[0],{site:o,credential:a[0]}}).catch(s=>Promise.reject(s)):Promise.reject({response:{status:"credential_not_found"}}))}reopenSocket(n){this.isSocketOpen=!1,this.socketTimeoutAfterError||this.setSocket(n.target.url)}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const n=setInterval(()=>{this.isSocketOpen?clearInterval(n):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(n),this.socket.close(),this.loading=!1,this.status="socket-error")},2e3)}}setSocket(n){this.socket=new WebSocket(n),this.socket.onclose=a=>this.reopenSocket(a),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=a=>this.socketMessage(a),this.socket.onopen=()=>this.socketOpen()}socketClose(n){this.clearTimer(),this.socket.onclose=()=>{this.twofa=null,n&&n(this)},this.socket.close()}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.status="socket-error")}socketMessage(n){const a=JSON.parse(n.data);if(this.clearTimer(),this.config.quickAnswer&&a.code===102){this.socketClose(()=>{this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.status="socket-quick-answer"}),this.configuredMeasureEvent("sync_credential_success",{code:a.code,id_credential:this.config.id_credential,id_site:this.config.id_site});return}a.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),a.code===410&&(this.twofa=new TWOFA({...a,id_site:this.config.id_site},this.httpService)),this.emit("socket-message",a),this.startTimer(),a.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),200<=a.code&&a.code<300||400<=a.code&&a.code<600&&a.code!==410?(this.loading=!1,this.twofa&&(this.twofa.loading=!1),a.code<300?(this.configuredMeasureEvent("sync_credential_success",{code:a.code,id_credential:this.config.id_credential,id_site:this.config.id_site}),this.message=a,this.status="success"):(this.configuredMeasureEvent("sync_credential_error",{code:a.code,code_origin:"socket",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.error=a,this.status="error"),this.socketClose()):this.twofa&&a.code!==410&&this.twofa.statusChanged()}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.status="socket-timeout",this.socketClose()}spreadOptions(){const n=Object.keys(this.options).reduce((a,s)=>(this.options[s]!==null&&this.options[s]!==void 0&&(a[s]=this.options[s]),a),{});return Object.keys(n).length?{options:{...n}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.socketTimeoutTime)}}axios.defaults.baseURL="https://sync.paybook.com";class HttpService extends eventsExports.EventEmitter{constructor(n,a={}){const{os:s}=UAParser(navigator.userAgent);super();$n(this,"baseURL");$n(this,"isStrict");$n(this,"jwk");this.token=n,a.baseURL&&(this.baseURL=axios.defaults.baseURL=a.baseURL),this.isStrict=a.isStrict||!1,axios.defaults.headers.common={"x-app-version":`syncfy-widget:${a.widgetVersion}:${s.name}:${s.version}`}}getInstance(){const n=axios.create({baseURL:this.baseURL});return n.interceptors.request.use(a=>(a.headers.Authorization=`Bearer ${this.token}`,a),function(a){return Promise.reject(a)}),n.interceptors.response.use(a=>(this.emit("rid",a.data.rid),a.data.response||a.data||a),a=>{var s;return a.response&&(this.emit("rid",(s=a.response.data)==null?void 0:s.rid),a.response.status===401&&this.emit("401")),Promise.reject(a)}),this.isStrict&&n.interceptors.request.use(a=>a.data?createJWE(a.data,this.jwk).then(s=>(a.data={jwe:s},Promise.resolve(a))):Promise.resolve(a),a=>Promise.reject(a)),n}updateToken(n,a){this.token=n,a&&(this.jwk=a)}}class SiteV1Service extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"data",{});$n(this,"rules",{});if(this.defaultParams=s,this.userConfig=o,DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(n),n.credentials&&n.credentials.length)o.isHeadless||n.credentials.forEach(c=>{const f=c.name;Object.defineProperty(this.rules,f,{enumerable:!0,value:this.setRules(c),writable:!0})});else throw new Error("Site credentials are required.")}get version(){return 1}connect(n){const a=this.getConnectData(n);return this.startTimer(),this.http.post(this.config.endpoint,a).then(s=>(this.response=s,this.emit("login-success"),this.setSocket(s.ws),s)).catch(s=>(this.configuredMeasureEvent("sync_error",{code:s.response?s.response.status:s.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.loading=!1,this.data={},this.status="start",this.clearTimer(),Promise.reject(s)))}getConnectData(n){this.data={...n};const a={...this.data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(a),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const s={...this.defaultParams,id_site:this.config.id_site,credentials:a,...this.spreadOptions()};return this.config.request?Promise.resolve(s.credentials):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(s.save_credential=this.userConfig.saveCredential),this.testMode&&(s.test=1),s)}getFields(n=!1){return n?this.config.credentials.filter(a=>!a.identifier):this.config.credentials}getRules(n=!1){if(n){const a={};return this.getFields(!0).forEach(s=>{const o=s.name;a[o]=this.setRules(s)}),a}return this.rules}addDownloadOptions(n){n.credentials.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.credentials.push(DOWNLOAD_OPTIONS_ACTIVE),n.credentials.push(DOWNLOAD_OPTIONS))}}class SiteV3Service extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"input",[]);this.defaultParams=s,this.userConfig=o,n.input.forEach(c=>{const f={rules:{},data:{}};DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(c),c.fields.forEach(y=>{const m=y.name;Object.defineProperty(f.rules,m,{enumerable:!0,value:this.setRules(y),writable:!0}),f.data[m]=null}),this.input.push(f)})}get version(){return 3}connect(n,a){const s=this.getConnectData(n,a);return this.startTimer(),this.http.post(this.config.endpoint,s).then(o=>(this.response=o,this.emit("login-success"),this.setSocket(o.ws),o)).catch(o=>(this.configuredMeasureEvent("sync_error",{code:o.response?o.response.status:o.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.input[n].data={},this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(o)))}getConnectData(n,a){this.updateData(n,a);const s=n||0,o={...this.input[s].data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(o),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const c={...this.defaultParams,id_site:this.config.id_site,input_name:this.config.input[n].name,input:o,...this.spreadOptions()};return this.config.request?Promise.resolve(c.input):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(c.save_credential=this.userConfig.saveCredential),this.testMode&&(c.test=1),c)}getFields(n,a=!1){return a?this.config.input[n].fields.filter(s=>!s.identifier):this.config.input[n].fields}getOptions(){return this.config.input}getRules(n,a=!1){if(a){const s={};return this.getFields(n,!0).forEach(o=>{const c=o.name;s[c]=this.setRules(o)}),s}return this.input[n].rules}updateData(n,a){this.input[n].data={...a}}addDownloadOptions(n){n.fields.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.fields.push(DOWNLOAD_OPTIONS_ACTIVE),n.fields.push(DOWNLOAD_OPTIONS))}}class Sync extends eventsExports.EventEmitter{constructor(n,a){super();$n(this,"http");$n(this,"httpService");$n(this,"rid");this.token=n,this.config=a,this.httpService=a.http?new HttpService(n,{...a.http,widgetVersion:a.widgetVersion}):new HttpService(n,{widgetVersion:a.widgetVersion}),this.http=this.httpService.getInstance(),this.httpService.on("401",this.debounce401()),this.httpService.on("rid",s=>{this.rid=s})}get defaultParams(){return this.config.defaultParams}set defaultParams(n){this.config.defaultParams=n}get quickAnswer(){return this.config.quickAnswer}getAccounts(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/accounts",{params:{...this.config.defaultParams,...n}})}getCountries(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/countries",{params:{...this.config.defaultParams}})}getHttpService(){return this.httpService}getLastRid(){return this.rid}getOrganizationSites(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/organizations/sites",{params:{...this.config.defaultParams,...n}})}getOrganizationTypes(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/site_organization_types",{params:{...this.config.defaultParams}})}getSite(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get(`/v1/catalogues/widget/sites/${n}`,{params:{...this.config.defaultParams}})}siteConnection(n){switch(n.version){case 1:return new SiteV1Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});case 3:return new SiteV3Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});case 4:return new SiteV4Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout})}}strictMode({token:n,strict:a}){return this.token=n,decodeStrictKeys(a).then(({strictAuthorizationKey:s,strictBodyKey:o})=>createJWS({token:n},s).then(c=>(this.httpService.updateToken(c),getLocalKeys().then(({authorization:f})=>{const y={authorization:btoa(JSON.stringify(f.toJSON(!0)))};return createJWE(y,o).then(m=>this.updateStrictSession(n,c,m).then(()=>createJWS({token:n},f).then(g=>this.updateToken(g).then(()=>(this.httpService.updateToken(this.token,o),{jws:g,jwe:o})))))}))))}syncCredential(n,a=!1){return new Credential(n,a,this,this.httpService,this.config.socketTimeout,this.config.isHeadless)}updateApiBaseUrl(n){this.http.defaults.baseURL=n,axios.defaults.baseURL=n}updateEnvironment(n){switch(n){case"production":this.http.defaults.baseURL="https://sync.paybook.com",axios.defaults.baseURL="https://sync.paybook.com";break;case"development":this.http.defaults.baseURL="https://api.syncfy.paybook.dev",axios.defaults.baseURL="https://api.syncfy.paybook.dev";break;default:this.http.defaults.baseURL="https://sync.paybook.com",axios.defaults.baseURL="https://sync.paybook.com";break}}updateToken(n){return new Promise(a=>{this.token!==n&&(this.token=n,this.httpService.updateToken(this.token)),a({token:n})})}debounce401(){return debounce(200,()=>{this.emit("sync_401")})}updateStrictSession(n,a,s){return axios.put(`/v1/sessions/jwt/${n}`,{type:"jwt","payload/jwe":s},{headers:{Authorization:`Bearer ${a}`}})}}class NotificationUpdater{constructor(t){$n(this,"callback");$n(this,"messages");this.messages=t}getMessages(){return this.messages}subscribe(t){this.callback=t}updateMessages(t){this.messages={...this.messages,...t},this.callback&&this.callback()}}const _sfc_main$2=defineComponent({__name:"BackUpConnection",props:{assetsPath:{default:"https://s.paybook.com"},buttonDisabledStyle:{type:Boolean,default:!1},credential:{default:void 0},disableFormAutocomplete:{type:Boolean,default:!1},displayBackButton:{type:Boolean},errorMessage:{default:null},loaderMessage:{},selectClass:{default:""},showLogo:{type:Boolean},showPasswordStyle:{default:"icon"},site:{},testMode:{type:Boolean,default:!1},updateMode:{type:Boolean,default:!1}},emits:["back","error","success","valid"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c=ref(!1);return onMounted(()=>{n.site.on("status-update",f=>{f==="loading"?c.value=!0:c.value=!1})}),(f,y)=>(openBlock(),createElementBlock("div",{class:normalizeClass(f.$style["back-up-connection"])},[c.value?createCommentVNode("",!0):(openBlock(),createBlock(AppLoader,{key:0,avatar:n.showLogo?`${f.assetsPath}${n.site.config.avatar}`:void 0,grow:!1,icon:n.showLogo?void 0:"error",message:unref(o)("back_up_connection.description"),size:"large",title:unref(o)("back_up_connection.title"),type:"error",onImagesLoaded:y[0]||(y[0]=()=>unref(s)("images-loaded")),onImagesLoading:y[1]||(y[1]=()=>unref(s)("images-loading"))},null,8,["avatar","icon","message","title"])),createBaseVNode("div",{class:normalizeClass(f.$style["back-up-form"])},[createVNode(SiteForm,{"assets-path":n.assetsPath,"back-up-connection":!0,"button-disabled-style":n.buttonDisabledStyle,"credential-service":n.credential,"disable-form-autocomplete":n.disableFormAutocomplete,"display-back-button":n.displayBackButton,"error-message":n.errorMessage,"loader-message":n.loaderMessage,"select-class":n.selectClass,"show-header":!1,"show-logo":n.showLogo,"show-password-style":n.showPasswordStyle,site:n.site,"test-mode":n.testMode,"update-mode":n.updateMode,onBack:y[2]||(y[2]=()=>a("back")),onError:y[3]||(y[3]=m=>a("error",m)),onSuccess:y[4]||(y[4]=m=>a("success",m)),onValid:y[5]||(y[5]=()=>{unref(s)("back-up-site-submitted"),a("valid")})},null,8,["assets-path","button-disabled-style","credential-service","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode","update-mode"])],2)],2))}}),style0$1={"back-up-connection":"pb-w-sync_back-up-connection","back-up-icon":"pb-w-sync_back-up-icon","back-up-form":"pb-w-sync_back-up-form"},cssModules$1={$style:style0$1},BackUpConnection=_export_sfc(_sfc_main$2,[["__cssModules",cssModules$1]]),_hoisted_1=["aria-label"],_hoisted_2={key:1},_hoisted_3=["aria-label"],_hoisted_4={key:0},_sfc_main$1=defineComponent({__name:"DataWidget",props:{client:{},enableTestMode:{type:Boolean},entrypoint:{},internal:{},locale:{},navigation:{},refreshTokenFunction:{type:Function},strict:{},token:{}},emits:["tokenRefreshed"],setup(e,{expose:t,emit:n}){const a=e,s=n,o=inject(rootEmitter),{t:c,locale:f}=useI18n({useScope:"global"}),{mobile:y}=useMobile(),m=ref([]),g=ref(null),z=ref(null),ie=ref(!1),re=ref(!1),he=ref(null),_e=ref(null),$e=ref(null),pe=ref(""),Ce=ref(""),Oe=ref(a.navigation.displayPrivacyScreen),qe=ref(!0),At=ref(!1),Et=ref(null),ze=ref([]),kt=ref(null),Pt=ref(!1),jt=ref(null),Ie=ref(null),u=ref(!1),v=ref(!1);let Y="https://s.paybook.com",ae=null,xe=`${getVersion()}${a.strict?"-strict":""}`,Ve=null,Ue,Ne=null,L=[],Fe=null,Dt=null,er=null;const ir=computed(()=>{var Gr;return(Gr=z.value)!=null&&Gr.displayBackUpConnection||re.value?Fe:null}),cr=computed(()=>$e.value==="credential"||z.value||qe.value?!1:jt.value?a.entrypoint.site&&a.navigation.oneSiteFlow?jt.value==="twofa"&&a.navigation.enableTwofaBackNavigation||a.navigation.displayPrivacyScreen&&jt.value!=="finish":jt.value==="finish"?a.navigation.enableBackNavigation:jt.value==="twofa"?a.navigation.enableTwofaBackNavigation:a.navigation.enableBackNavigation&&jt.value==="start":!!kt.value||a.navigation.displayPrivacyScreen),sr=computed(()=>m.value.filter(Gr=>(Gr.id_country==="51ad44db3b8e77631200047d"||Gr.id_country==="51ad44793b8e77631200027a")&&a.internal.plaidSites||Or(Gr.id_country).length).sort((Gr,Lt)=>Gr.name.localeCompare(Lt.name))),ar=computed(()=>$r(g.value,kt.value)),fr=computed(()=>Or(g.value)),Cr=computed(()=>Pr(g.value,kt.value,Et.value)),Mr=computed(()=>({short:Ce.value,long:pe.value})),xr=computed(()=>{let Gr=[];return ze.value&&ze.value.forEach(Lt=>{Gr=[...Gr,...Lt.sites.map(tr=>({...tr,avatar:Lt.avatar,cover:Lt.cover,site_organization:Lt}))]}),Gr}),gr=computed(()=>ie.value||At.value?"":z.value?z.value.siteToUpdate?c("credential.header_title.update"):c("credential.header_title.sync"):Pt.value?c("accounts_selection.title"):jt.value?jt.value==="start"&&!ir.value?c("common.header.login"):"":kt.value?g.value&&kt.value?c("common.header.select"):"":c("common.header.link"));watch(()=>a.locale,(Gr,Lt)=>{Gr!==Lt&&["es","en"].includes(Gr)&&(f.value=Gr)}),watch(()=>a.internal,(Gr,Lt)=>{if(er.defaultParams=Gr.defaultHttpParams||{},er.defaultParams.locale=a.locale,Gr.apiEnv!==Lt.apiEnv)switch(er.updateEnvironment(Gr.apiEnv),Gr.apiEnv){case"production":Y="https://s.paybook.com";break;case"development":Y="https://s.paybook.dev";break;default:Y="https://s.paybook.com";break}Gr.apiBaseUrl!==Lt.apiBaseUrl&&Gr.apiBaseUrl&&er.updateApiBaseUrl(Gr.apiBaseUrl),Gr.assetsBaseUrl!==Lt.assetsBaseUrl&&Gr.assetsBaseUrl&&(Y=Gr.assetsBaseUrl),Lr()}),watch(()=>a.navigation.displayPersonalSites,()=>{Lr()}),watch(()=>a.navigation.displayBusinessSites,()=>{Lr()}),watch(Ce,Gr=>{Ve&&Ue.updateMessages({short:Gr})}),watch(pe,Gr=>{Ve&&Ue.updateMessages({long:Gr})}),watch(v,()=>{!v.value&&z.value?(z.value=null,Ne&&Ne()):!v.value&&!Ve&&jt.value&&jt.value!=="start"&&jt.value!=="finish"?(Ue=new NotificationUpdater({short:pe.value}),Ve=ElNotification.info({duration:0,message:h(TwofaNotification,{assetsPath:Y,buttonDisabledStyle:a.navigation.formButtonsDisabledStyle,disableFormAutocomplete:a.navigation.disableFormAutocomplete,duration:0,enableBackNavigation:a.navigation.enableTwofaBackNavigation,item:Fe,messagesUpdater:Ue,rootEmit:o,selectClass:a.navigation.selectClass,showLogo:a.navigation.displayLogoImages,showPasswordStyle:a.navigation.formShowPasswordStyle,t:c,type:"info",onBack:()=>{o("back"),Nr(),Fe=jt.value=null,Tr(Dt,!1),v.value=!0},onError:Gr=>{Kr(Gr)},onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),position:a.navigation.toastPosition,showClose:!1})):v.value&&Ve&&(v.value=!1,ElNotification.error({duration:0,position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})}))}),onMounted(()=>{nextTick(()=>{o("dom-updated")})}),onUpdated(()=>{nextTick(()=>{o("dom-updated")})});function dr(){["es","en"].includes(a.locale)&&(f.value=a.locale),Y=a.internal.apiEnv?a.internal.apiEnv==="production"?"https://s.paybook.com":"https://s.paybook.dev":"https://s.paybook.com",a.internal.assetsBaseUrl&&(Y=a.internal.assetsBaseUrl),a.strict?(Yr(),qe.value=!0,setTimeout(()=>{er.strictMode({token:a.token,strict:a.strict}).then(()=>{Lr()})},400)):(Yr(),Lr())}function Br(){return z.value.siteToUpdate}function Ir(){measureEvent("close"),v.value=!1,(jt.value==="start"||jt.value==="finish")&&(jt.value=Fe=null),o("closed")}function Nr(){Ve&&(Ve.close(),Ve=null)}function Kr(Gr){const Lt=Sr(Gr);z.value&&(z.value.siteToUpdate||u.value)?z.value={...z.value,displayBackUpConnection:!1,siteToUpdate:void 0}:!a.navigation.displayErrorsInToast&&v?(re.value=!1,jt.value="finish",Fe&&(Fe.finalResponse="error"),he.value=c(`${Lt}long_description`),_e.value=c(`${Lt}short_description`)):ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:a.navigation.displayLongDescription,duration:0,initLongMessage:c(`${Lt}long_description`),initMessage:c(`${Lt}short_description`),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),vr(Gr,Lt)}const _r=debounce(200,function(){if(ie.value=!1,a.entrypoint.credential)return hr(a.entrypoint.credential,!0);if(a.entrypoint.updateCredential)return Hr(a.entrypoint.updateCredential,!0);if(a.entrypoint.site&&a.navigation.oneSiteFlow)er.getSite(a.entrypoint.site).then(Gr=>{if(o("loaded"),Gr&&Gr.length){const Lt=Gr[0].site_organization;Tr({...Gr[0],avatar:Lt.avatar,cover:Lt.avatar,site_organization:Lt})}else jr({response:{status:"site_not_found"}})}).catch(Gr=>jr(Gr.response||Gr)).finally(()=>{qe.value=!1});else{const Gr={};(a.navigation.displayPersonalSites||a.navigation.displayBusinessSites)&&!(a.navigation.displayPersonalSites&&a.navigation.displayBusinessSites)&&(a.navigation.displayPersonalSites?Gr.is_personal=1:Gr.is_business=1);const Lt=[er.getCountries(),er.getOrganizationTypes(),er.getOrganizationSites(Gr)];return Promise.all(Lt).then(tr=>{m.value=tr[0],L=tr[1],a.internal.plaidSites&&L.unshift({id_site_organization_type:"__internal__.plaidSites",label:"webapp_add_banks",name:"plaid"}),ze.value=tr[2]}).then(()=>nextTick().then(()=>{if(o("loaded"),ur(),a.entrypoint.site){const tr=xr.value.find(rr=>rr.id_site===a.entrypoint.site);return tr?Tr(tr):Promise.reject({response:{response:{status:"site_not_found"}}})}})).catch(tr=>jr(tr.response||tr)).finally(()=>{qe.value=!1})}});function vr(Gr,Lt){o("api-error",Gr.response?Gr.response.status:500,{longMessage:c(`${Lt}real.long_description`),message:c(`${Lt}real.short_description`),noInternet:!Gr.response})}function Vr(Gr){o("socket-error",{longMessage:c(`socket.${Gr}.long_description`),type:Gr,message:c(`socket.${Gr}.short_description`)})}function $r(Gr,Lt){return(a.navigation.displaySiteOrganizations.length||a.navigation.hideSiteOrganizations.length?ze.value.filter(tr=>{if(a.navigation.displaySiteOrganizations.length)return!!a.navigation.displaySiteOrganizations.find(rr=>rr===tr.name||rr===tr.id_site_organization);if(a.navigation.hideSiteOrganizations.length)return!a.navigation.hideSiteOrganizations.find(rr=>rr===tr.name||rr===tr.id_site_organization)}):ze.value).filter(tr=>Gr===tr.id_country&&Lt===tr.id_site_organization_type&&Pr(Gr,Lt,tr.id_site_organization).length)}function Or(Gr){return(a.navigation.displaySiteOrganizationTypes.length||a.navigation.hideSiteOrganizationTypes.length?L.filter(Lt=>{if(a.navigation.displaySiteOrganizationTypes.length)return!!a.navigation.displaySiteOrganizationTypes.find(tr=>tr===Lt.name||tr===Lt.id_site_organization_type);if(a.navigation.hideSiteOrganizationTypes.length)return!a.navigation.hideSiteOrganizationTypes.find(tr=>tr===Lt.name||tr===Lt.id_site_organization_type)}):L).filter(Lt=>(Gr==="51ad44db3b8e77631200047d"||Gr==="51ad44793b8e77631200027a")&&a.internal.plaidSites&&Lt.id_site_organization_type==="__internal__.plaidSites"?!0:$r(Gr,Lt.id_site_organization_type).length)}function Pr(Gr,Lt,tr){return(a.navigation.displaySites.length||a.navigation.hideSites.length?xr.value.filter(rr=>{if(a.navigation.displaySites.length)return!!a.navigation.displaySites.find(pr=>pr===rr.name||pr===rr.id_site);if(a.navigation.hideSites.length)return!a.navigation.hideSites.find(pr=>pr===rr.name||pr===rr.id_site)}):xr.value).filter(rr=>Gr===rr.site_organization.id_country&&Lt===rr.site_organization.id_site_organization_type&&tr===rr.site_organization.id_site_organization)}function Sr(Gr){return typeof Gr=="string"?Gr:Gr.status===401?"api_errors.unauthorized.":Gr.response&&Gr.response.data&&Gr.response.data.message==="Credential error, please consider updating credential password"?"api_errors.credential_error.":`api_errors.${Gr.response?Gr.response.status?Gr.response.status:500:"no_internet"}.`}function Er(){return er.getLastRid()}function zr(){jt.value?jt.value==="finish"?re.value?xn():br():jt.value==="twofa"?En():xn():Et.value?lr():kt.value?nr():(o("back"),Oe.value=!0)}function Lr(){qe.value=!0,_r()}function jr(Gr){const Lt=Sr(Gr);ie.value=Lt,!Gr.response&&a.navigation.displayErrorsInToast&&ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initLongMessage:c(`${Lt}long_description`),initMessage:c(`${Lt}short_description`),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),o("loaded"),vr(Gr,Lt)}function Ar(){measureEvent("open"),qe.value||ur(),v.value=!0,o("opened")}function lr(Gr=!0){Gr&&o("back"),Et.value=null,ar.value.length===1&&nr(!1)}function nr(Gr=!0){Gr&&o("back"),kt.value=null,fr.value.length===1&&(sr.value.length===1||a.navigation.hideSelectCountry)&&a.navigation.displayPrivacyScreen&&(Oe.value=!0)}function or(){Oe.value=!1,(sr.value.length===1||a.navigation.hideSelectCountry)&&fr.value.length===1&&(kt.value=fr.value[0].id_site_organization_type)}function br(){kt.value=$e.value=jt.value=Et.value=Fe=null}function yr(Gr){o("organization-selected",Gr),measureEvent("open_site_organization",{id_site_organization:Gr.id_site_organization}),Et.value=Gr.id_site_organization,nextTick(()=>{Cr.value.length===1&&Tr(Cr.value[0])})}function Tr(Gr,Lt=!0){let tr;Lt&&(o("organization-site-selected",Gr),measureEvent("open_site",{id_site:Gr.id_site})),!Fe||!Fe.loading?(Dt=Gr,tr=Fe=er.siteConnection(Gr),jt.value="start",_e.value=null,he.value=null,Fe.on("login-success",()=>{v.value&&a.navigation.displayStatusInToast&&Ir()}),Fe.on("socket-close",Nr),Fe.on("socket-error",()=>{a.navigation.displayErrorsInToast?ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,duration:0,hideForm:!0,initLongMessage:c("socket.error.long_description"),initMessage:c("socket.error.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}):(he.value=c("socket.error.long_description"),_e.value=c("socket.error.short_description")),Vr("error")}),Fe.on("socket-message",rr=>{const pr=`socket.message.${rr.code?rr.code:500}.`,wr=c(`${pr}short_description`),Ur=c(`${pr}long_description`);switch(!0){case(400<=rr.code&&rr.code<600&&rr.code!==410):Nr(),_e.value=wr,he.value=Ur,o("error",Fe.response,{code:rr.code,longMessage:Ur,message:wr}),rr.code>=500&&isSiteV4Service(Fe)&&Fe.backUpConnection&&!$e.value&&(o("back-up-site",Fe.config.id_site),measureEvent("back-up-site",{id_site:Fe.config.id_site}),re.value=!0),v.value?a.navigation.returnToSiteFormOnUserError!==!1&&(a.navigation.returnToSiteFormOnUserError===!0&&[401,403,411].includes(rr.code)||a.navigation.returnToSiteFormOnUserError!==!0&&a.navigation.returnToSiteFormOnUserError.includes(rr.code))&&(jt.value=Fe=null,Tr(Dt,!1),Ie.value={short:wr,long:Ur}):re.value?Ar():(ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Ur,initMessage:wr,item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),br(),ur());break;case(200<=rr.code&&rr.code<300):Nr(),_e.value=wr,he.value=Ur,o("success",Fe.response),v.value?$e.value==="credential"&&(z.value={avatar:`${Y}${Fe.config.avatar}`,loaderType:"success",loading:!0,messages:{short:_e.value,long:he.value}}):(ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:Ur,initMessage:wr,item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),br(),ur());break;default:Ce.value=wr,pe.value=Ur}o("status",rr)}),Fe.on("socket-quick-answer",()=>{_e.value=c("socket.quick_answer.short_description"),he.value=c("socket.quick_answer.long_description"),o("success",Fe.response),Nr(),v.value?$e.value==="credential"&&(z.value={avatar:`${Y}${Fe.config.avatar}`,loaderType:"success",loading:!0,messages:{short:_e.value,long:he.value}}):(ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:c("socket.quick_answer.long_description"),initMessage:c("socket.quick_answer.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),br(),ur())}),Fe.on("socket-timeout",()=>{_e.value=c("socket.timeout.short_description"),he.value=c("socket.timeout.long_description"),o("error",Fe.response),(!v.value||a.navigation.displayErrorsInToast)&&(ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c("socket.timeout.long_description"),initMessage:c("socket.timeout.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),v.value||(br(),ur())),Vr("timeout")}),Fe.on("status-update",rr=>{Fe===tr&&(jt.value=rr)}),Fe.on("twofa",()=>{Ce.value=c("twofa.waiting")})):ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}function hr(Gr,Lt=!1,tr=!1){if(!Gr)throw new Error("idCredential is required to update credential");if(Oe.value=!1,qe.value=!1,tr?(u.value=!0,measureEvent("update_credential",{id_credential:Gr})):measureEvent("open_credential",{id_credential:Gr}),!ae||!ae.loading){let rr=new NotificationUpdater({short:c("credential.search.title")}),pr;Ne=()=>{pr=ElNotification.info({showClose:!1,position:a.navigation.toastPosition,duration:0,message:h(TwofaNotification,{assetsPath:Y,duration:0,messagesUpdater:rr,showLogo:!1,t:c,type:"info",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})})},a.navigation.displayCredentialInModal?(z.value={loaderType:"loading",loading:!0,messages:{short:c("credential.search.title"),long:c("credential.search.message")}},v.value||Ar()):(v.value&&Ir(),Ne()),ae=er.syncCredential(Gr,tr),ae.on("error",()=>{const{code:wr}=ae.error,Ur=ae.error.response?Sr(ae.error):`socket.message.${wr||500}.`,qr=c(`${Ur}short_description`),Jr=c(`${Ur}long_description`);v.value?(z.value={...z.value,loaderType:"error",messages:{short:qr,long:Jr},siteToUpdate:void 0},Ne=null):(ae.error.response?pr&&pr.close():Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Jr,initMessage:qr,item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),ae.error.response?vr(ae.error,Ur):o("error",ae.response,{code:wr,longMessage:Jr,message:qr})}),ae.on("found",()=>{Lt&&o("loaded"),tr?(pr&&pr.close(),Ne=null,pr=ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:a.navigation.toastDuration,initMessage:c("credential.found.title"),item:ae,assetsPath:Y,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),v.value=!0,z.value={avatar:a.navigation.displayLogoImages?`${Y}${ae.config.avatar}`:void 0,loading:!1,siteToUpdate:ae.getSiteService()}):(v.value&&(z.value={...z.value,avatar:a.navigation.displayLogoImages?`${Y}${ae.config.avatar}`:void 0,messages:{short:c("credential.found.title"),long:c("credential.found.message")}}),rr.updateMessages({long:c("credential.found.message"),short:c("credential.found.title")}))}),ae.on("loading",()=>{o("updated",ae.response),Ne=()=>{Ue=new NotificationUpdater({}),Ve=ElNotification.info({showClose:!1,position:a.navigation.toastPosition,duration:0,message:h(TwofaNotification,{assetsPath:Y,buttonDisabledStyle:a.navigation.formButtonsDisabledStyle,disableFormAutocomplete:a.navigation.disableFormAutocomplete,duration:0,item:ae,messagesUpdater:Ue,rootEmit:o,selectClass:a.navigation.selectClass,showLogo:a.navigation.displayLogoImages,showPasswordStyle:a.navigation.formShowPasswordStyle,t:c,type:"info",onError:wr=>{Nr(),Kr(wr)},onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})})},v.value?z.value={...z.value,loaderType:"loading",loading:!0,messages:{short:c("credential.loading.title"),long:c("credential.loading.message")},siteToUpdate:void 0}:(pr&&pr.close(),Ne())}),ae.on("not-found",()=>{const wr=Sr(ae.error);Lt&&o("loaded"),v.value?(z.value={...z.value,loaderType:"error",messages:{short:c(`${wr}short_description`),long:c(`${wr}long_description`)}},Ne=null):(pr&&pr.close(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c(`${wr}long_description`),initMessage:c(`${wr}short_description`),t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),vr(ae.error,wr)}),ae.on("socket-error",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("socket.error.short_description"),long:c("socket.error.long_description")}},Ne=null):(Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,initLongMessage:c("socket.error.long_description"),initMessage:c("socket.error.short_description"),item:ae,hideForm:!0,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),Vr("error")}),ae.on("socket-message",wr=>{const Ur=ae.getSite(),qr=`socket.message.${wr.code?wr.code:500}.`,Jr=c(`${qr}short_description`),Rn=c(`${qr}long_description`);wr.code>=500&&Ur.version===4&&Ur.input.some(Qr=>Qr.name===SiteV4Service.statementParseInputName)&&!$e.value?(Tr({...Ur,avatar:Ur.site_organization.avatar,cover:Ur.site_organization.cover},!1),o("back-up-site",Ur.id_site),measureEvent("back-up-site",{id_site:Ur.id_site}),z.value={...z.value,displayBackUpConnection:!0},v.value||(Nr(),Ar())):v.value?z.value={...z.value,messages:{short:Jr,long:Rn}}:Ue.updateMessages({long:Rn,short:Jr}),o("status",wr)}),ae.on("socket-quick-answer",()=>{_e.value=c("socket.quick_answer.short_description"),he.value=c("socket.quick_answer.long_description"),o("success",ae.response),v.value?(z.value={...z.value,loaderType:"success",messages:{short:c("socket.quick_answer.short_description"),long:c("socket.quick_answer.long_description")}},Ne=null):(Nr(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,initLongMessage:c("socket.quick_answer.long_description"),initMessage:c("socket.quick_answer.short_description"),item:ae,hideForm:!0,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}))}),ae.on("socket-timeout",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("socket.timeout.short_description"),long:c("socket.timeout.long_description")}},Ne=null):(Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c("socket.timeout.long_description"),initMessage:c("socket.timeout.short_description"),item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),o("error",ae.response),Vr("timeout")}),ae.on("success",()=>{const{code:wr}=ae.message,Ur=`socket.message.${wr||500}.`,qr=c(`${Ur}short_description`),Jr=c(`${Ur}long_description`);v.value?(z.value={...z.value,loaderType:"success",messages:{short:qr,long:Jr}},Ne=null):(Nr(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:Jr,initMessage:qr,item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration})),o("success",ae.response)}),ae.on("twofa",()=>{v.value&&pr&&pr.close(),z.value={...z.value,loading:!1}}),ae.on("twofa-api-error",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("credential.api_error.title"),long:c("credential.api_error.message")}},Ne=null):Nr()}),ae.on("twofa-loading",()=>{z.value={...z.value,loading:!0,loaderType:"loading",messages:{short:c("twofa.waiting"),long:c("twofa.waiting")}}})}else ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}function ur(){if(ie.value)return;let Gr;a.entrypoint.country&&(Gr=sr.value.find(Lt=>Lt.code===a.entrypoint.country||Lt.id_country===a.entrypoint.country)),sr.value.length?(g.value=Gr?Gr.id_country:sr.value[0].id_country,measureEvent("open_country",{id_country:g.value}),vn(),At.value=!1):!jt.value&&!z.value&&(At.value=!0)}function vn(){if(a.entrypoint.siteOrganizationType){const Gr=fr.value.find(Lt=>Lt.id_site_organization_type===a.entrypoint.siteOrganizationType);if(Gr){const Lt=Gr.id_site_organization_type;measureEvent("open_site_organization_type",{id_site_organization_type:Lt}),kt.value=Lt}}}function Yr(){er=new Sync(a.token,{http:{baseURL:a.internal.apiBaseUrl?a.internal.apiBaseUrl:a.internal.apiEnv?a.internal.apiEnv==="production"?"https://sync.paybook.com":"https://api.syncfy.paybook.dev":"https://sync.paybook.com",isStrict:!!a.strict},defaultParams:{locale:a.locale,...a.internal.defaultHttpParams},isHeadless:!1,quickAnswer:a.navigation.quickAnswer,saveCredential:a.navigation.saveCredential,socketTimeout:a.navigation.socketTimeout,widgetVersion:xe});let Gr=null;er.on("sync_401",()=>{a.refreshTokenFunction&&!Gr&&(Gr=ElNotification.error({position:a.navigation.toastPosition,showClose:!1,message:h(UnauthorizedNotification,{initTitle:c("common.unauthorized"),initMessage:c("common.unauthorized_message"),refreshTokenFunction:a.refreshTokenFunction,t:c,onClosed:()=>{Gr=null},onCloseNotification:()=>{Gr.close()},onRefreshToken:({token:Lt,strict:tr,resolve:rr})=>{s("tokenRefreshed",Lt),Wr(Lt,tr).then(()=>(Gr.close(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:a.navigation.toastDuration,initMessage:c("common.session_refreshed_message"),initTitle:c("common.session_refreshed"),showLogo:!1,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),Lr(),rr(null)))},onRefreshTokenError:()=>{ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:0,initMessage:c("common.session_error"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}}),duration:0})),o("401")})}function Wr(Gr,Lt){return Lt?er.strictMode({token:Gr,strict:Lt}):er.updateToken(Gr)}function xn(){o("back"),re.value=!1,$e.value=null,a.entrypoint.site&&a.navigation.oneSiteFlow&&a.navigation.displayPrivacyScreen?Oe.value=!0:(measureEvent("close_site",{id_site:Fe.config.id_site}),jt.value=Fe=null,Ie.value=null,Cr.value.length===1&&lr(!1))}function Xr(Gr=!1){Ce.value=c("site.login.authenticating"),Ie.value=null,Gr&&(z.value?$e.value="credential":$e.value="site")}function wn(){z.value&&(z.value=null),re.value&&(re.value=!1),Ce.value=c("site.login.success")}function En(Gr=!0){Gr&&o("back"),jt.value=Fe=null,Tr(Dt,!1)}function Hr(Gr,Lt=!1){if(!Gr)throw new Error("idCredential is required to update credential");hr(Gr,Lt,!0)}function Zr(){Ce.value=c("credential.loading.title"),pe.value=c("credential.loading.message")}return dr(),t({close:Ir,getLastRid:Er,open:Ar,setCredential:hr,setToken:Wr,updateCredential:Hr}),(Gr,Lt)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(TheModal,{visible:v.value,"onUpdate:visible":Lt[5]||(Lt[5]=tr=>v.value=tr),mobile:unref(y)},{default:withCtx(()=>[v.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass([Gr.$style.container,{[Gr.$style["is-mobile"]]:unref(y)}])},[Oe.value?(openBlock(),createBlock(PrivacyPolicy,{key:0,client:a.client,onContinue:or},null,8,["client"])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-header"])},[cr.value?(openBlock(),createElementBlock("button",{key:0,"aria-label":unref(c)("common.back"),class:normalizeClass(Gr.$style["widget-back-button"]),onClick:zr},[createVNode(_sfc_main$h,{icon:"back"})],10,_hoisted_1)):(openBlock(),createElementBlock("span",_hoisted_2)),createBaseVNode("h1",null,toDisplayString$1(jt.value&&a.entrypoint.site?unref(c)("common.update_title"):gr.value),1),createBaseVNode("button",{class:normalizeClass(Gr.$style["widget-close-button"]),"aria-label":unref(c)("common.close"),onClick:Ir},[createVNode(_sfc_main$h,{icon:"close"})],10,_hoisted_3)],2),createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-content"])},[z.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Gr.$style["credential-content"])},[z.value.displayBackUpConnection?(openBlock(),createBlock(BackUpConnection,{key:0,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,credential:unref(ae),"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":!1,"error-message":null,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:ir.value,"test-mode":Gr.enableTestMode,"update-mode":u.value,onError:Kr,onSuccess:wn,onValid:Lt[0]||(Lt[0]=()=>Xr(!0))},null,8,["assets-path","button-disabled-style","credential","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site","test-mode","update-mode"])):z.value.siteToUpdate?(openBlock(),createBlock(SiteForm,{key:1,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"credential-service":unref(ae),"display-back-button":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:Br(),"test-mode":Gr.enableTestMode,"update-mode":!0,onValid:Zr},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","credential-service","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):(openBlock(),createElementBlock(Fragment,{key:2},[z.value.loading||z.value.loaderType!=="loading"?(openBlock(),createBlock(AppLoader,{key:0,avatar:z.value.avatar,grow:z.value.loaderType==="loading",message:z.value.messages.long,size:"large",title:z.value.messages.short,type:z.value.loaderType},null,8,["avatar","grow","message","title","type"])):unref(ae).twofa?(openBlock(),createBlock(TwofaForm,{key:1,avatar:z.value.avatar,"button-disabled-style":a.navigation.formButtonsDisabledStyle,cover:`${unref(Y)}${unref(ae).config.cover}`,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"enable-back-navigation":!1,"in-notification":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,"site-name":unref(ae).config.name,twofa:unref(ae).twofa},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):createCommentVNode("",!0),z.value.loaderType!=="loading"?(openBlock(),createElementBlock("button",{key:2,class:"pb-w-sync_primary-button","data-testid":"credential-finish-button",onClick:Ir},toDisplayString$1(unref(c)("common.finish")),1)):createCommentVNode("",!0)],64))],2)):(openBlock(),createElementBlock(Fragment,{key:1},[qe.value?(openBlock(),createBlock(AppLoader,{key:0})):createCommentVNode("",!0),!qe.value&&!ie.value&&!At.value?(openBlock(),createElementBlock(Fragment,{key:1},[jt.value?(openBlock(),createElementBlock(Fragment,{key:1},[re.value?(openBlock(),createBlock(BackUpConnection,{key:0,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":!(a.entrypoint.site&&a.navigation.oneSiteFlow)||a.navigation.displayPrivacyScreen,"error-message":Ie.value,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:ir.value,"test-mode":Gr.enableTestMode,onBack:xn,onError:Kr,onSuccess:wn,onValid:Lt[3]||(Lt[3]=()=>Xr(!0))},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):jt.value==="start"||jt.value==="loading"?(openBlock(),createBlock(SiteForm,{key:1,"assets-path":unref(Y),"back-up-connection":!!$e.value,"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":a.navigation.enableBackNavigation&&$e.value!=="credential"&&(!(a.entrypoint.site&&a.navigation.oneSiteFlow)||a.navigation.displayPrivacyScreen),"error-message":Ie.value,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:unref(Fe),"test-mode":Gr.enableTestMode,onBack:xn,onError:Kr,onSuccess:wn,onValid:Xr},null,8,["assets-path","back-up-connection","button-disabled-style","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):jt.value==="twofa"||jt.value==="twofa-loading"?(openBlock(),createBlock(TwofaForm,{key:2,avatar:`${unref(Y)}${unref(Fe).config.avatar}`,"button-disabled-style":a.navigation.formButtonsDisabledStyle,cover:`${unref(Y)}${unref(Fe).config.cover}`,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"enable-back-navigation":a.navigation.enableTwofaBackNavigation&&$e.value!=="credential","in-notification":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,"site-name":unref(Fe).config.name,twofa:unref(Fe).twofa,onBack:En,onError:Kr},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","enable-back-navigation","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):jt.value==="finish"?(openBlock(),createElementBlock(Fragment,{key:3},[Pt.value?(openBlock(),createBlock(AccountsSelection,{key:0,avatar:a.navigation.displayLogoImages?`${unref(Y)}${unref(Fe).config.avatar}`:void 0,"button-disabled-style":a.navigation.formButtonsDisabledStyle,client:a.client,credential:unref(Fe).response.id_credential,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"get-selected-accounts":a.navigation.getSelectedAccounts,sync:unref(er),onDone:Ir},null,8,["avatar","button-disabled-style","client","credential","disable-form-autocomplete","get-selected-accounts","sync"])):(openBlock(),createBlock(FinalResponse,{key:1,avatar:`${unref(Y)}${unref(Fe).config.avatar}`,"display-accounts-selection":a.navigation.displayAccountsSelection,"display-add-another-button":$e.value!=="credential"&&!(a.navigation.oneSiteFlow&&a.entrypoint.site),"long-message":he.value,message:_e.value,"show-logo":a.navigation.displayLogoImages,type:unref(Fe).finalResponse,onAddOther:br,onSelectAccounts:Lt[4]||(Lt[4]=()=>{Pt.value=!0})},null,8,["avatar","display-accounts-selection","display-add-another-button","long-message","message","show-logo","type"]))],64)):createCommentVNode("",!0)],64)):(openBlock(),createElementBlock("div",_hoisted_4,[g.value&&!kt.value?(openBlock(),createBlock(InstitutionFilters,{key:0,"country-id":g.value,"onUpdate:countryId":Lt[1]||(Lt[1]=tr=>g.value=tr),"organization-type-id":kt.value,"onUpdate:organizationTypeId":Lt[2]||(Lt[2]=tr=>kt.value=tr),"filtered-countries":sr.value,"filtered-organization-types":fr.value,"select-class":a.navigation.selectClass,"show-countries":!a.navigation.hideSelectCountry},null,8,["country-id","organization-type-id","filtered-countries","filtered-organization-types","select-class","show-countries"])):createCommentVNode("",!0),g.value&&kt.value&&!Et.value?(openBlock(),createBlock(OrganizationSitesList,{key:1,"assets-path":unref(Y),items:ar.value,"show-logo":a.navigation.displayLogoImages,"show-plaid-sites-button":a.internal.plaidSites&&kt.value==="__internal__.plaidSites",onSelect:yr},null,8,["assets-path","items","show-logo","show-plaid-sites-button"])):createCommentVNode("",!0),g.value&&kt.value&&Et.value?(openBlock(),createBlock(SitesList,{key:2,"assets-path":unref(Y),items:Cr.value,organization:ar.value.find(tr=>tr.id_site_organization===Et.value),"show-logo":a.navigation.displayLogoImages,onBack:lr,onSelect:Tr},null,8,["assets-path","items","organization","show-logo"])):createCommentVNode("",!0)]))],64)):createCommentVNode("",!0),ie.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(Gr.$style["widget-data-error"])},[createVNode(_sfc_main$h,{icon:"x-circle"}),createBaseVNode("h2",null,toDisplayString$1(unref(c)(`${ie.value}short_description`)),1),createBaseVNode("p",null,toDisplayString$1(unref(c)(`${ie.value}long_description`)),1),createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:Lr},toDisplayString$1(unref(c)("common.retry")),1)],2)):createCommentVNode("",!0),At.value?(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(Gr.$style["widget-data-error"])},[createVNode(_sfc_main$h,{icon:"x-circle"}),createBaseVNode("p",null,toDisplayString$1(unref(c)("common.no_filtered_data")),1),createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:Ir},toDisplayString$1(unref(c)("common.close")),1)],2)):createCommentVNode("",!0)],64)),!qe.value&&!ie.value&&!At.value||z.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(Gr.$style["security-banner"])},[createBaseVNode("p",null,toDisplayString$1(unref(c)("common.security_banner_title")),1),createBaseVNode("p",null,toDisplayString$1(unref(c)("common.security_banner_content")),1)],2)):createCommentVNode("",!0)],2)],64))],2)):createCommentVNode("",!0)]),_:1},8,["visible","mobile"]),createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-version"])},toDisplayString$1(unref(xe)),3)],64))}}),container="pb-w-sync_container",style0={container,"credential-content":"pb-w-sync_credential-content","is-mobile":"pb-w-sync_is-mobile","security-banner":"pb-w-sync_security-banner","widget-back-button":"pb-w-sync_widget-back-button","widget-close-button":"pb-w-sync_widget-close-button","widget-content":"pb-w-sync_widget-content","widget-data-error":"pb-w-sync_widget-data-error","widget-header":"pb-w-sync_widget-header","widget-version":"pb-w-sync_widget-version"},cssModules={$style:style0},DataWidget=_export_sfc(_sfc_main$1,[["__cssModules",cssModules]]),defaultConfig={client:{},locale:"en",entrypoint:{country:"MX"},navigation:{disableFormAutocomplete:!1,displayAccountsSelection:!1,displayBusinessSites:!0,displayCredentialInModal:!1,displayErrorsInToast:!0,displayLogoImages:!0,displayLongDescription:!1,displayPersonalSites:!0,displayPrivacyScreen:!0,displaySiteOrganizations:[],displaySiteOrganizationTypes:[],displaySites:[],displayStatusInToast:!1,enableBackNavigation:!0,enableTwofaBackNavigation:!1,formButtonsDisabledStyle:!1,formShowPasswordStyle:"icon",getSelectedAccounts:void 0,hideSelectCountry:!1,hideSiteOrganizations:[],hideSiteOrganizationTypes:[],hideSites:[],oneSiteFlow:!1,quickAnswer:!1,returnToSiteFormOnUserError:!1,saveCredential:!0,selectClass:"",socketTimeout:24e4,toastDuration:5e3,toastPosition:"top-right"},__internal__:{apiBaseUrl:null,apiEnv:null,assetsBaseUrl:null,plaidSites:!1,defaultHttpParams:{}}},_sfc_main=defineComponent({__name:"App",props:{config:{default:()=>({})},enableTestMode:{type:Boolean,default:!1},refreshTokenFunction:{type:Function,default:void 0},strict:{default:void 0},token:{}},setup(e,{expose:t}){const n=e,a=ref(null),{t:s}=useI18n();provide(translateFunction,s);const o=reactive({client:{...defaultConfig.client,..._e(n.config.client)},enableTestMode:n.enableTestMode,entrypoint:{...defaultConfig.entrypoint,..._e(n.config.entrypoint)},internal:{...defaultConfig.__internal__,..._e(n.config.__internal__)},locale:n.config.locale||defaultConfig.locale,navigation:{...defaultConfig.navigation,..._e(n.config.navigation)},refreshTokenFunction:n.refreshTokenFunction,strict:n.strict,token:n.token,onTokenRefreshed:$e=>{o.token=$e}});function c(){a.value.close()}function f(){return a.value.getLastRid()}function y(){nextTick(()=>{a.value.open()})}function m($e={}){try{configValidator.validateSync($e)}catch(pe){if(pe.name==="ValidationError")throw new Error(`ValidationError: ${pe.message}`)}o.client={...defaultConfig.client,..._e($e.client)},o.entrypoint={...defaultConfig.entrypoint,..._e($e.entrypoint)},o.internal={...defaultConfig.__internal__,..._e($e.__internal__)},o.locale=$e.locale||defaultConfig.locale,o.navigation={...defaultConfig.navigation,..._e($e.navigation)}}function g($e){a.value.setCredential($e)}function z($e){o.entrypoint={...o.entrypoint,site:$e},y()}function ie($e){a.value.updateCredential($e)}function re($e,pe){return a.value.setToken($e,pe)}function he($e={}){try{configValidator.validateSync($e)}catch(pe){if(pe.name==="ValidationError")throw new Error(`ValidationError: ${pe.message}`)}o.client={...o.client,..._e($e.client)},o.entrypoint={...o.entrypoint,..._e($e.entrypoint)},o.internal={...o.internal,..._e($e.__internal__)},o.locale=$e.locale||o.locale,o.navigation={...o.navigation,..._e($e.navigation)}}function _e($e={}){const pe={...$e};return Object.keys(pe).forEach(Ce=>{pe[Ce]===void 0&&delete pe[Ce]}),pe}return t({close:c,getLastRid:f,open:y,setConfig:m,setEntrypointCredential:g,setEntrypointSite:z,setEntrypointUpdateCredential:ie,setToken:re,upsertConfig:he}),($e,pe)=>(openBlock(),createBlock(unref(ElConfigProvider),{locale:o.locale==="es"?unref(es):unref(en)},{default:withCtx(()=>[createVNode(DataWidget,mergeProps(o,{ref_key:"widgetComponent",ref:a}),null,16)]),_:1},8,["locale"]))}});function setDefaultConfig(e){return e||(e={}),{locale:e.locale?e.locale:"en",quickAnswer:!!e.quickAnswer,socketTimeout:e.socketTimeout||24e4}}function setSync(e,t){return new Promise(a=>{const s=new Sync(e.token,{http:{baseURL:"https://sync.paybook.com",isStrict:!!e.strict},defaultParams:{locale:t.locale},isHeadless:!0,quickAnswer:t.quickAnswer,socketTimeout:t.socketTimeout,widgetVersion:`${getVersion()}-headless`});e.strict?s.strictMode({token:e.token,strict:e.strict}).then(()=>{a(s)}):a(s)})}function getAccounts(e,t,n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getAccounts({id_credential:t}).then(y=>{s(y)}).catch(y=>{o(y)})})})}function getCountries(e,t){return new Promise((a,s)=>{const o=setDefaultConfig(t);setSync(e,o).then(c=>{c.getCountries().then(f=>{a(f)}).catch(f=>{s(f)})})})}function getOrganizationSites(e,t={},n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getOrganizationSites(t).then(y=>{s(y)}).catch(y=>{o(y)})})})}function getOrganizationTypes(e,t){return new Promise((a,s)=>{const o=setDefaultConfig(t);setSync(e,o).then(c=>{c.getOrganizationTypes().then(f=>{a(f)}).catch(f=>{s(f)})})})}function getSite(e,t,n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getSite(t).then(y=>{s(y[0])}).catch(y=>{o(y)})})})}function siteConnection(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.siteConnection(t))})})}function syncCredential(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.syncCredential(t))})})}function twofa(e,t,n,a){return new Promise(o=>{const c=setDefaultConfig(a);setSync(e,c).then(f=>{o(new TWOFA({...t,id_site:n},f.getHttpService(),!1))})})}function updateCredential(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.syncCredential(t,!0))})})}const staticMethods={getAccounts,getCountries,getOrganizationSites,getOrganizationTypes,getSite,siteConnection,syncCredential,twofa,updateCredential};initFirebase();class SyncfyWidget{constructor(t){const n=new Rollbar({accessToken:"2d928ea9aa674c6ea84dbf6f3901a403",captureUncaught:!1,captureUnhandledRejections:!1,enabled:!0,environment:"production",payload:{code_version:getVersion()}});let a;if(typeof t=="string")a={token:t};else if(typeof t=="object")a=t;else throw new Error("Invalid params type. Params must be either string or object.");try{paramsValidator.validateSync(a)}catch(g){if(g.name==="ValidationError")throw new Error(`ValidationError: ${g.message}`)}measureEvent("instantiation");const s=createApp(_sfc_main,{config:a.config,enableTestMode:a.enableTestMode,refreshTokenFunction:a.refreshTokenFunction,strict:a.strict,token:a.token}),o=createI18n({fallbackLocale:"en",locale:"en",messages:{en:resource$1,es:resource}});s.use(o),s.use(ge$1),s.config.errorHandler=g=>{throw n.error(g),g};const c=[];function f(g,z){c.push({callback:z,e:g})}function y(g,...z){c.forEach(({callback:ie,e:re})=>{g===re&&ie(...z)})}s.provide(rootEmitter,y);const m=s.mount(a.element||"#widget");return{on:f,close:m.close,getLastRid:m.getLastRid,open:m.open,setConfig:m.setConfig,setEntrypointCredential:m.setEntrypointCredential,setEntrypointSite:m.setEntrypointSite,setEntrypointUpdateCredential:m.setEntrypointUpdateCredential,setToken:m.setToken,upsertConfig:m.upsertConfig}}static getVersion(){return getVersion()}}return $n(SyncfyWidget,"headless",staticMethods),window.SyncfyWidget=SyncfyWidget,SyncfyWidget});
|
|
877
|
+
`+o):a.stack=o}catch{}}throw a}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=mergeConfig$1(this.defaults,n);const{transitional:a,paramsSerializer:s,headers:o}=n;a!==void 0&&validator.assertOptions(a,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),s!=null&&(utils$1.isFunction(s)?n.paramsSerializer={serialize:s}:validator.assertOptions(s,{encode:validators.function,serialize:validators.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),validator.assertOptions(n,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&utils$1.merge(o.common,o[n.method]);o&&utils$1.forEach(["delete","get","head","post","put","patch","common"],he=>{delete o[he]}),n.headers=AxiosHeaders$1.concat(c,o);const f=[];let y=!0;this.interceptors.request.forEach(function(_e){typeof _e.runWhen=="function"&&_e.runWhen(n)===!1||(y=y&&_e.synchronous,f.unshift(_e.fulfilled,_e.rejected))});const m=[];this.interceptors.response.forEach(function(_e){m.push(_e.fulfilled,_e.rejected)});let g,z=0,ie;if(!y){const he=[dispatchRequest.bind(this),void 0];for(he.unshift.apply(he,f),he.push.apply(he,m),ie=he.length,g=Promise.resolve(n);z<ie;)g=g.then(he[z++],he[z++]);return g}ie=f.length;let re=n;for(z=0;z<ie;){const he=f[z++],_e=f[z++];try{re=he(re)}catch($e){_e.call(this,$e);break}}try{g=dispatchRequest.call(this,re)}catch(he){return Promise.reject(he)}for(z=0,ie=m.length;z<ie;)g=g.then(m[z++],m[z++]);return g}getUri(t){t=mergeConfig$1(this.defaults,t);const n=buildFullPath(t.baseURL,t.url,t.allowAbsoluteUrls);return buildURL(n,t.params,t.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function e(t){Axios$1.prototype[t]=function(n,a){return this.request(mergeConfig$1(a||{},{method:t,url:n,data:(a||{}).data}))}}),utils$1.forEach(["post","put","patch"],function e(t){function n(a){return function(o,c,f){return this.request(mergeConfig$1(f||{},{method:t,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}Axios$1.prototype[t]=n(),Axios$1.prototype[t+"Form"]=n(!0)});let CancelToken$1=class si{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const a=this;this.promise.then(s=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](s);a._listeners=null}),this.promise.then=s=>{let o;const c=new Promise(f=>{a.subscribe(f),o=f}).then(s);return c.cancel=function(){a.unsubscribe(o)},c},t(function(o,c,f){a.reason||(a.reason=new CanceledError$1(o,c,f),n(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=a=>{t.abort(a)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new si(function(s){t=s}),cancel:t}}};function spread$1(e){return function(n){return e.apply(null,n)}}function isAxiosError$1(e){return utils$1.isObject(e)&&e.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([e,t])=>{HttpStatusCode$1[t]=e});function createInstance(e){const t=new Axios$1(e),n=bind(Axios$1.prototype.request,t);return utils$1.extend(n,Axios$1.prototype,t,{allOwnKeys:!0}),utils$1.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return createInstance(mergeConfig$1(e,s))},n}const axios=createInstance(defaults);axios.Axios=Axios$1,axios.CanceledError=CanceledError$1,axios.CancelToken=CancelToken$1,axios.isCancel=isCancel$1,axios.VERSION=VERSION$1,axios.toFormData=toFormData$1,axios.AxiosError=AxiosError$1,axios.Cancel=axios.CanceledError,axios.all=function e(t){return Promise.all(t)},axios.spread=spread$1,axios.isAxiosError=isAxiosError$1,axios.mergeConfig=mergeConfig$1,axios.AxiosHeaders=AxiosHeaders$1,axios.formToJSON=e=>formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e),axios.getAdapter=adapters.getAdapter,axios.HttpStatusCode=HttpStatusCode$1,axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function throttle(e,t,n){var a=n||{},s=a.noTrailing,o=s===void 0?!1:s,c=a.noLeading,f=c===void 0?!1:c,y=a.debounceMode,m=y===void 0?void 0:y,g,z=!1,ie=0;function re(){g&&clearTimeout(g)}function he($e){var pe=$e||{},Ce=pe.upcomingOnly,Oe=Ce===void 0?!1:Ce;re(),z=!Oe}function _e(){for(var $e=arguments.length,pe=new Array($e),Ce=0;Ce<$e;Ce++)pe[Ce]=arguments[Ce];var Oe=this,qe=Date.now()-ie;if(z)return;function At(){ie=Date.now(),t.apply(Oe,pe)}function Et(){g=void 0}!f&&m&&!g&&At(),re(),m===void 0&&qe>e?f?(ie=Date.now(),o||(g=setTimeout(m?Et:At,e))):At():o!==!0&&(g=setTimeout(m?Et:At,m===void 0?e-qe:e))}return _e.cancel=he,_e}function debounce(e,t,n){var a={},s=a.atBegin,o=s===void 0?!1:s;return throttle(e,t,{debounceMode:o!==!1})}class Credential extends eventsExports.EventEmitter{constructor(n,a,s,o,c,f=!1){super();$n(this,"loading",!1);$n(this,"response");$n(this,"_config");$n(this,"_error");$n(this,"_message");$n(this,"_status","searching");$n(this,"_twofa");$n(this,"http");$n(this,"isSocketOpen",!1);$n(this,"options",{});$n(this,"socket");$n(this,"socketOpened",!1);$n(this,"socketTimeoutAfterError");$n(this,"timer",null);this.syncService=s,this.httpService=o,this.socketTimeoutTime=c,this.isHeadless=f,this.http=this.httpService.getInstance(),this.getSitefromCredential(n).then(({site:y,credential:m})=>{this.config={...m,avatar:y.site_organization.avatar,cover:y.site_organization.cover,name:y.name,quickAnswer:this.syncService.quickAnswer,site:y},this.status="found",a||this.sync().then(()=>{this.status="loading"}).catch(g=>{this.error=g,this.status="error"})}).catch(y=>{this.error=y,this.status="not-found"})}get config(){return this._config}set config(n){this._config=n}get error(){return this._error}set error(n){this._error=n}get message(){return this._message}set message(n){this._message=n}get status(){return this._status}set status(n){const a=this._status!==n;this._status=n,a&&(this.emit(n),this.emit("status-updated",n))}get twofa(){return this._twofa}set twofa(n){this._twofa=n,n&&(this.status="twofa",n.on("loading",()=>{this._twofa===n&&this.status==="twofa"&&(this.status="twofa-loading")}),n.on("twofa-api-error",()=>{this.status="twofa-api-error",this.socketClose()}))}getAvatar(){return this.config.avatar}getCover(){return this.config.cover}getCredentialData(){return{...this.config}}getName(){return this.config.name}getSite(){return{...this.config.site}}getSiteService(){return this.syncService.siteConnection(this.config.site)}setOption(n,a){this.options[n]=a}sync(){return this.configuredMeasureEvent("sync_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),this.loading=!0,this.startTimer(),this.http.put(`/v1/credentials/${this.config.id_credential}/sync`,{...this.spreadOptions()}).then(n=>(this.response=n,this.setSocket(n.ws),n)).catch(n=>(this.loading=!1,this.configuredMeasureEvent("sync_credential_error",{code:n.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(n)))}update(n,a,s,o){let c;return this.configuredMeasureEvent("update_credential",{id_credential:this.config.id_credential,id_site:this.config.id_site}),isSiteV1Service(n)?c=n.getConnectData(a):isSiteV3Service(n)?c=n.getConnectData(s,a):c=n.getConnectData(s,a,o),this.startTimer(),this.http.put(`/v1/credentials/${this.config.id_credential}/pulls`,c).then(f=>(this.status="loading",this.loading=!0,this.response=f,this.setSocket(f.ws),f)).catch(f=>(this.error=f,this.status="error",this.configuredMeasureEvent("update_credential_error",{code:f.response.status,code_origin:"endpoint",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.clearTimer(),Promise.reject(f)))}clearTimer(){clearTimeout(this.timer)}configuredMeasureEvent(n,a){this.isHeadless||measureEvent(n,a)}getSitefromCredential(n){return this.http.get("/v1/credentials",{params:{...this.syncService.defaultParams,id_credential:n}}).then(a=>a.length?this.syncService.getOrganizationSites({id_site_organization:a[0].id_site_organization}).then(s=>{if(!s.length)return Promise.reject({response:{status:"449"}});let o=s[0].sites.find(c=>c.id_site===a[0].id_site);if(o)o={...o};else return Promise.reject({response:{status:"credential_not_found"}});return o.site_organization=s[0],{site:o,credential:a[0]}}).catch(s=>Promise.reject(s)):Promise.reject({response:{status:"credential_not_found"}}))}reopenSocket(n){this.isSocketOpen=!1,this.socketTimeoutAfterError||this.setSocket(n.target.url)}reopenSocketAfterError(){if(!this.socketTimeoutAfterError){this.socketTimeoutAfterError=new Date().getTime()+12e4,this.setSocket(this.response.ws);const n=setInterval(()=>{this.isSocketOpen?clearInterval(n):new Date().getTime()<this.socketTimeoutAfterError?(this.socket.close(),this.setSocket(this.response.ws)):(clearInterval(n),this.socket.close(),this.loading=!1,this.status="socket-error")},2e3)}}setSocket(n){this.socket=new WebSocket(n),this.socket.onclose=a=>this.reopenSocket(a),this.socket.onerror=()=>this.socketError(),this.socket.onmessage=a=>this.socketMessage(a),this.socket.onopen=()=>this.socketOpen()}socketClose(n){this.clearTimer(),this.socket.onclose=()=>{this.twofa=null,n&&n(this)},this.socket.close()}socketError(){this.isSocketOpen=!1,this.socketOpened?this.reopenSocketAfterError():(this.loading=!1,this.status="socket-error")}socketMessage(n){const a=JSON.parse(n.data);if(this.clearTimer(),this.config.quickAnswer&&a.code===102){this.socketClose(()=>{this.loading=!1,this.twofa&&(this.twofa.loading=!1),this.status="socket-quick-answer"}),this.configuredMeasureEvent("sync_credential_success",{code:a.code,id_credential:this.config.id_credential,id_site:this.config.id_site});return}a.code===401&&this.configuredMeasureEvent("unauthorized",{id_site:this.config.id_site}),a.code===410&&(this.twofa=new TWOFA({...a,id_site:this.config.id_site},this.httpService)),this.emit("socket-message",a),this.startTimer(),a.code===411&&this.configuredMeasureEvent("twofa_timeout",{id_site:this.config.id_site}),200<=a.code&&a.code<300||400<=a.code&&a.code<600&&a.code!==410?(this.loading=!1,this.twofa&&(this.twofa.loading=!1),a.code<300?(this.configuredMeasureEvent("sync_credential_success",{code:a.code,id_credential:this.config.id_credential,id_site:this.config.id_site}),this.message=a,this.status="success"):(this.configuredMeasureEvent("sync_credential_error",{code:a.code,code_origin:"socket",id_credential:this.config.id_credential,id_site:this.config.id_site}),this.error=a,this.status="error"),this.socketClose()):this.twofa&&a.code!==410&&this.twofa.statusChanged()}socketOpen(){this.isSocketOpen=this.socketOpened=!0,this.socketTimeoutAfterError=void 0}socketTimeout(){this.status="socket-timeout",this.socketClose()}spreadOptions(){const n=Object.keys(this.options).reduce((a,s)=>(this.options[s]!==null&&this.options[s]!==void 0&&(a[s]=this.options[s]),a),{});return Object.keys(n).length?{options:{...n}}:{}}startTimer(){this.timer=setTimeout(()=>{this.socketTimeout()},this.socketTimeoutTime)}}axios.defaults.baseURL="https://sync.paybook.com";class HttpService extends eventsExports.EventEmitter{constructor(n,a={}){const{os:s}=UAParser(navigator.userAgent);super();$n(this,"baseURL");$n(this,"isStrict");$n(this,"jwk");this.token=n,a.baseURL&&(this.baseURL=axios.defaults.baseURL=a.baseURL),this.isStrict=a.isStrict||!1,axios.defaults.headers.common={"x-app-version":`syncfy-widget:${a.widgetVersion}:${s.name}:${s.version}`}}getInstance(){const n=axios.create({baseURL:this.baseURL});return n.interceptors.request.use(a=>(a.headers.Authorization=`Bearer ${this.token}`,a),function(a){return Promise.reject(a)}),n.interceptors.response.use(a=>(this.emit("rid",a.data.rid),a.data.response||a.data||a),a=>{var s;return a.response&&(this.emit("rid",(s=a.response.data)==null?void 0:s.rid),a.response.status===401&&this.emit("401")),Promise.reject(a)}),this.isStrict&&n.interceptors.request.use(a=>a.data?createJWE(a.data,this.jwk).then(s=>(a.data={jwe:s},Promise.resolve(a))):Promise.resolve(a),a=>Promise.reject(a)),n}updateToken(n,a){this.token=n,a&&(this.jwk=a)}}class SiteV1Service extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"data",{});$n(this,"rules",{});if(this.defaultParams=s,this.userConfig=o,DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(n),n.credentials&&n.credentials.length)o.isHeadless||n.credentials.forEach(c=>{const f=c.name;Object.defineProperty(this.rules,f,{enumerable:!0,value:this.setRules(c),writable:!0})});else throw new Error("Site credentials are required.")}get version(){return 1}connect(n){const a=this.getConnectData(n);return this.startTimer(),this.http.post(this.config.endpoint,a).then(s=>(this.response=s,this.emit("login-success"),this.setSocket(s.ws),s)).catch(s=>(this.configuredMeasureEvent("sync_error",{code:s.response?s.response.status:s.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.loading=!1,this.data={},this.status="start",this.clearTimer(),Promise.reject(s)))}getConnectData(n){this.data={...n};const a={...this.data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(a),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const s={...this.defaultParams,id_site:this.config.id_site,credentials:a,...this.spreadOptions()};return this.config.request?Promise.resolve(s.credentials):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(s.save_credential=this.userConfig.saveCredential),this.testMode&&(s.test=1),s)}getFields(n=!1){return n?this.config.credentials.filter(a=>!a.identifier):this.config.credentials}getRules(n=!1){if(n){const a={};return this.getFields(!0).forEach(s=>{const o=s.name;a[o]=this.setRules(s)}),a}return this.rules}addDownloadOptions(n){n.credentials.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.credentials.push(DOWNLOAD_OPTIONS_ACTIVE),n.credentials.push(DOWNLOAD_OPTIONS))}}class SiteV3Service extends SiteBase{constructor(n,a,s,o){super(n,a,o);$n(this,"input",[]);this.defaultParams=s,this.userConfig=o,n.input.forEach(c=>{const f={rules:{},data:{}};DOWNLOAD_OPTIONS_SITES.includes(n.id_site)&&this.addDownloadOptions(c),c.fields.forEach(y=>{const m=y.name;Object.defineProperty(f.rules,m,{enumerable:!0,value:this.setRules(y),writable:!0}),f.data[m]=null}),this.input.push(f)})}get version(){return 3}connect(n,a){const s=this.getConnectData(n,a);return this.startTimer(),this.http.post(this.config.endpoint,s).then(o=>(this.response=o,this.emit("login-success"),this.setSocket(o.ws),o)).catch(o=>(this.configuredMeasureEvent("sync_error",{code:o.response?o.response.status:o.toString(),code_origin:"endpoint",id_site:this.config.id_site}),this.input[n].data={},this.loading=!1,this.status="start",this.clearTimer(),Promise.reject(o)))}getConnectData(n,a){this.updateData(n,a);const s=n||0,o={...this.input[s].data};DOWNLOAD_OPTIONS_SITES.includes(this.config.id_site)&&this.moveDownloadOptions(o),this.testMode?this.setOption("allowMultipleRequests",!0):this.setOption("allowMultipleRequests",void 0);const c={...this.defaultParams,id_site:this.config.id_site,input_name:this.config.input[n].name,input:o,...this.spreadOptions()};return this.config.request?Promise.resolve(c.input):(this.configuredMeasureEvent("sync",{id_site:this.config.id_site}),this.loading=!0,this.userConfig.saveCredential||(c.save_credential=this.userConfig.saveCredential),this.testMode&&(c.test=1),c)}getFields(n,a=!1){return a?this.config.input[n].fields.filter(s=>!s.identifier):this.config.input[n].fields}getOptions(){return this.config.input}getRules(n,a=!1){if(a){const s={};return this.getFields(n,!0).forEach(o=>{const c=o.name;s[c]=this.setRules(o)}),s}return this.input[n].rules}updateData(n,a){this.input[n].data={...a}}addDownloadOptions(n){n.fields.includes(DOWNLOAD_OPTIONS_ACTIVE)||(n.fields.push(DOWNLOAD_OPTIONS_ACTIVE),n.fields.push(DOWNLOAD_OPTIONS))}}class Sync extends eventsExports.EventEmitter{constructor(n,a){super();$n(this,"http");$n(this,"httpService");$n(this,"rid");this.token=n,this.config=a,this.httpService=a.http?new HttpService(n,{...a.http,widgetVersion:a.widgetVersion}):new HttpService(n,{widgetVersion:a.widgetVersion}),this.http=this.httpService.getInstance(),this.httpService.on("401",this.debounce401()),this.httpService.on("rid",s=>{this.rid=s})}get defaultParams(){return this.config.defaultParams}set defaultParams(n){this.config.defaultParams=n}get quickAnswer(){return this.config.quickAnswer}getAccounts(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/accounts",{params:{...this.config.defaultParams,...n}})}getCountries(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/countries",{params:{...this.config.defaultParams}})}getHttpService(){return this.httpService}getLastRid(){return this.rid}getOrganizationSites(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/organizations/sites",{params:{...this.config.defaultParams,...n}})}getOrganizationTypes(){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get("/v1/catalogues/site_organization_types",{params:{...this.config.defaultParams}})}getSite(n){if(!this.token)throw new Error("Token is required. Try calling first getToken()");return this.http.get(`/v1/catalogues/widget/sites/${n}`,{params:{...this.config.defaultParams}})}siteConnection(n){switch(n.version){case 1:return new SiteV1Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});case 3:return new SiteV3Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout});case 4:return new SiteV4Service({...n,quickAnswer:this.config.quickAnswer},this.httpService,this.config.defaultParams,{isHeadless:this.config.isHeadless,saveCredential:this.config.saveCredential,socketTimeoutTime:this.config.socketTimeout})}}strictMode({token:n,strict:a}){return this.token=n,decodeStrictKeys(a).then(({strictAuthorizationKey:s,strictBodyKey:o})=>createJWS({token:n},s).then(c=>(this.httpService.updateToken(c),getLocalKeys().then(({authorization:f})=>{const y={authorization:btoa(JSON.stringify(f.toJSON(!0)))};return createJWE(y,o).then(m=>this.updateStrictSession(n,c,m).then(()=>createJWS({token:n},f).then(g=>this.updateToken(g).then(()=>(this.httpService.updateToken(this.token,o),{jws:g,jwe:o})))))}))))}syncCredential(n,a=!1){return new Credential(n,a,this,this.httpService,this.config.socketTimeout,this.config.isHeadless)}updateApiBaseUrl(n){this.http.defaults.baseURL=n,axios.defaults.baseURL=n}updateEnvironment(n){switch(n){case"production":this.http.defaults.baseURL="https://sync.paybook.com",axios.defaults.baseURL="https://sync.paybook.com";break;case"development":this.http.defaults.baseURL="https://api.syncfy.paybook.dev",axios.defaults.baseURL="https://api.syncfy.paybook.dev";break;default:this.http.defaults.baseURL="https://sync.paybook.com",axios.defaults.baseURL="https://sync.paybook.com";break}}updateToken(n){return new Promise(a=>{this.token!==n&&(this.token=n,this.httpService.updateToken(this.token)),a({token:n})})}debounce401(){return debounce(200,()=>{this.emit("sync_401")})}updateStrictSession(n,a,s){return axios.put(`/v1/sessions/jwt/${n}`,{type:"jwt","payload/jwe":s},{headers:{Authorization:`Bearer ${a}`}})}}class NotificationUpdater{constructor(t){$n(this,"callback");$n(this,"messages");this.messages=t}getMessages(){return this.messages}subscribe(t){this.callback=t}updateMessages(t){this.messages={...this.messages,...t},this.callback&&this.callback()}}const _sfc_main$2=defineComponent({__name:"BackUpConnection",props:{assetsPath:{default:"https://s.paybook.com"},buttonDisabledStyle:{type:Boolean,default:!1},credential:{default:void 0},disableFormAutocomplete:{type:Boolean,default:!1},displayBackButton:{type:Boolean},errorMessage:{default:null},loaderMessage:{},selectClass:{default:""},showLogo:{type:Boolean},showPasswordStyle:{default:"icon"},site:{},testMode:{type:Boolean,default:!1},updateMode:{type:Boolean,default:!1}},emits:["back","error","success","valid"],setup(e,{emit:t}){const n=e,a=t,s=inject(rootEmitter),{t:o}=useI18n(),c=ref(!1);return onMounted(()=>{n.site.on("status-update",f=>{f==="loading"?c.value=!0:c.value=!1})}),(f,y)=>(openBlock(),createElementBlock("div",{class:normalizeClass(f.$style["back-up-connection"])},[c.value?createCommentVNode("",!0):(openBlock(),createBlock(AppLoader,{key:0,avatar:n.showLogo?`${f.assetsPath}${n.site.config.avatar}`:void 0,grow:!1,icon:n.showLogo?void 0:"error",message:unref(o)("back_up_connection.description"),size:"large",title:unref(o)("back_up_connection.title"),type:"error",onImagesLoaded:y[0]||(y[0]=()=>unref(s)("images-loaded")),onImagesLoading:y[1]||(y[1]=()=>unref(s)("images-loading"))},null,8,["avatar","icon","message","title"])),createBaseVNode("div",{class:normalizeClass(f.$style["back-up-form"])},[createVNode(SiteForm,{"assets-path":n.assetsPath,"back-up-connection":!0,"button-disabled-style":n.buttonDisabledStyle,"credential-service":n.credential,"disable-form-autocomplete":n.disableFormAutocomplete,"display-back-button":n.displayBackButton,"error-message":n.errorMessage,"loader-message":n.loaderMessage,"select-class":n.selectClass,"show-header":!1,"show-logo":n.showLogo,"show-password-style":n.showPasswordStyle,site:n.site,"test-mode":n.testMode,"update-mode":n.updateMode,onBack:y[2]||(y[2]=()=>a("back")),onError:y[3]||(y[3]=m=>a("error",m)),onSuccess:y[4]||(y[4]=m=>a("success",m)),onValid:y[5]||(y[5]=()=>{unref(s)("back-up-site-submitted"),a("valid")})},null,8,["assets-path","button-disabled-style","credential-service","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode","update-mode"])],2)],2))}}),style0$1={"back-up-connection":"pb-w-sync_back-up-connection","back-up-icon":"pb-w-sync_back-up-icon","back-up-form":"pb-w-sync_back-up-form"},cssModules$1={$style:style0$1},BackUpConnection=_export_sfc(_sfc_main$2,[["__cssModules",cssModules$1]]),_hoisted_1=["aria-label"],_hoisted_2={key:1},_hoisted_3=["aria-label"],_hoisted_4={key:0},_sfc_main$1=defineComponent({__name:"DataWidget",props:{client:{},enableTestMode:{type:Boolean},entrypoint:{},internal:{},locale:{},navigation:{},refreshTokenFunction:{type:Function},strict:{},token:{}},emits:["tokenRefreshed"],setup(e,{expose:t,emit:n}){const a=e,s=n,o=inject(rootEmitter),{t:c,locale:f}=useI18n({useScope:"global"}),{mobile:y}=useMobile(),m=ref([]),g=ref(null),z=ref(null),ie=ref(!1),re=ref(!1),he=ref(null),_e=ref(null),$e=ref(null),pe=ref(""),Ce=ref(""),Oe=ref(a.navigation.displayPrivacyScreen),qe=ref(!0),At=ref(!1),Et=ref(null),ze=ref([]),kt=ref(null),Pt=ref(!1),jt=ref(null),Ie=ref(null),u=ref(!1),v=ref(!1);let Y="https://s.paybook.com",ae=null,xe=`${getVersion()}${a.strict?"-strict":""}`,Ve=null,Ue,Ne=null,L=[],Fe=null,Dt=null,er=null;const ir=computed(()=>{var Gr;return(Gr=z.value)!=null&&Gr.displayBackUpConnection||re.value?Fe:null}),cr=computed(()=>$e.value==="credential"||z.value||qe.value?!1:jt.value?a.entrypoint.site&&a.navigation.oneSiteFlow?jt.value==="twofa"&&a.navigation.enableTwofaBackNavigation||a.navigation.displayPrivacyScreen&&jt.value!=="finish":jt.value==="finish"?a.navigation.enableBackNavigation:jt.value==="twofa"?a.navigation.enableTwofaBackNavigation:a.navigation.enableBackNavigation&&jt.value==="start":!!kt.value||a.navigation.displayPrivacyScreen),sr=computed(()=>m.value.filter(Gr=>(Gr.id_country==="51ad44db3b8e77631200047d"||Gr.id_country==="51ad44793b8e77631200027a")&&a.internal.plaidSites||Or(Gr.id_country).length).sort((Gr,Lt)=>Gr.name.localeCompare(Lt.name))),ar=computed(()=>$r(g.value,kt.value)),fr=computed(()=>Or(g.value)),Cr=computed(()=>Pr(g.value,kt.value,Et.value)),Mr=computed(()=>({short:Ce.value,long:pe.value})),xr=computed(()=>{let Gr=[];return ze.value&&ze.value.forEach(Lt=>{Gr=[...Gr,...Lt.sites.map(tr=>({...tr,avatar:Lt.avatar,cover:Lt.cover,site_organization:Lt}))]}),Gr}),gr=computed(()=>ie.value||At.value?"":z.value?z.value.siteToUpdate?c("credential.header_title.update"):c("credential.header_title.sync"):Pt.value?c("accounts_selection.title"):jt.value?jt.value==="start"&&!ir.value?c("common.header.login"):"":kt.value?g.value&&kt.value?c("common.header.select"):"":c("common.header.link"));watch(()=>a.locale,(Gr,Lt)=>{Gr!==Lt&&["es","en"].includes(Gr)&&(f.value=Gr)}),watch(()=>a.internal,(Gr,Lt)=>{if(er.defaultParams=Gr.defaultHttpParams||{},er.defaultParams.locale=a.locale,Gr.apiEnv!==Lt.apiEnv)switch(er.updateEnvironment(Gr.apiEnv),Gr.apiEnv){case"production":Y="https://s.paybook.com";break;case"development":Y="https://s.paybook.dev";break;default:Y="https://s.paybook.com";break}Gr.apiBaseUrl!==Lt.apiBaseUrl&&Gr.apiBaseUrl&&er.updateApiBaseUrl(Gr.apiBaseUrl),Gr.assetsBaseUrl!==Lt.assetsBaseUrl&&Gr.assetsBaseUrl&&(Y=Gr.assetsBaseUrl),Lr()}),watch(()=>a.navigation.displayPersonalSites,()=>{Lr()}),watch(()=>a.navigation.displayBusinessSites,()=>{Lr()}),watch(Ce,Gr=>{Ve&&Ue.updateMessages({short:Gr})}),watch(pe,Gr=>{Ve&&Ue.updateMessages({long:Gr})}),watch(v,()=>{!v.value&&z.value?(z.value=null,Ne&&Ne()):!v.value&&!Ve&&jt.value&&jt.value!=="start"&&jt.value!=="finish"?(Ue=new NotificationUpdater({short:pe.value}),Ve=ElNotification.info({duration:0,message:h(TwofaNotification,{assetsPath:Y,buttonDisabledStyle:a.navigation.formButtonsDisabledStyle,disableFormAutocomplete:a.navigation.disableFormAutocomplete,duration:0,enableBackNavigation:a.navigation.enableTwofaBackNavigation,item:Fe,messagesUpdater:Ue,rootEmit:o,selectClass:a.navigation.selectClass,showLogo:a.navigation.displayLogoImages,showPasswordStyle:a.navigation.formShowPasswordStyle,t:c,type:"info",onBack:()=>{o("back"),Nr(),Fe=jt.value=null,Tr(Dt,!1),v.value=!0},onError:Gr=>{Kr(Gr)},onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),position:a.navigation.toastPosition,showClose:!1})):v.value&&Ve&&(v.value=!1,ElNotification.error({duration:0,position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})}))}),onMounted(()=>{nextTick(()=>{o("dom-updated")})}),onUpdated(()=>{nextTick(()=>{o("dom-updated")})});function dr(){["es","en"].includes(a.locale)&&(f.value=a.locale),Y=a.internal.apiEnv?a.internal.apiEnv==="production"?"https://s.paybook.com":"https://s.paybook.dev":"https://s.paybook.com",a.internal.assetsBaseUrl&&(Y=a.internal.assetsBaseUrl),a.strict?(Yr(),qe.value=!0,setTimeout(()=>{er.strictMode({token:a.token,strict:a.strict}).then(()=>{Lr()})},400)):(Yr(),Lr())}function Br(){return z.value.siteToUpdate}function Ir(){measureEvent("close"),v.value=!1,(jt.value==="start"||jt.value==="finish")&&(jt.value=Fe=null),o("closed")}function Nr(){Ve&&(Ve.close(),Ve=null)}function Kr(Gr){const Lt=Sr(Gr);z.value&&(z.value.siteToUpdate||u.value)?z.value={...z.value,displayBackUpConnection:!1,siteToUpdate:void 0}:!a.navigation.displayErrorsInToast&&v?(re.value=!1,jt.value="finish",Fe&&(Fe.finalResponse="error"),he.value=c(`${Lt}long_description`),_e.value=c(`${Lt}short_description`)):ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:a.navigation.displayLongDescription,duration:0,initLongMessage:c(`${Lt}long_description`),initMessage:c(`${Lt}short_description`),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),vr(Gr,Lt)}const _r=debounce(200,function(){if(ie.value=!1,a.entrypoint.credential)return hr(a.entrypoint.credential,!0);if(a.entrypoint.updateCredential)return Hr(a.entrypoint.updateCredential,!0);if(a.entrypoint.site&&a.navigation.oneSiteFlow)er.getSite(a.entrypoint.site).then(Gr=>{if(o("loaded"),Gr&&Gr.length){const Lt=Gr[0].site_organization;Tr({...Gr[0],avatar:Lt.avatar,cover:Lt.avatar,site_organization:Lt})}else jr({response:{status:"site_not_found"}})}).catch(Gr=>jr(Gr.response||Gr)).finally(()=>{qe.value=!1});else{const Gr={};(a.navigation.displayPersonalSites||a.navigation.displayBusinessSites)&&!(a.navigation.displayPersonalSites&&a.navigation.displayBusinessSites)&&(a.navigation.displayPersonalSites?Gr.is_personal=1:Gr.is_business=1);const Lt=[er.getCountries(),er.getOrganizationTypes(),er.getOrganizationSites(Gr)];return Promise.all(Lt).then(tr=>{m.value=tr[0],L=tr[1],a.internal.plaidSites&&L.unshift({id_site_organization_type:"__internal__.plaidSites",label:"webapp_add_banks",name:"plaid"}),ze.value=tr[2]}).then(()=>nextTick().then(()=>{if(o("loaded"),ur(),a.entrypoint.site){const tr=xr.value.find(rr=>rr.id_site===a.entrypoint.site);return tr?Tr(tr):Promise.reject({response:{response:{status:"site_not_found"}}})}})).catch(tr=>jr(tr.response||tr)).finally(()=>{qe.value=!1})}});function vr(Gr,Lt){o("api-error",Gr.response?Gr.response.status:500,{longMessage:c(`${Lt}real.long_description`),message:c(`${Lt}real.short_description`),noInternet:!Gr.response})}function Vr(Gr){o("socket-error",{longMessage:c(`socket.${Gr}.long_description`),type:Gr,message:c(`socket.${Gr}.short_description`)})}function $r(Gr,Lt){return(a.navigation.displaySiteOrganizations.length||a.navigation.hideSiteOrganizations.length?ze.value.filter(tr=>{if(a.navigation.displaySiteOrganizations.length)return!!a.navigation.displaySiteOrganizations.find(rr=>rr===tr.name||rr===tr.id_site_organization);if(a.navigation.hideSiteOrganizations.length)return!a.navigation.hideSiteOrganizations.find(rr=>rr===tr.name||rr===tr.id_site_organization)}):ze.value).filter(tr=>Gr===tr.id_country&&Lt===tr.id_site_organization_type&&Pr(Gr,Lt,tr.id_site_organization).length)}function Or(Gr){return(a.navigation.displaySiteOrganizationTypes.length||a.navigation.hideSiteOrganizationTypes.length?L.filter(Lt=>{if(a.navigation.displaySiteOrganizationTypes.length)return!!a.navigation.displaySiteOrganizationTypes.find(tr=>tr===Lt.name||tr===Lt.id_site_organization_type);if(a.navigation.hideSiteOrganizationTypes.length)return!a.navigation.hideSiteOrganizationTypes.find(tr=>tr===Lt.name||tr===Lt.id_site_organization_type)}):L).filter(Lt=>(Gr==="51ad44db3b8e77631200047d"||Gr==="51ad44793b8e77631200027a")&&a.internal.plaidSites&&Lt.id_site_organization_type==="__internal__.plaidSites"?!0:$r(Gr,Lt.id_site_organization_type).length)}function Pr(Gr,Lt,tr){return(a.navigation.displaySites.length||a.navigation.hideSites.length?xr.value.filter(rr=>{if(a.navigation.displaySites.length)return!!a.navigation.displaySites.find(pr=>pr===rr.name||pr===rr.id_site);if(a.navigation.hideSites.length)return!a.navigation.hideSites.find(pr=>pr===rr.name||pr===rr.id_site)}):xr.value).filter(rr=>Gr===rr.site_organization.id_country&&Lt===rr.site_organization.id_site_organization_type&&tr===rr.site_organization.id_site_organization)}function Sr(Gr){return typeof Gr=="string"?Gr:Gr.status===401?"api_errors.unauthorized.":Gr.response&&Gr.response.data&&Gr.response.data.message==="Credential error, please consider updating credential password"?"api_errors.credential_error.":`api_errors.${Gr.response?Gr.response.status?Gr.response.status:500:"no_internet"}.`}function Er(){return er.getLastRid()}function zr(){jt.value?jt.value==="finish"?re.value?xn():br():jt.value==="twofa"?En():xn():Et.value?lr():kt.value?nr():(o("back"),Oe.value=!0)}function Lr(){qe.value=!0,_r()}function jr(Gr){const Lt=Sr(Gr);ie.value=Lt,!Gr.response&&a.navigation.displayErrorsInToast&&ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initLongMessage:c(`${Lt}long_description`),initMessage:c(`${Lt}short_description`),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),o("loaded"),vr(Gr,Lt)}function Ar(){measureEvent("open"),qe.value||ur(),v.value=!0,o("opened")}function lr(Gr=!0){Gr&&o("back"),Et.value=null,ar.value.length===1&&nr(!1)}function nr(Gr=!0){Gr&&o("back"),kt.value=null,fr.value.length===1&&(sr.value.length===1||a.navigation.hideSelectCountry)&&a.navigation.displayPrivacyScreen&&(Oe.value=!0)}function or(){Oe.value=!1,(sr.value.length===1||a.navigation.hideSelectCountry)&&fr.value.length===1&&(kt.value=fr.value[0].id_site_organization_type)}function br(){kt.value=$e.value=jt.value=Et.value=Fe=null}function yr(Gr){o("organization-selected",Gr),measureEvent("open_site_organization",{id_site_organization:Gr.id_site_organization}),Et.value=Gr.id_site_organization,nextTick(()=>{Cr.value.length===1&&Tr(Cr.value[0])})}function Tr(Gr,Lt=!0){let tr;Lt&&(o("organization-site-selected",Gr),measureEvent("open_site",{id_site:Gr.id_site})),!Fe||!Fe.loading?(Dt=Gr,tr=Fe=er.siteConnection(Gr),jt.value="start",_e.value=null,he.value=null,Fe.on("login-success",()=>{v.value&&a.navigation.displayStatusInToast&&Ir()}),Fe.on("socket-close",Nr),Fe.on("socket-error",()=>{a.navigation.displayErrorsInToast?ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,duration:0,hideForm:!0,initLongMessage:c("socket.error.long_description"),initMessage:c("socket.error.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}):(he.value=c("socket.error.long_description"),_e.value=c("socket.error.short_description")),Vr("error")}),Fe.on("socket-message",rr=>{const pr=`socket.message.${rr.code?rr.code:500}.`,wr=c(`${pr}short_description`),Ur=c(`${pr}long_description`);switch(!0){case(400<=rr.code&&rr.code<600&&rr.code!==410):Nr(),_e.value=wr,he.value=Ur,o("error",Fe.response,{code:rr.code,longMessage:Ur,message:wr}),rr.code>=500&&isSiteV4Service(Fe)&&Fe.backUpConnection&&!$e.value&&(o("back-up-site",Fe.config.id_site),measureEvent("back-up-site",{id_site:Fe.config.id_site}),re.value=!0),v.value?a.navigation.returnToSiteFormOnUserError!==!1&&(a.navigation.returnToSiteFormOnUserError===!0&&[401,403,411].includes(rr.code)||a.navigation.returnToSiteFormOnUserError!==!0&&a.navigation.returnToSiteFormOnUserError.includes(rr.code))&&(jt.value=Fe=null,Tr(Dt,!1),Ie.value={short:wr,long:Ur}):re.value?Ar():(ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Ur,initMessage:wr,item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),br(),ur());break;case(200<=rr.code&&rr.code<300):Nr(),_e.value=wr,he.value=Ur,o("success",Fe.response),v.value?$e.value==="credential"&&(z.value={avatar:`${Y}${Fe.config.avatar}`,loaderType:"success",loading:!0,messages:{short:_e.value,long:he.value}}):(ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:Ur,initMessage:wr,item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),br(),ur());break;default:Ce.value=wr,pe.value=Ur}o("status",rr)}),Fe.on("socket-quick-answer",()=>{_e.value=c("socket.quick_answer.short_description"),he.value=c("socket.quick_answer.long_description"),o("success",Fe.response),Nr(),v.value?$e.value==="credential"&&(z.value={avatar:`${Y}${Fe.config.avatar}`,loaderType:"success",loading:!0,messages:{short:_e.value,long:he.value}}):(ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:c("socket.quick_answer.long_description"),initMessage:c("socket.quick_answer.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),br(),ur())}),Fe.on("socket-timeout",()=>{_e.value=c("socket.timeout.short_description"),he.value=c("socket.timeout.long_description"),o("error",Fe.response),(!v.value||a.navigation.displayErrorsInToast)&&(ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c("socket.timeout.long_description"),initMessage:c("socket.timeout.short_description"),item:Fe,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0}),v.value||(br(),ur())),Vr("timeout")}),Fe.on("status-update",rr=>{Fe===tr&&(jt.value=rr)}),Fe.on("twofa",()=>{Ce.value=c("twofa.waiting")})):ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}function hr(Gr,Lt=!1,tr=!1){if(!Gr)throw new Error("idCredential is required to update credential");if(Oe.value=!1,qe.value=!1,tr?(u.value=!0,measureEvent("update_credential",{id_credential:Gr})):measureEvent("open_credential",{id_credential:Gr}),!ae||!ae.loading){let rr=new NotificationUpdater({short:c("credential.search.title")}),pr;Ne=()=>{pr=ElNotification.info({showClose:!1,position:a.navigation.toastPosition,duration:0,message:h(TwofaNotification,{assetsPath:Y,duration:0,messagesUpdater:rr,showLogo:!1,t:c,type:"info",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})})},a.navigation.displayCredentialInModal?(z.value={loaderType:"loading",loading:!0,messages:{short:c("credential.search.title"),long:c("credential.search.message")}},v.value||Ar()):(v.value&&Ir(),Ne()),ae=er.syncCredential(Gr,tr),ae.on("error",()=>{const{code:wr}=ae.error,Ur=ae.error.response?Sr(ae.error):`socket.message.${wr||500}.`,qr=c(`${Ur}short_description`),Jr=c(`${Ur}long_description`);v.value?(z.value={...z.value,loaderType:"error",messages:{short:qr,long:Jr},siteToUpdate:void 0},Ne=null):(ae.error.response?pr&&pr.close():Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:Jr,initMessage:qr,item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),ae.error.response?vr(ae.error,Ur):o("error",ae.response,{code:wr,longMessage:Jr,message:qr})}),ae.on("found",()=>{Lt&&o("loaded"),tr?(pr&&pr.close(),Ne=null,pr=ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:a.navigation.toastDuration,initMessage:c("credential.found.title"),item:ae,assetsPath:Y,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),v.value=!0,z.value={avatar:a.navigation.displayLogoImages?`${Y}${ae.config.avatar}`:void 0,loading:!1,siteToUpdate:ae.getSiteService()}):(v.value&&(z.value={...z.value,avatar:a.navigation.displayLogoImages?`${Y}${ae.config.avatar}`:void 0,messages:{short:c("credential.found.title"),long:c("credential.found.message")}}),rr.updateMessages({long:c("credential.found.message"),short:c("credential.found.title")}))}),ae.on("loading",()=>{o("updated",ae.response),Ne=()=>{Ue=new NotificationUpdater({}),Ve=ElNotification.info({showClose:!1,position:a.navigation.toastPosition,duration:0,message:h(TwofaNotification,{assetsPath:Y,buttonDisabledStyle:a.navigation.formButtonsDisabledStyle,disableFormAutocomplete:a.navigation.disableFormAutocomplete,duration:0,item:ae,messagesUpdater:Ue,rootEmit:o,selectClass:a.navigation.selectClass,showLogo:a.navigation.displayLogoImages,showPasswordStyle:a.navigation.formShowPasswordStyle,t:c,type:"info",onError:wr=>{Nr(),Kr(wr)},onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}})})},v.value?z.value={...z.value,loaderType:"loading",loading:!0,messages:{short:c("credential.loading.title"),long:c("credential.loading.message")},siteToUpdate:void 0}:(pr&&pr.close(),Ne())}),ae.on("not-found",()=>{const wr=Sr(ae.error);Lt&&o("loaded"),v.value?(z.value={...z.value,loaderType:"error",messages:{short:c(`${wr}short_description`),long:c(`${wr}long_description`)}},Ne=null):(pr&&pr.close(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c(`${wr}long_description`),initMessage:c(`${wr}short_description`),t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),vr(ae.error,wr)}),ae.on("socket-error",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("socket.error.short_description"),long:c("socket.error.long_description")}},Ne=null):(Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,initLongMessage:c("socket.error.long_description"),initMessage:c("socket.error.short_description"),item:ae,hideForm:!0,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),Vr("error")}),ae.on("socket-message",wr=>{const Ur=ae.getSite(),qr=`socket.message.${wr.code?wr.code:500}.`,Jr=c(`${qr}short_description`),Rn=c(`${qr}long_description`);wr.code>=500&&Ur.version===4&&Ur.input.some(Qr=>Qr.name===SiteV4Service.statementParseInputName)&&!$e.value?(Tr({...Ur,avatar:Ur.site_organization.avatar,cover:Ur.site_organization.cover},!1),o("back-up-site",Ur.id_site),measureEvent("back-up-site",{id_site:Ur.id_site}),z.value={...z.value,displayBackUpConnection:!0},v.value||(Nr(),Ar())):v.value?z.value={...z.value,messages:{short:Jr,long:Rn}}:Ue.updateMessages({long:Rn,short:Jr}),o("status",wr)}),ae.on("socket-quick-answer",()=>{_e.value=c("socket.quick_answer.short_description"),he.value=c("socket.quick_answer.long_description"),o("success",ae.response),v.value?(z.value={...z.value,loaderType:"success",messages:{short:c("socket.quick_answer.short_description"),long:c("socket.quick_answer.long_description")}},Ne=null):(Nr(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,initLongMessage:c("socket.quick_answer.long_description"),initMessage:c("socket.quick_answer.short_description"),item:ae,hideForm:!0,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}))}),ae.on("socket-timeout",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("socket.timeout.short_description"),long:c("socket.timeout.long_description")}},Ne=null):(Nr(),ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:0,hideForm:!0,initLongMessage:c("socket.timeout.long_description"),initMessage:c("socket.timeout.short_description"),item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})),o("error",ae.response),Vr("timeout")}),ae.on("success",()=>{const{code:wr}=ae.message,Ur=`socket.message.${wr||500}.`,qr=c(`${Ur}short_description`),Jr=c(`${Ur}long_description`);v.value?(z.value={...z.value,loaderType:"success",messages:{short:qr,long:Jr}},Ne=null):(Nr(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{assetsPath:Y,displayLongDescription:a.navigation.displayLongDescription,duration:a.navigation.toastDuration,hideForm:!0,initLongMessage:Jr,initMessage:qr,item:ae,showLogo:a.navigation.displayLogoImages,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration})),o("success",ae.response)}),ae.on("twofa",()=>{v.value&&pr&&pr.close(),z.value={...z.value,loading:!1}}),ae.on("twofa-api-error",()=>{v.value?(z.value={...z.value,loaderType:"error",messages:{short:c("credential.api_error.title"),long:c("credential.api_error.message")}},Ne=null):Nr()}),ae.on("twofa-loading",()=>{z.value={...z.value,loading:!0,loaderType:"loading",messages:{short:c("twofa.waiting"),long:c("twofa.waiting")}}})}else ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{duration:0,initMessage:c("common.process_running"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}function ur(){if(ie.value)return;let Gr;a.entrypoint.country&&(Gr=sr.value.find(Lt=>Lt.code===a.entrypoint.country||Lt.id_country===a.entrypoint.country)),sr.value.length?(g.value=Gr?Gr.id_country:sr.value[0].id_country,measureEvent("open_country",{id_country:g.value}),vn(),At.value=!1):!jt.value&&!z.value&&(At.value=!0)}function vn(){if(a.entrypoint.siteOrganizationType){const Gr=fr.value.find(Lt=>Lt.id_site_organization_type===a.entrypoint.siteOrganizationType);if(Gr){const Lt=Gr.id_site_organization_type;measureEvent("open_site_organization_type",{id_site_organization_type:Lt}),kt.value=Lt}}}function Yr(){er=new Sync(a.token,{http:{baseURL:a.internal.apiBaseUrl?a.internal.apiBaseUrl:a.internal.apiEnv?a.internal.apiEnv==="production"?"https://sync.paybook.com":"https://api.syncfy.paybook.dev":"https://sync.paybook.com",isStrict:!!a.strict},defaultParams:{locale:a.locale,...a.internal.defaultHttpParams},isHeadless:!1,quickAnswer:a.navigation.quickAnswer,saveCredential:a.navigation.saveCredential,socketTimeout:a.navigation.socketTimeout,widgetVersion:xe});let Gr=null;er.on("sync_401",()=>{a.refreshTokenFunction&&!Gr&&(Gr=ElNotification.error({position:a.navigation.toastPosition,showClose:!1,message:h(UnauthorizedNotification,{initTitle:c("common.unauthorized"),initMessage:c("common.unauthorized_message"),refreshTokenFunction:a.refreshTokenFunction,t:c,onClosed:()=>{Gr=null},onCloseNotification:()=>{Gr.close()},onRefreshToken:({token:Lt,strict:tr,resolve:rr})=>{s("tokenRefreshed",Lt),Wr(Lt,tr).then(()=>(Gr.close(),ElNotification.success({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:a.navigation.toastDuration,initMessage:c("common.session_refreshed_message"),initTitle:c("common.session_refreshed"),showLogo:!1,t:c,type:"success",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:a.navigation.toastDuration}),Lr(),rr(null)))},onRefreshTokenError:()=>{ElNotification.error({position:a.navigation.toastPosition,message:h(TwofaNotification,{displayLongDescription:!1,duration:0,initMessage:c("common.session_error"),initTitle:c("common.error"),showLogo:!1,t:c,type:"error",onImagesLoaded:()=>{o("images-loaded")},onImagesLoading:()=>{o("images-loading")}}),duration:0})}}),duration:0})),o("401")})}function Wr(Gr,Lt){return Lt?er.strictMode({token:Gr,strict:Lt}):er.updateToken(Gr)}function xn(){o("back"),re.value=!1,$e.value=null,a.entrypoint.site&&a.navigation.oneSiteFlow&&a.navigation.displayPrivacyScreen?Oe.value=!0:(measureEvent("close_site",{id_site:Fe.config.id_site}),jt.value=Fe=null,Ie.value=null,Cr.value.length===1&&lr(!1))}function Xr(Gr=!1){Ce.value=c("site.login.authenticating"),Ie.value=null,Gr&&(z.value?$e.value="credential":$e.value="site")}function wn(){z.value&&(z.value=null),re.value&&(re.value=!1),Ce.value=c("site.login.success")}function En(Gr=!0){Gr&&o("back"),jt.value=Fe=null,Tr(Dt,!1)}function Hr(Gr,Lt=!1){if(!Gr)throw new Error("idCredential is required to update credential");hr(Gr,Lt,!0)}function Zr(){Ce.value=c("credential.loading.title"),pe.value=c("credential.loading.message")}return dr(),t({close:Ir,getLastRid:Er,open:Ar,setCredential:hr,setToken:Wr,updateCredential:Hr}),(Gr,Lt)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(TheModal,{visible:v.value,"onUpdate:visible":Lt[5]||(Lt[5]=tr=>v.value=tr),mobile:unref(y)},{default:withCtx(()=>[v.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass([Gr.$style.container,{[Gr.$style["is-mobile"]]:unref(y)}])},[Oe.value?(openBlock(),createBlock(PrivacyPolicy,{key:0,client:a.client,onContinue:or},null,8,["client"])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-header"])},[cr.value?(openBlock(),createElementBlock("button",{key:0,"aria-label":unref(c)("common.back"),class:normalizeClass(Gr.$style["widget-back-button"]),onClick:zr},[createVNode(_sfc_main$h,{icon:"back"})],10,_hoisted_1)):(openBlock(),createElementBlock("span",_hoisted_2)),createBaseVNode("h1",null,toDisplayString$1(jt.value&&a.entrypoint.site?unref(c)("common.update_title"):gr.value),1),createBaseVNode("button",{class:normalizeClass(Gr.$style["widget-close-button"]),"aria-label":unref(c)("common.close"),onClick:Ir},[createVNode(_sfc_main$h,{icon:"close"})],10,_hoisted_3)],2),createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-content"])},[z.value?(openBlock(),createElementBlock("div",{key:0,class:normalizeClass(Gr.$style["credential-content"])},[z.value.displayBackUpConnection?(openBlock(),createBlock(BackUpConnection,{key:0,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,credential:unref(ae),"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":!1,"error-message":null,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:ir.value,"test-mode":Gr.enableTestMode,"update-mode":u.value,onError:Kr,onSuccess:wn,onValid:Lt[0]||(Lt[0]=()=>Xr(!0))},null,8,["assets-path","button-disabled-style","credential","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site","test-mode","update-mode"])):z.value.siteToUpdate?(openBlock(),createBlock(SiteForm,{key:1,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"credential-service":unref(ae),"display-back-button":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:Br(),"test-mode":Gr.enableTestMode,"update-mode":!0,onValid:Zr},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","credential-service","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):(openBlock(),createElementBlock(Fragment,{key:2},[z.value.loading||z.value.loaderType!=="loading"?(openBlock(),createBlock(AppLoader,{key:0,avatar:z.value.avatar,grow:z.value.loaderType==="loading",message:z.value.messages.long,size:"large",title:z.value.messages.short,type:z.value.loaderType},null,8,["avatar","grow","message","title","type"])):unref(ae).twofa?(openBlock(),createBlock(TwofaForm,{key:1,avatar:z.value.avatar,"button-disabled-style":a.navigation.formButtonsDisabledStyle,cover:`${unref(Y)}${unref(ae).config.cover}`,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"enable-back-navigation":!1,"in-notification":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,"site-name":unref(ae).config.name,twofa:unref(ae).twofa},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):createCommentVNode("",!0),z.value.loaderType!=="loading"?(openBlock(),createElementBlock("button",{key:2,class:"pb-w-sync_primary-button","data-testid":"credential-finish-button",onClick:Ir},toDisplayString$1(unref(c)("common.finish")),1)):createCommentVNode("",!0)],64))],2)):(openBlock(),createElementBlock(Fragment,{key:1},[qe.value?(openBlock(),createBlock(AppLoader,{key:0})):createCommentVNode("",!0),!qe.value&&!ie.value&&!At.value?(openBlock(),createElementBlock(Fragment,{key:1},[jt.value?(openBlock(),createElementBlock(Fragment,{key:1},[re.value?(openBlock(),createBlock(BackUpConnection,{key:0,"assets-path":unref(Y),"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":!(a.entrypoint.site&&a.navigation.oneSiteFlow)||a.navigation.displayPrivacyScreen,"error-message":Ie.value,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:ir.value,"test-mode":Gr.enableTestMode,onBack:xn,onError:Kr,onSuccess:wn,onValid:Lt[3]||(Lt[3]=()=>Xr(!0))},null,8,["assets-path","button-disabled-style","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):jt.value==="start"||jt.value==="loading"?(openBlock(),createBlock(SiteForm,{key:1,"assets-path":unref(Y),"back-up-connection":!!$e.value,"button-disabled-style":a.navigation.formButtonsDisabledStyle,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"display-back-button":a.navigation.enableBackNavigation&&$e.value!=="credential"&&(!(a.entrypoint.site&&a.navigation.oneSiteFlow)||a.navigation.displayPrivacyScreen),"error-message":Ie.value,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,site:unref(Fe),"test-mode":Gr.enableTestMode,onBack:xn,onError:Kr,onSuccess:wn,onValid:Xr},null,8,["assets-path","back-up-connection","button-disabled-style","disable-form-autocomplete","display-back-button","error-message","loader-message","select-class","show-logo","show-password-style","site","test-mode"])):jt.value==="twofa"||jt.value==="twofa-loading"?(openBlock(),createBlock(TwofaForm,{key:2,avatar:`${unref(Y)}${unref(Fe).config.avatar}`,"button-disabled-style":a.navigation.formButtonsDisabledStyle,cover:`${unref(Y)}${unref(Fe).config.cover}`,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"enable-back-navigation":a.navigation.enableTwofaBackNavigation&&$e.value!=="credential","in-notification":!1,"loader-message":Mr.value,"select-class":a.navigation.selectClass,"show-logo":a.navigation.displayLogoImages,"show-password-style":a.navigation.formShowPasswordStyle,"site-name":unref(Fe).config.name,twofa:unref(Fe).twofa,onBack:En,onError:Kr},null,8,["avatar","button-disabled-style","cover","disable-form-autocomplete","enable-back-navigation","loader-message","select-class","show-logo","show-password-style","site-name","twofa"])):jt.value==="finish"?(openBlock(),createElementBlock(Fragment,{key:3},[Pt.value?(openBlock(),createBlock(AccountsSelection,{key:0,avatar:a.navigation.displayLogoImages?`${unref(Y)}${unref(Fe).config.avatar}`:void 0,"button-disabled-style":a.navigation.formButtonsDisabledStyle,client:a.client,credential:unref(Fe).response.id_credential,"disable-form-autocomplete":a.navigation.disableFormAutocomplete,"get-selected-accounts":a.navigation.getSelectedAccounts,sync:unref(er),onDone:Ir},null,8,["avatar","button-disabled-style","client","credential","disable-form-autocomplete","get-selected-accounts","sync"])):(openBlock(),createBlock(FinalResponse,{key:1,avatar:`${unref(Y)}${unref(Fe).config.avatar}`,"display-accounts-selection":a.navigation.displayAccountsSelection,"display-add-another-button":$e.value!=="credential"&&!(a.navigation.oneSiteFlow&&a.entrypoint.site),"long-message":he.value,message:_e.value,"show-logo":a.navigation.displayLogoImages,type:unref(Fe).finalResponse,onAddOther:br,onSelectAccounts:Lt[4]||(Lt[4]=()=>{Pt.value=!0})},null,8,["avatar","display-accounts-selection","display-add-another-button","long-message","message","show-logo","type"]))],64)):createCommentVNode("",!0)],64)):(openBlock(),createElementBlock("div",_hoisted_4,[g.value&&!kt.value?(openBlock(),createBlock(InstitutionFilters,{key:0,"country-id":g.value,"onUpdate:countryId":Lt[1]||(Lt[1]=tr=>g.value=tr),"organization-type-id":kt.value,"onUpdate:organizationTypeId":Lt[2]||(Lt[2]=tr=>kt.value=tr),"filtered-countries":sr.value,"filtered-organization-types":fr.value,"select-class":a.navigation.selectClass,"show-countries":!a.navigation.hideSelectCountry},null,8,["country-id","organization-type-id","filtered-countries","filtered-organization-types","select-class","show-countries"])):createCommentVNode("",!0),g.value&&kt.value&&!Et.value?(openBlock(),createBlock(OrganizationSitesList,{key:1,"assets-path":unref(Y),items:ar.value,"show-logo":a.navigation.displayLogoImages,"show-plaid-sites-button":a.internal.plaidSites&&kt.value==="__internal__.plaidSites",onSelect:yr},null,8,["assets-path","items","show-logo","show-plaid-sites-button"])):createCommentVNode("",!0),g.value&&kt.value&&Et.value?(openBlock(),createBlock(SitesList,{key:2,"assets-path":unref(Y),items:Cr.value,organization:ar.value.find(tr=>tr.id_site_organization===Et.value),"show-logo":a.navigation.displayLogoImages,onBack:lr,onSelect:Tr},null,8,["assets-path","items","organization","show-logo"])):createCommentVNode("",!0)]))],64)):createCommentVNode("",!0),ie.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(Gr.$style["widget-data-error"])},[createVNode(_sfc_main$h,{icon:"x-circle"}),createBaseVNode("h2",null,toDisplayString$1(unref(c)(`${ie.value}short_description`)),1),createBaseVNode("p",null,toDisplayString$1(unref(c)(`${ie.value}long_description`)),1),createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:Lr},toDisplayString$1(unref(c)("common.retry")),1)],2)):createCommentVNode("",!0),At.value?(openBlock(),createElementBlock("div",{key:3,class:normalizeClass(Gr.$style["widget-data-error"])},[createVNode(_sfc_main$h,{icon:"x-circle"}),createBaseVNode("p",null,toDisplayString$1(unref(c)("common.no_filtered_data")),1),createBaseVNode("button",{class:"pb-w-sync_primary-button",onClick:Ir},toDisplayString$1(unref(c)("common.close")),1)],2)):createCommentVNode("",!0)],64)),!qe.value&&!ie.value&&!At.value||z.value?(openBlock(),createElementBlock("div",{key:2,class:normalizeClass(Gr.$style["security-banner"])},[createBaseVNode("p",null,toDisplayString$1(unref(c)("common.security_banner_title")),1),createBaseVNode("p",null,toDisplayString$1(unref(c)("common.security_banner_content")),1)],2)):createCommentVNode("",!0)],2)],64))],2)):createCommentVNode("",!0)]),_:1},8,["visible","mobile"]),createBaseVNode("div",{class:normalizeClass(Gr.$style["widget-version"])},toDisplayString$1(unref(xe)),3)],64))}}),container="pb-w-sync_container",style0={container,"credential-content":"pb-w-sync_credential-content","is-mobile":"pb-w-sync_is-mobile","security-banner":"pb-w-sync_security-banner","widget-back-button":"pb-w-sync_widget-back-button","widget-close-button":"pb-w-sync_widget-close-button","widget-content":"pb-w-sync_widget-content","widget-data-error":"pb-w-sync_widget-data-error","widget-header":"pb-w-sync_widget-header","widget-version":"pb-w-sync_widget-version"},cssModules={$style:style0},DataWidget=_export_sfc(_sfc_main$1,[["__cssModules",cssModules]]),defaultConfig={client:{},locale:"en",entrypoint:{country:"MX"},navigation:{disableFormAutocomplete:!1,displayAccountsSelection:!1,displayBusinessSites:!0,displayCredentialInModal:!1,displayErrorsInToast:!0,displayLogoImages:!0,displayLongDescription:!1,displayPersonalSites:!0,displayPrivacyScreen:!0,displaySiteOrganizations:[],displaySiteOrganizationTypes:[],displaySites:[],displayStatusInToast:!1,enableBackNavigation:!0,enableTwofaBackNavigation:!1,formButtonsDisabledStyle:!1,formShowPasswordStyle:"icon",getSelectedAccounts:void 0,hideSelectCountry:!1,hideSiteOrganizations:[],hideSiteOrganizationTypes:[],hideSites:[],oneSiteFlow:!1,quickAnswer:!1,returnToSiteFormOnUserError:!1,saveCredential:!0,selectClass:"",socketTimeout:24e4,toastDuration:5e3,toastPosition:"top-right"},__internal__:{apiBaseUrl:null,apiEnv:null,assetsBaseUrl:null,plaidSites:!1,defaultHttpParams:{}}},_sfc_main=defineComponent({__name:"App",props:{config:{default:()=>({})},enableTestMode:{type:Boolean,default:!1},refreshTokenFunction:{type:Function,default:void 0},strict:{default:void 0},token:{}},setup(e,{expose:t}){const n=e,a=ref(null),{t:s}=useI18n();provide(translateFunction,s);const o=reactive({client:{...defaultConfig.client,..._e(n.config.client)},enableTestMode:n.enableTestMode,entrypoint:{...defaultConfig.entrypoint,..._e(n.config.entrypoint)},internal:{...defaultConfig.__internal__,..._e(n.config.__internal__)},locale:n.config.locale||defaultConfig.locale,navigation:{...defaultConfig.navigation,..._e(n.config.navigation)},refreshTokenFunction:n.refreshTokenFunction,strict:n.strict,token:n.token,onTokenRefreshed:$e=>{o.token=$e}});function c(){a.value.close()}function f(){return a.value.getLastRid()}function y(){nextTick(()=>{a.value.open()})}function m($e={}){try{configValidator.validateSync($e)}catch(pe){if(pe.name==="ValidationError")throw new Error(`ValidationError: ${pe.message}`)}o.client={...defaultConfig.client,..._e($e.client)},o.entrypoint={...defaultConfig.entrypoint,..._e($e.entrypoint)},o.internal={...defaultConfig.__internal__,..._e($e.__internal__)},o.locale=$e.locale||defaultConfig.locale,o.navigation={...defaultConfig.navigation,..._e($e.navigation)}}function g($e){a.value.setCredential($e)}function z($e){o.entrypoint={...o.entrypoint,site:$e},y()}function ie($e){a.value.updateCredential($e)}function re($e,pe){return a.value.setToken($e,pe)}function he($e={}){try{configValidator.validateSync($e)}catch(pe){if(pe.name==="ValidationError")throw new Error(`ValidationError: ${pe.message}`)}o.client={...o.client,..._e($e.client)},o.entrypoint={...o.entrypoint,..._e($e.entrypoint)},o.internal={...o.internal,..._e($e.__internal__)},o.locale=$e.locale||o.locale,o.navigation={...o.navigation,..._e($e.navigation)}}function _e($e={}){const pe={...$e};return Object.keys(pe).forEach(Ce=>{pe[Ce]===void 0&&delete pe[Ce]}),pe}return t({close:c,getLastRid:f,open:y,setConfig:m,setEntrypointCredential:g,setEntrypointSite:z,setEntrypointUpdateCredential:ie,setToken:re,upsertConfig:he}),($e,pe)=>(openBlock(),createBlock(unref(ElConfigProvider),{locale:o.locale==="es"?unref(es):unref(en)},{default:withCtx(()=>[createVNode(DataWidget,mergeProps(o,{ref_key:"widgetComponent",ref:a}),null,16)]),_:1},8,["locale"]))}});function setDefaultConfig(e){return e||(e={}),{locale:e.locale?e.locale:"en",quickAnswer:!!e.quickAnswer,socketTimeout:e.socketTimeout||24e4}}function setSync(e,t){return new Promise(a=>{const s=new Sync(e.token,{http:{baseURL:"https://sync.paybook.com",isStrict:!!e.strict},defaultParams:{locale:t.locale},isHeadless:!0,quickAnswer:t.quickAnswer,socketTimeout:t.socketTimeout,widgetVersion:`${getVersion()}-headless`});e.strict?s.strictMode({token:e.token,strict:e.strict}).then(()=>{a(s)}):a(s)})}function getAccounts(e,t,n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getAccounts({id_credential:t}).then(y=>{s(y)}).catch(y=>{o(y)})})})}function getCountries(e,t){return new Promise((a,s)=>{const o=setDefaultConfig(t);setSync(e,o).then(c=>{c.getCountries().then(f=>{a(f)}).catch(f=>{s(f)})})})}function getOrganizationSites(e,t={},n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getOrganizationSites(t).then(y=>{s(y)}).catch(y=>{o(y)})})})}function getOrganizationTypes(e,t){return new Promise((a,s)=>{const o=setDefaultConfig(t);setSync(e,o).then(c=>{c.getOrganizationTypes().then(f=>{a(f)}).catch(f=>{s(f)})})})}function getSite(e,t,n){return new Promise((s,o)=>{const c=setDefaultConfig(n);setSync(e,c).then(f=>{f.getSite(t).then(y=>{s(y[0])}).catch(y=>{o(y)})})})}function siteConnection(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.siteConnection(t))})})}function syncCredential(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.syncCredential(t))})})}function twofa(e,t,n,a){return new Promise(o=>{const c=setDefaultConfig(a);setSync(e,c).then(f=>{o(new TWOFA({...t,id_site:n},f.getHttpService(),!1))})})}function updateCredential(e,t,n){return new Promise(s=>{const o=setDefaultConfig(n);setSync(e,o).then(c=>{s(c.syncCredential(t,!0))})})}const staticMethods={getAccounts,getCountries,getOrganizationSites,getOrganizationTypes,getSite,siteConnection,syncCredential,twofa,updateCredential};initFirebase();class SyncfyWidget{constructor(t){const n=new Rollbar({accessToken:"2d928ea9aa674c6ea84dbf6f3901a403",captureUncaught:!1,captureUnhandledRejections:!1,enabled:!0,environment:"production",payload:{code_version:getVersion()}});let a;if(typeof t=="string")a={token:t};else if(typeof t=="object")a=t;else throw new Error("Invalid params type. Params must be either string or object.");try{paramsValidator.validateSync(a)}catch(g){if(g.name==="ValidationError")throw new Error(`ValidationError: ${g.message}`)}measureEvent("instantiation");const s=createApp(_sfc_main,{config:a.config,enableTestMode:a.enableTestMode,refreshTokenFunction:a.refreshTokenFunction,strict:a.strict,token:a.token}),o=createI18n({fallbackLocale:"en",locale:"en",messages:{en:resource$1,es:resource}});s.use(o),s.use(ge$1),s.config.errorHandler=g=>{throw n.error(g),g};const c=[];function f(g,z){c.push({callback:z,e:g})}function y(g,...z){c.forEach(({callback:ie,e:re})=>{g===re&&ie(...z)})}s.provide(rootEmitter,y);const m=s.mount(a.element||"#widget");return{on:f,close:m.close,getLastRid:m.getLastRid,open:m.open,setConfig:m.setConfig,setEntrypointCredential:m.setEntrypointCredential,setEntrypointSite:m.setEntrypointSite,setEntrypointUpdateCredential:m.setEntrypointUpdateCredential,setToken:m.setToken,upsertConfig:m.upsertConfig}}static getVersion(){return getVersion()}}$n(SyncfyWidget,"headless",staticMethods),window.SyncfyWidget=SyncfyWidget,exports.SyncfyWidget=SyncfyWidget,exports.default=SyncfyWidget,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|