{"version":3,"sources":["webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?bc9f","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?c849","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?8f35","webpack:///./src/components/Forms/FieldTypes/FormVideoUploadField.vue?0867"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","class","hasErrors","def","TypeName","directives","name","rawName","value","videoBlob","expression","ref","attrs","on","handleDone","deleteVideo","_v","_s","Labels","Delete","recordNewVideo","Replace","staticRenderFns","videoBlobUrl","errors","length","URL","revokeObjectURL","createObjectURL","$refs","preview","src","recorder","requestRecording","Key","Value","Blob","components","VideoRecorder","component"],"mappings":"2IAAA,W,yCCAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,aAAaC,MAAM,CAAC,CAAC,aAAcP,EAAIQ,WAAY,eAAiBR,EAAIS,IAAIC,WAAW,CAACN,EAAG,MAAM,CAACO,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAyB,OAAlBd,EAAIe,UAAoBC,WAAW,uBAAuBV,YAAY,qBAAqB,CAACF,EAAG,gBAAgB,CAACa,IAAI,WAAWC,MAAM,CAAC,IAAMlB,EAAIS,KAAKU,GAAG,CAAC,KAAOnB,EAAIoB,eAAe,GAAGhB,EAAG,MAAM,CAACO,WAAW,CAAC,CAACC,KAAK,OAAOC,QAAQ,SAASC,MAAyB,OAAlBd,EAAIe,UAAoBC,WAAW,uBAAuBV,YAAY,qBAAqB,CAACF,EAAG,MAAM,CAACE,YAAY,iBAAiB,CAACF,EAAG,QAAQ,CAACa,IAAI,UAAUX,YAAY,uBAAuBY,MAAM,CAAC,SAAW,GAAG,SAAW,QAAQd,EAAG,MAAM,CAACE,YAAY,eAAe,CAACF,EAAG,SAAS,CAACE,YAAY,4BAA4Ba,GAAG,CAAC,MAAQnB,EAAIqB,cAAc,CAACrB,EAAIsB,GAAGtB,EAAIuB,GAAGvB,EAAIS,IAAIe,OAAOC,WAAWrB,EAAG,SAAS,CAACE,YAAY,4BAA4Ba,GAAG,CAAC,MAAQnB,EAAI0B,iBAAiB,CAAC1B,EAAIsB,GAAGtB,EAAIuB,GAAGvB,EAAIS,IAAIe,OAAOG,aAAa,QAClgCC,EAAkB,G,whBC6BD,EAArB,yG,0BAOU,EAAAb,UAAyB,KAEzB,EAAAc,aAA8B,KATxC,gDAWE,WACE,OAAO5B,KAAK6B,OAAOC,OAAS,IAZhC,wBAeU,SAAWhB,G,MACjBd,KAAKc,UAAYA,EAES,OAAtBd,KAAK4B,eACPG,IAAIC,gBAAgBhC,KAAK4B,cACzB5B,KAAK4B,aAAe,MAGC,OAAnB5B,KAAKc,YACPd,KAAK4B,aAAeG,IAAIE,gBAAgBjC,KAAKc,YAG9Cd,KAAKkC,MAAMC,QAA6BC,IAAuB,QAApB,EAAGpC,KAAK4B,oBAAY,QAAI,KA3BxE,4BA8BU,WACL5B,KAAKkC,MAAMG,SAAsCC,qBA/BtD,yBAkCU,WACNtC,KAAKmB,WAAW,QAnCpB,sBAsCE,WACE,MAAO,CACLoB,IAAKvC,KAAKQ,IAAI+B,IACdC,MAAOxC,KAAKc,aAzClB,sBA6CE,SAASD,IACHA,EAAM2B,iBAAiBC,MAAwB,OAAhB5B,EAAM2B,SACvCxC,KAAKc,UAAYD,EAAM2B,WA/C7B,GAAkD,QAEhD,GADC,kB,0BAID,GADC,kB,6BAJkB,EAAoB,GALxC,eAAU,CACTE,WAAY,CACVC,cAAA,WAGiB,WC9B8Z,I,wBCQ/aC,EAAY,eACd,EACA9C,EACA6B,GACA,EACA,KACA,WACA,MAIa,aAAAiB,E","file":"js/chunk-1cfcd737.1c980cc9.js","sourcesContent":["export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FormVideoUploadField.vue?vue&type=style&index=0&id=6832a9d6&scoped=true&lang=css&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;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)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { Component, Vue, Prop } from 'vue-property-decorator';\nimport { VideoRecorderField, IFormField } from 'client-website-ts-library/types/Forms/FieldTypes';\nimport { FormSubmissionValidationError, FormValue } from 'client-website-ts-library/types/Forms';\n\nimport { VideoRecorder } from 'client-website-ts-library/components';\n\n@Component({\n components: {\n VideoRecorder,\n },\n})\nexport default class FormVideoUploadField extends Vue implements IFormField {\n @Prop()\n private readonly def!: VideoRecorderField;\n\n @Prop()\n private readonly errors!: FormSubmissionValidationError[];\n\n private videoBlob: Blob | null = null;\n\n private videoBlobUrl: string | null = null;\n\n get hasErrors(): boolean {\n return this.errors.length > 0;\n }\n\n private handleDone(videoBlob: Blob | null) {\n this.videoBlob = videoBlob;\n\n if (this.videoBlobUrl !== null) {\n URL.revokeObjectURL(this.videoBlobUrl!);\n this.videoBlobUrl = null;\n }\n\n if (this.videoBlob !== null) {\n this.videoBlobUrl = URL.createObjectURL(this.videoBlob);\n }\n\n (this.$refs.preview as HTMLVideoElement).src = this.videoBlobUrl ?? '';\n }\n\n private recordNewVideo() {\n (this.$refs.recorder as unknown as VideoRecorder).requestRecording();\n }\n\n private deleteVideo(): void {\n this.handleDone(null);\n }\n\n getValue(): FormValue {\n return {\n Key: this.def.Key,\n Value: this.videoBlob,\n };\n }\n\n setValue(value: FormValue) {\n if (value.Value instanceof Blob || value.Value === null) {\n this.videoBlob = value.Value;\n }\n }\n}\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-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--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-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&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":""}