/*! For license information please see PasswordSearch.js.LICENSE.txt */
(self.webpackChunkpasswords_webextension=self.webpackChunkpasswords_webextension||[]).push([[5841],{5004:(e,t,s)=>{e.exports=s(5093)},5093:(e,t)=>{t.parse=function(e,t){if(t?t.offsets=void 0===t.offsets||t.offsets:t={offsets:!0},e||(e=""),-1!==e.indexOf(":")||t.tokenize){if(t.keywords||t.ranges||t.tokenize){var s={text:[]};t.offsets&&(s.offsets=[]);for(var r,n={},i=[],o=/(\S+:'(?:[^'\\]|\\.)*')|(\S+:"(?:[^"\\]|\\.)*")|(-?"(?:[^"\\]|\\.)*")|(-?'(?:[^'\\]|\\.)*')|\S+|\S+:\S+/g;null!==(r=o.exec(e));){var f,a=(f=r[0]).indexOf(":");if(-1!==a){f.split(":");var l=f.slice(0,a),d=f.slice(a+1);d=((d=d.replace(/^\"|\"$|^\'|\'$/g,""))+"").replace(/\\(.?)/g,(function(e,t){switch(t){case"\\":return"\\";case"0":return"\0";case"":return"";default:return t}})),i.push({keyword:l,value:d,offsetStart:r.index,offsetEnd:r.index+f.length})}else{var u=!1;"-"===f[0]&&(u=!0,f=f.slice(1)),f=((f=f.replace(/^\"|\"$|^\'|\'$/g,""))+"").replace(/\\(.?)/g,(function(e,t){switch(t){case"\\":return"\\";case"0":return"\0";case"":return"";default:return t}})),u?n.text?(n.text instanceof Array||(n.text=[n.text]),n.text.push(f)):n.text=f:i.push({text:f,offsetStart:r.index,offsetEnd:r.index+f.length})}}for(i.reverse();f=i.pop();)if(f.text)s.text.push(f.text),t.offsets&&s.offsets.push(f);else{l=f.keyword,t.keywords=t.keywords||[];var h=!1,c=!1;if(/^-/.test(l)){if("-"===l[0]){var p=l.slice(1);(h=!(-1===t.keywords.indexOf(p)))&&(l=p,c=!0)}}else h=!(-1===t.keywords.indexOf(l));t.ranges=t.ranges||[];var x=!(-1===t.ranges.indexOf(l));if(h){if(t.offsets&&s.offsets.push({keyword:l,value:f.value,offsetStart:c?f.offsetStart+1:f.offsetStart,offsetEnd:f.offsetEnd}),(g=f.value).length){var y=g.split(",");c?n[l]?n[l]instanceof Array?y.length>1?n[l]=n[l].concat(y):n[l].push(g):(n[l]=[n[l]],n[l].push(g)):y.length>1?n[l]=y:t.alwaysArray?n[l]=[g]:n[l]=g:s[l]?s[l]instanceof Array?y.length>1?s[l]=s[l].concat(y):s[l].push(g):(s[l]=[s[l]],s[l].push(g)):y.length>1?s[l]=y:t.alwaysArray?s[l]=[g]:s[l]=g}}else if(x){t.offsets&&s.offsets.push(f);var g,w=(g=f.value).split("-");s[l]={},2===w.length?(s[l].from=w[0],s[l].to=w[1]):!w.length%2||(s[l].from=g)}else{var v=f.keyword+":"+f.value;s.text.push(v),t.offsets&&s.offsets.push({text:v,offsetStart:f.offsetStart,offsetEnd:f.offsetEnd})}}return s.text.length?t.tokenize||(s.text=s.text.join(" ").trim()):delete s.text,s.exclude=n,s}return e}return e},t.stringify=function(e,s,r){if(s||(s={offsets:!0}),!e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.join(" ");if(!Object.keys(e).length)return"";if(3===Object.keys(e).length&&e.text&&e.offsets&&e.exclude&&"string"==typeof e.text)return e.text;r||(r="");var n=function(e){return e.indexOf(" ")>-1?JSON.stringify(e):e},i=function(e){return r+e},o=[];if(e.text){var f=[];"string"==typeof e.text?f.push(e.text):f.push.apply(f,e.text),f.length>0&&o.push(f.map(n).map(i).join(" "))}return s.keywords&&s.keywords.forEach((function(t){if(e[t]){var s=[];"string"==typeof e[t]?s.push(e[t]):s.push.apply(s,e[t]),s.length>0&&o.push(i(t+":"+s.map(n).join(",")))}})),s.ranges&&s.ranges.forEach((function(t){if(e[t]){var s=e[t].from,r=e[t].to;r&&(s=s+"-"+r),s&&o.push(i(t+":"+s))}})),e.exclude&&Object.keys(e.exclude).length>0&&o.push(t.stringify(e.exclude,s,"-")),o.join(" ")}},8962:(e,t,s)=>{"use strict";s.d(t,{Z:()=>r});class r{async execute(e,t){console.trace("controller.execute() not implemented")}}},7233:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});var r=s(8962),n=s(8419),i=s(5004);class o extends n.Z{constructor(e,t="and"){-1===["and","or","xor"].indexOf(t)&&(t="and"),super(t),this._score=.2,this._limit=15,this._type="password",this._conditionType=t,this.query(e)}query(e){this._condition=this[this._conditionType]();let t=i.parse(e,{keywords:["id","tag","folder","favorite","host","url","server"],tokenize:!0});for(let e in t)t.hasOwnProperty(e)&&"offsets"!==e&&"exclude"!==e&&("text"===e?this._addTextCondition(t):this._addFieldCondition(t,e))}_addFieldCondition(e,t){let s=e[t];Array.isArray(s)?this.where(this.field(t).in(s)):this.where(this.field(t).equals(s))}_addTextCondition(e){let t=this.and();for(let s of e.text)t.where(this.or(this.field("label").contains(s,4),this.field("username").contains(s,2),this.field("text").contains(s)));this.where(t)}}var f=s(4194);class a extends r.Z{async execute(e,t){let s=e.getPayload().query,r=new o(s);f.Z.get().tab.incognito&&r.hidden(!0),t.setType("password.items").setPayload(r.execute())}}}}]);