\n );\n};\n\nexport default ServiceContainer;\n","import React from 'react';\nimport { Button, Link } from 'carbon-components-react';\nimport { default as Api124 } from '@carbon/icons-react/lib/API--1/24';\nimport Document24 from '@carbon/icons-react/lib/document/24';\nimport IbmCloud24 from '@carbon/icons-react/lib/ibm-cloud/24';\nimport Launch16 from '@carbon/icons-react/lib/launch/16';\nimport LogoGithub24 from '@carbon/icons-react/lib/logo--github/24';\nimport Header from './components/Header';\nimport ServiceContainer from './components/ServiceContainer';\n\nconst HEADER_TITLE = 'Watson Speech to Text';\nconst HEADER_DESCRIPTION =\n 'IBM Watson Speech to Text is a cloud-native API that transforms voice into written text.';\nconst HEADER_LINKS = [\n \n
\n);\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' }\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './styles/main.scss';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/build/static/js/main.a33677a6.chunk.js b/build/static/js/main.e75e603b.chunk.js
similarity index 59%
rename from build/static/js/main.a33677a6.chunk.js
rename to build/static/js/main.e75e603b.chunk.js
index 73e97fa..45f6475 100644
--- a/build/static/js/main.a33677a6.chunk.js
+++ b/build/static/js/main.e75e603b.chunk.js
@@ -1,2 +1,2 @@
-(this["webpackJsonp@ibm-watson/speech-to-text-code-pattern"]=this["webpackJsonp@ibm-watson/speech-to-text-code-pattern"]||[]).push([[0],{100:function(e,a){},102:function(e,a){},111:function(e,a){},113:function(e,a){},150:function(e,a){},152:function(e,a){},158:function(e,a,t){"use strict";t.r(a);var r=t(0),n=t.n(r),o=t(74),s=t.n(o),i=(t(92),t(168)),l=t(159),d=t(79),u=t.n(d),c=t(80),p=t.n(c),m=t(83),f=t.n(m),g=t(82),b=t.n(g),_=t(81),h=t.n(_),w=t(162),v=function(e){var a=e.description,t=e.links,r=e.title;return n.a.createElement(w.a,{className:"header"},n.a.createElement("div",{className:"title-container"},n.a.createElement("h2",{className:"header-title"},r),n.a.createElement("p",null,a)),n.a.createElement("div",{className:"link-container"},n.a.createElement("div",{className:"link-wrapper"},t.map((function(e){return e})))))};v.defaultProps={description:"",links:[],title:""};var y=v,k=t(8),S=t(4),E=t.n(S),x=t(10),N=t(47),C=t.n(N),P=t(75),R=t.n(P),B=t(163),A=t(169),M=t(164),T=t(165),I=t(170),D=t(46),O=t.n(D),U=t(27),z=function(e){var a=e.isRecording,t=e.isSamplePlaying,o=e.isUploadPlaying,s=e.keywordText,i=e.modelName,d=e.onError,u=e.onStartPlayingFileUpload,c=e.onStopPlayingFileUpload,p=e.onStartPlayingSample,m=e.onStopPlayingSample,f=e.onStartRecording,g=e.onStopRecording,b=e.useSpeakerLabels,_=Object(r.useState)([]),h=Object(x.a)(_,2),w=h[0],v=h[1];Object(r.useEffect)((function(){var e=[];s.length>0&&(e=s.split(",").map((function(e){return e.trim()}))),v(e)}),[s]);var y=U.find((function(e){return e.name===i})),S=y?y.filename:null,N=function(){var e,a,t,r;return E.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,E.a.awrap(O()("/api/auth"));case 2:return e=n.sent,n.next=5,E.a.awrap(e.json());case 5:if(a=n.sent,e.ok){n.next=9;break}return d(a),n.abrupt("return",{error:a});case 9:return t={},r=w.map((function(e){return e.toLowerCase()})),t=Object(k.a)({},t,{url:a.url||void 0,accessToken:a.accessToken,format:!0,keywords:w.length>0?r:void 0,keywordsThreshold:w.length>0?.01:void 0,model:i,objectMode:!0,play:!0,realtime:!0,resultsBySpeaker:b,speakerlessInterim:!0,timestamps:!0}),n.abrupt("return",t);case 13:case"end":return n.stop()}}))},C=function(){var e;return E.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,E.a.awrap(N());case 2:return e=a.sent,a.abrupt("return",Object(k.a)({},e,{file:"audio/".concat(S)}));case 4:case"end":return a.stop()}}))},P=function(){var e;return E.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,E.a.awrap(N());case 2:return e=a.sent,a.abrupt("return",Object(k.a)({},e,{resultsBySpeaker:!1}));case 4:case"end":return a.stop()}}))},R=function(e){var a;return E.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,E.a.awrap(N());case 2:return a=t.sent,t.abrupt("return",Object(k.a)({},a,{file:e,resultsBySpeaker:!1}));case 4:case"end":return t.stop()}}))};return n.a.createElement("div",{className:"submit-container"},t?n.a.createElement(l.a,{className:"submit-button",kind:"tertiary",onClick:m},"Stop audio sample"):n.a.createElement(l.a,{className:"submit-button",disabled:!i,kind:"tertiary",onClick:function(){var e;return E.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,E.a.awrap(C());case 2:(e=a.sent).error||p(e);case 4:case"end":return a.stop()}}))}},"Play audio sample"),a?n.a.createElement(l.a,{className:"submit-button",kind:"tertiary",onClick:g},"Stop recording"):n.a.createElement(l.a,{className:"submit-button",disabled:!i,kind:"tertiary",onClick:function(){var e;return E.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,E.a.awrap(P());case 2:(e=a.sent).error||f(e);case 4:case"end":return a.stop()}}))}},"Record your own"),o?n.a.createElement(l.a,{className:"submit-button",kind:"tertiary",onClick:c},"Stop playing"):n.a.createElement(I.a,{accept:["audio/wav","audio/mpeg","audio/flac","audio/opus"],buttonKind:"tertiary",className:"submit-button",disabled:!i,disableLabelChanges:!0,labelText:"Upload file",onChange:function(e){var a,t;return E.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return a=e.currentTarget.files[0],r.next=3,E.a.awrap(R(a));case 3:(t=r.sent).error||u(t);case 5:case"end":return r.stop()}}))}}))};z.defaultProps={isRecording:!1,isSamplePlaying:!1,isUploadPlaying:!1,keywordText:"",modelName:null,onError:function(){},onStartPlayingFileUpload:function(){},onStopPlayingFileUpload:function(){},onStartPlayingSample:function(){},onStopPlayingSample:function(){},onStartRecording:function(){},onStopRecording:function(){},useSpeakerLabels:!1};var j=z,W=function(e){var a=e.isRecording,t=e.isSamplePlaying,o=e.isUploadPlaying,s=e.onError,i=e.onSelectNewModel,l=e.onStartPlayingFileUpload,d=e.onStopPlayingFileUpload,u=e.onStartPlayingSample,c=e.onStopPlayingSample,p=e.onStartRecording,m=e.onStopRecording,f=U.map((function(e){return{id:e.name,label:e.description,supportsSpeakerLabels:e.supported_features.speaker_labels}})),g=Object(r.useState)(f[0]),b=Object(x.a)(g,2),_=b[0],h=b[1],v=Object(r.useState)(U[0].keywords),y=Object(x.a)(v,2),k=y[0],S=y[1],E=Object(r.useState)(!1),N=Object(x.a)(E,2),C=N[0],P=N[1];return n.a.createElement(w.a,{className:"control-container"},n.a.createElement("h3",{className:"container-title"},"Input"),n.a.createElement(B.a,{legendText:"Language model"},n.a.createElement(A.a,{id:"language-model-dropdown",label:"Select a language model",onChange:function(e){h(e.selectedItem);var a=U.find((function(a){return a.name===e.selectedItem.id})).keywords;S(a),C&&!e.selectedItem.supportsSpeakerLabels&&P(!1),i()},items:f,selectedItem:_&&_.label,defaultText:"Select a language model",ariaLabel:"Language selection dropdown",light:!0})),n.a.createElement(B.a,{legendText:"Keywords to spot"},n.a.createElement(M.a,{id:"custom-keyword-input",labelText:"Custom language keyword input",placeholder:"Enter custom language keywords",hideLabel:!0,invalidText:"Invalid keywords provided",value:k,onChange:function(e){S(e.target.value)},light:!0})),n.a.createElement(B.a,{legendText:"Detect multiple speakers (only supported with sample audio)"},n.a.createElement(T.a,{id:"speaker-label-toggle","aria-label":"Speaker label toggle",disabled:!_||!_.supportsSpeakerLabels,toggled:C,onToggle:function(){P(!C)}})),n.a.createElement(j,{isRecording:a,isSamplePlaying:t,isUploadPlaying:o,keywordText:k,modelName:_&&_.id,onError:s,onStartPlayingFileUpload:l,onStopPlayingFileUpload:d,onStartPlayingSample:u,onStopPlayingSample:c,onStartRecording:p,onStopRecording:m,useSpeakerLabels:C}))};W.defaultProps={isRecording:!1,isSamplePlaying:!1,isUploadPlaying:!1,onError:function(){},onSelectNewModel:function(){},onStartPlayingFileUpload:function(){},onStopPlayingFileUpload:function(){},onStartPlayingSample:function(){},onStopPlayingSample:function(){},onStartRecording:function(){},onStopRecording:function(){}};var F=W,L=t(76),G=t(77),K=t(85),J=t(78),X=t(36),q=t(84),Y=function(e){function a(e){var t;return Object(L.a)(this,a),(t=Object(K.a)(this,Object(J.a)(a).call(this,e))).audioWaveCanvasRef=n.a.createRef(),t.audioWaveCanvasCtx=null,t.animationFrameId=null,t.draw=t.draw.bind(Object(X.a)(t)),t.state={startingTimestamp:0,microphoneData:new Uint8Array(1024)},t}return Object(q.a)(a,e),Object(G.a)(a,[{key:"componentDidMount",value:function(){this.audioWaveCanvasCtx=this.audioWaveCanvasRef.current.getContext("2d"),this.audioWaveCanvasCtx.lineCap="round",this.initializeCanvasDimensions()}},{key:"componentDidUpdate",value:function(e){Object(x.a)(e.data,1)[0]!==Object(x.a)(this.props.data,1)[0]&&this.drawInitialAudioWave(),!1===e.isTranscribing&&!0===this.props.isTranscribing?(this.setStartingTimestamp(),this.draw()):!0===e.isTranscribing&&!1===this.props.isTranscribing&&this.stopDrawing()}},{key:"setStartingTimestamp",value:function(){this.setState({startingTimestamp:Date.now()})}},{key:"initializeCanvasDimensions",value:function(){var e=this.audioWaveCanvasRef.current,a=this.props.audioWaveContainerRef.current;e.width=a.clientWidth,e.height=100}},{key:"drawInitialAudioWave",value:function(){this.resetCanvasForNewFrame(),this.drawEmptyDataPoints()}},{key:"drawEmptyDataPoints",value:function(){var e=this;this.props.data.forEach((function(a,t){e.audioWaveCanvasCtx.beginPath(),e.audioWaveCanvasCtx.fillStyle="rgba(0, 98, 255, 0.5)",e.audioWaveCanvasCtx.fillRect(2*t,50,1,50*a),e.audioWaveCanvasCtx.fillRect(2*t,50,1,-50*a),e.audioWaveCanvasCtx.stroke(),e.audioWaveCanvasCtx.closePath()}))}},{key:"drawMicrophoneDataPoints",value:function(){var e=this;this.props.audioAnalyzer.getByteFrequencyData(this.state.microphoneData);var a=this.state.microphoneData;[].slice.call(a).map((function(e){return e/255})).forEach((function(a,t){e.audioWaveCanvasCtx.beginPath(),e.audioWaveCanvasCtx.fillStyle="rgba(0, 98, 255, 1)",e.audioWaveCanvasCtx.fillRect(2*t,50,1,50*a),e.audioWaveCanvasCtx.fillRect(2*t,50,1,-50*a),e.audioWaveCanvasCtx.stroke(),e.audioWaveCanvasCtx.closePath()}))}},{key:"drawAudioDataPoints",value:function(){var e=this,a=this.props,t=a.data,r=a.duration,n=(Date.now()-this.state.startingTimestamp)/r,o=t.length*n,s=Math.floor(o),i=o-s;i>1&&(i=1),i<.5&&(i=.5),t.forEach((function(a,t){e.audioWaveCanvasCtx.beginPath();var r="rgba(0, 98, 255, 1)";t>s&&(r="rgba(0, 98, 255, 0.5)"),t-1===s&&(r="rgba(0, 98, 255, ".concat(i.toFixed(2),")")),e.audioWaveCanvasCtx.fillStyle=r,e.audioWaveCanvasCtx.fillRect(2*t,50,1,50*a),e.audioWaveCanvasCtx.fillRect(2*t,50,1,-50*a),e.audioWaveCanvasCtx.stroke(),e.audioWaveCanvasCtx.closePath()}))}},{key:"draw",value:function(){this.resetCanvasForNewFrame(),this.props.audioSource&&"microphone"===this.props.audioSource?this.drawMicrophoneDataPoints():this.drawAudioDataPoints(),this.animationFrameId=requestAnimationFrame(this.draw)}},{key:"resetCanvasForNewFrame",value:function(){var e=this.audioWaveCanvasRef.current;this.audioWaveCanvasCtx.clearRect(0,0,e.width,e.height)}},{key:"stopDrawing",value:function(){this.animationFrameId&&cancelAnimationFrame(this.animationFrameId)}},{key:"render",value:function(){return n.a.createElement("div",{ref:this.props.audioWaveContainerRef,className:"audiowave"},n.a.createElement("canvas",{ref:this.audioWaveCanvasRef}))}}]),a}(n.a.Component);Y.defaultProps={audioSource:null,audioAnalyzer:null};var H=Y,V=t(166),Z=function(e){var a=e.confidence,t=e.startTime,r=e.endTime;return n.a.createElement("div",{className:"keyword-tooltip"},n.a.createElement("p",null,"Confidence: ",a),n.a.createElement("p",null,t,"s - ",r,"s"))},Q=t(32),$=function(e,a,t){var r=[];if(a.length>0){var n=function(e){var a=[];e.forEach((function(e){a=[].concat(Object(Q.a)(a),Object(Q.a)(Object.keys(e)))}));var t=a.map((function(e,t){return t!==a.length-1?"".concat(e,"|"):e})).reduce((function(e,a){return e+a}),"");return new RegExp("(".concat(t,")(?!')"),"gi")}(a);r=e.split(n)}if(0===r.length)return[{text:e,type:"normal"}];var o={};return r.map((function(e,r){var n=e.toLowerCase();if(r%2===0)return{text:e,type:"normal"};var s=a[t]&&a[t][n],i=0;o[n]?(i=o[n],o[n]+=1):o[n]=1;var l=s&&s[i];return l?{text:e,type:"keyword",startTime:l.start_time,endTime:l.end_time,confidence:l.confidence}:{}}))},ee=function(e){var a=e.keywordInfo,t=e.transcriptArray;return n.a.createElement("div",{className:"transcript-box"},t.map((function(e,t){var r=e.speaker,o=e.text,s=$(o,a,t);return n.a.createElement("div",{key:"transcript-".concat(t)},null!==r&&n.a.createElement("span",{className:"speaker-label--".concat(r)},"Speaker ".concat(r,": ")),s.map((function(e,a){return e?"normal"===e.type?n.a.createElement("span",{key:"transcript-text-".concat(t,"-").concat(a)},"".concat(e.text)):"keyword"===e.type?n.a.createElement(V.a,{align:"center",direction:"top",key:"transcript-keyword-".concat(t,"-").concat(a),tooltipText:n.a.createElement(Z,{confidence:e.confidence,startTime:e.startTime,endTime:e.endTime}),triggerClassName:"keyword-info-trigger"},e.text):null:null})))})))};ee.defaultProps={keywordInfo:[],transcriptArray:[]};var ae=ee,te=function(e){var a=e.audioAnalyzer,t=e.audioDataArray,r=e.audioDuration,o=e.audioSource,s=e.audioWaveContainerRef,i=e.isTranscribing,l=e.keywordInfo,d=e.transcriptArray;return n.a.createElement(w.a,{className:"output-container"},n.a.createElement("h3",{className:"container-title"},"Output"),n.a.createElement(B.a,{legendText:"Audio"},n.a.createElement(H,{audioWaveContainerRef:s,data:t,duration:r,isTranscribing:i,audioSource:o,audioAnalyzer:a})),n.a.createElement(B.a,{legendText:"Transcript"},n.a.createElement(ae,{keywordInfo:l,transcriptArray:d})))};te.defaultProps={audioDataArray:[],audioDuration:0,audioSource:"",isTranscribing:!1,keywordInfo:[],transcriptArray:[]};var re=te,ne=t(167),oe=function(e){var a=e.caption,t=e.children,o=e.className,s=e.hideAfterFirstDisplay,i=e.hideCloseButton,l=e.iconDescription,d=e.kind,u=e.lowContrast,c=e.onCloseButtonClick,p=e.role,m=e.subtitle,f=e.timeout,g=e.title,b=Object(r.useState)(),_=Object(x.a)(b,2),h=_[0],w=_[1],v=Object(r.useState)(!1),y=Object(x.a)(v,2),k=y[0],S=y[1];return Object(r.useEffect)((function(){w(Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15))}),[]),Object(r.useEffect)((function(){var e=document.querySelector(".custom-toast-".concat(h));e&&(e.className+="enter")}),[h]),Object(r.useEffect)((function(){s&&void 0!==typeof window&&void 0!==typeof window.localStorage&&"true"===window.localStorage.getItem("notificationHasBeenSeen")&&S(!0)}),[s]),k?null:n.a.createElement(ne.a,{caption:a,className:"custom-toast-".concat(h," ").concat(o),hideCloseButton:i,iconDescription:l,kind:d,lowContrast:u,onCloseButtonClick:function(){s&&void 0!==typeof window&&void 0!==typeof window.localStorage&&window.localStorage.setItem("notificationHasBeenSeen","true"),c()},role:p,subtitle:m,timeout:f,title:g},t)};oe.defaultProps={caption:"",children:null,className:"",hideAfterFirstDisplay:!0,hideCloseButton:!1,iconDescription:"closes notification",kind:"error",lowContrast:!1,onCloseButtonClick:function(){},role:"alert",subtitle:"",timeout:0,title:""};var se=oe,ie="SET_AUDIO_ANALYZER",le="SET_AUDIO_CONTEXT",de="SET_AUDIO_SOURCE",ue="SET_AUDIO_STREAM",ce="SET_AUDIO_VISUALIZATION_DATA",pe="SET_ERROR",me="SET_SPEAKER_LABELS",fe="SET_IS_RECORDING",ge="SET_IS_SAMPLE_PLAYING",be="SET_IS_TRANSCRIBING",_e="SET_IS_UPLOAD_PLAYING",he="UPDATE_RESULTS",we={audioAnalyzer:{},audioContext:null,audioDataArray:[],audioDurationInMs:0,audioSource:"",audioStream:null,error:null,isRecording:!1,isSamplePlaying:!1,isTranscribing:!1,isUploadPlaying:!1,keywordInfo:[],speakerLabels:[],transcript:[]},ve=function(e,a){switch(a.type){case"SET_AUDIO_ANALYZER":return Object(k.a)({},e,{audioAnalyzer:a.audioAnalyzer});case"SET_AUDIO_CONTEXT":return Object(k.a)({},e,{audioContext:a.audioContext});case"SET_AUDIO_SOURCE":return Object(k.a)({},e,{audioSource:a.audioSource});case"SET_AUDIO_STREAM":return Object(k.a)({},e,{audioStream:a.audioStream});case"SET_AUDIO_VISUALIZATION_DATA":return Object(k.a)({},e,{audioDataArray:a.audioDataArray,audioDurationInMs:a.audioDurationInMs});case"SET_ERROR":return Object(k.a)({},e,{error:a.error});case"SET_IS_RECORDING":return Object(k.a)({},e,{isRecording:a.isRecording});case"SET_IS_SAMPLE_PLAYING":return Object(k.a)({},e,{isSamplePlaying:a.isSamplePlaying});case"SET_IS_TRANSCRIBING":return Object(k.a)({},e,{isTranscribing:a.isTranscribing});case"SET_IS_UPLOAD_PLAYING":return Object(k.a)({},e,{isUploadPlaying:a.isUploadPlaying});case"SET_SPEAKER_LABELS":return Object(k.a)({},e,{speakerLabels:a.speakerLabels});case"UPDATE_RESULTS":var t=Object(Q.a)(e.transcript);return 0===a.resultIndex?t=a.transcript:t[a.resultIndex]=a.transcript[0],Object(k.a)({},e,{keywordInfo:a.keywordInfo,transcript:t});default:throw new Error}},ye=2,ke=function(e){var a=new FileReader;return new Promise((function(t,r){a.onload=function(){var e=a.result;t(e)},a.onerror=function(){a.abort(),r(new Error("failed to process file"))},a.readAsArrayBuffer(e)}))},Se=function(e,a,t){var r,n;return E.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,E.a.awrap(ke(e));case 2:return r=o.sent,n=new Uint8Array(r.slice(0)),o.abrupt("return",new Promise((function(e,o){a.decodeAudioData(r,(function(a){for(var r=a.duration,o=t-2*ye,s=Math.floor(o/2),i=n.length/s,l=[],d=1;d0&&(e=s.split(",").map((function(e){return e.trim()}))),v(e)}),[s]);var y=U.find((function(e){return e.name===i})),S=y?y.filename:null,N=function(){var e,a,t,r;return E.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,E.a.awrap(O()("/api/auth"));case 2:return e=n.sent,n.next=5,E.a.awrap(e.json());case 5:if(a=n.sent,e.ok){n.next=9;break}return d(a),n.abrupt("return",{error:a});case 9:return t={},r=w.map((function(e){return e.toLowerCase()})),t=Object(k.a)({},t,{url:a.url||void 0,accessToken:a.accessToken,format:!0,keywords:w.length>0?r:void 0,keywordsThreshold:w.length>0?.01:void 0,model:i,objectMode:!0,play:!0,realtime:!0,resultsBySpeaker:b,speakerlessInterim:!0,timestamps:!0}),n.abrupt("return",t);case 13:case"end":return n.stop()}}))},C=function(){var e;return E.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,E.a.awrap(N());case 2:return e=a.sent,a.abrupt("return",Object(k.a)({},e,{file:"audio/".concat(S)}));case 4:case"end":return a.stop()}}))},P=function(){var e;return E.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,E.a.awrap(N());case 2:return e=a.sent,a.abrupt("return",Object(k.a)({},e,{resultsBySpeaker:!1}));case 4:case"end":return a.stop()}}))},R=function(e){var a;return E.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,E.a.awrap(N());case 2:return a=t.sent,t.abrupt("return",Object(k.a)({},a,{file:e,resultsBySpeaker:!1}));case 4:case"end":return t.stop()}}))};return n.a.createElement("div",{className:"submit-container"},t?n.a.createElement(l.a,{className:"submit-button",kind:"tertiary",onClick:m},"Stop audio sample"):n.a.createElement(l.a,{className:"submit-button",disabled:!i,kind:"tertiary",onClick:function(){var e;return E.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,E.a.awrap(C());case 2:(e=a.sent).error||p(e);case 4:case"end":return a.stop()}}))}},"Play audio sample"),a?n.a.createElement(l.a,{className:"submit-button",kind:"tertiary",onClick:g},"Stop recording"):n.a.createElement(l.a,{className:"submit-button",disabled:!i,kind:"tertiary",onClick:function(){var e;return E.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,E.a.awrap(P());case 2:(e=a.sent).error||f(e);case 4:case"end":return a.stop()}}))}},"Record your own"),o?n.a.createElement(l.a,{className:"submit-button",kind:"tertiary",onClick:c},"Stop playing"):n.a.createElement(I.a,{accept:["audio/wav","audio/mpeg","audio/flac","audio/opus"],buttonKind:"tertiary",className:"submit-button",disabled:!i,disableLabelChanges:!0,labelText:"Upload file",onChange:function(e){var a,t;return E.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return a=e.currentTarget.files[0],r.next=3,E.a.awrap(R(a));case 3:(t=r.sent).error||u(t);case 5:case"end":return r.stop()}}))}}))};j.defaultProps={isRecording:!1,isSamplePlaying:!1,isUploadPlaying:!1,keywordText:"",modelName:null,onError:function(){},onStartPlayingFileUpload:function(){},onStopPlayingFileUpload:function(){},onStartPlayingSample:function(){},onStopPlayingSample:function(){},onStartRecording:function(){},onStopRecording:function(){},useSpeakerLabels:!1};var z=j,W=function(e){var a=e.isRecording,t=e.isSamplePlaying,o=e.isUploadPlaying,s=e.onError,i=e.onSelectNewModel,l=e.onStartPlayingFileUpload,d=e.onStopPlayingFileUpload,u=e.onStartPlayingSample,c=e.onStopPlayingSample,p=e.onStartRecording,m=e.onStopRecording,f=U.map((function(e){return{id:e.name,label:e.description,supportsSpeakerLabels:e.supported_features.speaker_labels}})),g=Object(r.useState)(f[0]),b=Object(x.a)(g,2),_=b[0],h=b[1],v=Object(r.useState)(U[0].keywords),y=Object(x.a)(v,2),k=y[0],S=y[1],E=Object(r.useState)(!1),N=Object(x.a)(E,2),C=N[0],P=N[1];return n.a.createElement(w.a,{className:"control-container"},n.a.createElement("h3",{className:"container-title"},"Input"),n.a.createElement(B.a,{legendText:"Language model"},n.a.createElement(A.a,{id:"language-model-dropdown",label:"Select a language model",onChange:function(e){h(e.selectedItem);var a=U.find((function(a){return a.name===e.selectedItem.id})).keywords;S(a),C&&!e.selectedItem.supportsSpeakerLabels&&P(!1),i()},items:f,selectedItem:_&&_.label,defaultText:"Select a language model",ariaLabel:"Language selection dropdown",light:!0})),n.a.createElement(B.a,{legendText:"Keywords to spot"},n.a.createElement(M.a,{id:"custom-keyword-input",labelText:"Custom language keyword input",placeholder:"Enter custom language keywords",hideLabel:!0,invalidText:"Invalid keywords provided",value:k,onChange:function(e){S(e.target.value)},light:!0})),n.a.createElement(B.a,{legendText:"Detect multiple speakers (only supported with sample audio)"},n.a.createElement(T.a,{id:"speaker-label-toggle","aria-label":"Speaker label toggle",disabled:!_||!_.supportsSpeakerLabels,toggled:C,onToggle:function(){P(!C)}})),n.a.createElement(z,{isRecording:a,isSamplePlaying:t,isUploadPlaying:o,keywordText:k,modelName:_&&_.id,onError:s,onStartPlayingFileUpload:l,onStopPlayingFileUpload:d,onStartPlayingSample:u,onStopPlayingSample:c,onStartRecording:p,onStopRecording:m,useSpeakerLabels:C}))};W.defaultProps={isRecording:!1,isSamplePlaying:!1,isUploadPlaying:!1,onError:function(){},onSelectNewModel:function(){},onStartPlayingFileUpload:function(){},onStopPlayingFileUpload:function(){},onStartPlayingSample:function(){},onStopPlayingSample:function(){},onStartRecording:function(){},onStopRecording:function(){}};var F=W,L=t(76),G=t(77),K=t(85),J=t(78),X=t(36),q=t(84),Y=function(e){function a(e){var t;return Object(L.a)(this,a),(t=Object(K.a)(this,Object(J.a)(a).call(this,e))).audioWaveCanvasRef=n.a.createRef(),t.audioWaveCanvasCtx=null,t.animationFrameId=null,t.draw=t.draw.bind(Object(X.a)(t)),t.state={startingTimestamp:0,microphoneData:new Uint8Array(1024)},t}return Object(q.a)(a,e),Object(G.a)(a,[{key:"componentDidMount",value:function(){this.audioWaveCanvasCtx=this.audioWaveCanvasRef.current.getContext("2d"),this.audioWaveCanvasCtx.lineCap="round",this.initializeCanvasDimensions()}},{key:"componentDidUpdate",value:function(e){Object(x.a)(e.data,1)[0]!==Object(x.a)(this.props.data,1)[0]&&this.drawInitialAudioWave(),!1===e.isTranscribing&&!0===this.props.isTranscribing?(this.setStartingTimestamp(),this.draw()):!0===e.isTranscribing&&!1===this.props.isTranscribing&&this.stopDrawing()}},{key:"setStartingTimestamp",value:function(){this.setState({startingTimestamp:Date.now()})}},{key:"initializeCanvasDimensions",value:function(){var e=this.audioWaveCanvasRef.current,a=this.props.audioWaveContainerRef.current;e.width=a.clientWidth,e.height=100}},{key:"drawInitialAudioWave",value:function(){this.resetCanvasForNewFrame(),this.drawEmptyDataPoints()}},{key:"drawEmptyDataPoints",value:function(){var e=this;this.props.data.forEach((function(a,t){e.audioWaveCanvasCtx.beginPath(),e.audioWaveCanvasCtx.fillStyle="rgba(0, 98, 255, 0.5)",e.audioWaveCanvasCtx.fillRect(2*t,50,1,50*a),e.audioWaveCanvasCtx.fillRect(2*t,50,1,-50*a),e.audioWaveCanvasCtx.stroke(),e.audioWaveCanvasCtx.closePath()}))}},{key:"drawMicrophoneDataPoints",value:function(){var e=this;this.props.audioAnalyzer.getByteFrequencyData(this.state.microphoneData);var a=this.state.microphoneData;[].slice.call(a).map((function(e){return e/255})).forEach((function(a,t){e.audioWaveCanvasCtx.beginPath(),e.audioWaveCanvasCtx.fillStyle="rgba(0, 98, 255, 1)",e.audioWaveCanvasCtx.fillRect(2*t,50,1,50*a),e.audioWaveCanvasCtx.fillRect(2*t,50,1,-50*a),e.audioWaveCanvasCtx.stroke(),e.audioWaveCanvasCtx.closePath()}))}},{key:"drawAudioDataPoints",value:function(){var e=this,a=this.props,t=a.data,r=a.duration,n=(Date.now()-this.state.startingTimestamp)/r,o=t.length*n,s=Math.floor(o),i=o-s;i>1&&(i=1),i<.5&&(i=.5),t.forEach((function(a,t){e.audioWaveCanvasCtx.beginPath();var r="rgba(0, 98, 255, 1)";t>s&&(r="rgba(0, 98, 255, 0.5)"),t-1===s&&(r="rgba(0, 98, 255, ".concat(i.toFixed(2),")")),e.audioWaveCanvasCtx.fillStyle=r,e.audioWaveCanvasCtx.fillRect(2*t,50,1,50*a),e.audioWaveCanvasCtx.fillRect(2*t,50,1,-50*a),e.audioWaveCanvasCtx.stroke(),e.audioWaveCanvasCtx.closePath()}))}},{key:"draw",value:function(){this.resetCanvasForNewFrame(),this.props.audioSource&&"microphone"===this.props.audioSource?this.drawMicrophoneDataPoints():this.drawAudioDataPoints(),this.animationFrameId=requestAnimationFrame(this.draw)}},{key:"resetCanvasForNewFrame",value:function(){var e=this.audioWaveCanvasRef.current;this.audioWaveCanvasCtx.clearRect(0,0,e.width,e.height)}},{key:"stopDrawing",value:function(){this.animationFrameId&&cancelAnimationFrame(this.animationFrameId)}},{key:"render",value:function(){return n.a.createElement("div",{ref:this.props.audioWaveContainerRef,className:"audiowave"},n.a.createElement("canvas",{ref:this.audioWaveCanvasRef}))}}]),a}(n.a.Component);Y.defaultProps={audioSource:null,audioAnalyzer:null};var H=Y,V=t(166),Z=function(e){var a=e.confidence,t=e.startTime,r=e.endTime;return n.a.createElement("div",{className:"keyword-tooltip"},n.a.createElement("p",null,"Confidence: ",a),n.a.createElement("p",null,t,"s - ",r,"s"))},Q=t(32),$=function(e,a,t){var r=[];if(a.length>0){var n=function(e){var a=[];e.forEach((function(e){a=[].concat(Object(Q.a)(a),Object(Q.a)(Object.keys(e)))}));var t=a.map((function(e,t){return t!==a.length-1?"".concat(e,"|"):e})).reduce((function(e,a){return e+a}),"");return new RegExp("(".concat(t,")(?!')"),"gi")}(a);r=e.split(n)}if(0===r.length)return[{text:e,type:"normal"}];var o={};return r.map((function(e,r){var n=e.toLowerCase();if(r%2===0)return{text:e,type:"normal"};var s=a[t]&&a[t][n],i=0;o[n]?(i=o[n],o[n]+=1):o[n]=1;var l=s&&s[i];return l?{text:e,type:"keyword",startTime:l.start_time,endTime:l.end_time,confidence:l.confidence}:{}}))},ee=function(e){var a=e.keywordInfo,t=e.transcriptArray;return n.a.createElement("div",{className:"transcript-box"},t.map((function(e,t){var r=e.speaker,o=e.text,s=$(o,a,t);return n.a.createElement("div",{key:"transcript-".concat(t)},null!==r&&n.a.createElement("span",{className:"speaker-label--".concat(r)},"Speaker ".concat(r,": ")),s.map((function(e,a){return e?"normal"===e.type?n.a.createElement("span",{key:"transcript-text-".concat(t,"-").concat(a)},"".concat(e.text)):"keyword"===e.type?n.a.createElement(V.a,{align:"center",direction:"top",key:"transcript-keyword-".concat(t,"-").concat(a),tooltipText:n.a.createElement(Z,{confidence:e.confidence,startTime:e.startTime,endTime:e.endTime}),triggerClassName:"keyword-info-trigger"},e.text):null:null})))})))};ee.defaultProps={keywordInfo:[],transcriptArray:[]};var ae=ee,te=function(e){var a=e.audioAnalyzer,t=e.audioDataArray,r=e.audioDuration,o=e.audioSource,s=e.audioWaveContainerRef,i=e.isTranscribing,l=e.keywordInfo,d=e.transcriptArray;return n.a.createElement(w.a,{className:"output-container"},n.a.createElement("h3",{className:"container-title"},"Output"),n.a.createElement(B.a,{legendText:"Audio"},n.a.createElement(H,{audioWaveContainerRef:s,data:t,duration:r,isTranscribing:i,audioSource:o,audioAnalyzer:a})),n.a.createElement(B.a,{legendText:"Transcript"},n.a.createElement(ae,{keywordInfo:l,transcriptArray:d})))};te.defaultProps={audioDataArray:[],audioDuration:0,audioSource:"",isTranscribing:!1,keywordInfo:[],transcriptArray:[]};var re=te,ne=t(167),oe=function(e){var a=e.caption,t=e.children,o=e.className,s=e.hideAfterFirstDisplay,i=e.hideCloseButton,l=e.iconDescription,d=e.kind,u=e.lowContrast,c=e.onCloseButtonClick,p=e.role,m=e.subtitle,f=e.timeout,g=e.title,b=Object(r.useState)(),_=Object(x.a)(b,2),h=_[0],w=_[1],v=Object(r.useState)(!1),y=Object(x.a)(v,2),k=y[0],S=y[1];return Object(r.useEffect)((function(){w(Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15))}),[]),Object(r.useEffect)((function(){var e=document.querySelector(".custom-toast-".concat(h));e&&(e.className+="enter")}),[h]),Object(r.useEffect)((function(){s&&void 0!==typeof window&&void 0!==typeof window.localStorage&&"true"===window.localStorage.getItem("notificationHasBeenSeen")&&S(!0)}),[s]),k?null:n.a.createElement(ne.a,{caption:a,className:"custom-toast-".concat(h," ").concat(o),hideCloseButton:i,iconDescription:l,kind:d,lowContrast:u,onCloseButtonClick:function(){s&&void 0!==typeof window&&void 0!==typeof window.localStorage&&window.localStorage.setItem("notificationHasBeenSeen","true"),c()},role:p,subtitle:m,timeout:f,title:g},t)};oe.defaultProps={caption:"",children:null,className:"",hideAfterFirstDisplay:!0,hideCloseButton:!1,iconDescription:"closes notification",kind:"error",lowContrast:!1,onCloseButtonClick:function(){},role:"alert",subtitle:"",timeout:0,title:""};var se=oe,ie="SET_AUDIO_ANALYZER",le="SET_AUDIO_CONTEXT",de="SET_AUDIO_SOURCE",ue="SET_AUDIO_STREAM",ce="SET_AUDIO_VISUALIZATION_DATA",pe="SET_ERROR",me="SET_SPEAKER_LABELS",fe="SET_IS_RECORDING",ge="SET_IS_SAMPLE_PLAYING",be="SET_IS_TRANSCRIBING",_e="SET_IS_UPLOAD_PLAYING",he="UPDATE_RESULTS",we={audioAnalyzer:{},audioContext:null,audioDataArray:[],audioDurationInMs:0,audioSource:"",audioStream:null,error:null,isRecording:!1,isSamplePlaying:!1,isTranscribing:!1,isUploadPlaying:!1,keywordInfo:[],speakerLabels:[],transcript:[]},ve=function(e,a){switch(a.type){case"SET_AUDIO_ANALYZER":return Object(k.a)({},e,{audioAnalyzer:a.audioAnalyzer});case"SET_AUDIO_CONTEXT":return Object(k.a)({},e,{audioContext:a.audioContext});case"SET_AUDIO_SOURCE":return Object(k.a)({},e,{audioSource:a.audioSource});case"SET_AUDIO_STREAM":return Object(k.a)({},e,{audioStream:a.audioStream});case"SET_AUDIO_VISUALIZATION_DATA":return Object(k.a)({},e,{audioDataArray:a.audioDataArray,audioDurationInMs:a.audioDurationInMs});case"SET_ERROR":return Object(k.a)({},e,{error:a.error});case"SET_IS_RECORDING":return Object(k.a)({},e,{isRecording:a.isRecording});case"SET_IS_SAMPLE_PLAYING":return Object(k.a)({},e,{isSamplePlaying:a.isSamplePlaying});case"SET_IS_TRANSCRIBING":return Object(k.a)({},e,{isTranscribing:a.isTranscribing});case"SET_IS_UPLOAD_PLAYING":return Object(k.a)({},e,{isUploadPlaying:a.isUploadPlaying});case"SET_SPEAKER_LABELS":return Object(k.a)({},e,{speakerLabels:a.speakerLabels});case"UPDATE_RESULTS":var t=Object(Q.a)(e.transcript);return 0===a.resultIndex?t=a.transcript:t[a.resultIndex]=a.transcript[0],Object(k.a)({},e,{keywordInfo:a.keywordInfo,transcript:t});default:throw new Error}},ye=2,ke=function(e){var a=new FileReader;return new Promise((function(t,r){a.onload=function(){var e=a.result;t(e)},a.onerror=function(){a.abort(),r(new Error("failed to process file"))},a.readAsArrayBuffer(e)}))},Se=function(e,a,t){var r,n;return E.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,E.a.awrap(ke(e));case 2:return r=o.sent,n=new Uint8Array(r.slice(0)),o.abrupt("return",new Promise((function(e,o){a.decodeAudioData(r,(function(a){for(var r=a.duration,o=t-2*ye,s=Math.floor(o/2),i=n.length/s,l=[],d=1;d (\n \n
\n );\n};\n\nexport default ServiceContainer;\n","import { useEffect } from 'react';\n\nconst useScript = url => {\n useEffect(() => {\n const script = document.createElement('script');\n\n script.src = url;\n script.async = true;\n\n document.body.appendChild(script);\n\n return () => {\n document.body.removeChild(script);\n };\n }, [url]);\n};\n\nexport default useScript;\n","import React from 'react';\nimport { Button, Link } from 'carbon-components-react';\nimport { default as Api124 } from '@carbon/icons-react/lib/API--1/24';\nimport Document24 from '@carbon/icons-react/lib/document/24';\nimport IbmCloud24 from '@carbon/icons-react/lib/ibm-cloud/24';\nimport Launch16 from '@carbon/icons-react/lib/launch/16';\nimport LogoGithub24 from '@carbon/icons-react/lib/logo--github/24';\nimport Header from './components/Header';\nimport ServiceContainer from './components/ServiceContainer';\nimport useScript from './hooks/useScript';\n\nconst HEADER_TITLE = 'Watson Speech to Text';\nconst HEADER_DESCRIPTION =\n 'IBM Watson Speech to Text is a cloud-native API that transforms voice into written text.';\nconst HEADER_LINKS = [\n \n
\n );\n};\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' }\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './styles/main.scss';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
index eb0464f..249f5ba 100644
--- a/public/index.html
+++ b/public/index.html
@@ -38,8 +38,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
-
-