"use strict";(globalThis["webpackChunkaurora_corporate_mobile_ui"]||=[]).push([[235,8855],{36245(e,l,s){s.r(l),s.d(l,{default:()=>A});var t=s(61758),a=s(58790);const n={key:0,class:"q-px-lg text-grey text-subtitle1 text-center"},o={key:1,class:"q-pa-lg full-width flex items-center"};function i(e,l,s,i,r,p){const u=(0,t.g2)("OpenPgpTab"),y=(0,t.g2)("q-scroll-area"),c=(0,t.g2)("AppButton"),g=(0,t.g2)("q-file"),d=(0,t.g2)("AppListLoader"),m=(0,t.g2)("ImportKeyDialog");return(0,t.uX)(),(0,t.CE)(t.FK,null,[e.loading?(0,t.Q3)("",!0):((0,t.uX)(),(0,t.Wv)(y,{key:0,"data-test-id":"settings-openpgp-external-keys-page","thumb-style":{width:"5px"},class:"keys_list q-px-lg q-pt-lg"},{default:(0,t.k6)(()=>[e.keysFromArmor.length?(0,t.Q3)("",!0):((0,t.uX)(),(0,t.CE)("div",n,(0,a.v_)(e.$t("OPENPGPWEBCLIENT.INFO_EMPTY_PUBLIC_KEYS")),1)),((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(e.keysFromArmor,e=>((0,t.uX)(),(0,t.Wv)(u,{key:e,label:e.Email,onClick:l=>p.openKey(e)},null,8,["label","onClick"]))),128))]),_:1})),e.loading?(0,t.Q3)("",!0):((0,t.uX)(),(0,t.CE)("div",o,[(0,t.Lk)("div",null,[(0,t.bF)(c,{onClick:p.exportAllKeys,label:e.$t("OPENPGPWEBCLIENT.ACTION_EXPORT_ALL_PUBLIC_KEYS"),disabled:!e.keysFromArmor.length},null,8,["onClick","label","disabled"]),(0,t.bF)(c,{onClick:l[0]||(l[0]=l=>e.showImportKeys=!0),label:e.$t("OPENPGPMOBILEWEBCLIENT.ACTION_IMPORT_KEY_TEXT"),class:"q-mt-lg"},null,8,["label"]),(0,t.bF)(c,{onClick:p.getFiles,label:e.$t("OPENPGPMOBILEWEBCLIENT.ACTION_IMPORT_KEY_FILE"),class:"q-mt-lg"},null,8,["onClick","label"]),(0,t.bF)(g,{ref:"fileInput",modelValue:e.files,"onUpdate:modelValue":l[1]||(l[1]=l=>e.files=l),class:"hidden",multiple:""},null,8,["modelValue"])])])),e.loading?((0,t.uX)(),(0,t.Wv)(d,{key:2,initial:""})):(0,t.Q3)("",!0),(0,t.bF)(m,{modelValue:e.showImportKeys,"onUpdate:modelValue":l[2]||(l[2]=l=>e.showImportKeys=l),onClose:l[3]||(l[3]=l=>e.showImportKeys=!1),onClearFiles:p.clearFiles,"is-external-keys":""},null,8,["modelValue","onClearFiles"])],64)}s(14748);var r=s(15679),p=s(9950),u=s(58983),y=s(19789),c=s(17149),g=s(59847),d=s(67754);const m={name:"ExternalKeys",components:{OpenPgpTab:g.A,ImportKeyDialog:c.A,AppButton:u.A,AppListLoader:y.A},data:()=>({loading:!1,showImportKeys:!1,files:[],keysFromArmor:[]}),watch:{async files(){if(this.files.length){const e=[];for(const l of this.files)e.push(await l.text());this.setFilesKeys(e),this.showImportKeys=!0}},async externalKeys(){const e=this.externalKeys.reduce((e,l)=>(e+=l.armor,e+"\n"),""),l=await d["default"].getArmorInfo(e);this.keysFromArmor=l?.map(e=>({PublicPgpKey:e.armor(),Email:e.getUserIds()[0]}))}},mounted(){this.getExternalKeys()},computed:{...(0,r.L8)(p.Qp,["externalKeys"])},methods:{...(0,r.i0)(p.Qp,["asyncGetExternalsKeys","changeCurrentKeys","setFilesKeys"]),async getExternalKeys(){this.loading=!0,await this.asyncGetExternalsKeys(),this.loading=!1},getFiles(){this.$refs.fileInput.$el.click()},clearFiles(){this.files=[]},exportAllKeys(){this.changeCurrentKeys(this.externalKeys),this.$router.push("/settings/open-pgp/all-external-keys")},openKey(e){this.changeCurrentKeys([e]),this.$router.push(`/settings/open-pgp/external-keys/${e.Email}`)}}};var h=s(12807),E=s(19600),K=s(59869),I=s(98582),k=s.n(I);const C=(0,h.A)(m,[["render",i],["__scopeId","data-v-66c6a4d6"]]),A=C;k()(m,"components",{QScrollArea:E.A,QFile:K.A})}}]);