@micromag/viewer-build 0.2.300 → 0.2.304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/build/asset-manifest.json +46 -46
  2. package/build/index.html +1 -1
  3. package/build/static/css/main.b267114f.chunk.css +2 -0
  4. package/build/static/css/{main.f936f9c7.chunk.css.map → main.b267114f.chunk.css.map} +1 -1
  5. package/build/static/js/{0.01163aa6.chunk.js → 0.c57697df.chunk.js} +2 -2
  6. package/build/static/js/{0.01163aa6.chunk.js.map → 0.c57697df.chunk.js.map} +1 -1
  7. package/build/static/js/{1.a3777b79.chunk.js → 1.a2a1b3c9.chunk.js} +2 -2
  8. package/build/static/js/{1.a3777b79.chunk.js.map → 1.a2a1b3c9.chunk.js.map} +1 -1
  9. package/build/static/js/{10.f9dd6afb.chunk.js → 10.6fcd1224.chunk.js} +2 -2
  10. package/build/static/js/{10.f9dd6afb.chunk.js.map → 10.6fcd1224.chunk.js.map} +1 -1
  11. package/build/static/js/{11.34b8c9a7.chunk.js → 11.83a32e76.chunk.js} +2 -2
  12. package/build/static/js/{11.34b8c9a7.chunk.js.map → 11.83a32e76.chunk.js.map} +1 -1
  13. package/build/static/js/{12.2dce3474.chunk.js → 12.3f05f526.chunk.js} +2 -2
  14. package/build/static/js/{12.2dce3474.chunk.js.map → 12.3f05f526.chunk.js.map} +1 -1
  15. package/build/static/js/{13.bde03245.chunk.js → 13.b5bda01c.chunk.js} +2 -2
  16. package/build/static/js/{13.bde03245.chunk.js.map → 13.b5bda01c.chunk.js.map} +1 -1
  17. package/build/static/js/{14.91002aaf.chunk.js → 14.258179b5.chunk.js} +2 -2
  18. package/build/static/js/{14.91002aaf.chunk.js.map → 14.258179b5.chunk.js.map} +1 -1
  19. package/build/static/js/{15.32007c2f.chunk.js → 15.76c2eb50.chunk.js} +2 -2
  20. package/build/static/js/{15.32007c2f.chunk.js.map → 15.76c2eb50.chunk.js.map} +1 -1
  21. package/build/static/js/{16.ff749cb1.chunk.js → 16.ae6b0552.chunk.js} +2 -2
  22. package/build/static/js/{16.ff749cb1.chunk.js.map → 16.ae6b0552.chunk.js.map} +1 -1
  23. package/build/static/js/{17.9104f132.chunk.js → 17.2441fadf.chunk.js} +2 -2
  24. package/build/static/js/{17.9104f132.chunk.js.map → 17.2441fadf.chunk.js.map} +1 -1
  25. package/build/static/js/18.2c3d3413.chunk.js +2 -0
  26. package/build/static/js/{18.5efbf108.chunk.js.map → 18.2c3d3413.chunk.js.map} +1 -1
  27. package/build/static/js/{2.21428e7d.chunk.js → 2.16849a32.chunk.js} +2 -2
  28. package/build/static/js/{2.21428e7d.chunk.js.map → 2.16849a32.chunk.js.map} +1 -1
  29. package/build/static/js/5.6b01950d.chunk.js +3 -0
  30. package/build/static/js/{5.0f581947.chunk.js.LICENSE.txt → 5.6b01950d.chunk.js.LICENSE.txt} +7 -0
  31. package/build/static/js/5.6b01950d.chunk.js.map +1 -0
  32. package/build/static/js/{6.c35da869.chunk.js → 6.07662540.chunk.js} +3 -3
  33. package/build/static/js/{6.c35da869.chunk.js.LICENSE.txt → 6.07662540.chunk.js.LICENSE.txt} +0 -0
  34. package/build/static/js/{6.c35da869.chunk.js.map → 6.07662540.chunk.js.map} +1 -1
  35. package/build/static/js/{7.183f653f.chunk.js → 7.eddfee5e.chunk.js} +2 -2
  36. package/build/static/js/{7.183f653f.chunk.js.map → 7.eddfee5e.chunk.js.map} +1 -1
  37. package/build/static/js/{8.18b5d6e9.chunk.js → 8.db47bd20.chunk.js} +2 -2
  38. package/build/static/js/{8.18b5d6e9.chunk.js.map → 8.db47bd20.chunk.js.map} +1 -1
  39. package/build/static/js/{9.f1fd57b4.chunk.js → 9.be4dea01.chunk.js} +2 -2
  40. package/build/static/js/{9.f1fd57b4.chunk.js.map → 9.be4dea01.chunk.js.map} +1 -1
  41. package/build/static/js/main.eda7741a.chunk.js +2 -0
  42. package/build/static/js/main.eda7741a.chunk.js.map +1 -0
  43. package/build/static/js/{runtime-main.61dd3d02.js → runtime-main.f11d5020.js} +2 -2
  44. package/build/static/js/{runtime-main.61dd3d02.js.map → runtime-main.f11d5020.js.map} +1 -1
  45. package/package.json +7 -7
  46. package/build/static/css/main.f936f9c7.chunk.css +0 -2
  47. package/build/static/js/18.5efbf108.chunk.js +0 -2
  48. package/build/static/js/5.0f581947.chunk.js +0 -3
  49. package/build/static/js/5.0f581947.chunk.js.map +0 -1
  50. package/build/static/js/main.c980496e.chunk.js +0 -2
  51. package/build/static/js/main.c980496e.chunk.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (this["webpackJsonp@micromag/viewer-build"]=this["webpackJsonp@micromag/viewer-build"]||[]).push([[9],{584:function(e,t,i){var o=i(38).h;e.exports=function(e){return o("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},o("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"}))}},635:function(e,t){var i={"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};e.exports=function(e){return e=e.replace(/;.*$/,""),i[e]||null}},636:function(e,t,i){var o=i(290);e.exports=function(e,t,i){return e.toBlob?new Promise((function(o){e.toBlob(o,t,i)})):Promise.resolve().then((function(){return o(e.toDataURL(t,i),{})}))}},637:function(e,t){e.exports=function(){return"function"===typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"===typeof MediaRecorder.prototype.start}},638:function(e,t,i){function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var n=i(38),s=n.h,a=n.Component,c=i(639),d=i(640),u=i(641),p=i(643),l=i(644),h=i(645);function g(e,t){return-1!==e.indexOf(t)}var m=function(e){var t,i;function n(){return e.apply(this,arguments)||this}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,r(t,i);var a=n.prototype;return a.componentDidMount=function(){(0,this.props.onFocus)()},a.componentWillUnmount=function(){(0,this.props.onStop)()},a.render=function(){var e=this,t=this.props,i=t.src,r=t.recordedVideo,n=t.recording,a=t.modes,m=t.supportsRecording,f=t.videoSources,v=t.showVideoSourceDropdown,y=t.showRecordingLength,b=t.onSubmit,S=t.i18n,w=t.mirror,R=t.onSnapshot,C=t.onStartRecording,P=t.onStopRecording,M=t.onDiscardRecordedVideo,k=t.recordingLengthSeconds,x=!!r,I=!x&&m&&(g(a,"video-only")||g(a,"audio-only")||g(a,"video-audio")),D=!x&&g(a,"picture"),V=m&&y,T=v&&f&&f.length>1,L={playsinline:!0};return r?(L.muted=!1,L.controls=!0,L.src=r,this.videoElement&&(this.videoElement.srcObject=void 0)):(L.muted=!0,L.autoplay=!0,L.srcObject=i),s("div",{className:"uppy uppy-Webcam-container"},s("div",{className:"uppy-Webcam-videoContainer"},s("video",o({ref:function(t){return e.videoElement=t},className:"uppy-Webcam-video "+(w?"uppy-Webcam-video--mirrored":"")},L))),s("div",{className:"uppy-Webcam-footer"},s("div",{className:"uppy-Webcam-videoSourceContainer"},T?p(this.props):null),s("div",{className:"uppy-Webcam-buttonContainer"},D&&s(c,{onSnapshot:R,i18n:S}),I&&s(d,{recording:n,onStartRecording:C,onStopRecording:P,i18n:S}),x&&s(l,{onSubmit:b,i18n:S}),x&&s(h,{onDiscard:M,i18n:S})),V&&s("div",{className:"uppy-Webcam-recordingLength"},s(u,{recordingLengthSeconds:k,i18n:S}))))},n}(a);e.exports=m},639:function(e,t,i){var o=i(38).h,r=i(584);e.exports=function(e){var t=e.onSnapshot,i=e.i18n;return o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:i("takePicture"),"aria-label":i("takePicture"),onClick:t,"data-uppy-super-focusable":!0},r())}},640:function(e,t,i){var o=i(38).h;e.exports=function(e){var t=e.recording,i=e.onStartRecording,r=e.onStopRecording,n=e.i18n;return t?o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("stopRecording"),"aria-label":n("stopRecording"),onClick:r,"data-uppy-super-focusable":!0},o("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},o("rect",{x:"15",y:"15",width:"70",height:"70"}))):o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("startRecording"),"aria-label":n("startRecording"),onClick:i,"data-uppy-super-focusable":!0},o("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},o("circle",{cx:"50",cy:"50",r:"40"})))}},641:function(e,t,i){var o=i(38).h,r=i(642);e.exports=function(e){var t=e.recordingLengthSeconds,i=e.i18n,n=r(t);return o("span",{"aria-label":i("recordingLength",{recording_length:n})},n)}},642:function(e,t){e.exports=function(e){return Math.floor(e/60)+":"+String(e%60).padStart(2,0)}},643:function(e,t,i){var o=i(38).h;e.exports=function(e){var t=e.currentDeviceId,i=e.videoSources,r=e.onChangeVideoSource;return o("div",{className:"uppy-Webcam-videoSource"},o("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:function(e){r(e.target.value)}},i.map((function(e){return o("option",{key:e.deviceId,value:e.deviceId,selected:e.deviceId===t},e.label)}))))}},644:function(e,t,i){var o=i(38).h;e.exports=function(e){var t=e.onSubmit,i=e.i18n;return o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:i("submitRecordedFile"),"aria-label":i("submitRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},o("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},o("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}},645:function(e,t,i){var o=i(38).h;e.exports=function(e){var t=e.onDiscard,i=e.i18n;return o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:i("discardRecordedFile"),"aria-label":i("discardRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},o("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},o("g",{fill:"#FFF",fillRule:"evenodd"},o("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),o("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}},646:function(e,t,i){var o=i(38).h;e.exports=function(e){return o("div",{className:"uppy-Webcam-permissons"},o("div",{className:"uppy-Webcam-permissonsIcon"},e.icon()),o("h1",{className:"uppy-Webcam-title"},e.hasCamera?e.i18n("allowAccessTitle"):e.i18n("noCameraTitle")),o("p",null,e.hasCamera?e.i18n("allowAccessDescription"):e.i18n("noCameraDescription")))}},672:function(e,t,i){var o,r;function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=i(38).h,d=i(73).Plugin,u=i(92),p=i(635),l=i(289),h=i(636),g=i(637),m=i(584),f=i(638),v=i(646);function y(e){return"."===e[0]?l[e.slice(1)]:e}function b(e){return/^video\/[^*]+$/.test(e)}function S(e){return/^image\/[^*]+$/.test(e)}e.exports=(r=o=function(e){var t,i;function o(t,i){var o;(o=e.call(this,t,i)||this).mediaDevices=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(i,o){e.call(navigator,t,i,o)}))}}:null}(),o.supportsUserMedia=!!o.mediaDevices,o.protocol=location.protocol.match(/https/i)?"https":"http",o.id=o.opts.id||"Webcam",o.title=o.opts.title||"Camera",o.type="acquirer",o.capturedMediaFile=null,o.icon=function(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("g",{fill:"none",fillRule:"evenodd"},c("rect",{className:"uppy-ProviderIconBg",fill:"#03BFEF",width:"32",height:"32",rx:"16"}),c("path",{d:"M22 11c1.133 0 2 .867 2 2v7.333c0 1.134-.867 2-2 2H10c-1.133 0-2-.866-2-2V13c0-1.133.867-2 2-2h2.333l1.134-1.733C13.6 9.133 13.8 9 14 9h4c.2 0 .4.133.533.267L19.667 11H22zm-6 1.533a3.764 3.764 0 0 0-3.8 3.8c0 2.129 1.672 3.801 3.8 3.801s3.8-1.672 3.8-3.8c0-2.13-1.672-3.801-3.8-3.801zm0 6.261c-1.395 0-2.46-1.066-2.46-2.46 0-1.395 1.065-2.461 2.46-2.461s2.46 1.066 2.46 2.46c0 1.395-1.065 2.461-2.46 2.461z",fill:"#FFF",fillRule:"nonzero"})))},o.defaultLocale={strings:{smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site.",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",recordingLength:"Recording length %{recording_length}",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file"}};var r={onBeforeSnapshot:function(){return Promise.resolve()},countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1};return o.opts=n({},r,i),o.i18nInit(),o.install=o.install.bind(s(o)),o.setPluginState=o.setPluginState.bind(s(o)),o.render=o.render.bind(s(o)),o.start=o.start.bind(s(o)),o.stop=o.stop.bind(s(o)),o.takeSnapshot=o.takeSnapshot.bind(s(o)),o.startRecording=o.startRecording.bind(s(o)),o.stopRecording=o.stopRecording.bind(s(o)),o.discardRecordedVideo=o.discardRecordedVideo.bind(s(o)),o.submit=o.submit.bind(s(o)),o.oneTwoThreeSmile=o.oneTwoThreeSmile.bind(s(o)),o.focus=o.focus.bind(s(o)),o.changeVideoSource=o.changeVideoSource.bind(s(o)),o.webcamActive=!1,o.opts.countdown&&(o.opts.onBeforeSnapshot=o.oneTwoThreeSmile),o.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null}),o}i=e,(t=o).prototype=Object.create(i.prototype),t.prototype.constructor=t,a(t,i);var r=o.prototype;return r.setOptions=function(t){e.prototype.setOptions.call(this,n({},t,{videoConstraints:n({},this.opts.videoConstraints,null==t?void 0:t.videoConstraints)})),this.i18nInit()},r.i18nInit=function(){this.translator=new u([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},r.hasCameraCheck=function(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then((function(e){return e.some((function(e){return"videoinput"===e.kind}))})):Promise.resolve(!1)},r.isAudioOnly=function(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]},r.getConstraints=function(e){var t;void 0===e&&(e=null);var i=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),o=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),r=n({},null!=(t=this.opts.videoConstraints)?t:{facingMode:this.opts.facingMode},e?{deviceId:e,facingMode:null}:{});return{audio:i,video:!!o&&r}},r.start=function(e){var t=this;if(void 0===e&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror=!0;var i=this.getConstraints(e&&e.deviceId?e.deviceId:null);this.hasCameraCheck().then((function(o){return t.setPluginState({hasCamera:o}),t.mediaDevices.getUserMedia(i).then((function(i){t.stream=i;var o=null,r=t.isAudioOnly()?i.getAudioTracks():i.getVideoTracks();e&&e.deviceId?r.forEach((function(t){t.getSettings().deviceId===e.deviceId&&(o=t.getSettings().deviceId)})):o=r[0].getSettings().deviceId,t.updateVideoSources(),t.setPluginState({currentDeviceId:o,cameraReady:!0})})).catch((function(e){t.setPluginState({cameraReady:!1,cameraError:e}),t.uppy.info(e.message,"error")}))}))},r.getMediaRecorderOptions=function(){var e={};if(MediaRecorder.isTypeSupported){var t=this.uppy.opts.restrictions,i=[];this.opts.preferredVideoMimeType?i=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(i=t.allowedFileTypes.map(y).filter(b));var o=i.filter((function(e){return MediaRecorder.isTypeSupported(e)&&p(e)}));o.length>0&&(e.mimeType=o[0])}return e},r.startRecording=function(){var e=this;this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];var t=!1;this.recorder.addEventListener("dataavailable",(function(i){e.recordingChunks.push(i.data);var o=e.uppy.opts.restrictions;if(e.recordingChunks.length>1&&null!=o.maxFileSize&&!t){var r=e.recordingChunks.reduce((function(e,t){return e+t.size}),0),n=3*((r-e.recordingChunks[0].size)/(e.recordingChunks.length-1));r>Math.max(0,o.maxFileSize-n)&&(t=!0,e.uppy.info(e.i18n("recordingStoppedMaxSize"),"warning",4e3),e.stopRecording())}})),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval((function(){var t=e.getPluginState().recordingLengthSeconds;e.setPluginState({recordingLengthSeconds:t+1})}),1e3)),this.setPluginState({isRecording:!0})},r.stopRecording=function(){var e=this;return new Promise((function(t){e.recorder.addEventListener("stop",(function(){t()})),e.recorder.stop(),e.opts.showRecordingLength&&(clearInterval(e.recordingLengthTimer),e.setPluginState({recordingLengthSeconds:0}))})).then((function(){return e.setPluginState({isRecording:!1}),e.getVideo()})).then((function(t){try{e.capturedMediaFile=t,e.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),e.opts.mirror=!1}catch(i){i.isRestriction||e.uppy.log(i)}})).then((function(){e.recordingChunks=null,e.recorder=null}),(function(t){throw e.recordingChunks=null,e.recorder=null,t}))},r.discardRecordedVideo=function(){this.setPluginState({recordedVideo:null}),this.opts.mirror=!0,this.capturedMediaFile=null},r.submit=function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}},r.stop=function(){this.stream&&(this.stream.getAudioTracks().forEach((function(e){e.stop()})),this.stream.getVideoTracks().forEach((function(e){e.stop()}))),this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null})},r.getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},r.oneTwoThreeSmile=function(){var e=this;return new Promise((function(t,i){var o=e.opts.countdown,r=setInterval((function(){if(!e.webcamActive)return clearInterval(r),e.captureInProgress=!1,i(new Error("Webcam is not active"));o>0?(e.uppy.info(o+"...","warning",800),o--):(clearInterval(r),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout((function(){return t()}),1500))}),1e3)}))},r.takeSnapshot=function(){var e=this;this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch((function(t){var i="object"===typeof t?t.message:t;return e.uppy.info(i,"error",5e3),Promise.reject(new Error("onBeforeSnapshot: "+i))})).then((function(){return e.getImage()})).then((function(t){e.captureInProgress=!1;try{e.uppy.addFile(t)}catch(i){i.isRestriction||e.uppy.log(i)}}),(function(t){throw e.captureInProgress=!1,t})))},r.getImage=function(){var e=this,t=this.getVideoElement();if(!t)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));var i=t.videoWidth,o=t.videoHeight,r=document.createElement("canvas");r.width=i,r.height=o,r.getContext("2d").drawImage(t,0,0);var n=this.uppy.opts.restrictions,s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:n.allowedFileTypes&&(s=n.allowedFileTypes.map(y).filter(S));var a=s[0]||"image/jpeg",c=p(a)||"jpg",d="cam-"+Date.now()+"."+c;return h(r,a).then((function(t){return{source:e.id,name:d,data:new Blob([t],{type:a}),type:a}}))},r.getVideo=function(){var e=this.recordingChunks.find((function(e){var t;return(null==(t=e.type)?void 0:t.length)>0})).type,t=p(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var i="webcam-"+Date.now()+"."+t,o=new Blob(this.recordingChunks,{type:e}),r={source:this.id,name:i,data:new Blob([o],{type:e}),type:e};return Promise.resolve(r)},r.focus=function(){var e=this;this.opts.countdown&&setTimeout((function(){e.uppy.info(e.i18n("smile"),"success",1500)}),1e3)},r.changeVideoSource=function(e){this.stop(),this.start({deviceId:e})},r.updateVideoSources=function(){var e=this;this.mediaDevices.enumerateDevices().then((function(t){e.setPluginState({videoSources:t.filter((function(e){return"videoinput"===e.kind}))})}))},r.render=function(){this.webcamActive||this.start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?c(f,n({},e,{onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedVideo:this.discardRecordedVideo,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:g(),recording:e.isRecording,mirror:this.opts.mirror,src:this.stream})):c(v,{icon:m,i18n:this.i18n,hasCamera:e.hasCamera})},r.install=function(){var e=this;this.setPluginState({cameraReady:!1,recordingLengthSeconds:0});var t=this.opts.target;t&&this.mount(t,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=function(){if(e.updateVideoSources(),e.stream){var t=!0,i=e.getPluginState(),o=i.videoSources,r=i.currentDeviceId;o.forEach((function(e){r===e.deviceId&&(t=!1)})),t&&(e.stop(),e.start())}})},r.uninstall=function(){this.stream&&this.stop(),this.unmount()},o}(d),o.VERSION="1.8.13",r)}}]);
2
- //# sourceMappingURL=9.f1fd57b4.chunk.js.map
1
+ (this["webpackJsonp@micromag/viewer-build"]=this["webpackJsonp@micromag/viewer-build"]||[]).push([[9],{586:function(e,t,i){var o=i(38).h;e.exports=function(e){return o("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},o("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"}))}},637:function(e,t){var i={"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};e.exports=function(e){return e=e.replace(/;.*$/,""),i[e]||null}},638:function(e,t,i){var o=i(291);e.exports=function(e,t,i){return e.toBlob?new Promise((function(o){e.toBlob(o,t,i)})):Promise.resolve().then((function(){return o(e.toDataURL(t,i),{})}))}},639:function(e,t){e.exports=function(){return"function"===typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"===typeof MediaRecorder.prototype.start}},640:function(e,t,i){function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var n=i(38),s=n.h,a=n.Component,c=i(641),d=i(642),u=i(643),p=i(645),l=i(646),h=i(647);function g(e,t){return-1!==e.indexOf(t)}var m=function(e){var t,i;function n(){return e.apply(this,arguments)||this}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,r(t,i);var a=n.prototype;return a.componentDidMount=function(){(0,this.props.onFocus)()},a.componentWillUnmount=function(){(0,this.props.onStop)()},a.render=function(){var e=this,t=this.props,i=t.src,r=t.recordedVideo,n=t.recording,a=t.modes,m=t.supportsRecording,f=t.videoSources,v=t.showVideoSourceDropdown,y=t.showRecordingLength,b=t.onSubmit,S=t.i18n,w=t.mirror,R=t.onSnapshot,C=t.onStartRecording,P=t.onStopRecording,M=t.onDiscardRecordedVideo,k=t.recordingLengthSeconds,x=!!r,I=!x&&m&&(g(a,"video-only")||g(a,"audio-only")||g(a,"video-audio")),D=!x&&g(a,"picture"),V=m&&y,T=v&&f&&f.length>1,L={playsinline:!0};return r?(L.muted=!1,L.controls=!0,L.src=r,this.videoElement&&(this.videoElement.srcObject=void 0)):(L.muted=!0,L.autoplay=!0,L.srcObject=i),s("div",{className:"uppy uppy-Webcam-container"},s("div",{className:"uppy-Webcam-videoContainer"},s("video",o({ref:function(t){return e.videoElement=t},className:"uppy-Webcam-video "+(w?"uppy-Webcam-video--mirrored":"")},L))),s("div",{className:"uppy-Webcam-footer"},s("div",{className:"uppy-Webcam-videoSourceContainer"},T?p(this.props):null),s("div",{className:"uppy-Webcam-buttonContainer"},D&&s(c,{onSnapshot:R,i18n:S}),I&&s(d,{recording:n,onStartRecording:C,onStopRecording:P,i18n:S}),x&&s(l,{onSubmit:b,i18n:S}),x&&s(h,{onDiscard:M,i18n:S})),V&&s("div",{className:"uppy-Webcam-recordingLength"},s(u,{recordingLengthSeconds:k,i18n:S}))))},n}(a);e.exports=m},641:function(e,t,i){var o=i(38).h,r=i(586);e.exports=function(e){var t=e.onSnapshot,i=e.i18n;return o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:i("takePicture"),"aria-label":i("takePicture"),onClick:t,"data-uppy-super-focusable":!0},r())}},642:function(e,t,i){var o=i(38).h;e.exports=function(e){var t=e.recording,i=e.onStartRecording,r=e.onStopRecording,n=e.i18n;return t?o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("stopRecording"),"aria-label":n("stopRecording"),onClick:r,"data-uppy-super-focusable":!0},o("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},o("rect",{x:"15",y:"15",width:"70",height:"70"}))):o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("startRecording"),"aria-label":n("startRecording"),onClick:i,"data-uppy-super-focusable":!0},o("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},o("circle",{cx:"50",cy:"50",r:"40"})))}},643:function(e,t,i){var o=i(38).h,r=i(644);e.exports=function(e){var t=e.recordingLengthSeconds,i=e.i18n,n=r(t);return o("span",{"aria-label":i("recordingLength",{recording_length:n})},n)}},644:function(e,t){e.exports=function(e){return Math.floor(e/60)+":"+String(e%60).padStart(2,0)}},645:function(e,t,i){var o=i(38).h;e.exports=function(e){var t=e.currentDeviceId,i=e.videoSources,r=e.onChangeVideoSource;return o("div",{className:"uppy-Webcam-videoSource"},o("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:function(e){r(e.target.value)}},i.map((function(e){return o("option",{key:e.deviceId,value:e.deviceId,selected:e.deviceId===t},e.label)}))))}},646:function(e,t,i){var o=i(38).h;e.exports=function(e){var t=e.onSubmit,i=e.i18n;return o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:i("submitRecordedFile"),"aria-label":i("submitRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},o("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},o("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}},647:function(e,t,i){var o=i(38).h;e.exports=function(e){var t=e.onDiscard,i=e.i18n;return o("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:i("discardRecordedFile"),"aria-label":i("discardRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},o("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},o("g",{fill:"#FFF",fillRule:"evenodd"},o("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),o("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}},648:function(e,t,i){var o=i(38).h;e.exports=function(e){return o("div",{className:"uppy-Webcam-permissons"},o("div",{className:"uppy-Webcam-permissonsIcon"},e.icon()),o("h1",{className:"uppy-Webcam-title"},e.hasCamera?e.i18n("allowAccessTitle"):e.i18n("noCameraTitle")),o("p",null,e.hasCamera?e.i18n("allowAccessDescription"):e.i18n("noCameraDescription")))}},674:function(e,t,i){var o,r;function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e}).apply(this,arguments)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=i(38).h,d=i(73).Plugin,u=i(92),p=i(637),l=i(290),h=i(638),g=i(639),m=i(586),f=i(640),v=i(648);function y(e){return"."===e[0]?l[e.slice(1)]:e}function b(e){return/^video\/[^*]+$/.test(e)}function S(e){return/^image\/[^*]+$/.test(e)}e.exports=(r=o=function(e){var t,i;function o(t,i){var o;(o=e.call(this,t,i)||this).mediaDevices=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(i,o){e.call(navigator,t,i,o)}))}}:null}(),o.supportsUserMedia=!!o.mediaDevices,o.protocol=location.protocol.match(/https/i)?"https":"http",o.id=o.opts.id||"Webcam",o.title=o.opts.title||"Camera",o.type="acquirer",o.capturedMediaFile=null,o.icon=function(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("g",{fill:"none",fillRule:"evenodd"},c("rect",{className:"uppy-ProviderIconBg",fill:"#03BFEF",width:"32",height:"32",rx:"16"}),c("path",{d:"M22 11c1.133 0 2 .867 2 2v7.333c0 1.134-.867 2-2 2H10c-1.133 0-2-.866-2-2V13c0-1.133.867-2 2-2h2.333l1.134-1.733C13.6 9.133 13.8 9 14 9h4c.2 0 .4.133.533.267L19.667 11H22zm-6 1.533a3.764 3.764 0 0 0-3.8 3.8c0 2.129 1.672 3.801 3.8 3.801s3.8-1.672 3.8-3.8c0-2.13-1.672-3.801-3.8-3.801zm0 6.261c-1.395 0-2.46-1.066-2.46-2.46 0-1.395 1.065-2.461 2.46-2.461s2.46 1.066 2.46 2.46c0 1.395-1.065 2.461-2.46 2.461z",fill:"#FFF",fillRule:"nonzero"})))},o.defaultLocale={strings:{smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site.",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",recordingLength:"Recording length %{recording_length}",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file"}};var r={onBeforeSnapshot:function(){return Promise.resolve()},countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1};return o.opts=n({},r,i),o.i18nInit(),o.install=o.install.bind(s(o)),o.setPluginState=o.setPluginState.bind(s(o)),o.render=o.render.bind(s(o)),o.start=o.start.bind(s(o)),o.stop=o.stop.bind(s(o)),o.takeSnapshot=o.takeSnapshot.bind(s(o)),o.startRecording=o.startRecording.bind(s(o)),o.stopRecording=o.stopRecording.bind(s(o)),o.discardRecordedVideo=o.discardRecordedVideo.bind(s(o)),o.submit=o.submit.bind(s(o)),o.oneTwoThreeSmile=o.oneTwoThreeSmile.bind(s(o)),o.focus=o.focus.bind(s(o)),o.changeVideoSource=o.changeVideoSource.bind(s(o)),o.webcamActive=!1,o.opts.countdown&&(o.opts.onBeforeSnapshot=o.oneTwoThreeSmile),o.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null}),o}i=e,(t=o).prototype=Object.create(i.prototype),t.prototype.constructor=t,a(t,i);var r=o.prototype;return r.setOptions=function(t){e.prototype.setOptions.call(this,n({},t,{videoConstraints:n({},this.opts.videoConstraints,null==t?void 0:t.videoConstraints)})),this.i18nInit()},r.i18nInit=function(){this.translator=new u([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},r.hasCameraCheck=function(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then((function(e){return e.some((function(e){return"videoinput"===e.kind}))})):Promise.resolve(!1)},r.isAudioOnly=function(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]},r.getConstraints=function(e){var t;void 0===e&&(e=null);var i=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),o=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),r=n({},null!=(t=this.opts.videoConstraints)?t:{facingMode:this.opts.facingMode},e?{deviceId:e,facingMode:null}:{});return{audio:i,video:!!o&&r}},r.start=function(e){var t=this;if(void 0===e&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror=!0;var i=this.getConstraints(e&&e.deviceId?e.deviceId:null);this.hasCameraCheck().then((function(o){return t.setPluginState({hasCamera:o}),t.mediaDevices.getUserMedia(i).then((function(i){t.stream=i;var o=null,r=t.isAudioOnly()?i.getAudioTracks():i.getVideoTracks();e&&e.deviceId?r.forEach((function(t){t.getSettings().deviceId===e.deviceId&&(o=t.getSettings().deviceId)})):o=r[0].getSettings().deviceId,t.updateVideoSources(),t.setPluginState({currentDeviceId:o,cameraReady:!0})})).catch((function(e){t.setPluginState({cameraReady:!1,cameraError:e}),t.uppy.info(e.message,"error")}))}))},r.getMediaRecorderOptions=function(){var e={};if(MediaRecorder.isTypeSupported){var t=this.uppy.opts.restrictions,i=[];this.opts.preferredVideoMimeType?i=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(i=t.allowedFileTypes.map(y).filter(b));var o=i.filter((function(e){return MediaRecorder.isTypeSupported(e)&&p(e)}));o.length>0&&(e.mimeType=o[0])}return e},r.startRecording=function(){var e=this;this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];var t=!1;this.recorder.addEventListener("dataavailable",(function(i){e.recordingChunks.push(i.data);var o=e.uppy.opts.restrictions;if(e.recordingChunks.length>1&&null!=o.maxFileSize&&!t){var r=e.recordingChunks.reduce((function(e,t){return e+t.size}),0),n=3*((r-e.recordingChunks[0].size)/(e.recordingChunks.length-1));r>Math.max(0,o.maxFileSize-n)&&(t=!0,e.uppy.info(e.i18n("recordingStoppedMaxSize"),"warning",4e3),e.stopRecording())}})),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval((function(){var t=e.getPluginState().recordingLengthSeconds;e.setPluginState({recordingLengthSeconds:t+1})}),1e3)),this.setPluginState({isRecording:!0})},r.stopRecording=function(){var e=this;return new Promise((function(t){e.recorder.addEventListener("stop",(function(){t()})),e.recorder.stop(),e.opts.showRecordingLength&&(clearInterval(e.recordingLengthTimer),e.setPluginState({recordingLengthSeconds:0}))})).then((function(){return e.setPluginState({isRecording:!1}),e.getVideo()})).then((function(t){try{e.capturedMediaFile=t,e.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),e.opts.mirror=!1}catch(i){i.isRestriction||e.uppy.log(i)}})).then((function(){e.recordingChunks=null,e.recorder=null}),(function(t){throw e.recordingChunks=null,e.recorder=null,t}))},r.discardRecordedVideo=function(){this.setPluginState({recordedVideo:null}),this.opts.mirror=!0,this.capturedMediaFile=null},r.submit=function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}},r.stop=function(){this.stream&&(this.stream.getAudioTracks().forEach((function(e){e.stop()})),this.stream.getVideoTracks().forEach((function(e){e.stop()}))),this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null})},r.getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},r.oneTwoThreeSmile=function(){var e=this;return new Promise((function(t,i){var o=e.opts.countdown,r=setInterval((function(){if(!e.webcamActive)return clearInterval(r),e.captureInProgress=!1,i(new Error("Webcam is not active"));o>0?(e.uppy.info(o+"...","warning",800),o--):(clearInterval(r),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout((function(){return t()}),1500))}),1e3)}))},r.takeSnapshot=function(){var e=this;this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch((function(t){var i="object"===typeof t?t.message:t;return e.uppy.info(i,"error",5e3),Promise.reject(new Error("onBeforeSnapshot: "+i))})).then((function(){return e.getImage()})).then((function(t){e.captureInProgress=!1;try{e.uppy.addFile(t)}catch(i){i.isRestriction||e.uppy.log(i)}}),(function(t){throw e.captureInProgress=!1,t})))},r.getImage=function(){var e=this,t=this.getVideoElement();if(!t)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));var i=t.videoWidth,o=t.videoHeight,r=document.createElement("canvas");r.width=i,r.height=o,r.getContext("2d").drawImage(t,0,0);var n=this.uppy.opts.restrictions,s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:n.allowedFileTypes&&(s=n.allowedFileTypes.map(y).filter(S));var a=s[0]||"image/jpeg",c=p(a)||"jpg",d="cam-"+Date.now()+"."+c;return h(r,a).then((function(t){return{source:e.id,name:d,data:new Blob([t],{type:a}),type:a}}))},r.getVideo=function(){var e=this.recordingChunks.find((function(e){var t;return(null==(t=e.type)?void 0:t.length)>0})).type,t=p(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var i="webcam-"+Date.now()+"."+t,o=new Blob(this.recordingChunks,{type:e}),r={source:this.id,name:i,data:new Blob([o],{type:e}),type:e};return Promise.resolve(r)},r.focus=function(){var e=this;this.opts.countdown&&setTimeout((function(){e.uppy.info(e.i18n("smile"),"success",1500)}),1e3)},r.changeVideoSource=function(e){this.stop(),this.start({deviceId:e})},r.updateVideoSources=function(){var e=this;this.mediaDevices.enumerateDevices().then((function(t){e.setPluginState({videoSources:t.filter((function(e){return"videoinput"===e.kind}))})}))},r.render=function(){this.webcamActive||this.start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?c(f,n({},e,{onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedVideo:this.discardRecordedVideo,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:g(),recording:e.isRecording,mirror:this.opts.mirror,src:this.stream})):c(v,{icon:m,i18n:this.i18n,hasCamera:e.hasCamera})},r.install=function(){var e=this;this.setPluginState({cameraReady:!1,recordingLengthSeconds:0});var t=this.opts.target;t&&this.mount(t,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=function(){if(e.updateVideoSources(),e.stream){var t=!0,i=e.getPluginState(),o=i.videoSources,r=i.currentDeviceId;o.forEach((function(e){r===e.deviceId&&(t=!1)})),t&&(e.stop(),e.start())}})},r.uninstall=function(){this.stream&&this.stop(),this.unmount()},o}(d),o.VERSION="1.8.13",r)}}]);
2
+ //# sourceMappingURL=9.be4dea01.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/@uppy/webcam/lib/CameraIcon.js","../../../node_modules/@uppy/utils/lib/getFileTypeExtension.js","../../../node_modules/@uppy/utils/lib/canvasToBlob.js","../../../node_modules/@uppy/webcam/lib/supportsMediaRecorder.js","../../../node_modules/@uppy/webcam/lib/CameraScreen.js","../../../node_modules/@uppy/webcam/lib/SnapshotButton.js","../../../node_modules/@uppy/webcam/lib/RecordButton.js","../../../node_modules/@uppy/webcam/lib/RecordingLength.js","../../../node_modules/@uppy/webcam/lib/formatSeconds.js","../../../node_modules/@uppy/webcam/lib/VideoSourceSelect.js","../../../node_modules/@uppy/webcam/lib/SubmitButton.js","../../../node_modules/@uppy/webcam/lib/DiscardButton.js","../../../node_modules/@uppy/webcam/lib/PermissionsScreen.js","../../../node_modules/@uppy/webcam/lib/index.js"],"names":["h","require","module","exports","props","focusable","fill","width","height","viewBox","d","fillRule","mimeToExtensions","mimeType","replace","dataURItoBlob","canvas","type","quality","toBlob","Promise","resolve","then","toDataURL","MediaRecorder","prototype","start","_extends","Object","assign","target","i","arguments","length","source","key","hasOwnProperty","call","apply","this","_setPrototypeOf","o","p","setPrototypeOf","__proto__","_require","Component","SnapshotButton","RecordButton","RecordingLength","VideoSourceSelect","SubmitButton","DiscardButton","isModeAvailable","modes","mode","indexOf","CameraScreen","_Component","subClass","superClass","create","constructor","_proto","componentDidMount","onFocus","componentWillUnmount","onStop","render","_this","_this$props","src","recordedVideo","recording","supportsRecording","videoSources","showVideoSourceDropdown","showRecordingLength","onSubmit","i18n","mirror","onSnapshot","onStartRecording","onStopRecording","onDiscardRecordedVideo","recordingLengthSeconds","hasRecordedVideo","shouldShowRecordButton","shouldShowSnapshotButton","shouldShowRecordingLength","shouldShowVideoSourceDropdown","videoProps","playsinline","muted","controls","videoElement","srcObject","undefined","autoplay","className","ref","onDiscard","CameraIcon","_ref","title","onClick","x","y","cx","cy","r","formatSeconds","formattedRecordingLengthSeconds","recording_length","seconds","Math","floor","String","padStart","currentDeviceId","onChangeVideoSource","onChange","event","value","map","videoSource","deviceId","selected","label","xmlns","icon","hasCamera","_class","_temp","_assertThisInitialized","self","ReferenceError","Plugin","Translator","getFileTypeExtension","mimeTypes","canvasToBlob","supportsMediaRecorder","PermissionsScreen","toMimeType","fileType","slice","isVideoMimeType","test","isImageMimeType","_Plugin","Webcam","uppy","opts","mediaDevices","navigator","getUserMedia","_getUserMedia","mozGetUserMedia","webkitGetUserMedia","reject","getMediaDevices","supportsUserMedia","protocol","location","match","id","capturedMediaFile","rx","defaultLocale","strings","smile","takePicture","startRecording","stopRecording","allowAccessTitle","allowAccessDescription","noCameraTitle","noCameraDescription","recordingStoppedMaxSize","recordingLength","submitRecordedFile","discardRecordedFile","defaultOptions","onBeforeSnapshot","countdown","facingMode","preferredImageMimeType","preferredVideoMimeType","i18nInit","install","bind","setPluginState","stop","takeSnapshot","discardRecordedVideo","submit","oneTwoThreeSmile","focus","changeVideoSource","webcamActive","cameraReady","cameraError","setOptions","newOpts","videoConstraints","translator","locale","translate","i18nArray","translateArray","hasCameraCheck","enumerateDevices","devices","some","device","kind","isAudioOnly","getConstraints","_this$opts$videoConst","acceptsAudio","acceptsVideo","audio","video","options","_this2","Error","constraints","stream","tracks","getAudioTracks","getVideoTracks","forEach","track","getSettings","updateVideoSources","err","info","message","getMediaRecorderOptions","isTypeSupported","restrictions","preferredVideoMimeTypes","allowedFileTypes","filter","acceptableMimeTypes","candidateType","_this3","recorder","recordingChunks","stoppingBecauseOfMaxSize","addEventListener","push","data","maxFileSize","totalSize","reduce","acc","chunk","size","expectedEndChunkSize","max","recordingLengthTimer","setInterval","currentRecordingLength","getPluginState","isRecording","_this4","clearInterval","getVideo","file","URL","createObjectURL","isRestriction","log","error","addFile","getVideoElement","el","querySelector","_this5","count","countDown","captureInProgress","setTimeout","_this6","getImage","tagFile","_this7","videoWidth","videoHeight","document","createElement","getContext","drawImage","preferredImageMimeTypes","ext","name","Date","now","blob","Blob","find","_blob$type","fileExtension","_this8","_this9","webcamState","_this10","mount","ondevicechange","restartStream","_this10$getPluginStat","uninstall","unmount","VERSION"],"mappings":"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C,KAAKkH,KAAKzE,OAClBT,IAAKhC,KAAK6L,UAxBHpO,EAAE+I,EAAmB,CAC1Bb,KAAM5B,EACNvB,KAAMxC,KAAKwC,KACXoD,UAAWgL,EAAYhL,aAyB7BpE,EAAO+H,QAAU,WACf,IAAIsH,EAAU7Q,KAEdA,KAAKyJ,eAAe,CAClBS,aAAa,EACbpH,uBAAwB,IAE1B,IAAIvD,EAASS,KAAKkH,KAAK3H,OAEnBA,GACFS,KAAK8Q,MAAMvR,EAAQS,MAGjBA,KAAKmH,eACPnH,KAAKoM,qBAELpM,KAAKmH,aAAa4J,eAAiB,WAGjC,GAFAF,EAAQzE,qBAEJyE,EAAQhF,OAAQ,CAClB,IAAImF,GAAgB,EAEhBC,EAAwBJ,EAAQ3C,iBAChC9L,EAAe6O,EAAsB7O,aACrC4C,EAAkBiM,EAAsBjM,gBAE5C5C,EAAa6J,SAAQ,SAAU3G,GACzBN,IAAoBM,EAAYC,WAClCyL,GAAgB,MAIhBA,IACFH,EAAQnH,OAERmH,EAAQ1R,aAOlBqC,EAAO0P,UAAY,WACblR,KAAK6L,QACP7L,KAAK0J,OAGP1J,KAAKmR,WAGAnK,EA/nBuC,CAgoB9Cd,GAASL,EAAOuL,QAAU,SAAUtL","file":"static/js/9.f1fd57b4.chunk.js","sourcesContent":["var _require = require('preact'),\n h = _require.h;\n\nmodule.exports = function (props) {\n return h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n fill: \"#0097DC\",\n width: \"66\",\n height: \"55\",\n viewBox: \"0 0 66 55\"\n }, h(\"path\", {\n d: \"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z\",\n fillRule: \"evenodd\"\n }));\n};","// TODO Check which types are actually supported in browsers. Chrome likes webm\n// from my testing, but we may need more.\n// We could use a library but they tend to contain dozens of KBs of mappings,\n// most of which will go unused, so not sure if that's worth it.\nvar mimeToExtensions = {\n 'audio/mp3': 'mp3',\n 'audio/mp4': 'mp4',\n 'audio/ogg': 'ogg',\n 'audio/webm': 'webm',\n 'image/gif': 'gif',\n 'image/heic': 'heic',\n 'image/heif': 'heif',\n 'image/jpeg': 'jpg',\n 'image/png': 'png',\n 'image/svg+xml': 'svg',\n 'video/mp4': 'mp4',\n 'video/ogg': 'ogv',\n 'video/quicktime': 'mov',\n 'video/webm': 'webm',\n 'video/x-matroska': 'mkv',\n 'video/x-msvideo': 'avi'\n};\n\nmodule.exports = function getFileTypeExtension(mimeType) {\n // Remove the ; bit in 'video/x-matroska;codecs=avc1'\n mimeType = mimeType.replace(/;.*$/, '');\n return mimeToExtensions[mimeType] || null;\n};","var dataURItoBlob = require('./dataURItoBlob');\n/**\n * Save a <canvas> element's content to a Blob object.\n *\n * @param {HTMLCanvasElement} canvas\n * @returns {Promise}\n */\n\n\nmodule.exports = function canvasToBlob(canvas, type, quality) {\n if (canvas.toBlob) {\n return new Promise(function (resolve) {\n canvas.toBlob(resolve, type, quality);\n });\n }\n\n return Promise.resolve().then(function () {\n return dataURItoBlob(canvas.toDataURL(type, quality), {});\n });\n};","module.exports = function supportsMediaRecorder() {\n /* eslint-disable compat/compat */\n return typeof MediaRecorder === 'function' && !!MediaRecorder.prototype && typeof MediaRecorder.prototype.start === 'function';\n /* eslint-enable compat/compat */\n};","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n/* eslint-disable jsx-a11y/media-has-caption */\nvar _require = require('preact'),\n h = _require.h,\n Component = _require.Component;\n\nvar SnapshotButton = require('./SnapshotButton');\n\nvar RecordButton = require('./RecordButton');\n\nvar RecordingLength = require('./RecordingLength');\n\nvar VideoSourceSelect = require('./VideoSourceSelect');\n\nvar SubmitButton = require('./SubmitButton');\n\nvar DiscardButton = require('./DiscardButton');\n\nfunction isModeAvailable(modes, mode) {\n return modes.indexOf(mode) !== -1;\n}\n\nvar CameraScreen = /*#__PURE__*/function (_Component) {\n _inheritsLoose(CameraScreen, _Component);\n\n function CameraScreen() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = CameraScreen.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var onFocus = this.props.onFocus;\n onFocus();\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n var onStop = this.props.onStop;\n onStop();\n };\n\n _proto.render = function render() {\n var _this = this;\n\n var _this$props = this.props,\n src = _this$props.src,\n recordedVideo = _this$props.recordedVideo,\n recording = _this$props.recording,\n modes = _this$props.modes,\n supportsRecording = _this$props.supportsRecording,\n videoSources = _this$props.videoSources,\n showVideoSourceDropdown = _this$props.showVideoSourceDropdown,\n showRecordingLength = _this$props.showRecordingLength,\n onSubmit = _this$props.onSubmit,\n i18n = _this$props.i18n,\n mirror = _this$props.mirror,\n onSnapshot = _this$props.onSnapshot,\n onStartRecording = _this$props.onStartRecording,\n onStopRecording = _this$props.onStopRecording,\n onDiscardRecordedVideo = _this$props.onDiscardRecordedVideo,\n recordingLengthSeconds = _this$props.recordingLengthSeconds;\n var hasRecordedVideo = !!recordedVideo;\n var shouldShowRecordButton = !hasRecordedVideo && supportsRecording && (isModeAvailable(modes, 'video-only') || isModeAvailable(modes, 'audio-only') || isModeAvailable(modes, 'video-audio'));\n var shouldShowSnapshotButton = !hasRecordedVideo && isModeAvailable(modes, 'picture');\n var shouldShowRecordingLength = supportsRecording && showRecordingLength;\n var shouldShowVideoSourceDropdown = showVideoSourceDropdown && videoSources && videoSources.length > 1;\n var videoProps = {\n playsinline: true\n };\n\n if (recordedVideo) {\n videoProps.muted = false;\n videoProps.controls = true;\n videoProps.src = recordedVideo; // reset srcObject in dom. If not resetted, stream sticks in element\n\n if (this.videoElement) {\n this.videoElement.srcObject = undefined;\n }\n } else {\n videoProps.muted = true;\n videoProps.autoplay = true;\n videoProps.srcObject = src;\n }\n\n return h(\"div\", {\n className: \"uppy uppy-Webcam-container\"\n }, h(\"div\", {\n className: \"uppy-Webcam-videoContainer\"\n }, h(\"video\", _extends({\n /* eslint-disable-next-line no-return-assign */\n ref: function ref(videoElement) {\n return _this.videoElement = videoElement;\n },\n className: \"uppy-Webcam-video \" + (mirror ? 'uppy-Webcam-video--mirrored' : '')\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n\n }, videoProps))), h(\"div\", {\n className: \"uppy-Webcam-footer\"\n }, h(\"div\", {\n className: \"uppy-Webcam-videoSourceContainer\"\n }, shouldShowVideoSourceDropdown ? VideoSourceSelect(this.props) : null), h(\"div\", {\n className: \"uppy-Webcam-buttonContainer\"\n }, shouldShowSnapshotButton && h(SnapshotButton, {\n onSnapshot: onSnapshot,\n i18n: i18n\n }), shouldShowRecordButton && h(RecordButton, {\n recording: recording,\n onStartRecording: onStartRecording,\n onStopRecording: onStopRecording,\n i18n: i18n\n }), hasRecordedVideo && h(SubmitButton, {\n onSubmit: onSubmit,\n i18n: i18n\n }), hasRecordedVideo && h(DiscardButton, {\n onDiscard: onDiscardRecordedVideo,\n i18n: i18n\n })), shouldShowRecordingLength && h(\"div\", {\n className: \"uppy-Webcam-recordingLength\"\n }, h(RecordingLength, {\n recordingLengthSeconds: recordingLengthSeconds,\n i18n: i18n\n }))));\n };\n\n return CameraScreen;\n}(Component);\n\nmodule.exports = CameraScreen;","var _require = require('preact'),\n h = _require.h;\n\nvar CameraIcon = require('./CameraIcon');\n\nmodule.exports = function (_ref) {\n var onSnapshot = _ref.onSnapshot,\n i18n = _ref.i18n;\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture\",\n type: \"button\",\n title: i18n('takePicture'),\n \"aria-label\": i18n('takePicture'),\n onClick: onSnapshot,\n \"data-uppy-super-focusable\": true\n }, CameraIcon());\n};","var _require = require('preact'),\n h = _require.h;\n\nmodule.exports = function RecordButton(_ref) {\n var recording = _ref.recording,\n onStartRecording = _ref.onStartRecording,\n onStopRecording = _ref.onStopRecording,\n i18n = _ref.i18n;\n\n if (recording) {\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button\",\n type: \"button\",\n title: i18n('stopRecording'),\n \"aria-label\": i18n('stopRecording'),\n onClick: onStopRecording,\n \"data-uppy-super-focusable\": true\n }, h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon\",\n width: \"100\",\n height: \"100\",\n viewBox: \"0 0 100 100\"\n }, h(\"rect\", {\n x: \"15\",\n y: \"15\",\n width: \"70\",\n height: \"70\"\n })));\n }\n\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button\",\n type: \"button\",\n title: i18n('startRecording'),\n \"aria-label\": i18n('startRecording'),\n onClick: onStartRecording,\n \"data-uppy-super-focusable\": true\n }, h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon\",\n width: \"100\",\n height: \"100\",\n viewBox: \"0 0 100 100\"\n }, h(\"circle\", {\n cx: \"50\",\n cy: \"50\",\n r: \"40\"\n })));\n};","var _require = require('preact'),\n h = _require.h;\n\nvar formatSeconds = require('./formatSeconds');\n\nmodule.exports = function RecordingLength(_ref) {\n var recordingLengthSeconds = _ref.recordingLengthSeconds,\n i18n = _ref.i18n;\n var formattedRecordingLengthSeconds = formatSeconds(recordingLengthSeconds);\n return h(\"span\", {\n \"aria-label\": i18n('recordingLength', {\n recording_length: formattedRecordingLengthSeconds\n })\n }, formattedRecordingLengthSeconds);\n};","/**\n * Takes an Integer value of seconds (e.g. 83) and converts it into a human-readable formatted string (e.g. '1:23').\n *\n * @param {Integer} seconds\n * @returns {string} the formatted seconds (e.g. '1:23' for 1 minute and 23 seconds)\n *\n */\nmodule.exports = function formatSeconds(seconds) {\n return Math.floor(seconds / 60) + \":\" + String(seconds % 60).padStart(2, 0);\n};","var _require = require('preact'),\n h = _require.h;\n\nmodule.exports = function (_ref) {\n var currentDeviceId = _ref.currentDeviceId,\n videoSources = _ref.videoSources,\n onChangeVideoSource = _ref.onChangeVideoSource;\n return h(\"div\", {\n className: \"uppy-Webcam-videoSource\"\n }, h(\"select\", {\n className: \"uppy-u-reset uppy-Webcam-videoSource-select\",\n onChange: function onChange(event) {\n onChangeVideoSource(event.target.value);\n }\n }, videoSources.map(function (videoSource) {\n return h(\"option\", {\n key: videoSource.deviceId,\n value: videoSource.deviceId,\n selected: videoSource.deviceId === currentDeviceId\n }, videoSource.label);\n })));\n};","var _require = require('preact'),\n h = _require.h;\n\nfunction SubmitButton(_ref) {\n var onSubmit = _ref.onSubmit,\n i18n = _ref.i18n;\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit\",\n type: \"button\",\n title: i18n('submitRecordedFile'),\n \"aria-label\": i18n('submitRecordedFile'),\n onClick: onSubmit,\n \"data-uppy-super-focusable\": true\n }, h(\"svg\", {\n width: \"12\",\n height: \"9\",\n viewBox: \"0 0 12 9\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon\"\n }, h(\"path\", {\n fill: \"#fff\",\n fillRule: \"nonzero\",\n d: \"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z\"\n })));\n}\n\nmodule.exports = SubmitButton;","var _require = require('preact'),\n h = _require.h;\n\nfunction DiscardButton(_ref) {\n var onDiscard = _ref.onDiscard,\n i18n = _ref.i18n;\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button\",\n type: \"button\",\n title: i18n('discardRecordedFile'),\n \"aria-label\": i18n('discardRecordedFile'),\n onClick: onDiscard,\n \"data-uppy-super-focusable\": true\n }, h(\"svg\", {\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 13 13\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon\"\n }, h(\"g\", {\n fill: \"#FFF\",\n fillRule: \"evenodd\"\n }, h(\"path\", {\n d: \"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z\"\n }), h(\"path\", {\n d: \"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z\"\n }))));\n}\n\nmodule.exports = DiscardButton;","var _require = require('preact'),\n h = _require.h;\n\nmodule.exports = function (props) {\n return h(\"div\", {\n className: \"uppy-Webcam-permissons\"\n }, h(\"div\", {\n className: \"uppy-Webcam-permissonsIcon\"\n }, props.icon()), h(\"h1\", {\n className: \"uppy-Webcam-title\"\n }, props.hasCamera ? props.i18n('allowAccessTitle') : props.i18n('noCameraTitle')), h(\"p\", null, props.hasCamera ? props.i18n('allowAccessDescription') : props.i18n('noCameraDescription')));\n};","var _class, _temp;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar _require = require('preact'),\n h = _require.h;\n\nvar _require2 = require('@uppy/core'),\n Plugin = _require2.Plugin;\n\nvar Translator = require('@uppy/utils/lib/Translator');\n\nvar getFileTypeExtension = require('@uppy/utils/lib/getFileTypeExtension');\n\nvar mimeTypes = require('@uppy/utils/lib/mimeTypes');\n\nvar canvasToBlob = require('@uppy/utils/lib/canvasToBlob');\n\nvar supportsMediaRecorder = require('./supportsMediaRecorder');\n\nvar CameraIcon = require('./CameraIcon');\n\nvar CameraScreen = require('./CameraScreen');\n\nvar PermissionsScreen = require('./PermissionsScreen');\n/**\n * Normalize a MIME type or file extension into a MIME type.\n *\n * @param {string} fileType - MIME type or a file extension prefixed with `.`.\n * @returns {string|undefined} The MIME type or `undefined` if the fileType is an extension and is not known.\n */\n\n\nfunction toMimeType(fileType) {\n if (fileType[0] === '.') {\n return mimeTypes[fileType.slice(1)];\n }\n\n return fileType;\n}\n/**\n * Is this MIME type a video?\n *\n * @param {string} mimeType - MIME type.\n * @returns {boolean}\n */\n\n\nfunction isVideoMimeType(mimeType) {\n return /^video\\/[^*]+$/.test(mimeType);\n}\n/**\n * Is this MIME type an image?\n *\n * @param {string} mimeType - MIME type.\n * @returns {boolean}\n */\n\n\nfunction isImageMimeType(mimeType) {\n return /^image\\/[^*]+$/.test(mimeType);\n}\n/**\n * Setup getUserMedia, with polyfill for older browsers\n * Adapted from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\n */\n\n\nfunction getMediaDevices() {\n // eslint-disable-next-line compat/compat\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n // eslint-disable-next-line compat/compat\n return navigator.mediaDevices;\n }\n\n var _getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia;\n\n if (!_getUserMedia) {\n return null;\n }\n\n return {\n getUserMedia: function getUserMedia(opts) {\n return new Promise(function (resolve, reject) {\n _getUserMedia.call(navigator, opts, resolve, reject);\n });\n }\n };\n}\n/**\n * Webcam\n */\n\n\nmodule.exports = (_temp = _class = /*#__PURE__*/function (_Plugin) {\n _inheritsLoose(Webcam, _Plugin);\n\n // eslint-disable-next-line global-require\n function Webcam(uppy, opts) {\n var _this;\n\n _this = _Plugin.call(this, uppy, opts) || this;\n _this.mediaDevices = getMediaDevices();\n _this.supportsUserMedia = !!_this.mediaDevices; // eslint-disable-next-line no-restricted-globals\n\n _this.protocol = location.protocol.match(/https/i) ? 'https' : 'http';\n _this.id = _this.opts.id || 'Webcam';\n _this.title = _this.opts.title || 'Camera';\n _this.type = 'acquirer';\n _this.capturedMediaFile = null;\n\n _this.icon = function () {\n return h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n width: \"32\",\n height: \"32\",\n viewBox: \"0 0 32 32\"\n }, h(\"g\", {\n fill: \"none\",\n fillRule: \"evenodd\"\n }, h(\"rect\", {\n className: \"uppy-ProviderIconBg\",\n fill: \"#03BFEF\",\n width: \"32\",\n height: \"32\",\n rx: \"16\"\n }), h(\"path\", {\n d: \"M22 11c1.133 0 2 .867 2 2v7.333c0 1.134-.867 2-2 2H10c-1.133 0-2-.866-2-2V13c0-1.133.867-2 2-2h2.333l1.134-1.733C13.6 9.133 13.8 9 14 9h4c.2 0 .4.133.533.267L19.667 11H22zm-6 1.533a3.764 3.764 0 0 0-3.8 3.8c0 2.129 1.672 3.801 3.8 3.801s3.8-1.672 3.8-3.8c0-2.13-1.672-3.801-3.8-3.801zm0 6.261c-1.395 0-2.46-1.066-2.46-2.46 0-1.395 1.065-2.461 2.46-2.461s2.46 1.066 2.46 2.46c0 1.395-1.065 2.461-2.46 2.461z\",\n fill: \"#FFF\",\n fillRule: \"nonzero\"\n })));\n };\n\n _this.defaultLocale = {\n strings: {\n smile: 'Smile!',\n takePicture: 'Take a picture',\n startRecording: 'Begin video recording',\n stopRecording: 'Stop video recording',\n allowAccessTitle: 'Please allow access to your camera',\n allowAccessDescription: 'In order to take pictures or record video with your camera, please allow camera access for this site.',\n noCameraTitle: 'Camera Not Available',\n noCameraDescription: 'In order to take pictures or record video, please connect a camera device',\n recordingStoppedMaxSize: 'Recording stopped because the file size is about to exceed the limit',\n recordingLength: 'Recording length %{recording_length}',\n submitRecordedFile: 'Submit recorded file',\n discardRecordedFile: 'Discard recorded file'\n }\n }; // set default options\n\n var defaultOptions = {\n onBeforeSnapshot: function onBeforeSnapshot() {\n return Promise.resolve();\n },\n countdown: false,\n modes: ['video-audio', 'video-only', 'audio-only', 'picture'],\n mirror: true,\n showVideoSourceDropdown: false,\n facingMode: 'user',\n preferredImageMimeType: null,\n preferredVideoMimeType: null,\n showRecordingLength: false\n };\n _this.opts = _extends({}, defaultOptions, opts);\n\n _this.i18nInit();\n\n _this.install = _this.install.bind(_assertThisInitialized(_this));\n _this.setPluginState = _this.setPluginState.bind(_assertThisInitialized(_this));\n _this.render = _this.render.bind(_assertThisInitialized(_this)); // Camera controls\n\n _this.start = _this.start.bind(_assertThisInitialized(_this));\n _this.stop = _this.stop.bind(_assertThisInitialized(_this));\n _this.takeSnapshot = _this.takeSnapshot.bind(_assertThisInitialized(_this));\n _this.startRecording = _this.startRecording.bind(_assertThisInitialized(_this));\n _this.stopRecording = _this.stopRecording.bind(_assertThisInitialized(_this));\n _this.discardRecordedVideo = _this.discardRecordedVideo.bind(_assertThisInitialized(_this));\n _this.submit = _this.submit.bind(_assertThisInitialized(_this));\n _this.oneTwoThreeSmile = _this.oneTwoThreeSmile.bind(_assertThisInitialized(_this));\n _this.focus = _this.focus.bind(_assertThisInitialized(_this));\n _this.changeVideoSource = _this.changeVideoSource.bind(_assertThisInitialized(_this));\n _this.webcamActive = false;\n\n if (_this.opts.countdown) {\n _this.opts.onBeforeSnapshot = _this.oneTwoThreeSmile;\n }\n\n _this.setPluginState({\n hasCamera: false,\n cameraReady: false,\n cameraError: null,\n recordingLengthSeconds: 0,\n videoSources: [],\n currentDeviceId: null\n });\n\n return _this;\n }\n\n var _proto = Webcam.prototype;\n\n _proto.setOptions = function setOptions(newOpts) {\n _Plugin.prototype.setOptions.call(this, _extends({}, newOpts, {\n videoConstraints: _extends({}, this.opts.videoConstraints, newOpts == null ? void 0 : newOpts.videoConstraints)\n }));\n\n this.i18nInit();\n };\n\n _proto.i18nInit = function i18nInit() {\n this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale]);\n this.i18n = this.translator.translate.bind(this.translator);\n this.i18nArray = this.translator.translateArray.bind(this.translator);\n this.setPluginState(); // so that UI re-renders and we see the updated locale\n };\n\n _proto.hasCameraCheck = function hasCameraCheck() {\n if (!this.mediaDevices) {\n return Promise.resolve(false);\n }\n\n return this.mediaDevices.enumerateDevices().then(function (devices) {\n return devices.some(function (device) {\n return device.kind === 'videoinput';\n });\n });\n };\n\n _proto.isAudioOnly = function isAudioOnly() {\n return this.opts.modes.length === 1 && this.opts.modes[0] === 'audio-only';\n };\n\n _proto.getConstraints = function getConstraints(deviceId) {\n var _this$opts$videoConst;\n\n if (deviceId === void 0) {\n deviceId = null;\n }\n\n var acceptsAudio = this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('audio-only') !== -1;\n var acceptsVideo = !this.isAudioOnly() && (this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('video-only') !== -1 || this.opts.modes.indexOf('picture') !== -1);\n\n var videoConstraints = _extends({}, (_this$opts$videoConst = this.opts.videoConstraints) != null ? _this$opts$videoConst : {\n facingMode: this.opts.facingMode\n }, deviceId ? {\n deviceId: deviceId,\n facingMode: null\n } : {});\n\n return {\n audio: acceptsAudio,\n video: acceptsVideo ? videoConstraints : false\n };\n } // eslint-disable-next-line consistent-return\n ;\n\n _proto.start = function start(options) {\n var _this2 = this;\n\n if (options === void 0) {\n options = null;\n }\n\n if (!this.supportsUserMedia) {\n return Promise.reject(new Error('Webcam access not supported'));\n }\n\n this.webcamActive = true;\n this.opts.mirror = true;\n var constraints = this.getConstraints(options && options.deviceId ? options.deviceId : null);\n this.hasCameraCheck().then(function (hasCamera) {\n _this2.setPluginState({\n hasCamera: hasCamera\n }); // ask user for access to their camera\n\n\n return _this2.mediaDevices.getUserMedia(constraints).then(function (stream) {\n _this2.stream = stream;\n var currentDeviceId = null;\n var tracks = _this2.isAudioOnly() ? stream.getAudioTracks() : stream.getVideoTracks();\n\n if (!options || !options.deviceId) {\n currentDeviceId = tracks[0].getSettings().deviceId;\n } else {\n tracks.forEach(function (track) {\n if (track.getSettings().deviceId === options.deviceId) {\n currentDeviceId = track.getSettings().deviceId;\n }\n });\n } // Update the sources now, so we can access the names.\n\n\n _this2.updateVideoSources();\n\n _this2.setPluginState({\n currentDeviceId: currentDeviceId,\n cameraReady: true\n });\n }).catch(function (err) {\n _this2.setPluginState({\n cameraReady: false,\n cameraError: err\n });\n\n _this2.uppy.info(err.message, 'error');\n });\n });\n }\n /**\n * @returns {object}\n */\n ;\n\n _proto.getMediaRecorderOptions = function getMediaRecorderOptions() {\n var options = {}; // Try to use the `opts.preferredVideoMimeType` or one of the `allowedFileTypes` for the recording.\n // If the browser doesn't support it, we'll fall back to the browser default instead.\n // Safari doesn't have the `isTypeSupported` API.\n\n if (MediaRecorder.isTypeSupported) {\n var restrictions = this.uppy.opts.restrictions;\n var preferredVideoMimeTypes = [];\n\n if (this.opts.preferredVideoMimeType) {\n preferredVideoMimeTypes = [this.opts.preferredVideoMimeType];\n } else if (restrictions.allowedFileTypes) {\n preferredVideoMimeTypes = restrictions.allowedFileTypes.map(toMimeType).filter(isVideoMimeType);\n }\n\n var filterSupportedTypes = function filterSupportedTypes(candidateType) {\n return MediaRecorder.isTypeSupported(candidateType) && getFileTypeExtension(candidateType);\n };\n\n var acceptableMimeTypes = preferredVideoMimeTypes.filter(filterSupportedTypes);\n\n if (acceptableMimeTypes.length > 0) {\n // eslint-disable-next-line prefer-destructuring\n options.mimeType = acceptableMimeTypes[0];\n }\n }\n\n return options;\n };\n\n _proto.startRecording = function startRecording() {\n var _this3 = this;\n\n // only used if supportsMediaRecorder() returned true\n // eslint-disable-next-line compat/compat\n this.recorder = new MediaRecorder(this.stream, this.getMediaRecorderOptions());\n this.recordingChunks = [];\n var stoppingBecauseOfMaxSize = false;\n this.recorder.addEventListener('dataavailable', function (event) {\n _this3.recordingChunks.push(event.data);\n\n var restrictions = _this3.uppy.opts.restrictions;\n\n if (_this3.recordingChunks.length > 1 && restrictions.maxFileSize != null && !stoppingBecauseOfMaxSize) {\n var totalSize = _this3.recordingChunks.reduce(function (acc, chunk) {\n return acc + chunk.size;\n }, 0); // Exclude the initial chunk from the average size calculation because it is likely to be a very small outlier\n\n\n var averageChunkSize = (totalSize - _this3.recordingChunks[0].size) / (_this3.recordingChunks.length - 1);\n var expectedEndChunkSize = averageChunkSize * 3;\n var maxSize = Math.max(0, restrictions.maxFileSize - expectedEndChunkSize);\n\n if (totalSize > maxSize) {\n stoppingBecauseOfMaxSize = true;\n\n _this3.uppy.info(_this3.i18n('recordingStoppedMaxSize'), 'warning', 4000);\n\n _this3.stopRecording();\n }\n }\n }); // use a \"time slice\" of 500ms: ondataavailable will be called each 500ms\n // smaller time slices mean we can more accurately check the max file size restriction\n\n this.recorder.start(500);\n\n if (this.opts.showRecordingLength) {\n // Start the recordingLengthTimer if we are showing the recording length.\n this.recordingLengthTimer = setInterval(function () {\n var currentRecordingLength = _this3.getPluginState().recordingLengthSeconds;\n\n _this3.setPluginState({\n recordingLengthSeconds: currentRecordingLength + 1\n });\n }, 1000);\n }\n\n this.setPluginState({\n isRecording: true\n });\n };\n\n _proto.stopRecording = function stopRecording() {\n var _this4 = this;\n\n var stopped = new Promise(function (resolve) {\n _this4.recorder.addEventListener('stop', function () {\n resolve();\n });\n\n _this4.recorder.stop();\n\n if (_this4.opts.showRecordingLength) {\n // Stop the recordingLengthTimer if we are showing the recording length.\n clearInterval(_this4.recordingLengthTimer);\n\n _this4.setPluginState({\n recordingLengthSeconds: 0\n });\n }\n });\n return stopped.then(function () {\n _this4.setPluginState({\n isRecording: false\n });\n\n return _this4.getVideo();\n }).then(function (file) {\n try {\n _this4.capturedMediaFile = file; // create object url for capture result preview\n\n _this4.setPluginState({\n // eslint-disable-next-line compat/compat\n recordedVideo: URL.createObjectURL(file.data)\n });\n\n _this4.opts.mirror = false;\n } catch (err) {\n // Logging the error, exept restrictions, which is handled in Core\n if (!err.isRestriction) {\n _this4.uppy.log(err);\n }\n }\n }).then(function () {\n _this4.recordingChunks = null;\n _this4.recorder = null;\n }, function (error) {\n _this4.recordingChunks = null;\n _this4.recorder = null;\n throw error;\n });\n };\n\n _proto.discardRecordedVideo = function discardRecordedVideo() {\n this.setPluginState({\n recordedVideo: null\n });\n this.opts.mirror = true;\n this.capturedMediaFile = null;\n };\n\n _proto.submit = function submit() {\n try {\n if (this.capturedMediaFile) {\n this.uppy.addFile(this.capturedMediaFile);\n }\n } catch (err) {\n // Logging the error, exept restrictions, which is handled in Core\n if (!err.isRestriction) {\n this.uppy.log(err, 'error');\n }\n }\n };\n\n _proto.stop = function stop() {\n if (this.stream) {\n this.stream.getAudioTracks().forEach(function (track) {\n track.stop();\n });\n this.stream.getVideoTracks().forEach(function (track) {\n track.stop();\n });\n }\n\n this.webcamActive = false;\n this.stream = null;\n this.setPluginState({\n recordedVideo: null\n });\n };\n\n _proto.getVideoElement = function getVideoElement() {\n return this.el.querySelector('.uppy-Webcam-video');\n };\n\n _proto.oneTwoThreeSmile = function oneTwoThreeSmile() {\n var _this5 = this;\n\n return new Promise(function (resolve, reject) {\n var count = _this5.opts.countdown; // eslint-disable-next-line consistent-return\n\n var countDown = setInterval(function () {\n if (!_this5.webcamActive) {\n clearInterval(countDown);\n _this5.captureInProgress = false;\n return reject(new Error('Webcam is not active'));\n }\n\n if (count > 0) {\n _this5.uppy.info(count + \"...\", 'warning', 800);\n\n count--;\n } else {\n clearInterval(countDown);\n\n _this5.uppy.info(_this5.i18n('smile'), 'success', 1500);\n\n setTimeout(function () {\n return resolve();\n }, 1500);\n }\n }, 1000);\n });\n };\n\n _proto.takeSnapshot = function takeSnapshot() {\n var _this6 = this;\n\n if (this.captureInProgress) return;\n this.captureInProgress = true;\n this.opts.onBeforeSnapshot().catch(function (err) {\n var message = typeof err === 'object' ? err.message : err;\n\n _this6.uppy.info(message, 'error', 5000);\n\n return Promise.reject(new Error(\"onBeforeSnapshot: \" + message));\n }).then(function () {\n return _this6.getImage();\n }).then(function (tagFile) {\n _this6.captureInProgress = false;\n\n try {\n _this6.uppy.addFile(tagFile);\n } catch (err) {\n // Logging the error, except restrictions, which is handled in Core\n if (!err.isRestriction) {\n _this6.uppy.log(err);\n }\n }\n }, function (error) {\n _this6.captureInProgress = false;\n throw error;\n });\n };\n\n _proto.getImage = function getImage() {\n var _this7 = this;\n\n var video = this.getVideoElement();\n\n if (!video) {\n return Promise.reject(new Error('No video element found, likely due to the Webcam tab being closed.'));\n }\n\n var width = video.videoWidth;\n var height = video.videoHeight;\n var canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(video, 0, 0);\n var restrictions = this.uppy.opts.restrictions;\n var preferredImageMimeTypes = [];\n\n if (this.opts.preferredImageMimeType) {\n preferredImageMimeTypes = [this.opts.preferredImageMimeType];\n } else if (restrictions.allowedFileTypes) {\n preferredImageMimeTypes = restrictions.allowedFileTypes.map(toMimeType).filter(isImageMimeType);\n }\n\n var mimeType = preferredImageMimeTypes[0] || 'image/jpeg';\n var ext = getFileTypeExtension(mimeType) || 'jpg';\n var name = \"cam-\" + Date.now() + \".\" + ext;\n return canvasToBlob(canvas, mimeType).then(function (blob) {\n return {\n source: _this7.id,\n name: name,\n data: new Blob([blob], {\n type: mimeType\n }),\n type: mimeType\n };\n });\n };\n\n _proto.getVideo = function getVideo() {\n // Sometimes in iOS Safari, Blobs (especially the first Blob in the recordingChunks Array)\n // have empty 'type' attributes (e.g. '') so we need to find a Blob that has a defined 'type'\n // attribute in order to determine the correct MIME type.\n var mimeType = this.recordingChunks.find(function (blob) {\n var _blob$type;\n\n return ((_blob$type = blob.type) == null ? void 0 : _blob$type.length) > 0;\n }).type;\n var fileExtension = getFileTypeExtension(mimeType);\n\n if (!fileExtension) {\n return Promise.reject(new Error(\"Could not retrieve recording: Unsupported media type \\\"\" + mimeType + \"\\\"\"));\n }\n\n var name = \"webcam-\" + Date.now() + \".\" + fileExtension;\n var blob = new Blob(this.recordingChunks, {\n type: mimeType\n });\n var file = {\n source: this.id,\n name: name,\n data: new Blob([blob], {\n type: mimeType\n }),\n type: mimeType\n };\n return Promise.resolve(file);\n };\n\n _proto.focus = function focus() {\n var _this8 = this;\n\n if (!this.opts.countdown) return;\n setTimeout(function () {\n _this8.uppy.info(_this8.i18n('smile'), 'success', 1500);\n }, 1000);\n };\n\n _proto.changeVideoSource = function changeVideoSource(deviceId) {\n this.stop();\n this.start({\n deviceId: deviceId\n });\n };\n\n _proto.updateVideoSources = function updateVideoSources() {\n var _this9 = this;\n\n this.mediaDevices.enumerateDevices().then(function (devices) {\n _this9.setPluginState({\n videoSources: devices.filter(function (device) {\n return device.kind === 'videoinput';\n })\n });\n });\n };\n\n _proto.render = function render() {\n if (!this.webcamActive) {\n this.start();\n }\n\n var webcamState = this.getPluginState();\n\n if (!webcamState.cameraReady || !webcamState.hasCamera) {\n return h(PermissionsScreen, {\n icon: CameraIcon,\n i18n: this.i18n,\n hasCamera: webcamState.hasCamera\n });\n }\n\n return h(CameraScreen // eslint-disable-next-line react/jsx-props-no-spreading\n , _extends({}, webcamState, {\n onChangeVideoSource: this.changeVideoSource,\n onSnapshot: this.takeSnapshot,\n onStartRecording: this.startRecording,\n onStopRecording: this.stopRecording,\n onDiscardRecordedVideo: this.discardRecordedVideo,\n onSubmit: this.submit,\n onFocus: this.focus,\n onStop: this.stop,\n i18n: this.i18n,\n modes: this.opts.modes,\n showRecordingLength: this.opts.showRecordingLength,\n showVideoSourceDropdown: this.opts.showVideoSourceDropdown,\n supportsRecording: supportsMediaRecorder(),\n recording: webcamState.isRecording,\n mirror: this.opts.mirror,\n src: this.stream\n }));\n };\n\n _proto.install = function install() {\n var _this10 = this;\n\n this.setPluginState({\n cameraReady: false,\n recordingLengthSeconds: 0\n });\n var target = this.opts.target;\n\n if (target) {\n this.mount(target, this);\n }\n\n if (this.mediaDevices) {\n this.updateVideoSources();\n\n this.mediaDevices.ondevicechange = function () {\n _this10.updateVideoSources();\n\n if (_this10.stream) {\n var restartStream = true;\n\n var _this10$getPluginStat = _this10.getPluginState(),\n videoSources = _this10$getPluginStat.videoSources,\n currentDeviceId = _this10$getPluginStat.currentDeviceId;\n\n videoSources.forEach(function (videoSource) {\n if (currentDeviceId === videoSource.deviceId) {\n restartStream = false;\n }\n });\n\n if (restartStream) {\n _this10.stop();\n\n _this10.start();\n }\n }\n };\n }\n };\n\n _proto.uninstall = function uninstall() {\n if (this.stream) {\n this.stop();\n }\n\n this.unmount();\n };\n\n return Webcam;\n}(Plugin), _class.VERSION = \"1.8.13\", _temp);"],"sourceRoot":""}
1
+ {"version":3,"sources":["../../../node_modules/@uppy/webcam/lib/CameraIcon.js","../../../node_modules/@uppy/utils/lib/getFileTypeExtension.js","../../../node_modules/@uppy/utils/lib/canvasToBlob.js","../../../node_modules/@uppy/webcam/lib/supportsMediaRecorder.js","../../../node_modules/@uppy/webcam/lib/CameraScreen.js","../../../node_modules/@uppy/webcam/lib/SnapshotButton.js","../../../node_modules/@uppy/webcam/lib/RecordButton.js","../../../node_modules/@uppy/webcam/lib/RecordingLength.js","../../../node_modules/@uppy/webcam/lib/formatSeconds.js","../../../node_modules/@uppy/webcam/lib/VideoSourceSelect.js","../../../node_modules/@uppy/webcam/lib/SubmitButton.js","../../../node_modules/@uppy/webcam/lib/DiscardButton.js","../../../node_modules/@uppy/webcam/lib/PermissionsScreen.js","../../../node_modules/@uppy/webcam/lib/index.js"],"names":["h","require","module","exports","props","focusable","fill","width","height","viewBox","d","fillRule","mimeToExtensions","mimeType","replace","dataURItoBlob","canvas","type","quality","toBlob","Promise","resolve","then","toDataURL","MediaRecorder","prototype","start","_extends","Object","assign","target","i","arguments","length","source","key","hasOwnProperty","call","apply","this","_setPrototypeOf","o","p","setPrototypeOf","__proto__","_require","Component","SnapshotButton","RecordButton","RecordingLength","VideoSourceSelect","SubmitButton","DiscardButton","isModeAvailable","modes","mode","indexOf","CameraScreen","_Component","subClass","superClass","create","constructor","_proto","componentDidMount","onFocus","componentWillUnmount","onStop","render","_this","_this$props","src","recordedVideo","recording","supportsRecording","videoSources","showVideoSourceDropdown","showRecordingLength","onSubmit","i18n","mirror","onSnapshot","onStartRecording","onStopRecording","onDiscardRecordedVideo","recordingLengthSeconds","hasRecordedVideo","shouldShowRecordButton","shouldShowSnapshotButton","shouldShowRecordingLength","shouldShowVideoSourceDropdown","videoProps","playsinline","muted","controls","videoElement","srcObject","undefined","autoplay","className","ref","onDiscard","CameraIcon","_ref","title","onClick","x","y","cx","cy","r","formatSeconds","formattedRecordingLengthSeconds","recording_length","seconds","Math","floor","String","padStart","currentDeviceId","onChangeVideoSource","onChange","event","value","map","videoSource","deviceId","selected","label","xmlns","icon","hasCamera","_class","_temp","_assertThisInitialized","self","ReferenceError","Plugin","Translator","getFileTypeExtension","mimeTypes","canvasToBlob","supportsMediaRecorder","PermissionsScreen","toMimeType","fileType","slice","isVideoMimeType","test","isImageMimeType","_Plugin","Webcam","uppy","opts","mediaDevices","navigator","getUserMedia","_getUserMedia","mozGetUserMedia","webkitGetUserMedia","reject","getMediaDevices","supportsUserMedia","protocol","location","match","id","capturedMediaFile","rx","defaultLocale","strings","smile","takePicture","startRecording","stopRecording","allowAccessTitle","allowAccessDescription","noCameraTitle","noCameraDescription","recordingStoppedMaxSize","recordingLength","submitRecordedFile","discardRecordedFile","defaultOptions","onBeforeSnapshot","countdown","facingMode","preferredImageMimeType","preferredVideoMimeType","i18nInit","install","bind","setPluginState","stop","takeSnapshot","discardRecordedVideo","submit","oneTwoThreeSmile","focus","changeVideoSource","webcamActive","cameraReady","cameraError","setOptions","newOpts","videoConstraints","translator","locale","translate","i18nArray","translateArray","hasCameraCheck","enumerateDevices","devices","some","device","kind","isAudioOnly","getConstraints","_this$opts$videoConst","acceptsAudio","acceptsVideo","audio","video","options","_this2","Error","constraints","stream","tracks","getAudioTracks","getVideoTracks","forEach","track","getSettings","updateVideoSources","err","info","message","getMediaRecorderOptions","isTypeSupported","restrictions","preferredVideoMimeTypes","allowedFileTypes","filter","acceptableMimeTypes","candidateType","_this3","recorder","recordingChunks","stoppingBecauseOfMaxSize","addEventListener","push","data","maxFileSize","totalSize","reduce","acc","chunk","size","expectedEndChunkSize","max","recordingLengthTimer","setInterval","currentRecordingLength","getPluginState","isRecording","_this4","clearInterval","getVideo","file","URL","createObjectURL","isRestriction","log","error","addFile","getVideoElement","el","querySelector","_this5","count","countDown","captureInProgress","setTimeout","_this6","getImage","tagFile","_this7","videoWidth","videoHeight","document","createElement","getContext","drawImage","preferredImageMimeTypes","ext","name","Date","now","blob","Blob","find","_blob$type","fileExtension","_this8","_this9","webcamState","_this10","mount","ondevicechange","restartStream","_this10$getPluginStat","uninstall","unmount","VERSION"],"mappings":"2HAAA,IACIA,EADWC,EAAQ,IACND,EAEjBE,EAAOC,QAAU,SAAUC,GACzB,OAAOJ,EAAE,MAAO,CACd,cAAe,OACfK,UAAW,QACXC,KAAM,UACNC,MAAO,KACPC,OAAQ,KACRC,QAAS,aACRT,EAAE,OAAQ,CACXU,EAAG,ueACHC,SAAU,e,kBCTd,IAAIC,EAAmB,CACrB,YAAa,MACb,YAAa,MACb,YAAa,MACb,aAAc,OACd,YAAa,MACb,aAAc,OACd,aAAc,OACd,aAAc,MACd,YAAa,MACb,gBAAiB,MACjB,YAAa,MACb,YAAa,MACb,kB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,eAAiB,WAGjC,GAFAF,EAAQzE,qBAEJyE,EAAQhF,OAAQ,CAClB,IAAImF,GAAgB,EAEhBC,EAAwBJ,EAAQ3C,iBAChC9L,EAAe6O,EAAsB7O,aACrC4C,EAAkBiM,EAAsBjM,gBAE5C5C,EAAa6J,SAAQ,SAAU3G,GACzBN,IAAoBM,EAAYC,WAClCyL,GAAgB,MAIhBA,IACFH,EAAQnH,OAERmH,EAAQ1R,aAOlBqC,EAAO0P,UAAY,WACblR,KAAK6L,QACP7L,KAAK0J,OAGP1J,KAAKmR,WAGAnK,EA/nBuC,CAgoB9Cd,GAASL,EAAOuL,QAAU,SAAUtL","file":"static/js/9.be4dea01.chunk.js","sourcesContent":["var _require = require('preact'),\n h = _require.h;\n\nmodule.exports = function (props) {\n return h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n fill: \"#0097DC\",\n width: \"66\",\n height: \"55\",\n viewBox: \"0 0 66 55\"\n }, h(\"path\", {\n d: \"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z\",\n fillRule: \"evenodd\"\n }));\n};","// TODO Check which types are actually supported in browsers. Chrome likes webm\n// from my testing, but we may need more.\n// We could use a library but they tend to contain dozens of KBs of mappings,\n// most of which will go unused, so not sure if that's worth it.\nvar mimeToExtensions = {\n 'audio/mp3': 'mp3',\n 'audio/mp4': 'mp4',\n 'audio/ogg': 'ogg',\n 'audio/webm': 'webm',\n 'image/gif': 'gif',\n 'image/heic': 'heic',\n 'image/heif': 'heif',\n 'image/jpeg': 'jpg',\n 'image/png': 'png',\n 'image/svg+xml': 'svg',\n 'video/mp4': 'mp4',\n 'video/ogg': 'ogv',\n 'video/quicktime': 'mov',\n 'video/webm': 'webm',\n 'video/x-matroska': 'mkv',\n 'video/x-msvideo': 'avi'\n};\n\nmodule.exports = function getFileTypeExtension(mimeType) {\n // Remove the ; bit in 'video/x-matroska;codecs=avc1'\n mimeType = mimeType.replace(/;.*$/, '');\n return mimeToExtensions[mimeType] || null;\n};","var dataURItoBlob = require('./dataURItoBlob');\n/**\n * Save a <canvas> element's content to a Blob object.\n *\n * @param {HTMLCanvasElement} canvas\n * @returns {Promise}\n */\n\n\nmodule.exports = function canvasToBlob(canvas, type, quality) {\n if (canvas.toBlob) {\n return new Promise(function (resolve) {\n canvas.toBlob(resolve, type, quality);\n });\n }\n\n return Promise.resolve().then(function () {\n return dataURItoBlob(canvas.toDataURL(type, quality), {});\n });\n};","module.exports = function supportsMediaRecorder() {\n /* eslint-disable compat/compat */\n return typeof MediaRecorder === 'function' && !!MediaRecorder.prototype && typeof MediaRecorder.prototype.start === 'function';\n /* eslint-enable compat/compat */\n};","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\n/* eslint-disable jsx-a11y/media-has-caption */\nvar _require = require('preact'),\n h = _require.h,\n Component = _require.Component;\n\nvar SnapshotButton = require('./SnapshotButton');\n\nvar RecordButton = require('./RecordButton');\n\nvar RecordingLength = require('./RecordingLength');\n\nvar VideoSourceSelect = require('./VideoSourceSelect');\n\nvar SubmitButton = require('./SubmitButton');\n\nvar DiscardButton = require('./DiscardButton');\n\nfunction isModeAvailable(modes, mode) {\n return modes.indexOf(mode) !== -1;\n}\n\nvar CameraScreen = /*#__PURE__*/function (_Component) {\n _inheritsLoose(CameraScreen, _Component);\n\n function CameraScreen() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = CameraScreen.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n var onFocus = this.props.onFocus;\n onFocus();\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n var onStop = this.props.onStop;\n onStop();\n };\n\n _proto.render = function render() {\n var _this = this;\n\n var _this$props = this.props,\n src = _this$props.src,\n recordedVideo = _this$props.recordedVideo,\n recording = _this$props.recording,\n modes = _this$props.modes,\n supportsRecording = _this$props.supportsRecording,\n videoSources = _this$props.videoSources,\n showVideoSourceDropdown = _this$props.showVideoSourceDropdown,\n showRecordingLength = _this$props.showRecordingLength,\n onSubmit = _this$props.onSubmit,\n i18n = _this$props.i18n,\n mirror = _this$props.mirror,\n onSnapshot = _this$props.onSnapshot,\n onStartRecording = _this$props.onStartRecording,\n onStopRecording = _this$props.onStopRecording,\n onDiscardRecordedVideo = _this$props.onDiscardRecordedVideo,\n recordingLengthSeconds = _this$props.recordingLengthSeconds;\n var hasRecordedVideo = !!recordedVideo;\n var shouldShowRecordButton = !hasRecordedVideo && supportsRecording && (isModeAvailable(modes, 'video-only') || isModeAvailable(modes, 'audio-only') || isModeAvailable(modes, 'video-audio'));\n var shouldShowSnapshotButton = !hasRecordedVideo && isModeAvailable(modes, 'picture');\n var shouldShowRecordingLength = supportsRecording && showRecordingLength;\n var shouldShowVideoSourceDropdown = showVideoSourceDropdown && videoSources && videoSources.length > 1;\n var videoProps = {\n playsinline: true\n };\n\n if (recordedVideo) {\n videoProps.muted = false;\n videoProps.controls = true;\n videoProps.src = recordedVideo; // reset srcObject in dom. If not resetted, stream sticks in element\n\n if (this.videoElement) {\n this.videoElement.srcObject = undefined;\n }\n } else {\n videoProps.muted = true;\n videoProps.autoplay = true;\n videoProps.srcObject = src;\n }\n\n return h(\"div\", {\n className: \"uppy uppy-Webcam-container\"\n }, h(\"div\", {\n className: \"uppy-Webcam-videoContainer\"\n }, h(\"video\", _extends({\n /* eslint-disable-next-line no-return-assign */\n ref: function ref(videoElement) {\n return _this.videoElement = videoElement;\n },\n className: \"uppy-Webcam-video \" + (mirror ? 'uppy-Webcam-video--mirrored' : '')\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n\n }, videoProps))), h(\"div\", {\n className: \"uppy-Webcam-footer\"\n }, h(\"div\", {\n className: \"uppy-Webcam-videoSourceContainer\"\n }, shouldShowVideoSourceDropdown ? VideoSourceSelect(this.props) : null), h(\"div\", {\n className: \"uppy-Webcam-buttonContainer\"\n }, shouldShowSnapshotButton && h(SnapshotButton, {\n onSnapshot: onSnapshot,\n i18n: i18n\n }), shouldShowRecordButton && h(RecordButton, {\n recording: recording,\n onStartRecording: onStartRecording,\n onStopRecording: onStopRecording,\n i18n: i18n\n }), hasRecordedVideo && h(SubmitButton, {\n onSubmit: onSubmit,\n i18n: i18n\n }), hasRecordedVideo && h(DiscardButton, {\n onDiscard: onDiscardRecordedVideo,\n i18n: i18n\n })), shouldShowRecordingLength && h(\"div\", {\n className: \"uppy-Webcam-recordingLength\"\n }, h(RecordingLength, {\n recordingLengthSeconds: recordingLengthSeconds,\n i18n: i18n\n }))));\n };\n\n return CameraScreen;\n}(Component);\n\nmodule.exports = CameraScreen;","var _require = require('preact'),\n h = _require.h;\n\nvar CameraIcon = require('./CameraIcon');\n\nmodule.exports = function (_ref) {\n var onSnapshot = _ref.onSnapshot,\n i18n = _ref.i18n;\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture\",\n type: \"button\",\n title: i18n('takePicture'),\n \"aria-label\": i18n('takePicture'),\n onClick: onSnapshot,\n \"data-uppy-super-focusable\": true\n }, CameraIcon());\n};","var _require = require('preact'),\n h = _require.h;\n\nmodule.exports = function RecordButton(_ref) {\n var recording = _ref.recording,\n onStartRecording = _ref.onStartRecording,\n onStopRecording = _ref.onStopRecording,\n i18n = _ref.i18n;\n\n if (recording) {\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button\",\n type: \"button\",\n title: i18n('stopRecording'),\n \"aria-label\": i18n('stopRecording'),\n onClick: onStopRecording,\n \"data-uppy-super-focusable\": true\n }, h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon\",\n width: \"100\",\n height: \"100\",\n viewBox: \"0 0 100 100\"\n }, h(\"rect\", {\n x: \"15\",\n y: \"15\",\n width: \"70\",\n height: \"70\"\n })));\n }\n\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button\",\n type: \"button\",\n title: i18n('startRecording'),\n \"aria-label\": i18n('startRecording'),\n onClick: onStartRecording,\n \"data-uppy-super-focusable\": true\n }, h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon\",\n width: \"100\",\n height: \"100\",\n viewBox: \"0 0 100 100\"\n }, h(\"circle\", {\n cx: \"50\",\n cy: \"50\",\n r: \"40\"\n })));\n};","var _require = require('preact'),\n h = _require.h;\n\nvar formatSeconds = require('./formatSeconds');\n\nmodule.exports = function RecordingLength(_ref) {\n var recordingLengthSeconds = _ref.recordingLengthSeconds,\n i18n = _ref.i18n;\n var formattedRecordingLengthSeconds = formatSeconds(recordingLengthSeconds);\n return h(\"span\", {\n \"aria-label\": i18n('recordingLength', {\n recording_length: formattedRecordingLengthSeconds\n })\n }, formattedRecordingLengthSeconds);\n};","/**\n * Takes an Integer value of seconds (e.g. 83) and converts it into a human-readable formatted string (e.g. '1:23').\n *\n * @param {Integer} seconds\n * @returns {string} the formatted seconds (e.g. '1:23' for 1 minute and 23 seconds)\n *\n */\nmodule.exports = function formatSeconds(seconds) {\n return Math.floor(seconds / 60) + \":\" + String(seconds % 60).padStart(2, 0);\n};","var _require = require('preact'),\n h = _require.h;\n\nmodule.exports = function (_ref) {\n var currentDeviceId = _ref.currentDeviceId,\n videoSources = _ref.videoSources,\n onChangeVideoSource = _ref.onChangeVideoSource;\n return h(\"div\", {\n className: \"uppy-Webcam-videoSource\"\n }, h(\"select\", {\n className: \"uppy-u-reset uppy-Webcam-videoSource-select\",\n onChange: function onChange(event) {\n onChangeVideoSource(event.target.value);\n }\n }, videoSources.map(function (videoSource) {\n return h(\"option\", {\n key: videoSource.deviceId,\n value: videoSource.deviceId,\n selected: videoSource.deviceId === currentDeviceId\n }, videoSource.label);\n })));\n};","var _require = require('preact'),\n h = _require.h;\n\nfunction SubmitButton(_ref) {\n var onSubmit = _ref.onSubmit,\n i18n = _ref.i18n;\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit\",\n type: \"button\",\n title: i18n('submitRecordedFile'),\n \"aria-label\": i18n('submitRecordedFile'),\n onClick: onSubmit,\n \"data-uppy-super-focusable\": true\n }, h(\"svg\", {\n width: \"12\",\n height: \"9\",\n viewBox: \"0 0 12 9\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon\"\n }, h(\"path\", {\n fill: \"#fff\",\n fillRule: \"nonzero\",\n d: \"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z\"\n })));\n}\n\nmodule.exports = SubmitButton;","var _require = require('preact'),\n h = _require.h;\n\nfunction DiscardButton(_ref) {\n var onDiscard = _ref.onDiscard,\n i18n = _ref.i18n;\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button\",\n type: \"button\",\n title: i18n('discardRecordedFile'),\n \"aria-label\": i18n('discardRecordedFile'),\n onClick: onDiscard,\n \"data-uppy-super-focusable\": true\n }, h(\"svg\", {\n width: \"13\",\n height: \"13\",\n viewBox: \"0 0 13 13\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className: \"uppy-c-icon\"\n }, h(\"g\", {\n fill: \"#FFF\",\n fillRule: \"evenodd\"\n }, h(\"path\", {\n d: \"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z\"\n }), h(\"path\", {\n d: \"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z\"\n }))));\n}\n\nmodule.exports = DiscardButton;","var _require = require('preact'),\n h = _require.h;\n\nmodule.exports = function (props) {\n return h(\"div\", {\n className: \"uppy-Webcam-permissons\"\n }, h(\"div\", {\n className: \"uppy-Webcam-permissonsIcon\"\n }, props.icon()), h(\"h1\", {\n className: \"uppy-Webcam-title\"\n }, props.hasCamera ? props.i18n('allowAccessTitle') : props.i18n('noCameraTitle')), h(\"p\", null, props.hasCamera ? props.i18n('allowAccessDescription') : props.i18n('noCameraDescription')));\n};","var _class, _temp;\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nvar _require = require('preact'),\n h = _require.h;\n\nvar _require2 = require('@uppy/core'),\n Plugin = _require2.Plugin;\n\nvar Translator = require('@uppy/utils/lib/Translator');\n\nvar getFileTypeExtension = require('@uppy/utils/lib/getFileTypeExtension');\n\nvar mimeTypes = require('@uppy/utils/lib/mimeTypes');\n\nvar canvasToBlob = require('@uppy/utils/lib/canvasToBlob');\n\nvar supportsMediaRecorder = require('./supportsMediaRecorder');\n\nvar CameraIcon = require('./CameraIcon');\n\nvar CameraScreen = require('./CameraScreen');\n\nvar PermissionsScreen = require('./PermissionsScreen');\n/**\n * Normalize a MIME type or file extension into a MIME type.\n *\n * @param {string} fileType - MIME type or a file extension prefixed with `.`.\n * @returns {string|undefined} The MIME type or `undefined` if the fileType is an extension and is not known.\n */\n\n\nfunction toMimeType(fileType) {\n if (fileType[0] === '.') {\n return mimeTypes[fileType.slice(1)];\n }\n\n return fileType;\n}\n/**\n * Is this MIME type a video?\n *\n * @param {string} mimeType - MIME type.\n * @returns {boolean}\n */\n\n\nfunction isVideoMimeType(mimeType) {\n return /^video\\/[^*]+$/.test(mimeType);\n}\n/**\n * Is this MIME type an image?\n *\n * @param {string} mimeType - MIME type.\n * @returns {boolean}\n */\n\n\nfunction isImageMimeType(mimeType) {\n return /^image\\/[^*]+$/.test(mimeType);\n}\n/**\n * Setup getUserMedia, with polyfill for older browsers\n * Adapted from: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\n */\n\n\nfunction getMediaDevices() {\n // eslint-disable-next-line compat/compat\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n // eslint-disable-next-line compat/compat\n return navigator.mediaDevices;\n }\n\n var _getUserMedia = navigator.mozGetUserMedia || navigator.webkitGetUserMedia;\n\n if (!_getUserMedia) {\n return null;\n }\n\n return {\n getUserMedia: function getUserMedia(opts) {\n return new Promise(function (resolve, reject) {\n _getUserMedia.call(navigator, opts, resolve, reject);\n });\n }\n };\n}\n/**\n * Webcam\n */\n\n\nmodule.exports = (_temp = _class = /*#__PURE__*/function (_Plugin) {\n _inheritsLoose(Webcam, _Plugin);\n\n // eslint-disable-next-line global-require\n function Webcam(uppy, opts) {\n var _this;\n\n _this = _Plugin.call(this, uppy, opts) || this;\n _this.mediaDevices = getMediaDevices();\n _this.supportsUserMedia = !!_this.mediaDevices; // eslint-disable-next-line no-restricted-globals\n\n _this.protocol = location.protocol.match(/https/i) ? 'https' : 'http';\n _this.id = _this.opts.id || 'Webcam';\n _this.title = _this.opts.title || 'Camera';\n _this.type = 'acquirer';\n _this.capturedMediaFile = null;\n\n _this.icon = function () {\n return h(\"svg\", {\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n width: \"32\",\n height: \"32\",\n viewBox: \"0 0 32 32\"\n }, h(\"g\", {\n fill: \"none\",\n fillRule: \"evenodd\"\n }, h(\"rect\", {\n className: \"uppy-ProviderIconBg\",\n fill: \"#03BFEF\",\n width: \"32\",\n height: \"32\",\n rx: \"16\"\n }), h(\"path\", {\n d: \"M22 11c1.133 0 2 .867 2 2v7.333c0 1.134-.867 2-2 2H10c-1.133 0-2-.866-2-2V13c0-1.133.867-2 2-2h2.333l1.134-1.733C13.6 9.133 13.8 9 14 9h4c.2 0 .4.133.533.267L19.667 11H22zm-6 1.533a3.764 3.764 0 0 0-3.8 3.8c0 2.129 1.672 3.801 3.8 3.801s3.8-1.672 3.8-3.8c0-2.13-1.672-3.801-3.8-3.801zm0 6.261c-1.395 0-2.46-1.066-2.46-2.46 0-1.395 1.065-2.461 2.46-2.461s2.46 1.066 2.46 2.46c0 1.395-1.065 2.461-2.46 2.461z\",\n fill: \"#FFF\",\n fillRule: \"nonzero\"\n })));\n };\n\n _this.defaultLocale = {\n strings: {\n smile: 'Smile!',\n takePicture: 'Take a picture',\n startRecording: 'Begin video recording',\n stopRecording: 'Stop video recording',\n allowAccessTitle: 'Please allow access to your camera',\n allowAccessDescription: 'In order to take pictures or record video with your camera, please allow camera access for this site.',\n noCameraTitle: 'Camera Not Available',\n noCameraDescription: 'In order to take pictures or record video, please connect a camera device',\n recordingStoppedMaxSize: 'Recording stopped because the file size is about to exceed the limit',\n recordingLength: 'Recording length %{recording_length}',\n submitRecordedFile: 'Submit recorded file',\n discardRecordedFile: 'Discard recorded file'\n }\n }; // set default options\n\n var defaultOptions = {\n onBeforeSnapshot: function onBeforeSnapshot() {\n return Promise.resolve();\n },\n countdown: false,\n modes: ['video-audio', 'video-only', 'audio-only', 'picture'],\n mirror: true,\n showVideoSourceDropdown: false,\n facingMode: 'user',\n preferredImageMimeType: null,\n preferredVideoMimeType: null,\n showRecordingLength: false\n };\n _this.opts = _extends({}, defaultOptions, opts);\n\n _this.i18nInit();\n\n _this.install = _this.install.bind(_assertThisInitialized(_this));\n _this.setPluginState = _this.setPluginState.bind(_assertThisInitialized(_this));\n _this.render = _this.render.bind(_assertThisInitialized(_this)); // Camera controls\n\n _this.start = _this.start.bind(_assertThisInitialized(_this));\n _this.stop = _this.stop.bind(_assertThisInitialized(_this));\n _this.takeSnapshot = _this.takeSnapshot.bind(_assertThisInitialized(_this));\n _this.startRecording = _this.startRecording.bind(_assertThisInitialized(_this));\n _this.stopRecording = _this.stopRecording.bind(_assertThisInitialized(_this));\n _this.discardRecordedVideo = _this.discardRecordedVideo.bind(_assertThisInitialized(_this));\n _this.submit = _this.submit.bind(_assertThisInitialized(_this));\n _this.oneTwoThreeSmile = _this.oneTwoThreeSmile.bind(_assertThisInitialized(_this));\n _this.focus = _this.focus.bind(_assertThisInitialized(_this));\n _this.changeVideoSource = _this.changeVideoSource.bind(_assertThisInitialized(_this));\n _this.webcamActive = false;\n\n if (_this.opts.countdown) {\n _this.opts.onBeforeSnapshot = _this.oneTwoThreeSmile;\n }\n\n _this.setPluginState({\n hasCamera: false,\n cameraReady: false,\n cameraError: null,\n recordingLengthSeconds: 0,\n videoSources: [],\n currentDeviceId: null\n });\n\n return _this;\n }\n\n var _proto = Webcam.prototype;\n\n _proto.setOptions = function setOptions(newOpts) {\n _Plugin.prototype.setOptions.call(this, _extends({}, newOpts, {\n videoConstraints: _extends({}, this.opts.videoConstraints, newOpts == null ? void 0 : newOpts.videoConstraints)\n }));\n\n this.i18nInit();\n };\n\n _proto.i18nInit = function i18nInit() {\n this.translator = new Translator([this.defaultLocale, this.uppy.locale, this.opts.locale]);\n this.i18n = this.translator.translate.bind(this.translator);\n this.i18nArray = this.translator.translateArray.bind(this.translator);\n this.setPluginState(); // so that UI re-renders and we see the updated locale\n };\n\n _proto.hasCameraCheck = function hasCameraCheck() {\n if (!this.mediaDevices) {\n return Promise.resolve(false);\n }\n\n return this.mediaDevices.enumerateDevices().then(function (devices) {\n return devices.some(function (device) {\n return device.kind === 'videoinput';\n });\n });\n };\n\n _proto.isAudioOnly = function isAudioOnly() {\n return this.opts.modes.length === 1 && this.opts.modes[0] === 'audio-only';\n };\n\n _proto.getConstraints = function getConstraints(deviceId) {\n var _this$opts$videoConst;\n\n if (deviceId === void 0) {\n deviceId = null;\n }\n\n var acceptsAudio = this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('audio-only') !== -1;\n var acceptsVideo = !this.isAudioOnly() && (this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('video-only') !== -1 || this.opts.modes.indexOf('picture') !== -1);\n\n var videoConstraints = _extends({}, (_this$opts$videoConst = this.opts.videoConstraints) != null ? _this$opts$videoConst : {\n facingMode: this.opts.facingMode\n }, deviceId ? {\n deviceId: deviceId,\n facingMode: null\n } : {});\n\n return {\n audio: acceptsAudio,\n video: acceptsVideo ? videoConstraints : false\n };\n } // eslint-disable-next-line consistent-return\n ;\n\n _proto.start = function start(options) {\n var _this2 = this;\n\n if (options === void 0) {\n options = null;\n }\n\n if (!this.supportsUserMedia) {\n return Promise.reject(new Error('Webcam access not supported'));\n }\n\n this.webcamActive = true;\n this.opts.mirror = true;\n var constraints = this.getConstraints(options && options.deviceId ? options.deviceId : null);\n this.hasCameraCheck().then(function (hasCamera) {\n _this2.setPluginState({\n hasCamera: hasCamera\n }); // ask user for access to their camera\n\n\n return _this2.mediaDevices.getUserMedia(constraints).then(function (stream) {\n _this2.stream = stream;\n var currentDeviceId = null;\n var tracks = _this2.isAudioOnly() ? stream.getAudioTracks() : stream.getVideoTracks();\n\n if (!options || !options.deviceId) {\n currentDeviceId = tracks[0].getSettings().deviceId;\n } else {\n tracks.forEach(function (track) {\n if (track.getSettings().deviceId === options.deviceId) {\n currentDeviceId = track.getSettings().deviceId;\n }\n });\n } // Update the sources now, so we can access the names.\n\n\n _this2.updateVideoSources();\n\n _this2.setPluginState({\n currentDeviceId: currentDeviceId,\n cameraReady: true\n });\n }).catch(function (err) {\n _this2.setPluginState({\n cameraReady: false,\n cameraError: err\n });\n\n _this2.uppy.info(err.message, 'error');\n });\n });\n }\n /**\n * @returns {object}\n */\n ;\n\n _proto.getMediaRecorderOptions = function getMediaRecorderOptions() {\n var options = {}; // Try to use the `opts.preferredVideoMimeType` or one of the `allowedFileTypes` for the recording.\n // If the browser doesn't support it, we'll fall back to the browser default instead.\n // Safari doesn't have the `isTypeSupported` API.\n\n if (MediaRecorder.isTypeSupported) {\n var restrictions = this.uppy.opts.restrictions;\n var preferredVideoMimeTypes = [];\n\n if (this.opts.preferredVideoMimeType) {\n preferredVideoMimeTypes = [this.opts.preferredVideoMimeType];\n } else if (restrictions.allowedFileTypes) {\n preferredVideoMimeTypes = restrictions.allowedFileTypes.map(toMimeType).filter(isVideoMimeType);\n }\n\n var filterSupportedTypes = function filterSupportedTypes(candidateType) {\n return MediaRecorder.isTypeSupported(candidateType) && getFileTypeExtension(candidateType);\n };\n\n var acceptableMimeTypes = preferredVideoMimeTypes.filter(filterSupportedTypes);\n\n if (acceptableMimeTypes.length > 0) {\n // eslint-disable-next-line prefer-destructuring\n options.mimeType = acceptableMimeTypes[0];\n }\n }\n\n return options;\n };\n\n _proto.startRecording = function startRecording() {\n var _this3 = this;\n\n // only used if supportsMediaRecorder() returned true\n // eslint-disable-next-line compat/compat\n this.recorder = new MediaRecorder(this.stream, this.getMediaRecorderOptions());\n this.recordingChunks = [];\n var stoppingBecauseOfMaxSize = false;\n this.recorder.addEventListener('dataavailable', function (event) {\n _this3.recordingChunks.push(event.data);\n\n var restrictions = _this3.uppy.opts.restrictions;\n\n if (_this3.recordingChunks.length > 1 && restrictions.maxFileSize != null && !stoppingBecauseOfMaxSize) {\n var totalSize = _this3.recordingChunks.reduce(function (acc, chunk) {\n return acc + chunk.size;\n }, 0); // Exclude the initial chunk from the average size calculation because it is likely to be a very small outlier\n\n\n var averageChunkSize = (totalSize - _this3.recordingChunks[0].size) / (_this3.recordingChunks.length - 1);\n var expectedEndChunkSize = averageChunkSize * 3;\n var maxSize = Math.max(0, restrictions.maxFileSize - expectedEndChunkSize);\n\n if (totalSize > maxSize) {\n stoppingBecauseOfMaxSize = true;\n\n _this3.uppy.info(_this3.i18n('recordingStoppedMaxSize'), 'warning', 4000);\n\n _this3.stopRecording();\n }\n }\n }); // use a \"time slice\" of 500ms: ondataavailable will be called each 500ms\n // smaller time slices mean we can more accurately check the max file size restriction\n\n this.recorder.start(500);\n\n if (this.opts.showRecordingLength) {\n // Start the recordingLengthTimer if we are showing the recording length.\n this.recordingLengthTimer = setInterval(function () {\n var currentRecordingLength = _this3.getPluginState().recordingLengthSeconds;\n\n _this3.setPluginState({\n recordingLengthSeconds: currentRecordingLength + 1\n });\n }, 1000);\n }\n\n this.setPluginState({\n isRecording: true\n });\n };\n\n _proto.stopRecording = function stopRecording() {\n var _this4 = this;\n\n var stopped = new Promise(function (resolve) {\n _this4.recorder.addEventListener('stop', function () {\n resolve();\n });\n\n _this4.recorder.stop();\n\n if (_this4.opts.showRecordingLength) {\n // Stop the recordingLengthTimer if we are showing the recording length.\n clearInterval(_this4.recordingLengthTimer);\n\n _this4.setPluginState({\n recordingLengthSeconds: 0\n });\n }\n });\n return stopped.then(function () {\n _this4.setPluginState({\n isRecording: false\n });\n\n return _this4.getVideo();\n }).then(function (file) {\n try {\n _this4.capturedMediaFile = file; // create object url for capture result preview\n\n _this4.setPluginState({\n // eslint-disable-next-line compat/compat\n recordedVideo: URL.createObjectURL(file.data)\n });\n\n _this4.opts.mirror = false;\n } catch (err) {\n // Logging the error, exept restrictions, which is handled in Core\n if (!err.isRestriction) {\n _this4.uppy.log(err);\n }\n }\n }).then(function () {\n _this4.recordingChunks = null;\n _this4.recorder = null;\n }, function (error) {\n _this4.recordingChunks = null;\n _this4.recorder = null;\n throw error;\n });\n };\n\n _proto.discardRecordedVideo = function discardRecordedVideo() {\n this.setPluginState({\n recordedVideo: null\n });\n this.opts.mirror = true;\n this.capturedMediaFile = null;\n };\n\n _proto.submit = function submit() {\n try {\n if (this.capturedMediaFile) {\n this.uppy.addFile(this.capturedMediaFile);\n }\n } catch (err) {\n // Logging the error, exept restrictions, which is handled in Core\n if (!err.isRestriction) {\n this.uppy.log(err, 'error');\n }\n }\n };\n\n _proto.stop = function stop() {\n if (this.stream) {\n this.stream.getAudioTracks().forEach(function (track) {\n track.stop();\n });\n this.stream.getVideoTracks().forEach(function (track) {\n track.stop();\n });\n }\n\n this.webcamActive = false;\n this.stream = null;\n this.setPluginState({\n recordedVideo: null\n });\n };\n\n _proto.getVideoElement = function getVideoElement() {\n return this.el.querySelector('.uppy-Webcam-video');\n };\n\n _proto.oneTwoThreeSmile = function oneTwoThreeSmile() {\n var _this5 = this;\n\n return new Promise(function (resolve, reject) {\n var count = _this5.opts.countdown; // eslint-disable-next-line consistent-return\n\n var countDown = setInterval(function () {\n if (!_this5.webcamActive) {\n clearInterval(countDown);\n _this5.captureInProgress = false;\n return reject(new Error('Webcam is not active'));\n }\n\n if (count > 0) {\n _this5.uppy.info(count + \"...\", 'warning', 800);\n\n count--;\n } else {\n clearInterval(countDown);\n\n _this5.uppy.info(_this5.i18n('smile'), 'success', 1500);\n\n setTimeout(function () {\n return resolve();\n }, 1500);\n }\n }, 1000);\n });\n };\n\n _proto.takeSnapshot = function takeSnapshot() {\n var _this6 = this;\n\n if (this.captureInProgress) return;\n this.captureInProgress = true;\n this.opts.onBeforeSnapshot().catch(function (err) {\n var message = typeof err === 'object' ? err.message : err;\n\n _this6.uppy.info(message, 'error', 5000);\n\n return Promise.reject(new Error(\"onBeforeSnapshot: \" + message));\n }).then(function () {\n return _this6.getImage();\n }).then(function (tagFile) {\n _this6.captureInProgress = false;\n\n try {\n _this6.uppy.addFile(tagFile);\n } catch (err) {\n // Logging the error, except restrictions, which is handled in Core\n if (!err.isRestriction) {\n _this6.uppy.log(err);\n }\n }\n }, function (error) {\n _this6.captureInProgress = false;\n throw error;\n });\n };\n\n _proto.getImage = function getImage() {\n var _this7 = this;\n\n var video = this.getVideoElement();\n\n if (!video) {\n return Promise.reject(new Error('No video element found, likely due to the Webcam tab being closed.'));\n }\n\n var width = video.videoWidth;\n var height = video.videoHeight;\n var canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n var ctx = canvas.getContext('2d');\n ctx.drawImage(video, 0, 0);\n var restrictions = this.uppy.opts.restrictions;\n var preferredImageMimeTypes = [];\n\n if (this.opts.preferredImageMimeType) {\n preferredImageMimeTypes = [this.opts.preferredImageMimeType];\n } else if (restrictions.allowedFileTypes) {\n preferredImageMimeTypes = restrictions.allowedFileTypes.map(toMimeType).filter(isImageMimeType);\n }\n\n var mimeType = preferredImageMimeTypes[0] || 'image/jpeg';\n var ext = getFileTypeExtension(mimeType) || 'jpg';\n var name = \"cam-\" + Date.now() + \".\" + ext;\n return canvasToBlob(canvas, mimeType).then(function (blob) {\n return {\n source: _this7.id,\n name: name,\n data: new Blob([blob], {\n type: mimeType\n }),\n type: mimeType\n };\n });\n };\n\n _proto.getVideo = function getVideo() {\n // Sometimes in iOS Safari, Blobs (especially the first Blob in the recordingChunks Array)\n // have empty 'type' attributes (e.g. '') so we need to find a Blob that has a defined 'type'\n // attribute in order to determine the correct MIME type.\n var mimeType = this.recordingChunks.find(function (blob) {\n var _blob$type;\n\n return ((_blob$type = blob.type) == null ? void 0 : _blob$type.length) > 0;\n }).type;\n var fileExtension = getFileTypeExtension(mimeType);\n\n if (!fileExtension) {\n return Promise.reject(new Error(\"Could not retrieve recording: Unsupported media type \\\"\" + mimeType + \"\\\"\"));\n }\n\n var name = \"webcam-\" + Date.now() + \".\" + fileExtension;\n var blob = new Blob(this.recordingChunks, {\n type: mimeType\n });\n var file = {\n source: this.id,\n name: name,\n data: new Blob([blob], {\n type: mimeType\n }),\n type: mimeType\n };\n return Promise.resolve(file);\n };\n\n _proto.focus = function focus() {\n var _this8 = this;\n\n if (!this.opts.countdown) return;\n setTimeout(function () {\n _this8.uppy.info(_this8.i18n('smile'), 'success', 1500);\n }, 1000);\n };\n\n _proto.changeVideoSource = function changeVideoSource(deviceId) {\n this.stop();\n this.start({\n deviceId: deviceId\n });\n };\n\n _proto.updateVideoSources = function updateVideoSources() {\n var _this9 = this;\n\n this.mediaDevices.enumerateDevices().then(function (devices) {\n _this9.setPluginState({\n videoSources: devices.filter(function (device) {\n return device.kind === 'videoinput';\n })\n });\n });\n };\n\n _proto.render = function render() {\n if (!this.webcamActive) {\n this.start();\n }\n\n var webcamState = this.getPluginState();\n\n if (!webcamState.cameraReady || !webcamState.hasCamera) {\n return h(PermissionsScreen, {\n icon: CameraIcon,\n i18n: this.i18n,\n hasCamera: webcamState.hasCamera\n });\n }\n\n return h(CameraScreen // eslint-disable-next-line react/jsx-props-no-spreading\n , _extends({}, webcamState, {\n onChangeVideoSource: this.changeVideoSource,\n onSnapshot: this.takeSnapshot,\n onStartRecording: this.startRecording,\n onStopRecording: this.stopRecording,\n onDiscardRecordedVideo: this.discardRecordedVideo,\n onSubmit: this.submit,\n onFocus: this.focus,\n onStop: this.stop,\n i18n: this.i18n,\n modes: this.opts.modes,\n showRecordingLength: this.opts.showRecordingLength,\n showVideoSourceDropdown: this.opts.showVideoSourceDropdown,\n supportsRecording: supportsMediaRecorder(),\n recording: webcamState.isRecording,\n mirror: this.opts.mirror,\n src: this.stream\n }));\n };\n\n _proto.install = function install() {\n var _this10 = this;\n\n this.setPluginState({\n cameraReady: false,\n recordingLengthSeconds: 0\n });\n var target = this.opts.target;\n\n if (target) {\n this.mount(target, this);\n }\n\n if (this.mediaDevices) {\n this.updateVideoSources();\n\n this.mediaDevices.ondevicechange = function () {\n _this10.updateVideoSources();\n\n if (_this10.stream) {\n var restartStream = true;\n\n var _this10$getPluginStat = _this10.getPluginState(),\n videoSources = _this10$getPluginStat.videoSources,\n currentDeviceId = _this10$getPluginStat.currentDeviceId;\n\n videoSources.forEach(function (videoSource) {\n if (currentDeviceId === videoSource.deviceId) {\n restartStream = false;\n }\n });\n\n if (restartStream) {\n _this10.stop();\n\n _this10.start();\n }\n }\n };\n }\n };\n\n _proto.uninstall = function uninstall() {\n if (this.stream) {\n this.stop();\n }\n\n this.unmount();\n };\n\n return Webcam;\n}(Plugin), _class.VERSION = \"1.8.13\", _temp);"],"sourceRoot":""}