"use strict";(self.webpackChunkpasswords_webextension=self.webpackChunkpasswords_webextension||[]).push([[6578],{8962:(e,a,s)=>{s.d(a,{Z:()=>t});class t{async execute(e,a){console.trace("controller.execute() not implemented")}}},1735:(e,a,s)=>{s.r(a),s.d(a,{default:()=>r});var t=s(8962),o=s(7577),i=s(1842),n=s(1835);class r extends t.Z{constructor(){super(),this._booleanSettings=["paste.popup.close","paste.form.submit","paste.compromised.warning","paste.autofill","paste.basic-auth","popup.related.search","notification.password.new","notification.password.update","debug.localisation.enabled","clipboard.clear.passwords","password.list.show.user"]}async execute(e,a){let{setting:s,value:t}=e.getPayload();try{if("theme.custom"===s)await o.Z.set(s,t);else if("server.default"===s)await this._setDefaultServer(t);else if("theme.current"===s)await this._setCurrentTheme(t);else if("search.recommendation.mode"===s)await this._setSearchRecommendationMode(t);else if("search.recommendation.maxRows"===s)await this._setSearchRecommendationMaxRows(Number(t));else if("clipboard.clear.delay"===s)await this._setClipboardClearDelay(Number(t));else{if(-1===this._booleanSettings.indexOf(s))return void a.setPayload({success:!1,message:"Unknown setting"});await this._setBoolean(s,t)}a.setPayload({success:!0})}catch(e){a.setPayload({success:!1,message:e.message})}}async _setDefaultServer(e){await i.Z.findById(e),await o.Z.set("server.default",e)}async _setCurrentTheme(e){await n.Z.findById(e),await o.Z.set("theme.current",e)}async _setSearchRecommendationMode(e){await o.Z.set("search.recommendation.mode",e)}async _setSearchRecommendationMaxRows(e){await o.Z.set("search.recommendation.maxRows",e)}async _setBoolean(e,a){await o.Z.set(e,!0===a)}async _setClipboardClearDelay(e){await o.Z.set("clipboard.clear.delay",e)}}}}]);