{"version":3,"sources":["webpack:///./src/views/LoadSecret.vue","webpack:///./src/views/LoadSecret.vue?d253","webpack:///./src/views/LoadSecret.vue?1048","webpack:///./src/views/LoadSecret.vue?a6a5"],"names":["render","_vm","this","_c","_self","_setupProxy","staticClass","attrs","_v","_s","$t","needsPassword","model","value","password","callback","$$v","expression","_e","passwordValidationError","on","show","staticRenderFns","LoadSecret","_Vue","_inherits","_super","_createSuper","_this","_classCallCheck","_createClass","key","_mounted","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","resData","wrap","_callee$","_context","prev","next","fetch","url","sent","json","status","$router","push","name","hasPassword","stop","mounted","apply","arguments","_show","_callee2","_callee2$","_context2","encodeURIComponent","showPasswordValidationError","abrupt","t0","$store","t1","dispatch","call","params","Vue","__decorate","Prop","Component","component"],"mappings":"yHAAA,IAAIA,EAAS,SAASA,SAAS,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,MAAM,CAACG,YAAY,eAAe,CAACH,EAAG,cAAc,CAACI,MAAM,CAAC,QAAU,GAAG,MAAQ,KAAK,CAACJ,EAAG,gBAAgB,CAACF,EAAIO,GAAG,IAAIP,EAAIQ,GAAGR,EAAIS,GAAG,6BAA6B,QAAQ,GAAGP,EAAG,cAAc,CAACI,MAAM,CAAC,MAAQN,EAAIS,GAAG,uBAAuB,KAAO,OAAO,CAAER,KAAKS,cAAeR,EAAG,YAAY,CAACI,MAAM,CAAC,GAAK,iBAAiB,KAAO,iBAAiB,MAAQN,EAAIS,GAAG,6BAA6B,KAAO,YAAYE,MAAM,CAACC,MAAOZ,EAAIa,SAAUC,SAAS,SAAAA,SAAUC,GAAMf,EAAIa,SAASE,GAAKC,WAAW,cAAchB,EAAIiB,KAAKf,EAAG,YAAY,CAACS,MAAM,CAACC,MAAOZ,EAAIkB,wBAAyBJ,SAAS,SAAAA,SAAUC,GAAMf,EAAIkB,wBAAwBH,GAAKC,WAAW,4BAA4B,C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,EAAAjB,KAAA,EACFC,MAAM,eAAiB1C,KAAK2C,IAAM,aAAegB,mBAAmB3D,KAAKY,WAAU,OAA5F,GAAHuB,EAAGuB,EAAAd,KAEU,MAAfT,EAAIW,OAAc,CAAAY,EAAAjB,KAAA,QACc,OAAlCzC,KAAK4D,8BAA6BF,EAAAG,OAAA,iBAIzB,OAJyBH,EAAAI,GAIpC9D,KAAK+D,OAAML,EAAAjB,KAAA,GAA8BN,EAAIU,OAAM,QAAAa,EAAAM,GAAAN,EAAAd,KAAAc,EAAAI,GAAvCG,SAAQC,KAAAR,EAAAI,GAAC,YAAWJ,EAAAM,IAAA,QAElChE,KAAK+C,QAAQC,KAAK,CAChBC,KAAM,aACNkB,OAAQ,CAAExB,IAAM3C,KAAK2C,OACrB,yBAAAe,EAAAP,UAAAK,SAAA,UACH,SAAArC,OAAA,OAAAoC,EAAAF,MAAA,KAAAC,WAAA,OAAAnC,KAjBA,IAiBA,CAAAU,IAAA,8BAAAlB,MAEO,SAAAiD,8BACN5D,KAAKiB,yBAA0B,MAChCI,WAvC4B,CAAS+C,SAMtCC,eAAA,CADCC,kB,0BALkBjD,EAAUgD,eAAA,CAD9BE,eAAU,KACUlD,WCN+W,I,YCOhYmD,EAAY,eACd,EACA1E,EACAsB,GACA,EACA,KACA,KACA,MAIa,aAAAoD,E","file":"js/chunk-2d0decf6.8dd86668.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"load-secret\"},[_c('anx-content',{attrs:{\"inverse\":\"\",\"first\":\"\"}},[_c('anx-paragraph',[_vm._v(\" \"+_vm._s(_vm.$t('labels.c_login_head_text'))+\" \")])],1),_c('anx-content',{attrs:{\"title\":_vm.$t('labels.c_login_head'),\"size\":\"h2\"}},[(this.needsPassword)?_c('anx-input',{attrs:{\"id\":\"login-password\",\"name\":\"login-password\",\"label\":_vm.$t('labels.c_input_passphrase'),\"type\":\"password\"},model:{value:(_vm.password),callback:function ($$v) {_vm.password=$$v},expression:\"password\"}}):_vm._e(),_c('anx-alert',{model:{value:(_vm.passwordValidationError),callback:function ($$v) {_vm.passwordValidationError=$$v},expression:\"passwordValidationError\"}},[_vm._v(_vm._s(_vm.$t('message.c_wrong_password')))]),_c('div',{staticClass:\"btn-center\"},[_c('anx-button',{attrs:{\"text\":_vm.$t('btn.c_login_password')},on:{\"click\":_vm.show}})],1)],1)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\nimport { Vue, Component, Prop } from 'vue-property-decorator'\n\nimport 'whatwg-fetch'\n\n@Component({})\nexport default class LoadSecret extends Vue {\n private password: string = '';\n private needsPassword: boolean = false;\n private passwordValidationError: boolean = false;\n\n @Prop()\n private url: string|undefined;\n\n private async mounted () {\n const res = await fetch('/api/secret/' + this.url + '/info')\n\n const resData = await res.json()\n\n if (res.status === 404) {\n this.$router.push({ name: 'Error' })\n }\n\n this.needsPassword = resData.hasPassword\n }\n\n private async show () {\n if (this.needsPassword) {\n const res = await fetch('/api/secret/' + this.url + '?password=' + encodeURIComponent(this.password))\n\n if (res.status === 403) {\n this.showPasswordValidationError()\n return // wrong password\n }\n\n this.$store.dispatch('setSecret', (await res.json()))\n }\n this.$router.push({\n name: 'showSecret',\n params: { url: (this.url as string) }\n })\n }\n\n private showPasswordValidationError () {\n this.passwordValidationError = true\n }\n}\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--15-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LoadSecret.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--15-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LoadSecret.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./LoadSecret.vue?vue&type=template&id=de4e731a\"\nimport script from \"./LoadSecret.vue?vue&type=script&lang=ts\"\nexport * from \"./LoadSecret.vue?vue&type=script&lang=ts\"\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 null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}