diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2024-07-20 16:27:48 +0200 |
---|---|---|
committer | Richard Steinmetz <richard@steinmetz.cloud> | 2024-07-20 16:27:48 +0200 |
commit | 6761d7846084a24f03c365ba91098e09e9b0a066 (patch) | |
tree | 9f7430ef59b8877e76420febf8e57c064e3c2faf | |
parent | 970a8287cd6e091d6403ddd9950fdd61791ad594 (diff) | |
download | nextcloud-server-6761d7846084a24f03c365ba91098e09e9b0a066.tar.gz nextcloud-server-6761d7846084a24f03c365ba91098e09e9b0a066.zip |
feat: migrate backupcodes personal settings buttons
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
-rw-r--r-- | apps/twofactor_backupcodes/src/views/PersonalSettings.vue | 69 | ||||
-rw-r--r-- | dist/twofactor_backupcodes-settings.js | 4 | ||||
-rw-r--r-- | dist/twofactor_backupcodes-settings.js.map | 2 |
3 files changed, 48 insertions, 27 deletions
diff --git a/apps/twofactor_backupcodes/src/views/PersonalSettings.vue b/apps/twofactor_backupcodes/src/views/PersonalSettings.vue index 0b616457487..612d21a7dee 100644 --- a/apps/twofactor_backupcodes/src/views/PersonalSettings.vue +++ b/apps/twofactor_backupcodes/src/views/PersonalSettings.vue @@ -3,40 +3,47 @@ - SPDX-License-Identifier: AGPL-3.0-or-later --> <template> - <div> - <button v-if="!enabled" + <div class="backupcodes-settings"> + <NcButton v-if="!enabled" id="generate-backup-codes" :disabled="generatingCodes" @click="generateBackupCodes"> + <template #icon> + <NcLoadingIcon v-if="generatingCodes" /> + </template> {{ t('twofactor_backupcodes', 'Generate backup codes') }} - <span :class="{'icon-loading-small': generatingCodes}" /> - </button> + </NcButton> <template v-else> - <p> + <p class="backupcodes-settings__codes"> <template v-if="!haveCodes"> {{ t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used, total}) }} </template> <template v-else> - {{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later') }} + {{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later.') }} <ul> - <li v-for="code in codes" :key="code" class="backup-code"> + <li v-for="code in codes" + :key="code" + class="backupcodes-settings__codes__code"> {{ code }} </li> </ul> - <a :href="downloadUrl" - class="button primary" - :download="downloadFilename">{{ t('twofactor_backupcodes', 'Save backup codes') }}</a> - <button class="button" - @click="printCodes"> - {{ t('twofactor_backupcodes', 'Print backup codes') }} - </button> </template> </p> - <p> - <button id="generate-backup-codes" + <p class="backupcodes-settings__actions"> + <template v-if="haveCodes"> + <NcButton :href="downloadUrl" + :download="downloadFilename" + type="primary"> + {{ t('twofactor_backupcodes', 'Save backup codes') }} + </NcButton> + <NcButton @click="printCodes"> + {{ t('twofactor_backupcodes', 'Print backup codes') }} + </NcButton> + </template> + <NcButton id="generate-backup-codes" @click="generateBackupCodes"> {{ t('twofactor_backupcodes', 'Regenerate backup codes') }} - </button> + </NcButton> </p> <p> <em> @@ -50,11 +57,17 @@ <script> import { confirmPassword } from '@nextcloud/password-confirmation' import { print } from '../service/PrintService.js' +import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' +import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js' import '@nextcloud/password-confirmation/dist/style.css' export default { name: 'PersonalSettings', + components: { + NcButton, + NcLoadingIcon, + }, data() { return { generatingCodes: false, @@ -124,13 +137,21 @@ export default { } </script> -<style scoped> - .backup-code { - font-family: monospace; - letter-spacing: 0.02em; - font-size: 1.2em; +<style lang="scss" scoped> +.backupcodes-settings { + &__codes { + &__code { + font-family: monospace; + letter-spacing: 0.02em; + font-size: 1.2em; + } } - .button { - display: inline-block; + + &__actions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--default-grid-baseline); } +} </style> diff --git a/dist/twofactor_backupcodes-settings.js b/dist/twofactor_backupcodes-settings.js index 3d8f908ad2a..0f5453e27c1 100644 --- a/dist/twofactor_backupcodes-settings.js +++ b/dist/twofactor_backupcodes-settings.js @@ -1,2 +1,2 @@ -(()=>{"use strict";var e,n={28449:(e,n,o)=>{var a=o(32981),s=o(85471),r=o(56760);o(51257);var c=o(96763);const d={name:"PersonalSettings",data:()=>({generatingCodes:!1}),computed:{downloadUrl(){return this.codes?"data:text/plain,"+encodeURIComponent(this.codes.reduce(((t,e)=>t+e+"\r\n"),"")):""},downloadFilename:()=>(OC.theme.name||"Nextcloud")+"-backup-codes.txt",enabled(){return this.$store.state.enabled},total(){return this.$store.state.total},used(){return this.$store.state.used},codes(){return this.$store.state.codes},name:()=>OC.theme.name||"Nextcloud",haveCodes(){return this.codes&&this.codes.length>0}},methods:{generateBackupCodes(){(0,r.C)().then((()=>{this.generatingCodes=!0,this.$store.dispatch("generate").then((()=>{this.generatingCodes=!1})).catch((e=>{throw OC.Notification.showTemporary(t("twofactor_backupcodes","An error occurred while generating your backup codes")),this.generatingCodes=!1,e}))})).catch(c.error.bind(this))},getPrintData:t=>t?t.reduce(((t,e)=>t+e+"<br>"),""):"",printCodes(){!function(e){const n=OC.theme.name||"Nextcloud",o=window.open("",t("twofactor_backupcodes","{name} backup codes",{name:n}));o.document.write("<h1>"+t("twofactor_backupcodes","{name} backup codes",{name:n})+"</h1>"),o.document.write("<pre>"+e+"</pre>"),o.print(),o.close()}(this.getPrintData(this.codes))}}};var i=o(85072),l=o.n(i),u=o(97825),p=o.n(u),b=o(77659),h=o.n(b),m=o(55056),f=o.n(m),g=o(10540),v=o.n(g),k=o(41113),w=o.n(k),C=o(41250),y={};y.styleTagTransform=w(),y.setAttributes=f(),y.insert=h().bind(null,"head"),y.domAPI=p(),y.insertStyleElement=v(),l()(C.A,y),C.A&&C.A.locals&&C.A.locals;const A=(0,o(14486).A)(d,(function(){var t=this,e=t._self._c;return e("div",[t.enabled?[e("p",[t.haveCodes?[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","These are your backup codes. Please save and/or print them as you will not be able to read the codes again later"))+"\n\t\t\t\t"),e("ul",t._l(t.codes,(function(n){return e("li",{key:n,staticClass:"backup-code"},[t._v("\n\t\t\t\t\t\t"+t._s(n)+"\n\t\t\t\t\t")])})),0),t._v(" "),e("a",{staticClass:"button primary",attrs:{href:t.downloadUrl,download:t.downloadFilename}},[t._v(t._s(t.t("twofactor_backupcodes","Save backup codes")))]),t._v(" "),e("button",{staticClass:"button",on:{click:t.printCodes}},[t._v("\n\t\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Print backup codes"))+"\n\t\t\t\t")])]:[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Backup codes have been generated. {used} of {total} codes have been used.",{used:t.used,total:t.total}))+"\n\t\t\t")]],2),t._v(" "),e("p",[e("button",{attrs:{id:"generate-backup-codes"},on:{click:t.generateBackupCodes}},[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Regenerate backup codes"))+"\n\t\t\t")])]),t._v(" "),e("p",[e("em",[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","If you regenerate backup codes, you automatically invalidate old codes."))+"\n\t\t\t")])])]:e("button",{attrs:{id:"generate-backup-codes",disabled:t.generatingCodes},on:{click:t.generateBackupCodes}},[t._v("\n\t\t"+t._s(t.t("twofactor_backupcodes","Generate backup codes"))+"\n\t\t"),e("span",{class:{"icon-loading-small":t.generatingCodes}})])],2)}),[],!1,null,"619acaa0",null).exports;var _=o(95353),x=o(65043),P=o(63814);s.Ay.use(_.Ay);const O={setEnabled(t,e){s.Ay.set(t,"enabled",e)},setTotal(t,e){s.Ay.set(t,"total",e)},setUsed(t,e){s.Ay.set(t,"used",e)},setCodes(t,e){s.Ay.set(t,"codes",e)}},S={generate(t){let{commit:e}=t;return e("setEnabled",!1),function(){const t=(0,P.Jv)("/apps/twofactor_backupcodes/settings/create");return x.Ay.post(t,{}).then((t=>t.data))}().then((t=>{let{codes:n,state:o}=t;return e("setEnabled",o.enabled),e("setTotal",o.total),e("setUsed",o.used),e("setCodes",n),!0}))}},T=new _.il({strict:!1,state:{enabled:!1,total:0,used:0,codes:[]},mutations:O,actions:S});s.Ay.prototype.t=t;const B=(0,a.C)("twofactor_backupcodes","state");T.replaceState(B),new(s.Ay.extend(A))({store:T}).$mount("#twofactor-backupcodes-settings")},41250:(t,e,n)=>{n.d(e,{A:()=>c});var o=n(71354),a=n.n(o),s=n(76314),r=n.n(s)()(a());r.push([t.id,"\n.backup-code[data-v-619acaa0] {\n\tfont-family: monospace;\n\tletter-spacing: 0.02em;\n\tfont-size: 1.2em;\n}\n.button[data-v-619acaa0] {\n\tdisplay: inline-block;\n}\n","",{version:3,sources:["webpack://./apps/twofactor_backupcodes/src/views/PersonalSettings.vue"],names:[],mappings:";AAyIA;CACA,sBAAA;CACA,sBAAA;CACA,gBAAA;AACA;AACA;CACA,qBAAA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n<template>\n\t<div>\n\t\t<button v-if=\"!enabled\"\n\t\t\tid=\"generate-backup-codes\"\n\t\t\t:disabled=\"generatingCodes\"\n\t\t\t@click=\"generateBackupCodes\">\n\t\t\t{{ t('twofactor_backupcodes', 'Generate backup codes') }}\n\t\t\t<span :class=\"{'icon-loading-small': generatingCodes}\" />\n\t\t</button>\n\t\t<template v-else>\n\t\t\t<p>\n\t\t\t\t<template v-if=\"!haveCodes\">\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used, total}) }}\n\t\t\t\t</template>\n\t\t\t\t<template v-else>\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later') }}\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li v-for=\"code in codes\" :key=\"code\" class=\"backup-code\">\n\t\t\t\t\t\t\t{{ code }}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<a :href=\"downloadUrl\"\n\t\t\t\t\t\tclass=\"button primary\"\n\t\t\t\t\t\t:download=\"downloadFilename\">{{ t('twofactor_backupcodes', 'Save backup codes') }}</a>\n\t\t\t\t\t<button class=\"button\"\n\t\t\t\t\t\t@click=\"printCodes\">\n\t\t\t\t\t\t{{ t('twofactor_backupcodes', 'Print backup codes') }}\n\t\t\t\t\t</button>\n\t\t\t\t</template>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<button id=\"generate-backup-codes\"\n\t\t\t\t\t@click=\"generateBackupCodes\">\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'Regenerate backup codes') }}\n\t\t\t\t</button>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<em>\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.') }}\n\t\t\t\t</em>\n\t\t\t</p>\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { confirmPassword } from '@nextcloud/password-confirmation'\nimport { print } from '../service/PrintService.js'\n\nimport '@nextcloud/password-confirmation/dist/style.css'\n\nexport default {\n\tname: 'PersonalSettings',\n\tdata() {\n\t\treturn {\n\t\t\tgeneratingCodes: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\tdownloadUrl() {\n\t\t\tif (!this.codes) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn 'data:text/plain,' + encodeURIComponent(this.codes.reduce((prev, code) => {\n\t\t\t\treturn prev + code + '\\r\\n'\n\t\t\t}, ''))\n\t\t},\n\t\tdownloadFilename() {\n\t\t\tconst name = OC.theme.name || 'Nextcloud'\n\t\t\treturn name + '-backup-codes.txt'\n\t\t},\n\t\tenabled() {\n\t\t\treturn this.$store.state.enabled\n\t\t},\n\t\ttotal() {\n\t\t\treturn this.$store.state.total\n\t\t},\n\t\tused() {\n\t\t\treturn this.$store.state.used\n\t\t},\n\t\tcodes() {\n\t\t\treturn this.$store.state.codes\n\t\t},\n\t\tname() {\n\t\t\treturn OC.theme.name || 'Nextcloud'\n\t\t},\n\t\thaveCodes() {\n\t\t\treturn this.codes && this.codes.length > 0\n\t\t},\n\t},\n\tmethods: {\n\t\tgenerateBackupCodes() {\n\t\t\tconfirmPassword().then(() => {\n\t\t\t\t// Hide old codes\n\t\t\t\tthis.generatingCodes = true\n\n\t\t\t\tthis.$store.dispatch('generate').then(() => {\n\t\t\t\t\tthis.generatingCodes = false\n\t\t\t\t}).catch(err => {\n\t\t\t\t\tOC.Notification.showTemporary(t('twofactor_backupcodes', 'An error occurred while generating your backup codes'))\n\t\t\t\t\tthis.generatingCodes = false\n\t\t\t\t\tthrow err\n\t\t\t\t})\n\t\t\t}).catch(console.error.bind(this))\n\t\t},\n\n\t\tgetPrintData(codes) {\n\t\t\tif (!codes) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn codes.reduce((prev, code) => {\n\t\t\t\treturn prev + code + '<br>'\n\t\t\t}, '')\n\t\t},\n\n\t\tprintCodes() {\n\t\t\tprint(this.getPrintData(this.codes))\n\t\t},\n\t},\n}\n<\/script>\n\n<style scoped>\n\t.backup-code {\n\t\tfont-family: monospace;\n\t\tletter-spacing: 0.02em;\n\t\tfont-size: 1.2em;\n\t}\n\t.button {\n\t\tdisplay: inline-block;\n\t}\n</style>\n"],sourceRoot:""}]);const c=r}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var s=o[t]={id:t,loaded:!1,exports:{}};return n[t].call(s.exports,s,s.exports,a),s.loaded=!0,s.exports}a.m=n,e=[],a.O=(t,n,o,s)=>{if(!n){var r=1/0;for(l=0;l<e.length;l++){n=e[l][0],o=e[l][1],s=e[l][2];for(var c=!0,d=0;d<n.length;d++)(!1&s||r>=s)&&Object.keys(a.O).every((t=>a.O[t](n[d])))?n.splice(d--,1):(c=!1,s<r&&(r=s));if(c){e.splice(l--,1);var i=o();void 0!==i&&(t=i)}}return t}s=s||0;for(var l=e.length;l>0&&e[l-1][2]>s;l--)e[l]=e[l-1];e[l]=[n,o,s]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.e=()=>Promise.resolve(),a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),a.j=4423,(()=>{a.b=document.baseURI||self.location.href;var t={4423:0};a.O.j=e=>0===t[e];var e=(e,n)=>{var o,s,r=n[0],c=n[1],d=n[2],i=0;if(r.some((e=>0!==t[e]))){for(o in c)a.o(c,o)&&(a.m[o]=c[o]);if(d)var l=d(a)}for(e&&e(n);i<r.length;i++)s=r[i],a.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return a.O(l)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),a.nc=void 0;var s=a.O(void 0,[4208],(()=>a(28449)));s=a.O(s)})(); -//# sourceMappingURL=twofactor_backupcodes-settings.js.map?v=38e4c2f352034c873133
\ No newline at end of file +(()=>{"use strict";var e,o={85781:(e,o,n)=>{var s=n(32981),a=n(85471),c=n(56760),r=n(54332),d=n(84237),i=(n(51257),n(96763));const l={name:"PersonalSettings",components:{NcButton:r.A,NcLoadingIcon:d.A},data:()=>({generatingCodes:!1}),computed:{downloadUrl(){return this.codes?"data:text/plain,"+encodeURIComponent(this.codes.reduce(((t,e)=>t+e+"\r\n"),"")):""},downloadFilename:()=>(OC.theme.name||"Nextcloud")+"-backup-codes.txt",enabled(){return this.$store.state.enabled},total(){return this.$store.state.total},used(){return this.$store.state.used},codes(){return this.$store.state.codes},name:()=>OC.theme.name||"Nextcloud",haveCodes(){return this.codes&&this.codes.length>0}},methods:{generateBackupCodes(){(0,c.C)().then((()=>{this.generatingCodes=!0,this.$store.dispatch("generate").then((()=>{this.generatingCodes=!1})).catch((e=>{throw OC.Notification.showTemporary(t("twofactor_backupcodes","An error occurred while generating your backup codes")),this.generatingCodes=!1,e}))})).catch(i.error.bind(this))},getPrintData:t=>t?t.reduce(((t,e)=>t+e+"<br>"),""):"",printCodes(){!function(e){const o=OC.theme.name||"Nextcloud",n=window.open("",t("twofactor_backupcodes","{name} backup codes",{name:o}));n.document.write("<h1>"+t("twofactor_backupcodes","{name} backup codes",{name:o})+"</h1>"),n.document.write("<pre>"+e+"</pre>"),n.print(),n.close()}(this.getPrintData(this.codes))}}};var u=n(85072),p=n.n(u),b=n(97825),f=n.n(b),g=n(77659),h=n.n(g),_=n(55056),v=n.n(_),A=n(10540),m=n.n(A),k=n(41113),C=n.n(k),w=n(40097),y={};y.styleTagTransform=C(),y.setAttributes=v(),y.insert=h().bind(null,"head"),y.domAPI=f(),y.insertStyleElement=m(),p()(w.A,y),w.A&&w.A.locals&&w.A.locals;const x=(0,n(14486).A)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"backupcodes-settings"},[t.enabled?[e("p",{staticClass:"backupcodes-settings__codes"},[t.haveCodes?[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","These are your backup codes. Please save and/or print them as you will not be able to read the codes again later."))+"\n\t\t\t\t"),e("ul",t._l(t.codes,(function(o){return e("li",{key:o,staticClass:"backupcodes-settings__codes__code"},[t._v("\n\t\t\t\t\t\t"+t._s(o)+"\n\t\t\t\t\t")])})),0)]:[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Backup codes have been generated. {used} of {total} codes have been used.",{used:t.used,total:t.total}))+"\n\t\t\t")]],2),t._v(" "),e("p",{staticClass:"backupcodes-settings__actions"},[t.haveCodes?[e("NcButton",{attrs:{href:t.downloadUrl,download:t.downloadFilename,type:"primary"}},[t._v("\n\t\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Save backup codes"))+"\n\t\t\t\t")]),t._v(" "),e("NcButton",{on:{click:t.printCodes}},[t._v("\n\t\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Print backup codes"))+"\n\t\t\t\t")])]:t._e(),t._v(" "),e("NcButton",{attrs:{id:"generate-backup-codes"},on:{click:t.generateBackupCodes}},[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","Regenerate backup codes"))+"\n\t\t\t")])],2),t._v(" "),e("p",[e("em",[t._v("\n\t\t\t\t"+t._s(t.t("twofactor_backupcodes","If you regenerate backup codes, you automatically invalidate old codes."))+"\n\t\t\t")])])]:e("NcButton",{attrs:{id:"generate-backup-codes",disabled:t.generatingCodes},on:{click:t.generateBackupCodes},scopedSlots:t._u([{key:"icon",fn:function(){return[t.generatingCodes?e("NcLoadingIcon"):t._e()]},proxy:!0}],null,!1,4108280908)},[t._v("\n\t\t"+t._s(t.t("twofactor_backupcodes","Generate backup codes"))+"\n\t")])],2)}),[],!1,null,"70ee3f3c",null).exports;var O=n(95353),B=n(65043),P=n(63814);a.Ay.use(O.Ay);const N={setEnabled(t,e){a.Ay.set(t,"enabled",e)},setTotal(t,e){a.Ay.set(t,"total",e)},setUsed(t,e){a.Ay.set(t,"used",e)},setCodes(t,e){a.Ay.set(t,"codes",e)}},S={generate(t){let{commit:e}=t;return e("setEnabled",!1),function(){const t=(0,P.Jv)("/apps/twofactor_backupcodes/settings/create");return B.Ay.post(t,{}).then((t=>t.data))}().then((t=>{let{codes:o,state:n}=t;return e("setEnabled",n.enabled),e("setTotal",n.total),e("setUsed",n.used),e("setCodes",o),!0}))}},T=new O.il({strict:!1,state:{enabled:!1,total:0,used:0,codes:[]},mutations:N,actions:S});a.Ay.prototype.t=t;const j=(0,s.C)("twofactor_backupcodes","state");T.replaceState(j),new(a.Ay.extend(x))({store:T}).$mount("#twofactor-backupcodes-settings")},40097:(t,e,o)=>{o.d(e,{A:()=>r});var n=o(71354),s=o.n(n),a=o(76314),c=o.n(a)()(s());c.push([t.id,".backupcodes-settings__codes__code[data-v-70ee3f3c]{font-family:monospace;letter-spacing:.02em;font-size:1.2em}.backupcodes-settings__actions[data-v-70ee3f3c]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--default-grid-baseline)}","",{version:3,sources:["webpack://./apps/twofactor_backupcodes/src/views/PersonalSettings.vue"],names:[],mappings:"AAGE,oDACC,qBAAA,CACA,oBAAA,CACA,eAAA,CAIF,gDACC,YAAA,CACA,cAAA,CACA,kBAAA,CACA,gCAAA",sourcesContent:["\n.backupcodes-settings {\n\t&__codes {\n\t\t&__code {\n\t\t\tfont-family: monospace;\n\t\t\tletter-spacing: 0.02em;\n\t\t\tfont-size: 1.2em;\n\t\t}\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tgap: var(--default-grid-baseline);\n\t}\n}\n"],sourceRoot:""}]);const r=c}},n={};function s(t){var e=n[t];if(void 0!==e)return e.exports;var a=n[t]={id:t,loaded:!1,exports:{}};return o[t].call(a.exports,a,a.exports,s),a.loaded=!0,a.exports}s.m=o,e=[],s.O=(t,o,n,a)=>{if(!o){var c=1/0;for(l=0;l<e.length;l++){o=e[l][0],n=e[l][1],a=e[l][2];for(var r=!0,d=0;d<o.length;d++)(!1&a||c>=a)&&Object.keys(s.O).every((t=>s.O[t](o[d])))?o.splice(d--,1):(r=!1,a<c&&(c=a));if(r){e.splice(l--,1);var i=n();void 0!==i&&(t=i)}}return t}a=a||0;for(var l=e.length;l>0&&e[l-1][2]>a;l--)e[l]=e[l-1];e[l]=[o,n,a]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var o in e)s.o(e,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},s.e=()=>Promise.resolve(),s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s.j=4423,(()=>{s.b=document.baseURI||self.location.href;var t={4423:0};s.O.j=e=>0===t[e];var e=(e,o)=>{var n,a,c=o[0],r=o[1],d=o[2],i=0;if(c.some((e=>0!==t[e]))){for(n in r)s.o(r,n)&&(s.m[n]=r[n]);if(d)var l=d(s)}for(e&&e(o);i<c.length;i++)a=c[i],s.o(t,a)&&t[a]&&t[a][0](),t[a]=0;return s.O(l)},o=self.webpackChunknextcloud=self.webpackChunknextcloud||[];o.forEach(e.bind(null,0)),o.push=e.bind(null,o.push.bind(o))})(),s.nc=void 0;var a=s.O(void 0,[4208],(()=>s(85781)));a=s.O(a)})(); +//# sourceMappingURL=twofactor_backupcodes-settings.js.map?v=65a72f23ef41ac588371
\ No newline at end of file diff --git a/dist/twofactor_backupcodes-settings.js.map b/dist/twofactor_backupcodes-settings.js.map index ede06f06e60..6b25e8a5889 100644 --- a/dist/twofactor_backupcodes-settings.js.map +++ b/dist/twofactor_backupcodes-settings.js.map @@ -1 +1 @@ -{"version":3,"file":"twofactor_backupcodes-settings.js?v=38e4c2f352034c873133","mappings":"uBAAIA,E,gFCuDJ,MCvD4L,EDuD5L,CACAC,KAAA,mBACAC,KAAAA,KACA,CACAC,iBAAA,IAGAC,SAAA,CACAC,WAAAA,GACA,YAAAC,MAGA,mBAAAC,mBAAA,KAAAD,MAAAE,QAAA,CAAAC,EAAAC,IACAD,EAAAC,EAAA,QACA,KAJA,EAKA,EACAC,iBAAAA,KACAC,GAAAC,MAAAZ,MAAA,aACA,oBAEAa,OAAAA,GACA,YAAAC,OAAAC,MAAAF,OACA,EACAG,KAAAA,GACA,YAAAF,OAAAC,MAAAC,KACA,EACAC,IAAAA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AkB,CACrB,KAAM,GAaPtD,EAAoBS,EAAES,EAAKqC,GAA0C,IAA7BD,EAAgBC,GAGxD,IAAIC,EAAuB,CAACC,EAA4BxJ,KACvD,IAKIgG,EAAUsD,EALV5C,EAAW1G,EAAK,GAChByJ,EAAczJ,EAAK,GACnB0J,EAAU1J,EAAK,GAGI+G,EAAI,EAC3B,GAAGL,EAASiD,MAAM9D,GAAgC,IAAxBwD,EAAgBxD,KAAa,CACtD,IAAIG,KAAYyD,EACZ1D,EAAoB8B,EAAE4B,EAAazD,KACrCD,EAAoBQ,EAAEP,GAAYyD,EAAYzD,IAGhD,GAAG0D,EAAS,IAAIjD,EAASiD,EAAQ3D,EAClC,CAEA,IADGyD,GAA4BA,EAA2BxJ,GACrD+G,EAAIL,EAASxF,OAAQ6F,IACzBuC,EAAU5C,EAASK,GAChBhB,EAAoB8B,EAAEwB,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOvD,EAAoBS,EAAEC,EAAO,EAGjCmD,EAAqBV,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FU,EAAmBC,QAAQN,EAAqBxH,KAAK,KAAM,IAC3D6H,EAAmBjE,KAAO4D,EAAqBxH,KAAK,KAAM6H,EAAmBjE,KAAK5D,KAAK6H,G,KClDvF7D,EAAoB+D,QAAK5D,ECGzB,IAAI6D,EAAsBhE,EAAoBS,OAAEN,EAAW,CAAC,OAAO,IAAOH,EAAoB,SAC9FgE,EAAsBhE,EAAoBS,EAAEuD,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue?vue&type=script&lang=js","webpack:///nextcloud/apps/twofactor_backupcodes/src/service/PrintService.js","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?f810","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?81a7","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?0c03","webpack:///nextcloud/apps/twofactor_backupcodes/src/store.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/service/BackupCodesService.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/settings.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue?vue&type=style&index=0&id=619acaa0&prod&scoped=true&lang=css","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","<!--\n - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div>\n\t\t<button v-if=\"!enabled\"\n\t\t\tid=\"generate-backup-codes\"\n\t\t\t:disabled=\"generatingCodes\"\n\t\t\t@click=\"generateBackupCodes\">\n\t\t\t{{ t('twofactor_backupcodes', 'Generate backup codes') }}\n\t\t\t<span :class=\"{'icon-loading-small': generatingCodes}\" />\n\t\t</button>\n\t\t<template v-else>\n\t\t\t<p>\n\t\t\t\t<template v-if=\"!haveCodes\">\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used, total}) }}\n\t\t\t\t</template>\n\t\t\t\t<template v-else>\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later') }}\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li v-for=\"code in codes\" :key=\"code\" class=\"backup-code\">\n\t\t\t\t\t\t\t{{ code }}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<a :href=\"downloadUrl\"\n\t\t\t\t\t\tclass=\"button primary\"\n\t\t\t\t\t\t:download=\"downloadFilename\">{{ t('twofactor_backupcodes', 'Save backup codes') }}</a>\n\t\t\t\t\t<button class=\"button\"\n\t\t\t\t\t\t@click=\"printCodes\">\n\t\t\t\t\t\t{{ t('twofactor_backupcodes', 'Print backup codes') }}\n\t\t\t\t\t</button>\n\t\t\t\t</template>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<button id=\"generate-backup-codes\"\n\t\t\t\t\t@click=\"generateBackupCodes\">\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'Regenerate backup codes') }}\n\t\t\t\t</button>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<em>\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.') }}\n\t\t\t\t</em>\n\t\t\t</p>\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { confirmPassword } from '@nextcloud/password-confirmation'\nimport { print } from '../service/PrintService.js'\n\nimport '@nextcloud/password-confirmation/dist/style.css'\n\nexport default {\n\tname: 'PersonalSettings',\n\tdata() {\n\t\treturn {\n\t\t\tgeneratingCodes: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\tdownloadUrl() {\n\t\t\tif (!this.codes) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn 'data:text/plain,' + encodeURIComponent(this.codes.reduce((prev, code) => {\n\t\t\t\treturn prev + code + '\\r\\n'\n\t\t\t}, ''))\n\t\t},\n\t\tdownloadFilename() {\n\t\t\tconst name = OC.theme.name || 'Nextcloud'\n\t\t\treturn name + '-backup-codes.txt'\n\t\t},\n\t\tenabled() {\n\t\t\treturn this.$store.state.enabled\n\t\t},\n\t\ttotal() {\n\t\t\treturn this.$store.state.total\n\t\t},\n\t\tused() {\n\t\t\treturn this.$store.state.used\n\t\t},\n\t\tcodes() {\n\t\t\treturn this.$store.state.codes\n\t\t},\n\t\tname() {\n\t\t\treturn OC.theme.name || 'Nextcloud'\n\t\t},\n\t\thaveCodes() {\n\t\t\treturn this.codes && this.codes.length > 0\n\t\t},\n\t},\n\tmethods: {\n\t\tgenerateBackupCodes() {\n\t\t\tconfirmPassword().then(() => {\n\t\t\t\t// Hide old codes\n\t\t\t\tthis.generatingCodes = true\n\n\t\t\t\tthis.$store.dispatch('generate').then(() => {\n\t\t\t\t\tthis.generatingCodes = false\n\t\t\t\t}).catch(err => {\n\t\t\t\t\tOC.Notification.showTemporary(t('twofactor_backupcodes', 'An error occurred while generating your backup codes'))\n\t\t\t\t\tthis.generatingCodes = false\n\t\t\t\t\tthrow err\n\t\t\t\t})\n\t\t\t}).catch(console.error.bind(this))\n\t\t},\n\n\t\tgetPrintData(codes) {\n\t\t\tif (!codes) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn codes.reduce((prev, code) => {\n\t\t\t\treturn prev + code + '<br>'\n\t\t\t}, '')\n\t\t},\n\n\t\tprintCodes() {\n\t\t\tprint(this.getPrintData(this.codes))\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n\t.backup-code {\n\t\tfont-family: monospace;\n\t\tletter-spacing: 0.02em;\n\t\tfont-size: 1.2em;\n\t}\n\t.button {\n\t\tdisplay: inline-block;\n\t}\n</style>\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=script&lang=js\"","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * @param {any} data -\n */\nexport function print(data) {\n\tconst name = OC.theme.name || 'Nextcloud'\n\tconst newTab = window.open('', t('twofactor_backupcodes', '{name} backup codes', { name }))\n\tnewTab.document.write('<h1>' + t('twofactor_backupcodes', '{name} backup codes', { name }) + '</h1>')\n\tnewTab.document.write('<pre>' + data + '</pre>')\n\tnewTab.print()\n\tnewTab.close()\n}\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=style&index=0&id=619acaa0&prod&scoped=true&lang=css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=style&index=0&id=619acaa0&prod&scoped=true&lang=css\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./PersonalSettings.vue?vue&type=template&id=619acaa0&scoped=true\"\nimport script from \"./PersonalSettings.vue?vue&type=script&lang=js\"\nexport * from \"./PersonalSettings.vue?vue&type=script&lang=js\"\nimport style0 from \"./PersonalSettings.vue?vue&type=style&index=0&id=619acaa0&prod&scoped=true&lang=css\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"619acaa0\",\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[(!_vm.enabled)?_c('button',{attrs:{\"id\":\"generate-backup-codes\",\"disabled\":_vm.generatingCodes},on:{\"click\":_vm.generateBackupCodes}},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Generate backup codes'))+\"\\n\\t\\t\"),_c('span',{class:{'icon-loading-small': _vm.generatingCodes}})]):[_c('p',[(!_vm.haveCodes)?[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used: _vm.used, total: _vm.total}))+\"\\n\\t\\t\\t\")]:[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later'))+\"\\n\\t\\t\\t\\t\"),_c('ul',_vm._l((_vm.codes),function(code){return _c('li',{key:code,staticClass:\"backup-code\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(code)+\"\\n\\t\\t\\t\\t\\t\")])}),0),_vm._v(\" \"),_c('a',{staticClass:\"button primary\",attrs:{\"href\":_vm.downloadUrl,\"download\":_vm.downloadFilename}},[_vm._v(_vm._s(_vm.t('twofactor_backupcodes', 'Save backup codes')))]),_vm._v(\" \"),_c('button',{staticClass:\"button\",on:{\"click\":_vm.printCodes}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Print backup codes'))+\"\\n\\t\\t\\t\\t\")])]],2),_vm._v(\" \"),_c('p',[_c('button',{attrs:{\"id\":\"generate-backup-codes\"},on:{\"click\":_vm.generateBackupCodes}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Regenerate backup codes'))+\"\\n\\t\\t\\t\")])]),_vm._v(\" \"),_c('p',[_c('em',[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.'))+\"\\n\\t\\t\\t\")])])]],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Vue from 'vue'\nimport Vuex, { Store } from 'vuex'\nimport { generateCodes } from './service/BackupCodesService.js'\n\nVue.use(Vuex)\n\nconst state = {\n\tenabled: false,\n\ttotal: 0,\n\tused: 0,\n\tcodes: [],\n}\n\nconst mutations = {\n\tsetEnabled(state, enabled) {\n\t\tVue.set(state, 'enabled', enabled)\n\t},\n\tsetTotal(state, total) {\n\t\tVue.set(state, 'total', total)\n\t},\n\tsetUsed(state, used) {\n\t\tVue.set(state, 'used', used)\n\t},\n\tsetCodes(state, codes) {\n\t\tVue.set(state, 'codes', codes)\n\t},\n}\n\nconst actions = {\n\tgenerate({ commit }) {\n\t\tcommit('setEnabled', false)\n\n\t\treturn generateCodes().then(({ codes, state }) => {\n\t\t\tcommit('setEnabled', state.enabled)\n\t\t\tcommit('setTotal', state.total)\n\t\t\tcommit('setUsed', state.used)\n\t\t\tcommit('setCodes', codes)\n\t\t\treturn true\n\t\t})\n\t},\n}\n\nexport default new Store({\n\tstrict: process.env.NODE_ENV !== 'production',\n\tstate,\n\tmutations,\n\tactions,\n})\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\n\n/**\n *\n */\nexport function generateCodes() {\n\tconst url = generateUrl('/apps/twofactor_backupcodes/settings/create')\n\n\treturn Axios.post(url, {}).then(resp => resp.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { loadState } from '@nextcloud/initial-state'\nimport Vue from 'vue'\n\nimport PersonalSettings from './views/PersonalSettings.vue'\nimport store from './store.js'\n\nVue.prototype.t = t\n\nconst initialState = loadState('twofactor_backupcodes', 'state')\nstore.replaceState(initialState)\n\nconst View = Vue.extend(PersonalSettings)\nnew View({\n\tstore,\n}).$mount('#twofactor-backupcodes-settings')\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `\n.backup-code[data-v-619acaa0] {\n\tfont-family: monospace;\n\tletter-spacing: 0.02em;\n\tfont-size: 1.2em;\n}\n.button[data-v-619acaa0] {\n\tdisplay: inline-block;\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/twofactor_backupcodes/src/views/PersonalSettings.vue\"],\"names\":[],\"mappings\":\";AAyIA;CACA,sBAAA;CACA,sBAAA;CACA,gBAAA;AACA;AACA;CACA,qBAAA;AACA\",\"sourcesContent\":[\"<!--\\n - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\\n - SPDX-License-Identifier: AGPL-3.0-or-later\\n-->\\n<template>\\n\\t<div>\\n\\t\\t<button v-if=\\\"!enabled\\\"\\n\\t\\t\\tid=\\\"generate-backup-codes\\\"\\n\\t\\t\\t:disabled=\\\"generatingCodes\\\"\\n\\t\\t\\t@click=\\\"generateBackupCodes\\\">\\n\\t\\t\\t{{ t('twofactor_backupcodes', 'Generate backup codes') }}\\n\\t\\t\\t<span :class=\\\"{'icon-loading-small': generatingCodes}\\\" />\\n\\t\\t</button>\\n\\t\\t<template v-else>\\n\\t\\t\\t<p>\\n\\t\\t\\t\\t<template v-if=\\\"!haveCodes\\\">\\n\\t\\t\\t\\t\\t{{ t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used, total}) }}\\n\\t\\t\\t\\t</template>\\n\\t\\t\\t\\t<template v-else>\\n\\t\\t\\t\\t\\t{{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later') }}\\n\\t\\t\\t\\t\\t<ul>\\n\\t\\t\\t\\t\\t\\t<li v-for=\\\"code in codes\\\" :key=\\\"code\\\" class=\\\"backup-code\\\">\\n\\t\\t\\t\\t\\t\\t\\t{{ code }}\\n\\t\\t\\t\\t\\t\\t</li>\\n\\t\\t\\t\\t\\t</ul>\\n\\t\\t\\t\\t\\t<a :href=\\\"downloadUrl\\\"\\n\\t\\t\\t\\t\\t\\tclass=\\\"button primary\\\"\\n\\t\\t\\t\\t\\t\\t:download=\\\"downloadFilename\\\">{{ t('twofactor_backupcodes', 'Save backup codes') }}</a>\\n\\t\\t\\t\\t\\t<button class=\\\"button\\\"\\n\\t\\t\\t\\t\\t\\t@click=\\\"printCodes\\\">\\n\\t\\t\\t\\t\\t\\t{{ t('twofactor_backupcodes', 'Print backup codes') }}\\n\\t\\t\\t\\t\\t</button>\\n\\t\\t\\t\\t</template>\\n\\t\\t\\t</p>\\n\\t\\t\\t<p>\\n\\t\\t\\t\\t<button id=\\\"generate-backup-codes\\\"\\n\\t\\t\\t\\t\\t@click=\\\"generateBackupCodes\\\">\\n\\t\\t\\t\\t\\t{{ t('twofactor_backupcodes', 'Regenerate backup codes') }}\\n\\t\\t\\t\\t</button>\\n\\t\\t\\t</p>\\n\\t\\t\\t<p>\\n\\t\\t\\t\\t<em>\\n\\t\\t\\t\\t\\t{{ t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.') }}\\n\\t\\t\\t\\t</em>\\n\\t\\t\\t</p>\\n\\t\\t</template>\\n\\t</div>\\n</template>\\n\\n<script>\\nimport { confirmPassword } from '@nextcloud/password-confirmation'\\nimport { print } from '../service/PrintService.js'\\n\\nimport '@nextcloud/password-confirmation/dist/style.css'\\n\\nexport default {\\n\\tname: 'PersonalSettings',\\n\\tdata() {\\n\\t\\treturn {\\n\\t\\t\\tgeneratingCodes: false,\\n\\t\\t}\\n\\t},\\n\\tcomputed: {\\n\\t\\tdownloadUrl() {\\n\\t\\t\\tif (!this.codes) {\\n\\t\\t\\t\\treturn ''\\n\\t\\t\\t}\\n\\t\\t\\treturn 'data:text/plain,' + encodeURIComponent(this.codes.reduce((prev, code) => {\\n\\t\\t\\t\\treturn prev + code + '\\\\r\\\\n'\\n\\t\\t\\t}, ''))\\n\\t\\t},\\n\\t\\tdownloadFilename() {\\n\\t\\t\\tconst name = OC.theme.name || 'Nextcloud'\\n\\t\\t\\treturn name + '-backup-codes.txt'\\n\\t\\t},\\n\\t\\tenabled() {\\n\\t\\t\\treturn this.$store.state.enabled\\n\\t\\t},\\n\\t\\ttotal() {\\n\\t\\t\\treturn this.$store.state.total\\n\\t\\t},\\n\\t\\tused() {\\n\\t\\t\\treturn this.$store.state.used\\n\\t\\t},\\n\\t\\tcodes() {\\n\\t\\t\\treturn this.$store.state.codes\\n\\t\\t},\\n\\t\\tname() {\\n\\t\\t\\treturn OC.theme.name || 'Nextcloud'\\n\\t\\t},\\n\\t\\thaveCodes() {\\n\\t\\t\\treturn this.codes && this.codes.length > 0\\n\\t\\t},\\n\\t},\\n\\tmethods: {\\n\\t\\tgenerateBackupCodes() {\\n\\t\\t\\tconfirmPassword().then(() => {\\n\\t\\t\\t\\t// Hide old codes\\n\\t\\t\\t\\tthis.generatingCodes = true\\n\\n\\t\\t\\t\\tthis.$store.dispatch('generate').then(() => {\\n\\t\\t\\t\\t\\tthis.generatingCodes = false\\n\\t\\t\\t\\t}).catch(err => {\\n\\t\\t\\t\\t\\tOC.Notification.showTemporary(t('twofactor_backupcodes', 'An error occurred while generating your backup codes'))\\n\\t\\t\\t\\t\\tthis.generatingCodes = false\\n\\t\\t\\t\\t\\tthrow err\\n\\t\\t\\t\\t})\\n\\t\\t\\t}).catch(console.error.bind(this))\\n\\t\\t},\\n\\n\\t\\tgetPrintData(codes) {\\n\\t\\t\\tif (!codes) {\\n\\t\\t\\t\\treturn ''\\n\\t\\t\\t}\\n\\t\\t\\treturn codes.reduce((prev, code) => {\\n\\t\\t\\t\\treturn prev + code + '<br>'\\n\\t\\t\\t}, '')\\n\\t\\t},\\n\\n\\t\\tprintCodes() {\\n\\t\\t\\tprint(this.getPrintData(this.codes))\\n\\t\\t},\\n\\t},\\n}\\n</script>\\n\\n<style scoped>\\n\\t.backup-code {\\n\\t\\tfont-family: monospace;\\n\\t\\tletter-spacing: 0.02em;\\n\\t\\tfont-size: 1.2em;\\n\\t}\\n\\t.button {\\n\\t\\tdisplay: inline-block;\\n\\t}\\n</style>\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 4423;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t4423: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(28449)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","name","data","generatingCodes","computed","downloadUrl","codes","encodeURIComponent","reduce","prev","code","downloadFilename","OC","theme","enabled","$store","state","total","used","haveCodes","length","methods","generateBackupCodes","confirmPassword","then","dispatch","catch","err","Notification","showTemporary","t","console","error","bind","getPrintData","printCodes","newTab","window","open","document","write","print","close","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","_vm","this","_c","_self","_v","_s","_l","key","staticClass","attrs","on","class","Vue","use","Vuex","mutations","setEnabled","setTotal","setUsed","setCodes","actions","generate","_ref","commit","url","generateUrl","Axios","post","resp","generateCodes","_ref2","Store","strict","process","prototype","initialState","loadState","store","replaceState","extend","PersonalSettings","$mount","___CSS_LOADER_EXPORT___","push","module","id","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","loaded","__webpack_modules__","call","m","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","e","Promise","resolve","g","globalThis","Function","obj","prop","hasOwnProperty","Symbol","toStringTag","value","nmd","paths","children","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","nc","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file +{"version":3,"file":"twofactor_backupcodes-settings.js?v=65a72f23ef41ac588371","mappings":"uBAAIA,E,oGCgEJ,MChE4L,EDgE5L,CACAC,KAAA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,EAGjCkD,EAAqBV,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FU,EAAmBC,QAAQN,EAAqB3H,KAAK,KAAM,IAC3DgI,EAAmBhE,KAAO2D,EAAqB3H,KAAK,KAAMgI,EAAmBhE,KAAKhE,KAAKgI,G,KClDvF5D,EAAoB8D,QAAK3D,ECGzB,IAAI4D,EAAsB/D,EAAoBS,OAAEN,EAAW,CAAC,OAAO,IAAOH,EAAoB,SAC9F+D,EAAsB/D,EAAoBS,EAAEsD,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue?vue&type=script&lang=js","webpack:///nextcloud/apps/twofactor_backupcodes/src/service/PrintService.js","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?26a5","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?81a7","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?0c03","webpack:///nextcloud/apps/twofactor_backupcodes/src/store.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/service/BackupCodesService.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/settings.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue?vue&type=style&index=0&id=70ee3f3c&prod&lang=scss&scoped=true","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","<!--\n - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div class=\"backupcodes-settings\">\n\t\t<NcButton v-if=\"!enabled\"\n\t\t\tid=\"generate-backup-codes\"\n\t\t\t:disabled=\"generatingCodes\"\n\t\t\t@click=\"generateBackupCodes\">\n\t\t\t<template #icon>\n\t\t\t\t<NcLoadingIcon v-if=\"generatingCodes\" />\n\t\t\t</template>\n\t\t\t{{ t('twofactor_backupcodes', 'Generate backup codes') }}\n\t\t</NcButton>\n\t\t<template v-else>\n\t\t\t<p class=\"backupcodes-settings__codes\">\n\t\t\t\t<template v-if=\"!haveCodes\">\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used, total}) }}\n\t\t\t\t</template>\n\t\t\t\t<template v-else>\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later.') }}\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li v-for=\"code in codes\"\n\t\t\t\t\t\t\t:key=\"code\"\n\t\t\t\t\t\t\tclass=\"backupcodes-settings__codes__code\">\n\t\t\t\t\t\t\t{{ code }}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</template>\n\t\t\t</p>\n\t\t\t<p class=\"backupcodes-settings__actions\">\n\t\t\t\t<template v-if=\"haveCodes\">\n\t\t\t\t\t<NcButton :href=\"downloadUrl\"\n\t\t\t\t\t\t:download=\"downloadFilename\"\n\t\t\t\t\t\ttype=\"primary\">\n\t\t\t\t\t\t{{ t('twofactor_backupcodes', 'Save backup codes') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton @click=\"printCodes\">\n\t\t\t\t\t\t{{ t('twofactor_backupcodes', 'Print backup codes') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</template>\n\t\t\t\t<NcButton id=\"generate-backup-codes\"\n\t\t\t\t\t@click=\"generateBackupCodes\">\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'Regenerate backup codes') }}\n\t\t\t\t</NcButton>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<em>\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.') }}\n\t\t\t\t</em>\n\t\t\t</p>\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { confirmPassword } from '@nextcloud/password-confirmation'\nimport { print } from '../service/PrintService.js'\nimport NcButton from '@nextcloud/vue/dist/Components/NcButton.js'\nimport NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'\n\nimport '@nextcloud/password-confirmation/dist/style.css'\n\nexport default {\n\tname: 'PersonalSettings',\n\tcomponents: {\n\t\tNcButton,\n\t\tNcLoadingIcon,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tgeneratingCodes: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\tdownloadUrl() {\n\t\t\tif (!this.codes) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn 'data:text/plain,' + encodeURIComponent(this.codes.reduce((prev, code) => {\n\t\t\t\treturn prev + code + '\\r\\n'\n\t\t\t}, ''))\n\t\t},\n\t\tdownloadFilename() {\n\t\t\tconst name = OC.theme.name || 'Nextcloud'\n\t\t\treturn name + '-backup-codes.txt'\n\t\t},\n\t\tenabled() {\n\t\t\treturn this.$store.state.enabled\n\t\t},\n\t\ttotal() {\n\t\t\treturn this.$store.state.total\n\t\t},\n\t\tused() {\n\t\t\treturn this.$store.state.used\n\t\t},\n\t\tcodes() {\n\t\t\treturn this.$store.state.codes\n\t\t},\n\t\tname() {\n\t\t\treturn OC.theme.name || 'Nextcloud'\n\t\t},\n\t\thaveCodes() {\n\t\t\treturn this.codes && this.codes.length > 0\n\t\t},\n\t},\n\tmethods: {\n\t\tgenerateBackupCodes() {\n\t\t\tconfirmPassword().then(() => {\n\t\t\t\t// Hide old codes\n\t\t\t\tthis.generatingCodes = true\n\n\t\t\t\tthis.$store.dispatch('generate').then(() => {\n\t\t\t\t\tthis.generatingCodes = false\n\t\t\t\t}).catch(err => {\n\t\t\t\t\tOC.Notification.showTemporary(t('twofactor_backupcodes', 'An error occurred while generating your backup codes'))\n\t\t\t\t\tthis.generatingCodes = false\n\t\t\t\t\tthrow err\n\t\t\t\t})\n\t\t\t}).catch(console.error.bind(this))\n\t\t},\n\n\t\tgetPrintData(codes) {\n\t\t\tif (!codes) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn codes.reduce((prev, code) => {\n\t\t\t\treturn prev + code + '<br>'\n\t\t\t}, '')\n\t\t},\n\n\t\tprintCodes() {\n\t\t\tprint(this.getPrintData(this.codes))\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.backupcodes-settings {\n\t&__codes {\n\t\t&__code {\n\t\t\tfont-family: monospace;\n\t\t\tletter-spacing: 0.02em;\n\t\t\tfont-size: 1.2em;\n\t\t}\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tgap: var(--default-grid-baseline);\n\t}\n}\n</style>\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=script&lang=js\"","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * @param {any} data -\n */\nexport function print(data) {\n\tconst name = OC.theme.name || 'Nextcloud'\n\tconst newTab = window.open('', t('twofactor_backupcodes', '{name} backup codes', { name }))\n\tnewTab.document.write('<h1>' + t('twofactor_backupcodes', '{name} backup codes', { name }) + '</h1>')\n\tnewTab.document.write('<pre>' + data + '</pre>')\n\tnewTab.print()\n\tnewTab.close()\n}\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=style&index=0&id=70ee3f3c&prod&lang=scss&scoped=true\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=style&index=0&id=70ee3f3c&prod&lang=scss&scoped=true\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./PersonalSettings.vue?vue&type=template&id=70ee3f3c&scoped=true\"\nimport script from \"./PersonalSettings.vue?vue&type=script&lang=js\"\nexport * from \"./PersonalSettings.vue?vue&type=script&lang=js\"\nimport style0 from \"./PersonalSettings.vue?vue&type=style&index=0&id=70ee3f3c&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"70ee3f3c\",\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"backupcodes-settings\"},[(!_vm.enabled)?_c('NcButton',{attrs:{\"id\":\"generate-backup-codes\",\"disabled\":_vm.generatingCodes},on:{\"click\":_vm.generateBackupCodes},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [(_vm.generatingCodes)?_c('NcLoadingIcon'):_vm._e()]},proxy:true}],null,false,4108280908)},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Generate backup codes'))+\"\\n\\t\")]):[_c('p',{staticClass:\"backupcodes-settings__codes\"},[(!_vm.haveCodes)?[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used: _vm.used, total: _vm.total}))+\"\\n\\t\\t\\t\")]:[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later.'))+\"\\n\\t\\t\\t\\t\"),_c('ul',_vm._l((_vm.codes),function(code){return _c('li',{key:code,staticClass:\"backupcodes-settings__codes__code\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(code)+\"\\n\\t\\t\\t\\t\\t\")])}),0)]],2),_vm._v(\" \"),_c('p',{staticClass:\"backupcodes-settings__actions\"},[(_vm.haveCodes)?[_c('NcButton',{attrs:{\"href\":_vm.downloadUrl,\"download\":_vm.downloadFilename,\"type\":\"primary\"}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Save backup codes'))+\"\\n\\t\\t\\t\\t\")]),_vm._v(\" \"),_c('NcButton',{on:{\"click\":_vm.printCodes}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Print backup codes'))+\"\\n\\t\\t\\t\\t\")])]:_vm._e(),_vm._v(\" \"),_c('NcButton',{attrs:{\"id\":\"generate-backup-codes\"},on:{\"click\":_vm.generateBackupCodes}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Regenerate backup codes'))+\"\\n\\t\\t\\t\")])],2),_vm._v(\" \"),_c('p',[_c('em',[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.'))+\"\\n\\t\\t\\t\")])])]],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Vue from 'vue'\nimport Vuex, { Store } from 'vuex'\nimport { generateCodes } from './service/BackupCodesService.js'\n\nVue.use(Vuex)\n\nconst state = {\n\tenabled: false,\n\ttotal: 0,\n\tused: 0,\n\tcodes: [],\n}\n\nconst mutations = {\n\tsetEnabled(state, enabled) {\n\t\tVue.set(state, 'enabled', enabled)\n\t},\n\tsetTotal(state, total) {\n\t\tVue.set(state, 'total', total)\n\t},\n\tsetUsed(state, used) {\n\t\tVue.set(state, 'used', used)\n\t},\n\tsetCodes(state, codes) {\n\t\tVue.set(state, 'codes', codes)\n\t},\n}\n\nconst actions = {\n\tgenerate({ commit }) {\n\t\tcommit('setEnabled', false)\n\n\t\treturn generateCodes().then(({ codes, state }) => {\n\t\t\tcommit('setEnabled', state.enabled)\n\t\t\tcommit('setTotal', state.total)\n\t\t\tcommit('setUsed', state.used)\n\t\t\tcommit('setCodes', codes)\n\t\t\treturn true\n\t\t})\n\t},\n}\n\nexport default new Store({\n\tstrict: process.env.NODE_ENV !== 'production',\n\tstate,\n\tmutations,\n\tactions,\n})\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\n\n/**\n *\n */\nexport function generateCodes() {\n\tconst url = generateUrl('/apps/twofactor_backupcodes/settings/create')\n\n\treturn Axios.post(url, {}).then(resp => resp.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { loadState } from '@nextcloud/initial-state'\nimport Vue from 'vue'\n\nimport PersonalSettings from './views/PersonalSettings.vue'\nimport store from './store.js'\n\nVue.prototype.t = t\n\nconst initialState = loadState('twofactor_backupcodes', 'state')\nstore.replaceState(initialState)\n\nconst View = Vue.extend(PersonalSettings)\nnew View({\n\tstore,\n}).$mount('#twofactor-backupcodes-settings')\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.backupcodes-settings__codes__code[data-v-70ee3f3c]{font-family:monospace;letter-spacing:.02em;font-size:1.2em}.backupcodes-settings__actions[data-v-70ee3f3c]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--default-grid-baseline)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/twofactor_backupcodes/src/views/PersonalSettings.vue\"],\"names\":[],\"mappings\":\"AAGE,oDACC,qBAAA,CACA,oBAAA,CACA,eAAA,CAIF,gDACC,YAAA,CACA,cAAA,CACA,kBAAA,CACA,gCAAA\",\"sourcesContent\":[\"\\n.backupcodes-settings {\\n\\t&__codes {\\n\\t\\t&__code {\\n\\t\\t\\tfont-family: monospace;\\n\\t\\t\\tletter-spacing: 0.02em;\\n\\t\\t\\tfont-size: 1.2em;\\n\\t\\t}\\n\\t}\\n\\n\\t&__actions {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-wrap: wrap;\\n\\t\\talign-items: center;\\n\\t\\tgap: var(--default-grid-baseline);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 4423;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t4423: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(85781)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","name","components","NcButton","NcLoadingIcon","data","generatingCodes","computed","downloadUrl","codes","encodeURIComponent","reduce","prev","code","downloadFilename","OC","theme","enabled","$store","state","total","used","haveCodes","length","methods","generateBackupCodes","confirmPassword","then","dispatch","catch","err","Notification","showTemporary","t","console","error","bind","getPrintData","printCodes","newTab","window","open","document","write","print","close","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","_vm","this","_c","_self","staticClass","_v","_s","_l","key","attrs","on","_e","scopedSlots","_u","fn","proxy","Vue","use","Vuex","mutations","setEnabled","setTotal","setUsed","setCodes","actions","generate","_ref","commit","url","generateUrl","Axios","post","resp","generateCodes","_ref2","Store","strict","process","prototype","initialState","loadState","store","replaceState","extend","PersonalSettings","$mount","___CSS_LOADER_EXPORT___","push","module","id","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","loaded","__webpack_modules__","call","m","O","result","chunkIds","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","e","Promise","resolve","g","globalThis","Function","obj","prop","hasOwnProperty","Symbol","toStringTag","value","nmd","paths","children","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","nc","__webpack_exports__"],"sourceRoot":""}
\ No newline at end of file |