opus-codec-worker 1.0.9 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opus-codec-worker",
3
3
  "license": "MIT",
4
- "version": "1.0.9",
4
+ "version": "2.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/VictorQueiroz/js-opus-codec.git"
@@ -1 +1 @@
1
- (()=>{"use strict";class t extends Error{constructor(t){super(t)}}function e({name:e,value:r,validations:n}){const i=new Array;if(n.integer&&!Number.isSafeInteger(r)&&i.push("It must be an integer."),r>n.max&&i.push(`It must be up to ${n.max}.`),r<n.min&&i.push(`It must be at least ${n.min}.`),i.length>0)throw new t([`"${r}" is not a valid value for ${e}. It failed to following validations:\n`,...i.map(t=>`\t- ${t}`)].join(""));return r}var r,n,i,o,a,s,u,l,f,c,h,p,y,m,b,d=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},v=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const w=4294967295;class g{constructor({frameSize:f,frameCacheSize:c=0,preallocateFrameCount:h=10,TypedArrayConstructor:p}){if(r.add(this),n.set(this,void 0),i.set(this,void 0),o.set(this,void 0),a.set(this,void 0),s.set(this,void 0),u.set(this,void 0),l.set(this,void 0),d(this,a,e({value:f,name:"Frame Size",validations:{min:1,integer:!0,max:w}}),"f"),d(this,i,e({value:h,name:"Preallocate Frame Count",validations:{min:1,integer:!0,max:w}}),"f"),d(this,o,e({value:c,name:"Frame Cache Size",validations:{min:0,integer:!1,max:w}}),"f"),!("BYTES_PER_ELEMENT"in p))throw new t("TypedArrayConstructor must be a typed array");d(this,u,0,"f"),d(this,l,0,"f"),d(this,n,p,"f"),d(this,s,new ArrayBuffer(v(this,r,"m",b).call(this)),"f")}empty(){return v(this,r,"m",h).call(this)<v(this,a,"f")}peek(){return v(this,r,"m",f).call(this)}write(t){v(this,r,"m",m).call(this,t.length),v(this,r,"m",f).call(this).subarray(v(this,l,"f"),v(this,l,"f")+t.length).set(t),d(this,l,v(this,l,"f")+t.length,"f")}remainingFrames(){return Math.floor(v(this,r,"m",c).call(this))}drain(){return v(this,r,"m",y).call(this,v(this,r,"m",h).call(this))}read(){return v(this,r,"m",y).call(this,v(this,a,"f"))}get[(n=new WeakMap,i=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakMap,u=new WeakMap,l=new WeakMap,r=new WeakSet,f=function(){return new(v(this,n,"f"))(v(this,s,"f"))},c=function(){return v(this,r,"m",h).call(this)/v(this,a,"f")},h=function(){return v(this,l,"f")-v(this,u,"f")},p=function(){return v(this,o,"f")>0&&v(this,r,"m",c).call(this)>=v(this,o,"f")},y=function(t){if(!t)return null;if(v(this,r,"m",h).call(this)<t)return null;let e=v(this,r,"m",f).call(this).subarray(v(this,u,"f"),v(this,u,"f")+t);if(d(this,u,v(this,u,"f")+t,"f"),v(this,u,"f")===v(this,l,"f")&&(d(this,l,0,"f"),d(this,u,0,"f")),v(this,r,"m",p).call(this)){const t=this.drain();t&&(e=e.slice(0),this.write(t))}return e},m=function(t){const e=t*v(this,n,"f").BYTES_PER_ELEMENT;if(v(this,r,"m",f).call(this).length-v(this,l,"f")<=t){const t=v(this,s,"f");d(this,s,new ArrayBuffer(t.byteLength+e+v(this,r,"m",b).call(this)),"f"),v(this,r,"m",f).call(this).set(new(v(this,n,"f"))(t))}return v(this,r,"m",f).call(this).subarray(v(this,u,"f"),v(this,u,"f")+v(this,a,"f"))},b=function(){return v(this,a,"f")*v(this,n,"f").BYTES_PER_ELEMENT*v(this,i,"f")},Symbol.toStringTag)](){return"RingBuffer"}[Symbol.iterator](){return this[Symbol.asyncIterator]()}*[Symbol.asyncIterator](){let t;do{t=this.read(),null!==t&&(yield t)}while(null!==t)}}class S extends g{constructor(t,e={}){super(Object.assign(Object.assign({},e),{frameSize:t,TypedArrayConstructor:Float32Array}))}get[Symbol.toStringTag](){return"RingBufferF32"}}function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k(n.key),n)}}function O(t){var e="function"==typeof Map?new Map:void 0;return O=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(P())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&M(i,r.prototype),i}(t,arguments,A(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),M(r,t)},O(t)}function P(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(P=function(){return!!t})()}function M(t,e){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},M(t,e)}function A(t){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},A(t)}function k(t){var e=function(t){if("object"!=E(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==E(e)?e:e+""}function _(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function C(t,e,r){return t.set(W(t,e),r),r}function x(t,e){return t.get(W(t,e))}function W(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}function F(t){var e=t.length;if(0===e)return new Float32Array(0);for(var r=t[0].length,n=1;n<e;n++)if(t[n].length!==r)throw new Error("Channel length mismatch");for(var i=new Float32Array(r*e),o=0,a=0;o<r;o++)for(var s=0;s<e;s++,a++)i[a]=t[s][o];return i}Symbol.toStringTag,Symbol.toStringTag,Symbol.toStringTag,Symbol.toStringTag,Symbol.toStringTag;var I=new WeakMap,B=new WeakMap,R=function(t){function e(){var t,r,n,i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),_(t=function(t,e,r){return e=A(e),function(t,e){if(e&&("object"==E(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,P()?Reflect.construct(e,r||[],A(t).constructor):e.apply(t,r))}(this,e),I,null),_(t,B,!0),r=t,i=function(e){e.data&&e.data.stop&&C(B,t,!1)},(n=k(n="onMessage"))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,t.port.addEventListener("message",t.onMessage),t.port.start(),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&M(t,e)}(e,t),r=e,i=[{key:"parameterDescriptors",get:function(){return[{name:"frameSize"}]}}],(n=[{key:"process",value:function(t,e,r){var n=r.frameSize[0];x(I,this)||C(I,this,new S(n)),t.length||console.error("no data available in input list: %o",t);var i,o=new Array,a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(a.s();!(i=a.n()).done;){var s=i.value;s.length&&o.push(F(s))}}catch(t){a.e(t)}finally{a.f()}x(I,this).write(F(o));var u,l=x(I,this).read();if(null!==l&&this.port.postMessage({samples:l}),!x(B,this))do{null!==(u=x(I,this).drain())&&this.port.postMessage({samples:u})}while(null!==u);return x(B,this)}}])&&j(r.prototype,n),i&&j(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(O(AudioWorkletProcessor));registerProcessor("default-audio-processor",R)})();
1
+ (()=>{"use strict";class t extends Error{constructor(t){super(t)}}function e({name:e,value:r,validations:n}){const i=new Array;if(n.integer&&!Number.isSafeInteger(r)&&i.push("It must be an integer."),r>n.max&&i.push(`It must be up to ${n.max}.`),r<n.min&&i.push(`It must be at least ${n.min}.`),i.length>0)throw new t([`"${r}" is not a valid value for ${e}. It failed to following validations:\n`,...i.map(t=>`\t- ${t}`)].join(""));return r}var r,n,i,o,a,s,u,l,f,c,h,p,y,m,w,v=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},b=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};const d=4294967295;class g{constructor({frameSize:f,frameCacheSize:c=0,preallocateFrameCount:h=10,TypedArrayConstructor:p}){if(r.add(this),n.set(this,void 0),i.set(this,void 0),o.set(this,void 0),a.set(this,void 0),s.set(this,void 0),u.set(this,void 0),l.set(this,void 0),v(this,a,e({value:f,name:"Frame Size",validations:{min:1,integer:!0,max:d}}),"f"),v(this,i,e({value:h,name:"Preallocate Frame Count",validations:{min:1,integer:!0,max:d}}),"f"),v(this,o,e({value:c,name:"Frame Cache Size",validations:{min:0,integer:!1,max:d}}),"f"),!("BYTES_PER_ELEMENT"in p))throw new t("TypedArrayConstructor must be a typed array");v(this,u,0,"f"),v(this,l,0,"f"),v(this,n,p,"f"),v(this,s,new ArrayBuffer(b(this,r,"m",w).call(this)),"f")}empty(){return b(this,r,"m",h).call(this)<b(this,a,"f")}peek(){return b(this,r,"m",f).call(this)}write(t){b(this,r,"m",m).call(this,t.length),b(this,r,"m",f).call(this).subarray(b(this,l,"f"),b(this,l,"f")+t.length).set(t),v(this,l,b(this,l,"f")+t.length,"f")}remainingFrames(){return Math.floor(b(this,r,"m",c).call(this))}drain(){return b(this,r,"m",y).call(this,b(this,r,"m",h).call(this))}read(){return b(this,r,"m",y).call(this,b(this,a,"f"))}get[(n=new WeakMap,i=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakMap,u=new WeakMap,l=new WeakMap,r=new WeakSet,f=function(){return new(b(this,n,"f"))(b(this,s,"f"))},c=function(){return b(this,r,"m",h).call(this)/b(this,a,"f")},h=function(){return b(this,l,"f")-b(this,u,"f")},p=function(){return b(this,o,"f")>0&&b(this,r,"m",c).call(this)>=b(this,o,"f")},y=function(t){if(!t)return null;if(b(this,r,"m",h).call(this)<t)return null;let e=b(this,r,"m",f).call(this).subarray(b(this,u,"f"),b(this,u,"f")+t);if(v(this,u,b(this,u,"f")+t,"f"),b(this,u,"f")===b(this,l,"f")&&(v(this,l,0,"f"),v(this,u,0,"f")),b(this,r,"m",p).call(this)){const t=this.drain();t&&(e=e.slice(0),this.write(t))}return e},m=function(t){const e=t*b(this,n,"f").BYTES_PER_ELEMENT;if(b(this,r,"m",f).call(this).length-b(this,l,"f")<=t){const t=b(this,s,"f");v(this,s,new ArrayBuffer(t.byteLength+e+b(this,r,"m",w).call(this)),"f"),b(this,r,"m",f).call(this).set(new(b(this,n,"f"))(t))}return b(this,r,"m",f).call(this).subarray(b(this,u,"f"),b(this,u,"f")+b(this,a,"f"))},w=function(){return b(this,a,"f")*b(this,n,"f").BYTES_PER_ELEMENT*b(this,i,"f")},Symbol.toStringTag)](){return"RingBuffer"}[Symbol.iterator](){return this[Symbol.asyncIterator]()}*[Symbol.asyncIterator](){let t;do{t=this.read(),null!==t&&(yield t)}while(null!==t)}}class S extends g{constructor(t,e={}){super(Object.assign(Object.assign({},e),{frameSize:t,TypedArrayConstructor:Float32Array}))}get[Symbol.toStringTag](){return"RingBufferF32"}}function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k(n.key),n)}}function k(t){var e=function(t){if("object"!=E(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==E(e)?e:e+""}function M(t,e){return t.get(P(t,e))}function P(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}Symbol.toStringTag,Symbol.toStringTag,Symbol.toStringTag,Symbol.toStringTag,Symbol.toStringTag;var C,O,W,A=new WeakMap,z=function(){return t=function t(e,r){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}(this,A,void 0),n=A,i=new Array,n.set(P(n,this),i);for(var o=0;o<r;o++)M(A,this).push(new S(e,{frameCacheSize:20}))},(e=[{key:"write",value:function(t){if(t.length!==M(A,this).length)throw new Error("Expected ".concat(M(A,this).length," channels, but got ").concat(t.length));for(var e=0;e<t.length;e++)M(A,this)[e].write(t[e])}},{key:"read",value:function(){for(var t=[],e=0;e<M(A,this).length;e++){var r=M(A,this)[e].read();if(null===r)return null;t.push(r.slice(0))}return t}},{key:"remainingFrames",value:function(){var t,e=[],r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return T(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(M(A,this));try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push(n.remainingFrames())}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"drain",value:function(){for(var t=[],e=0;e<M(A,this).length;e++){var r=M(A,this)[e].drain();if(null===r)return null;t.push(r.slice(0))}return t.length?t:null}}])&&j(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),_=function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r},x=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};function F(t,e){return t===e}new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap;class I{constructor(t,e=F){C.set(this,void 0),O.set(this,void 0),W.set(this,void 0),_(this,W,null,"f"),_(this,C,t,"f"),_(this,O,e,"f")}get(t){const e=x(this,W,"f");if(e&&x(this,O,"f").call(this,e.key,t))return e.value;const r=x(this,C,"f").call(this,t);return _(this,W,{key:t,value:r},"f"),r}}function B(t){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function $(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,D(n.key),n)}}function L(t){var e="function"==typeof Map?new Map:void 0;return L=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(N())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Y(i,r.prototype),i}(t,arguments,q(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Y(r,t)},L(t)}function N(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(N=function(){return!!t})()}function Y(t,e){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Y(t,e)}function q(t){return q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},q(t)}function D(t){var e=function(t){if("object"!=B(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=B(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==B(e)?e:e+""}function U(t,e,r){G(t,e),e.set(t,r)}function G(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function H(t,e){return t.get(J(t,e))}function J(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}C=new WeakMap,O=new WeakMap,W=new WeakMap;var K=new WeakMap,Q=new WeakMap,V=new WeakSet,X=function(t){function e(){var t,r,n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=function(t,e,r){return e=q(e),function(t,e){if(e&&("object"==B(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,N()?Reflect.construct(e,r||[],q(t).constructor):e.apply(t,r))}(this,e),G(r=t,n=V),n.add(r),U(t,K,new I(function(t){var e=t.frameSize,r=t.channelCount;return new z(e,r)},function(t,e){return t.frameSize===e.frameSize&&t.channelCount===e.channelCount})),U(t,Q,!0),function(t,e,r){(e=D(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(t,"onMessage",function(e){e.data&&e.data.stop&&function(t,e){t.set(J(t,e),!1)}(Q,t)}),t.port.addEventListener("message",t.onMessage),t.port.start(),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Y(t,e)}(e,t),r=e,i=[{key:"parameterDescriptors",get:function(){return[{name:"frameSize"},{name:"channelCount"},{name:"queueFrameCount"}]}}],(n=[{key:"process",value:function(t,e,r){var n,i,o,a=J(V,this,Z).call(this,"frameSize",r),s=J(V,this,Z).call(this,"channelCount",r),u=J(V,this,Z).call(this,"queueFrameCount",r),l=H(K,this).get({frameSize:a,channelCount:s}),f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return R(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(f.s();!(n=f.n()).done;){var c=n.value;c.length&&l.write(c)}}catch(t){f.e(t)}finally{f.f()}if(l.remainingFrames().some(function(t){return t<u}))return H(Q,this);do{null!==(i=l.read())&&this.port.postMessage({samples:i},i.map(function(t){return t.buffer}))}while(null!==i);if(!H(Q,this))do{null!==(o=l.drain())&&this.port.postMessage({samples:o})}while(null!==o);return H(Q,this)}}])&&$(r.prototype,n),i&&$(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(L(AudioWorkletProcessor));function Z(t,e){var r=e[t];if(!r||0===r.length)throw new Error("Parameter ".concat(t," is missing"));return r[0]}registerProcessor("default-audio-processor",X)})();