{"version":3,"file":"react-media-recorder-DtVOCqpC.js","sources":["../../node_modules/react-media-recorder/node_modules/media-encoder-host-broker/node_modules/fast-unique-numbers/build/es2019/factories/add-unique-number.js","../../node_modules/react-media-recorder/node_modules/media-encoder-host-broker/node_modules/fast-unique-numbers/build/es2019/factories/cache.js","../../node_modules/react-media-recorder/node_modules/media-encoder-host-broker/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.js","../../node_modules/react-media-recorder/node_modules/media-encoder-host-broker/node_modules/fast-unique-numbers/build/es2019/module.js","../../node_modules/react-media-recorder/node_modules/media-encoder-host-broker/build/es2019/module.js","../../node_modules/react-media-recorder/node_modules/media-encoder-host/build/es2019/worker/worker.js","../../node_modules/react-media-recorder/node_modules/media-encoder-host/build/es2019/module.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/blob-event-factory.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/decode-web-m-chunk.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/event-target-constructor.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/event-target-factory.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/invalid-modification-error.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/invalid-state-error.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/is-supported-promise.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/media-recorder-constructor.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/native-blob-event-constructor.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/native-media-recorder.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/native-media-recorder-constructor.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/not-supported-error.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/read-element-content.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/read-element-type.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/read-variable-size-integer.js","../../node_modules/react-media-recorder/node_modules/fast-unique-numbers/build/es2019/factories/cache.js","../../node_modules/react-media-recorder/node_modules/fast-unique-numbers/build/es2019/factories/generate-unique-number.js","../../node_modules/react-media-recorder/node_modules/fast-unique-numbers/build/es2019/module.js","../../node_modules/react-media-recorder/node_modules/worker-factory/build/es2019/helpers/error-renderers.js","../../node_modules/react-media-recorder/node_modules/recorder-audio-worklet/build/es2019/factories/add-recorder-audio-worklet-module.js","../../node_modules/react-media-recorder/node_modules/recorder-audio-worklet/build/es2019/factories/listener.js","../../node_modules/react-media-recorder/node_modules/recorder-audio-worklet/build/es2019/factories/post-message-factory.js","../../node_modules/react-media-recorder/node_modules/recorder-audio-worklet/build/es2019/factories/recorder-audio-worklet-node-factory.js","../../node_modules/react-media-recorder/node_modules/recorder-audio-worklet/build/es2019/functions/validate-state.js","../../node_modules/react-media-recorder/node_modules/recorder-audio-worklet/build/es2019/worklet/worklet.js","../../node_modules/react-media-recorder/node_modules/recorder-audio-worklet/build/es2019/module.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/web-audio-media-recorder.js","../../node_modules/react-media-recorder/node_modules/multi-buffer-data-view/build/es2019/classes/multi-buffer-data-view.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/webm-pcm-media-recorder.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/factories/window.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/functions/read-variable-size-integer-length.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/functions/wrap-event-listener.js","../../node_modules/react-media-recorder/node_modules/extendable-media-recorder/build/es2019/module.js","../../node_modules/react-media-recorder/lib/index.js","../../node_modules/react-media-recorder/index.js"],"sourcesContent":["export const createAddUniqueNumber = (generateUniqueNumber) => {\n return (set) => {\n const number = generateUniqueNumber(set);\n set.add(number);\n return number;\n };\n};\n//# sourceMappingURL=add-unique-number.js.map","export const createCache = (lastNumberWeakMap) => {\n return (collection, nextNumber) => {\n lastNumberWeakMap.set(collection, nextNumber);\n return nextNumber;\n };\n};\n//# sourceMappingURL=cache.js.map","/*\n * The value of the constant Number.MAX_SAFE_INTEGER equals (2 ** 53 - 1) but it\n * is fairly new.\n */\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER === undefined ? 9007199254740991 : Number.MAX_SAFE_INTEGER;\nconst TWO_TO_THE_POWER_OF_TWENTY_NINE = 536870912;\nconst TWO_TO_THE_POWER_OF_THIRTY = TWO_TO_THE_POWER_OF_TWENTY_NINE * 2;\nexport const createGenerateUniqueNumber = (cache, lastNumberWeakMap) => {\n return (collection) => {\n const lastNumber = lastNumberWeakMap.get(collection);\n /*\n * Let's try the cheapest algorithm first. It might fail to produce a new\n * number, but it is so cheap that it is okay to take the risk. Just\n * increase the last number by one or reset it to 0 if we reached the upper\n * bound of SMIs (which stands for small integers). When the last number is\n * unknown it is assumed that the collection contains zero based consecutive\n * numbers.\n */\n let nextNumber = lastNumber === undefined ? collection.size : lastNumber < TWO_TO_THE_POWER_OF_THIRTY ? lastNumber + 1 : 0;\n if (!collection.has(nextNumber)) {\n return cache(collection, nextNumber);\n }\n /*\n * If there are less than half of 2 ** 30 numbers stored in the collection,\n * the chance to generate a new random number in the range from 0 to 2 ** 30\n * is at least 50%. It's benifitial to use only SMIs because they perform\n * much better in any environment based on V8.\n */\n if (collection.size < TWO_TO_THE_POWER_OF_TWENTY_NINE) {\n while (collection.has(nextNumber)) {\n nextNumber = Math.floor(Math.random() * TWO_TO_THE_POWER_OF_THIRTY);\n }\n return cache(collection, nextNumber);\n }\n // Quickly check if there is a theoretical chance to generate a new number.\n if (collection.size > MAX_SAFE_INTEGER) {\n throw new Error('Congratulations, you created a collection of unique numbers which uses all available integers!');\n }\n // Otherwise use the full scale of safely usable integers.\n while (collection.has(nextNumber)) {\n nextNumber = Math.floor(Math.random() * MAX_SAFE_INTEGER);\n }\n return cache(collection, nextNumber);\n };\n};\n//# sourceMappingURL=generate-unique-number.js.map","import { createAddUniqueNumber } from './factories/add-unique-number';\nimport { createCache } from './factories/cache';\nimport { createGenerateUniqueNumber } from './factories/generate-unique-number';\nconst LAST_NUMBER_WEAK_MAP = new WeakMap();\nconst cache = createCache(LAST_NUMBER_WEAK_MAP);\nconst generateUniqueNumber = createGenerateUniqueNumber(cache, LAST_NUMBER_WEAK_MAP);\nconst addUniqueNumber = createAddUniqueNumber(generateUniqueNumber);\nexport { addUniqueNumber, generateUniqueNumber };\n//# sourceMappingURL=module.js.map","import { createBroker } from 'broker-factory';\nimport { addUniqueNumber } from 'fast-unique-numbers';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nconst encoderIds = new Set();\nexport const wrap = createBroker({\n deregister: ({ call }) => {\n return (port) => {\n return call('deregister', { port }, [port]);\n };\n },\n encode: ({ call }) => {\n return async (encoderId, timeslice) => {\n const arrayBuffers = await call('encode', { encoderId, timeslice });\n encoderIds.delete(encoderId);\n return arrayBuffers;\n };\n },\n instantiate: ({ call }) => {\n return async (mimeType, sampleRate) => {\n const encoderId = addUniqueNumber(encoderIds);\n const port = await call('instantiate', { encoderId, mimeType, sampleRate });\n return { encoderId, port };\n };\n },\n register: ({ call }) => {\n return (port) => {\n return call('register', { port }, [port]);\n };\n }\n});\nexport const load = (url) => {\n const worker = new Worker(url);\n return wrap(worker);\n};\n//# sourceMappingURL=module.js.map","// This is the minified and stringified code of the media-encoder-host-worker package.\nexport const worker = `(()=>{var e={455:function(e,t){!function(e){\"use strict\";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:an)throw new Error(\"Congratulations, you created a collection of unique numbers which uses all available integers!\");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,c=r(i),l=a(c,i),d=t(l);e.addUniqueNumber=d,e.generateUniqueNumber=l}(t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{\"use strict\";var e=r(455);const t=new WeakMap,n=new WeakMap,o=(r=>{const o=(s=r,{...s,connect:e=>{let{call:r}=e;return async()=>{const{port1:e,port2:n}=new MessageChannel,o=await r(\"connect\",{port:e},[e]);return t.set(n,o),n}},disconnect:e=>{let{call:r}=e;return async e=>{const n=t.get(e);if(void 0===n)throw new Error(\"The given port is not connected.\");await r(\"disconnect\",{portId:n})}},isSupported:e=>{let{call:t}=e;return()=>t(\"isSupported\")}});var s;return t=>{const r=(e=>{if(n.has(e))return n.get(e);const t=new Map;return n.set(e,t),t})(t);t.addEventListener(\"message\",(e=>{let{data:t}=e;const{id:n}=t;if(null!==n&&r.has(n)){const{reject:e,resolve:o}=r.get(n);r.delete(n),void 0===t.error?o(t.result):e(new Error(t.error.message))}})),(e=>\"function\"==typeof e.start)(t)&&t.start();const s=function(n){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return new Promise(((a,i)=>{const c=(0,e.generateUniqueNumber)(r);r.set(c,{reject:i,resolve:a}),null===o?t.postMessage({id:c,method:n},s):t.postMessage({id:c,method:n,params:o},s)}))},a=function(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t.postMessage({id:null,method:e,params:r},n)};let i={};for(const[e,t]of Object.entries(o))i={...i,[e]:t({call:s,notify:a})};return{...i}}})({characterize:e=>{let{call:t}=e;return()=>t(\"characterize\")},encode:e=>{let{call:t}=e;return(e,r)=>t(\"encode\",{recordingId:e,timeslice:r})},record:e=>{let{call:t}=e;return async(e,r,n)=>{await t(\"record\",{recordingId:e,sampleRate:r,typedArrays:n},n.map((e=>{let{buffer:t}=e;return t})))}}}),s=-32603,a=-32602,i=-32601,c=(e,t)=>Object.assign(new Error(e),{status:t}),l=e=>c('The handler of the method called \"'.concat(e,'\" returned an unexpected result.'),s),d=(e,t)=>async r=>{let{data:{id:n,method:o,params:a}}=r;const d=t[o];try{if(void 0===d)throw(e=>c('The requested method called \"'.concat(e,'\" is not supported.'),i))(o);const t=void 0===a?d():d(a);if(void 0===t)throw(e=>c('The handler of the method called \"'.concat(e,'\" returned no required result.'),s))(o);const r=t instanceof Promise?await t:t;if(null===n){if(void 0!==r.result)throw l(o)}else{if(void 0===r.result)throw l(o);const{result:t,transferables:s=[]}=r;e.postMessage({id:n,result:t},s)}}catch(t){const{message:r,status:o=-32603}=t;e.postMessage({error:{code:o,message:r},id:n})}},u=new Map,h=(t,r,n)=>({...r,connect:n=>{let{port:o}=n;o.start();const s=t(o,r),a=(0,e.generateUniqueNumber)(u);return u.set(a,(()=>{s(),o.close(),u.delete(a)})),{result:a}},disconnect:e=>{let{portId:t}=e;const r=u.get(t);if(void 0===r)throw(e=>c('The specified parameter called \"portId\" with the given value \"'.concat(e,'\" does not identify a port connected to this worker.'),a))(t);return r(),{result:null}},isSupported:async()=>{if(await new Promise((e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=t=>{let{data:r}=t;return e(null!==r)},n.postMessage(t,[t])}))){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),f=function(e,t){const r=h(f,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0),n=d(e,r);return e.addEventListener(\"message\",n),()=>e.removeEventListener(\"message\",n)},p=e=>{e.onmessage=null,e.close()},w=new Map,m=new WeakMap,g=((e,t)=>r=>{const n=t.get(r);if(void 0===n)throw new Error(\"There is no encoder stored which wraps this port.\");e.delete(n),t.delete(r)})(w,m),v=new Map,y=(e=>t=>{const r=e.get(t);if(void 0===r)throw new Error(\"There was no instance of an encoder stored with the given id.\");return r})(v),M=((e,t)=>r=>{const n=t(r);return e.delete(r),n})(v,y),E=((e,t)=>r=>{const[n,o,s,a]=t(r);return s?new Promise((t=>{o.onmessage=s=>{let{data:i}=s;0===i.length?(e(o),t(n.encode(r,null))):n.record(r,a,i)}})):n.encode(r,null)})(p,M),b=(e=>t=>{for(const[r,n]of Array.from(e.values()))if(r.test(t))return n;throw new Error(\"There is no encoder registered which could handle the given mimeType.\")})(w),T=((e,t,r)=>(n,o,s)=>{if(t.has(n))throw new Error('There is already an encoder registered with an id called \"'.concat(n,'\".'));const a=r(o),{port1:i,port2:c}=new MessageChannel,l=[a,i,!0,s];return t.set(n,l),i.onmessage=t=>{let{data:r}=t;0===r.length?(e(i),l[2]=!1):a.record(n,s,r.map((e=>\"number\"==typeof e?new Float32Array(e):e)))},c})(p,v,b),I=((e,t,r)=>async n=>{const o=r(n),s=await o.characterize(),a=s.toString();if(e.has(a)||t.has(n))throw new Error(\"There is already an encoder stored which handles exactly the same mime types.\");return e.set(a,[s,o]),t.set(n,a),s})(w,m,o),A=(e=>(t,r)=>{const[n]=e(t);return n.encode(t,r)})(y);f(self,{deregister:async e=>{let{port:t}=e;return{result:g(t)}},encode:async e=>{let{encoderId:t,timeslice:r}=e;const n=null===r?await E(t):await A(t,r);return{result:n,transferables:n}},instantiate:e=>{let{encoderId:t,mimeType:r,sampleRate:n}=e;const o=T(t,r,n);return{result:o,transferables:[o]}},register:async e=>{let{port:t}=e;return{result:await I(t)}}})})()})();`; // tslint:disable-line:max-line-length\n//# sourceMappingURL=worker.js.map","import { load as loadWorker } from 'media-encoder-host-broker';\nimport { worker } from './worker/worker';\nconst blob = new Blob([worker], { type: 'application/javascript; charset=utf-8' });\nconst url = URL.createObjectURL(blob);\nconst mediaEncoderHost = loadWorker(url);\nexport const connect = mediaEncoderHost.connect;\nexport const deregister = mediaEncoderHost.deregister;\nexport const disconnect = mediaEncoderHost.disconnect;\nexport const encode = mediaEncoderHost.encode;\nexport const instantiate = mediaEncoderHost.instantiate;\nexport const isSupported = mediaEncoderHost.isSupported;\nexport const register = mediaEncoderHost.register;\nURL.revokeObjectURL(url);\n//# sourceMappingURL=module.js.map","export const createBlobEventFactory = (nativeBlobEventConstructor) => {\n return (type, blobEventInit) => {\n // Bug #14: Safari does not yet support the BlobEvent.\n if (nativeBlobEventConstructor === null) {\n const { data, ...eventInit } = blobEventInit;\n const fakeBlobEvent = new Event(type, eventInit);\n fakeBlobEvent.data = data;\n return fakeBlobEvent;\n }\n return new nativeBlobEventConstructor(type, blobEventInit);\n };\n};\n//# sourceMappingURL=blob-event-factory.js.map","export const createDecodeWebMChunk = (readElementContent, readElementType) => {\n return (dataView, elementType, channelCount) => {\n const contents = [];\n let currentElementType = elementType;\n let offset = 0;\n while (offset < dataView.byteLength) {\n if (currentElementType === null) {\n const lengthAndType = readElementType(dataView, offset);\n if (lengthAndType === null) {\n break;\n }\n const { length, type } = lengthAndType;\n currentElementType = type;\n offset += length;\n }\n else {\n const contentAndLength = readElementContent(dataView, offset, currentElementType, channelCount);\n if (contentAndLength === null) {\n break;\n }\n const { content, length } = contentAndLength;\n currentElementType = null;\n offset += length;\n if (content !== null) {\n contents.push(content);\n }\n }\n }\n return { contents, currentElementType, offset };\n };\n};\n//# sourceMappingURL=decode-web-m-chunk.js.map","export const createEventTargetConstructor = (createEventTarget, wrapEventListener) => {\n return class EventTarget {\n constructor(nativeEventTarget = null) {\n this._listeners = new WeakMap();\n this._nativeEventTarget = nativeEventTarget === null ? createEventTarget() : nativeEventTarget;\n }\n addEventListener(type, listener, options) {\n if (listener !== null) {\n let wrappedEventListener = this._listeners.get(listener);\n if (wrappedEventListener === undefined) {\n wrappedEventListener = wrapEventListener(this, listener);\n if (typeof listener === 'function') {\n this._listeners.set(listener, wrappedEventListener);\n }\n }\n this._nativeEventTarget.addEventListener(type, wrappedEventListener, options);\n }\n }\n dispatchEvent(event) {\n return this._nativeEventTarget.dispatchEvent(event);\n }\n removeEventListener(type, listener, options) {\n const wrappedEventListener = listener === null ? undefined : this._listeners.get(listener);\n this._nativeEventTarget.removeEventListener(type, wrappedEventListener === undefined ? null : wrappedEventListener, options);\n }\n };\n};\n//# sourceMappingURL=event-target-constructor.js.map","export const createEventTargetFactory = (window) => {\n return () => {\n if (window === null) {\n throw new Error('A native EventTarget could not be created.');\n }\n return window.document.createElement('p');\n };\n};\n//# sourceMappingURL=event-target-factory.js.map","export const createInvalidModificationError = (message = '') => {\n try {\n return new DOMException(message, 'InvalidModificationError');\n }\n catch (err) {\n // @todo Edge is the only browser that does not yet allow to construct a DOMException.\n err.code = 13;\n err.message = message;\n err.name = 'InvalidModificationError';\n return err;\n }\n};\n//# sourceMappingURL=invalid-modification-error.js.map","export const createInvalidStateError = () => {\n try {\n return new DOMException('', 'InvalidStateError');\n }\n catch (err) {\n // Bug #122: Edge is the only browser that does not yet allow to construct a DOMException.\n err.code = 11;\n err.name = 'InvalidStateError';\n return err;\n }\n};\n//# sourceMappingURL=invalid-state-error.js.map","export const createIsSupportedPromise = (window) => {\n if (window !== null &&\n window.MediaStream !== undefined &&\n /*\n * Bug #10: An early experimental implemenation in Safari did not provide the isTypeSupported() function.\n */\n (window.MediaRecorder === undefined || window.MediaRecorder.isTypeSupported !== undefined)) {\n /*\n * Bug #5: Up until v70 Firefox did emit a blob of type video/webm when asked to encode a MediaStream with a video track into an\n * audio codec.\n */\n return new Promise((resolve) => {\n // Bug #11 Safari does not yet support the MediaRecorder but that isn't tested here.\n if (window.MediaRecorder === undefined) {\n return resolve(true);\n }\n // @todo captureStream() is not defined yet.\n const canvasElement = document.createElement('canvas');\n // @todo https://bugzilla.mozilla.org/show_bug.cgi?id=1388974\n canvasElement.getContext('2d');\n if (typeof canvasElement.captureStream !== 'function') {\n return resolve(false);\n }\n const mediaStream = canvasElement.captureStream();\n const mimeType = 'audio/webm';\n try {\n const mediaRecorder = new window.MediaRecorder(mediaStream, { mimeType });\n mediaRecorder.addEventListener('dataavailable', ({ data }) => resolve(data.type === mimeType));\n mediaRecorder.start();\n setTimeout(() => mediaRecorder.stop(), 10);\n }\n catch (err) {\n resolve(err.name === 'NotSupportedError');\n }\n });\n }\n return Promise.resolve(false);\n};\n//# sourceMappingURL=is-supported-promise.js.map","export const createMediaRecorderConstructor = (createNativeMediaRecorder, createNotSupportedError, createWebAudioMediaRecorder, createWebmPcmMediaRecorder, encoderRegexes, eventTargetConstructor, nativeMediaRecorderConstructor) => {\n return class MediaRecorder extends eventTargetConstructor {\n constructor(stream, options = {}) {\n const { mimeType } = options;\n if (nativeMediaRecorderConstructor !== null &&\n // Bug #10: Safari does not yet implement the isTypeSupported() method.\n (mimeType === undefined ||\n (nativeMediaRecorderConstructor.isTypeSupported !== undefined &&\n nativeMediaRecorderConstructor.isTypeSupported(mimeType)))) {\n const internalMediaRecorder = createNativeMediaRecorder(nativeMediaRecorderConstructor, stream, options);\n super(internalMediaRecorder);\n this._internalMediaRecorder = internalMediaRecorder;\n }\n else if (mimeType !== undefined && encoderRegexes.some((regex) => regex.test(mimeType))) {\n super();\n // Bug #10: Safari does not yet implement the isTypeSupported() method.\n if (nativeMediaRecorderConstructor !== null &&\n nativeMediaRecorderConstructor.isTypeSupported !== undefined &&\n nativeMediaRecorderConstructor.isTypeSupported('audio/webm;codecs=pcm')) {\n this._internalMediaRecorder = createWebmPcmMediaRecorder(this, nativeMediaRecorderConstructor, stream, mimeType);\n }\n else {\n this._internalMediaRecorder = createWebAudioMediaRecorder(this, stream, mimeType);\n }\n }\n else {\n // This is creating a native MediaRecorder just to provoke it to throw an error.\n if (nativeMediaRecorderConstructor !== null) {\n createNativeMediaRecorder(nativeMediaRecorderConstructor, stream, options);\n }\n throw createNotSupportedError();\n }\n this._ondataavailable = null;\n this._onerror = null;\n this._onpause = null;\n this._onresume = null;\n this._onstart = null;\n this._onstop = null;\n }\n get mimeType() {\n return this._internalMediaRecorder.mimeType;\n }\n get ondataavailable() {\n return this._ondataavailable === null ? this._ondataavailable : this._ondataavailable[0];\n }\n set ondataavailable(value) {\n if (this._ondataavailable !== null) {\n this.removeEventListener('dataavailable', this._ondataavailable[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('dataavailable', boundListener);\n this._ondataavailable = [value, boundListener];\n }\n else {\n this._ondataavailable = null;\n }\n }\n get onerror() {\n return this._onerror === null ? this._onerror : this._onerror[0];\n }\n set onerror(value) {\n if (this._onerror !== null) {\n this.removeEventListener('error', this._onerror[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('error', boundListener);\n this._onerror = [value, boundListener];\n }\n else {\n this._onerror = null;\n }\n }\n get onpause() {\n return this._onpause === null ? this._onpause : this._onpause[0];\n }\n set onpause(value) {\n if (this._onpause !== null) {\n this.removeEventListener('pause', this._onpause[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('pause', boundListener);\n this._onpause = [value, boundListener];\n }\n else {\n this._onpause = null;\n }\n }\n get onresume() {\n return this._onresume === null ? this._onresume : this._onresume[0];\n }\n set onresume(value) {\n if (this._onresume !== null) {\n this.removeEventListener('resume', this._onresume[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('resume', boundListener);\n this._onresume = [value, boundListener];\n }\n else {\n this._onresume = null;\n }\n }\n get onstart() {\n return this._onstart === null ? this._onstart : this._onstart[0];\n }\n set onstart(value) {\n if (this._onstart !== null) {\n this.removeEventListener('start', this._onstart[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('start', boundListener);\n this._onstart = [value, boundListener];\n }\n else {\n this._onstart = null;\n }\n }\n get onstop() {\n return this._onstop === null ? this._onstop : this._onstop[0];\n }\n set onstop(value) {\n if (this._onstop !== null) {\n this.removeEventListener('stop', this._onstop[1]);\n }\n if (typeof value === 'function') {\n const boundListener = value.bind(this);\n this.addEventListener('stop', boundListener);\n this._onstop = [value, boundListener];\n }\n else {\n this._onstop = null;\n }\n }\n get state() {\n return this._internalMediaRecorder.state;\n }\n pause() {\n return this._internalMediaRecorder.pause();\n }\n resume() {\n return this._internalMediaRecorder.resume();\n }\n start(timeslice) {\n return this._internalMediaRecorder.start(timeslice);\n }\n stop() {\n return this._internalMediaRecorder.stop();\n }\n static isTypeSupported(mimeType) {\n return ((nativeMediaRecorderConstructor !== null &&\n // Bug #10: Safari does not yet implement the isTypeSupported() method.\n nativeMediaRecorderConstructor.isTypeSupported !== undefined &&\n nativeMediaRecorderConstructor.isTypeSupported(mimeType)) ||\n encoderRegexes.some((regex) => regex.test(mimeType)));\n }\n };\n};\n//# sourceMappingURL=media-recorder-constructor.js.map","export const createNativeBlobEventConstructor = (window) => {\n if (window !== null && window.BlobEvent !== undefined) {\n return window.BlobEvent;\n }\n return null;\n};\n//# sourceMappingURL=native-blob-event-constructor.js.map","export const createNativeMediaRecorderFactory = (createInvalidModificationError, createNotSupportedError) => {\n return (nativeMediaRecorderConstructor, stream, mediaRecorderOptions) => {\n const bufferedBlobs = [];\n const dataAvailableListeners = new WeakMap();\n const errorListeners = new WeakMap();\n const nativeMediaRecorder = new nativeMediaRecorderConstructor(stream, mediaRecorderOptions);\n const stopListeners = new WeakMap();\n let isActive = true;\n nativeMediaRecorder.addEventListener = ((addEventListener) => {\n return (type, listener, options) => {\n let patchedEventListener = listener;\n if (typeof listener === 'function') {\n if (type === 'dataavailable') {\n // Bug #7 & #8: Chrome fires the dataavailable and stop events before it fires the error event.\n patchedEventListener = (event) => {\n setTimeout(() => {\n if (isActive && nativeMediaRecorder.state === 'inactive') {\n bufferedBlobs.push(event.data);\n }\n else {\n if (bufferedBlobs.length > 0) {\n const blob = event.data;\n Object.defineProperty(event, 'data', {\n value: new Blob([...bufferedBlobs, blob], { type: blob.type })\n });\n bufferedBlobs.length = 0;\n }\n listener.call(nativeMediaRecorder, event);\n }\n });\n };\n dataAvailableListeners.set(listener, patchedEventListener);\n }\n else if (type === 'error') {\n // Bug #12 & #13: Firefox fires a regular event with an error property.\n patchedEventListener = (event) => {\n // Bug #3 & #4: Chrome throws an error event without any error.\n if (event.error === undefined) {\n listener.call(nativeMediaRecorder, new ErrorEvent('error', { error: createInvalidModificationError() }));\n // Bug #1 & #2: Firefox throws an error event with an UnknownError.\n }\n else if (event.error.name === 'UnknownError') {\n const message = event.error.message;\n listener.call(nativeMediaRecorder, new ErrorEvent('error', { error: createInvalidModificationError(message) }));\n }\n else if (event instanceof ErrorEvent) {\n listener.call(nativeMediaRecorder, event);\n }\n else {\n listener.call(nativeMediaRecorder, new ErrorEvent('error', { error: event.error }));\n }\n };\n errorListeners.set(listener, patchedEventListener);\n }\n else if (type === 'stop') {\n // Bug #7 & #8: Chrome fires the dataavailable and stop events before it fires the error event.\n patchedEventListener = (event) => {\n isActive = false;\n setTimeout(() => listener.call(nativeMediaRecorder, event));\n };\n stopListeners.set(listener, patchedEventListener);\n }\n }\n return addEventListener.call(nativeMediaRecorder, type, patchedEventListener, options);\n };\n })(nativeMediaRecorder.addEventListener);\n nativeMediaRecorder.dispatchEvent = ((dispatchEvent) => {\n // Bug #7 & #8: Chrome fires the dataavailable and stop events before it fires the error event.\n return (event) => {\n let wasActive;\n setTimeout(() => {\n wasActive = isActive;\n isActive = false;\n });\n const returnValue = dispatchEvent.call(nativeMediaRecorder, event);\n setTimeout(() => (isActive = wasActive));\n return returnValue;\n };\n })(nativeMediaRecorder.dispatchEvent);\n nativeMediaRecorder.removeEventListener = ((removeEventListener) => {\n return (type, listener, options) => {\n let patchedEventListener = listener;\n if (typeof listener === 'function') {\n if (type === 'dataavailable') {\n const dataAvailableListener = dataAvailableListeners.get(listener);\n if (dataAvailableListener !== undefined) {\n patchedEventListener = dataAvailableListener;\n }\n }\n else if (type === 'error') {\n const errorListener = errorListeners.get(listener);\n if (errorListener !== undefined) {\n patchedEventListener = errorListener;\n }\n }\n else if (type === 'stop') {\n const stopListener = stopListeners.get(listener);\n if (stopListener !== undefined) {\n patchedEventListener = stopListener;\n }\n }\n }\n return removeEventListener.call(nativeMediaRecorder, type, patchedEventListener, options);\n };\n })(nativeMediaRecorder.removeEventListener);\n nativeMediaRecorder.start = ((start) => {\n return (timeslice) => {\n /*\n * Bug #6: Chrome will emit a blob without any data when asked to encode a MediaStream with a video track into an audio\n * codec.\n */\n if (mediaRecorderOptions.mimeType !== undefined &&\n mediaRecorderOptions.mimeType.startsWith('audio/') &&\n stream.getVideoTracks().length > 0) {\n throw createNotSupportedError();\n }\n isActive = timeslice !== undefined;\n return timeslice === undefined ? start.call(nativeMediaRecorder) : start.call(nativeMediaRecorder, timeslice);\n };\n })(nativeMediaRecorder.start);\n return nativeMediaRecorder;\n };\n};\n//# sourceMappingURL=native-media-recorder.js.map","export const createNativeMediaRecorderConstructor = (window) => {\n if (window === null) {\n return null;\n }\n return window.MediaRecorder === undefined ? null : window.MediaRecorder;\n};\n//# sourceMappingURL=native-media-recorder-constructor.js.map","export const createNotSupportedError = () => {\n try {\n return new DOMException('', 'NotSupportedError');\n }\n catch (err) {\n // @todo Edge is the only browser that does not yet allow to construct a DOMException.\n err.code = 9;\n err.name = 'NotSupportedError';\n return err;\n }\n};\n//# sourceMappingURL=not-supported-error.js.map","export const createReadElementContent = (readVariableSizeInteger) => {\n return (dataView, offset, type, channelCount = 2) => {\n const lengthAndValue = readVariableSizeInteger(dataView, offset);\n if (lengthAndValue === null) {\n return lengthAndValue;\n }\n const { length, value } = lengthAndValue;\n if (type === 'master') {\n return { content: null, length };\n }\n if (offset + length + value > dataView.byteLength) {\n return null;\n }\n if (type === 'binary') {\n const numberOfSamples = (value / Float32Array.BYTES_PER_ELEMENT - 1) / channelCount;\n const content = Array.from({ length: channelCount }, () => new Float32Array(numberOfSamples));\n for (let i = 0; i < numberOfSamples; i += 1) {\n const elementOffset = i * channelCount + 1;\n for (let j = 0; j < channelCount; j += 1) {\n content[j][i] = dataView.getFloat32(offset + length + (elementOffset + j) * Float32Array.BYTES_PER_ELEMENT, true);\n }\n }\n return { content, length: length + value };\n }\n return { content: null, length: length + value };\n };\n};\n//# sourceMappingURL=read-element-content.js.map","export const createReadElementType = (readVariableSizeInteger) => {\n return (dataView, offset) => {\n const lengthAndValue = readVariableSizeInteger(dataView, offset);\n if (lengthAndValue === null) {\n return lengthAndValue;\n }\n const { length, value } = lengthAndValue;\n if (value === 35) {\n return { length, type: 'binary' };\n }\n if (value === 46 ||\n value === 97 ||\n value === 88713574 ||\n value === 106212971 ||\n value === 139690087 ||\n value === 172351395 ||\n value === 256095861) {\n return { length, type: 'master' };\n }\n return { length, type: 'unknown' };\n };\n};\n//# sourceMappingURL=read-element-type.js.map","export const createReadVariableSizeInteger = (readVariableSizeIntegerLength) => {\n return (dataView, offset) => {\n const length = readVariableSizeIntegerLength(dataView, offset);\n if (length === null) {\n return length;\n }\n const firstDataByteOffset = offset + Math.floor((length - 1) / 8);\n if (firstDataByteOffset + length > dataView.byteLength) {\n return null;\n }\n const firstDataByte = dataView.getUint8(firstDataByteOffset);\n let value = firstDataByte & ((1 << (8 - (length % 8))) - 1); // tslint:disable-line:no-bitwise\n for (let i = 1; i < length; i += 1) {\n value = (value << 8) + dataView.getUint8(firstDataByteOffset + i); // tslint:disable-line:no-bitwise\n }\n return { length, value };\n };\n};\n//# sourceMappingURL=read-variable-size-integer.js.map","export const createCache = (lastNumberWeakMap) => {\n return (collection, nextNumber) => {\n lastNumberWeakMap.set(collection, nextNumber);\n return nextNumber;\n };\n};\n//# sourceMappingURL=cache.js.map","/*\n * The value of the constant Number.MAX_SAFE_INTEGER equals (2 ** 53 - 1) but it\n * is fairly new.\n */\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER === undefined ? 9007199254740991 : Number.MAX_SAFE_INTEGER;\nconst TWO_TO_THE_POWER_OF_TWENTY_NINE = 536870912;\nconst TWO_TO_THE_POWER_OF_THIRTY = TWO_TO_THE_POWER_OF_TWENTY_NINE * 2;\nexport const createGenerateUniqueNumber = (cache, lastNumberWeakMap) => {\n return (collection) => {\n const lastNumber = lastNumberWeakMap.get(collection);\n /*\n * Let's try the cheapest algorithm first. It might fail to produce a new\n * number, but it is so cheap that it is okay to take the risk. Just\n * increase the last number by one or reset it to 0 if we reached the upper\n * bound of SMIs (which stands for small integers). When the last number is\n * unknown it is assumed that the collection contains zero based consecutive\n * numbers.\n */\n let nextNumber = lastNumber === undefined ? collection.size : lastNumber < TWO_TO_THE_POWER_OF_THIRTY ? lastNumber + 1 : 0;\n if (!collection.has(nextNumber)) {\n return cache(collection, nextNumber);\n }\n /*\n * If there are less than half of 2 ** 30 numbers stored in the collection,\n * the chance to generate a new random number in the range from 0 to 2 ** 30\n * is at least 50%. It's benifitial to use only SMIs because they perform\n * much better in any environment based on V8.\n */\n if (collection.size < TWO_TO_THE_POWER_OF_TWENTY_NINE) {\n while (collection.has(nextNumber)) {\n nextNumber = Math.floor(Math.random() * TWO_TO_THE_POWER_OF_THIRTY);\n }\n return cache(collection, nextNumber);\n }\n // Quickly check if there is a theoretical chance to generate a new number.\n if (collection.size > MAX_SAFE_INTEGER) {\n throw new Error('Congratulations, you created a collection of unique numbers which uses all available integers!');\n }\n // Otherwise use the full scale of safely usable integers.\n while (collection.has(nextNumber)) {\n nextNumber = Math.floor(Math.random() * MAX_SAFE_INTEGER);\n }\n return cache(collection, nextNumber);\n };\n};\n//# sourceMappingURL=generate-unique-number.js.map","import { createAddUniqueNumber } from './factories/add-unique-number';\nimport { createCache } from './factories/cache';\nimport { createGenerateUniqueNumber } from './factories/generate-unique-number';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './types/index';\nconst LAST_NUMBER_WEAK_MAP = new WeakMap();\nconst cache = createCache(LAST_NUMBER_WEAK_MAP);\nconst generateUniqueNumber = createGenerateUniqueNumber(cache, LAST_NUMBER_WEAK_MAP);\nconst addUniqueNumber = createAddUniqueNumber(generateUniqueNumber);\nexport { addUniqueNumber, generateUniqueNumber };\n//# sourceMappingURL=module.js.map","import { compile } from 'compilerr';\nconst JSON_RPC_ERROR_CODES = { INTERNAL_ERROR: -32603, INVALID_PARAMS: -32602, METHOD_NOT_FOUND: -32601 };\nexport const renderMethodNotFoundError = compile({\n message: 'The requested method called \"${method}\" is not supported.',\n status: JSON_RPC_ERROR_CODES.METHOD_NOT_FOUND\n});\nexport const renderMissingResponseError = compile({\n message: 'The handler of the method called \"${method}\" returned no required result.',\n status: JSON_RPC_ERROR_CODES.INTERNAL_ERROR\n});\nexport const renderUnexpectedResultError = compile({\n message: 'The handler of the method called \"${method}\" returned an unexpected result.',\n status: JSON_RPC_ERROR_CODES.INTERNAL_ERROR\n});\nexport const renderUnknownPortIdError = compile({\n message: 'The specified parameter called \"portId\" with the given value \"${portId}\" does not identify a port connected to this worker.',\n status: JSON_RPC_ERROR_CODES.INVALID_PARAMS\n});\n//# sourceMappingURL=error-renderers.js.map","export const createAddRecorderAudioWorkletModule = (blobConstructor, urlConstructor, worklet) => {\n return async (addAudioWorkletModule) => {\n const blob = new blobConstructor([worklet], { type: 'application/javascript; charset=utf-8' });\n const url = urlConstructor.createObjectURL(blob);\n try {\n await addAudioWorkletModule(url);\n }\n finally {\n urlConstructor.revokeObjectURL(url);\n }\n };\n};\n//# sourceMappingURL=add-recorder-audio-worklet-module.js.map","export const createListener = (ongoingRequests) => {\n return ({ data: message }) => {\n const { id } = message;\n if (id !== null) {\n const ongoingRequest = ongoingRequests.get(id);\n if (ongoingRequest !== undefined) {\n const { reject, resolve } = ongoingRequest;\n ongoingRequests.delete(id);\n if (message.error === undefined) {\n resolve(message.result);\n }\n else {\n reject(new Error(message.error.message));\n }\n }\n }\n };\n};\n//# sourceMappingURL=listener.js.map","export const createPostMessageFactory = (generateUniqueNumber) => {\n return (ongoingRequests, port) => {\n return (message, transferables = []) => {\n return new Promise((resolve, reject) => {\n const id = generateUniqueNumber(ongoingRequests);\n ongoingRequests.set(id, { reject, resolve });\n port.postMessage({ id, ...message }, transferables);\n });\n };\n };\n};\n//# sourceMappingURL=post-message-factory.js.map","export const createRecorderAudioWorkletNodeFactory = (createListener, createPostMessage, on, validateState) => {\n return (audioWorkletNodeConstructor, context, options = {}) => {\n const audioWorkletNode = new audioWorkletNodeConstructor(context, 'recorder-audio-worklet-processor', {\n ...options,\n channelCountMode: 'explicit',\n numberOfInputs: 1,\n numberOfOutputs: 0\n });\n const ongoingRequests = new Map();\n const postMessage = createPostMessage(ongoingRequests, audioWorkletNode.port);\n const unsubscribe = on(audioWorkletNode.port, 'message')(createListener(ongoingRequests));\n audioWorkletNode.port.start();\n let state = 'inactive';\n Object.defineProperties(audioWorkletNode, {\n pause: {\n get() {\n return async () => {\n validateState(['recording'], state);\n state = 'paused';\n return postMessage({\n method: 'pause'\n });\n };\n }\n },\n port: {\n get() {\n throw new Error(\"The port of a RecorderAudioWorkletNode can't be accessed.\");\n }\n },\n record: {\n get() {\n return async (encoderPort) => {\n validateState(['inactive'], state);\n state = 'recording';\n return postMessage({\n method: 'record',\n params: { encoderPort }\n }, [encoderPort]);\n };\n }\n },\n resume: {\n get() {\n return async () => {\n validateState(['paused'], state);\n state = 'recording';\n return postMessage({\n method: 'resume'\n });\n };\n }\n },\n stop: {\n get() {\n return async () => {\n validateState(['paused', 'recording'], state);\n state = 'stopped';\n try {\n await postMessage({ method: 'stop' });\n }\n finally {\n unsubscribe();\n }\n };\n }\n }\n });\n return audioWorkletNode;\n };\n};\n//# sourceMappingURL=recorder-audio-worklet-node-factory.js.map","export const validateState = (expectedStates, currentState) => {\n if (!expectedStates.includes(currentState)) {\n throw new Error(`Expected the state to be ${expectedStates\n .map((expectedState) => `\"${expectedState}\"`)\n .join(' or ')} but it was \"${currentState}\".`);\n }\n};\n//# sourceMappingURL=validate-state.js.map","// This is the minified and stringified code of the recorder-audio-worklet-processor package.\nexport const worklet = `(()=>{\"use strict\";class e extends AudioWorkletProcessor{constructor(){super(),this._encoderPort=null,this._state=\"inactive\",this.port.onmessage=e=>{let{data:t}=e;\"pause\"===t.method?\"active\"===this._state||\"recording\"===this._state?(this._state=\"paused\",this._sendAcknowledgement(t.id)):this._sendUnexpectedStateError(t.id):\"record\"===t.method?\"inactive\"===this._state?(this._encoderPort=t.params.encoderPort,this._state=\"active\",this._sendAcknowledgement(t.id)):this._sendUnexpectedStateError(t.id):\"resume\"===t.method?\"paused\"===this._state?(this._state=\"active\",this._sendAcknowledgement(t.id)):this._sendUnexpectedStateError(t.id):\"stop\"===t.method?\"active\"!==this._state&&\"paused\"!==this._state&&\"recording\"!==this._state||null===this._encoderPort?this._sendUnexpectedStateError(t.id):(this._stop(this._encoderPort),this._sendAcknowledgement(t.id)):\"number\"==typeof t.id&&this.port.postMessage({error:{code:-32601,message:\"The requested method is not supported.\"},id:t.id})}}process(e){let[t]=e;if(\"inactive\"===this._state||\"paused\"===this._state)return!0;if(\"active\"===this._state){if(void 0===t)throw new Error(\"No channelData was received for the first input.\");if(0===t.length)return!0;this._state=\"recording\"}if(\"recording\"===this._state&&null!==this._encoderPort){if(void 0===t)throw new Error(\"No channelData was received for the first input.\");if(0!==t.length)return this._encoderPort.postMessage(t,t.map((e=>{let{buffer:t}=e;return t}))),!0;this._stop(this._encoderPort)}return!1}_sendAcknowledgement(e){this.port.postMessage({id:e,result:null})}_sendUnexpectedStateError(e){this.port.postMessage({error:{code:-32603,message:\"The internal state does not allow to process the given message.\"},id:e})}_stop(e){e.postMessage([]),e.close(),this._encoderPort=null,this._state=\"stopped\"}}e.parameterDescriptors=[],registerProcessor(\"recorder-audio-worklet-processor\",e)})();`; // tslint:disable-line:max-line-length\n//# sourceMappingURL=worklet.js.map","import { generateUniqueNumber } from 'fast-unique-numbers';\nimport { on } from 'subscribable-things';\nimport { isSupported } from 'worker-factory';\nimport { createAddRecorderAudioWorkletModule } from './factories/add-recorder-audio-worklet-module';\nimport { createListener } from './factories/listener';\nimport { createPostMessageFactory } from './factories/post-message-factory';\nimport { createRecorderAudioWorkletNodeFactory } from './factories/recorder-audio-worklet-node-factory';\nimport { validateState } from './functions/validate-state';\nimport { worklet } from './worklet/worklet';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nexport const addRecorderAudioWorkletModule = createAddRecorderAudioWorkletModule(Blob, URL, worklet);\nexport const createRecorderAudioWorkletNode = createRecorderAudioWorkletNodeFactory(createListener, createPostMessageFactory(generateUniqueNumber), on, validateState);\nexport { isSupported };\n//# sourceMappingURL=module.js.map","import { encode, instantiate } from 'media-encoder-host';\nimport { addRecorderAudioWorkletModule, createRecorderAudioWorkletNode } from 'recorder-audio-worklet';\nimport { AudioBuffer, AudioBufferSourceNode, AudioWorkletNode, ConstantSourceNode, MediaStreamAudioSourceNode, MinimalAudioContext, addAudioWorkletModule } from 'standardized-audio-context';\nconst ERROR_MESSAGE = 'Missing AudioWorklet support. Maybe this is not running in a secure context.';\n// @todo This should live in a separate file.\nconst createPromisedAudioNodesEncoderIdAndPort = async (audioBuffer, audioContext, channelCount, mediaStream, mimeType) => {\n const { encoderId, port } = await instantiate(mimeType, audioContext.sampleRate);\n if (AudioWorkletNode === undefined) {\n throw new Error(ERROR_MESSAGE);\n }\n const audioBufferSourceNode = new AudioBufferSourceNode(audioContext, { buffer: audioBuffer });\n const mediaStreamAudioSourceNode = new MediaStreamAudioSourceNode(audioContext, { mediaStream });\n const recorderAudioWorkletNode = createRecorderAudioWorkletNode(AudioWorkletNode, audioContext, { channelCount });\n return { audioBufferSourceNode, encoderId, mediaStreamAudioSourceNode, port, recorderAudioWorkletNode };\n};\nexport const createWebAudioMediaRecorderFactory = (createBlobEvent, createInvalidModificationError, createInvalidStateError, createNotSupportedError) => {\n return (eventTarget, mediaStream, mimeType) => {\n var _a;\n const sampleRate = (_a = mediaStream.getAudioTracks()[0]) === null || _a === void 0 ? void 0 : _a.getSettings().sampleRate;\n const audioContext = new MinimalAudioContext({ latencyHint: 'playback', sampleRate });\n const length = Math.max(1024, Math.ceil(audioContext.baseLatency * audioContext.sampleRate));\n const audioBuffer = new AudioBuffer({ length, sampleRate: audioContext.sampleRate });\n const bufferedArrayBuffers = [];\n const promisedAudioWorkletModule = addRecorderAudioWorkletModule((url) => {\n if (addAudioWorkletModule === undefined) {\n throw new Error(ERROR_MESSAGE);\n }\n return addAudioWorkletModule(audioContext, url);\n });\n let abortRecording = null;\n let intervalId = null;\n let promisedAudioNodesAndEncoderId = null;\n let promisedPartialRecording = null;\n let isAudioContextRunning = true;\n const dispatchDataAvailableEvent = (arrayBuffers) => {\n eventTarget.dispatchEvent(createBlobEvent('dataavailable', { data: new Blob(arrayBuffers, { type: mimeType }) }));\n };\n const requestNextPartialRecording = async (encoderId, timeslice) => {\n const arrayBuffers = await encode(encoderId, timeslice);\n if (promisedAudioNodesAndEncoderId === null) {\n bufferedArrayBuffers.push(...arrayBuffers);\n }\n else {\n dispatchDataAvailableEvent(arrayBuffers);\n promisedPartialRecording = requestNextPartialRecording(encoderId, timeslice);\n }\n };\n const resume = () => {\n isAudioContextRunning = true;\n return audioContext.resume();\n };\n const stop = () => {\n if (promisedAudioNodesAndEncoderId === null) {\n return;\n }\n if (abortRecording !== null) {\n mediaStream.removeEventListener('addtrack', abortRecording);\n mediaStream.removeEventListener('removetrack', abortRecording);\n }\n if (intervalId !== null) {\n clearTimeout(intervalId);\n }\n promisedAudioNodesAndEncoderId.then(async ({ constantSourceNode, encoderId, mediaStreamAudioSourceNode, recorderAudioWorkletNode }) => {\n if (promisedPartialRecording !== null) {\n promisedPartialRecording.catch(() => {\n /* @todo Only catch the errors caused by a duplicate call to encode. */\n });\n promisedPartialRecording = null;\n }\n await recorderAudioWorkletNode.stop();\n mediaStreamAudioSourceNode.disconnect(recorderAudioWorkletNode);\n constantSourceNode.stop();\n const arrayBuffers = await encode(encoderId, null);\n if (promisedAudioNodesAndEncoderId === null) {\n await suspend();\n }\n dispatchDataAvailableEvent([...bufferedArrayBuffers, ...arrayBuffers]);\n bufferedArrayBuffers.length = 0;\n eventTarget.dispatchEvent(new Event('stop'));\n });\n promisedAudioNodesAndEncoderId = null;\n };\n const suspend = () => {\n isAudioContextRunning = false;\n return audioContext.suspend();\n };\n suspend();\n return {\n get mimeType() {\n return mimeType;\n },\n get state() {\n return promisedAudioNodesAndEncoderId === null ? 'inactive' : isAudioContextRunning ? 'recording' : 'paused';\n },\n pause() {\n if (promisedAudioNodesAndEncoderId === null) {\n throw createInvalidStateError();\n }\n if (isAudioContextRunning) {\n suspend();\n eventTarget.dispatchEvent(new Event('pause'));\n }\n },\n resume() {\n if (promisedAudioNodesAndEncoderId === null) {\n throw createInvalidStateError();\n }\n if (!isAudioContextRunning) {\n resume();\n eventTarget.dispatchEvent(new Event('resume'));\n }\n },\n start(timeslice) {\n var _a;\n if (promisedAudioNodesAndEncoderId !== null) {\n throw createInvalidStateError();\n }\n if (mediaStream.getVideoTracks().length > 0) {\n throw createNotSupportedError();\n }\n eventTarget.dispatchEvent(new Event('start'));\n const audioTracks = mediaStream.getAudioTracks();\n // @todo TypeScript v4.4.2 removed the channelCount property from the MediaTrackSettings interface.\n const channelCount = audioTracks.length === 0\n ? 2\n : (_a = audioTracks[0].getSettings().channelCount) !== null && _a !== void 0 ? _a : 2;\n promisedAudioNodesAndEncoderId = Promise.all([\n resume(),\n promisedAudioWorkletModule.then(() => createPromisedAudioNodesEncoderIdAndPort(audioBuffer, audioContext, channelCount, mediaStream, mimeType))\n ]).then(async ([, { audioBufferSourceNode, encoderId, mediaStreamAudioSourceNode, port, recorderAudioWorkletNode }]) => {\n mediaStreamAudioSourceNode.connect(recorderAudioWorkletNode);\n await new Promise((resolve) => {\n audioBufferSourceNode.onended = resolve;\n audioBufferSourceNode.connect(recorderAudioWorkletNode);\n audioBufferSourceNode.start(audioContext.currentTime + length / audioContext.sampleRate);\n });\n audioBufferSourceNode.disconnect(recorderAudioWorkletNode);\n // Bug #17: Safari does throttle the processing on hidden tabs if there is no active audio output.\n const constantSourceNode = new ConstantSourceNode(audioContext, { offset: 0 });\n constantSourceNode.onended = () => constantSourceNode.disconnect();\n constantSourceNode.connect(audioContext.destination);\n constantSourceNode.start();\n await recorderAudioWorkletNode.record(port);\n if (timeslice !== undefined) {\n promisedPartialRecording = requestNextPartialRecording(encoderId, timeslice);\n }\n return { constantSourceNode, encoderId, mediaStreamAudioSourceNode, recorderAudioWorkletNode };\n });\n const tracks = mediaStream.getTracks();\n abortRecording = () => {\n stop();\n eventTarget.dispatchEvent(new ErrorEvent('error', { error: createInvalidModificationError() }));\n };\n mediaStream.addEventListener('addtrack', abortRecording);\n mediaStream.addEventListener('removetrack', abortRecording);\n intervalId = setInterval(() => {\n const currentTracks = mediaStream.getTracks();\n if ((currentTracks.length !== tracks.length || currentTracks.some((track, index) => track !== tracks[index])) &&\n abortRecording !== null) {\n abortRecording();\n }\n }, 1000);\n },\n stop\n };\n };\n};\n//# sourceMappingURL=web-audio-media-recorder.js.map","export class MultiBufferDataView {\n constructor(buffers, byteOffset = 0, byteLength) {\n if (byteOffset < 0 || (byteLength !== undefined && byteLength < 0)) {\n throw new RangeError();\n }\n const availableBytes = buffers.reduce((length, buffer) => length + buffer.byteLength, 0);\n if (byteOffset > availableBytes || (byteLength !== undefined && byteOffset + byteLength > availableBytes)) {\n throw new RangeError();\n }\n const dataViews = [];\n const effectiveByteLength = byteLength === undefined ? availableBytes - byteOffset : byteLength;\n const truncatedBuffers = [];\n let consumedByteLength = 0;\n let truncatedByteOffset = byteOffset;\n for (const buffer of buffers) {\n if (truncatedBuffers.length === 0) {\n if (buffer.byteLength > truncatedByteOffset) {\n consumedByteLength = buffer.byteLength - truncatedByteOffset;\n const byteLengthOfDataView = consumedByteLength > effectiveByteLength ? effectiveByteLength : consumedByteLength;\n dataViews.push(new DataView(buffer, truncatedByteOffset, byteLengthOfDataView));\n truncatedBuffers.push(buffer);\n }\n else {\n truncatedByteOffset -= buffer.byteLength;\n }\n }\n else if (consumedByteLength < effectiveByteLength) {\n consumedByteLength += buffer.byteLength;\n const byteLengthOfDataView = consumedByteLength > effectiveByteLength\n ? buffer.byteLength - consumedByteLength + effectiveByteLength\n : buffer.byteLength;\n dataViews.push(new DataView(buffer, 0, byteLengthOfDataView));\n truncatedBuffers.push(buffer);\n }\n }\n this._buffers = truncatedBuffers;\n this._byteLength = effectiveByteLength;\n this._byteOffset = truncatedByteOffset;\n this._dataViews = dataViews;\n this._internalBuffer = new DataView(new ArrayBuffer(8));\n }\n get buffers() {\n return this._buffers;\n }\n get byteLength() {\n return this._byteLength;\n }\n get byteOffset() {\n return this._byteOffset;\n }\n getFloat32(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n this._internalBuffer.setUint8(2, this.getUint8(byteOffset + 2));\n this._internalBuffer.setUint8(3, this.getUint8(byteOffset + 3));\n return this._internalBuffer.getFloat32(0, littleEndian);\n }\n getFloat64(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n this._internalBuffer.setUint8(2, this.getUint8(byteOffset + 2));\n this._internalBuffer.setUint8(3, this.getUint8(byteOffset + 3));\n this._internalBuffer.setUint8(4, this.getUint8(byteOffset + 4));\n this._internalBuffer.setUint8(5, this.getUint8(byteOffset + 5));\n this._internalBuffer.setUint8(6, this.getUint8(byteOffset + 6));\n this._internalBuffer.setUint8(7, this.getUint8(byteOffset + 7));\n return this._internalBuffer.getFloat64(0, littleEndian);\n }\n getInt16(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n return this._internalBuffer.getInt16(0, littleEndian);\n }\n getInt32(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n this._internalBuffer.setUint8(2, this.getUint8(byteOffset + 2));\n this._internalBuffer.setUint8(3, this.getUint8(byteOffset + 3));\n return this._internalBuffer.getInt32(0, littleEndian);\n }\n getInt8(byteOffset) {\n const [dataView, byteOffsetOfDataView] = this._findDataViewWithOffset(byteOffset);\n return dataView.getInt8(byteOffset - byteOffsetOfDataView);\n }\n getUint16(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n return this._internalBuffer.getUint16(0, littleEndian);\n }\n getUint32(byteOffset, littleEndian) {\n this._internalBuffer.setUint8(0, this.getUint8(byteOffset + 0));\n this._internalBuffer.setUint8(1, this.getUint8(byteOffset + 1));\n this._internalBuffer.setUint8(2, this.getUint8(byteOffset + 2));\n this._internalBuffer.setUint8(3, this.getUint8(byteOffset + 3));\n return this._internalBuffer.getUint32(0, littleEndian);\n }\n getUint8(byteOffset) {\n const [dataView, byteOffsetOfDataView] = this._findDataViewWithOffset(byteOffset);\n return dataView.getUint8(byteOffset - byteOffsetOfDataView);\n }\n setFloat32(byteOffset, value, littleEndian) {\n this._internalBuffer.setFloat32(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n this.setUint8(byteOffset + 2, this._internalBuffer.getUint8(2));\n this.setUint8(byteOffset + 3, this._internalBuffer.getUint8(3));\n }\n setFloat64(byteOffset, value, littleEndian) {\n this._internalBuffer.setFloat64(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n this.setUint8(byteOffset + 2, this._internalBuffer.getUint8(2));\n this.setUint8(byteOffset + 3, this._internalBuffer.getUint8(3));\n this.setUint8(byteOffset + 4, this._internalBuffer.getUint8(4));\n this.setUint8(byteOffset + 5, this._internalBuffer.getUint8(5));\n this.setUint8(byteOffset + 6, this._internalBuffer.getUint8(6));\n this.setUint8(byteOffset + 7, this._internalBuffer.getUint8(7));\n }\n setInt16(byteOffset, value, littleEndian) {\n this._internalBuffer.setInt16(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n }\n setInt32(byteOffset, value, littleEndian) {\n this._internalBuffer.setInt32(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n this.setUint8(byteOffset + 2, this._internalBuffer.getUint8(2));\n this.setUint8(byteOffset + 3, this._internalBuffer.getUint8(3));\n }\n setInt8(byteOffset, value) {\n const [dataView, byteOffsetOfDataView] = this._findDataViewWithOffset(byteOffset);\n dataView.setInt8(byteOffset - byteOffsetOfDataView, value);\n }\n setUint16(byteOffset, value, littleEndian) {\n this._internalBuffer.setUint16(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n }\n setUint32(byteOffset, value, littleEndian) {\n this._internalBuffer.setUint32(0, value, littleEndian);\n this.setUint8(byteOffset, this._internalBuffer.getUint8(0));\n this.setUint8(byteOffset + 1, this._internalBuffer.getUint8(1));\n this.setUint8(byteOffset + 2, this._internalBuffer.getUint8(2));\n this.setUint8(byteOffset + 3, this._internalBuffer.getUint8(3));\n }\n setUint8(byteOffset, value) {\n const [dataView, byteOffsetOfDataView] = this._findDataViewWithOffset(byteOffset);\n dataView.setUint8(byteOffset - byteOffsetOfDataView, value);\n }\n _findDataViewWithOffset(byteOffset) {\n let byteOffsetOfDataView = 0;\n for (const dataView of this._dataViews) {\n const byteOffsetOfNextDataView = byteOffsetOfDataView + dataView.byteLength;\n if (byteOffset >= byteOffsetOfDataView && byteOffset < byteOffsetOfNextDataView) {\n return [dataView, byteOffsetOfDataView];\n }\n byteOffsetOfDataView = byteOffsetOfNextDataView;\n }\n throw new RangeError();\n }\n}\n//# sourceMappingURL=multi-buffer-data-view.js.map","import { encode, instantiate } from 'media-encoder-host';\nimport { MultiBufferDataView } from 'multi-buffer-data-view';\nimport { on } from 'subscribable-things';\nexport const createWebmPcmMediaRecorderFactory = (createBlobEvent, createInvalidModificationError, createNotSupportedError, decodeWebMChunk, readVariableSizeInteger) => {\n return (eventTarget, nativeMediaRecorderConstructor, mediaStream, mimeType) => {\n const audioTracks = mediaStream.getAudioTracks();\n const bufferedArrayBuffers = [];\n // @todo TypeScript v4.4.2 removed the channelCount property from the MediaTrackSettings interface.\n const channelCount = audioTracks.length === 0\n ? undefined\n : audioTracks[0].getSettings().channelCount;\n const nativeMediaRecorder = new nativeMediaRecorderConstructor(mediaStream, { mimeType: 'audio/webm;codecs=pcm' });\n const sampleRate = audioTracks.length === 0 ? undefined : audioTracks[0].getSettings().sampleRate;\n let promisedPartialRecording = null;\n let stopRecording = () => { }; // tslint:disable-line:no-empty\n const dispatchDataAvailableEvent = (arrayBuffers) => {\n eventTarget.dispatchEvent(createBlobEvent('dataavailable', { data: new Blob(arrayBuffers, { type: mimeType }) }));\n };\n const requestNextPartialRecording = async (encoderId, timeslice) => {\n const arrayBuffers = await encode(encoderId, timeslice);\n if (nativeMediaRecorder.state === 'inactive') {\n bufferedArrayBuffers.push(...arrayBuffers);\n }\n else {\n dispatchDataAvailableEvent(arrayBuffers);\n promisedPartialRecording = requestNextPartialRecording(encoderId, timeslice);\n }\n };\n const stop = () => {\n if (nativeMediaRecorder.state === 'inactive') {\n return;\n }\n if (promisedPartialRecording !== null) {\n promisedPartialRecording.catch(() => {\n /* @todo Only catch the errors caused by a duplicate call to encode. */\n });\n promisedPartialRecording = null;\n }\n stopRecording();\n stopRecording = () => { }; // tslint:disable-line:no-empty\n nativeMediaRecorder.stop();\n };\n nativeMediaRecorder.addEventListener('error', () => {\n stop();\n // Bug #3 & #4: Chrome throws an error event without any error.\n eventTarget.dispatchEvent(new ErrorEvent('error', { error: createInvalidModificationError() }));\n });\n nativeMediaRecorder.addEventListener('start', () => eventTarget.dispatchEvent(new Event('start')));\n return {\n get mimeType() {\n return mimeType;\n },\n get state() {\n return nativeMediaRecorder.state;\n },\n pause() {\n return nativeMediaRecorder.pause();\n },\n resume() {\n return nativeMediaRecorder.resume();\n },\n start(timeslice) {\n /*\n * Bug #6: Chrome will emit a blob without any data when asked to encode a MediaStream with a video track into an audio\n * codec.\n */\n if (mediaStream.getVideoTracks().length > 0) {\n throw createNotSupportedError();\n }\n if (nativeMediaRecorder.state === 'inactive') {\n if (sampleRate === undefined) {\n throw new Error('The sampleRate is not defined.');\n }\n let isRecording = false;\n let isStopped = false;\n // Bug #9: Chrome sometimes fires more than one dataavailable event while being inactive.\n let pendingInvocations = 0;\n let promisedDataViewElementTypeEncoderIdAndPort = instantiate(mimeType, sampleRate);\n stopRecording = () => {\n isStopped = true;\n };\n const removeEventListener = on(nativeMediaRecorder, 'dataavailable')(({ data }) => {\n pendingInvocations += 1;\n promisedDataViewElementTypeEncoderIdAndPort = promisedDataViewElementTypeEncoderIdAndPort.then(async ({ dataView = null, elementType = null, encoderId, port }) => {\n const arrayBuffer = await data.arrayBuffer();\n pendingInvocations -= 1;\n const currentDataView = dataView === null\n ? new MultiBufferDataView([arrayBuffer])\n : new MultiBufferDataView([...dataView.buffers, arrayBuffer], dataView.byteOffset);\n if (!isRecording && nativeMediaRecorder.state === 'recording' && !isStopped) {\n const lengthAndValue = readVariableSizeInteger(currentDataView, 0);\n if (lengthAndValue === null) {\n return { dataView: currentDataView, elementType, encoderId, port };\n }\n const { value } = lengthAndValue;\n if (value !== 172351395) {\n return { dataView, elementType, encoderId, port };\n }\n isRecording = true;\n }\n const { currentElementType, offset, contents } = decodeWebMChunk(currentDataView, elementType, channelCount);\n const remainingDataView = offset < currentDataView.byteLength\n ? new MultiBufferDataView(currentDataView.buffers, currentDataView.byteOffset + offset)\n : null;\n contents.forEach((content) => port.postMessage(content, content.map(({ buffer }) => buffer)));\n if (pendingInvocations === 0 && (nativeMediaRecorder.state === 'inactive' || isStopped)) {\n encode(encoderId, null).then((arrayBuffers) => {\n dispatchDataAvailableEvent([...bufferedArrayBuffers, ...arrayBuffers]);\n bufferedArrayBuffers.length = 0;\n eventTarget.dispatchEvent(new Event('stop'));\n });\n port.postMessage([]);\n port.close();\n removeEventListener();\n }\n return { dataView: remainingDataView, elementType: currentElementType, encoderId, port };\n });\n });\n if (timeslice !== undefined) {\n promisedDataViewElementTypeEncoderIdAndPort.then(({ encoderId }) => (promisedPartialRecording = requestNextPartialRecording(encoderId, timeslice)));\n }\n }\n nativeMediaRecorder.start(100);\n },\n stop\n };\n };\n};\n//# sourceMappingURL=webm-pcm-media-recorder.js.map","export const createWindow = () => (typeof window === 'undefined' ? null : window);\n//# sourceMappingURL=window.js.map","export const readVariableSizeIntegerLength = (dataView, offset) => {\n if (offset >= dataView.byteLength) {\n return null;\n }\n const byte = dataView.getUint8(offset);\n if (byte > 127) {\n return 1;\n }\n if (byte > 63) {\n return 2;\n }\n if (byte > 31) {\n return 3;\n }\n if (byte > 15) {\n return 4;\n }\n if (byte > 7) {\n return 5;\n }\n if (byte > 3) {\n return 6;\n }\n if (byte > 1) {\n return 7;\n }\n if (byte > 0) {\n return 8;\n }\n const length = readVariableSizeIntegerLength(dataView, offset + 1);\n return length === null ? null : length + 8;\n};\n//# sourceMappingURL=read-variable-size-integer-length.js.map","export const wrapEventListener = (target, eventListener) => {\n return (event) => {\n const descriptor = { value: target };\n Object.defineProperties(event, {\n currentTarget: descriptor,\n target: descriptor\n });\n if (typeof eventListener === 'function') {\n return eventListener.call(target, event);\n }\n return eventListener.handleEvent.call(target, event);\n };\n};\n//# sourceMappingURL=wrap-event-listener.js.map","import { register as rgstr } from 'media-encoder-host';\nimport { createBlobEventFactory } from './factories/blob-event-factory';\nimport { createDecodeWebMChunk } from './factories/decode-web-m-chunk';\nimport { createEventTargetConstructor } from './factories/event-target-constructor';\nimport { createEventTargetFactory } from './factories/event-target-factory';\nimport { createInvalidModificationError } from './factories/invalid-modification-error';\nimport { createInvalidStateError } from './factories/invalid-state-error';\nimport { createIsSupportedPromise } from './factories/is-supported-promise';\nimport { createMediaRecorderConstructor } from './factories/media-recorder-constructor';\nimport { createNativeBlobEventConstructor } from './factories/native-blob-event-constructor';\nimport { createNativeMediaRecorderFactory } from './factories/native-media-recorder';\nimport { createNativeMediaRecorderConstructor } from './factories/native-media-recorder-constructor';\nimport { createNotSupportedError } from './factories/not-supported-error';\nimport { createReadElementContent } from './factories/read-element-content';\nimport { createReadElementType } from './factories/read-element-type';\nimport { createReadVariableSizeInteger } from './factories/read-variable-size-integer';\nimport { createWebAudioMediaRecorderFactory } from './factories/web-audio-media-recorder';\nimport { createWebmPcmMediaRecorderFactory } from './factories/webm-pcm-media-recorder';\nimport { createWindow } from './factories/window';\nimport { readVariableSizeIntegerLength } from './functions/read-variable-size-integer-length';\nimport { wrapEventListener } from './functions/wrap-event-listener';\n/*\n * @todo Explicitly referencing the barrel file seems to be necessary when enabling the\n * isolatedModules compiler option.\n */\nexport * from './interfaces/index';\nexport * from './types/index';\nconst encoderRegexes = [];\nconst window = createWindow();\nconst nativeBlobEventConstructor = createNativeBlobEventConstructor(window);\nconst createBlobEvent = createBlobEventFactory(nativeBlobEventConstructor);\nconst createWebAudioMediaRecorder = createWebAudioMediaRecorderFactory(createBlobEvent, createInvalidModificationError, createInvalidStateError, createNotSupportedError);\nconst readVariableSizeInteger = createReadVariableSizeInteger(readVariableSizeIntegerLength);\nconst readElementContent = createReadElementContent(readVariableSizeInteger);\nconst readElementType = createReadElementType(readVariableSizeInteger);\nconst decodeWebMChunk = createDecodeWebMChunk(readElementContent, readElementType);\nconst createWebmPcmMediaRecorder = createWebmPcmMediaRecorderFactory(createBlobEvent, createInvalidModificationError, createNotSupportedError, decodeWebMChunk, readVariableSizeInteger);\nconst createEventTarget = createEventTargetFactory(window);\nconst nativeMediaRecorderConstructor = createNativeMediaRecorderConstructor(window);\nconst createNativeMediaRecorder = createNativeMediaRecorderFactory(createInvalidModificationError, createNotSupportedError);\nconst mediaRecorderConstructor = createMediaRecorderConstructor(createNativeMediaRecorder, createNotSupportedError, createWebAudioMediaRecorder, createWebmPcmMediaRecorder, encoderRegexes, createEventTargetConstructor(createEventTarget, wrapEventListener), nativeMediaRecorderConstructor);\nexport { mediaRecorderConstructor as MediaRecorder };\nexport const isSupported = () => createIsSupportedPromise(window);\nexport const register = async (port) => {\n encoderRegexes.push(await rgstr(port));\n};\n//# sourceMappingURL=module.js.map","\"use strict\";var __awaiter=(this&&this.__awaiter)||function(thisArg,_arguments,P,generator){function adopt(value){return value instanceof P?value:new P(function(resolve){resolve(value);});}\nreturn new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value));}catch(e){reject(e);}}\nfunction rejected(value){try{step(generator[\"throw\"](value));}catch(e){reject(e);}}\nfunction step(result){result.done?resolve(result.value):adopt(result.value).then(fulfilled,rejected);}\nstep((generator=generator.apply(thisArg,_arguments||[])).next());});};var __generator=(this&&this.__generator)||function(thisArg,body){var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1];},trys:[],ops:[]},f,y,t,g;return g={next:verb(0),\"throw\":verb(1),\"return\":verb(2)},typeof Symbol===\"function\"&&(g[Symbol.iterator]=function(){return this;}),g;function verb(n){return function(v){return step([n,v]);};}\nfunction step(op){if(f)throw new TypeError(\"Generator is already executing.\");while(_)try{if(f=1,y&&(t=op[0]&2?y[\"return\"]:op[0]?y[\"throw\"]||((t=y[\"return\"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue;}\nif(op[0]===3&&(!t||(op[1]>t[0]&&op[1]0){console.error(\"The constraints \"+unSupportedConstraints.join(\",\")+\" doesn't support on this browser. Please check your ReactMediaRecorder component.\");}};if(typeof audio===\"object\"){checkConstraints(audio);}\nif(typeof video===\"object\"){checkConstraints(video);}\nif(mediaRecorderOptions&&mediaRecorderOptions.mimeType){if(!MediaRecorder.isTypeSupported(mediaRecorderOptions.mimeType)){console.error(\"The specified MIME type you supplied for MediaRecorder doesn't support this browser\");}}\nif(!mediaStream.current&&askPermissionOnMount){getMediaStream();}\nreturn function(){if(mediaStream.current){var tracks=mediaStream.current.getTracks();tracks.forEach(function(track){return track.clone().stop();});}};},[audio,screen,video,getMediaStream,mediaRecorderOptions,askPermissionOnMount,]);var startRecording=function(){return __awaiter(_this,void 0,void 0,function(){var isStreamEnded;return __generator(this,function(_a){switch(_a.label){case 0:setError(\"NONE\");if(!!mediaStream.current)return[3,2];return[4,getMediaStream()];case 1:_a.sent();_a.label=2;case 2:if(!mediaStream.current)return[3,5];isStreamEnded=mediaStream.current.getTracks().some(function(track){return track.readyState===\"ended\";});if(!isStreamEnded)return[3,4];return[4,getMediaStream()];case 3:_a.sent();_a.label=4;case 4:if(!mediaStream.current.active){return[2];}\nmediaRecorder.current=new extendable_media_recorder_1.MediaRecorder(mediaStream.current,mediaRecorderOptions||undefined);mediaRecorder.current.ondataavailable=onRecordingActive;mediaRecorder.current.onstop=onRecordingStop;mediaRecorder.current.onstart=onRecordingStart;mediaRecorder.current.onerror=function(){setError(\"NO_RECORDER\");setStatus(\"idle\");};mediaRecorder.current.start();setStatus(\"recording\");_a.label=5;case 5:return[2];}});});};var onRecordingActive=function(_a){var data=_a.data;mediaChunks.current.push(data);};var onRecordingStart=function(){onStart();};var onRecordingStop=function(){var chunk=mediaChunks.current[0];var blobProperty=Object.assign({type:chunk.type},blobPropertyBag||(video?{type:\"video/mp4\"}:{type:\"audio/wav\"}));var blob=new Blob(mediaChunks.current,blobProperty);var url=URL.createObjectURL(blob);setStatus(\"stopped\");setMediaBlobUrl(url);onStop(url,blob);};var muteAudio=function(mute){setIsAudioMuted(mute);if(mediaStream.current){mediaStream.current.getAudioTracks().forEach(function(audioTrack){return(audioTrack.enabled=!mute);});}};var pauseRecording=function(){if(mediaRecorder.current&&mediaRecorder.current.state===\"recording\"){setStatus(\"paused\");mediaRecorder.current.pause();}};var resumeRecording=function(){if(mediaRecorder.current&&mediaRecorder.current.state===\"paused\"){setStatus(\"recording\");mediaRecorder.current.resume();}};var stopRecording=function(){if(mediaRecorder.current){if(mediaRecorder.current.state!==\"inactive\"){setStatus(\"stopping\");mediaRecorder.current.stop();if(stopStreamsOnStop){mediaStream.current&&mediaStream.current.getTracks().forEach(function(track){return track.stop();});}\nmediaChunks.current=[];}}};return{error:RecorderErrors[error],muteAudio:function(){return muteAudio(true);},unMuteAudio:function(){return muteAudio(false);},startRecording:startRecording,pauseRecording:pauseRecording,resumeRecording:resumeRecording,stopRecording:stopRecording,mediaBlobUrl:mediaBlobUrl,status:status,isAudioMuted:isAudioMuted,previewStream:mediaStream.current?new MediaStream(mediaStream.current.getVideoTracks()):null,previewAudioStream:mediaStream.current?new MediaStream(mediaStream.current.getAudioTracks()):null,clearBlobUrl:function(){if(mediaBlobUrl){URL.revokeObjectURL(mediaBlobUrl);}\nsetMediaBlobUrl(undefined);setStatus(\"idle\");},};}\nexports.useReactMediaRecorder=useReactMediaRecorder;var ReactMediaRecorder=function(props){return props.render(useReactMediaRecorder(props));};exports.ReactMediaRecorder=ReactMediaRecorder;","module.exports = require(\"./lib\");\n"],"names":["createAddUniqueNumber","generateUniqueNumber","set","number","createCache","lastNumberWeakMap","collection","nextNumber","MAX_SAFE_INTEGER","TWO_TO_THE_POWER_OF_TWENTY_NINE","TWO_TO_THE_POWER_OF_THIRTY","createGenerateUniqueNumber","cache","lastNumber","LAST_NUMBER_WEAK_MAP","addUniqueNumber","encoderIds","wrap","createBroker","call","port","encoderId","timeslice","arrayBuffers","mimeType","sampleRate","load","url","worker","blob","mediaEncoderHost","loadWorker","encode","instantiate","register","createBlobEventFactory","nativeBlobEventConstructor","type","blobEventInit","data","eventInit","fakeBlobEvent","createDecodeWebMChunk","readElementContent","readElementType","dataView","elementType","channelCount","contents","currentElementType","offset","lengthAndType","length","contentAndLength","content","createEventTargetConstructor","createEventTarget","wrapEventListener","nativeEventTarget","listener","options","wrappedEventListener","event","createEventTargetFactory","window","createInvalidModificationError","message","err","createInvalidStateError","createIsSupportedPromise","resolve","canvasElement","mediaStream","mediaRecorder","createMediaRecorderConstructor","createNativeMediaRecorder","createNotSupportedError","createWebAudioMediaRecorder","createWebmPcmMediaRecorder","encoderRegexes","eventTargetConstructor","nativeMediaRecorderConstructor","stream","internalMediaRecorder","regex","value","boundListener","createNativeBlobEventConstructor","createNativeMediaRecorderFactory","mediaRecorderOptions","bufferedBlobs","dataAvailableListeners","errorListeners","nativeMediaRecorder","stopListeners","isActive","addEventListener","patchedEventListener","dispatchEvent","wasActive","returnValue","removeEventListener","dataAvailableListener","errorListener","stopListener","start","createNativeMediaRecorderConstructor","createReadElementContent","readVariableSizeInteger","lengthAndValue","numberOfSamples","i","elementOffset","j","createReadElementType","createReadVariableSizeInteger","readVariableSizeIntegerLength","firstDataByteOffset","JSON_RPC_ERROR_CODES","compile","createAddRecorderAudioWorkletModule","blobConstructor","urlConstructor","worklet","addAudioWorkletModule","createListener","ongoingRequests","id","ongoingRequest","reject","createPostMessageFactory","transferables","createRecorderAudioWorkletNodeFactory","createPostMessage","on","validateState","audioWorkletNodeConstructor","context","audioWorkletNode","postMessage","unsubscribe","state","encoderPort","expectedStates","currentState","expectedState","addRecorderAudioWorkletModule","createRecorderAudioWorkletNode","ERROR_MESSAGE","createPromisedAudioNodesEncoderIdAndPort","audioBuffer","audioContext","AudioWorkletNode","audioBufferSourceNode","AudioBufferSourceNode","mediaStreamAudioSourceNode","MediaStreamAudioSourceNode","recorderAudioWorkletNode","createWebAudioMediaRecorderFactory","createBlobEvent","eventTarget","_a","MinimalAudioContext","AudioBuffer","bufferedArrayBuffers","promisedAudioWorkletModule","abortRecording","intervalId","promisedAudioNodesAndEncoderId","promisedPartialRecording","isAudioContextRunning","dispatchDataAvailableEvent","requestNextPartialRecording","resume","stop","constantSourceNode","suspend","audioTracks","ConstantSourceNode","tracks","currentTracks","track","index","MultiBufferDataView","buffers","byteOffset","byteLength","availableBytes","buffer","dataViews","effectiveByteLength","truncatedBuffers","consumedByteLength","truncatedByteOffset","byteLengthOfDataView","littleEndian","byteOffsetOfDataView","byteOffsetOfNextDataView","createWebmPcmMediaRecorderFactory","decodeWebMChunk","stopRecording","isRecording","isStopped","pendingInvocations","promisedDataViewElementTypeEncoderIdAndPort","arrayBuffer","currentDataView","remainingDataView","createWindow","byte","target","eventListener","descriptor","mediaRecorderConstructor","isSupported","rgstr","__awaiter","this","thisArg","_arguments","P","generator","adopt","fulfilled","step","e","rejected","result","__generator","body","_","t","f","y","g","verb","n","v","op","exports","extendable_media_recorder_1","require$$0","react_1","require$$1","extendable_media_recorder_wav_encoder_1","require$$2","RecorderErrors","useReactMediaRecorder","_this","_b","audio","_c","video","_d","selfBrowserSurface","_e","onStop","_f","onStart","blobPropertyBag","_g","screen","_h","_j","customMediaStream","_k","stopStreamsOnStop","_l","askPermissionOnMount","mediaChunks","_m","status","setStatus","_o","isAudioMuted","setIsAudioMuted","_p","mediaBlobUrl","setMediaBlobUrl","_q","error","setError","_r","init","setInit","setup","getMediaStream","requiredMedia","stream_1","audioStream","error_1","audioTrack","checkConstraints","mediaType","supportedMediaConstraints","unSupportedConstraints","constraint","startRecording","isStreamEnded","onRecordingActive","onRecordingStop","onRecordingStart","chunk","blobProperty","muteAudio","mute","pauseRecording","resumeRecording","ReactMediaRecorder","props","reactMediaRecorder"],"mappings":"yvBAAO,MAAMA,GAAyBC,GAC1BC,GAAQ,CACZ,MAAMC,EAASF,EAAqBC,CAAG,EACvC,OAAAA,EAAI,IAAIC,CAAM,EACPA,CACV,ECLQC,GAAeC,GACjB,CAACC,EAAYC,KAChBF,EAAkB,IAAIC,EAAYC,CAAU,EACrCA,GCCTC,GAAm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