1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).xmsdk={})}(this,(function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var s=function(){function t(e){n(this,t),this._host=e}return o(t,[{key:"extractHeaders",value:function(t){return t.trim().split(/[\r\n]+/).map((function(t){var e=t.split(": "),n=e.shift(),r=e.join(": "),o=new com.ts.mobile.sdk.TransportHeader;return o.setName(n),o.setValue(r),o}))}},{key:"sendRequest",value:function(t){var e=this;return new Promise((function(n,r){var o=new XMLHttpRequest,i=function(){r(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Communication,o.responseText))};o.open(t.getMethod(),t.getUrl(),!0),o.withCredentials=!0,o.onreadystatechange=function(){if(4===o.readyState)try{if(0===o.status)return e._host.log(com.ts.mobile.sdk.LogLevel.Error,"transport","Destination server is invalid or the server does not support access-control-allow-origin."),r(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Communication,o.responseText));JSON.parse(o.responseText);var s=new com.ts.mobile.sdk.TransportResponse;s.setStatus(o.status),s.setMethod(t.getMethod()),s.setHeaders(e.extractHeaders(o.getAllResponseHeaders())),s.setBodyJson(o.responseText),n(s)}catch(t){i()}},o.onerror=function(){i()},t.getHeaders().forEach((function(t){o.setRequestHeader(t.getName(),t.getValue())})),o.setRequestHeader("Content-Type","application/json"),o.send(t.getBodyJson())}))}}]),t}(),a={ts_gen_back:"BACK",ts_gen_skip:"SKIP",ts_gen_continue:"Continue",ts_gen_cancel:"CANCEL",ts_gen_close:"CLOSE",ts_gen_ok:"OK",ts_gen_default:"Default",ts_gen_restart:"RESTART",ts_gen_expired:"Authenticator expired. Please reregister.",ts_gen_cancel_authentication:"CANCEL",ts_gen_change_authenticator:"CHANGE METHOD",ts_gen_select_authenticator:"CHANGE METHOD",ts_gen_retry_authenticator:"TRY AGAIN",ts_gen_dismiss:"DISMISS",ts_authenticator_device_biometrics:"Device Biometrics",ts_authenticator_password:"Password",ts_authenticator_pin:"PIN",ts_authenticator_pattern:"Pattern",ts_authenticator_otp:"OTP",ts_authenticator_fingerprint:"Fingerprint",ts_authenticator_question:"Security Questions",ts_authenticator_face_id:"Face ID",ts_authenticator_touch_id:"Touch ID",ts_authenticator_totp:"Soft Token",ts_authenticator_pattern_centralized:"Pattern",ts_authenticator_pin_centralized:"PIN",ts_authenticator_voice_server:"Voice",ts_authenticator_fido2:"FIDO2",ts_authenticator_mobile_approve:"Mobile Approve",ts_authenticator_face_server:"Face",ts_authenticator_fido_fidopin:"PIN",ts_authenticator_fido_fidoface:"Face ID",ts_authenticator_fido_fidofp:"Fingerprint",ts_authenticator_device_biometrics_description:"Use the biometric sensors registered on your device",ts_authenticator_password_description:"",ts_authenticator_pin_description:"Numeric PIN code",ts_authenticator_pin_centralized_description:"Numeric PIN code",ts_authenticator_pattern_description:"Visual pattern",ts_authenticator_pattern_centralized_description:"Visual pattern",ts_authenticator_otp_description:"One time password sent to your phone or email",ts_authenticator_voice_description:"Use your voice print",ts_authenticator_voice_server_description:"Use your voice print",ts_authenticator_questions_description:"Knowledge based questions",ts_authenticator_face_description:"Use your smartphone's camera",ts_authenticator_fingerprint_description:"Use your smartphone's biometric sensor",ts_authenticator_face_id_description:"Use Face ID",ts_authenticator_touch_id_description:"Use Touch ID",ts_authenticator_totp_description:"Use soft token",ts_authenticator_mobile_approve_description:"Use mobile approve",ts_authenticator_fido2_description:"Use a security ke
1y",ts_authenticator_fido2_title_auth:"Authenticate with FIDO2",ts_authenticator_fido2_title_reg:"Register FIDO2",ts_authenticator_fido2d_intro_auth:"",ts_authenticator_fido2d_intro_reg:"",ts_authenticator_password_title_auth:"Authenticate with Password",ts_authenticator_password_title_reg:"Register Password",ts_authenticator_password_intro_auth:"",ts_authenticator_password_intro_reg:"",ts_authenticator_password_field_hint:"Password",ts_authenticator_password_reg_field_hint:"Repeat password",ts_authenticator_password_cta_positive:"CONTINUE",ts_authenticator_password_error_too_short:"Password too short!",ts_authenticator_password_error_reg_no_match:"Passwords don't match!",ts_authenticator_password_error_reg_strength_validation_failed:"Password must be at least 6 characters long, and contain a mix of lowercase characters, uppercase characters, and digits.",ts_authenticator_pin_title_auth:"Authenticate with PIN Code",ts_authenticator_pin_title_reg:"Register PIN Code",ts_authenticator_pin_intro_auth:"Enter your PIN Code to proceed",ts_authenticator_pin_intro_reg:"Enter your new PIN Code to proceed",ts_authenticator_pin_intro_repeat:"Re-enter your new PIN Code",ts_authenticator_pin_error_reg_no_match:"Codes don't match!",ts_authenticator_pin_code_length:"Enter your %1$s-digit PIN code",ts_authenticator_otp_title_auth:"Authenticate with OTP",ts_authenticator_otp_qr_title:"Authenticate with QR",ts_authenticator_otp_targets_intro:"Select how you want to receive your code.",ts_authenticator_otp_sms_title:"SMS",ts_authenticator_otp_email_title:"EMAIL",ts_authenticator_otp_voice_title:"VOICE",ts_authenticator_otp_push_title:"PUSH",ts_authenticator_otp_unknown_title:"Unknown",ts_authenticator_otp_sms_sent:"A text message with a code was sent to your phone. Please type it here.",ts_authenticator_otp_email_sent:"A code was sent to your email. Please type it here.",ts_authenticator_otp_push_sent:"A push notification with a code was sent to your phone. Please type it here.",ts_authenticator_otp_voice_sent:"A voice message with a code is being delivered to your phone. Please type it here.",ts_authenticator_otp_qr_sent:"A QR code was sent to your email. Please scan it.",ts_authenticator_otp_external_numeric_sent:"A code is being delivered to you. Please type it here.",ts_authenticator_otp_external_qr_sent:"Please scan the QR code to proceed",ts_authenticator_otp_resend:"RESEND OTP",ts_authenticator_otp_resend_message:"Didn't get the code?",ts_authenticator_otp_resend_intro:"Code resent.",ts_authenticator_otp_error_qr_permission:"Using QR to authenticate requires permission to access your phone's camera",ts_authenticator_otp_error_code_expired:"Your code is no longer valid, please request a new one",ts_authenticator_otp_code_length:"Enter the %1$s-digit code",ts_authenticator_pattern_title_auth:"Authenticate with Pattern",ts_authenticator_pattern_title_reg:"Register Pattern",ts_authenticator_pattern_intro_auth:"Draw your pattern to proceed",ts_authenticator_pattern_intro_reg:"Draw your new pattern to proceed",ts_authenticator_pattern_mismatch:"Patterns don't match. Re-draw your new pattern to proceed.",ts_authenticator_pattern_error_min_points:"Pattern is too short. Try again",ts_authenticator_pattern_intro_repeat:"Re-draw your pattern",ts_authenticator_pattern_cta_reset:"RESTART",ts_authenticator_fingerprint_title_auth:"Authenticate with Fingerprint",ts_authenticator_fingerprint_title_reg:"Confirm fingerprint to continue",ts_authenticator_fingerprint_status_hint:"Touch sensor",ts_authenticator_fingerprint_error_invalid:"No match, please try again",ts_authenticator_fingerprint_error_title:"Please try again later",ts_authenticator_fingerprint_error_lock:"Too many attempts",ts_authenticator_faceid_title_auth:"Authenticate with Face ID",ts_authenticator_faceid_title_reg:"Confirm Face ID to continue",ts_authenticator_touchid_title_reg:"Authenticate with Touch ID",ts_authenticator_touchid_title_auth:"Confirm Touch ID to continue",ts_authenticator_device_biometrics_title_auth:"Authenticate with device biometrics",ts_authenticator_device_biometrics_title_reg:"Confirm device biometrics to continue",ts_authenticator_device_biometrics_intro_auth:"Authenticate biometric to continue",ts_authenticator_device_biometrics_intro_reg:"Register biometric to continue",ts_authenticator_device_biometrics_prompt:"Follow biometric instructions",ts_authenticator_device_biometrics_cancel_cta:"Cancel biometric",ts_authenticator_questions_title_auth:"Authenticate with Security Questions",ts_authenticator_questions_title_reg:"Register Security Questions",ts_authenticator_questions_intro_auth:"Answer the question below to proceed",ts_authenticator_questions_intro_reg:"Answer at least %1$s questions to proceed.",t
1s_authenticator_questions_error_answer_range:"Answer must be at least %1$s characters long.",ts_authenticator_questions_left:"%1$s questions answered",ts_authenticator_questions_error_answer_empty:"Please provide an answer",ts_authenticator_questions_remove_this_question_cta:"REMOVE",ts_authenticator_questions_add_question_cta:"ADD QUESTION",ts_authenticator_questions_reg_select_question:"Select Question",ts_authenticator_questions_reg_select_question_cta:"CHOOSE",ts_authenticator_questions_reg_default_answer_placeholder:"*******",ts_authenticator_voice_title_auth:"Authenticate with Voice",ts_authenticator_voice_title_reg:"Register Voice",ts_authenticator_voice_intro_auth:"Follow instructions to authenticate with your voice signature",ts_authenticator_voice_intro_reg:"Follow instructions to register your voice signature",ts_authenticator_voice_passphrase:"Hold to record and repeat the following passphrase %1$s.",ts_authenticator_voice_passphrase_subtitle:"You might be prompted to say it more than once.",ts_authenticator_voice_instructions:"Please record again.",ts_authenticator_voice_record_start:"Hold to record",ts_authenticator_voice_record_stop:"Release to stop",ts_authenticator_voice_request_audio_permission:"Recording voice requires permission to access your phone's microphone",ts_authenticator_voice_error_too_long:"The recording is too long",ts_authenticator_voice_error_too_short:"Recording too short",ts_authenticator_voice_error_too_loud:"Recording too loud",ts_authenticator_voice_error_too_weak:"Recording too weak",ts_authenticator_voice_error_too_noisy:"Recording too noisy",ts_authenticator_voice_error_invalid:"Wrong passphrase!",ts_authenticator_face_title_auth:"Authenticate with Face",ts_authenticator_face_title_reg:"Register Face",ts_authenticator_face_intro_auth:"Capture a selfie in order to proceed",ts_authenticator_face_intro_reg:"Capture a selfie in order to proceed",ts_authenticator_face_error_invalid:"Could not find a match, please try again",ts_authenticator_totp_title:"Authenticate with Soft Token",ts_authenticator_totp_targets_intro:"Please select device",ts_authenticator_totp_input_intro:"Please input code",ts_authenticator_totp_input_with_challenge_intro:"Please use challenge and input code",ts_authenticator_totp_input_with_qr_challenge_intro:"Please scan QR challenge and input code",ts_authenticator_totp_qrcode_challenge_step1_message:"Step 1: Scan this QR code using your mobile app",ts_authenticator_totp_qrcode_challenge_step2_message:"Step 2: Enter the code generated by your mobile app",ts_authenticator_totp_code_challenge_step1_message:"Step 1: Enter this key into your mobile app",ts_authenticator_totp_code_challenge_step2_message:"Step 2: Enter the code generated by your mobile app",ts_authenticator_totp_input_hint:"Insert code",ts_authenticator_totp_targets_recently_used:"Recently used: %1$s",ts_authenticator_totp_targets_current_device:"Current Device",ts_authenticator_mobile_approve_title:"Mobile Approve",ts_authenticator_mobile_approve_fetching_data:"Please wait... Fetching data",ts_authenticator_mobile_approve_send:"SEND",ts_authenticator_mobile_approve_send_to_all:"SEND TO ALL",ts_authenticator_mobile_approve_targets_intro:"Please select device",ts_authenticator_mobile_approve_targets_recently_used:"Recently used: %1$s",ts_authenticator_mobile_approve_targets_current_device:"Current Device",ts_authenticator_mobile_approve_resend_message:"Didn't get the approval request?",ts_authenticator_mobile_approve_resend_cta:"RESEND",ts_session_config_title:"Authenticator configuration",ts_session_config_intro:"Register, remove or change your authenticators.",ts_session_config_item_action_register:"REGISTER",ts_session_config_item_action_unregister:"UNREGISTER",ts_session_config_item_action_reregister:"CHANGE",ts_session_config_item_action_set_as_default:"SET AS DEFAULT",ts_session_config_item_register_result:"%1$s registered successfully",ts_session_config_item_reregister_result:"%1$s changed successfully",ts_session_config_item_unregister_result:"%1$s unregistered successfully",ts_session_config_item_default_result:"%1$s is now the default authenticator",ts_session_config_item_register_failed:"%1$s registration failed. %2$s",ts_session_config_item_reregister_failed:"%1$s change failed. %2$s",ts_session_config_item_unregister_failed:"%1$s unregistration failed. %2$s",ts_session_config_item_default_failed:"Failed to make %1$s the default authenticator. %2$s",ts_session_config_item_unregister_dialog_title:"Are your sure?",ts_session_config_item_unregister_dialog_message:"Do you want to unregister %1$s?",ts_session_config_item_unregister_dialog_cta:"UNREGISTER",ts_session_config_error_dialog_title:"Something went wrong",ts_session_totp_title:"Generate Soft Token",ts_session_totp_content:"Your code is being reset every %1$s seconds.",ts_session_totp_unbound_title:"Unbound TOTP Generation",ts_session_totp_unbound_content:"Your TOTP co
1de has been generated",ts_session_totp_unbound_code:"Your TOTP code is: %1$s",ts_session_totp_nottl_content:"Please use this code.",ts_session_totp_provision_sa_title:"Select Authenticator for Provisioning Soft Token",ts_session_totp_provision_password_title:"Provision Soft Token With Password",ts_session_totp_provision_pattern_title:"Provision Soft Token With Pattern",ts_session_totp_provision_pin_title:"Provision Soft Token With PIN",ts_session_totp_generation_sa_title:"Generate Soft Token with Authenticator",ts_session_totp_generation_password_title:"Generate Soft Token with Password",ts_session_totp_generation_pattern_title:"Generate Soft Token with Pattern",ts_session_totp_generation_pin_title:"Generate Soft Token with PIN",ts_session_totp_generation_fingerprint_title:"Generate Soft Token with Fingerprint",ts_session_totp_generation_device_biometrics_title:"Generate Soft Token with Device Biometrics",ts_session_totp_challenge_title_list:"Soft Token with Challenge",ts_session_totp_challenge_intro_list:"Choose challenge type",ts_session_totp_challenge_title_textual:"Textual",ts_session_totp_challenge_intro_textual:"Enter the challenge to proceed",ts_session_totp_challenge_title_qr:"QR Code",ts_session_totp_challenge_intro_qr:"Scan the QR code to proceed",ts_session_approval_approve:"APPROVE",ts_session_approval_deny:"DENY",ts_session_approval_completed_title:"Success",ts_session_approval_completed_subtitle:"The request has been successfully approved. Please return to the requesting application.",ts_session_approval_completed_denied_subtitle:"The request has been successfully denied. Please return to the requesting application.",ts_session_approval_dialog_title:"Deny approval",ts_session_approval_dialog_message:"Deny approval",ts_session_approval_dialog_cta:"DENY",ts_session_approval_approve_failed:"'%1$s' failed to approve",ts_session_approval_deny_failed:"'%1$s' failed to deny",ts_session_approval_approve_failed_title:"An Error Occurred",ts_session_approval_deny_failed_title:"An Error Occurred",ts_session_approval_approve_failed_cta:"CLOSE",ts_session_approval_deny_failed_cta:"CLOSE",ts_session_approval_username:"Username",ts_session_approval_service:"Service",ts_session_approval_description:"Details",ts_session_approval_requested_device:"Requesting Device",ts_session_approval_expiry:"Expiry",ts_session_approval_requested_location:"Request Location",ts_session_approval_request_expires_time:"Your request expires in %1$s",ts_session_approval_request_has_expired:"Your request has expired",ts_session_dm_title:"Your Devices",ts_session_dm_intro:"These are the devices you've used to log into our applications. Click on a device for more information and options.",ts_session_dm_section_current:"This device",ts_session_dm_section_others:"Other devices",ts_session_dm_last_used_date:"Last used: %1$s",ts_session_dm_last_used_location:"at %1$s",ts_session_dm_details_title:"Your Device Details",ts_session_dm_details_subtitle:"Details about your device",ts_session_dm_details_current_device:"Current device",ts_session_dm_details_rename_action:"RENAME",ts_session_dm_details_remove_subtitle:"You can remove this device if you're not using it anymore.",ts_session_dm_details_remove_action:"REMOVE",ts_session_dm_details_no_other_devices_available:"No other devices available at the moment",ts_session_dm_item_action_dialog_remove_title:"Remove '%1$s'",ts_session_dm_item_action_dialog_remove_message:"Are you sure you want to remove this device?",ts_session_dm_item_action_dialog_remove_cta:"REMOVE",ts_session_dm_item_action_dialog_rename_title:"Rename '%1$s'",ts_session_dm_item_action_dialog_rename_cta:"RENAME",ts_session_dm_details_rename_input_hint:"New Device Name",ts_session_dm_item_action_rename_result_positive:"Device %1$s was renamed successfully to %2$s",ts_session_dm_item_action_rename_result_negative:"Failed to rename %1$s. %2$s",ts_session_dm_item_action_remove_result_positive:"Device %1$s was removed successfully",ts_session_dm_item_action_remove_result_negative:"Failed to remove %1$s. %2$s",ts_session_dm_error_dialog_title:"Something went wrong",ts_session_promotion_title:"Promotion",ts_session_promotion_intro:"Select authentication method to register",ts_session_promotion_skip:"SKIP",ts_session_promotion_abort:"ABORT",ts_promise_sa_title:"Verify It's You",ts_promise_sa_content:"Choose how you want to verify yourself",ts_promise_co_title_auth:"Authentication canceled!",ts_promise_co_title_reg:"Registration canceled!",ts_promise_fallback_title:"%1$s failed.",t
1s_promise_fallback_content:"Would you like to try a different method?",ts_promise_fallback_action_fallback:"TRY ANOTHER METHOD",ts_promise_fallback_action_menu:"CHANGE METHOD",ts_promise_fallback_action_retry:"TRY AGAIN",ts_promise_fallback_action_cancel:"CANCEL",ts_promise_co_content:"What would you like to do?",ts_promise_co_abort:"ABORT",ts_promise_co_select:"SELECT METHOD",ts_promise_co_change:"CHANGE METHOD",ts_promise_co_retry:"RETRY METHOD",ts_promise_error_default_title_auth:"Authentication failed",ts_promise_error_default_title_reg:"Registration failed",ts_promise_error_default_content_auth:"%1$s",ts_promise_error_default_content_reg:"%1$s",ts_promise_error_lock_title:"Authenticator Locked!",ts_promise_error_lock_content:"Too many failed attempts",ts_promise_invalid_authenticator_title:"%1$s invalidated",ts_promise_invalid_authenticator_content:"This authenticator has became invalid and is no longer available.",ts_promise_invalid_authenticator_cta:"CONTINUE",ts_promise_rejection_policy_title:"Error",ts_promise_rejection_policy_content:"Configuration error, please contact support",ts_promise_rejection_policy_cta:"CONTINUE",ts_promise_rejection_locked_user_title:"User Locked",ts_promise_rejection_locked_user_content:"You have been locked, please contact support",ts_promise_rejection_locked_user_cta:"CONTINUE",ts_promise_rejection_locked_device_title:"Device Locked",ts_promise_rejection_locked_device_content:"Your device has been locked, please contact support",ts_promise_rejection_locked_device_cta:"CONTINUE",ts_promise_rejection_locked_application_title:"Application Locked",ts_promise_rejection_locked_application_content:"Your application has been locked, please contact support",ts_promise_rejection_locked_application_cta:"CONTINUE",ts_promise_rejection_approval_expired_title:"Expired",ts_promise_rejection_approval_expired_content:"Request has expired, please try again",ts_promise_rejection_approval_expired_cta:"CONTINUE",ts_session_authenticator_expired_title:"%1$s Expired",ts_session_authenticator_expired_content:"Click continue to reregister",ts_promise_rejection_feature_not_supported_title:"Upgrade Required",ts_promise_rejection_feature_not_supported_content:"Your application is too old, please upgrade",ts_promise_rejection_feature_not_supported_cta:"CONTINUE",ts_promise_rejection_cannot_consume_ticket_title:"Error",ts_promise_rejection_cannot_consume_ticket_content:"Configuration error, please contact support",ts_promise_rejection_cannot_consume_ticket_cta:"CONTINUE",ts_promise_rejection_username_already_exists_title:"User Already Exists",ts_promise_rejection_username_already_exists_content:"The user %1$s already exists.",ts_promise_rejection_username_already_exists_cta:"CLOSE",ts_promise_rejection_authenticator_fatal_error_title:"An Error Occurred",ts_promise_rejection_authenticator_fatal_error_content:"Something went wrong when trying to add or verify using this method. ",ts_promise_rejection_authenticator_fatal_error_cta:"CLOSE",ts_accessibility_totp_reset:"New code is %1$s. %2$s seconds left before reset.",ts_accessibility_totp_reader:"Code is %1$s. %2$s seconds left.",ts_accessibility_totp_no_ttl:"Your code is %1$s.",ts_accessibility_configuration_cta_register:"Register %1$s",ts_accessibility_configuration_cta_unregister:"Unregister %1$s",ts_accessibility_configuration_cta_reregister:"Change %1$s",ts_accessibility_input_reader:"%1$s cells filled, %2$s cells remaining",ts_accessibility_input_pin_cell:"Cell filled",ts_accessibility_input_reset:"Cells were reset.",ts_accessibility_authenticator_list_locked:"%1$s authenticator is locked. selection disabled.",ts_accessibility_authenticator_list_disabled:"%1$s authenticator is unregistered. selection disabled.",ts_accessibility_authenticator_list_enabled:"%1$s authenticator. double tap to authenticate",ts_accessibility_authenticator_list_default:"%1$s authenticator is the Default authenticator. double tap to authenticate",ts_accessibility_hide_input_field:"Hide Input field",ts_accessibility_show_input_field:"Show Input field",ts_accessibility_back:"Back",ts_accessibility_cancel:"Cancel",ts_accessibility_password_enter_password:"Enter your new password",ts_accessibility_password_enter_password_again:"Enter your new password again",ts_accessibility_password_error_reg_no_match:"Passwords don't match. Try again",ts_plugin_dynamic_form_mandatory:"%1$s *",ts_plugin_dynamic_form_error_mandatory:"'%1$s' is mandatory!",ts_plugin_dynamic_form_error_invalid:"'%1$s' invalid value",ts_plugin_dynamic_form_error_too_long:"'%1$s' is too long",ts_plugin_dynamic_form_error_not_phone:"'%1$s' isn't a valid phone number",ts_plugin_dynamic_form_error_not_email:"'%1$s' isn't a valid Email address",ts_plugin_dynamic_form_error_else:"Something went wrong",ts_plugin_dynamic_form_table_title:"Add row",ts_plugin_dynamic_form_table_title_item:"Add row to %1$s",ts_plugin_dynamic_form_error_general:"Failed to read '%1$s' value",ts_plugin_dynamic_form_item_cta_positive:"OK",ts_plugin_dynamic_form_item_cta_cancel:"Dismiss",ts_plugin_dynamic_form_item_cta_select_all:"Select All",ts_plugin_dynamic_form_item_cta_clear_all:"Clear All",ts_plugin_dynamic_form_item_phone_prefix:"%1$s +%2$s",ts_plugin_dynamic_form_item_phone_prefix_dialog_title:"Select country",ts_session_scan_qr_title:"Scan QR",ts_session_scan_qr_hint:"No QR code detected",ts_gen_recovery:"Forgot my %1$s"},c=function(){function t(){n(this,t)}return o(t,[{key:"formatAsTwoDigits",value:function(t){return t.toLocaleStr
1ing("EN",{minimumIntegerDigits:2,useGrouping:!1})}},{key:"logDateFormat",value:function(t){var e=t.getFullYear(),n=this.formatAsTwoDigits(t.getMonth()+1),r=this.formatAsTwoDigits(t.getDate()),o=this.formatAsTwoDigits(t.getHours()),i=this.formatAsTwoDigits(t.getMinutes()),s=this.formatAsTwoDigits(t.getSeconds()),a=t.getMilliseconds().toLocaleString("EN",{minimumIntegerDigits:3,useGrouping:!1});return"".concat(e,"-").concat(n,"-").concat(r," ").concat(o,":").concat(i,":").concat(s,".").concat(a)}},{key:"log",value:function(t,e,n){var r=com.ts.mobile.sdk.LogLevel[t].toUpperCase();console.log("".concat(this.logDateFormat(new Date),"\t").concat(r,"\t").concat(e,":\t").concat(n))}}]),t}();function u(t,e,n){var r;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(n=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,o={};r<arguments.length;r++){var i=arguments[r];for(var s in i)o[s]=i[s]}return o}({path:"/"},{},n)).expires){var o=new Date;o.setMilliseconds(o.getMilliseconds()+864e5*n.expires),n.expires=o}n.expires=n.expires?n.expires.toUTCString():"";try{r=JSON.stringify(e),/^[\{\[]/.test(r)&&(e=r)}catch(t){}e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var i="";for(var s in n)n[s]&&(i+="; "+s,!0!==n[s]&&(i+="="+n[s]));return document.cookie=t+"="+e+i}t||(r={});for(var a=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,u=0;u<a.length;u++){var l=a[u].split("="),d=l.slice(1).join("=");'"'===d.charAt(0)&&(d=d.slice(1,-1));try{var h=l[0].replace(c,decodeURIComponent);if(d=d.replace(c,decodeURIComponent),t===h){r=d;break}t||(r[h]=d)}catch(t){}}return r}}var l={set:u,get:function(t){return u.call(u,t)},remove:function(t){u(t,"",{expires:-1})}},d=function(){function t(e){n(this,t),this._persistent=e}return o(t,[{key:"setItem",value:function(t,e){var n=btoa(e);this._persistent?l.set(t,n,{expires:365}):l.set(t,n)}},{key:"removeItem",value:function(t){l.remove(t)}},{key:"getItem",value:function(t){var e=l.get(t);return e&&(e=atob(e)),e}}]),t}(),h=function(){function t(){n(this,t),this._memStore={}}return o(t,[{key:"setItem",value:function(t,e){this._memStore[t]=e}},{key:"removeItem",value:function(t){delete this._memStore[t]}},{key:"getItem",value:function(t){return this._memStore[t]}}]),t}(),p=function(){function t(e){if(n(this,t),"undefined"!=typeof window)try{this.currentStorage=window[e],this.currentStorage.setItem("ts:test","ok"),this.currentStorage.removeItem("ts:test")}catch(t){console.warn("Failed to use browser storage. Resorting to cookies."),this.currentStorage=new d("localStorage"==e)}else this.currentStorage=new h}return o(t,[{key:"setItem",value:function(t,e){this.currentStorage.setItem(t,e)}},{key:"getItem",value:function(t){return this.currentStorage.getItem(t)}},{key:"removeItem",value:function(t){this.currentStorage.removeItem(t)}}]),t}(),f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function g(t,e){return t(e={exports:{}},e.exports),e.exports}var v=g((function(t){!function(e,n){t.exports?t.exports=n():e.exports?e.exports=n():e.Fingerprint2=n()}(f,(function(){function t(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var n=[0,0,0,0];return n[3]+=t[3]+e[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=t[2]+e[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=t[1]+e[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=t[0]+e[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function e(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var n=[0,0,0,0];return n[3]+=t[3]*e[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=t[2]*e[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=t[3]*e[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=t[1]*e[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=t[2]*e[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=t[3]*e[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=t[0]*e[3]+t[1]*e[2]+t[2]*e[1]+t[3]*e[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function n(t,e){return 32==(e%=64)?[t[1],t[0]]:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e|t[0]>>>32-e]:(e-=32,[t[1]<<e|t[0]>>>32-e,t[0]<<e|t[1]>>>32-e])}function r(t,e){return 0==(e%=64)?t:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e]:[t[1]<<e-32,0]}function o(t,e){return[t[0]^e[0],t[1]^e[1]]}function i(t){return t=o(t,[0,t[0]>>>1]),t=o(t=e(t,[4283543511,3981806797]),[0,t[0]>>>1]),o(t=e(t,[3301882366,444984403]),[0,t[0]>>>1])}function s(s,a){a=a||0;for(var c=(s=s||"").length%16,u=s.length-c,l=[0,a],d=[0,a],h=[0,0],p=[0,0],f=[2277735313,289559509],m=[1291169091,658871167],g=0;g<u;
1g+=16)h=[255&s.charCodeAt(g+4)|(255&s.charCodeAt(g+5))<<8|(255&s.charCodeAt(g+6))<<16|(255&s.charCodeAt(g+7))<<24,255&s.charCodeAt(g)|(255&s.charCodeAt(g+1))<<8|(255&s.charCodeAt(g+2))<<16|(255&s.charCodeAt(g+3))<<24],p=[255&s.charCodeAt(g+12)|(255&s.charCodeAt(g+13))<<8|(255&s.charCodeAt(g+14))<<16|(255&s.charCodeAt(g+15))<<24,255&s.charCodeAt(g+8)|(255&s.charCodeAt(g+9))<<8|(255&s.charCodeAt(g+10))<<16|(255&s.charCodeAt(g+11))<<24],h=n(h=e(h,f),31),l=t(l=n(l=o(l,h=e(h,m)),27),d),l=t(e(l,[0,5]),[0,1390208809]),p=n(p=e(p,m),33),d=t(d=n(d=o(d,p=e(p,f)),31),l),d=t(e(d,[0,5]),[0,944331445]);switch(h=[0,0],p=[0,0],c){case 15:p=o(p,r([0,s.charCodeAt(g+14)],48));case 14:p=o(p,r([0,s.charCodeAt(g+13)],40));case 13:p=o(p,r([0,s.charCodeAt(g+12)],32));case 12:p=o(p,r([0,s.charCodeAt(g+11)],24));case 11:p=o(p,r([0,s.charCodeAt(g+10)],16));case 10:p=o(p,r([0,s.charCodeAt(g+9)],8));case 9:p=e(p=o(p,[0,s.charCodeAt(g+8)]),m),d=o(d,p=e(p=n(p,33),f));case 8:h=o(h,r([0,s.charCodeAt(g+7)],56));case 7:h=o(h,r([0,s.charCodeAt(g+6)],48));case 6:h=o(h,r([0,s.charCodeAt(g+5)],40));case 5:h=o(h,r([0,s.charCodeAt(g+4)],32));case 4:h=o(h,r([0,s.charCodeAt(g+3)],24));case 3:h=o(h,r([0,s.charCodeAt(g+2)],16));case 2:h=o(h,r([0,s.charCodeAt(g+1)],8));case 1:h=e(h=o(h,[0,s.charCodeAt(g)]),f),l=o(l,h=e(h=n(h,31),m))}return l=t(l=o(l,[0,s.length]),d=o(d,[0,s.length])),d=t(d,l),l=t(l=i(l),d=i(d)),d=t(d,l),("00000000"+(l[0]>>>0).toString(16)).slice(-8)+("00000000"+(l[1]>>>0).toString(16)).slice(-8)+("00000000"+(d[0]>>>0).toString(16)).slice(-8)+("00000000"+(d[1]>>>0).toString(16)).slice(-8)}function a(t,e){if(Array.prototype.forEach&&t.forEach===Array.prototype.forEach)t.forEach(e);else if(t.length===+t.length)for(var n=0,r=t.length;n<r;n++)e(t[n],n,t);else for(var o in t)t.hasOwnProperty(o)&&e(t[o],o,t)}function c(t,e){var n=[];return null==t?n:Array.prototype.map&&t.map===Array.prototype.map?t.map(e):(a(t,(function(t,r,o){n.push(e(t,r,o))})),n)}function u(t){throw new Error("'new Fingerprint()' is deprecated, see https://github.com/fingerprintjs/fingerprintjs#upgrade-guide-from-182-to-200")}void 0===Array.isArray&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var l={preprocessor:null,audio:{timeout:1e3,excludeIOS11:!0},fonts:{userDefinedFonts:[],extendedJsFonts:!1},screen:{detectScreenOrientation:!0},plugins:{sortPluginsFor:[/palemoon/i],excludeIE:!1},extraComponents:[],excludes:{enumerateDevices:!0,pixelRatio:!0,doNotTrack:!0,adBlock:!0},NOT_AVAILABLE:"not available",ERROR:"error",EXCLUDED:"excluded"},d=function(t){if(null==navigator.plugins)return t.NOT_AVAILABLE;for(var e=[],n=0,r=navigator.plugins.length;n<r;n++)navigator.plugins[n]&&e.push(navigator.plugins[n]);return h(t)&&(e=e.sort((function(t,e){return t.name>e.name?1:t.name<e.name?-1:0}))),c(e,(function(t){var e=c(t,(function(t){return[t.type,t.suffixes]}));return[t.name,t.description,e]}))},h=function(t){for(var e=!1,n=0,r=t.plugins.sortPluginsFor.length;n<r;n++){var o=t.plugins.sortPluginsFor[n];if(navigator.userAgent.match(o)){e=!0;break}}return e},p=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},f=function(){if(!p()||!window.WebGLRenderingContext)return!1;var t=g();if(t){try{v(t)}catch(t){}return!0}return!1},m=function(){return 2<=("msWriteProfilerMark"in window)+("msLaunchUri"in navigator)+("msSaveBlob"in navigator)},g=function(){var t=document.createElement("canvas"),e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){}return e||null},v=function(t){var e=t.getExtension("WEBGL_lose_context");null!=e&&e.loseContext()},y=[{key:"userAgent",getData:function(t){t(navigator.userAgent)}},{key:"webdriver",getData:function(t,e){t(null==navigator.webdriver?e.NOT_AVAILABLE:navigator.webdriver)}},{key:"language",getData:function(t,e){t(navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||e.NOT_AVAILABLE)}},{key:"colorDepth",getData:function(t,e){t(window.screen.colorDepth||e.NOT_AVAILABLE)}},{key:"deviceMemory",getData:function(t,e){t(navigator.deviceMemory||e.NOT_AVAILABLE)}},{key:"pixelRatio",getData:function(t,e){t(window.devicePixelRatio||e.NOT_AVAILABLE)}},{key:"hardwareConcurrency",getData:function(t,e){t(function(t){return navigator.hardwareConcurrency?navigator.hardwareConcurrency:t.NOT_AVAILABLE}(e))}},{key:"screenResolution",getData:function(t,e){t(function(t){var e=[window.screen.width,window.screen.height];return t.screen.detectScreenOrientation&&e.sort().reverse(),e}(e))}},{key:"availableScreenResolution",getData:function(t,e){t(function(t){if(window.screen.availWi
1dth&&window.screen.availHeight){var e=[window.screen.availHeight,window.screen.availWidth];return t.screen.detectScreenOrientation&&e.sort().reverse(),e}return t.NOT_AVAILABLE}(e))}},{key:"timezoneOffset",getData:function(t){t((new Date).getTimezoneOffset())}},{key:"timezone",getData:function(t,e){window.Intl&&window.Intl.DateTimeFormat?t((new window.Intl.DateTimeFormat).resolvedOptions().timeZone||e.NOT_AVAILABLE):t(e.NOT_AVAILABLE)}},{key:"sessionStorage",getData:function(t,e){t(function(t){try{return!!window.sessionStorage}catch(e){return t.ERROR}}(e))}},{key:"localStorage",getData:function(t,e){t(function(t){try{return!!window.localStorage}catch(e){return t.ERROR}}(e))}},{key:"indexedDb",getData:function(t,e){t(function(t){if(m())return t.EXCLUDED;try{return!!window.indexedDB}catch(e){return t.ERROR}}(e))}},{key:"addBehavior",getData:function(t){t(!!window.HTMLElement.prototype.addBehavior)}},{key:"openDatabase",getData:function(t){t(!!window.openDatabase)}},{key:"cpuClass",getData:function(t,e){t(function(t){return navigator.cpuClass||t.NOT_AVAILABLE}(e))}},{key:"platform",getData:function(t,e){t(function(t){return navigator.platform?navigator.platform:t.NOT_AVAILABLE}(e))}},{key:"doNotTrack",getData:function(t,e){t(function(t){return navigator.doNotTrack?navigator.doNotTrack:navigator.msDoNotTrack?navigator.msDoNotTrack:window.doNotTrack?window.doNotTrack:t.NOT_AVAILABLE}(e))}},{key:"plugins",getData:function(t,e){"Microsoft Internet Explorer"===navigator.appName||"Netscape"===navigator.appName&&/Trident/.test(navigator.userAgent)?e.plugins.excludeIE?t(e.EXCLUDED):t(function(t){var e=[];return Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window?e=c(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],(function(e){try{return new window.ActiveXObject(e),e}catch(e){return t.ERROR}})):e.push(t.NOT_AVAILABLE),navigator.plugins&&(e=e.concat(d(t))),e}(e)):t(d(e))}},{key:"canvas",getData:function(t,e){p()?t(function(t){var e=[],n=document.createElement("canvas");n.width=2e3,n.height=200,n.style.display="inline";var r=n.getContext("2d");return r.rect(0,0,10,10),r.rect(2,2,6,6),e.push("canvas winding:"+(!1===r.isPointInPath(5,5,"evenodd")?"yes":"no")),r.textBaseline="alphabetic",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",t.dontUseFakeFontInCanvas?r.font="11pt Arial":r.font="11pt no-real-font-123",r.fillText("Cwm fjordbank glyphs vext quiz, ????",2,15),r.fillStyle="rgba(102, 204, 0, 0.2)",r.font="18pt Arial",r.fillText("Cwm fjordbank glyphs vext quiz, ????",4,45),r.globalCompositeOperation="multiply",r.fillStyle="rgb(255,0,255)",r.beginPath(),r.arc(50,50,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(0,255,255)",r.beginPath(),r.arc(100,50,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(255,255,0)",r.beginPath(),r.arc(75,100,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(255,0,255)",r.arc(75,75,75,0,2*Math.PI,!0),r.arc(75,75,25,0,2*Math.PI,!0),r.fill("evenodd"),n.toDataURL&&e.push("canvas fp:"+n.toDataURL()),e}(e)):t(e.NOT_AVAILABLE)}},{key:"webgl",getData:function(t,e){f()?t(function(){function t(t){return e.clearColor(0,0,0,1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"}var e;if(!(e=g()))return null;try{var n=[],r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r);var o=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);e.bufferData(e.ARRAY_BUFFER,o,e.STATIC_DRAW),r.itemSize=3,r.numItems=3;var i=e.createProgram(),s=e.createShader(e.VERTEX_SHADER);e.shaderSource(s,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;
1void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),e.compileShader(s);var c=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(c,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),e.compileShader(c),e.attachShader(i,s),e.attachShader(i,c),e.linkProgram(i),e.useProgram(i),i.vertexPosAttrib=e.getAttribLocation(i,"attrVertex"),i.offsetUniform=e.getUniformLocation(i,"uniformOffset"),e.enableVertexAttribArray(i.vertexPosArray),e.vertexAttribPointer(i.vertexPosAttrib,r.itemSize,e.FLOAT,!1,0,0),e.uniform2f(i.offsetUniform,1,1),e.drawArrays(e.TRIANGLE_STRIP,0,r.numItems);try{n.push(e.canvas.toDataURL())}catch(t){}n.push("extensions:"+(e.getSupportedExtensions()||[]).join(";")),n.push("webgl aliased line width range:"+t(e.getParameter(e.ALIASED_LINE_WIDTH_RANGE))),n.push("webgl aliased point size range:"+t(e.getParameter(e.ALIASED_POINT_SIZE_RANGE))),n.push("webgl alpha bits:"+e.getParameter(e.ALPHA_BITS)),n.push("webgl antialiasing:"+(e.getContextAttributes().antialias?"yes":"no")),n.push("webgl blue bits:"+e.getParameter(e.BLUE_BITS)),n.push("webgl depth bits:"+e.getParameter(e.DEPTH_BITS)),n.push("webgl green bits:"+e.getParameter(e.GREEN_BITS)),n.push("webgl max anisotropy:"+function(t){var e=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic");if(e){var n=t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT);return 0===n&&(n=2),n}return null}(e)),n.push("webgl max combined texture image units:"+e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),n.push("webgl max cube map texture size:"+e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),n.push("webgl max fragment uniform vectors:"+e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),n.push("webgl max render buffer size:"+e.getParameter(e.MAX_RENDERBUFFER_SIZE)),n.push("webgl max texture image units:"+e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),n.push("webgl max texture size:"+e.getParameter(e.MAX_TEXTURE_SIZE)),n.push("webgl max varying vectors:"+e.getParameter(e.MAX_VARYING_VECTORS)),n.push("webgl max vertex attribs:"+e.getParameter(e.MAX_VERTEX_ATTRIBS)),n.push("webgl max vertex texture image units:"+e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),n.push("webgl max vertex uniform vectors:"+e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),n.push("webgl max viewport dims:"+t(e.getParameter(e.MAX_VIEWPORT_DIMS))),n.push("webgl red bits:"+e.getParameter(e.RED_BITS)),n.push("webgl renderer:"+e.getParameter(e.RENDERER)),n.push("webgl shading language version:"+e.getParameter(e.SHADING_LANGUAGE_VERSION)),n.push("webgl stencil bits:"+e.getParameter(e.STENCIL_BITS)),n.push("webgl vendor:"+e.getParameter(e.VENDOR)),n.push("webgl version:"+e.getParameter(e.VERSION));try{var u=e.getExtension("WEBGL_debug_renderer_info");u&&(n.push("webgl unmasked vendor:"+e.getParameter(u.UNMASKED_VENDOR_WEBGL)),n.push("webgl unmasked renderer:"+e.getParameter(u.UNMASKED_RENDERER_WEBGL)))}catch(t){}return e.getShaderPrecisionFormat&&a(["FLOAT","INT"],(function(t){a(["VERTEX","FRAGMENT"],(function(r){a(["HIGH","MEDIUM","LOW"],(function(o){a(["precision","rangeMin","rangeMax"],(function(i){var s=e.getShaderPrecisionFormat(e[r+"_SHADER"],e[o+"_"+t])[i];"precision"!==i&&(i="precision "+i);var a=["webgl ",r.toLowerCase()," shader ",o.toLowerCase()," ",t.toLowerCase()," ",i,":",s].join("");n.push(a)}))}))}))})),n}finally{try{v(e)}catch(t){}}}()):t(e.NOT_AVAILABLE)}},{key:"webglVendorAndRenderer",getData:function(t){f()?t(function(){try{var t=g(),e=t.getExtension("WEBGL_debug_renderer_info");return t.getParameter(e.UNMASKED_VENDOR_WEBGL)+"~"+t.getParameter(e.UNMASKED_RENDERER_WEBGL)}catch(t){return null}finally{try{v(t)}catch(t){}}}()):t()}},{key:"adBlock",getData:function(t){t(function(){var t=document.createElement("div");t.innerHTML=" ";var e=!(t.className="adsbox");try{document.body.appendChild(t),e=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(t)}catch(t){e=!1}return e}())}},{key:"hasLiedLanguages",getData:function(t){t(function(){if(void 0!==navigator.languages)try{if
1(navigator.languages[0].substr(0,2)!==navigator.language.substr(0,2))return!0}catch(t){return!0}return!1}())}},{key:"hasLiedResolution",getData:function(t){t(window.screen.width<window.screen.availWidth||window.screen.height<window.screen.availHeight)}},{key:"hasLiedOs",getData:function(t){t(function(){var t,e=navigator.userAgent.toLowerCase(),n=navigator.oscpu,r=navigator.platform.toLowerCase();if(t=0<=e.indexOf("windows phone")?"Windows Phone":0<=e.indexOf("windows")||0<=e.indexOf("win16")||0<=e.indexOf("win32")||0<=e.indexOf("win64")||0<=e.indexOf("win95")||0<=e.indexOf("win98")||0<=e.indexOf("winnt")||0<=e.indexOf("wow64")?"Windows":0<=e.indexOf("android")?"Android":0<=e.indexOf("linux")||0<=e.indexOf("cros")||0<=e.indexOf("x11")?"Linux":0<=e.indexOf("iphone")||0<=e.indexOf("ipad")||0<=e.indexOf("ipod")||0<=e.indexOf("crios")||0<=e.indexOf("fxios")?"iOS":0<=e.indexOf("macintosh")||0<=e.indexOf("mac_powerpc)")?"Mac":"Other",("ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&"Windows"!==t&&"Windows Phone"!==t&&"Android"!==t&&"iOS"!==t&&"Other"!==t&&-1===e.indexOf("cros"))return!0;if(void 0!==n){if(0<=(n=n.toLowerCase()).indexOf("win")&&"Windows"!==t&&"Windows Phone"!==t)return!0;if(0<=n.indexOf("linux")&&"Linux"!==t&&"Android"!==t)return!0;if(0<=n.indexOf("mac")&&"Mac"!==t&&"iOS"!==t)return!0;if((-1===n.indexOf("win")&&-1===n.indexOf("linux")&&-1===n.indexOf("mac"))!=("Other"===t))return!0}return 0<=r.indexOf("win")&&"Windows"!==t&&"Windows Phone"!==t||(0<=r.indexOf("linux")||0<=r.indexOf("android")||0<=r.indexOf("pike"))&&"Linux"!==t&&"Android"!==t||(0<=r.indexOf("mac")||0<=r.indexOf("ipad")||0<=r.indexOf("ipod")||0<=r.indexOf("iphone"))&&"Mac"!==t&&"iOS"!==t||!(0<=r.indexOf("arm")&&"Windows Phone"===t)&&!(0<=r.indexOf("pike")&&0<=e.indexOf("opera mini"))&&((r.indexOf("win")<0&&r.indexOf("linux")<0&&r.indexOf("mac")<0&&r.indexOf("iphone")<0&&r.indexOf("ipad")<0&&r.indexOf("ipod")<0)!=("Other"===t)||void 0===navigator.plugins&&"Windows"!==t&&"Windows Phone"!==t)}())}},{key:"hasLiedBrowser",getData:function(t){t(function(){var t,e=navigator.userAgent.toLowerCase(),n=navigator.productSub;if(0<=e.indexOf("edge/")||0<=e.indexOf("iemobile/"))return!1;if(0<=e.indexOf("opera mini"))return!1;if(("Chrome"==(t=0<=e.indexOf("firefox/")?"Firefox":0<=e.indexOf("opera/")||0<=e.indexOf(" opr/")?"Opera":0<=e.indexOf("chrome/")?"Chrome":0<=e.indexOf("safari/")?0<=e.indexOf("android 1.")||0<=e.indexOf("android 2.")||0<=e.indexOf("android 3.")||0<=e.indexOf("android 4.")?"AOSP":"Safari":0<=e.indexOf("trident/")?"Internet Explorer":"Other")||"Safari"===t||"Opera"===t)&&"20030107"!==n)return!0;var r,o=eval.toString().length;if(37===o&&"Safari"!==t&&"Firefox"!==t&&"Other"!==t)return!0;if(39===o&&"Internet Explorer"!==t&&"Other"!==t)return!0;if(33===o&&"Chrome"!==t&&"AOSP"!==t&&"Opera"!==t&&"Other"!==t)return!0;try{throw"a"}catch(t){try{t.toSource(),r=!0}catch(t){r=!1}}return r&&"Firefox"!==t&&"Other"!==t}())}},{key:"touchSupport",getData:function(t){t(function(){var t,e=0;void 0!==navigator.maxTouchPoints?e=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(e=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(e){t=!1}return[e,t,"ontouchstart"in window]}())}},{key:"fonts",getData:function(t,e){var n=["monospace","sans-serif","serif"],r=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];function o(){var t=document.createElement("span");return t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="72px",t.style.fontStyle="normal",t.style.fontWeight="normal",t.style.letterSpacing="normal",t.style.lineBreak="auto",t.style.lineHeight="normal",t.style.textTransform="none",t.style.textAlign="left",t.style.textDecoration="none",t.style.textShadow="none",t.style.whiteSpace="normal",t.style.wordBreak="normal",t.style.wordSpacing="normal",t.innerHTML="mmmmmmmmmmlli",t}function i(t){for(var e=!1,r=0;r<n.length;r++)if(e=t[r].offsetWidth!==u[n[r]]||t[r].offsetHeight!==l[n[r]])return e;return e}e.fonts.extendedJsFonts&&(r=r
vendor: 6,136 bytes, line 1
1.concat(["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"])
1),r=(r=r.concat(e.fonts.userDefinedFonts)).filter((function(t,e){return r.indexOf(t)===e}));var s=document.getElementsByTagName("body")[0],a=document.createElement("div"),c=document.createElement("div"),u={},l={},d=function(){for(var t=[],e=0,r=n.length;e<r;e++){var i=o();i.style.fontFamily=n[e],a.appendChild(i),t.push(i)}return t}();s.appendChild(a);for(var h=0,p=n.length;h<p;h++)u[n[h]]=d[h].offsetWidth,l[n[h]]=d[h].offsetHeight;var f=function(){for(var t,e,i,s={},a=0,u=r.length;a<u;a++){for(var l=[],d=0,h=n.length;d<h;d++){var p=(t=r[a],e=n[d],i=void 0,(i=o()).style.fontFamily="'"+t+"',"+e,i);c.appendChild(p),l.push(p)}s[r[a]]=l}return s}();s.appendChild(c);for(var m=[],g=0,v=r.length;g<v;g++)i(f[r[g]])&&m.push(r[g]);s.removeChild(c),s.removeChild(a),t(m)},pauseBefore:!0},{key:"audio",getData:function(t,e){var n=e.audio;if(n.excludeIOS11&&navigator.userAgent.match(/OS 11.+Version\/11.+Safari/))return t(e.EXCLUDED);var r=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(null==r)return t(e.NOT_AVAILABLE);var o=new r(1,44100,44100),i=o.createOscillator();i.type="triangle",i.frequency.setValueAtTime(1e4,o.currentTime);var s=o.createDynamicsCompressor();a([["threshold",-50],["knee",40],["ratio",12],["reduction",-20],["attack",0],["release",.25]],(function(t){void 0!==s[t[0]]&&"function"==typeof s[t[0]].setValueAtTime&&s[t[0]].setValueAtTime(t[1],o.currentTime)})),i.connect(s),s.connect(o.destination),i.start(0),o.startRendering();var c=setTimeout((function(){return console.warn('Audio fingerprint timed out. Please report bug at https://github.com/fingerprintjs/fingerprintjs with your user agent: "'+navigator.userAgent+'".'),o.oncomplete=function(){},o=null,t("audioTimeout")}),n.timeout);o.oncomplete=function(e){var n;try{clearTimeout(c),n=e.renderedBuffer.getChannelData(0).slice(4500,5e3).reduce((function(t,e){return t+Math.abs(e)}),0).toString(),i.disconnect(),s.disconnect()}catch(e){return void t(e)}t(n)}}},{key:"enumerateDevices",getData:function(t,e){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return t(e.NOT_AVAILABLE);navigator.mediaDevices.enumerateDevices().then((function(e){t(e.map((function(t){return"id="+t.deviceId+";gid="+t.groupId+";"+t.kind+";"+t.label})))})).catch((function(e){t(e)}))}}];return u.get=function(t,e){(function(t,e){var n,r;if(null!=e)for(r in e)null==(n=e[r])||Object.prototype.hasOwnProperty.call(t,r)||(t[r]=n)})(t=e?t||{}:(e=t,{}),l),t.components=t.extraComponents.concat(y);var n={data:[],addPreprocessedComponent:function(e,r){"function"==typeof t.preprocessor&&(r=t.preprocessor(e,r)),n.data.push({key:e,value:r})}},r=-1;!function o(i){if((r+=1)>=t.components.length)e(n.data);else{var s=t.components[r];if(t.excludes[s.key])o(!1);else{if(!i&&s.pauseBefore)return--r,void setTimeout((function(){o(!0)}),1);try{s.getData((function(t){n.addPreprocessedComponent(s.key,t),o(!1)}),t)}catch(i){n.addPreprocessedComponent(s.key,String(i)),o(!1)}}}}(!1)},u.getPromise=function(t){return new Promise((function(e,n){u.get(t,e)}))},u.getV18=function(t,e){return null==e&&(e=t,t={}),u.get(t,(function(n){for(var r=[],o=0;o<n.length;o++){var i=n[o];if(i.value===(t.NOT_AVAILABLE||"not available"))r.push({key:i.key,value:"unknown"});else if("plugins"===i.key)r.push({key:"plugins",value:c(i.value,(function(t){var e=c(t[2],(function(t){return t.join?t.join("~"):t})).join(",");return[t[0],t[1],e].join("::")}))});else if(-1!==["canvas","webgl"].indexOf(i.key)&&Array.isArray(i.value))r.push({key:i.key,value:i.value.join("~")});else if(-1!==["sessionStorage","localStorage","indexedDb","addBehavior","openDatabase"].indexOf(i.key)){if(!i.value)continue;r.push({key:i.key,value:1})}else i.value?r.push(i.value.join?{key:i.key,value:i.value.join(";")}:i):r.push({key:i.key,value:i.value})}var a=s(c(r,(function(t){return t.value})).join("~~~"),31);e(a,r)}))},u.x64hash128=s,u.VERSION="2.1.5",u}))})),y=g((function(t,n){ 2/*!@license 3 * UAParser.js v0.7.28 4 * Lightweight JavaScript-based User-Agent string parser 5 * https://github.com/faisalman/ua-parser-js 6 * 7 * Copyright ?? 2012-2021 Faisal Salman <[email protected]> 8 * Licensed under MIT License 9 */ 10!function(r,o){var i="model",s="name",a="type",c="vendor",u="version",l="mobile",d="tablet",h="smarttv",p={extend:function(t,e){var n={};for(var r in t)e[r]&&e[r].length%2==0?n[r]=e[r].concat(t[r]):n[r]=t[r];return n},has:function(t,n){return"string"===e(t)&&-1!==n.toLowerCase().indexOf(t.toLowerCase())},lowerize:function(t){return t.toLowerCase()},major:function(t){return"string"===e(t)?t.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(t,n){return t=t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"undefined"===e(n)?t:t.substring(0,255)}},f={rgx:function(t,n){for(var r,o,i,s,a,c,u=0;u<n.length&&!a;){var l=n[u],d=n[u+1];for(r=o=0;r<l.length&&!a;)if(a=l[r++].exec(t))for(i=0;i<d.length;i++)c=a[++o],"object"===e(s=d[i])&&s.length>0?2==s.length?"function"==e(s[1])?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:3==s.length?"function"!==e(s[1])||s[1].exec&&s[1].test?this[s[0]]=c?c.replace(s[1],s[2]):void 0:this[s[0]]=c?s[1].call(this,c,s[2]):void 0:4==s.length&&(this[s[0]]=c?s[3].call(this,c.replace(s[1],s[2])):void 0):this[s]=c||void 0;u+=2}},str:function(t,n){for(var r in n)if("object"===e(n[r])&&n[r].length>0){for(var o=0;o<n[r].length;o++)if(p.has(n[r][o],t))return"?"===r?void 0:r}else if(p.has(n[r],t))return"?"===r?void 0:r;return t}},m={browser:{oldSafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}},oldEdge:{version:{.1:"12.",21:"13.",31:"14.",39:"15.",41:"16.",42:"17.",44:"18."}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},g={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[u,[s,"Chrome"]],[/(?:edge|edgios|edga|edg)\/([\w\.]+)/i],[u,[s,"Edge"]],[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]{3,6})\b.+version\/([\w\.-]+)/i,/(opera)(?:.+version\/|[\/\s]+)([\w\.]+)/i],[s,u],[/opios[\/\s]+([\w\.]+)/i],[u,[s,"Opera Mini"]],[/\sopr\/([\w\.]+)/i],[u,[s,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(ba?idubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i,/(rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([\w\.]+)/i,/(weibo)__([\d\.]+)/i],[s,u],[/(?:[\s\/]uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[u,[s,"UCBrowser"]],[/(?:windowswechat)?\sqbcore\/([\w\.]+)\b.*(?:windowswechat)?/i],[u,[s,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[u,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[u,[s,"Konqueror"]],[/trident.+rv[:\s]([\w\.]{1,9})\b.+like\sgecko/i],[u,[s,"IE"]],[/yabrowser\/([\w\.]+)/i],[u,[s,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure Browser"],u],[/focus\/([\w\.]+)/i],[u,[s,"Firefox Focus"]],[/opt\/([\w\.]+)/i],[u,[s,"Opera Touch"]],[/coc_coc_browser\/([\w\.]+)/i],[u,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[u,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[u,[s,"Opera Coast"]],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[u,[s,"MIUI Browser"]],[/fxios\/([\w\.-]+)/i],[u,[s,"Firefox"]],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[s,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 Browser"],u],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],u],[/\s(electron)\/([\w\.]+)\ssafari/i,/(tesla)(?:\sqtcarbrowser|\/(20[12]\d\.[\w\.-]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/\s]?([\w\.]+)/i],[s,u],[/(MetaSr)[\/\s]?([\w\.]+)/i,/(LBBROWSER)/i],[s],[/;fbav\/([\w\.]+);
vendor: 5,513 bytes, line 10
10/i],[u,[s,"Facebook"]],[/FBAN\/FBIOS|FB_IAB\/FB4A/i],[[s,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/\s]([\w\.-]+)/i],[s,u],[/\bgsa\/([\w\.]+)\s.*safari\//i],[u,[s,"GSA"]],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[u,[s,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[s,"Chrome WebView"],u],[/droid.+\sversion\/([\w\.]+)\b.+(?:mobile\ssafari|safari)/i],[u,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[s,u],[/version\/([\w\.]+)\s.*mobile\/\w+\s(safari)/i],[u,[s,"Mobile Safari"]],[/version\/([\w\.]+)\s.*(mobile\s?safari|safari)/i],[u,s],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[s,[u,f.str,m.browser.oldSafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[s,u],[/(navigator|netscape)\/([\w\.-]+)/i],[[s,"Netscape"],u],[/ile\svr;\srv:([\w\.]+)\).+firefox/i],[u,[s,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)$/i,/(firefox)\/([\w\.]+)\s[\w\s\-]+\/[\w\.]+$/i,/(mozilla)\/([\w\.]+)\s.+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[s,u]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",p.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|armv?8e?l?)\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows\s(ce|mobile);\sppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",p.lowerize]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?:64|(?=v(?:[1-7]|[5-7]1)l?|;|eabi))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",p.lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus\s10)/i],[i,[c,"Samsung"],[a,d]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy\snexus)/i,/\ssamsung[\s-]([\w-]+)/i,/sec-(sgh\w+)/i],[i,[c,"Samsung"],[a,l]],[/\((ip(?:hone|od)[\s\w]*);/i],[i,[c,"Apple"],[a,l]],[/\((ipad);[\w\s\),;-]+apple/i,/applecoremedia\/[\w\.]+\s\((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[i,[c,"Apple"],[a,d]],[/\b((?:agr|ags[23]|bah2?|sht?)-a?[lw]\d{2})/i],[i,[c,"Huawei"],[a,d]],[/d\/huawei([\w\s-]+)[;\)]/i,/\b(nexus\s6p|vog-[at]?l\d\d|ane-[at]?l[x\d]\d|eml-a?l\d\da?|lya-[at]?l\d[\dc]|clt-a?l\d\di?|ele-l\d\d)/i,/\b(\w{2,4}-[atu][ln][01259][019])[;\)\s]/i],[i,[c,"Huawei"],[a,l]],[/\b(poco[\s\w]+)(?:\sbuild|\))/i,/\b;\s(\w+)\sbuild\/hm\1/i,/\b(hm[\s\-_]?note?[\s_]?(?:\d\w)?)\sbuild/i,/\b(redmi[\s\-_]?(?:note|k)?[\w\s_]+)(?:\sbuild|\))/i,/\b(mi[\s\-_]?(?:a\d|one|one[\s_]plus|note lte)?[\s_]?(?:\d?\w?)[\s_]?(?:plus)?)\sbuild/i],[[i,/_/g," "],[c,"Xiaomi"],[a,l]],[/\b(mi[\s\-_]?(?:pad)(?:[\w\s_]+))(?:\sbuild|\))/i],[[i,/_/g," "],[c,"Xiaomi"],[a,d]],[/;\s(\w+)\sbuild.+\soppo/i,/\s(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007)\b/i],[i,[c,"OPPO"],[a,l]],[/\svivo\s(\w+)(?:\sbuild|\))/i,/\s(v[12]\d{3}\w?[at])(?:\sbuild|;)/i],[i,[c,"Vivo"],[a,l]],[/\s(rmx[12]\d{3})(?:\sbuild|;)/i],[i,[c,"Realme"],[a,l]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)\b[\w\s]+build\//i,/\smot(?:orola)?[\s-](\w*)/i,/((?:moto[\s\w\(\)]+|xt\d{3,4}|nexus\s6)(?=\sbuild|\)))/i],[i,[c,"Motorola"],[a,l]],[/\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[i,[c,"Motorola"],[a,d]],[/((?=lg)?[vl]k\-?\d{3})\sbuild|\s3\.[\s\w;-]{10}lg?-([06cv9]{3,4})/i],[i,[c,"LG"],[a,d]],[/(lm-?f100[nv]?|nexus\s[45])/i,/lg[e;\s\/-]+((?!browser|netcast)\w+)/i,/\blg(\-?[\d\w]+)\sbuild/i],[i,[c,"LG"],[a,l]],[/(ideatab[\w\-\s]+)/i,/lenovo\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+)|yt[\d\w-]{6}|tb[\d\w-]{6})/i],[i,[c,"Lenovo"],[a,d]],[/(?:maemo|nokia).*(n900|lumia\s\d+)/i,/nokia[\s_-]?([\w\.-]*)/i],[[i,/_/g," "],[c,"Nokia"],[a,l]],[/droid.+;\s(pixel\sc)[\s)]/i],[i,[c,"Google"],[a,d]],[/droid.+;\s(pixel[\s\daxl]{0,6})(?:\sbuild|\))/i],[i,[c,"Google"],[a,l]],[/droid.+\s([c-g]\d{4}|so[-l]\w+|xq-a\w[4-7][12])(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[i,[c,"Sony"],[a,l]],[/sony\stablet\s[ps]\sbuild\//i,/(?:sony)?sgp\w+(?:\sbuild\/|\))/i],[[i,"Xperia Tablet"],[c,"Sony"],[a,d]],[/\s(kb2005|in20[12]5|be20[12][59])\b/i,/\ba000(1)\sbuild/i,/\boneplus\s(a\d{4})[\s)]/i],[i,[c,"OnePlus"],[a,l]],[/(alexa)webm/i,/(kf[a-z]{2}wi)(\sbuild\/|\))/i,/(kf[a-z]+)(\sbuild\/|\)).+silk\//i],[i,[c,"Amazon"],[a,d]],[/(sd|kf)[0349hijorstuw]+(\sbuild\/|\)).+silk\//i],[[i,"Fire Phone"],[c,"Amazon"],[a,l]],[/\((playbook);[\w\s\),;-]+(rim)/i],[i,c,[a,d]],[/((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10;\s(\w+)/i],[i,[c,"BlackBerry"],[a,l]],[/(?:\b|asus_)(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus\s7|padfone|p00[cj])/i],[i,[c,"ASUS"],[a,d]],[/\s(z[es]6[027][01][km][ls]|zenfone\s\d\w?)\b/i],[i,[c,"ASUS"],[a,l]],[/(nexus\s9)/i],[i,[c,"HTC"],[a,d]],[/(htc)[;_\s-]{1,2}([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[c,[i,/_/g," "],[a,l]],[/droid[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[i,[c,"Acer"],[a,d]],[/droid.+;\s(m[1-5]\snote)\sbuild/i,/\bmz-([\w-]{2,})/i],[i,[c,"Meizu"],[a,l]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asu
10s)-?(\w+)/i,/(microsoft);\s(lumia[\s\w]+)/i,/(lenovo)[_\s-]?([\w-]+)/i,/linux;.+(jolla);/i,/droid.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[c,i,[a,l]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i,/[;\/]\s?(le[\s\-]+pan)[\s\-]+(\w{1,9})\sbuild/i,/[;\/]\s?(trinity)[\-\s]*(t\d{3})\sbuild/i,/\b(gigaset)[\s\-]+(q\w{1,9})\sbuild/i,/\b(vodafone)\s([\w\s]+)(?:\)|\sbuild)/i],[c,i,[a,d]],[/\s(surface\sduo)\s/i],[i,[c,"Microsoft"],[a,d]],[/droid\s[\d\.]+;\s(fp\du?)\sbuild/i],[i,[c,"Fairphone"],[a,l]],[/\s(u304aa)\sbuild/i],[i,[c,"AT&T"],[a,l]],[/sie-(\w*)/i],[i,[c,"Siemens"],[a,l]],[/[;\/]\s?(rct\w+)\sbuild/i],[i,[c,"RCA"],[a,d]],[/[;\/\s](venue[\d\s]{2,7})\sbuild/i],[i,[c,"Dell"],[a,d]],[/[;\/]\s?(q(?:mv|ta)\w+)\sbuild/i],[i,[c,"Verizon"],[a,d]],[/[;\/]\s(?:barnes[&\s]+noble\s|bn[rt])([\w\s\+]*)\sbuild/i],[i,[c,"Barnes & Noble"],[a,d]],[/[;\/]\s(tm\d{3}\w+)\sbuild/i],[i,[c,"NuVision"],[a,d]],[/;\s(k88)\sbuild/i],[i,[c,"ZTE"],[a,d]],[/;\s(nx\d{3}j)\sbuild/i],[i,[c,"ZTE"],[a,l]],[/[;\/]\s?(gen\d{3})\sbuild.*49h/i],[i,[c,"Swiss"],[a,l]],[/[;\/]\s?(zur\d{3})\sbuild/i],[i,[c,"Swiss"],[a,d]],[/[;\/]\s?((zeki)?tb.*\b)\sbuild/i],[i,[c,"Zeki"],[a,d]],[/[;\/]\s([yr]\d{2})\sbuild/i,/[;\/]\s(dragon[\-\s]+touch\s|dt)(\w{5})\sbuild/i],[[c,"Dragon Touch"],i,[a,d]],[/[;\/]\s?(ns-?\w{0,9})\sbuild/i],[i,[c,"Insignia"],[a,d]],[/[;\/]\s?((nxa|Next)-?\w{0,9})\sbuild/i],[i,[c,"NextBook"],[a,d]],[/[;\/]\s?(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05]))\sbuild/i],[[c,"Voice"],i,[a,l]],[/[;\/]\s?(lvtel\-)?(v1[12])\sbuild/i],[[c,"LvTel"],i,[a,l]],[/;\s(ph-1)\s/i],[i,[c,"Essential"],[a,l]],[/[;\/]\s?(v(100md|700na|7011|917g).*\b)\sbuild/i],[i,[c,"Envizen"],[a,d]],[/[;\/]\s?(trio[\s\w\-\.]+)\sbuild/i],[i,[c,"MachSpeed"],[a,d]],[/[;\/]\s?tu_(1491)\sbuild/i],[i,[c,"Rotor"],[a,d]],[/(shield[\w\s]+)\sbuild/i],[i,[c,"Nvidia"],[a,d]],[/(sprint)\s(\w+)/i],[c,i,[a,l]],[/(kin\.[onetw]{3})/i],[[i,/\./g," "],[c,"Microsoft"],[a,l]],[/droid\s[\d\.]+;\s(cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[i,[c,"Zebra"],[a,d]],[/droid\s[\d\.]+;\s(ec30|ps20|tc[2-8]\d[kx])\)/i],[i,[c,"Zebra"],[a,l]],[/\s(ouya)\s/i,/(nintendo)\s([wids3utch]+)/i],[c,i,[a,"console"]],[/droid.+;\s(shield)\sbuild/i],[i,[c,"Nvidia"],[a,"console"]],[/(playstation\s[345portablevi]+)/i],[i,[c,"Sony"],[a,"console"]],[/[\s\(;](xbox(?:\sone)?(?!;\sxbox))[\s\);]/i],[i,[c,"Microsoft"],[a,"console"]],[/smart-tv.+(samsung)/i],[c,[a,h]],[/hbbtv.+maple;(\d+)/i],[[i,/^/,"SmartTV"],[c,"Samsung"],[a,h]],[/(?:linux;\snetcast.+smarttv|lg\snetcast\.tv-201\d)/i],[[c,"LG"],[a,h]],[/(apple)\s?tv/i],[c,[i,"Apple TV"],[a,h]],[/crkey/i],[[i,"Chromecast"],[c,"Google"],[a,h]],[/droid.+aft([\w])(\sbuild\/|\))/i],[i,[c,"Amazon"],[a,h]],[/\(dtv[\);].+(aquos)/i],[i,[c,"Sharp"],[a,h]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[c,p.trim],[i,p.trim],[a,h]],[/[\s\/\(](android\s|smart[-\s]?|opera\s)tv[;\)\s]/i],[[a,h]],[/((pebble))app\/[\d\.]+\s/i],[c,i,[a,"wearable"]],[/droid.+;\s(glass)\s\d/i],[i,[c,"Google"],[a,"wearable"]],[/droid\s[\d\.]+;\s(wt63?0{2,3})\)/i],[i,[c,"Zebra"],[a,"wearable"]],[/(tesla)(?:\sqtcarbrowser|\/20[12]\d\.[\w\.-]+)/i],[c,[a,"embedded"]],[/droid .+?; ([^;]+?)(?: build|\) applewebkit).+? mobile safari/i],[i,[a,l]],[/droid .+?;\s([^;]+?)(?: build|\) applewebkit).+?(?! mobile) safari/i],[i,[a,d]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[a,p.lowerize]],[/(android[\w\.\s\-]{0,9});.+build/i],[i,[c,"Generic"]],[/(phone)/i],[[a,l]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[u,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[u,[s,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[s,u],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[u,s]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[s,u],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)(?!.+xbox)/i],[s,[u,f.str,m.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[s,"Windows"],[u,f.str,m.os.windows.version]],[/ip[honead]{2,4}\b(?:.*os\s([\w]+)\slike\smac|;\sopera)/i,/cfnetwork\/.+darwin/i],[[u,/_/g,"."],[s,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)(?!.+haiku)/i],[[s,"Mac OS"],[u,/_/g,"."]],[/(android|webos|palm\sos|qn
10x|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/\((series40);/i],[s,u],[/\(bb(10);/i],[u,[s,"BlackBerry"]],[/(?:symbian\s?os|symbos|s60(?=;)|series60)[\/\s-]?([\w\.]*)/i],[u,[s,"Symbian"]],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[s,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[u,[s,"webOS"]],[/crkey\/([\d\.]+)/i],[u,[s,"Chromecast"]],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[s,"Chromium OS"],u],[/(nintendo|playstation)\s([wids345portablevuch]+)/i,/(xbox);\s+xbox\s([^\);]+)/i,/(mint)[\/\s\(\)]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?=\slinux)|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus|raspbian)(?:\sgnu\/linux)?(?:\slinux)?[\/\s-]?(?!chrom|package)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i,/\s([frentopc-]{0,4}bsd|dragonfly)\s?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku)\s(\w+)/i],[s,u],[/(sunos)\s?([\w\.\d]*)/i],[[s,"Solaris"],u],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[s,u]]},v=function t(n,o){if("object"===e(n)&&(o=n,n=void 0),!(this instanceof t))return new t(n,o).getResult();var i=n||(void 0!==r&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),s=o?p.extend(g,o):g;return this.getBrowser=function(){var t={name:void 0,version:void 0};return f.rgx.call(t,i,s.browser),t.major=p.major(t.version),t},this.getCPU=function(){var t={architecture:void 0};return f.rgx.call(t,i,s.cpu),t},this.getDevice=function(){var t={vendor:void 0,model:void 0,type:void 0};return f.rgx.call(t,i,s.device),t},this.getEngine=function(){var t={name:void 0,version:void 0};return f.rgx.call(t,i,s.engine),t},this.getOS=function(){var t={name:void 0,version:void 0};return f.rgx.call(t,i,s.os),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(t){return i="string"===e(t)&&t.length>255?p.trim(t,255):t,this},this.setUA(i),this};v.VERSION="0.7.28",v.BROWSER={NAME:s,MAJOR:"major",VERSION:u},v.CPU={ARCHITECTURE:"architecture"},v.DEVICE={MODEL:i,VENDOR:c,TYPE:a,CONSOLE:"console",MOBILE:l,SMARTTV:h,TABLET:d,WEARABLE:"wearable",EMBEDDED:"embedded"},v.ENGINE={NAME:s,VERSION:u},v.OS={NAME:s,VERSION:u},t.exports&&(n=t.exports=v),n.UAParser=v;var y=void 0!==r&&(r.jQuery||r.Zepto);if(y&&!y.ua){var _=new v;y.ua=_.getResult(),y.ua.get=function(){return _.getUA()},y.ua.set=function(t){_.setUA(t);var e=_.getResult();for(var n in e)y.ua[n]=e[n]}}}("object"===("undefined"==typeof window?"undefined":e(window))?window:f)})),_=y.UAParser,b=Object.freeze({__proto__:null,default:y,__moduleExports:y,UAParser:_}),A=void 0,S=void 0;function w(t){var e={allow:!1,timeout:4e3,maximumAge:18e4},n=void 0,r=function(){n=void 0},o=function(t,e){var n={};for(var r in e=e||{},t=t||{})n[r]=t[r];for(var r in e)n[r]=e[r];return n},i=function(e,n,r){if(A)p(e,r);else{var o={excludes:{userAgent:!0,screenResolution:!0,fonts:!0,fontsFlash:!0,plugins:!0,colorDepth:!0,webdriver:!0,audio:!0,deviceMemory:!0,enumerateDevices:!0,timezone:!0,webglVendorAndRenderer:!0}};t.largeData||(o.excludes.canvas=!0,o.excludes.webgl=!0),n.getV18(o,(function(t,n){var o=s(n);A={id:t,details:o},p(e,r)}))}},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=t||[];for(var n={},r=0;r<t.length;r++){var o=t[r],i=o.key;e&&(i=a(i)),n[i]=o.value}return n},a=function(t){return t.replace(/[\w]([A-Z])/g,(function(t){return t[0]+"_"+t[1]})).toLowerCase()},c=function(e,n,r){if(S)p(e,r);else{var o={excludes:{}};t.largeData||(o.excludes.canvas=!0,o.excludes.webgl=!0),t.deviceFingerprint||(o.excludes.screenResolution=!0,o.excludes.fonts=!0,o.excludes.fontsFlash=!0,o.excludes.plugins=!0,o.excludes.colorDepth=!0,o.excludes.webdriver=!0,o.excludes.audio=!0,o.excludes.deviceMemory=!0,o.excludes.enumerateDevices=!0,o.excludes.timezone=!0,o.excludes.webglVendorAndRenderer=!0),n.get(o,(function(t){S=s(t,!0),p(e,r)}))}},u=function(e,r){n=void 0;var o=t.location;if(!o.allow)return h(!1),void p(e,r);if(l(navigator.geolocation)||"function"!=typeof navigator.geolocation.getCurrentPosition)return h(!1),void p(e,r);var i=setTimeout((function(){s({code:3})}),o.timeout),s=function(t){clearTimeout(i),h(!0,void 0,void 0,d(t.code)),p(e,r)};navigator.geolocation.getCurrentPosition((function(t){clearTimeout(i),h(!0,t.co
10ords.latitude,t.coords.longitude),p(e,r)}),s,o)},l=function(t){return null==t},d=function(t){return 1===t?"permission_denied":2===t?"position_unavailable":3===t?"timeout":"unknown"};function h(t,e,r,o){n={enabled:t||!1,lat:e,lng:r,error:o}}var p=function(t,e){if(!(l(S)||l(A)||l(n))){var o={metadata:{timestamp:Date.now(),physical_app_id:window.location.hostname},content:{device_details:f(A,e),location:n},fp2:S};r(),t(o)}},f=function(t,e){var n={device_id:t.id},r=t.details,o=(new e.UAParser).setUA(navigator.userAgent).getResult();return n.os_type=o.os.name,n.os_version=o.os.version,n.device_model=o.browser.name+" "+o.browser.version,n.device_platform=r.navigator_platform,n.tampered=function(t){return t&&(t.has_lied_browser||t.has_lied_language||t.has_lied_os||t.has_lied_resolution)}(r),n.timezone_offset=r.timezone_offset,n};return(t=t||{}).location=o(e,t.location),r(),{get:function(t){i(t,v,b),c(t,v,b),u(t,b)}}}function I(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function k(t,e,n,r,o,i){return I((s=I(I(e,t),I(r,i)))<<(a=o)|s>>>32-a,n);var s,a}function C(t,e,n,r,o,i,s){return k(e&n|~e&r,t,e,o,i,s)}function E(t,e,n,r,o,i,s){return k(e&r|n&~r,t,e,o,i,s)}function R(t,e,n,r,o,i,s){return k(e^n^r,t,e,o,i,s)}function P(t,e,n,r,o,i,s){return k(n^(e|~r),t,e,o,i,s)}function D(t,e){var n,r,o,i,s;t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;var a=1732584193,c=-271733879,u=-1732584194,l=271733878;for(n=0;n<t.length;n+=16)r=a,o=c,i=u,s=l,a=C(a,c,u,l,t[n],7,-680876936),l=C(l,a,c,u,t[n+1],12,-389564586),u=C(u,l,a,c,t[n+2],17,606105819),c=C(c,u,l,a,t[n+3],22,-1044525330),a=C(a,c,u,l,t[n+4],7,-176418897),l=C(l,a,c,u,t[n+5],12,1200080426),u=C(u,l,a,c,t[n+6],17,-1473231341),c=C(c,u,l,a,t[n+7],22,-45705983),a=C(a,c,u,l,t[n+8],7,1770035416),l=C(l,a,c,u,t[n+9],12,-1958414417),u=C(u,l,a,c,t[n+10],17,-42063),c=C(c,u,l,a,t[n+11],22,-1990404162),a=C(a,c,u,l,t[n+12],7,1804603682),l=C(l,a,c,u,t[n+13],12,-40341101),u=C(u,l,a,c,t[n+14],17,-1502002290),a=E(a,c=C(c,u,l,a,t[n+15],22,1236535329),u,l,t[n+1],5,-165796510),l=E(l,a,c,u,t[n+6],9,-1069501632),u=E(u,l,a,c,t[n+11],14,643717713),c=E(c,u,l,a,t[n],20,-373897302),a=E(a,c,u,l,t[n+5],5,-701558691),l=E(l,a,c,u,t[n+10],9,38016083),u=E(u,l,a,c,t[n+15],14,-660478335),c=E(c,u,l,a,t[n+4],20,-405537848),a=E(a,c,u,l,t[n+9],5,568446438),l=E(l,a,c,u,t[n+14],9,-1019803690),u=E(u,l,a,c,t[n+3],14,-187363961),c=E(c,u,l,a,t[n+8],20,1163531501),a=E(a,c,u,l,t[n+13],5,-1444681467),l=E(l,a,c,u,t[n+2],9,-51403784),u=E(u,l,a,c,t[n+7],14,1735328473),a=R(a,c=E(c,u,l,a,t[n+12],20,-1926607734),u,l,t[n+5],4,-378558),l=R(l,a,c,u,t[n+8],11,-2022574463),u=R(u,l,a,c,t[n+11],16,1839030562),c=R(c,u,l,a,t[n+14],23,-35309556),a=R(a,c,u,l,t[n+1],4,-1530992060),l=R(l,a,c,u,t[n+4],11,1272893353),u=R(u,l,a,c,t[n+7],16,-155497632),c=R(c,u,l,a,t[n+10],23,-1094730640),a=R(a,c,u,l,t[n+13],4,681279174),l=R(l,a,c,u,t[n],11,-358537222),u=R(u,l,a,c,t[n+3],16,-722521979),c=R(c,u,l,a,t[n+6],23,76029189),a=R(a,c,u,l,t[n+9],4,-640364487),l=R(l,a,c,u,t[n+12],11,-421815835),u=R(u,l,a,c,t[n+15],16,530742520),a=P(a,c=R(c,u,l,a,t[n+2],23,-995338651),u,l,t[n],6,-198630844),l=P(l,a,c,u,t[n+7],10,1126891415),u=P(u,l,a,c,t[n+14],15,-1416354905),c=P(c,u,l,a,t[n+5],21,-57434055),a=P(a,c,u,l,t[n+12],6,1700485571),l=P(l,a,c,u,t[n+3],10,-1894986606),u=P(u,l,a,c,t[n+10],15,-1051523),c=P(c,u,l,a,t[n+1],21,-2054922799),a=P(a,c,u,l,t[n+8],6,1873313359),l=P(l,a,c,u,t[n+15],10,-30611744),u=P(u,l,a,c,t[n+6],15,-1560198380),c=P(c,u,l,a,t[n+13],21,1309151649),a=P(a,c,u,l,t[n+4],6,-145523070),l=P(l,a,c,u,t[n+11],10,-1120210379),u=P(u,l,a,c,t[n+2],15,718787259),c=P(c,u,l,a,t[n+9],21,-343485551),a=I(a,r),c=I(c,o),u=I(u,i),l=I(l,s);return[a,c,u,l]}function T(t){var e,n="",r=32*t.length;for(e=0;e<r;e+=8)n+=String.fromCharCode(t[e>>5]>>>e%32&255);return n}function F(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=8*t.length;for(e=0;e<r;e+=8)n[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return n}function L(t){var e,n,r="";for(n=0;n<t.length;n+=1)e=t.charCodeAt(n),r+="0123456789abcdef".charAt(e>>>4&15)+"0123456789abcdef".charAt(15&e);return r}function x(t){return unescape(encodeURIComponent(t))}function M(t){return function(t){return T(D(F(t),8*t.length))}(x(t))}function O(t,e){return function(t,e){var n,r,o=F(t),i=[],s=[];for(i[15]=s[15]=void 0,o.length>16&&(o=D(o,8*t.length)),n=0;n<16;n+=1)i[n]=909522486^o[n],s[n]=1549556828^o[n];return r=D(i.concat(F(e)),512+8*e.length),T(D(s.concat(r),640))}(x(t),x(e))}function q(t,e,n){return e?n?O(e,t):L(O(e,t)):n?M(t):L(M(t))}var N=function(){function t(){n(this,t),this.locales={}}return o(t,[{key:"getString",value:function(t,e){var n=e||"en-US",r=this.locales[n];return r&&r.hasOwnProperty(t)?r[t]:t}},{key:"addDictionary",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",n=this.locales[e]||{},r=Object.assign(n,t);this.locales[e]=r}}]),t}(),U=function(){function t(e,r){n(this,t),this.navi=navigator,this.opType=e,this.options=r}return o(t,[{key:"b64Encode",value:function(t){for(var e="",n=new Uint8Array(t),r=n.byteLength,o=0;o<r;o++)e+=String.fromCharCode(n[o]);return window.btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}},{key:"b64Decode",value:function(t){for(var e=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,""),n=window.atob(e),r=n.length,o=new Uint8Array(r),i=0;i<r;i++)o[i]=n.charCodeAt(i);return o.buffer}},{key:"publicKeyCredentialToJSON",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25;if(t instanceof ArrayBuffer)return this.b64Encode(t);if(e<=0)return t;if(t instanceof Array){var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=t[Symbol.iterator]();!(r=(s=a.next()).done);r=!0){var c=s.value;n.push(this.publicKeyCredentialToJSON(c),e-1)}}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}return n}if(t instanceof Object){var u={};for(var l in t)"function"!=typeof t[l]&&(u[l]=this.publicKeyCredentialToJSON(t[l],e-1));return u}return t}},{key:"execute",value:function(){var t,e=this,n=JSON.parse(JSON.stringify(this.options));switch(this.opType){case com.ts.mobile.sdkhost.Fido2CredentialsOpType.Create:n.publicKey.challenge=this.b64Decode(n.publicKey.challenge),n.publicKey.user.id=this.b64Decode(n.publicKey.user.id),n.publicKey.excludeCredentials.map((function(t){return t.id=e.b64Decode(t.id),t})),t=this.navi.credentials.create(n).then((function(t){t.clientExtensionResults=t.getClientExtensionResults();var n=t.response&&t.response.getTransports&&t.response.getTransports(),r=e.publicKeyCredentialToJSON(t);return n&&n.length>0&&(r.response.transports=n),r}));break;case com.ts.mobile.sdkhost.Fido2CredentialsOpType.Get:n.publicKey.challenge=this.b64Decode(n.publicKey.challenge);var r=!0,o=!1,i=void 0;try{for(var s,a=n.publicKey.allowCredentials[Symbol.iterator]();!(r=(s=a.next()).done);r=!0){var c=s.value;c.id=this.b64Decode(c.id)}}catch(t){o=!0,i=t}finally{try{r||null==a.return||a.return()}finally{if(o)throw i}}t=this.navi.credentials.get(n).then((function(t){return t.clientExtensionResults=t.getClientExtensionResults(),e.publicKeyCredentialToJSON(t)}))}return t=t.catch((function(t){throw K.indexOf(t.name)>-1?new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.UserCanceled,"Received FIDO2 cancellation request from platform; Error: ".concat(t)):t}))}}]),t}(),K=["NotAllowedError","AbortError"],B=function(){function t(e,r,o,i,s){n(this,t),this._tag=e,this._keyClass=r,this._protection=o,this._keyData=i,this._keyStore=s}return o(t,[{key:"getKeyClass",value:function(){return this._keyClass}},{key:"getTag",value:function(){return this._tag}},{key:"getBioProtected",value:function(){return this._protection}},{key:"setBiometricPromptInfo",value:function(t,e,n){}},{key:"signHex",value:function(t){return this._keyStore.signWithKeyPair(this._tag,this._keyClass,t)}},{key:"encrypt",value:function(t){throw new Error("Method not implemented.")}},{key:"decrypt",value:function(t){throw new Error("Method not implemented.")}},{key:"unwrapAsymmetricKeyPairFromPrivateKeyHex",value:function(t,e){throw new Error("Method not implemented.")}},{key:"unwrapSymmetricKeyHex",value:function(t,e){throw new Error("Method not implemented.")}},{key:"wrapSymmetricKey",value:function(t){throw new Error("Method not implemented.")}},{key:"publicKeyToJson",value:function(){return this._keyData}},{key:"closeKeyPair",value:function(){throw new Error("Method not implemented.")}}]),t}(),H=function(){function t(e){n(this,t),this._host=e}return o(t,[{key:"generateKeyPair",value:function(t,e,n,r){var o=this,i=this.keyGenParamsForKeyClass(e);return this.generateKeyPairInternal(t,i,e,n,r).catch((function(i){if(o._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus","Failed to generate key pair: ".concat(i)),i instanceof DOMException&&"DataCloneError"===i.name){var s=o.fallbackKeyGenParamsForKeyClass(e);return o.generateKeyPairInternal(t,s,e,n,r)}throw o._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus","Failed to generate key pair: ".concat(i)),com.ts.mobile.sdk.impl.AuthenticationErrorImpl.ensureAuthenticationError(i)}))}},{key:"generateKeyPairInternal",value:function(t,e,n,r,o){var s=this;return new Promise((function(o,a){e||o(null),s.promiseLikeToPromise(crypto.subtle.generateKey(e.params,!1,s.keyUsagesForKeyClass(n))).then((function(c){return s._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","key pair generated, now will validate private key is not exportable."),new Promise((function(t,e){s.promiseLikeToPromise(crypto.subtle.exportKey("pkcs8",c.privateKey)).then((function(t){var e="generated exportable private key";s._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus",e);var n=new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Internal,e),r={};throw r[com.ts.mobile.sdkhost.ErrorDataInternalError]=com.ts.mobile.sdkhost.InternalErrorCouldNotGenerateSecureKey,com.ts.mobile.sdk.impl.AuthenticationErrorImpl.augmentErrorData(n,r)})).catch((function(n){if(n instanceof com.ts.mobile.sdk.impl.AuthenticationErrorImpl&&e(n),!(n instanceof DOMException)||n instanceof DOMException&&"InvalidAccessError"!==n.name){var r="failed to verify private key is not exportable";s._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus",r);var o=new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Internal,r),i={};i[com.ts.mobile.sdkhost.ErrorDataInternalError]=com.ts.mobile.sdkhost.InternalErrorCouldNotGenerateSecureKey,e(com.ts.mobile.sdk.impl.AuthenticationErrorImpl.augmentErrorData(o,i))}t(!0)}))})).then((function(o){return s._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","generate key pair success"),s.promiseLikeToPromise(crypto.subtle.exportKey("spki",c.publicKey)).then((function(o){s._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","export key pair success");var u=s._db.transaction("keystore","readwrite");u.oncomplete=function(t){s._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","object store transaction complete")},u.onerror=function(t){var e="object store transaction failed: ".concat(u.error.message);s._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus",e),a(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Internal,e))};var l=u.objectStore("keystore");try{var d=l.add({tag:t,key:c.privateKey});return s.promiseRequestResult(d).then((function(a){s._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","add key pair success");var c=btoa(String.fromCharCode.apply(String,i(new Uint8Array(o))));return s.savePublicKeyData(t,c,e.keyType),new B(t,n,r,{type:e.keyType,key:c},s)}))}catch(t){throw s._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus","failed to add record to db: ".concat(t)),t}}))}
10)).catch((function(t){throw s._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus","failed to generate key pair: ".concat(t)),t})).then(o,a)}))}))}},{key:"getKeyPair",value:function(t,e,n){var r=this.getPublicKeyData(t);return r?new B(t,e,n,{type:r.keyType,key:r.keyData},this):null}},{key:"deleteKeyPair",value:function(t){delete this._publicKeyDataCache[t],this._host.writeStorageKey("xmkeystore",this._publicKeyDataCache)}},{key:"signWithKeyPair",value:function(t,e,n){var r=this;return new Promise((function(e,o){var i=r._db.transaction("keystore");i.oncomplete=function(t){r._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","object store transaction complete")},i.onerror=function(t){var e="object store transaction failed: ".concat(i.error.message);r._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus",e),o(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Internal,e))};var s=i.objectStore("keystore").get(t);r.promiseRequestResult(s).then((function(t){if(t){r._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","get key pair success");var i=new Uint8Array(com.ts.mobile.sdk.util.hexToBytes(n)),s=t.key.algorithm.name;r.promiseLikeToPromise(crypto.subtle.sign({name:s,hash:"SHA-256"},t.key,i)).then((function(t){if("ECDSA"===s){var n=r.convertSignatureToDERHex(new Uint8Array(t));e(n)}else if("RSASSA-PKCS1-v1_5"===s)e(r.toHexString(t));else{var i="invalid signing key algorithm";r._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus",i),o(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Internal,i))}}))}else{var a="failed to get signing key";r._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus",a),o(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.InvalidDeviceBinding,a))}})).catch(o)})).catch((function(t){throw r._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus","failed to sign with key pair: ".concat(t)),com.ts.mobile.sdk.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)}))}},{key:"initialize",value:function(){var t=this;return new Promise((function(e,n){var r=function(){try{t._publicKeyDataCache=t._host.readStorageKey("xmkeystore"),e(!0)}catch(e){var r="failed to fetch public key data cache: ".concat(e);t._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus",r),n(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Internal,r))}},o=indexedDB.open("com.ts.mobile.sdk.key-store",1);o.onupgradeneeded=function(e){t._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","indexedDB upgrade or create required"),t._db=o.result,t._db.createObjectStore("keystore",{keyPath:"tag"}),r()},o.onsuccess=function(e){t._host.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","indexedDB opened successfully"),t._db=o.result,r()},o.onerror=function(e){var r="failed to open indexedDB: ".concat(o.error.message);t._host.log(com.ts.mobile.sdk.LogLevel.Error,"TransmitSDK/Tarsus",r),n(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.Internal,r))}}))}},{key:"promiseRequestResult",value:function(t){return new Promise((function(e,n){t.onsuccess=function(n){e(t.result)},t.onerror=function(e){n(t.error)}}))}},{key:"promiseLikeToPromise",value:function(t){return new Promise((function(e,n){t.then(e,n)}))}},{key:"keyUsagesForKeyClass",value:function(t){switch(t){case com.ts.mobile.sdkhost.KeyClass.StdEncryptionKey:case com.ts.mobile.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey:return["decrypt","encrypt"];default:return["sign"]}}},{key:"keyGenParamsForKeyClass",value:function(t){switch(t){case com.ts.mobile.sdkhost.KeyClass.StdEncryptionKey:case com.ts.mobile.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey:return null;default:return{keyType:"ec",params:{name:"ECDSA",namedCurve:"P-384"}}}}},{key:"fallbackKeyGenParamsForKeyClass",value:function(t){switch(t){case com.ts.mobile.sdkhost.KeyClass.StdEncryptionKey:case com.ts.mobile.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey:return null;default:return{keyType:"rsapkcs",params:{name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"}}}}},{key:"getPublicKeyData",value:function(t){return this._publicKeyDataCache[t]}
10},{key:"savePublicKeyData",value:function(t,e,n){this._publicKeyDataCache[t]={keyType:n,keyData:e},this._host.writeStorageKey("xmkeystore",this._publicKeyDataCache)}},{key:"convertSignatureToDERHex",value:function(t){for(var e=Array.prototype.map.call(t,(function(t){return("00"+t.toString(16)).slice(-2)})).join(""),n=e.substring(0,96),r=e.substring(96),o=!0,i=!0;0===n.indexOf("00");)n=n.substring(2),o=!1;for(o&&parseInt(n.substring(0,2),16)>127&&(n="00"+n);0===r.indexOf("00");)r=r.substring(2),i=!1;i&&parseInt(r.substring(0,2),16)>127&&(r="00"+r);var s=function(t){return("00"+(t.length/2).toString(16)).slice(-2).toString()},a="02"+s(n)+n+"02"+s(r)+r;return"30"+s(a)+a}},{key:"toHexString",value:function(t){return Array.prototype.map.call(new Uint8Array(t),(function(t){return("00"+t.toString(16)).slice(-2)})).join("")}}],[{key:"isIndexedDBSupported",value:function(){return!!(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB)}}]),t}(),j=function(){function t(){n(this,t)}return o(t,null,[{key:"isWebCryptoSupported",value:function(){if(!window.crypto||!window.crypto.subtle)return!1;var t=(new _).setUA(navigator.userAgent).getBrowser(),e=t.name,n=t.major,r=t.minor||0;return"Chrome"===e&&n>=45||"Safari"===e&&n>=11||"Mobile Safari"===e&&(n>=12||11==n&&r>=3)||"Edge"===e&&n>=79||"Firefox"===e&&n>=34}},{key:"isIndexedDBAvailable",value:function(){return new Promise((function(t){try{var e=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB;if(e){var n=e.open("capability-test"),r=setTimeout((function(){n.onsuccess=n.onerror=null,t(!1)}),4e3);n.onerror=function(){clearTimeout(r),t(!1)},n.onsuccess=function(){clearTimeout(r),e.deleteDatabase("capability-test"),t(!0)}}else t(!1)}catch(e){t(!1)}}))}},{key:"collect",value:function(){return new Promise((function(e){t.isIndexedDBAvailable().then((function(n){e({indexedDB:n,webCrypto:t.isWebCryptoSupported()})}))}))}}]),t}().collect(),z=function(){function t(){n(this,t),this.logLevel=com.ts.mobile.sdk.LogLevel.Error,this.collectionResultsPromise=null,this.internalLogger=new c,this.externalLogger=null,this.cachedFidoMfuvaSupported=null,this.localizer=new N,this.browserCapabilities=null,window.__XMSDK_PLUGINS={},this.localizer.addDictionary(a)}return o(t,[{key:"initialize",value:function(t){var e=this;return this.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","initialize with collectors [".concat(t,"]")),this._localStorage=new p("localStorage"),this._sessionStorage=new p("sessionStorage"),j.then((function(n){return e.browserCapabilities=n,e._enabledCollectors=t,"true"!==e.queryHostInfo(com.ts.mobile.sdkhost.HostInformationKey.PersistentKeysSupported)||(e.keyStore=new H(e),e.keyStore.initialize())}))}},{key:"setLogLevel",value:function(t){this.logLevel=t}},{key:"log",value:function(t,e,n){t<=this.logLevel&&this.internalLogger.log(t,e,n),this.externalLogger&&this.externalLogger.log(t,e,n)}},{key:"readStorageKey",value:function(t){return JSON.parse(this._localStorage.getItem(t)||"{}")}},{key:"writeStorageKey",value:function(t,e){this._localStorage.setItem(t,JSON.stringify(e))}},{key:"deleteStorageKey",value:function(t){this._localStorage.removeItem(t)}},{key:"readSessionStorageKey",value:function(t){return JSON.parse(this._sessionStorage.getItem(t)||"{}")}},{key:"writeSessionStorageKey",value:function(t,e){this._sessionStorage.setItem(t,JSON.stringify(e))}},{key:"deleteSessionStorageKey",value:function(t){this._sessionStorage.removeItem(t)}},{key:"promiseCollectionResult",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null!=n?(this.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","promiseCollectionResult() override collectors"),t=n):t=this._enabledCollectors;var r={location:{allow:t.indexOf(com.ts.mobile.sdk.CollectorType.Location)>=0,timeout:4e3,maximumAge:18e4},deviceFingerprint:t.indexOf(com.ts.mobile.sdk.CollectorType.DeviceFingerprint)>=0,largeData:t.indexOf(com.ts.mobile.sdk.CollectorType.LargeData)>=0},o=new Promise((function(n,o){e.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","promiseCollectionResult() invoked with collectors: [".concat(t,"]")),w(r).get((function(t){e.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","promiseCollectionResult() completed"),n(t)}))}));return Promise.all([o]).then((function(t){var e=Object.assign(t[0]);return e.toJson=function(){return e},e}))}},{key:"calcHexStringEncodedMd5Hash",value:function(t){return q(com.ts.mobile.sdk.util.hexToAscii(t))}},{key:"generateRandomHexString",value:function(t){var e=new Uint8Array(t);(window.crypto||window.msCrypto).getRandomValues(e);for(var n="",r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],o=0;o<e.length;o++){n+=r[15&e[o]]}return n}},{key:"queryHostInfo",value:function(t){switch(t){case com.ts.mobile.sdkhost.HostInformationKey.Version:return"7.3.18";case com.ts.mobile.sdkhost.HostInformationKey.Platform:return"web";case com.ts.mobile.sdkhost.HostInformationKey.FingerprintSupported:return"false";case com.ts.mobile.sdkhost.HostInformationKey.HostProvidedFeatures:return"";case com.ts.mobile.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported:case com.ts.mobile.sdkhost.HostInformationKey.ImageAcquitisionSupported:return"false";case com.ts.mobile.sdkhost.HostInformationKey.AudioAcquitisionSupported:return"true";
10case com.ts.mobile.sdkhost.HostInformationKey.PersistentKeysSupported:return this.browserCapabilities&&this.browserCapabilities.indexedDB&&this.browserCapabilities.webCrypto?"true":"false";case com.ts.mobile.sdkhost.HostInformationKey.DyadicPresent:return"false";case com.ts.mobile.sdkhost.HostInformationKey.Fido2ClientPresent:return navigator.credentials&&window.PublicKeyCredential?"true":"false";case com.ts.mobile.sdkhost.HostInformationKey.DeviceBiometricsSupported:case com.ts.mobile.sdkhost.HostInformationKey.DeviceBiometricsFPContinuation:case com.ts.mobile.sdkhost.HostInformationKey.DeviceBiometricsUsesSign:return"false";case com.ts.mobile.sdkhost.HostInformationKey.DevicePersistenceMode:return"persistent";default:throw new Error("Info key is unsupported: ".concat(t))}}},{key:"queryAsyncHostInfo",value:function(t){var e=this;return new Promise((function(n,r){switch(t){case com.ts.mobile.sdkhost.AsyncHostInformationKey.Fido2UserVerifyingPlatformAuthenticatorAvailable:if(e.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","queryAsyncHostInfo() for Fido2UserVerifyingPlatformAuthenticatorAvailable invoked"),null!=e.cachedFidoMfuvaSupported)e.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","queryAsyncHostInfo() for Fido2UserVerifyingPlatformAuthenticatorAvailable returning cached result"),n(e.cachedFidoMfuvaSupported?"true":"false");else{e.log(com.ts.mobile.sdk.LogLevel.Debug,"TransmitSDK/Tarsus","queryAsyncHostInfo() for Fido2UserVerifyingPlatformAuthenticatorAvailable evaluating");var o=window.PublicKeyCredential;(o?o.isUserVerifyingPlatformAuthenticatorAvailable().catch((function(t){return!1})):Promise.resolve(!1)).then((function(t){e.cachedFidoMfuvaSupported=t,n(t?"true":"false")}))}break;default:e.log(com.ts.mobile.sdk.LogLevel.Debug,"not-implemented","queryAsyncHostInfo not implemented for key \n [".concat(com.ts.mobile.sdkhost.AsyncHostInformationKey[t],"] in tarsus-web")),r("Info key is unsupported: ".concat(t))}}))}},{key:"setExternalLogger",value:function(t){this.externalLogger=t}},{key:"getCurrentTime",value:function(){return Date.now()}},{key:"createDelayedPromise",value:function(t){return new Promise((function(e){setTimeout((function(){return e(t)}),t)}))}},{key:"calcHexStringEncodedHmacSha1HashWithHexEncodedKey",value:function(t,e){return this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","calcHexStringEncodedHmacSha1HashWithHexEncodedKey not implemented for tarsus-web"),null}},{key:"generatePbkdf2HmacSha1HexString",value:function(t,e,n,r){return Promise.reject("generatePbkdf2HmacSha1HexString not implemented for tarsus-web")}},{key:"fidoClientXact",value:function(t,e,n,r){return Promise.reject("fidoClientXact not implemented for tarsus-web")}},{key:"fido2CredentialsOp",value:function(t,e,n,r,o){return new U(r,o).execute()}},{key:"generateKeyPair",value:function(t,e,n,r){return this.keyStore.generateKeyPair(t,e,n,r)}},{key:"getKeyPair",value:function(t,e,n){return this.keyStore.getKeyPair(t,e,n)}},{key:"deleteKeyPair",value:function(t){this.keyStore.deleteKeyPair(t)}},{key:"importSymmetricKey",value:function(t,e,n,r){return this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","importSymmetricKey not implemented for tarsus-web"),null}},{key:"calcHexStringEncodedSha256Hash",value:function(t){var e=com.ts.mobile.sdk.util.hexToAscii(t);return sha256(com.ts.mobile.sdk.util.toUTF8Array(e))}},{key:"calcHexStringEncodedSha512Hash",value:function(t){throw this.log(com.ts.mobile.sdk.LogLevel.Error,"not-implemented","calcHexStringEncodedSha512Hash not implemented for tarsus-web"),new Error("Method not implemented.")}},{key:"generateHexSeededKeyPairExternalRepresentation",value:function(t,e){return Promise.reject("Method not implemented.")}},{key:"generateKeyPairExternalRepresentation",value:function(t){return Promise.reject("Method not implemented.")}},{key:"importVolatileKeyPair",value:function(t,e){throw new Error("Method not implemented.")}},{key:"importVolatileSymmetricKey",value:function(t,e){throw new Error("Method not implemented.")}},{key:"loadPlugin",value:function(t){var e=window.__XMSDK_PLUGINS[t];return e?(this.log(com.ts.mobile.sdk.LogLevel.Debug,"plugins","Found defined plugin "+t),Promise.resolve(e)):(this.log(com.ts.mobile.sdk.LogLevel.Error,"plugins","Could not find defined plugin "+t),Promise.reject(new com.ts.mobile.sdk.impl.AuthenticationErrorImpl(com.ts.mobile.sdk.AuthenticationErrorCode.AppImplementation,"Could not find defined plugin "+t)))}},{key:"dyadicRefreshToken",value:function(t){throw new Error("Method not implemented.")}},{key:"dyadicEnroll",value:function(t,e){return Promise.reject("Method not implemented.")}},{key:"dyadicSign",value:function(t){return Promise.reject("Method not implemented.")}},{key:"dyadicDelete",value:function(){return Promise.reject("Method not implemented.")}},{key:"setDebugIndicatorVisible",value:function(t){t?this.debugIndicator||(this.debugIndicator=document.createElement("div"),Object.assign(this.debugIndicator.style,{position:"absolute",top:"5px",left:"5px",background:"black",opacity:"0.7",color:"white",borderRadius:"10px",padding:"12px",fontFamily:"sans-serif"}),this.debugIndicator.innerText="Transmit SDK: Journey is being debugged.",document.body.appendChild(this.debugIndicator)):this.debugIndicator&&(this.debugIndicator.remove(),this.debugIndicator=null)}},{key:"importVolatileKeyPairFromPublicKeyHex",value:function(t,e){throw new Error("Method not implemented.")}},{key:"getString",value:function(t,e){return this.localizer.getString(t,e)}},{key:"getPreferredLocale",value:function(){var t=window.navigator,e=window.navigator.languages?window.navigator.languages[0]:null;return e=e||t.language||t.browserLanguage||t.userLanguage}},{key:"transformApiPath",value:function(t){return t}},{key:"getUIStyles",value:function(){return"{}"}},{key:"dyadicClearAllData",value:function(){}}]),t}();!function(t){!function(t){!function(t){!function(t){!function(t){var n={},r=function(){function t(t){t?(this._reading=!0,this._root=t):(this._reading=!1,this._root={}),this._currentContainer=this._root,this._otherContainerStack=[]}return Object.defineProperty(t.prototype,"serializedContent",{get:function(){return this._root}
10,enumerable:!1,configurable:!0}),t.prototype.enterContainer=function(t){var n=this._currentContainer[t];if(this._reading||n||(n={},this._currentContainer[t]=n),"object"!=e(n))throw new Error("Attempt to enter non-container "+t);this._otherContainerStack.push(this._currentContainer),this._currentContainer=n},t.prototype.leaveContainer=function(){this._currentContainer=this._otherContainerStack.pop()},t.prototype.writePrimitive=function(t,e){this._currentContainer[t]=e},t.prototype.readPrimitive=function(t){return this._currentContainer[t]},t.prototype.writeObject=function(t,e){if(null!==e){var n=e.constructor.___serializationTag;if(!n)throw new Error("Invalid typetag for object passed to writeObject. Did you forget to decorate object with @Serializable?");this.enterContainer(t),this.writePrimitive("type",n),this.enterContainer("content"),e.serializeTo(this),this.leaveContainer(),this.leaveContainer()}else this.writePrimitive(t,null)},t.prototype.readObject=function(t,e){return this.internalReadObject(t,e)},t.prototype.readNonNullObject=function(t,e){var n=this.internalReadObject(t,e);if(!n)throw new Error("Invalid null object encountered");return n},t.prototype.internalReadObject=function(t,e){var r,o;if("string"==typeof t?(o=t,r=null):(r=t,o=e),null===this.readPrimitive(o))return null;this.enterContainer(o);var i=this.readPrimitive("type"),s=n[i];if(!s)throw new Error("Invalid class tag encountered in archive "+i);this.enterContainer("content");var a=new s(this);if(this.leaveContainer(),r&&!(a instanceof r))throw new Error("Expected subclass of "+r+"; found "+s);return this.leaveContainer(),a},t}();t.SerializationContext=r,t.Serializable=function(t){return function(e){n[t]=e,e.___serializationTag=t}}}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Hide=0]="Hide",t[t.Action=1]="Action",t[t.Cancel=2]="Cancel",t[t.Custom=3]="Custom"}(t.ActionEscapeOptionPresentation||(t.ActionEscapeOptionPresentation={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.__tarsusInterfaceName="InputResponseType",t}();t.InputResponseType=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.__tarsusInterfaceName="AuthenticationActionParameter",t}();t.AuthenticationActionParameter=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={}));var W,V=f&&f.__extends||(W=function(t,e){return(W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}W(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getAuthenticatorInput=function(){return this._authenticatorInput},n.prototype.setAuthenticatorInput=function(t){this._authenticatorInput=t},n.prototype.getSelectedTargets=function(){return this._selectedTargets},n.prototype.setSelectedTargets=function(t){this._selectedTargets=t},n.createAuthenticatorInput=function(e){return t.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createAuthenticatorInput(e)},n.createTargetSelectionRequest=function(e){return t.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createTargetSelectionRequest(e)},n.createTargetsSelectionRequest=function(e){return t.ts.mobile.sdk.impl.TargetBasedAuthenticatorInputImpl.createTargetsSelectionRequest(e)},n.__tarsusInterfaceName="TargetBasedAuthenticatorInput",n}(e.InputResponseType);e.TargetBasedAuthenticatorInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="OtpInput",e}(t.InputResponseType);t.OtpInput=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createSuccessResponse=function(e){return t.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createSuccessResponse(e)},n.createdFailedResponse=function(e,n){return t.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createdFailedResponse(e,n)},n.createFailedResponseWithServerProvidedStatus=function(e){return t.ts.mobile.sdk.impl.PlaceholderInputResponseImpl.createFailedResponseWithServerProvidedStatus(e)},n.__tarsusInterfaceName="PlaceholderInputResponse",n}(e.InputResponseType);e.PlaceholderInputResponse=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.__tarsusInterfaceName="PushRequestPayload",t}();t.PushRequestPayload=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createWithUserId=function(e){return t.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithUserId(e)},n.createWithUserTicket=function(e){return t.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithUserTicket(e)},n.createWithJsonPayload=function(e){return t.ts.mobile.sdk.impl.MobileApprovePushRequestPayloadImpl.createWithJsonPayload(e)},n.__tarsusInterfaceName="MobileApprovePushRequestPayload",n}(e.PushRequestPayload);e.MobileApprovePushRequestPayload=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createSecurityQuestionAnswersInputResponse=function(e){return t.ts.mobile.sdk.impl.SecurityQuestionInputResponseImpl.createSecurityQuestionAnswersInputResponse(e)},n.__tarsusInterfaceName="SecurityQuestionInputResponse",n}(e.InputResponseType);e.SecurityQuestionInputResponse=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getAnswerText=function(){return this._answerText},e.createWithText=function(e){return t.ts.mobile.sdk.impl.SecurityQuestionAnswerImpl.createWithText(e)},e.__tarsusInterfaceName="SecurityQuestionAnswer",e}();e.SecurityQuestionAnswer=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getQuestion=function(){return this._question},e.prototype.getAnswer=function(){return this._answer},e.prototype.getIsRemoved=function(){return this._isRemoved},e.createAnswerToQuestion=function(e,n){return t.ts.mobile.sdk.impl.SecurityQuestionAndAnswerImpl.createAnswerToQuestion(e,n)},e.createAnswerRemovalRequest=function(e){return t.ts.mobile.sdk.impl.SecurityQuestionAndAnswerImpl.createAnswerRemovalRequest
10(e)},e.__tarsusInterfaceName="SecurityQuestionAndAnswer",e}();e.SecurityQuestionAndAnswer=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getFlowId=function(){return this._flowId},t.prototype.setFlowId=function(t){this._flowId=t},t.__tarsusInterfaceName="JourneyInvocationOptions",t}();t.JourneyInvocationOptions=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.createEscapeRequest=function(e){return t.ts.mobile.tarsusplugin.impl.TotpProvisionResultImpl.createEscapeRequest(e)},e.__tarsusInterfaceName="TotpProvisionResult",e}();e.TotpProvisionResult=n}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getAssertionData=function(){return this._assertionData},e.prototype.setAssertionData=function(t){this._assertionData=t},e.prototype.getStoredData=function(){return this._storedData},e.prototype.setStoredData=function(t){this._storedData=t},e.__tarsusInterfaceName="TotpProvisionOutput",e}(t.TotpProvisionResult);t.TotpProvisionOutput=e}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t,e){this._stepTag=t,this._passphraseText=e}return t.prototype.getStepTag=function(){return this._stepTag},t.prototype.getAcquisitionChallenges=function(){return[]},t.prototype.getPassphraseText=function(){return this._passphraseText},t.__tarsusInterfaceName="AudioAcquisitionStepDescription",t}();t.AudioAcquisitionStepDescriptionImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getTarget=function(){return this._target},n.create=function(e){return t.ts.mobile.sdk.impl.AuthenticationActionParameterTargetSelectionImpl.create(e)},n.__tarsusInterfaceName="AuthenticationActionParameterTargetSelection",n}(e.AuthenticationActionParameter);e.AuthenticationActionParameterTargetSelection=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(e){var n=t.call(this)||this;return n._target=e,n}return V(e,t),e.create=function(t){return new e(t)},e.__tarsusInterfaceName="AuthenticationActionParameterTargetSelection",e}(t.AuthenticationActionParameterTargetSelection);e.AuthenticationActionParameterTargetSelectionImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getErrorCode=function(){return this._errorCode},e.prototype.getMessage=function(){return this._message},e.prototype.getData=function(){return this._data},e.createApplicationGeneratedGeneralError=function(e,n){return t.ts.mobile.sdk.impl.AuthenticationErrorImpl.createApplicationGeneratedGeneralError(e,n)},e.createApplicationGeneratedCommunicationError=function(e,n){return t.ts.mobile.sdk.impl.AuthenticationErrorImpl.createApplicationGeneratedCommunicationError(e,n)},e.__tarsusInterfaceName="AuthenticationError",e}();e.AuthenticationError=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={}));var G=f&&f.__assign||function(){return(G=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(r){function o(t,e,n){var o=r.call(this)||this;return o._errorCode=t,o._message=e,o._data=n||{},o._data.public_properties||(o._data=G(G({},o._data),{public_properties:{}})),o}return V(o,r),o.errorForServerResponse=function(t){var n={server_error_code:t.error_code,server_error_message:t.error_message,server_error_data:t.data},r=t.error_message||"Internal error",i=e.AuthenticationErrorCode.Internal;switch(t.error_code){case 2009:i=e.AuthenticationErrorCode.DeviceN
10otFound;break;case 28:var s=new o(e.AuthenticationErrorCode.InvalidIdToken,r);return s.setPublicProperty(e.AuthenticationErrorProperty.InvalidIdTokenErrorReason,e.AuthenticationErrorPropertySymbol.InvalidIdTokenErrorReasonBadToken),s;case e.core.Protocol.ServerResponseErrorCode.UserIdTokenExpired:return(s=new o(e.AuthenticationErrorCode.InvalidIdToken,r)).setPublicProperty(e.AuthenticationErrorProperty.InvalidIdTokenErrorReason,e.AuthenticationErrorPropertySymbol.InvalidIdTokenErrorReasonExpiredToken),s;case 3001:case 3002:i=e.AuthenticationErrorCode.InvalidDeviceBinding;break;case 4e3:case 4002:i=e.AuthenticationErrorCode.ControlFlowExpired;break;case 4005:case 4006:i=e.AuthenticationErrorCode.SessionRequired;break;case 6001:case 6002:i=e.AuthenticationErrorCode.ApprovalWrongState}return new o(i,r,n)},o.createApplicationGeneratedGeneralError=function(t,n){return new o(e.AuthenticationErrorCode.Internal,t,n)},o.createApplicationGeneratedCommunicationError=function(t,n){return new o(e.AuthenticationErrorCode.Communication,t,n)},o.errorForSessionRejectionFailureData=function(t){var n=e.AuthenticationErrorCode.PolicyRejection,r="Session rejected by server.",i={failure_data:t};if(t&&t.source)switch(t.reason&&t.reason.type){case e.core.Protocol.FailureReasonType.ApprovalExpired:n=e.AuthenticationErrorCode.ApprovalWrongState,r="Approval expired.",i.approval_state="expired"}return new o(n,r,i)},o.errorForHostInternalBiometricErrorData=function(r,o){var i;switch(r[t.sdkhost.ErrorDataInternalError]){case t.sdkhost.InternalErrorBiometricInvalidated:i=new n.AuthenticationErrorImpl(e.AuthenticationErrorCode.AuthenticatorInvalidated,o+" registration invali
10dated.");break;case t.sdkhost.InternalErrorWrongBiometric:i=new n.AuthenticationErrorImpl(e.AuthenticationErrorCode.InvalidInput,"Invalid "+o+" was input.");break;case t.sdkhost.InternalErrorBiometricNotConfigured:(i=new n.AuthenticationErrorImpl(e.AuthenticationErrorCode.AuthenticatorExternalConfigError,o+" not configured on this device.")).setPublicProperty(e.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,e.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled);break;case t.sdkhost.InternalErrorBiometricOsLockTemporary:(i=new n.AuthenticationErrorImpl(e.AuthenticationErrorCode.AuthenticatorExternalConfigError,o+" authentication is temporarily locked by the OS.")).setPublicProperty(e.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,e.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary);break;case t.sdkhost.InternalErrorBiometricOsLockPermanent:(i=new n.AuthenticationErrorImpl(e.AuthenticationErrorCode.AuthenticatorExternalConfigError,o+" authentication is permanently locked by the OS.")).setPublicProperty(e.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,e.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent);break;default:i=null}return i},o.errorForHostInternalErrorData=function(r){var o;switch(r[t.sdkhost.ErrorDataInternalError]){case t.sdkhost.InternalErrorCouldNotGenerateSecureKey:(o=new n.AuthenticationErrorImpl(e.AuthenticationErrorCode.AuthenticatorExternalConfigError,"Failed to generate secure key.")).setPublicProperty(e.AuthenticationErrorProperty.AuthenticatorExternalConfigErrorReason,e.AuthenticationErrorPropertySymbol.AuthenticatorExternalConfigErrorReasonGeneratedKeyIsNotSecure);break;default:o=null}return o},o.prototype.setPublicProperty=function(t,n){this._data.public_properties[e.AuthenticationErrorProperty[t]]=n},o.prototype.getPublicProperty=function(t){return this._data.public_properties[e.AuthenticationErrorProperty[t]]},o.prototype.getPublicBooleanProperty=function(t){var n=this.getPublicProperty(t);if(n&&"boolean"!=typeof n)throw new o(e.AuthenticationErrorCode.AppImplementation,"type of property "+e.AuthenticationErrorProperty[t]+" is not 'boolean'");return n},o.prototype.getPublicNumberProperty=function(t){var n=this.getPublicProperty(t);if(n&&"number"!=typeof n)throw new o(e.AuthenticationErrorCode.AppImplementation,"type of property "+e.AuthenticationErrorProperty[t]+" is not 'number'");return n},o.prototype.getPublicStringProperty=function(t){var n=this.getPublicProperty(t);if(n&&"string"!=typeof n)throw new o(e.AuthenticationErrorCode.AppImplementation,"type of property "+e.AuthenticationErrorProperty[t]+" is not 'string'");return n},o.prototype.getPublicSymbolicProperty=function(t){var n=this.getPublicProperty(t);if(n&&!e.AuthenticationErrorProperty[t])throw new o(e.AuthenticationErrorCode.AppImplementation,"type of property "+e.AuthenticationErrorProperty[t]+" is not 'AuthenticationErrorPropertySymbol'");return n},o.prototype.toString=function(){return"AuthenticationError<"+e.AuthenticationErrorCode[this._errorCode]+", "+this._message+", "+JSON.stringify(this._data)+">"},o.errorForAssertionResponse=function(t){var n;switch(t.assertion_error_code){case e.core.Protocol.AssertionErrorCode.FailedAssertion:n=e.AuthenticationErrorCode.InvalidInput;break;case e.core.Protocol.AssertionErrorCode.MethodLocked:n=e.AuthenticationErrorCode.AuthenticatorLocked;break;case e.core.Protocol.AssertionErrorCode.HistoryRepeat:n=e.AuthenticationErrorCode.RegisteredSecretAlreadyInHistory;break;default:n=e.AuthenticationErrorCode.Internal}var r={assertion_error_code:t.assertion_error_code,additional_data:t.data};return new o(n,t.assertion_error_message||"Assertion error code "+t.assertion_error_code,r)},o.appImplementationError=function(t){return new o(e.AuthenticationErrorCode.AppImplementation,t)},o.errorForTransportResponse=function(t){return new o(e.AuthenticationErrorCode.Communication,"HTTP response error",{status:t.getStatus(),body:t.getBodyJson()})},o.ensureAuthenticationError=function(t){if(o.dynamicCast(t))return t;var n={js_error_message:t.toString()};return t.stack&&(n.js_error_stack=t.stack),new o(e.AuthenticationErrorCode.Internal,"Internal error occurred ("+t.toString()+")",n)},o.augmentErrorData=function(t,e){var n,r={},i=t.getData();if(i)for(n in i)r[n]=i[n];for(n in e)r[n]=e[n];return new o(t.getErrorCode(),t.getMessage(),r)},o.dynamicCast=function(t){return void 0!==t.getErrorCode&&void 0!==t.getMe
10ssage&&void 0!==t.getData},o}(e.AuthenticationError);n.AuthenticationErrorImpl=r}(e.impl||(e.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t,e){this._authenticator=t,this._suggestedParams=e}return t.prototype.getAuthenticator=function(){return this._authenticator},t.prototype.getSuggestedParameters=function(){return this._suggestedParams},t}();t.AuthenticationOptionImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t,e,n,r){this._appData=n||null,this._token=t||null,this._internalData=r||null,this._deviceId=e||null}return t.prototype.getToken=function(){return this._token||""},t.prototype.getDeviceId=function(){return this._deviceId||""},t.prototype.getData=function(){return this._appData||{}},t.prototype.getInternalData=function(){return this._internalData},t.fromCflowServerResponse=function(e,n){return new t(e.token,n,e.application_data,e.data)},t}();t.AuthenticationResultImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getResultType=function(){return this._resultType},e.prototype.setResultType=function(t){this._resultType=t},e.prototype.getSelectedAuthenticator=function(){return this._selectedAuthenticator},e.prototype.setSelectedAuthenticator=function(t){this._selectedAuthenticator=t},e.prototype.getSelectedAuthenticationParameters=function(){return this._selectedAuthenticationParameters},e.prototype.setSelectedAuthenticationParameters=function(t){this._selectedAuthenticationParameters=t},e.prototype.getActionEscapeRequest=function(){return this._actionEscapeRequest},e.prototype.setActionEscapeRequest=function(t){this._actionEscapeRequest=t},e.createAbortRequest=function(){return t.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createAbortRequest()},e.createEscapeRequest=function(e,n){return t.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createEscapeRequest(e,n)},e.createSelectionRequest=function(e){return t.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createSelectionRequest(e)},e.createParameterizedSelectionRequest=function(e,n){return t.ts.mobile.sdk.impl.AuthenticatorSelectionResultImpl.createParameterizedSelectionRequest(e,n)},e.__tarsusInterfaceName="AuthenticatorSelectionResult",e}();e.AuthenticatorSelectionResult=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createAbortRequest=function(){var e=new n;return e.setResultType(t.AuthenticatorSelectionResultType.Abort),e},n.createSelectionRequest=function(e){var r=new n;return r.setResultType(t.AuthenticatorSelectionResultType.SelectAuthenticator),r.setSelectedAuthenticator(e),r},n.createEscapeRequest=function(e,r){var o=new n;return o._resultType=t.AuthenticatorSelectionResultType.Escape,o._actionEscapeRequest=new t.ActionEscapeRequest,o._actionEscapeRequest._escapeOption=e,o._actionEscapeRequest._escapeParameters=r,o},n}(t.AuthenticatorSelectionResult);e.AuthenticatorSelectionResultImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t){this._acquisitionChallenges=t}return t.prototype.getStepTag=function(){return"imageAcquisition"},t.prototype.getAcquisitionChallenges=function(){return this._acquisitionChallenges},t.__tarsusInterfaceName="CameraAcquisitionStepDescription",t}();t.CameraAcquisitionStepDescriptionImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getLocalEnrollmentKeySizeInBytes=function(){return this._localEnrollmentKeySizeInBytes},e.prototype.getLocalEnrollmentKeyIterationCount=function(){return this._localEnrollmentKeyIterationCount},e.prototype.setLocalEnrollmentKeyIterationCount=function(t){this._localEnrollmentKeyIterationCount=t},e.create=function(e){return t.ts.mobile.sdk.impl.ClientCryptoSettingsImpl.create(e)},e.__tarsusInterfaceName="ClientCryptoSettings",e}();e.ClientCryptoSettings=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setLocalEnrollmentKeyIterationCount(t),n._localEnrollmentKeySizeInBytes=32,n},e}(t.ClientCryptoSettings);e.ClientCryptoSettingsImpl=n}
10(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function e(t,e){this._description=t,this._menuItemOptions=e||{}}return e.prototype.getDescription=function(){return this._description},e.prototype.getAvailableActions=function(){var e=this,n=[];switch(this._description.getRegistrationStatus()){case t.AuthenticatorRegistrationStatus.Registered:n=[t.AuthenticatorConfigurationAction.Reregister,t.AuthenticatorConfigurationAction.Unregister];break;case t.AuthenticatorRegistrationStatus.Unregistered:case t.AuthenticatorRegistrationStatus.LocallyInvalid:n=[t.AuthenticatorConfigurationAction.Register]}return n.filter((function(n){return n==t.AuthenticatorConfigurationAction.Reregister&&!e._menuItemOptions.hide_reregister||n==t.AuthenticatorConfigurationAction.Register&&!e._menuItemOptions.hide_register||n==t.AuthenticatorConfigurationAction.Unregister&&!e._menuItemOptions.hide_unregister}))},e}();e.ConfigurableAuthenticatorImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getUserChoice=function(){return this._userChoice},e.prototype.setUserChoice=function(t){this._userChoice=t},e.prototype.getActionEscapeRequest=function(){return this._actionEscapeRequest},e.prototype.setActionEscapeRequest=function(t){this._actionEscapeRequest=t},e.create=function(e){return t.ts.mobile.sdk.impl.ConfirmationInputImpl.create(e)},e.createEscapeRequest=function(e,n){return t.ts.mobile.sdk.impl.ConfirmationInputImpl.createEscapeRequest(e,n)},e.__tarsusInterfaceName="ConfirmationInput",e}();e.ConfirmationInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.create=function(t){var e=new n;return e.setUserChoice(t),e},n.createEscapeRequest=function(e,r){var o=new n,i=new t.ActionEscapeRequest;return i.setEscapeOption(e),i.setEscapeParameters(r),o.setActionEscapeRequest(i),o},n}(t.ConfirmationInput);e.ConfirmationInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getRequestType=function(){return this._requestType},e.prototype.setRequestType=function(t){this._requestType=t},e.create=function(e){return t.ts.mobile.sdk.impl.ControlRequestImpl.create(e)},e.__tarsusInterfaceName="ControlRequest",e}();e.ControlRequest=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setRequestType(t),n},e}(t.ControlRequest);e.ControlRequestImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getPrompt=function(){return this._prompt},n.prototype.setPrompt=function(t){this._prompt=t},n.prototype.getTitle=function(){return this._title},n.prototype.setTitle=function(t){this._title=t},n.prototype.getSubtitle=function(){return this._subtitle},n.prototype.setSubtitle=function(t){this._subtitle=t},n.prototype.getCancelButtonTitle=function(){return this._cancelButtonTitle},n.prototype.setCancelButtonTitle=function(t){this._cancelButtonTitle=t},n.create=function(e){return t.ts.mobile.sdk.impl.DeviceBiometricsInputImpl.create(e)},n.createFull=function(e,n,r,o){return t.ts.mobile.sdk.impl.DeviceBiometricsInputImpl.createFull(e,n,r,o)},n.__tarsusInterfaceName="DeviceBiometricsInput",n}(e.InputResponseType);e.DeviceBiometricsInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return t&&n.setPrompt(t),n},e}(t.DeviceBiometricsInput);e.DeviceBiometricsInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t,e){this._id=t,this._name=e}return t.prototype.getId=function(){return this._id},t.prototype.getName=function(){return this._name},t}();t.DeviceGroupImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function n(t){this.updateFromServer(t)}return n.prototype.getDeviceHwId=function(){return this._id},n.prototype.getName=function(){return this._name?this._name:this._model+" "+this._osType+" "+this._osVersion},n.prototype.getStatus=function(){return this._status},n.prototype.getLastAccess=function(){return this._lastAccess},n.prototype.getLastAccessLocation=function(){return this._lastAccessLocation},n.prototype.getLastAccessLocationAttributes=function(){return this._lastAccessLocationAttributes},n.prototype.getRegistered=function(){return this._registered},n.prototype.getModel=function(){return this._model},n.prototype.getOsType=function(){return this._osType},n.prototype.getOsVersion=function(){return this._osVersion},n.prototype.getUseCount=function(){return this._useCount},n.prototype.getIsCurrent=function(){return this._isCurrent},n.prototype.getDeviecId=function(){return this._id},n.prototype.setStatus=function(t){this._status=t},n.prototype.setName=function(t){this._name=t},n.prototype.forceCurrent=function(){this._isCurrent=!0},n.prototype.updateFromServer=function(n){switch(this._model=t.core.DeviceModelConverter.getDeviceModel(n.device_model,n.os_type),this._name=n.name,this._lastAccess=Date.parse(n.last_access),this._registered=Date.parse(n.registered),this._osType=t.core.DeviceModelConverter.getOsName(n.os_type),this._osVersion=n.os_version,this._useCount=n.use_count,this._isCurrent=n.cur_device,this._id=n.device_id,n.status){case t.core.Protocol.DeviceStatusServerFormat.Disabled:this._status=t.DeviceStatus.Disabled;break;case t.core.Protocol.DeviceStatusServerFormat.LongInactivity:this._status=t.DeviceStatus.LongInactivity;break;case t.core.Protocol.DeviceStatusServerFormat.NoRecentActivity:this._status=t.DeviceStatus.NoRecentActivity;break;case t.core.Protocol.DeviceStatusServerFormat.RecentlyUsed:this._status=t.DeviceStatus.RecentlyUsed;break;case t.core.Protocol.DeviceStatusServerFormat.Removed:this._status=t.DeviceStatus.Removed;break;default:throw new e.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Unknown device status "+n.status)}if(n.last_access_location){var r=new t.GeoLocation;r.longitude=n.last_access_location.lng,r.latitude=n.last_access_location.lat,this._lastAccessLocation=r,this._lastAccessLocationAttributes=new e.LocationAttributesImpl(n.last_access_location)}},n}();e.DeviceInfoImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.getOsName=function(t){var e=t;switch(t){case"iPhone":case"iPad":e="iOS"}return e},t.getDeviceModel=function(t,e){var n=t;if("iPhone"==e)switch(t){case"i386":case"x86_64":n="Simulator";break;case"iPod1,1":case"iPod2,1":case"iPod3,1":case"iPod4,1":case"iPod7,1":case"iPod9,1":n="iPod Touch";break;case"iPhone1,1":case"iPhone1,2":case"iPhone2,1":n="iPhone";break;case"iPhone3,1":case"iPhone3,3":n="iPhone 4";break;case"iPhone4,1":n="iPhone 4S";break;case"iPhone5,1":case"iPhone5,2":n="iPhone 5";break;case"iPhone5,3":case"iPhone5,4":n="iPhone 5c";break;case"iPhone6,1":case"iPhone6,2":n="iPhone 5s";break;case"iPhone7,1":n="iPhone 6 Plus";break;case"iPhone7,2":n="iPhone 6";break;case"iPhone8,1":n="iPhone 6S";break;case"iPhone8,2":n="iPhone 6S Plus";break;case"iPhone8,4":n="iPhone SE";break;case"iPhone9,1":case"iPhone9,3":n="iPhone 7";break;case"iPhone9,2":case"iPhone9,4":n="iPhone 7 Plus";break;case"iPhone10,1":case"iPhone10,4":n="iPhone 8";break;case"iPhone10,2":case"iPhone10,5":n="iPhone 8 Plus";break;case"iPhone10,3":case"iPhone10,6":n="iPhone X";break;case"iPhone11,2":n="iPhone XS";break;case"iPhone11,6":case"iPhone11,4":n="iPhone XS Max";break;case"iPhone11,8":n="iPhone XR";break;case"iPhone12,1":n="iPhone 11";break;case"iPhone12,3":n="iPhone 11 Pro";break;case"iPhone12,5":n="iPhone 11 Pro Max";break;
10case"iPhone12,8":n="iPhone SE 2nd Gen";break;case"iPhone13,1":n="iPhone 12 Mini";break;case"iPhone13,2":n="iPhone 12";break;case"iPhone13,3":n="iPhone 12 Pro";break;case"iPhone13,4":n="iPhone 12 Pro Max";break;case"iPhone14,2":n="iPhone 13 Pro";break;case"iPhone14,3":n="iPhone 13 Pro Max";break;case"iPhone14,4":n="iPhone 13 Mini";break;case"iPhone14,5":n="iPhone 13";break;case"iPhone14,6":n="iPhone SE 3rd Gen";break;case"iPhone14,7":n="iPhone 14";break;case"iPhone14,8":n="iPhone 14 Plus";break;case"iPhone15,2":n="iPhone 14 Pro";break;case"iPhone15,3":n="iPhone 14 Pro Max";break;case"iPad1,1":n="iPad";break;case"iPad2,1":n="iPad 2";break;case"iPad3,1":case"iPad3,4":n="iPad";break;case"iPad2,5":n="iPad Mini";break;case"iPad4,1":case"iPad4,2":n="iPad Air";break;case"iPad4,4":case"iPad4,5":case"iPad4,7":n="iPad Mini";break;case"iPad6,7":case"iPad6,8":n='iPad Pro (12.9")';break;case"iPad6,3":case"iPad6,4":n='iPad Pro (9.7")';break;case"iPad6,11":case"iPad6,12":n="iPad (2017)";break;case"iPad7,1":case"iPad7,2":n="iPad Pro 2nd Gen";break;case"iPad7,3":case"iPad7,4":n='iPad Pro (10.5")';break;case"iPad7,5":case"iPad7,6":n="iPad";break;case"iPad7,11":case"iPad7,12":n="iPad 7th Gen 10.2-inch";break;case"iPad8,1":case"iPad8,2":case"iPad8,3":case"iPad8,4":n='iPad Pro (11")';break;case"iPad8,5":case"iPad8,6":case"iPad8,7":case"iPad8,8":n='iPad Pro (12.9")';break;case"iPad8,9":case"iPad8,10":n='iPad Pro (11")';break;case"iPad8,11":case"iPad8,12":n='iPad Pro (12.9")';break;case"iPad11,1":case"iPad11,2":n="iPad mini";break;case"iPad11,3":case"iPad11,4":n="iPad Air";break;case"iPad11,6":case"iPad11,7":n="iPad";break;case"iPad12,1":case"iPad12,2":n="iPad 9th Gen";break;case"iPad13,1":case"iPad13,2":n="iPad Air";break;case"iPad13,4":case"iPad13,5":case"iPad13,6":case"iPad13,7":n='iPad Pro (11")';break;case"iPad13,8":case"iPad13,9":case"iPad13,10":case"iPad13,11":n='iPad Pro (12.9")';break;case"iPad13,16":case"iPad13,17":n="iPad Air 5th Gen";break;case"iPad13,18":case"iPad13,19":n="iPad 10th Gen";break;case"iPad14,1":case"iPad14,2":n="iPad mini 6th Gen";break;case"iPad14,3":case"iPad14,4":n="iPad Pro 11 inch 4th Gen";break;case"iPad14,5":case"iPad14,6":n="iPad Pro 12.9 inch 6th Gen"}return n},t}();t.DeviceModelConverter=e}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Password=0]="Password",t[t.Fingerprint=1]="Fingerprint",t[t.Pincode=2]="Pincode",t[t.Pattern=3]="Pattern",t[t.Otp=4]="Otp",t[t.Face=5]="Face",t[t.Voice=6]="Voice",t[t.Eye=7]="Eye",t[t.Emoji=8]="Emoji",t[t.Questions=9]="Questions",t[t.FaceID=10]="FaceID",t[t.Generic=11]="Generic",t[t.MobileApprove=12]="MobileApprove",t[t.Totp=13]="Totp",t[t.DeviceBiometrics=14]="DeviceBiometrics",t[t.Fido2=15]="Fido2"}(t.AuthenticatorType||(t.AuthenticatorType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.RedirectTypeBind=0]="RedirectTypeBind",t[t.RedirectTypeAuthenticate=1]="RedirectTypeAuthenticate",t[t.RedirectTypeBindOrAuthenticate=2]="RedirectTypeBindOrAuthenticate",t[t.RedirectTypeInvokePolicy=3]="RedirectTypeInvokePolicy"}(t.RedirectType||(t.RedirectType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n,r;e.AuthTypeData={password:{authTypeEnum:t.AuthenticatorType.Password,authTypeName:"Password"},fingerprint:{authTypeEnum:t.AuthenticatorType.Fingerprint,authTypeName:"Fingerprint"},pin:{authTypeEnum:t.AuthenticatorType.Pincode,authTypeName:"PIN"},pin_centralized:{authTypeEnum:t.AuthenticatorType.Pincode,authTypeName:"PIN"},pattern:{authTypeEnum:t.AuthenticatorType.Pattern,authTypeName:"Pattern"},pattern_centralized:{authTypeEnum:t.AuthenticatorType.Pattern,authTypeName:"Pattern"},otp:{authTypeEnum:t.AuthenticatorType.Otp,authTypeName:"OTP"},face:{authTypeEnum:t.AuthenticatorType.Face,authTypeName:"Face"},face_server:{authTypeEnum:t.AuthenticatorType.Face,authTypeName:"Face"},voice_server:{authTypeEnum:t.AuthenticatorType.Voice,authTypeName:"Voice"},eye:{authTypeEnum:t.AuthenticatorType.Eye,authTypeName:"Eye"},emoji:{authTypeEnum:t.AuthenticatorType.Emoji,authTypeName:"Emoji"},question:{authTypeEnum:t.AuthenticatorType.Questions,authTypeName:"Questions"},face_id:{authTypeEnum:t.AuthenticatorType.FaceID,authTypeName:"FaceID"},mobile_approve:{authTypeEnum:t.AuthenticatorType.MobileApprove,authTypeName:"MobileApprove"},totp:{authTypeEnum:t.AuthenticatorType.Totp,authTypeName:"Totp"},device_biometrics:{authTypeEnum:t.AuthenticatorType.DeviceBiometrics,authTypeName:"DeviceBiometrics"},fido2:{authTypeEnum:t.AuthenticatorType.Generic,authTypeName:"FIDO2Authenticator"}},function(t){t.Closed="closed"}(e.SessionStateChangeState||(e.SessionStateChangeState={})),e.flowIdHeaderName="flow_id",function(t){t.Pending="pending",t.Completed="completed",t.Rejected="rejected"}(e.AuthSessionState||(e.AuthSessionState={})),function(t){t.LOGINS="frequency_logins",t.DAYS="frequency_days"}(e.PromotionStrategyFrequency||(e.PromotionStrategyFrequency={})),function(t){t.Numeric="numeric",t.Alphanumeric="alphanumeric",t.Binary="binary"}(e.QrCodeFormatType||(e.QrCodeFormatType={})),function(t){t.Alphanumeric="alphanumeric",t.QrCode="qrcode"}(e.TicketIdFormatType||(e.TicketIdFormatType={})),function(t){t.ApprovalApprove="approval_approve"}(e.FailureSourceTransactionType||(e.FailureSourceTransactionType={})),function(t){t.AutoExecute="auto_execute",t.AssertionRejected="assertion_rejected",t.Policy="policy",t.Locked="locked",t.ApprovalExpired="approval_expired",t.Communication="communication"}(e.FailureReasonType||(e.FailureReasonType={})),function(t){t.DefaultAuthenticator="default",t.AuthenticatorMenu="menu",t.FirstAuthenticator="first"}(e.AuthMenuPresentationMode||(e.AuthMenuPresentationMode={})),function(t){t.Registered="registered",t.Registering="registering",t.Unregistered="unregistered"}(e.AuthenticationMethodStatus||(e.AuthenticationMethodStatus={})),function(t){t.Validate="validate",t.Generate="generate"}(e.AuthenticationMethodOtpState||(e.AuthenticationMethodOtpState={})),function(t){t.None="none",t.Sms="sms",t.Email="email",t.Voice="voice",t.Push="push_notification"}(e.AuthenticationMethodOtpChannelType||(e.AuthenticationMethodOtpChannelType={})),function(t){t.Numeric="numeric",t.QrCode="qrcode",t.External="external",t.Unknown=""}(e.OtpFormatType||(e.OtpFormatType={})),function(t){t.WaitForApproval="wait_for_approval",t.WaitForAuthenticate="wait_for_authenticate"}(e.AuthenticationMethodMobileApproveState||(e.AuthenticationMethodMobileApproveState={})),function(t){t.AlphaNumeric="alpha_numeric",t.Numeric="numeric",t.QrCode="qrcode"}(e.TotpChallengeFormatType||(e.TotpChallengeFormatType={})),function(t){t.SelectTargets="select_targets",t.Validate="validate",t.Generate="generate"}(e.AuthenticationMethodTotpState||(e.AuthenticationMethodTotpState={})),function(t){t.RedirectTypeNameBind="bind",t.RedirectTypeNameAuthenticate="auth",t.RedirectTypeNameBindOrAuthenticate="bind_or_auth",t.RedirectTypeNameInvokePolicy="invoke"}(r=e.RedirectTypeName||(e.RedirectTypeName={})),e.RedirectTypeMap=((n={})[r.RedirectTypeNameBind]=t.RedirectType.RedirectTypeBind,n[r.RedirectTypeNameAuthenticate]=t.RedirectType.RedirectTypeAuthenticate,n[r.RedirectTypeNameBindOrAuthenticate]=t.RedirectType.RedirectTypeBindOrAuthenticate,n[r.RedirectTypeNameInvokePolicy]=t.RedirectType.RedirectTypeInvokePolicy,n),function(t){t[t.EncryptionStateError=23]="EncryptionStateError",t[t.UserIdTokenExpired=29]="UserIdTokenExpired",t[t.DeviceKeyExpired=2017]="DeviceKeyExpired"}(e.ServerResponseErrorCode||(e.ServerResponseErrorCode={})),function(t){t[t.NotRegistered=1]="NotRegistered",t[t.InvalidAction=2]="InvalidAction",t[t.BadConfig=3]="BadConfig",t[t.BadFch=4]="BadFch",t[t.FailedAssertion=5]="FailedAssertion",t[t.MethodLocked=6]="MethodLocked",t[t.DataMissing=7]="DataMissing",t[t.Internal=9]="Internal",t[t.HistoryRepeat=11]="HistoryRepeat",t[t.ExternalProcessPending=13]="ExternalProcessPending",t[t.MustRegister=14]="MustRegister",t[t.NotFinished=16]="NotFinished",t[t.MissingQuestions=17]="MissingQuestions",t[t.RepeatCurrentStep=18]="RepeatCurrentStep",t[t.FailOver=19]="FailOver",t[t.AssertionContainerNotComplete=20]="AssertionContainerNotComplete",t[t.AckRequired=22]="AckRequired"}(e.AssertionErrorCode||(e.AssertionErrorCode={})),function(t){t.Pending="pending",t.Approved="approved",t.Denied="declined",t.Expired="expired"}(e.ServerResponseDataApprovalsApprovalStatus||(e.ServerResponseDataApprovalsApprovalStatus={})),function(t){t.RecentlyUsed="recently_used",t.NoRecentActivity="no_recent_activity",t.LongInactivity="long_inactivity",t.Disabled="disabled",t.Removed="removed"}(e.DeviceStatusServerFormat||(e.DeviceStatusServerFormat={})),function(t){t.ErrorReasonAttestationReverificationFailed="attestation_verification_failed",t.ErrorReasonCredentialFiltered="credential_filtered"}(e.ServerResponseDataErrorReasonReasons||(e.ServerResponseDataErrorReasonReasons={})),function(t){t.Active="active",t.Disabled="disabled"}(e.CollectorState||(e.CollectorState={}))}(e.Protocol||(e.Protocol={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._styleSheet=n.merge.apply(n,t),this.replaceRefValues()}return n.prototype.getMatchingStyle=function(e){var n=this;if(null!=this._styleSheet.styles){var r={};
10return this._styleSheet.styles.forEach((function(t){var o=n.matchStyle(e,t);r=G(G({},r),o)})),new t.impl.UIStyleImpl(r)}return t.impl.UIStyleImpl.emptyStyle()},n.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={styles:[],values:{}};return t.forEach((function(t){var e;(e=n.styles).push.apply(e,t.styles),n.values=G(G({},n.values),t.values)})),n},n.prototype.matchStyle=function(t,e){return e.rule.tags.every((function(e){return t.indexOf(e)>-1}))?e.properties:{}},n.prototype.replaceRefValues=function(){var t=this;null!=this._styleSheet.values&&this._styleSheet.styles&&this._styleSheet.styles.forEach((function(e){e.properties=t.replaceStyleProperties(e.properties)}))},n.prototype.replaceRef=function(t){return e.Protocol.isRefType(t)?this._styleSheet.values[t.ref]:t},n.prototype.replaceStyleProperties=function(t){var e=t;for(var n in t)e[n]=this.replaceRef(t[n]);return e},n}();e.UIStyleSheets=n}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n={hide:t.ActionEscapeOptionPresentation.Hide,action:t.ActionEscapeOptionPresentation.Action,cancel:t.ActionEscapeOptionPresentation.Cancel,custom:t.ActionEscapeOptionPresentation.Custom},r=function(){function t(t){this._id=t.id,this._displayName=t.display_name,this._presentation=n[t.presentation]}return t.prototype.getId=function(){return this._id},t.prototype.getDisplayName=function(){return this._displayName},t.prototype.getPresentation=function(){return this._presentation},t}();e.EscapeOptionImpl=r}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getDisplayName=function(){return this._displayName},n.prototype.setDisplayName=function(t){this._displayName=t},n.create=function(e){return t.ts.mobile.sdk.impl.Fido2InputResponseImpl.create(e)},n.__tarsusInterfaceName="Fido2InputResponse",n}(e.InputResponseType);e.Fido2InputResponse=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setDisplayName(t),n},e}(t.Fido2InputResponse);e.Fido2InputResponseImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getPrompt=function(){return this._prompt},n.prototype.setPrompt=function(t){this._prompt=t},n.prototype.getCancelButtonTitle=function(){return this._cancelButtonTitle},n.prototype.setCancelButtonTitle=function(t){this._cancelButtonTitle=t},n.prototype.getFallbackButtonTitle=function(){return this._fallbackButtonTitle},n.prototype.setFallbackButtonTitle=function(t){this._fallbackButtonTitle=t},n.prototype.getFallbackControlRequestType=function(){return this._fallbackControlRequestType},n.prototype.setFallbackControlRequestType=function(t){this._fallbackControlRequestType=t},n.create=function(e){return t.ts.mobile.sdk.impl.FingerprintInputImpl.create(e)},n.createFallbackEnabledPrompt=function(e,n,r){return t.ts.mobile.sdk.impl.FingerprintInputImpl.createFallbackEnabledPrompt(e,n,r)},n.__tarsusInterfaceName="FingerprintInput",n}(e.InputResponseType);e.FingerprintInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.create=function(t){var e=new n;return t&&e.setPrompt(t),e},n.createFallbackEnabledPrompt=function(e,r,o){var i=new n;return e&&i.setPrompt(e),r&&i.setFallbackButtonTitle(r),o?i.setFallbackControlRequestType(o):i.setFallbackControlRequestType(t.ControlRequestType.SelectMethod),i},n}(t.FingerprintInput);e.FingerprintInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getJsonData=function(){return this._jsonData},e.prototype.setJsonData=function(t){this._jsonData=t},e.prototype.getControlRequest=function(){return this._controlRequest},e.prototype.setControlRequest=function(t){this._controlRequest=t},e.prototype.getActionEscapeRequest=function(){return this._actionEscapeRequest},e.prototype.setActionEscapeRequest=function(t){this._actionEscapeRequest=t},e.createFormInputSubmissionRequest=function(e){return t.ts.mobile.sdk.impl.FormInputImpl.createFormInputSubmissionRequest(e)},e.createFormCancellationRequest=function(){return t.ts.mobile.sdk.impl.FormInputImpl.createFormCancellationRequest()},e.createEscapeRequest=function(e,n){return t.ts.mobile.sdk.impl.FormInputImpl.createEscapeRequest
10(e,n)},e.__tarsusInterfaceName="FormInput",e}();e.FormInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createFormInputSubmissionRequest=function(e){var r=new n;return r.setJsonData(e),r.setControlRequest(t.FormControlRequest.Submit),r},n.createFormCancellationRequest=function(){var e=new n;return e.setControlRequest(t.FormControlRequest.Abort),e},n.createEscapeRequest=function(e,r){var o=new n,i=new t.ActionEscapeRequest;return i.setEscapeOption(e),i.setEscapeParameters(r),o.setActionEscapeRequest(i),o.setControlRequest(t.FormControlRequest.Escape),o},n}(t.FormInput);e.FormInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){};t.GeoLocation=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getResponse=function(){return this._response},e.prototype.setResponse=function(t){this._response=t},e.prototype.getControlRequest=function(){return this._controlRequest},e.prototype.setControlRequest=function(t){this._controlRequest=t},e.prototype.getActionEscapeRequest=function(){return this._actionEscapeRequest},e.prototype.setActionEscapeRequest=function(t){this._actionEscapeRequest=t},e.createControlResponse=function(e){return t.ts.mobile.sdk.impl.In
10putOrControlResponseImpl.createControlResponse(e)},e.createEscapeResponse=function(e,n){return t.ts.mobile.sdk.impl.InputOrControlResponseImpl.createEscapeResponse(e,n)},e.createInputResponse=function(e){return t.ts.mobile.sdk.impl.InputOrControlResponseImpl.createInputResponse(e)},e.__tarsusInterfaceName="InputOrControlResponse",e}();e.InputOrControlResponse=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createControlResponse=function(t){var e=new n;return e.setControlRequest(t),e},n.createInputResponse=function(t){var e=new n;return e.setResponse(t),e},n.createEscapeResponse=function(e,r){var o=new n;return o._actionEscapeRequest=new t.ActionEscapeRequest,o._actionEscapeRequest._escapeOption=e,o._actionEscapeRequest._escapeParameters=r,o},n.prototype.isControlRequest=function(){return!!this._controlRequest},n}(t.InputOrControlResponse);e.InputOrControlResponseImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getContinueProcessing=function(){return this._continueProcessing},e.prototype.setContinueProcessing=function(t){this._continueProcessing=t},e.create=function(e){return t.ts.mobile.sdk.impl.JsonDataProcessingResultImpl.create(e)},e.__tarsusInterfaceName="JsonDataProcessingResult",e}();e.JsonDataProcessingResult=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setContinueProcessing(t),n},e}(t.JsonDataProcessingResult);e.JsonDataProcessingResultImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t){this.city=t.city,this.state=t.state,this.country=t.country}return t.prototype.getCity=function(){return this.city},t.prototype.getCountry=function(){return this.country},t.prototype.getState=function(){return this.state},t}();t.LocationAttributesImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function n(t){this._deviceInfo=new e.DeviceInfoImpl(t)}return n.prototype.getInfo=function(){return this._deviceInfo},n.prototype.getAvailableActions=function(){if(this._deviceInfo.getStatus()==t.DeviceStatus.Removed)return[];var e=[t.DeviceManagementAction.Rename];return this._deviceInfo.getIsCurrent()||e.push(t.DeviceManagementAction.Remove),e},n}();e.ManagedDeviceImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function n(n){switch(this._approval=new e.MobileApprovalImpl(n),this._approval.getStatus()){case t.MobileApprovalStatus.Pending:this._availableActions=[t.MobileApprovalAction.Approve,t.MobileApprovalAction.Deny];break;default:this._availableActions=[]}}return n.prototype.getApproval=function(){return this._approval},n.prototype.getAvailableActions=function(){return this._availableActions},n}();e.ManagedMobileApprovalImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function n(n){
10if(this._originDevice=null,this._approvalId=n.approval_id,this._source=n.source,this._title=n.title,this._details=n.details,this._creationTime=n.create,this._finishTime=n.finish,this._expiresAt=n.create+1e3*n.expiry_in,this._originAppId=n.origin_app_id,this._customParams=n.custom_params,n.origin_device&&(this._originDevice=t.TargetDeviceDetailsImpl.fromServerFormat(n.origin_device)),n.location){var r=new t.GeoLocation;r.longitude=n.location.lng,r.latitude=n.location.lat,this._location=r}switch(n.status){case t.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Approved:this._status=t.MobileApprovalStatus.Approved;break;case t.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Denied:this._status=t.MobileApprovalStatus.Denied;break;case t.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Expired:this._status=t.MobileApprovalStatus.Expired;break;case t.core.Protocol.ServerResponseDataApprovalsApprovalStatus.Pending:this._status=t.MobileApprovalStatus.Pending;break;default:throw new e.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Unknown approval status "+n.status)}}return n.prototype.getApprovalId=function(){return this._approvalId},n.prototype.getSource=function(){return this._source},n.prototype.getTitle=function(){return this._title},n.prototype.getDetails=function(){return this._details},n.prototype.getCreationTime=function(){return this._creationTime},n.prototype.getFinishTime=function(){return this._finishTime},n.prototype.getExpiresAt=function(){return this._expiresAt},n.prototype.getOriginAppId=function(){return this._originAppId},n.prototype.getOriginDevice=function(){return this._originDevice},n.prototype.getLocation=function(){return this._location},n.prototype.getCustomParams=function(){return this._customParams},n.prototype.getStatus=function(){return this._status},n.prototype.isExpired=function(){return this._status==t.MobileApprovalStatus.Expired},n.prototype.updateStatus=function(t){this._status=t},n}();e.MobileApprovalImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="MobileApproveInput",e}(t.InputResponseType);t.MobileApproveInput=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getPollingTimeout=function(){return this._pollingTimeout},n.prototype.setPollingTimeout=function(t){this._pollingTimeout=t},n.createRequestPollingInput=function(){return t.ts.mobile.sdk.impl.MobileApproveInputRequestPollingImpl.createRequestPollingInput()},n.createRequestLongPollingInput=function(e){return t.ts.mobile.sdk.impl.MobileApproveInputRequestPollingImpl.createRequestLongPollingInput(e)},n.__tarsusInterfaceName="MobileApproveInputRequestPolling",n}(e.MobileApproveInput);e.MobileApproveInputRequestPolling=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createRequestPollingInput=function(){var t=new e;return t.setPollingTimeout(0),t},e.createRequestLongPollingInput=function(t){var n=new e;return n.setPollingTimeout(t),n},e}(t.MobileApproveInputRequestPolling);e.MobileApproveInputRequestPollingImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function e(t,e,n){this.value=t,this.format=e,this.alt=n}return e.prototype.getValue=function(){return this.value},e.prototype.getFormat=function(){return this.format},e.prototype.getQrAlternativeRepresentation=function(){return this.alt},e.createFromServerFormat=function(n){var r=t.OtpFormatImpl.fromAssertionFormat(n.format),o=null;
10return(n.alt||[]).forEach((function(t){"qr_text"===t.type&&(o=t.value)})),new e(n.value,r,o)},e}();e.MobileApproveOtpImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e,n;e=t.impl||(t.impl={}),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.userId=function(){return this._userId},e.prototype.title=function(){return this._title},e.prototype.body=function(){return this._body},e.prototype.source=function(){return this._source},e.prototype.ticket=function(){return this._ticket},e.createWithUserId=function(t){var n=new e;return n._userId=t,n},e.createWithUserTicket=function(t){var n=new e;return n._userId=t,n},e.createWithJsonPayload=function(t){var n=t,r=new e;return r._userId=n.user_id,r._title=n.body,r._body=n.details,r._source=n.source,r},e}(t.MobileApprovePushRequestPayload),e.MobileApprovePushRequestPayloadImpl=n}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getPrompt=function(){return this._prompt},n.prototype.setPrompt=function(t){this._prompt=t},n.prototype.getCancelButtonTitle=function(){return this._cancelButtonTitle},n.prototype.setCancelButtonTitle=function(t){this._cancelButtonTitle=t},n.prototype.getFallbackButtonTitle=function(){return this._fallbackButtonTitle},n.prototype.setFallbackButtonTitle=function(t){this._fallbackButtonTitle=t},n.prototype.getFallbackControlRequestType=function(){return this._fallbackControlRequestType},n.prototype.setFallbackControlRequestType=function(t){this._fallbackControlRequestType=t},n.create=function(e){return t.ts.mobile.sdk.impl.NativeFaceInputImpl.create(e)},n.createFallbackEnabledPrompt=function(e,n,r){return t.ts.mobile.sdk.impl.NativeFaceInputImpl.createFallbackEnabledPrompt(e,n,r)},n.__tarsusInterfaceName="NativeFaceInput",n}(e.InputResponseType);e.NativeFaceInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.create=function(t){var e=new n;return t&&e.setPrompt(t),e},n.createFallbackEnabledPrompt=function(e,r,o){var i=new n;return e&&i.setPrompt(e),r&&i.setFallbackButtonTitle(r),o?i.setFallbackControlRequestType(o):i.setFallbackControlRequestType(t.ControlRequestType.SelectMethod),i},n}(t.NativeFaceInput);e.NativeFaceInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function e(){}return e.fromAssertionFormat=function(e){switch(e.type){case t.core.Protocol.OtpFormatType.Numeric:return new n(e.length);case t.core.Protocol.OtpFormatType.QrCode:return new r;case t.core.Protocol.OtpFormatType.External:return new i(e.data);default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid format type encountered: "+e.type)}},e}();t.OtpFormatImpl=e;var n=function(){function t(t){this._length=t}return t.prototype.getOtpLength=function(){return this._length},t.prototype.getType=function(){return o.Numeric},t.__tarsusInterfaceName="OtpFormatNumeric",t}();t.OtpFormatNumericImpl=n;var r=function(){function t(){}return t.prototype.getType=function(){return o.QrCode},t.__tarsusInterfaceName="OtpFormatQr",t}();t.OtpFormatQrImpl=r;var o,i=function(){function t(t){this._data=t}return t.prototype.getData=function(){return this._data},t.prototype.getType=function(){return o.External},t.__tarsusInterfaceName="OtpFormatExternal",t}();t.OtpFormatExternalImpl=i,function(t){t[t.Numeric=0]="Numeric",t[t.QrCode=1]="QrCode",t[t.External=2]="External"}(o=t.OtpFormatType||(t.OtpFormatType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getOtp=function(){return this._otp},n.prototype.setOtp=function(t){this._otp=t},n.createOtpSubmission=function(e){return t.ts.mobile.sdk.impl.OtpInputOtpSubmissionImpl.createOtpSubmission(e)}
10,n.__tarsusInterfaceName="OtpInputOtpSubmission",n}(e.OtpInput);e.OtpInputOtpSubmission=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createOtpSubmission=function(t){var n=new e;return n.setOtp(t),n},e}(t.OtpInputOtpSubmission);e.OtpInputOtpSubmissionImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createOtpResendRequest=function(){return t.ts.mobile.sdk.impl.OtpInputRequestResendImpl.createOtpResendRequest()},n.__tarsusInterfaceName="OtpInputRequestResend",n}(e.OtpInput);e.OtpInputRequestResend=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createOtpResendRequest=function(){return new e},e}(t.OtpInputRequestResend);e.OtpInputRequestResendImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="OtpPushRequestPayload",e}(t.PushRequestPayload);t.OtpPushRequestPayload=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e,n;e=t.impl||(t.impl={}),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.userId=function(){return this._userId},e.prototype.title=function(){return this._title},e.prototype.body=function(){return this._body},e.createWithJsonPayload=function(t){var n=t,r=new e;return r._userId=n.user_id,r._title=n.title,r._body=n.body,r},e}(t.OtpPushRequestPayload),e.OtpPushRequestPayloadImpl=n}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getPassword=function(){return this._password},n.prototype.setPassword=function(t){this._password=t},n.create=function(e){return t.ts.mobile.sdk.impl.PasswordInputImpl.create(e)},n.__tarsusInterfaceName="PasswordInput",n}(e.InputResponseType);e.PasswordInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setPassword(t),n},e}(t.PasswordInput);e.PasswordInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getPatternDescription=function(){return this._patternDescription},n.prototype.setPatternDescription=function(t){this._patternDescription=t},n.create=function(e){return t.ts.mobile.sdk.impl.PatternInputImpl.create(e)},n.__tarsusInterfaceName="PatternInput",n}(e.InputResponseType);e.PatternInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return V(r,n),r.create=function(t){var e=new r;return e.setPatternDescription(t),e},r.validateFormat=function(t){return null!=t.getPatternDescription().match(/^(r:[0-9]+,c:[0-9]+)+$/)},r.getPatternLength=function(n){if(r.validateFormat(n))return n.getPatternDescription().match(/r/g).length;throw new e.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid pattern input.")},r}(t.PatternInput);e.PatternInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getPin=function(){return this._pin},n.prototype.setPin=function(t){this._pin=t},n.create=function(e){return t.ts.mobile.sdk.impl.PinInputImpl.create(e)},n.__tarsusInterfaceName="PinInput",n}(e.InputResponseType);e.PinInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setPin(t),n},e}(t.PinInput);e.PinInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createSuccessResponse=function(e){var n=new t.PlaceholderAuthSuccessResponse;return n.setPlaceholderToken(e),n},n.createdFailedResponse=function(e,n){var r=new t.PlaceholderAuthFailureResponse;return r.setFailureError(n),r.setExpired(e.getExpired()),r.setLocked(e.getLocked()),r.setRegistered(e.getRegistered()),r.setRegistrationStatus(e.getRegistrationStatus()),r},n.createFailedResponseWithServerProvidedStatus=function(e){var n=new t.PlaceholderAuthFailureWithServerProvidedStatusResponse;return n.setFailureError(e),n},n}(t.PlaceholderInputResponse);e.PlaceholderInputResponseImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){};function n(t){return!!t.createContinuation}t.Continuation=e,t.IsResumableProcess=n;var r=function(){function t(t,e){this._ctxt=t}return Object.defineProperty(t.prototype,"rtContext",{get:function(){return this._ctxt}
10,enumerable:!1,configurable:!0}),t.prototype.resume=function(t,e){return t instanceof s?(this._currentStep=t.currentStepContinuation.createResumableProcess(this),this.pumpSteps(this._currentStep.resume(t.currentStepContinuation,e))):Promise.reject("Attempt to resume a MultiStageResumableProcess with a bad continuation class.")},t.prototype.startWithStage=function(t){return this._currentStep=t,this.pumpSteps(t.run())},t.prototype.pumpSteps=function(t){var e=this;return t.then((function(t){return i(t)?(e._currentStep=t,e.pumpSteps(t.run())):t}))},t}();t.MultiStageResumableProcess=r;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e}(e);function i(t){return n(t)&&t.run}t.ResumableProcessStageContinuation=o,t.IsResumableProcessStage=i;var s=function(e){function n(n){var r=e.call(this)||this;return n instanceof t.SerializationContext?r.serializeFrom(n):r._currentStepContinuation=n._currentStep.createContinuation(),r}return V(n,e),n.prototype.serializeTo=function(t){t.writeObject("currentStepContinuation",this._currentStepContinuation)},n.prototype.serializeFrom=function(t){this._currentStepContinuation=t.readNonNullObject("currentStepContinuation")},Object.defineProperty(n.prototype,"currentStepContinuation",{get:function(){return this._currentStepContinuation},enumerable:!1,configurable:!0}),n}(e);t.MultiStageResumableProcessContinuation=s}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(){function e(t,e){this._controlFlowProcessor=t,this._action=e,this._sdk=this._controlFlowProcessor._sdk,this._uiHandler=this._controlFlowProcessor._uiHandler,this._clientContext=this._controlFlowProcessor._clientContext}return e.prototype.cancelRun=function(){},e.prototype.policyAction=function(){return this._policyAction||(this._policyAction=t.impl.PolicyActionImpl.fromServerAction(this._controlFlowProcessor,this._action)),this._policyAction},e.prototype.processEscapeRequest=function(e){var n=this;return new Promise((function(r,o){var i=e.getEscapeOption().getId();n._sdk.log(t.LogLevel.Debug,(function(){return"Processing escape reques "+i}));for(var s=n._policyAction.getEscapeOptions(),a=!1,c=0;c<s.length;c++)if(s[c].getId()===i){a=!0;break}a?n.sendAssertionEscapeRequest(e).then(r,o):o(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to invoke an invalid escape option "+i))}))},e.prototype.sendPollingRequest=function(e,n){var r=this._controlFlowProcessor.createPollingRequest(e,n);return t.util.wrapPromiseWithActivityIndicator(this._uiHandler,this.policyAction(),this._clientContext,this._controlFlowProcessor._session.performSessionExchange(r).then((function(t){return t.data})))},e.prototype.sendAssertionRequest=function(e,n,r){var o=this._controlFlowProcessor.createAssertionRequest(this._action,e,n,r);return t.util.wrapPromiseWithActivityIndicator(this._uiHandler,this.policyAction(),this._clientContext,this._controlFlowProcessor._session.performSessionExchange(o).then((function(e){if(!e.data)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Communication,"Invalid response to assertion.",{responseBody:JSON.stringify(e)});return e.data})))},e.prototype.sendErrorReportAssertionRequest=function(t){var e={client_error:t};return this.sendAssertionRequest("report_error",e)},e.prototype.sendAssertionEscapeRequest=function(e){var n=this._controlFlowProcessor.createAssertionRequest(this._action,"escape",{escape_id:e.getEscapeOption().getId(),escape_params:e.getEscapeParameters()});return t.util.wrapPromiseWithActivityIndicator(this._uiHandler,this.policyAction(),this._clientContext,this._controlFlowProcessor._session.performSessionExchange(n).then((function(e){if(!e.data)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Communication,"Invalid response to assertion.",{responseBody:JSON.stringify(e)});return e.data})))},e}();e.ActionDriver=n}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){};e.ResumableProcessActionDriverRuntimeContext=n;var r=function(e){function n(n){var r=e.call(this)||this;return n instanceof t.SerializationContext?r.serializeFrom(n):r._actionData=n,r}return V(n,e),n.prototype.serializeTo=function(t){t.writePrimitive("actionData",this._actionData)},n.prototype.serializeFrom=function(t){this._actionData=t.readPrimitive("actionData")},Object.defineProperty(n.prototype,"actionData",{get:function(){return this._actionData}
10,enumerable:!1,configurable:!0}),n}(t.Continuation);e.ResumableProcessActionContinuation=r;var o=function(t){function e(e,o){return e instanceof n&&(e=e.controlFlowProcessor),o instanceof r&&(o=o.actionData),t.call(this,e,o)||this}return V(e,t),e}(e.ActionDriver);e.ResumableProcessActionDriver=o}(t.actiondrivers||(t.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={}));var J=f&&f.__decorate||function(t,n,r,o){var i,s=arguments.length,a=s<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,r):o;if("object"===("undefined"==typeof Reflect?"undefined":e(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,n,r,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(a=(s<3?i(a):s>3?i(n,r,a):i(n,r))||a);return s>3&&a&&Object.defineProperty(n,r,a),a},Q=f&&f.__metadata||function(t,n){if("object"===("undefined"==typeof Reflect?"undefined":e(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)};!function(t){!function(t){!function(t){var e;(function(t){var n=function(){};t.ControlFlowProcessorRuntimeContext=n;var r=function(){function n(n,r,o,i,s){if(n instanceof t.SerializationContext)this.serializeFrom(n);else{if(!(r&&o&&void 0!==i&&s))throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid arguments passed to ControlFlowProcessorContinuation ctor");this._initiatingRequest=n,this._initialCflowResponse=r,this._controlFlow=o,this._currentControlFlowStep=i,this._actionContinuation=s.createContinuation()}}return Object.defineProperty(n.prototype,"initiatingRequest",{get:function(){return this._initiatingRequest},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"initialCflowResponse",{get:function(){return this._initialCflowResponse},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controlFlow",{get:function(){return this._controlFlow},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentControlFlowStep",{get:function(){return this._currentControlFlowStep},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"actionContinuation",{get:function(){return this._actionContinuation},enumerable:!1,configurable:!0}),n.prototype.createResumableProcess=function(t){return new o(t)},n.prototype.serializeTo=function(t){t.writeObject("intiatingRequest",this._initiatingRequest),t.writePrimitive("initialCflowResponse",this._initialCflowResponse),t.writePrimitive("controlFlow",this._controlFlow),t.writePrimitive("currentControlFlowStep",this._currentControlFlowStep),t.writeObject("actionContinuation",this._actionContinuation)},n.prototype.serializeFrom=function(e){this._initiatingRequest=e.readObject(t.SessionExchangeRequest,"intiatingRequest"),this._initialCflowResponse=e.readPrimitive("initialCflowResponse"),this._controlFlow=e.readPrimitive("controlFlow"),this._currentControlFlowStep=e.readPrimitive("currentControlFlowStep"),this._actionContinuation=e.readNonNullObject("actionContinuation")},n=J([t.Serializable("ControlFlowProcessorContinuation"),Q("design:paramtypes",[Object,Object,Array,Number,t.actiondrivers.ResumableProcessActionDriver])],n)}(),o=function(){function o(t,e,r,o){if(this._cancelled=!1,!(t instanceof n)){var i=t;(t=new n).sdk=i,t.cflowRequestContext=o||null,t.clientContext=r,t.session=e,t.uiHandler=i.currentUiHandler}this._sdk=t.sdk,this._session=t.session,this._uiHandler=t.uiHandler,this._clientContext=t.clientContext,this._requestContext=t.cflowRequestContext}return o.findByClientContext=function(t){var e=o._allRunningControlFlows.filter((function(e){return e._clientContext==t}));return e.length?e[0]:null},o.prototype.createContinuation=function(){if(this._cancelled)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Cannot create continuation for cancelled control flow");if(!this._currentActionDriver)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Cannot create continuation for control flow without current action");if(this._currentActionDriver instanceof t.actiondrivers.ResumableProcessActionDriver)return new r(this._initiatingRequest,this._initialCflowResponse,this._controlFlow,this._currentControlFlowStep,this._currentActionDriver);throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Cannot create continuation for control flow running current action "+this._currentActionDriver._action.type)},Object.defineProperty(o.prototype,"sdk",{get:function(){return this._sdk}
10,enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"initiatingRequest",{get:function(){return this._initiatingRequest},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"requestContext",{get:function(){return this._requestContext},enumerable:!1,configurable:!0}),o.prototype.cancelFlow=function(){this._cancelled=!0,this._currentActionDriver&&this._currentActionDriver.cancelRun(),this._uiHandler.controlFlowCancelled(this._clientContext)},o.prototype.startControlFlow=function(n){var r,o=this;if(this._cancelled)return this.createExternalCancellationRejectionPromise();var i=null;return n instanceof t.SessionExchangeRequest?(i=n,r=e.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,this._session.performSessionExchange(n))):r=this._session.processInlineResponse(n),r.then((function(t){return o._initialCflowResponse=t.data,o._initiatingRequest=i,o.executeControlFlow(o._initialCflowResponse)}))},o.prototype.resume=function(n,o){var i=this;return new Promise((function(s,a){if(!(n instanceof r))throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid continuation type provided to resume()");i._initiatingRequest=n.initiatingRequest,i._initialCflowResponse=n.initialCflowResponse,i._controlFlow=n.controlFlow,i._currentControlFlowStep=n.currentControlFlowStep;var c=new t.actiondrivers.ResumableProcessActionDriverRuntimeContext;c.controlFlowProcessor=i;var u=n.actionContinuation.createResumableProcess(c);i._currentActionDriver=u,u.resume(n.actionContinuation,o).then((function(t){return i.executeControlFlow(t)})).then(s,a)}))},Object.defineProperty(o.prototype,"challenge",{get:function(){return this._initialCflowResponse&&this._initialCflowResponse.challenge||null},enumerable:!1,configurable:!0}),o.prototype.executeControlFlow=function(t){var e=this;return new Promise((function(n,r){o._allRunningControlFlows.push(e),e._uiHandler.controlFlowStarting(e._clientContext),e.processSingleStepExchange(t).then((function(t){return e._uiHandler.controlFlowEnded(null,e._clientContext),t}),(function(t){throw e._uiHandler.controlFlowEnded(t,e._clientContext),t})).finally((function(){var t=o._allRunningControlFlows.indexOf(e);o._allRunningControlFlows.splice(t,1)})).then(n,r)}))},o.prototype.processSingleStepExchange=function(n){var r,o=this;return n.control_flow&&(this._controlFlow=n.control_flow,this._currentControlFlowStep=0,this._sdk.log(e.LogLevel.Debug,(function(){return"Got ControlFlow with "+o._controlFlow.length+" steps."}))),n.data&&n.data.json_data?(this._sdk.log(e.LogLevel.Debug,(function(){return"Got a JSON data attachment on control flow response. Processing."})),r=t.actiondrivers.ActionDriverJsonData.handleJsonDataByUiHandler(this._uiHandler,n,n.data.json_data,null,this._clientContext)):r=Promise.resolve(n),r.then((function(r){switch(n.state){case t.Protocol.AuthSessionState.Pending:return o._sdk.log(e.LogLevel.Debug,(function(){return"Execute step "+o._currentControlFlowStep+"."})),(i=o._controlFlow[o._currentControlFlowStep])?o._cancelled?o.createExternalCancellationRejectionPromise():o.promiseCancellableSingleActionProcessing(i).then((function(t){return o._currentControlFlowStep++,o.processSingleStepExchange(t)})):(o._sdk.log(e.LogLevel.Error,(function(){return"Step "+o._currentControlFlowStep+" nonexisting."})),Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Session state is pending but no control flow.")));case t.Protocol.AuthSessionState.Rejected:o._sdk.log(e.LogLevel.Debug,(function(){return"Handle control flow rejection."}));var i=o._controlFlow&&o._controlFlow[o._currentControlFlowStep]||null;return o._uiHandler.handlePolicyRejection(n.rejection_data&&n.rejection_data.title||null,n.rejection_data&&n.rejection_data.text||null,n.rejection_data&&n.rejection_data.button_text||null,n.failure_data,i?e.impl.PolicyActionImpl.fromServerAction(o,i):e.impl.PolicyActionImpl.createPseudoAction(o._sdk,"rejection"),o._clientContext).then((function(t){if(-1!=t.getUserChoice())throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"ConfirmationInput.getUserChoice must be set to -1.");throw e.impl.AuthenticationErrorImpl.errorForSessionRejectionFailureData(n.failure_data)}));case t.Protocol.AuthSessionState.Completed:return o._sdk.log(e.LogLevel.Debug,(function(){return"Handle control flow completion."})),Promise.resolve(e.impl.AuthenticationResultImpl.fromCflowServerResponse(n,o._session.deviceId())
10)}}))},o.prototype.promiseCancellableSingleActionProcessing=function(n){var r=this,o=t.actiondrivers.ActionDrivers[n.type];if(!o)return Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Don't know how to handle action.",{actionType:n.type}));var i=new o(this,n);return this._currentActionDriver=i,this._uiHandler.controlFlowActionStarting(i.policyAction(),this._clientContext),i.run().then((function(t){return r._uiHandler.controlFlowActionEnded(null,i.policyAction(),r._clientContext),t}),(function(t){var o=e.impl.AuthenticationErrorImpl.augmentErrorData(t,{});throw o.setPublicProperty(e.AuthenticationErrorProperty.AuthenticationErrorFailingActionType,n.type),r._uiHandler.controlFlowActionEnded(o,i.policyAction(),r._clientContext),o})).finally((function(){r._currentActionDriver=null}))},o.prototype.createAssertionRequest=function(n,r,o,i){var s;if(!this.challenge)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to create an assertion request without an initial control flow request.");var a={action:n.type,assert:r||"action",assertion_id:n.assertion_id,fch:this.challenge};if(o&&(a.data=o),i){var c=a;for(var u in i)c[u]=i[u]}return new t.SessionExchangeRequest("POST","auth/assert",a,[],null===(s=this.requestContext)||void 0===s?void 0:s.getFlowId())},o.prototype.createPollingRequest=function(e,n){var r,o={};return Object.keys(e).forEach((function(t){o[t]=e[t]})),o.polling_timeout=n,new t.SessionExchangeRequest("POST","auth/poll",o,[],null===(r=this.requestContext)||void 0===r?void 0:r.getFlowId())},o.prototype.createExternalCancellationRejectionPromise=function(){return Promise.reject(this.createExternalCancellationError())},o.prototype.createExternalCancellationError=function(){return new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.UserCanceled,"Operation cancelled by user.",{control_flow_external_cancellation:!0})},o.prototype.generateDebugPin=function(){var e=this;return new Promise((function(n,r){var o=new t.SessionExchangeRequest("POST","auth/create_debug_token",{},[]);e._session.performSessionExchange(o).then((function(t){return t.data.debug_pin})).then(n,r)}))},o._allRunningControlFlows=[],o}();t.ControlFlowProcessor=o})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r;r=t.sdk||(t.sdk={}),e=r.impl||(r.impl={}),n=function(){function t(t,n,r,o,i,s){void 0===o&&(o=!1),void 0===i&&(i=null),void 0===s&&(s=null),this._isPseudoAction=!1,this._escapeOptions=[],this._actionType=n,this._isPseudoAction=o,this._actionLocalStrings=i,this._actionLocalStyles=s,this._uiContextImpl=new e.UIContextImpl(t,this._actionLocalStrings||void 0,this._actionLocalStyles),this._controlFlow=r}return t.prototype.getIsPseudoAction=function(){return this._isPseudoAction},t.prototype.getActionType=function(){return this._actionType},t.prototype.getAltLabel=function(){return""},t.prototype.getUiContext=function(){return this._uiContextImpl},t.prototype.getEscapeOptions=function(){return this._escapeOptions},t.prototype.escapeOptionById=function(t){var n=null;if(this._escapeOptions.forEach((function(e){e.getId()===t&&(n=e)})),!n)throw new e.AuthenticationErrorImpl(r.AuthenticationErrorCode.AppImplementation,"Invalid escape ID "+t+" for this action.");return n},Object.defineProperty(t.prototype,"controlFlow",{get:function(){return this._controlFlow},enumerable:!1,configurable:!0}),t.fromServerAction=function(n,r){var o=new t(n.sdk,r.type,n,!1,r.strings,r.styles);return r.escapes&&(o._escapeOptions=r.escapes.map((function(t){return new e.EscapeOptionImpl(t)}))),o},t.createPseudoAction=function(e,n){return new t(e,n,null,!0)},t}(),e.PolicyActionImpl=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getControlRequest=function(){return this._controlRequest},e.prototype.setControlRequest=function(t){this._controlRequest=t},e.prototype.getSelectedAuthenticator=function(){return this._selectedAuthenticator},e.prototype.setSelectedAuthenticator=function(t){this._selectedAuthenticator=t},e.prototype.getActionEscapeRequest=function(){return this._actionEscapeRequest},e.prototype.setActionEscapeRequest=function(t){this._actionEscapeRequest=t},e.createControlResponse=function(e){return t.ts.mobile.sdk.impl.PromotionInputImpl.createControlResponse(e)},e.createEscapeRequest=function(e,n){return t.ts.mobile.sdk.impl.PromotionInputImpl.createEscapeRequest
10(e,n)},e.createAuthenticatorDescription=function(e){return t.ts.mobile.sdk.impl.PromotionInputImpl.createAuthenticatorDescription(e)},e.__tarsusInterfaceName="PromotionInput",e}();e.PromotionInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.isControlRequest=function(){return!(void 0===this._controlRequest||null===this._controlRequest)},n.createControlResponse=function(t){var e=new n;return e.setControlRequest(t),e},n.createAuthenticatorDescription=function(t){var e=new n;return e.setSelectedAuthenticator(t),e},n.createEscapeRequest=function(e,r){var o=new n;return o._actionEscapeRequest=new t.ActionEscapeRequest,o._actionEscapeRequest._escapeOption=e,o._actionEscapeRequest._escapeParameters=r,o},n}(t.PromotionInput);e.PromotionInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function e(){}return e.fromAssertionFormat=function(e){switch(e){case t.core.Protocol.QrCodeFormatType.Numeric:return t.QrCodeFormat.Numeric;case t.core.Protocol.QrCodeFormatType.Alphanumeric:return t.QrCodeFormat.Alphanumeric;case t.core.Protocol.QrCodeFormatType.Binary:return t.QrCodeFormat.Binary;default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid qr code format type encountered: "+e.type)}},e}();t.QrCodeFormatImpl=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getQrCode=function(){return this._qrCode},e.prototype.getQrCodeFormat=function(){return this._qrCodeFormat},e.createQrCodeResult=function(e,n){return t.ts.mobile.sdk.impl.QrCodeResultImpl.createQrCodeResult(e,n)},e.__tarsusInterfaceName="QrCodeResult",e}();e.QrCodeResult=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createQrCodeResult=function(t,n){var r=new e;return r._qrCode=t,r._qrCodeFormat=n,r},e}(t.QrCodeResult);e.QrCodeResultImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getRedirectResponse=function(){return this._redirectResponse},e.prototype.setRedirectResponse=function(t){this._redirectResponse=t},e.prototype.getAdditionalParametersOverride=function(){return this._additionalParametersOverride},e.prototype.setAdditionalParametersOverride=function(t){this._additionalParametersOverride=t},e.create=function(e){return t.ts.mobile.sdk.impl.RedirectInputImpl.create(e)},e.__tarsusInterfaceName="RedirectInput",e}();e.RedirectInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setRedirectResponse(t),n},e}(t.RedirectInput);e.RedirectInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getServerAddress=function(){return this._serverAddress},e.prototype.setServerAddress=function(t){this._serverAddress=t},e.prototype.getRealm=function(){return this._realm},e.prototype.setRealm=function(t){this._realm=t},e.prototype.getAppId=function(){return this._appId},e.prototype.setAppId=function(t){this._appId=t},e.prototype.getTokenName=function(){return this._tokenName},e.prototype.setTokenName=function(t){this._tokenName=t},e.prototype.getToken=function(){return this._token},e.prototype.setToken=function(t){this._token=t},e.prototype.getCryptoMode=function(){return this._cryptoMode},e.prototype.setCryptoMode=function(t){this._cryptoMode=t},e.create=function(e,n,r,o){return t.ts.mobile.sdk.impl.SDKConnectionSettingsImpl.create(e,n,r,o)},e.createWithCryptoMode=function(e,n,r,o,i){return t.ts.mobile.sdk.impl.SDKConnectionSettingsImpl.createWithCryptoMode(e,n,r,o,i)},e.__tarsusInterfaceName="SDKConnectionSettings",e}();e.SDKConnectionSettings=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.create=function(e,n,r,o){return this.createWithCryptoMode(e,n,r,o,t.ConnectionCryptoMode.None)},n.createWithCryptoMode=function(t,e,r,o,i){var s=new n;return s.setServerAddress(t),s.setAppId(e),s.setTokenName(r),s.setToken(o),s.setCryptoMode(i),s},n.prototype.setSendFlowIdAsHttpHeader=function(t){this.sendFlowIdAsHttpHeader=t}
10,n.prototype.shouldSendFlowIdAsHttpHeader=function(){return this.sendFlowIdAsHttpHeader},n}(t.SDKConnectionSettings);e.SDKConnectionSettingsImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getQrCodeResult=function(){return this._qrCodeResult},n.prototype.setQrCodeResult=function(t){this._qrCodeResult=t},n.createScanQrCodeInput=function(e){return t.ts.mobile.sdk.impl.ScanQrCodeInputImpl.createScanQrCodeInput(e)},n.__tarsusInterfaceName="ScanQrCodeInput",n}(e.InputResponseType);e.ScanQrCodeInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createScanQrCodeInput=function(t){var n=new e;return n.setQrCodeResult(t),n},e}(t.ScanQrCodeInput);e.ScanQrCodeInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createAnswerToQuestion=function(t,n){var r=new e;return r._question=t,r._answer=n,r._isRemoved=!1,r},e.createAnswerRemovalRequest=function(t){var n=new e;return n._question=t,n._isRemoved=!0,n},e}(t.SecurityQuestionAndAnswer);e.SecurityQuestionAndAnswerImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createWithText=function(t){var n=new e;return n._answerText=t,n},e}(t.SecurityQuestionAnswer);e.SecurityQuestionAnswerImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t,e,n){this._id=t,this._text=e,this._registered=n}return t.prototype.getSecurityQuestionId=function(){return this._id},t.prototype.getSecurityQuestionText=function(){return this._text},t.prototype.getAnswered=function(){return this._registered},t.__tarsusInterfaceName="SecurityQuestion",t}();t.SecurityQuestionImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createSecurityQuestionAnswersInputResponse=function(e){var n=new t.SecurityQuestionAnswersInputResponse;return n._answers=e,n},n}(t.SecurityQuestionInputResponse);e.SecurityQuestionInputResponseImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getStepTag=function(){return"question"},t.prototype.getSecurityQuestions=function(){return this._securityQuestions},t.prototype.getMinAnswersNeeded=function(){return this._minAnswers},t.prototype.getMaxAnswerLength=function(){return this._maxAnswerLength},t.prototype.getMinAnswerLength=function(){return this._minAnswerLength},t.createForAuthQuestion=function(e){var n=new t;return n._minAnswers=1,n._securityQuestions=[e],n._maxAnswerLength=-1,n._minAnswerLength=-1,n},t.createForRegistrationQuestions=function(e,n,r,o){var i=new t;return i._minAnswers=n,i._securityQuestions=e,i._maxAnswerLength=r,i._minAnswerLength=o,i},t.__tarsusInterfaceName="SecurityQuestionStepDescription",t}();t.SecurityQuestionStepDescriptionImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){var e="undefined"!=typeof window?window:e;e.com=t}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t){this._hex=t.hex||"",t.alpha&&(this._hex=this._hex.slice(0,1)+this.convertAlpha(t.alpha)+this._hex.slice(1))}return t.prototype.getHexValue=function(){return this._hex},t.prototype.convertAlpha=function(t){return Math.ceil(255*t).toString(16)},t}();t.TSColorImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(e,n){var r=t.call(this)||this;return n&&(r._selectedTargets=n),e&&(r._authenticatorInput=e),r}return V(e,t),e.createAuthenticatorInput=function(t){return new e(t,null)},e.createTargetSelectionRequest=function(t){return new e(null,[t])},e.createTargetsSelectionRequest=function(t){return new e(null,t)},e}(t.TargetBasedAuthenticatorInput);e.TargetBasedAuthenticatorInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function e(e,n,r,o,i,s,a){this._deviceId=e,this._model=t.core.DeviceModelConverter.getDeviceModel(n,i),this._isCurrentDevice=o,this._osType=t.core.DeviceModelConverter.getOsName(i),this._osVersion=s,this._lastAccessed=r,this._alias=a}return e.prototype.getDeviceId=function(){return this._deviceId},e.prototype.getModel=function(){return this._model},e.prototype.getLastAccessed=function(){return this._lastAccessed},e.prototype.getIsCurrent=function(){return this._isCurrentDevice},e.prototype.getOsType=function(){return this._osType},e.prototype.getOsVersion=function(){return this._osVersion},e.prototype.getAlias=function(){return this._alias},e.prototype.describe=function(){var t=new Date(this._lastAccessed).toLocaleDateString();return""+(this._alias?this._alias+" : ":"")+this._model+" last accessed on "+t},e.fromServerFormat=function(t){return new e(t.device_id,t.model,t.last_access,t.current_device,t.os_type,t.os_version,t.alias||null)},e}();t.TargetDeviceDetailsImpl=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.createPollRequest=function(){return t.ts.mobile.sdk.impl.TicketWaitInputImpl.createPollRequest()},n.createLongPollRequest=function(e){return t.ts.mobile.sdk.impl.TicketWaitInputImpl.createLongPollRequest(e)},n.__tarsusInterfaceName="TicketWaitInput",n}(e.InputResponseType);e.TicketWaitInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getPollingTimeout=function(){return this._pollingTimeout},e.prototype.setPollingTimeout=function(t){this._pollingTimeout=t},e.__tarsusInterfaceName="TicketWaitInputPollRequest",e}(t.TicketWaitInput);t.TicketWaitInputPollRequest=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createPollRequest=function(){var t=new r;return t.setPollingTimeout(0),t},e.createLongPollRequest=function(t){var e=new r;return e.setPollingTimeout(t),e},e}(t.TicketWaitInput);e.TicketWaitInputImpl=n;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="TicketWaitInputPollRequest",e}(t.TicketWaitInputPollRequest);e.TicketWaitInputPollRequestImpl=r}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Qr=0]="Qr",t[t.Alphanumeric=1]="Alphanumeric"}(t.TicketIdFormat||(t.TicketIdFormat={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function e(t){this._ticketId=t}return e.prototype.getFormat=function(){switch(this._ticketId.format){case t.core.Protocol.TicketIdFormatType.Alphanumeric:return t.TicketIdFormat.Alphanumeric;case t.core.Protocol.TicketIdFormatType.QrCode:default:return t.TicketIdFormat.Qr}},e.prototype.getValue=function(){return this._ticketId.value},e.prototype.getValueAltRepresentation=function(){return this._ticketId.alt},e}();e.TicketIdImpl=n;var r=function(){function t(t){this._title=t.title,this._text=t.text,this._ticketId=t.ticket_id?new n(t.ticket_id):null}return t.prototype.getTitle=function(){return this._title},t.prototype.getText=function(){return this._text},t.prototype.getTicketId=function(){return this._ticketId},t}();e.TicketWaitingInformationImpl=r}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function e(){}return e.fromAssertionFormat=function(e){switch(e.type){case t.core.Protocol.TotpChallengeFormatType.Numeric:return new r;case t.core.Protocol.TotpChallengeFormatType.QrCode:return new i;case t.core.Protocol.TotpChallengeFormatType.AlphaNumeric:return new n;default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid format type encountered: "+e.type)}},e}();t.TotpChallengeFormatImpl=e;var n=function(){function t(){}return t.prototype.getType=function(){return o.AlphaNumeric},t.__tarsusInterfaceName="TotpChallengeFormatAlphaNumeric",t}();t.TotpChallengeFormatAlphaNumericImpl=n;var r=function(){function t(){}return t.prototype.getType=function(){return o.Numeric},t.__tarsusInterfaceName="TotpChallengeFormatNumeric",t}();t.TotpChallengeFormatNumericImpl=r;var o,i=function(){function t(){}return t.prototype.getType=function(){return o.QrCode},t.__tarsusInterfaceName="TotpChallengeFormatQr",t}();t.TotpChallengeFormatQrImpl=i,function(t){t[t.AlphaNumeric=0]="AlphaNumeric",t[t.Numeric=1]="Numeric",t[t.QrCode=2]="QrCode"}(o=t.TotpChallengeFormatType||(t.TotpChallengeFormatType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getChallenge=function(){return this._challenge},n.prototype.setChallenge=function(t){this._challenge=t},n.create=function(e){return t.ts.mobile.sdk.impl.TotpChallengeInputImpl.create(e)},n.__tarsusInterfaceName="TotpChallengeInput",n}(e.InputResponseType);e.TotpChallengeInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setChallenge(t),n},e}(t.TotpChallengeInput);e.TotpChallengeInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.createTotpGenerationRequest=function(e,n,r){var o=new t;return o.setUserId(e.userHandle),o.setChallenge(n),o.setGeneratorName(r),o},t.prototype.getChallenge=function(){return this._challenge},t.prototype.getGeneratorName=function(){return this._generatorName},t.prototype.setGeneratorName=function(t){this._generatorName=t},t.prototype.setChallenge=function(t){this._challenge=t},t.prototype.setUserId=function(t){this._userId=t},t.prototype.getUserId=function(){return this._userId},t.prototype.setUserHandleType=function(t){this._userHandleType=t},t.prototype.getUserHandleType=function(){return this._userHandleType},t}();t.TotpGenerationRequestImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="TotpInput",e}(t.InputResponseType);t.TotpInput=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getCode=function(){return this._code},n.prototype.setCode=function(t){this._code=t},n.createTotpCodeSubmission=function(e){return t.ts.mobile.sdk.impl.TotpInputCodeSubmissionImpl.createTotpCodeSubmission(e)}
10,n.__tarsusInterfaceName="TotpInputCodeSubmission",n}(e.TotpInput);e.TotpInputCodeSubmission=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.createTotpCodeSubmission=function(t){var n=new e;return n.setCode(t),n},e}(t.TotpInputCodeSubmission);e.TotpInputCodeSubmissionImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function e(){}return e.createEscapeRequest=function(e){var n=new t.TotpProvisionEscapeRequest;return n.setEscapeRequest(e),n},e}();e.TotpProvisionResultImpl=n}(t.impl||(t.impl={}))}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={}));var X=f&&f.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};!function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._components=t}return t.prototype.toString=function(){return this._components.map((function(t){return t.replace(/([\\.])/g,(function(t){return"\\"+("."==t?"p":t)}))})).join(".")},t.fromString=function(e){return new(t.bind.apply(t,X([void 0],e.split("."))))},t.prototype.concat=function(e){return new(t.bind.apply(t,X([void 0],this._components.concat(e._components))))},t.prototype.component=function(t){return this._components[t]},t}();t.TarsusKeyPath=e;var n=function(){function t(t){this._host=t}return t.prototype.readStorageKey=function(t){return this._lastReadStorageKeyValue=this._host.readStorageKey(t.toString()),this._lastReadStorageKeyValue},t.prototype.getLastReadStorageKeyValue=function(){return this._lastReadStorageKeyValue},t.prototype.writeStorageKey=function(t,e){this._host.writeStorageKey(t.toString(),e)},t.prototype.deleteStorageKey=function(t){this._host.deleteStorageKey(t.toString())},t.prototype.readSessionStorageKey=function(t){return this._host.readSessionStorageKey(t.toString())},t.prototype.writeSessionStorageKey=function(t,e){this._host.writeSessionStorageKey(t.toString(),e)},t.prototype.deleteSessionStorageKey=function(t){this._host.deleteSessionStorageKey(t.toString())},t.prototype.generateKeyPair=function(t,e,n,r){return this._host.generateKeyPair(t.toString(),e,n,r)},t.prototype.generateKeyPairExternalRepresentation=function(t){return this._host.generateKeyPairExternalRepresentation(t)},t.prototype.generateHexSeededKeyPairExternalRepresentation=function(t,e,n,r){return this._host.generateHexSeededKeyPairExternalRepresentation(t,e,n,r)},t.prototype.getKeyPair=function(t,e,n){return this._host.getKeyPair(t.toString(),e,n)},t.prototype.deleteKeyPair=function(t){this._host.deleteKeyPair(t.toString())},t.prototype.importVolatileSymmetricKey=function(t,e){return this._host.importVolatileSymmetricKey(t,e)},t.prototype.importVolatileKeyPair=function(t,e){return this._host.importVolatileKeyPair(t,e)},t.prototype.importVolatileKeyPairFromPublicKeyHex=function(t,e){return this._host.importVolatileKeyPairFromPublicKeyHex(t,e)},t.prototype.generatePbkdf2HmacSha1HexString=function(t,e,n,r){return this._host.generatePbkdf2HmacSha1HexString(t,e,n,r)},t.prototype.calcHexStringEncodedSha256Hash=function(t){return this._host.calcHexStringEncodedSha256Hash(t)},t.prototype.calcHexStringEncodedSha512Hash=function(t){return this._host.calcHexStringEncodedSha512Hash(t)},t.prototype.generateRandomHexString=function(t){return this._host.generateRandomHexString(t)},t.prototype.queryHostInfo=function(t){return this._host.queryHostInfo(t)},t.prototype.queryAsyncHostInfo=function(t){return this._host.queryAsyncHostInfo(t)},t.prototype.calcHexStringEncodedHmacSha1HashWithHexEncodedKey=function(t,e){return this._host.calcHexStringEncodedHmacSha1HashWithHexEncodedKey(t,e)},t.prototype.getCurrentTime=function(){return this._host.getCurrentTime()},t.prototype.createDelayedPromise=function(t){return this._host.createDelayedPromise(t)},t.prototype.fido2CredentialsOp=function(t,e,n,r,o){return this._host.fido2CredentialsOp(t,e,n,r,o)},t.prototype.dyadicEnroll=function(t,e){return this._host.dyadicEnroll(t,e)},t.prototype.dyadicSign=function(t,e){return this._host.dyadicSign(t,e)},t.prototype.dyadicDelete=function(t){return this._host.dyadicDelete(t)},t.prototype.dyadicRefreshToken=function(t,e){return this._host.dyadicRefreshToken(t,e)},t.prototype.dyadicClearAllData=function(){this._host.dyadicClearAllData()},t.prototype.log=function(t,e,n){return this._host.log(t,e,n)},t.prototype.setDebugIndicatorVisible=function(t){this._host.setDebugIndicatorVisible(t)},t.prototype.getUIStyles=function(){return this._host.getUIStyles()},t.prototype.getString=function(t,e){return this._host.getString(t,e)},t.prototype.loadPlugin=function(t){return this._host.loadPlugin(t)},t}();t.TarsusHostServices=n}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(t){this._strings=t}return Object.defineProperty(t.prototype,"strings",{get:function(){return this._strings}
10,enumerable:!1,configurable:!0}),t.prototype.getString=function(t){return this._strings?this._strings[t]:null},t}();t.ClientStrings=e}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r;r=t.sdk||(t.sdk={}),e=r.impl||(r.impl={}),n=function(){function t(t,e,n){this._sdk=t,this._contextLocalStrings=e||null,this._contextStylesheetJson=n||null}return t.prototype.getString=function(t){return this.internalFormatString(t,null)},t.prototype.formatString=function(t,e){return this.internalFormatString(t,e)},t.prototype.internalFormatString=function(t,e){var n;return null==(n=this.resolveStringKey(t))?t:e&&e.length>0?this.format(n,e):n},t.prototype.resolveStringKey=function(t){var e;if(null!=(e=this._contextLocalStrings&&this._contextLocalStrings[t]))return e;var n=this._sdk.uiAssetsData;return n?n.getString(t):(this._sdk.log(r.LogLevel.Warning,(function(){return"Attempt to get string value without initialized asset data."})),null)},t.prototype.format=function(t,e){var n=this,r=t;return r&&(r=r.replace(/%(\d+)\$s/g,(function(t,r){var o=+r-1;return n.stringForIndex(o,e,t)}))),r},t.prototype.stringForIndex=function(t,e,n){return t>=0&&t<e.length?e[t]:n},t.prototype.getStyle=function(t){return this._contextStylesheet||(this._contextStylesheet=this._contextStylesheetJson?this._sdk.uiAssetsData.getUiStylesheetsWithOverrides(this._contextStylesheetJson):this._sdk.uiAssetsData.uiStylesheets),this._contextStylesheet.getMatchingStyle(t)},t}(),e.UIContextImpl=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){t.TARSUS_EXTENSION_POINT_NAME_MESSAGE_FILTERS="com.ts.mobile.sdk.core.messageFilters",t.TARSUS_EXTENSION_POINT_NAME_SESSION_OBSERVERS="com.ts.mobile.sdk.core.sessionObservers",t.TARSUS_EXTENSION_POINT_NAME_PLACEHOLDER_EXTENSION="com.ts.mobile.sdk.core.placeholderExtension",t.TARSUS_EXTENSION_POINT_NAME_FORMS_EXTENSION="com.ts.mobile.plugins.form.settings",t.TARSUS_EXTENSION_POINT_NAME_IDP_LOGIN_PROVIDER="com.ts.mobile.plugins.providers.idp",t.TARSUS_EXTENSION_POINT_NAME_KYC="com.ts.mobile.plugins.kyc",t.TARSUS_EXTENSION_POINT_NAME_SEED_BASED_TOTP_CALCULATOR="com.ts.mobile.plugins.totp.seedBasedTotpCalculator",t.TARSUS_EXTENSION_POINT_NAME_ACCOUNT_PROTECTION="com.ts.mobile.plugins.acp"}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function e(t){this._name=t,this._extensions=[],e._extensionPoints[t]=this}return e.prototype.extend=function(t){this._extensions.push(t)},e.prototype.forEach=function(t){this._extensions.forEach(t)},e.prototype.first=function(t){var e=null;return this._extensions.forEach((function(n){!e&&t(n)&&(e=n)})),e},e.prototype.firstNonNull=function(t){var e=null;return this._extensions.forEach((function(n){e||(e=t(n))})),e},e.byName=function(e){var n=this._extensionPoints[e];if(!n)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid extension point requested: "+e);return n},e.firstNonNullByName=function(n){var r=e.byName(n).firstNonNull((function(t){return t}));if(!r)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Could not locate "+n);return r},e._extensionPoints={},e}();e.ExtensionPoint=n}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={}));var $=f&&f.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))},Y=f&&f.__generator||function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};!function(t){!function(e){!function(e){!function(n){var r=t.ts.mobile.sdk.core.ExtensionPoint,o=new n.core.TarsusKeyPath("currentSession"),i=new n.core.TarsusKeyPath("continuations","default_cflow"),s=(new n.core.TarsusKeyPath("flow_id"),function(){function s(){this.mandatoryCollectors=[n.CollectorType.DeviceDetails,n.CollectorType.ExternalSDKDetail
10s,n.CollectorType.HWAuthenticators,n.CollectorType.LocalEnrollments,n.CollectorType.Capabilities,n.CollectorType.DeviceFingerprint],this.mandatoryCollectorsForAnonymous=[n.CollectorType.DeviceDetails,n.CollectorType.ExternalSDKDetails,n.CollectorType.HWAuthenticators,n.CollectorType.Capabilities],this.uiAssetsDownloadMode=n.UIAssetsDownloadMode.DownloadOnInit,this._wasLocaleSet=!1}return s.prototype.pushRequestPayloadFromJSON=function(t){var e=t.push_type;switch(e){case"otp_notification":return n.impl.OtpPushRequestPayloadImpl.createWithJsonPayload(t);case"approval":return n.impl.MobileApprovePushRequestPayloadImpl.createWithJsonPayload(t)}throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Payload with type "+e+" isn't recognized")},Object.defineProperty(s.prototype,"apiLevel",{get:function(){if(null==this._apiLevel)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Attempt to access uninitialized API level");return this._apiLevel},enumerable:!1,configurable:!0}),s.prototype.setTarsusHost=function(t){this._nativeHost=t,this.host=new n.core.TarsusHostServices(t),this.setLogLevel(n.LogLevel.Error),this.pluginManager=new n.core.TarsusPluginManager(this),this.enabledCollectors=[n.CollectorType.Accounts,n.CollectorType.DeviceDetails,n.CollectorType.Contacts,n.CollectorType.Owner,n.CollectorType.Software,n.CollectorType.Location,n.CollectorType.Bluetooth,n.CollectorType.ExternalSDKDetails,n.CollectorType.HWAuthenticators,n.CollectorType.Capabilities,n.CollectorType.LargeData,n.CollectorType.LocalEnrollments,n.CollectorType.DeviceFingerprint,n.CollectorType.AppPermissions],this._enabledCollectorsAnonymous=null,this.currentPersistUserData=!0},Object.defineProperty(s.prototype,"enabledCollectorsAnonymous",{get:function(){return null==this._enabledCollectorsAnonymous?this.apiLevel<11?(this.log(n.LogLevel.Debug,(function(){return"enabledCollectorsAnonymous() returning regular collectors"})),this.enabledCollectors):(this.log(n.LogLevel.Debug,(function(){return"enabledCollectorsAnonymous() returning mandatory collectors for anonymous only"})),this.mandatoryCollectorsForAnonymous):(this.log(n.LogLevel.Debug,(function(){return"enabledCollectorsAnonymous() returning collectors set by the customer"})),this._enabledCollectorsAnonymous)},enumerable:!1,configurable:!0}),s.prototype.setUiAssetsDownloadMode=function(t){this.uiAssetsDownloadMode=t},s.prototype.setLocale=function(t){var e=this;if((this.log(n.LogLevel.Debug,(function(){return"Start setLocale with locale "+t})),t&&""!=t)&&(this._wasLocaleSet=!0,(this.uiAssetsData&&this.uiAssetsData.locale)!=t||this.uiAssetsData.isServerClientStringsEmpty()))return this.log(n.LogLevel.Debug,(function(){return"Updating locale to "+t})),this.uiAssetsDownloadMode!==n.UIAssetsDownloadMode.Disable?this.loadUiAssetsFromServer(t).then((function(t){return Promise.resolve(t)})).catch((function(r){return e.log(n.LogLevel.Warning,(function(){return"Error loading locale from server; using empty locale "+t})),e.uiAssetsData=new n.core.UIAssetsData(e,t),Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(r))})):(this.uiAssetsData=new n.core.UIAssetsData(this,t),Promise.resolve(!0));return Promise.resolve(!1)},s.prototype.setConnectionSettings=function(t){this.connectionSettings=t},s.prototype.setClientCryptoSettings=function(t){this.cryptoSettings=t},s.prototype.setEnabledCollectors=function(t){this.enabledCollectors=t,this.addMandatoryCollectorsIfNeeded()},s.prototype.setEnabledCollectorsForAnonymousJourneys=function(t){this.log(n.LogLevel.Debug,(function(){return"Overriding collectors for anonymous"})),this._enabledCollectorsAnonymous=t,this.addMandatoryCollectorsForAnonymousIfNeeded()},s.prototype.setLogLevel=function(t){this._logLevel=t,this._nativeHost.setLogLevel(this._logLevel)},s.prototype.setExternalLogger=function(t){this._nativeHost.setExternalLogger(t)},s.prototype.setTransportProvider=function(t){this.transportProvider=t},s.prototype.setUiHandler=function(t){this.currentUiHandler=t},s.prototype.setPushToken=function(t){this._lastReceivedPushToken=t},s.prototype.setPersistUserData=function(t){this.currentPersistUserData=t},s.prototype.setInvalidUserRecordRecoveryMode=function(t){if(null!=this.invalidUserRecoveryMode&&this.invalidUserRecoveryMode!=t)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Duplicate invocation of setInvalidUserRecordRecoveryMode.");this.invalidUserRecoveryMode=t},s.prototype.setClientApiLevel=function(e){if(null!=this._apiLevel&&this._apiLevel!=e)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Duplicate invocation of setClientApiLevel.");if(e>t.ts.mobile.sdk.core.API_LEVEL)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"This SDK does not support API level "+this.apiLevel+".");this._apiLevel=e},Object.defineProperty(s.prototype,"currentSession",{get:function(){return this._currentSession}
10,enumerable:!1,configurable:!0}),s.prototype.installPlugin=function(t,e){this.pluginManager.installPlugin(t,e)},s.prototype.initialize=function(){var t=this;return new Promise((function(e,r){if(!t.host)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without host.");if(!t.connectionSettings)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without connection settings.");if(!t.transportProvider)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to initialize SDK without transport provider.");t.cryptoSettings||(t.cryptoSettings=n.ClientCryptoSettings.create(1e4)),t.applyConfigurationDefaultsAndLogConfiguration(),t._nativeHost.initialize(t.allCollectorsSet()).then((function(e){var r=null;if(!t._wasLocaleSet){var i=t._nativeHost.getPreferredLocale(),s=t.getFullLocale(i);t.uiAssetsDownloadMode===n.UIAssetsDownloadMode.DownloadOnInit?r=t.setLocale(s).catch((function(){return!1})):t.uiAssetsData=new n.core.UIAssetsData(t,s)}return r=r||Promise.resolve(!0),Promise.all([t.pluginManager.initializePlugins(),r]).then((function(){var e=t.host.readSessionStorageKey(o);if(e){t.log(n.LogLevel.Info,(function(){return"Loading existing session from session store"}));try{t._currentSession=n.core.Session.fromJson(t,e),t.log(n.LogLevel.Debug,(function(){return"Loaded existing session for user "+(t._currentSession.user&&t._currentSession.user.displayName)}))}catch(e){t.log(n.LogLevel.Warning,(function(){return"Failed to load existing session from session store. Discarding existing session "+e+"."}))}}return!0}))})).then(e,r)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.getUsersInfo=function(){var t=[];return n.core.User.iterateUsers(this,(function(e){t.push(n.impl.UserInfoImpl.createWithUser(e))})),t},s.prototype.getUserInfo=function(t){var e=n.core.User.findUser(this,t);if(!e)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.UserNotFound,"Attempt to call getUserInfo with a non existing user.");return n.impl.UserInfoImpl.createWithUser(e)},s.prototype.isBoundForUser=function(t){var e=n.core.User.findUser(this,t);return!(!e||!e.deviceBound)},s.prototype.isBound=function(t){var e=n.core.User.findUser(this,t),r=!(!e||!e.deviceBound);return r||null!=this.host.getLastReadStorageKeyValue()?r:null},s.prototype.getBoundUserIds=function(){var t=[];return n.core.User.iterateUsers(this,(function(e){e.userId&&e.deviceBound&&t.pu
10sh(e.userId)})),t},s.prototype.getKnownUserIds=function(){var t=[];return n.core.User.iterateUsers(this,(function(e){e.userId&&(e.hasLoggedIn||e.deviceBound)&&t.push(e.userId)})),t},s.prototype.logout=function(){var t=this;return new Promise((function(e,r){if(t._currentSession)if(t._currentSession.canTerminate()){var o,i=t._currentSession.createLogoutRequest(),s=t._currentSession;t._currentSession=null,t.saveCurrentSession(),s.invalidated?(t.log(n.LogLevel.Info,(function(){return"Logging out with an invalidated session; not issuing server request."})),o=Promise.resolve(!0)):o=s.performSessionExchange(i).then((function(t){return Promise.resolve(!0)})),o.then((function(t){return n.core.Session.notifySessionObserversOnMainSessionLogout(s),t})).then(e,r)}else r(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to logout with a locked session."));else r(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"No logged in user."))})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.isTotpProvisionedForUser=function(t,e){var r=n.core.User.findUser(this,t);if(!r)return this.log(n.LogLevel.Error,(function(){return"Can not find user record for <"+t+">"})),!1;var o=new n.core.LocalSession(this,r);return n.core.totp.TotpPropertiesProcessor.createWithUserWithoutUIInteraction(r,this,o).isTotpProvisionedForGenerator(e||n.core.totp.TotpPropertiesProcessor.BACKWARD_COMPATIBILITY_DEFAULT_GENERATOR)},s.prototype.getVersionInfo=function(){return this._versionInfo||(this._versionInfo=new n.impl.VersionInfoImpl(this.host.queryHostInfo(e.sdkhost.HostInformationKey.Platform),this.host.queryHostInfo(e.sdkhost.HostInformationKey.Version))),this._versionInfo},s.prototype.resolveUserForBind=function(t){var e=n.core.User.findUser(this,t);return e||(this.log(n.LogLevel.Debug,(function(){return"bind: Creating new user "+t})),e=n.core.User.createUserWithUserId(this,t)),e},s.prototype.resumableControlFlowRequestRuntimeContext=function(t){var e=this;return{clientContext:t,sdk:this,sdkSessionManagementServices:new(function(){function t(){}return t.prototype.setCurrentSession=function(t){e._currentSession=t},Object.defineProperty(t.prototype,"lastReceivedPushToken",{get:function(){return e._lastReceivedPushToken},enumerable:!1,configurable:!0}),t.prototype.saveCurrentSession=function(){e.saveCurrentSession()},t}()),uiHandler:this.currentUiHandler}},s.prototype.internalBind=function(t,e,r,o){return this.log(n.LogLevel.Debug,(function(){return"Bind for user "+(t.userId||t.idToken)})),new n.core.BindControlFlowRequest(this.resumableControlFlowRequestRuntimeContext(r),this.getOrGenerateFlowId(o)).run(t,e)},s.prototype.bind=function(t,e,n){return this.bindWithOptions(t,e,n,null)},s.prototype.bindWithOptions=function(t,e,r,o){var i=this;return new Promise((function(n,s){var a=i.resolveUserForBind(t);return i.internalBind(a,e,r,o).then(n,s)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.deviceSupportsCryptoBinding=function(){return"true"==this.host.queryHostInfo(e.sdkhost.HostInformationKey.PersistentKeysSupported)},s.prototype.resolveUserForAuthenticate=function(t,e){var r=n.core.User.findUserWithType(this,t,e);if(!r){if(e!==n.UserHandleType.UserId)throw e===n.UserHandleType.IdToken?new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to authenticate with ID Token that is not provisioned on this device.",{uid_token:t}):new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unsupported user handle type",{user_handle_type:e});this.log(n.LogLevel.Debug,(function(){return"authenticate: Creating new user "+t})),r=n.core.User.createUserWithUserId(this,t)}return r},s.prototype.internalAuthenticate=function(t,e,r,o,i){var s=this;return this.log(n.LogLevel.Debug,(function(){return"Authenticate for user "+(t.userId||t.idToken)+" with policy "+e})),new n.core.AuthenticateControlFlowRequest(this.resumableControlFlowRequestRuntimeContext(o),this.getOrGenerateFlowId(i)).run(t,e,r).catch((function(e){return s.applyInvalidUserRecordRecovery(t.userHandle,n.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},s.prototype.authenticate=function(t,e,n,r){return this.authenticateWithOptions(t,e,n,r,null)},s.prototype.authenticateWithOptions=function(t,e,r,o,i){try{var s=this.resolveUserForAuthenticate(t,n.UserHandleType.UserId);return this.internalAuthenticate(s,e,r,o,i)}catch(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}},s.prototype.authenticateWithIdToken=function(t,e,n,r){return this.authenticateWithIdTokenWithOptions(t,e,n,r,null)},s.prototype.authenticateWithIdTokenWithOptions=function(t,e,r,o,i){try{var s=this.resolveUserForAuthenticate(t,n.UserHandleType.IdToken);return this.internalAuthenticate(s,e,r,o,i)}catch(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}},s.prototype.invokePolicy=function(t,e,n){return this.invokePolicyWithOptions(t,e,n,null)},s.prototype.invokePolicyWithOptions=function(t,e,r,o){return this.log(n.LogLevel.Debug,(function(){return"Invoke policy "+t+" for current session."})),new n.core.InvokePolicyControlFlowRequest(this.resumableControlFlowRequestRuntimeContext(r),this.getOrGenerateFlowId(o)).run(t,e)},s.prototype.startTotpSessionForUser=function(t,e,r,o){var i=this;return r=r||n.core.totp.TotpPropertiesProcessor.BACKWARD_COMPATIBILITY_DEFAULT_GENERATOR,this.log(n.LogLevel.Debug,(function(){return"Start TOTP session for user "+t+", generator "+r})),new Promise((function(s,a){i.ensureConfigured(),i.log(n.LogLevel.Debug,(function(){return"Get TOTP data for <"+t+", "+r+">"}));var c=n.core.User.findUser(i,t);if(!c)throw i.log(n.LogLevel.Error,(function(){return"Can not find user record for <"+t+">"})),new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Can not find user <"+t+">");var u=new n.core.LocalSession(i,c);n.core.totp.TotpPropertiesProcessor.createWithUserHandle(t,i,u,o).runCodeGenerationSession(r,e,o,i.currentUiHandler).then(s,a)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.totpGenerationRequestForUserFromCanonicalString=function(t,e){this.ensureConfigured(),this.log(n.LogLevel.Debug,(function(){return"Get TOTP request for <"+t+">"}));var r=n.core.User.findUser(this,t);if(!r)throw this.log(n.LogLevel.Error,(function(){return"Can not find user record for <"+t+">"})),new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Can not find user <"+t+">");var o=new n.core.LocalSession(this,r);return n.core.totp.TotpPropertiesProcessor.createWithUserWithoutUIInteraction(r,this,o).totpRequestFromCanonicalString(e)},s.prototype.startTotpSessionWithRequest=function(t,e){var r=this;return new Promise((function(o,i){r.ensureConfigured(),r.log(n.LogLevel.Debug,(function(){return"Start TOTP session for user "+t.getUserId()+", generator "+t.getGeneratorName()}
10));var s=n.core.User.findUser(r,t.getUserId());if(!s)throw r.log(n.LogLevel.Error,(function(){return"Can not find user record for <"+t.getUserId()+">"})),new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Can not find user <"+t.getUserId()+">");var a=new n.core.LocalSession(r,s);n.core.totp.TotpPropertiesProcessor.createWithUserHandle(t.getUserId(),r,a,e).runCodeGenerationSessionWithRequest(t,e,r.currentUiHandler).then(o,i)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.startDeviceManagementSession=function(t){var e=this;return new Promise((function(r,o){e.ensureConfigured(),e.runWithCurrentSession((function(r){return e.log(n.LogLevel.Debug,(function(){return"User in current session: "+r.user.displayName})),new n.core.DeviceManagementSessionProcessor(e,r,t).run()})).then((function(t){switch(t){case n.core.DeviceManagementSessionProcessorReturnReason.CurrentDeviceDeleted:var r=e._currentSession&&e._currentSession.user;return e.log(n.LogLevel.Debug,(function(){return"Invalidating current session after deletion of current device."})),e._currentSession=null,e.saveCurrentSession(),r?(e.log(n.LogLevel.Debug,(function(){return"Clearing data for current user ("+r.displayName+") after deletion of current device."})),e.clearDataForUser(r.userHandle)):e.log(n.LogLevel.Warning,(function(){return"No current user after deletion of current device; not clearing sesison."})),!0;case n.core.DeviceManagementSessionProcessorReturnReason.FinishSession:return!0}})).then(r,o)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.startAuthenticationConfiguration=function(t){var e=this;return this.log(n.LogLevel.Debug,(function(){return"Start authentication configuration for current session"})),new Promise((function(r,o){e.ensureConfigured(),e.runWithCurrentSession((function(r){return e.log(n.LogLevel.Debug,(function(){return"User in current session: "+r.user.displayName})),new n.core.AuthenticationConfigurationSessionProcessor(e,r,t).run()})).then(r,o)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.startAuthenticationConfigurationWithToken=function(t,e){var r=this;return this.log(n.LogLevel.Debug,(function(){return"Start approval for provided session token"})),new Promise((function(o,i){r.ensureConfigured(),r.runWithCurrentSession((function(o){return r.log(n.LogLevel.Debug,(function(){return"User in current session: "+o.user.displayName})),new n.core.AuthenticationConfigurationSessionProcessor(r,o,e,t).run()})).then(o,i)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.startApprovalsSessionForCurrentSession=function(t){var e=this;return this.log(n.LogLevel.Debug,(function(){return"Start approval for current session"})),new Promise((function(r,o){e.ensureConfigured(),e.runWithCurrentSession((function(r){return e.log(n.LogLevel.Debug,(function(){return"User in current session: "+r.user.displayName})),new n.core.ApprovalSessionProcessor(e,r,t).run()})).then(r,o)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.startApprovalsSessionForPushedRequest=function(t,e){return this.startApprovalsSessionForPushedRequestWithOptions(t,e,null)},s.prototype.startApprovalsSessionForPushedRequestWithOptions=function(t,e,r){var o=this;return this.log(n.LogLevel.Debug,(function(){return"Start approval for push request"})),new Promise((function(r,i){if(o.ensureConfigured(),!t.userId())return t.ticket()?void i(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Mobile approval push by ticket not yet implemented.")):void i(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Unknown mobile approval push request."));o.log(n.LogLevel.Debug,(function(){return"startApprovalsSessionForPushedRequest with userid "+t.userId()}));var s=o.lookupBoundUser(t.userId()),a=new n.core.Session(o,s);new n.core.ApprovalSessionProcessor(o,a,e).run().then(r,i)})).catch((function(t){return Promise.reject(n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},s.prototype.invokeAnonymousPolicy=function(t,e,n){return this.invokeAnonymousPolicyWithOptions(t,e,n,null)},s.prototype.invokeAnonymousPolicyWithOptions=function(t,e,r,o){return this.log(n.LogLevel.Debug,(function(){return"Start anonymous policy "+t})),new n.core.InvokeAnonymousPolicyControlFlowRequest(this.resumableControlFlowRequestRuntimeContext(r),this.getOrGenerateFlowId(o)).run(t,e)},s.prototype.invokeAnonymousPolicyWithInlineInvokeResponse=function(t,e){return this.log(n.LogLevel.Debug,(function(){return"Start anonymous policy with inline server response"})),new n.core.InvokeAnonymousPolicyControlFlowRequest(this.resumableControlFlowRequestRuntimeContext(e),t.flow_id).run(t.inline_invoke_response)},s.prototype.cancelCurrentRunningControlFlow=function(){this.log(n.LogLevel.Debug,(function(){return"Cancel current running control flow requested."})),this._currentSession?this._currentSession.cancelCurrentControlFlow():this.log(n.LogLevel.Error,(function(){return"No current session"}))},s.prototype.ensureConfigured=function(){if(!this.currentUiHandler)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to start authentication without a registered UIHandler.")},s.prototype.getAppGlobalUIContext=function(){return this._appGlobalUiContext||(this._appGlobalUiContext=new n.impl.UIContextImpl(this)),this._appGlobalUiContext},s.prototype.userVaultExists=function(t,e){return n.UserVault.exists(this,t,e)},s.prototype.readUserVault=function(t,e,r){var o=this;return new Promise((function(i,s){n.UserVault.open(o,t,e).readData(r).then(i,s)}))},s.prototype.writeUserVault=function(t,e,r,o){var i=this;return new Promise((function(s,a){n.UserVault.open(i,t,e).writeData(r,o).then((function(){return s(!0)}),a)}))},s.prototype.saveCurrentSession=function(){this._currentSession?this.host.writeSessionStorageKey(o,this._currentSession.toJson()):this.host.deleteSessionStorageKey(o)},s.prototype.runWithCurrentSession=function(t){var e=this;if(!this._currentSession)return Promise.reject(new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.SessionRequired,"Operation requires an active session."));var r=this._currentSession;return r.lock(),t(r).finally((function(){r.unlock(),e.saveCurrentSession()}))},s.prototype.log=function(t,e){this._nativeHost.log(t,"TransmitSDK/Tarsus",e())},s.prototype.getOrGenerateFlowId=function(t){return(null==t?void 0:t.getFlowId())||this.generateFlowId()},s.prototype.generateFlowId=function(){return this.host.generateRandomHexString(64)},s.prototype.promiseCollectionResult=function(t){var e=this;return void 0===t&&(t=null),this._nativeHost.promiseCollectionResult(t).then((function(n){return null!=t?e.addTarsusCollectedData(n,t):e.addTarsusCollectedData(n,e.enabledCollectors)})).then((function(t){return e.addFingerprintActionTokenToCollectionResult(t).catch((function(r){return e.log(n.LogLevel.Error,(function(){return"Unexpected err while trying to add fingerprint action token: "+r})),t}))}))},s.prototype.addFingerprintActionTokenToCollectionResult=function(t){return $(this,void 0,void 0,(function(){var e,n;return Y(this,(function(r){switch(r.label){case 0:return e=t.toJson(),[4,s.acpExtensionPoint.firstNonNull((function(t){return t.getActionToken("flexid_journey_init",null,null)}))];
10case 1:return(n=r.sent())&&(e.metadata.action_token=n.getActionToken()),[2,new a(e)]}}))}))},s.prototype.getClientFeatureSet=function(){var t,r=this.host.queryHostInfo(e.sdkhost.HostInformationKey.HostProvidedFeatures);return t=r&&r.length?r.split(",").map((function(t){return parseInt(t)})):[],"true"==this.host.queryHostInfo(e.sdkhost.HostInformationKey.DeviceBiometricsFPContinuation)&&t.push(e.sdkhost.FeatureDeviceBiometricsFPContinuation),n.core.STATIC_FEATURE_SET.concat(t)},s.prototype.clearDataForUser=function(t){try{if(this.log(n.LogLevel.Debug,(function(){return"Delete data for user "+t+"."})),this._currentSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to call clearDataForUser with an active primary ongoing session.");var e=n.core.User.findUser(this,t);if(!e)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to call clearDataForUser with a non existing user.");try{this.host.deleteKeyPair(e.deviceSigningKeyTag)}catch(t){this.log(n.LogLevel.Warning,(function(){return"Can't delete device signing key."}))}try{this.host.deleteKeyPair(e.deviceEncryptionKeyTag)}catch(t){this.log(n.LogLevel.Warning,(function(){return"Can't delete device encryption key."}))}try{n.core.LocalEnrollment.deleteEnrollmentsForUser(e,this)}catch(t){this.log(n.LogLevel.Warning,(function(){return"Can't delete enrollments for user."}))}var r=new n.core.LocalSession(this,e);try{n.core.totp&&n.core.totp.TotpPropertiesProcessor.createWithUserWithoutUIInteraction(e,this,r).deleteAllProvisions()}catch(t){this.log(n.LogLevel.Warning,(function(){return"Can't delete enrollments for user."}))}n.core.User.deleteUser(e,this)}catch(e){throw this.log(n.LogLevel.Warning,(function(){return"Can't delete data for user "+t+": "+e})),e}},s.prototype.clearAllData=function(){var t=this;if(this._currentSession)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to call clearAllData with an active primary ongoing session.");this.log(n.LogLevel.Debug,(function(){return"Delete all data: collecting users"}));var r=[];n.core.User.iterateUsers(this,(function(t){r.push(t.userHandle)})),this.log(n.LogLevel.Debug,(function(){return"Delete all data: deleting users"})),r.forEach((function(e){try{t.clearDataForUser(e)}catch(r){t.log(n.LogLevel.Warning,(function(){return"Error when deleting user "+e+": "+r}))}})),"true"==this.host.queryHostInfo(e.sdkhost.HostInformationKey.DyadicPresent)&&this.host.dyadicClearAllData()},s.prototype.generateDebugPinForControlFlow=function(t){var e=this;return this.log(n.LogLevel.Debug,(function(){return"generateDebugPinForMainSession: Starting"})),new Promise((function(r,o){e.ensureConfigured();var i=n.core.ControlFlowProcessor.findByClientContext(t);if(!i)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to start debugging for an unknown control flow.");i.generateDebugPin().then(r,o)}))},s.prototype.lookupBoundUser=function(t,e){var r=n.core.User.findUserWithType(this,t,e);if(!r)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to authenticate with an unknown user on this device.",{user:t});if(!r.deviceBound)throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to authenticate with an unbound user on this device.",{user:t});return r},s.prototype.addTarsusCollectedData=function(t,e){var r=this;return new Promise((function(o,i){var s=new Array,c=new Array;Object.keys(n.core.collectors.TarsusCollectors).forEach((function(t){var o=new n.core.collectors.TarsusCollectors[t].createCollector(e);o.isEnabled()&&(c.push(t),s.push(o.provide(r)))})),Promise.all(s.map((function(t){return t.catch((function(t){return new Error(t)}))}))).then((function(e){for(var i=t.toJson(),s=function(t){e[t]instanceof Error?r.log(n.LogLevel.Error,(function(){return"caught collection error "+e[t]})):(r.log(n.LogLevel.Debug,(function(){return"Tarsus collected from: "+c[t]+" "+JSON.stringify(e[t])}
10)),i.content[c[t]]=r.mergeCollectedData(e[t],i.content[c[t]]))},u=0;u<e.length;u++)s(u);o(new a(i))})).catch((function(t){i(t)}))}))},s.prototype.mergeCollectedData=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},s.prototype.addMandatoryCollectorsIfNeeded=function(){var t=this;this.mandatoryCollectors.forEach((function(e){t.enabledCollectors.indexOf(e)<0&&(t.enabledCollectors.push(e),t.log(n.LogLevel.Warning,(function(){return n.CollectorType[e]+" collector is mandatory, and will remain enabled."})))}))},s.prototype.addMandatoryCollectorsForAnonymousIfNeeded=function(){var t=this;this.mandatoryCollectorsForAnonymous.forEach((function(e){null!==t._enabledCollectorsAnonymous&&t._enabledCollectorsAnonymous.indexOf(e)<0&&(t._enabledCollectorsAnonymous.push(e),t.log(n.LogLevel.Warning,(function(){return n.CollectorType[e]+" collector is mandatory for anonymous, and will remain enabled."})))}))},s.prototype.allCollectorsSet=function(){var t=[];return this.enabledCollectors.forEach((function(e){-1==t.indexOf(e)&&t.push(e)})),this.enabledCollectorsAnonymous.forEach((function(e){-1==t.indexOf(e)&&t.push(e)})),t},s.prototype.loadUiAssetsFromServer=function(t){var e=this;try{this.log(n.LogLevel.Debug,(function(){return"Start ClientStrings request with locale: "+t}));var r=new n.core.PublicNetworkRequest(this),o=r.createClientStringsRequest(t);return r.performRequest(o).then((function(r){if(e.uiAssetsData=new n.core.UIAssetsData(e,t),r){var o=r&&r.data;if(o&&o.values)return e.uiAssetsData.setServerClientStrings(new n.core.ClientStrings(o.values)),!0;throw new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,r.error_message)}return!1}))}catch(t){return this.log(n.LogLevel.Error,(function(){return"ClientStrings general error: "+t.getMessage()})),Promise.reject(t)}},s.prototype.getFullLocale=function(t){return t&&t.indexOf("-")>=0&&(n.util.LANGUAGES[t]=t),n.util.LANGUAGES[t]||t},s.prototype.applyConfigurationDefaultsAndLogConfiguration=function(){var e=this;null==this._apiLevel&&(this._apiLevel=t.ts.mobile.sdk.core.API_LEVEL),null==this.invalidUserRecoveryMode&&(this.invalidUserRecoveryMode=this.apiLevel>=9?n.InvalidUserRecordRecoveryMode.RecoverDeviceAndBindingOnAuthenticate:n.InvalidUserRecordRecoveryMode.Disable),this.log(n.LogLevel.Debug,(function(){return"Using Client API Level "+e.apiLevel})),this.log(n.LogLevel.Debug,(function(){return"Using invalid user recovery mode "+n.InvalidUserRecordRecoveryMode[e.invalidUserRecoveryMode]}))},s.prototype.applyInvalidUserRecordRecovery=function(t,e){switch(this.invalidUserRecoveryMode){case n.InvalidUserRecordRecoveryMode.Disable:break;case n.InvalidUserRecordRecoveryMode.RecoverDeviceAndBindingOnAuthenticate:e.getErrorCode()!=n.AuthenticationErrorCode.DeviceNotFound&&e.getErrorCode()!=n.AuthenticationErrorCode.InvalidDeviceBinding||(this.log(n.LogLevel.Error,(function(){return"Resetting user record due to error "+e})),this.clearDataForUser(t),e instanceof n.impl.AuthenticationErrorImpl||(e=new n.impl.AuthenticationErrorImpl(e.getErrorCode(),e.getMessage(),e.getData())),e.setPublicProperty(n.AuthenticationErrorProperty.UserRecordDeleted,!0))}return Promise.reject(e)},s.prototype.suspendControlFlowToDefaultSuspensionContext=function(t){if(!(t instanceof n.impl.PolicyActionImpl))throw this.log(n.LogLevel.Error,(function(){return"Attempt to request continuation for an unknown PolicyAction implementation"})),new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Cannot prepare SDK for continuation in this context.");if(!(t.controlFlow&&t.controlFlow.requestContext&&t.controlFlow.requestContext instanceof n.core.ResumableControlFlowRequest))throw this.log(n.LogLevel.Error,(function(){return"Attempt to request continuation for a PolicyAction implementation without a control flow request context"})),new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.Internal,"Cannot prepare SDK for continuation in this context.");this.log(n.LogLevel.Debug,(function(){return"Preparing for continuation of "+t.controlFlow}));var e=t.controlFlow.requestContext.topmost.createContinuation(),r=new n.core.SerializationContext;r.writeObject("continuation",e),this.log(n.LogLevel.Debug,(function(){return"Storing continuation"})),this.host.writeStorageKey(i,r.serializedContent)},s.prototype.resumeSuspendedControlFlow=function(t,e,r){var o=this;return new Promise((function(t,s){o.log(n.LogLevel.Debug,(function(){return"resumeSuspendedControlFlow Fetching continuation and deleting it..."}));var a=o.host.readStorageKey(i);o.host.deleteStorageKey(i),o.log(n.LogLevel.Debug,(function(){return"Deserializing continuation"}));var c=new n.core.SerializationContext(a).readNonNullObject("continuation");o.log(n.LogLevel.Debug,(function(){return"Resuming process based on continuation"})),c.createResumableProcess(o.resumableControlFlowRequestRuntimeContext(r)).resume(c,e).then(t,s)})).catch((function(t){throw n.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)}))},s.prototype.resetCurrentSession=function(){var t=this;return new Promise((function(e,r){if(t.log(n.LogLevel.Debug,(function(){return"resetCurrentSession Invoked"})),t.log(n.LogLevel.Debug,(function(){return"resetCurrentSession will discard session"})),t._currentSession&&!t._currentSession.canTerminate())throw t.log(n.LogLevel.Error,(function(){return"resetCurrentSession Attempt to reset current session with a locked session"})),new n.impl.AuthenticationErrorImpl(n.AuthenticationErrorCode.AppImplementation,"Attempt to resetCurrentSession with a locked session.");t._currentSession=null,t.saveCurrentSession(),t.log(n.LogLevel.Debug,(function(){return"resetCurrentSession will discard continuation"})),t.host.deleteStorageKey(i),e(!0)}))},s.__tarsusInterfaceName="TransmitSDKXm",s.acpExtensionPoint=new r(e.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_ACCOUNT_PROTECTION),s}());n.TransmitSDKXmImpl=s;var a=function(){function t(t){this.theResult=t}return t.prototype.toJson=function(){return this.theResult},t}();n.CollectionResultImpl=a,n.createSdk=function(){return new s}}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function n(n){this._backgroundColor=n.backgroundColor&&new e.TSColorImpl(t.core.Protocol.unwrap(n.backgroundColor)),this._tintColor=n.tintColor&&new e.TSColorImpl(t.core.Protocol.unwrap(n.tintColor)),this._lineColor=n.lineColor&&new e.TSColorImpl(t.core.Protocol.unwrap(n.lineColor)),this._iconColor=n.iconColor&&new e.TSColorImpl(t.core.Protocol.unwrap(n.iconColor)),this._imageUrl=n.imageUrl&&t.core.Protocol.unwrap(n.imageUrl),this._fontName=n.fontName&&t.core.Protocol.unwrap(n.fontName),this._fontSize=n.fontSize&&t.core.Protocol.unwrap(n.fontSize),this._fontBold=n.fontBold&&t.core.Protocol.unwrap(n.fontBold),this._maskInput=n.maskInput&&t.core.Protocol.unwrap(n.maskInput),this._rawJson=JSON.stringify({backgroundColor:this._backgroundColor&&this._backgroundColor.getHexValue(),tintColor:this._tintColor&&this._tintColor.getHexValue(),lineColor:this._lineColor&&this._lineColor.getHexValue(),iconColor:this._iconColor&&this._iconColor.getHexValue(),imageUrl:this._imageUrl,fontName:this._fontName,fontSize:this._fontSize,fontBold:this._fontBold,maskInput:this._maskInput})}
10return n.prototype.getBackgroundColor=function(){return this._backgroundColor||null},n.prototype.getTintColor=function(){return this._tintColor||null},n.prototype.getLineColor=function(){return this._lineColor||null},n.prototype.getIconColor=function(){return this._iconColor||null},n.prototype.getImageUrl=function(){return this._imageUrl||null},n.prototype.getFontName=function(){return this._fontName||null},n.prototype.getFontSize=function(){return this._fontSize||0},n.prototype.getFontBold=function(){return this._fontBold||!1},n.prototype.getMaskInput=function(){return this._maskInput||!1},n.prototype.getRawJson=function(){return this._rawJson},n.emptyStyle=function(){return this._emptyStyle||(this._emptyStyle=new n({})),this._emptyStyle},n}();e.UIStyleImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getUserChoice=function(){return this._userChoice},e.prototype.setUserChoice=function(t){this._userChoice=t},e.create=function(e){return t.ts.mobile.sdk.impl.UnregistrationInputImpl.create(e)},e.__tarsusInterfaceName="UnregistrationInput",e}();e.UnregistrationInput=n}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n.setUserChoice(t),n},e}(t.UnregistrationInput);e.UnregistrationInputImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getUserHandle=function(){return this._user.userHandle},t.prototype.getUserHandleType=function(){return this._user.userHandleType},t.prototype.getDisplayName=function(){return this._user.displayName},t.prototype.getDeviceBound=function(){return this._user.deviceBound},t.prototype.getHasLoggedIn=function(){return this._user.hasLoggedIn},t.createWithUser=function(e){var n=new t;return n._user=e,n},t}();t.UserInfoImpl=e}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r;e=t.sdk||(t.sdk={}),n=function(){function t(){}return t.prototype.getValidCancelOptions=function(){return null},t.prototype.getValidErrorRecoveryOptions=function(t){return[e.AuthenticationErrorRecovery.ChangeAuthenticator,e.AuthenticationErrorRecovery.SelectAuthenticator,e.AuthenticationErrorRecovery.Fail,e.AuthenticationErrorRecovery.RetryAuthenticator]},t}(),r=function(){function t(t,e){this._sdk=t,this._vault=e}return t.keyPathForUserVaultNamed=function(t){return new e.core.TarsusKeyPath("user_vaults",t)},t.isValidKeyPathForUserVault=function(t){return"user_vaults"==t.component(0)},t.open=function(r,o,i){var s=e.core.User.findUser(r,o);if(!s)throw r.log(e.LogLevel.Error,(function(){return"Can not find user record for <"+o+">"})),new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.InvalidInput,"Can not find user <"+o+">");return new t(r,e.core.vault.Vault.getVaultForUserWithId(s,this.keyPathForUserVaultNamed(i),new n,r,r.currentUiHandler))},t.exists=function(t,n,r){var o=e.core.User.findUser(t,n);return o?e.core.vault.Vault.vaultExists(o,this.keyPathForUserVaultNamed(r),t):(t.log(e.LogLevel.Error,(function(){return"Can not find user record for <"+n+">"})),!1)},t.prototype.readData=function(t){var n=this,r=e.impl.PolicyActionImpl.createPseudoAction(this._sdk,"user_vault_read");return this._vault.unlock(r,t,!0).then((function(t){if(t instanceof e.core.vault.VaultUnlockResultSuccessOrFailed&&t.successful){var r=n._vault.readVaultKey(e.core.vault.Vault.noIntegrityElementKey),o=e.util.hexToBase64(r);return n._vault.lock(),o}throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid response from vault unlock operation",{result:JSON.stringify(t)})}))},t.prototype.writeData=function(t,n){var r=this,o=e.impl.PolicyActionImpl.createPseudoAction(this._sdk,"user_vault_write");return this._vault.unlock(o,n,!0).then((function(n){if(n instanceof e.core.vault.VaultUnlockResultSuccessOrFailed&&n.successful){var o=e.util.base64ToHex(t);return r._vault.writeVaultKey(e.core.vault.Vault.noIntegrityElementKey,o).then((function(){return r._vault.lock()}))}throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid response from vault unlock operation")}))},t}(),e.UserVault=r}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function e(t,e){this._sdkVersion=e,this._platformName=t}return e.prototype.getSdkVersion=function(){return this._sdkVersion},e.prototype.getTarsusVersion=function(){return t.core.TARSUS_VERSION},e.prototype.getPlatformName=function(){return this._platformName},e.prototype.getApiLevel=function(){return t.core.API_LEVEL},e}();e.VersionInfoImpl=n}(t.impl||(t.impl={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){function e(t){return parseInt(t)===t}function n(t){if(!e(t.length))return!1;for(var n=0;n<t.length;n++)if(!e(t[n])||t[n]<0||t[n]>255)return!1;return!0}function r(t,r){if(t.buffer&&ArrayBuffer.isView(t)&&"Uint8Array"===t.name)return r&&(t=t.slice?t.slice():Array.prototype.slice.call(t)),t;if(Array.isArray(t)){if(!n(t))throw new Error("Array contains invali
10d value: "+t);return new Uint8Array(t)}if(e(t.length)&&n(t))return new Uint8Array(t);throw new Error("unsupported array-like object")}function o(t){return new Uint8Array(t)}function i(t,e,n,r,o){null==r&&null==o||(t=t.slice?t.slice(r,o):Array.prototype.slice.call(t,r,o)),e.set(t,n)}var s,a={toBytes:function(t){var e=[],n=0;for(t=encodeURI(t);n<t.length;){var o=t.charCodeAt(n++);37===o?(e.push(parseInt(t.substr(n,2),16)),n+=2):e.push(o)}return r(e)},fromBytes:function(t){for(var e=0,n="";e<t.length;){var r=t[e++];if(r>127)if(r>191&&r<224){if(e>=t.length)throw new Error("UTF-8 decode: incomplete 2-byte sequence");r=(31&r)<<6|63&t[e++]}else if(r>223&&r<240){if(e+1>=t.length)throw new Error("UTF-8 decode: incomplete 3-byte sequence");r=(15&r)<<12|(63&t[e++])<<6|63&t[e++]}else{if(!(r>239&&r<248))throw new Error("UTF-8 decode: unknown multibyte start 0x"+r.toString(16)+" at index "+(e-1));if(e+2>=t.length)throw new Error("UTF-8 decode: incomplete 4-byte sequence");r=(7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++]}if(r<=65535)n+=String.fromCharCode(r);else{if(!(r<=1114111))throw new Error("UTF-8 decode: code point 0x"+r.toString(16)+" exceeds UTF-16 reach");r-=65536,n+=String.fromCharCode(r>>10|55296),n+=String.fromCharCode(1023&r|56320)}}return n}},c=(s="0123456789abcdef",{toBytes:function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(parseInt(t.substr(n,2),16));return e},fromBytes:function(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(s[(240&r)>>4]+s[15&r])}return e.join("")}}),u={16:10,24:12,32:14},l=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3
10025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],f=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,111
105438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428
10677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],v=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,18625348
1068,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],_=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],b=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,6454
1001037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],A=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],S=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,12
1001765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],w=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],I=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861
10748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function k(t){for(var e=[],n=0;n<t.length;n+=4)e.push(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]);return e}var C=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:r(e,!0)}),this._prepare()};C.prototype._prepare=function(){var t=u[this.key.length];if(null==t)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var e=0;e<=t;e++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var n,r=4*(t+1),o=this.key.length/4,i=k(this.key);for(e=0;e<o;e++)n=e>>2,this._Ke[n][e%4]=i[e],this._Kd[t-n][e%4]=i[e];for(var s,a=0,c=o;c<r;){if(s=i[o-1],i[0]^=d[s>>16&255]<<24^d[s>>8&255]<<16^d[255&s]<<8^d[s>>24&255]^l[a]<<24,a+=1,8!=o)for(e=1;e<o;e++)i[e]^=i[e-1];else{for(e=1;e<o/2;e++)i[e]^=i[e-1];s=i[o/2-1],i[o/2]^=d[255&s]^d[s>>8&255]<<8^d[s>>16&255]<<16^d[s>>24&255]<<24;for(e=o/2+1;e<o;e++)i[e]^=i[e-1]}for(e=0;e<o&&c<r;)h=c>>2,p=c%4,this._Ke[h][p]=i[e],this._Kd[t-h][p]=i[e++],c++}for(var h=1;h<t;h++)for(var p=0;p<4;p++)s=this._Kd[h][p],this._Kd[h][p]=A[s>>24&255]^S[s>>16&255]^w[s>>8&255]^I[255&s]},C.prototype.encrypt=function(t){if(16!=t.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var e=this._Ke.length-1,n=[0,0,0,0],r=k(t),i=0;i<4;i++)r[i]^=this._Ke[0][i];for(var s=1;s<e;s++){for(i=0;i<4;i++)n[i]=p[r[i]>>24&255]^f[r[(i+1)%4]>>16&255]^m[r[(i+2)%4]>>8&255]^g[255&r[(i+3)%4]]^this._Ke[s][i];r=n.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Ke[e][i],c[4*i]=255&(d[r[i]>>24&255]^a>>24),c[4*i+1]=255&(d[r[(i+1)%4]>>16&255]^a>>16),c[4*i+2]=255&(d[r[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(d[255&r[(i+3)%4]]^a);return c},C.prototype.decrypt=function(t){if(16!=t.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var e=this._Kd.length-1,n=[0,0,0,0],r=k(t),i=0;i<4;i++)r[i]^=this._Kd[0][i];for(var s=1;s<e;s++){for(i=0;i<4;i++)n[i]=v[r[i]>>24&255]^y[r[(i+3)%4]>>16&255]^_[r[(i+2)%4]>>8&255]^b[255&r[(i+1)%4]]^this._Kd[s][i];r=n.slice()}var a,c=o(16);for(i=0;i<4;i++)a=this._Kd[e][i],c[4*i]=255&(h[r[i]>>24&255]^a>>24),c[4*i+1]=255&(h[r[(i+3)%4]>>16&255]^a>>16),c[4*i+2]=255&(h[r[(i+2)%4]>>8&255]^a>>8),c[4*i+3]=255&(h[255&r[(i+1)%4]]^a);return c};var E=function t(e){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new C(e)};E.prototype.encrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=o(t.length),n=o(16),s=0;s<t.length;
10s+=16)i(t,n,0,s,s+16),i(n=this._aes.encrypt(n),e,s);return e},E.prototype.decrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=o(t.length),n=o(16),s=0;s<t.length;s+=16)i(t,n,0,s,s+16),i(n=this._aes.decrypt(n),e,s);return e};var R=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=o(16);this._lastCipherblock=r(n,!0),this._aes=new C(e)};R.prototype.encrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var e=o(t.length),n=o(16),s=0;s<t.length;s+=16){i(t,n,0,s,s+16);for(var a=0;a<16;a++)n[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(n),i(this._lastCipherblock,e,s)}return e},R.prototype.decrypt=function(t){if((t=r(t)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var e=o(t.length),n=o(16),s=0;s<t.length;s+=16){i(t,n,0,s,s+16),n=this._aes.decrypt(n);for(var a=0;a<16;a++)e[s+a]=n[a]^this._lastCipherblock[a];i(t,this._lastCipherblock,0,s,s+16)}return e};var P=function t(e,n,i){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 size)")}else n=o(16);i||(i=1),this.segmentSize=i,this._shiftRegister=r(n,!0),this._aes=new C(e)};P.prototype.encrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var e,n=r(t,!0),o=0;o<n.length;o+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var s=0;s<this.segmentSize;s++)n[o+s]^=e[s];i(this._shiftRegister,this._shiftRegister,0,this.segmentSize),i(n,this._shiftRegister,16-this.segmentSize,o,o+this.segmentSize)}return n},P.prototype.decrypt=function(t){if(t.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var e,n=r(t,!0),o=0;o<n.length;o+=this.segmentSize){e=this._aes.encrypt(this._shiftRegister);for(var s=0;s<this.segmentSize;s++)n[o+s]^=e[s];i(this._shiftRegister,this._shiftRegister,0,this.segmentSize),i(t,this._shiftRegister,16-this.segmentSize,o,o+this.segmentSize)}return n};var D=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",n){if(16!=n.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else n=o(16);this._lastPrecipher=r(n,!0),this._lastPrecipherIndex=16,this._aes=new C(e)};D.prototype.encrypt=function(t){for(var e=r(t,!0),n=0;n<e.length;n++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),e[n]^=this._lastPrecipher[this._lastPrecipherIndex++];return e},D.prototype.decrypt=D.prototype.encrypt;var T=function t(e){if(!(this instanceof t))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=o(16),this.setValue(e)):this.setBytes(e)};T.prototype.setValue=function(t){if("number"!=typeof t||parseInt(t)!=t)throw new Error("invalid counter value (must be an integer)");if(t>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var e=15;e>=0;--e)this._counter[e]=t%256,t=parseInt(t/256)},T.prototype.setBytes=function(t){if(16!=(t=r(t,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=t},T.prototype.increment=function(){for(var t=15;t>=0;t--){if(255!==this._counter[t]){this._counter[t]++;break}this._counter[t]=0}};var F=function t(e,n){if(!(this instanceof t))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",n instanceof T||(n=new T(n)),this._counter=n,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new C(e)};F.prototype.encrypt=function(t){for(var e=r(t,!0),n=0;n<e.length;n++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt
10(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),e[n]^=this._remainingCounter[this._remainingCounterIndex++];return e},F.prototype.decrypt=F.prototype.encrypt;var L={AES:C,Counter:T,ModeOfOperation:{ecb:E,cbc:R,cfb:P,ofb:D,ctr:F},utils:{hex:c,utf8:a},padding:{pkcs7:{pad:function(t){var e=16-(t=r(t,!0)).length%16,n=o(t.length+e);i(t,n);for(var s=t.length;s<n.length;s++)n[s]=e;return n},strip:function(t){if((t=r(t,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=t[t.length-1];if(e>16)throw new Error("PKCS#7 padding byte out of range");for(var n=t.length-e,s=0;s<e;s++)if(t[n+s]!==e)throw new Error("PKCS#7 invalid padding byte");var a=o(n);return i(t,a,0,0,n),a}}},_arrayTest:{coerceArray:r,createArray:o,copyArray:i}};t.aesjs&&(L._aesjs=t.aesjs),t.aesjs=L}("undefined"!=typeof window?window:f),function(t){("undefined"!=typeof window?window:void 0!==f?f:"undefined"!=typeof self?self:this).elliptic=function t(e,n,r){function o(s,a){if(!n[s]){if(!e[s]){if(!a&&m)return m();if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};e[s][0].call(u.exports,(function(t){var n=e[s][1][t];return o(n||t)}),u,u.exports,t,e,n,r)}return n[s].exports}for(var i=m,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,n){var r=n;r.version=t("../package.json").version,r.utils=t("./elliptic/utils"),r.rand=t("brorand"),r.curve=t("./elliptic/curve"),r.curves=t("./elliptic/curves"),r.ec=t("./elliptic/ec"),r.eddsa=t("./elliptic/eddsa")},{"../package.json":30,"./elliptic/curve":4,"./elliptic/curves":7,"./elliptic/ec":8,"./elliptic/eddsa":11,"./elliptic/utils":15,brorand:17}],2:[function(t,e,n){function r(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function o(t,e){this.curve=t,this.type=e,this.precomputed=null}var i=t("bn.js"),s=t("../../elliptic").utils,a=s.getNAF,c=s.getJSF,u=s.assert;e.exports=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(t,e){u(t.precomputed);var n=t._getDoubles(),r=a(e,1),o=(1<<n.step+1)-(n.step%2==0?2:1);o/=3;for(var i=[],s=0;s<r.length;s+=n.step){var c=0;for(e=s+n.step-1;e>=s;e--)c=(c<<1)+r[e];i.push(c)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=o;h>0;h--){for(s=0;s<i.length;s++)(c=i[s])===h?d=d.mixedAdd(n.points[s]):c===-h&&(d=d.mixedAdd(n.points[s].neg()));l=l.add(d)}return l.toP()},r.prototype._wnafMul=function(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var o=r.points,i=a(e,n),s=this.jpoint(null,null,null),c=i.length-1;c>=0;c--){for(e=0;c>=0&&0===i[c];c--)e++;if(c>=0&&e++,s=s.dblp(e),c<0)break;var l=i[c];u(0!==l),s="affine"===t.type?l>0?s.mixedAdd(o[l-1>>1]):s.mixedAdd(o[-l-1>>1].neg()):l>0?s.add(o[l-1>>1]):s.add(o[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},r.prototype._wnafMulAdd=function(t,e,n,r,o){for(var i=this._wnafT1,s=this._wnafT2,u=this._wnafT3,l=0,d=0;d<r;d++){var h=(k=e[d])._getNAFPoints(t);i[d]=h.wnd,s[d]=h.points}for(d=r-1;d>=1;d-=2){var p=d-1,f=d;if(1===i[p]&&1===i[f]){var m=[e[p],null,null,e[f]];0===e[p].y.cmp(e[f].y)?(m[1]=e[p].add(e[f]),m[2]=e[p].toJ().mixedAdd(e[f].neg())):0===e[p].y.cmp(e[f].y.redNeg())?(m[1]=e[p].toJ().mixedAdd(e[f]),m[2]=e[p].add(e[f].neg())):(m[1]=e[p].toJ().mixedAdd(e[f]),m[2]=e[p].toJ().mixedAdd(e[f].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=c(n[p],n[f]);l=Math.max(v[0].length,l),u[p]=new Array(l),u[f]=new Array(l);for(var y=0;y<l;y++){var _=0|v[0][y],b=0|v[1][y];u[p][y]=g[3*(_+1)+(b+1)],u[f][y]=0,s[p]=m}}else u[p]=a(n[p],i[p]),u[f]=a(n[f],i[f]),l=Math.max(u[p].length,l),l=Math.max(u[f].length,l)}var A=this.jpoint(null,null,null),S=this._wnafT4;for(d=l;d>=0;d--){for(var w=0;d>=0;){var I=!0;for(y=0;y<r;y++)S[y]=0|u[y][d],0!==S[y]&&(I=!1);if(!I)break;w++,d--}if(d>=0&&w++,A=A.dblp(w),d<0)break;for(y=0;y<r;
vendor: 22,029 bytes, line 10
10y++){var k,C=S[y];0!==C&&(C>0?k=s[y][C-1>>1]:C<0&&(k=s[y][-C-1>>1].neg()),A="affine"===k.type?A.mixedAdd(k):A.add(k))}}for(d=0;d<r;d++)s[d]=null;return o?A:A.toP()},r.BasePoint=o,o.prototype.eq=function(){throw new Error("Not implemented")},o.prototype.validate=function(){return this.curve.validate(this)},r.prototype.decodePoint=function(t,e){t=s.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?u(t[t.length-1]%2==0):7===t[0]&&u(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},o.prototype.encodeCompressed=function(t){return this.encode(t,!0)},o.prototype._encode=function(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},o.prototype.encode=function(t,e){return s.encode(this._encode(e),t)},o.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},o.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},o.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,o=0;o<e;o+=t){for(var i=0;i<t;i++)r=r.dbl();n.push(r)}return{step:t,points:n}},o.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),o=1;o<n;o++)e[o]=e[o-1].add(r);return{wnd:t,points:e}},o.prototype._getBeta=function(){return null},o.prototype.dblp=function(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}},{"../../elliptic":1,"bn.js":16}],3:[function(t,e,n){function r(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,u.call(this,"edwards",t),this.a=new a(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new a(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new a(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),l(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function o(t,e,n,r,o){u.BasePoint.call(this,t,"projective"),null===e&&null===n&&null===r?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new a(e,16),this.y=new a(n,16),this.z=r?new a(r,16):this.curve.one,this.t=o&&new a(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var i=t("../curve"),s=t("../../elliptic"),a=t("bn.js"),c=t("inherits"),u=i.base,l=s.utils.assert;c(r,u),e.exports=r,r.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},r.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},r.prototype.jpoint=function(t,e,n,r){return this.point(t,e,n,r)},r.prototype.pointFromX=function(t,e){(t=new a(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr(),r=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),i=r.redMul(o.redInvm()),s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(e&&!c||!e&&c)&&(s=s.redNeg()),this.point(t,s)},r.prototype.pointFromY=function(t,e){(t=new a(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr(),r=n.redSub(this.one),o=n.redMul(this.d).redAdd(this.one),i=r.redMul(o.redInvm());if(0===i.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=i.redSqrt();if(0!==s.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");return s.isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},r.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),n=t.y.redSqr(),r=e.redMul(this.a).redAdd(n),o=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(n)));return 0===r.cmp(o)},c(o,u.BasePoint),r.prototype.pointFromJSON=function(t){return o.fromJSON(this,t)},r.prototype.point=function(t,e,n,r){return new o(this,t,e,n,r)},o.fromJSON=function(t,e){return new o(t,e[0],e[1],e[2])},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},o.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var r=this.curve._mulA(t),o=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),i=r.redAdd(e),s=i.redSub(n),a=r.redSub(e),c=o.redMul(s),u=i.redMul(a),l=o.redMul(a),d=s.redMul(i);return this.curve.point(c,u,d,l)},o.prototype._projDbl=function(){var t,e,n,r=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),i=this.y.redSqr();if(this.curve.twisted){var s=(u=this.curve._mulA(o)).redAdd(i);if(this.zOne)t=r.redSub(o).redSub(i).redMul(s.redSub(this.curve.two)),e=s.redMul(u.redSub(i)),n=s.redSqr().redSub(s).redSub(s);else{var a=this.z.redSqr(),c=s.redSub(a).redISub(a);t=r.redSub(o).redISub(i).redMul(c),e=s.redMul(u.redSub(i)),n=s.redMul(c)}}else{var u=o.redAdd(i);a=this.curve._mulC(this.c.redMul(this.z)).redSqr(),c=u.redSub(a).redSub(a),t=this.curve._mulC(r.redISub(u)).redMul(c),e=this.curve._mulC(u).redMul(o.redISub(i)),n=u.redMul(c)}return this.curve.point(t,e,n)},o.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},o.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),n=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),r=this.t.redMul(this.curve.dd).redMul(t.t),o=this.z.redMul(t.z.redAdd(t.z)),i=n.redSub(e),s=o.redSub(r),a=o.redAdd(r),c=n.redAdd(e),u=i.redMul(s),l=a.redMul(c),d=i.redMul(c),h=s.redMul(a);return this.curve.point(u,l,h,d)},o.prototype._projAdd=function(t){var e,n,r=this.z.redMul(t.z),o=r.redSqr(),i=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(i).redMul(s),c=o.redSub(a),u=o.redAdd(a),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(s),d=r.redMul(c).redMul(l);return this.curve.twisted?(e=r.redMul(u).redMul(s.redSub(this.curve._mulA(i))),n=c.redMul(u)):(e=r.redMul(u).redMul(s.redSub(i)),n=this.curve._mulC(c).redMul(u)),this.curve.point(d,e,n)},o.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},o.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},o.prototype.mulAdd=function(t,e,n){return this.curve._wnafMulAdd(1,[this,e],[t,n],2,!1)},o.prototype.jmulAdd=function(t,e,n){return this.curve._wnafMulAdd(1,[this,e],[t,n],2,!0)},o.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},o.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()},o.prototype.getY=function(){return this.normalize(),this.y.fromRed()},o.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},o.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var n=t.clone(),r=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(r),0===this.x.cmp(e))return!0}return!1},o.prototype.toP=o.prototype.normalize,o.prototype.mixedAdd=o.prototype.add},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],4:[function(t,e,n){var r=n;r.base=t("./base"),r.short=t("./short"),r.mont=t("./mont"),r.edwards=t("./edwards")},{"./base":2,"./edwards":3,"./mont":5,"./short":6}],5:[function(t,e,n){function r(t){c.call(this,"mont",t),this.a=new s(t.a,16).toRed(this.red),this.b=new s(t.b,16).toRed(this.red),this.i4=new s(4).toRed(this.red).redInvm(),this.two=new s(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(t,e,n){c.BasePoint.call(this,t,"projective"),null===e&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new s(e,16),this.z=new s(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var i=t("../curve"),s=t("bn.js"),a=t("inherits"),c=i.base,u=t("../../elliptic").utils;a(r,c),e.exports=r,r.prototype.validate=function(t){var e=t.normalize().x,n=e.redSqr(),r=n.redMul(e).redAdd(n.redMul(this.a)).redAdd(e);return 0===r.redSqrt().redSqr().cmp(r)},a(o,c.BasePoint),r.prototype.decodePoint=function(t,e){return this.point(u.toArray(t,e),1)},r.prototype.point=function(t,e){return new o(this,t,e)},r.prototype.pointFromJSON=function(t){return o.fromJSON(this,t)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(t,e){return new o(t,e[0],e[1]||t.one)},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),n=t.redSub(e),r=t.redMul(e),o=n.redMul(e.redAdd(this.curve.a24.redMul(n)));return this.curve.point(r,o)},o.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(t,e){var n=this.x.redAdd(this.z),r=this.x.redSub(this.z),o=t.x.redAdd(t.z),i=t.x.redSub(t.z).redMul(n),s=o.redMul(r),a=e.z.redMul(i.redAdd(s).redSqr()),c=e.x.redMul(i.redISub(s).redSqr());return this.curve.point(a,c)},o.prototype.mul=function(t){for(var e=t.clone(),n=this,r=this.curve.point(null,null),o=[];0!==e.cmpn(0);e.iushrn(1))o.push(e.andln(1));for(var i=o.length-1;i>=0;i--)0===o[i]?(n=n.diffAdd(r,this),r=r.dbl()):(r=n.diffAdd(r,this),n=n.dbl());return r},o.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},o.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],6:[function(t,e,n){function r(t){l.call(this,"short",t),this.a=new c(t.a,16).toRed(this.red),this.b=new c(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function o(t,e,n,r){l.BasePoint.call(this,t,"affine"),null===e&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new c(e,16),this.y=new c(n,16),r&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function i(t,e,n,r){l.BasePoint.call(this,t,"jacobian"),null===e&&null===n&&null===r?(this.x=this.curve.one,this.y=this.curve.one,this.z=new c(0)):(this.x=new c(e,16),this.y=new c(n,16),this.z=new c(r,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var s=t("../curve"),a=t("../../elliptic"),c=t("bn.js"),u=t("inherits"),l=s.base,d=a.utils.assert;u(r,l),e.exports=r,r.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,n;if(t.beta)e=new c(t.beta,16).toRed(this.red);else{var r=this._getEndoRoots(this.p);e=(e=r[0].cmp(r[1])<0?r[0]:r[1]).toRed(this.red)}if(t.lambda)n=new c(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?n=o[0]:(n=o[1],d(0===this.g.mul(n).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:n,basis:t.basis?t.basis.map((function(t){return{a:new c(t.a,16),b:new c(t.b,16)}})):this._getEndoBasis(n)}}},r.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:c.mont(t),n=new c(2).toRed(e).redInvm(),r=n.redNeg(),o=new c(3).toRed(e).redNeg().redSqrt().redMul(n);return[r.redAdd(o).fromRed(),r.redSub(o).fromRed()]},r.prototype._getEndoBasis=function(t){for(var e,n,r,o,i,s,a,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,p=this.n.clone(),f=new c(1),m=new c(0),g=new c(0),v=new c(1),y=0;0!==h.cmpn(0);){var _=p.div(h);u=p.sub(_.mul(h)),l=g.sub(_.mul(f));var b=v.sub(_.mul(m));if(!r&&u.cmp(d)<0)e=a.neg(),n=f,r=u.neg(),o=l;else if(r&&2==++y)break;a=u,p=h,h=u,g=f,f=l,v=m,m=b}i=u.neg(),s=l;var A=r.sqr().add(o.sqr());return i.sqr().add(s.sqr()).cmp(A)>=0&&(i=e,s=n),r.negative&&(r=r.neg(),o=o.neg()),i.negative&&(i=i.neg(),s=s.neg()),[{a:r,b:o},{a:i,b:s}]},r.prototype._endoSplit=function(t){var e=this.endo.basis,n=e[0],r=e[1],o=r.b.mul(t).divRound(this.n),i=n.b.neg().mul(t).divRound(this.n),s=o.mul(n.a),a=i.mul(r.a),c=o.mul(n.b),u=i.mul(r.b);return{k1:t.sub(s).sub(a),k2:c.add(u).neg()}},r.prototype.pointFromX=function(t,e){(t=new c(t,16)).red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),r=n.redSqrt();if(0!==r.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var o=r.fromRed().isOdd();return(e&&!o||!e&&o)&&(r=r.redNeg()),this.point(t,r)},r.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,n=t.y,r=this.a.redMul(e),o=e.redSqr().redMul(e).redIAdd(r).redIAdd(this.b);return 0===n.redSqr().redISub(o).cmpn(0)},r.prototype._endoWnafMulAdd=function(t,e,n){for(var r=this._endoWnafT1,o=this._endoWnafT2,i=0;i<t.length;i++){var s=this._endoSplit(e[i]),a=t[i],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),r[2*i]=a,r[2*i+1]=c,o[2*i]=s.k1,o[2*i+1]=s.k2}for(var u=this._wnafMulAdd(1,r,o,2*i,n),l=0;l<2*i;l++)r[l]=null,o[l]=null;return u},u(o,l.BasePoint),r.prototype.point=function(t,e,n){return new o(this,t,e,n)},r.prototype.pointFromJSON=function(t,e){return o.fromJSON(this,t,e)},o.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,r=function(t){return n.point(t.x.redMul(n.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(r)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(r)}}}return e}},o.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},o.fromJSON=function(t,e,n){function r(e){return t.point(e[0],e[1],n)}"string"==typeof e&&(e=JSON.parse(e));var o=t.point(e[0],e[1],n);if(!e[2])return o;var i=e[2];return o.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[o].concat(i.doubles.points.map(r))},naf:i.naf&&{wnd:i.naf.wnd,points:[o].concat(i.naf.points.map(r))}},o},o.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},o.prototype.isInfinity=function(){return this.inf},o.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var n=e.redSqr().redISub(this.x).redISub(t.x),r=e.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,r)},o.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,n=this.x.redSqr(),r=t.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(e).redMul(r),i=o.redSqr().redISub(this.x.redAdd(this.x)),s=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},o.prototype.getX=function(){return this.x.fromRed()},o.prototype.getY=function(){return this.y.fromRed()},o.prototype.mul=function(t){return t=new c(t,16),this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},o.prototype.mulAdd=function(t,e,n){var r=[this,e],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,o):this.curve._wnafMulAdd(1,r,o,2)},o.prototype.jmulAdd=function(t,e,n){var r=[this,e],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(r,o,!0):this.curve._wnafMulAdd(1,r,o,2,!0)},o.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},o.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,r=function(t){return t.neg()};e.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(r)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(r)}}}return e},o.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},u(i,l.BasePoint),r.prototype.jpoint=function(t,e,n){return new i(this,t,e,n)},i.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),n=this.x.redMul(e),r=this.y.redMul(e).redMul(t);return this.curve.point(n,r)},i.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},i.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),n=this.z.redSqr(),r=this.x.redMul(e),o=t.x.redMul(n),i=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(n.redMul(this.z)),a=r.redSub(o),c=i.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=r.redMul(u),h=c.redSqr().redIAdd(l).redISub(d).redISub(d),p=c.redMul(d.redISub(h)).redISub(i.redMul(l)),f=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(h,p,f)},i.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),n=this.x,r=t.x.redMul(e),o=this.y,i=t.y.redMul(e).redMul(this.z),s=n.redSub(r),a=o.redSub(i);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=n.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),h=a.redMul(l.redISub(d)).redISub(o.redMul(u)),p=this.z.redMul(s);return this.curve.jpoint(d,h,p)},i.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}var r=this.curve.a,o=this.curve.tinv,i=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(n=0;n<t;n++){var l=i.redSqr(),d=u.redSqr(),h=d.redSqr(),p=l.redAdd(l).redIAdd(l).redIAdd(r.redMul(c)),f=i.redMul(d),m=p.redSqr().redISub(f.redAdd(f)),g=f.redISub(m),v=p.redMul(g);v=v.redIAdd(v).redISub(h);var y=u.redMul(a);n+1<t&&(c=c.redMul(h)),i=m,a=y,u=v}return this.curve.jpoint(i,u.redMul(o),a)},i.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},i.prototype._zeroDbl=function(){var t,e,n;if(this.zOne){var r=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(r).redISub(i);s=s.redIAdd(s);var a=r.redAdd(r).redIAdd(r),c=a.redSqr().redISub(s).redISub(s),u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),t=c,e=a.redMul(s.redISub(c)).redISub(u),n=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),p=this.x.redAdd(d).redSqr().redISub(l).redISub(h);p=p.redIAdd(p);var f=l.redAdd(l).redIAdd(l),m=f.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(p).redISub(p),e=f.redMul(p.redISub(t)).redISub(g),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(t,e,n)},i.prototype._threeDbl=function(){var t,e,n;if(this.zOne){var r=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(r).redISub(i);s=s.redIAdd(s);var a=r.redAdd(r).redIAdd(r).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);t=c;var u=i.redIAdd(i);u=(u=u.redIAdd(u)).redIAdd(u),e=a.redMul(s.redISub(c)).redISub(u),n=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),p=this.x.redSub(l).redMul(this.x.redAdd(l));p=p.redAdd(p).redIAdd(p);var f=h.redIAdd(h),m=(f=f.redIAdd(f)).redAdd(f);t=p.redSqr().redISub(m),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=p.redMul(f.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,n)},i.prototype._dbl=function(){var t=this.curve.a,e=this.x,n=this.y,r=this.z,o=r.redSqr().redSqr(),i=e.redSqr(),s=n.redSqr(),a=i.redAdd(i).redIAdd(i).redIAdd(t.redMul(o)),c=e.redAdd(e),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=a.redMul(d).redISub(h),f=n.redAdd(n).redMul(r);return this.curve.jpoint(l,p,f)},i.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
vendor: 6,475 bytes, line 10
10var t=this.x.redSqr(),e=this.y.redSqr(),n=this.z.redSqr(),r=e.redSqr(),o=t.redAdd(t).redIAdd(t),i=o.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(r),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),c=r.redIAdd(r);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=o.redIAdd(s).redSqr().redISub(i).redISub(a).redISub(c),l=e.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var p=this.z.redAdd(s).redSqr().redISub(n).redISub(a);return this.curve.jpoint(d,h,p)},i.prototype.mul=function(t,e){return t=new c(t,e),this.curve._wnafMul(this,t)},i.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),n=t.z.redSqr();if(0!==this.x.redMul(n).redISub(t.x.redMul(e)).cmpn(0))return!1;var r=e.redMul(this.z),o=n.redMul(t.z);return 0===this.y.redMul(o).redISub(t.y.redMul(r)).cmpn(0)},i.prototype.eqXToP=function(t){var e=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(n))return!0;for(var r=t.clone(),o=this.curve.redN.redMul(e);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(o),0===this.x.cmp(n))return!0}return!1},i.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},i.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":1,"../curve":4,"bn.js":16,inherits:27}],7:[function(t,e,n){function r(t){"short"===t.type?this.curve=new c.curve.short(t):"edwards"===t.type?this.curve=new c.curve.edwards(t):this.curve=new c.curve.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,u(this.g.validate(),"Invalid curve"),u(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(t,e){Object.defineProperty(s,t,{configurable:!0,enumerable:!0,get:function(){var n=new r(e);return Object.defineProperty(s,t,{configurable:!0,enumerable:!0,value:n}),n}})}var i,s=n,a=t("hash.js"),c=t("../elliptic"),u=c.utils.assert;s.PresetCurve=r,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=t("./precomputed/secp256k1")}catch(t){i=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
10,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":1,"./precomputed/secp256k1":14,"hash.js":19}],8:[function(t,n,r){function o(t){return this instanceof o?("string"==typeof t&&(c(a.curves.hasOwnProperty(t),"Unknown curve "+t),t=a.curves[t]),t instanceof a.curves.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),void(this.hash=t.hash||t.curve.hash)):new o(t)}var i=t("bn.js"),s=t("hmac-drbg"),a=t("../../elliptic"),c=a.utils.assert,u=t("./key"),l=t("./signature");n.exports=o,o.prototype.keyPair=function(t){return new u(this,t)},o.prototype.keyFromPrivate=function(t,e){return u.fromPrivate(this,t,e)},o.prototype.keyFromPublic=function(t,e){return u.fromPublic(this,t,e)},o.prototype.genKeyPair=function(t){t||(t={});for(var e=new s({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a.rand(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),r=this.n.sub(new i(2));;){var o=new i(e.generate(n));if(!(o.cmp(r)>0))return o.iaddn(1),this.keyFromPrivate(o)}},o.prototype._truncateToN=function(t,e){var n=8*t.byteLength()-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},o.prototype.sign=function(t,n,r,o){"object"==e(r)&&(o=r,r=null),o||(o={}),n=this.keyFromPrivate(n,r),t=this._truncateToN(new i(t,16));for(var a=this.n.byteLength(),c=n.getPrivate().toArray("be",a),u=t.toArray("be",a),d=new s({hash:this.hash,entropy:c,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new i(1)),p=0;;p++){var f=o.k?o.k(p):new i(d.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(h)>=0)){var m=this.g.mul(f);if(!m.isInfinity()){var g=m.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var y=f.invm(this.n).mul(v.mul(n.getPrivate()).iadd(t));if(0!==(y=y.umod(this.n)).cmpn(0)){var _=(m.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),_^=1),new l({r:v,s:y,recoveryParam:_})}}}}}},o.prototype.verify=function(t,e,n,r){t=this._truncateToN(new i(t,16)),n=this.keyFromPublic(n,r);var o=(e=new l(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),u=c.mul(t).umod(this.n),d=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),d)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(u,n.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},o.prototype.recoverPubKey=function(t,e,n,r){c((3&n)===n,"The recovery param is more than two bits"),e=new l(e,r);var o=this.n,s=new i(t),a=e.r,u=e.s,d=1&n,h=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var p=e.r.invm(o),f=o.sub(s).mul(p).umod(o),m=u.mul(p).umod(o);return this.g.mulAdd(f,a,m)},o.prototype.getKeyRecoveryParam=function(t,e,n,r){if(null!==(e=new l(e,r)).recoveryParam)return e.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(t,e,o)}catch(t){continue}if(i.eq(n))return o}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":1,"./key":9,"./signature":10,"bn.js":16,"hmac-drbg":25}],9:[function(t,e,n){function r(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var o=t("bn.js"),i=t("../../elliptic").utils.assert;e.exports=r,r.fromPublic=function(t,e,n){return e instanceof r?e:new r(t,{pub:e,pubEnc:n})},r.fromPrivate=function(t,e,n){return e instanceof r?e:new r(t,{priv:e,privEnc:n})},r.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},r.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},r.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},r.prototype._importPrivate=function(t,e){this.priv=new o(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},r.prototype._importPublic=function(t,e){return t.x||t.y?("mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y))):void(this.pub=this.ec.curve.decodePoint(t,e))},r.prototype.derive=function(t){return t.mul(this.priv).getX()},r.prototype.sign=function(t,e,n){return this.ec.sign(t,this,e,n)},r.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},r.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":1,"bn.js":16}],10:[function(t,e,n){function r(t,e){return t instanceof r?t:void(this._importDER(t,e)||(l(t.r&&t.s,"Signature without r or s"),this.r=new c(t.r,16),this.s=new c(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam))}function o(){this.place=0}function i(t,e){var n=t[e.place++];if(!(128&n))return n;for(var r=15&n,o=0,i=0,s=e.place;i<r;i++,s++)o<<=8,o|=t[s];return e.place=s,o}function s(t){for(var e=0,n=t.length-1;!t[e]&&!(128&t[e+1])&&e<n;)e++;return 0===e?t:t.slice(e)}function a(t,e){if(e<128)t.push(e);else{var n=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|n);--n;)t.push(e>>>(n<<3)&255);t.push(e)}}var c=t("bn.js"),u=t("../../elliptic").utils,l=u.assert;e.exports=r,r.prototype._importDER=function(t,e){t=u.toArray(t,e);var n=new o;if(48!==t[n.place++])return!1;if(i(t,n)+n.place!==t.length)return!1;if(2!==t[n.place++])return!1;var r=i(t,n),s=t.slice(n.place,r+n.place);if(n.place+=r,2!==t[n.place++])return!1;var a=i(t,n);if(t.length!==a+n.place)return!1;var l=t.slice(n.place,a+n.place);return 0===s[0]&&128&s[1]&&(s=s.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new c(s),this.s=new c(l),this.recoveryParam=null,!0},r.prototype.toDER=function(t){var e=this.r.toArray(),n=this.s.toArray();
vendor: 4,438 bytes, line 10
10for(128&e[0]&&(e=[0].concat(e)),128&n[0]&&(n=[0].concat(n)),e=s(e),n=s(n);!(n[0]||128&n[1]);)n=n.slice(1);var r=[2];a(r,e.length),(r=r.concat(e)).push(2),a(r,n.length);var o=r.concat(n),i=[48];return a(i,o.length),i=i.concat(o),u.encode(i,t)}},{"../../elliptic":1,"bn.js":16}],11:[function(t,e,n){function r(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof r))return new r(t);t=i.curves[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=o.sha512}var o=t("hash.js"),i=t("../../elliptic"),s=i.utils,a=s.assert,c=s.parseBytes,u=t("./key"),l=t("./signature");e.exports=r,r.prototype.sign=function(t,e){t=c(t);var n=this.keyFromSecret(e),r=this.hashInt(n.messagePrefix(),t),o=this.g.mul(r),i=this.encodePoint(o),s=this.hashInt(i,n.pubBytes(),t).mul(n.priv()),a=r.add(s).umod(this.curve.n);return this.makeSignature({R:o,S:a,Rencoded:i})},r.prototype.verify=function(t,e,n){t=c(t),e=this.makeSignature(e);var r=this.keyFromPublic(n),o=this.hashInt(e.Rencoded(),r.pubBytes(),t),i=this.g.mul(e.S());return e.R().add(r.pub().mul(o)).eq(i)},r.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return s.intFromLE(t.digest()).umod(this.curve.n)},r.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},r.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},r.prototype.makeSignature=function(t){return t instanceof l?t:new l(this,t)},r.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},r.prototype.decodePoint=function(t){var e=(t=s.parseBytes(t)).length-1,n=t.slice(0,e).concat(-129&t[e]),r=0!=(128&t[e]),o=s.intFromLE(n);return this.curve.pointFromY(o,r)},r.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},r.prototype.decodeInt=function(t){return s.intFromLE(t)},r.prototype.isPoint=function(t){return t instanceof this.pointClass}},{"../../elliptic":1,"./key":12,"./signature":13,"hash.js":19}],12:[function(t,e,n){function r(t,e){this.eddsa=t,this._secret=s(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=s(e.pub)}var o=t("../../elliptic").utils,i=o.assert,s=o.parseBytes,a=o.cachedProperty;r.fromPublic=function(t,e){return e instanceof r?e:new r(t,{pub:e})},r.fromSecret=function(t,e){return e instanceof r?e:new r(t,{secret:e})},r.prototype.secret=function(){return this._secret},a(r,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(r,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(r,"privBytes",(function(){var t=this.eddsa,e=this.hash(),n=t.encodingLength-1,r=e.slice(0,t.encodingLength);return r[0]&=248,r[n]&=127,r[n]|=64,r})),a(r,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(r,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(r,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),r.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},r.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},r.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),o.encode(this.secret(),t)},r.prototype.getPublic=function(t){return o.encode(this.pubBytes(),t)},e.exports=r},{"../../elliptic":1}],13:[function(t,n,r){function o(t,n){this.eddsa=t,"object"!=e(n)&&(n=u(n)),Array.isArray(n)&&(n={R:n.slice(0,t.encodingLength),S:n.slice(t.encodingLength)}),a(n.R&&n.S,"Signature without R or S"),t.isPoint(n.R)&&(this._R=n.R),n.S instanceof i&&(this._S=n.S),this._Rencoded=Array.isArray(n.R)?n.R:n.Rencoded,this._Sencoded=Array.isArray(n.S)?n.S:n.Sencoded}var i=t("bn.js"),s=t("../../elliptic").utils,a=s.assert,c=s.cachedProperty,u=s.parseBytes;c(o,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),c(o,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),c(o,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),c(o,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return s.encode(this.toBytes(),"hex").toUpperCase()},n.exports=o},{"../../elliptic":1,"bn.js":16}],14:[function(t,e,n){e
vendor: 18,403 bytes, line 10
10.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0
vendor: 7,738 bytes, line 10
10a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],
1015:[function(t,e,n){var r=n,o=t("bn.js"),i=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");r.assert=i,r.toArray=s.toArray,r.zero2=s.zero2,r.toHex=s.toHex,r.encode=s.encode,r.getNAF=function(t,e){for(var n=[],r=1<<e+1,o=t.clone();o.cmpn(1)>=0;){var i;if(o.isOdd()){var s=o.andln(r-1);i=s>(r>>1)-1?(r>>1)-s:s,o.isubn(i)}else i=0;n.push(i);for(var a=0!==o.cmpn(0)&&0===o.andln(r-1)?e+1:1,c=1;c<a;c++)n.push(0);o.iushrn(a)}return n},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r=0,o=0;t.cmpn(-r)>0||e.cmpn(-o)>0;){var i,s,a,c=t.andln(3)+r&3,u=e.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),i=0==(1&c)?0:3!=(a=t.andln(7)+r&7)&&5!==a||2!==u?c:-c,n[0].push(i),s=0==(1&u)?0:3!=(a=e.andln(7)+o&7)&&5!==a||2!==c?u:-u,n[1].push(s),2*r===i+1&&(r=1-r),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"==typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new o(t,"hex","le")}},{"bn.js":16,"minimalistic-assert":28,"minimalistic-crypto-utils":29}],16:[function(t,n,r){!function(n,r){function o(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function s(t,e,n){return s.isBN(t)?t:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))))}function a(t,e,n){for(var r=0,o=Math.min(t.length,n),i=e;i<o;i++){var s=t.charCodeAt(i)-48;r<<=4,r|=s>=49&&s<=54?s-49+10:s>
vendor: 6,957 bytes, line 10
10=17&&s<=22?s-17+10:15&s}return r}function c(t,e,n,r){for(var o=0,i=Math.min(t.length,n),s=e;s<i;s++){var a=t.charCodeAt(s)-48;o*=r,o+=a>=49?a-49+10:a>=17?a-17+10:a}return o}function u(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var o=0|t.words[0],i=0|e.words[0],s=o*i,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u<r;u++){for(var l=c>>>26,d=67108863&c,h=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=h;p++){var f=u-p|0;l+=(s=(o=0|t.words[f])*(i=0|e.words[p])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}function l(t,e,n){return(new d).mulp(t,e,n)}function d(t,e){this.x=t,this.y=e}function h(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function p(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function f(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function m(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function g(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function v(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else o(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function y(t){v.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}var _;"object"==e(n)?n.exports=s:r.BN=s,s.BN=s,s.wordSize=26;try{_=t("buffer").Buffer}catch(t){}s.isBN=function(t){return t instanceof s||null!==t&&"object"==e(t)&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return t.cmp(e)<0?t:e},s.prototype._init=function(t,n,r){if("number"==typeof t)return this._initNumber(t,n,r);if("object"==e(t))return this._initArray(t,n,r);"hex"===n&&(n=16),o(n===(0|n)&&n>=2&&n<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===n?this._parseHex(t,i):this._parseBase(t,n,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),n,r)},s.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(o(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},s.prototype._initArray=function(t,e,n){if(o("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,s,a=0;if("be"===n)for(r=t.length-1,i=0;r>=0;r-=3)s=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(r=0,i=0;r<t.length;r+=3)s=t[r]|t[r+1]<<8|t[r+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this.strip()},s.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,o,i=0;for(n=t.length-6,r=0;n>=e;n-=6)o=a(t,n,n+6),this.words[r]|=o<<i&67108863,this.words[r+1]|=o>>>26-i&4194303,(i+=24)>=26&&(i-=26,r++);n+6!==e&&(o=a(t,e,n+6),this.words[r]|=o<<i&67108863,this.words[r+1]|=o>>>26-i&4194303),this.strip()},s.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,o=1;o<=67108863;o*=e)r++;r--,o=o/e|0;for(var i=t.length-n,s=i%r,a=Math.min(i,i-s)+n,u=0,l=n;l<a;l+=r)u=c(t,l,l+r,e),this.imuln(o),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(t,l,t.length,e),l=0;l<s;l++)d*=e;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},s.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],S=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var r=0,i=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<r|i)).toString(16);n=0!=(i=a>>>24-r&16777215)||s!==this.length-1?b[6-c.length]+c+n:c+n,(r+=2)>=26&&(r-=26,s--)}for(0!==i&&(n=i.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var u=A[t],l=S[t];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var h=d.modn(l).toString(t);n=(d=d.idivn(l)).isZero()?h+n:b[u-h.length]+h+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}o(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return o(void 0!==_),this.toArrayLike(_,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,n){var r=this.byteLength(),i=n||Math.max(1,r);o(r<=i,"byte array longer than desired length"),o(i>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===e,u=new t(i),l=this.clone();if(c){for(a=0;!l.isZero();
vendor: 10,531 bytes, line 10
10a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<i;a++)u[a]=0}else{for(a=0;a<i-r;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[i-a-1]=s}return u},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return o(0==(this.negative|t.negative)),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return o(0==(this.negative|t.negative)),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return o(0==(this.negative|t.negative)),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){o("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var r=0;r<e;r++)this.words[r]=67108863&~this.words[r];return n>0&&(this.words[r]=~this.words[r]&67108863>>26-n),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){o("number"==typeof t&&t>=0);var n=t/26|0,r=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<r:this.words[n]&~(1<<r),this.strip()},s.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var o=0,i=0;i<r.length;i++)e=(0|n.words[i])+(0|r.words[i])+o,this.words[i]=67108863&e,o=e>>>26;for(;0!==o&&i<n.length;i++)e=(0|n.words[i])+o,this.words[i]=67108863&e,o=e>>>26;if(this.length=n.length,0!==o)this.words[this.length]=o,this.length++;else if(n!==this)for(;i<n.length;i++)this.words[i]=n.words[i];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,o=this.cmp(t);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(n=this,r=t):(n=t,r=this);for(var i=0,s=0;s<r.length;s++)i=(e=(0|n.words[s])-(0|r.words[s])+i)>>26,this.words[s]=67108863&e;for(;0!==i&&s<n.length;s++)i=(e=(0|n.words[s])+i)>>26,this.words[s]=67108863&e;if(0===i&&s<n.length&&n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this.length=Math.max(this.length,s),n!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var w=function(t,e,n){var r,o,i,s=t.words,a=e.words,c=n.words,u=0,l=0|s[0],d=8191&l,h=l>>>13,p=0|s[1],f=8191&p,m=p>>>13,g=0|s[2],v=8191&g,y=g>>>13,_=0|s[3],b=8191&_,A=_>>>13,S=0|s[4],w=8191&S,I=S>>>13,k=0|s[5],C=8191&k,E=k>>>13,R=0|s[6],P=8191&R,D=R>>>13,T=0|s[7],F=8191&T,L=T>>>13,x=0|s[8],M=8191&x,O=x>>>13,q=0|s[9],N=8191&q,U=q>>>13,K=0|a[0],B=8191&K,H=K>>>13,j=0|a[1],z=8191&j,W=j>>>13,V=0|a[2],G=8191&V,J=V>>>13,Q=0|a[3],X=8191&Q,$=Q>>>13,Y=0|a[4],Z=8191&Y,tt=Y>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,ot=0|a[6],it=8191&ot,st=ot>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,lt=0|a[8],dt=8191<,ht=lt>>>13,pt=0|a[9],ft=8191&pt,mt=pt>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(u+(r=Math.imul(d,B))|0)+((8191&(o=(o=Math.imul(d,H))+Math.imul(h,B)|0))<<13)|0;u=((i=Math.imul(h,H))+(o>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(f,B),o=(o=Math.imul(f,H))+Math.imul(m,B)|0,i=Math.imul(m,H);var vt=(u+(r=r+Math.imul(d,z)|0)|0)+((8191&(o=(o=o+Math.imul(d,W)|0)+Math.imul(h,z)|0))<<13)|0;u=((i=i+Math.imul(h,W)|0)+(o>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(v,B),o=(o=Math.imul(v,H))+Math.imul(y,B)|0,i=Math.imul(y,H),r=r+Math.imul(f,z)|0,o=(o=o+Math.imul(f,W)|0)+Math.imul(m,z)|0,i=i+Math.imul(m,W)|0;var yt=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(o=(o=o+Math.imul(d,J)|0)+Math.imul(h,G)|0))<<13)|0;u=((i=i+Math.imul(h,J)|0)+(o>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(b,B),o=(o=Math.imul(b,H))+Math.imul(A,B)|0,i=Math.imul(A,H),r=r+Math.imul(v,z)|0,o=(o=o+Math.imul(v,W)|0)+Math.imul(y,z)|0,i=i+Math.imul(y,W)|0,r=r+Math.imul(f,G)|0,o=(o=o+Math.imul(f,J)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,J)|0;var _t=(u+(r=r+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,$)|0)+Math.imul(h,X)|0))<<13)|0;u=((i=i+Math.imul(h,$)|0)+(o>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(w,B),o=(o=Math.imul(w,H))+Math.imul(I,B)|0,i=Math.imul(I,H),r=r+Math.imul(b,z)|0,o=(o=o+Math.imul(b,W)|0)+Math.imul(A,z)|0,i=i+Math.imul(A,W)|0,r=r+Math.imul(v,G)|0,o=(o=o+Math.imul(v,J)|0)+Math.imul(y,G)|0,i=i+Math.imul(y,J)|0,r=r+Math.imul(f,X)|0,o=(o=o+Math.imul(f,$)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,$)|0;var bt=(u+(r=r+Math.imul(d,Z)|0)|0)+((8191&(o=(o=o+Math.imul(d,tt)|0)+Math.imul(h,Z)|0))<<13)|0;u=((i=i+Math.imul(h,tt)|0)+(o>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(C,B),o=(o=Math.imul(C,H))+Math.imul(E,B)|0,i=Math.imul(E,H),r=r+Math.imul(w,z)|0,o=(o=o+Math.imul(w,W)|0)+Math.imul(I,z)|0,i=i+Math.imul(I,W)|0,r=r+Math.imul(b,G)|0,o=(o=o+Math.imul(b,J)|0)+Math.imul(A,G)|0,i=i+Math.imul(A,J)|0,r=r+Math.imul(v,X)|0,o=(o=o+Math.imul(v,$)|0)+Math.imul(y,X)|0,i=i+Math.imul(y,$)|0,r=r+Math.imul(f,Z)|0,o=(o=o+Math.imul(f,tt)|0)+Math.imul(m,Z)|0,i=i+Math.imul(m,tt)|0;var At=(u+(r=r+Math.imul(d,nt)|0)|0)+((8191&(o=(o=o+Math.imul(d,rt)|0)+Math.imul(h,nt)|0))<<13)|0;u=((i=i+Math.imul(h,rt)|0)+(o>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(P,B),o=(o=Math.imul(P,H))+Math.imul(D,B)|0,i=Math.imul(D,H),r=r+Math.imul(C,z)|0,o=(o=o+Math.imul(C,W)|0)+Math.imul(E,z)|0,i=i+Math.imul(E,W)|0,r=r+Math.imul(w,G)|0,o=(o=o+Math.imul(w,J)|0)+Math.imul(I,G)|0,i=i+Math.imul(I,J)|0,r=r+Math.imul(b,X)|0,o=(o=o+Math.imul(b,$)|0)+Math.imul(A,X)|0,i=i+Math.imul(A,$)|0,r=r+Math.imul(v,Z)|0,o=(o=o+Math.imul(v,tt)|0)+Math.imul(y,Z)|0,i=i+Math.imul(y,tt)|0,r=r+Math.imul(f,nt)|0,o=(o=o+Math.imul(f,rt)|0)+Math.imul(m,nt)|0,i=i+Math.imul(m,rt)|0;var St=(u+(r=r+Math.imul(d,it)|0)|0)+((8191&(o=(o=o+Math.imul(d,st)|0)+Math.imul(h,it)|0))<<13)|0;u=((i=i+Math.imul(h,st)|0)+(o>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(F,B),o=(o=Math.imul(F,H))+Math.imul(L,B)|0,i=Math.imul(L,H),r=r+Math.imul(P,z)|0,o=(o=o+Math.imul(P,W)|0)+Math.imul(D,z)|0,i=i+Math.imul(D,W)|0,r=r+Math.imul(C,G)|0,o=(o=o+Math.imul(C,J)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,J)|0,r=r+Math.imul(w,X)|0,o=(o=o+Math.imul(w,$)|0)+Math.imul(I,X)|0,i=i+Math.imul(I,$)|0,r=r+Math.imul(b,Z)|0,o=(o=o+Math.imul(b,tt)|0)+Math.imul(A,Z)|0,i=i+Math.imul(A,tt)|0,r=r+Math.imul(v,nt)|0,o=(o=o+Math.imul(v,rt)|0)+Math.imul(y,nt)|0,i=i+Math.imul(y,rt)|0,r=r+Math.imul(f,it)|0,o=(o=o+Math.imul(f,st)|0)+Math.imul(m,it)|0,i=i+Math.imul(m,st)|0;var wt=(u+(r=r+Math.imul(d,ct)|0)|0)+((8191&(o=(o=o+Math.imul(d,ut)|0)+Math.imul(h,ct)|0))<<13)|0;u=((i=i+Math.imul(h,ut)|0)+(o>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(M,B),o=(o=Math.imul(M,H))+Math.imul(O,B)|0,i=Math.imul(O,H),r=r+Math.imul(F,z)|0,o=(o=o+Math.imul(F,W)|0)+Math.imul(L,z)|0,i=i+Math.imul(L,W)|0,r=r+Math.imul(P,G)|0,o=(o=o+Math.imul(P,J)|0)+Math.imul(D,G)|0,i=i+Math.imul(D,J)|0,r=r+Math.imul(C,X)|0,o=(o=o+Math.imul(C,$)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,$)|0,r=r+Math.imul(w,Z)|0,o=(o=o+Math.imul(w,tt)|0)+Math.imul(I,Z)|0,i=i+Math.imul(I,tt)|0,r=r+Math.imul(b,nt)|0,o=(o=o+Math.imul(b,rt)|0)+Math.imul(A,nt)|0,i=i+Math.imul(A,rt)|0,r=r+Math.imul(v,it)|0,o=(o=o+Math.imul(v,st)|0)+Math.imul(y,it)|0,i=i+Math.imul(y,st)|0,r=r+Math.imul(f,ct)|0,o=(o=o+Math.imul(f,ut)|0)+Math.imul(m,ct)|0,i=i+Math.imul(m,ut)|0;var It=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(o=(o=o+Math.imul(d,ht)|0)+Math.imul(h,dt)|0))<<13)|0;u=((i=i+Math.imul(h,ht)|0)+(o>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(N,B),o=(o=Math.imul(N,H))+Math.imul(U,B)|0,i=Math.imul(U,H),r=r+Math.imul(M,z)|0,o=(o=o+Math.imul(M,W)|0)+Math.imul(O,z)|0,i=i+Math.imul(O,W)|0,r=r+Math.imul(F,G)|0,o=(o=o+Math.imul(F,J)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,J)|0,r=r+Math.imul(P,X)|0,o=(o=o+Math.imul(P,$)|0)+Math.imul(D,X)|0,i=i+Math.imul(D,$)|0,r=r+Math.imul(C,Z)|0,o=(o=o+Math.imul(C,tt)|0)+Math.imul(E,Z)|0,i=i+Math.imul(E,tt)|0,r=r+Math.imul(w,nt)|0,o=(o=o+Math.imul(w,rt)|0)+Math.imul(I,nt)|0,i=i+Math.imul(I,rt)|0,r=r+Math.imul(b,it)|0,o=(o=o+Math.imul(b,st)|0)+Math.imul(A,it)|0,i=i+Math.imul(A,st)|0,r=r+Math.imul(v,ct)|0,o=(o=o+Math.imul(v,ut)|0)+Math.imul(y,
vendor: 4,541 bytes, line 10
10ct)|0,i=i+Math.imul(y,ut)|0,r=r+Math.imul(f,dt)|0,o=(o=o+Math.imul(f,ht)|0)+Math.imul(m,dt)|0,i=i+Math.imul(m,ht)|0;var kt=(u+(r=r+Math.imul(d,ft)|0)|0)+((8191&(o=(o=o+Math.imul(d,mt)|0)+Math.imul(h,ft)|0))<<13)|0;u=((i=i+Math.imul(h,mt)|0)+(o>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(N,z),o=(o=Math.imul(N,W))+Math.imul(U,z)|0,i=Math.imul(U,W),r=r+Math.imul(M,G)|0,o=(o=o+Math.imul(M,J)|0)+Math.imul(O,G)|0,i=i+Math.imul(O,J)|0,r=r+Math.imul(F,X)|0,o=(o=o+Math.imul(F,$)|0)+Math.imul(L,X)|0,i=i+Math.imul(L,$)|0,r=r+Math.imul(P,Z)|0,o=(o=o+Math.imul(P,tt)|0)+Math.imul(D,Z)|0,i=i+Math.imul(D,tt)|0,r=r+Math.imul(C,nt)|0,o=(o=o+Math.imul(C,rt)|0)+Math.imul(E,nt)|0,i=i+Math.imul(E,rt)|0,r=r+Math.imul(w,it)|0,o=(o=o+Math.imul(w,st)|0)+Math.imul(I,it)|0,i=i+Math.imul(I,st)|0,r=r+Math.imul(b,ct)|0,o=(o=o+Math.imul(b,ut)|0)+Math.imul(A,ct)|0,i=i+Math.imul(A,ut)|0,r=r+Math.imul(v,dt)|0,o=(o=o+Math.imul(v,ht)|0)+Math.imul(y,dt)|0,i=i+Math.imul(y,ht)|0;var Ct=(u+(r=r+Math.imul(f,ft)|0)|0)+((8191&(o=(o=o+Math.imul(f,mt)|0)+Math.imul(m,ft)|0))<<13)|0;u=((i=i+Math.imul(m,mt)|0)+(o>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(N,G),o=(o=Math.imul(N,J))+Math.imul(U,G)|0,i=Math.imul(U,J),r=r+Math.imul(M,X)|0,o=(o=o+Math.imul(M,$)|0)+Math.imul(O,X)|0,i=i+Math.imul(O,$)|0,r=r+Math.imul(F,Z)|0,o=(o=o+Math.imul(F,tt)|0)+Math.imul(L,Z)|0,i=i+Math.imul(L,tt)|0,r=r+Math.imul(P,nt)|0,o=(o=o+Math.imul(P,rt)|0)+Math.imul(D,nt)|0,i=i+Math.imul(D,rt)|0,r=r+Math.imul(C,it)|0,o=(o=o+Math.imul(C,st)|0)+Math.imul(E,it)|0,i=i+Math.imul(E,st)|0,r=r+Math.imul(w,ct)|0,o=(o=o+Math.imul(w,ut)|0)+Math.imul(I,ct)|0,i=i+Math.imul(I,ut)|0,r=r+Math.imul(b,dt)|0,o=(o=o+Math.imul(b,ht)|0)+Math.imul(A,dt)|0,i=i+Math.imul(A,ht)|0;var Et=(u+(r=r+Math.imul(v,ft)|0)|0)+((8191&(o=(o=o+Math.imul(v,mt)|0)+Math.imul(y,ft)|0))<<13)|0;u=((i=i+Math.imul(y,mt)|0)+(o>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(N,X),o=(o=Math.imul(N,$))+Math.imul(U,X)|0,i=Math.imul(U,$),r=r+Math.imul(M,Z)|0,o=(o=o+Math.imul(M,tt)|0)+Math.imul(O,Z)|0,i=i+Math.imul(O,tt)|0,r=r+Math.imul(F,nt)|0,o=(o=o+Math.imul(F,rt)|0)+Math.imul(L,nt)|0,i=i+Math.imul(L,rt)|0,r=r+Math.imul(P,it)|0,o=(o=o+Math.imul(P,st)|0)+Math.imul(D,it)|0,i=i+Math.imul(D,st)|0,r=r+Math.imul(C,ct)|0,o=(o=o+Math.imul(C,ut)|0)+Math.imul(E,ct)|0,i=i+Math.imul(E,ut)|0,r=r+Math.imul(w,dt)|0,o=(o=o+Math.imul(w,ht)|0)+Math.imul(I,dt)|0,i=i+Math.imul(I,ht)|0;var Rt=(u+(r=r+Math.imul(b,ft)|0)|0)+((8191&(o=(o=o+Math.imul(b,mt)|0)+Math.imul(A,ft)|0))<<13)|0;u=((i=i+Math.imul(A,mt)|0)+(o>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(N,Z),o=(o=Math.imul(N,tt))+Math.imul(U,Z)|0,i=Math.imul(U,tt),r=r+Math.imul(M,nt)|0,o=(o=o+Math.imul(M,rt)|0)+Math.imul(O,nt)|0,i=i+Math.imul(O,rt)|0,r=r+Math.imul(F,it)|0,o=(o=o+Math.imul(F,st)|0)+Math.imul(L,it)|0,i=i+Math.imul(L,st)|0,r=r+Math.imul(P,ct)|0,o=(o=o+Math.imul(P,ut)|0)+Math.imul(D,ct)|0,i=i+Math.imul(D,ut)|0,r=r+Math.imul(C,dt)|0,o=(o=o+Math.imul(C,ht)|0)+Math.imul(E,dt)|0,i=i+Math.imul(E,ht)|0;var Pt=(u+(r=r+Math.imul(w,ft)|0)|0)+((8191&(o=(o=o+Math.imul(w,mt)|0)+Math.imul(I,ft)|0))<<13)|0;u=((i=i+Math.imul(I,mt)|0)+(o>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(N,nt),o=(o=Math.imul(N,rt))+Math.imul(U,nt)|0,i=Math.imul(U,rt),r=r+Math.imul(M,it)|0,o=(o=o+Math.imul(M,st)|0)+Math.imul(O,it)|0,i=i+Math.imul(O,st)|0,r=r+Math.imul(F,ct)|0,o=(o=o+Math.imul(F,ut)|0)+Math.imul(L,ct)|0,i=i+Math.imul(L,ut)|0,r=r+Math.imul(P,dt)|0,o=(o=o+Math.imul(P,ht)|0)+Math.imul(D,dt)|0,i=i+Math.imul(D,ht)|0;var Dt=(u+(r=r+Math.imul(C,ft)|0)|0)+((8191&(o=(o=o+Math.imul(C,mt)|0)+Math.imul(E,ft)|0))<<13)|0;u=((i=i+Math.imul(E,mt)|0)+(o>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,r=Math.imul(N,it),o=(o=Math.imul(N,st))+Math.imul(U,it)|0,i=Math.imul(U,st),r=r+Math.imul(M,ct)|0,o=(o=o+Math.imul(M,ut)|0)+Math.imul(O,ct)|0,i=i+Math.imul(O,ut)|0,r=r+Math.imul(F,dt)|0,o=(o=o+Math.imul(F,ht)|0)+Math.imul(L,dt)|0,i=i+Math.imul(L,ht)|0;var Tt=(u+(r=r+Math.imul(P,ft)|0)|0)+((8191&(o=(o=o+Math.imul(P,mt)|0)+Math.imul(D,ft)|0))<<13)|0;u=((i=i+Math.imul(D,mt)|0)+(o>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(N,ct),o=(o=Math.imul(N,ut))+Math.imul(U,ct)|0,i=Math.imul(U,ut),r=r+Math.imul(M,dt)|0,o=(o=o+Math.imul(M,ht)|0)+Math.imul(O,dt)|0,i=i+Math.imul(O,ht)|0;var Ft=(u+(r=r+Math.imul(F,ft)|0)|0)+((8191&(o=(o=o+Math.imul(F,mt)|0)+Math.imul(L,ft)|0))<<13)|0;u=((i=i+Math.imul(L,mt)|0)+(o>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,r=Math.imul(N,dt),o=(o=Math.imul(N,ht))+Math.imul(U,dt)|0,i=Math.imul(U,ht);var Lt=(u+(r=r+Math.imul(M,ft)|0)|0)+((8191&(o=(o=o+Math.imul(M,mt)|0)+Math.imul(O,ft)|0)
vendor: 19,335 bytes, line 10
10)<<13)|0;u=((i=i+Math.imul(O,mt)|0)+(o>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var xt=(u+(r=Math.imul(N,ft))|0)+((8191&(o=(o=Math.imul(N,mt))+Math.imul(U,ft)|0))<<13)|0;return u=((i=Math.imul(U,mt))+(o>>>13)|0)+(xt>>>26)|0,xt&=67108863,c[0]=gt,c[1]=vt,c[2]=yt,c[3]=_t,c[4]=bt,c[5]=At,c[6]=St,c[7]=wt,c[8]=It,c[9]=kt,c[10]=Ct,c[11]=Et,c[12]=Rt,c[13]=Pt,c[14]=Dt,c[15]=Tt,c[16]=Ft,c[17]=Lt,c[18]=xt,0!==u&&(c[19]=u,n.length++),n};Math.imul||(w=u),s.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?w(this,t,e):n<63?u(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,o=0,i=0;i<n.length-1;i++){var s=o;o=0;for(var a=67108863&r,c=Math.min(i,e.length-1),u=Math.max(0,i-t.length+1);u<=c;u++){var l=i-u,d=(0|t.words[l])*(0|e.words[u]),h=67108863&d;a=67108863&(h=h+a|0),o+=(s=(s=s+(d/67108864|0)|0)+(h>>>26)|0)>>>26,s&=67108863}n.words[i]=a,r=s,s=o}return 0!==r?n.words[i]=r:n.length--,n.strip()}(this,t,e):l(this,t,e)},d.prototype.makeRBT=function(t){for(var e=new Array(t),n=s.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},d.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,o=0;o<e;o++)r|=(1&t)<<e-o-1,t>>=1;return r},d.prototype.permute=function(t,e,n,r,o,i){for(var s=0;s<i;s++)r[s]=e[t[s]],o[s]=n[t[s]]},d.prototype.transform=function(t,e,n,r,o,i){this.permute(i,t,e,n,r,o);for(var s=1;s<o;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<o;l+=a)for(var d=c,h=u,p=0;p<s;p++){var f=n[l+p],m=r[l+p],g=n[l+p+s],v=r[l+p+s],y=d*g-h*v;v=d*v+h*g,g=y,n[l+p]=f+g,r[l+p]=m+v,n[l+p+s]=f-g,r[l+p+s]=m-v,p!==a&&(y=c*d-u*h,h=c*h+u*d,d=y)}},d.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),r=1&n,o=0;for(n=n/2|0;n;n>>>=1)o++;return 1<<o+1+r},d.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var o=t[r];t[r]=t[n-r-1],t[n-r-1]=o,o=e[r],e[r]=-e[n-r-1],e[n-r-1]=-o}},d.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var o=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&o,n=o<67108864?0:o/67108864|0}return t},d.prototype.convert13b=function(t,e,n,r){for(var i=0,s=0;s<e;s++)i+=0|t[s],n[2*s]=8191&i,i>>>=13,n[2*s+1]=8191&i,i>>>=13;for(s=2*e;s<r;++s)n[s]=0;o(0===i),o(0==(-8192&i))},d.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},d.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),o=this.makeRBT(r),i=this.stub(r),s=new Array(r),a=new Array(r),c=new Array(r),u=new Array(r),l=new Array(r),d=new Array(r),h=n.words;h.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,u,r),this.transform(s,i,a,c,r,o),this.transform(u,i,l,d,r,o);for(var p=0;p<r;p++){var f=a[p]*l[p]-c[p]*d[p];c[p]=a[p]*d[p]+c[p]*l[p],a[p]=f}return this.conjugate(a,c,r),this.transform(a,c,h,i,r,o),this.conjugate(h,i,r),this.normalize13b(h,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=new Array(this.length+t.length),l(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){o("number"==typeof t),o(t<67108864);for(var e=0,n=0;n<this.length;n++){var r=(0|this.words[n])*t,i=(67108863&r)+(67108863&e);e>>=26,e+=r/67108864|0,e+=i>>>26,this.words[n]=67108863&i}return 0!==e&&(this.words[n]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,o=n%26;e[n]=(t.words[r]&1<<o)>>>o}return e}(t);if(0===e.length)return new s(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var o=n.sqr();r<e.length;r++,o=o.sqr())0!==e[r]&&(n=n.mul(o));return n},s.prototype.iushln=function(t){o("number"==typeof t&&t>=0);var e,n=t%26,r=(t-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&i,c=(0|this.words[e])-a<<n;this.words[e]=c|s,s=a>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e<r;e++)this.words[e]=0;this.length+=r}return this.strip()},s.prototype.ishln=function(t){return o(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,n){var r;o("number"==typeof t&&t>=0),r=e?(e-e%26)/26:0;var i=t%26,s=Math.min((t-i)/26,this.length),a=67108863^67108863>>>i<<i,c=n;if(r-=s,r=Math.max(0,r),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=r);u--){var d=0|this.words[u];this.words[u]=l<<26-i|d>>>i,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,n){return o(0===this.negative),this.iushrn(t,e,n)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){o("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,r=1<<e;return!(this.length<=n||!(this.words[n]&r))},s.prototype.imaskn=function(t){o("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(o(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var r=67108863^67108863>>>e<<e;this.words[this.length-1]&=r}return this.strip()},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return o("number"==typeof t),o(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(o("number"==typeof t),o(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,n){var r,i=t.length+n;this._expand(i);var s,a=0;for(r=0;r<t.length;r++){s=(0|this.words[r+n])+a;var c=(0|t.words[r])*e;a=((s-=67108863&c)>>26)-(c/67108864|0),this.words[r+n]=67108863&s}for(;r<this.length-n;r++)a=(s=(0|this.words[r+n])+a)>>26,this.words[r+n]=67108863&s;if(0===a)return this.strip();for(o(-1===a),a=0,r=0;r<this.length;r++)a=(s=-(0|this.words[r])+a)>>26,this.words[r]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),o=t,i=0|o.words[o.length-1];0!=(n=26-this._countBits(i))&&(o=o.ushln(n),r.iushln(n),i=0|o.words[o.length-1]);var a,c=r.length-o.length;if("mod"!==e){(a=new s(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(o,1,c);0===l.negative&&(r=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var h=67108864*(0|r.words[o.length+d])+(0|r.words[o.length+d-1]);for(h=Math.min(h/i|0,67108863),r._ishlnsubmul(o,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(o,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=h)}return a&&a.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},s.prototype.divmod=function(t,e,n){return o(!t.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(r=a.div.neg()),"div"!==e&&(i=a.mod.neg(),n&&0!==i.negative&&i.iadd(t)),{div:r,mod:i}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(i=a.mod.neg(),n&&0!==i.negative&&i.isub(t)),{div:a.div,mod:i}):t.length>this.length||this.cmp(t)<0?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e);var r,i,a},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),o=t.andln(1),i=n.cmp(r);return i<0||1===o&&0===i?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){o(t<=67108863);for(var e=(1<<26)%t,n=0,r=this.length-1;r>=0;r--)n=(e*n+(0|this.words[r]))%t;return n},s.prototype.idivn=function(t){o(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var r=(0|this.words[n])+67108864*e;this.words[n]=r/t|0,e=r%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){o(0===t.negative),o(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var r=new s(1),i=new s(0),a=new s(0),c=new s(1),u=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(r.isOdd()||i.isOdd())&&(r.iadd(l),i.isub(d)),r.iushrn(1),i.iushrn(1);for(var f=0,m=1;0==(n.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(n.iushrn(f);f-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);e.cmp(n)>=0?(e.isub(n),r.isub(a),i.isub(c)):(n.isub(e),a.isub(r),c.isub(i))}return{a:a,b:c,gcd:n.iushln(u)}},s.prototype._invmp=function(t){o(0===t.negative),o(!t.isZero());var e,n=this,r=t.clone();n=0!==n.negative?n.umod(t):n.clone();for(var i=new s(1),a=new s(0),c=r.clone();n.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(n.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(n.iushrn(u);u-- >0;)i.isOdd()&&i.iadd(c),i.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);n.cmp(r)>=0?(n.isub(r),i.isub(a)):(r.isub(n),a.isub(i))}return(e=0===n.cmpn(1)?i:a).cmpn(0)<0&&e.iadd(t),e},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var o=e.cmp(n);if(o<0){var i=e;e=n,n=i}else if(0===o||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){o("number"==typeof t);var e=t%26,n=(t-e)/26,r=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=r,this;for(var i=r,s=n;0!==i&&s<this.length;s++){var a=0|this.words[s];i=(a+=i)>>>26,a&=67108863,this.words[s]=a}return 0!==i&&(this.words[s]=i,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),o(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:r<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],o=0|t.words[n];if(r!==o){r<o?e=-1:r>o&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return this.cmpn(t)<=0},s.prototype.lte=function(t){return this.cmp(t)<=0},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new v(t)},s.prototype.toRed=function(t){return o(!this.red,"Already a number in reduction context"),o(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return o(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return o(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var I={k256:null,p224:null,p192:null,p25519:null};h.prototype._tmp=function(){var t=new s(null);return t.words=new Array(Math.ceil(this.n/13)),t},h.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):n.strip(),n},h.prototype.split=function(t,e){t.iushrn(this.n,0,e)},h.prototype.imulK=function(t){return t.imul(this.k)},i(p,h),p.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),o=0;o<r;o++)e.words[o]=t.words[o];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=i&n,o=10;o<t.length;o++){var s=0|t.words[o];t.words[o-10]=(s&n)<<4|i>>>22,i=s}i>>>=22,t.words[o-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},p.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(f,h),i(m,h),i(g,h),g.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,o=67108863&r;r>>>=26,t.words[n]=o,e=r}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){if(I[t])return I[t];var e;if("k256"===t)e=new p;else if("p224"===t)e=new f;else if("p192"===t)e=new m;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new g}return I[t]=e,e},v.prototype._verify1=function(t){o(0===t.negative,"red works only with positives"),o(t.red,"red works only with red numbers")},v.prototype._verify2=function(t,e){o(0==(t.negative|e.negative),"red works only with positives"),o(t.red&&t.red===e.red,"red works only with red numbers")},v.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},v.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},v.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},v.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},v.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},v.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},v.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},v.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},v.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},v.prototype.isqr=function(t){return this.imul(t,t.clone())},v.prototype.sqr=function(t){return this.mul(t,t)},v.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(o(e%2==1),3===e){var n=this.m.add(new s(1)).iushrn(2);return this.pow(t,n)}for(var r=this.m.subn(1),i=0;!r.isZero()&&0===r.andln(1);)i++,r.iushrn(1);o(!r.isZero());var a=new s(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,r),h=this.pow(t,r.addn(1).iushrn(1)),p=this.pow(t,r),f=i;0!==p.cmp(a);){for(var m=p,g=0;0!==m.cmp(a);g++)m=m.redSqr();o(g<f);var v=this.pow(d,new s(1).iushln(f-g-1));h=h.redMul(v),d=v.redSqr(),p=p.redMul(d),f=g}return h},v.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},v.prototype.pow=function(t,e){if(e.isZero())return new s(1);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new s(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var o=n[0],i=0,a=0,c=e.bitLength()%26;for(0===c&&(c=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var d=u>>l&1;o!==n[0]&&(o=this.sqr(o)),0!==d||0!==i?(i<<=1,i|=d,(4==++a||0===r&&0===l)&&(o=this.mul(o,n[i]),a=0,i=0)):a=0}
10c=26}return o},v.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},v.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new y(t)},i(y,v),y.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},y.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},y.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},y.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=n.isub(r).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},y.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===n||n,this)},{}],17:[function(t,n,r){function o(t){this.rand=t}var i;if(n.exports=function(t){return i||(i=new o(null)),i.generate(t)},n.exports.Rand=o,o.prototype.generate=function(t){return this._rand(t)},"object"==("undefined"==typeof self?"undefined":e(self)))self.crypto&&self.crypto.getRandomValues?o.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?o.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:o.prototype._rand=function(){throw new Error("Not implemented yet")};else try{var s=t("crypto");o.prototype._rand=function(t){return s.randomBytes(t)}}catch(t){o.prototype._rand=function(t){for(var e=new Uint8Array(t),n=0;n<e.length;n++)e[n]=this.rand.getByte();return e}}},{crypto:18}],18:[function(t,e,n){},{}],19:[function(t,e,n){var r=n;r.utils=t("./hash/utils"),r.common=t("./hash/common"),r.sha=t("./hash/sha"),r.ripemd=t("./hash/ripemd"),r.hmac=t("./hash/hmac"),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},{"./hash/common":20,"./hash/hmac":21,"./hash/ripemd":22,"./hash/sha":23,"./hash/utils":24}],20:[function(t,e,n){function r(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var o=t("../hash").utils,i=o.assert;n.BlockHash=r,r.prototype.update=function(t,e){if(t=o.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=o.join32(t,0,t.length-n,this.endian);for(var r=0;r<t.length;r+=this._delta32)this._update(t,r,r+this._delta32)}return this},r.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},r.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var o=1;o<n;o++)r[o]=0;if(t<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[o++]=0;r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=t>>>24&255,r[o++]=t>>>16&255,r[o++]=t>>>8&255,r[o++]=255&t}else for(r[o++]=255&t,r[o++]=t>>>8&255,r[o++]=t>>>16&255,r[o++]=t>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i<this.padLength;i++)r[o++]=0;return r}},{"../hash":19}],21:[function(t,e,n){function r(t,e,n){return this instanceof r?(this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,void this._init(o.toArray(e,n))):new r(t,e,n)}var o=t("../hash").utils,i=o.assert;e.exports=r,r.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},r.prototype.update=function(t,e){return this.inner.update(t,e),this},r.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"../hash":19}],22:[function(t,e,n){function r(){return this instanceof r?(p.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.endian="little")):new r}function o(t,e,n,r){return t<=15?e^n^r:t<=31?e&n|~e&r:t<=47?(e|~n)^r:t<=63?e&r|n&~r:e^(n|~r)}function i(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function s(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var a=t("../hash"),c=a.utils,u=c.rotl32,l=c.sum32,d=c.sum32_3,h=c.sum32_4,p=a.common.BlockHash;c.inherits(r,p),n.ripemd160=r,r.blockSize=512,r.outSize=160,r.hmacStrength=192,r.padLength=64,r.prototype._update=function(t,e){for(var n=this.h[0],r=this.h[1],a=this.h[2],c=this.h[3],p=this.h[4],y=n,_=r,b=a,A=c,S=p,w=0;w<80;w++){var I=l(u(h(n,o(w,r,a,c),t[f[w]+e],i(w)),g[w]),p);n=p,p=c,c=u(a,10),a=r,r=I,I=l(u(h(y,o(79-w,_,b,A),t[m[w]+e],s(w)),v[w]),S),y=S,S=A,A=u(b,10),b=_,_=I}I=d(this.h[1],a,A),this.h[1]=d(this.h[2],c,S),this.h[2]=d(this.h[3],p,y),this.h[3]=d(this.h[4],n,_),this.h[4]=d(this.h[0],r,b),this.h[0]=I},r.prototype._digest=function(t){return"hex"===t?c.toHex32(this.h,"little"):c.split32(this.h,"little")};var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],v=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"../hash":19}],23:[function(t,e,n){function r(){return this instanceof r?(V.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=G,void(this.W=new Array(64))):new r}function o(){return this instanceof o?(r.call(this),void(this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])):new o}function i(){return this instanceof i?(V.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=J,void(this.W=new Array(160))):new i}function s(){return this instanceof s?(i.call(this),void(this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428])):new s}function a(){return this instanceof a?(V.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],void(this.W=new Array(80))):new a}function c(t,e,n){return t&e^~t&n}function u(t,e,n){return t&e^t&n^e&n}function l(t){return D(t,2)^D(t,13)^D(t,22)}function d(t){return D(t,6)^D(t,11)^D(t,25)}function h(t){return D(t,7)^D(t,18)^t>>>3}function p(t){return D(t,17)^D(t,19)^t>>>10}function f(t,e,n,r){return 0===t?c(e,n,r):1===t||3===t?function(t,e,n){return t^e^n}(e,n,r):2===t?u(e,n,r):void 0}function m(t,e,n,r,o,i){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function g(t,e,n,r,o,i){var s=e&r^~e&i;return s<0&&(s+=4294967296),s}function v(t,e,n,r,o,i){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function y(t,e,n,r,o,i){var s=e&r^e&i^r&i;return s<0&&(s+=4294967296),s}function _(t,e){var n=M(t,e,28)^M(e,t,2)^M(e,t,7);return n<0&&(n+=4294967296),n}function b(t,e){var n=O(t,e,28)^O(e,t,2)^O(e,t,7);return n<0&&(n+=4294967296),n}function A(t,e){var n=M(t,e,14)^M(t,e,18)^M(e,t,9);return n<0&&(n+=4294967296),n}function S(t,e){var n=O(t,e,14)^O(t,e,18)^O(e,t,9);return n<0&&(n+=4294967296),n}function w(t,e){var n=M(t,e,1)^M(t,e,8)^q(t,e,7);return n<0&&(n+=4294967296),n}function I(t,e){var n=O(t,e,1)^O(t,e,8)^N(t,e,7);return n<0&&(n+=4294967296),n}function k(t,e){var n=M(t,e,19)^M(e,t,29)^q(t,e,6);return n<0&&(n+=4294967296),n}function C(t,e){var n=O(t,e,19)^O(e,t,29)^N(t,e,6);return n<0&&(n+=4294967296),n}var E=t("../hash"),R=E.utils,P=R.assert,D=R.rotr32,T=R.rotl32,F=R.sum32,L=R.sum32_4,x=R.sum32_5,M=R.rotr64_hi,O=R.rotr64_lo,q=R.shr64_hi,N=R.shr64_lo,U=R.sum64,K=R.sum64_hi,B=R.sum64_lo,H=R.sum64_4_hi,j=R.sum64_4_lo,z=R.sum64_5_hi,W=R.sum64_5_lo,V=E.common.BlockHash,G=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
10734187,3204031479,3329325298],J=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
vendor: 6,972 bytes, line 10
101126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Q=[1518500249,1859775393,2400959708,3395469782];R.inherits(r,V),n.sha256=r,r.blockSize=512,r.outSize=256,r.hmacStrength=192,r.padLength=64,r.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=L(p(n[r-2]),n[r-7],h(n[r-15]),n[r-16]);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],m=this.h[5],g=this.h[6],v=this.h[7];for(P(this.k.length===n.length),r=0;r<n.length;r++){var y=x(v,d(f),c(f,m,g),this.k[r],n[r]),_=F(l(o),u(o,i,s));v=g,g=m,m=f,f=F(a,y),a=s,s=i,i=o,o=F(y,_)}this.h[0]=F(this.h[0],o),this.h[1]=F(this.h[1],i),this.h[2]=F(this.h[2],s),this.h[3]=F(this.h[3],a),this.h[4]=F(this.h[4],f),this.h[5]=F(this.h[5],m),this.h[6]=F(this.h[6],g),this.h[7]=F(this.h[7],v)},r.prototype._digest=function(t){return"hex"===t?R.toHex32(this.h,"big"):R.split32(this.h,"big")},R.inherits(o,r),n.sha224=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?R.toHex32(this.h.slice(0,7),"big"):R.split32(this.h.slice(0,7),"big")},R.inherits(i,V),n.sha512=i,i.blockSize=1024,i.outSize=512,i.hmacStrength=192,i.padLength=128,i.prototype._prepareBlock=function(t,e){for(var n=this.W,r=0;r<32;r++)n[r]=t[e+r];for(;r<n.length;r+=2){var o=k(n[r-4],n[r-3]),i=C(n[r-4],n[r-3]),s=n[r-14],a=n[r-13],c=w(n[r-30],n[r-29]),u=I(n[r-30],n[r-29]),l=n[r-32],d=n[r-31];n[r]=H(o,i,s,a,c,u,l,d),n[r+1]=j(o,i,s,a,c,u,l,d)}},i.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,r=this.h[0],o=this.h[1],i=this.h[2],s=this.h[3],a=this.h[4],c=this.h[5],u=this.h[6],l=this.h[7],d=this.h[8],h=this.h[9],p=this.h[10],f=this.h[11],w=this.h[12],I=this.h[13],k=this.h[14],C=this.h[15];P(this.k.length===n.length);for(var E=0;E<n.length;E+=2){var R=k,D=C,T=A(d,h),F=S(d,h),L=m(d,0,p,0,w),x=g(0,h,0,f,0,I),M=this.k[E],O=this.k[E+1],q=n[E],N=n[E+1],H=z(R,D,T,F,L,x,M,O,q,N),j=W(R,D,T,F,L,x,M,O,q,N),V=(R=_(r,o),D=b(r,o),T=v(r,0,i,0,a),F=y(0,o,0,s,0,c),K(R,D,T,F)),G=B(R,D,T,F);k=w,C=I,w=p,I=f,p=d,f=h,d=K(u,l,H,j),h=B(l,l,H,j),u=a,l=c,a=i,c=s,i=r,s=o,r=K(H,j,V,G),o=B(H,j,V,G)}U(this.h,0,r,o),U(this.h,2,i,s),U(this.h,4,a,c),U(this.h,6,u,l),U(this.h,8,d,h),U(this.h,10,p,f),U(this.h,12,w,I),U(this.h,14,k,C)},i.prototype._digest=function(t){return"hex"===t?R.toHex32(this.h,"big"):R.split32(this.h,"big")},R.inherits(s,i),n.sha384=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(t){return"hex"===t?R.toHex32(this.h.slice(0,12),"big"):R.split32(this.h.slice(0,12),"big")},R.inherits(a,V),n.sha1=a,a.blockSize=512,a.outSize=160,a.hmacStrength=80,a.padLength=64,a.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=T(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4];for(r=0;r<n.length;r++){var u=~~(r/20),l=x(T(o,5),f(u,i,s,a),c,n[r],Q[u]);c=a,a=s,s=T(i,30),i=o,o=l}this.h[0]=F(this.h[0],o),this.h[1]=F(this.h[1],i),this.h[2]=F(this.h[2],s),this.h[3]=F(this.h[3],a),this.h[4]=F(this.h[4],c)},a.prototype._digest=function(t){return"hex"===t?R.toHex32(this.h,"big"):R.split32(this.h,"big")}},{"../hash":19}],24:[function(t,e,n){function r(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function o(t){return 1===t.length?"0"+t:t}function i(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}function s(t,e){if(!t)throw new Error(e||"Assertion failed")}var a=n,c=t("inherits");a.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(var r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16))}}else for(r=0;r<t.length;r++){var o=t.charCodeAt(r),i=o>>8,s=255&o;i?n.push(i,s):n.push(s)}else for(r=0;r<t.length;r++)n[r]=0|t[r];return n},a.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=o(t[n].toString(16));return e},a.htonl=r,a.toHex32=function(t,e){for(var n="",o=0;o<t.length;o++){var s=t[o];"little"===e&&(s=r(s)),n+=i(s.toString(16))}return n},a.zero2=o,a.zero8=i,a.join32=function(t,e,n,r){var o=n-e;s(o%4==0);for(var i=new Array(o/4),a=0,c=e;a<i.length;a++,c+=4){var u;u="big"===r?t[c]<<24|t[c+1]<<16|t[c+2]<<8|t[c+3]:t[c+3]<<24|t[c+2]<<16|t[c+1]<<8|t[c],i[a]=u>>>0}return i},a.split32=function(t,e){for(var n=new Array(4*t.length),r=0,o=0;r<t.length;r++,o+=4){var i=t[r];"big"===e?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},a.rotr32=function(t,e){return t>>>e|t<<32-e},a.rotl32=function(t,e){return t<<e|t>>>32-e},a.sum32=function(t,e){return t+e>>>0},a.sum32_3=function(t,e,n){return t+e+n>>>0},a.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},a.sum32_5=function(t,e,n,r,o){return t+e+n+r+o>>>0},a.assert=s,a.inherits=c,n.sum64=function(t,e,n,r){var o=t[e],i=r+t[e+1]>>>0,s=(i<r?1:0)+n+o;t[e]=s>>>0,t[e+1]=i},n.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},n.sum64_lo=function(t,e,n,r){return e+r>>>0},n.sum64_4_hi=function(t,e,n,r,o,i,s,a){var c=0,u=e;return c+=(u=u+r>>>0)<e?1:0,c+=(u=u+i>>>0)<i?1:0,t+n+o+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},n.sum64_4_lo=function(t,e,n,r,o,i,s,a){return e+r+i+a>>>0},n.sum64_5_hi=function(t,e,n,r,o,i,s,a,c,u){var l=0,d=e;return l+=(d=d+r>>>0)<e?1:0,l+=(d=d+i>>>0)<i?1:0,l+=(d=d+a>>>0)<a?1:0,t+n+o+s+c+(l+=(d=d+u>>>0)<u?1:0)>>>0},n.sum64_5_lo=function(t,e,n,r,o,i,s,a,c,u){return e+r+i+a+u>>>0},n.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},n.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},n.shr64_hi=function(t,e,n){return t>>>n},n.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},{inherits:27}],25:[function(t,e,n){function r(t){if(!(this instanceof r))return new r(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this.reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),n=i.toArray(t.nonce,t.nonceEnc||"hex"),o=i.toArray(t.pers,t.persEnc||"hex");s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,o)}var o=t("hash.js"),i=t("minimalistic-crypto-utils"),s=t("minimalistic-assert");e.exports=r,r.prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(r),this.reseed=1,this.reseedInterval=281474976710656},r.prototype._hmac=function(){return new o.hmac(this.hash,this.K)},r.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([
101]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},r.prototype.reseed=function(t,e,n,r){"string"!=typeof e&&(r=n,n=e,e=null),t=i.toArray(t,e),n=i.toArray(n,r),s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this.reseed=1},r.prototype.generate=function(t,e,n,r){if(this.reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(r=n,n=e,e=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(n),this.reseed++,i.encode(s,e)}},{"hash.js":19,"minimalistic-assert":28,"minimalistic-crypto-utils":26}],26:[function(t,e,n){function r(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",n=0;n<t.length;n++)e+=r(t[n].toString(16));return e}var i=n;i.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)n[r]=0|t[r];return n}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16));else for(r=0;r<t.length;r++){var o=t.charCodeAt(r),i=o>>8,s=255&o;i?n.push(i,s):n.push(s)}return n},i.zero2=r,i.toHex=o,i.encode=function(t,e){return"hex"===e?o(t):t}},{}],27:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],28:[function(t,e,n){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}e.exports=r,r.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},{}],29:[function(t,e,n){function r(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",n=0;n<t.length;n++)e+=r(t[n].toString(16));return e}var i=n;i.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"!=typeof t){for(var r=0;r<t.length;r++)n[r]=0|t[r];return n}if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)n.push(parseInt(t[r]+t[r+1],16))}else for(r=0;r<t.length;r++){var o=t.charCodeAt(r),i=o>>8,s=255&o;i?n.push(i,s):n.push(s)}return n},i.zero2=r,i.toHex=o,i.encode=function(t,e){return"hex"===e?o(t):t}},{}],30:[function(t,e,n){e.exports={name:"elliptic",version:"6.4.0",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"[email protected]:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <[email protected]>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}},{}]},{},[1])(1)}(),function(t){var n="input is invalid type",r=!t.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,o="0123456789abcdef".split(""),i=[-2147483648,8388608,32768,128],s=[24,16,8,0],a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
10734187,3204031479,3329325298],c=["hex","array","digest","arrayBuffer"],u=[];!t.JS_SHA256_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!r||!t.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"===e(t)&&t.buffer&&t.buffer.constructor===ArrayBuffer});var l=function(t,e){return function(n){return new f(e,!0).update(n)[t]()}},d=function(t){var e=l("hex",t);e.create=function(){return new f(t)},e.update=function(t){return e.create().update(t)};for(var n=0;n<c.length;++n){var r=c[n];e[r]=l(r,t)}return e},h=function(t,e){return function(n,r){return new m(n,e,!0).update(r)[t]()}},p=function(t){var e=h("hex",t);e.create=function(e){return new m(e,t)},e.update=function(t,n){return e.create(t).update(n)};for(var n=0;n<c.length;++n){var r=c[n];e[r]=h(r,t)}return e};function f(t,e){e?(u[0]=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0,this.blocks=u):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}function m(t,o,i){var s,a=e(t);if("string"===a){var c,u=[],l=t.length,d=0;for(s=0;s<l;++s)(c=t.charCodeAt(s))<128?u[d++]=c:c<2048?(u[d++]=192|c>>6,u[d++]=128|63&c):c<55296||c>=57344?(u[d++]=224|c>>12,u[d++]=128|c>>6&63,u[d++]=128|63&c):(c=65536+((1023&c)<<10|1023&t.charCodeAt(++s)),u[d++]=240|c>>18,u[d++]=128|c>>12&63,u[d++]=128|c>>6&63,u[d++]=128|63&c);t=u}else{if("object"!==a)throw new Error(n);if(null===t)throw new Error(n);if(r&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||r&&ArrayBuffer.isView(t)))throw new Error(n)}t.length>64&&(t=new f(o,!0).update(t).array());var h=[],p=[];for(s=0;s<64;++s){var m=t[s]||0;h[s]=92^m,p[s]=54^m}f.call(this,o,i),this.update(p),this.oKeyPad=h,this.inner=!0,this.sharedMemory=i}f.prototype.update=function(t){if(!this.finalized){var o,i=e(t);if("string"!==i){if("object"!==i)throw new Error(n);if(null===t)throw new Error(n);if(r&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||r&&ArrayBuffer.isView(t)))throw new Error(n);o=!0}for(var a,c,u=0,l=t.length,d=this.blocks;u<l;){if(this.hashed&&(this.hashed=!1,d[0]=this.block,d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0),o)for(c=this.start;u<l&&c<64;++u)d[c>>2]|=t[u]<<s[3&c++];else for(c=this.start;u<l&&c<64;++u)(a=t.charCodeAt(u))<128?d[c>>2]|=a<<s[3&c++]:a<2048?(d[c>>2]|=(192|a>>6)<<s[3&c++],d[c>>2]|=(128|63&a)<<s[3&c++]):a<55296||a>=57344?(d[c>>2]|=(224|a>>12)<<s[3&c++],d[c>>2]|=(128|a>>6&63)<<s[3&c++],d[c>>2]|=(128|63&a)<<s[3&c++]):(a=65536+((1023&a)<<10|1023&t.charCodeAt(++u)),d[c>>2]|=(240|a>>18)<<s[3&c++],d[c>>2]|=(128|a>>12&63)<<s[3&c++],d[c>>2]|=(128|a>>6&63)<<s[3&c++],d[c>>2]|=(128|63&a)<<s[3&c++]);this.lastByteIndex=c,this.bytes+=c-this.start,c>=64?(this.block=d[16],this.start=c-64,this.hash(),this.hashed=!0):this.start=c}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},f.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=i[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},f.prototype.hash=function(){var t,e,n,r,o,i,s,c,u,l=this.h0,d=this.h1,h=this.h2,p=this.h3,f=this.h4,m=this.h5,g=this.h6,v=this.h7,y=this.blocks;for(t=16;t<64;++t)e=((o=y[t-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,n=((o=y[t-2])>>>17|o<<15)^(o>>>19|o<<13)^o>>>10,y[t]=y[t-16]+e+y[t-7]+n<<0;for(u=d&h,t=0;t<64;t+=4)this.first?(this.is224?(i=300032,v=(o=y[0]-1413257819)-150054599<<0,p=o+24177077<<0):(i=704751109,v=(o=y[0]-210244248)-1521486534<<0,p=o+143694565<<0),this.first=!1):(e=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),r=(i=l&d)^l&h^u,v=p+(o=v+(n=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&m^~f&g)+a[t]+y[t])<<0,p=o+(e+r)<<0),e=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),r=(s=p&l)^p&d^i,g=h+(o=g+(n=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&f^~v&m)+a[t+1]+y[t+1])<<0,e=((h=o+(e+r)<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),r=(c=h&p)^h&l^s,m=d+(o=m+(n=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&v^~g&f)+a[t+2]+y[t+2])<<0,e=((d=o+(e+r)<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(u=d&h)^d&p^c,f=l+(o=f+(n=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&v)+a[t+3]+y[t+3])<<0,l=o+(e+r)<<0;this.h0=this.h0+l<<0,this.h1=this.h1+d<<0,this.h2=this.h2+h<<0,this.h3=this.h3+p<<0,this.h4=this.h4+f<<0,this.h5=this.h5+m<<0,this.h6=this.h6+g<<0,this.h7=this.h7+v<<0},f.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4,s=this.h5,a=this.h6,c=this.h7,u=o[t>>28&15]+o[t>>24&15]+o[t>>20&15]+o[t>>16&15]+o[t>>12&15]+o[t>>8&15]+o[t>>4&15]+o[15&t]+o[e>>28&15]+o[e>>24&15]+o[e>>20&15]+o[e>>16&15]+o[e>>12&15]+o[e>>8&15]+o[e>>4&15]+o[15&e]+o[n>>28&15]+o[n>>24&15]+o[n>>20&15]+o[n>>16&15]+o[n>>12&15]+o[n>>8&15]+o[n>>4&15]+o[15&n]+o[r>>28&15]+o[r>>24&15]+o[r>>20&15]+o[r>>16&15]+o[r>>12&15]+o[r>>8&15]+o[r>>4&15]+o[15&r]+o[i>>28&15]+o[i>>24&15]+o[i>>20&15]+o[i>>16&15]+o[i>>12&15]+o[i>>8&15]+o[i>>4&15]+o[15&i]+o[s>>28&15]+o[s>>24&15]+o[s>>20&15]+o[s>>16&15]+o[s>>12&15]+o[s>>8&15]+o[s>>4&15]+o[15&s]+o[a>>28&15]+o[a>>
1024&15]+o[a>>20&15]+o[a>>16&15]+o[a>>12&15]+o[a>>8&15]+o[a>>4&15]+o[15&a];return this.is224||(u+=o[c>>28&15]+o[c>>24&15]+o[c>>20&15]+o[c>>16&15]+o[c>>12&15]+o[c>>8&15]+o[c>>4&15]+o[15&c]),u},f.prototype.toString=f.prototype.hex,f.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,s=this.h6,a=this.h7,c=[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,255&a),c},f.prototype.array=f.prototype.digest,f.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t},m.prototype=new f,m.prototype.finalize=function(){if(f.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();f.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),f.prototype.finalize.call(this)}};var g=d();g.sha256=g,g.sha224=d(!0),g.sha256.hmac=p(),g.sha224.hmac=p(!0),t.sha256=g.sha256,t.sha224=g.sha224}("undefined"!=typeof window?window:f),function(t){!function(t){!function(t){var e;(function(t){var n=function(){function t(t){this.flowId=t}return t.prototype.getFlowId=function(){return this.flowId},t}();t.ApprovalControlFlowExecutionContext=n;var r=function(){function t(t,n,r){this._session=n,this._sdk=t,this._clientContext=r,this._uiHandler=t.currentUiHandler,this._uiContextImpl=new e.impl.UIContextImpl(t)}return t.prototype.getUiContext=function(){return this._uiContextImpl},t.prototype.run=function(){var t=this;return this._sdk.log(e.LogLevel.Debug,(function(){return"approvals: Starting session"})),this.queryApprovalsFromServer().then((function(e){return new Promise((function(n,r){t._completeFn=n,t._rejectFn=r,t.kickStartSession(e)}))}))},t.prototype.approve=function(t,n){return this.changeApprovalStatus(t,e.MobileApprovalStatus.Approved,n)},t.prototype.deny=function(t){return this.changeApprovalStatus(t,e.MobileApprovalStatus.Denied).then((function(t){return!0}))},t.prototype.requestRefreshApprovals=function(){var t=this;return this.queryApprovalsFromServer().then((function(e){return t.updateManagedApprovals(e),!0}),(function(t){throw e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)}))},t.prototype.finishSession=function(){if(!this._appSession)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to finish a non started approval session.");this._appSession.endSession(),this._appSession=null,this._completeFn(!0)},t.prototype.kickStartSession=function(t){this._appSession=this._sdk.currentUiHandler.createApprovalsSession(this._session.user.displayName),this._appSession?(this.updateManagedApprovals(t),this._appSession.startSession(this,null,this._clientContext)):this._rejectFn(e.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTicketWaitSession."))},t.prototype.updateManagedApprovals=function(t){if(this._managedApprovals=t,!this._appSession)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to update approvals on a non started approval session.");this._appSession.setSessionApprovalsList(t)},t.prototype.queryApprovalsFromServer=function(){var t=this;this._sdk.log(e.LogLevel.Debug,(function(){return"approvals: Initiating collection"}));var n=this._sdk.promiseCollectionResult();return e.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,n.then((function(n){t._sdk.log(e.LogLevel.Debug,(function(){return"approvals: Collection done; setting up request to query approvals"}));var r=t._session.createApprovalsFetchRequest(n);return t._sdk.log(e.LogLevel.Debug,(function(){return"approvals: Sending request to query approvals"})),t._session.performSessionExchange(r).then((function(t){return t.data.approvals.map((function(t){return new e.impl.ManagedMobileApprovalImpl(t)}))}
10))})))},t.prototype.changeApprovalStatus=function(t,r,o){var i=this;return this._sdk.log(e.LogLevel.Debug,(function(){return"approval: change status of approval "+t.getApproval().getApprovalId()+" to "+r})),this._sdk.log(e.LogLevel.Debug,(function(){return"approval: Initiating request promise"})),this._sdk.promiseCollectionResult().then((function(n){return i._sdk.log(e.LogLevel.Debug,(function(){return"approval: Collection done; setting up request"})),i._session.createApprovalReplyRequest(n,t.getApproval().getApprovalId(),r)})).then((function(s){i._sdk.log(e.LogLevel.Debug,(function(){return"approval: Initiating control flow"}));var a=new n(s.getFlowId());return a.approval=t.getApproval(),i._session.startControlFlow(s,a,o||i._clientContext).then((function(e){return t.getApproval().updateStatus(r),i.updateManagedApprovals(i._managedApprovals),e}),(function(t){var n=e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t);throw i._sdk.log(e.LogLevel.Debug,(function(){return"approval: Got server error "+n})),n.getErrorCode()==e.AuthenticationErrorCode.Internal&&n.getData()&&6001==n.getData().server_error_code?(i._sdk.log(e.LogLevel.Debug,(function(){return"approval: Converting server error"})),new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.ApprovalWrongState,n.getMessage())):n}))}))},t}();t.ApprovalSessionProcessor=r})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e;(function(t){var n=function(t){function e(e,n){var r=t.call(this,e)||this;return n&&(r.flowId=n),r}return V(e,t),e.prototype.serializeTo=function(e){t.prototype.serializeTo.call(this,e),e.writePrimitive("flowId",this.flowId)},e.prototype.serializeFrom=function(e){t.prototype.serializeFrom.call(this,e),this.flowId=e.readPrimitive("flowId")},e}(t.MultiStageResumableProcessContinuation);t.ResumableControlFlowRequestContinuation=n;var r=function(e){function n(n,r){var o=e.call(this)||this;return n instanceof t.Session?o.initFromSession(n):o.serializeFrom(n),o}return V(n,e),Object.defineProperty(n.prototype,"userRecord",{get:function(){return this._userRecord},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"usedSessionJson",{get:function(){return this._sessionJson},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controlFlowContinuation",{get:function(){return this._cflowContinuation},enumerable:!1,configurable:!0}),n.prototype.createUsedSession=function(e){var n=t.User.fromUserRecord(this._userRecord,e);return t.Session.fromJsonWithUser(e,this._sessionJson,n)},n.prototype.serializeTo=function(t){t.writePrimitive("user",this._userRecord),t.writePrimitive("session",this._sessionJson),t.writeObject("cflowContinuation",this._cflowContinuation)},n.prototype.serializeFrom=function(t){this._userRecord=t.readPrimitive("user"),this._sessionJson=t.readPrimitive("session"),this._cflowContinuation=t.readObject("cflowContinuation")},n.prototype.initFromSession=function(e){this._sessionJson=e.toJson(),this._userRecord=t.User.toUserRecord(e.user),this._cflowContinuation=e.createCurrentControlFlowContinuation()},n}(t.ResumableProcessStageContinuation);t.ExecuteControlFlowStageContinuation=r;var o=function(){function t(t){this._ownerRequest=t,this._rtContext=t.rtContext}return Object.defineProperty(t.prototype,"clientContext",{get:function(){return this._rtContext.clientContext},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sdk",{get:function(){return this._rtContext.sdk},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uiHandler",{get:function(){return this._rtContext.uiHandler},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sdkSessionManagementServices",{get:function(){return this._rtContext.sdkSessionManagementServices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"session",{get:function(){return this._usedSession},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"user",{get:function(){return this._usedSession.user},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"additionalParameters",{get:function(){return this._additionalParameters}
10,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"policy",{get:function(){return this._policy},enumerable:!1,configurable:!0}),t.prototype.run=function(){return this.runOrContinue()},t.prototype.resume=function(t,n){var o=this;return new Promise((function(i,s){if(!(t instanceof r))return Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid continuation type for resume"));o.restoreParametersFromContinuation(t),o.runOrContinue(t,n).then(i,s)}))},t.prototype.restoreParametersFromContinuation=function(t){this._usedSession=t.createUsedSession(this.sdk)},t.prototype.postProcessControlFlowResult=function(t){return t},t.prototype.prepareForControlFlowExecution=function(){},t.prototype.handleControlFlowError=function(t){},t.prototype.createNextStage=function(t){return new s(this._ownerRequest,this._usedSession,t)},t.prototype.runOrContinue=function(t,n){var r=this;return this._usedSession.lock(),new Promise((function(o,i){var s;r.sdk.log(e.LogLevel.Debug,(function(){return"Running "+r.opName+" for user "+(r.user.userId||r.user.idToken)+"; continuation: "+!!t})),r.sdk.ensureConfigured(),r.prepareForControlFlowExecution(),t?(r.sdk.log(e.LogLevel.Debug,(function(){return r.opName+": Resuming control flow from continuation"})),s=r._usedSession.continueControlFlow(t.controlFlowContinuation,n,r._ownerRequest,r.clientContext)):r._inlineControlFlowInitiationServerResponse?(r.sdk.log(e.LogLevel.Debug,(function(){return r.opName+": Non continuation, starting control flow with inline server response"})),s=r._usedSession.startControlFlow(r._inlineControlFlowInitiationServerResponse,r._ownerRequest,r.clientContext)):(r.sdk.log(e.LogLevel.Debug,(function(){return r.opName+": Non continuation, starting control flow with server request"})),s=e.util.wrapPromiseWithActivityIndicator(r.uiHandler,null,r.clientContext,r.generateControlFlowRequest()).then((function(t){return r.sdk.log(e.LogLevel.Debug,(function(){return r.opName+": Starting control flow"})),r._usedSession.startControlFlow(t,r._ownerRequest,r.clientContext)}))),s.then((function(t){return o(r.postProcessControlFlowResult(t))}),(function(t){if(t.getErrorCode()==e.AuthenticationErrorCode.Internal&&t.getData()){var n=t.getData();t=e.impl.AuthenticationErrorImpl.errorForHostInternalErrorData(n)||t}r.handleControlFlowError(t),i(t)}))})).finally((function(){r._usedSession.unlock()})).catch((function(t){return Promise.reject(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))})).then((function(t){return r.createNextStage(t)}))},t.prototype.getFlowId=function(){return this._ownerRequest.getFlowId()},t}();t.ExecuteControlFlowStage=o;var i=function(n){function r(t){var e=n.call(this)||this;return t instanceof s?e.initFromProc(t):e.serializeFrom(t),e}return V(r,n),Object.defineProperty(r.prototype,"redirectionContinuation",{get:function(){return this._redirectionContinuation},enumerable:!1,configurable:!0}),r.prototype.serializeTo=function(t){t.writeObject("redirectionContinuation",this._redirectionContinuation)},r.prototype.serializeFrom=function(t){this._redirectionContinuation=t.readNonNullObject("redirectionContinuation")},r.prototype.initFromProc=function(t){var n=t.requestProcess;if(!n)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid state for requesting contination");this._redirectionContinuation=n.createContinuation()},r.prototype.createResumableProcess=function(t){return new s(t)},r=J([t.Serializable("RunRedirectsStageContinuation"),Q("design:paramtypes",[Object])],r)}(t.ResumableProcessStageContinuation),s=function(){function n(t,e,n){this._ownerRequest=t,this._rtContext=t.rtContext,this._usedSession=e||null,this._authResult=n||null;var r=n&&this._authResult.getInternalData();this._redirectData=r&&r.redirect&&r.redirect}return Object.defineProperty(n.prototype,"requestProcess",{get:function(){return this._requestProcess},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"clientContext",{get:function(){return this._rtContext.clientContext},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sdk",{get:function(){return this._rtContext.sdk}
10,enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"uiHandler",{get:function(){return this._rtContext.uiHandler},enumerable:!1,configurable:!0}),n.prototype.createContinuation=function(){return new i(this)},n.prototype.run=function(){return $(this,void 0,void 0,(function(){var n,r,o,i;return Y(this,(function(s){switch(s.label){case 0:if(!this._authResult)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid resumable control flow request state");return this._redirectData?[3,1]:[2,this._authResult];case 1:return n=this._redirectData,r=n.policy_id||null,o=n.target.user_id||n.target.token||null,[4,this.uiHandler.handlePolicyRedirect(t.Protocol.RedirectTypeMap[n.redirect_type],r,o,n.params,this.clientContext)];case 2:switch((i=s.sent()).getAdditionalParametersOverride()&&(n.params=i.getAdditionalParametersOverride()),i.getRedirectResponse()){case e.RedirectResponseType.RedirectToPolicy:return[2,this.processRedirectRequest(n)];case e.RedirectResponseType.CancelRedirect:throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.UserCanceled,"Redirection to next policy canceled.");default:throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid redirect response type.")}case 3:return[2]}}
10))}))},n.prototype.resume=function(t,n){return t instanceof i?(this._requestProcess=t.redirectionContinuation.createResumableProcess(this._rtContext),this._requestProcess.resume(t.redirectionContinuation,n)):Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid continuation type for resume"))},n.prototype.runtimeContextForCallee=function(){return{clientContext:this.clientContext,sdk:this.sdk,sdkSessionManagementServices:this._ownerRequest.rtContext.sdkSessionManagementServices,uiHandler:this.uiHandler,caller:this._ownerRequest}},n.prototype.processRedirectRequest=function(n){return $(this,void 0,void 0,(function(){var r,o,i,s,a,c,u,l,d,h,p,f=this;return Y(this,(function(m){if(!this._usedSession)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid resumable control flow request state");if(r=n.policy_id||null,o=n.params,i=this._usedSession.user,"current"==n.target.type);else if("user_id"==n.target.type){if(!(s=n.target.user_id||this._usedSession.user.userId))throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"failed to resolve user id for redirect request <"+n.redirect_type+", "+n.target.type+">");s!=this._usedSession.user.userId&&(this.sdk.log(e.LogLevel.Debug,(function(){return"User id in request is different than that of the current user <"+s+", "+f._usedSession.user.userId+">"})),i=t.User.findUser(this.sdk,s)||t.User.createUserWithUserId(this.sdk,s))}else{if("uid_token"!=n.target.type)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Unhandled redirect target type '"+n.target.type+"'");if(a=n.target.uid_hash,!(c=n.target.token||this._usedSession.user.idToken))throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"failed to resolve id token for redirect request <"+n.redirect_type+", "+n.target.type+">");c!=this._usedSession.user.idToken&&(this.sdk.log(e.LogLevel.Debug,(function(){return"Id token in request is different than that of the current user <"+c+", "+f._usedSession.user.idToken+">"})),i=a&&t.User.findUserByUidHash(this.sdk,a)||t.User.findUser(this.sdk,c)||t.User.createUserWithIdToken(this.sdk,c,a))}switch(this.sdk.log(e.LogLevel.Info,(function(){return"control flow || type:"+n.redirect_type+" policy: "+r})),(u=n.redirect_type)===t.Protocol.RedirectTypeName.RedirectTypeNameBindOrAuthenticate&&(u=i.deviceBound?t.Protocol.RedirectTypeName.RedirectTypeNameAuthenticate:t.Protocol.RedirectTypeName.RedirectTypeNameBind),l=this.runtimeContextForCallee(),u){case t.Protocol.RedirectTypeName.RedirectTypeNameAuthenticate:return d=new t.AuthenticateControlFlowRequest(l,this._ownerRequest.getFlowId()),this._requestProcess=d,[2,d.run(i,r,o)];case t.Protocol.RedirectTypeName.RedirectTypeNameBind:return h=new t.BindControlFlowRequest(l,this._ownerRequest.getFlowId()),this._requestProcess=h,[2,h.run(i,o)];case t.Protocol.RedirectTypeName.RedirectTypeNameInvokePolicy:return p=new t.InvokePolicyControlFlowRequest(l,this._ownerRequest.getFlowId()),this._requestProcess=p,[2,p.run(r,o)];default:throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Unhandled redirect type '"+n.redirect_type+"'")}}))}))},n}();t.RunRedirectsStage=s;var a=function(t){function e(e,n){var r=t.call(this,e)||this;return r._flowId=n,r}return V(e,t),Object.defineProperty(e.prototype,"topmost",{get:function(){for(var t=this;t.rtContext.caller;)t=t.rtContext.caller;return t},enumerable:!1,configurable:!0}),e.prototype.getFlowId=function(){return this._flowId},e}(t.MultiStageResumableProcess);t.ResumableControlFlowRequest=a;var c=function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return V(r,n),r.prototype.prepareForControlFlowExecution=function(){if(this.sdk.currentSession)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Attempt to start a session (bind) with a current primary active session.");this.sdkSessionManagementServices.setCurrentSession(this._usedSession)},r.prototype.handleControlFlowError=function(t){this.sdk.log(e.LogLevel.Debug,(function(){return"Clearing session after error"})),this.sdkSessionManagementServices.setCurrentSession(null),this.sdkSessionManagementServices.saveCurrentSession()},r.prototype.postProcessControlFlowResult=function(e){return this._usedSession.persistUserData&&t.User.save(this.sdk,this._usedSession.user),this.sdkSessionManagementServices.saveCurrentSession(),t.Session.notifySessionObserversOnMainSessionLogin(this._usedSession),e},r.prototype.createNextStage=function(t){return new l(this._ownerRequest,this._usedSession,t)},r}(o);t.SessionSetupExecuteControlFlowStage=c;var u=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.createResumableProcess=function(t){return new l(t)},n=J([t.Serializable("SessionSetupProcessRedirectsStageContination")],n)}(i),l=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.resume=function(e,n){var r=this;return t.prototype.resume.call(this,e,n).catch((function(t){return r.handleRedirectionError(t)}))},n.prototype.processRedirectRequest=function(e){var n=this;
10return t.prototype.processRedirectRequest.call(this,e).catch((function(t){return n.handleRedirectionError(t)}))},n.prototype.createContinuation=function(){return new u(this)},n.prototype.handleRedirectionError=function(t){return this.sdk.apiLevel>=10?(this.sdk.log(e.LogLevel.Debug,(function(){return"Error in redirect after session establishing call. Logging out session."})),this.sdk.logout().then((function(e){throw t}),(function(e){throw t}))):Promise.reject(t)},n}(s);t.SessionSetupRunRedirectsStage=l;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e}(a);t.SessionSetupResumableControlFlowRequest=d})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.createResumableProcess=function(t){return new r(t)},n=J([e.Serializable("AuthenticateRequestExecuteControlFlowStageContinuation")],n)}(e.ExecuteControlFlowStageContinuation);e.AuthenticateRequestExecuteControlFlowStageContinuation=n;var r=function(r){function o(t,e,n,o){void 0===o&&(o=null);var i=r.call(this,t)||this;return i.opName="authenticate",e&&(i._usedSession=e,i._additionalParameters=n,i._policy=o),i}return V(o,r),o.generateLoginRequest=function(t,n){var r={collection_result:t.toJson(),push_token:n.sdkSessionManagementServices.lastReceivedPushToken};return n.policy&&(r.policy_request_id=n.policy),n.additionalParameters&&(r.params=n.additionalParameters),new e.SessionExchangeRequest("POST","auth/login",r,[],n.getFlowId())},o.prototype.generateControlFlowRequest=function(){var e=this;return this.sdk.promiseCollectionResult().then((function(n){return e.sdk.log(t.LogLevel.Debug,(function(){return"authenticate: Collection done; setting up request"})),o.generateLoginRequest(n,e)}))},o.prototype.postProcessControlFlowResult=function(e){return this.sdk.log(t.LogLevel.Debug,(function(){return"authenticate: marking user has logged in after succesful completion"})),this.user.markLoggedIn(),r.prototype.postProcessControlFlowResult.call(this,e)},o.prototype.createContinuation=function(){return new n(this.session,this.getFlowId())},o}(e.SessionSetupExecuteControlFlowStage);e.AuthenticateRequestExecuteControlFlowStage=r;var o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.createResumableProcess=function(t){return new i(t,this.flowId)},n=J([e.Serializable("AuthenticateControlFlowRequestContinuation")],n)}(e.ResumableControlFlowRequestContinuation),i=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.createContinuation=function(){return new o(this,this.getFlowId())},n.prototype.run=function(t,n,o){return this.startWithStage(new r(this,new e.Session(this.rtContext.sdk,t),o,n))},n}(e.SessionSetupResumableControlFlowRequest);e.AuthenticateControlFlowRequest=i}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){!function(n){!function(r){var o;!function(t){t[t.Builtin=0]="Builtin",t[t.Placeholder=1]="Placeholder",t[t.OTP=2]="OTP",t[t.Totp=3]="Totp",t[t.MobileApprove=4]="MobileApprove"}(o=r.AuthenticatorPrototype||(r.AuthenticatorPrototype={}));var i=function(){function i(e,n,r,i){this._session=e,this._authenticatorId=n;var s=n.match(/^placeholder_(.*)$/);if(s){this._authenticatorPrototype=o.Placeholder,this._placeholderId=s[1];var a=r;this._authetnicationMethodTypeName=a.placeholder_type}else n.match(/^otp_(.*)$/)?(this._authenticatorPrototype=o.OTP,this._authetnicationMethodTypeName=this.getAuthenticatorIdForMultiStep()):n.match(/^totp_(.*)$/)?(this._authenticatorPrototype=o.Totp,this._authetnicationMethodTypeName=this.getAuthenticatorIdForMultiStep()):n.match(/^mobile_approve_(.*)$/)?(this._authenticatorPrototype=o.MobileApprove,this._authetnicationMethodTypeName=this.getAuthenticatorIdForMobileApprove()):(this._authenticatorPrototype=o.Builtin,this._authetnicationMethodTypeName=this._authenticatorId);this._authenticatorMethodConfig=r,this._serverReportedRegistrationStatus=i.status,this._expired=i.expired||!1,this._locked=i.locked||!1,r.recovery_escape&&(this._recoveryEscapeOption=new t.ts.mobile.sdk.impl.EscapeOptionImpl(r.recovery_escape))}return Object.defineProperty(i.prototype,"authenticationDriverDescriptor",{get:function(){var e=this.internalAuthenticationDriverDescriptor();
10if(!e)throw new t.ts.mobile.sdk.impl.AuthenticationErrorImpl(t.ts.mobile.sdk.AuthenticationErrorCode.Internal,"Unhandled authenticator: "+this.getAuthenticatorId());return e},enumerable:!1,configurable:!0}),i.prototype.internalAuthenticationDriverDescriptor=function(){switch(this._authenticatorPrototype){case o.Placeholder:return r.AuthenticatorDrivers.__placeholder;case o.Totp:case o.OTP:var t=this.getAuthenticatorIdForMultiStep();return r.AuthenticatorDrivers[t];case o.MobileApprove:var e=this.getAuthenticatorIdForMobileApprove();return r.AuthenticatorDrivers[e];case o.Builtin:default:return r.AuthenticatorDrivers[this.getAuthenticatorId()]}},i.prototype.getAuthenticatorIdForMobileApprove=function(){var t=this._authenticatorId.split("_");return t[0]+"_"+t[1]},i.prototype.getAuthenticatorIdForMultiStep=function(){return""+this._authenticatorId.split("_")[0]},i.prototype.getAuthenticatorId=function(){return this._authenticatorId},i.prototype.getType=function(){var t=n.Protocol.AuthTypeData[this._authetnicationMethodTypeName];return t&&"authTypeEnum"in t?t.authTypeEnum:e.AuthenticatorType.Generic},i.prototype.getName=function(){var t=n.Protocol.AuthTypeData[this._authetnicationMethodTypeName];return t&&t.authTypeName||"Generic"},i.prototype.getExpired=function(){return this._expired},i.prototype.getRegistered=function(){return this.getRegistrationStatus()==e.AuthenticatorRegistrationStatus.Registered},i.prototype.getRegistrationStatus=function(){return this._serverReportedRegistrationStatus!=n.Protocol.AuthenticationMethodStatus.Registered?e.AuthenticatorRegistrationStatus.Unregistered:this.authenticationDriverDescriptor.evaluateLocalRegistrationStatus(this._session)},i.prototype.getLocked=function(){return this._locked},i.prototype.getDefaultAuthenticator=function(){return this._session.user.defaultAuthId==this.getAuthenticatorId()},i.prototype.getSupportedOnDevice=function(){return this.internalAuthenticationDriverDescriptor()&&this.authenticationDriverDescriptor.isSupportedOnDevice(this._session)},i.prototype.getPlaceholderId=function(){return this._placeholderId},i.prototype.updateWithAuthenticatorState=function(t){this._expired=t.expired||!1,this._locked=t.locked||!1,this._serverReportedRegistrationStatus=t.status},i.prototype.getCredentialRecoveryEscapeOption=function(){return this._recoveryEscapeOption},i}();r.AuthenticatorDescriptionImpl=i}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r,o;o=t.sdk||(t.sdk={}),e=o.core||(o.core={}),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getEnabled=function(){return this.getSupportedOnDevice()},e}(e.authenticationdrivers.AuthenticatorDescriptionImpl),r=function(){function t(t,e,n,r){this._sdk=t,this._session=e,this._token=r||null,this._clientContext=n,this._uiHandler=this._sdk.currentUiHandler,this._uiContextImpl=new o.impl.UIContextImpl(t)}return t.prototype.getUiContext=function(){return this._uiContextImpl},t.prototype.run=function(){var t=this;return this._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Starting session"})),this.queryConfigMenuFromServerAndFilter().then((function(e){return new Promise((function(n,r){t.kickStartSession(e),t._completeFn=n,t._rejectFn=r}))}))},t.prototype.registerAuthenticator=function(t,e){return this.requestAuthenticatorRegistrationChange(t,!0,e)},t.prototype.reregisterAuthenticator=function(t,e){return this.requestAuthenticatorRegistrationChange(t,!0,e)},t.prototype.setDefaultAuthenticator=function(t){var n=this;return this._sdk.log(o.LogLevel.Info,(function(){return"Configuration: Updating user default authenticator."})),new Promise((function(r,o){if(!n._session.anonymous){var i=n._session.user;i.updateDefaultAuthId(t.getDescription().getAuthenticatorId()),n._session.persistUserData&&e.User.save(n._sdk,i)}r(!0),n.updateManagedAuthenticators(n._authenticators)}))},t.prototype.unregisterAuthenticator=function(t,e){return this.requestAuthenticatorRegistrationChange(t,!1,e).then((function(t){return!0}))},t.prototype.requestRefreshAuthenticators=function(){var t=this;return this.queryConfigMenuFromServerAndFilter().then((function(e){return t.updateManagedAuthenticators(e),!0}),(function(t){throw o.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)}))},t.prototype.finishSession=function(){if(!this._appSession)throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.Internal,"Attempt to finish a non started config session.");this._appSession.endSession(),this._appSession=null,this._completeFn(!0)},t.prototype.kickStartSession=function(t){this._appSession=this._uiHandler.createAuthenticationConfigurationSession(this._session.user.displayName),this._appSession?(this._appSession.startSession(this,null,this._clientContext),this.updateManagedAuthenticators(t)):this._rejectFn(o.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createAuthenticationConfigurationSession."))},t.prototype.updateManagedAuthenticators=function(t){if(!this._appSession)throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.Internal,"Attempt to work with a non started config session.");var e={};t.forEach((function(t){e[t.getDescription().getAuthenticatorId()]=t})),this._authenticators=t,this._authenticatorsByName=e,this._appSession.setAuthenticatorsList(t)},t.prototype.queryConfigMenuFromServerAndFilter=function(){var t=this;this._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Initiating collection"}));var e=this._sdk.promiseCollectionResult();return o.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,e.then((function(e){t._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Collection done; setting up request to query for config menu"}));var r=t._session.createConfigMenuFetchRequest(e,t._token);return t._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Sending request to query approvals"})),t._session.performSessionExchange(r).then((function(e){var r=e.data&&"configuration"==e.data.type&&e.data;if(!r)throw new o.impl.AuthenticationErrorImpl(o.AuthenticationErrorCode.Internal,"Invalid configuration screen structure encountered.");return r.methods.map((function(e){var r=new n(t._session,e.type,e,e);return new o.impl.ConfigurableAuthenticatorImpl(r,e.options)})).filter((function(t){return t.getDescription().getSupportedOnDevice()}))}))})))},t.prototype.requestAuthenticatorRegistrationChange=function(t,n,r){var i=this;this._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Authenticator "+t.getDescription().getName()+" request (un)registration "+n})),this._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Initiating registration request promise"}));var s=this._sdk.promiseCollectionResult().then((function(e){return i._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Collection done; setting up request"})),i._session.createAuthRegistrationRequest(e,t.getDescription().getAuthenticatorId(),n,i._token)}));return this._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Initiating control flow"})),s.then((function(s){return i._session.startControlFlow(s,null,r||i._clientContext).then((function(r){var s=r.getInternalData(),a=!1;if(s&&s.methods&&s.methods.length&&(i._sdk.log(o.LogLevel.Debug,(function(){return"configuration: Processing updates."})),s.methods.forEach((function(t){var e=i._authenticatorsByName[t.type];e&&(e.getDescription().updateWithAuthenticatorState(t),a=!0)}))),a){if(!n&&t.getDescription().getDefaultAuthenticator()&&!i._session.anonymous){var c=i._session.user;c.updateDefaultAuthId(""),i._session.persistUserData&&e.User.save(i._sdk,c)}i.updateManagedAuthenticators(i._authenticators)}return r}),(function(t){throw o.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)}))}
10))},t}(),e.AuthenticationConfigurationSessionProcessor=r}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e;(function(t){var e=function(){function t(t,e){this._sdk=t,this._user=e}return Object.defineProperty(t.prototype,"user",{get:function(){return this._user},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sdk",{get:function(){return this._sdk},enumerable:!1,configurable:!0}),t}();t.BaseSession=e;var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e}(e);t.LocalSession=n})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.createResumableProcess=function(t){return new o(t)},e=J([n.Serializable("BindRequestExecuteControlFlowStageContinuation")],e)}(n.ExecuteControlFlowStageContinuation),o=function(o){function i(t,e,n){var r=o.call(this,t)||this;return r.opName="bind",e&&(r._usedSession=e,r._additionalParameters=n),r}return V(i,o),i.prototype.generateControlFlowRequest=function(){var r=this;this.sdk.log(e.LogLevel.Debug,(function(){return r.opName+": Generating new device keys for "+(r.user.userId||r.user.idToken)}));var o=this.sdk.host.generateKeyPair(this.user.deviceSigningKeyTag,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.None,!0),i=this.sdk.host.generateKeyPair(this.user.deviceEncryptionKeyTag,t.sdkhost.KeyClass.StdEncryptionKey,t.sdkhost.KeyBiometricProtectionMode.None,!0);return Promise.all([o,i]).then((function(t){var o=t[0],i=t[1];return r.sdk.log(e.LogLevel.Debug,(function(){return r.opName+": key generation done"})),r.sdk.promiseCollectionResult().then((function(t){r.sdk.log(e.LogLevel.Debug,(function(){return r.opName+": Collection result completed, Initiating request promise"}));var s={collection_result:t.toJson(),public_key:o.publicKeyToJson(),push_token:r.sdkSessionManagementServices.lastReceivedPushToken};return i&&(s.encryption_public_key=i.publicKeyToJson()),r.additionalParameters&&(s.params=r.additionalParameters),new n.SessionExchangeRequest("POST","auth/bind",s,[],r.getFlowId())}))}))},i.prototype.postProcessControlFlowResult=function(t){var n=this,r=this.sdk.currentSession&&this.sdk.currentSession.deviceId();return this.sdk.currentSession&&r&&(this.sdk.log(e.LogLevel.Debug,(function(){return n.opName+": binding device to user after succesful completion"})),this.sdk.currentSession.user.bindDeviceToUser(r)),o.prototype.postProcessControlFlowResult.call(this,t)},i.prototype.createContinuation=function(){return new r(this.session,this.getFlowId())},i}(n.SessionSetupExecuteControlFlowStage);n.BindRequestExecuteControlFlowStage=o;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.createResumableProcess=function(t){return new s(t,this.flowId)},e=J([n.Serializable("BindControlFlowRequestContinuation")],e)}(n.ResumableControlFlowRequestContinuation),s=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return V(r,t),r.prototype.createContinuation=function(){return new i(this,this.getFlowId())},r.prototype.run=function(t,r){var i=this;return new Promise((function(s,a){i._ctxt.sdk.deviceSupportsCryptoBinding()?t.deviceBound?a(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Attempt to bind an already bound user on this device.",{user:t.userHandle})):s(i.startWithStage(new o(i,new n.Session(i.rtContext.sdk,t),r))):a(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"cryptographic binding is not supported for this device"))}))},r}(n.SessionSetupResumableControlFlowRequest);n.BindControlFlowRequest=s}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r;r=t.sdk||(t.sdk={}),e=r.core||(r.core={}),n=function(){function t(t,e){if(this.sdk=t,this.ec=new elliptic.ec("secp256k1"),e&&(this.sessionId=e.session_id,this.aesKey=this.base64ToJsArray(e.key),!this.isReady()))throw new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.Internal,"Can't deserialize crypto session")}
10return t.prototype.getExchangeRequestHeader=function(){if(!this.kp){var t={entropy:this.sdk.host.generateRandomHexString(192),entropyEnc:"hex"};this.kp=this.ec.genKeyPair(t)}return{type:"key_exchange",scheme:2,y:this.jsArrayToBase64(this.kp.getPublic().encode())}},t.prototype.processExchangeResponseHeader=function(t){if(2!=t.scheme)throw"Unsupported crypto scheme "+t.scheme;this.sessionId=t.crypto_session_id;var e=this.kp.derive(this.ec.keyFromPublic(atob(t.y)).getPublic()),n=sha256.create();n.update(e.toArray("be",32)),this.aesKey=n.digest()},t.prototype.isReady=function(){return!(!this.aesKey||!this.sessionId)},t.prototype.decryptResponse=function(t){var e=null;if(t.headers.forEach((function(t){"encryption"==t.type&&(e=t)})),e){var n=this.base64ToJsArray(e.iv),r=new aesjs.ModeOfOperation.cbc(this.aesKey,n),o=this.base64ToJsArray(t.data),i=r.decrypt(o),s=aesjs.utils.utf8.fromBytes(i);s=this.pkcs7Unpad(s),t.data=JSON.parse(s)}return t},t.prototype.encryptRequest=function(t){var e=this,n=this.sdk.host.generateRandomHexString(32),o=aesjs.utils.hex.toBytes(n),i={type:"encryption",iv:r.util.hexToBase64(n),crypto_session_id:this.sessionId},s=t.headers.map((function(t){return e.encryptStringToBase64(JSON.stringify(t),o)})),a=JSON.stringify(t.data),c=this.encryptStringToBase64(a,o);t.headers=[i],t.enc_headers=s,t.data=c},t.prototype.encryptStringToBase64=function(t,e){var n=new aesjs.ModeOfOperation.cbc(this.aesKey,e),r=aesjs.utils.utf8.toBytes(t),o=this.pkcs7Pad(r),i=n.encrypt(o);return this.jsArrayToBase64(i)},t.prototype.toJson=function(){return{scheme:2,session_id:this.sessionId,key:this.jsArrayToBase64(this.aesKey)}},t.fromJson=function(e,n){return new t(e,n)},t.prototype.jsArrayToBase64=function(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)},t.prototype.base64ToJsArray=function(t){for(var e=atob(t),n=[],r=0;r<e.length;r++)n.push(e.charCodeAt(r));return n},t.prototype.pkcs7Pad=function(t){var e=16-t.length%16,n=new Uint8Array(t.length+e);n.set(t,0);for(var r=0;r<e;r++)n[t.length+r]=e;return n},t.prototype.pkcs7Unpad=function(t){var e=t.charCodeAt(t.length-1);return t.slice(0,-e)},t}(),e.Scheme2CryptoSession=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e;(function(t){var n;!function(t){t[t.FinishSession=0]="FinishSession",t[t.CurrentDeviceDeleted=1]="CurrentDeviceDeleted"}(n=t.DeviceManagementSessionProcessorReturnReason||(t.DeviceManagementSessionProcessorReturnReason={}));var r=function(){function t(t,n,r,o){this._sdk=t,this._session=n,this._clientContext=r,this._token=o||null,this._uiHandler=this._sdk.currentUiHandler,this._uiContextImpl=new e.impl.UIContextImpl(t)}return t.prototype.getUiContext=function(){return this._uiContextImpl},t.prototype.run=function(){var t=this;return this._sdk.log(e.LogLevel.Debug,(function(){return"device management: Starting session"})),this.queryDevicesFromServer().then((function(e){return new Promise((function(n,r){t._completeFn=n,t._rejectFn=r,t.kickStartSession(e)}))}))},t.prototype.removeDevice=function(t,n){var r=this;return new Promise((function(o,i){if(t.getInfo().getIsCurrent())throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Illegal attempt to delete the current device using 'DeviceManagementSessionServices.removeDevice'. The current device must only be deleted using DeviceManagementSessionServices.removeCurrentDeviceAndFinishSession.");var s=r.ensureValidDevice(t);r.performDeviceAction(s,e.DeviceManagementAction.Remove,n,null).then((function(t){return r._sdk.log(e.LogLevel.Debug,(function(){return"device management: Updating device state locally"})),s.getInfo().setStatus(e.DeviceStatus.Removed),r.updateManagedDevices(r._managedDevices.filter((function(t){return t!=s}))),!0})).then(o,i)}))},t.prototype.removeCurrentDeviceAndFinishSession=function(t){var r,o=this;return this._appSession?(r=this._appSession,new Promise((function(i,s){o._sdk.log(e.LogLevel.Debug,(function(){return"device management: Start removing current device"}));var a=o._managedDevices.filter((function(t){return t.getInfo().getIsCurrent()}));if(1!=a.length)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Couldn't locate current device in device list.");var c=a[0];o.performDeviceAction(c,e.DeviceManagementAction.Remove,t,null).then((function(t){return o._sdk.log(e.LogLevel.Debug,(function(){return"device management: Updating device state locally"})),c.getInfo().setStatus(e.DeviceStatus.Removed),!0})).then((function(){i(!0),r.endSession(),o._appSession=null,o._completeFn(n.CurrentDeviceDeleted)})).catch(s)}))):Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to finish a non started device management session."))},t.prototype.renameDevice=function(t,n,r){var o=this;return new Promise((function(i,s){var a=o.ensureValidDevice(t),c={name:n};return o.performDeviceAction(a,e.DeviceManagementAction.Rename,r,c).then((function(t){return o._sdk.log(e.LogLevel.Debug,(function(){return"device management: Updating device state locally"})),a.getInfo().setName(n),o.updateManagedDevices(o._managedDevices),!0})).then(i,s)}))},t.prototype.requestRefreshDevices=function(){var t=this;return this.queryDevicesFromServer().then((function(e){return t.updateManagedDevices(e),!0}),(function(t){throw e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)}))},t.prototype.finishSession=function(){if(!this._appSession)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to finish a non started device management session.");this._appSession.endSession(),this._appSession=null,this._completeFn(n.FinishSession)},t.prototype.kickStartSession=function(t){this._appSession=this._sdk.currentUiHandler.createDeviceManagementSession(this._session.user.displayName),this._appSession?(this.updateManagedDevices(t),this._appSession.startSession(this,null,this._clientContext)):this._rejectFn(e.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createDeviceManagementSession."))},t.prototype.updateManagedDevices=function(t){if(!this._appSession)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to update device list for a non started device management session.");this._managedDevices=t,this._appSession.setSessionDevicesList(t)},t.prototype.queryDevicesFromServer=function(){var t=this;this._sdk.log(e.LogLevel.Debug,(function(){return"device management: Initiating collection"}));var n=this._sdk.promiseCollectionResult();return e.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,this._clientContext,n.then((function(n){t._sdk.log(e.LogLevel.Debug,(function(){return"device management: Collection done; setting up request to query devices"}));var r=t._session.createDevicesFetchRequest(n,t._token);return t._sdk.log(e.LogLevel.Debug,(function(){return"device management: Sending request to query devices"})),t._session.startControlFlow(r,null,t._clientContext).then((function(n){return t._uiHandler.endActivityIndicator(null,t._clientContext),n.getInternalData().devices.map((function(n){var r=new e.impl.ManagedDeviceImpl(n);return r.getInfo().getDeviecId()==t._session.user.deviceId&&r.getInfo().forceCurrent(),r}))}))})))},t.prototype.performDeviceAction=function(t,n,r,o){var i,s=this,a=r||this._clientContext;switch(n){case e.DeviceManagementAction.Remove:i="remove";break;case e.DeviceManagementAction.Rename:i="name";break;default:return Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid device action specified "+n))}this._sdk.log(e.LogLevel.Debug,(function(){return"devices: action "+i+" on "+t.getInfo().getDeviecId()})),this._sdk.log(e.LogLevel.Debug,(function(){return"devices: Initiating collection"}));var c=this._sdk.promiseCollectionResult();return e.util.wrapPromiseWithActivityIndicator(this._uiHandler,null,a,c.then((function(n){s._sdk.log(e.LogLevel.Debug,(function(){return"devices: Collection done; setting up request"}));var r=s._session.createDeviceActionRequest(n,s._token,t.getInfo().getDeviecId(),i,o);return s._sdk.log(e.LogLevel.Debug,(function(){return"devices: Sending request"})),s._session.startControlFlow(r,null,a).then((function(t){return t.getInternalData()}))})).catch((function(t){throw e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)})))},t.prototype.ensureValidDevice=function(t){var n=this._managedDevices.indexOf(t);if(n<0)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Attempt to perform a device action on a device not originally included in device management session.");return this._managedDevices[n]},t}();t.DeviceManagementSessionProcessor=r})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.createSuccessResponse=function(t){var n=new e.Fido2AuthenticatorSuccessResponse;return n.setFido2Response(t),n},n.createdFailedResponse=function(t){var n=new e.Fido2AuthenticationFailedResponse;return n.setFailureError(t),n},n}(t.InputResponseType);e.Fido2InputResponseInternal=n}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getFailureError=function(){return this._failureError},e.prototype.setFailureError=function(t){this._failureError=t},e}(t.Fido2InputResponseInternal);t.Fido2AuthenticationFailedResponse=e}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getFido2Response=function(){return this._fido2Response},e.prototype.setFido2Response=function(t){this._fido2Response=t},e}(t.Fido2InputResponseInternal);t.Fido2AuthenticatorSuccessResponse=e}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.createResumableProcess=function(t){return new r(t)},n=J([e.Serializable("InvokeAnonymousPolicyRequestExecuteControlFlowStageContinuation")],n)}(e.ExecuteControlFlowStageContinuation);e.InvokeAnonymousPolicyRequestExecuteControlFlowStageContinuation=n;var r=function(r){function o(t,e,n,o){void 0===n&&(n=null);var i=r.call(this,t)||this;return i.opName="invokeAnonymousPolicy",e&&(i._usedSession=e,null===n||"string"==typeof n?(i._additionalParameters=o,i._policy=n):i._inlineControlFlowInitiationServerResponse=n),i}return V(o,r),o.prototype.generateControlFlowRequest=function(){var n=this;return this.sdk.promiseCollectionResult(this.sdk.enabledCollectorsAnonymous).then((function(r){n.sdk.log(t.LogLevel.Debug,(function(){return"authenticate: Collection done; setting up request"}));var o={collection_result:r.toJson(),push_token:n.sdkSessionManagementServices.lastReceivedPushToken};return n.policy&&(o.policy_request_id=n.policy),n.additionalParameters&&(o.params=n.additionalParameters),new e.SessionExchangeRequest("POST","auth/anonymous_invoke",o,[],n.getFlowId())}))},o.prototype.createContinuation=function(){return new n(this.session,this.getFlowId())},o}(e.ExecuteControlFlowStage);e.InvokeAnonymousPolicyRequestExecuteControlFlowStage=r;var o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.createResumableProcess=function(t){return new i(t,this.flowId)},n=J([e.Serializable("InvokeAnonymousPolicyControlFlowRequestContinuation")],n)}(e.ResumableControlFlowRequestContinuation),i=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.createContinuation=function(){return new o(this,this.getFlowId())},n.prototype.run=function(t,n){var o,i=e.Session.createAnonymousSession(this.rtContext.sdk);
10return o="string"!=typeof t&&t?new r(this,i,t):new r(this,i,t,n),this.startWithStage(o)},n}(e.ResumableControlFlowRequest);e.InvokeAnonymousPolicyControlFlowRequest=i}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.createResumableProcess=function(t){return new r(t)},n=J([e.Serializable("InvokePolicyRequestExecuteControlFlowStageContinuation")],n)}(e.ExecuteControlFlowStageContinuation),r=function(r){function o(t,e,n,o){void 0===o&&(o=null);var i=r.call(this,t)||this;return i.opName="invokePolicy",e&&(i._usedSession=e,i._additionalParameters=n,i._policy=o),i}return V(o,r),o.prototype.generateControlFlowRequest=function(){var n=this;return this.sdk.promiseCollectionResult().then((function(r){return n.sdk.log(t.LogLevel.Debug,(function(){return"invokePolicy: Collection done; setting up request"})),e.AuthenticateRequestExecuteControlFlowStage.generateLoginRequest(r,n)}))},o.prototype.restoreParametersFromContinuation=function(e){if(!this.sdk.currentSession)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Attempt to resume invokePolicy without an existing session.");r.prototype.restoreParametersFromContinuation.call(this,e);var n=this._usedSession;this._usedSession=this.sdk.currentSession,this.sdk.currentSession.updateFromContinuedSession(n)},o.prototype.createContinuation=function(){return new n(this.session,this.getFlowId())},o}(e.ExecuteControlFlowStage);e.InvokePolicyRequestControlFlowStage=r;var o=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.createResumableProcess=function(t){return new i(t,this.flowId)},n=J([e.Serializable("InvokePolicyControlFlowRequestContinuation")],n)}(e.ResumableControlFlowRequestContinuation),i=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.createContinuation=function(){return new o(this,this.getFlowId())},n.prototype.run=function(e,n){return this.rtContext.sdk.currentSession?this.startWithStage(new r(this,this.rtContext.sdk.currentSession,n,e)):Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Attempt to resume invokePolicy without an existing session."))},n}(e.ResumableControlFlowRequest);e.InvokePolicyControlFlowRequest=i}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r;r=t.sdk||(t.sdk={}),e=r.core||(r.core={}),n=function(){function t(){}return t.installOnSdk=function(e){e.setExternalLogger(new t)},t.prototype.log=function(t,e,n){var o="["+e+"] "+n;switch(t){case r.LogLevel.Debug:console.log(o);break;case r.LogLevel.Info:console.info(o);break;case r.LogLevel.Warning:console.warn(o);break;case r.LogLevel.Error:case r.LogLevel.Critical:console.error(o)}},t}(),e.JsConsoleLogger=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e;(function(n){var r,o;!function(t){t.Registering="registering",t.Registered="registered",t.Unregistered="unregistered"}(r=n.LocalEnrollmentStatus||(n.LocalEnrollmentStatus={})),function(t){t.None="none",t.Validated="validated",t.Invalidated="invalidated"}(o=n.LocalEnrollmentValidationStatus||(n.LocalEnrollmentValidationStatus={}));var i=function(){function t(t,e){this.pbkdf_iterations_count=t,this.pbkdf_key_size=e}return t.prototype.duplicate=function(){return new t(this.pbkdf_iterations_count,this.pbkdf_key_size)},t.prototype.toRecordFormat=function(){return{pbkdf_iterations_count:this.pbkdf_iterations_count,pbkdf_key_size:this.pbkdf_key_size}},t}();n.ClientCryptoSettingsRecordFormat=i;var s=function(){function t(t,e,n,r,o,i,s){this.salt=t,this.status=e,this.version=n,this.authenticatorId=r,this.cryptoSettings=o,this.validationStatus=i,this.publicKeyHash=s}return t.prototype.duplicate=function(){var e=null;this.cryptoSettings&&(e=this.cryptoSettings.duplicate());var n=new t(this.salt,this.status,this.version,this.authenticatorId,e,this.validationStatus,this.publicKeyHash);return n.keyMeterial=this.keyMeterial,this.authenticatorConfig&&(n.authenticatorConfig=JSON.parse(JSON.stringify(this.authenticatorConfig))),n},t.prototype.toRecordFormat=function(){var t=null;return this.cryptoSettings&&(t=this.cryptoSettings.toRecordFormat()),{salt:this.salt,status:this.status,version:this.version,authenticatorId:this.authenticatorId,cryptoSettings:t,validationStatus:this.validationStatus,publicKeyHash:this.publicKeyHash,keyMeterial:this.keyMeterial,authenticatorConfig:this.authenticatorConfig}},t}();n.LocalEnrollmentRecordFormat=s;var a=function(){function a(){}return Object.defineProperty(a.prototype,"salt",{get:function(){return this._record.salt},set:function(t){this._record.salt=t}
10,enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"status",{get:function(){return this._record.status||r.Unregistered},set:function(t){this._record.status=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"version",{get:function(){return this._record.version},set:function(t){this._record.version=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"authenticatorId",{get:function(){return this._record.authenticatorId},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"validationStatus",{get:function(){return this._record.validationStatus},set:function(t){this._record.validationStatus=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"publicKeyHash",{get:function(){return this._record.publicKeyHash},set:function(t){this._record.publicKeyHash=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"cryptoSettings",{get:function(){return this._record.cryptoSettings?e.ClientCryptoSettings.create(this._record.cryptoSettings.pbkdf_iterations_count):null},set:function(t){this._record.cryptoSettings=t?new i(t.getLocalEnrollmentKeyIterationCount(),t.getLocalEnrollmentKeySizeInBytes()):null},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"keyMaterial",{get:function(){return this._record.keyMeterial},set:function(t){this._record.keyMeterial=t},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"authenticatorConfig",{get:function(){return this._record.authenticatorConfig},set:function(t){this._record.authenticatorConfig=t},enumerable:!1,configurable:!0}),a.prototype.setFingerprintDbSnapshot=function(t){this._record.fingerprintDbSsnapshot=t},a.enrollmentWithRecord=function(t){var e=new a,n=null;return t.cryptoSettings&&(n=new i(t.cryptoSettings.pbkdf_iterations_count,t.cryptoSettings.pbkdf_key_size)),e._record=new s(t.salt,t.status,t.version,t.authenticatorId,n,t.validationStatus,t.publicKeyHash),e.authenticatorConfig=t.authenticatorConfig,e.keyMaterial=t.keyMeterial,e},a.migrateFPEnrollmentsToDeviceBiometricsIfNeeded=function(r,o,i){var s=i.host.queryHostInfo(t.sdkhost.HostInformationKey.DeviceBiometricsSupported);if(s&&"false"!=s&&"true"==i.host.queryHostInfo(t.sdkhost.HostInformationKey.DeviceBiometricsFPContinuation)){var a=r[n.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName];a&&(i.log(e.LogLevel.Debug,(function(){return"migrating Fingerprint enrollment to DeviceBiometrics for user "+o.displayName})),a.version="v0_"+a.version,a.authenticatorId=n.authenticationdrivers.AuthenticationDriverDescriptorDeviceBiometrics.authenticatorName,delete r[n.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName],r[n.authenticationdrivers.AuthenticationDriverDescriptorDeviceBiometrics.authenticatorName]=a,i.host.writeStorageKey(this.storageKeyForEnrollmentsForUser(o.guid),r))}return r},a.enrollmentsForUser=function(t,n){var r={},o=n.host.readStorageKey(this.storageKeyForEnrollmentsForUser(t.guid));for(var i in o=a.migrateFPEnrollmentsToDeviceBiometricsIfNeeded(o,t,n)||{},n.log(e.LogLevel.Debug,(function(){return"Got db "+JSON.stringify(o)})),o)n.log(e.LogLevel.Debug,(function(){return"Got db wEnrollmentKey"+i})),r[i]=a.enrollmentWithRecord(o[i]);return r},a.deleteEnrollmentsForUser=function(t,e){e.host.deleteStorageKey(this.storageKeyForEnrollmentsForUser(t.guid))},a.createNew=function(t,e,n,i,c){var u=new s(n,r.Unregistered,e,t,null,o.None,c),l=new a;return l._record=u,l},a.prototype.duplicate=function(){var t=new a;return t._record=this._record.duplicate(),t},a.updateEnrollmentsForUser=function(t,e,n){var r={};for(var o in e)r[o]=e[o]._record.toRecordFormat();n.host.writeStorageKey(this.storageKeyForEnrollmentsForUser(t.guid),r)},a.invalidateLocalRegistrationStatusAndNotifyUIHandler=function(t,n){return new Promise((function(r,i){if(!t)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"No user interaction session provider!");t._sdk.log(e.LogLevel.Info,(function(){return"Marking authenticator as invalidated and invoking UI Handler"}));var s=t._session.user.localEnrollments[n.getAuthenticatorId()];s.validationStatus=o.Invalidated,t._session.user.updateEnrollmentRecord(s),t._uiHandler.localAuthenticatorInvalidated(n,t._clientContext).then((function(t){r(t)}))}
10))},a.storageKeyForEnrollmentsForUser=function(t){return new n.TarsusKeyPath("per_user",t.toString(),"local_enrollments")},a.listInvalidatedLocalEnrollments=function(t){var e,n=new Array;for(var r in t.user.localEnrollments)(e=t.user.localEnrollments[r]).validationStatus==o.Invalidated&&n.push(e);return n},a}();n.LocalEnrollment=a})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){function n(t){return void 0!==t.ref}e.isRefType=n,e.unwrap=function(e){if(n(e))throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"style property "+e+" is not the right format");return e}}(e.Protocol||(e.Protocol={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r;r=t.sdk||(t.sdk={}),e=r.core||(r.core={}),n=function(){function t(t){this._sdk=t}return Object.defineProperty(t.prototype,"sdk",{get:function(){return this._sdk},enumerable:!1,configurable:!0}),t.prototype.createClientStringsRequest=function(t){return new e.PublicExchangeRequest("GET","resources/localization?locale="+t+"&v=1",{})},t.prototype.performRequest=function(t){var n=this;return this._sdk.log(r.LogLevel.Debug,(function(){return"Preprocess request "+JSON.stringify(t)})),this.createTransportRequestForPublicExchangeRequest(t).then((function(t){return n.prepareTransportRequest(t).then((function(t){return n._sdk.log(r.LogLevel.Debug,(function(){return"Will send request "+JSON.stringify(t)})),n._sdk.transportProvider.sendRequest(t).then((function(t){n._sdk.log(r.LogLevel.Debug,(function(){return"Got response "+JSON.stringify(t)}));try{var o=JSON.parse(t.getBodyJson())}catch(e){throw r.impl.AuthenticationErrorImpl.errorForTransportResponse(t)}var i=o.data&&o.data.state==e.Protocol.AuthSessionState.Rejected;if(200==t.getStatus()&&!o.error_code||401==t.getStatus()&&i)return o;throw 200==t.getStatus()||o.error_code?r.impl.AuthenticationErrorImpl.errorForServerResponse(o):r.impl.AuthenticationErrorImpl.errorForTransportResponse(t)}))}))}))},t.prototype.createTransportRequestForPublicExchangeRequest=function(t){var e=this;return new Promise((function(n,o){var i={headers:t.envelopeHeaders,data:t.body},s=new r.TransportRequest;s.setMethod(t.method);var a=e._sdk.connectionSettings.getRealm()||"",c=a.length?"/"+a:"";s.setUrl(""+e._sdk.connectionSettings.getServerAddress()+c+"/api/v2/"+t.serverRelativeUrl),s.setBodyJson(JSON.stringify(i)),n(s)}))},t.prototype.prepareTransportRequest=function(t){var e={aid:this._sdk.connectionSettings.getAppId()};t.setUrl(this.urlWithConcatenatedQuery(t.getUrl(),e));var n=t.getHeaders()||[];return t.setHeaders(n),Promise.resolve(t)},t.prototype.urlWithConcatenatedQuery=function(t,e){var n="";return t.indexOf("?")<0?n="?":"&"!=t[t.length-1]&&(n="&"),t+n+Object.keys(e).map((function(t){return t+"="+encodeURIComponent(e[t])})).join("&")},t}(),e.PublicNetworkRequest=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getUrl=function(){return this._url},t.prototype.setUrl=function(t){this._url=t},t.prototype.getMethod=function(){return this._method},t.prototype.setMethod=function(t){this._method=t},t.prototype.getHeaders=function(){return this._headers},t.prototype.setHeaders=function(t){this._headers=t},t.prototype.getBodyJson=function(){return this._bodyJson},t.prototype.setBodyJson=function(t){this._bodyJson=t},t.__tarsusInterfaceName="TransportRequest",t}();t.TransportRequest=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e;(function(n){var r=function(r){function s(t,e){var n=r.call(this,t,e)||this;n._lockCount=0,n._invalidated=!1,n._persistUserData=t.currentPersistUserData;var o=e&&(e.deviceBound||e.hasLoggedIn);return n._deviceId=o&&e.deviceId||null,n}return V(s,r),Object.defineProperty(s.prototype,"anonymous",{get:function(){return this._anonymous}
10,enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"invalidated",{get:function(){return this._invalidated},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"persistUserData",{get:function(){return this._persistUserData},enumerable:!1,configurable:!0}),s.createAnonymousSession=function(t){var e=new s(t,n.User.createEphemeralUser(t));return e._anonymous=!0,e},s.prototype.createLogoutRequest=function(){return new n.SessionExchangeRequest("POST","auth/logout",{},[],this.getFlowId())},s.prototype.createApprovalsFetchRequest=function(t){var e={collection_result:t.toJson()};return new n.SessionExchangeRequest("POST","approvals/actions/fetch",e,[],this.getFlowId())},s.prototype.createApprovalReplyRequest=function(t,r,o){var i={collection_result:t.toJson(),status:o==e.MobileApprovalStatus.Approved?n.Protocol.ServerResponseDataApprovalsApprovalStatus.Approved:n.Protocol.ServerResponseDataApprovalsApprovalStatus.Denied};return new n.SessionExchangeRequest("POST","auth/approve?apid="+r,i,[],this.getFlowId())},s.prototype.createDevicesFetchRequest=function(t,e){var r={collection_result:t.toJson()};return e&&(r.token=e),new n.SessionExchangeRequest("POST","authenticate/physical/devices",r,[],this.getFlowId())},s.prototype.createDeviceActionRequest=function(t,e,r,o,i){var s={collection_result:t.toJson(),device_id:r};
10return e&&(s.token=e),i&&Object.keys(i).forEach((function(t){s[t]=i[t]})),new n.SessionExchangeRequest("POST","authenticate/physical/device/action?action="+o,s,[],this.getFlowId())},s.prototype.createConfigMenuFetchRequest=function(t,e){var r={collection_result:t.toJson()};return e&&(r.token=e),new n.SessionExchangeRequest("POST","auth/authenticator/config_menu",r,[],this.getFlowId())},s.prototype.createAuthRegistrationRequest=function(t,e,r,o){var i={collection_result:t.toJson(),type:e};o&&(i.token=o);var s=r?"register":"unregister";return new n.SessionExchangeRequest("POST","auth/authenticator/"+s,i,[],this.getFlowId())},s.prototype.startControlFlow=function(t,e,r){var o=new n.ControlFlowProcessor(this.sdk,this,r,e);return this.runWithSessionControlFlow(o,(function(e){return e.startControlFlow(t)}))},s.prototype.continueControlFlow=function(t,e,r,o){var i=new n.ControlFlowProcessorRuntimeContext;i.cflowRequestContext=r,i.clientContext=o,i.sdk=this.sdk,i.session=this,i.uiHandler=this.sdk.currentUiHandler;var s=t.createResumableProcess(i);return this.runWithSessionControlFlow(s,(function(n){return n.resume(t,e)}))},s.prototype.createCurrentControlFlowContinuation=function(){if(!this._currentControlFlow)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to create continuation for a session without an active control flow");return this._currentControlFlow.createContinuation()},s.prototype.runWithSessionControlFlow=function(t,r){var o=this;return new Promise((function(i,s){if(o._currentControlFlow)throw o.sdk.log(e.LogLevel.Error,(function(){return"Attempt to start a control flow while an existing control flow ("+o._currentControlFlow.challenge+") is running."})),new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Attempt to start a control flow while an existing control flow ("+o._currentControlFlow.challenge+") is running.");o._currentControlFlow=t,o.sdk.log(e.LogLevel.Debug,(function(){return"Start control flow"})),n.authenticationdrivers.SimpleAuthenticationDriverDescriptor.refreshInvalidatedAuthenticatorsEnrollments(o).catch((function(t){o.sdk.log(e.LogLevel.Warning,(function(){return"Could not refresh invalidated authenticators enrollments: "+t}))})).then((function(){return r(t)})).finally((function(){o.sdk.log(e.LogLevel.Debug,(function(){return"Done control flow "+t.challenge})),o._currentControlFlow=null})).then(i,s)}))},s.prototype.getCurrentUserInteractionSessionProvider=function(){return this._currentControlFlow},s.prototype.generateInvalidatedAuthenticatorsHeadersIfNeeded=function(){for(var t,r=new Array,o=0,i=n.LocalEnrollment.listInvalidatedLocalEnrollments(this);o<i.length;o++)if(t=i[o],this._sdk.log(e.LogLevel.Debug,(function(){return"Found invalidated authenticator: "+t.authenticatorId})),t.publicKeyHash){var s={type:"public_key_hash",hash:t.publicKeyHash},a={type:"registration_invalidated",method:t.authenticatorId,registration_id:s};r.push(a)}return r},Object.defineProperty(s.prototype,"deviceSigningKeyPair",{get:function(){if(!this._deviceKeyPair&&!this._anonymous&&this._sdk.deviceSupportsCryptoBinding()&&(this._deviceKeyPair=this._sdk.host.getKeyPair(this._user.deviceSigningKeyTag,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.None),this.user.deviceBound&&!this._deviceKeyPair))throw this._sdk.log(e.LogLevel.Error,(function(){return"Could not load device signing key pair for this device."})),new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.InvalidDeviceBinding,"Invalid device signature - could not load device signing key pair.");return this._deviceKeyPair},enumerable:!1,configurable:!0}),s.prototype.performSessionExchange=function(t){return this.performSessionExchangeInternal(t,!0,!0,!0).catch((function(t){throw e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t)}))},s.prototype.performSessionExchangeInternal=function(r,o,i,s){var a=this;if(this._invalidated)return this._sdk.log(e.LogLevel.Error,(function(){return"Attempt to execute a session exchange from invalidated session."})),Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.SessionRequired,"Session was invali
10dated by server."));if(this.connectionSettings().getCryptoMode()==e.ConnectionCryptoMode.Full&&!this._currentCryptoSession&&s){var c=new n.SessionExchangeRequest("POST","auth/key_exchange",{r:"Hello Encrypted World"},[],this.getFlowId());return this.performSessionExchangeInternal(c,o,i).then((function(t){return a.performSessionExchangeInternal(r,o)}))}return this._sdk.log(e.LogLevel.Debug,(function(){return"Preprocess request "+JSON.stringify(r)})),this.preprocessSessionExchangeRequest(r).then((function(s){return a.promisePossiblyEncryptedTransportRequest(s).then((function(s){return a.preprocessTransportRequest(s).then((function(s){return a._sdk.log(e.LogLevel.Debug,(function(){return"Will send request "+JSON.stringify(s)})),a._sdk.transportProvider.sendRequest(s).then((function(s){a._sdk.log(e.LogLevel.Debug,(function(){return"Got response "+JSON.stringify(s)}));try{var c=JSON.parse(s.getBodyJson())}catch(t){throw e.impl.AuthenticationErrorImpl.errorForTransportResponse(s)}a.postprocessResponse(c);var u=(c=a.possiblyDecryptResponse(c)).data&&c.data.state==n.Protocol.AuthSessionState.Rejected;if(200==s.getStatus()&&!c.error_code||401==s.getStatus()&&u)return c;if(200==s.getStatus()||c.error_code){if(c.error_code==n.Protocol.ServerResponseErrorCode.EncryptionStateError&&i)return a._currentCryptoSession=null,a.performSessionExchangeInternal(r,o,!1,!0);if(c.error_code==n.Protocol.ServerResponseErrorCode.DeviceKeyExpired){if(a._sdk.log(e.LogLevel.Debug,(function(){return"DeviceKeyRoll: device key expired rejection received"})),o){var l=a._sdk.host.generateRandomHexString(24);return a._sdk.host.generateKeyPair(a._user.getPendingDeviceSigningKeyTag(l),t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.None,!0).then((function(t){var n=void 0;return a.verifyDevicePublicKey(c.data.key_id)||(a._sdk.log(e.LogLevel.Warning,(function(){return"DeviceKeyRoll: server response device public key hash doesn't match."})),n="Device public key hash and server response public key hash do not match."),a._deviceKeyRollData={deviceKeyPair:t,salt:l,message:n},a.performSessionExchangeInternal(r,!1,!0,!0)}))}if(a._sdk.log(e.LogLevel.Warning,(function(){return"DeviceKeyRoll: already attempted to roll device key and failed. Aborting second attempt."})),a._deviceKeyRollData)try{a._sdk.host.deleteKeyPair(a._user.getPendingDeviceSigningKeyTag(a._deviceKeyRollData.salt))}catch(t){a._sdk.log(e.LogLevel.Warning,(function(){return"DeviceKeyRoll: Can't delete pending device signing key."}))}}else c.error_code==n.Protocol.ServerResponseErrorCode.UserIdTokenExpired&&n.User.resetUserIdTokenForSession(a);throw e.impl.AuthenticationErrorImpl.errorForServerResponse(c)}throw e.impl.AuthenticationErrorImpl.errorForTransportResponse(s)}))}))}))}))},s.prototype.processInlineResponse=function(t){return this.postprocessResponse(t),Promise.resolve(t)},s.prototype.cancelCurrentControlFlow=function(){this._currentControlFlow?this._currentControlFlow.cancelFlow():this._sdk.log(e.LogLevel.Error,(function(){return"No current control flow."}))},s.prototype.deviceId=function(){return this._deviceId},s.prototype.preprocessTransportRequest=function(t){var n=this,r={aid:this.connectionSettings().getAppId()};this._deviceId&&(r.did=this._deviceId),this._sessionId&&(r.sid=this._sessionId),this._sdk.uiAssetsData&&this._sdk.uiAssetsData.locale&&(r.locale=this._sdk.uiAssetsData.locale),t.setUrl(this.urlWithConcatenatedQuery(t.getUrl(),r));var o=t.getHeaders()||[],i=new e.TransportHeader;i.setName("X-TS-Client-Version"),i.setValue(this.clientVersionHeader),o.push(i);var s=new e.TransportHeader;s.setName("Authorization"),s.setValue("TSToken "+this.connectionSettings().getToken()+"; tid="+this.connectionSettings().getTokenName()),o.push(s);try{if(this._deviceId&&this.deviceSigningKeyPair)return this.generateSignatureForRequest(t).then((function(r){var i=e.util.calcPublicKeyHexStringEncodedSha256Hash(n.deviceSigningKeyPair,n._sdk),s=new e.TransportHeader;return s.setName("Content-Signature"),s.setValue("data:"+r+";key-id:"+i+";scheme:4"),o.push(s),t.setHeaders(o),t}))}catch(t){return Promise.reject(t)}return t.setHeaders(o),Promise.resolve(t)},s.prototype.postprocessResponse=function(t){var e=this;
10t.headers&&t.headers.forEach((function(t){s.headerProcessors[t.type].call(e,t)}))},s.prototype.encryptEnvelopedMessageIfNeeded=function(t){var e=this.generateKeyExchangeHeaderIfNeeded();this._currentCryptoSession&&this._currentCryptoSession.isReady()&&this._currentCryptoSession.encryptRequest(t),e&&t.headers.push(e)},s.prototype.promisePossiblyEncryptedTransportRequest=function(t){var r=this;return new Promise((function(o,i){var s,a={headers:t.envelopeHeaders,data:t.body};r.encryptEnvelopedMessageIfNeeded(a);var c=new e.TransportRequest;c.setHeaders([]),c.setMethod(t.method);var u=r._sdk.connectionSettings.getRealm()||"",l=u.length?"/"+u:"";c.setUrl(""+r._sdk.connectionSettings.getServerAddress()+l+"/api/v2/"+t.serverRelativeUrl),c.setBodyJson(JSON.stringify(a));var d=null===(s=t.envelopeHeaders.filter((function(t){return t.type===n.Protocol.flowIdHeaderName})))||void 0===s?void 0:s[0];if(r.connectionSettings().shouldSendFlowIdAsHttpHeader()&&d){var h=new e.TransportHeader;h.setName(d.type),h.setValue(d[n.Protocol.flowIdHeaderName]),c.getHeaders().push(h)}o(c)}))},s.prototype.possiblyDecryptResponse=function(t){return this._currentCryptoSession&&this._currentCryptoSession.isReady()&&(t=this._currentCryptoSession.decryptResponse(t)),t},s.prototype.generateKeyExchangeHeaderIfNeeded=function(){return this.connectionSettings().getCryptoMode()==e.ConnectionCryptoMode.None||this._currentCryptoSession?null:(this._currentCryptoSession=new n.Scheme2CryptoSession(this._sdk),this._currentCryptoSession.getExchangeRequestHeader())},s.prototype.preprocessSessionExchangeRequest=function(t){var n=this;return new Promise((function(r,o){var a=n.generateUserIDHeaderIfNeeded();a&&t.addEnvelopeHeader(a);var c=n.generateInvalidatedAuthenticatorsHeadersIfNeeded();if(c)for(var u=0,l=c;u<l.length;u++){var d=l[u];t.addEnvelopeHeader(d)}var h=n.generateDeviceKeyRollHeaderIfNeeded();h&&t.addEnvelopeHeader(h);var p=Promise.resolve(!0),f=new i(t);s.messageFilteringExtensionPoint.forEach((function(t){p=p.then((function(r){return t.filterMessage(n.createPluginSessionInfo(),f).catch((function(t){return n.sdk.log(e.LogLevel.Warning,(function(){return"Error during message filtering: "+t})),!0}))}))})),p.then((function(e){return r(t)}),o)}))},s.prototype.getFlowId=function(){var t,e;return null===(e=null===(t=this._currentControlFlow)||void 0===t?void 0:t.requestContext)||void 0===e?void 0:e.getFlowId()},s.prototype.generateDeviceKeyRollHeaderIfNeeded=function(){if(!this._deviceKeyRollData)return null;var t={type:"device_key_roll"};return t.device_key_roll=this._deviceKeyRollData.deviceKeyPair.publicKeyToJson(),this._deviceKeyRollData.message&&(t.message=this._deviceKeyRollData.message),t},s.prototype.generateUserIDHeaderIfNeeded=function(){if(this.connectionSettings().getCryptoMode()==e.ConnectionCryptoMode.Full&&!this._currentCryptoSession)return null;if(this._anonymous){if(this._user.ephemeralUserId)return{type:"uid",uid:this._user.ephemeralUserId}}else{if(this._user.userId)return{type:"uid",uid:this._user.userId};if(this._user.idToken)return{type:"uid_token",token:this._user.idToken}}return null},s.prototype.processKeyExchangeResponseHeader=function(t){this._currentCryptoSession&&this._currentCryptoSession.processExchangeResponseHeader(t)},s.prototype.generateSignatureForRequest=function(t){var n=t.getUrl(),r=n.indexOf("?");if(r>0){var o=t.getUrl().substring(r+1);n=t.getUrl().substring(0,r)+"?"+o.split("&").sort().join("&")}var i=/%%/g,s=n.substr(this.connectionSettings().getServerAddress().length).replace(i,"\\%")+"%%"+this.clientVersionHeader.replace(i,"\\%")+"%%"+t.getBodyJson().replace(i,"\\%"),a=e.util.asciiToHex(s);return this.deviceSigningKeyPair.signHex(a).then((function(t){return e.util.hexToBase64(t)}))},s.prototype.connectionSettings=function(){return this._sdk.connectionSettings},s.prototype.processSessionIdHeader=function(t){this._sdk.log(e.LogLevel.Debug,(function(){return"Processing session ID header "+t})),this._sessionId=t.session_id},s.prototype.processDeviceIdHeader=function(t){var n=this;this._sdk.log(e.LogLevel.Debug,(function(){return"Processing Device ID header "+t})),this._deviceId?this._deviceId!=t.device_id&&this._sdk.log(e.LogLevel.Warning,(function(){return"Received device ID "+t.device_id+" in a session with an existing device id "+n._deviceId})):(this._user.setProvisionalDeviceId(t.device_id),this._deviceId=t.device_id)},s.prototype.processSessionStateChangeHeader=function(t){switch(this._sdk.log(e.LogLevel.Debug,(function(){return"Processing session state change header "+t+" to state "+t.state})),t.state){case n.Protocol.SessionStateChangeState.Closed:this._sdk.log(e.LogLevel.Debug,(function(){return"Invalidating session."})),this._invalidated=!0;break;default:throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Communication,"Invalid session state change encountered in header.")}},s.prototype.processSessionEphemeralUserHeader=function(t){this._sdk.log(e.LogLevel.Debug,(function(){return"Processing ephemeral user Id header "+t})),this._user.updateEphemeralUserId(t.uid)},s.prototype.noHeaderProcessing=function(t){},s.prototype.processEncryptedSharedSecretHeader=function(t){},s.prototype.processDisplayNameHeader=function(t){this._sdk.log(e.LogLevel.Debug,(function(){return"Processing display name header '"+t.display_name+"'"})),n.User.updateUserDisplayName(t.display_name,this._user,this._sdk)},s.prototype.processUidTokenHeader=function(t){this._sdk.log(e.LogLevel.Debug,(function(){return"Processing uid_token header '"+t.token+"', uid hash '"+t.uid_hash+"'"})),n.User.updateUserIdTokenForSession(t.token,this,t.uid_hash)},s.prototype.processDeviceKeyRollSuccess=function(t){if(this._sdk.log(e.LogLevel.Debug,(function(){return"DeviceKeyRoll: Processing device_key_roll_success header. device_key_roll_success = '"+t.device_key_roll_success+"'."})),t.device_key_roll_success&&this._deviceKeyRollData){var n=this._user.deviceSigningKeyTag;this._user.updateDeviceKeyTagSaltAndSave(this._deviceKeyRollData.salt),this._deviceKeyPair=this._deviceKeyRollData.deviceKeyPair,this._deviceKeyRollData=null;try{this._sdk.host.deleteKeyPair(n)}catch(t){this._sdk.log(e.LogLevel.Warning,(function(){return"DeviceKeyRoll: Can't delete old device signing key."}))}}},s.prototype.processAccountProtectionSetAuthenticatedUser=function(t){this._sdk.log(e.LogLevel.Debug,(function(){return"Processing account protection set authenticated user header '"+t.user_id+"'"}));try{s.acpExtensionPoint.firstNonNull((function(e){return e.setAuthenticatedUser(t.user_id)}))}catch(t){this._sdk.log(e.LogLevel.Error,(function(){return"Unexpected error when attempting to set authenticated user;\n"+t}))}},s.prototype.verifyDevicePublicKey=function(t){var n=e.util.calcPublicKeyHexStringEncodedSha256Hash(this.deviceSigningKeyPair,this._sdk);return this._sdk.log(e.LogLevel.Debug,(function(){return"DeviceKeyRoll: verify server key hash matches device key hash: "+(n===t)})),n===t},s.prototype.urlWithConcatenatedQuery=function(t,e){var n="";return t.indexOf("?")<0?n="?":"&"!=t[t.length-1]&&(n="&"),t+n+Object.keys(e).map((function(t){return t+"="+encodeURIComponent(e[t])})).join("&")},Object.defineProperty(s.prototype,"clientVersionHeader",{get:function(){if(!this._cachedClientVersionHeader){var t=this._sdk.getClientFeatureSet().join(",");this._cachedClientVersionHeader=this._sdk.getVersionInfo().getSdkVersion()+";["+t+"]"}return this._cachedClientVersionHeader}
10,enumerable:!1,configurable:!0}),s.prototype.createPluginSessionInfo=function(){return new o(this)},s.prototype.lock=function(){var t=this;this._sdk.log(e.LogLevel.Debug,(function(){return"Locking session "+t._sessionId})),this._lockCount++},s.prototype.unlock=function(){var t=this;if(this._sdk.log(e.LogLevel.Debug,(function(){return"Unlocking session "+t._sessionId})),this._lockCount--,this._lockCount<0)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Unbalanced session locking: Attempt to unlock an already unlocked sessoin.")},s.prototype.canTerminate=function(){return!this._lockCount},s.prototype.toJson=function(){var t={session_id:this._sessionId,user_guid:this._user.guid.toString(),device_id:this._deviceId,invalidated:this._invalidated,persistUserData:this._persistUserData,anonymous:this._anonymous};return this._persistUserData||(t.nonPersistentUser=n.User.toUserRecord(this._user)),this._currentCryptoSession&&this._currentCryptoSession.isReady()&&(t.c_session=this._currentCryptoSession.toJson()),t},s.fromJson=function(t,r){var o=r,i=o.persistUserData?n.User.findUserByGuid(t,n.UserGuid.createFromString(o.user_guid)):o.nonPersistentUser&&n.User.fromUserRecord(o.nonPersistentUser,t);if(!i)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Can't deserialize session -- user "+o.user_guid+" not found.");return this.fromJsonWithUser(t,r,i)},s.fromJsonWithUser=function(t,e,r){var o=e,i=new s(t,r);return i._sessionId=o.session_id,i._deviceId=o.device_id,i._invalidated=o.invalidated||!1,i._persistUserData=o.persistUserData||!0,i._anonymous=o.anonymous||!1,o.c_session&&(i._currentCryptoSession=n.Scheme2CryptoSession.fromJson(t,o.c_session)),i},s.prototype.updateFromContinuedSession=function(t){this.user.updateFromContinuedSessionUser(t.user)},s.notifySessionObserversOnMainSessionLogin=function(t){var e=t.createPluginSessionInfo();this.sessionObservationExtensionPoint.forEach((function(t){t.mainSessionStarted(e)}))},s.notifySessionObserversOnMainSessionLogout=function(t){var e=t.createPluginSessionInfo();this.sessionObservationExtensionPoint.forEach((function(t){t.mainSessionEnded(e)}))},s.acpExtensionPoint=n.ExtensionPoint.byName(t.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_ACCOUNT_PROTECTION),s.headerProcessors={session_id:s.prototype.processSessionIdHeader,device_id:s.prototype.processDeviceIdHeader,encrypted_shared_secret:s.prototype.processEncryptedSharedSecretHeader,session_state:s.prototype.processSessionStateChangeHeader,ephemeral_uid:s.prototype.processSessionEphemeralUserHeader,key_exchange:s.prototype.processKeyExchangeResponseHeader,encryption:s.prototype.noHeaderProcessing,display_name:s.prototype.processDisplayNameHeader,uid_token:s.prototype.processUidTokenHeader,device_key_roll_success:s.prototype.processDeviceKeyRollSuccess,acp_set_authenticated_user:s.prototype.processAccountProtectionSetAuthenticatedUser},s.messageFilteringExtensionPoint=new n.ExtensionPoint(t.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_MESSAGE_FILTERS),s.sessionObservationExtensionPoint=new n.ExtensionPoint(t.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_SESSION_OBSERVERS),s}(n.BaseSession);n.Session=r;var o=function(){function t(t){this._underlying=t}return t.prototype.getUsername=function(){return this._underlying.user.displayName},t}(),i=function(){function t(t){this._underlying=t}return t.prototype.getMethod=function(){return this._underlying.method},t.prototype.getBody=function(){return this._underlying.body},t.prototype.getHeaders=function(){return this._underlying.envelopeHeaders},t.prototype.addHeader=function(t){this._underlying.addEnvelopeHeader(t)},t}()})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(){function n(n,r,o,i,s){if(this.flowId=s,n instanceof e.SerializationContext)this.serializeFrom(n);else{if("string"!=typeof n||!r||!o)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid arguments for constructing session message");this._requestMethod=n,this._requestServerRelativeUrl=r,this._requestBody=o,this._envelopeHeaders=i||[]}var a=this.createFlowIdSdkHeader();a&&this._envelopeHeaders.push(a)}return n.prototype.addEnvelopeHeader=function(t){this._envelopeHeaders.push(t)},Object.defineProperty(n.prototype,"method",{get:function(){return this._requestMethod}
10,enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"serverRelativeUrl",{get:function(){return this._requestServerRelativeUrl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this._requestBody},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"envelopeHeaders",{get:function(){return this._envelopeHeaders},enumerable:!1,configurable:!0}),n.prototype.serializeTo=function(t){t.writePrimitive("envelopeHeaders",this._envelopeHeaders),t.writePrimitive("requestBody",this._requestBody),t.writePrimitive("requestMethod",this._requestMethod),t.writePrimitive("requestServerRelativeUrl",this._requestServerRelativeUrl)},n.prototype.serializeFrom=function(t){this._envelopeHeaders=t.readPrimitive("envelopeHeaders"),this._requestBody=t.readPrimitive("requestBody"),this._requestMethod=t.readPrimitive("requestMethod"),this._requestServerRelativeUrl=t.readPrimitive("requestServerRelativeUrl")},n.prototype.getFlowId=function(){return this.flowId},n.prototype.createFlowIdSdkHeader=function(){var t;return this.flowId?((t={type:e.Protocol.flowIdHeaderName})[e.Protocol.flowIdHeaderName]=this.flowId,t):null},n=J([e.Serializable("ExchangeRequest"),Q("design:paramtypes",[Object,String,Object,Array,String])],n)}();e.BaseExchangeRequest=n;var r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n=J([e.Serializable("SessionExchangeReqeust")],n)}(n);e.SessionExchangeRequest=r;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e}(n);e.PublicExchangeRequest=o}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e;(function(n){var r=function(){function t(t,e){this._sdk=t,this._hostedPluginName=e.getPluginInfo().getPluginName()}return t.prototype.extend=function(t,e){n.ExtensionPoint.byName(t).extend(e)},t.prototype.getSdk=function(){return this._sdk},t.prototype.generateRandomHexString=function(t){return this._sdk.host.generateRandomHexString(t)},t.prototype.suspendControlFlowToDefaultSuspensionContext=function(t){this._sdk.suspendControlFlowToDefaultSuspensionContext(t)},t.prototype.log=function(t,e){this._sdk.host.log(t,"TransmitSDK/Tarsus/Plugin/"+this._hostedPluginName,e)},t}();n.TarsusPluginHostImpl=r;var o=function(){function n(t){this._installedPluginsAndConfigs={},this._initializedPlugins=[],this._sdk=t}return n.prototype.getInitializedPlugins=function(){return this._initializedPlugins.concat([])},n.prototype.installPlugin=function(t,n){if(this._installedPluginsAndConfigs[t])throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Attempt to install plugin "+t+" twice.");this._installedPluginsAndConfigs[t]=n},n.prototype.initializePlugins=function(){var n=this;this._sdk.log(e.LogLevel.Debug,(function(){return"Starting plugin initialization..."}));var o=Object.keys(this._installedPluginsAndConfigs).map((function(o){return n._sdk.log(e.LogLevel.Debug,(function(){return"Loading plugin "+o+"..."})),n._sdk.host.loadPlugin(o).then((function(i){var s=i.getPluginInfo(),a=t.tarsusplugin.impl.PluginInfoImpl.toString(s);if(i.getPluginInfo().getPluginName()!=o)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Plugin "+o+": getPluginInfo() reported mismatched name -- "+a+".");n._sdk.log(e.LogLevel.Info,(function(){return"Initializing plugin "+a+"..."}));var c=new r(n._sdk,i);return i.initialize(c,n._installedPluginsAndConfigs[o]).then((function(){n._initializedPlugins.push(i)})).catch((function(t){n._sdk.log(e.LogLevel.Error,(function(){return"Couldn't initialize plugin "+a+": "+t}))}))}))}));return Promise.all(o).then((function(){n._sdk.log(e.LogLevel.Debug,(function(){return"Plugin initialization completed sucessfuly"}))}))},n}();n.TarsusPluginManager=o})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r;r=t.sdk||(t.sdk={}),e=r.core||(r.core={}),n=function(){function t(t,n){this._locale=n,this._sdk=t,this._serverClientStrings=new e.ClientStrings({}),this._cachedClientStrings=new e.ClientStrings({})}return Object.defineProperty(t.prototype,"locale",{get:function(){return this._locale}
10,enumerable:!1,configurable:!0}),t.prototype.isServerClientStringsEmpty=function(){var t=this._serverClientStrings.strings;return null==t||0===Object.keys(t).length&&t.constructor===Object},t.prototype.setServerClientStrings=function(t){this._serverClientStrings=t,this._cachedClientStrings=new e.ClientStrings({})},t.prototype.applyGlobalStyleSheetJson=function(t){this._styleSheetJson||(this._styleSheetJson=JSON.parse(this._sdk.host.getUIStyles())),this._styleSheetJson=e.UIStyleSheets.merge(this._styleSheetJson,t),this._cachedBaseStylesheet=null},Object.defineProperty(t.prototype,"uiStylesheets",{get:function(){return this.getUiStylesheetsWithOverrides()},enumerable:!1,configurable:!0}),t.prototype.getUiStylesheetsWithOverrides=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._styleSheetJson||(this._styleSheetJson=JSON.parse(this._sdk.host.getUIStyles())),t.length?new(e.UIStyleSheets.bind.apply(e.UIStyleSheets,X([void 0,this._styleSheetJson],t))):(this._cachedBaseStylesheet||(this._cachedBaseStylesheet=new e.UIStyleSheets(this._styleSheetJson)),this._cachedBaseStylesheet)},t.prototype.getString=function(t){var e=null;return(e=this._cachedClientStrings.getString(t))?e:(this._serverClientStrings&&(e=this._serverClientStrings.getString(t)),null==e&&(e=this._sdk.host.getString(t,this._locale)),e&&this.storeInLocalCache(t,e),e)},t.prototype.storeInLocalCache=function(t,e){e&&this._cachedClientStrings&&(this._cachedClientStrings.strings[t]=e)},t}(),e.UIAssetsData=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e;(function(t){var n=function(){function t(){}return t.prototype.toString=function(){return this._guidStr},t.prototype.equalString=function(t){return this._guidStr==t},t.prototype.equalsUserGuid=function(t){return this.toString()==t.toString()},t.createWithLength=function(e,n){var r=new t;return r._guidStr=n.host.generateRandomHexString(e),r},t.createFromString=function(e){var n=new t;return n._guidStr=e,n},t}();t.UserGuid=n;var r=function(){function r(){}return Object.defineProperty(r.prototype,"guid",{get:function(){return this._guid},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"displayName",{get:function(){return(this._ephemeral?"anonymous":this._displayName)||this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"idToken",{get:function(){return this._idToken},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uidHash",{get:function(){return this._uidHash},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"deviceId",{get:function(){return this._deviceId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"phoneNumber",{get:function(){return this._phoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"defaultAuthId",{get:function(){return this._defaultAuthId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"deviceBound",{get:function(){return this._deviceBound},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hasLoggedIn",{get:function(){return this._hasLoggedIn},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"deviceEncryptionKeyTag",{get:function(){return new t.TarsusKeyPath("per_user",this._guid.toString(),"enc_enabled")},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"ephemeralUserId",{get:function(){return this._ephemeralUserId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userHandle",{get:function(){return this._userId||this._idToken},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"userHandleType",{get:function(){return this._userId?e.UserHandleType.UserId:e.UserHandleType.IdToken},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"deviceSigningKeyTag",{get:function(){return this._deviceSigningKeyTagSalt?new t.TarsusKeyPath("per_user",this._guid.toString(),"device_key",this._deviceSigningKeyTagSalt):new t.TarsusKeyPath("per_user",this._guid.toString(),"device_key")}
10,enumerable:!1,configurable:!0}),r.prototype.getPendingDeviceSigningKeyTag=function(e){return new t.TarsusKeyPath("per_user",this._guid.toString(),"device_key",e)},r.prototype.updateDeviceKeyTagSaltAndSave=function(t){this._deviceSigningKeyTagSalt=t,r.save(this._sdk,this)},Object.defineProperty(r.prototype,"localEnrollments",{get:function(){return this._localEnrollments||(this._localEnrollments=t.LocalEnrollment.enrollmentsForUser(this,this._sdk)),this._localEnrollments},enumerable:!1,configurable:!0}),r.prototype.updateDefaultAuthId=function(t){this._defaultAuthId=t},r.prototype.updateEphemeralUserId=function(t){if(!this._ephemeral)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid ephemeral user name update reaquest header, user is not ephemeral.");if(this._ephemeralUserId)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to set an ephemeral userId after it has already been updated once.");this._ephemeralUserId=t},r.updateUserDisplayName=function(t,e,n){e._displayName=t,n.currentSession&&n.currentSession.persistUserData&&r.save(n,e)},r.updateUserIdTokenForSession=function(t,e,n){var o=e.user;o._idToken=t,o._uidHash=n,delete o._userId,e.persistUserData&&r.save(e.sdk,o)},r.resetUserIdTokenForSession=function(t){var e=t.user;delete e._idToken,t.persistUserData&&r.save(t.sdk,e)},r.prototype.updateFromContinuedSessionUser=function(t){if(!this._guid.equalsUserGuid(t.guid))throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"GUID mismatch when updating user from continuation");this._defaultAuthId=t._defaultAuthId,this._deviceBound=t._deviceBound,this._hasLoggedIn=t._hasLoggedIn,this._deviceId=t._deviceId,this._phoneNumber=t._phoneNumber,this._userId=t._userId,this._idToken=t._idToken,this._displayName=t._displayName,this._uidHash=t._uidHash},r.prototype.setProvisionalDeviceId=function(t){if(this.deviceBound)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to record a provisional device ID for an already bound user record.",{});this._deviceId=t},r.prototype.bindDeviceToUser=function(t){if(this.deviceBound)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to record a device for an already bound user record.",{});if(this._deviceId!=t)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to bind user to a device ID different than provisional device ID.",{});this._deviceBound=!0},r.prototype.markLoggedIn=function(){this._hasLoggedIn=!0},r.iterateUsers=function(t,e){for(var n=t.host.readStorageKey(r.storageKey)||[],o=t.currentSession&&t.currentSession.user,i=0;i<n.length;i++){var s=r.fromUserRecord(n[i],t),a=e(s);if(null!=a)return a;o&&o.guid.equalsUserGuid(s.guid)&&(o=null)}return o?e(o):null},r.findUserByUidToken=function(t,n){return r.iterateUsers(t,(function(r){return r.idToken&&r.idToken===n?(t.log(e.LogLevel.Debug,(function(){return"Located user based on id token, guid: '"+r.guid+"'"})),r):null}))},r.calculateUidHash=function(t,n){var r=n.toLowerCase(),o=e.util.hexToBase64(t.host.calcHexStringEncodedSha256Hash(e.util.asciiToHex(r)));return t.log(e.LogLevel.Debug,(function(){return"Calculated uid hash, input: '"+r+", hash: '"+o+"'"})),o},r.findUserByUidHash=function(t,n){var o=this;return t.log(e.LogLevel.Debug,(function(){return"Looking up user based on user id hash, hash: '"+n+"'"})),r.iterateUsers(t,(function(r){return n==r._uidHash?(t.log(e.LogLevel.Debug,(function(){return"Located user based on uid hash, guid: '"+r.guid+"'"})),r):r.userId&&o.calculateUidHash(t,r.userId)==n?(t.log(e.LogLevel.Debug,(function(){return"Located user with user id based on uid hash, guid: '"+r.guid+"'"})),r):null}))},r.findUserByUserId=function(t,n){var o=this.calculateUidHash(t,n);return t.log(e.LogLevel.Debug,(function(){return"Looking up user based on user id, userId: '"+n+"'"})),r.iterateUsers(t,(function(r){return r.userId&&r.userId.toLowerCase()===n.toLowerCase()?(t.log(e.LogLevel.Debug,(function(){return"Located user based on user id, guid: '"+r.guid+"'"})),r):r.userId||o!=r._uidHash?null:(t.log(e.LogLevel.Debug,(function(){return"Located user based on uid hash, guid: '"+r.guid+"'"})),r.idToken||(r._userId=n),r)}))},r.findUserByGuid=function(t,n){return r.iterateUsers(t,(function(r){return r.guid.equalsUserGuid(n)?(t.log(e.LogLevel.Debug,(function(){return"Located user based on guid, guid: '"+r.guid+"'"})),r):null}))},r.findUser=function(t,e){return 0==e.indexOf("uidt:")?this.findUserByUidToken(t,e):this.findUserByUserId(t,e)},r.findUserWithType=function(t,n,r){if(r){if(r===e.UserHandleType.IdToken)return this.findUserByUidToken(t,n);if(r===e.UserHandleType.UserId)return this.findUserByUserId(t,n);throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Unsupported user handle type",{user_handle_type:r})}return this.findUser(t,n)},r.createUserWithUserId=function(t,n){if(!n)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"userHandle must not be empty");var r=this.createBaseUser(t);return r._userId=n,r._uidHash=e.util.hexToBase64(t.host.calcHexStringEncodedSha256Hash(e.util.asciiToHex(n))),r},r.createUserWithIdToken=function(t,n,r){if(!n)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"userHandle must not be empty");var o=this.createBaseUser(t);return o._idToken=n,o._uidHash=r,o},r.createBaseUser=function(t){var e=new r;return e._guid=n.createWithLength(32,t),e._deviceBound=!1,e._hasLoggedIn=!1,e._phoneNumber="",e._sdk=t,e._ephemeral=!1,e._deviceSigningKeyTagSalt=t.host.generateRandomHexString(24),e},r.createEphemeralUser=function(t){var e=new r;return e._guid=n.createWithLength(32,t),e._deviceBound=!1,e._hasLoggedIn=!1,e._phoneNumber="",e._sdk=t,e._ephemeral=!0,e._ephemeralUserId=null,e},r.deleteUser=function(t,n){var o=n.host.readStorageKey(r.storageKey)||[];n.log(e.LogLevel.Warning,(function(){return"=== CURRENTL LEN "+o.length}));for(var i=0;i<o.length;i++){var s=r.fromUserRecord(o[i],n);if(t.guid.equalsUserGuid(s.guid))break}if(i<o.length){for(;i<o.length-1;)o[i]=o[i+1],i++;var a=o.length-1;
10delete o[o.length-1],o.length=a,n.host.writeStorageKey(r.storageKey,o)}else n.log(e.LogLevel.Warning,(function(){return"Attempt to delete nonexisting user "+t.userHandle}))},r.prototype.createEnrollmentRecord=function(e,n,r,o,i){var s=t.LocalEnrollment.createNew(e,n,r,this._sdk,i);return s.status=o,s},r.prototype.updateEnrollmentRecord=function(n){if(this._ephemeral)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to update enrollment record for ephemeral user.",{});var r={};for(var o in this.localEnrollments)r[o]=this.localEnrollments[o];r[n.authenticatorId]=n,t.LocalEnrollment.updateEnrollmentsForUser(this,r,this._sdk),this._localEnrollments=r},r.toUserRecord=function(t){var e={default_auth_id:t._defaultAuthId,device_bound:t._deviceBound,has_logged_in:t._hasLoggedIn,device_id:t._deviceId,last_auth:"<null>",guid:t._guid.toString(),user_id:t.userId,display_name:t._displayName,id_token:t._idToken,uid_hash:t._uidHash,user_number:t._phoneNumber,schemeVersion:"v1",device_signing_key_tag_salt:t._deviceSigningKeyTagSalt};return t._ephemeralUserId&&(e.ephemeral_id=t._ephemeralUserId),e},r.save=function(t,n){if(n._ephemeral)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to save ephemeral user record to persistent store.",{});var o=t.host.readStorageKey(r.storageKey)||[];o.length=o.length||0;for(var i=0;i<o.length&&!r.fromUserRecord(o[i],t).guid.equalsUserGuid(n.guid);i++);o[i]=r.toUserRecord(n),o.length<i+1&&(o.length=i+1),t.host.writeStorageKey(r.storageKey,o)},r.fromUserRecord=function(t,e){var o=new r;return o._sdk=e,o._defaultAuthId=t.default_auth_id,o._deviceBound=t.device_bound,o._hasLoggedIn=t.has_logged_in,o._deviceId=t.device_id,o._phoneNumber=t.user_number,o._deviceSigningKeyTagSalt=t.device_signing_key_tag_salt,o._userId=t.user_id,o._idToken=t.id_token,o._uidHash=t.uid_hash,t.ephemeral_id&&(o._ephemeral=!0,o._ephemeralUserId=t.ephemeral_id),t.schemeVersion?(o._guid=n.createFromString(t.guid),o._displayName=t.display_name):(o._guid=n.createFromString(t.user_id),o._displayName=t.user_id),o},r.storageKey=new t.TarsusKeyPath("users"),r}();t.User=r})((e=t.sdk||(t.sdk={})).core||(e.core={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){t.InternalErrorWrongBiometric=1e3,t.InternalErrorBiometricInvalidated=1001,t.InternalErrorBiometricKeyStoreError=1002,t.InternalErrorBiometricNotConfigured=1003,t.InternalErrorBiometricOsLockTemporary=1004,t.InternalErrorBiometricOsLockPermanent=1005,t.InternalErrorBiometricFallbackPressed=1006,t.InternalErrorCouldNotGenerateSecureKey=1007,t.ErrorDataInternalError="internal_error",t.ErrorDataNumFailures="num_failures",t.ErrorDataServerErrorCode="server_error_code",t.ErrorDataServerErrorMessage="server_error_message",t.ErrorDataServerErrorData="server_error_data",t.ErrorDataRetriesLeft="retries",t.ErrorDataCommunicationError="communication_error",t.ErrorDataCommunicationSSL="ssl",t.FeatureCodeServerHeaders=1,t.FeatureCodeAuthFailover=2,t.FeatureCodeUnifiedRegFlow=3,t.FeatureCodePromotionAction=6,t.FeatureCodeSilentFingerprintRegistration=7,t.FeatureCodeMultiMethodRegistrationAction=8,t.FeatureCodeOtpCodeInvalidated=10,t.FeatureCodeEnvelopedClientRequest=11,t.FeatureCodeUnregistrationFlow=12,t.FeatureCodeFaceIdAuthentication=13,t.FeatureCodeDynamicPolicySupport=14,t.FeatureCodeAutoRequestForSignContent=19,t.FeatureDeviceBiometricsFPContinuation=27,t.FeatureCodeDebugBreakpointActionSupport=28,t.FeatureCodeFido2ClientEcKeyExtSupport=37,t.FeatureCodeMultiCredVaultFido2Support=38}(t.sdkhost||(t.sdkhost={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(e){e.TARSUS_VERSION="7.3.18",e.API_LEVEL=11,e.STATIC_FEATURE_SET=[t.sdkhost.FeatureCodeServerHeaders,t.sdkhost.FeatureCodeAuthFailover,t.sdkhost.FeatureCodeUnifiedRegFlow,t.sdkhost.FeatureCodePromotionAction,t.sdkhost.FeatureCodeSilentFingerprintRegistration,t.sdkhost.FeatureCodeMultiMethodRegistrationAction,t.sdkhost.FeatureCodeOtpCodeInvalidated,t.sdkhost.FeatureCodeEnvelopedClientRequest,t.sdkhost.FeatureCodeUnregistrationFlow,t.sdkhost.FeatureCodeDynamicPolicySupport,t.sdkhost.FeatureCodeDebugBreakp
10ointActionSupport]}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(r){function o(t,e){return r.call(this,t,e)||this}return V(o,r),o.prototype.run=function(){return $(this,void 0,void 0,(function(){var r,i,s,a,c;return Y(this,(function(u){switch(u.label){case 0:this._sdk.log(e.LogLevel.Debug,(function(){return"Executing ACP action."})),r=n.ExtensionPoint.firstNonNullByName(t.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_ACCOUNT_PROTECTION),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,r.getActionToken(this.action.action_type,this.action.user_id,this.action.correlation_id)];case 2:return i=u.sent(),c={action_token:i.getActionToken()},[2,this.sendAssertionRequest(o.AssertActionSendData,c)];case 3:return s=u.sent(),a=e.impl.AuthenticationErrorImpl.ensureAuthenticationError(s),c={message:a.getMessage(),data:a.getData()},[2,this.sendAssertionRequest(o.AssertActionClientError,c)];case 4:return[2]}}
10))}))},Object.defineProperty(o.prototype,"action",{get:function(){return this._action},enumerable:!1,configurable:!0}),o.AssertActionSendData="data",o.AssertActionClientError="client_error",o}(r.ActionDriver);r.ActionDriverAccountProtection=o}(n.actiondrivers||(n.actiondrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(n,r){var o=e.call(this,n,r)||this;return o._clientContext=o._controlFlowProcessor._clientContext,o._cancellationHolder=new t.util.CancelablePromiseHolder,o}return V(n,e),n.prototype.run=function(){var e=this;return this._cancellationHolder.resolveWith((function(t,n){e.doRunAction().then(t,n)})),this._cancellationHolder.cancellablePromise.catch((function(n){if(n==t.util.CancelablePromiseHolder.CancelRequest)return e._controlFlowProcessor.createExternalCancellationRejectionPromise();throw n}))},n.prototype.cancelRun=function(){this._cancellationHolder.cancel()},n}(e.ActionDriver);e.SimpleCancellationActionDriver=n}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(n){!function(r){!function(r){var o=function(r){function o(t,e){return r.call(this,t,e)||this}return V(o,r),o.prototype.doRunAction=function(){var r=this;this._sdk.log(n.LogLevel.Debug,(function(){return"Executing Anonymous FIDO2 authentication."}));var o=this._action;return this._sdk.host.fido2CredentialsOp(this._uiHandler,this._controlFlowProcessor,this._policyAction,e.sdkhost.Fido2CredentialsOpType.Get,o.credentialRequestOptions).then((function(t){var e={assertion_credential:t};return r.sendAssertionRequest("authenticate",e)})).catch((function(e){var o=t.ts.mobile.sdk.impl.AuthenticationErrorImpl.ensureAuthenticationError(e);if(o.getErrorCode()===n.AuthenticationErrorCode.UserCanceled){r._sdk.log(n.LogLevel.Debug,(function(){return"Received FIDO2 cancellation request."}));var i=r._policyAction.getEscapeOptions().filter((function(e){return e.getPresentation()==t.ts.mobile.sdk.ActionEscapeOptionPresentation.Cancel}))[0];if(i){r._sdk.log(n.LogLevel.Debug,(function(){return"Got cancel escape option; responding with that."}));var s=new n.ActionEscapeRequest;return s.setEscapeOption(i),r.processEscapeRequest(s)}}throw o}))},o}(r.SimpleCancellationActionDriver);r.ActionDriverAnonymousFido2Authenticate=o}(r.actiondrivers||(r.actiondrivers={}))}(n.core||(n.core={}))}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(t){function e(e,n,r,o,i,s,a,c){var u=t.call(this,a._controlFlowProcessor._session,e,n,r)||this;return u._assertionId=o,u._retriesLeft=i,u._actionDriver=a,u._fallback=s,u._registration=c,u}return V(e,t),Object.defineProperty(e.prototype,"authDriver",{get:function(){return this._authDriver||(this._authDriver=this.authenticationDriverDescriptor.createAuthenticationDriver(this._actionDriver,this._authenticatorMethodConfig,this)),this._authDriver},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"suggestedParameters",{get:function(){return this.getEnabled()?this.authenticationDriverDescriptor.suggestParameters(this._authenticatorMethodConfig,this):[]},enumerable:!1,configurable:!0}),e.prototype.getEnabled=function(){return(this._registration||this.getRegistered()&&!this.getLocked())&&this.getSupportedOnDevice()},Object.defineProperty(e.prototype,"fallback",{get:function(){return this._fallback},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assertionId",{get:function(){return this._assertionId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"retriesLeft",{get:function(){return this._retriesLeft},enumerable:!1,configurable:!0}),e.prototype.updateWithAssertionResult=function(t){t.retries_left&&(this._retriesLeft=t.retries_left),t.locked&&(this._locked=t.locked)},e.fromUnregistrationAction=function(t,n){return new e(t.method,t,t,t.assertion_id,null,null,n,!1)},e.fromPromotionAction=function(t,n){return new e(t.method,t,t,t.assertion_id,t.retries_left,t.fallback||null,
10n,!0)},e.fromAuthenticationActionMenuOption=function(t,n){return new e(t.type,t,t,t.assertion_id,t.retries_left,t.fallback||null,n,!1)},e.fromRegistrationAction=function(t,n){return new e(t.method,t,t,t.assertion_id,null,null,n,!0)},e}(e.authenticationdrivers.AuthenticatorDescriptionImpl);n.AuthenticationMenuAuthenticator=r;var o=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r._externallyCancelled=!1,r}return V(n,e),n.prototype.doRunAction=function(){var t=this;return new Promise((function(e,n){t._completionFunction=e,t._rejectionFunction=n,t.runActionWithCompletionFunctions()}))},Object.defineProperty(n.prototype,"availableAuthenticatorsForSwitching",{get:function(){return this.availableAuthenticators},enumerable:!1,configurable:!0}),n.prototype.sendPollingRequest=function(t,n){return e.prototype.sendPollingRequest.call(this,t,n)},n.prototype.sendAuthenticatorAssertionRequest=function(e,n,r,o){this._sdk.log(t.LogLevel.Debug,(function(){return"Sending authenticator asserion request for "+e.getAuthenticatorId()+": assert="+n}));var i={assertion_id:e.assertionId,method:e.getAuthenticatorId()};if(o)for(var s in o)i[s]=o[s];return this.sendAssertionRequest(n,r,i)},n.prototype.completeAuthenticationWithAssertionResult=function(t){this._completionFunction(t)},n.prototype.completeAuthenticationWithError=function(t){this._rejectionFunction(t)},n.prototype.completeWithEscapeRequest=function(t){var e=this;this.processEscapeRequest(t).then((function(t){e.completeAuthenticationWithAssertionResult(t)}),(function(t){e.completeAuthenticationWithError(t)}))},n.prototype.prepareForRunningAuthenticationDriver=function(t){return this._externallyCancelled?(this.completeAuthenticationWithError(this._controlFlowProcessor.createExternalCancellationError()),!1):(this._runningAuthenticatorDriver=t,!0)},n.prototype.cancelRun=function(){this._externallyCancelled=!0,this._runningAuthenticatorDriver&&this._runningAuthenticatorDriver.onCancelRun(),e.prototype.cancelRun.call(this)},n}(n.SimpleCancellationActionDriver);n.ActionDriverAuthenticatorOp=o}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(r){function o(t,e){return r.call(this,t,e)||this}return V(o,r),o.prototype.runActionWithCompletionFunctions=function(){var n=this._action;this._sdk.log(t.LogLevel.Debug,(function(){return"Loading authenticator descriptions"})),this.loadAuthenticatorDescriptionsFromAction(n),this._shouldUpdateDefaultAuth=n.options&&n.options.update_default,this._sdk.log(t.LogLevel.Debug,(function(){return"Starting auth presentation"})),this.runWithPresentationMode(n.options&&n.options.start_with||e.Protocol.AuthMenuPresentationMode.DefaultAuthenticator)},Object.defineProperty(o.prototype,"availableAuthenticators",{get:function(){return this.updateAvailableAuthenticatorsList(),this._availableAuthenticators.concat([])},enumerable:!1,configurable:!0}),o.prototype.runWithPresentationMode=function(n,r){var o=this;this.updateAvailableAuthenticatorsList();var i=n==e.Protocol.AuthMenuPresentationMode.AuthenticatorMenu&&this._uiHandler.shouldIncludeDisabledAuthenticatorsInMenu(this.policyAction(),this._clientContext)?this._allAuthenticators:this._availableAuthenticators;if(r&&(i=i.filter((function(t){return r.filter((function(e){return e.getAuthenticatorId()==t.getAuthenticatorId()})).length>0}))),i.length)switch(n){case e.Protocol.AuthMenuPresentationMode.AuthenticatorMenu:var s=i.map((function(e){return new t.impl.AuthenticationOptionImpl(e,e.suggestedParameters)}));this._uiHandler.selectAuthenticator(s,this.policyAction(),this._clientContext).then((function(e){switch(e.getResultType()){case t.AuthenticatorSelectionResultType.Abort:o.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"Cancel during authenticator selection."));break;case t.AuthenticatorSelectionResultType.SelectAuthenticator:if(!(s.filter((function(t){return t.getAuthenticator()==e.getSelectedAuthenticator()}
10)).length>0)){o.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"selectAuthenticator returned an authenticator not within options."));break}if(!e.getSelectedAuthenticator().getEnabled()){o.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"selectAuthenticator returned a non-enabled authenticator."));break}o.runAuthenticator(e.getSelectedAuthenticator(),e.getSelectedAuthenticationParameters());break;case t.AuthenticatorSelectionResultType.Escape:o.completeWithEscapeRequest(e.getActionEscapeRequest())}}));break;case e.Protocol.AuthMenuPresentationMode.DefaultAuthenticator:this._defaultAuthenticator&&this._availableAuthenticators.indexOf(this._defaultAuthenticator)>=0?this.runAuthenticator(this._defaultAuthenticator,[]):(this._sdk.log(t.LogLevel.Warning,(function(){return"Default authenticator for user not found. Falling back to first authenticator in list."})),this.runAuthenticator(this._availableAuthenticators[0],[]));break;case e.Protocol.AuthMenuPresentationMode.FirstAuthenticator:this.runAuthenticator(this._availableAuthenticators[0],[])}else this._allAuthenticators.filter((function(t){return t.getLocked()})).length>0?this.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AllAuthenticatorsLocked,"All authenticators locked.")):this.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.NoRegisteredAuthenticator,"No registered authenticator available."))},o.prototype.loadAuthenticatorDescriptionsFromAction=function(t){var e=this;this._allAuthenticators=t.methods.map((function(t){return n.AuthenticationMenuAuthenticator.fromAuthenticationActionMenuOption(t,e)}))},o.prototype.updateAvailableAuthenticatorsList=function(){var e=this;this._defaultAuthenticator=null,this._availableAuthenticators=[],this._allAuthenticators.forEach((function(t){t.getEnabled()&&e._availableAuthenticators.push(t),t.getDefaultAuthenticator()&&(e._defaultAuthenticator=t)})),this._defaultAuthenticator||(this._defaultAuthenticator=this._availableAuthenticators[0]),this._sdk.log(t.LogLevel.Debug,(function(){return"Updated available authenticators list; "+e._availableAuthenticators.length+" available authenticators"}))},o.prototype.runAuthenticator=function(n,r){var o=this,i=n.authDriver;this.prepareForRunningAuthenticationDriver(i)&&i.runAuthentication(r).then((function(r){if(r instanceof e.authenticationdrivers.AuthenticationDriverSessionResultSwitchAuthenticator)r.requiredAuthenticator?o.runAuthenticator(r.requiredAuthenticator,[]):o.runWithPresentationMode(e.Protocol.AuthMenuPresentationMode.AuthenticatorMenu,r.allowedAuthenticators);else if(r instanceof e.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted){if(o._shouldUpdateDefaultAuth&&(o._sdk.log(t.LogLevel.Info,(function(){return"Updating user default authenticator."})),!o._controlFlowProcessor._session.anonymous)){var i=o._controlFlowProcessor._session.user;i.updateDefaultAuthId(n.getAuthenticatorId()),o._controlFlowProcessor._session.persistUserData&&e.User.save(o._sdk,i)}o.completeAuthenticationWithAssertionResult(r.assertionResult)}else r instanceof e.authenticationdrivers.AuthenticationDriverSessionResultEscapeRequested?o.completeWithEscapeRequest(r.escapeRequest):o.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered."))}),(function(e){o._sdk.log(t.LogLevel.Debug,(function(){return"Received authentication driver error "+e})),o.completeAuthenticationWithError(e)}))},o}(n.ActionDriverAuthenticatorOp);n.ActionDriverAuthentication=r}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(n){function r(t,e){return n.call(this,t,e)||this}return V(r,n),r.prototype.doRunAction=function(){var n=this;this._sdk.log(t.LogLevel.Debug,(function(){return"Executing confirmation action."}));var r=this._action;return this._uiHandler.getConfirmationInput(r.title,r.text,r.continue_button_text,r.cancel_button_text,this.policyAction(),this._clientContext).then((function(o){var i=o.getActionEscapeRequest
10();if(i)return n.processEscapeRequest(i);var s={user_cancelled:1==o.getUserChoice()},a=Promise.resolve(s);if(r.require_sign_content){var c={params:{title:r.title,text:r.text,continue_button_text:r.continue_button_text,cancel_button_text:r.cancel_button_text,parameters:r.parameters,image:r.image},user_input:s.user_cancelled?r.cancel_button_text:r.continue_button_text};a=a.then((function(t){return e.ActionDriverSignContent.augmentAssertionDataWithSignedContent(t,c,n._controlFlowProcessor._session.deviceSigningKeyPair,n._sdk)}))}return a.then((function(e){return n._sdk.log(t.LogLevel.Debug,(function(){return"Asserting confirmation: "+e})),n.sendAssertionRequest(null,e).then((function(t){return t}))}))}))},r}(e.SimpleCancellationActionDriver);e.ActionDriverConfirmation=n}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e){return n.call(this,t,e)||this}return V(r,n),r.prototype.doRunAction=function(){var e=this;return this._sdk.log(t.LogLevel.Debug,(function(){return"Executing debug break action."})),this._sdk.host.setDebugIndicatorVisible(!0),this.pollUntilDone().finally((function(){e._sdk.host.setDebugIndicatorVisible(!1)}))},r.prototype.pollUntilDone=function(){var n=this,r={};return t.util.wrapPromiseWithActivityIndicator(this._uiHandler,this._policyAction,this._clientContext,this._sdk.host.createDelayedPromise(250)).then((function(){return n.sendAssertionRequest(null,r)})).then((function(t){return t.assertion_error_code==e.Protocol.AssertionErrorCode.NotFinished?n.pollUntilDone():t}))},r}(n.SimpleCancellationActionDriver);n.ActionDriverDebugBreak=r}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e){return n.call(this,t,e)||this}return V(r,n),r.prototype.doRunAction=function(){var n=this;this._sdk.log(t.LogLevel.Debug,(function(){return"Executing disable TOTP action..."}));var r=this._action,o=e.totp.TotpPropertiesProcessor.createWithUser(this._controlFlowProcessor._session.user,this._sdk,this._clientContext,this._controlFlowProcessor._session);return this._sdk.log(t.LogLevel.Debug,(function(){return"Obtained TOTP processor."})),r.config_ids.forEach((function(e){n._sdk.log(t.LogLevel.Debug,(function(){return"Deleting TOTP processor "+e+"."})),o.deleteProvisionForGenerator(e),n._sdk.log(t.LogLevel.Debug,(function(){return"TOTP processor "+e+" deleted."}))})),this.sendAssertionRequest()},r}(n.SimpleCancellationActionDriver);n.ActionDriverDisableTotp=r}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(r){function o(t,e){return r.call(this,t,e)||this}return V(o,r),o.prototype.doRunAction=function(){var t=this,n=this._action,r=o.formExtensionPoint.firstNonNull((function(t){return t.createFormSession(n.form_id,n.app_data)}));return r?(this._sdk.log(e.LogLevel.Debug,(function(){return'Using extension of type "com.ts.mobile.plugins.form.settings" for formId '+n.form_id})),this.session=r):this.session=this._uiHandler.createFormSession(n.form_id,n.app_data),this.session?new Promise((function(e,n){t.completionFunction=e,t.rejectionFunction=n,t.session.startSession(t._clientContext,t.policyAction()),t.session.promiseFormInput().then((function(e){return t.processPromiseResult(e)}),t.rejectionFunction)})):Promise.reject(e.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createFormSession."))},o.prototype.processPromiseResult=function(t){switch(t.getControlRequest()){case e.FormControlRequest.Submit:var n={input:t.getJsonData()};this.request(n);break;case e.FormControlRequest.Abort:this.terminateSession(),this.rejectionFunction(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.UserCanceled,"User cancelled a form action."));break;case e.FormControlRequest.Escape:this.terminateSession(),this.processEscapeRequest
10(t.getActionEscapeRequest()).then(this.completionFunction,this.rejectionFunction)}},o.prototype.terminateSession=function(){this.session&&(this.session.endSession(),delete this.session)},o.prototype.request=function(t){var e=this;this.sendAssertionRequest(null,null,t).then((function(t){var r=t.data;switch(t.assertion_error_code){case n.Protocol.AssertionErrorCode.NotFinished:e.session.onContinue(r),e.session.promiseFormInput().then((function(t){return e.processPromiseResult(t)}),e.rejectionFunction);break;case n.Protocol.AssertionErrorCode.RepeatCurrentStep:e.session.onError(r),e.session.promiseFormInput().then((function(t){return e.processPromiseResult(t)}),e.rejectionFunction);break;default:e.terminateSession(),e.completionFunction(t)}})).catch((function(t){e.terminateSession(),e.rejectionFunction(t)}))},o.formExtensionPoint=new n.ExtensionPoint(t.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_FORMS_EXTENSION),o}(r.SimpleCancellationActionDriver);r.ActionDriverForm=o}(n.actiondrivers||(n.actiondrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n){return e.call(this,t,n)||this}return V(n,e),n.prototype.doRunAction=function(){var e=this;this._sdk.log(t.LogLevel.Debug,(function(){return"Executing information action."}));var n=this._action;return this._uiHandler.getInformationResponse(n.title,n.text,n.button_text,this.policyAction(),this._clientContext).then((function(n){if(n.getActionEscapeRequest())return e.processEscapeRequest(n.getActionEscapeRequest());if(e._sdk.log(t.LogLevel.Debug,(function(){return"Asserting information"})),-1!=n.getUserChoice())throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"ConfirmationInput.getUserChoice must be set to -1.");return e.sendAssertionRequest()}))},n}(e.SimpleCancellationActionDriver);e.ActionDriverInformation=n}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(t){function e(e,r){var o=t.call(this,e)||this;return e instanceof n.SerializationContext||(o._idpSessionContinuationData=r),o}return V(e,t),Object.defineProperty(e.prototype,"idpSessionContinuationData",{get:function(){return this._idpSessionContinuationData},enumerable:!1,configurable:!0}),e.prototype.createResumableProcess=function(t){return new i(t,this)},e.prototype.serializeTo=function(e){t.prototype.serializeTo.call(this,e),e.writePrimitive("idpSessionContinuation",this._idpSessionContinuationData)},e.prototype.serializeFrom=function(e){t.prototype.serializeFrom.call(this,e),this._idpSessionContinuationData=e.readPrimitive("idpSessionContinuation")},e=J([n.Serializable("ActionDriverInvokeIdpContinuation"),Q("design:paramtypes",[Object,Object])],e)}(r.ResumableProcessActionContinuation);r.ActionDriverInvokeIdpContinuation=o;var i=function(r){function i(){return null!==r&&r.apply(this,arguments)||this}return V(i,r),i.prototype.extensionPointForIdp=function(){var t=this,n=i.idpExtensionPoint.first((function(e){return e.canHandleIdp(t.idpName)}));if(!n)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Could not locate IDP handler plugin for idp "+this.idpName+".");return n},i.prototype.resume=function(t,n){var r=this;if(!(t instanceof o))throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid continuation type for ActionDriverInvokeIdp");return new Promise((function(e,o){r.extensionPointForIdp().resumeFromContinuation(t.idpSessionContinuationData,n).then((function(t){return r.processIdpResponse(t)})).then(e,o)}))},i.prototype.createContinuation=function(){return new o(this._action,this._activeIdpAuthSession&&this._activeIdpAuthSession.serializeContinuationData())},i.prototype.run=function(){var t=this;return new Promise((function(e,n){var r=t.extensionPointForIdp().createIdpAuthSession(t.idpName);t._activeIdpAuthSession=r,r.startSession(t._controlFlowProcessor._session.user.userHandle,t._action,t.policyAction(),t._clientContext),t._activeIdpAuthSession.invokeIdp().finally((function(){r.endSession(),t._activeIdpAuthSession=null})).then((function(e){return t.processIdpResponse(e)})).then(e,n)}))},Object.defineProperty(i.prototype,"idpName",{get:function(){return this._action.idp_name}
10,enumerable:!1,configurable:!0}),i.prototype.processIdpResponse=function(t){return this.sendAssertionRequest(null,{idp_response:t.getResultPayload()})},i.idpExtensionPoint=new n.ExtensionPoint(t.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_IDP_LOGIN_PROVIDER),i}(r.ResumableProcessActionDriver);r.ActionDriverInvokeIdp=i}(n.actiondrivers||(n.actiondrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n){return e.call(this,t,n)||this}return V(n,e),n.prototype.run=function(){var e=this;return this._sdk.log(t.LogLevel.Debug,(function(){return"Executing JSON data action."})),this.sendAssertionRequest().then((function(r){return e._sdk.log(t.LogLevel.Debug,(function(){return"Executing JSON data action: "+r})),n.handleJsonDataByUiHandler(e._uiHandler,r,r.data.json_data,e._policyAction,e._clientContext)}))},n.handleJsonDataByUiHandler=function(e,n,r,o,i){return e.processJsonData(r,o,i).then((function(e){if(e.getContinueProcessing())return n;throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"User cancelled a JSON action.")}))},n}(e.ActionDriver);e.ActionDriverJsonData=n}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={}));var Z;Z.ts.mobile.tarsusplugin.KycDataCollectionResult,Z.ts.mobile.sdk.InputOrControlResponse;!function(t){!function(n){!function(n){!function(r){!function(o){!function(i){var s=function(t){function e(e,n){var r=t.call(this,e)||this;return e instanceof o.SerializationContext||(r._kycSessionContinuationData=n),r}return V(e,t),Object.defineProperty(e.prototype,"kycSessionContinuationData",{get:function(){return this._kycSessionContinuationData},enumerable:!1,configurable:!0}),e.prototype.createResumableProcess=function(t){return new a(t,this)},e.prototype.serializeTo=function(e){t.prototype.serializeTo.call(this,e),e.writePrimitive("kycSessionContinuation",this._kycSessionContinuationData)},e.prototype.serializeFrom=function(e){t.prototype.serializeFrom.call(this,e),this._kycSessionContinuationData=e.readPrimitive("kycSessionContinuation")},e=J([o.Serializable("ActionDriverKycContinuation"),Q("design:paramtypes",[Object,Object])],e)}(i.ResumableProcessActionContinuation);i.ActionDriverKycContinuation=s;var a=function(i){function a(){return null!==i&&i.apply(this,arguments)||this}return V(a,i),a.prototype.run=function(){return $(this,void 0,void 0,(function(){var t,e,n,r,i;return Y(this,(function(s){switch(s.label){case 0:t=this.extensionPointForKyc(),this._activeKycSession=t.createSession(this.action.vendor_name,this.action.payload),this._activeKycSession.startSession(this._controlFlowProcessor._clientContext,this.policyAction()),s.label=1;case 1:s.trys.push([1,8,9,10]),e=null,s.label=2;case 2:return e&&e.assertion_error_code!=o.Protocol.AssertionErrorCode.NotFinished?[3,7]:(n=e?e.data.payload:this.action.payload,[4,this._activeKycSession.collectKycData(n)]);case 3:return(r=s.sent()).isControlRequest()?[2,this.handleControlRequest(r.getControlRequest())]:[3,4];case 4:return[4,this.handleUserResponse(this._activeKycSession,r.getResponse())];case 5:e=s.sent(),s.label=6;case 6:return[3,2];case 7:return[2,e];case 8:return i=s.sent(),[2,Promise.reject(i)];case 9:return this._activeKycSession.endSession(),[7];case 10:return[2]}}
10))}))},a.prototype.resume=function(t,e){var n=this;if(!(t instanceof s))throw new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.Internal,"Invalid continuation type for ActionDriverKyc");return new Promise((function(r,o){n.extensionPointForKyc().resumeFromContinuation(t.kycSessionContinuationData,e).then((function(t){return n.submitUserResponse(t)})).then(r,o)}))},a.prototype.createContinuation=function(){return new s(this._action,this._activeKycSession&&this._activeKycSession.serializeContinuationData())},a.prototype.handleControlRequest=function(e){switch(this.logDebug((function(){return"Processing control request "+e.getRequestType()})),e.getRequestType()){case r.ControlRequestType.AbortAuthentication:var n=this._policyAction.getEscapeOptions().filter((function(e){return e.getPresentation()==t.ts.mobile.sdk.ActionEscapeOptionPresentation.Cancel}))[0];if(n){this._sdk.log(r.LogLevel.Debug,(function(){return"Got cancel escape option; responding with that."}));var o=new r.ActionEscapeRequest;return o.setEscapeOption(n),this.sendAssertionEscapeRequest(o)}return this.rejectedPromise(r.AuthenticationErrorCode.UserCanceled,"KYC action canceled by user.");default:return this.rejectedPromise(r.AuthenticationErrorCode.AppImplementation,"Unsupported control request: "+e.getRequestType()+" for kyc action.")}},a.prototype.submitUserResponse=function(t){return $(this,void 0,void 0,(function(){var e,n,r;return Y(this,(function(o){switch(o.label){case 0:return this.logDebug((function(){return"Processing kyc data"})),e=t.getPayload(),n={payload:e},[4,this.sendAssertionRequest(a.AssertActionSendData,n)];case 1:return r=o.sent(),this.logDebug((function(){return"Server result: "+r.assertion_error_code})),[2,r]}}))}))},a.prototype.handleUserResponse=function(t,n){return $(this,void 0,void 0,(function(){var r,i,s,c;return Y(this,(function(u){switch(u.label){case 0:return[4,this.submitUserResponse(n)];case 1:r=u.sent(),i=function(){var e,n;return Y(this,(function(o){switch(o.label){case 0:return s.logDebug((function(){return"Received polling assertion response, asking session for duration"})),[4,t.processing(null===(o=r.data)||void 0===o?void 0:o.payload)];case 1:return(e=o.sent()).isControlRequest()?[2,{value:s.handleControlRequest(e.getControlRequest())}]:[3,2];case 2:return n=e.getResponse().getDelay(),s.logDebug((function(){return"Waiting for: "+n})),[4,s.delay(n)];case 3:return o.sent(),s.logDebug((function(){return"Polling after delay"})),[4,s.sendAssertionRequest(a.AssertActionPoll,{})];case 4:r=o.sent(),s.logDebug((function(){return"Server result: "+r.assertion_error_code})),o.label=5;case 5:return[2]}}
10))},s=this,u.label=2;case 2:return r.assertion_error_code!=o.Protocol.AssertionErrorCode.ExternalProcessPending?[3,4]:[5,i()];case 3:return"object"===e(c=u.sent())?[2,c.value]:[3,2];case 4:return[2,r]}}))}))},a.prototype.extensionPointForKyc=function(){var t=this,e=a.kycExtensionPoint.firstNonNull((function(e){return e.canHandleProvider(t.action.vendor_name)?e:null}));if(!e)throw new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.AppImplementation,"Could not locate KYC handler plugin for kyc provider "+this.action.vendor_name+".");return e},Object.defineProperty(a.prototype,"action",{get:function(){return this._action},enumerable:!1,configurable:!0}),a.prototype.rejectedPromise=function(t,e){return Promise.reject(new r.impl.AuthenticationErrorImpl(t,e))},a.prototype.logDebug=function(t){this._sdk.log(r.LogLevel.Debug,t)},a.prototype.delay=function(t){return this._sdk.host.createDelayedPromise(t)},a.AssertActionPoll="poll",a.AssertActionSendData="data",a.kycExtensionPoint=new o.ExtensionPoint(n.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_KYC),a}(i.ResumableProcessActionDriver);i.ActionDriverKyc=a}(o.actiondrivers||(o.actiondrivers={}))}(r.core||(r.core={}))}(n.sdk||(n.sdk={}))}(n.mobile||(n.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(r){function o(t,e){var n=r.call(this,t,e)||this;return n.isAssertionContainerNotComplete=!1,n}return V(o,r),o.prototype.strategyStatePerUserStorageKey=function(){var t=this._controlFlowProcessor._session.user.guid;return new e.TarsusKeyPath("per_user",t.toString(),"promotion_strategy_state")},o.prototype.runActionWithCompletionFunctions=function(){var e=this;if(this._sdk.log(t.LogLevel.Debug,(function(){return"ActionDriverPromotion#runActionWithCompletionFunctions() started"})),this._action=this._action,this._action.assertions.length<1)return this._sdk.log(t.LogLevel.Info,(function(){return"runActionWithCompletionFunctions() Promotion has no assertions, finishing action."})),void this.completeWithDeclineAssertion();if(!this.shouldDisplayPromotion())return this._sdk.log(t.LogLevel.Info,(function(){return"runActionWithCompletionFunctions() Promotion stragety stop, finishing action."})),void this.completeWithDeclineAssertion();if(this._session=this._uiHandler.createRegistrationPromotionSession(this._controlFlowProcessor._session.user.displayName,this._policyAction),this._session){this._session.startSession(this._clientContext,this.policyAction());var r=this._action.options;this._session.promptIntroduction(r.title,r.text,r.ok_button,r.decline_button).then((function(t){if(e.handlePromotionInputControlOrEscapeRequest(t)){for(var r=e._action.assertions,o=new Array,i=0;i<r.length;i++){var s=n.AuthenticationMenuAuthenticator.fromPromotionAction(r[i],e);s.getSupportedOnDevice()&&o.push(s)}e._authenticatorList=o,e.suggestAuthenticators()}}))}else this._rejectionFunction(t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createRegistrationPromotionSession."))},o.prototype.sendAssertionRequest=function(t,n,o){var i=this;return this.isAssertionContainerNotComplete=!1,r.prototype.sendAssertionRequest.call(this,t,n,o).then((function(t){return t.assertion_error_code==e.Protocol.AssertionErrorCode.AssertionContainerNotComplete&&(t.assertion_error_code=void 0,i.isAssertionContainerNotComplete=!0),t}))},o.prototype.suggestAuthenticators=function(n){var r=this;if(void 0===n&&(n=this._authenticatorList),this._currentAuthentictorSelected){var o=n.indexOf(this._currentAuthentictorSelected);o>-1&&n.splice(o,1)}this._session.setPromotedAuthenticators(n).then((function(n){if(r.handlePromotionInputControlOrEscapeRequest(n)){var o=n.getSelectedAuthenticator();r._currentAuthentictorSelected=o;var i=o.authDriver;r.prepareForRunningAuthenticationDriver(i)&&o.authDriver.runRegistration().then((function(n){if(n instanceof e.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted)r.isAssertionContainerNotComplete?(r._sdk.log(t.LogLevel.Debug,(function(){return"suggestAuthenticators() callback result: promotion not completed. showing list again."})),r.suggestAuthenticators()):(r._sdk.log(t.LogLevel.Debug,(function(){return"suggestAuthenticators() callback result: promotion completed. finishing"})),r.completeAuthenticationWithAssertionResult(n.assertionResult));else if(n instanceof e.authenticationdrivers.AuthenticationDriverSessionResultSwitchAuthenticator)if(n.allowedAuthenticators){r._sdk.log(t.LogLevel.Debug,(function(){return"suggestAuthenticators() callback result: switch authentciator with allowed authenticators called"}));var o=n.allowedAuthenticators;r._currentAuthentictorSelected=null,r.suggestAuthenticators(o)}else r._sdk.log(t.LogLevel.Debug,(function(){return"suggestAuthenticators() callback result: switch authentciator called"})),r._currentAuthentictorSelected=null,r.suggestAuthenticators();else n instanceof e.authenticationdrivers.AuthenticationDriverSessionResultEscapeRequested?r.completeWithEscapeRequest
10(n.escapeRequest):(r._sdk.log(t.LogLevel.Error,(function(){return"suggestAuthenticators() unexpected callback result: stopping with error.'"})),r.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered during registration.")))}),(function(e){r._sdk.log(t.LogLevel.Error,(function(){return"suggestAuthenticators() error callback result: stopping with error. error: '"+e._data+"'"})),r.completeAuthenticationWithError(e)}))}else r._sdk.log(t.LogLevel.Debug,(function(){return"suggestAuthenticators() stopped by ControlRequest of type "+n.getControlRequest()}))}))},o.prototype.handlePromotionInputControlOrEscapeRequest=function(e){if(e.getActionEscapeRequest())return this.completeWithEscapeRequest(e.getActionEscapeRequest()),!1;if(!e.isControlRequest())return!0;switch(e.getControlRequest()){case t.PromotionControlRequest.Continue:return!0;case t.PromotionControlRequest.Skip:return this.completeWithDeclineAssertion(),!1;case t.PromotionControlRequest.Abort:return this.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"User aborted/canceled")),!1;default:return this._sdk.log(t.LogLevel.Warning,(function(){return"handlePromotionInputControlRequest() received invalid PromotionInput, unsupported ControlRequest"})),!1}},o.prototype.sendDeclineAssertion=function(){return this.sendAssertionRequest(o.ASSERT_DECLINE)},o.prototype.completeWithDeclineAssertion=function(){var t=this;this.sendDeclineAssertion().then((function(e){t.completeAuthenticationWithAssertionResult(e)})).catch((function(e){t.completeAuthenticationWithError(e)}))},o.prototype.completeAuthenticationWithAssertionResult=function(t){this.terminateSession(),r.prototype.completeAuthenticationWithAssertionResult.call(this,t)},o.prototype.completeAuthenticationWithError=function(t){this.terminateSession(),r.prototype.completeAuthenticationWithError.call(this,t)},o.prototype.terminateSession=function(){this._session&&(this._session.endSession(),delete this._session)},Object.defineProperty(o.prototype,"availableAuthenticatorsForSwitching",{get:function(){return this.availableAuthenticators},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"availableAuthenticators",{get:function(){return this._authenticatorList.concat([])},enumerable:!1,configurable:!0}),o.prototype.shouldDisplayPromotion=function(){var e=this.readStrategyState();if(null==e||null==e.lastPromotionDate||null==e.loginsCounter)return this._sdk.log(t.LogLevel.Debug,(function(){return"shouldDisplayPromotion() first promotion. Stored data was empty."})),e={loginsCounter:1,lastPromotionDate:0},this.updateStrategyState(e),!0;for(var n=this._action.options.strategies,r=!0,o=function(n){if(0==i.checkStrategy(n,e))return i._sdk.log(t.LogLevel.Debug,(function(){return"shouldDisplayPromotion() strategy stopped promotion. strategy type: "+n.type})),r=!1,"break"},i=this,s=0,a=n;s<a.length;s++){if("break"===o(a[s]))break}return e.loginsCounter+=1,this.updateStrategyState(e),r},o.prototype.updateStrategyState=function(t){this._sdk.host.writeStorageKey(this.strategyStatePerUserStorageKey(),t)},o.prototype.readStrategyState=function(){var e=this._sdk.host.readStorageKey(this.strategyStatePerUserStorageKey())||{};return null!=e.lastPromotionDate&&null!=e.loginsCounter?(this._sdk.log(t.LogLevel.Debug,(function(){return"Stored state found, "+JSON.stringify(e)})),e):(this._sdk.log(t.LogLevel.Debug,(function(){return"No stored state, trying to read legacy format"})),this.readLegacyStrategyStateFormat())},o.prototype.readLegacyStrategyStateFormat=function(){var n=this._sdk.host.readStorageKey(new e.TarsusKeyPath("stragety"));return null!=n.days&&null!=n.logins?(this._sdk.log(t.LogLevel.Debug,(function(){return"Reading from legacy format, "+JSON.stringify(n)})),{loginsCounter:n.logins,lastPromotionDate:n.days}):null},o.prototype.checkStrategy=function(t,n){if(t.type==e.Protocol.PromotionStrategyFrequency.LOGINS)return n.loginsCounter%t.value==0;if(t.type==e.Protocol.PromotionStrategyFrequency.DAYS){var r=new Date,o=new Date;o.setTime(n.lastPromotionDate);var i=new Date;return i.setDate(o.getDate()+t.value),i.getTime()<=r.getTime()&&(n.lastPromotionDate=r.getTime(),!0)}return!1},o.ASSERT_DECLINE="decline",o.ACTION_REGISTRATION="registration",o.ACTION_PROMOTION="registration_promotion",o}(n.ActionDriverAuthenticatorOp);n.ActionDriverPromotion=r}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(r){function o(t,e){return r.call(this,t,e)||this}return V(o,r),o.prototype.doRunAction=function(){var r=this;this._sdk.log(e.LogLevel.Debug,(function(){return"Executing provision TOTP action."})),this._cfmAction=this._action;var o=n.totp.TotpPropertiesProcessor.createWithUser(this._controlFlowProcessor._session.user,this._sdk,this._clientContext,this._controlFlowProcessor._session),i=o.createTotpDriver(this._cfmAction.generator,this._cfmAction.otp_type);return i?(o.deleteProvisionForGenerator(this._cfmAction.generator),i.promiseProvisionOutput(this._cfmAction,this.policyAction(),this._clientContext,this._uiHandler).then((function(n){if(n instanceof t.tarsusplugin.TotpProvisionOutput)return r.sendAssertionRequest(null,n.getAssertionData()).then((function(t){return n.finalize(t),o.updateWithProvisionedGenerator(r._cfmAction,n),t}));if(n instanceof t.tarsusplugin.TotpProvisionEscapeRequest)return r.processEscapeRequest
10(n.getEscapeRequest());throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid TOTP provision output response")}))):(this._sdk.log(e.LogLevel.Error,(function(){return"failed to create TOTP driver"})),Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"failed to create TOTP driver")))},o}(r.SimpleCancellationActionDriver);r.ActionDriverProvisionTotp=o}(n.actiondrivers||(n.actiondrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e){return n.call(this,t,e)||this}return V(r,n),r.prototype.toValidVaultPath=function(n){var r=e.TarsusKeyPath.fromString(n);if(!t.UserVault.isValidKeyPathForUserVault(r))throw this._sdk.log(t.LogLevel.Error,(function(){return"Invalid user vault path "+r})),new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid user vault path "+r);return r},r.prototype.doRunAction=function(){var n=this;this._sdk.log(t.LogLevel.Debug,(function(){return"Executing provision TOTP action."})),this._vaultAction=this._action;var r=Promise.resolve();return this._vaultAction.new_vaults.forEach((function(o){r=r.then((function(){var r=n.toValidVaultPath(o.vault.vault_id);n._sdk.log(t.LogLevel.Debug,(function(){return"Will provision vault "+r}));var i=o.vault.vault_type,s=e.vault.VaultTypes[i];return s?s.createNew(n._controlFlowProcessor._session.user,r,n,n._sdk,n._controlFlowProcessor._uiHandler,!1,o).then((function(){})):(n._sdk.log(t.LogLevel.Error,(function(){return"failed to find vault driver for type "+i})),Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"failed to create TOTP driver for type "+i)))}))})),(r=r.then((function(r){n._vaultAction.deleted_vaults.forEach((function(r){var o=n.toValidVaultPath(r);n._sdk.log(t.LogLevel.Debug,(function(){return"Will delete vault "+o})),e.vault.Vault.deleteVaultForUserWithId(n._controlFlowProcessor._session.user,o,n._sdk)}))}))).then((function(){return n.sendAssertionRequest()}))},r.prototype.getValidCancelOptions=function(){return[t.ControlRequestType.SelectMethod,t.ControlRequestType.ChangeMethod,t.ControlRequestType.RetryAuthenticator,t.ControlRequestType.CancelAuthenticator]},r.prototype.getValidErrorRecoveryOptions=function(e){return[t.AuthenticationErrorRecovery.RetryAuthenticator,t.AuthenticationErrorRecovery.ChangeAuthenticator,t.AuthenticationErrorRecovery.SelectAuthenticator,t.AuthenticationErrorRecovery.Fail]},r}(n.SimpleCancellationActionDriver);n.ActionDriverProvisionUserVault=r}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(r){function o(t,e){return r.call(this,t,e)||this}return V(o,r),o.prototype.runActionWithCompletionFunctions=function(){var r=this,o=this._action;this._sdk.log(t.LogLevel.Debug,(function(){return"Loading and validating authenticator description"}));for(var i=0;i<o.assertions.length;i++){var s=n.AuthenticationMenuAuthenticator.fromRegistrationAction(o.assertions[i],this);if(s.getSupportedOnDevice()){this._registeredAuthenticator=s,this._silentRegistration=!!o.assertions[i].silent;break}}if(this._registeredAuthenticator){var a=this._registeredAuthenticator.authDriver;this.prepareForRunningAuthenticationDriver(a)&&(this._sdk.log(t.LogLevel.Debug,(function(){return"Starting auth registeration"})),a.runRegistration().then((function(n){n instanceof e.authenticationdrivers.AuthenticationDriverSessionResultAuthenticationCompleted?r.completeAuthenticationWithAssertionResult(n.assertionResult):n instanceof e.authenticationdrivers.AuthenticationDriverSessionResultEscapeRequested?r.completeWithEscapeRequest(n.escapeRequest):r.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Unknown authentication driver result type encountered during registration."))}),(function(e){r._sdk.log(t.LogLevel.Debug,(function(){return"Received authentication driver error "+e})),r.completeAuthenticationWithError(e)})))}else this.completeAuthenticationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"No supported authenticator listed in registeration request."))},Object.defineProperty(o.prototype,"availableAuthenticatorsForSwitching",{get:function(){return[]}
10,enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"availableAuthenticators",{get:function(){return[this._registeredAuthenticator]},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isSilentRegistration",{get:function(){return this._silentRegistration},enumerable:!1,configurable:!0}),o}(n.ActionDriverAuthenticatorOp);n.ActionDriverRegistration=r}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n){return e.call(this,t,n)||this}return V(n,e),n.prototype.run=function(){var e=this;return this._sdk.log(t.LogLevel.Debug,(function(){return"Executing scan qr action."})),new Promise((function(n,r){var o=e._action,i=t.QrCodeFormat.Alphanumeric;if(o.qr_code_format_type&&(i=t.QrCodeFormatImpl.fromAssertionFormat(o.qr_code_format_type)),e._session=e._uiHandler.createScanQrSession(e._policyAction,e._clientContext),!e._session)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createScanQrSession.");e._session.startSession(e._clientContext,e.policyAction()),e._session.getScanQrResponse(o.instructions,i).then((function(n){if(n.isControlRequest())return e.processControlRequest(n.getControlRequest());if(null!=n.getActionEscapeRequest())return e.processEscapeRequest(n.getActionEscapeRequest());var r={qr_content:n.getResponse().getQrCodeResult().getQrCode()};return e._sdk.log(t.LogLevel.Debug,(function(){return"Asserting scan qr: "+r.qr_content})),e.sendAssertionRequest(null,r).catch((function(n){throw e._sdk.log(t.LogLevel.Error,(function(){return"Scan qr sendAssertionRequest error: "+n})),n}))})).catch((function(n){throw e._sdk.log(t.LogLevel.Error,(function(){return"Scan qr action error: "+n})),n})).finally((function(){e._session.endSession(),delete e._session})).then(n,r)}))},n.prototype.processControlRequest=function(e){var n=this;return new Promise((function(r,o){switch(n._sdk.log(t.LogLevel.Debug,(function(){return"Processing control request "+e.getRequestType()})),e.getRequestType()){case t.ControlRequestType.CancelAuthenticator:o(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"Scan qr code action canceled by user."));break;default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Unsupported control request: "+e.getRequestType()+" for scan qr action.")}}))},n}(e.ActionDriver);e.ActionDriverScanQr=n}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r,o;o=t.sdk||(t.sdk={}),r=o.core||(o.core={}),e=r.actiondrivers||(r.actiondrivers={}),n=function(t){function e(e,n){return t.call(this,e,n)||this}return V(e,t),e.augmentAssertionDataWithSignedContent=function(t,e,n,r){var i=JSON.stringify(e);r.log(o.LogLevel.Debug,(function(){return"Signing consent payload: "+i}));var s=o.util.asciiToHex(i);return n.signHex(s).then((function(e){var n=o.util.hexToBase64(e),r={payload:i,signed_payload:n};return t.sign_content_data=r,t}))},e.prototype.run=function(){var t=this;this._sdk.log(o.LogLevel.Debug,(function(){return"Executing consent action."}));var n=this._controlFlowProcessor.initiatingRequest&&this._controlFlowProcessor.initiatingRequest.body,i={params:n&&n.params||{}};if(this._controlFlowProcessor.requestContext&&this._controlFlowProcessor.requestContext instanceof r.ApprovalControlFlowExecutionContext){var s=this._controlFlowProcessor.requestContext.approval;i.approval={approval_id:s.getApprovalId(),message:{title:s.getTitle(),details:s.getDetails()}}}return e.augmentAssertionDataWithSignedContent({},i,this._controlFlowProcessor._session.deviceSigningKeyPair,this._sdk).then((function(e){return t.sendAssertionRequest(null,e)}))},e}(e.ActionDriver),e.ActionDriverSignContent=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e){return n.call(this,t,e)||this}return V(r,n),r.prototype.doRunAction=function(){var e=this;return this._sdk.log(t.LogLevel.Debug,(function(){return"Executing ticket wait action."})),new Promise((function(n,r){var o=e._action;if(e._session=e._uiHandler.createTicketWaitSession(e._policyAction,e._clientContext),!e._session)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTicketWaitSession.");e._session.setWaitingTicket(new t.impl.TicketWaitingInformationImpl(o)),e._session.startSession(e.policyAction(),e._clientContext),e.pollServer().then((function(t){n(t)})).finally((function(){e._session.endSession(),delete e._session})).catch((function(n){e._sdk.log(t.LogLevel.Error,(function(){return"Wait for ticket action error: "+n})),r(n)}))}))},r.prototype.pollServer=function(){var n=this,r={};return this._sdk.log(t.LogLevel.Debug,(function(){return"Asserting ticket wait poll"})),new Promise((function(t,o){var i,s=3;!function a(){0===s?o(i):n.sendAssertionRequest(null,r).then((function(r){r.assertion_error_code==e.Protocol.AssertionErrorCode.ExternalProcessPending?t(n.inputLoop()):t(r)})).catch((function(t){s--,i=t,n._sdk.host.createDelayedPromise(10).then((function(){a()}))}))}()}))},r.prototype.longPoll=function(t){var e=this,n={type:"ticket",ticket_id:this._action.raw_ticket_id};return this.sendPollingRequest(n,t).then((function(t){return t.change_detected?e.pollServer():e.inputLoop()}))},r.prototype.inputLoop=function(){var e=this;return this._session.promiseInput().then((function(n){if(n.isControlRequest
10())return e.processControlRequest(n.getControlRequest());if(null!=n.getActionEscapeRequest())return e.processEscapeRequest(n.getActionEscapeRequest());var r=n.getResponse();if(r instanceof t.TicketWaitInputPollRequest){var o=r.getPollingTimeout();return o?e.longPoll(o):e.pollServer()}throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Expected polling request input response but got: "+r)}))},r.prototype.processControlRequest=function(e){var n=this;return new Promise((function(r,o){switch(n._sdk.log(t.LogLevel.Debug,(function(){return"Processing control request "+e.getRequestType()})),e.getRequestType()){case t.ControlRequestType.CancelAuthenticator:case t.ControlRequestType.AbortAuthentication:o(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"Wait for ticket action canceled by user."));break;default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Unsupported control request: "+e.getRequestType()+" for ticket wait action.")}}))},r}(n.SimpleCancellationActionDriver);n.ActionDriverTicketWait=r}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(n){function r(t,e){return n.call(this,t,e)||this}return V(r,n),r.prototype.runActionWithCompletionFunctions=function(){this._action=this._action,this._sdk.log(t.LogLevel.Debug,(function(){return"Started unregister action!"})),e.AuthenticationMenuAuthenticator.fromUnregistrationAction(this._action,this).authDriver.runUnregistration().then(this._completionFunction,this._rejectionFunction)},Object.defineProperty(r.prototype,"availableAuthenticators",{get:function(){return this._availableAuthenticators.concat([])},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isSilentRegistration",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isPlaceholder",{get:function(){return 0==this._action.method.indexOf("placeholder")},enumerable:!1,configurable:!0}),r.prototype.sendUnregisterAssertion=function(){return this.sendAssertionRequest()},r}(e.ActionDriverAuthenticatorOp);e.ActionDriverUnregistration=n}(e.actiondrivers||(e.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o,i;o=r.dyadic||(r.dyadic={}),i=function(r){function o(){var t=null!==r&&r.apply(this,arguments)||this;return t.curHandle=null,t.flowCompleted=!1,t.assertCompleted=!1,t}return V(o,r),o.prototype.run=function(){var n=this;return this.flowCompleted=!1,this.assertCompleted=!1,Promise.resolve().then((function(r){return"false"==n._sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.DyadicPresent)?Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Dyadic capability is not present (is Dyadic SDK integrated?)")):(n.refreshTokenRequested=!1,n.curHandle=null,n.start())})).catch((function(t){if(n.assertCompleted){var r=e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t),o=n.buildErrorAssertionData(r),i={msg:r.getMessage(),code:r.getErrorCode(),data:o};return n.sendErrorReportAssertionRequest(i).finally((function(){throw t}))}if(!n.flowCompleted)return r=e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t),i=n.buildErrorAssertionData(r),n.sendAssertionRequest("error",i).then((function(t){return n.handleRejection(t)}));throw t}))},o.prototype.start=function(){return $(this,void 0,void 0,(function(){var t,e,n=this;return Y(this,(function(r){switch(r.label){case 0:return[4,this.issueDyadicRequest()];case 1:return t=r.sent(),this.curHandle=t,[4,this.sendAssertionRequest(this.operationId,this.buildAssertionData(t)).catch((function(t){throw n.flowCompleted=!0,t}))];case 2:return e=r.sent(),[2,this.handleAssertionResponse(t,e)]}}))}))},o.prototype.handleAssertionResponse=function(t,n){return $(this,void 0,void 0,(function(){var r,o=this;return Y(this,(function(i){return this._sdk.log(e.LogLevel.Debug,(function(){return"Dyadic sign; handle sign response; response: ["+JSON.stringify(n)+"]"})),this.isAssertionRejected(n)?[2,this.handleRejection(n)]:(r=this.dyadicServerResponseFromAssertionResponse(n))?[2,t.finalize(r).then((function(t){return n})).catch((function(n){return o._sdk.log(e.LogLevel.Debug,(function(){return"Dyadic sign; finalize failed; error: ["+JSON.stringify(n)+"]"})),o.isRefershSupported&&!o.refreshTokenRequested?(o._sdk.log(e.LogLevel.Debug,(function(){return"Dyadic sign; isRefershSupported: ["+o.isRefershSupported+"]; refreshTokenRequested: ["+o.refreshTokenRequested+"]"})),o.handleFinalizeError(t,n)):Promise.reject(n)}))]:[2,Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Dyadic data missing from server response"))]}))}))},o.prototype.handleFinalizeError=function(n,r){return $(this,void 0,void 0,(function(){var o,i,s,a,c=this;return Y(this,(function(u){switch(u.label){case 0:return o=e.impl.AuthenticationErrorImpl.ensureAuthenticationError(r),i=o.getData(),this._sdk.log(e.LogLevel.Debug,(function(){return"Dyadic sign; is refresh required: ["+(null==i?void 0:i.refresh_required)+"]"})),(null==i?void 0:i.refresh_required)?[4,this._sdk.host.dyadicRefreshToken(n.getTokenId(),t.sdkhost.DyadicTokenType.Sign)]:[3,3];case 1:return s=u.sent(),this.refreshTokenRequested=!0,[4,this.sendAssertionRequest("refresh_token",this.buildAssertionData(s)).catch((function(t){throw c.flowCompleted=!0,t}))];case 2:return a=u.sent(),[2,this.handleRefreshTokenAssertionResponse(s,a)];case 3:return[2,Promise.reject(r)]}}))}))},o.prototype.handleRefreshTokenAssertionResponse=function(t,n){return $(this,void 0,void 0,(function(){var r;return Y(this,(function(o){switch(o.label){case 0:return this.isAssertionRejected(n)?[2,this.handleRejection(n)]:(r=this.dyadicServerResponseFromAssertionResponse(n))?[4,t.finalize(r)]:[2,Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Dyadic data missing from server response"))];case 1:return o.sent(),[2,this.start()]}}))}))},o.prototype.dyadicServerResponseFromAssertionResponse=function(t){this.assertCompleted=t.assertions_complete;var e=t.data&&t.data.dyadic;return e&&e.server_response},o.prototype.buildAssertionData=function(t){var e={requestData:"request_data",requestPayload:"request_payload",proxyPayload:"proxy_payload"}
10,n=t.getServerRequest();Object.keys(e).forEach((function(t){var r=e[t];n[r]=n[t],delete n[t];var o=n[r];o&&(o.original_data=o.originalData,delete o.originalData)}));var r={dyadic:n};return r.dyadic.token_uid=t.getTokenId()||this._controlFlowProcessor._session.deviceId(),r.dyadic.token_username=t.getUserName(),r.dyadic.dyadic_sdk_version=t.getVersion(),r},o.prototype.buildErrorAssertionData=function(t){var e={message:t.getMessage()};return Object.keys(t.getData()).length&&(e.dyadic_status=t.getData()),this.curHandle&&(null!=this.curHandle.getTokenId()&&(e.token_uid=this.curHandle.getTokenId()),null!=this.curHandle.getUserName&&(e.token_username=this.curHandle.getUserName()),e.dyadic_sdk_version=this.curHandle.getVersion()),{dyadic:e}},o.prototype.isAssertionRejected=function(t){return t.state===n.Protocol.AuthSessionState.Rejected},o.prototype.handleRejection=function(t){var r,o,i,s,a,c=t.failure_data;if((null===(r=null==c?void 0:c.reason)||void 0===r?void 0:r.type)===n.Protocol.FailureReasonType.Communication||"dyadic_general_error"==(null===(i=null===(o=null==c?void 0:c.reason)||void 0===o?void 0:o.data)||void 0===i?void 0:i.error_type))return t;this.flowCompleted=!0;var u=null===(a=null===(s=null==c?void 0:c.reason)||void 0===s?void 0:s.data)||void 0===a?void 0:a.message,l=u?"dyadic action internal error; "+u:"dyadic action internal error";throw e.AuthenticationError.createApplicationGeneratedGeneralError(l,{failure_data:c})},o}(r.ActionDriver),o.ActionDriverDyadic=i}(n.actiondrivers||(n.actiondrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isRefershSupported=!1,e.operationId="enroll",e}return V(e,t),e.prototype.issueDyadicRequest=function(){var t=this._action,e=this._controlFlowProcessor._session.user.guid.toString();return this._sdk.host.dyadicEnroll(e,t.server_info)},e}(t.ActionDriverDyadic);t.ActionDriverDyadicEnroll=e}(t.dyadic||(t.dyadic={}))}(t.actiondrivers||(t.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(n){!function(n){var r=function(){function t(){}return t.prototype.getServerRequest=function(){return this._serverRequest},t.prototype.getTokenId=function(){return this._signHandle.getTokenId()},t.prototype.getUserName=function(){return this._signHandle.getUserName()},t.prototype.getVersion=function(){return this._signHandle.getVersion()},t.prototype.finalize=function(t){var e=this,n=t,r=this._signHandle.finalize(n.server_response);return n.otp_token_refresh&&Object.keys(n.otp_token_refresh).forEach((function(t){r=r.then((function(r){return e._refreshTokenHandles[t].finalize(n.otp_token_refresh[t])}))})),r},t.create=function(e,n,r){var o=new t;return o._refreshTokenHandles=e,o._signHandle=n,o._serverRequest=r,o},t}(),o=function(n){function o(){var t=null!==n&&n.apply(this,arguments)||this;return t.isRefershSupported=!0,t.operationId="sign",t}return V(o,n),o.prototype.issueDyadicRequest=function(){var n=this,o=this._action,i=e.util.asciiToHex(o.assertion_id+this._controlFlowProcessor.challenge),s=this._controlFlowProcessor._session.user.guid.toString();return this._sdk.host.dyadicSign(s,i).then((function(e){var i={},s=e.getServerRequest(),a=Promise.resolve(!0);return o.otp_token_uids&&0<o.otp_token_uids.length&&(s.otp_token_refresh={},o.otp_token_uids.forEach((function(e){a=a.then((function(r){return n._sdk.host.dyadicRefreshToken(e,t.sdkhost.DyadicTokenType.Otp).then((function(t){return i[e]=t,s.otp_token_refresh[e]=t.getServerRequest(),!0}))}))}))),a.then((function(t){return r.create(i,e,s)}))}))},o.prototype.dyadicServerResponseFromAssertionResponse=function(t){return this.assertCompleted=t.assertions_complete,t.data&&t.data.dyadic},o}(n.ActionDriverDyadic);n.ActionDriverDyadicSign=o}(n.dyadic||(n.dyadic={}))}(n.actiondrivers||(n.actiondrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isRefershSupported=!1,e.operationId="unenroll",e}return V(e,t),e.prototype.issueDyadicRequest=function(){var t=this._controlFlowProcessor._session.user.guid.toString();return this._sdk.host.dyadicDelete(t)},e}(t.ActionDriverDyadic);t.ActionDriverDyadicDelete=e}(t.dyadic||(t.dyadic={}))}(t.actiondrivers||(t.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){t.ActionDrivers={confirmation:t.ActionDriverConfirmation,information:t.ActionDriverInformation,json_data:t.ActionDriverJsonData,authentication:t.ActionDriverAuthentication,registration:t.ActionDriverRegistration,unregistration:t.ActionDriverUnregistration,provision_totp:t.ActionDriverProvisionTotp,disable_totp:t.ActionDriverDisableTotp,sign_content:t.ActionDriverSignContent,form:t.ActionDriverForm,registration_promotion:t.ActionDriverPromotion,scan_qr:t.ActionDriverScanQr,wait_for_ticket:t.ActionDriverTicketWait,dyadic_enroll:t.dyadic.ActionDriverDyadicEnroll,dyadic_sign:t.dyadic.ActionDriverDyadicSign,dyadic_un_enroll:t.dyadic.ActionDriverDyadicDelete,debug_break:t.ActionDriverDebugBreak,invoke_idp:t.ActionDriverInvokeIdp,provision_user_vault:t.ActionDriverProvisionUserVault,kyc:t.ActionDriverKyc,fido2_anonymous_auth:t.ActionDriverAnonymousFido2Authenticate,transmit_acp:t.ActionDriverAccountProtection}}(t.actiondrivers||(t.actiondrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(){function r(t,e,n){this._externalCancelled=!1,this._actionDriver=t,this._authenticatorConfig=e,this._authenticatorDescription=n,this._sdk=t._sdk,this._uiHandler=t._uiHandler,this._clientContext=t._clientContext}return r.prototype.runAuthentication=function(e){return this._authenticationParameters=e,this.runMode(t.AuthenticatorSessionMode.Authentication)},r.prototype.runRegistration=function(){if(this._actionDriver.isSilentRegistration){var e=this;return n.instanceOfAuthenticationDriverSilentRegistrationSupport(this)?(e._sdk.log(t.LogLevel.Debug,(function(){return"Invoking silent registration for "+e._authenticatorDescription.getAuthenticatorId()})),this.runSilentRegistration()):Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorError,"Silent registration not supported for this authenticator"))}return this.runMode(t.AuthenticatorSessionMode.Registration)},r.prototype.runUnregistration=function(){var e=this,n=this._actionDriver;return this._sdk.currentUiHandler.handleAuthenticatorUnregistration(this._authenticatorDescription,n.isPlaceholder,n.policyAction(),this._clientContext).then((function(r){if(e._sdk.log(t.LogLevel.Debug,(function(){return"handleAuthenticatorUnregistration() result: "+r})),0==r.getUserChoice())return n.sendUnregisterAssertion().then((function(t){return e.handleUnregistrationAssertionResult(t),t}));var o=new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Unregistration failed due to app implementation rejecting unregistertion.");return Promise.reject(o)}))},r.prototype.onCancelRun=function(){this._externalCancelled=!0},Object.defineProperty(r.prototype,"user",{get:function(){return this._actionDriver._controlFlowProcessor._session.user}
10,enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"operationMode",{get:function(){return this._operationMode},enumerable:!1,configurable:!0}),r.prototype.terminateSession=function(){this._inputSession&&(this._inputSession.endSession(),delete this._inputSession)},r.prototype.completeAuthenticatorSessionWithResult=function(t){this.terminateSession(),this._completionFunction(t)},r.prototype.completeAuthenticatorSessionWithError=function(e){try{this.terminateSession()}catch(e){this._sdk.log(t.LogLevel.Warning,(function(){return"Can't dismiss authenticator session during error reporting."}))}this._rejectionFunction(e)},r.prototype.handleInputOrControlResponse=function(e){try{e.isControlRequest()?this.processControlRequest(e.getControlRequest()):null!=e.getActionEscapeRequest()?this.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultEscapeRequested(e.getActionEscapeRequest())):this._operationMode==t.AuthenticatorSessionMode.Authentication?this.handleAuthenticationInputResponse(e.getResponse()):this.handleRegistrationInputResponse(e.getResponse())}catch(e){this.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}},r.prototype.processRegisterAssertion=function(e,r){var o=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"register",e,r).then((function(e){o.handleRegisterAssertionResult(e)||(o._sdk.log(t.LogLevel.Info,(function(){return"Registration session done."})),o.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultAuthenticationCompleted(e)))})).catch((function(e){o._sdk.log(t.LogLevel.Error,(function(){return"Perform error recovery with server error "+e})),o.performErrorRecoveryForError(e)}))},r.prototype.processAuthenticateAssertion=function(e,r){var o=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"authenticate",e,r).then((function(i){o.handleAuthenticateAssertionResult(i,o._authenticatorDescription,"authenticate",e,r)||(o._sdk.log(t.LogLevel.Info,(function(){return"Authenticator session done."})),o.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultAuthenticationCompleted(i)))})).catch((function(e){o._sdk.log(t.LogLevel.Error,(function(){return"Perform error recovery with server error "+e})),o.performErrorRecoveryForError(e)}))},r.prototype.runMode=function(e){var n=this;return new Promise((function(r,o){if(n._completionFunction=r,n._rejectionFunction=o,n._operationMode=e,n._inputSession=n.createAuthenticatorSession(),!n._inputSession)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from authenticator session creation call.");n._inputSession.startSession(n._authenticatorDescription,n._operationMode,n._actionDriver.policyAction(),n._clientContext),n.authOrRegInStartedSession(!1)})).catch((function(e){throw t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e)}))},r.prototype.handleGeneralAssertionResult=function(r){return this._sdk.log(t.LogLevel.Debug,(function(){return"Authenticator assertion response "+JSON.stringify(r)})),r.data&&(this._sdk.log(t.LogLevel.Debug,(function(){return"Processing authenticator assertion response: updating assertion authenticator description"})),this._authenticatorDescription.updateWithAssertionResult(r.data)),r.state!=e.Protocol.AuthSessionState.Pending&&(this._sdk.log(t.LogLevel.Info,(function(){return"Authenticator session complete; status "+r.state})),this.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultAuthenticationCompleted(r)),!0)},r.prototype.handleUnregistrationAssertionResult=function(t){},r.prototype.handleRegisterAssertionResult=function(e){return!!this.handleGeneralAssertionResult(e)||!!e.assertion_error_code&&(this._sdk.log(t.LogLevel.Error,(function(){return"handleRegisterAssertionResult() Assertion error encoutered. Starting error recovery."})),this.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.errorForAssertionResponse(e)),!0)},r.prototype.handleAuthenticateAssertionResult=function(n,r,o,i,s){if(this.handleGeneralAssertionResult(n))return!0;
10if(n.assertion_error_code)switch(n.assertion_error_code){case e.Protocol.AssertionErrorCode.MustRegister:return this._sdk.log(t.LogLevel.Debug,(function(){return"handleAuthenticateAssertionResult() Authenticator expired; must register"})),this.handleRegistrationDueToExpiration(),!0;case e.Protocol.AssertionErrorCode.FailOver:return this._sdk.log(t.LogLevel.Debug,(function(){return"handleAuthenticateAssertionResult() Failover signalled"})),this.handleFallback(),!0;default:return this._sdk.log(t.LogLevel.Error,(function(){return"handleAuthenticateAssertionResult() Assertion error encoutered. Starting error recovery. 2"})),this.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.errorForAssertionResponse(n)),!0}else if(this._authenticatorDescription.getExpired())return this._sdk.log(t.LogLevel.Info,(function(){return"Authenticator expired; must register"})),this.handleRegistrationDueToExpiration(),!0;return!1},r.prototype.processAuthFailureAssertionAndHandleError=function(n,r){var o=this,i={num_of_failures:r};this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"auth_failure",i).then((function(r){if(!o.handleGeneralAssertionResult(r)){if(r.assertion_error_code)switch(r.assertion_error_code){case e.Protocol.AssertionErrorCode.FailOver:return o._sdk.log(t.LogLevel.Info,(function(){return"Failover signalled during local failure report"})),o.handleFallback(),!0}n=t.impl.AuthenticationErrorImpl.augmentErrorData(n,r.data),o.performErrorRecoveryForError(n)}}),(function(e){var n=t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e);o._sdk.log(t.LogLevel.Error,(function(){return"Error ${authError} signalled during local failure report"})),o.performErrorRecoveryForError(n,!0)}))},r.prototype.handleRegistrationDueToExpiration=function(){this._inputSession.changeSessionModeToRegistrationAfterExpiration(),this._operationMode=t.AuthenticatorSessionMode.Registration,this.registerInStartedSession(!1)},r.prototype.authOrRegInStartedSession=function(e){this._operationMode==t.AuthenticatorSessionMode.Authentication?this.authenticateInStartedSession(e):this.registerInStartedSession(e)},r.prototype.processControlRequest=function(e){switch(this._sdk.log(t.LogLevel.Debug,(function(){return"Processing control request "+e.getRequestType()})),e.getRequestType()){case t.ControlRequestType.AbortAuthentication:this.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"Authentication cancelled due to abort control request."));break;case t.ControlRequestType.ChangeMethod:this.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultSwitchAuthenticator(null,this.getAuthenticationActionOtherAuthenticators()));break;case t.ControlRequestType.SelectMethod:this.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultSwitchAuthenticator);break;case t.ControlRequestType.CancelAuthenticator:this.invokeUiHandlerCancellation();break;case t.ControlRequestType.RetryAuthenticator:this.authOrRegInStartedSession(!0);break;default:this.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid ControlRequestType value during authentication session."))}},r.prototype.invokeUiHandlerCancellation=function(){var e=this;if(this._externalCancelled)this.processControlRequest(t.ControlRequest.create(t.ControlRequestType.AbortAuthentication));else{var n=[t.ControlRequestType.RetryAuthenticator,t.ControlRequestType.AbortAuthentication];this.getAuthenticationActionOtherAuthenticators().length>0&&n.push(t.ControlRequestType.ChangeMethod),this._actionDriver.availableAuthenticatorsForSwitching.length>0&&n.push(t.ControlRequestType.SelectMethod),this._uiHandler.controlOptionForCancellationRequestInSession(n,this._inputSession).then((function(r){r.getRequestType()!=t.ControlRequestType.CancelAuthenticator?n.indexOf(r.getRequestType())<0?e.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned an invali
10d option.")):e.processControlRequest(r):e.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned CancelAuthenticator which is an invalid option."))}))}},r.prototype.getAuthenticationActionOtherAuthenticators=function(){var t=this;return this._actionDriver.availableAuthenticatorsForSwitching.filter((function(e){return e!=t._authenticatorDescription}))},r.prototype.handleFallback=function(){var e=this;if(this._authenticatorDescription.fallback){var r=[t.AuthenticatorFallbackAction.Retry,t.AuthenticatorFallbackAction.Cancel],o=null,i=this._authenticatorDescription.fallback.method;i?(o=this._actionDriver.availableAuthenticators.filter((function(t){return t.getAuthenticatorId()==i}))[0])&&r.push(t.AuthenticatorFallbackAction.Fallback):this.getAuthenticationActionOtherAuthenticators().length>0&&r.push(t.AuthenticatorFallbackAction.AuthMenu),this._uiHandler.selectAuthenticatorFallbackAction(r,o,this._inputSession,this._actionDriver.policyAction(),this._clientContext).then((function(i){switch(e._sdk.log(t.LogLevel.Debug,(function(){return"Fallback action selected "+i})),r.indexOf(i)<0&&(e._sdk.log(t.LogLevel.Error,(function(){return"Invalid fallback action selected: "+i+" not in "+r})),e.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid fallback action selected by callback."))),i){case t.AuthenticatorFallbackAction.Fallback:case t.AuthenticatorFallbackAction.AuthMenu:e.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultSwitchAuthenticator(o));break;case t.AuthenticatorFallbackAction.Retry:e.authOrRegInStartedSession(!0);break;case t.AuthenticatorFallbackAction.Cancel:e.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.UserCanceled,"User cancel in response to fallback action."))}}))}else this.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Cannot handle a fallback error without fallback specification in action."))},r.prototype.recoveryOptionsForError=function(e,n){var r=[t.AuthenticationErrorRecovery.Fail];return[t.AuthenticationErrorCode.AllAuthenticatorsLocked,t.AuthenticationErrorCode.AppImplementation,t.AuthenticationErrorCode.ControlFlowExpired,t.AuthenticationErrorCode.SessionRequired,t.AuthenticationErrorCode.InvalidDeviceBinding,t.AuthenticationErrorCode.UserCanceled].indexOf(e.getErrorCode())>=0?r:(n||!this._authenticatorDescription.getEnabled()||this._operationMode==t.AuthenticatorSessionMode.Authentication&&e.getErrorCode()==t.AuthenticationErrorCode.AuthenticatorExternalConfigError||r.push(t.AuthenticationErrorRecovery.RetryAuthenticator),this.getAuthenticationActionOtherAuthenticators().length>0&&r.push(t.AuthenticationErrorRecovery.ChangeAuthenticator),this._actionDriver.availableAuthenticatorsForSwitching.length>0&&r.push(t.AuthenticationErrorRecovery.SelectAuthenticator),r)},r.prototype.performErrorRecoveryForError=function(e,n){var r=this,o=this.recoveryOptionsForError(e,n),i=this.defaultRecoveryForError(e);o.indexOf(i)<0&&(i=o.indexOf(t.AuthenticationErrorRecovery.SelectAuthenticator)>=0?t.AuthenticationErrorRecovery.SelectAuthenticator:t.AuthenticationErrorRecovery.Fail),this._inputSession.promiseRecoveryForError(e,o,i).then((function(n){r._sdk.log(t.LogLevel.Debug,(function(){return"Error recovery selected "+n})),r._sdk.log(t.LogLevel.Debug,(function(){return"recover from error: "+e.getErrorCode()})),o.indexOf(n)<0&&(r._sdk.log(t.LogLevel.Error,(function(){return"Invalid error recovery option from callback: "+n+" not in "+o})),r.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid error recovery action selected by callback."))),r.handleErrorRecoveryAction(n,e)}))},r.prototype.handleErrorRecoveryAction=function(e,r){switch(e){case t.AuthenticationErrorRecovery.RetryAuthenticator:this.authOrRegInStartedSession(!0);break;case t.AuthenticationErrorRecovery.ChangeAuthenticator:this.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultSwitchAuthenticator(null,this.getAuthenticationActionOtherAuthenticators()));break;case t.AuthenticationErrorRecovery.SelectAuthenticator:this.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultSwitchAuthenticator);break;case t.AuthenticationErrorRecovery.Fail:default:this.completeAuthenticatorSessionWithError(r)}},r.prototype.defaultRecoveryForError=function(e){return this._operationMode==t.AuthenticatorSessionMode.Authentication?!this._authenticatorDescription.getL
10ocked()&&this._authenticatorDescription.getRegistered()&&this._authenticatorDescription.getEnabled()&&e.getErrorCode()!=t.AuthenticationErrorCode.AuthenticatorLocked&&e.getErrorCode()!=t.AuthenticationErrorCode.AllAuthenticatorsLocked?t.AuthenticationErrorRecovery.RetryAuthenticator:e.getErrorCode()!=t.AuthenticationErrorCode.AllAuthenticatorsLocked?t.AuthenticationErrorRecovery.ChangeAuthenticator:t.AuthenticationErrorRecovery.Fail:t.AuthenticationErrorRecovery.RetryAuthenticator},r}();n.AuthenticationDriver=r}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),n.prototype.authenticateInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},n.prototype.registerInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},n.prototype.handleAuthenticationInputResponse=function(e){var n;try{n=this.generateAssertionDataForInputResponse(e)}catch(e){return void this.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}this.processAuthenticateAssertion(n)},n.prototype.handleRegistrationInputResponse=function(e){try{var n=this.generateAssertionDataForInputResponse(e)}catch(e){return void this.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}this.processRegisterAssertion(n)},n.prototype.generateAssertionDataForInputResponse=function(t){return{secret:this.generateSecretToSignForInputResponse(t)}},n}(e.AuthenticationDriver);e.AuthenticationDriverCentralizedSecretInputBased=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(){function n(t){this._authenticationDriverCtor=t}return n.prototype.createAuthenticationDriver=function(t,e,n){return new this._authenticationDriverCtor(t,e,n)},n.prototype.evaluateLocalRegistrationStatus=function(e){return t.AuthenticatorRegistrationStatus.Registered},n.prototype.isSupportedOnDevice=function(t){return!0},n.prototype.suggestParameters=function(t,e){return[]},n.refreshInvalidatedAuthenticatorsEnrollments=function(t){return new Promise((function(n,r){var o,i=new Array;for(var s in t.user.localEnrollments){o=t.user.localEnrollments[s];var a=e.AuthenticatorDrivers[o.authenticatorId];i.push(a.checkAuthenticatorInvalidatedAndNotifyUIHandler(t))}Promise.all(i).then((function(t){n(t)})).catch((function(t){r(t)}))}))},n.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(t){return Promise.resolve(!0)},n}();e.SimpleAuthenticationDriverDescriptor=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.getEnabled=function(){return this.getSupportedOnDevice()},n.getDescription=function(t,r){return new n(t,r,{},{status:e.Protocol.AuthenticationMethodStatus.Unregistered})},n}(n.AuthenticatorDescriptionImpl),o=function(o){function i(t,e){var n=o.call(this,t)||this;return n._authenticatorType=e,n}return V(i,o),i.prototype.evaluateLocalRegistrationStatus=function(n){var r=n.user.localEnrollments[this._authenticatorType];return r?r.validationStatus==e.LocalEnrollmentValidationStatus.Invalidated?t.AuthenticatorRegistrationStatus.LocallyInvali
10d:t.AuthenticatorRegistrationStatus.Registered:t.AuthenticatorRegistrationStatus.LocallyInvalid},i.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(o){var i=this;return new Promise((function(s,a){o.sdk.log(t.LogLevel.Info,(function(){return"Checking if authenticator "+i._authenticatorType+" has become invalidated."}));var c=o.user.localEnrollments[i._authenticatorType];if(c.status==e.LocalEnrollmentStatus.Registered&&c.validationStatus!=e.LocalEnrollmentValidationStatus.Invalidated)if(n.AuthenticatorDrivers[i._authenticatorType].evaluateLocalRegistrationStatus(o)==t.AuthenticatorRegistrationStatus.LocallyInvalid){o.sdk.log(t.LogLevel.Info,(function(){return"Authenticator "+i._authenticatorType+" already became invalidated. Invalidating enrollment record and notifying ui handler."}));var u=r.getDescription(o,c.authenticatorId);e.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(o.getCurrentUserInteractionSessionProvider(),u).then((function(t){s(t)})).catch((function(t){a(t)}))}else s(!1);else s(!1)}))},i}(n.SimpleAuthenticationDriverDescriptor);n.AuthenticationDriverDescriptorLocal=o}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(n){var r=function(r){function o(){return r.call(this,n.AuthenticationDriverDeviceBiometrics,o.authenticatorName)||this}return V(o,r),o.prototype.evaluateLocalRegistrationStatus=function(i){var s=r.prototype.evaluateLocalRegistrationStatus.call(this,i);if(s!=e.AuthenticatorRegistrationStatus.Registered)return s;var a=i.user.localEnrollments[o.authenticatorName],c=n.AuthenticationDriverDeviceBiometrics.authenticatorKeyTagForUser(i.user,a.version,a.salt),u=i.sdk.host.getKeyPair(c,t.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);return u?(u.closeKeyPair(),e.AuthenticatorRegistrationStatus.Registered):e.AuthenticatorRegistrationStatus.LocallyInvalid},o.prototype.isSupportedOnDevice=function(e){var n=e.sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.DeviceBiometricsSupported);return!!n&&"false"!=n},o.authenticatorName="device_biometrics",o}(n.AuthenticationDriverDescriptorLocal);n.AuthenticationDriverDescriptorDeviceBiometrics=r}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(e){!function(e){var n=function(n){function r(){return n.call(this,e.AuthenticationDriverFace)||this}return V(r,n),r.prototype.isSupportedOnDevice=function(e){return"true"==e.sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.ImageAcquitisionSupported)},r}(e.SimpleAuthenticationDriverDescriptor);e.AuthenticationDriverDescriptorFace=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.isSupportedOnDevice=function(e){return"true"===e.sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.Fido2ClientPresent)},n}(e.SimpleAuthenticationDriverDescriptor);e.AuthenticationDriverDescriptorFido2=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(n){var r=function(r){function o(){return r.call(this,n.AuthenticationDriverFingerprint,o.authenticatorName)||this}return V(o,r),o.prototype.evaluateLocalRegistrationStatus=function(i){var s=r.prototype.evaluateLocalRegistrationStatus.call(this,i);if(s!=e.AuthenticatorRegistrationStatus.Registered)return s;var a=i.user.localEnrollments[o.authenticatorName],c=n.AuthenticationDriverFingerprint.authenticatorKeyTagForUser(i.user,a.version,a.salt),u=i.sdk.host.getKeyPair(c,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);return u?(u.closeKeyPair(),e.AuthenticatorRegistrationStatus.Registered):e.AuthenticatorRegistrationStatus.LocallyInvali
10d},o.prototype.isSupportedOnDevice=function(e){return"true"==e.sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.FingerprintSupported)},o.authenticatorName="fingerprint",o}(n.AuthenticationDriverDescriptorLocal);n.AuthenticationDriverDescriptorFingerprint=r}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(){function t(t,e){this._targetIdentifier=t,this._description=e.describe(),this._deviceDetails=e}return t.prototype.getDescription=function(){return this._description},t.prototype.getDeviceIdentifier=function(){return this._targetIdentifier},t.prototype.getDeviceDetails=function(){return this._deviceDetails},t.__tarsusInterfaceName="MobileApproveTarget",t}();e.MobileApproveTargetImpl=n;var r=function(){function r(){}return r.prototype.evaluateLocalRegistrationStatus=function(e){return t.AuthenticatorRegistrationStatus.Registered},r.prototype.isSupportedOnDevice=function(t){return!0},r.prototype.suggestParameters=function(e,n){return r.createTargetsFromConfig(e).map((function(e){return t.AuthenticationActionParameterTargetSelection.create(e)}))},r.prototype.createAuthenticationDriver=function(t,n,r){return new e.AuthenticationDriverMobileApprove(t,n,r)},r.createTargetsFromConfig=function(e){return e.selectable_devices.map((function(e,r){var o=t.TargetDeviceDetailsImpl.fromServerFormat(e);return new n(e.device_id,o)}))},r.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(t){return Promise.resolve(!0)},r}();e.AuthenticationDriverDescriptorMobileApprove=r}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(n){var r=function(r){function o(){return r.call(this,n.AuthenticationDriverNativeFace,o.authenticatorName)||this}return V(o,r),o.prototype.evaluateLocalRegistrationStatus=function(i){var s=r.prototype.evaluateLocalRegistrationStatus.call(this,i);if(s!=e.AuthenticatorRegistrationStatus.Registered)return s;var a=i.user.localEnrollments[o.authenticatorName],c=n.AuthenticationDriverNativeFace.authenticatorKeyTagForUser(i.user,a.version,a.salt),u=i.sdk.host.getKeyPair(c,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);return u?(u.closeKeyPair(),e.AuthenticatorRegistrationStatus.Registered):e.AuthenticatorRegistrationStatus.LocallyInvalid},o.prototype.isSupportedOnDevice=function(e){return"true"==e.sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported)},o.authenticatorName="face_id",o}(n.AuthenticationDriverDescriptorLocal);n.AuthenticationDriverDescriptorNativeFace=r}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(){function t(t,e,n,r,o,i){this._channelIndex=t,this._channelAssertionId=e,this._targetIdentifier=n,this._description=r,this._channel=o,this._deviceDetails=i}return t.prototype.getDescription=function(){return this._description},t.prototype.getChannel=function(){return this._channel},t.prototype.getTargetIdentifier=function(){return this._targetIdentifier},t.prototype.getChannelAssertionId=function(){return this._channelAssertionId},t.prototype.getChannelIndex=function(){return this._channelIndex},t.prototype.getDeviceDetails=function(){return this._deviceDetails},t.__tarsusInterfaceName="OtpTarget",t}();n.OtpTargetImpl=r;var o=function(){function o(){}return o.prototype.evaluateLocalRegistrationStatus=function(e){return t.AuthenticatorRegistrationStatus.Registered},o.prototype.isSupportedOnDevice=function(t){return!0},o.prototype.suggestParameters=function(e,n){return this.createTargetsFromConfig(e).map((function(e){return t.AuthenticationActionParameterTargetSelection.create(e)}))},o.prototype.createAuthenticationDriver=function(t,e,r){var o=this.createTargetsFromConfig(e);return new n.AuthenticationDriverOtp(t,e,o,r)},o.prototype.createTargetsFromConfig=function(n){return n.channels.map((function(n){var o;switch(n.type){case e.Protocol.AuthenticationMethodOtpChannelType.Email:o=t.OtpChannel.Email;break;case e.Protocol.AuthenticationMethodOtpChannelType.Sms:o=t.OtpChannel.Sms;break;case e.Protocol.AuthenticationMethodOtpChannelType.Voice:o=t.OtpChannel.VoiceCall;break;case e.Protocol.AuthenticationMethodOtpChannelType.Push:o=t.OtpChannel.PushNotification;break;default:o=t.OtpChannel.Unknown}return!n.targets&&n.target&&(n.targets={},n.targets[0]=n.target),n.targets||(n.targets={}),Object.keys(n.targets).map((function(e,i){var s=n.targets[e];switch(o){case t.OtpChannel.PushNotification:var a=s,c=t.TargetDeviceDetailsImpl.fromServerFormat(a);return new r(i,n.assertion_id,e,c.describe(),o,c);default:var u=s;return new r(i,n.assertion_id,e,u,o,null)}}))})).reduce((function(t,e){return t.concat(e)}),[])},o.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(t){return Promise.resolve(!0)},o}();n.AuthenticationDriverDescriptorOtp=o}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(){function t(t,e){this._targetIdentifier=t,this._description=e.describe(),this._deviceDetails=e}return t.prototype.getDescription=function(){return this._description},t.prototype.getDeviceIdentifier=function(){return this._targetIdentifier},t.prototype.getDeviceDetails=function(){return this._deviceDetails},t.__tarsusInterfaceName="TotpTarget",t}();e.TotpTargetImpl=n;var r=function(){function r(){}return r.prototype.evaluateLocalRegistrationStatus=function(e){return t.AuthenticatorRegistrationStatus.Registered},r.prototype.isSupportedOnDevice=function(t){return!0},r.prototype.suggestParameters=function(e,n){return r.createTargetsFromConfig(e).map((function(e){return t.AuthenticationActionParameterTarget
10Selection.create(e)}))},r.prototype.createAuthenticationDriver=function(t,n,r){return new e.AuthenticationDriverTotp(t,n,r)},r.createTargetsFromConfig=function(e){var r=e;return r.selectable_devices?r.selectable_devices.map((function(e,r){var o=t.TargetDeviceDetailsImpl.fromServerFormat(e);return new n(e.device_id,o)})):[]},r.prototype.checkAuthenticatorInvalidatedAndNotifyUIHandler=function(t){return Promise.resolve(!0)},r}();e.AuthenticationDriverDescriptorTotp=r}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(e){!function(e){var n=function(n){function r(){return n.call(this,e.AuthenticationDriverVoice)||this}return V(r,n),r.prototype.isSupportedOnDevice=function(e){return"true"==e.sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.AudioAcquitisionSupported)},r}(e.SimpleAuthenticationDriverDescriptor);e.AuthenticationDriverDescriptorVoice=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(r){function o(t,e,n){return r.call(this,t,e,n)||this}return V(o,r),Object.defineProperty(o.prototype,"lastObtainedKeyPair",{get:function(){return this._lastObtainedKeyPair},set:function(t){this._lastObtainedKeyPair&&this._lastObtainedKeyPair!=t&&this._lastObtainedKeyPair.closeKeyPair(),this._lastObtainedKeyPair=t},enumerable:!1,configurable:!0}),o.prototype.completeAuthenticatorSessionWithResult=function(o){this.operationMode===t.AuthenticatorSessionMode.Registration&&o instanceof n.AuthenticationDriverSessionResultAuthenticationCompleted&&(!o.assertionResult.assertion_error_code||o.assertionResult.assertion_error_code===e.Protocol.AssertionErrorCode.AssertionContainerNotComplete)&&(this._enrollmentRecordToCommit?(this._sdk.log(t.LogLevel.Debug,(function(){return"Updating local enrollment record on registration"})),this.user.updateEnrollmentRecord(this._enrollmentRecordToCommit)):this._sdk.log(t.LogLevel.Warning,(function(){return"No enrollment record to update."}))),this._enrollmentRecordToCommit=null,this.lastObtainedKeyPair=null,r.prototype.completeAuthenticatorSessionWithResult.call(this,o)},o.prototype.completeAuthenticatorSessionWithError=function(t){this.lastObtainedKeyPair=null,r.prototype.completeAuthenticatorSessionWithError.call(this,t)},o.prototype.registerInStartedSession=function(t){this._enrollmentRecordToCommit=null},o.prototype.calculateAssertionFieldsWithAuthenticatorKey=function(e){var n=this;return new Promise((function(r,o){var i=t.util.asciiToHex(n.localAuthenticatorChallenge());e.signHex(i).then((function(e){return{fch:t.util.hexToBase64(e)}})).then(r,o)}))},o.prototype.handleAuthenticationInputResponse=function(n){var r=this,o=this.user.localEnrollments[this.authenticatorType];o||this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.NoRegisteredAuthenticator,"Missing key for "+this.authenticatorType+" authenticator")),this.getKeyForEnrollmentDataAndInput(o,n).then((function(i){return r._sdk.log(t.LogLevel.Debug,(function(){return"Local authenticator key obtained; signing challenge"})),r.addRolloverDataIfNeeded(i,o,n).then((function(n){return r._externalCancelled?Promise.reject(r._actionDriver._controlFlowProcessor.createExternalCancellationError()):(r.lastObtainedKeyPair=n.key,r.calculateAssertionFieldsWithAuthenticatorKey(n.key).then((function(i){var s={};if(n.rolloverKeyData){r._sdk.log(t.LogLevel.Info,(function(){return"Local authenticator rollover requested"}));var a={};n.rolloverKeyData.key&&(a.key=n.rolloverKeyData.key.publicKeyToJson(),a.version=n.rolloverKeyData.schemeVersion),n.rolloverReason&&(a.reason=n.rolloverReason),n.rolloverOldKeyHash&&(a.expired_key={hash:n.rolloverOldKeyHash}),s.rollover=a,r._enrollmentRecordToCommit=o.duplicate(),r._enrollmentRecordToCommit.status=e.LocalEnrollmentStatus.Registered,r._enrollmentRecordToCommit.validationStatus=e.LocalEnrollmentValidationStatus.Validated,r._enrollmentRecordToCommit.
10salt=n.rolloverKeyData.salt,r._enrollmentRecordToCommit.version=n.rolloverKeyData.schemeVersion,r._enrollmentRecordToCommit.keyMaterial=n.rolloverKeyData.keyMeterial,r._enrollmentRecordToCommit.cryptoSettings=r._sdk.cryptoSettings,r._enrollmentRecordToCommit.authenticatorConfig=n.rolloverKeyData.authenticatorConfig,r._enrollmentRecordToCommit.publicKeyHash=t.util.calcPublicKeyHexStringEncodedSha256Hash(n.rolloverKeyData.key,r._sdk)}r.processAuthenticateAssertion(s,i)}),(function(t){return Promise.reject(t)})))})).catch((function(e){r.processLocalAuthenticatorError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))})).catch((function(e){r.processLocalAuthenticatorError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},o.prototype.addRolloverDataIfNeeded=function(e,n,r){var o=this;if(this.rolloverNeeded(n)){var i=this.getRolloverReason(n);return this._sdk.log(t.LogLevel.Debug,(function(){return"AuthenticatorKeyRoll: "+i})),this.generatePendingEnrollment(r,!0).then((function(r){return e.rolloverKeyData=r,e.rolloverReason=i,n.publicKeyHash?e.rolloverOldKeyHash=n.publicKeyHash:e.rolloverOldKeyHash=t.util.calcPublicKeyHexStringEncodedSha256Hash(e.key,o._sdk),Promise.resolve(e)}))}return Promise.resolve(e)},o.prototype.getNewOrUpdatedEnrollmentRecord=function(n){var r=this;this._sdk.log(t.LogLevel.Debug,(function(){return"Register "+r.authenticatorType+": fetching local enrollment record"}));var o=this.user.localEnrollments[this.authenticatorType],i=t.util.calcPublicKeyHexStringEncodedSha256Hash(n.key,this._sdk);return o||(this._sdk.log(t.LogLevel.Debug,(function(){return"Register "+r.authenticatorType+": Generating new local enrollment record"})),o=this.user.createEnrollmentRecord(this.authenticatorType,n.schemeVersion,n.salt,e.LocalEnrollmentStatus.Unregistered,i)),o.status=e.LocalEnrollmentStatus.Registered,o.validationStatus=e.LocalEnrollmentValidationStatus.Validated,o.salt=n.salt,o.version=n.schemeVersion,o.cryptoSettings=this._sdk.cryptoSettings,o.publicKeyHash=i,o.keyMaterial=n.keyMeterial,o.authenticatorConfig=n.authenticatorConfig,o},o.prototype.handleRegistrationInputResponse=function(e){var n=this;this._sdk.log(t.LogLevel.Debug,(function(){return"Register "+n.authenticatorType+": Generating pending enrollment data"})),this.generatePendingEnrollment(e).then((function(t){return n.handleRegisterAssertion(t)})).catch((function(e){n.processLocalAuthenticatorError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},o.prototype.handleRegisterAssertion=function(e){var n=this;return this._sdk.log(t.LogLevel.Debug,(function(){return"Register "+n.authenticatorType+": Signing registration assertion"})),this.calculateAssertionFieldsWithAuthenticatorKey(e.key).then((function(r){n._sdk.log(t.LogLevel.Debug,(function(){return"Register "+n.authenticatorType+": Preparing registration assertion"}));var o=n.getNewOrUpdatedEnrollmentRecord(e);if(n._enrollmentRecordToCommit=o,n._externalCancelled)return Promise.reject(n._actionDriver._controlFlowProcessor.createExternalCancellationError());n.lastObtainedKeyPair=e.key;var i=G({public_key:e.key.publicKeyToJson(),version:e.schemeVersion},r);n.processRegisterAssertion(null,i)}),(function(t){return Promise.reject(t)}))},o.prototype.handleRegisterAssertionResult=function(t){return t.data&&t.data.update_vaults&&e.vault.MultiCredsVault.updateVaultsProtectingCreds(this.user,t.data.update_vaults,this._uiHandler,this._sdk),r.prototype.handleRegisterAssertionResult.call(this,t)},o.prototype.handleUnregistrationAssertionResult=function(n){var o=this,i=this.user.localEnrollments[this.authenticatorType];i?(i.status=e.LocalEnrollmentStatus.Unregistered,this.user.updateEnrollmentRecord(i),this.unregisterEnrollmentAssets(i)):this._sdk.log(t.LogLevel.Warning,(function(){return"Failed to find enrollment record for "+o.authenticatorType})),n.data&&n.data.update_vaults&&e.vault.MultiCredsVault.updateVaultsProtectingCreds(this.user,n.data.update_vaults,this._uiHandler,this._sdk),r.prototype.handleUnregistrationAssertionResult.call(this,n)},o.prototype.handleAuthenticateAssertionResult=function(n,o,i,s,a){if(this._enrollmentRecordToCommit)if(n.assertion_error_code){if(n.assertion_error_code==e.Protocol.AssertionErrorCode.AckRequired)return this.user.updateEnrollmentRecord(this._enrollmentRecordToCommit),n.data&&n.data.update_vaults&&e.vault.MultiCredsVault.updateVaultsProtectingCreds(this.user,n.data.update_vaults,this._uiHandler,this._sdk),this.processRolloverAckAssertionRequest(this._enrollmentRecordToCommit.publicKeyHash,a),this._enrollmentRecordToCommit=null,!0}else this._sdk.log(t.LogLevel.Debug,(function(){return"Pending commit for enrollment; checking rollover status."})),n.data&&n.data.rollover&&0==n.data.rollover.code?(this._sdk.log(t.LogLevel.Info,(function(){return"Updating local enrollment record on authentication result"})),this.user.updateEnrollmentRecord(this._enrollmentRecordToCommit)):this._sdk.log(t.LogLevel.Error,(function(){return"Received a rollover failure response from the server; aboting rollover."}));return this._enrollmentRecordToCommit=null,r.prototype.handleAuthenticateAssertionResult.call(this,n,o,i,s,a)},o.prototype.processRolloverAckAssertionRequest=function(e,n){this._sdk.log(t.LogLevel.Info,(function(){return"AuthenticatorKeyRollover: Processing ack assertion request..."}));var r={};if(n&&n.fch){r={fch:n.fch};var o={rollover_ack:{hash:e}};this.processAuthenticateAssertion(o,r)}else this.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Invalid assertion fields - missing fch"))},o.prototype.processLocalAuthenticatorError=function(t){this.performErrorRecoveryForError(t)},o.prototype.localAuthenticatorChallenge=function(){var t=this._actionDriver._controlFlowProcessor.challenge+this._authenticatorDescription.assertionId,e=this._authenticatorConfig.extended_challenge_data;return e&&(t+=e),t},o.prototype.getAuthenticatorEnrollmentConfig=function(){return null},o.prototype.onCancelRun=function(){r.prototype.onCancelRun.call(this),this.lastObtainedKeyPair&&(this.lastObtainedKeyPair=null)},o.prototype.shouldAllowBiometricFallbackButton=function(n){var r=this;if(!n)return!1;var o=this._actionDriver.availableAuthenticatorsForSwitching.filter((function(t){return t!=r._authenticatorDescription}));if(this._actionDriver instanceof e.actiondrivers.ActionDriverRegistration||this._actionDriver instanceof e.actiondrivers.ActionDriverAuthentication&&0==o.length)return!1;var i=n,s=i.getFallbackButtonTitle();if(!(s&&s.length>0))return!1;var a=i.getFallbackControlRequestType();switch(null==a&&(a=t.ControlRequestType.SelectMethod),a){case t.ControlRequestType.ChangeMethod:case t.ControlRequestType.SelectMethod:return this._actionDriver.availableAuthenticators.length>1;default:return!0}},o.prototype.publicKeyExpired=function(e){var n=this;if(!this._authenticatorConfig.public_key_expired)return!1;var r=e===this._authenticatorConfig.public_key_expired.hash;return this._sdk.log(t.LogLevel.Debug,(function(){return"AuthenticatorKeyRoll: authenticator "+n.authenticatorType+" \n key hash matching expired key hash received from server: "+r})),r},o.prototype.getRolloverReason=function(t){return this.publicKeyExpired(t.publicKeyHash)?"Rollover of "+this.authenticatorType+" authenticator public key due to expiration":"Upgrading "+this.authenticatorType+" authenticator scheme from "+t.version+" to "+this.currentScheme},o.prototype.rolloverNeeded=function(t){return this.publicKeyExpired(t.publicKeyHash)||this.schemeVersionRequiresRollover(t.version)},o}(n.AuthenticationDriver);n.AuthenticationDriverLocal=r}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){t.instanceOfAuthenticationDriverSilentRegistrationSupport=function(t){return t.runSilentRegistration}}(t.authenticationdrivers||(t.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){!function(n){!function(n){var r=function(r){function o(){return null!==r&&r.apply(this,arguments)||this}return V(o,r),o.prototype.unregisterEnrollmentAssets=function(t){var e=this.authenticatorKeyTagForScheme(t.version,t.salt);this._sdk.host.deleteKeyPair(e)},o.prototype.invokeCancellationUiOrEscape=function(){var r=this._actionDriver._policyAction.getEscapeOptions().filter((function(e){return e.getPresentation()==t.ts.mobile.sdk.ActionEscapeOptionPresentation.Cancel}))[0];if(r){this._sdk.log(e.LogLevel.Debug,(function(){return"Got cancel escape option; responding with that."}));var o=new e.ActionEscapeRequest;o._escapeOption=r,o._escapeParameters=null,this.completeAuthenticatorSessionWithResult(new n.AuthenticationDriverSessionResultEscapeRequested(o))}else this._sdk.log(e.LogLevel.Debug,(function(){return"Invoking UI cancellation handler."})),this.invokeUiHandlerCancellation()},o}(n.AuthenticationDriverLocal);
10n.AuthenticationDriverLocalPersistentKeyPairBased=r}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(e){!function(e){var n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.schemeVersionRequiresRollover=function(e){return"v0"==e||"v1"==e||"v2"==e&&"true"!=this._sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.StdSigningKeyIsHardwareProtectedSignAndEncryptKey)},n}(e.AuthenticationDriverLocalPersistentKeyPairBased);e.AuthenticationDriverLocalPersistentKeyPairBasedPostV2Scheme=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(e){var n=function(){function e(){}return e.deviceBiometricInput=function(t,n){var r=e.newBiometricPromptInfo();return r.setLocalizedTitle(t.getTitle()),r.setLocalizedSubtitle(t.getSubtitle()),r.setLocalizedPrompt(t.getPrompt()),r.setCancelButtonTitle(t.getCancelButtonTitle()),n&&void 0!==n.require_confirmation?r.setRequireConfirmation(n.require_confirmation):r.setRequireConfirmation(!0),r},e.fingerprintInput=function(t){var n=e.newBiometricPromptInfo();n.setLocalizedPrompt(t.getPrompt());var r=t.getCancelButtonTitle();r&&0<r.length&&n.setCancelButtonTitle(r);var o=t.getFallbackButtonTitle();return o&&0<o.length&&n.setFallbackButtonTitle(o),n},e.nativeFaceInput=function(t){var n=e.newBiometricPromptInfo();n.setLocalizedPrompt(t.getPrompt());var r=t.getCancelButtonTitle();r&&0<r.length&&n.setCancelButtonTitle(r);var o=t.getFallbackButtonTitle();return o&&0<o.length&&n.setFallbackButtonTitle(o),n},e.newBiometricPromptInfo=function(){var e=new t.sdkhost.BiometricPromptInfo;return e.setCancelButtonTitle(null),e.setFallbackButtonTitle(null),e.setLocalizedPrompt(null),e.setLocalizedSubtitle(null),e.setLocalizedTitle(null),e},e}();e.BiometricPromptInfoFrom=n}(e.util||(e.util={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(o){function i(t,e,n){return o.call(this,t,e,n)||this}return V(i,o),i.authenticatorKeySchemeForMigratedEnrollment=function(t){if(0===t.indexOf("v0")){var e=t.split("_");return 1<e.length?e[1]:"v3"}return null},i.authenticatorKeyTagForUserForMigratedEnrollment=function(t,e,n){var o=i.authenticatorKeySchemeForMigratedEnrollment(e);return o?r.AuthenticationDriverFingerprint.authenticatorKeyTagForUser(t,o,n):null},i.authenticatorKeyTagForUser=function(t,e,o){return i.authenticatorKeyTagForUserForMigratedEnrollment(t,e,o)||new n.TarsusKeyPath("per_user",t.guid.toString(),"local_auth_keys",r.AuthenticationDriverDescriptorDeviceBiometrics.authenticatorName,e,o)},i.prototype.schemeVersionRequiresRollover=function(t){var e=i.authenticatorKeySchemeForMigratedEnrollment(t);return!(!e||!o.prototype.schemeVersionRequiresRollover.call(this,e))},Object.defineProperty(i.prototype,"signChallengeMode",{get:function(){var e=this._sdk.host.queryHostInfo(t.sdkhost.HostInformationKey.DeviceBiometricsUsesSign);return!!e&&"true"==e},enumerable:!1,configurable:!0}),i.prototype.runSilentRegistration=function(){var t=this;return this.generateAuthenticatorKey().then((function(n){var o=t.getNewOrUpdatedEnrollmentRecord(n),i={public_key:n.key.publicKeyToJson(),encrypted_challenge_mode:!t.signChallengeMode,version:n.schemeVersion};return t._actionDriver.sendAuthenticatorAssertionRequest(t._authenticatorDescription,"register",null,i).then((function(n){if(n.assertion_error_code)throw e.impl.AuthenticationErrorImpl.errorForAssertionResponse(n);return t.user.updateEnrollmentRecord(o),new r.AuthenticationDriverSessionResultAuthenticationCompleted(n)}))}))},i.prototype.createAuthenticatorSession=function(){return this._sdk.log(e.LogLevel.Debug,(function(){return"Create DSA session."})),this._uiHandler.createDeviceBiometricsAuthSession(r.AuthenticationDriverDescriptorDeviceBiometrics.authenticatorName,this.user.displayName)},i.prototype.authenticateInStartedSession=function(t){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(t){return n.completeAuthenticatorSessionWithError(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},i.prototype.registerInStartedSession=function(t){var n=this;this._sdk.log(e.LogLevel.Debug,(function(){return"Register DSA in started session."})),o.prototype.registerInStartedSession.call(this,t),this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(t){return n.completeAuthenticatorSessionWithError(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},i.prototype.handleRegistrationInputResponse=function(t){var n=this;this._sdk.log(e.LogLevel.Debug,(function(){return"Register "+n.authenticatorType+": Generating pending enrollment data"})),this.getNewPendingEnrollmentOrReuse(t).then((function(t){return n._pendingEnrollmentData=t,n.handleRegisterAssertion(t)})).catch((function(t){n.processLocalAuthenticatorError(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},i.prototype.handleFallback=function(){this.lastObtainedKeyPair=null,o.prototype.handleFallback.call(this)},Object.defineProperty(i.prototype,"authenticatorType",{get:function(){return r.AuthenticationDriverDescriptorDeviceBiometrics.authenticatorName}
10,enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"currentScheme",{get:function(){return"v1"},enumerable:!1,configurable:!0}),i.prototype.processLocalAuthenticatorError=function(r){var o=this,i=r,s=0,a=Promise.resolve();if(i.getErrorCode()==e.AuthenticationErrorCode.Internal&&i.getData()){var c=i.getData();s=c[t.sdkhost.ErrorDataNumFailures]||0,i=e.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(c,"Biometrics")||i,(c[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricInvalidated||c[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered())&&(this._sdk.log(e.LogLevel.Debug,(function(){return"Biometric invalidated "+c[t.sdkhost.ErrorDataInternalError]})),a=n.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._actionDriver._controlFlowProcessor,this._authenticatorDescription))}a.catch((function(t){o._sdk.log(e.LogLevel.Error,t)})),a.finally((function(){if(i.getErrorCode()==e.AuthenticationErrorCode.UserCanceled)return o._sdk.log(e.LogLevel.Debug,(function(){return"Device biometrics captured user cancel error code."})),void o.invokeCancellationUiOrEscape();s&&o._operationMode==e.AuthenticatorSessionMode.Authentication?o.processAuthFailureAssertionAndHandleError(i,s):o.performErrorRecoveryForError(i)}))},i.prototype.performErrorRecoveryForError=function(t,n){this.recoveryOptionsForError(t,n).indexOf(e.AuthenticationErrorRecovery.RetryAuthenticator)<0&&(this.lastObtainedKeyPair=null),o.prototype.performErrorRecoveryForError.call(this,t,n)},i.prototype.getKeyForEnrollmentDataAndInput=function(n,r){var o=this;return new Promise((function(i,s){var a,c=r,u=o.authenticatorKeyTagForScheme(n.version,n.salt);if(!(a=o.lastObtainedKeyPair&&o.lastObtainedKeyPair.getTag()===u.toString()?o.lastObtainedKeyPair:o._sdk.host.getKeyPair(u,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb))){var l={};
10throw l[t.sdkhost.ErrorDataInternalError]=t.sdkhost.InternalErrorBiometricInvalidated,new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated biometrics.",l)}a.setBiometricPromptInfo(e.util.BiometricPromptInfoFrom.deviceBiometricInput(c,o._authenticatorConfig),null,null),i({key:a})}))},i.prototype.getNewPendingEnrollmentOrReuse=function(t,e){return this._pendingEnrollmentData?Promise.resolve(this._pendingEnrollmentData):this.generatePendingEnrollment(t,e)},i.prototype.generatePendingEnrollment=function(t,n){var r=this;return this.generateAuthenticatorKey().then((function(o){if(!n){var i=t;o.key.setBiometricPromptInfo(e.util.BiometricPromptInfoFrom.deviceBiometricInput(i,r._authenticatorConfig),null,null)}return o}))},i.prototype.generateAuthenticatorKey=function(){var n,r=this;n=this._sdk.host.generateRandomHexString(24);var o=this.authenticatorKeyTagForScheme(this.currentScheme,n);return e.util.wrapPromiseWithActivityIndicator(this._uiHandler,this._actionDriver.policyAction(),this._clientContext,this._sdk.host.generateKeyPair(o,t.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,!0).then((function(t){return{key:t,salt:n,schemeVersion:r.currentScheme}}),(function(t){if(t.getErrorCode()==e.AuthenticationErrorCode.Internal&&t.getData()){var n=t.getData(),r=e.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(n,"Biometrics");if(r)throw r}throw t})))},i.prototype.calculateAssertionFieldsWithAuthenticatorKey=function(t){var n=this._authenticatorConfig;if(!this.signChallengeMode){if(this.operationMode==e.AuthenticatorSessionMode.Registration)return t.decrypt("").then((function(){return{data:{encrypted_challenge_mode:!0}}}));var r=n&&n.encrypted_challenge;return r?new Promise((function(n,o){var i=e.util.base64ToHex(r);t.decrypt(i).then((function(t){return{fch:e.util.hexToBase64(t)}})).then(n,o)})):Promise.reject(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Invalid server response for decrypt-mode authenticator. Missing encrypted challenge."))}return o.prototype.calculateAssertionFieldsWithAuthenticatorKey.call(this,t)},i.prototype.authenticatorKeyTagForScheme=function(t,e){return i.authenticatorKeyTagForUser(this.user,t,e)},i.prototype.completeAuthenticatorSessionWithResult=function(t){this._pendingEnrollmentData=null,o.prototype.completeAuthenticatorSessionWithResult.call(this,t)},i.prototype.completeAuthenticatorSessionWithError=function(t){this._pendingEnrollmentData=null,o.prototype.completeAuthenticatorSessionWithError.call(this,t)},i}(r.AuthenticationDriverLocalPersistentKeyPairBasedPostV2Scheme);r.AuthenticationDriverDeviceBiometrics=o}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e,r){return n.call(this,t,e,r)||this}return V(r,n),r.prototype.getMaxStep=function(){return-1},r.prototype.authenticateInStartedSession=function(t){t||this.initializeFirstStep(),this.pumpStep()},r.prototype.registerInStartedSession=function(t){t||this.initializeFirstStep(),this.pumpStep()},r.prototype.pumpStep=function(){var e=this,n=this._inputSession;n.setInputStep(this._currentStepIndex,this.getMaxStep(),this._currentStep),n.promiseInput().then((function(t){return e.handleInputOrControlResponse(t)}),(function(n){return e.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))}))},r.prototype.handleAuthenticateAssertionResult=function(t,e,r,o,i){return!!this.handleStepManagementAssertionResult(t)||n.prototype.handleAuthenticateAssertionResult.call(this,t,e,r,o,i)},r.prototype.handleRegisterAssertionResult=function(t){return!!this.handleStepManagementAssertionResult(t)||n.prototype.handleRegisterAssertionResult.call(this,t)},r.prototype.handleStepManagementAssertionResult=function(t){if(t.assertion_error_code==e.Protocol.AssertionErrorCode.NotFinished){var n=this.prepareNextAuthenticationStep(t);return n!=this._currentStep&&(this._currentStep=n,this._currentStepIndex++),this.pumpStep(),!0}return t.assertion_error_code==e.Protocol.AssertionErrorCode.RepeatCurrentStep&&(this._currentStep=this.updateCurrentAuthenticationStep(t,this._currentStep),this.pumpStep(),!0)},r.prototype.initializeFirstStep=function(){this._currentStep=this.createInitialInputStep(),this._currentStepIndex=0},r}(n.AuthenticationDriver);n.AuthenticationDriverMultiStep=r}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),n.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFaceAuthSession("face",this.user.displayName)},n.prototype.createInitialInputStep=function(){var e=this._authenticatorConfig;return new t.impl.CameraAcquisitionStepDescriptionImpl(e.acquisition_challenges)},n.prototype.prepareNextAuthenticationStep=function(t){return this.createInitialInputStep()},n.prototype.updateCurrentAuthenticationStep=function(t,e){return e},n.prototype.handleAuthenticationInputResponse=function(t){var e=t;this.processAuthenticateAssertion(e.getAcquisitionResponse())},n.prototype.handleRegistrationInputResponse=function(t){var e=t;this.processRegisterAssertion(e.getAcquisitionResponse())},n}(e.AuthenticationDriverMultiStep);e.AuthenticationDriverFace=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){var n,r;r=e.sdk||(e.sdk={}),function(o){var i=function(){function o(t,e,n,r,o,i){this.cancellationDOMErrorNames=["NotAllowedError","AbortError"],this.sdk=t,this.username=e,this.uiHandler=n,this.clientContext=r,this.actionContext=o,this.config=i,this.config.require_display_name_from_user&&(this.hostUiAuthenticatorSession=this.uiHandler.createFido2AuthSession("fido2",e))}return o.prototype.startSession=function(t,e,n,o){this.description=t,this.mode=e,this.actionContext=n,this.clientContext=o,this.hostUiAuthenticatorSession&&(this.mode==r.AuthenticatorSessionMode.Registration?this.hostUiAuthenticatorSession.startSession(t,e,n,o):(this.hostUiAuthenticatorSession.endSession(),delete this.hostUiAuthenticatorSession))},o.prototype.changeSessionModeToRegistrationAfterExpiration=function(){this.mode=t.ts.mobile.sdk.AuthenticatorSessionMode.Registration,this.hostUiAuthenticatorSession&&this.hostUiAuthenticatorSession.changeSessionModeToRegistrationAfterExpiration()},o.prototype.promiseRecoveryForError=function(t,e,n){return this.hostUiAuthenticatorSession?this.hostUiAuthenticatorSession.promiseRecoveryForError(t,e,n):Promise.resolve(r.AuthenticationErrorRecovery.Fail)},o.prototype.promiseInput=function(){return this.hostUiAuthenticatorSession?this.hostUiAuthenticatorSession.promiseInput():this.performFido2CredentialsOp()},o.prototype.endSession=function(){this.hostUiAuthenticatorSession&&(this.hostUiAuthenticatorSession.endSession(),delete this.hostUiAuthenticatorSession)},o.prototype.performFido2CredentialsOp=function(o){var i,s,a=this;return this.mode===t.ts.mobile.sdk.AuthenticatorSessionMode.Authentication?(i=this.config.credentialRequestOptions,s=e.sdkhost.Fido2CredentialsOpType.Get):((i=this.config.credentialCreationOptions)?s=e.sdkhost.Fido2CredentialsOpType.Create:(i=this.config.credentialRequestOptions,s=e.sdkhost.Fido2CredentialsOpType.Get),o&&(i=this.enrichOptionsWithDisplayName(i,o))),this.sdk.host.fido2CredentialsOp(this.uiHandler,this.clientContext,this.actionContext,s,i).then((function(t){return r.InputOrControlResponse.createInputResponse(n.Fido2InputResponseInternal.createSuccessResponse(t))})).catch((function(e){var o=t.ts.mobile.sdk.impl.AuthenticationErrorImpl.ensureAuthenticationError(e);
10if(o.getErrorCode()===r.AuthenticationErrorCode.UserCanceled){a.sdk.log(r.LogLevel.Debug,(function(){return"Received FIDO2 cancellation request."}));var i=a.actionContext.getEscapeOptions().filter((function(e){return e.getPresentation()==t.ts.mobile.sdk.ActionEscapeOptionPresentation.Cancel}))[0];return i?(a.sdk.log(r.LogLevel.Debug,(function(){return"Got cancel escape option; responding with that."})),r.InputOrControlResponse.createEscapeResponse(i,null)):(a.sdk.log(r.LogLevel.Debug,(function(){return"Responding with auth cancel control request."})),r.InputOrControlResponse.createControlResponse(r.ControlRequest.create(r.ControlRequestType.CancelAuthenticator)))}return a.sdk.log(r.LogLevel.Debug,(function(){return"Received FIDO2 error response from client: "+o})),r.InputOrControlResponse.createInputResponse(n.Fido2InputResponseInternal.createdFailedResponse(o))}))},o.prototype.enrichOptionsWithDisplayName=function(t,e){return t.publicKey.user.displayName=e,t},o}();o.Fido2AuthenticatorSessionInternal=i;var s=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return V(o,t),o.prototype.createAuthenticatorSession=function(){if("true"===this._sdk.host.queryHostInfo(e.sdkhost.HostInformationKey.Fido2ClientPresent))return new i(this._sdk,this.user.displayName,this._uiHandler,this._clientContext,this._actionDriver.policyAction(),this._authenticatorConfig);throw new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.AuthenticatorExternalConfigError,"Can't find FIDO2 client to handle FIDO2 authentication.")},o.prototype.authenticateInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then((function(t){return e.handleInputOrControlResponse(t)}),(function(t){return e.completeAuthenticatorSessionWithError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},o.prototype.handleAuthenticationInputResponse=function(t){if(t instanceof n.Fido2AuthenticatorSuccessResponse){this._sdk.log(r.LogLevel.Debug,(function(){return"Fido2 received Fido2AuthenticatorSuccessResponse."}));var e=t.getFido2Response();this.processAuthenticateAssertion({assertion_credential:{id:e.id,response:{authenticatorData:e.response.authenticatorData,clientDataJSON:e.response.clientDataJSON,signature:e.response.signature,userHandle:e.response.userHandle},type:e.type,clientExtensionResults:e.clientExtensionResults}})}else t instanceof n.Fido2AuthenticationFailedResponse?(this._sdk.log(r.LogLevel.Debug,(function(){return"Fido2 received Fido2AuthenticationFailedResponse."})),this.handleFido2FailureResponse(t)):(this._sdk.log(r.LogLevel.Error,(function(){return"Fido2 received unknkown response type."})),this.performErrorRecoveryForError(new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.AppImplementation,"Fido2 received unknkown response type.")))},o.prototype.registerInStartedSession=function(t){var e=this;this._inputSession.promiseInput().then((function(t){return e.handleInputOrControlResponse(t)}),(function(t){return e.completeAuthenticatorSessionWithError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},o.prototype.handleRegistrationInputResponse=function(t){var e=this;if(t instanceof r.Fido2InputResponse){var o=t.getDisplayName();this._sdk.log(r.LogLevel.Debug,(function(){return"Fido2 received authenticator display name: "+o})),this.validateDisplayNameFormat(o)?(this._displayName=o,this._inputSession.performFido2CredentialsOp(o).then((function(t){return e.handleInputOrControlResponse(t)}),(function(t){return e.completeAuthenticatorSessionWithError(r.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))):this.performErrorRecoveryForError(new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.InvalidInput,"Display name can't be empty"))}else if(t instanceof n.Fido2AuthenticatorSuccessResponse)if(this._authenticatorConfig.credentialCreationOptions){this._sdk.log(r.LogLevel.Debug,(function(){return"Fido2 received Fido2AuthenticatorSuccessResponse."}));var i=t.getFido2Response();(!this._displayName||this._displayName.length<=0)&&(this._displayName=this._authenticatorConfig.credentialCreationOptions.publicKey.user.displayName),this.processRegisterAssertion({attestation_credential:{id:i.id,response:{attestationObject:i.response.attestationObject,clientDataJSON:i.response.clientDataJSON,transports:i.response.transports},type:i.type,clientExtensionResults:i.clientExtensionResults},display_name:this._displayName})}else this.handleAuthenticationInputResponse(t);else t instanceof n.Fido2AuthenticationFailedResponse?(this._sdk.log(r.LogLevel.Debug,(function(){return"Fido2 received Fido2AuthenticationFailedResponse."})),this.handleFido2FailureResponse(t)):(this._sdk.log(r.LogLevel.Error,(function(){return"Fido2 received unknkown response type."})),this.performErrorRecoveryForError(new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.AppImplementation,"Fido2 received unknkown response type.")))},o.prototype.handleFido2FailureResponse=function(t){this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"auth_failure",{num_of_failures:1}),this.performErrorRecoveryForError(t.getFailureError())},o.prototype.handleAuthenticateAssertionResult=function(e,o,i,s,a){if(e.assertion_error_code&&e.assertion_error_code==n.Protocol.AssertionErrorCode.FailedAssertion&&e.data)switch(e.data.reason){case n.Protocol.ServerResponseDataErrorReasonReasons.ErrorReasonAttestationReverificationFailed:this._sdk.log(r.LogLevel.Debug,(function(){return"handleAuthenticateAssertionResult() for FIDO2 that failed attestation reverification"}));var c=new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.AuthenticatorError,e.assertion_error_message||"FIDO2 credential failed attestation reverification");return c.setPublicProperty(r.AuthenticationErrorProperty.AuthenticationErrorReason,r.AuthenticationErrorPropertySymbol.AuthenticationErrorReasonAttestationReverificationFailed),this.performErrorRecoveryForError(c),!0;case n.Protocol.ServerResponseDataErrorReasonReasons.ErrorReasonCredentialFiltered:return this._sdk.log(r.LogLevel.Debug,(function(){return"handleAuthenticateAssertionResult() for FIDO2 with filtered credential"})),this.handleCredentialFiltered(e)}return t.prototype.handleAuthenticateAssertionResult.call(this,e,o,i,s,a)},o.prototype.handleRegisterAssertionResult=function(e){if(e.assertion_error_code&&e.assertion_error_code==n.Protocol.AssertionErrorCode.Internal&&e.data)switch(e.data.reason){case n.Protocol.ServerResponseDataErrorReasonReasons.ErrorReasonCredentialFiltered:return this._sdk.log(r.LogLevel.Debug,(function(){return"handleRegisterAssertionResult() for FIDO2 with filtered credential"})),this.handleCredentialFiltered(e)}return t.prototype.handleRegisterAssertionResult.call(this,e)},o.prototype.handleCredentialFiltered=function(t){var e=new r.impl.AuthenticationErrorImpl(r.AuthenticationErrorCode.AuthenticatorError,t.assertion_error_message||"FIDO2 with filtered credential");return e.setPublicProperty(r.AuthenticationErrorProperty.AuthenticationErrorReason,r.AuthenticationErrorPropertySymbol.AuthenticationErrorReasonCredentialFiltered),this.performErrorRecoveryForError(e),!0},o.prototype.validateDisplayNameFormat=function(t){return!(!t||t.length<=0)},o}(o.AuthenticationDriver);o.AuthenticationDriverFido2=s}((n=r.core||(r.core={})).authenticationdrivers||(n.authenticationdrivers={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){r.AUTHENTICATION_DRIVER_FINGERPRINT_CURRENT_SCHEME="v3";var o=function(o){function i(t,e,n){return o.call(this,t,e,n)||this}return V(i,o),i.prototype.getBiometricPromptFallbackControlType=function(){return null!=this._biometricPromptFallbackControlType?this._biometricPromptFallbackControlType:e.ControlRequestType.SelectMethod},i.authenticatorKeyTagForUser=function(t,e,o){return new n.TarsusKeyPath("per_user",t.guid.toString(),"local_auth_keys",r.AuthenticationDriverDescriptorFingerprint.authenticatorName,e,o)},i.prototype.shouldAllowBiometricFallbackButton=function(t){var r=this;if(!t)return!1;var o=this._actionDriver.availableAuthenticatorsForSwitching.filter((function(t){return t!=r._authenticatorDescription}));if(this._actionDriver instanceof n.actiondrivers.ActionDriverRegistration||this._actionDriver instanceof n.actiondrivers.ActionDriverAuthentication&&0==o.length)return!1;var i=t,s=i.getFallbackButtonTitle();if(!(s&&s.length>0))return!1;var a=i.getFallbackControlRequestType();switch(null==a&&(a=e.ControlRequestType.SelectMethod),a){case e.ControlRequestType.ChangeMethod:return this._actionDriver.availableAuthenticatorsForSwitching.filter((function(t){return t!=r._authenticatorDescription})).length>0;case e.ControlRequestType.SelectMethod:return this._actionDriver.availableAuthenticatorsForSwitching.length>0;default:return!0}},i.prototype.runSilentRegistration=function(){var t=this;return this.generateAuthenticatorKey().then((function(n){var o=t.getNewOrUpdatedEnrollmentRecord(n),i={public_key:n.key.publicKeyToJson(),version:n.schemeVersion};return t._actionDriver.sendAuthenticatorAssertionRequest(t._authenticatorDescription,"register",null,i).then((function(n){if(n.assertion_error_code)throw e.impl.AuthenticationErrorImpl.errorForAssertionResponse(n);return t.user.updateEnrollmentRecord(o),new r.AuthenticationDriverSessionResultAuthenticationCompleted(n)}))}))},i.prototype.createAuthenticatorSession=function(){return this._uiHandler.createFingerprintAuthSession(r.AuthenticationDriverDescriptorFingerprint.authenticatorName,this.user.displayName)},i.prototype.authenticateInStartedSession=function(t){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(t){return n.completeAuthenticatorSessionWithError(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},i.prototype.registerInStartedSession=function(t){var n=this;o.prototype.registerInStartedSession.call(this,t),this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(t){return n.completeAuthenticatorSessionWithError(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},Object.defineProperty(i.prototype,"authenticatorType",{get:function(){return r.AuthenticationDriverDescriptorFingerprint.authenticatorName}
10,enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"currentScheme",{get:function(){return r.AUTHENTICATION_DRIVER_FINGERPRINT_CURRENT_SCHEME},enumerable:!1,configurable:!0}),i.prototype.processLocalAuthenticatorError=function(r){var o=this,i=r,s=0,a=Promise.resolve();if(i.getErrorCode()==e.AuthenticationErrorCode.Internal&&i.getData()){var c=i.getData();s=c[t.sdkhost.ErrorDataNumFailures]||s,i=e.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(c,"Fingerprint")||i,(c[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()||c[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricInvalidated)&&(a=n.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._actionDriver._controlFlowProcessor,this._authenticatorDescription))}a.catch((function(t){o._sdk.log(e.LogLevel.Error,t)})),a.finally((function(){var n=i.getData();if(!s||o._operationMode!=e.AuthenticatorSessionMode.Authentication)return n[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricFallbackPressed?(o._sdk.log(e.LogLevel.Debug,(function(){return"Biometric prompt fallback button pressed"})),void o.processControlRequest(e.ControlRequest.create(o.getBiometricPromptFallbackControlType()))):i.getErrorCode()==e.AuthenticationErrorCode.UserCanceled?(o._sdk.log(e.LogLevel.Debug,(function(){return"Fingerprint authenticator captured user cancel error code."})),void o.invokeCancellationUiOrEscape()):void o.performErrorRecoveryForError(i);o.processAuthFailureAssertionAndHandleError(i,s)}))},i.prototype.getKeyForEnrollmentDataAndInput=function(n,r){var o=this;return new Promise((function(i,s){var a=r;o.shouldAllowBiometricFallbackButton(a)&&(o._biometricPromptFallbackControlType=a.getFallbackControlRequestType());var c=o.authenticatorKeyTagForScheme(n.version,n.salt),u=o._sdk.host.getKeyPair(c,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!u){var l={};
10throw l[t.sdkhost.ErrorDataInternalError]=t.sdkhost.InternalErrorBiometricInvalidated,new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated Fingerprint.",l)}u.setBiometricPromptInfo(e.util.BiometricPromptInfoFrom.fingerprintInput(a),o._uiHandler,o._inputSession),i({key:u})}))},i.prototype.generatePendingEnrollment=function(t,n){var r=this;return this.generateAuthenticatorKey().then((function(o){if(!n){var i=t;r.shouldAllowBiometricFallbackButton(i)&&(r._biometricPromptFallbackControlType=i.getFallbackControlRequestType()),o.key.setBiometricPromptInfo(e.util.BiometricPromptInfoFrom.fingerprintInput(i),r._uiHandler,r._inputSession)}return o}))},i.prototype.generateAuthenticatorKey=function(){var n,r=this;n=this._sdk.host.generateRandomHexString(24);t.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey;var o=this.authenticatorKeyTagForScheme(this.currentScheme,n);return e.util.wrapPromiseWithActivityIndicator(this._uiHandler,this._actionDriver.policyAction(),this._clientContext,this._sdk.host.generateKeyPair(o,t.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,!0).then((function(t){return{key:t,salt:n,schemeVersion:r.currentScheme}}),(function(t){if(t.getErrorCode()==e.AuthenticationErrorCode.Internal&&t.getData()){var n=t.getData(),r=e.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(n,"Fingerprint");if(r)throw r}throw t})))},i.prototype.authenticatorKeyTagForScheme=function(t,e){return i.authenticatorKeyTagForUser(this.user,t,e)},i}(r.AuthenticationDriverLocalPersistentKeyPairBasedPostV2Scheme);r.AuthenticationDriverFingerprint=o}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e;(function(t){function e(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e.push(r):r<2048?e.push(192|r>>6,128|63&r):r<55296||r>=57344?e.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&t.charCodeAt(n)),e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return e}function n(t){var e,n="";for(e=0;e<t.length;e++){var r=t[e];if(r<128)n+=String.fromCharCode(r);else if(r>191&&r<224)n+=String.fromCharCode((31&r)<<6|63&t[e+1]),e+=1;else if(r>223&&r<240)n+=String.fromCharCode((15&r)<<12|(63&t[e+1])<<6|63&t[e+2]),e+=2;else{var o=((7&r)<<18|(63&t[e+1])<<12|(63&t[e+2])<<6|63&t[e+3])-65536;n+=String.fromCharCode(o>>10|55296,1023&o|56320),e+=3}}return n}function r(t){for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n).toString(16);r.length<2&&(r="0"+r),e+=r}return e}t.numberToHex=function(t,e){var n=t.toString(16);if(n.length>e/4)throw"Number out of range for bitcount.";for(;n.length<e/4;)n="0"+n;return n},t.toUTF8Array=e,t.fromUTF8Array=n,t.hexToAscii=function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return n(e)},t.asciiToHex=function(t){return e(t).map((function(t){var e=t.toString(16);return e.length<2&&(e="0"+e),e})).join("")},t.base64ToHex=function(t){return r(atob(t))},t.bytesToHex=r,t.hexToBytes=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(parseInt(t.substr(n,2),16));return e},t.hexToBase64=function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,r=0,o="",i=0;i<t.length;i++)n=(n<<4)+parseInt(t[i],16),(r+=4)>=6&&(o+=e[n>>r-6],n&=255>>8-(r-=6));for(r&&(o+=e[n<<6-r]);o.length%4;)o+="=";return o},t.isHexString=function(t){return new RegExp("^([0-9A-Fa-f]{2})+$").test(t)},t.stringToBytes=function(t){for(var e=[],n=0;n<t.length;n++)e.push(t.charCodeAt(n));return e},t.calcPublicKeyHexStringEncodedSha256Hash=function(e,n){var r=e.publicKeyToJson().key;return sha256(t.stringToBytes(atob(r)))},t.nameof=function(t){return t},t.checkedCast=function(t,e){if(e instanceof t)return e;throw Error("Checked cast failed. Expected "+t)},t.wrapPromiseWithActivityIndicator=function(t,e,n,r){return t.startActivityIndicator(e,n),r.then((function(r){return t.endActivityIndicator(e,n),r}),(function(r){return t.endActivityIndicator(e,n),Promise.reject(r)}))};var o=function(){function t(){var e=this;this._cancelPromise=new Promise((function(n,r){e._cancelFn=function(){r(t.CancelRequest)},e._cancelled&&r(t.CancelRequest)}))}return Object.defineProperty(t.prototype,"cancellablePromise",{get:function(){return this._cancellablePromise}
10,enumerable:!1,configurable:!0}),t.prototype.resolveWith=function(t){this._cancelled?this._cancellablePromise=this._cancelPromise:(this._underlyingPromise=new Promise(t),this._cancellablePromise=Promise.race([this._cancelPromise,this._underlyingPromise]))},t.prototype.cancel=function(){this._cancelled=!0,this._cancelFn&&this._cancelFn()},t.CancelRequest={},t}();t.CancelablePromiseHolder=o,t.LANGUAGES={"zh-HK":"zh-HK","zh-CN":"zh-Hans","zh-TW":"zh-Hant",zh:"zh-Hans",da:"da-DK",nl:"nl-NL","en-AU":"en-AU","en-GB":"en-GB",en:"en-US","en-IN":"en-IN",fi:"fi-FI",fr:"fr-FR","fr-CA":"fr-CA",de:"de-DE",it:"it-IT",is:"is-IS",ja:"ja-JP",ko:"ko-KR",nb:"nb-NO",pl:"pl-PL","pt-BR":"pt-BR",pt:"pt-PT",ro:"ro-RO",ru:"ru-RU","es-MX":"es-MX",es:"es-ES",ca:"ca-ES","es-US":"es-US",sv:"sv-SE",tr:"tr-TR",vi:"vi-VN",el:"el-GR",id:"id-ID",hu:"hu-HU",th:"th-TH",hi:"hi-IN",cs:"cs-CZ",sk:"sk-SK",uk:"uk-UA",hr:"hr-CS",he:"he-IL",iw:"he-IL",ar:"ar-SA"}})((e=t.sdk||(t.sdk={})).util||(e.util={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(r){function o(t,e,n){return r.call(this,t,e,n)||this}return V(o,r),o.enrollmentVersion2KeyGenVersion=function(t){return t>="v3"?"s2":"s1"},o.prototype.unregisterEnrollmentAssets=function(t){},Object.defineProperty(o.prototype,"currentScheme",{get:function(){return"v3"},enumerable:!1,configurable:!0}),o.prototype.processLocalAuthenticatorError=function(t){var n=t;t.getErrorCode()==e.AuthenticationErrorCode.InvalidInput&&this._operationMode==e.AuthenticatorSessionMode.Authentication?this.processAuthFailureAssertionAndHandleError(n,1):this.performErrorRecoveryForError(n)},o.prototype.getKeyForEnrollmentDataAndInput=function(t,n){var r=this;return new Promise((function(e,o){t.version>="v2"?r.getKeyForEnrollmentDataAndInputV2(t,n).then(e,o):r.getKeyForEnrollmentDataAndInputPreV2(t,n).then(e,o)})).then((function(t){if(!t)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.InvalidInput,"Invalid input provided to authenticator.");return{key:t}}))},o.prototype.generatePendingEnrollment=function(r){var i=this;return new Promise((function(s,a){var c=i._sdk.host.generateRandomHexString(32),u=i._sdk.host.generateRandomHexString(64),l=i.extractPbkdfInputFromInputResponse(r);return e.util.wrapPromiseWithActivityIndicator(i._uiHandler,i._actionDriver.policyAction(),i._clientContext,i._sdk.host.generateHexSeededKeyPairExternalRepresentation(t.sdkhost.KeyClass.FidoECCSigningKey,u,o.enrollmentVersion2KeyGenVersion(i.currentScheme),null).then((function(e){return n.vault.pbkdfStretchHexSecretIntoAESKey(c,l,i._sdk.cryptoSettings.getLocalEnrollmentKeySizeInBytes(),i._sdk.cryptoSettings.getLocalEnrollmentKeyIterationCount(),!0,i._sdk).then((function(n){return n.encrypt(u).then((function(n){return{key:i._sdk.host.importVolatileKeyPair(t.sdkhost.KeyClass.FidoECCSigningKey,e),salt:c,schemeVersion:i.currentScheme,keyMeterial:n}}))}))}))).then(s,a)}))},o.prototype.getKeyForEnrollmentDataAndInputV2=function(e,r){var i=this,s=this.extractPbkdfInputFromInputResponse(r);return n.vault.pbkdfStretchHexSecretIntoAESKey(e.salt,s,e.cryptoSettings.getLocalEnrollmentKeySizeInBytes(),e.cryptoSettings.getLocalEnrollmentKeyIterationCount(),!0,this._sdk).then((function(n){return n.decrypt(e.keyMaterial,null).then((function(n){return i._sdk.host.generateHexSeededKeyPairExternalRepresentation(t.sdkhost.KeyClass.FidoECCSigningKey,n,o.enrollmentVersion2KeyGenVersion(e.version),e.publicKeyHash).then((function(e){return i._sdk.host.importVolatileKeyPair(t.sdkhost.KeyClass.FidoECCSigningKey,e)}))}))}))},o.prototype.getKeyForEnrollmentDataAndInputPreV2=function(e,n){var r=this;return this.authenticatorKeyTagForScheme(e.version,e.salt,e.cryptoSettings,n).then((function(e){return r._sdk.host.getKeyPair(e,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.None)}))},o.prototype.schemeVersionRequiresRollover=function(t){return"v0"==t||"v1"==t},o.prototype.authenticatorKeyTagForScheme=function(t,r,o,i){var s=this;return new Promise((function(a,c){var u=s.extractPbkdfInputFromInputResponse(i);if("v0"==t&&(s._sdk.log(e.LogLevel.Debug,(function(){return"Using SDK CryptoSettings for migrated enrollment."})),o=s._sdk.cryptoSettings),!o)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Missing crypt settings for local enrollment.");
10s._sdk.host.generatePbkdf2HmacSha1HexString(r,u,o.getLocalEnrollmentKeySizeInBytes(),o.getLocalEnrollmentKeyIterationCount()).then((function(r){var o=e.util.hexToBase64(r);return new n.TarsusKeyPath("per_user",s.user.guid.toString(),"local_auth_keys",s.authenticatorType,t,o)})).then(a,c)}))},o}(r.AuthenticationDriverLocal);r.AuthenticationDriverLocalSecretInputBased=o}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),Object.defineProperty(n.prototype,"authenticatorType",{get:function(){return n.authenticatorName},enumerable:!1,configurable:!0}),n.prototype.handleAuthenticationInputResponse=function(n){var r=n;t.impl.PatternInputImpl.validateFormat(r)?e.prototype.handleAuthenticationInputResponse.call(this,n):this.processLocalAuthenticatorError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))},n.prototype.handleRegistrationInputResponse=function(n){var r=this._authenticatorConfig,o=n;t.impl.PatternInputImpl.validateFormat(o)?r.min_length&&t.impl.PatternInputImpl.getPatternLength(o)<r.min_length?this.processLocalAuthenticatorError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid pattern length.")):e.prototype.handleRegistrationInputResponse.call(this,n):this.processLocalAuthenticatorError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))},n.prototype.extractPbkdfInputFromInputResponse=function(e){var n=e;return t.util.asciiToHex(n.getPatternDescription())},n.prototype.createAuthenticatorSession=function(){var t,e,r=this._authenticatorConfig,o=this._uiHandler.createPatternAuthSession(n.authenticatorName,this.user.displayName,3,4);return null===(e=(t=o).setMinLength)||void 0===e||e.call(t,r.min_length),o},n.prototype.authenticateInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},n.prototype.registerInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},n.authenticatorName="pattern",n}(e.AuthenticationDriverLocalSecretInputBased);e.AuthenticationDriverLocalPattern=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),Object.defineProperty(n.prototype,"authenticatorType",{get:function(){return n.authenticatorName},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pinLength",{get:function(){return this._authenticatorConfig.length},enumerable:!1,configurable:!0}),n.prototype.handleRegistrationInputResponse=function(n){n.getPin().length!=this.pinLength?this.processLocalAuthenticatorError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"Expecting an entry of length "+this.pinLength+".")):e.prototype.handleRegistrationInputResponse.call(this,n)},n.prototype.generatePendingEnrollment=function(t){var n=this;return e.prototype.generatePendingEnrollment.call(this,t).then((function(t){var e={length:n.pinLength};return t.authenticatorConfig=e,t}))},n.prototype.extractPbkdfInputFromInputResponse=function(e){var n=e;return t.util.asciiToHex(n.getPin())},n.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPinAuthSession(n.authenticatorName,this.user.displayName,this.pinLength)},n.prototype.authenticateInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},n.prototype.registerInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},n.authenticatorName="pin",n}(e.AuthenticationDriverLocalSecretInputBased);e.AuthenticationDriverLocalPinCode=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(n){function r(t,e,r){return n.call(this,t,e,r)||this}return V(r,n),r.prototype.poll=function(){var n=this;this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"authenticate",this.pollingAssertionData(),{}).then((function(r){n.filterAssertionResult(r)&&n.shouldContinuePolling(r)?n.pumpInput():n.handleAuthenticateAssertionResult(r,n._authenticatorDescription,"authenticate",n.pollingAssertionData)||(n._sdk.log(t.LogLevel.Info,(function(){return"Authenticator session done."})),n.completeAuthenticatorSessionWithResult(new e.AuthenticationDriverSessionResultAuthenticationCompleted(r)))})).catch((function(e){n.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},r.prototype.longPoll=function(e,n){var r=this;this._actionDriver.sendPollingRequest(e,n).then((function(t){t.change_detected?r.poll():r.pumpInput()})).catch((function(e){r.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},r}(e.AuthenticationDriver);e.AuthenticationDriverPolling=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){!function(n){!function(r){var o=function(o){function i(t,e,n){var r=o.c
10all(this,t,e,n)||this;return r.methodName="mobileApprove",r.setupDataModel(e,n),r}return V(i,o),i.prototype.createAuthenticatorSession=function(){var r=this,o=this._uiHandler.createMobileApproveAuthSession("mobile_approve",this.user.displayName,this._instructions);if(!o)throw e.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createMobileApproveAuthSession");if(o.setAvailableTargets(this._selectableDevices),this._state==n.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate){this._selectedDevices=this._selectableDevices.map((function(t){return t}));var i=null;this._otp&&(i=t.ts.mobile.sdk.impl.MobileApproveOtpImpl.createFromServerFormat(this._otp)),o.setCreatedApprovalInfo(this._selectedDevices,i)}if(this._authenticationParameters){var s=this._authenticationParameters.filter((function(t){e.AuthenticationActionParameterTargetSelection}));if(0!=s.length){this._sdk.log(e.LogLevel.Debug,(function(){return"Target based driver found target selection parameters."}));var a=this._selectableDevices.reduce((function(t,e){return t[e.getDeviceIdentifier()]=e,t}),{});this._pendingTargetSelection=s.map((function(t){var n=t.getTarget(),r=a[n.getDeviceIdentifier()];if(!r)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Authentication parameter tried to select a device not presented as a selectable target");return r}),{}),this._sdk.log(e.LogLevel.Debug,(function(){return"Target based driver will select targets "+r._pendingTargetSelection+" based on selection parameter."}))}}return o},i.prototype.authenticateInStartedSession=function(t){this._autoExecuted?this._autoExecuted=!1:this.reset(),this.pumpInput()},i.prototype.pumpInput=function(){if(this._state===n.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval)this.createApproval();else{if(this._state!==n.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Illegal authenticator state encountered: "+this._state);this.requestInputAndHandle()}},i.prototype.registerInStartedSession=function(t){throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Cannot register Mobile Approve authenticator.")},i.prototype.createApproval=function(){var t=this;if(this._approvalId=null,this._pendingTargetSelection&&Object.keys(this._pendingTargetSelection).length){this._sdk.log(e.LogLevel.Debug,(function(){return"Performing pending target selection "+t._pendingTargetSelection}));var n=e.TargetBasedAuthenticatorInput.createTargetsSelectionRequest(this._pendingTargetSelection);this._pendingTargetSelection=null,this.handleAuthenticationInputResponse(n)}else this._strategy.user_selection&&this._selectableDevices&&this._selectableDevices.length?this.requestInputAndHandle():this.handleAuthenticationInputResponse(e.TargetBasedAuthenticatorInput.createTargetsSelectionRequest([]))},i.prototype.requestInputAndHandle=function(){var t=this;this._inputSession.promiseInput().then((function(e){t.handleInputOrControlResponse(e)}))},i.prototype.handleAuthenticationInputResponse=function(t){switch(this._state){case n.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval:var r=t.getSelectedTargets();if(r){this.handleTargetSelectionInput(r);break}throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Expected target selection input response but got: "+t);case n.Protocol.AuthenticationMethodMobileApproveState.WaitForAuthenticate:var o=t.getAuthenticatorInput();if(o instanceof e.MobileApproveInputRequestPolling){var i=o.getPollingTimeout();if(i){var s={type:"approval",approval_id:this._approvalId||""};this.longPoll(s,i)}else this.poll();break}throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Expected polling request input response but got: "+t);default:throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Illegal state for authenticator: "+this._state)}},i.prototype.handleTargetSelectionInput=function(t){var n=this;this._selectedDevices=t.map((function(t){var r=t;if(n._selectableDevices.indexOf(r)<0)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Attempt to select a Mobile Approve target not originally listed in the session.");return r})),this.createForSelectedTargets()},i.prototype.createForSelectedTargets=function(){var n,r=this;n=this._selectedDevices&&this._selectedDevices.length?{device_ids:this._selectedDevices.map((function(t){return t.getDeviceIdentifier()}))}:{},this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"approval",n,{}).then((function(n){if(!r.handleGeneralAssertionResult(n))if(n.assertion_error_code)r._sdk.log(e.LogLevel.Error,(function(){return"Assertion error encoutered. Starting error recovery."})),r.performErrorRecoveryForError(e.impl.AuthenticationErrorImpl.errorForAssertionResponse(n));else{var o=null,i=n.data;i.otp&&(o=t.ts.mobile.sdk.impl.MobileApproveOtpImpl.createFromServerFormat(i.otp)),r._approvalId=i.approval_id||null,r._state=i.state,r._inputSession.setCreatedApprovalInfo(r._selectedDevices,o),r._sdk.log(e.LogLevel.Debug,(function(){return"Restarting auth or reg."})),r.pumpInput()}})).catch((function(t){r.completeAuthenticatorSessionWithError(t)}))},i.prototype.handleRegistrationInputResponse=function(t){throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Cannot register Mobile Approve authenticator.")},i.prototype.processControlRequest=function(t){t.getRequestType()===e.ControlRequestType.RetryAuthenticator&&this.reset(),o.prototype.processControlRequest.call(this,t)},i.prototype.filterAssertionResult=function(t){if(5==t.assertion_error_code)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.ApprovalDenied,"Approval was de
10nied");if(21==t.assertion_error_code)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.ApprovalExpired,"Approval has expired");return!0},i.prototype.shouldContinuePolling=function(t){return t.assertion_error_code==n.Protocol.AssertionErrorCode.ExternalProcessPending},i.prototype.pollingAssertionData=function(){return{approval_id:this._approvalId}},i.prototype.reset=function(){this._state=n.Protocol.AuthenticationMethodMobileApproveState.WaitForApproval,this._approvalId=null,this._selectedDevices=null,this._inputSession.setCreatedApprovalInfo(null,null)},i.prototype.setupDataModel=function(t,e){this._state=t.state,this._otp=t.otp||null,this._strategy=t.strategy,this._selectableDevices=r.AuthenticationDriverDescriptorMobileApprove.createTargetsFromConfig(t),this._instructions=t.instructions,this._approvalId=t.approval_id||null,this._approvalId&&(this._autoExecuted=!0)},i}(r.AuthenticationDriverPolling);r.AuthenticationDriverMobileApprove=o}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(e.sdk||(e.sdk={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(o){function i(t,e,n){return o.call(this,t,e,n)||this}return V(i,o),i.prototype.getBiometricPromptFallbackControlType=function(){return null!=this._biometricPromptFallbackControlType?this._biometricPromptFallbackControlType:e.ControlRequestType.SelectMethod},i.authenticatorKeyTagForUser=function(t,e,r){return new n.TarsusKeyPath("per_user",t.guid.toString(),"local_auth_keys","native_face",e,r)},i.prototype.shouldAllowBiometricFallbackButton=function(t){var r=this;if(!t)return!1;var o=this._actionDriver.availableAuthenticatorsForSwitching.filter((function(t){return t!=r._authenticatorDescription}));if(this._actionDriver instanceof n.actiondrivers.ActionDriverRegistration||this._actionDriver instanceof n.actiondrivers.ActionDriverAuthentication&&0==o.length)return!1;var i=t,s=i.getFallbackButtonTitle();if(!(s&&s.length>0))return!1;var a=i.getFallbackControlRequestType();switch(null==a&&(a=e.ControlRequestType.SelectMethod),a){case e.ControlRequestType.ChangeMethod:return this._actionDriver.availableAuthenticatorsForSwitching.filter((function(t){return t!=r._authenticatorDescription})).length>0;case e.ControlRequestType.SelectMethod:return this._actionDriver.availableAuthenticatorsForSwitching.length>0;default:return!0}},i.prototype.runSilentRegistration=function(){var t=this;return this.generateFaceNativeKeyForScheme(this.currentScheme).then((function(n){var o=t.getNewOrUpdatedEnrollmentRecord(n),i={public_key:n.key.publicKeyToJson(),version:n.schemeVersion};return t._actionDriver.sendAuthenticatorAssertionRequest(t._authenticatorDescription,"register",null,i).then((function(n){if(n.assertion_error_code)throw e.impl.AuthenticationErrorImpl.errorForAssertionResponse(n);return t.user.updateEnrollmentRecord(o),new r.AuthenticationDriverSessionResultAuthenticationCompleted(n)}))}))},i.prototype.createAuthenticatorSession=function(){return this._uiHandler.createNativeFaceAuthSession(r.AuthenticationDriverDescriptorNativeFace.authenticatorName,this.user.displayName)},i.prototype.authenticateInStartedSession=function(t){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(t){return n.completeAuthenticatorSessionWithError(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},i.prototype.registerInStartedSession=function(t){var n=this;o.prototype.registerInStartedSession.call(this,t),this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(t){return n.completeAuthenticatorSessionWithError(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},Object.defineProperty(i.prototype,"authenticatorType",{get:function(){return r.AuthenticationDriverDescriptorNativeFace.authenticatorName},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"currentScheme",{get:function(){return"v2"},enumerable:!1,configurable:!0}),i.prototype.processLocalAuthenticatorError=function(r){var o=this,i=r,s=0,a=Prom
10ise.resolve();if(i.getErrorCode()==e.AuthenticationErrorCode.Internal&&i.getData()){var c=i.getData();s=c[t.sdkhost.ErrorDataNumFailures]||s,i=e.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(c,"Native Face")||i,(c[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()||c[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricInvalidated)&&(a=n.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._actionDriver._controlFlowProcessor,this._authenticatorDescription))}a.catch((function(t){o._sdk.log(e.LogLevel.Error,t)})),a.finally((function(){var n=i.getData();if(!s||o._operationMode!=e.AuthenticatorSessionMode.Authentication)return n[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricFallbackPressed?(o._sdk.log(e.LogLevel.Debug,(function(){return"Biometric prompt fallback button pressed"})),void o.processControlRequest(e.ControlRequest.create(o.getBiometricPromptFallbackControlType()))):i.getErrorCode()==e.AuthenticationErrorCode.UserCanceled?(o._sdk.log(e.LogLevel.Debug,(function(){return"Native face authenticator captured user cancel error code."})),void o.invokeCancellationUiOrEscape()):void o.performErrorRecoveryForError(i);o.processAuthFailureAssertionAndHandleError(i,s)}))},i.prototype.getKeyForEnrollmentDataAndInput=function(n,r){var o=this;return new Promise((function(i,s){var a=r;o.shouldAllowBiometricFallbackButton(a)&&(o._biometricPromptFallbackControlType=a.getFallbackControlRequestType());var c=o.authenticatorKeyTagForScheme(n.version,n.salt),u=o._sdk.host.getKeyPair(c,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!u){var l={};
10throw l[t.sdkhost.ErrorDataInternalError]=t.sdkhost.InternalErrorBiometricInvalidated,new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated FaceID.",l)}u.setBiometricPromptInfo(e.util.BiometricPromptInfoFrom.nativeFaceInput(a),null,null),i({key:u})}))},i.prototype.generatePendingEnrollment=function(t,n){if(!n){var r=t;this.shouldAllowBiometricFallbackButton(r)&&(this._biometricPromptFallbackControlType=r.getFallbackControlRequestType())}return this.generateKeyForScheme(t,this.currentScheme).then((function(t){return n||t.key.setBiometricPromptInfo(e.util.BiometricPromptInfoFrom.nativeFaceInput(r),null,null),t}))},i.prototype.generateKeyForScheme=function(t,e){return this.generateFaceNativeKeyForScheme(e)},i.prototype.schemeVersionRequiresRollover=function(t){return"v0"==t||"v1"==t},i.prototype.generateFaceNativeKeyForScheme=function(n){var r;r="v1"==n||"v2"==n?this._sdk.host.generateRandomHexString(24):"";var o=this.authenticatorKeyTagForScheme(n,r);return e.util.wrapPromiseWithActivityIndicator(this._uiHandler,this._actionDriver.policyAction(),this._clientContext,this._sdk.host.generateKeyPair(o,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb,!0).then((function(t){return{key:t,salt:r,schemeVersion:n}}),(function(t){if(t.getErrorCode()==e.AuthenticationErrorCode.Internal&&t.getData()){var n=t.getData(),r=e.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(n,"Native Face");if(r)throw r}throw t})))},i.prototype.authenticatorKeyTagForScheme=function(t,e){return i.authenticatorKeyTagForUser(this.user,t,e)},i}(r.AuthenticationDriverLocalPersistentKeyPairBased);r.AuthenticationDriverNativeFace=o}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e,r,o){var i=n.call(this,t,e,o)||this;return i._possibleTargets=r,i.setupDataModel(e),i}return V(r,n),r.prototype.getPossibleTargets=function(){return this._possibleTargets},r.prototype.createAuthenticatorSession=function(){var e,n=this;if(0!=(e=this._authenticationParameters?this._authenticationParameters.filter((function(e){return e instanceof t.AuthenticationActionParameterTargetSelection})):[]).length){this._sdk.log(t.LogLevel.Debug,(function(){return"Target based driver found target selection parameters."}));var r=e[0].getTarget().getChannelAssertionId(),o=this._possibleTargets.filter((function(t){return t.getChannelAssertionId()==r}));o.length?(this._pendingTargetSelection=o[0],this._sdk.log(t.LogLevel.Debug,(function(){return"Target based driver will select target "+n._pendingTargetSelection+" based on selection parameter."})),this._lastSelectedTarget=this._pendingTargetSelection):this._sdk.log(t.LogLevel.Warning,(function(){return"Target selection parameter for target based auth driver specified invalid target assertiong id "+r+"."}))}var i=this._uiHandler.createOtpAuthSession("otp",this.user.displayName,this._possibleTargets,this._autoExecTarget);if(!i)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createOtpAuthSession");return i.setAvailableTargets(this._possibleTargets),i},r.prototype.authenticateInStartedSession=function(e){var n=this;if(0==this._possibleTargets.length)return this._sdk.log(t.LogLevel.Warning,(function(){return"No authentication target available for OTP. Doing error recovery."})),void this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AuthenticatorExternalConfigError,"No targets available for OTP."),!0);if(this._sdk.log(t.LogLevel.Debug,(function(){return"Notifying current session of generated OTP format and target"})),this._inputSession.setGeneratedOtp(this._format,this._lastSelectedTarget),this._pendingTargetSelection){this._sdk.log(t.LogLevel.Debug,(function(){return"Performing pending target selection "+n._pendingTargetSelection}));var r=t.TargetBasedAuthenticatorInput.createTargetsSelectionRequest([this._pendingTargetSelection]);this._pendingTargetSelection=null,this.handleInputOrControlResponse(t.InputOrControlResponse.createInputResponse(r))}else this._inputSession.promiseInput().then((function(t){n.handleInputOrControlResponse(t)}
10)).catch((function(e){n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},r.prototype.registerInStartedSession=function(e){throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Cannot register OTP authenticator.")},r.prototype.handleTargetBasedAuthenticatorConcreteInput=function(e){if(e instanceof t.OtpInputOtpSubmission)this.processAuthenticateAssertion({otp:e.getOtp()},{assertion_id:this._possibleTargets[0].getChannelAssertionId()});else{if(!(e instanceof t.OtpInputRequestResend))throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Unknown OTP response type received from application callback.");this.triggerForSelectedTarget()}},r.prototype.handleAuthenticateAssertionResult=function(e,r,o,i,s){return e.data&&e.data.additional_error_code&&1==e.data.additional_error_code&&(this._sdk.log(t.LogLevel.Debug,(function(){return"Reached max number of attempts - invalidating current target."})),this._lastSelectedTarget=null,this._format=null),n.prototype.handleAuthenticateAssertionResult.call(this,e,r,o,i,s)},r.prototype.handleAuthenticationInputResponse=function(e){if(e.getAuthenticatorInput())this.handleTargetBasedAuthenticatorConcreteInput(e.getAuthenticatorInput());else{if(!e.getSelectedTargets()[0])throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid target-based authetnicator response type received from application callback. Target-based authenticator inputs must be created by calling TargetBasedAuthenticatorInput.createAuthenticatorInput.");var n=e.getSelectedTargets();if(n.length>1)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to select multiple OTP targets while OTP supports only a single target.");var r=n[0];if(this._possibleTargets.indexOf(r)<0)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to select an OTP target not originally listed in the session.");this._lastSelectedTarget=r,this.triggerForSelectedTarget()}},r.prototype.triggerForSelectedTarget=function(){var n=this;if(!this._lastSelectedTarget)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Attempt to trigger OTP generation without a selected target.");var r={target_id:this._lastSelectedTarget.getTargetIdentifier(),channel_index:this._lastSelectedTarget.getChannelIndex()},o={assertion_id:this._lastSelectedTarget.getChannelAssertionId()};this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"otp",r,o).then((function(r){r.assertion_error_code&&r.assertion_error_code!=e.Protocol.AssertionErrorCode.FailOver&&(n._sdk.log(t.LogLevel.Error,(function(){return"Assertion error encoutered. Clearing last selected target."})),n._lastSelectedTarget=null),n.handleAuthenticateAssertionResult(r,n._authenticatorDescription,"otp",o,o)||(r.data&&r.data.otp_format&&(n._sdk.log(t.LogLevel.Debug,(function(){return"Received updated OTP and format."})),n._format=t.OtpFormatImpl.fromAssertionFormat(r.data.otp_format)),n._sdk.log(t.LogLevel.Debug,(function(){return"Restarting auth or reg."})),n.authOrRegInStartedSession(!0))})).catch((function(t){n.completeAuthenticatorSessionWithError(t)}))},r.prototype.handleRegistrationInputResponse=function(e){throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Cannot register OTP authenticator.")},r.prototype.setupDataModel=function(n){this._otpInitialState=n.state,this._otpInitialState==e.Protocol.AuthenticationMethodOtpState.Validate&&(this._lastSelectedTarget=this._possibleTargets[0],this._autoExecTarget=this._lastSelectedTarget);var r=n.format||n.otp_format;this._format=r&&t.OtpFormatImpl.fromAssertionFormat(r)||null},r}(n.AuthenticationDriver);n.AuthenticationDriverOtp=r}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),n.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPasswordAuthSession("password",this.user.displayName)},n.prototype.authenticateInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},n.prototype.registerInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeAuthenticatorSessionWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},n.prototype.handleAuthenticationInputResponse=function(e){var n=e.getPassword();n&&n.length>0?this.processAuthenticateAssertion({password:n}):this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"Password can't be empty"))},n.prototype.handleRegistrationInputResponse=function(e){var n=e.getPassword();n&&n.length>0?this.processRegisterAssertion({password:n}):this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"Password can't be empty"))},n}(e.AuthenticationDriver);e.AuthenticationDriverPassword=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),n.prototype.createAuthenticatorSession=function(){var t,e,n=this._authenticatorConfig,r=this._uiHandler.createPatternAuthSe
10ssion("pattern_centralized",this.user.displayName,3,4);return null===(e=(t=r).setMinLength)||void 0===e||e.call(t,n.min_length),r},n.prototype.handleAuthenticationInputResponse=function(n){var r=n;t.impl.PatternInputImpl.validateFormat(r)?e.prototype.handleAuthenticationInputResponse.call(this,n):this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))},n.prototype.handleRegistrationInputResponse=function(n){var r=n,o=this._authenticatorConfig;t.impl.PatternInputImpl.validateFormat(r)?o.min_length&&t.impl.PatternInputImpl.getPatternLength(r)<o.min_length?this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid pattern length.")):e.prototype.handleRegistrationInputResponse.call(this,n):this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))},n.prototype.generateSecretToSignForInputResponse=function(t){return t.getPatternDescription()},n}(e.AuthenticationDriverCentralizedSecretInputBased);e.AuthenticationDriverPattern=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),Object.defineProperty(n.prototype,"pinLength",{get:function(){return this._authenticatorConfig.length},enumerable:!1,configurable:!0}),n.prototype.createAuthenticatorSession=function(){return this._uiHandler.createPinAuthSession("pin_centralized",this.user.displayName,this.pinLength)},n.prototype.handleRegistrationInputResponse=function(n){n.getPin().length==this.pinLength?e.prototype.handleRegistrationInputResponse.call(this,n):this.performErrorRecoveryForError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"Invalid PIN length provided.",{expected_length:this.pinLength}))},n.prototype.generateSecretToSignForInputResponse=function(t){return t.getPin()},n}(e.AuthenticationDriverCentralizedSecretInputBased);e.AuthenticationDriverPinCode=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(r){function o(t,e,n){return r.call(this,t,e,n)||this}return V(o,r),o.prototype.createAuthenticatorSession=function(){var t=this,e=this.generatePlaceholderServerTokenGenerationPayload(),n=o.placeholderExtensionPoint.firstNonNull((function(n){return n.createPlaceholderAuthSession(t._authenticatorDescription.getPlaceholderId(),t._authenticatorConfig.placeholder_type||"",t._authenticatorDescription.getName()||"",t.user.displayName,t._authenticatorConfig.data||"",e)}));return n||this._uiHandler.createPlaceholderAuthSession(this._authenticatorDescription.getPlaceholderId(),this._authenticatorConfig.placeholder_type||"",this._authenticatorDescription.getName()||"",this.user.displayName,this._authenticatorConfig.data||"",e)},o.prototype.authenticateOrRegisterInStratedSession=function(t){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(t){return n.completeAuthenticatorSessionWithError(e.impl.AuthenticationErrorImpl.ensureAuthenticationError(t))}))},o.prototype.authenticateInStartedSession=function(t){this.authenticateOrRegisterInStratedSession(t)},o.prototype.registerInStartedSession=function(t){this.authenticateOrRegisterInStratedSession(t)},o.prototype.handleAuthenticationInputResponse=function(t){this.handleAuthenticationOrRegistrationInputResponse(t)},o.prototype.handleRegistrationInputResponse=function(t){this.handleAuthenticationOrRegistrationInputResponse(t)},o.prototype.handleAuthenticationOrRegistrationInputResponse=function(t){t instanceof e.PlaceholderAuthSuccessResponse?(this._sdk.log(e.LogLevel.Debug,(function(){return"Placeholder received PlaceholderAuthSuccessResponse."})),this.handlePlaceholderSuccessResponse(t)):t instanceof e.PlaceholderAuthFailureResponse?(this._sdk.log(e.LogLevel.Debug,(function(){return"Placeholder received PlaceholderAuthFailureResponse."})),this.handlePlaceholderFailureResponse(t)):t instanceof e.PlaceholderAuthFailureWithServerProvidedStatusResponse?(this._sdk.log(e.LogLevel.Debug,(function(){return"Placehoder received PlaceholderAuthFailureWithServerProvidedStatusResponse"})),this.processAuthFailureAssertionAndHandleError(t.getFailureError(),1)):(this._sdk.log(e.LogLevel.Error,(function(){return"Placeholder received unknkown response type."})),this.performErrorRecoveryForError(new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.AppImplementation,"Placeholder received unknkown response type.")))},o.prototype.handlePlaceholderSuccessResponse=function(t){var n={token:t.getPlaceholderToken()};this._operationMode==e.AuthenticatorSessionMode.Authentication?this.processAuthenticateAssertion(n):this.processRegisterAssertion(n)},o.prototype.handlePlaceholderFailureResponse=function(t){this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"auth_failure",{num_of_failures:1});var r={status:t.getRegistrationStatus()==e.AuthenticatorRegistrationStatus.Registered?n.Protocol.AuthenticationMethodStatus.Registered:n.Protocol.AuthenticationMethodStatus.Unregistered,expired:t.getExpired(),locked:t.getLocked(),last_used:0};this._authenticatorDescription.updateWithAuthenticatorState(r),this.performErrorRecoveryForError(t.getFailureError())},o.prototype.generatePlaceholderServerTokenGenerationPayload=function(){var t=this.user.deviceId||this._actionDriver._controlFlowProcessor._session.deviceId(),e={assertion_id:this._authenticatorDescription.assertionId,challenge:this._actionDriver._controlFlowProcessor.challenge,device_id:t,auth_type:this._authenticatorDescription.getAuthenticatorId()};return btoa(JSON.stringify(e))},o.placeholderExtensionPoint=new n.ExtensionPoint(t.tarsusplugin.TARSUS_EXTENSION_POINT_NAME_PLACEHOLDER_EXTENSION),o}(r.AuthenticationDriver);r.AuthenticationDriverPlaceholder=o}(n.authenticationdrivers||(n.authenticationdrivers={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){var o=e.call(this,t,n,r)||this;return o._pendingRestartRequest=!1,o}return V(n,e),Object.defineProperty(n.prototype,"currentQuestionsStep",{get:function(){return this._currentStep}
10,enumerable:!1,configurable:!0}),n.prototype.createAuthenticatorSession=function(){return this._pendingRestartRequest=!1,this._uiHandler.createSecurityQuestionAuthSession("question",this.user.displayName)},n.prototype.authenticateInStartedSession=function(n){var r=this,o=Promise.resolve(null);this._pendingRestartRequest&&(this._pendingRestartRequest=!1,o=this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"restart",{}).then((function(e){e.data&&e.data.question?r._currentStep=r.loadStepFromQuestionDict(e.data.question):r.completeAuthenticatorSessionWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Unexpected response to question restart request."))}))),o.then((function(t){e.prototype.authenticateInStartedSession.call(r,n)}))},n.prototype.loadStepFromQuestionDict=function(e){var n=Object.keys(e);if(1!=n.length)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Expecting a single authentication question.");return t.impl.SecurityQuestionStepDescriptionImpl.createForAuthQuestion(new t.impl.SecurityQuestionImpl(n[0],e[n[0]],!0))},n.prototype.createInitialInputStep=function(){var e=this._authenticatorConfig;switch(this._operationMode){case t.AuthenticatorSessionMode.Authentication:if(!e.question)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Expecting authentication question dictionary.");return this.loadStepFromQuestionDict(e.question);case t.AuthenticatorSessionMode.Registration:if(!e.questions)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Expecting registration question dictionary.");if(!e.reg_min_questions)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Expecting minimum registered questions field");if(e.max_answer_length||(e.max_answer_length=-1),!e.min_answer_length)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Expecting minimum answer length");var n=e.questions,r=Object.keys(n).map((function(e){return new t.impl.SecurityQuestionImpl(e,n[e].text,n[e].registered)}));return t.impl.SecurityQuestionStepDescriptionImpl.createForRegistrationQuestions(r,e.reg_min_questions,e.max_answer_length,e.min_answer_length)}},n.prototype.prepareNextAuthenticationStep=function(t){return this.loadStepFromQuestionDict(t.data.question)},n.prototype.updateCurrentAuthenticationStep=function(t,e){return e},n.prototype.handleAuthenticationInputResponse=function(e){var n=e;if(this.sortValidAnswers(n),1!=n.getAnswers().length)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Expecting exactly one answer on secuirty question authentication.");var r=this.securityQuestionAnswersResposneToAnswerMap(n);this.processAuthenticateAssertion({answer:r})},n.prototype.handleRegistrationInputResponse=function(e){var n=e,r=this.currentSecurityQuestionsStep().getMinAnswersNeeded();if(0==r)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"No answers were provided");this.sortValidAnswers(n).length;var o=0;this.currentQuestionsStep.getSecurityQuestions().forEach((function(t){t.getAnswered()&&o++}));var i=this.securityQuestionAnswersResposneToJson(n),s=i.answers.length+o-i.deleted_answers.length;if(this._sdk.log(t.LogLevel.Debug,(function(){return"handleRegistrationInputResponse: alreadyAnswered:"+o+" with sent list of "+i.answers.length+" and deleted of "+i.deleted_answers.length})),r>s)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Only "+s+" answers were provided to security questions registration process. "+s+" answers out of required minimum of "+r+".");this.processRegisterAssertion(this.securityQuestionAnswersResposneToJson(n))},n.prototype.handleErrorRecoveryAction=function(n,r){r.getErrorCode()==t.AuthenticationErrorCode.InvalidInput&&(this._pendingRestartRequest=!0),e.prototype.handleErrorRecoveryAction.call(this,n,r)},n.prototype.sortValidAnswers=function(e){for(var n=Array(),r=0,o=e.getAnswers();r<o.length;r++){var i=o[r];
10if(!i.getIsRemoved()){if(!i.getAnswer()||!i.getAnswer().getAnswerText()||i.getAnswer().getAnswerText().length<this.currentQuestionsStep.getMinAnswerLength())throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Answer too short. Answer must be at least "+this.currentQuestionsStep.getMinAnswerLength()+" characters.");if(this.currentQuestionsStep.getMaxAnswerLength()>0&&i.getAnswer().getAnswerText().length>this.currentQuestionsStep.getMaxAnswerLength())throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Answer too long. Answer must be maximum "+this.currentQuestionsStep.getMaxAnswerLength()+" characters.");n.push(i)}}return n},n.prototype.securityQuestionAnswersResposneToJson=function(e){var n=this,r={},o=Array();return e.getAnswers().forEach((function(e){if(n.currentSecurityQuestionsStep().getSecurityQuestions().indexOf(e.getQuestion())<0)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Answer provided to a question not included in this step.");if(e.getIsRemoved())o.push(e.getQuestion().getSecurityQuestionId());else{var i=e.getAnswer().getAnswerText().toLocaleLowerCase();r[e.getQuestion().getSecurityQuestionId()]=i}})),{answers:r,deleted_answers:o}},n.prototype.securityQuestionAnswersResposneToAnswerMap=function(e){var n=this,r={};return e.getAnswers().forEach((function(e){if(n.currentSecurityQuestionsStep().getSecurityQuestions().indexOf(e.getQuestion())<0)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Answer provided to a question not included in this step.");var o=e.getAnswer().getAnswerText().toLocaleLowerCase();r[e.getQuestion().getSecurityQuestionId()]=o})),r},n.prototype.currentSecurityQuestionsStep=function(){return this._currentStep},n}(e.AuthenticationDriverMultiStep);e.AuthenticationDriverSecurityQuestions=n}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){};t.AuthenticationDriverSessionResult=e;var n=function(t){function e(e,n){var r=t.call(this)||this;return r.requiredAuthenticator=e||null,r.allowedAuthenticators=n||null,r}return V(e,t),e}(e);t.AuthenticationDriverSessionResultSwitchAuthenticator=n;var r=function(t){function e(e){var n=t.call(this)||this;return n.assertionResult=e,n}return V(e,t),e}(e);t.AuthenticationDriverSessionResultAuthenticationCompleted=r;var o=function(t){function e(e){var n=t.call(this)||this;return n.escapeRequest=e,n}return V(e,t),e}(e);t.AuthenticationDriverSessionResultEscapeRequested=o}(t.authenticationdrivers||(t.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(r){function o(t,e,n){var o=r.call(this,t,e,n)||this;return o._previousSelectedDevices=[],o.methodName="totp",o.setupDataModel(e,n),o}return V(o,r),o.prototype.setupDataModel=function(t,r){this._state=t.state,this._requiresChallengeGeneration=t.state!=e.Protocol.AuthenticationMethodTotpState.Validate,this._selectedDevices=null,this._state==e.Protocol.AuthenticationMethodTotpState.Validate&&t.challenge&&(this._challenge=this.createTotpChallenge(t.challenge)),t.selectable_devices?this._selectableDevices=n.AuthenticationDriverDescriptorTotp.createTargetsFromConfig(t):this._selectableDevices=null},o.prototype.createAuthenticatorSession=function(){var e=this;if(this._authenticationParameters){var n=this._authenticationParameters.filter((function(e){t.AuthenticationActionParameterTargetSelection}));if(this._selectableDevices&&0!=n.length){this._sdk.log(t.LogLevel.Debug,(function(){return"Target based driver found target selection parameters."}));var r=this._selectableDevices.reduce((function(t,e){return t[e.getDeviceIdentifier()]=e,t}),{});this._pendingTargetSelection=n.map((function(e){var n=e.getTarget(),o=r[n.getDeviceIdentifier()];if(!o)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Authentication parameter tried to select a device not presented as a selectable target");return o}
10),{}),this._sdk.log(t.LogLevel.Debug,(function(){return"Target based driver will select targets "+e._pendingTargetSelection+" based on selection parameter."}))}}var o=this._uiHandler.createTotpAuthSession("totp",this.user.displayName);if(!o)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from createTotpAuthSession");return o.setAvailableTargets(this._selectableDevices),o},o.prototype.handleRegistrationInputResponse=function(e){throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Cannot register TOTP authenticator.")},o.prototype.registerInStartedSession=function(e){throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Cannot register TOTP authenticator.")},o.prototype.authenticateInStartedSession=function(e){var n=this;!this._selectedDevices&&this._pendingTargetSelection&&this._pendingTargetSelection.length&&(this._sdk.log(t.LogLevel.Debug,(function(){return"TOTP authentication driver has "+n._pendingTargetSelection.length+" pending targets."})),this._selectedDevices=this._pendingTargetSelection),this.requestInput()},o.prototype.requestInput=function(){var e=this;this._inputSession.setTargetDevices(this._selectedDevices),this._inputSession.setChallenge(this._challenge),this.pendingChallengeGeneration()?this.sendGenerateTotpAssertion():this._inputSession.promiseInput().then((function(t){e.handleInputOrControlResponse(t)}
10)).catch((function(n){e.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(n))}))},o.prototype.handleAuthenticationInputResponse=function(e){var n=e.getAuthenticatorInput(),r=e.getSelectedTargets();if(n){this._sdk.log(t.LogLevel.Debug,(function(){return"Handling OTP code Input."}));var o={totp:n.getCode()};this._selectedDevices&&(o.device_ids=this._selectedDevices.map((function(t){return t.getDeviceIdentifier()}))),this.processAuthenticateAssertion(o)}else{if(!r||!this._selectableDevices)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid target-based authenticator response type received from application callback. Target-based authenticator inputs must be created by calling TargetBasedAuthenticatorInput.createAuthenticatorInput.");var i=this._selectableDevices;if(this._sdk.log(t.LogLevel.Debug,(function(){return"Handling target selection Input."})),this._selectedDevices=r.map((function(e){var n=e;if(i.indexOf(n)<0)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Attempt to select a Totp target not originally listed in the session.");return n})),0===this._selectedDevices.length)throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,"No targets selected for TOTP.");this.requestInput()}},o.prototype.sendGenerateTotpAssertion=function(){var n=this,r={};this._selectedDevices&&(r.device_ids=this._selectedDevices.map((function(t){return t.getDeviceIdentifier()}))),this._sdk.log(t.LogLevel.Debug,(function(){return"Requesting TOTP generation"})),this._actionDriver.sendAuthenticatorAssertionRequest(this._authenticatorDescription,"generate",r,{}).then((function(o){n._previousSelectedDevices=n._selectedDevices||[],o.assertion_error_code&&o.assertion_error_code!=e.Protocol.AssertionErrorCode.FailOver&&(n._sdk.log(t.LogLevel.Error,(function(){return"Assertion error encountered."})),n._selectedDevices=null),!n.handleAuthenticateAssertionResult(o,n._authenticatorDescription,"generate",r)&&o.data&&(n._state=o.data.state,o.data.challenge&&(n._challenge=n.createTotpChallenge(o.data.challenge)),n.requestInput())})).catch((function(e){n.performErrorRecoveryForError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},o.prototype.pendingChallengeGeneration=function(){var t=this._selectedDevices&&(this._previousSelectedDevices.length!==this._selectedDevices.length||this._previousSelectedDevices.some((function(t,e){return t!==this._selectedDevices[e]}),this)),n=!this._selectableDevices;return this._requiresChallengeGeneration&&(t||n&&this._state==e.Protocol.AuthenticationMethodTotpState.Generate)},o.prototype.createTotpChallenge=function(e){var n=new t.TotpChallenge;return n.setValue(e.value),n.setFormat(t.TotpChallengeFormatImpl.fromAssertionFormat(e.format)),n},o.prototype.handleAuthenticateAssertionResult=function(n,o,i,s,a){if(n.assertion_error_code&&n.assertion_error_code==e.Protocol.AssertionErrorCode.RepeatCurrentStep&&n.data&&"check_digit"==n.data.reason){this._sdk.log(t.LogLevel.Debug,(function(){return"handleAuthenticateAssertionResult() for Totp code with incorrect check digit"}));var c=new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.InvalidInput,n.assertion_error_message||"Totp code with incorrect check digit");return c.setPublicProperty(t.AuthenticationErrorProperty.AuthenticatorInvalidInputErrorDescription,t.AuthenticationErrorPropertySymbol.AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit),this.performErrorRecoveryForError(c),!0}return r.prototype.handleAuthenticateAssertionResult.call(this,n,o,i,s,a)},o}(n.AuthenticationDriver);n.AuthenticationDriverTotp=r}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n;!function(t){t.LONG="tooLong",t.SHORT="tooShort",t.LOUD="tooLoud",t.SOFT="tooSoft",t.NOISY="tooNoisy",t.WRONG_PASSPHRASE="wrongPassphrase",t.VALID_PASSPHRASE="000"}(n||(n={}));var r=function(e){function r(t,n,r){return e.call(this,t,n,r)||this}return V(r,e),r.prototype.createAuthenticatorSession=function(){return this._uiHandler.createVoiceAuthSession("voice",this.user.displayName)},r.prototype.updatePassphraseFromAssertionResultIfNeeded=function(e){var n=e.data;if(n){var r=n.passphrase_text;if(r)this._sdk.log(t.LogLevel.Debug,(function(){return"handleAuthenticateAssertionResult() received updated passphrase"})),this._authenticatorConfig.passphrase_text=r}},r.prototype.handleRegisterAssertionResult=function(t){return this.updatePassphraseFromAssertionResultIfNeeded(t),e.prototype.handleRegisterAssertionResult.call(this,t)},r.prototype.handleAuthenticateAssertionResult=function(t,n,r,o,i){return this.updatePassphraseFromAssertionResultIfNeeded(t),e.prototype.handleAuthenticateAssertionResult.call(this,t,n,r,o,i)},r.prototype.createInitialInputStep=function(){var e=this._authenticatorConfig;return new t.impl.AudioAcquisitionStepDescriptionImpl(this.createStepTag(),e.passphrase_text)},r.prototype.prepareNextAuthenticationStep=function(e){var n=this._authenticatorConfig;return new t.impl.AudioAcquisitionStepDescriptionImpl(this.createStepTag(e.data&&e.data.additional_error_code),n.passphrase_text)},r.prototype.updateCurrentAuthenticationStep=function(t,e){return this.prepareNextAuthenticationStep(t)},r.prototype.handleAuthenticationInputResponse=function(t){var e=t;this.processAuthenticateAssertion(e.getAcquisitionResponse())},r.prototype.handleRegistrationInputResponse=function(t){var e=t;this.processRegisterAssertion(e.getAcquisitionResponse())},r.prototype.createStepTag=function(t){return"voice_"+(t?this.mapHintToVoiceError(t):n.VALID_PASSPHRASE)},r.prototype.mapHintToVoiceError=function(e){switch(e){case 101:return n.LONG;case 102:return n.SHORT;case 103:return n.LOUD;case 104:return n.SOFT;case 105:return n.NOISY;case 106:return n.WRONG_PASSPHRASE;default:throw new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Voice error code "+e+" is unknown/unhandled")}},r}(e.AuthenticationDriverMultiStep);e.AuthenticationDriverVoice=r}(e.authenticationdrivers||(e.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){t.AuthenticatorDrivers={password:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverPassword),pin_centralized:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverPinCode),pin:new t.AuthenticationDriverDescriptorLocal(t.AuthenticationDriverLocalPinCode,t.AuthenticationDriverLocalPinCode.authenticatorName),pattern:new t.AuthenticationDriverDescriptorLocal(t.AuthenticationDriverLocalPattern,t.AuthenticationDriverLocalPattern.authenticatorName),pattern_centralized:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverPattern),fingerprint:new t.AuthenticationDriverDescriptorFingerprint,face_id:new t.AuthenticationDriverDescriptorNativeFace,otp:new t.AuthenticationDriverDescriptorOtp,face_server:new t.AuthenticationDriverDescriptorFace,voice_server:new t.AuthenticationDriverDescriptorVoice,mobile_approve:ne
10w t.AuthenticationDriverDescriptorMobileApprove,totp:new t.AuthenticationDriverDescriptorTotp,question:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverSecurityQuestions),fido2:new t.AuthenticationDriverDescriptorFido2(t.AuthenticationDriverFido2),device_biometrics:new t.AuthenticationDriverDescriptorDeviceBiometrics,__placeholder:new t.SimpleAuthenticationDriverDescriptor(t.AuthenticationDriverPlaceholder)}}(t.authenticationdrivers||(t.authenticationdrivers={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r,o;o=t.sdk||(t.sdk={}),r=o.core||(o.core={}),e=r.collectors||(r.collectors={}),n=function(){function t(t){this.enabledCollectors=t}return t.prototype.isEnabled=function(){var t=this.getAssociatedCollectorType();return null==t||-1!=this.enabledCollectors.indexOf(t)},t}(),e.Collector=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r,o;o=t.sdk||(t.sdk={}),r=o.core||(o.core={}),e=r.collectors||(r.collectors={}),n=function(t){function e(e,n){var r=t.call(this,e)||this;return r.cacheValidityPeriod=n,r}return V(e,t),e.prototype.provide=function(t){var e=this;return new Promise((function(n,r){var o=e.getCachedData(t);o?n(o):e.provideNewData(t).then((function(r){e.saveCollectionResultToLocalStorage(t,r),n(r)}),r)}))},e.prototype.saveCollectionResultToLocalStorage=function(t,e){var n=t.host,r=this.getSchemeVersionTarsusKeyPath(),o=new Object;o.timeStamp=Date.now(),o.collectionResult=e,n.writeStorageKey(r,o)},e.prototype.getCachedData=function(t){var e=t.host,n=this.getSchemeVersionTarsusKeyPath(),r=e.readStorageKey(n);if(!r.collectionResult||!r.timeStamp)return t.log(o.LogLevel.Debug,(function(){return"No collected data found in cache."})),null;var i=r.timeStamp;return Date.now()-i>this.cacheValidityPeriod?(t.log(o.LogLevel.Debug,(function(){return"Cached collected data invalidated."})),null):(t.log(o.LogLevel.Debug,(function(){return"Loaded cached collector data: "+JSON.stringify(r.collectionResult)})),r.collectionResult)},e}(e.Collector),e.CacheableCollector=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r,o;o=t.sdk||(t.sdk={}),r=o.core||(o.core={}),e=r.collectors||(r.collectors={}),n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.provide=function(e){return $(this,void 0,void 0,(function(){var n,r;return Y(this,(function(o){switch(o.label){case 0:return n=new Object,r=n,[4,e.host.queryAsyncHostInfo(t.sdkhost.AsyncHostInformationKey.Fido2UserVerifyingPlatformAuthenticatorAvailable)];case 1:return r.fido2_user_verifying_platform_authenticator_available="true"==o.sent(),n.audio_acquisition_supported="true"==e.host.queryHostInfo(t.sdkhost.HostInformationKey.AudioAcquitisionSupported),n.finger_print_supported="true"==e.host.queryHostInfo(t.sdkhost.HostInformationKey.FingerprintSupported),n.image_acquisition_supported="true"==e.host.queryHostInfo(t.sdkhost.HostInformationKey.ImageAcquitisionSupported),n.persistent_keys_supported="true"==e.host.queryHostInfo(t.sdkhost.HostInformationKey.PersistentKeysSupported),n.face_id_key_bio_protection_supported="true"==e.host.queryHostInfo(t.sdkhost.HostInformationKey.FaceIdKeyBioProtectionSupported),n.fido2_client_present="true"==e.host.queryHostInfo(t.sdkhost.HostInformationKey.Fido2ClientPresent),n.dyadic_present="true"==e.host.queryHostInfo(t.sdkhost.HostInformationKey.DyadicPresent),n.installed_plugins=e.pluginManager.getInitializedPlugins().map((function(e){return{plugin_name:e.getPluginInfo().getPluginName(),plugin_version:t.tarsusplugin.impl.PluginInfoImpl.versionToString(e.getPluginInfo())}})),""!=e.host.queryHostInfo(t.sdkhost.HostInformationKey.HostProvidedFeatures)&&(n.host_provided_features=e.host.queryHostInfo(t.sdkhost.HostInformationKey.HostProvidedFeatures)),[2,n]}}))}))},n.prototype.getAssociatedCollectorType=function(){return o.CollectorType.Capabilities},n}(e.Collector),e.CapabilitiesCollector=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r,o;o=t.sdk||(t.sdk={}),e=o.core||(o.core={}),n=e.collectors||(e.collectors={}),r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return V(n,t),n.prototype.provide=function(t){var n=new Object;for(var r in o.CollectorType)n[r]=e.Protocol.CollectorState.Disabled;for(var i=0,s=this.enabledCollectors;i<s.length;i++)n[s[i]]=e.Protocol.CollectorState.Active;var a=new Object;for(var c in o.CollectorType)this.isNumeric(c)&&(a[o.CollectorType[c].toLowerCase()]=n[c]);return Promise.resolve(a)},n.prototype.getAssociatedCollectorType=function(){return null},n.prototype.isNumeric=function(t){return parseInt(t,10)>=0},n}(n.Collector),n.CollectorsStateCollector=r}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r,o;o=t.sdk||(t.sdk={}),r=o.core||(o.core={}),e=r.collectors||(r.collectors={}),n=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.provide=function(e){var n=e.host,o=new Object;o.logged_users=0,r.User.iterateUsers(e,(function(t){t.deviceBound&&++o.logged_users}));var i=n.queryHostInfo(t.sdkhost.HostInformationKey.DevicePersistenceMode);return"string"==typeof i&&(o.persistence_mode=i),Promise.resolve(o)},n.prototype.getAssociatedCollectorType=function(){return o.CollectorType.DeviceDetails},n}(e.Collector),e.DeviceDetailsCollector=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){var e,n,r,o;o=t.sdk||(t.sdk={}),r=o.core||(o.core={}),e=r.collectors||(r.collectors={}),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.provide=function(t){for(var n=new Object,r=0,o=e.authenticatorDriversLocal;r<o.length;r++){var i=o[r],s=this.provideLocalEnrollmentData(t,i);s&&(n[i]=s)}return Promise.resolve(n)},e.prototype.getAssociatedCollectorType=function(){return o.CollectorType.LocalEnrollments},e.prototype.provideLocalEnrollmentData=function(t,e){var n=null;if(t.currentSession){var r=t.currentSession.user.localEnrollments[e];r&&((n=new Object).registration_status=r.status,n.validation_status=r.validationStatus)}return n},e.authenticatorDriversLocal=[r.authenticationdrivers.AuthenticationDriverLocalPinCode.authenticatorName,r.authenticationdrivers.AuthenticationDriverLocalPattern.authenticatorName,r.authenticationdrivers.AuthenticationDriverDescriptorFingerprint.authenticatorName,r.authenticationdrivers.AuthenticationDriverDescriptorNativeFace.authenticatorName],e}(e.Collector),e.LocalEnrollmentsCollector=n}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){t.TarsusCollectors={capabilities:{createCollector:t.CapabilitiesCollector},collector_state:{createCollector:t.CollectorsStateCollector},device_details:{createCollector:t.DeviceDetailsCollector}
10,local_enrollments:{createCollector:t.LocalEnrollmentsCollector}}}(t.collectors||(t.collectors={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){var e=function(){};t.PKCredentialException=e;var n=function(){function t(t,e){this._credentialId=t,this._userInteractionSessionProvider=e}return Object.defineProperty(t.prototype,"credentialId",{get:function(){return this._credentialId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"user",{get:function(){return this._userInteractionSessionProvider._session.user},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sdk",{get:function(){return this._userInteractionSessionProvider._sdk},enumerable:!1,configurable:!0}),t.prototype.getClientContext=function(){return this._userInteractionSessionProvider._clientContext},t}();t.PKCredential=n}(t.credential||(t.credential={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e,r){var o=n.call(this,t,r)||this;return o._host=e,o._externalCancelled=!1,o}return V(r,n),Object.defineProperty(r.prototype,"uiHandler",{get:function(){return this._userInteractionSessionProvider._uiHandler},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"authenticatorDescription",{get:function(){return this._authenticatorDescription},enumerable:!1,configurable:!0}),r.prototype.onCancelRun=function(){this._externalCancelled=!0,this.lastObtainedKeyPair&&(this.lastObtainedKeyPair=null)},r.prototype.startCredentialSession=function(e){if(this._authenticatorConfig=this._host.getAuthenticatorConfig(this),this._inputSession=this.createAuthenticatorSession(),!this._inputSession)throw t.impl.AuthenticationErrorImpl.appImplementationError("Invalid return from authenticator session creation call.");this._authenticatorDescription=this._host.getAuthenticatorDescription(this),this._inputSession.startSession(this._authenticatorDescription,t.AuthenticatorSessionMode.Authentication,this._host.getPolicyAction(this),e)},r.prototype.endCredentialSession=function(){this.lastObtainedKeyPair&&(this.lastObtainedKeyPair=null),this._inputSession&&(this._inputSession.endSession(),delete this._inputSession)},r.prototype.signHex=function(t){var e=this;return this.doSafeCredentialOperation((function(){return e.lastObtainedKeyPair.signHex(t)}))},r.prototype.unwrapAsymmetricKeyPairFromPrivateHex=function(t,e){var n=this;return this.doSafeCredentialOperation((function(){return n.lastObtainedKeyPair.unwrapAsymmetricKeyPairFromPrivateKeyHex(t,e)}))},r.prototype.doSafeCredentialOperation=function(e){var n=this;return new Promise((function(r,o){n._rejectionFunction||n._completionFunction?o(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.Internal,"Illegal credential state")):(n._rejectionFunction=o,n._completionFunction=function(i){n.lastObtainedKeyPair=i;try{e().then(r,(function(e){return n.processLocalAuthenticatorError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))}catch(e){o(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}},n.authenticateInStartedSession(!1))})).finally((function(){n._rejectionFunction=null,n._completionFunction=null}))},r.prototype.promiseRecoveryForError=function(e,n,r){var o=this;return n.indexOf(r)<0&&(r=n.indexOf(t.AuthenticationErrorRecovery.SelectAuthenticator)>=0?t.AuthenticationErrorRecovery.SelectAuthenticator:t.AuthenticationErrorRecovery.Fail),this._inputSession.promiseRecoveryForError(e,n,r).then((function(r){return o.sdk.log(t.LogLevel.Debug,(function(){return"Error recovery selected "+r})),o.sdk.log(t.LogLevel.Debug,(function(){return"recover from error: "+e.getErrorCode()})),n.indexOf(r)<0?(o.sdk.log(t.LogLevel.Error,(function(){return"Invalid error recovery option from callback: "+r+" not in "+n})),Promise.reject(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid error recovery action selected by callback."))):Promise.resolve(r)}))},r.prototype.evaluateLocalRegistrationStatus=function(){var n=this.user.localEnrollments[this.credentialId];return n?n.validationStatus==e.LocalEnrollmentValidationStatus.Invalidated?t.AuthenticatorRegistrationStatus.LocallyInvali
10d:n.status!=e.LocalEnrollmentStatus.Registered?t.AuthenticatorRegistrationStatus.Unregistered:t.AuthenticatorRegistrationStatus.Registered:t.AuthenticatorRegistrationStatus.LocallyInvalid},Object.defineProperty(r.prototype,"lastObtainedKeyPair",{get:function(){return this._lastObtainedKeyPair},set:function(t){this._lastObtainedKeyPair&&this._lastObtainedKeyPair!=t&&(t&&this._lastObtainedKeyPair.getTag()===t.getTag()||this._lastObtainedKeyPair.closeKeyPair()),this._lastObtainedKeyPair=t},enumerable:!1,configurable:!0}),r.prototype.authenticateInStartedSession=function(e){var n=this;this._inputSession.promiseInput().then((function(t){return n.handleInputOrControlResponse(t)}),(function(e){return n.completeCredentialOperationWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}))},r.prototype.handleAuthenticationInputResponse=function(e){var n=this,r=this.user.localEnrollments[this.credentialId];r?this.getKeyForEnrollmentDataAndInput(r,e).then((function(e){n.sdk.log(t.LogLevel.Debug,(function(){return"Local authenticator key obtained; signing challenge"})),n.completeCredentialOperationWithResult(e)})).catch((function(e){n.processLocalAuthenticatorError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))})):this.completeCredentialOperationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.NoRegisteredAuthenticator,"Missing key for fingerprint authenticator"))},r.prototype.processLocalAuthenticatorError=function(e){var n=this,r=this._host.getCredentialValidErrorRecoveryOptions(this,e),o=r.indexOf(t.AuthenticationErrorRecovery.RetryAuthenticator)>=0?t.AuthenticationErrorRecovery.RetryAuthenticator:t.AuthenticationErrorRecovery.Fail;this.promiseRecoveryForError(e,r,o).then((function(t){n.handleErrorRecoveryAction(t,e)}))},r.prototype.completeCredentialOperationWithResult=function(t){this._completionFunction(t)},r.prototype.completeCredentialOperationWithError=function(t){this._rejectionFunction(t)},r.prototype.handleInputOrControlResponse=function(e){try{e.isControlRequest()?e.getControlRequest().getRequestType()==t.ControlRequestType.CancelAuthenticator?this.invokeUiHandlerCancellation():this.signalControlRequest(e.getControlRequest()):e.getActionEscapeRequest()?this.signalEscapeRequest(e.getActionEscapeRequest()):this.handleAuthenticationInputResponse(e.getResponse())}catch(e){this.completeCredentialOperationWithError(t.impl.AuthenticationErrorImpl.ensureAuthenticationError(e))}},r.prototype.signalControlRequest=function(e){this._externalCancelled&&e.getRequestType()==t.ControlRequestType.CancelAuthenticator&&(e=t.ControlRequest.create(t.ControlRequestType.AbortAuthentication)),this._rejectionFunction(e)},r.prototype.signalEscapeRequest=function(t){this._rejectionFunction(t)},r.prototype.invokeUiHandlerCancellation=function(){var e=this,n=this._host.getCredentialAvailableCancellationOptions(this);this.uiHandler.controlOptionForCancellationRequestInSession(n,this._inputSession).then((function(r){r.getRequestType()==t.ControlRequestType.CancelAuthenticator&&e.completeCredentialOperationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned CancelAuthenticator which is an invalid option.")),n.indexOf(r.getRequestType())<0&&e.completeCredentialOperationWithError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"controlOptionForCancellationRequestInSession returned an invalid option.")),e.signalControlRequest(r)}))},r.prototype.handleErrorRecoveryAction=function(e,n){switch(e){case t.AuthenticationErrorRecovery.RetryAuthenticator:this.signalControlRequest(t.ControlRequest.create(t.ControlRequestType.RetryAuthenticator));break;case t.AuthenticationErrorRecovery.ChangeAuthenticator:this.signalControlRequest(t.ControlRequest.create(t.ControlRequestType.ChangeMethod));break;case t.AuthenticationErrorRecovery.SelectAuthenticator:this.signalControlRequest(t.ControlRequest.create(t.ControlRequestType.SelectMethod));break;case t.AuthenticationErrorRecovery.Fail:default:this.completeCredentialOperationWithError(n)}},r}(n.PKCredential);n.PKCredentialAuthLocal=r}(e.credential||(e.credential={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(r){function o(t,e,n){return r.call(this,t,e,n)||this}
10return V(o,r),o.prototype.getKeyForEnrollmentDataAndInput=function(t,n){var r=this;return new Promise((function(e,o){t.version>="v2"?r.getKeyForEnrollmentDataAndInputV2(t,n).then(e,o):r.getKeyForEnrollmentDataAndInputPreV2(t,n).then(e,o)})).then((function(t){if(!t)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.InvalidInput,"Invalid input provided to credential.");return t}))},o.prototype.getKeyForEnrollmentDataAndInputV2=function(e,r){var o=this,i=this.extractPbkdfInputFromInputResponse(r);return n.vault.pbkdfStretchHexSecretIntoAESKey(e.salt,i,e.cryptoSettings.getLocalEnrollmentKeySizeInBytes(),e.cryptoSettings.getLocalEnrollmentKeyIterationCount(),!0,this.sdk).then((function(r){return r.decrypt(e.keyMaterial,null).then((function(r){return o.sdk.host.generateHexSeededKeyPairExternalRepresentation(t.sdkhost.KeyClass.FidoECCSigningKey,r,n.authenticationdrivers.AuthenticationDriverLocalSecretInputBased.enrollmentVersion2KeyGenVersion(e.version),e.publicKeyHash).then((function(e){return o.sdk.host.importVolatileKeyPair(t.sdkhost.KeyClass.FidoECCSigningKey,e)}))}))}))},o.prototype.getKeyForEnrollmentDataAndInputPreV2=function(e,n){var r=this;return this.authenticatorKeyTagForScheme(e.version,e.salt,e.cryptoSettings,n).then((function(e){return r.sdk.host.getKeyPair(e,t.sdkhost.KeyClass.StdSigningKey,t.sdkhost.KeyBiometricProtectionMode.None)}))},o.prototype.authenticatorKeyTagForScheme=function(t,r,o,i){var s=this;return new Promise((function(a,c){var u=s.extractPbkdfInputFromInputResponse(i);if("v0"==t&&(s.sdk.log(e.LogLevel.Debug,(function(){return"Using SDK CryptoSettings for migrated enrollment."})),o=s.sdk.cryptoSettings),!o)throw new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Missing crypto settings for local enrollment.");s.sdk.host.generatePbkdf2HmacSha1HexString(r,u,o.getLocalEnrollmentKeySizeInBytes(),o.getLocalEnrollmentKeyIterationCount()).then((function(r){var o=e.util.hexToBase64(r);return new n.TarsusKeyPath("per_user",s.user.guid.toString(),"local_auth_keys",s.credentialId,t,o)})).then(a,c)}))},o}(r.PKCredentialAuthLocal);r.PKCredentialLocalSecretInputBased=o}(n.credential||(n.credential={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(){};e.CredentialAuthPinCodeConfig=n;var r=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),Object.defineProperty(n.prototype,"pinLength",{get:function(){return this._authenticatorConfig.length},enumerable:!1,configurable:!0}),n.prototype.extractPbkdfInputFromInputResponse=function(e){var n=e;return t.util.asciiToHex(n.getPin())},n.prototype.createAuthenticatorSession=function(){return this.uiHandler.createPinAuthSession(this.credentialId,this.user.displayName,this.pinLength)},n.create=function(t,e,r){return new n(t,e,r)},n}(e.PKCredentialLocalSecretInputBased);e.PKCredentialLocalPinCode=r}(e.credential||(e.credential={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(e){var n=function(e){function n(t,n,r){return e.call(this,t,n,r)||this}return V(n,e),n.prototype.handleAuthenticationInputResponse=function(n){var r=n;t.impl.PatternInputImpl.validateFormat(r)?e.prototype.handleAuthenticationInputResponse.call(this,n):this.processLocalAuthenticatorError(new t.impl.AuthenticationErrorImpl(t.AuthenticationErrorCode.AppImplementation,"Invalid pattern description format."))},n.prototype.extractPbkdfInputFromInputResponse=function(e){var n=e;return t.util.asciiToHex(n.getPatternDescription())},n.prototype.createAuthenticatorSession=function(){var t,e,n=this._authenticatorConfig,r=this.uiHandler.createPatternAuthSession(this.credentialId,this.user.displayName,3,4);return null===(e=(t=r).setMinLength)||void 0===e||e.call(t,n.min_length),r},n.create=function(t,e,r){return new n(t,e,r)},n}(e.PKCredentialLocalSecretInputBased);e.PKCredentialLocalPattern=n}(e.credential||(e.credential={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(e){!function(n){!function(r){var o=function(r){function o(){return null!==r&&r.apply(this,arguments)||this}return V(o,r),o.prototype.authenticatorKeyTagForScheme=function(t,e){return new n.TarsusKeyPath("per_user",this.user.guid.toString(),"local_auth_keys",this.credentialId,t,e)}
10,o.prototype.getKeyForEnrollmentDataAndInput=function(n,r){var o=this;return new Promise((function(i,s){var a=o.authenticatorKeyTagForScheme(n.version,n.salt),c=o.sdk.host.getKeyPair(a,t.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);if(!c){var u={};throw u[t.sdkhost.ErrorDataInternalError]=t.sdkhost.InternalErrorBiometricInvalidated,new e.impl.AuthenticationErrorImpl(e.AuthenticationErrorCode.Internal,"Attempt to authenticate with invalidated biometric authenticator.",u)}o.updateKeyPairWithAuthenticationInput(c,o._inputSession,r),i(c)}))},o.prototype.processLocalAuthenticatorError=function(r){var o=this,i=r,s=Promise.resolve();if(i.getErrorCode()==e.AuthenticationErrorCode.Internal&&i.getData()){var a=i.getData();i=e.impl.AuthenticationErrorImpl.errorForHostInternalBiometricErrorData(a,this.credentialId)||i,(a[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricNotConfigured&&this._authenticatorDescription.getRegistered()||a[t.sdkhost.ErrorDataInternalError]==t.sdkhost.InternalErrorBiometricInvalidated)&&(s=n.LocalEnrollment.invalidateLocalRegistrationStatusAndNotifyUIHandler(this._userInteractionSessionProvider,this._authenticatorDescription))}
10s.catch((function(t){o.sdk.log(e.LogLevel.Error,t)})),s.finally((function(){if(i.getErrorCode()==e.AuthenticationErrorCode.UserCanceled)return o.sdk.log(e.LogLevel.Debug,(function(){return"${this.credentialId} authenticator captured user cancel error code."})),void o.invokeUiHandlerCancellation();o.completeCredentialOperationWithError(i)}))},o.prototype.evaluateLocalRegistrationStatus=function(){var n=r.prototype.evaluateLocalRegistrationStatus.call(this);if(n!=e.AuthenticatorRegistrationStatus.Registered)return n;var o=this.user.localEnrollments[this.credentialId],i=this.authenticatorKeyTagForScheme(o.version,o.salt),s=this.sdk.host.getKeyPair(i,t.sdkhost.KeyClass.HardwareProtectedSignAndEncryptKey,t.sdkhost.KeyBiometricProtectionMode.BindToEnrollmentDb);return s?(s.closeKeyPair(),e.AuthenticatorRegistrationStatus.Registered):e.AuthenticatorRegistrationStatus.LocallyInvalid},o}(r.PKCredentialAuthLocal);r.PKCredentialBiometric=o}(n.credential||(n.credential={}))}(e.core||(e.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e,r){return n.call(this,t,e,r)||this}return V(r,n),r.prototype.updateKeyPairWithAuthenticationInput=function(e,n,r){e.setBiometricPromptInfo(t.util.BiometricPromptInfoFrom.fingerprintInput(r),this.uiHandler,n)},r.prototype.authenticatorKeyTagForScheme=function(t,n){return e.authenticationdrivers.AuthenticationDriverFingerprint.authenticatorKeyTagForUser(this.user,t,n)},r.prototype.createAuthenticatorSession=function(){return this.uiHandler.createFingerprintAuthSession(this.credentialId,this.user.displayName)},r.prototype.shouldAllowBiometricFallbackButton=function(t){if(!t)return!1;var e=t.getFallbackButtonTitle();return!!(e&&e.length>0)},r.create=function(t,e,n){return new r(t,e,n)},r}(n.PKCredentialBiometric);n.PKCredentialFingerprint=r}(e.credential||(e.credential={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e,r){return n.call(this,t,e,r)||this}return V(r,n),r.prototype.updateKeyPairWithAuthenticationInput=function(e,n,r){e.setBiometricPromptInfo(t.util.BiometricPromptInfoFrom.nativeFaceInput(r),null,null)},r.prototype.authenticatorKeyTagForScheme=function(t,n){return e.authenticationdrivers.AuthenticationDriverNativeFace.authenticatorKeyTagForUser(this.user,t,n)},r.prototype.createAuthenticatorSession=function(){return this.uiHandler.createNativeFaceAuthSession(this.credentialId,this.user.displayName)},r.prototype.shouldAllowBiometricFallbackButton=function(t){if(!t)return!1;var e=t.getFallbackButtonTitle();return!!(e&&e.length>0)},r.create=function(t,e,n){return new r(t,e,n)},r}(n.PKCredentialBiometric);n.PKCredentialNativeFace=r}(e.credential||(e.credential={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){!function(n){var r=function(n){function r(t,e,r){return n.call(this,t,e,r)||this}return V(r,n),r.prototype.updateKeyPairWithAuthenticationInput=function(e,n,r){e.setBiometricPromptInfo(t.util.BiometricPromptInfoFrom.deviceBiometricInput(r,this._authenticatorConfig),null,null)},r.prototype.authenticatorKeyTagForScheme=function(t,r){return e.authenticationdrivers.AuthenticationDriverDeviceBiometrics.authenticatorKeyTagForUserForMigratedEnrollment(this.user,t,r)||n.prototype.authenticatorKeyTagForScheme.call(this,t,r)},r.prototype.createAuthenticatorSession=function(){return this.uiHandler.createDeviceBiometricsAuthSession(this.credentialId,this.user.displayName)},r.create=function(t,e,n){return new r(t,e,n)},r}(n.PKCredentialBiometric);n.PKCredentialDeviceBiometrics=r}(e.credential||(e.credential={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){!function(t){t.CredentialTypes={pin:t.PKCredentialLocalPinCode,pattern:t.PKCredentialLocalPattern,fingerprint:t.PKCredentialFingerprint,face_id:t.PKCredentialNativeFace,device_biometrics:t.PKCredentialDeviceBiometrics}}(t.credential||(t.credential={}))}(t.core||(t.core={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getEscapeOption=function(){return this._escapeOption},t.prototype.setEscapeOption=function(t){this._escapeOption=t},t.prototype.getEscapeParameters=function(){return this._escapeParameters},t.prototype.setEscapeParameters=function(t){this._escapeParameters=t},t.__tarsusInterfaceName="ActionEscapeRequest",t}();t.ActionEscapeRequest=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="AnonymousPolicyInvocationOptions",e}(t.JourneyInvocationOptions);t.AnonymousPolicyInvocationOptions=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="ApprovalPolicyInvocationOptions",e}(t.JourneyInvocationOptions);t.ApprovalPolicyInvocationOptions=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getAcquisitionResponse=function(){return this._acquisitionResponse},e.prototype.setAcquisitionResponse=function(t){this._acquisitionResponse=t},e.__tarsusInterfaceName="AudioInputResponse",e}(t.InputResponseType);t.AudioInputResponse=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="AuthenticateInvocationOptions",e}(t.JourneyInvocationOptions);t.AuthenticateInvocationOptions=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Internal=0]="Internal",t[t.InvalidInput
10=1]="InvalidInput",t[t.AuthenticatorLocked=2]="AuthenticatorLocked",t[t.AllAuthenticatorsLocked=3]="AllAuthenticatorsLocked",t[t.NoRegisteredAuthenticator=4]="NoRegisteredAuthenticator",t[t.RegisteredSecretAlreadyInHistory=5]="RegisteredSecretAlreadyInHistory",t[t.Communication=6]="Communication",t[t.UserCanceled=7]="UserCanceled",t[t.AppImplementation=8]="AppImplementation",t[t.PolicyRejection=9]="PolicyRejection",t[t.AuthenticatorInvalidated=10]="AuthenticatorInvalidated",t[t.ControlFlowExpired=11]="ControlFlowExpired",t[t.SessionRequired=12]="SessionRequired",t[t.AuthenticatorError=13]="AuthenticatorError",t[t.ApprovalWrongState=14]="ApprovalWrongState",t[t.TotpNotProvisioned=15]="TotpNotProvisioned",t[t.AuthenticatorExternalConfigError=16]="AuthenticatorExternalConfigError",t[t.InvalidDeviceBinding=17]="InvalidDeviceBinding",t[t.InvalidIdToken=18]="InvalidIdToken",t[t.DeviceNotFound=19]="DeviceNotFound",t[t.ApprovalDenied=20]="ApprovalDenied",t[t.ApprovalExpired=21]="ApprovalExpired",t[t.ApplicationGeneratedRecoverableError=22]="ApplicationGeneratedRecoverableError",t[t.UserNotFound=23]="UserNotFound"}(t.AuthenticationErrorCode||(t.AuthenticationErrorCode={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.AuthenticatorExternalConfigErrorReason=0]="AuthenticatorExternalConfigErrorReason",t[t.AuthenticatorInvalidInputErrorDescription=1]="AuthenticatorInvalidInputErrorDescription",t[t.InvalidIdTokenErrorReason=2]="InvalidIdTokenErrorReason",t[t.UserRecordDeleted=3]="UserRecordDeleted",t[t.AuthenticationErrorFailingActionType=4]="AuthenticationErrorFailingActionType",t[t.AuthenticationErrorReason=5]="AuthenticationErrorReason"}(t.AuthenticationErrorProperty||(t.AuthenticationErrorProperty={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled=0]="AuthenticatorExternalConfigErrorReasonBiometricsNotEnrolled",t[t.AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary=1]="AuthenticatorExternalConfigErrorReasonBiometricsOsLockTemporary",t[t.AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent=2]="AuthenticatorExternalConfigErrorReasonBiometricsOsLockPermanent",t[t.AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit=3]="AuthenticatorInvalidInputErrorDescriptionTotpIncorrectCheckDigit",t[t.InvalidIdTokenErrorReasonExpiredToken=4]="InvalidIdTokenErrorReasonExpiredToken",t[t.InvalidIdTokenErrorReasonBadToken=5]="InvalidIdTokenErrorReasonBadToken",t[t.AuthenticationErrorReasonAttestationReverificationFailed=6]="AuthenticationErrorReasonAttestationReverificationFailed",t[t.AuthenticationErrorReasonCredentialFiltered=7]="AuthenticationErrorReasonCredentialFiltered",t[t.AuthenticatorExternalConfigErrorReasonGeneratedKeyIsNotSecure=8]="AuthenticatorExternalConfigErrorReasonGeneratedKeyIsNotSecure"}(t.AuthenticationErrorPropertySymbol||(t.AuthenticationErrorPropertySymbol={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.RetryAuthenticator=0]="RetryAuthenticator",t[t.ChangeAuthenticator=1]="ChangeAuthenticator",t[t.SelectAuthenticator=2]="SelectAuthenticator",t[t.Fail=3]="Fail"}(t.AuthenticationErrorRecovery||(t.AuthenticationErrorRecovery={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Register=0]="Register",t[t.Unregister=1]="Unregister",t[t.Reregister=2]="Reregister"}(t.AuthenticatorConfigurationAction||(t.AuthenticatorConfigurationAction={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Fallback=0]="Fallback",t[t.AuthMenu=1]="AuthMenu",t[t.Retry=2]="Retry",t[t.Cancel=3]="Cancel"}(t.AuthenticatorFallbackAction||(t.AuthenticatorFallbackAction={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Registered=0]="Registered",t[t.Unregistered=1]="Unregistered",t[t.LocallyInvali
10d=2]="LocallyInvalid"}(t.AuthenticatorRegistrationStatus||(t.AuthenticatorRegistrationStatus={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.SelectAuthenticator=0]="SelectAuthenticator",t[t.Abort=1]="Abort",t[t.Escape=2]="Escape"}(t.AuthenticatorSelectionResultType||(t.AuthenticatorSelectionResultType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Authentication=0]="Authentication",t[t.Registration=1]="Registration"}(t.AuthenticatorSessionMode||(t.AuthenticatorSessionMode={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="BindInvocationOptions",e}(t.JourneyInvocationOptions);t.BindInvocationOptions=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getAcquisitionResponse=function(){return this._acquisitionResponse},e.prototype.setAcquisitionResponse=function(t){this._acquisitionResponse=t},e.__tarsusInterfaceName="CameraInputResponse",e}(t.InputResponseType);t.CameraInputResponse=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Accounts=0]="Accounts",t[t.DeviceDetails=1]="DeviceDetails",t[t.Contacts=2]="Contacts",t[t.Owner=3]="Owner",t[t.Software=4]="Software",t[t.Location=5]="Location",t[t.LocationCountry=6]="LocationCountry",t[t.Bluetooth=7]="Bluetooth",t[t.ExternalSDKDetails=8]="ExternalSDKDetails",t[t.HWAuthenticators=9]="HWAuthenticators",t[t.Capabilities=10]="Capabilities",t[t.LargeData=11]="LargeData",t[t.LocalEnrollments=12]="LocalEnrollments",t[t.DeviceFingerprint=13]="DeviceFingerprint",t[t.AppPermissions=14]="AppPermissions"}(t.CollectorType||(t.CollectorType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.None=0]="None",t[t.Credentials=1]="Credentials",t[t.Full=2]="Full"}(t.ConnectionCryptoMode||(t.ConnectionCryptoMode={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.CancelAuthenticator=0]="CancelAuthenticator",t[t.RetryAuthenticator=1]="RetryAuthenticator",t[t.ChangeMethod=2]="ChangeMethod",t[t.SelectMethod=3]="SelectMethod",t[t.AbortAuthentication=4]="AbortAuthentication"}(t.ControlRequestType||(t.ControlRequestType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Remove=0]="Remove",t[t.Rename=1]="Rename"}(t.DeviceManagementAction||(t.DeviceManagementAction={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.RecentlyUsed=0]="RecentlyUsed",t[t.NoRecentActivity=1]="NoRecentActivity",t[t.LongInactivity=2]="LongInactivity",t[t.Disabled=3]="Disabled",t[t.Removed=4]="Removed"}(t.DeviceStatus||(t.DeviceStatus={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Submit=0]="Submit",t[t.Abort=1]="Abort",t[t.Escape=2]="Escape"}(t.FormControlRequest||(t.FormControlRequest={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Disable=0]="Disable",t[t.RecoverDeviceAndBindingOnAuthenticate=1]="RecoverDeviceAndBindingOnAuthenticate"}(t.InvalidUserRecordRecoveryMode||(t.InvalidUserRecordRecoveryMode={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Off=0]="Off",t[t.Critical=1]="Critical",t[t.Error=2]="Error",t[t.Warning=3]="Warning",t[t.Info=4]="Info",t[t.Debug=5]="Debug"}(t.LogLevel||(t.LogLevel={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Approve=0]="Approve",t[t.De
10ny=1]="Deny"}(t.MobileApprovalAction||(t.MobileApprovalAction={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Pending=0]="Pending",t[t.Approved=1]="Approved",t[t.Denied=2]="Denied",t[t.Expired=3]="Expired"}(t.MobileApprovalStatus||(t.MobileApprovalStatus={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Unknown=0]="Unknown",t[t.Sms=1]="Sms",t[t.Email=2]="Email",t[t.PushNotification=3]="PushNotification",t[t.VoiceCall=4]="VoiceCall"}(t.OtpChannel||(t.OtpChannel={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getFailureError=function(){return this._failureError},e.prototype.setFailureError=function(t){this._failureError=t},e.prototype.getExpired=function(){return this._expired},e.prototype.setExpired=function(t){this._expired=t},e.prototype.getRegistered=function(){return this._registered},e.prototype.setRegistered=function(t){this._registered=t},e.prototype.getRegistrationStatus=function(){return this._registrationStatus},e.prototype.setRegistrationStatus=function(t){this._registrationStatus=t},e.prototype.getLocked=function(){return this._locked},e.prototype.setLocked=function(t){this._locked=t},e.__tarsusInterfaceName="PlaceholderAuthFailureResponse",e}(t.PlaceholderInputResponse);t.PlaceholderAuthFailureResponse=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getFailureError=function(){return this._failureError},e.prototype.setFailureError=function(t){this._failureError=t},e.__tarsusInterfaceName="PlaceholderAuthFailureWithServerProvidedStatusResponse",e}(t.PlaceholderInputResponse);t.PlaceholderAuthFailureWithServerProvidedStatusResponse=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getPlaceholderToken=function(){return this._placeholderToken},e.prototype.setPlaceholderToken=function(t){this._placeholderToken=t},e.__tarsusInterfaceName="PlaceholderAuthSuccessResponse",e}(t.PlaceholderInputResponse);t.PlaceholderAuthSuccessResponse=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.__tarsusInterfaceName="PolicyInvocationOptions",e}(t.JourneyInvocationOptions);t.PolicyInvocationOptions=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Skip=0]="Skip",t[t.Abort=1]="Abort",t[t.Continue=2]="Continue"}(t.PromotionControlRequest||(t.PromotionControlRequest={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Numeric=0]="Numeric",t[t.Alphanumeric=1]="Alphanumeric",t[t.Binary=2]="Binary"}(t.QrCodeFormat||(t.QrCodeFormat={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.RedirectToPolicy=0]="RedirectToPolicy",t[t.CancelRedirect=1]="CancelRedirect"}(t.RedirectResponseType||(t.RedirectResponseType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getAnswers=function(){return this._answers},e.__tarsusInterfaceName="SecurityQuestionAnswersInputResponse",e}(t.SecurityQuestionInputResponse);t.SecurityQuestionAnswersInputResponse=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.__tarsusInterfaceName="SuspensionContext",t}();t.SuspensionContext=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getValue=function(){return this._value},t.prototype.setValue=function(t){this._value=t},t.prototype.getFormat=function(){return this._format},t.prototype.setFormat=function(t){this._format=t},t.__tarsusInterfaceName="TotpChallenge",t}();t.TotpChallenge=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getName=function(){return this._name},t.prototype.setName=function(t){this._name=t},t.prototype.getValue=function(){return this._value},t.prototype.setValue=function(t){this._value=t}
10,t.__tarsusInterfaceName="TransportHeader",t}();t.TransportHeader=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getStatus=function(){return this._status},t.prototype.setStatus=function(t){this._status=t},t.prototype.getMethod=function(){return this._method},t.prototype.setMethod=function(t){this._method=t},t.prototype.getHeaders=function(){return this._headers},t.prototype.setHeaders=function(t){this._headers=t},t.prototype.getBodyJson=function(){return this._bodyJson},t.prototype.setBodyJson=function(t){this._bodyJson=t},t.__tarsusInterfaceName="TransportResponse",t}();t.TransportResponse=e}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Disable=0]="Disable",t[t.DownloadOnInit=1]="DownloadOnInit"}(t.UIAssetsDownloadMode||(t.UIAssetsDownloadMode={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.UserId=0]="UserId",t[t.IdToken=1]="IdToken"}(t.UserHandleType||(t.UserHandleType={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Fido2UserVerifyingPlatformAuthenticatorAvailable=0]="Fido2UserVerifyingPlatformAuthenticatorAvailable"}(t.AsyncHostInformationKey||(t.AsyncHostInformationKey={}))}(t.sdkhost||(t.sdkhost={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(){function t(){}return t.prototype.getLocalizedTitle=function(){return this._localizedTitle},t.prototype.setLocalizedTitle=function(t){this._localizedTitle=t},t.prototype.getLocalizedSubtitle=function(){return this._localizedSubtitle},t.prototype.setLocalizedSubtitle=function(t){this._localizedSubtitle=t},t.prototype.getLocalizedPrompt=function(){return this._localizedPrompt},t.prototype.setLocalizedPrompt=function(t){this._localizedPrompt=t},t.prototype.getFallbackButtonTitle=function(){return this._fallbackButtonTitle},t.prototype.setFallbackButtonTitle=function(t){this._fallbackButtonTitle=t},t.prototype.getCancelButtonTitle=function(){return this._cancelButtonTitle},t.prototype.setCancelButtonTitle=function(t){this._cancelButtonTitle=t},t.prototype.getRequireConfirmation=function(){return this._requireConfirmation},t.prototype.setRequireConfirmation=function(t){this._requireConfirmation=t},t.__tarsusInterfaceName="BiometricPromptInfo",t}();t.BiometricPromptInfo=e}(t.sdkhost||(t.sdkhost={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Sign=0]="Sign",t[t.Otp=1]="Otp"}(t.DyadicTokenType||(t.DyadicTokenType={}))}(t.sdkhost||(t.sdkhost={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Create=0]="Create",t[t.Get=1]="Get"}(t.Fido2CredentialsOpType||(t.Fido2CredentialsOpType={}))}(t.sdkhost||(t.sdkhost={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.Version=0]="Version",t[t.Platform=1]="Platform",t[t.FingerprintSupported=2]="FingerprintSupported",t[t.HostProvidedFeatures=3]="HostProvidedFeatures",t[t.FaceIdKeyBioProtectionSupported=4]="FaceIdKeyBioProtectionSupported",t[t.ImageAcquitisionSupported=5]="ImageAcquitisionSupported",t[t.AudioAcquitisionSupported=6]="AudioAcquitisionSupported",t[t.PersistentKeysSupported=7]="PersistentKeysSupported",t[t.DyadicPresent=8]="DyadicPresent",t[t.StdSigningKeyIsHardwareProtectedSignAndEncryptKey=9]="StdSigningKeyIsHardwareProtectedSignAndEncryptKey",t[t.Fido2ClientPresent=10]="Fido2ClientPresent",t[t.DeviceBiometricsSupported=11]="DeviceBiometricsSupported",t[t.DeviceBiometricsFPContinuation=12]="DeviceBiometricsFPContinuation",t[t.DeviceBiometricsUsesSign=13]="DeviceBiometricsUsesSign",t[t.DevicePersistenceMode=14]="DevicePersistenceMode",t[t.Fido2RelyingParty=15]="Fido2RelyingParty"}(t.HostInformationKey||(t.HostInformationKey={}))}(t.sdkhost||(t.sdkhost={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.None=0]="None",t[t.NormalProtection=1]="NormalProtection",t[t.BindToEnrollmentDb=2]="BindToEnrollmentDb"}(t.KeyBiometricProtectionMode||(t.KeyBiometricProtectionMode={}))}(t.sdkhost||(t.sdkhost={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){t[t.StdSigningKey=0]="StdSigningKey",t[t.StdEncryptionKey=1]="StdEncryptionKey",t[t.GeneralPurposeAES=2]="GeneralPurposeAES",t[t.NoIntegrityAES=3]="NoIntegrityAES",t[t.FidoECCSigningKey=4]="FidoECCSigningKey",t[t.HardwareProtectedSignAndEncryptKey=5]="HardwareProtectedSignAndEncryptKey"}(t.KeyClass||(t.KeyClass={}))}(t.sdkhost||(t.sdkhost={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(n){var r=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getActionToken=function(){return this._actionToken},n.create=function(e){return t.ts.mobile.tarsusplugin.impl.AcpActionTokenResultImpl.create(e)},n.__tarsusInterfaceName="AcpActionTokenResult",n}(e.sdk.InputResponseType);n.AcpActionTokenResult=r}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getResultPayload=function(){return this._resultPayload},e.create=function(e){return t.ts.mobile.tarsusplugin.impl.IdpInvocationResultImpl.create(e)},e.__tarsusInterfaceName="IdpInvocationResult",e}();e.IdpInvocationResult=n}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(n){var r=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getPayload=function(){return this._payload},n.create=function(e){return t.ts.mobile.tarsusplugin.impl.KycDataCollectionResultImpl.create(e)},n.__tarsusInterfaceName="KycDataCollectionResult",n}(e.sdk.InputResponseType);n.KycDataCollectionResult=r}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(n){var r=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return V(n,e),n.prototype.getDelay=function(){return this._delay},n.create=function(e){return t.ts.mobile.tarsusplugin.impl.KycPollResultImpl.create(e)},n.__tarsusInterfaceName="KycPollResult",n}(e.sdk.InputResponseType);n.KycPollResult=r}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getPluginName=function(){return this._pluginName},e.prototype.setPluginName=function(t){this._pluginName=t},e.prototype.getVersionMajor=function(){return this._versionMajor},e.prototype.setVersionMajor=function(t){this._versionMajor=t},e.prototype.getVersionMinor=function(){return this._versionMinor},e.prototype.setVersionMinor=function(t){this._versionMinor=t},e.prototype.getVersionPatch=function(){return this._versionPatch},e.prototype.setVersionPatch=function(t){this._versionPatch=t},e.prototype.getRequiredPluginApiLevel=function(){return this._requiredPluginApiLevel},e.prototype.setRequiredPluginApiLevel=function(t){this._requiredPluginApiLevel=t},e.create=function(){return t.ts.mobile.tarsusplugin.impl.PluginInfoImpl.create()},e.__tarsusInterfaceName="PluginInfo",e}();e.PluginInfo=n}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getCode=function(){return this._code},e.prototype.getTimeStepSeconds=function(){return this._timeStepSeconds},e.prototype.getExpiresInSeconds=function(){return this._expiresInSeconds},e.prototype.getSecondsTillNextInvocation=function(){return this._secondsTillNextInvocation},e.prototype.getShouldUpdateSpecificProperties=function(){return this._shouldUpdateSpecificProperties},e.prototype.getGeneratorSpecificDataToStore=function(){return this._generatorSpecificDataToStore},e.prototype.getMessage=function(){return this._message},e.create=function(e,n,r,o,i,s,a){return t.ts.mobile.tarsusplugin.impl.TotpCodeGenerationOutputImpl.create(e,n,r,o,i,s,a)},e.__tarsusInterfaceName="TotpCodeGenerationOutput",e}();e.TotpCodeGenerationOutput=n}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getEscapeRequest=function(){return this._escapeRequest},e.prototype.setEscapeRequest=function(t){this._escapeRequest=t},e.__tarsusInterfaceName="TotpProvisionEscapeRequest",e}(t.TotpProvisionResult);t.TotpProvisionEscapeRequest=e}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){var n=function(){function e(){}return e.prototype.getUnprotectedProvisionOutput=function(){return this._unprotectedProvisionOutput},e.prototype.getSecretToLock=function(){return this._secretToLock},e.create=function(e,n){return t.ts.mobile.tarsusplugin.impl.VaultBasedTotpProvisionOutputImpl.create(e,n)},e.__tarsusInterfaceName="VaultBasedTotpProvisionOutput",e}();e.VaultBasedTotpProvisionOutput=n}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n._actionToken=t,n},e.__tarsusInterfaceName="AcpActionTokenResult",e}(t.AcpActionTokenResult);e.AcpActionTokenResultImpl=n}(t.impl||(t.impl={}))}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getResultPayload=function(){return this._resultPayload},e.create=function(t){var n=new e;return n._resultPayload=t,n},e.__tarsusInterfaceName="IdpInvocationResult",e}(t.IdpInvocationResult);e.IdpInvocationResultImpl=n}(t.impl||(t.impl={}))}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.prototype.getPayload=function(){return this._payload},e.create=function(t){var n=new e;return n._payload=t,n},e.__tarsusInterfaceName="KycDataCollectionResult",e}(t.KycDataCollectionResult);e.KycDataCollectionResultImpl=n}(t.impl||(t.impl={}))}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t){var n=new e;return n._delay=t,n},e.__tarsusInterfaceName="KycDataPollResult",e}(t.KycPollResult);e.KycPollResultImpl=n}(t.impl||(t.impl={}))}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(e){!function(e){!function(e){!function(n){var r=function(e){function n(){var t=e.call(this)||this;return t._versionMajor=0,t._versionMinor=0,t._versionPatch=0,t}
10return V(n,e),n.create=function(){return new t.ts.mobile.tarsusplugin.impl.PluginInfoImpl},n.versionToString=function(t){return t.getVersionMajor()+"."+t.getVersionMinor()+"."+t.getVersionPatch()},n.toString=function(t){return t.getPluginName()+" v"+this.versionToString(t)},n}(e.PluginInfo);n.PluginInfoImpl=r}(e.impl||(e.impl={}))}(e.tarsusplugin||(e.tarsusplugin={}))}(e.mobile||(e.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t,n,r,o,i,s,a){var c=new e;return c._code=t,n&&(c._message=n),c._timeStepSeconds=r,c._expiresInSeconds=o,c._secondsTillNextInvocation=i,c._shouldUpdateSpecificProperties=s,a&&(c._generatorSpecificDataToStore=a),c},e}(t.TotpCodeGenerationOutput);e.TotpCodeGenerationOutputImpl=n}(t.impl||(t.impl={}))}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(e){var n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return V(e,t),e.create=function(t,n){var r=new e;return r._secretToLock=t,r._unprotectedProvisionOutput=n,r},e}(t.VaultBasedTotpProvisionOutput);e.VaultBasedTotpProvisionOutputImpl=n}(t.impl||(t.impl={}))}(t.tarsusplugin||(t.tarsusplugin={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={})),function(t){!function(t){!function(t){!function(t){!function(t){function e(t){return!!t.tlvSerializable}function n(n,r){var o=[];return Object.keys(r).forEach((function(i){var s=n[i];if(!s)throw"TLV encoding error: Unknown tag "+i;var a=r[i];a instanceof Array||(a=[a]),a.forEach((function(r){var a=r.__type||s.tagType||e(r)&&t.TlvTypes.Serializable;if(!a)throw"Unknown type for tag "+i;r.__type&&(r=r.__value);var c=a(r,n);o.push(t.TlvTypes.UInt16(s.id)),o.push(t.TlvTypes.UInt16(c.length/2)),o.push(c)}))})),o.join("")}t.instanceOfTlvSerializable=e,t.TlvTypes={UInt8:function(e){return t.numberToHex(e,8)},UInt16:function(e){return t.numberToHex(e>>8&255|(255&e)<<8,16)},UInt32:function(e){return t.numberToHex((255&e)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>24&255,32)},Object:function(t,e){return n(e,t)},Serializable:function(t,e){return t.tlvSerialize(e)},String:function(e,n){return t.asciiToHex(e)},HexBinary:function(t,e){return t},Struct:function(t){return function(e,n){var r=[];return Object.keys(t).forEach((function(o){if(o in e){var i=e[o],s=t[o];r.push(s(i,n))}})),r.join("")}}},t.tlvEncodeHex=n}(t.util||(t.util={}))}(t.sdk||(t.sdk={}))}(t.mobile||(t.mobile={}))}(t.ts||(t.ts={}))}(Z||(Z={}));var tt=com.ts.mobile.sdk.createSdk(),et=new z;tt.setTarsusHost(et),tt.setTransportProvider(new s(et)),tt.setEnabledCollectors([com.ts.mobile.sdk.CollectorType.DeviceDetails,com.ts.mobile.sdk.CollectorType.LargeData,com.ts.mobile.sdk.CollectorType.Capabilities]),tt.setEnabledCollectorsForAnonymousJourneys([com.ts.mobile.sdk.CollectorType.DeviceDetails,com.ts.mobile.sdk.CollectorType.Capabilities]),tt.setLogLevel(com.ts.mobile.sdk.LogLevel.Error),window.xmui&&tt.setUiHandler(new window.xmui.XmUIHandler),t.XmSdk=function(){return tt},Object.defineProperty(t,"__esModule",{value:!0})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.