@micromag/viewer-build 0.2.390 → 0.2.395

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 (56) hide show
  1. package/build/asset-manifest.json +39 -41
  2. package/build/index.html +1 -1
  3. package/build/static/css/{main.7f2f5b5a.chunk.css → main.f4d95294.chunk.css} +2 -2
  4. package/build/static/css/main.f4d95294.chunk.css.map +1 -0
  5. package/build/static/js/0.738d262a.chunk.js +2 -0
  6. package/build/static/js/0.738d262a.chunk.js.map +1 -0
  7. package/build/static/js/1.8b3ff205.chunk.js +2 -0
  8. package/build/static/js/1.8b3ff205.chunk.js.map +1 -0
  9. package/build/static/js/{11.9b03ae00.chunk.js → 10.1cb3daca.chunk.js} +2 -2
  10. package/build/static/js/{11.9b03ae00.chunk.js.map → 10.1cb3daca.chunk.js.map} +1 -1
  11. package/build/static/js/{12.07f6dfbf.chunk.js → 11.e5cda4e3.chunk.js} +2 -2
  12. package/build/static/js/{12.07f6dfbf.chunk.js.map → 11.e5cda4e3.chunk.js.map} +1 -1
  13. package/build/static/js/{13.af8da627.chunk.js → 12.06c49e96.chunk.js} +2 -2
  14. package/build/static/js/{13.af8da627.chunk.js.map → 12.06c49e96.chunk.js.map} +1 -1
  15. package/build/static/js/{14.e42f0789.chunk.js → 13.6888ee8a.chunk.js} +2 -2
  16. package/build/static/js/{14.e42f0789.chunk.js.map → 13.6888ee8a.chunk.js.map} +1 -1
  17. package/build/static/js/14.06a09227.chunk.js +2 -0
  18. package/build/static/js/14.06a09227.chunk.js.map +1 -0
  19. package/build/static/js/{16.d2386b37.chunk.js → 15.be60e44e.chunk.js} +2 -2
  20. package/build/static/js/{16.d2386b37.chunk.js.map → 15.be60e44e.chunk.js.map} +1 -1
  21. package/build/static/js/4.96c340f4.chunk.js +3 -0
  22. package/build/static/js/{5.36556929.chunk.js.LICENSE.txt → 4.96c340f4.chunk.js.LICENSE.txt} +0 -0
  23. package/build/static/js/4.96c340f4.chunk.js.map +1 -0
  24. package/build/static/js/{7.1cc6c06d.chunk.js → 5.5555a5fa.chunk.js} +2 -2
  25. package/build/static/js/{7.1cc6c06d.chunk.js.map → 5.5555a5fa.chunk.js.map} +1 -1
  26. package/build/static/js/{2.89735343.chunk.js → 6.4ca96426.chunk.js} +2 -2
  27. package/build/static/js/6.4ca96426.chunk.js.map +1 -0
  28. package/build/static/js/{8.7d772a7e.chunk.js → 7.f9e2e742.chunk.js} +2 -2
  29. package/build/static/js/{8.7d772a7e.chunk.js.map → 7.f9e2e742.chunk.js.map} +1 -1
  30. package/build/static/js/{9.2b1ae3f1.chunk.js → 8.e3121c5a.chunk.js} +2 -2
  31. package/build/static/js/{9.2b1ae3f1.chunk.js.map → 8.e3121c5a.chunk.js.map} +1 -1
  32. package/build/static/js/9.d9e4ad43.chunk.js +2 -0
  33. package/build/static/js/9.d9e4ad43.chunk.js.map +1 -0
  34. package/build/static/js/main.c42fa4c9.chunk.js +2 -0
  35. package/build/static/js/main.c42fa4c9.chunk.js.map +1 -0
  36. package/build/static/js/runtime-main.f4f072c5.js +2 -0
  37. package/build/static/js/runtime-main.f4f072c5.js.map +1 -0
  38. package/package.json +7 -7
  39. package/build/static/css/main.7f2f5b5a.chunk.css.map +0 -1
  40. package/build/static/js/0.b8a162a9.chunk.js +0 -2
  41. package/build/static/js/0.b8a162a9.chunk.js.map +0 -1
  42. package/build/static/js/1.c7a69c3d.chunk.js +0 -2
  43. package/build/static/js/1.c7a69c3d.chunk.js.map +0 -1
  44. package/build/static/js/10.11cb5892.chunk.js +0 -2
  45. package/build/static/js/10.11cb5892.chunk.js.map +0 -1
  46. package/build/static/js/15.15c6ee58.chunk.js +0 -2
  47. package/build/static/js/15.15c6ee58.chunk.js.map +0 -1
  48. package/build/static/js/2.89735343.chunk.js.map +0 -1
  49. package/build/static/js/5.36556929.chunk.js +0 -3
  50. package/build/static/js/5.36556929.chunk.js.map +0 -1
  51. package/build/static/js/6.9d7e4dda.chunk.js +0 -2
  52. package/build/static/js/6.9d7e4dda.chunk.js.map +0 -1
  53. package/build/static/js/main.271c3d25.chunk.js +0 -2
  54. package/build/static/js/main.271c3d25.chunk.js.map +0 -1
  55. package/build/static/js/runtime-main.82def290.js +0 -2
  56. package/build/static/js/runtime-main.82def290.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (this["webpackJsonp@micromag/viewer-build"]=this["webpackJsonp@micromag/viewer-build"]||[]).push([[7],{455:function(e,t,i){var r=i(459);function n(t,i,o){return"undefined"!==typeof Reflect&&Reflect.get?e.exports=n=Reflect.get:e.exports=n=function(e,t,i){var n=r(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i):o.value}},n(t,i,o||t)}e.exports=n},459:function(e,t,i){var r=i(148);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},479:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(){return r("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},r("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"}))}},504:function(e,t,i){"use strict";var r=i(95),n={"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){var t=e.split(";",1);return e=r(t,1)[0],n[e]||null}},505:function(e,t,i){"use strict";e.exports=function(e,t,i){return new Promise((function(r){e.toBlob(r,t,i)}))}},506:function(e,t,i){"use strict";e.exports=function(){return"function"===typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"===typeof MediaRecorder.prototype.start}},507:function(e,t,i){"use strict";var r=i(19),n=i(20),o=i(24),s=i(25);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},a.apply(this,arguments)}var c=i(17),u=c.h,d=c.Component,p=i(508),l=i(509),h=i(510),g=i(512),v=i(513),m=i(514);function f(e,t){return-1!==e.indexOf(t)}var y=function(e){o(i,e);var t=s(i);function i(){return r(this,i),t.apply(this,arguments)}return n(i,[{key:"componentDidMount",value:function(){(0,this.props.onFocus)()}},{key:"componentWillUnmount",value:function(){(0,this.props.onStop)()}},{key:"render",value:function(){var e=this,t=this.props,i=t.src,r=t.recordedVideo,n=t.recording,o=t.modes,s=t.supportsRecording,c=t.videoSources,d=t.showVideoSourceDropdown,y=t.showRecordingLength,b=t.onSubmit,w=t.i18n,S=t.mirror,R=t.onSnapshot,k=t.onStartRecording,C=t.onStopRecording,x=t.onDiscardRecordedVideo,P=t.recordingLengthSeconds,I=!!r,M=!I&&s&&(f(o,"video-only")||f(o,"audio-only")||f(o,"video-audio")),T=!I&&f(o,"picture"),V=s&&y&&!I,L=d&&c&&c.length>1,D={playsinline:!0};return r?(D.muted=!1,D.controls=!0,D.src=r,this.videoElement&&(this.videoElement.srcObject=void 0)):(D.muted=!0,D.autoplay=!0,D.srcObject=i),u("div",{className:"uppy uppy-Webcam-container"},u("div",{className:"uppy-Webcam-videoContainer"},u("video",a({ref:function(t){return e.videoElement=t},className:"uppy-Webcam-video ".concat(S?"uppy-Webcam-video--mirrored":"")},D))),u("div",{className:"uppy-Webcam-footer"},u("div",{className:"uppy-Webcam-videoSourceContainer"},L?g(this.props):null),u("div",{className:"uppy-Webcam-buttonContainer"},T&&u(p,{onSnapshot:R,i18n:w}),M&&u(l,{recording:n,onStartRecording:k,onStopRecording:C,i18n:w}),I&&u(v,{onSubmit:b,i18n:w}),I&&u(m,{onDiscard:x,i18n:w})),u("div",{className:"uppy-Webcam-recordingLength"},V&&u(h,{recordingLengthSeconds:P,i18n:w}))))}}]),i}(d);e.exports=y},508:function(e,t,i){"use strict";var r=i(17).h,n=i(479);e.exports=function(e){var t=e.onSnapshot,i=e.i18n;return r("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},n())}},509:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){var t=e.recording,i=e.onStartRecording,n=e.onStopRecording,o=e.i18n;return t?r("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:o("stopRecording"),"aria-label":o("stopRecording"),onClick:n,"data-uppy-super-focusable":!0},r("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},r("rect",{x:"15",y:"15",width:"70",height:"70"}))):r("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:o("startRecording"),"aria-label":o("startRecording"),onClick:i,"data-uppy-super-focusable":!0},r("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},r("circle",{cx:"50",cy:"50",r:"40"})))}},510:function(e,t,i){"use strict";var r=i(17).h,n=i(511);e.exports=function(e){var t=e.recordingLengthSeconds,i=e.i18n,o=n(t);return r("span",{"aria-label":i("recordingLength",{recording_length:o})},o)}},511:function(e,t,i){"use strict";e.exports=function(e){return"".concat(Math.floor(e/60),":").concat(String(e%60).padStart(2,0))}},512:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){var t=e.currentDeviceId,i=e.videoSources,n=e.onChangeVideoSource;return r("div",{className:"uppy-Webcam-videoSource"},r("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:function(e){n(e.target.value)}},i.map((function(e){return r("option",{key:e.deviceId,value:e.deviceId,selected:e.deviceId===t},e.label)}))))}},513:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){var t=e.onSubmit,i=e.i18n;return r("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},r("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"},r("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}},514:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){var t=e.onDiscard,i=e.i18n;return r("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:i("discardRecordedFile"),"aria-label":i("discardRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},r("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"},r("g",{fill:"#FFF",fillRule:"evenodd"},r("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),r("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}},515:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){return r("div",{className:"uppy-Webcam-permissons"},r("div",{className:"uppy-Webcam-permissonsIcon"},e.icon()),r("h1",{className:"uppy-Webcam-title"},e.hasCamera?e.i18n("allowAccessTitle"):e.i18n("noCameraTitle")),r("p",null,e.hasCamera?e.i18n("allowAccessDescription"):e.i18n("noCameraDescription")))}},516:function(e,t,i){"use strict";e.exports={strings:{pluginNameCamera:"Camera",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",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",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."}}},544:function(e,t,i){"use strict";var r,n,o,s=i(51),a=i(226),c=i(29),u=i(19),d=i(20),p=i(56),l=i(455),h=i(148),g=i(24),v=i(25);function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},m.apply(this,arguments)}function f(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var y=0;function b(e){return"__private_"+y+++"_"+e}var w=i(17).h,S=i(53).UIPlugin,R=i(504),k=i(233),C=i(505),x=i(506),P=i(479),I=i(507),M=i(515),T=i(516);function V(e){return"."===e[0]?k[e.slice(1)]:e}function L(e){return/^video\/[^*]+$/.test(e)}function D(e){return/^image\/[^*]+$/.test(e)}e.exports=(n=b("enableMirror"),o=r=function(e){g(i,e);var t=v(i);function i(e,r){var o;u(this,i),o=t.call(this,e,r),Object.defineProperty(p(o),n,{writable:!0,value:void 0}),o.mediaDevices=navigator.mediaDevices,o.supportsUserMedia=!!o.mediaDevices,o.protocol=location.protocol.match(/https/i)?"https":"http",o.id=o.opts.id||"Webcam",o.type="acquirer",o.capturedMediaFile=null,o.icon=function(){return w("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},w("g",{fill:"none",fillRule:"evenodd"},w("rect",{className:"uppy-ProviderIconBg",fill:"#03BFEF",width:"32",height:"32",rx:"16"}),w("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=T;var s={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=c(c({},s),r),o.i18nInit(),o.title=o.i18n("pluginNameCamera"),f(p(o),n)[n]=o.opts.mirror,o.install=o.install.bind(p(o)),o.setPluginState=o.setPluginState.bind(p(o)),o.render=o.render.bind(p(o)),o.start=o.start.bind(p(o)),o.stop=o.stop.bind(p(o)),o.takeSnapshot=o.takeSnapshot.bind(p(o)),o.startRecording=o.startRecording.bind(p(o)),o.stopRecording=o.stopRecording.bind(p(o)),o.discardRecordedVideo=o.discardRecordedVideo.bind(p(o)),o.submit=o.submit.bind(p(o)),o.oneTwoThreeSmile=o.oneTwoThreeSmile.bind(p(o)),o.focus=o.focus.bind(p(o)),o.changeVideoSource=o.changeVideoSource.bind(p(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}return d(i,[{key:"setOptions",value:function(e){l(h(i.prototype),"setOptions",this).call(this,c(c({},e),{},{videoConstraints:c(c({},this.opts.videoConstraints),null==e?void 0:e.videoConstraints)}))}},{key:"hasCameraCheck",value:function(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then((function(e){return e.some((function(e){return"videoinput"===e.kind}))})):Promise.resolve(!1)}},{key:"isAudioOnly",value:function(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]}},{key:"getConstraints",value:function(e){void 0===e&&(e=null);var t=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),i=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),r=c(c({},this.opts.videoConstraints||{facingMode:this.opts.facingMode}),e?{deviceId:e,facingMode:null}:{});return{audio:t,video:!!i&&r}}},{key:"start",value: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&&(f(this,n)[n]=!0);var i=this.getConstraints(e&&e.deviceId?e.deviceId:null);this.hasCameraCheck().then((function(r){return t.setPluginState({hasCamera:r}),t.mediaDevices.getUserMedia(i).then((function(i){t.stream=i;var r=null,n=t.isAudioOnly()?i.getAudioTracks():i.getVideoTracks();e&&e.deviceId?n.forEach((function(t){t.getSettings().deviceId===e.deviceId&&(r=t.getSettings().deviceId)})):r=n[0].getSettings().deviceId,t.updateVideoSources(),t.setPluginState({currentDeviceId:r,cameraReady:!0})})).catch((function(e){t.setPluginState({cameraReady:!1,cameraError:e}),t.uppy.info(e.message,"error")}))}))}},{key:"getMediaRecorderOptions",value: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(V).filter(L));var r=i.filter((function(e){return MediaRecorder.isTypeSupported(e)&&R(e)}));r.length>0&&(e.mimeType=r[0])}return e}},{key:"startRecording",value: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 r=e.uppy.opts.restrictions;if(e.recordingChunks.length>1&&null!=r.maxFileSize&&!t){var n=e.recordingChunks.reduce((function(e,t){return e+t.size}),0),o=3*((n-e.recordingChunks[0].size)/(e.recordingChunks.length-1));n>Math.max(0,r.maxFileSize-o)&&(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})}},{key:"stopRecording",value: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)}),f(e,n)[n]=!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}))}},{key:"discardRecordedVideo",value:function(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(f(this,n)[n]=!0),this.capturedMediaFile=null}},{key:"submit",value:function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}},{key:"stop",value:function(){var e=a(s.mark((function e(){var t,i,r=this;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.stream&&(t=this.stream.getAudioTracks(),i=this.stream.getVideoTracks(),t.concat(i).forEach((function(e){return e.stop()}))),!this.recorder){e.next=4;break}return e.next=4,new Promise((function(e){r.recorder.addEventListener("stop",e,{once:!0}),r.recorder.stop(),r.opts.showRecordingLength&&clearInterval(r.recordingLengthTimer)}));case 4:this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,isRecording:!1,recordingLengthSeconds:0});case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getVideoElement",value:function(){return this.el.querySelector(".uppy-Webcam-video")}},{key:"oneTwoThreeSmile",value:function(){var e=this;return new Promise((function(t,i){var r=e.opts.countdown,n=setInterval((function(){if(!e.webcamActive)return clearInterval(n),e.captureInProgress=!1,i(new Error("Webcam is not active"));r>0?(e.uppy.info("".concat(r,"..."),"warning",800),r--):(clearInterval(n),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout((function(){return t()}),1500))}),1e3)}))}},{key:"takeSnapshot",value: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: ".concat(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})))}},{key:"getImage",value: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,r=t.videoHeight,n=document.createElement("canvas");n.width=i,n.height=r,n.getContext("2d").drawImage(t,0,0);var o=this.uppy.opts.restrictions,s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(s=o.allowedFileTypes.map(V).filter(D));var a=s[0]||"image/jpeg",c=R(a)||"jpg",u="cam-".concat(Date.now(),".").concat(c);return C(n,a).then((function(t){return{source:e.id,name:u,data:new Blob([t],{type:a}),type:a}}))}},{key:"getVideo",value:function(){var e=this.recordingChunks.find((function(e){var t;return(null==(t=e.type)?void 0:t.length)>0})).type,t=R(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'.concat(e,'"')));var i="webcam-".concat(Date.now(),".").concat(t),r=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:i,data:new Blob([r],{type:e}),type:e};return Promise.resolve(n)}},{key:"focus",value:function(){var e=this;this.opts.countdown&&setTimeout((function(){e.uppy.info(e.i18n("smile"),"success",1500)}),1e3)}},{key:"changeVideoSource",value:function(e){this.stop(),this.start({deviceId:e})}},{key:"updateVideoSources",value:function(){var e=this;this.mediaDevices.enumerateDevices().then((function(t){e.setPluginState({videoSources:t.filter((function(e){return"videoinput"===e.kind}))})}))}},{key:"render",value:function(){this.webcamActive||this.start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?w(I,m({},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:x(),recording:e.isRecording,mirror:f(this,n)[n],src:this.stream})):w(M,{icon:P,i18n:this.i18n,hasCamera:e.hasCamera})}},{key:"install",value: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(),r=i.videoSources,n=i.currentDeviceId;r.forEach((function(e){n===e.deviceId&&(t=!1)})),t&&(e.stop(),e.start())}})}},{key:"uninstall",value:function(){this.stop(),this.unmount()}},{key:"onUnmount",value:function(){this.stop()}}]),i}(S),r.VERSION="2.0.5",o)}}]);
2
- //# sourceMappingURL=7.1cc6c06d.chunk.js.map
1
+ (this["webpackJsonp@micromag/viewer-build"]=this["webpackJsonp@micromag/viewer-build"]||[]).push([[5],{454:function(e,t,i){var r=i(456);function n(t,i,o){return"undefined"!==typeof Reflect&&Reflect.get?e.exports=n=Reflect.get:e.exports=n=function(e,t,i){var n=r(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i):o.value}},n(t,i,o||t)}e.exports=n},456:function(e,t,i){var r=i(148);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},470:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(){return r("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},r("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"}))}},484:function(e,t,i){"use strict";var r=i(95),n={"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){var t=e.split(";",1);return e=r(t,1)[0],n[e]||null}},485:function(e,t,i){"use strict";e.exports=function(e,t,i){return new Promise((function(r){e.toBlob(r,t,i)}))}},486:function(e,t,i){"use strict";e.exports=function(){return"function"===typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"===typeof MediaRecorder.prototype.start}},487:function(e,t,i){"use strict";var r=i(19),n=i(20),o=i(24),s=i(25);function a(){return a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},a.apply(this,arguments)}var c=i(17),u=c.h,d=c.Component,p=i(488),l=i(489),h=i(490),g=i(492),v=i(493),m=i(494);function f(e,t){return-1!==e.indexOf(t)}var y=function(e){o(i,e);var t=s(i);function i(){return r(this,i),t.apply(this,arguments)}return n(i,[{key:"componentDidMount",value:function(){(0,this.props.onFocus)()}},{key:"componentWillUnmount",value:function(){(0,this.props.onStop)()}},{key:"render",value:function(){var e=this,t=this.props,i=t.src,r=t.recordedVideo,n=t.recording,o=t.modes,s=t.supportsRecording,c=t.videoSources,d=t.showVideoSourceDropdown,y=t.showRecordingLength,b=t.onSubmit,w=t.i18n,S=t.mirror,R=t.onSnapshot,k=t.onStartRecording,C=t.onStopRecording,x=t.onDiscardRecordedVideo,P=t.recordingLengthSeconds,I=!!r,M=!I&&s&&(f(o,"video-only")||f(o,"audio-only")||f(o,"video-audio")),T=!I&&f(o,"picture"),V=s&&y&&!I,L=d&&c&&c.length>1,D={playsinline:!0};return r?(D.muted=!1,D.controls=!0,D.src=r,this.videoElement&&(this.videoElement.srcObject=void 0)):(D.muted=!0,D.autoplay=!0,D.srcObject=i),u("div",{className:"uppy uppy-Webcam-container"},u("div",{className:"uppy-Webcam-videoContainer"},u("video",a({ref:function(t){return e.videoElement=t},className:"uppy-Webcam-video ".concat(S?"uppy-Webcam-video--mirrored":"")},D))),u("div",{className:"uppy-Webcam-footer"},u("div",{className:"uppy-Webcam-videoSourceContainer"},L?g(this.props):null),u("div",{className:"uppy-Webcam-buttonContainer"},T&&u(p,{onSnapshot:R,i18n:w}),M&&u(l,{recording:n,onStartRecording:k,onStopRecording:C,i18n:w}),I&&u(v,{onSubmit:b,i18n:w}),I&&u(m,{onDiscard:x,i18n:w})),u("div",{className:"uppy-Webcam-recordingLength"},V&&u(h,{recordingLengthSeconds:P,i18n:w}))))}}]),i}(d);e.exports=y},488:function(e,t,i){"use strict";var r=i(17).h,n=i(470);e.exports=function(e){var t=e.onSnapshot,i=e.i18n;return r("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},n())}},489:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){var t=e.recording,i=e.onStartRecording,n=e.onStopRecording,o=e.i18n;return t?r("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:o("stopRecording"),"aria-label":o("stopRecording"),onClick:n,"data-uppy-super-focusable":!0},r("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},r("rect",{x:"15",y:"15",width:"70",height:"70"}))):r("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:o("startRecording"),"aria-label":o("startRecording"),onClick:i,"data-uppy-super-focusable":!0},r("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},r("circle",{cx:"50",cy:"50",r:"40"})))}},490:function(e,t,i){"use strict";var r=i(17).h,n=i(491);e.exports=function(e){var t=e.recordingLengthSeconds,i=e.i18n,o=n(t);return r("span",{"aria-label":i("recordingLength",{recording_length:o})},o)}},491:function(e,t,i){"use strict";e.exports=function(e){return"".concat(Math.floor(e/60),":").concat(String(e%60).padStart(2,0))}},492:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){var t=e.currentDeviceId,i=e.videoSources,n=e.onChangeVideoSource;return r("div",{className:"uppy-Webcam-videoSource"},r("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:function(e){n(e.target.value)}},i.map((function(e){return r("option",{key:e.deviceId,value:e.deviceId,selected:e.deviceId===t},e.label)}))))}},493:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){var t=e.onSubmit,i=e.i18n;return r("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},r("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"},r("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}},494:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){var t=e.onDiscard,i=e.i18n;return r("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:i("discardRecordedFile"),"aria-label":i("discardRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},r("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"},r("g",{fill:"#FFF",fillRule:"evenodd"},r("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),r("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}},495:function(e,t,i){"use strict";var r=i(17).h;e.exports=function(e){return r("div",{className:"uppy-Webcam-permissons"},r("div",{className:"uppy-Webcam-permissonsIcon"},e.icon()),r("h1",{className:"uppy-Webcam-title"},e.hasCamera?e.i18n("allowAccessTitle"):e.i18n("noCameraTitle")),r("p",null,e.hasCamera?e.i18n("allowAccessDescription"):e.i18n("noCameraDescription")))}},496:function(e,t,i){"use strict";e.exports={strings:{pluginNameCamera:"Camera",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",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",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."}}},523:function(e,t,i){"use strict";var r,n,o,s=i(51),a=i(226),c=i(30),u=i(19),d=i(20),p=i(56),l=i(454),h=i(148),g=i(24),v=i(25);function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},m.apply(this,arguments)}function f(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var y=0;function b(e){return"__private_"+y+++"_"+e}var w=i(17).h,S=i(53).UIPlugin,R=i(484),k=i(233),C=i(485),x=i(486),P=i(470),I=i(487),M=i(495),T=i(496);function V(e){return"."===e[0]?k[e.slice(1)]:e}function L(e){return/^video\/[^*]+$/.test(e)}function D(e){return/^image\/[^*]+$/.test(e)}e.exports=(n=b("enableMirror"),o=r=function(e){g(i,e);var t=v(i);function i(e,r){var o;u(this,i),o=t.call(this,e,r),Object.defineProperty(p(o),n,{writable:!0,value:void 0}),o.mediaDevices=navigator.mediaDevices,o.supportsUserMedia=!!o.mediaDevices,o.protocol=location.protocol.match(/https/i)?"https":"http",o.id=o.opts.id||"Webcam",o.type="acquirer",o.capturedMediaFile=null,o.icon=function(){return w("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},w("g",{fill:"none",fillRule:"evenodd"},w("rect",{className:"uppy-ProviderIconBg",fill:"#03BFEF",width:"32",height:"32",rx:"16"}),w("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=T;var s={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=c(c({},s),r),o.i18nInit(),o.title=o.i18n("pluginNameCamera"),f(p(o),n)[n]=o.opts.mirror,o.install=o.install.bind(p(o)),o.setPluginState=o.setPluginState.bind(p(o)),o.render=o.render.bind(p(o)),o.start=o.start.bind(p(o)),o.stop=o.stop.bind(p(o)),o.takeSnapshot=o.takeSnapshot.bind(p(o)),o.startRecording=o.startRecording.bind(p(o)),o.stopRecording=o.stopRecording.bind(p(o)),o.discardRecordedVideo=o.discardRecordedVideo.bind(p(o)),o.submit=o.submit.bind(p(o)),o.oneTwoThreeSmile=o.oneTwoThreeSmile.bind(p(o)),o.focus=o.focus.bind(p(o)),o.changeVideoSource=o.changeVideoSource.bind(p(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}return d(i,[{key:"setOptions",value:function(e){l(h(i.prototype),"setOptions",this).call(this,c(c({},e),{},{videoConstraints:c(c({},this.opts.videoConstraints),null==e?void 0:e.videoConstraints)}))}},{key:"hasCameraCheck",value:function(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then((function(e){return e.some((function(e){return"videoinput"===e.kind}))})):Promise.resolve(!1)}},{key:"isAudioOnly",value:function(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]}},{key:"getConstraints",value:function(e){void 0===e&&(e=null);var t=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),i=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),r=c(c({},this.opts.videoConstraints||{facingMode:this.opts.facingMode}),e?{deviceId:e,facingMode:null}:{});return{audio:t,video:!!i&&r}}},{key:"start",value: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&&(f(this,n)[n]=!0);var i=this.getConstraints(e&&e.deviceId?e.deviceId:null);this.hasCameraCheck().then((function(r){return t.setPluginState({hasCamera:r}),t.mediaDevices.getUserMedia(i).then((function(i){t.stream=i;var r=null,n=t.isAudioOnly()?i.getAudioTracks():i.getVideoTracks();e&&e.deviceId?n.forEach((function(t){t.getSettings().deviceId===e.deviceId&&(r=t.getSettings().deviceId)})):r=n[0].getSettings().deviceId,t.updateVideoSources(),t.setPluginState({currentDeviceId:r,cameraReady:!0})})).catch((function(e){t.setPluginState({cameraReady:!1,cameraError:e}),t.uppy.info(e.message,"error")}))}))}},{key:"getMediaRecorderOptions",value: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(V).filter(L));var r=i.filter((function(e){return MediaRecorder.isTypeSupported(e)&&R(e)}));r.length>0&&(e.mimeType=r[0])}return e}},{key:"startRecording",value: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 r=e.uppy.opts.restrictions;if(e.recordingChunks.length>1&&null!=r.maxFileSize&&!t){var n=e.recordingChunks.reduce((function(e,t){return e+t.size}),0),o=3*((n-e.recordingChunks[0].size)/(e.recordingChunks.length-1));n>Math.max(0,r.maxFileSize-o)&&(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})}},{key:"stopRecording",value: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)}),f(e,n)[n]=!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}))}},{key:"discardRecordedVideo",value:function(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(f(this,n)[n]=!0),this.capturedMediaFile=null}},{key:"submit",value:function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}},{key:"stop",value:function(){var e=a(s.mark((function e(){var t,i,r=this;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.stream&&(t=this.stream.getAudioTracks(),i=this.stream.getVideoTracks(),t.concat(i).forEach((function(e){return e.stop()}))),!this.recorder){e.next=4;break}return e.next=4,new Promise((function(e){r.recorder.addEventListener("stop",e,{once:!0}),r.recorder.stop(),r.opts.showRecordingLength&&clearInterval(r.recordingLengthTimer)}));case 4:this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,isRecording:!1,recordingLengthSeconds:0});case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getVideoElement",value:function(){return this.el.querySelector(".uppy-Webcam-video")}},{key:"oneTwoThreeSmile",value:function(){var e=this;return new Promise((function(t,i){var r=e.opts.countdown,n=setInterval((function(){if(!e.webcamActive)return clearInterval(n),e.captureInProgress=!1,i(new Error("Webcam is not active"));r>0?(e.uppy.info("".concat(r,"..."),"warning",800),r--):(clearInterval(n),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout((function(){return t()}),1500))}),1e3)}))}},{key:"takeSnapshot",value: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: ".concat(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})))}},{key:"getImage",value: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,r=t.videoHeight,n=document.createElement("canvas");n.width=i,n.height=r,n.getContext("2d").drawImage(t,0,0);var o=this.uppy.opts.restrictions,s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(s=o.allowedFileTypes.map(V).filter(D));var a=s[0]||"image/jpeg",c=R(a)||"jpg",u="cam-".concat(Date.now(),".").concat(c);return C(n,a).then((function(t){return{source:e.id,name:u,data:new Blob([t],{type:a}),type:a}}))}},{key:"getVideo",value:function(){var e=this.recordingChunks.find((function(e){var t;return(null==(t=e.type)?void 0:t.length)>0})).type,t=R(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'.concat(e,'"')));var i="webcam-".concat(Date.now(),".").concat(t),r=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:i,data:new Blob([r],{type:e}),type:e};return Promise.resolve(n)}},{key:"focus",value:function(){var e=this;this.opts.countdown&&setTimeout((function(){e.uppy.info(e.i18n("smile"),"success",1500)}),1e3)}},{key:"changeVideoSource",value:function(e){this.stop(),this.start({deviceId:e})}},{key:"updateVideoSources",value:function(){var e=this;this.mediaDevices.enumerateDevices().then((function(t){e.setPluginState({videoSources:t.filter((function(e){return"videoinput"===e.kind}))})}))}},{key:"render",value:function(){this.webcamActive||this.start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?w(I,m({},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:x(),recording:e.isRecording,mirror:f(this,n)[n],src:this.stream})):w(M,{icon:P,i18n:this.i18n,hasCamera:e.hasCamera})}},{key:"install",value: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(),r=i.videoSources,n=i.currentDeviceId;r.forEach((function(e){n===e.deviceId&&(t=!1)})),t&&(e.stop(),e.start())}})}},{key:"uninstall",value:function(){this.stop(),this.unmount()}},{key:"onUnmount",value:function(){this.stop()}}]),i}(S),r.VERSION="2.0.5",o)}}]);
2
+ //# sourceMappingURL=5.5555a5fa.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/get.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/superPropBase.js","../../../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/locale.js","../../../node_modules/@uppy/webcam/lib/index.js"],"names":["superPropBase","_get","target","property","receiver","Reflect","get","module","exports","base","desc","Object","getOwnPropertyDescriptor","call","value","getPrototypeOf","object","prototype","hasOwnProperty","h","require","focusable","fill","width","height","viewBox","d","fillRule","mimeToExtensions","mimeType","split","canvas","type","quality","Promise","resolve","toBlob","MediaRecorder","start","_extends","assign","i","arguments","length","source","key","apply","this","Component","SnapshotButton","RecordButton","RecordingLength","VideoSourceSelect","SubmitButton","DiscardButton","isModeAvailable","modes","mode","indexOf","CameraScreen","onFocus","props","onStop","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","map","videoSource","deviceId","selected","label","xmlns","icon","hasCamera","strings","pluginNameCamera","noCameraTitle","noCameraDescription","recordingStoppedMaxSize","submitRecordedFile","discardRecordedFile","smile","takePicture","startRecording","stopRecording","recordingLength","allowAccessTitle","allowAccessDescription","_class","_enableMirror","_temp","_classPrivateFieldLooseBase","privateKey","TypeError","id","_classPrivateFieldLooseKey","name","UIPlugin","getFileTypeExtension","mimeTypes","canvasToBlob","supportsMediaRecorder","PermissionsScreen","locale","toMimeType","fileType","slice","isVideoMimeType","test","isImageMimeType","uppy","opts","defineProperty","writable","mediaDevices","navigator","supportsUserMedia","protocol","location","match","capturedMediaFile","rx","defaultLocale","defaultOptions","onBeforeSnapshot","countdown","facingMode","preferredImageMimeType","preferredVideoMimeType","i18nInit","install","bind","setPluginState","render","stop","takeSnapshot","discardRecordedVideo","submit","oneTwoThreeSmile","focus","changeVideoSource","webcamActive","cameraReady","cameraError","newOpts","videoConstraints","enumerateDevices","then","devices","some","device","kind","acceptsAudio","acceptsVideo","isAudioOnly","audio","video","options","reject","Error","constraints","getConstraints","hasCameraCheck","getUserMedia","stream","tracks","getAudioTracks","getVideoTracks","forEach","track","getSettings","updateVideoSources","err","info","message","isTypeSupported","restrictions","preferredVideoMimeTypes","allowedFileTypes","filter","acceptableMimeTypes","candidateType","recorder","getMediaRecorderOptions","recordingChunks","stoppingBecauseOfMaxSize","addEventListener","push","data","maxFileSize","totalSize","reduce","acc","chunk","size","expectedEndChunkSize","max","recordingLengthTimer","setInterval","currentRecordingLength","getPluginState","isRecording","clearInterval","getVideo","file","URL","createObjectURL","isRestriction","log","error","addFile","audioTracks","videoTracks","concat","once","el","querySelector","count","countDown","captureInProgress","setTimeout","getImage","tagFile","getVideoElement","videoWidth","videoHeight","document","createElement","getContext","drawImage","preferredImageMimeTypes","ext","Date","now","blob","Blob","find","_blob$type","fileExtension","webcamState","mount","ondevicechange","restartStream","unmount","VERSION"],"mappings":"2HAAA,IAAIA,EAAgB,EAAQ,KAE5B,SAASC,EAAKC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D3E,IAAKhB,KAAKsK,UAxBHlM,EAAEoI,EAAmB,CAC1B9B,KAAM3B,EACNvB,KAAMxB,KAAKwB,KACXmD,UAAWsK,EAAYtK,cA3gB2E,qBAoiBxG,WAAU,WACR3E,KAAKsI,eAAe,CAClBU,aAAa,EACblH,uBAAwB,IAE1B,IACE3E,EACE6C,KAAKiH,KADP9J,OAGEA,GACF6C,KAAKkP,MAAM/R,EAAQ6C,MAGjBA,KAAKoH,eACPpH,KAAK6K,qBAEL7K,KAAKoH,aAAa+H,eAAiB,WAGjC,GAFA,EAAKtE,qBAED,EAAKP,OAAQ,CACf,IAAI8E,GAAgB,EACpB,EAGI,EAAK1C,iBAFPtL,EADF,EACEA,aACA4C,EAFF,EAEEA,gBAEF5C,EAAasJ,SAAQ,SAAArG,GACfL,IAAoBK,EAAYC,WAClC8K,GAAgB,MAIhBA,IACF,EAAK5G,OACL,EAAKjJ,cArkByF,uBA4kBxG,WACES,KAAKwI,OACLxI,KAAKqP,YA9kBiG,uBAilBxG,WACErP,KAAKwI,WAllBiG,GAAwBrC,GAqlB9HT,EAAO4J,QAAU,QAAS1J","file":"static/js/7.1cc6c06d.chunk.js","sourcesContent":["var superPropBase = require(\"./superPropBase\");\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nmodule.exports = _get;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nmodule.exports = _superPropBase;","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nmodule.exports = () => {\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};","\"use strict\";\n\nconst 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 // eslint-disable-next-line no-param-reassign\n [mimeType] = mimeType.split(';', 1);\n return mimeToExtensions[mimeType] || null;\n};","\"use strict\";\n\n/**\n * Save a <canvas> element's content to a Blob object.\n *\n * @param {HTMLCanvasElement} canvas\n * @returns {Promise}\n */\nmodule.exports = function canvasToBlob(canvas, type, quality) {\n return new Promise(resolve => {\n canvas.toBlob(resolve, type, quality);\n });\n};","\"use strict\";\n\nmodule.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};","\"use strict\";\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\n/* eslint-disable jsx-a11y/media-has-caption */\nconst {\n h,\n Component\n} = require('preact');\n\nconst SnapshotButton = require('./SnapshotButton');\n\nconst RecordButton = require('./RecordButton');\n\nconst RecordingLength = require('./RecordingLength');\n\nconst VideoSourceSelect = require('./VideoSourceSelect');\n\nconst SubmitButton = require('./SubmitButton');\n\nconst DiscardButton = require('./DiscardButton');\n\nfunction isModeAvailable(modes, mode) {\n return modes.indexOf(mode) !== -1;\n}\n\nclass CameraScreen extends Component {\n componentDidMount() {\n const {\n onFocus\n } = this.props;\n onFocus();\n }\n\n componentWillUnmount() {\n const {\n onStop\n } = this.props;\n onStop();\n }\n\n render() {\n const {\n src,\n recordedVideo,\n recording,\n modes,\n supportsRecording,\n videoSources,\n showVideoSourceDropdown,\n showRecordingLength,\n onSubmit,\n i18n,\n mirror,\n onSnapshot,\n onStartRecording,\n onStopRecording,\n onDiscardRecordedVideo,\n recordingLengthSeconds\n } = this.props;\n const hasRecordedVideo = !!recordedVideo;\n const shouldShowRecordButton = !hasRecordedVideo && supportsRecording && (isModeAvailable(modes, 'video-only') || isModeAvailable(modes, 'audio-only') || isModeAvailable(modes, 'video-audio'));\n const shouldShowSnapshotButton = !hasRecordedVideo && isModeAvailable(modes, 'picture');\n const shouldShowRecordingLength = supportsRecording && showRecordingLength && !hasRecordedVideo;\n const shouldShowVideoSourceDropdown = showVideoSourceDropdown && videoSources && videoSources.length > 1;\n const 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: videoElement => this.videoElement = videoElement,\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 })), h(\"div\", {\n className: \"uppy-Webcam-recordingLength\"\n }, shouldShowRecordingLength && h(RecordingLength, {\n recordingLengthSeconds: recordingLengthSeconds,\n i18n: i18n\n }))));\n }\n\n}\n\nmodule.exports = CameraScreen;","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nconst CameraIcon = require('./CameraIcon');\n\nmodule.exports = _ref => {\n let {\n onSnapshot,\n i18n\n } = _ref;\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};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nmodule.exports = function RecordButton(_ref) {\n let {\n recording,\n onStartRecording,\n onStopRecording,\n i18n\n } = _ref;\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};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nconst formatSeconds = require('./formatSeconds');\n\nmodule.exports = function RecordingLength(_ref) {\n let {\n recordingLengthSeconds,\n i18n\n } = _ref;\n const formattedRecordingLengthSeconds = formatSeconds(recordingLengthSeconds);\n return h(\"span\", {\n \"aria-label\": i18n('recordingLength', {\n recording_length: formattedRecordingLengthSeconds\n })\n }, formattedRecordingLengthSeconds);\n};","\"use strict\";\n\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};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nmodule.exports = _ref => {\n let {\n currentDeviceId,\n videoSources,\n onChangeVideoSource\n } = _ref;\n return h(\"div\", {\n className: \"uppy-Webcam-videoSource\"\n }, h(\"select\", {\n className: \"uppy-u-reset uppy-Webcam-videoSource-select\",\n onChange: event => {\n onChangeVideoSource(event.target.value);\n }\n }, videoSources.map(videoSource => h(\"option\", {\n key: videoSource.deviceId,\n value: videoSource.deviceId,\n selected: videoSource.deviceId === currentDeviceId\n }, videoSource.label))));\n};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nfunction SubmitButton(_ref) {\n let {\n onSubmit,\n i18n\n } = _ref;\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;","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nfunction DiscardButton(_ref) {\n let {\n onDiscard,\n i18n\n } = _ref;\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard\",\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;","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nmodule.exports = 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};","\"use strict\";\n\nmodule.exports = {\n strings: {\n pluginNameCamera: 'Camera',\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 submitRecordedFile: 'Submit recorded file',\n discardRecordedFile: 'Discard recorded file',\n // Shown before a picture is taken when the `countdown` option is set.\n smile: 'Smile!',\n // Used as the label for the button that takes a picture.\n // This is not visibly rendered but is picked up by screen readers.\n takePicture: 'Take a picture',\n // Used as the label for the button that starts a video recording.\n // This is not visibly rendered but is picked up by screen readers.\n startRecording: 'Begin video recording',\n // Used as the label for the button that stops a video recording.\n // This is not visibly rendered but is picked up by screen readers.\n stopRecording: 'Stop video recording',\n // Used as the label for the recording length counter. See the showRecordingLength option.\n // This is not visibly rendered but is picked up by screen readers.\n recordingLength: 'Recording length %{recording_length}',\n // Title on the “allow access” screen\n allowAccessTitle: 'Please allow access to your camera',\n // Description on the “allow access” screen\n allowAccessDescription: 'In order to take pictures or record video with your camera, please allow camera access for this site.'\n }\n};","\"use strict\";\n\nvar _class, _enableMirror, _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 _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError(\"attempted to use private field on non-instance\"); } return receiver; }\n\nvar id = 0;\n\nfunction _classPrivateFieldLooseKey(name) { return \"__private_\" + id++ + \"_\" + name; }\n\nconst {\n h\n} = require('preact');\n\nconst {\n UIPlugin\n} = require('@uppy/core');\n\nconst getFileTypeExtension = require('@uppy/utils/lib/getFileTypeExtension');\n\nconst mimeTypes = require('@uppy/utils/lib/mimeTypes');\n\nconst canvasToBlob = require('@uppy/utils/lib/canvasToBlob');\n\nconst supportsMediaRecorder = require('./supportsMediaRecorder');\n\nconst CameraIcon = require('./CameraIcon');\n\nconst CameraScreen = require('./CameraScreen');\n\nconst PermissionsScreen = require('./PermissionsScreen');\n\nconst locale = require('./locale.js');\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\nfunction getMediaDevices() {\n // bug in the compatibility data\n // eslint-disable-next-line compat/compat\n return navigator.mediaDevices;\n}\n/**\n * Webcam\n */\n\n\nmodule.exports = (_temp = (_enableMirror = /*#__PURE__*/_classPrivateFieldLooseKey(\"enableMirror\"), _class = class Webcam extends UIPlugin {\n // eslint-disable-next-line global-require\n // enableMirror is used to toggle mirroring, for instance when discarding the video,\n // while `opts.mirror` is used to remember the initial user setting\n constructor(uppy, opts) {\n super(uppy, opts);\n Object.defineProperty(this, _enableMirror, {\n writable: true,\n value: void 0\n });\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.type = 'acquirer';\n this.capturedMediaFile = null;\n\n this.icon = () => 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 this.defaultLocale = locale; // set default options\n\n const defaultOptions = {\n onBeforeSnapshot: () => Promise.resolve(),\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 = { ...defaultOptions,\n ...opts\n };\n this.i18nInit();\n this.title = this.i18n('pluginNameCamera');\n _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror] = this.opts.mirror;\n this.install = this.install.bind(this);\n this.setPluginState = this.setPluginState.bind(this);\n this.render = this.render.bind(this); // Camera controls\n\n this.start = this.start.bind(this);\n this.stop = this.stop.bind(this);\n this.takeSnapshot = this.takeSnapshot.bind(this);\n this.startRecording = this.startRecording.bind(this);\n this.stopRecording = this.stopRecording.bind(this);\n this.discardRecordedVideo = this.discardRecordedVideo.bind(this);\n this.submit = this.submit.bind(this);\n this.oneTwoThreeSmile = this.oneTwoThreeSmile.bind(this);\n this.focus = this.focus.bind(this);\n this.changeVideoSource = this.changeVideoSource.bind(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\n setOptions(newOpts) {\n super.setOptions({ ...newOpts,\n videoConstraints: { // May be undefined but ... handles that\n ...this.opts.videoConstraints,\n ...(newOpts == null ? void 0 : newOpts.videoConstraints)\n }\n });\n }\n\n hasCameraCheck() {\n if (!this.mediaDevices) {\n return Promise.resolve(false);\n }\n\n return this.mediaDevices.enumerateDevices().then(devices => {\n return devices.some(device => device.kind === 'videoinput');\n });\n }\n\n isAudioOnly() {\n return this.opts.modes.length === 1 && this.opts.modes[0] === 'audio-only';\n }\n\n getConstraints(deviceId) {\n if (deviceId === void 0) {\n deviceId = null;\n }\n\n const acceptsAudio = this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('audio-only') !== -1;\n const acceptsVideo = !this.isAudioOnly() && (this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('video-only') !== -1 || this.opts.modes.indexOf('picture') !== -1);\n const videoConstraints = { ...(this.opts.videoConstraints || {\n facingMode: this.opts.facingMode\n }),\n // facingMode takes precedence over deviceId, and not needed\n // when specific device is selected\n ...(deviceId ? {\n 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 start(options) {\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\n if (this.opts.mirror) {\n _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror] = true;\n }\n\n const constraints = this.getConstraints(options && options.deviceId ? options.deviceId : null);\n this.hasCameraCheck().then(hasCamera => {\n this.setPluginState({\n hasCamera\n }); // ask user for access to their camera\n\n return this.mediaDevices.getUserMedia(constraints).then(stream => {\n this.stream = stream;\n let currentDeviceId = null;\n const tracks = this.isAudioOnly() ? stream.getAudioTracks() : stream.getVideoTracks();\n\n if (!options || !options.deviceId) {\n currentDeviceId = tracks[0].getSettings().deviceId;\n } else {\n tracks.forEach(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 this.updateVideoSources();\n this.setPluginState({\n currentDeviceId,\n cameraReady: true\n });\n }).catch(err => {\n this.setPluginState({\n cameraReady: false,\n cameraError: err\n });\n this.uppy.info(err.message, 'error');\n });\n });\n }\n /**\n * @returns {object}\n */\n\n\n getMediaRecorderOptions() {\n const 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 const {\n restrictions\n } = this.uppy.opts;\n let 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 const filterSupportedTypes = candidateType => MediaRecorder.isTypeSupported(candidateType) && getFileTypeExtension(candidateType);\n\n const 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 startRecording() {\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 let stoppingBecauseOfMaxSize = false;\n this.recorder.addEventListener('dataavailable', event => {\n this.recordingChunks.push(event.data);\n const {\n restrictions\n } = this.uppy.opts;\n\n if (this.recordingChunks.length > 1 && restrictions.maxFileSize != null && !stoppingBecauseOfMaxSize) {\n const totalSize = this.recordingChunks.reduce((acc, chunk) => acc + chunk.size, 0); // Exclude the initial chunk from the average size calculation because it is likely to be a very small outlier\n\n const averageChunkSize = (totalSize - this.recordingChunks[0].size) / (this.recordingChunks.length - 1);\n const expectedEndChunkSize = averageChunkSize * 3;\n const maxSize = Math.max(0, restrictions.maxFileSize - expectedEndChunkSize);\n\n if (totalSize > maxSize) {\n stoppingBecauseOfMaxSize = true;\n this.uppy.info(this.i18n('recordingStoppedMaxSize'), 'warning', 4000);\n this.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(() => {\n const currentRecordingLength = this.getPluginState().recordingLengthSeconds;\n this.setPluginState({\n recordingLengthSeconds: currentRecordingLength + 1\n });\n }, 1000);\n }\n\n this.setPluginState({\n isRecording: true\n });\n }\n\n stopRecording() {\n const stopped = new Promise(resolve => {\n this.recorder.addEventListener('stop', () => {\n resolve();\n });\n this.recorder.stop();\n\n if (this.opts.showRecordingLength) {\n // Stop the recordingLengthTimer if we are showing the recording length.\n clearInterval(this.recordingLengthTimer);\n this.setPluginState({\n recordingLengthSeconds: 0\n });\n }\n });\n return stopped.then(() => {\n this.setPluginState({\n isRecording: false\n });\n return this.getVideo();\n }).then(file => {\n try {\n this.capturedMediaFile = file; // create object url for capture result preview\n\n this.setPluginState({\n // eslint-disable-next-line compat/compat\n recordedVideo: URL.createObjectURL(file.data)\n });\n _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror] = false;\n } catch (err) {\n // Logging the error, exept restrictions, which is handled in Core\n if (!err.isRestriction) {\n this.uppy.log(err);\n }\n }\n }).then(() => {\n this.recordingChunks = null;\n this.recorder = null;\n }, error => {\n this.recordingChunks = null;\n this.recorder = null;\n throw error;\n });\n }\n\n discardRecordedVideo() {\n this.setPluginState({\n recordedVideo: null\n });\n\n if (this.opts.mirror) {\n _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror] = true;\n }\n\n this.capturedMediaFile = null;\n }\n\n 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 async stop() {\n if (this.stream) {\n const audioTracks = this.stream.getAudioTracks();\n const videoTracks = this.stream.getVideoTracks();\n audioTracks.concat(videoTracks).forEach(track => track.stop());\n }\n\n if (this.recorder) {\n await new Promise(resolve => {\n this.recorder.addEventListener('stop', resolve, {\n once: true\n });\n this.recorder.stop();\n\n if (this.opts.showRecordingLength) {\n clearInterval(this.recordingLengthTimer);\n }\n });\n }\n\n this.recordingChunks = null;\n this.recorder = null;\n this.webcamActive = false;\n this.stream = null;\n this.setPluginState({\n recordedVideo: null,\n isRecording: false,\n recordingLengthSeconds: 0\n });\n }\n\n getVideoElement() {\n return this.el.querySelector('.uppy-Webcam-video');\n }\n\n oneTwoThreeSmile() {\n return new Promise((resolve, reject) => {\n let count = this.opts.countdown; // eslint-disable-next-line consistent-return\n\n const countDown = setInterval(() => {\n if (!this.webcamActive) {\n clearInterval(countDown);\n this.captureInProgress = false;\n return reject(new Error('Webcam is not active'));\n }\n\n if (count > 0) {\n this.uppy.info(`${count}...`, 'warning', 800);\n count--;\n } else {\n clearInterval(countDown);\n this.uppy.info(this.i18n('smile'), 'success', 1500);\n setTimeout(() => resolve(), 1500);\n }\n }, 1000);\n });\n }\n\n takeSnapshot() {\n if (this.captureInProgress) return;\n this.captureInProgress = true;\n this.opts.onBeforeSnapshot().catch(err => {\n const message = typeof err === 'object' ? err.message : err;\n this.uppy.info(message, 'error', 5000);\n return Promise.reject(new Error(`onBeforeSnapshot: ${message}`));\n }).then(() => {\n return this.getImage();\n }).then(tagFile => {\n this.captureInProgress = false;\n\n try {\n this.uppy.addFile(tagFile);\n } catch (err) {\n // Logging the error, except restrictions, which is handled in Core\n if (!err.isRestriction) {\n this.uppy.log(err);\n }\n }\n }, error => {\n this.captureInProgress = false;\n throw error;\n });\n }\n\n getImage() {\n const 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 const width = video.videoWidth;\n const height = video.videoHeight;\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(video, 0, 0);\n const {\n restrictions\n } = this.uppy.opts;\n let 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 const mimeType = preferredImageMimeTypes[0] || 'image/jpeg';\n const ext = getFileTypeExtension(mimeType) || 'jpg';\n const name = `cam-${Date.now()}.${ext}`;\n return canvasToBlob(canvas, mimeType).then(blob => {\n return {\n source: this.id,\n name,\n data: new Blob([blob], {\n type: mimeType\n }),\n type: mimeType\n };\n });\n }\n\n 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 const mimeType = this.recordingChunks.find(blob => {\n var _blob$type;\n\n return ((_blob$type = blob.type) == null ? void 0 : _blob$type.length) > 0;\n }).type;\n const fileExtension = getFileTypeExtension(mimeType);\n\n if (!fileExtension) {\n return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type \"${mimeType}\"`));\n }\n\n const name = `webcam-${Date.now()}.${fileExtension}`;\n const blob = new Blob(this.recordingChunks, {\n type: mimeType\n });\n const file = {\n source: this.id,\n name,\n data: new Blob([blob], {\n type: mimeType\n }),\n type: mimeType\n };\n return Promise.resolve(file);\n }\n\n focus() {\n if (!this.opts.countdown) return;\n setTimeout(() => {\n this.uppy.info(this.i18n('smile'), 'success', 1500);\n }, 1000);\n }\n\n changeVideoSource(deviceId) {\n this.stop();\n this.start({\n deviceId\n });\n }\n\n updateVideoSources() {\n this.mediaDevices.enumerateDevices().then(devices => {\n this.setPluginState({\n videoSources: devices.filter(device => device.kind === 'videoinput')\n });\n });\n }\n\n render() {\n if (!this.webcamActive) {\n this.start();\n }\n\n const 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: _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror],\n src: this.stream\n }));\n }\n\n install() {\n this.setPluginState({\n cameraReady: false,\n recordingLengthSeconds: 0\n });\n const {\n target\n } = this.opts;\n\n if (target) {\n this.mount(target, this);\n }\n\n if (this.mediaDevices) {\n this.updateVideoSources();\n\n this.mediaDevices.ondevicechange = () => {\n this.updateVideoSources();\n\n if (this.stream) {\n let restartStream = true;\n const {\n videoSources,\n currentDeviceId\n } = this.getPluginState();\n videoSources.forEach(videoSource => {\n if (currentDeviceId === videoSource.deviceId) {\n restartStream = false;\n }\n });\n\n if (restartStream) {\n this.stop();\n this.start();\n }\n }\n };\n }\n }\n\n uninstall() {\n this.stop();\n this.unmount();\n }\n\n onUnmount() {\n this.stop();\n }\n\n}), _class.VERSION = \"2.0.5\", _temp);"],"sourceRoot":""}
1
+ {"version":3,"sources":["../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/get.js","../../../node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/superPropBase.js","../../../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/locale.js","../../../node_modules/@uppy/webcam/lib/index.js"],"names":["superPropBase","_get","target","property","receiver","Reflect","get","module","exports","base","desc","Object","getOwnPropertyDescriptor","call","value","getPrototypeOf","object","prototype","hasOwnProperty","h","require","focusable","fill","width","height","viewBox","d","fillRule","mimeToExtensions","mimeType","split","canvas","type","quality","Promise","resolve","toBlob","MediaRecorder","start","_extends","assign","i","arguments","length","source","key","apply","this","Component","SnapshotButton","RecordButton","RecordingLength","VideoSourceSelect","SubmitButton","DiscardButton","isModeAvailable","modes","mode","indexOf","CameraScreen","onFocus","props","onStop","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","map","videoSource","deviceId","selected","label","xmlns","icon","hasCamera","strings","pluginNameCamera","noCameraTitle","noCameraDescription","recordingStoppedMaxSize","submitRecordedFile","discardRecordedFile","smile","takePicture","startRecording","stopRecording","recordingLength","allowAccessTitle","allowAccessDescription","_class","_enableMirror","_temp","_classPrivateFieldLooseBase","privateKey","TypeError","id","_classPrivateFieldLooseKey","name","UIPlugin","getFileTypeExtension","mimeTypes","canvasToBlob","supportsMediaRecorder","PermissionsScreen","locale","toMimeType","fileType","slice","isVideoMimeType","test","isImageMimeType","uppy","opts","defineProperty","writable","mediaDevices","navigator","supportsUserMedia","protocol","location","match","capturedMediaFile","rx","defaultLocale","defaultOptions","onBeforeSnapshot","countdown","facingMode","preferredImageMimeType","preferredVideoMimeType","i18nInit","install","bind","setPluginState","render","stop","takeSnapshot","discardRecordedVideo","submit","oneTwoThreeSmile","focus","changeVideoSource","webcamActive","cameraReady","cameraError","newOpts","videoConstraints","enumerateDevices","then","devices","some","device","kind","acceptsAudio","acceptsVideo","isAudioOnly","audio","video","options","reject","Error","constraints","getConstraints","hasCameraCheck","getUserMedia","stream","tracks","getAudioTracks","getVideoTracks","forEach","track","getSettings","updateVideoSources","err","info","message","isTypeSupported","restrictions","preferredVideoMimeTypes","allowedFileTypes","filter","acceptableMimeTypes","candidateType","recorder","getMediaRecorderOptions","recordingChunks","stoppingBecauseOfMaxSize","addEventListener","push","data","maxFileSize","totalSize","reduce","acc","chunk","size","expectedEndChunkSize","max","recordingLengthTimer","setInterval","currentRecordingLength","getPluginState","isRecording","clearInterval","getVideo","file","URL","createObjectURL","isRestriction","log","error","addFile","audioTracks","videoTracks","concat","once","el","querySelector","count","countDown","captureInProgress","setTimeout","getImage","tagFile","getVideoElement","videoWidth","videoHeight","document","createElement","getContext","drawImage","preferredImageMimeTypes","ext","Date","now","blob","Blob","find","_blob$type","fileExtension","webcamState","mount","ondevicechange","restartStream","unmount","VERSION"],"mappings":"2HAAA,IAAIA,EAAgB,EAAQ,KAE5B,SAASC,EAAKC,EAAQC,EAAUC,GAiB9B,MAhBuB,qBAAZC,SAA2BA,QAAQC,IAC5CC,EAAOC,QAAUP,EAAOI,QAAQC,IAEhCC,EAAOC,QAAUP,EAAO,SAAcC,EAAQC,EAAUC,GACtD,IAAIK,EAAOT,EAAcE,EAAQC,GACjC,GAAKM,EAAL,CACA,IAAIC,EAAOC,OAAOC,yBAAyBH,EAAMN,GAEjD,OAAIO,EAAKJ,IACAI,EAAKJ,IAAIO,KAAKT,GAGhBM,EAAKI,QAITb,EAAKC,EAAQC,EAAUC,GAAYF,GAG5CK,EAAOC,QAAUP,G,oBCtBjB,IAAIc,EAAiB,EAAQ,KAW7BR,EAAOC,QATP,S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tL,EADF,EACEA,aACA4C,EAFF,EAEEA,gBAEF5C,EAAasJ,SAAQ,SAAArG,GACfL,IAAoBK,EAAYC,WAClC8K,GAAgB,MAIhBA,IACF,EAAK5G,OACL,EAAKjJ,cArkByF,uBA4kBxG,WACES,KAAKwI,OACLxI,KAAKqP,YA9kBiG,uBAilBxG,WACErP,KAAKwI,WAllBiG,GAAwBrC,GAqlB9HT,EAAO4J,QAAU,QAAS1J","file":"static/js/5.5555a5fa.chunk.js","sourcesContent":["var superPropBase = require(\"./superPropBase\");\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nmodule.exports = _get;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nmodule.exports = _superPropBase;","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nmodule.exports = () => {\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};","\"use strict\";\n\nconst 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 // eslint-disable-next-line no-param-reassign\n [mimeType] = mimeType.split(';', 1);\n return mimeToExtensions[mimeType] || null;\n};","\"use strict\";\n\n/**\n * Save a <canvas> element's content to a Blob object.\n *\n * @param {HTMLCanvasElement} canvas\n * @returns {Promise}\n */\nmodule.exports = function canvasToBlob(canvas, type, quality) {\n return new Promise(resolve => {\n canvas.toBlob(resolve, type, quality);\n });\n};","\"use strict\";\n\nmodule.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};","\"use strict\";\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\n/* eslint-disable jsx-a11y/media-has-caption */\nconst {\n h,\n Component\n} = require('preact');\n\nconst SnapshotButton = require('./SnapshotButton');\n\nconst RecordButton = require('./RecordButton');\n\nconst RecordingLength = require('./RecordingLength');\n\nconst VideoSourceSelect = require('./VideoSourceSelect');\n\nconst SubmitButton = require('./SubmitButton');\n\nconst DiscardButton = require('./DiscardButton');\n\nfunction isModeAvailable(modes, mode) {\n return modes.indexOf(mode) !== -1;\n}\n\nclass CameraScreen extends Component {\n componentDidMount() {\n const {\n onFocus\n } = this.props;\n onFocus();\n }\n\n componentWillUnmount() {\n const {\n onStop\n } = this.props;\n onStop();\n }\n\n render() {\n const {\n src,\n recordedVideo,\n recording,\n modes,\n supportsRecording,\n videoSources,\n showVideoSourceDropdown,\n showRecordingLength,\n onSubmit,\n i18n,\n mirror,\n onSnapshot,\n onStartRecording,\n onStopRecording,\n onDiscardRecordedVideo,\n recordingLengthSeconds\n } = this.props;\n const hasRecordedVideo = !!recordedVideo;\n const shouldShowRecordButton = !hasRecordedVideo && supportsRecording && (isModeAvailable(modes, 'video-only') || isModeAvailable(modes, 'audio-only') || isModeAvailable(modes, 'video-audio'));\n const shouldShowSnapshotButton = !hasRecordedVideo && isModeAvailable(modes, 'picture');\n const shouldShowRecordingLength = supportsRecording && showRecordingLength && !hasRecordedVideo;\n const shouldShowVideoSourceDropdown = showVideoSourceDropdown && videoSources && videoSources.length > 1;\n const 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: videoElement => this.videoElement = videoElement,\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 })), h(\"div\", {\n className: \"uppy-Webcam-recordingLength\"\n }, shouldShowRecordingLength && h(RecordingLength, {\n recordingLengthSeconds: recordingLengthSeconds,\n i18n: i18n\n }))));\n }\n\n}\n\nmodule.exports = CameraScreen;","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nconst CameraIcon = require('./CameraIcon');\n\nmodule.exports = _ref => {\n let {\n onSnapshot,\n i18n\n } = _ref;\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};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nmodule.exports = function RecordButton(_ref) {\n let {\n recording,\n onStartRecording,\n onStopRecording,\n i18n\n } = _ref;\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};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nconst formatSeconds = require('./formatSeconds');\n\nmodule.exports = function RecordingLength(_ref) {\n let {\n recordingLengthSeconds,\n i18n\n } = _ref;\n const formattedRecordingLengthSeconds = formatSeconds(recordingLengthSeconds);\n return h(\"span\", {\n \"aria-label\": i18n('recordingLength', {\n recording_length: formattedRecordingLengthSeconds\n })\n }, formattedRecordingLengthSeconds);\n};","\"use strict\";\n\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};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nmodule.exports = _ref => {\n let {\n currentDeviceId,\n videoSources,\n onChangeVideoSource\n } = _ref;\n return h(\"div\", {\n className: \"uppy-Webcam-videoSource\"\n }, h(\"select\", {\n className: \"uppy-u-reset uppy-Webcam-videoSource-select\",\n onChange: event => {\n onChangeVideoSource(event.target.value);\n }\n }, videoSources.map(videoSource => h(\"option\", {\n key: videoSource.deviceId,\n value: videoSource.deviceId,\n selected: videoSource.deviceId === currentDeviceId\n }, videoSource.label))));\n};","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nfunction SubmitButton(_ref) {\n let {\n onSubmit,\n i18n\n } = _ref;\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;","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nfunction DiscardButton(_ref) {\n let {\n onDiscard,\n i18n\n } = _ref;\n return h(\"button\", {\n className: \"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard\",\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;","\"use strict\";\n\nconst {\n h\n} = require('preact');\n\nmodule.exports = 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};","\"use strict\";\n\nmodule.exports = {\n strings: {\n pluginNameCamera: 'Camera',\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 submitRecordedFile: 'Submit recorded file',\n discardRecordedFile: 'Discard recorded file',\n // Shown before a picture is taken when the `countdown` option is set.\n smile: 'Smile!',\n // Used as the label for the button that takes a picture.\n // This is not visibly rendered but is picked up by screen readers.\n takePicture: 'Take a picture',\n // Used as the label for the button that starts a video recording.\n // This is not visibly rendered but is picked up by screen readers.\n startRecording: 'Begin video recording',\n // Used as the label for the button that stops a video recording.\n // This is not visibly rendered but is picked up by screen readers.\n stopRecording: 'Stop video recording',\n // Used as the label for the recording length counter. See the showRecordingLength option.\n // This is not visibly rendered but is picked up by screen readers.\n recordingLength: 'Recording length %{recording_length}',\n // Title on the “allow access” screen\n allowAccessTitle: 'Please allow access to your camera',\n // Description on the “allow access” screen\n allowAccessDescription: 'In order to take pictures or record video with your camera, please allow camera access for this site.'\n }\n};","\"use strict\";\n\nvar _class, _enableMirror, _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 _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError(\"attempted to use private field on non-instance\"); } return receiver; }\n\nvar id = 0;\n\nfunction _classPrivateFieldLooseKey(name) { return \"__private_\" + id++ + \"_\" + name; }\n\nconst {\n h\n} = require('preact');\n\nconst {\n UIPlugin\n} = require('@uppy/core');\n\nconst getFileTypeExtension = require('@uppy/utils/lib/getFileTypeExtension');\n\nconst mimeTypes = require('@uppy/utils/lib/mimeTypes');\n\nconst canvasToBlob = require('@uppy/utils/lib/canvasToBlob');\n\nconst supportsMediaRecorder = require('./supportsMediaRecorder');\n\nconst CameraIcon = require('./CameraIcon');\n\nconst CameraScreen = require('./CameraScreen');\n\nconst PermissionsScreen = require('./PermissionsScreen');\n\nconst locale = require('./locale.js');\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\nfunction getMediaDevices() {\n // bug in the compatibility data\n // eslint-disable-next-line compat/compat\n return navigator.mediaDevices;\n}\n/**\n * Webcam\n */\n\n\nmodule.exports = (_temp = (_enableMirror = /*#__PURE__*/_classPrivateFieldLooseKey(\"enableMirror\"), _class = class Webcam extends UIPlugin {\n // eslint-disable-next-line global-require\n // enableMirror is used to toggle mirroring, for instance when discarding the video,\n // while `opts.mirror` is used to remember the initial user setting\n constructor(uppy, opts) {\n super(uppy, opts);\n Object.defineProperty(this, _enableMirror, {\n writable: true,\n value: void 0\n });\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.type = 'acquirer';\n this.capturedMediaFile = null;\n\n this.icon = () => 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 this.defaultLocale = locale; // set default options\n\n const defaultOptions = {\n onBeforeSnapshot: () => Promise.resolve(),\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 = { ...defaultOptions,\n ...opts\n };\n this.i18nInit();\n this.title = this.i18n('pluginNameCamera');\n _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror] = this.opts.mirror;\n this.install = this.install.bind(this);\n this.setPluginState = this.setPluginState.bind(this);\n this.render = this.render.bind(this); // Camera controls\n\n this.start = this.start.bind(this);\n this.stop = this.stop.bind(this);\n this.takeSnapshot = this.takeSnapshot.bind(this);\n this.startRecording = this.startRecording.bind(this);\n this.stopRecording = this.stopRecording.bind(this);\n this.discardRecordedVideo = this.discardRecordedVideo.bind(this);\n this.submit = this.submit.bind(this);\n this.oneTwoThreeSmile = this.oneTwoThreeSmile.bind(this);\n this.focus = this.focus.bind(this);\n this.changeVideoSource = this.changeVideoSource.bind(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\n setOptions(newOpts) {\n super.setOptions({ ...newOpts,\n videoConstraints: { // May be undefined but ... handles that\n ...this.opts.videoConstraints,\n ...(newOpts == null ? void 0 : newOpts.videoConstraints)\n }\n });\n }\n\n hasCameraCheck() {\n if (!this.mediaDevices) {\n return Promise.resolve(false);\n }\n\n return this.mediaDevices.enumerateDevices().then(devices => {\n return devices.some(device => device.kind === 'videoinput');\n });\n }\n\n isAudioOnly() {\n return this.opts.modes.length === 1 && this.opts.modes[0] === 'audio-only';\n }\n\n getConstraints(deviceId) {\n if (deviceId === void 0) {\n deviceId = null;\n }\n\n const acceptsAudio = this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('audio-only') !== -1;\n const acceptsVideo = !this.isAudioOnly() && (this.opts.modes.indexOf('video-audio') !== -1 || this.opts.modes.indexOf('video-only') !== -1 || this.opts.modes.indexOf('picture') !== -1);\n const videoConstraints = { ...(this.opts.videoConstraints || {\n facingMode: this.opts.facingMode\n }),\n // facingMode takes precedence over deviceId, and not needed\n // when specific device is selected\n ...(deviceId ? {\n 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 start(options) {\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\n if (this.opts.mirror) {\n _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror] = true;\n }\n\n const constraints = this.getConstraints(options && options.deviceId ? options.deviceId : null);\n this.hasCameraCheck().then(hasCamera => {\n this.setPluginState({\n hasCamera\n }); // ask user for access to their camera\n\n return this.mediaDevices.getUserMedia(constraints).then(stream => {\n this.stream = stream;\n let currentDeviceId = null;\n const tracks = this.isAudioOnly() ? stream.getAudioTracks() : stream.getVideoTracks();\n\n if (!options || !options.deviceId) {\n currentDeviceId = tracks[0].getSettings().deviceId;\n } else {\n tracks.forEach(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 this.updateVideoSources();\n this.setPluginState({\n currentDeviceId,\n cameraReady: true\n });\n }).catch(err => {\n this.setPluginState({\n cameraReady: false,\n cameraError: err\n });\n this.uppy.info(err.message, 'error');\n });\n });\n }\n /**\n * @returns {object}\n */\n\n\n getMediaRecorderOptions() {\n const 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 const {\n restrictions\n } = this.uppy.opts;\n let 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 const filterSupportedTypes = candidateType => MediaRecorder.isTypeSupported(candidateType) && getFileTypeExtension(candidateType);\n\n const 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 startRecording() {\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 let stoppingBecauseOfMaxSize = false;\n this.recorder.addEventListener('dataavailable', event => {\n this.recordingChunks.push(event.data);\n const {\n restrictions\n } = this.uppy.opts;\n\n if (this.recordingChunks.length > 1 && restrictions.maxFileSize != null && !stoppingBecauseOfMaxSize) {\n const totalSize = this.recordingChunks.reduce((acc, chunk) => acc + chunk.size, 0); // Exclude the initial chunk from the average size calculation because it is likely to be a very small outlier\n\n const averageChunkSize = (totalSize - this.recordingChunks[0].size) / (this.recordingChunks.length - 1);\n const expectedEndChunkSize = averageChunkSize * 3;\n const maxSize = Math.max(0, restrictions.maxFileSize - expectedEndChunkSize);\n\n if (totalSize > maxSize) {\n stoppingBecauseOfMaxSize = true;\n this.uppy.info(this.i18n('recordingStoppedMaxSize'), 'warning', 4000);\n this.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(() => {\n const currentRecordingLength = this.getPluginState().recordingLengthSeconds;\n this.setPluginState({\n recordingLengthSeconds: currentRecordingLength + 1\n });\n }, 1000);\n }\n\n this.setPluginState({\n isRecording: true\n });\n }\n\n stopRecording() {\n const stopped = new Promise(resolve => {\n this.recorder.addEventListener('stop', () => {\n resolve();\n });\n this.recorder.stop();\n\n if (this.opts.showRecordingLength) {\n // Stop the recordingLengthTimer if we are showing the recording length.\n clearInterval(this.recordingLengthTimer);\n this.setPluginState({\n recordingLengthSeconds: 0\n });\n }\n });\n return stopped.then(() => {\n this.setPluginState({\n isRecording: false\n });\n return this.getVideo();\n }).then(file => {\n try {\n this.capturedMediaFile = file; // create object url for capture result preview\n\n this.setPluginState({\n // eslint-disable-next-line compat/compat\n recordedVideo: URL.createObjectURL(file.data)\n });\n _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror] = false;\n } catch (err) {\n // Logging the error, exept restrictions, which is handled in Core\n if (!err.isRestriction) {\n this.uppy.log(err);\n }\n }\n }).then(() => {\n this.recordingChunks = null;\n this.recorder = null;\n }, error => {\n this.recordingChunks = null;\n this.recorder = null;\n throw error;\n });\n }\n\n discardRecordedVideo() {\n this.setPluginState({\n recordedVideo: null\n });\n\n if (this.opts.mirror) {\n _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror] = true;\n }\n\n this.capturedMediaFile = null;\n }\n\n 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 async stop() {\n if (this.stream) {\n const audioTracks = this.stream.getAudioTracks();\n const videoTracks = this.stream.getVideoTracks();\n audioTracks.concat(videoTracks).forEach(track => track.stop());\n }\n\n if (this.recorder) {\n await new Promise(resolve => {\n this.recorder.addEventListener('stop', resolve, {\n once: true\n });\n this.recorder.stop();\n\n if (this.opts.showRecordingLength) {\n clearInterval(this.recordingLengthTimer);\n }\n });\n }\n\n this.recordingChunks = null;\n this.recorder = null;\n this.webcamActive = false;\n this.stream = null;\n this.setPluginState({\n recordedVideo: null,\n isRecording: false,\n recordingLengthSeconds: 0\n });\n }\n\n getVideoElement() {\n return this.el.querySelector('.uppy-Webcam-video');\n }\n\n oneTwoThreeSmile() {\n return new Promise((resolve, reject) => {\n let count = this.opts.countdown; // eslint-disable-next-line consistent-return\n\n const countDown = setInterval(() => {\n if (!this.webcamActive) {\n clearInterval(countDown);\n this.captureInProgress = false;\n return reject(new Error('Webcam is not active'));\n }\n\n if (count > 0) {\n this.uppy.info(`${count}...`, 'warning', 800);\n count--;\n } else {\n clearInterval(countDown);\n this.uppy.info(this.i18n('smile'), 'success', 1500);\n setTimeout(() => resolve(), 1500);\n }\n }, 1000);\n });\n }\n\n takeSnapshot() {\n if (this.captureInProgress) return;\n this.captureInProgress = true;\n this.opts.onBeforeSnapshot().catch(err => {\n const message = typeof err === 'object' ? err.message : err;\n this.uppy.info(message, 'error', 5000);\n return Promise.reject(new Error(`onBeforeSnapshot: ${message}`));\n }).then(() => {\n return this.getImage();\n }).then(tagFile => {\n this.captureInProgress = false;\n\n try {\n this.uppy.addFile(tagFile);\n } catch (err) {\n // Logging the error, except restrictions, which is handled in Core\n if (!err.isRestriction) {\n this.uppy.log(err);\n }\n }\n }, error => {\n this.captureInProgress = false;\n throw error;\n });\n }\n\n getImage() {\n const 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 const width = video.videoWidth;\n const height = video.videoHeight;\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(video, 0, 0);\n const {\n restrictions\n } = this.uppy.opts;\n let 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 const mimeType = preferredImageMimeTypes[0] || 'image/jpeg';\n const ext = getFileTypeExtension(mimeType) || 'jpg';\n const name = `cam-${Date.now()}.${ext}`;\n return canvasToBlob(canvas, mimeType).then(blob => {\n return {\n source: this.id,\n name,\n data: new Blob([blob], {\n type: mimeType\n }),\n type: mimeType\n };\n });\n }\n\n 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 const mimeType = this.recordingChunks.find(blob => {\n var _blob$type;\n\n return ((_blob$type = blob.type) == null ? void 0 : _blob$type.length) > 0;\n }).type;\n const fileExtension = getFileTypeExtension(mimeType);\n\n if (!fileExtension) {\n return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type \"${mimeType}\"`));\n }\n\n const name = `webcam-${Date.now()}.${fileExtension}`;\n const blob = new Blob(this.recordingChunks, {\n type: mimeType\n });\n const file = {\n source: this.id,\n name,\n data: new Blob([blob], {\n type: mimeType\n }),\n type: mimeType\n };\n return Promise.resolve(file);\n }\n\n focus() {\n if (!this.opts.countdown) return;\n setTimeout(() => {\n this.uppy.info(this.i18n('smile'), 'success', 1500);\n }, 1000);\n }\n\n changeVideoSource(deviceId) {\n this.stop();\n this.start({\n deviceId\n });\n }\n\n updateVideoSources() {\n this.mediaDevices.enumerateDevices().then(devices => {\n this.setPluginState({\n videoSources: devices.filter(device => device.kind === 'videoinput')\n });\n });\n }\n\n render() {\n if (!this.webcamActive) {\n this.start();\n }\n\n const 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: _classPrivateFieldLooseBase(this, _enableMirror)[_enableMirror],\n src: this.stream\n }));\n }\n\n install() {\n this.setPluginState({\n cameraReady: false,\n recordingLengthSeconds: 0\n });\n const {\n target\n } = this.opts;\n\n if (target) {\n this.mount(target, this);\n }\n\n if (this.mediaDevices) {\n this.updateVideoSources();\n\n this.mediaDevices.ondevicechange = () => {\n this.updateVideoSources();\n\n if (this.stream) {\n let restartStream = true;\n const {\n videoSources,\n currentDeviceId\n } = this.getPluginState();\n videoSources.forEach(videoSource => {\n if (currentDeviceId === videoSource.deviceId) {\n restartStream = false;\n }\n });\n\n if (restartStream) {\n this.stop();\n this.start();\n }\n }\n };\n }\n }\n\n uninstall() {\n this.stop();\n this.unmount();\n }\n\n onUnmount() {\n this.stop();\n }\n\n}), _class.VERSION = \"2.0.5\", _temp);"],"sourceRoot":""}