{"version":3,"sources":["webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?cb09","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?dc5c","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?f6f7","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?dcf2"],"names":["render","_vm","this","_c","_self","_setupProxy","staticClass","class","hasErrors","def","TypeName","directives","name","rawName","value","videoBlob","expression","ref","attrs","on","handleDone","deleteVideo","_v","_s","Labels","Delete","recordNewVideo","Replace","staticRenderFns","FormVideoUploadField","Vue","constructor","videoBlobUrl","errors","length","URL","revokeObjectURL","createObjectURL","$refs","preview","src","recorder","requestRecording","getValue","Key","Value","setValue","Blob","__decorate","Prop","Component","components","VideoRecorder","component"],"mappings":"yIAAA,W,yCCAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAUF,EAAIG,MAAMC,YAAY,OAAOF,EAAG,MAAM,CAACG,YAAY,aAAaC,MAAM,CAAC,CAAC,aAAcN,EAAIO,WAAY,eAAiBP,EAAIQ,IAAIC,WAAW,CAACP,EAAG,MAAM,CAACQ,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAyB,OAAlBb,EAAIc,UAAoBC,WAAW,uBAAuBV,YAAY,qBAAqB,CAACH,EAAG,gBAAgB,CAACc,IAAI,WAAWC,MAAM,CAAC,IAAMjB,EAAIQ,KAAKU,GAAG,CAAC,KAAOlB,EAAImB,eAAe,GAAGjB,EAAG,MAAM,CAACQ,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAyB,OAAlBb,EAAIc,UAAoBC,WAAW,uBAAuBV,YAAY,qBAAqB,CAACH,EAAG,MAAM,CAACG,YAAY,iBAAiB,CAACH,EAAG,QAAQ,CAACc,IAAI,UAAUX,YAAY,uBAAuBY,MAAM,CAAC,SAAW,GA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../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FormVideoUploadField.vue?vue&type=style&index=0&id=6832a9d6&prod&scoped=true&lang=css&\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"form-field\",class:[{'has-errors': _vm.hasErrors}, 'form-field--' + _vm.def.TypeName]},[_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.videoBlob === null),expression:\"videoBlob === null\"}],staticClass:\"form-field__panel\"},[_c('VideoRecorder',{ref:\"recorder\",attrs:{\"def\":_vm.def},on:{\"done\":_vm.handleDone}})],1),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.videoBlob !== null),expression:\"videoBlob !== null\"}],staticClass:\"form-field__panel\"},[_c('div',{staticClass:\"video-preview\"},[_c('video',{ref:\"preview\",staticClass:\"video-preview__video\",attrs:{\"autoplay\":\"\",\"controls\":\"\"}})]),_c('div',{staticClass:\"center-text\"},[_c('Button',{staticClass:\"video-field__swap-buttons\",on:{\"click\":_vm.deleteVideo}},[_vm._v(_vm._s(_vm.def.Labels.Delete))]),_c('Button',{staticClass:\"video-field__swap-buttons\",on:{\"click\":_vm.recordNewVideo}},[_vm._v(_vm._s(_vm.def.Labels.Replace))])],1)])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport { Component, Vue, Prop } from 'vue-property-decorator';\r\nimport { VideoRecorderField, IFormField } from 'client-website-ts-library/types/Forms/FieldTypes';\r\nimport { FormSubmissionValidationError, FormValue } from 'client-website-ts-library/types/Forms';\r\n\r\nimport { VideoRecorder } from 'client-website-ts-library/components';\r\n\r\n@Component({\r\n components: {\r\n VideoRecorder,\r\n },\r\n})\r\nexport default class FormVideoUploadField extends Vue implements IFormField {\r\n @Prop()\r\n private readonly def!: VideoRecorderField;\r\n\r\n @Prop()\r\n private readonly errors!: FormSubmissionValidationError[];\r\n\r\n private videoBlob: Blob | null = null;\r\n\r\n private videoBlobUrl: string | null = null;\r\n\r\n get hasErrors(): boolean {\r\n return this.errors.length > 0;\r\n }\r\n\r\n private handleDone(videoBlob: Blob | null) {\r\n this.videoBlob = videoBlob;\r\n\r\n if (this.videoBlobUrl !== null) {\r\n URL.revokeObjectURL(this.videoBlobUrl!);\r\n this.videoBlobUrl = null;\r\n }\r\n\r\n if (this.videoBlob !== null) {\r\n this.videoBlobUrl = URL.createObjectURL(this.videoBlob);\r\n }\r\n\r\n (this.$refs.preview as HTMLVideoElement).src = this.videoBlobUrl ?? '';\r\n }\r\n\r\n private recordNewVideo() {\r\n (this.$refs.recorder as unknown as VideoRecorder).requestRecording();\r\n }\r\n\r\n private deleteVideo(): void {\r\n this.handleDone(null);\r\n }\r\n\r\n getValue(): FormValue {\r\n return {\r\n Key: this.def.Key,\r\n Value: this.videoBlob,\r\n };\r\n }\r\n\r\n setValue(value: FormValue) {\r\n if (value.Value instanceof Blob || value.Value === null) {\r\n this.videoBlob = value.Value;\r\n }\r\n }\r\n}\r\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!./FormVideoUploadField.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!./FormVideoUploadField.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FormVideoUploadField.vue?vue&type=template&id=6832a9d6&scoped=true&\"\nimport script from \"./FormVideoUploadField.vue?vue&type=script&lang=ts&\"\nexport * from \"./FormVideoUploadField.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FormVideoUploadField.vue?vue&type=style&index=0&id=6832a9d6&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 \"6832a9d6\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}