/******/ (function() { // webpackBootstrap /******/ "use strict"; // UNUSED EXPORTS: appendHeaderMessageToTitle, getConfirmationHeaderMessage, getNotificationHeaderMessage, getNotificationTestId ;// ../../node_modules/@lit/reactive-element/css-tag.js /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const css_tag_t=globalThis,e=css_tag_t.ShadowRoot&&(void 0===css_tag_t.ShadyCSS||css_tag_t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap();class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet()).replaceSync(this.cssText),e&&o.set(s,t));}return t;}toString(){return this.cssText;}}const r=t=>new n("string"==typeof t?t:t+"",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");})(s)+t[o+1],t[0]);return new n(o,t,s);},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=css_tag_t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e);})(t):t; ;// ../../node_modules/@lit/reactive-element/reactive-element.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const{is:reactive_element_i,defineProperty:reactive_element_e,getOwnPropertyDescriptor:h,getOwnPropertyNames:reactive_element_r,getOwnPropertySymbols:reactive_element_o,getPrototypeOf:reactive_element_n}=Object,a=globalThis,reactive_element_c=a.trustedTypes,l=reactive_element_c?reactive_element_c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t;},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i;}},f=(t,s)=>!reactive_element_i(t,s),b={attribute:!0,type:String,converter:u,reflect:!1,useDefault:!1,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap();class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()];}static createProperty(t,s=b){if(s.state&&(s.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=!0),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&reactive_element_e(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h(this.prototype,t)??{get(){return this[s];},set(t){this[s]=t;}};return{get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:!0,enumerable:!0};}static getPropertyOptions(t){return this.elementProperties.get(t)??b;}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=reactive_element_n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...reactive_element_r(t),...reactive_element_o(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map();for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c(s));}else void 0!==s&&i.push(c(s));return i;}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0;}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map(),this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this));}addController(t){(this._$EO??=new Set()).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map(),s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t;}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);}!1===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map()).has(t)&&(this._$Ej.set(t,r??s??this[t]),!0!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),!0===e&&this._$Em!==t&&(this._$Eq??=new Set()).add(t));}async _$EP(){this.isUpdatePending=!0;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&(await t),!this.isUpdatePending;}scheduleUpdate(){return this.performUpdate();}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];!0!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM();}catch(s){throw t=!1,this._$EM(),s;}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map(),this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete();}getUpdateComplete(){return this._$ES;}shouldUpdate(t){return!0;}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}}y.elementStyles=[],y.shadowRootOptions={mode:"open"},y[d("elementProperties")]=new Map(),y[d("finalized")]=new Map(),p?.({ReactiveElement:y}),(a.reactiveElementVersions??=[]).push("2.1.0"); ;// ../../node_modules/lit-html/lit-html.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const lit_html_t=globalThis,lit_html_i=lit_html_t.trustedTypes,lit_html_s=lit_html_i?lit_html_i.createPolicy("lit-html",{createHTML:t=>t}):void 0,lit_html_e="$lit$",lit_html_h=`lit$${Math.random().toFixed(9).slice(2)}$`,lit_html_o="?"+lit_html_h,lit_html_n=`<${lit_html_o}>`,lit_html_r=document,lit_html_l=()=>lit_html_r.createComment(""),lit_html_c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,lit_html_a=Array.isArray,lit_html_u=t=>lit_html_a(t)||"function"==typeof t?.[Symbol.iterator],lit_html_d="[ \t\n\f\r]",lit_html_f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${lit_html_d}(?:([^\\s"'>=/]+)(${lit_html_d}*=${lit_html_d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),lit_html_p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,lit_html_y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=lit_html_y(1),lit_html_b=lit_html_y(2),w=lit_html_y(3),T=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap(),C=lit_html_r.createTreeWalker(lit_html_r,129);function P(t,i){if(!lit_html_a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==lit_html_s?lit_html_s.createHTML(i):i;}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"":3===i?"":"",c=lit_html_f;for(let i=0;i"===u[0]?(c=r??lit_html_f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:lit_html_p):c===g||c===lit_html_p?c=m:c===v||c===_?c=lit_html_f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===lit_html_f?s+lit_html_n:d>=0?(o.push(a),s.slice(0,d)+lit_html_e+s.slice(d)+lit_html_h+x):s+lit_html_h+(-2===d?i:x);}return[P(t,l+(t[s]||"")+(2===i?"":3===i?"":"")),o];};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length0){r.textContent=lit_html_i?lit_html_i.emptyScript:"";for(let i=0;i2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String()),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=lit_html_S(this,t,i,0),o=!lit_html_c(t)||t!==this._$AH&&t!==T,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R(i.insertBefore(lit_html_l(),t),t,void 0,s??{});}return h._$AI(t),h;}; ;// ../../node_modules/lit-element/lit-element.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const lit_element_s=globalThis;class lit_element_i extends y{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t;}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return T;}}lit_element_i._$litElement$=!0,lit_element_i["finalized"]=!0,lit_element_s.litElementHydrateSupport?.({LitElement:lit_element_i});const lit_element_o=lit_element_s.litElementPolyfillSupport;lit_element_o?.({LitElement:lit_element_i});const lit_element_n={_$AK:(t,e,r)=>{t._$AK(e,r);},_$AL:t=>t._$AL};(lit_element_s.litElementVersions??=[]).push("4.2.0"); ;// ../../node_modules/lit/index.js ;// ../../libs/common/src/platform/enums/encryption-type.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var EncryptionType; (function (EncryptionType) { // Symmetric encryption types EncryptionType[EncryptionType["AesCbc256_B64"] = 0] = "AesCbc256_B64"; // Type 1 was the unused and removed AesCbc128_HmacSha256_B64 EncryptionType[EncryptionType["AesCbc256_HmacSha256_B64"] = 2] = "AesCbc256_HmacSha256_B64"; // Cose is the encoding for the key used, but contained can be: // - XChaCha20Poly1305 EncryptionType[EncryptionType["CoseEncrypt0"] = 7] = "CoseEncrypt0"; // Asymmetric encryption types. These never occur in the same places that the symmetric ones would // and can be split out into a separate enum. EncryptionType[EncryptionType["Rsa2048_OaepSha256_B64"] = 3] = "Rsa2048_OaepSha256_B64"; EncryptionType[EncryptionType["Rsa2048_OaepSha1_B64"] = 4] = "Rsa2048_OaepSha1_B64"; EncryptionType[EncryptionType["Rsa2048_OaepSha256_HmacSha256_B64"] = 5] = "Rsa2048_OaepSha256_HmacSha256_B64"; EncryptionType[EncryptionType["Rsa2048_OaepSha1_HmacSha256_B64"] = 6] = "Rsa2048_OaepSha1_HmacSha256_B64"; })(EncryptionType || (EncryptionType = {})); function encryptionTypeToString(encryptionType) { if (encryptionType in EncryptionType) { return EncryptionType[encryptionType]; } else { return "Unknown encryption type " + encryptionType; } } /** The expected number of parts to a serialized EncString of the given encryption type. * For example, an EncString of type AesCbc256_B64 will have 2 parts * * Example of annotated serialized EncStrings: * 0.iv|data * 2.iv|data|mac * 3.data * 4.data * * @see EncString * @see EncryptionType * @see EncString.parseEncryptedString */ const EXPECTED_NUM_PARTS_BY_ENCRYPTION_TYPE = { [EncryptionType.AesCbc256_B64]: 2, [EncryptionType.AesCbc256_HmacSha256_B64]: 3, [EncryptionType.Rsa2048_OaepSha256_B64]: 1, [EncryptionType.Rsa2048_OaepSha1_B64]: 1, [EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64]: 2, [EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64]: 2, [EncryptionType.CoseEncrypt0]: 1, }; ;// ../../libs/common/src/platform/enums/file-upload-type.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var FileUploadType; (function (FileUploadType) { FileUploadType[FileUploadType["Direct"] = 0] = "Direct"; FileUploadType[FileUploadType["Azure"] = 1] = "Azure"; })(FileUploadType || (FileUploadType = {})); ;// ../../libs/common/src/platform/enums/hash-purpose.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var HashPurpose; (function (HashPurpose) { HashPurpose[HashPurpose["ServerAuthorization"] = 1] = "ServerAuthorization"; HashPurpose[HashPurpose["LocalAuthorization"] = 2] = "LocalAuthorization"; })(HashPurpose || (HashPurpose = {})); ;// ../../libs/storage-core/src/html-storage-location.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var HtmlStorageLocation; (function (HtmlStorageLocation) { HtmlStorageLocation["Local"] = "local"; HtmlStorageLocation["Memory"] = "memory"; HtmlStorageLocation["Session"] = "session"; })(HtmlStorageLocation || (HtmlStorageLocation = {})); ;// ../../node_modules/tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** *//* global Reflect, Promise, SuppressedError, Symbol, Iterator */var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b;}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p];};return extendStatics(d,b);};function __extends(d,b){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());}var __assign=function(){__assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r;}function __param(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex);};}function __esDecorate(ctor,descriptorIn,decorators,contextIn,initializers,extraInitializers){function accept(f){if(f!==void 0&&typeof f!=="function")throw new TypeError("Function expected");return f;}var kind=contextIn.kind,key=kind==="getter"?"get":kind==="setter"?"set":"value";var target=!descriptorIn&&ctor?contextIn["static"]?ctor:ctor.prototype:null;var descriptor=descriptorIn||(target?Object.getOwnPropertyDescriptor(target,contextIn.name):{});var _,done=false;for(var i=decorators.length-1;i>=0;i--){var context={};for(var p in contextIn)context[p]=p==="access"?{}:contextIn[p];for(var p in contextIn.access)context.access[p]=contextIn.access[p];context.addInitializer=function(f){if(done)throw new TypeError("Cannot add initializers after decoration has completed");extraInitializers.push(accept(f||null));};var result=(0,decorators[i])(kind==="accessor"?{get:descriptor.get,set:descriptor.set}:descriptor[key],context);if(kind==="accessor"){if(result===void 0)continue;if(result===null||typeof result!=="object")throw new TypeError("Object expected");if(_=accept(result.get))descriptor.get=_;if(_=accept(result.set))descriptor.set=_;if(_=accept(result.init))initializers.unshift(_);}else if(_=accept(result)){if(kind==="field")initializers.unshift(_);else descriptor[key]=_;}}if(target)Object.defineProperty(target,contextIn.name,descriptor);done=true;};function __runInitializers(thisArg,initializers,value){var useValue=arguments.length>2;for(var i=0;i0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue;}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]=o.length)o=void 0;return{value:o&&o[i++],done:!o};}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.");}function __read(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-->0)&&!(r=i.next()).done)ar.push(r.value);}catch(error){e={error:error};}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i);}finally{if(e)throw e.error;}}return ar;}/** @deprecated */function __spread(){for(var ar=[],i=0;i1||resume(n,v);});};if(f)i[n]=f(i[n]);}}function resume(n,v){try{step(g[n](v));}catch(e){settle(q[0][3],e);}}function step(r){r.value instanceof __await?Promise.resolve(r.value.v).then(fulfill,reject):settle(q[0][2],r);}function fulfill(value){resume("next",value);}function reject(value){resume("throw",value);}function settle(f,v){if(f(v),q.shift(),q.length)resume(q[0][0],q[0][1]);}}function __asyncDelegator(o){var i,p;return i={},verb("next"),verb("throw",function(e){throw e;}),verb("return"),i[Symbol.iterator]=function(){return this;},i;function verb(n,f){i[n]=o[n]?function(v){return(p=!p)?{value:__await(o[n](v)),done:false}:f?f(v):v;}:f;}}function __asyncValues(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var m=o[Symbol.asyncIterator],i;return m?m.call(o):(o=typeof __values==="function"?__values(o):o[Symbol.iterator](),i={},verb("next"),verb("throw"),verb("return"),i[Symbol.asyncIterator]=function(){return this;},i);function verb(n){i[n]=o[n]&&function(v){return new Promise(function(resolve,reject){v=o[n](v),settle(resolve,reject,v.done,v.value);});};}function settle(resolve,reject,d,v){Promise.resolve(v).then(function(v){resolve({value:v,done:d});},reject);}}function __makeTemplateObject(cooked,raw){if(Object.defineProperty){Object.defineProperty(cooked,"raw",{value:raw});}else{cooked.raw=raw;}return cooked;};var __setModuleDefault=Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:true,value:v});}:function(o,v){o["default"]=v;};var ownKeys=function(o){ownKeys=Object.getOwnPropertyNames||function(o){var ar=[];for(var k in o)if(Object.prototype.hasOwnProperty.call(o,k))ar[ar.length]=k;return ar;};return ownKeys(o);};function __importStar(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k=ownKeys(mod),i=0;i0;},enumerable:false,configurable:true});Subject.prototype._trySubscribe=function(subscriber){this._throwIfClosed();return _super.prototype._trySubscribe.call(this,subscriber);};Subject.prototype._subscribe=function(subscriber){this._throwIfClosed();this._checkFinalizedStatuses(subscriber);return this._innerSubscribe(subscriber);};Subject.prototype._innerSubscribe=function(subscriber){var _this=this;var _a=this,hasError=_a.hasError,isStopped=_a.isStopped,observers=_a.observers;if(hasError||isStopped){return EMPTY_SUBSCRIPTION;}this.currentObservers=null;observers.push(subscriber);return new Subscription(function(){_this.currentObservers=null;arrRemove(observers,subscriber);});};Subject.prototype._checkFinalizedStatuses=function(subscriber){var _a=this,hasError=_a.hasError,thrownError=_a.thrownError,isStopped=_a.isStopped;if(hasError){subscriber.error(thrownError);}else if(isStopped){subscriber.complete();}};Subject.prototype.asObservable=function(){var observable=new Observable();observable.source=this;return observable;};Subject.create=function(destination,source){return new AnonymousSubject(destination,source);};return Subject;}(Observable);var AnonymousSubject=function(_super){__extends(AnonymousSubject,_super);function AnonymousSubject(destination,source){var _this=_super.call(this)||this;_this.destination=destination;_this.source=source;return _this;}AnonymousSubject.prototype.next=function(value){var _a,_b;(_b=(_a=this.destination)===null||_a===void 0?void 0:_a.next)===null||_b===void 0?void 0:_b.call(_a,value);};AnonymousSubject.prototype.error=function(err){var _a,_b;(_b=(_a=this.destination)===null||_a===void 0?void 0:_a.error)===null||_b===void 0?void 0:_b.call(_a,err);};AnonymousSubject.prototype.complete=function(){var _a,_b;(_b=(_a=this.destination)===null||_a===void 0?void 0:_a.complete)===null||_b===void 0?void 0:_b.call(_a);};AnonymousSubject.prototype._subscribe=function(subscriber){var _a,_b;return(_b=(_a=this.source)===null||_a===void 0?void 0:_a.subscribe(subscriber))!==null&&_b!==void 0?_b:EMPTY_SUBSCRIPTION;};return AnonymousSubject;}(Subject); ;// ../../libs/storage-core/src/storage.service.ts class StorageService { } ;// ../../libs/storage-core/src/memory-storage.service.ts var memory_storage_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore class MemoryStorageService extends StorageService { constructor() { super(...arguments); this.store = new Map(); this.updatesSubject = new Subject(); } get valuesRequireDeserialization() { return false; } get updates$() { return this.updatesSubject.asObservable(); } get(key) { if (this.store.has(key)) { const obj = this.store.get(key); return Promise.resolve(obj); } return Promise.resolve(null); } has(key) { return memory_storage_service_awaiter(this, void 0, void 0, function* () { return (yield this.get(key)) != null; }); } save(key, obj) { if (obj == null) { return this.remove(key); } // TODO: Remove once foreground/background contexts are separated in browser // Needed to ensure ownership of all memory by the context running the storage service const toStore = structuredClone(obj); this.store.set(key, toStore); this.updatesSubject.next({ key, updateType: "save" }); return Promise.resolve(); } remove(key) { this.store.delete(key); this.updatesSubject.next({ key, updateType: "remove" }); return Promise.resolve(); } } ;// ../../libs/storage-core/src/serialized-memory-storage.service.ts var serialized_memory_storage_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; // FIXME: Update this file to be type safe and remove this and next line // @ts-strict-ignore class SerializedMemoryStorageService extends StorageService { constructor() { super(...arguments); this.store = {}; this.updatesSubject = new Subject(); } get valuesRequireDeserialization() { return true; } get updates$() { return this.updatesSubject.asObservable(); } get(key) { const json = this.store[key]; if (json) { const obj = JSON.parse(json); return Promise.resolve(obj); } return Promise.resolve(null); } has(key) { return serialized_memory_storage_service_awaiter(this, void 0, void 0, function* () { return (yield this.get(key)) != null; }); } save(key, obj) { if (obj == null) { return this.remove(key); } // TODO: Remove once foreground/background contexts are separated in browser // Needed to ensure ownership of all memory by the context running the storage service this.store[key] = JSON.stringify(obj); this.updatesSubject.next({ key, updateType: "save" }); return Promise.resolve(); } remove(key) { delete this.store[key]; this.updatesSubject.next({ key, updateType: "remove" }); return Promise.resolve(); } } ;// ../../libs/storage-core/src/storage-location.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var StorageLocationEnum; (function (StorageLocationEnum) { StorageLocationEnum["Both"] = "both"; StorageLocationEnum["Disk"] = "disk"; StorageLocationEnum["Memory"] = "memory"; })(StorageLocationEnum || (StorageLocationEnum = {})); ;// ../../libs/storage-core/src/index.ts // Renamed to just "StorageService", to be removed when references are updated ;// ../../libs/common/src/platform/enums/html-storage-location.enum.ts ;// ../../libs/common/src/platform/enums/key-suffix-options.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var KeySuffixOptions; (function (KeySuffixOptions) { KeySuffixOptions["Auto"] = "auto"; KeySuffixOptions["Pin"] = "pin"; })(KeySuffixOptions || (KeySuffixOptions = {})); ;// ../../libs/logging/src/log-level.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var log_level_LogLevel; (function (LogLevel) { LogLevel[LogLevel["Debug"] = 0] = "Debug"; LogLevel[LogLevel["Info"] = 1] = "Info"; LogLevel[LogLevel["Warning"] = 2] = "Warning"; LogLevel[LogLevel["Error"] = 3] = "Error"; })(log_level_LogLevel || (log_level_LogLevel = {})); ;// ../../libs/logging/src/console-log.service.ts class ConsoleLogService { constructor(isDev, filter = null) { this.isDev = isDev; this.filter = filter; this.timersMap = new Map(); } debug(message, ...optionalParams) { if (!this.isDev) { return; } this.write(LogLevel.Debug, message, ...optionalParams); } info(message, ...optionalParams) { this.write(LogLevel.Info, message, ...optionalParams); } warning(message, ...optionalParams) { this.write(LogLevel.Warning, message, ...optionalParams); } error(message, ...optionalParams) { this.write(LogLevel.Error, message, ...optionalParams); } write(level, message, ...optionalParams) { if (this.filter != null && this.filter(level)) { return; } switch (level) { case LogLevel.Debug: // eslint-disable-next-line console.log(message, ...optionalParams); break; case LogLevel.Info: // eslint-disable-next-line console.log(message, ...optionalParams); break; case LogLevel.Warning: // eslint-disable-next-line console.warn(message, ...optionalParams); break; case LogLevel.Error: // eslint-disable-next-line console.error(message, ...optionalParams); break; default: break; } } measure(start, trackGroup, track, name, properties) { const measureName = `[${track}]: ${name}`; const measure = performance.measure(measureName, { start: start, detail: { devtools: { dataType: "track-entry", track, trackGroup, properties, }, }, }); this.info(`${measureName} took ${measure.duration}`, properties); return measure; } mark(name) { const mark = performance.mark(name, { detail: { devtools: { dataType: "marker", }, }, }); this.info(mark.name, new Date().toISOString()); return mark; } } ;// ../../libs/logging/src/index.ts ;// ../../libs/common/src/platform/enums/log-level-type.enum.ts ;// ../../libs/common/src/platform/enums/storage-location.enum.ts ;// ../../libs/common/src/platform/enums/theme-type.enum.ts /** * @deprecated prefer the `ThemeTypes` constants and `Theme` type over unsafe enum types **/ // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var ThemeType; (function (ThemeType) { ThemeType["System"] = "system"; ThemeType["Light"] = "light"; ThemeType["Dark"] = "dark"; })(ThemeType || (ThemeType = {})); const ThemeTypes = { System: "system", Light: "light", Dark: "dark", }; ;// ../../libs/common/src/platform/enums/index.ts ;// ../../node_modules/@emotion/sheet/dist/emotion-sheet.esm.js var isDevelopment=false;/* Based off glamor's StyleSheet, thanks Sunil ❤️ high performance StyleSheet for css-in-js systems - uses multiple style tags behind the scenes for millions of rules - uses `insertRule` for appending in production for *much* faster performance // usage import { StyleSheet } from '@emotion/sheet' let styleSheet = new StyleSheet({ key: '', container: document.head }) styleSheet.insert('#box { border: 1px solid red; }') - appends a css rule into the stylesheet styleSheet.flush() - empties the stylesheet of all its contents */function sheetForTag(tag){if(tag.sheet){return tag.sheet;}// this weirdness brought to you by firefox /* istanbul ignore next */for(var i=0;i0?Utility_charat(characters,--position):0;if(column--,character===10)column=1,line--;return character;}/** * @return {number} */function next(){character=position @ ~ isolate token case 33:case 43:case 44:case 47:case 62:case 64:case 126:// ; { } breakpoint token case 59:case 123:case 125:return 4;// : accompanied token case 58:return 3;// " ' ( [ opening delimit token case 34:case 39:case 40:case 91:return 2;// ) ] closing delimit token case 41:case 93:return 1;}return 0;}/** * @param {string} value * @return {any[]} */function alloc(value){return line=column=1,Tokenizer_length=Utility_strlen(characters=value),position=0,[];}/** * @param {any} value * @return {any} */function dealloc(value){return characters='',value;}/** * @param {number} type * @return {string} */function delimit(type){return trim(slice(position-1,delimiter(type===91?type+2:type===40?type+1:type)));}/** * @param {string} value * @return {string[]} */function Tokenizer_tokenize(value){return dealloc(tokenizer(alloc(value)));}/** * @param {number} type * @return {string} */function whitespace(type){while(character=peek())if(character<33)next();else break;return token(type)>2||token(character)>3?'':' ';}/** * @param {string[]} children * @return {string[]} */function tokenizer(children){while(next())switch(token(character)){case 0:append(identifier(position-1),children);break;case 2:append(delimit(character),children);break;default:append(from(character),children);}return children;}/** * @param {number} index * @param {number} count * @return {string} */function escaping(index,count){while(--count&&next())// not 0-9 A-F a-f if(character<48||character>102||character>57&&character<65||character>70&&character<97)break;return slice(index,caret()+(count<6&&peek()==32&&next()==32));}/** * @param {number} type * @return {number} */function delimiter(type){while(next())switch(character){// ] ) " ' case type:return position;// " ' case 34:case 39:if(type!==34&&type!==39)delimiter(character);break;// ( case 40:if(type===41)delimiter(type);break;// \ case 92:next();break;}return position;}/** * @param {number} type * @param {number} index * @return {number} */function commenter(type,index){while(next())// // if(type+character===47+10)break;// /* else if(type+character===42+42&&peek()===47)break;return'/*'+slice(index,position-1)+'*'+Utility_from(type===47?type:next());}/** * @param {number} index * @return {string} */function identifier(index){while(!token(peek()))next();return slice(index,position);} ;// ../../node_modules/stylis/src/Enum.js var Enum_MS='-ms-';var Enum_MOZ='-moz-';var Enum_WEBKIT='-webkit-';var COMMENT='comm';var Enum_RULESET='rule';var Enum_DECLARATION='decl';var PAGE='@page';var MEDIA='@media';var IMPORT='@import';var CHARSET='@charset';var VIEWPORT='@viewport';var SUPPORTS='@supports';var DOCUMENT='@document';var NAMESPACE='@namespace';var Enum_KEYFRAMES='@keyframes';var FONT_FACE='@font-face';var COUNTER_STYLE='@counter-style';var FONT_FEATURE_VALUES='@font-feature-values';var LAYER='@layer'; ;// ../../node_modules/stylis/src/Serializer.js /** * @param {object[]} children * @param {function} callback * @return {string} */function Serializer_serialize(children,callback){var output='';var length=Utility_sizeof(children);for(var i=0;i-1)if(!element.return)switch(element.type){case DECLARATION:element.return=prefix(element.value,element.length,children);return;case KEYFRAMES:return serialize([copy(element,{value:replace(element.value,'@','@'+WEBKIT)})],callback);case RULESET:if(element.length)return combine(element.props,function(value){switch(match(value,/(::plac\w+|:read-\w+)/)){// :read-(only|write) case':read-only':case':read-write':return serialize([copy(element,{props:[replace(value,/:(read-\w+)/,':'+MOZ+'$1')]})],callback);// :placeholder case'::placeholder':return serialize([copy(element,{props:[replace(value,/:(plac\w+)/,':'+WEBKIT+'input-$1')]}),copy(element,{props:[replace(value,/:(plac\w+)/,':'+MOZ+'$1')]}),copy(element,{props:[replace(value,/:(plac\w+)/,MS+'input-$1')]})],callback);}return'';});}}/** * @param {object} element * @param {number} index * @param {object[]} children */function namespace(element){switch(element.type){case RULESET:element.props=element.props.map(function(value){return combine(tokenize(value),function(value,index,children){switch(charat(value,0)){// \f case 12:return substr(value,1,strlen(value));// \0 ( + > ~ case 0:case 40:case 43:case 62:case 126:return value;// : case 58:if(children[++index]==='global')children[index]='',children[++index]='\f'+substr(children[index],index=1,-1);// \s case 32:return index===1?'':value;default:switch(index){case 0:element=value;return sizeof(children)>1?'':value;case index=sizeof(children)-1:case 2:return index===2?value+element+element:value+element;default:return value;}}});});}} ;// ../../node_modules/stylis/src/Parser.js /** * @param {string} value * @return {object[]} */function compile(value){return dealloc(parse('',null,null,null,[''],value=alloc(value),0,[0],value));}/** * @param {string} value * @param {object} root * @param {object?} parent * @param {string[]} rule * @param {string[]} rules * @param {string[]} rulesets * @param {number[]} pseudo * @param {number[]} points * @param {string[]} declarations * @return {object} */function parse(value,root,parent,rule,rules,rulesets,pseudo,points,declarations){var index=0;var offset=0;var length=pseudo;var atrule=0;var property=0;var previous=0;var variable=1;var scanning=1;var ampersand=1;var character=0;var type='';var props=rules;var children=rulesets;var reference=rule;var characters=type;while(scanning)switch(previous=character,character=next()){// ( case 40:if(previous!=108&&Utility_charat(characters,length-1)==58){if(indexof(characters+=Utility_replace(delimit(character),'&','&\f'),'&\f')!=-1)ampersand=-1;break;}// " ' [ case 34:case 39:case 91:characters+=delimit(character);break;// \t \n \r \s case 9:case 10:case 13:case 32:characters+=whitespace(previous);break;// \ case 92:characters+=escaping(caret()-1,7);continue;// / case 47:switch(peek()){case 42:case 47:Utility_append(comment(commenter(next(),caret()),root,parent),declarations);break;default:characters+='/';}break;// { case 123*variable:points[index++]=Utility_strlen(characters)*ampersand;// } ; \0 case 125*variable:case 59:case 0:switch(character){// \0 } case 0:case 125:scanning=0;// ; case 59+offset:if(ampersand==-1)characters=Utility_replace(characters,/\f/g,'');if(property>0&&Utility_strlen(characters)-length)Utility_append(property>32?declaration(characters+';',rule,parent,length-1):declaration(Utility_replace(characters,' ','')+';',rule,parent,length-2),declarations);break;// @ ; case 59:characters+=';';// { rule/at-rule default:Utility_append(reference=ruleset(characters,root,parent,index,offset,rules,points,type,props=[],children=[],length),rulesets);if(character===123)if(offset===0)parse(characters,root,reference,reference,props,rulesets,length,points,children);else switch(atrule===99&&Utility_charat(characters,3)===110?100:atrule){// d l m s case 100:case 108:case 109:case 115:parse(value,reference,reference,rule&&Utility_append(ruleset(value,reference,reference,0,0,rules,points,type,rules,props=[],length),children),rules,children,length,points,rule?props:children);break;default:parse(characters,reference,reference,reference,[''],children,0,points,children);}}index=offset=property=0,variable=ampersand=1,type=characters='',length=pseudo;break;// : case 58:length=1+Utility_strlen(characters),property=previous;default:if(variable<1)if(character==123)--variable;else if(character==125&&variable++==0&&prev()==125)continue;switch(characters+=Utility_from(character),character*variable){// & case 38:ampersand=offset>0?1:(characters+='\f',-1);break;// , case 44:points[index++]=(Utility_strlen(characters)-1)*ampersand,ampersand=1;break;// @ case 64:// - if(peek()===45)characters+=delimit(next());atrule=peek(),offset=length=Utility_strlen(type=characters+=identifier(caret())),character++;break;// - case 45:if(previous===45&&Utility_strlen(characters)==2)variable=0;}}return rulesets;}/** * @param {string} value * @param {object} root * @param {object?} parent * @param {number} index * @param {number} offset * @param {string[]} rules * @param {number[]} points * @param {string} type * @param {string[]} props * @param {string[]} children * @param {number} length * @return {object} */function ruleset(value,root,parent,index,offset,rules,points,type,props,children,length){var post=offset-1;var rule=offset===0?rules:[''];var size=Utility_sizeof(rule);for(var i=0,j=0,k=0;i0?rule[x]+' '+y:Utility_replace(y,/&\f/g,rule[x])))props[k++]=z;return node(value,root,parent,offset===0?Enum_RULESET:type,props,children,length);}/** * @param {number} value * @param {object} root * @param {object?} parent * @return {object} */function comment(value,root,parent){return node(value,root,parent,COMMENT,Utility_from(Tokenizer_char()),Utility_substr(value,2,-2),0);}/** * @param {string} value * @param {object} root * @param {object?} parent * @param {number} length * @return {object} */function declaration(value,root,parent,length){return node(value,root,parent,Enum_DECLARATION,Utility_substr(value,0,length),Utility_substr(value,length+1,-1),length);} ;// ../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js var identifierWithPointTracking=function identifierWithPointTracking(begin,points,index){var previous=0;var character=0;while(true){previous=character;character=peek();// &\f if(previous===38&&character===12){points[index]=1;}if(token(character)){break;}next();}return slice(begin,position);};var toRules=function toRules(parsed,points){// pretend we've started with a comma var index=-1;var character=44;do{switch(token(character)){case 0:// &\f if(character===38&&peek()===12){// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings // stylis inserts \f after & to know when & where it should replace this sequence with the context selector // and when it should just concatenate the outer and inner selectors // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here points[index]=1;}parsed[index]+=identifierWithPointTracking(position-1,points,index);break;case 2:parsed[index]+=delimit(character);break;case 4:// comma if(character===44){// colon parsed[++index]=peek()===58?'&\f':'';points[index]=parsed[index].length;break;}// fallthrough default:parsed[index]+=Utility_from(character);}}while(character=next());return parsed;};var getRules=function getRules(value,points){return dealloc(toRules(alloc(value),points));};// WeakSet would be more appropriate, but only WeakMap is supported in IE11 var fixedElements=/* #__PURE__ */new WeakMap();var compat=function compat(element){if(element.type!=='rule'||!element.parent||// positive .length indicates that this rule contains pseudo // negative .length indicates that this rule has been already prefixed element.length<1){return;}var value=element.value;var parent=element.parent;var isImplicitRule=element.column===parent.column&&element.line===parent.line;while(parent.type!=='rule'){parent=parent.parent;if(!parent)return;}// short-circuit for the simplest case if(element.props.length===1&&value.charCodeAt(0)!==58/* colon */&&!fixedElements.get(parent)){return;}// if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level) // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent" if(isImplicitRule){return;}fixedElements.set(element,true);var points=[];var rules=getRules(value,points);var parentRules=parent.props;for(var i=0,k=0;i6)switch(Utility_charat(value,length+1)){// (m)ax-content, (m)in-content case 109:// - if(Utility_charat(value,length+4)!==45)break;// (f)ill-available, (f)it-content case 102:return Utility_replace(value,/(.+:)(.+)-([^]+)/,'$1'+Enum_WEBKIT+'$2-$3'+'$1'+Enum_MOZ+(Utility_charat(value,length+3)==108?'$3':'$2-$3'))+value;// (s)tretch case 115:return~indexof(value,'stretch')?emotion_cache_browser_esm_prefix(Utility_replace(value,'stretch','fill-available'),length)+value:value;}break;// position: sticky case 4949:// (s)ticky? if(Utility_charat(value,length+1)!==115)break;// display: (flex|inline-flex) case 6444:switch(Utility_charat(value,Utility_strlen(value)-3-(~indexof(value,'!important')&&10))){// stic(k)y case 107:return Utility_replace(value,':',':'+Enum_WEBKIT)+value;// (inline-)?fl(e)x case 101:return Utility_replace(value,/(.+:)([^;!]+)(;|!.+)?/,'$1'+Enum_WEBKIT+(Utility_charat(value,14)===45?'inline-':'')+'box$3'+'$1'+Enum_WEBKIT+'$2$3'+'$1'+Enum_MS+'$2box$3')+value;}break;// writing-mode case 5936:switch(Utility_charat(value,length+11)){// vertical-l(r) case 114:return Enum_WEBKIT+value+Enum_MS+Utility_replace(value,/[svh]\w+-[tblr]{2}/,'tb')+value;// vertical-r(l) case 108:return Enum_WEBKIT+value+Enum_MS+Utility_replace(value,/[svh]\w+-[tblr]{2}/,'tb-rl')+value;// horizontal(-)tb case 45:return Enum_WEBKIT+value+Enum_MS+Utility_replace(value,/[svh]\w+-[tblr]{2}/,'lr')+value;}return Enum_WEBKIT+value+Enum_MS+value+value;}return value;}var emotion_cache_browser_esm_prefixer=function prefixer(element,index,children,callback){if(element.length>-1)if(!element["return"])switch(element.type){case Enum_DECLARATION:element["return"]=emotion_cache_browser_esm_prefix(element.value,element.length);break;case Enum_KEYFRAMES:return Serializer_serialize([Tokenizer_copy(element,{value:Utility_replace(element.value,'@','@'+Enum_WEBKIT)})],callback);case Enum_RULESET:if(element.length)return Utility_combine(element.props,function(value){switch(Utility_match(value,/(::plac\w+|:read-\w+)/)){// :read-(only|write) case':read-only':case':read-write':return Serializer_serialize([Tokenizer_copy(element,{props:[Utility_replace(value,/:(read-\w+)/,':'+Enum_MOZ+'$1')]})],callback);// :placeholder case'::placeholder':return Serializer_serialize([Tokenizer_copy(element,{props:[Utility_replace(value,/:(plac\w+)/,':'+Enum_WEBKIT+'input-$1')]}),Tokenizer_copy(element,{props:[Utility_replace(value,/:(plac\w+)/,':'+Enum_MOZ+'$1')]}),Tokenizer_copy(element,{props:[Utility_replace(value,/:(plac\w+)/,Enum_MS+'input-$1')]})],callback);}return'';});}};var defaultStylisPlugins=[emotion_cache_browser_esm_prefixer];var createCache=function createCache(options){var key=options.key;if(key==='css'){var ssrStyles=document.querySelectorAll("style[data-emotion]:not([data-s])");// get SSRed styles out of the way of React's hydration // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) // note this very very intentionally targets all style elements regardless of the key to ensure // that creating a cache works inside of render of a React component Array.prototype.forEach.call(ssrStyles,function(node){// we want to only move elements which have a space in the data-emotion attribute value // because that indicates that it is an Emotion 11 server-side rendered style elements // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles // will not result in the Emotion 10 styles being destroyed var dataEmotionAttribute=node.getAttribute('data-emotion');if(dataEmotionAttribute.indexOf(' ')===-1){return;}document.head.appendChild(node);node.setAttribute('data-s','');});}var stylisPlugins=options.stylisPlugins||defaultStylisPlugins;var inserted={};var container;var nodesToHydrate=[];{container=options.container||document.head;Array.prototype.forEach.call(// this means we will ignore elements which don't have a space in them which // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll("style[data-emotion^=\""+key+" \"]"),function(node){var attrib=node.getAttribute("data-emotion").split(' ');for(var i=1;i=4;++i,len-=4){k=str.charCodeAt(i)&0xff|(str.charCodeAt(++i)&0xff)<<8|(str.charCodeAt(++i)&0xff)<<16|(str.charCodeAt(++i)&0xff)<<24;k=/* Math.imul(k, m): */(k&0xffff)*0x5bd1e995+((k>>>16)*0xe995<<16);k^=/* k >>> r: */k>>>24;h=/* Math.imul(k, m): */(k&0xffff)*0x5bd1e995+((k>>>16)*0xe995<<16)^/* Math.imul(h, m): */(h&0xffff)*0x5bd1e995+((h>>>16)*0xe995<<16);}// Handle the last few bytes of the input array switch(len){case 3:h^=(str.charCodeAt(i+2)&0xff)<<16;case 2:h^=(str.charCodeAt(i+1)&0xff)<<8;case 1:h^=str.charCodeAt(i)&0xff;h=/* Math.imul(h, m): */(h&0xffff)*0x5bd1e995+((h>>>16)*0xe995<<16);}// Do a few final mixes of the hash to ensure the last few // bytes are well-incorporated. h^=h>>>13;h=/* Math.imul(h, m): */(h&0xffff)*0x5bd1e995+((h>>>16)*0xe995<<16);return((h^h>>>15)>>>0).toString(36);} ;// ../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,// SVG-related properties fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}; ;// ../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js function memoize(fn){var cache=Object.create(null);return function(arg){if(cache[arg]===undefined)cache[arg]=fn(arg);return cache[arg];};} ;// ../../node_modules/@emotion/serialize/dist/emotion-serialize.esm.js var emotion_serialize_esm_isDevelopment=false;var hyphenateRegex=/[A-Z]|^ms/g;var animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g;var isCustomProperty=function isCustomProperty(property){return property.charCodeAt(1)===45;};var isProcessableValue=function isProcessableValue(value){return value!=null&&typeof value!=='boolean';};var processStyleName=/* #__PURE__ */memoize(function(styleName){return isCustomProperty(styleName)?styleName:styleName.replace(hyphenateRegex,'-$&').toLowerCase();});var processStyleValue=function processStyleValue(key,value){switch(key){case'animation':case'animationName':{if(typeof value==='string'){return value.replace(animationRegex,function(match,p1,p2){cursor={name:p1,styles:p2,next:cursor};return p1;});}}}if(unitlessKeys[key]!==1&&!isCustomProperty(key)&&typeof value==='number'&&value!==0){return value+'px';}return value;};var noComponentSelectorMessage='Component selectors can only be used in conjunction with '+'@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware '+'compiler transform.';function handleInterpolation(mergedProps,registered,interpolation){if(interpolation==null){return'';}var componentSelector=interpolation;if(componentSelector.__emotion_styles!==undefined){return componentSelector;}switch(typeof interpolation){case'boolean':{return'';}case'object':{var keyframes=interpolation;if(keyframes.anim===1){cursor={name:keyframes.name,styles:keyframes.styles,next:cursor};return keyframes.name;}var serializedStyles=interpolation;if(serializedStyles.styles!==undefined){var next=serializedStyles.next;if(next!==undefined){// not the most efficient thing ever but this is a pretty rare case // and there will be very few iterations of this generally while(next!==undefined){cursor={name:next.name,styles:next.styles,next:cursor};next=next.next;}}var styles=serializedStyles.styles+";";return styles;}return createStringFromObject(mergedProps,registered,interpolation);}case'function':{if(mergedProps!==undefined){var previousCursor=cursor;var result=interpolation(mergedProps);cursor=previousCursor;return handleInterpolation(mergedProps,registered,result);}break;}}// finalize string values (regular strings and functions interpolated into css calls) var asString=interpolation;if(registered==null){return asString;}var cached=registered[asString];return cached!==undefined?cached:asString;}function createStringFromObject(mergedProps,registered,obj){var string='';if(Array.isArray(obj)){for(var i=0;i ` ${rule}: ${color}; `; const animations = { spin: ` 0% { transform: rotate(0deg); } 100% { transform: rotate(359deg); } `, }; function scrollbarStyles(theme, color) { const thumbColor = (color === null || color === void 0 ? void 0 : color.thumb) || styles_themes[theme].secondary["500"]; const trackColor = (color === null || color === void 0 ? void 0 : color.track) || styles_themes[theme].background.alt; return { /* FireFox & Chrome support */ default: ` scrollbar-color: ${thumbColor} ${trackColor}; `, /* Safari Support */ safari: ` ::-webkit-scrollbar { overflow: auto; } ::-webkit-scrollbar-thumb { border-width: 4px; border-style: solid; border-radius: 0.5rem; border-color: transparent; background-clip: content-box; background-color: ${thumbColor}; } ::-webkit-scrollbar-track { ${trackColor}; } ::-webkit-scrollbar-thumb:hover { ${styles_themes[theme].secondary["600"]}; } `, }; } ;// ./src/autofill/content/components/icons/angle-down.ts function AngleDown({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/angle-up.ts function AngleUp({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/shield.ts function Shield({ ariaHidden = true, color, theme }) { const shapeColor = color || styles_themes[theme].brandLogo; return x ` `; } ;// ./src/autofill/content/components/icons/brand-icon-container.ts function BrandIconContainer({ iconLink, theme }) { const Icon = x `
${Shield({ theme })}
`; return iconLink ? x `${Icon}` : Icon; } const brandIconContainerStyles = emotion_css_esm_css ` display: flex; justify-content: center; width: 24px; height: 24px; > svg { width: auto; height: 100%; } `; ;// ./src/autofill/content/components/icons/business.ts function Business({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/close.ts function Close({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/collection-shared.ts function CollectionShared({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/exclamation-triangle.ts function ExclamationTriangle({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? themes[theme].secondary["300"] : color || themes[theme].text.main; return html ` `; } ;// ./src/autofill/content/components/icons/external-link.ts function ExternalLink({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/family.ts function Family({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/folder.ts function Folder({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/globe.ts function Globe({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/pencil-square.ts function PencilSquare({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/spinner.ts function Spinner({ ariaHidden = true, color, disabled, theme, disableSpin = false, }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } const animation = emotion_css_esm_css ` animation: ${keyframes(animations.spin)} 2s infinite linear; `; ;// ./src/autofill/content/components/icons/user.ts function User({ ariaHidden = true, color, disabled, theme }) { const shapeColor = disabled ? styles_themes[theme].secondary["300"] : color || styles_themes[theme].text.main; return x ` `; } ;// ./src/autofill/content/components/icons/index.ts ;// ./src/autofill/content/components/buttons/close-button.ts function CloseButton({ handleCloseNotification, i18n, theme }) { return x ` `; } const closeButtonStyles = (theme) => emotion_css_esm_css ` border: 1px solid transparent; border-radius: ${spacing["1"]}; background-color: transparent; cursor: pointer; width: 36px; height: 36px; :hover { border: 1px solid ${styles_themes[theme].primary["600"]}; } > svg { width: 20px; height: 20px; vertical-align: middle; } `; ;// ./src/autofill/content/components/notification/header-message.ts function NotificationHeaderMessage({ message, theme }) { return x ` ${message} `; } const notificationHeaderMessageStyles = (theme) => emotion_css_esm_css ` flex-grow: 1; overflow-x: hidden; text-align: left; text-overflow: ellipsis; line-height: 28px; white-space: nowrap; color: ${styles_themes[theme].text.main}; font-family: Inter, sans-serif; font-size: 18px; font-weight: 500; `; ;// ./src/autofill/content/components/notification/header.ts const componentClassPrefix = "notification-header"; const { css: header_css } = createEmotion({ key: componentClassPrefix, }); function NotificationHeader({ i18n, message, standalone = false, theme = ThemeTypes.Light, handleCloseNotification, }) { const showIcon = true; const isDismissable = true; return x `
${showIcon ? BrandIconContainer({ theme }) : null} ${message ? NotificationHeaderMessage({ message, theme }) : null} ${isDismissable ? CloseButton({ handleCloseNotification, i18n, theme }) : null}
`; } const notificationHeaderStyles = ({ standalone, theme, }) => header_css ` gap: ${spacing[2]}; display: flex; align-items: center; justify-content: flex-start; background-color: ${styles_themes[theme].background.DEFAULT}; padding: 12px 16px 8px 16px; white-space: nowrap; ${standalone ? header_css `` : header_css ` border-bottom: 0.5px solid ${styles_themes[theme].secondary["300"]}; `} `; ;// ./src/autofill/content/components/illustrations/celebrate.ts // This icon has static multi-colors for each theme function Celebrate({ theme }) { if (theme === ThemeTypes.Dark) { return x ` `; } return x ` `; } ;// ./src/autofill/content/components/illustrations/keyhole.ts // This icon has static multi-colors for each theme function Keyhole({ theme }) { if (theme === ThemeTypes.Dark) { return x ` `; } return x ` `; } ;// ./src/autofill/content/components/illustrations/warning.ts // This icon has static multi-colors for each theme function Warning() { return x ` `; } ;// ./src/autofill/content/components/illustrations/index.ts ;// ./src/autofill/content/components/notification/at-risk-password/message.ts function AtRiskNotificationMessage({ message, theme }) { return x `
${message ? x ` ${message} ` : E}
`; } const baseTextStyles = emotion_css_esm_css ` overflow-x: hidden; text-align: left; text-overflow: ellipsis; line-height: 24px; font-family: Inter, sans-serif; font-size: 16px; `; const atRiskNotificationMessageStyles = (theme) => emotion_css_esm_css ` ${baseTextStyles} color: ${styles_themes[theme].text.main}; font-weight: 400; white-space: normal; word-break: break-word; display: inline; `; ;// ./src/autofill/content/components/notification/at-risk-password/body.ts const body_componentClassPrefix = "at-risk-notification-body"; const { css: body_css } = createEmotion({ key: body_componentClassPrefix, }); function AtRiskNotificationBody({ riskMessage, theme }) { return x `
${Warning()}
${riskMessage ? AtRiskNotificationMessage({ message: riskMessage, theme, }) : E}
`; } const iconContainerStyles = body_css ` > svg { width: 50px; height: auto; } `; const atRiskNotificationBodyStyles = ({ theme }) => body_css ` gap: ${spacing[4]}; display: flex; align-items: center; justify-content: flex-start; background-color: ${styles_themes[theme].background.alt}; padding: 12px; `; ;// ./src/autofill/content/components/buttons/action-button.ts function ActionButton({ buttonText, dataTestId, disabled = false, isLoading = false, theme, handleClick, fullWidth = true, }) { const handleButtonClick = (event) => { if (!disabled && !isLoading) { handleClick(event); } }; return x ` `; } const actionButtonStyles = ({ disabled, fullWidth, isLoading, theme, }) => emotion_css_esm_css ` ${typography.body2} user-select: none; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: ${border.radius.full}; padding: ${spacing["1"]} ${spacing["3"]}; width: ${fullWidth ? "100%" : "auto"}; overflow: hidden; text-align: center; text-overflow: ellipsis; font-weight: 500; ${disabled || isLoading ? ` background-color: ${styles_themes[theme].secondary["300"]}; color: ${styles_themes[theme].text.muted}; ` : ` background-color: ${styles_themes[theme].primary["600"]}; cursor: pointer; color: ${styles_themes[theme].text.contrast}; :hover { border-color: ${styles_themes[theme].primary["700"]}; background-color: ${styles_themes[theme].primary["700"]}; color: ${styles_themes[theme].text.contrast}; } :focus { outline: 2px solid ${styles_themes[theme].primary["600"]}; outline-offset: 1px; } `} svg { padding: 2px 0; /* Match line-height of button body2 typography */ width: auto; height: 16px; } `; ;// ./src/autofill/content/components/buttons/additional-tasks/button-content.ts function AdditionalTasksButtonContent({ buttonText, theme, }) { return x `
${buttonText} ${ExternalLink({ theme, color: styles_themes[theme].text.contrast })}
`; } const additionalTasksButtonContentStyles = ({ theme }) => emotion_css_esm_css ` gap: ${spacing[2]}; display: flex; align-items: center; white-space: nowrap; `; ;// ./src/autofill/content/components/notification/at-risk-password/footer.ts function AtRiskNotificationFooter({ i18n, theme, passwordChangeUri, }) { return x `
${passwordChangeUri && ActionButton({ handleClick: () => { open(passwordChangeUri, "_blank"); }, buttonText: AdditionalTasksButtonContent({ buttonText: i18n.changePassword, theme }), dataTestId: "change-password-button", theme, fullWidth: false, })}
`; } const atRiskNotificationFooterStyles = emotion_css_esm_css ` display: flex; padding: ${spacing[2]} ${spacing[4]} ${spacing[4]} ${spacing[4]}; :last-child { border-radius: 0 0 ${spacing["4"]} ${spacing["4"]}; } `; ;// ./src/autofill/content/components/notification/at-risk-password/container.ts function AtRiskNotification({ handleCloseNotification, i18n, notificationTestId, theme = ThemeTypes.Light, params, }) { const { passwordChangeUri, organizationName } = params; const riskMessage = chrome.i18n.getMessage(passwordChangeUri ? "atRiskChangePrompt" : "atRiskNavigatePrompt", organizationName); return x `
${NotificationHeader({ handleCloseNotification, i18n, message: i18n.atRiskPassword, theme, })} ${AtRiskNotificationBody({ theme, riskMessage, })} ${passwordChangeUri ? AtRiskNotificationFooter({ i18n, theme, passwordChangeUri: params === null || params === void 0 ? void 0 : params.passwordChangeUri, }) : E}
`; } const atRiskNotificationContainerStyles = (theme) => emotion_css_esm_css ` position: absolute; right: 20px; border: 1px solid ${styles_themes[theme].secondary["300"]}; border-radius: ${spacing["4"]}; box-shadow: -2px 4px 6px 0px #0000001a; background-color: ${styles_themes[theme].background.alt}; width: 400px; overflow: hidden; [class*="${componentClassPrefix}-"] { border-radius: ${spacing["4"]} ${spacing["4"]} 0 0; border-bottom: 0.5px solid ${styles_themes[theme].secondary["300"]}; } `; ;// ./src/autofill/notification/abstractions/notification-bar.ts const NotificationTypes = { Add: "add", Change: "change", Unlock: "unlock", AtRiskPassword: "at-risk-password", }; ;// ./src/autofill/content/components/notification/confirmation/message.ts function NotificationConfirmationMessage({ buttonAria, buttonText, itemName, message, messageDetails, handleClick, theme, }) { return x `
${message || buttonText ? x `
${itemName ? x ` ${itemName} ` : E} ${message || E} ${buttonText ? x ` handleButtonKeyDown(e, () => handleClick(e))} aria-label=${buttonAria} tabindex="0" role="button" > ${buttonText} ` : E}
` : E} ${messageDetails ? x `
${messageDetails}
` : E}
`; } const containerStyles = emotion_css_esm_css ` display: flex; flex-direction: column; gap: ${spacing[1]}; width: 100%; `; const singleLineWrapperStyles = emotion_css_esm_css ` display: inline; white-space: normal; word-break: break-word; `; const message_baseTextStyles = emotion_css_esm_css ` overflow-x: hidden; text-align: left; text-overflow: ellipsis; line-height: 24px; font-family: Inter, sans-serif; font-size: 16px; `; const notificationConfirmationMessageStyles = (theme) => emotion_css_esm_css ` ${message_baseTextStyles} color: ${styles_themes[theme].text.main}; font-weight: 400; white-space: normal; word-break: break-word; display: inline; `; const itemNameStyles = (theme) => emotion_css_esm_css ` ${message_baseTextStyles} color: ${styles_themes[theme].text.main}; font-weight: 400; white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; `; const notificationConfirmationButtonTextStyles = (theme) => emotion_css_esm_css ` ${message_baseTextStyles} color: ${styles_themes[theme].primary[600]}; font-weight: 500; cursor: pointer; `; const AdditionalMessageStyles = ({ theme }) => emotion_css_esm_css ` ${typography.body2} font-size: 14px; color: ${styles_themes[theme].text.muted}; `; function handleButtonKeyDown(event, handleClick) { if (event.key === "Enter" || event.key === " ") { event.preventDefault(); handleClick(); } } ;// ./src/autofill/content/components/notification/confirmation/body.ts const confirmation_body_componentClassPrefix = "notification-confirmation-body"; const { css: confirmation_body_css } = createEmotion({ key: confirmation_body_componentClassPrefix, }); function NotificationConfirmationBody({ buttonAria, buttonText, confirmationMessage, error, itemName, messageDetails, tasksAreComplete, theme, handleOpenVault, }) { const IconComponent = error ? Warning : tasksAreComplete ? Celebrate : Keyhole; const showConfirmationMessage = confirmationMessage || buttonText || messageDetails; return x `
${IconComponent({ theme })}
${showConfirmationMessage ? NotificationConfirmationMessage({ buttonAria, buttonText, itemName: error ? undefined : itemName, message: confirmationMessage, messageDetails, theme, handleClick: handleOpenVault, }) : E}
`; } const body_iconContainerStyles = (error) => confirmation_body_css ` > svg { width: ${!error ? "50px" : "40px"}; height: auto; } `; const notificationConfirmationBodyStyles = ({ theme }) => confirmation_body_css ` gap: ${spacing[4]}; display: flex; align-items: center; justify-content: flex-start; background-color: ${styles_themes[theme].background.alt}; padding: 12px; `; ;// ./src/autofill/content/components/notification/confirmation/footer.ts function NotificationConfirmationFooter({ i18n, theme, handleButtonClick, }) { const primaryButtonText = i18n.nextSecurityTaskAction; return x `
${ActionButton({ handleClick: handleButtonClick, buttonText: footer_AdditionalTasksButtonContent({ buttonText: primaryButtonText, theme }), theme, })}
`; } const notificationConfirmationFooterStyles = ({ theme }) => emotion_css_esm_css ` background-color: ${styles_themes[theme].background.alt}; padding: 0 ${spacing[3]} ${spacing[3]} ${spacing[3]}; max-width: min-content; :last-child { border-radius: 0 0 ${spacing["4"]} ${spacing["4"]}; padding-bottom: ${spacing[4]}; } `; function footer_AdditionalTasksButtonContent({ buttonText, theme }) { return x `
${buttonText} ${ExternalLink({ theme, color: styles_themes[theme].text.contrast })}
`; } const footer_additionalTasksButtonContentStyles = ({ theme }) => emotion_css_esm_css ` gap: ${spacing[2]}; display: flex; align-items: center; white-space: nowrap; `; ;// ./src/autofill/content/components/notification/confirmation/container.ts function NotificationConfirmationContainer({ error, handleCloseNotification, handleOpenVault, handleOpenTasks, headerMessage, i18n, itemName, notificationTestId, task, theme = ThemeTypes.Light, type, }) { const confirmationMessage = getConfirmationMessage(i18n, type, error); const buttonText = error ? i18n.newItem : i18n.view; const buttonAria = error ? i18n.notificationNewItemAria : chrome.i18n.getMessage("notificationViewAria", [itemName]); let messageDetails; let remainingTasksCount; let tasksAreComplete = true; if (task && !error) { remainingTasksCount = task.remainingTasksCount || 0; tasksAreComplete = remainingTasksCount === 0; messageDetails = remainingTasksCount > 0 ? chrome.i18n.getMessage("loginUpdateTaskSuccessAdditional", [ task.orgName, `${remainingTasksCount}`, ]) : chrome.i18n.getMessage("loginUpdateTaskSuccess", [task.orgName]); } return x `
${NotificationHeader({ handleCloseNotification, i18n, message: headerMessage, theme, })} ${NotificationConfirmationBody({ buttonAria, buttonText, confirmationMessage, error, itemName, messageDetails, tasksAreComplete, theme, handleOpenVault, })} ${!error && remainingTasksCount ? NotificationConfirmationFooter({ i18n, theme, handleButtonClick: handleOpenTasks, }) : E}
`; } const notificationContainerStyles = (theme) => emotion_css_esm_css ` position: absolute; right: 20px; border: 1px solid ${styles_themes[theme].secondary["300"]}; border-radius: ${spacing["4"]}; box-shadow: -2px 4px 6px 0px #0000001a; background-color: ${styles_themes[theme].background.alt}; width: 400px; overflow: hidden; [class*="${componentClassPrefix}-"] { border-radius: ${spacing["4"]} ${spacing["4"]} 0 0; border-bottom: 0.5px solid ${styles_themes[theme].secondary["300"]}; } `; function getConfirmationMessage(i18n, type, error) { if (error) { return i18n.saveFailureDetails; } /* @TODO This partial string return and later concatenation with the cipher name is needed * to handle cipher name overflow cases, but is risky for i18n concerns. Fix concatenation * with cipher name overflow when a tag replacement solution is available. */ return type === NotificationTypes.Add ? i18n.notificationLoginSaveConfirmation : i18n.notificationLoginUpdatedConfirmation; } ;// ./src/autofill/content/components/buttons/badge-button.ts function BadgeButton({ buttonAction, buttonText, disabled = false, itemName, theme, username, }) { const handleButtonClick = (event) => { if (!disabled) { buttonAction(event); } }; return x ` `; } const badgeButtonStyles = ({ disabled, theme }) => emotion_css_esm_css ` ${typography.helperMedium} user-select: none; border-radius: ${border.radius.full}; padding: ${spacing["1"]} ${spacing["2"]}; max-height: fit-content; overflow: hidden; text-align: center; text-overflow: ellipsis; font-weight: 500; ${disabled ? ` border: 0.5px solid ${styles_themes[theme].secondary["300"]}; background-color: ${styles_themes[theme].secondary["300"]}; color: ${styles_themes[theme].text.muted}; ` : ` border: 0.5px solid ${styles_themes[theme].primary["700"]}; background-color: ${styles_themes[theme].primary["100"]}; cursor: pointer; color: ${styles_themes[theme].primary["700"]}; :hover { border-color: ${styles_themes[theme].primary["600"]}; background-color: ${styles_themes[theme].primary["600"]}; color: ${styles_themes[theme].text.contrast}; } :focus { outline: 2px solid ${styles_themes[theme].primary["600"]}; outline-offset: 2px; } `} `; ;// ./src/autofill/content/components/buttons/edit-button.ts function EditButton({ buttonAction, buttonText, disabled = false, theme }) { return x ` `; } const editButtonStyles = ({ disabled, theme }) => emotion_css_esm_css ` ${typography.helperMedium} user-select: none; display: flex; border: 1px solid transparent; border-radius: ${spacing["1"]}; background-color: transparent; padding: ${spacing["1"]}; max-height: fit-content; overflow: hidden; ${!disabled ? ` cursor: pointer; :hover { border-color: ${styles_themes[theme].primary["600"]}; } ` : ""} > svg { width: 16px; height: fit-content; } `; ;// ../../node_modules/signal-polyfill/dist/index.js var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __publicField=(obj,key,value)=>{__defNormalProp(obj,typeof key!=="symbol"?key+"":key,value);return value;};var __accessCheck=(obj,member,msg)=>{if(!member.has(obj))throw TypeError("Cannot "+msg);};var __privateIn=(member,obj)=>{if(Object(obj)!==obj)throw TypeError('Cannot use the "in" operator on this value');return member.has(obj);};var __privateAdd=(obj,member,value)=>{if(member.has(obj))throw TypeError("Cannot add the same private member more than once");member instanceof WeakSet?member.add(obj):member.set(obj,value);};var __privateMethod=(obj,member,method)=>{__accessCheck(obj,member,"access private method");return method;};/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function defaultEquals(a,b){return Object.is(a,b);}/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */let activeConsumer=null;let inNotificationPhase=false;let epoch=1;const SIGNAL=/* @__PURE__ */Symbol("SIGNAL");function setActiveConsumer(consumer){const prev=activeConsumer;activeConsumer=consumer;return prev;}function getActiveConsumer(){return activeConsumer;}function isInNotificationPhase(){return inNotificationPhase;}const REACTIVE_NODE={version:0,lastCleanEpoch:0,dirty:false,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:false,consumerIsAlwaysLive:false,producerMustRecompute:()=>false,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function producerAccessed(node){if(inNotificationPhase){throw new Error(typeof ngDevMode!=="undefined"&&ngDevMode?`Assertion error: signal read during notification phase`:"");}if(activeConsumer===null){return;}activeConsumer.consumerOnSignalRead(node);const idx=activeConsumer.nextProducerIndex++;assertConsumerNode(activeConsumer);if(idxnode.nextProducerIndex){node.producerNode.pop();node.producerLastReadVersion.pop();node.producerIndexOfThis.pop();}}function consumerPollProducersForChange(node){assertConsumerNode(node);for(let i=0;i=node.liveConsumerNode.length){throw new Error(`Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`);}if(node.liveConsumerNode.length===1){(_a=node.unwatched)==null?void 0:_a.call(node.wrapper);for(let i=0;i0;}function assertConsumerNode(node){node.producerNode??(node.producerNode=[]);node.producerIndexOfThis??(node.producerIndexOfThis=[]);node.producerLastReadVersion??(node.producerLastReadVersion=[]);}function assertProducerNode(node){node.liveConsumerNode??(node.liveConsumerNode=[]);node.liveConsumerIndexOfThis??(node.liveConsumerIndexOfThis=[]);}/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function computedGet(node){producerUpdateValueVersion(node);producerAccessed(node);if(node.value===ERRORED){throw node.error;}return node.value;}function createComputed(computation){const node=Object.create(COMPUTED_NODE);node.computation=computation;const computed=()=>computedGet(node);computed[SIGNAL]=node;return computed;}const UNSET=/* @__PURE__ */Symbol("UNSET");const COMPUTING=/* @__PURE__ */Symbol("COMPUTING");const ERRORED=/* @__PURE__ */Symbol("ERRORED");const COMPUTED_NODE=/* @__PURE__ */(()=>{return{...REACTIVE_NODE,value:UNSET,dirty:true,error:null,equal:defaultEquals,producerMustRecompute(node){return node.value===UNSET||node.value===COMPUTING;},producerRecomputeValue(node){if(node.value===COMPUTING){throw new Error("Detected cycle in computations.");}const oldValue=node.value;node.value=COMPUTING;const prevConsumer=consumerBeforeComputation(node);let newValue;let wasEqual=false;try{newValue=node.computation.call(node.wrapper);const oldOk=oldValue!==UNSET&&oldValue!==ERRORED;wasEqual=oldOk&&node.equal.call(node.wrapper,oldValue,newValue);}catch(err){newValue=ERRORED;node.error=err;}finally{consumerAfterComputation(node,prevConsumer);}if(wasEqual){node.value=oldValue;return;}node.value=newValue;node.version++;}};})();/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function defaultThrowError(){throw new Error();}let throwInvalidWriteToSignalErrorFn=defaultThrowError;function throwInvalidWriteToSignalError(){throwInvalidWriteToSignalErrorFn();}/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */function createSignal(initialValue){const node=Object.create(SIGNAL_NODE);node.value=initialValue;const getter=()=>{producerAccessed(node);return node.value;};getter[SIGNAL]=node;return getter;}function signalGetFn(){producerAccessed(this);return this.value;}function signalSetFn(node,newValue){if(!producerUpdatesAllowed()){throwInvalidWriteToSignalError();}if(!node.equal.call(node.wrapper,node.value,newValue)){node.value=newValue;signalValueChanged(node);}}const SIGNAL_NODE=/* @__PURE__ */(()=>{return{...REACTIVE_NODE,equal:defaultEquals,value:void 0};})();function signalValueChanged(node){node.version++;producerIncrementEpoch();producerNotifyConsumers(node);}/** * @license * Copyright 2024 Bloomberg Finance L.P. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const NODE=Symbol("node");var Signal;(Signal2=>{var _a,_brand,brand_fn,_b,_brand2,brand_fn2;class State{constructor(initialValue,options={}){__privateAdd(this,_brand);__publicField(this,_a);const ref=createSignal(initialValue);const node=ref[SIGNAL];this[NODE]=node;node.wrapper=this;if(options){const equals=options.equals;if(equals){node.equal=equals;}node.watched=options[Signal2.subtle.watched];node.unwatched=options[Signal2.subtle.unwatched];}}get(){if(!(0,Signal2.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return signalGetFn.call(this[NODE]);}set(newValue){if(!(0,Signal2.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(isInNotificationPhase()){throw new Error("Writes to signals not permitted during Watcher callback");}const ref=this[NODE];signalSetFn(ref,newValue);}}_a=NODE;_brand=new WeakSet();brand_fn=function(){};Signal2.isState=s=>typeof s==="object"&&__privateIn(_brand,s);Signal2.State=State;class Computed{// Create a Signal which evaluates to the value returned by the callback. // Callback is called with this signal as the parameter. constructor(computation,options){__privateAdd(this,_brand2);__publicField(this,_b);const ref=createComputed(computation);const node=ref[SIGNAL];node.consumerAllowSignalWrites=true;this[NODE]=node;node.wrapper=this;if(options){const equals=options.equals;if(equals){node.equal=equals;}node.watched=options[Signal2.subtle.watched];node.unwatched=options[Signal2.subtle.unwatched];}}get(){if(!(0,Signal2.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return computedGet(this[NODE]);}}_b=NODE;_brand2=new WeakSet();brand_fn2=function(){};Signal2.isComputed=c=>typeof c==="object"&&__privateIn(_brand2,c);Signal2.Computed=Computed;(subtle2=>{var _a2,_brand3,brand_fn3,_assertSignals,assertSignals_fn;function untrack(cb){let output;let prevActiveConsumer=null;try{prevActiveConsumer=setActiveConsumer(null);output=cb();}finally{setActiveConsumer(prevActiveConsumer);}return output;}subtle2.untrack=untrack;function introspectSources(sink){var _a3;if(!(0,Signal2.isComputed)(sink)&&!(0,Signal2.isWatcher)(sink)){throw new TypeError("Called introspectSources without a Computed or Watcher argument");}return((_a3=sink[NODE].producerNode)==null?void 0:_a3.map(n=>n.wrapper))??[];}subtle2.introspectSources=introspectSources;function introspectSinks(signal){var _a3;if(!(0,Signal2.isComputed)(signal)&&!(0,Signal2.isState)(signal)){throw new TypeError("Called introspectSinks without a Signal argument");}return((_a3=signal[NODE].liveConsumerNode)==null?void 0:_a3.map(n=>n.wrapper))??[];}subtle2.introspectSinks=introspectSinks;function hasSinks(signal){if(!(0,Signal2.isComputed)(signal)&&!(0,Signal2.isState)(signal)){throw new TypeError("Called hasSinks without a Signal argument");}const liveConsumerNode=signal[NODE].liveConsumerNode;if(!liveConsumerNode)return false;return liveConsumerNode.length>0;}subtle2.hasSinks=hasSinks;function hasSources(signal){if(!(0,Signal2.isComputed)(signal)&&!(0,Signal2.isWatcher)(signal)){throw new TypeError("Called hasSources without a Computed or Watcher argument");}const producerNode=signal[NODE].producerNode;if(!producerNode)return false;return producerNode.length>0;}subtle2.hasSources=hasSources;class Watcher{// When a (recursive) source of Watcher is written to, call this callback, // if it hasn't already been called since the last `watch` call. // No signals may be read or written during the notify. constructor(notify){__privateAdd(this,_brand3);__privateAdd(this,_assertSignals);__publicField(this,_a2);let node=Object.create(REACTIVE_NODE);node.wrapper=this;node.consumerMarkedDirty=notify;node.consumerIsAlwaysLive=true;node.consumerAllowSignalWrites=false;node.producerNode=[];this[NODE]=node;}// Add these signals to the Watcher's set, and set the watcher to run its // notify callback next time any signal in the set (or one of its dependencies) changes. // Can be called with no arguments just to reset the "notified" state, so that // the notify callback will be invoked again. watch(...signals){if(!(0,Signal2.isWatcher)(this)){throw new TypeError("Called unwatch without Watcher receiver");}__privateMethod(this,_assertSignals,assertSignals_fn).call(this,signals);const node=this[NODE];node.dirty=false;const prev=setActiveConsumer(node);for(const signal of signals){producerAccessed(signal[NODE]);}setActiveConsumer(prev);}// Remove these signals from the watched set (e.g., for an effect which is disposed) unwatch(...signals){if(!(0,Signal2.isWatcher)(this)){throw new TypeError("Called unwatch without Watcher receiver");}__privateMethod(this,_assertSignals,assertSignals_fn).call(this,signals);const node=this[NODE];assertConsumerNode(node);for(let i=node.producerNode.length-1;i>=0;i--){if(signals.includes(node.producerNode[i].wrapper)){producerRemoveLiveConsumerAtIndex(node.producerNode[i],node.producerIndexOfThis[i]);const lastIdx=node.producerNode.length-1;node.producerNode[i]=node.producerNode[lastIdx];node.producerIndexOfThis[i]=node.producerIndexOfThis[lastIdx];node.producerNode.length--;node.producerIndexOfThis.length--;node.nextProducerIndex--;if(in.dirty).map(n=>n.wrapper);}}_a2=NODE;_brand3=new WeakSet();brand_fn3=function(){};_assertSignals=new WeakSet();assertSignals_fn=function(signals){for(const signal of signals){if(!(0,Signal2.isComputed)(signal)&&!(0,Signal2.isState)(signal)){throw new TypeError("Called watch/unwatch without a Computed or State argument");}}};Signal2.isWatcher=w=>__privateIn(_brand3,w);subtle2.Watcher=Watcher;function currentComputed(){var _a3;return(_a3=getActiveConsumer())==null?void 0:_a3.wrapper;}subtle2.currentComputed=currentComputed;subtle2.watched=Symbol("watched");subtle2.unwatched=Symbol("unwatched");})(Signal2.subtle||(Signal2.subtle={}));})(Signal||(Signal={})); ;// ../../node_modules/@lit-labs/signals/lib/signal-watcher.js /** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const signal_watcher_i=Symbol("SignalWatcherBrand"),signal_watcher_s=new FinalizationRegistry(({watcher:t,signal:i})=>{t.unwatch(i);}),signal_watcher_h=new WeakMap();function signal_watcher_e(e){return!0===e[signal_watcher_i]?(console.warn("SignalWatcher should not be applied to the same class more than once."),e):class extends e{constructor(){super(...arguments),this._$St=new t.State(0),this._$Si=!1,this._$So=!0,this._$Sh=new Set();}_$Sl(){if(void 0!==this._$Su)return;this._$Sv=new t.Computed(()=>{this._$St.get(),super.performUpdate();});const i=this._$Su=new t.subtle.Watcher(function(){const t=signal_watcher_h.get(this);void 0!==t&&(!1===t._$Si&&t.requestUpdate(),this.watch());});signal_watcher_h.set(i,this),signal_watcher_s.register(this,{watcher:i,signal:this._$Sv}),i.watch(this._$Sv);}_$Sp(){void 0!==this._$Su&&(this._$Su.unwatch(this._$Sv),this._$Sv=void 0,this._$Su=void 0);}performUpdate(){this.isUpdatePending&&(this._$Sl(),this._$Si=!0,this._$St.set(this._$St.get()+1),this._$Si=!1,this._$Sv.get());}update(t){try{this._$So?(this._$So=!1,super.update(t)):this._$Sh.forEach(t=>t.commit());}finally{this.isUpdatePending=!1,this._$Sh.clear();}}requestUpdate(t,i,s){this._$So=!0,super.requestUpdate(t,i,s);}connectedCallback(){super.connectedCallback(),this.requestUpdate();}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp();});}_(t){this._$Sh.add(t);const i=this._$So;this.requestUpdate(),this._$So=i;}m(t){this._$Sh.delete(t);}};} ;// ../../node_modules/lit-html/directive.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const directive_t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},directive_e=t=>(...e)=>({_$litDirective$:t,values:e});class directive_i{constructor(t){}get _$AU(){return this._$AM._$AU;}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e);}update(t,e){return this.render(...e);}} ;// ../../node_modules/lit/directive.js ;// ../../node_modules/lit-html/directive-helpers.js /** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const{I:directive_helpers_t}=Z,directive_helpers_i=o=>null===o||"object"!=typeof o&&"function"!=typeof o,directive_helpers_n={HTML:1,SVG:2,MATHML:3},directive_helpers_e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,directive_helpers_l=o=>null!=o?._$litType$?.h,directive_helpers_c=o=>void 0!==o?._$litDirective$,directive_helpers_d=o=>o?._$litDirective$,directive_helpers_f=o=>void 0===o.strings,directive_helpers_s=()=>document.createComment(""),directive_helpers_r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(directive_helpers_s(),l),c=e.insertBefore(directive_helpers_s(),l);n=new directive_helpers_t(i,c,o,o.options);}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t);}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t;}}}return n;},directive_helpers_v=(o,t,i=o)=>(o._$AI(t,i),o),directive_helpers_u={},directive_helpers_m=(o,t=directive_helpers_u)=>o._$AH=t,directive_helpers_p=o=>o._$AH,directive_helpers_M=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o;}},directive_helpers_h=o=>{o._$AR();}; ;// ../../node_modules/lit-html/async-directive.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const async_directive_s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),async_directive_s(i,t);return!0;},async_directive_o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t;}while(0===e?.size);},async_directive_r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set();else if(e.has(i))break;e.add(i),async_directive_c(t);}};function async_directive_h(i){void 0!==this._$AN?(async_directive_o(this),this._$AM=i,async_directive_r(this)):this._$AM=i;}function async_directive_n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t){if(Array.isArray(r))for(let i=e;i{i.type==directive_t.CHILD&&(i._$AP??=async_directive_n,i._$AQ??=async_directive_h);};class async_directive_f extends directive_i{constructor(){super(...arguments),this._$AN=void 0;}_$AT(i,t,e){super._$AT(i,t,e),async_directive_r(this),this.isConnected=i._$AU;}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(async_directive_s(this,i),async_directive_o(this));}setValue(t){if(directive_helpers_f(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0);}}disconnected(){}reconnected(){}} ;// ../../node_modules/lit/async-directive.js ;// ../../node_modules/@lit-labs/signals/lib/watch.js /** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class watch_h extends async_directive_f{_$Sl(){if(void 0!==this._$Su)return;this._$SW=new Signal.Computed(()=>{var i;return null===(i=this._$Sj)||void 0===i?void 0:i.get();});const i=this._$Su=new Signal.subtle.Watcher(()=>{var t;null===(t=this._$SO)||void 0===t||t._(this),i.watch();});i.watch(this._$SW);}_$Sp(){var i;void 0!==this._$Su&&(this._$Su.unwatch(this._$SW),this._$SW=void 0,this._$Su=void 0,null===(i=this._$SO)||void 0===i||i.m(this));}commit(){this.setValue(Signal.subtle.untrack(()=>{var i;return null===(i=this._$SW)||void 0===i?void 0:i.get();}));}render(i){return Signal.subtle.untrack(()=>i.get());}update(i,[t]){var h,o;return null!==(h=this._$SO)&&void 0!==h||(this._$SO=null===(o=i.options)||void 0===o?void 0:o.host),t!==this._$Sj&&void 0!==this._$Sj&&this._$Sp(),this._$Sj=t,this._$Sl(),Signal.subtle.untrack(()=>this._$SW.get());}disconnected(){this._$Sp();}reconnected(){this._$Sl();}}const watch_o=directive_e(watch_h); ;// ../../node_modules/lit/html.js ;// ../../node_modules/@lit-labs/signals/lib/html-tag.js /** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const html_tag_m=o=>(t,...m)=>o(t,...m.map(o=>o instanceof Signal.State||o instanceof Signal.Computed?watch_o(o):o)),html_tag_l=html_tag_m(x),html_tag_r=html_tag_m(lit_html_b); ;// ../../node_modules/@lit-labs/signals/index.js /** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const signals_l=Signal.State,signals_o=Signal.Computed,signals_r=(l,o)=>new Signal.State(l,o),signals_i=(l,o)=>new t.Computed(l,o); ;// ./src/autofill/content/components/signals/selected-cipher.ts const selected_cipher_selectedCipher = signals_r(null); ;// ./src/autofill/content/components/cipher/cipher-action.ts function CipherAction({ cipherId, handleAction = () => { /* no-op */ }, i18n, itemName, notificationType, theme, username, }) { const selectCipherHandleAction = (e) => { selected_cipher_selectedCipher.set(cipherId); try { handleAction(e); } finally { selected_cipher_selectedCipher.set(null); } }; return notificationType === NotificationTypes.Change ? BadgeButton({ buttonAction: selectCipherHandleAction, buttonText: i18n.notificationUpdate, itemName, theme, username, }) : EditButton({ buttonAction: handleAction, buttonText: i18n.notificationEditTooltip, theme, }); } ;// ./src/autofill/content/components/cipher/cipher-icon.ts /** * @param {string} props.color contextual color override if no icon URI is available * @param {string} props.size valid CSS `width` value, represents the width-basis of the graphic, with height maintaining original aspect-ratio */ function CipherIcon({ color, size, theme, uri }) { const iconClass = cipherIconStyle({ width: size }); return uri ? x `` : x `${Globe({ color, theme })}`; } const cipherIconStyle = ({ width }) => emotion_css_esm_css ` width: ${width}; height: fit-content; `; ;// ./src/autofill/content/components/cipher/types.ts const CipherTypes = { Login: 1, SecureNote: 2, Card: 3, Identity: 4, }; const CipherRepromptTypes = { None: 0, Password: 1, }; const OrganizationCategories = { business: "business", family: "family", }; ;// ./src/autofill/content/components/cipher/cipher-indicator-icons.ts const cipherIndicatorIconsMap = { [OrganizationCategories.business]: Business, [OrganizationCategories.family]: Family, }; function CipherInfoIndicatorIcons({ organizationCategories = [], theme, }) { return x ` ${organizationCategories.map((name) => { var _a; return (_a = cipherIndicatorIconsMap[name]) === null || _a === void 0 ? void 0 : _a.call(cipherIndicatorIconsMap, { color: styles_themes[theme].text.muted, theme }); })} `; } const cipherInfoIndicatorIconsStyles = emotion_css_esm_css ` > svg { width: fit-content; height: 12px; } `; ;// ./src/autofill/content/components/cipher/cipher-info.ts function CipherInfo({ cipher, theme }) { const { name, login, organizationCategories } = cipher; const hasIndicatorIcons = organizationCategories === null || organizationCategories === void 0 ? void 0 : organizationCategories.length; return x `
${[ name, hasIndicatorIcons ? CipherInfoIndicatorIcons({ theme, organizationCategories, }) : E, ]} ${(login === null || login === void 0 ? void 0 : login.username) ? x `${login.username}` : null}
`; } const cipherInfoPrimaryTextStyles = (theme) => emotion_css_esm_css ` ${typography.body2} gap: 2px; display: flex; display: block; overflow-x: hidden; text-overflow: ellipsis; color: ${styles_themes[theme].text.main}; font-weight: 500; `; const cipherInfoSecondaryTextStyles = (theme) => emotion_css_esm_css ` ${typography.helperMedium} display: block; overflow-x: hidden; text-overflow: ellipsis; color: ${styles_themes[theme].text.muted}; font-weight: 400; `; ;// ./src/autofill/content/components/cipher/cipher-item.ts const cipherIconWidth = "24px"; function CipherItem({ cipher, handleAction, i18n, notificationType, theme = ThemeTypes.Light, }) { const { icon, name, login } = cipher; const uri = (icon.imageEnabled && icon.image) || undefined; let cipherActionButton = null; if (notificationType === NotificationTypes.Change || notificationType === NotificationTypes.Add) { cipherActionButton = x `
${CipherAction({ cipherId: cipher.id, handleAction, i18n, itemName: name, notificationType, theme, username: login === null || login === void 0 ? void 0 : login.username, })}
`; } return x `
${CipherIcon({ color: styles_themes[theme].text.muted, size: cipherIconWidth, theme, uri })} ${CipherInfo({ theme, cipher })}
${cipherActionButton} `; } const cipherItemStyles = emotion_css_esm_css ` gap: ${spacing["2"]}; display: flex; flex-wrap: nowrap; align-items: center; justify-content: start; > img, > span { display: flex; } > div { max-width: calc(100% - ${cipherIconWidth} - ${spacing["2"]}); } `; ;// ./src/autofill/content/components/rows/cipher-item-row.ts function CipherItemRow({ cipher, i18n, notificationType, theme, handleAction, }) { return x `
${CipherItem({ cipher, i18n, notificationType, theme, handleAction, })}
`; } const cipherItemRowStyles = ({ theme }) => emotion_css_esm_css ` ${typography.body1} gap: ${spacing["2"]}; display: flex; align-items: center; justify-content: space-between; border-width: 0 0 0.5px 0; border-style: solid; border-radius: ${spacing["2"]}; border-color: ${styles_themes[theme].secondary["300"]}; background-color: ${styles_themes[theme].background.DEFAULT}; padding: ${spacing["2"]} ${spacing["3"]}; min-height: min-content; max-height: 52px; overflow-x: hidden; white-space: nowrap; color: ${styles_themes[theme].text.main}; font-weight: 400; > div { :first-child { flex: 3 3 75%; min-width: 25%; } :not(:first-child) { display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: flex-end; max-width: 25%; > button { max-width: min-content; } } } `; ;// ./src/autofill/content/components/notification/body.ts const notification_body_componentClassPrefix = "notification-body"; const { css: notification_body_css } = createEmotion({ key: notification_body_componentClassPrefix, }); function NotificationBody({ ciphers = [], i18n, notificationType, theme = ThemeTypes.Light, handleEditOrUpdateAction, }) { // @TODO get client vendor from context const isSafari = false; return x `
${ciphers.map((cipher) => CipherItemRow({ cipher, theme, i18n, notificationType, handleAction: handleEditOrUpdateAction, }))}
`; } const notificationBodyStyles = ({ isSafari, theme }) => notification_body_css ` ${typography.body1} gap: ${spacing["1.5"]}; display: flex; flex-flow: column; background-color: ${styles_themes[theme].background.alt}; max-height: 123px; overflow-x: hidden; overflow-y: auto; white-space: nowrap; color: ${styles_themes[theme].text.main}; font-weight: 400; :last-child { border-radius: 0 0 ${spacing["4"]} ${spacing["4"]}; } ${isSafari ? scrollbarStyles(theme).safari : scrollbarStyles(theme).default} `; ;// ../../libs/common/src/billing/enums/payment-method-type.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var PaymentMethodType; (function (PaymentMethodType) { PaymentMethodType[PaymentMethodType["Card"] = 0] = "Card"; PaymentMethodType[PaymentMethodType["BankAccount"] = 1] = "BankAccount"; PaymentMethodType[PaymentMethodType["PayPal"] = 2] = "PayPal"; PaymentMethodType[PaymentMethodType["BitPay"] = 3] = "BitPay"; PaymentMethodType[PaymentMethodType["Credit"] = 4] = "Credit"; PaymentMethodType[PaymentMethodType["WireTransfer"] = 5] = "WireTransfer"; PaymentMethodType[PaymentMethodType["Check"] = 8] = "Check"; })(PaymentMethodType || (PaymentMethodType = {})); ;// ../../libs/common/src/billing/enums/plan-sponsorship-type.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var PlanSponsorshipType; (function (PlanSponsorshipType) { PlanSponsorshipType[PlanSponsorshipType["FamiliesForEnterprise"] = 0] = "FamiliesForEnterprise"; })(PlanSponsorshipType || (PlanSponsorshipType = {})); ;// ../../libs/common/src/billing/enums/plan-type.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var PlanType; (function (PlanType) { PlanType[PlanType["Free"] = 0] = "Free"; PlanType[PlanType["FamiliesAnnually2019"] = 1] = "FamiliesAnnually2019"; PlanType[PlanType["TeamsMonthly2019"] = 2] = "TeamsMonthly2019"; PlanType[PlanType["TeamsAnnually2019"] = 3] = "TeamsAnnually2019"; PlanType[PlanType["EnterpriseMonthly2019"] = 4] = "EnterpriseMonthly2019"; PlanType[PlanType["EnterpriseAnnually2019"] = 5] = "EnterpriseAnnually2019"; PlanType[PlanType["Custom"] = 6] = "Custom"; PlanType[PlanType["FamiliesAnnually2025"] = 7] = "FamiliesAnnually2025"; PlanType[PlanType["TeamsMonthly2020"] = 8] = "TeamsMonthly2020"; PlanType[PlanType["TeamsAnnually2020"] = 9] = "TeamsAnnually2020"; PlanType[PlanType["EnterpriseMonthly2020"] = 10] = "EnterpriseMonthly2020"; PlanType[PlanType["EnterpriseAnnually2020"] = 11] = "EnterpriseAnnually2020"; PlanType[PlanType["TeamsMonthly2023"] = 12] = "TeamsMonthly2023"; PlanType[PlanType["TeamsAnnually2023"] = 13] = "TeamsAnnually2023"; PlanType[PlanType["EnterpriseMonthly2023"] = 14] = "EnterpriseMonthly2023"; PlanType[PlanType["EnterpriseAnnually2023"] = 15] = "EnterpriseAnnually2023"; PlanType[PlanType["TeamsStarter2023"] = 16] = "TeamsStarter2023"; PlanType[PlanType["TeamsMonthly"] = 17] = "TeamsMonthly"; PlanType[PlanType["TeamsAnnually"] = 18] = "TeamsAnnually"; PlanType[PlanType["EnterpriseMonthly"] = 19] = "EnterpriseMonthly"; PlanType[PlanType["EnterpriseAnnually"] = 20] = "EnterpriseAnnually"; PlanType[PlanType["TeamsStarter"] = 21] = "TeamsStarter"; PlanType[PlanType["FamiliesAnnually"] = 22] = "FamiliesAnnually"; })(PlanType || (PlanType = {})); ;// ../../libs/common/src/billing/enums/transaction-type.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var TransactionType; (function (TransactionType) { TransactionType[TransactionType["Charge"] = 0] = "Charge"; TransactionType[TransactionType["Credit"] = 1] = "Credit"; TransactionType[TransactionType["PromotionalCredit"] = 2] = "PromotionalCredit"; TransactionType[TransactionType["ReferralCredit"] = 3] = "ReferralCredit"; TransactionType[TransactionType["Refund"] = 4] = "Refund"; })(TransactionType || (TransactionType = {})); ;// ../../libs/common/src/billing/enums/product-tier-type.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var ProductTierType; (function (ProductTierType) { ProductTierType[ProductTierType["Free"] = 0] = "Free"; ProductTierType[ProductTierType["Families"] = 1] = "Families"; ProductTierType[ProductTierType["Teams"] = 2] = "Teams"; ProductTierType[ProductTierType["Enterprise"] = 3] = "Enterprise"; ProductTierType[ProductTierType["TeamsStarter"] = 4] = "TeamsStarter"; })(ProductTierType || (ProductTierType = {})); function isNotSelfUpgradable(productType) { return (productType !== ProductTierType.Free && productType !== ProductTierType.TeamsStarter && productType !== ProductTierType.Families); } ;// ../../libs/common/src/billing/enums/product-type.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var ProductType; (function (ProductType) { ProductType[ProductType["PasswordManager"] = 0] = "PasswordManager"; ProductType[ProductType["SecretsManager"] = 1] = "SecretsManager"; })(ProductType || (ProductType = {})); ;// ../../libs/common/src/billing/enums/plan-interval.enum.ts // FIXME: update to use a const object instead of a typescript enum // eslint-disable-next-line @bitwarden/platform/no-enums var PlanInterval; (function (PlanInterval) { PlanInterval[PlanInterval["Monthly"] = 0] = "Monthly"; PlanInterval[PlanInterval["Annually"] = 1] = "Annually"; })(PlanInterval || (PlanInterval = {})); ;// ../../libs/common/src/billing/enums/index.ts ;// ../../node_modules/@lit/reactive-element/decorators/property.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const property_o={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f},property_r=(t=property_o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map()),"setter"===n&&((t=Object.create(t)).wrapped=!0),s.set(r.name,t),"accessor"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e;}};}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);};}throw Error("Unsupported decorator location: "+n);};function property_n(t){return(e,o)=>"object"==typeof o?property_r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0;})(t,e,o);} ;// ../../node_modules/@lit/reactive-element/decorators/state.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function state_r(r){return property_n({...r,state:!0,attribute:!1});} ;// ../../node_modules/lit/decorators.js ;// ./src/autofill/content/components/buttons/option-selection-button.ts function OptionSelectionButton({ disabled, icon, id, text, theme, toggledOn, handleButtonClick, }) { const selectedOptionIconProps = { color: styles_themes[theme].text.muted, theme }; const buttonIcon = icon === null || icon === void 0 ? void 0 : icon(selectedOptionIconProps); return x ` `; } const iconSize = "16px"; const selectionButtonStyles = ({ disabled, toggledOn, theme, }) => emotion_css_esm_css ` ${typography.body2} gap: ${spacing["1.5"]}; user-select: none; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: space-between; columns: ${iconSize} max-content ${iconSize}; border-radius: ${border.radius.full}; padding: ${spacing["1"]} ${spacing["2"]}; max-height: fit-content; overflow: hidden; text-align: center; text-overflow: ellipsis; font-weight: 400; ${disabled ? ` border: 1px solid ${styles_themes[theme].secondary["300"]}; background-color: ${styles_themes[theme].secondary["300"]}; cursor: not-allowed; color: ${styles_themes[theme].text.muted}; ` : ` border: 1px solid ${styles_themes[theme].text.muted}; background-color: ${toggledOn ? styles_themes[theme].secondary["100"] : "transparent"}; cursor: pointer; color: ${styles_themes[theme].text.muted}; :hover { border-color: ${styles_themes[theme].secondary["700"]}; background-color: ${styles_themes[theme].secondary["100"]}; } `} > svg { max-width: ${iconSize}; max-height: ${iconSize}; height: auto; } `; const dropdownButtonTextStyles = emotion_css_esm_css ` overflow-x: hidden; text-overflow: ellipsis; `; ;// ./src/autofill/content/components/option-selection/option-item.ts const optionItemTagName = "option-item"; const { css: option_item_css } = createEmotion({ key: optionItemTagName, }); function OptionItem({ contextLabel, id, icon, text, theme, value, handleSelection, }) { const handleSelectionKeyUpProxy = (event) => { const listenedForKeys = new Set(["Enter", "Space"]); if (listenedForKeys.has(event.code) && event.target instanceof Element) { handleSelection(); } return; }; const iconProps = { color: styles_themes[theme].text.main, theme }; const itemIcon = icon === null || icon === void 0 ? void 0 : icon(iconProps); const ariaLabel = contextLabel && text ? chrome.i18n.getMessage("selectItemAriaLabel", [contextLabel, text]) : text; return x `
${itemIcon ? x `
${itemIcon}
` : E} ${text || value}
`; } const optionItemIconWidth = 16; const optionItemGap = spacing["2"]; const optionItemStyles = option_item_css ` gap: ${optionItemGap}; user-select: none; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-start; cursor: pointer; `; const optionItemIconContainerStyles = option_item_css ` display: flex; flex-grow: 1; flex-shrink: 1; max-width: ${optionItemIconWidth}px; max-height: ${optionItemIconWidth}px; > svg { width: 100%; height: auto; } `; const optionItemTextStyles = option_item_css ` flex: 1 1 calc(100% - ${optionItemIconWidth}px - ${optionItemGap}); overflow-x: hidden; text-overflow: ellipsis; white-space: nowrap; `; ;// ./src/autofill/content/components/option-selection/option-items.ts const optionItemsTagName = "option-items"; const { css: option_items_css } = createEmotion({ key: optionItemsTagName, }); function OptionItems({ id, theme, topOffset, label, options, handleOptionSelection, }) { // @TODO get client vendor from context const isSafari = false; return x `
handleMenuKeyUp(e)} > ${label ? x `
${label}
` : E}
${options.map((option) => OptionItem(Object.assign(Object.assign({ id }, option), { theme, contextLabel: label, handleSelection: () => handleOptionSelection(option) })))}
`; } function handleMenuKeyUp(event) { var _a; const items = [ ...event.currentTarget.querySelectorAll('[tabindex="0"]'), ]; const index = items.indexOf(document.activeElement); const direction = event.key === "ArrowDown" ? 1 : event.key === "ArrowUp" ? -1 : 0; if (index === -1 || direction === 0) { return; } event.preventDefault(); (_a = items[(index + direction + items.length) % items.length]) === null || _a === void 0 ? void 0 : _a.focus(); } const optionsStyles = ({ theme, topOffset }) => option_items_css ` ${typography.body1} -webkit-font-smoothing: antialiased; position: absolute; /* top offset + line-height of dropdown button + top and bottom padding of button + border-width */ top: calc(${topOffset}px + 20px + ${spacing["1"]} + ${spacing["1"]} + 1px); border: 1px solid ${styles_themes[theme].secondary["500"]}; border-radius: 0.5rem; background-clip: padding-box; background-color: ${styles_themes[theme].background.DEFAULT}; padding: 0.25rem 0; max-width: fit-content; overflow-y: hidden; color: ${styles_themes[theme].text.main}; `; const optionsLabelStyles = ({ theme }) => option_items_css ` ${typography.helperMedium} user-select: none; padding: 0.375rem ${spacing["3"]}; color: ${styles_themes[theme].text.muted}; font-weight: 500; `; const optionsMenuItemMaxWidth = 260; const optionsMenuItemsMaxHeight = 114; const optionsWrapper = ({ isSafari, theme }) => option_items_css ` max-height: ${optionsMenuItemsMaxHeight}px; overflow-y: auto; > [class*="${optionItemTagName}-"] { padding: ${spacing["1.5"]} ${spacing["3"]}; max-width: ${optionsMenuItemMaxWidth}px; :hover { background-color: ${styles_themes[theme].primary["100"]}; } } ${isSafari ? scrollbarStyles(theme, { track: "transparent" }).safari : scrollbarStyles(theme, { track: "transparent" }).default} `; ;// ./src/autofill/content/components/option-selection/option-selection.ts var option_selection_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var option_selection_metadata = (undefined && undefined.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var option_selection_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; const optionSelectionTagName = "option-selection"; const { css: option_selection_css } = createEmotion({ key: optionSelectionTagName, }); class OptionSelection extends lit_element_i { constructor() { super(...arguments); this.disabled = false; this.id = ""; this.options = []; this.theme = ThemeTypes.Light; this.showMenu = false; this.menuTopOffset = 0; // Determines if the opened menu should be "anchored" to the right or left side of the opening button this.menuIsEndJustified = false; this.handleButtonClick = (event) => option_selection_awaiter(this, void 0, void 0, function* () { if (!this.disabled) { const isOpening = !this.showMenu; if (isOpening) { if (OptionSelection.currentOpenInstance && OptionSelection.currentOpenInstance !== this) { OptionSelection.currentOpenInstance.showMenu = false; } OptionSelection.currentOpenInstance = this; this.menuTopOffset = this.offsetTop; // Distance from right edge of button to left edge of the viewport // Assumes no enclosing frames between the intended host frame and the component const boundingClientRect = this.getBoundingClientRect(); // Width of the client (minus scrollbar) const documentWidth = document.documentElement.clientWidth; // Distance between left edge of the button and right edge of the viewport // (e.g. the max space the menu can use when left-aligned) const distanceFromViewportRightEdge = documentWidth - boundingClientRect.left; // The full width the option menu can take up // (base + icon + border + gap + padding) const maxDifferenceThreshold = optionsMenuItemMaxWidth + optionItemIconWidth + 2 + 8 + 12 * 2; this.menuIsEndJustified = distanceFromViewportRightEdge < maxDifferenceThreshold; } else { if (OptionSelection.currentOpenInstance === this) { OptionSelection.currentOpenInstance = null; } } this.showMenu = isOpening; if (this.showMenu) { yield this.updateComplete; const firstItem = this.querySelector('#option-menu [tabindex="0"]'); firstItem === null || firstItem === void 0 ? void 0 : firstItem.focus(); } } }); this.handleFocusOut = (event) => { const relatedTarget = event.relatedTarget; if (!(relatedTarget instanceof Node) || !this.contains(relatedTarget)) { this.showMenu = false; if (OptionSelection.currentOpenInstance === this) { OptionSelection.currentOpenInstance = null; } } }; this.handleOptionSelection = (selectedOption) => { var _a, _b; this.showMenu = false; this.selection = selectedOption; (_a = this.selectedSignal) === null || _a === void 0 ? void 0 : _a.set(selectedOption.value); // Any side-effects that should occur from the selection (_b = this.handleSelectionUpdate) === null || _b === void 0 ? void 0 : _b.call(this, selectedOption.value); }; } createRenderRoot() { return this; } render() { var _a, _b; if (!this.selection) { this.selection = getDefaultOption(this.options); } return x `
${OptionSelectionButton({ disabled: this.disabled, icon: (_a = this.selection) === null || _a === void 0 ? void 0 : _a.icon, id: this.id, text: (_b = this.selection) === null || _b === void 0 ? void 0 : _b.text, theme: this.theme, toggledOn: this.showMenu, handleButtonClick: this.handleButtonClick, })} ${this.showMenu ? OptionItems({ id: this.id, label: this.label, options: this.options, theme: this.theme, topOffset: this.menuTopOffset, handleOptionSelection: this.handleOptionSelection, }) : E}
`; } } OptionSelection.currentOpenInstance = null; option_selection_decorate([ property_n(), option_selection_metadata("design:type", Boolean) ], OptionSelection.prototype, "disabled", void 0); option_selection_decorate([ property_n(), option_selection_metadata("design:type", String) ], OptionSelection.prototype, "id", void 0); option_selection_decorate([ property_n(), option_selection_metadata("design:type", String) ], OptionSelection.prototype, "label", void 0); option_selection_decorate([ property_n({ type: Array }), option_selection_metadata("design:type", Array) ], OptionSelection.prototype, "options", void 0); option_selection_decorate([ property_n(), option_selection_metadata("design:type", String) ], OptionSelection.prototype, "theme", void 0); option_selection_decorate([ property_n({ type: (selectedOption) => selectedOption }), option_selection_metadata("design:type", Function) ], OptionSelection.prototype, "handleSelectionUpdate", void 0); option_selection_decorate([ property_n({ attribute: false }), option_selection_metadata("design:type", Object) ], OptionSelection.prototype, "selectedSignal", void 0); option_selection_decorate([ state_r(), option_selection_metadata("design:type", Object) ], OptionSelection.prototype, "showMenu", void 0); option_selection_decorate([ state_r(), option_selection_metadata("design:type", Number) ], OptionSelection.prototype, "menuTopOffset", void 0); option_selection_decorate([ state_r(), option_selection_metadata("design:type", Boolean) ], OptionSelection.prototype, "menuIsEndJustified", void 0); option_selection_decorate([ state_r(), option_selection_metadata("design:type", Object) ], OptionSelection.prototype, "selection", void 0); /* harmony default export */ var option_selection = (customElements.define(optionSelectionTagName, OptionSelection)); function getDefaultOption(options = []) { return options.find((option) => option.default) || options[0]; } const optionSelectionStyles = ({ menuIsEndJustified }) => option_selection_css ` display: flex; justify-content: ${menuIsEndJustified ? "flex-end" : "flex-start"}; > div, > button { width: 100%; } `; ;// ./src/autofill/content/components/rows/button-row.ts function ButtonRow({ theme, primaryButton, selectButtons }) { return x `
${ActionButton({ handleClick: primaryButton.handlePrimaryButtonClick, buttonText: primaryButton.text, isLoading: primaryButton.isLoading, theme, })}
${selectButtons === null || selectButtons === void 0 ? void 0 : selectButtons.map(({ id, label, options, handleSelectionUpdate, selectedSignal }) => x ` ` || E)}
`; } const buttonRowStyles = emotion_css_esm_css ` gap: ${spacing[4]}; display: flex; align-items: center; justify-content: space-between; width: 100%; max-height: 52px; white-space: nowrap; padding-top: ${spacing[1]}; > button { max-width: min-content; flex: 1 1 25%; } > div { flex: 1 1 min-content; } `; const optionSelectionsStyles = emotion_css_esm_css ` gap: ${spacing["2"]}; display: flex; align-items: center; justify-content: flex-end; overflow: hidden; > ${optionSelectionTagName} { /* assumes two option selections */ max-width: calc(50% - ${spacing["1.5"]}); min-width: 120px; } `; ;// ./src/autofill/content/components/signals/selected-collection.ts const selectedCollection = signals_r("0"); ;// ./src/autofill/content/components/signals/selected-folder.ts const selected_folder_selectedFolder = signals_r("0"); ;// ./src/autofill/content/components/signals/selected-vault.ts const selected_vault_selectedVault = signals_r("0"); ;// ./src/autofill/content/components/notification/button-row.ts function getVaultIconByProductTier(productTierType) { switch (productTierType) { case ProductTierType.Free: case ProductTierType.Families: return Family; case ProductTierType.Teams: case ProductTierType.Enterprise: case ProductTierType.TeamsStarter: return Business; default: return User; } } // Value represents default selector state outside of data-driven state const defaultNoneSelectValue = "0"; function NotificationButtonRow({ collections, folders, i18n, organizations, primaryButton, personalVaultIsAllowed, theme, }) { const currentUserVaultOption = { icon: User, default: true, text: i18n.myVault, value: defaultNoneSelectValue, }; // Do not include user vault if disallowed by org policy const initialVaultOptions = [ ...(personalVaultIsAllowed ? [currentUserVaultOption] : []), ]; const vaultOptions = (organizations === null || organizations === void 0 ? void 0 : organizations.length) ? organizations.reduce((options, { id, name, productTierType }) => { const icon = getVaultIconByProductTier(productTierType); return [ ...options, { icon, text: name, value: id, }, ]; }, initialVaultOptions) : initialVaultOptions; const folderOptions = (folders === null || folders === void 0 ? void 0 : folders.length) ? folders.reduce((options, { id, name }) => [ ...options, { icon: Folder, text: name, value: id === null ? defaultNoneSelectValue : id, default: id === null, }, ], []) : []; const collectionOptions = (collections === null || collections === void 0 ? void 0 : collections.length) ? collections.reduce((options, { id, name }) => [ ...options, { icon: CollectionShared, text: name, value: id === null ? defaultNoneSelectValue : id, default: id === null, }, ], []) : []; if (vaultOptions.length === 1) { selected_vault_selectedVault === null || selected_vault_selectedVault === void 0 ? void 0 : selected_vault_selectedVault.set(vaultOptions[0].value); // If the individual vault is disabled by a vault policy, // a collection selection is required if (!personalVaultIsAllowed && (collections === null || collections === void 0 ? void 0 : collections.length) && selectedCollection.get() === defaultNoneSelectValue) { selectedCollection === null || selectedCollection === void 0 ? void 0 : selectedCollection.set(collections[0].id); } } return x ` ${ButtonRow({ theme, primaryButton, selectButtons: [ ...(vaultOptions.length > 1 ? [ { id: "organization", label: i18n.vault, options: vaultOptions, selectedSignal: selected_vault_selectedVault, }, ] : []), ...(folderOptions.length > 1 && !collectionOptions.length ? [ { id: "folder", label: i18n.folder, options: folderOptions, selectedSignal: selected_folder_selectedFolder, }, ] : []), ...(collectionOptions.length > 1 ? [ { id: "collection", label: i18n.collection, options: collectionOptions, selectedSignal: selectedCollection, }, ] : []), ], })} `; } ;// ./src/autofill/content/components/notification/footer.ts function NotificationFooter({ collections, folders, i18n, isLoading, notificationType, organizations, personalVaultIsAllowed, theme, handleSaveAction, }) { const isChangeNotification = notificationType === NotificationTypes.Change; const isUnlockNotification = notificationType === NotificationTypes.Unlock; let primaryButtonText = i18n.saveAction; if (isUnlockNotification) { primaryButtonText = i18n.notificationUnlock; } return x `
${!isChangeNotification ? NotificationButtonRow({ collections, folders, organizations, i18n, primaryButton: { handlePrimaryButtonClick: handleSaveAction, isLoading, text: primaryButtonText, }, personalVaultIsAllowed, theme, }) : E}
`; } const notificationFooterStyles = ({ isChangeNotification, }) => emotion_css_esm_css ` display: flex; padding: ${spacing[2]} ${spacing[4]} ${isChangeNotification ? spacing[1] : spacing[4]} ${spacing[4]}; :last-child { border-radius: 0 0 ${spacing["4"]} ${spacing["4"]}; } `; ;// ./src/autofill/content/components/notification/container.ts function NotificationContainer({ handleCloseNotification, handleEditOrUpdateAction, handleSaveAction, ciphers, collections, folders, headerMessage, i18n, isLoading, organizations, personalVaultIsAllowed = true, notificationTestId, theme = ThemeTypes.Light, type, }) { const showBody = type !== NotificationTypes.Unlock; return x `
${NotificationHeader({ handleCloseNotification, i18n, message: headerMessage, theme, })} ${showBody ? NotificationBody({ handleEditOrUpdateAction, ciphers, notificationType: type, theme, i18n, }) : E} ${NotificationFooter({ handleSaveAction, collections, folders, i18n, isLoading, notificationType: type, organizations, personalVaultIsAllowed, theme, })}
`; } const container_notificationContainerStyles = (theme) => emotion_css_esm_css ` position: absolute; right: 20px; border: 1px solid ${styles_themes[theme].secondary["300"]}; border-radius: ${spacing["4"]}; box-shadow: -2px 4px 6px 0px #0000001a; background-color: ${styles_themes[theme].background.alt}; width: 400px; [class*="${componentClassPrefix}-"] { border-radius: ${spacing["4"]} ${spacing["4"]} 0 0; } [class*="${notification_body_componentClassPrefix}-"] { margin: ${spacing["3"]} 0 0 ${spacing["3"]}; padding-right: ${spacing["3"]}; } `; ;// ./src/autofill/notification/bar.ts var bar_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; let notificationBarIframeInitData = {}; let windowMessageOrigin; const urlParams = new URLSearchParams(globalThis.location.search); const trustedParentOrigin = urlParams.get("parentOrigin"); if (trustedParentOrigin) { windowMessageOrigin = trustedParentOrigin; } const notificationBarWindowMessageHandlers = { initNotificationBar: ({ message }) => initNotificationBar(message), saveCipherAttemptCompleted: ({ message }) => handleSaveCipherConfirmation(message), }; globalThis.addEventListener("load", load); function load() { setupWindowMessageListener(); postMessageToParent({ command: "initNotificationBar" }); } function getI18n() { return { appName: chrome.i18n.getMessage("appName"), atRiskPassword: chrome.i18n.getMessage("atRiskPassword"), changePassword: chrome.i18n.getMessage("changePassword"), close: chrome.i18n.getMessage("close"), collection: chrome.i18n.getMessage("collection"), folder: chrome.i18n.getMessage("folder"), loginSaveConfirmation: chrome.i18n.getMessage("loginSaveConfirmation"), loginSaveSuccess: chrome.i18n.getMessage("loginSaveSuccess"), loginUpdatedConfirmation: chrome.i18n.getMessage("loginUpdatedConfirmation"), loginUpdateSuccess: chrome.i18n.getMessage("loginUpdateSuccess"), loginUpdateTaskSuccess: chrome.i18n.getMessage("loginUpdateTaskSuccess"), loginUpdateTaskSuccessAdditional: chrome.i18n.getMessage("loginUpdateTaskSuccessAdditional"), myVault: chrome.i18n.getMessage("myVault"), never: chrome.i18n.getMessage("never"), newItem: chrome.i18n.getMessage("newItem"), nextSecurityTaskAction: chrome.i18n.getMessage("nextSecurityTaskAction"), notificationAddDesc: chrome.i18n.getMessage("notificationAddDesc"), notificationAddSave: chrome.i18n.getMessage("notificationAddSave"), notificationChangeDesc: chrome.i18n.getMessage("notificationChangeDesc"), notificationEdit: chrome.i18n.getMessage("edit"), notificationEditTooltip: chrome.i18n.getMessage("notificationEditTooltip"), notificationLoginSaveConfirmation: chrome.i18n.getMessage("notificationLoginSaveConfirmation"), notificationLoginUpdatedConfirmation: chrome.i18n.getMessage("notificationLoginUpdatedConfirmation"), notificationUnlock: chrome.i18n.getMessage("notificationUnlock"), notificationUnlockDesc: chrome.i18n.getMessage("notificationUnlockDesc"), notificationUpdate: chrome.i18n.getMessage("notificationChangeSave"), notificationViewAria: chrome.i18n.getMessage("notificationViewAria"), saveAction: chrome.i18n.getMessage("notificationAddSave"), saveAsNewLoginAction: chrome.i18n.getMessage("saveAsNewLoginAction"), saveFailure: chrome.i18n.getMessage("saveFailure"), saveFailureDetails: chrome.i18n.getMessage("saveFailureDetails"), saveLogin: chrome.i18n.getMessage("saveLogin"), typeLogin: chrome.i18n.getMessage("typeLogin"), unlockToSave: chrome.i18n.getMessage("unlockToSave"), updateLogin: chrome.i18n.getMessage("updateLogin"), updateLoginAction: chrome.i18n.getMessage("updateLoginAction"), vault: chrome.i18n.getMessage("vault"), view: chrome.i18n.getMessage("view"), }; } /** * Returns the localized header message for the notification bar based on the notification type. * * @returns The localized header message string, or undefined if the type is not recognized. */ function getNotificationHeaderMessage(i18n, type) { return type ? { [NotificationTypes.Add]: i18n.saveLogin, [NotificationTypes.Change]: i18n.updateLogin, [NotificationTypes.Unlock]: i18n.unlockToSave, [NotificationTypes.AtRiskPassword]: i18n.atRiskPassword, }[type] : undefined; } /** * Returns the localized header message for the confirmation message bar based on the notification type. * * @returns The localized header message string, or undefined if the type is not recognized. */ function getConfirmationHeaderMessage(i18n, type, error) { if (error) { return i18n.saveFailure; } return type ? { [NotificationTypes.Add]: i18n.loginSaveSuccess, [NotificationTypes.Change]: i18n.loginUpdateSuccess, [NotificationTypes.Unlock]: "", [NotificationTypes.AtRiskPassword]: "", }[type] : undefined; } /** * Appends the header message to the document title. * If the header message is already present, it avoids duplication. */ function appendHeaderMessageToTitle(headerMessage) { if (!headerMessage) { return; } const baseTitle = document.title.split(" - ")[0]; document.title = `${baseTitle} - ${headerMessage}`; } /** * Determines the effective notification type to use based on initialization data. * * If the vault is locked, the notification type will be set to `Unlock`. * Otherwise, the type provided in the init data is returned. * * @returns The resolved `NotificationType` to be used for rendering logic. */ function resolveNotificationType(initData) { if (initData.isVaultLocked) { return NotificationTypes.Unlock; } return initData.type; } /** * Returns the appropriate test ID based on the resolved notification type. * * @param type - The resolved NotificationType. * @param isConfirmation - Optional flag for confirmation vs. notification container. */ function getNotificationTestId(notificationType, isConfirmation = false) { if (isConfirmation) { return "confirmation-notification-bar"; } return { [NotificationTypes.Unlock]: "unlock-notification-bar", [NotificationTypes.Add]: "save-notification-bar", [NotificationTypes.Change]: "update-notification-bar", [NotificationTypes.AtRiskPassword]: "at-risk-notification-bar", }[notificationType]; } function initNotificationBar(message) { return bar_awaiter(this, void 0, void 0, function* () { const { initData } = message; if (!initData) { return; } notificationBarIframeInitData = initData; const { isVaultLocked, removeIndividualVault: personalVaultDisallowed, theme, } = notificationBarIframeInitData; const i18n = getI18n(); const resolvedTheme = getResolvedTheme(theme !== null && theme !== void 0 ? theme : ThemeTypes.Light); const notificationType = resolveNotificationType(notificationBarIframeInitData); const headerMessage = getNotificationHeaderMessage(i18n, notificationType); const notificationTestId = getNotificationTestId(notificationType); appendHeaderMessageToTitle(headerMessage); if (isVaultLocked) { const notificationConfig = Object.assign(Object.assign({}, notificationBarIframeInitData), { headerMessage, type: notificationType, notificationTestId, theme: resolvedTheme, personalVaultIsAllowed: !personalVaultDisallowed, handleCloseNotification, handleEditOrUpdateAction, i18n }); const handleSaveAction = () => { // cipher ID is null while vault is locked. sendSaveCipherMessage(null, true); B(NotificationContainer(Object.assign(Object.assign({}, notificationConfig), { handleSaveAction: () => { }, isLoading: true })), document.body); }; const UnlockNotification = NotificationContainer(Object.assign(Object.assign({}, notificationConfig), { handleSaveAction })); return B(UnlockNotification, document.body); } // Handle AtRiskPasswordNotification render if (notificationBarIframeInitData.type === NotificationTypes.AtRiskPassword) { return B(AtRiskNotification(Object.assign(Object.assign({}, notificationBarIframeInitData), { type: notificationBarIframeInitData.type, theme: resolvedTheme, i18n, notificationTestId, params: initData.params, handleCloseNotification })), document.body); } // Default scenario: add or update password const orgId = selected_vault_selectedVault.get(); yield Promise.all([ new Promise((resolve) => sendPlatformMessage({ command: "bgGetOrgData" }, resolve)), new Promise((resolve) => sendPlatformMessage({ command: "bgGetFolderData" }, resolve)), new Promise((resolve) => sendPlatformMessage({ command: "bgGetDecryptedCiphers" }, resolve)), new Promise((resolve) => sendPlatformMessage({ command: "bgGetCollectionData", orgId }, resolve)), ]).then(([organizations, folders, ciphers, collections]) => { notificationBarIframeInitData = Object.assign(Object.assign({}, notificationBarIframeInitData), { organizations, folders, ciphers, collections }); // @TODO use context to avoid prop drilling return B(NotificationContainer(Object.assign(Object.assign({}, notificationBarIframeInitData), { headerMessage, type: notificationType, theme: resolvedTheme, notificationTestId, personalVaultIsAllowed: !personalVaultDisallowed, handleCloseNotification, handleSaveAction, handleEditOrUpdateAction, i18n })), document.body); }); function handleEditOrUpdateAction(e) { e.preventDefault(); sendSaveCipherMessage(selected_cipher_selectedCipher.get(), notificationType === NotificationTypes.Add); } }); } function handleCloseNotification(e) { e.preventDefault(); sendPlatformMessage({ command: "bgCloseNotificationBar", fadeOutNotification: true, }); } function handleSaveAction(e) { const selectedCipher = selected_cipher_selectedCipher.get(); const selectedVault = selected_vault_selectedVault.get(); const selectedFolder = selected_folder_selectedFolder.get(); if (selectedVault.length > 1) { openAddEditVaultItemPopout(e, Object.assign({ organizationId: selectedVault }, ((selectedFolder === null || selectedFolder === void 0 ? void 0 : selectedFolder.length) > 1 ? { folder: selectedFolder } : {}))); handleCloseNotification(e); return; } e.preventDefault(); sendSaveCipherMessage(selectedCipher, removeIndividualVault(), selectedFolder); if (removeIndividualVault()) { return; } } function sendSaveCipherMessage(cipherId, edit, folder) { sendPlatformMessage({ command: "bgSaveCipher", cipherId, folder, edit, }); } function openAddEditVaultItemPopout(e, options) { e.preventDefault(); sendPlatformMessage(Object.assign({ command: "bgOpenAddEditVaultItemPopout" }, options)); } function openViewVaultItemPopout(cipherId) { sendPlatformMessage({ command: "bgOpenViewVaultItemPopout", cipherId, }); } function handleSaveCipherConfirmation(message) { const { theme, type } = notificationBarIframeInitData; const { error, data } = message; const { cipherId, task, itemName } = data || {}; const i18n = getI18n(); const resolvedTheme = getResolvedTheme(theme !== null && theme !== void 0 ? theme : ThemeTypes.Light); const resolvedType = resolveNotificationType(notificationBarIframeInitData); const headerMessage = getConfirmationHeaderMessage(i18n, resolvedType, error); const notificationTestId = getNotificationTestId(resolvedType, true); appendHeaderMessageToTitle(headerMessage); globalThis.setTimeout(() => sendPlatformMessage({ command: "bgCloseNotificationBar" }), 5000); return B(NotificationConfirmationContainer(Object.assign(Object.assign({}, notificationBarIframeInitData), { error, handleCloseNotification, handleOpenTasks: () => sendPlatformMessage({ command: "bgOpenAtRiskPasswords" }), handleOpenVault: (e) => cipherId ? openViewVaultItemPopout(cipherId) : openAddEditVaultItemPopout(e, {}), headerMessage, i18n, itemName: itemName !== null && itemName !== void 0 ? itemName : i18n.typeLogin, notificationTestId, task, theme: resolvedTheme, type: type })), document.body); } function sendPlatformMessage(msg, responseCallback) { chrome.runtime.sendMessage(msg, (response) => { if (responseCallback) { responseCallback(response); } }); } function removeIndividualVault() { return Boolean(notificationBarIframeInitData === null || notificationBarIframeInitData === void 0 ? void 0 : notificationBarIframeInitData.removeIndividualVault); } function setupWindowMessageListener() { globalThis.addEventListener("message", handleWindowMessage); } function handleWindowMessage(event) { if ((event === null || event === void 0 ? void 0 : event.source) !== globalThis.parent) { return; } const message = event.data; if (!(message === null || message === void 0 ? void 0 : message.command)) { return; } if (!windowMessageOrigin || event.origin !== windowMessageOrigin) { return; } if (message.command === "initNotificationBar" && message.parentOrigin && message.parentOrigin !== event.origin) { return; } const handler = notificationBarWindowMessageHandlers[message.command]; if (!handler) { return; } handler({ message }); } function getTheme(globalThis, theme) { if (theme === ThemeTypes.System) { return globalThis.matchMedia("(prefers-color-scheme: dark)").matches ? ThemeTypes.Dark : ThemeTypes.Light; } return theme; } function getResolvedTheme(theme) { const themeType = getTheme(globalThis, theme); // There are other possible passed theme values, but for now, resolve to dark or light const resolvedTheme = themeType === ThemeTypes.Dark ? ThemeTypes.Dark : ThemeTypes.Light; return resolvedTheme; } function postMessageToParent(message) { if (!windowMessageOrigin) { return; } globalThis.parent.postMessage(message, windowMessageOrigin); } /******/ })() ;