Interfaces=function(){var u=function(d,g){this.type=d;if(this.options=g)this.options.include&&(this.options.include=[].concat(this.options.include)),this.options.exclude&&(this.options.exclude=[].concat(this.options.exclude))},b=function(d,g){g=[].concat(g);for(i=0;i<g.length;++i)for(j=0;j<d.length;++j)if(d[j]===g[i])return!0;return!1};u.prototype.requiredBy=function(d){if(d&&this.options){if(this.options.include)return b(this.options.include,d);if(this.options.exclude)return!b(this.options.include,
d)}return!0};u.prototype.isSyncronized=function(){return this.options&&!0===this.options.sync};u.prototype.isSyncronousFunction=function(){return this.type===Interfaces.TYPE_SYNC_FUNCTION};u.prototype.isFunction=function(){return this.type===Interfaces.TYPE_FUNCTION||this.type===Interfaces.TYPE_SYNC_FUNCTION};u.prototype.isConstructor=function(){return this.type===Interfaces.TYPE_CONSTRUCTOR};u.prototype.isPrimitive=function(){return!this.isFunction()&&!this.isConstructor()};u.prototype.shouldSendIndirect=
function(){return this.isPrimitive()?this.options&&"undefined"!==typeof this.options.sendIndirect?this.options.sendIndirect:!0:this.options&&!0===this.options.sendIndirect};u.prototype.allowWrite=function(){return this.options&&!0===this.options.write};u.prototype.addIncludes=function(d){this.options=this.options||{};this.options.include=this.options.include.concat(d)};var c=function(){var d=function(e,f,h){return function(l){var n=f[l];if(n&&n.options&&n.options.sourceFunction&&!1!==h.direct)return n.options.sourceFunction();
if(f.hasOwnProperty(l))return e[l];throw l+" is not defined in the interface.";}},g=function(e,f,h,l){var n=function(q,k,r){if(!q.allowWrite())throw h.concat(k)+" is not writeable.";if(q&&typeof r===q.type)e[k]=r;else throw k+" is not defined in the interface.";};return l.direct?function(q,k){n(f[q],q,k)}:function(q,k){var r=f[q];n(r,q,k);r.shouldSendIndirect()&&l.requestFunction({cmd:"LPData.setValue",args:[h.concat(q),k]})}},p=function(e,f,h,l){return function(){var n=arguments;if(l.cloneObjects&&
!e.isSyncronousFunction()){var q=function(r){return"function"===typeof r?function(){var t=k(Array.from(arguments));r.apply(null,t)}:r},k=function(r){if(!r)return null;if(Array.isArray(r)){var t=[];r.forEach(function(w){"object"===typeof w?t.push(k(w)):t.push(q(w))})}else t={},Object.keys(r).forEach(function(w){t[w]=r[w]&&"object"===typeof r[w]?k(r[w]):q(r[w])});return q(t)};n=Array.prototype.map.call(n,function(r){return"object"===typeof r?k(r):q(r)})}return h.apply(f,n)}},a=function(e,f,h){if("function"===
typeof h.requestFunction)return function(){for(var l=[],n=0,q=arguments.length;n<q;++n)l.push(arguments[n]);return h.requestFunction({cmd:0<e.length?e.concat(f):f,args:l})};throw"requestFunction must be specified for this interface since it is not direct access.";},x=function(e,f,h){return function(){"function"===typeof f&&f.apply(e,arguments);"function"===typeof h&&h.apply(e,arguments)}},v=function(e,f,h,l,n,q){var k=!1,r=[],t;for(t in l){var w=l[t];w instanceof u?w.isFunction()?!w.requiredBy(q.context)||
w.isSyncronousFunction()&&q.asyncOnly||(q.direct||w.isSyncronousFunction()?f&&"function"===typeof f[t]?(e[t]=p(w,f,f[t],q),!q.direct&&w.shouldSendIndirect()&&(e[t]=x(e,e[t],a(n,t,q)))):r.push(w.type+": "+n.concat(t).join(".")):e[t]=a(n,t,q)):w.isConstructor()?w.requiredBy(q.context)&&!q.asyncOnly&&(f&&"function"===typeof f[t]?e[t]=f[t]:r.push(w.type+": "+n.concat(t).join("."))):k=!0:(e.hasOwnProperty(t)||(e[t]={}),v(e[t],f?f[t]:f,h?h[t]:h,l[t],n.concat(t),q))}k&&(e.get=d(h,l,q),e.set=g(h,l,n,q));
if(0<r.length&&q.checkMissing)throw"Background instance does not support the following:\n"+r.join("\n");return e};return function(e,f){return v(f.instance||{},f.source||f.sourceFunctions,f.source||f.sourceData,e,[],f)}}(),m=function(){var d={},g={},p=function(a,x,v,e){var f=[],h;for(h in a){var l=e?e.concat(h):[h],n=a[h];n instanceof u?n.isPrimitive()&&n.requiredBy(x)&&(!v||n.isSyncronized())&&f.push({sourceFunction:n.options&&n.options.sourceFunction,path:l}):f=f.concat(p(n,x,v,l))}return f};return function(a,
x){var v=[];a=[].concat(a);for(var e=0;e<a.length;++e){var f=a[e];if(x.syncronizedOnly){var h=g[f];"undefined"===typeof h&&(h=g[f]=p(x.interface,f,!0))}else h=d[f],"undefined"===typeof h&&(h=d[f]=p(x.interface,f,!1));v=v.concat(h)}return v}}();return{TYPE_CONSTRUCTOR:"contsructor",TYPE_SYNC_FUNCTION:"synchronous function",TYPE_FUNCTION:"function",TYPE_STRING:"string",TYPE_BOOLEAN:"boolean",TYPE_NUMBER:"number",TYPE_OBJECT:"object",Definition:u,extend:function(d,g){for(var p in g){var a=g[p];switch(typeof a){case "object":d.hasOwnProperty(p)?
Interfaces.extend(d[p],a):d[p]=a;break;default:d[p]=a}}},createInstance:c,getPrimitives:function(d){var g={};if(d.context)for(var p=m(d.context,d),a=0,x=p.length;a<x;++a){var v=p[a];var e=v.sourceFunction?"function"===typeof v.sourceFunction?v.sourceFunction():LPReflection.callFunction(null,v.sourceFunction,[],{context:d.source}):LPReflection.getValue(d.interface,v.path,{context:d.source});LPReflection.setValue(null,v.path,e,{context:g})}return g},clearPrimitives:function(d){if(d.context)for(var g=
m(d.context,d),p=0;p<g.length;++p)LPReflection.setValue(null,g[p].path,null,{context:d.source})},getName:function(d){for(var g in this)if(d===this[g])return g;throw Error("Could not find interface name.");}}}();Interfaces.BackgroundInterface=function(u){var b=u.TYPE_FUNCTION,c=u.TYPE_SYNC_FUNCTION,m=u.TYPE_STRING,d=u.TYPE_BOOLEAN,g=u.TYPE_OBJECT,p=u.TYPE_NUMBER,a=u.Definition;return{base_url:new a(m),FILENAME_FRAGMENT_VALID:new a(p,{include:["vault","note"]}),g_bigicons:new a(g,{include:["vault","extensionDropdown","vaultItemSelect"],sendIndirect:!1,write:!0}),g_icons:new a(g,{include:["vault","extensionDropdown","vaultItemSelect"]}),g_applications:new a(g,{include:["vault","extensionDropdown","application"],
sourceFunction:function(){return"undefined"!==typeof g_applications?g_applications:reduxApp.getNativeAppPasswords()}}),g_emer_sharees:new a(g,{include:"vault"}),g_emer_sharers:new a(g,{include:"vault"}),g_formfills:new a(g,{include:["vault","extensionDropdown","formFill","chooseProfile","preferences"]}),g_genpws:new a(g,{include:["vault","extensionDropdown"],write:!0}),g_pwdeckey_orig:new a(m,{include:"vault"}),g_identities:new a(g,{include:["vault","extensionDropdown"]}),g_identity:new a(m,{include:["vault",
"extensionDropdown"],sync:!0}),g_is_company_subscription_expired:new a(d,{sync:!0}),g_show_billing_address_notification:new a(d,{sync:!0,sourceFunction:function(){return"undefined"!==typeof reduxApp?reduxApp.getState().user.showBillingAddressNotification:"undefined"!==typeof g_show_billing_address_notification&&g_show_billing_address_notification}}),g_token:new a(m),g_is_premium_as_a_perk:new a(d,{sync:!0}),g_is_restricted:new a(d),g_primary_device_switches_left:new a(p),g_is_company_owner:new a(d),
g_display_premium_retrial_offer:new a(d),g_infield_multidevice_paywall_tracking:new a(d,{sourceFunction:function(){return"undefined"!==typeof LPContentScriptFeatures?LPContentScriptFeatures.g_infield_multidevice_paywall_tracking:reduxApp.getState().settings.features.infield_multidevice_paywall_tracking}}),g_local_key:new a(m),g_pendings:new a(g,{include:"vault"}),gRecovery:new a(m),g_is_premium_trial:new a(g),g_product_price:new a(p),g_local_currency:new a(m),g_premium_trial_exp_days:new a(p),g_hasplugin:new a(d),
g_2fa_inprocess:new a(d,{include:"vault"}),g_is_families_trial_started:new a(p,{sync:!0}),g_predates_families:new a(p,{sync:!0}),g_seen_vault_post_families:new a(p,{sync:!0}),g_prompts:new a(g),g_securenotes:new a(g,{include:["vault","extensionDropdown","note","vaultItemSelect"]}),g_shares:new a(g),g_sites:new a(g,{include:"vault extensionDropdown site note formFill contentScriptSite".split(" ")}),g_pending_shares:new a(g,{include:["vault"]}),g_language:new a(m),g_uid:new a(p),g_username:new a(m),
g_username_hash:new a(m,{include:"vault"}),g_new_settings_enabled:new a(d,{include:"vault",sourceFunction:function(){return"undefined"!==typeof LPContentScriptFeatures?LPContentScriptFeatures.g_new_settings_enabled:reduxApp.getState().user.newSettingsEnabled}}),g_nofolder_feature_enabled:new a(d,{include:"vault preferences extensionDropdown contentScript siteDialog site note formFill contentScriptSite".split(" "),sourceFunction:function(){return"undefined"!==typeof reduxApp?reduxApp.getState().settings.features.no_auto_folder:
"undefined"!==typeof g_nofolder_feature_enabled&&g_nofolder_feature_enabled}}),g_basicauth_feature_enabled:new a(d,{include:"vault preferences extensionDropdown contentScript siteDialog site note formFill contentScriptSite".split(" "),sourceFunction:function(){return"undefined"!==typeof reduxApp?reduxApp.getState().settings.features.basic_auth:"undefined"!==typeof g_basicauth_feature_enabled&&g_basicauth_feature_enabled}}),g_family_shared_folders_enabled:new a(d,{include:"vault"}),lp_attaches:new a(g,
{include:["vault","note"],sourceFunction:function(){return"undefined"!==typeof lp_attaches?lp_attaches:reduxApp.getState().encryptedVaultDataSource.attachments}}),lploggedin:new a(d,{sync:!0}),loginFinished:new a(d,{sync:!0}),onlineLoginFinished:new a(d,{sync:!0}),lpversion:new a(m,{include:"vault"}),siteCats:new a(g,{include:["vault","site"]}),performanceData:new a(g,{include:"vault"}),LPContentScriptFeatures:new a(g,{sourceFunction:function(){if("undefined"!==typeof LPContentScriptFeatures)return LPContentScriptFeatures;
var x=reduxApp.getFeatureFlags();"function"===typeof isDogfood&&(x.isDogfood=isDogfood());return x}}),g_bigsquareicons:new a(g,{include:["vault"]}),g_isie:new a(d),g_isedge:new a(d,{include:["note","extensionDropdown","contentScript"]}),RecordTypeConfig:new a(g,{include:["vault","note","site","addItem","extensionDropdown"]}),addeditformfill:new a(b),addEmptyGroup:new a(b),addEmptyGroups:new a(b),LPServer:{ajax:new a(b),xmlRequest:new a(b),textRequest:new a(b),jsonRequest:new a(b)},LPRavenTransport:new a(b),
BackgroundServer:{emergencyAccess:{acceptOffer:new a(b),addRecipient:new a(b),declineOffer:new a(b),denyAccess:new a(b),getRecipientInfo:new a(b),getSharerInfo:new a(b),removeRecipient:new a(b),requestAccess:new a(b),unlinkAccount:new a(b),updateRecipient:new a(b),resendInvitation:new a(b),updateShareeKey:new a(b)},identities:{add:new a(b),remove:new a(b),update:new a(b)},vault:{history:{revertPasswordChange:new a(b),getPasswordHistory:new a(b),getUsernameHistory:new a(b),getNoteHistory:new a(b)}},
sharing:{individual:{shareItems:new a(b),unshareItem:new a(b),acceptShare:new a(b),rejectShare:new a(b),inviteFriends:new a(b),getSentShareData:new a(b),getReceivedShareData:new a(b)},folder:{getFolders:new a(b),getPublicKeys:new a(b),create:new a(b),rename:new a(b),remove:new a(b),accept:new a(b),reject:new a(b),addMembers:new a(b),getMembers:new a(b),removeMember:new a(b),reinviteMember:new a(b),updateMemberPermissions:new a(b),getRestrictions:new a(b),updateRestrictions:new a(b),startDownloading:new a(b),
stopDownloading:new a(b),restoreDeleted:new a(b),purgeDeleted:new a(b),convertToEnterprise:new a(b),convertToLegacy:new a(b)}},sitesAndNotes:{saveCustomNoteTemplate:new a(b),deleteCustomNoteTemplate:new a(b)},transact:{sendReminder:new a(b),sendMobileDownload:new a(b)},families:{getMembers:new a(b),existingUserTrial:new a(b),getInvitations:new a(b)},licensing:{getCompanyLicensing:new a(b),isCompanyExpired:new a(b),setCompanyExpired:new a(b)},invitation:{acceptInvitation:new a(b),dismissInvitation:new a(b),
getMembers:new a(b)},aurora:{getOneClickSignupUrls:new a(b)}},proxyLegacyGlobals:new a(b),changePassword:new a(b),deleteAid:new a(b),deleteformfill:new a(b),deleteGroup:new a(b),editAid:new a(b),fastEncryptAttachments:new a(b),generate_key:new a(b),get_securityChallengeScore:new a(b),gotourl:new a(b),launch:new a(b),launchApp:new a(b),loggedOut:new a(b),loglogin:new a(b),make_lp_hash_iterations:new a(b),make_lp_key_hash:new a(b),make_lp_key_iterations:new a(b),moveIntoSharedFolder:new a(b),moveSelectedToGroup:new a(b),
openAllSites:new a(b),openexport:new a(b),openentconsole:new a(b),openOnNewTab:new a(b),openFamilyConsole:new a(b),openPremiumPaymentPage:new a(b),openEnterprisePaymentPage:new a(b),openTeamsPaymentPage:new a(b),openFamiliesPaymentPage:new a(b),openPricingPage:new a(b),openfavorites:new a(b),openimport:new a(b),openseccheck:new a(b),openURL:new a(b),uploadSharingKeysWeb:new a(b),processCS:new a(b),storeAccountLinkToken:new a(b),setPasswordlessData:new a(b),removePasswordlessData:new a(b),startPasswordlessEnrollmentSetup:new a(b),
removeAccountLinkToken:new a(b),refreshGroupNames:new a(b),refreshsites:new a(b),renameGroup:new a(b),saveFields:new a(b),saveSite:new a(b),singlefactor_reprompt:new a(b),switch_identity:new a(b),unlock_plug2web:new a(b),request_native_messaging:new a(b),singlefactorWinbioSet:new a(b),AES:{bin2hex:new a(c),Decrypt:new a(c),Encrypt:new a(c),hex2bin:new a(c),hex2url:new a(c),url2hex:new a(c)},ab2bin:new a(c),bin2ab:new a(c),reorderOnURL:new a(c),can_copy_to_clipboard:new a(c),canLaunchApplication:new a(c),
check_filename_badchars:new a(c),crypto_btoa:new a(c),db_prepend:new a(c),dec:new a(c),enc:new a(c),enccbc:new a(c),encode_private_key:new a(c),encode_public_key:new a(c),fix_username:new a(c),get_last_reprompt_time:new a(c),get_mimetype_from_filename:new a(c),get_personal_linked:new a(c),get_personal_linked_needs_verification:new a(c),get_show_expired_subscription_messaging:new a(c),isAllowedFileExtension:new a(c),getAllowedFileExtensions:new a(c),getInvalidFileExtensionMessageStrings:new a(c),removeLinkedAccount:new a(c),
get_random_password:new a(c),getbigicon:new a(c),geticonurlfromrecord:new a(c),gs:new a(c),isOffline:new a(c),localStorage_getItem:new a(c),localStorage_setItem:new a(c),lp_gettld_url:new a(c),lpCreatePass:new a(c),lpdec:new a(c),lpenc:new a(c),lpevent:new a(c),lpmdec:new a(c),lpmenc:new a(c),parse_public_key:new a(c),parse_private_key:new a(c),parsemobile:new a(c),punycode:{URLToASCII:new a(c),URLToUnicode:new a(c)},RSAKey:new a(u.TYPE_CONSTRUCTOR),set_last_reprompt_time:new a(c),SHA256:new a(c),
hostof:new a(c),StringUtils:{translate:new a(c)},Preferences:{get:new a(c),set:new a(c,{sendIndirect:!0})},rsa_encrypt_privatekey:new a(b),sendLpImprove:new a(b),sendLpImproveCallback:new a(b),Provisioning:{provisioning:{checkUserState:new a(b,{include:"provisioning"}),sendApiCalls:new a(b,{include:"provisioning"}),getLocalKey:new a(b,{include:"provisioning"})}},ExtensionPreferences:{getConst:new a(b),getDefault:new a(b),read:new a(b),write:new a(b),getUnavailablePreferences:new a(b)},LPPlatform:{getUILanguage:new a(c),
fill:new a(b),downloadAttachment:new a(b),copyToClipboard:new a(c),setProductPriceUpdatesObserver:new a(b),isSafariAppStore:new a(b)},get_method_async:new a(b),MigrationBackground:{getShouldStartMigration:new a(b),setShouldStartMigration:new a(b),getBlobVersion:new a(b),getIdentities:new a(b),getLinkedUsername:new a(b),getLinkedBlobVersion:new a(b),subscribeToState:new a(b),subscribeToStateOnce:new a(b),wasMigration:new a(b),publishState:new a(b),saveBlobVersion:new a(b),saveLinkedBlobVersion:new a(b),
sendSegmentEvent:new a(b),shouldShowMigrationNotification:new a(c),hasFormFills:new a(b),postponeMigration:new a(b),setMigrationState:new a(b)},FormfillMigrationBackground:{isEnabled:new a(b),getFormfills:new a(b),getLinkedFormfills:new a(b),createCustomNoteType:new a(b),saveNote:new a(b)},Feature:{isEnabled:new a(b)},Policies:{logNameEnabled:new a(b,{include:"vault preferences extensionDropdown contentScript siteDialog site note formFill contentScriptSite".split(" "),appendAdditionalArguments:!0}),
logUserNameEnabled:new a(b,{include:"vault preferences extensionDropdown contentScript siteDialog site note formFill contentScriptSite".split(" "),appendAdditionalArguments:!0}),logUrlEnabled:new a(b,{include:"vault preferences extensionDropdown contentScript siteDialog site note formFill contentScriptSite".split(" "),appendAdditionalArguments:!0}),getSaveSiteToPersonal:new a(b,{include:"vault preferences extensionDropdown contentScript siteDialog site note formFill contentScriptSite".split(" "),
appendAdditionalArguments:!0}),getAccountSelectionBasedOnEmail:new a(b,{include:"vault preferences extensionDropdown contentScript siteDialog site note formFill contentScriptSite".split(" "),appendAdditionalArguments:!0}),showSecureNotes:new a(b,{include:"vault preferences extensionDropdown contentScript siteDialog site note formFill contentScriptSite".split(" "),appendAdditionalArguments:!0})},FederatedLogin:{isFederated:new a(b,{include:"login acctsiframe update_phone misc_challenge enterprise_options delete_account otp misc_login enterprise_users export".split(" ")}),
getPassword:new a(b,{include:"acctsiframe update_phone misc_challenge enterprise_options delete_account otp misc_login enterprise_users export".split(" ")})},getVersion:new a(b),LPPartner:{getPartnerInfo:new a(b)},onSettingsIframeClose:new a(b,{include:["vault"],appendAdditionalArguments:!0}),closeSettingsIframe:new a(b,{include:["acctsiframe","contentScript","vault"],appendAdditionalArguments:!0}),GenPassHistory:{add:new a(b),clear:new a(b),getWithDate:new a(b),getWithReadableDate:new a(b),getWithoutDate:new a(b)},
FieldOverrides:{getAll:new a(b),getSite:new a(b)},switchLanguage:new a(b),saveUserLanguage:new a(b),setRestriction:new a(b),setLanguageNotificationDismissal:new a(b),setPrimaryDevice:new a(b),setDisplayRetrialOffer:new a(b),getRetrialOfferDeepLinkEnabled:new a(b),hideBillingAddressNotification:new a(b),Recovery:{getOtpHash:new a(b)},g_pendo_jwt_token:new a(m),g_pendo_signing_key_name:new a(m),calculatePasswordStrength:new a(b)}}(Interfaces);LPBackgroundRequester=function(u){return function(b,c){c=c||{};var m=this,d=null,g=!1,p=[],a,x=c.interfaceDefinition,v=Date.now(),e=function(k,r){LPMessaging.handleRequest(x,k,function(t){f({type:"contentScriptResponse",data:t,frameID:r})},{context:c.reflectionContext,additionalArguments:r})},f=function(k){k.sourceFrameID=d;LPMessaging.makeRequest(a,k,function(r){f({type:"contentScriptResponse",data:r,frameID:k.frameID||0})})},h=function(k){var r=c.reflectionContext||window;if("undefined"!==typeof LPPlatform&&
LPPlatform.onLoad)LPPlatform.onLoad(r,k);else"loading"===r.document.readyState?r.addEventListener("DOMContentLoaded",k):k()},l=function(){return function(k){if(k.frameID===d)switch(k.type){case "backgroundResponse":case "contentScriptResponse":LPMessaging.handleResponse(k.data);break;case "contentScriptRequest":e(k.data,k.sourceFrameID)}else if("initialization"===k.type&&(k=k.data,null===d&&k.request.initializationID===v)){"undefined"!==typeof Topics&&Topics.get(Topics.REQUEST_FRAMEWORK_INITIALIZED).publish(k,
m);d=k.frameID;g=!1;a({type:"initialized",sourceFrameID:d});k=0;for(var r=p.length;k<r;++k)p[k]()}}}(),n=function(k){h(function(){a({type:"initialize",data:{initializationID:v,interfaceName:c.interfaceName,top:c.mainRequestFramework,url:u.location.href,childFrameCount:document.getElementsByTagName("iframe").length,frameIdentity:k}})})};this.initialize=function(k){null!==d||g||(a=b(l,q),c.frameIdentityManager?c.frameIdentityManager.getFrameIdentity(n):n(),g=!0);k&&p.push(k)};this.sendRequest=function(k){null===
d?this.initialize(function(){f(k)}):f(k)};var q=function(){d=null;p=[]}}}(this);LPReflection=function(u){var b=function(c,m,d){d=d||u;"string"===typeof m&&(m=m.split("."));for(var g=0,p=m.length;g<p;++g){var a=m[g];if(c)if(c.hasOwnProperty(a))c=c[a];else throw"Cannot access "+m.join(".")+". Not defined on the interface.";g<p-1&&(d=d[a])}return{parent:d,property:m[m.length-1],definition:c}};return{callFunction:function(c,m,d,g){var p=b(c,m,g&&g.context),a=p.parent[p.property];if(g&&g.additionalArguments&&p.definition.options&&p.definition.options.appendAdditionalArguments){c=
[].concat(g.additionalArguments);c=a.length-d.length-c.length;for(m=0;m<c;++m)d.push(void 0);d=d.concat(g.additionalArguments)}if(p.definition&&p.definition.before)p.definition.before.apply(p.definition,d.concat(function(){a.apply(p.parent,d)}));else return a.apply(p.parent,d)},setValue:function(c,m,d,g){c=b(c,m,g&&g.context);if(!c.definition||c.definition.allowWrite())c.parent[c.property]=d;else throw("string"===typeof m?m:m.join("."))+" is not writeable.";},getValue:function(c,m,d){c=b(c,m,d&&d.context);
return c.parent[c.property]}}}(this);LPMessaging=function(u){var b=0,c={},m=0,d=function(e){var f={},h=!1,l;for(l in e)if(e.hasOwnProperty(l)){var n=e[l];switch(typeof n){case "function":h=h||!0;f[l]=n.length;break;case "object":f[l]=d(n),h=h||null!==f[l]}}return h?f:null},g=function(e){var f={},h;for(h in e)if(e.hasOwnProperty(h)){var l=e[h];switch(typeof l){case "function":f[h]=l;delete e[h];break;case "object":f[h]=g(l)}}return f},p=function(e){var f="[object Array]"===Object.prototype.toString.call(e)?[]:{};a:{if(e&&"object"===typeof e)switch(Object.prototype.toString.call(e)){case "[object Element]":var h=
!0;break a;case "[object Object]":h=null!==Object.getPrototypeOf(Object.getPrototypeOf(e));break a}h=!1}if(!h)for(var l in e)e.hasOwnProperty(l)&&(h=e[l],f[l]=h&&"object"===typeof h?p(h):h);return f},a=function(e,f){e.args=p(e.args);var h=d(e.args);if(h){var l=++m;c[l]={functions:g(e.args),sender:f};e.requestID=l;e.functions=h}},x=function(e,f,h,l){var n=function(){for(var q={responseRequestID:f.requestID,callbackPath:h},k=[],r=0,t=arguments.length;r<t;++r)k.push(arguments[r]);q.args=k;a(q,e);e(q)};
switch(l){case 1:return function(q){n.apply(this,arguments)};case 2:return function(q,k){n.apply(this,arguments)};case 3:return function(q,k,r){n.apply(this,arguments)};case 4:return function(q,k,r,t){n.apply(this,arguments)};case 5:return function(q,k,r,t,w){n.apply(this,arguments)};default:return function(){n.apply(this,arguments)}}},v=function(e,f,h,l,n){n=n||[];for(var q in h){var k=h[q];switch(typeof k){case "object":v(e,f[q],k,l,n.concat(q));break;default:f[q]=x(e,l,n.concat(q),k)}}};return{handleRequest:function(e,
f,h,l){var n=f.args;v(h,n,f.functions,f);LPReflection.callFunction(e,f.cmd,n,l)},makeRequest:function(e,f,h){a(f.data,h);return e(f)},handleResponse:function(e){var f=c[e.responseRequestID].functions,h=c[e.responseRequestID].sender;delete c[e.responseRequestID];for(var l=0,n=e.callbackPath.length;l<n;++l)f=f[e.callbackPath[l]];l=e.args;v(h,l,e.functions,e);f.apply(u,l)},getNewMessageSourceID:function(e){return++b}}}(this);var ExtensionConnector=function(){return function(u,b){var c=function(m,d){switch(m.data.type){case "backgroundResponse":case "initialization":d(m.data)}};b&&b!==window?(this.send=function(m){LastpassApiHelper.postSafeMessage(b,m)},this.listen=function(m){var d=window;null!==parent.document.documentElement.getAttribute("data-extension-enabled")&&location.pathname.includes("background-spa")&&(d=b);LastpassApiHelper.addSafeMessageHandler(d,function(g){c(g,m)})}):(this.send=function(m){window.postMessage(m,
window.location.origin)},this.listen=function(m){window.addEventListener("message",function(d){d.source===window&&c(d,m)})})}}();function createExtensionInterface(u,b){var c=null,m=location.pathname.includes("background-spa");null!==document.documentElement.getAttribute("lastpass-extension")?b=window:null!==parent.document.documentElement.getAttribute("data-extension-enabled")&&m&&(b=parent);if(b){var d=new ExtensionConnector(u,b),g=new LPBackgroundRequester(function(p){d.listen(p);return function(a){d.send(a)}});c=Interfaces.createInstance(Interfaces.BackgroundInterface,{direct:!1,context:u.context,asyncOnly:!0,requestFunction:function(p){g.sendRequest({type:"backgroundRequest",
data:p})}})}b===window||b===parent&&m||!c?window.ext=c:(window.ext=null,c.getVersion(function(p){window.ext=c}))};
//# sourceMappingURL=extensionconnector.js.map