// Copyright (c) 2024 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
///
function r(r){return Object.keys(Object(r))}var e=void 0!==Object.keys;var t="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function n(){return t&&"symbol"==typeof Symbol.toStringTag}var i=Object.prototype.toString;var o=Object.prototype.hasOwnProperty;function a(r,e){return null!=r&&o.call(r,e)}var u="function"==typeof Symbol?Symbol:void 0,f="function"==typeof u?u.toStringTag:"";var l=n()?function(r){var e,t,n;if(null==r)return i.call(r);t=r[f],e=a(r,f);try{r[f]=void 0}catch(e){return i.call(r)}return n=i.call(r),e?r[f]=t:delete r[f],n}:function(r){return i.call(r)};function s(r){return"[object Arguments]"===l(r)}var h=function(){return s(arguments)}(),c="function"==typeof Object.defineProperty?Object.defineProperty:null;var m=Object.defineProperty;function p(r){return"number"==typeof r}function g(r){var e,t="";for(e=0;e0&&(e-=1),t=n.toExponential(e)):t=n.toPrecision(r.precision),r.alternate||(t=T.call(t,k,"$1e"),t=T.call(t,S,"e"),t=T.call(t,j,""));break;default:throw new Error("invalid double notation. Value: "+r.specifier)}return t=T.call(t,x,"e+0$1"),t=T.call(t,V,"e-0$1"),r.alternate&&(t=T.call(t,A,"$1."),t=T.call(t,F,"$1.e")),n>=0&&r.sign&&(t=r.sign+t),t=r.specifier===_.call(r.specifier)?_.call(t):E.call(t)}function R(r){var e,t="";for(e=0;e127)throw new Error("invalid character code. Value: "+n.arg);n.arg=I(o)?String(n.arg):B(o)}break;case"e":case"E":case"f":case"F":case"g":case"G":e||(n.precision=6),n.arg=L(n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=y(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(s=n.arg,h=n.width,c=n.padRight,m=void 0,(m=h-s.length)<0?s:s=c?s+R(m):R(m)+s)),a+=n.arg||"",u+=1}return a}var P=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function N(r){var e={mapping:r[1]?parseInt(r[1],10):void 0,flags:r[2],width:r[3],precision:r[5],specifier:r[6]};return"."===r[4]&&void 0===r[5]&&(e.precision="1"),e}function Y(r){var e,t,n,i;for(t=[],i=0,n=P.exec(r);n;)(e=r.slice(i,P.lastIndex-n[0].length)).length&&t.push(e),t.push(N(n)),i=P.lastIndex,n=P.exec(r);return(e=r.slice(i)).length&&t.push(e),t}function U(r){var e,t;if("string"!=typeof r)throw new TypeError(U("invalid argument. First argument must be a string. Value: `%s`.",r));for(e=[Y(r)],t=1;tmr&&gr(r)}function wr(r){return tr(r)&&yr(r)}function vr(r){return ar(r)&&yr(r.valueOf())}function br(r){return wr(r)||vr(r)}D(br,"isPrimitive",wr),D(br,"isObject",vr);var dr=Object.prototype.propertyIsEnumerable;var Er=!dr.call("beep","0");function _r(r,e){var t;return null!=r&&(!(t=dr.call(r,e))&&Er&&er(r)?!lr(e=+e)&&wr(e)&&e>=0&&e=0&&r.length<=xr&&a(r,"callee")&&!_r(r,"callee")},Ar=Array.prototype.slice;function Fr(r){return null!==r&&"object"==typeof r}D(Fr,"isObjectLikeArray",function(r){if("function"!=typeof r)throw new TypeError(U("invalid argument. Must provide a function. Value: `%s`.",r));return function(e){var t,n;if(!Tr(e))return!1;if(0===(t=e.length))return!1;for(n=0;n=0&&r.length<=kr}function Rr(r,e,t){var n,i;if(!Lr(r)&&!H(r))throw new TypeError(U("invalid argument. First argument must be an array-like object. Value: `%s`.",r));if(0===(n=r.length))return-1;if(3===arguments.length){if(!wr(t))throw new TypeError(U("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(t>=0){if(t>=n)return-1;i=t}else(i=n+t)<0&&(i=0)}else i=0;if(hr(e)){for(;i0&&!a(r,"0"))for(f=0;f1){if(!me(e))throw new TypeError(U("invalid argument. Options argument must be an object. Value: `%s`.",e));if(a(e,"duplicates")&&!Or(s=e.duplicates))throw new TypeError(U("invalid option. `%s` option must be a boolean. Option: `%s`.","duplicates",s))}if(n=(t=oe(r)).length,u={},s)for(l=0;l=0}function Ft(r){return vr(r)&&r.valueOf()>=0}function jt(r){return At(r)||Ft(r)}D(jt,"isPrimitive",At),D(jt,"isObject",Ft);var St=4294967295;function kt(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&gr(r.length)&&r.length>=0&&r.length<=St}var Lt="function"==typeof ArrayBuffer;function Rt(r){return Lt&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===l(r)}function Bt(r,e){if(!(this instanceof Bt))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!tr(r))throw new TypeError(U("invalid argument. Real component must be a number. Value: `%s`.",r));if(!tr(e))throw new TypeError(U("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return z(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),z(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}D(Bt,"BYTES_PER_ELEMENT",8),D(Bt.prototype,"BYTES_PER_ELEMENT",8),D(Bt.prototype,"byteLength",16),D(Bt.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),D(Bt.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Ot="function"==typeof Math.fround?Math.fround:null,It=new Ge(1);var Mt="function"==typeof Ot?Ot:function(r){return It[0]=r,It[0]};function Ct(r,e){if(!(this instanceof Ct))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!tr(r))throw new TypeError(U("invalid argument. Real component must be a number. Value: `%s`.",r));if(!tr(e))throw new TypeError(U("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return z(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Mt(r)}),z(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Mt(e)}),this}function Pt(r){return r instanceof Bt||r instanceof Ct||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Nt(r){return gr(r/2)}D(Ct,"BYTES_PER_ELEMENT",4),D(Ct.prototype,"BYTES_PER_ELEMENT",4),D(Ct.prototype,"byteLength",8),D(Ct.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),D(Ct.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Yt=8;function Ut(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Yt}var Wt=16;function $t(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Wt}function Gt(){return"function"==typeof u&&"symbol"==typeof u("foo")&&a(u,"iterator")&&"symbol"==typeof u.iterator}var Xt=Gt()?Symbol.iterator:null;function Zt(r,e,t){z(r,e,{configurable:!1,enumerable:!1,get:t})}function Jt(r,e){if(!(this instanceof Jt))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!tr(r))throw new TypeError(U("invalid argument. Real component must be a number. Value: `%s`.",r));if(!tr(e))throw new TypeError(U("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return z(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Mt(r)}),z(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Mt(e)}),this}function qt(r){return r.re}function zt(r){return r.im}function Dt(r,e){return new Ge(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function Ht(r,e){return new Ne(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function Kt(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(kt(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Pt(n))return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(qt(n),zt(n))}return e}D(Jt,"BYTES_PER_ELEMENT",4),D(Jt.prototype,"BYTES_PER_ELEMENT",4),D(Jt.prototype,"byteLength",8),D(Jt.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),D(Jt.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Qt=2*Ge.BYTES_PER_ELEMENT,rn=Gt();function en(r){return r instanceof on||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function tn(r){return r===on||"Complex128Array"===r.name}function nn(r,e){return new Jt(r[e*=2],r[e+1])}function on(){var r,e,t,n;if(e=arguments.length,!(this instanceof on))return 0===e?new on:1===e?new on(arguments[0]):2===e?new on(arguments[0],arguments[1]):new on(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Ge(0);else if(1===e)if(At(arguments[0]))t=new Ge(2*arguments[0]);else if(Lr(arguments[0]))if((n=(t=arguments[0]).length)&&Tr(t)&&Pt(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.byteLength-r)throw new RangeError(U("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Qt));t=new Ge(t,r,2*n)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}function an(r,e){if(!(this instanceof an))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!tr(r))throw new TypeError(U("invalid argument. Real component must be a number. Value: `%s`.",r));if(!tr(e))throw new TypeError(U("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return z(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:r}),z(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:e}),this}function un(r){return r.re}function fn(r){return r.im}function ln(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(kt(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Pt(n))return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(un(n),fn(n))}return e}D(on,"BYTES_PER_ELEMENT",Qt),D(on,"name","Complex64Array"),D(on,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!ue(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!tn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!ue(n=arguments[1]))throw new TypeError(U("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(en(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Lr(r)){if(n){for(f=r.length,u=r.get&&r.set?Le("default"):Be("default"),h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ae(r)&&rn&&ue(r[Xt])){if(!ue((o=r[Xt]()).next))throw new TypeError(U("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,kt(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pt(o))return new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(qt(o),zt(o))}return n}(o,n,e):Kt(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return nn(this._buffer,r)})),Zt(on.prototype,"buffer",(function(){return this._buffer.buffer})),Zt(on.prototype,"byteLength",(function(){return this._buffer.byteLength})),Zt(on.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),D(on.prototype,"BYTES_PER_ELEMENT",on.BYTES_PER_ELEMENT),D(on.prototype,"copyWithin",(function(r,e){if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),D(on.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,D(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Jt(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),D(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Xt&&D(t,Xt,(function(){return e.entries()})),t})),D(on.prototype,"every",(function(r,e){var t,n;if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(U("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=qt(r),u=zt(r),f=e;f=0;n--)if(i=nn(t,n),r.call(e,i,n,this))return i})),D(on.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=nn(t,n),r.call(e,i,n,this))return n;return-1})),D(on.prototype,"forEach",(function(r,e){var t,n,i;if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n=this._length))return nn(this._buffer,r)})),D(on.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(r))throw new TypeError(U("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Zt(on.prototype,"length",(function(){return this._length})),D(on.prototype,"map",(function(r,e){var t,n,i,o,a;if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=nn(t,0),o=1}for(;o1){if(!At(t=arguments[1]))throw new TypeError(U("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pt(r)){if(t>=this._length)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=qt(r),void(n[t+1]=zt(r))}if(en(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*Qt,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*Qt,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*Qt):(i=e-r,t=n.byteOffset+r*Qt),new this.constructor(n.buffer,t,i<0?0:i)})),D(on.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!en(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i=i)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pt(e))throw new TypeError(U("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=qt(e),t[2*r+1]=zt(e),n})),D(an,"BYTES_PER_ELEMENT",8),D(an.prototype,"BYTES_PER_ELEMENT",8),D(an.prototype,"byteLength",16),D(an.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),D(an.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var sn=2*Ne.BYTES_PER_ELEMENT,hn=Gt();function cn(r){return r instanceof gn||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function mn(r){return r===gn||"Complex64Array"===r.name}function pn(r,e){return new an(r[e*=2],r[e+1])}function gn(){var r,e,t,n;if(e=arguments.length,!(this instanceof gn))return 0===e?new gn:1===e?new gn(arguments[0]):2===e?new gn(arguments[0],arguments[1]):new gn(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Ne(0);else if(1===e)if(At(arguments[0]))t=new Ne(2*arguments[0]);else if(Lr(arguments[0]))if((n=(t=arguments[0]).length)&&Tr(t)&&Pt(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.byteLength-r)throw new RangeError(U("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*sn));t=new Ne(t,r,2*n)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(gn,"BYTES_PER_ELEMENT",sn),D(gn,"name","Complex128Array"),D(gn,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!ue(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!mn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!ue(n=arguments[1]))throw new TypeError(U("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(cn(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Lr(r)){if(n){for(f=r.length,u=r.get&&r.set?Le("default"):Be("default"),h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ae(r)&&hn&&ue(r[Xt])){if(!ue((o=r[Xt]()).next))throw new TypeError(U("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,kt(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pt(o))return new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(un(o),fn(o))}return n}(o,n,e):ln(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return pn(this._buffer,r)})),Zt(gn.prototype,"buffer",(function(){return this._buffer.buffer})),Zt(gn.prototype,"byteLength",(function(){return this._buffer.byteLength})),Zt(gn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),D(gn.prototype,"BYTES_PER_ELEMENT",gn.BYTES_PER_ELEMENT),D(gn.prototype,"copyWithin",(function(r,e){if(!cn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),D(gn.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!cn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,D(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new an(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),D(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Xt&&D(t,Xt,(function(){return e.entries()})),t})),D(gn.prototype,"every",(function(r,e){var t,n;if(!cn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(U("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=un(r),u=fn(r),f=e;f=0;n--)if(i=pn(t,n),r.call(e,i,n,this))return i})),D(gn.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!cn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=pn(t,n),r.call(e,i,n,this))return n;return-1})),D(gn.prototype,"forEach",(function(r,e){var t,n,i;if(!cn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n=this._length))return pn(this._buffer,r)})),Zt(gn.prototype,"length",(function(){return this._length})),D(gn.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!cn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(r))throw new TypeError(U("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=un(r),o=fn(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=un(r),o=fn(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=un(r),o=fn(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),D(gn.prototype,"map",(function(r,e){var t,n,i,o,a;if(!cn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=pn(t,0),o=1}for(;o1){if(!At(t=arguments[1]))throw new TypeError(U("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pt(r)){if(t>=this._length)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=un(r),void(n[t+1]=fn(r))}if(cn(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*sn,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ne(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*sn,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ne(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*sn):(i=e-r,t=n.byteOffset+r*sn),new this.constructor(n.buffer,t,i<0?0:i)})),D(gn.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!cn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i=i)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pt(e))throw new TypeError(U("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=un(e),t[2*r+1]=fn(e),n}));var yn=[Ne,Ge,rt,ze,st,ot,Vt,gt,dt,on,gn],wn=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],vn=wn.length;function bn(r){var e;if(Tr(r))return"generic";if(Dr(r))return null;for(e=0;e0&&e.push("generic"),e)}var xn=dn(Tn("real")),Vn=dn(Tn("complex_floating_point")),An=dn(Tn("boolean")),Fn={float64:function(r,e,t){r[e]=t},float32:function(r,e,t){r[e]=t},int32:function(r,e,t){r[e]=t},int16:function(r,e,t){r[e]=t},int8:function(r,e,t){r[e]=t},uint32:function(r,e,t){r[e]=t},uint16:function(r,e,t){r[e]=t},uint8:function(r,e,t){r[e]=t},uint8c:function(r,e,t){r[e]=t},generic:function(r,e,t){r[e]=t},default:function(r,e,t){r[e]=t}};function jn(r){var e=Fn[r];return"function"==typeof e?e:Fn.default}var Sn={complex128:function(r,e,t){r.set(t,e)},complex64:function(r,e,t){r.set(t,e)},default:function(r,e,t){r.set(t,e)}};function kn(r){var e=Sn[r];return"function"==typeof e?e:Sn.default}var Ln={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"};function Rn(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(kt(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Pt(n))return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(qt(n),zt(n))}return e}var Bn=2*Ge.BYTES_PER_ELEMENT,On=Gt();function In(r){return r instanceof Pn||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Mn(r){return r===Pn||"Complex128Array"===r.name}function Cn(r,e){return new Jt(r[e*=2],r[e+1])}function Pn(){var r,e,t,n;if(e=arguments.length,!(this instanceof Pn))return 0===e?new Pn:1===e?new Pn(arguments[0]):2===e?new Pn(arguments[0],arguments[1]):new Pn(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Ge(0);else if(1===e)if(At(arguments[0]))t=new Ge(2*arguments[0]);else if(Lr(arguments[0]))if((n=(t=arguments[0]).length)&&Tr(t)&&Pt(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.byteLength-r)throw new RangeError(U("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Bn));t=new Ge(t,r,2*n)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(Pn,"BYTES_PER_ELEMENT",Bn),D(Pn,"name","Complex64Array"),D(Pn,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!ue(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Mn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!ue(n=arguments[1]))throw new TypeError(U("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(In(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Lr(r)){if(n){for(f=r.length,u=r.get&&r.set?Le("default"):Be("default"),h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ae(r)&&On&&ue(r[Xt])){if(!ue((o=r[Xt]()).next))throw new TypeError(U("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,kt(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pt(o))return new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(qt(o),zt(o))}return n}(o,n,e):Rn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return Cn(this._buffer,r)})),Zt(Pn.prototype,"buffer",(function(){return this._buffer.buffer})),Zt(Pn.prototype,"byteLength",(function(){return this._buffer.byteLength})),Zt(Pn.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),D(Pn.prototype,"BYTES_PER_ELEMENT",Pn.BYTES_PER_ELEMENT),D(Pn.prototype,"copyWithin",(function(r,e){if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),D(Pn.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,D(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Jt(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),D(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Xt&&D(t,Xt,(function(){return e.entries()})),t})),D(Pn.prototype,"every",(function(r,e){var t,n;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(U("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=qt(r),u=zt(r),f=e;f=0;n--)if(i=Cn(t,n),r.call(e,i,n,this))return i})),D(Pn.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=Cn(t,n),r.call(e,i,n,this))return n;return-1})),D(Pn.prototype,"forEach",(function(r,e){var t,n,i;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n=this._length))return Cn(this._buffer,r)})),D(Pn.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(r))throw new TypeError(U("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Zt(Pn.prototype,"length",(function(){return this._length})),D(Pn.prototype,"map",(function(r,e){var t,n,i,o,a;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Cn(t,0),o=1}for(;o1){if(!At(t=arguments[1]))throw new TypeError(U("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pt(r)){if(t>=this._length)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=qt(r),void(n[t+1]=zt(r))}if(In(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*Bn,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*Bn,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*Bn):(i=e-r,t=n.byteOffset+r*Bn),new this.constructor(n.buffer,t,i<0?0:i)})),D(Pn.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!In(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i=i)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pt(e))throw new TypeError(U("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=qt(e),t[2*r+1]=zt(e),n}));var Nn=[Ne,Ge,rt,ze,st,ot,Vt,gt,dt,Pn,gn],Yn=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],Un=Yn.length;function Wn(r){var e=function(r){var e;if(Tr(r))return"generic";if(Dr(r))return null;for(e=0;e=2)e.push(n[0],n[1]);else{if(!Pt(n))return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(qt(n),zt(n))}return e}var Dn=2*Ge.BYTES_PER_ELEMENT,Hn=Gt();function Kn(r){return r instanceof ei||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Qn(r){return r===ei||"Complex128Array"===r.name}function ri(r,e){return new Jt(r[e*=2],r[e+1])}function ei(){var r,e,t,n;if(e=arguments.length,!(this instanceof ei))return 0===e?new ei:1===e?new ei(arguments[0]):2===e?new ei(arguments[0],arguments[1]):new ei(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Ge(0);else if(1===e)if(At(arguments[0]))t=new Ge(2*arguments[0]);else if(Lr(arguments[0]))if((n=(t=arguments[0]).length)&&Tr(t)&&Pt(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.byteLength-r)throw new RangeError(U("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Dn));t=new Ge(t,r,2*n)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(ei,"BYTES_PER_ELEMENT",Dn),D(ei,"name","Complex64Array"),D(ei,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!ue(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Qn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!ue(n=arguments[1]))throw new TypeError(U("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(Kn(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Lr(r)){if(n){for(f=r.length,u=r.get&&r.set?Le("default"):Be("default"),h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ae(r)&&Hn&&ue(r[Xt])){if(!ue((o=r[Xt]()).next))throw new TypeError(U("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,kt(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pt(o))return new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(qt(o),zt(o))}return n}(o,n,e):zn(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return ri(this._buffer,r)})),Zt(ei.prototype,"buffer",(function(){return this._buffer.buffer})),Zt(ei.prototype,"byteLength",(function(){return this._buffer.byteLength})),Zt(ei.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),D(ei.prototype,"BYTES_PER_ELEMENT",ei.BYTES_PER_ELEMENT),D(ei.prototype,"copyWithin",(function(r,e){if(!Kn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),D(ei.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!Kn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,D(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Jt(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),D(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Xt&&D(t,Xt,(function(){return e.entries()})),t})),D(ei.prototype,"every",(function(r,e){var t,n;if(!Kn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(U("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=qt(r),u=zt(r),f=e;f=0;n--)if(i=ri(t,n),r.call(e,i,n,this))return i})),D(ei.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!Kn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=ri(t,n),r.call(e,i,n,this))return n;return-1})),D(ei.prototype,"forEach",(function(r,e){var t,n,i;if(!Kn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n=this._length))return ri(this._buffer,r)})),D(ei.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!Kn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(r))throw new TypeError(U("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Zt(ei.prototype,"length",(function(){return this._length})),D(ei.prototype,"map",(function(r,e){var t,n,i,o,a;if(!Kn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=ri(t,0),o=1}for(;o1){if(!At(t=arguments[1]))throw new TypeError(U("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pt(r)){if(t>=this._length)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=qt(r),void(n[t+1]=zt(r))}if(Kn(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*Dn,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*Dn,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*Dn):(i=e-r,t=n.byteOffset+r*Dn),new this.constructor(n.buffer,t,i<0?0:i)})),D(ei.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!Kn(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i=i)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pt(e))throw new TypeError(U("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=qt(e),t[2*r+1]=zt(e),n}));var ti=[Ne,Ge,rt,ze,st,ot,Vt,gt,dt,ei,gn],ni=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],ii=ni.length;function oi(r){var e=function(r){var e;if(Tr(r))return"generic";if(Dr(r))return null;for(e=0;e=2)e.push(n[0],n[1]);else{if(!Pt(n))return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(qt(n),zt(n))}return e}var si=2*Ge.BYTES_PER_ELEMENT,hi=Gt();function ci(r){return r instanceof gi||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function mi(r){return r===gi||"Complex128Array"===r.name}function pi(r,e){return new Jt(r[e*=2],r[e+1])}function gi(){var r,e,t,n;if(e=arguments.length,!(this instanceof gi))return 0===e?new gi:1===e?new gi(arguments[0]):2===e?new gi(arguments[0],arguments[1]):new gi(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Ge(0);else if(1===e)if(At(arguments[0]))t=new Ge(2*arguments[0]);else if(Lr(arguments[0]))if((n=(t=arguments[0]).length)&&Tr(t)&&Pt(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.byteLength-r)throw new RangeError(U("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*si));t=new Ge(t,r,2*n)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}function yi(r){var e,t;for(e=[];!(t=r.next()).done;)e.push(Ir(t.value));return e}D(gi,"BYTES_PER_ELEMENT",si),D(gi,"name","Complex64Array"),D(gi,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!ue(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!mi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!ue(n=arguments[1]))throw new TypeError(U("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(ci(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Lr(r)){if(n){for(f=r.length,u=r.get&&r.set?Le("default"):Be("default"),h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ae(r)&&hi&&ue(r[Xt])){if(!ue((o=r[Xt]()).next))throw new TypeError(U("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,kt(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pt(o))return new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(qt(o),zt(o))}return n}(o,n,e):li(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return pi(this._buffer,r)})),Zt(gi.prototype,"buffer",(function(){return this._buffer.buffer})),Zt(gi.prototype,"byteLength",(function(){return this._buffer.byteLength})),Zt(gi.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),D(gi.prototype,"BYTES_PER_ELEMENT",gi.BYTES_PER_ELEMENT),D(gi.prototype,"copyWithin",(function(r,e){if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),D(gi.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,D(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Jt(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),D(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Xt&&D(t,Xt,(function(){return e.entries()})),t})),D(gi.prototype,"every",(function(r,e){var t,n;if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(U("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=qt(r),u=zt(r),f=e;f=0;n--)if(i=pi(t,n),r.call(e,i,n,this))return i})),D(gi.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=pi(t,n),r.call(e,i,n,this))return n;return-1})),D(gi.prototype,"forEach",(function(r,e){var t,n,i;if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n=this._length))return pi(this._buffer,r)})),D(gi.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(r))throw new TypeError(U("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Zt(gi.prototype,"length",(function(){return this._length})),D(gi.prototype,"map",(function(r,e){var t,n,i,o,a;if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=pi(t,0),o=1}for(;o1){if(!At(t=arguments[1]))throw new TypeError(U("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pt(r)){if(t>=this._length)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=qt(r),void(n[t+1]=zt(r))}if(ci(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*si,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*si,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*si):(i=e-r,t=n.byteOffset+r*si),new this.constructor(n.buffer,t,i<0?0:i)})),D(gi.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i=i)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pt(e))throw new TypeError(U("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=qt(e),t[2*r+1]=zt(e),n}));var wi=gt.BYTES_PER_ELEMENT,vi=Gt();function bi(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===wi}function di(r){return r===Ei}function Ei(){var r,e,t,n,i;if(e=arguments.length,!(this instanceof Ei))return 0===e?new Ei:1===e?new Ei(arguments[0]):2===e?new Ei(arguments[0],arguments[1]):new Ei(arguments[0],arguments[1],arguments[2]);if(0===e)t=new gt(0);else if(1===e)if(At(i=arguments[0]))t=new gt(i);else if(Lr(i))t=function(r,e){var t,n;for(t=e.length,n=0;nt.byteLength-r)throw new RangeError(U("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*wi));t=new gt(t,r,n)}}return D(this,"_buffer",t),D(this,"_length",t.length),this}D(Ei,"BYTES_PER_ELEMENT",wi),D(Ei,"name","BooleanArray"),D(Ei,"from",(function(r){var e,t,n,i,o,a,u,f,l;if(!ue(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!di(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((t=arguments.length)>1){if(!ue(n=arguments[1]))throw new TypeError(U("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(Lr(r)){if(n){for(f=r.length,u=r.get&&r.set?Le("default"):Be("default"),o=(i=new this(f))._buffer,l=0;l=0;i--)if(n=Ir(t[i]),r.call(e,n,i,this))return n})),D(Ei.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!bi(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=Ir(t[i]),r.call(e,n,i,this))return i;return-1})),D(Ei.prototype,"get",(function(r){if(!bi(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!At(r))throw new TypeError(U("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return Ir(this._buffer[r])})),Zt(Ei.prototype,"length",(function(){return this._length})),D(Ei.prototype,"map",(function(r,e){var t,n,i,o;if(!bi(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ue(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(i=this._buffer,t=(n=new this.constructor(this._length))._buffer,o=0;o1){if(!At(t=arguments[1]))throw new TypeError(U("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Lr(r)){if(t+(o=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=bi(r)?r._buffer:r,u=n.byteOffset+t*wi,e.buffer===n.buffer&&e.byteOffsetu){for(i=new gt(e.length),a=0;a=this._length)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));n[t]=r?1:0}})),D(Ei.prototype,"sort",(function(r){var e;if(!bi(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(e=this._buffer,0===arguments.length)return e.sort(),this;if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));return e.sort((function(e,t){return r(Ir(e),Ir(t))})),this})),D(Ei.prototype,"toReversed",(function(){var r,e,t,n,i;if(!bi(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i=2)e.push(n[0],n[1]);else{if(!Pt(n))return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(qt(n),zt(n))}return e}var ji=2*Ge.BYTES_PER_ELEMENT,Si=Gt();function ki(r){return r instanceof Bi||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Li(r){return r===Bi||"Complex128Array"===r.name}function Ri(r,e){return new Jt(r[e*=2],r[e+1])}function Bi(){var r,e,t,n;if(e=arguments.length,!(this instanceof Bi))return 0===e?new Bi:1===e?new Bi(arguments[0]):2===e?new Bi(arguments[0],arguments[1]):new Bi(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Ge(0);else if(1===e)if(At(arguments[0]))t=new Ge(2*arguments[0]);else if(Lr(arguments[0]))if((n=(t=arguments[0]).length)&&Tr(t)&&Pt(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.byteLength-r)throw new RangeError(U("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*ji));t=new Ge(t,r,2*n)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(Bi,"BYTES_PER_ELEMENT",ji),D(Bi,"name","Complex64Array"),D(Bi,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!ue(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Li(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!ue(n=arguments[1]))throw new TypeError(U("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(ki(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Lr(r)){if(n){for(f=r.length,u=r.get&&r.set?Le("default"):Be("default"),h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ae(r)&&Si&&ue(r[Xt])){if(!ue((o=r[Xt]()).next))throw new TypeError(U("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,kt(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pt(o))return new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(qt(o),zt(o))}return n}(o,n,e):Fi(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return Ri(this._buffer,r)})),Zt(Bi.prototype,"buffer",(function(){return this._buffer.buffer})),Zt(Bi.prototype,"byteLength",(function(){return this._buffer.byteLength})),Zt(Bi.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),D(Bi.prototype,"BYTES_PER_ELEMENT",Bi.BYTES_PER_ELEMENT),D(Bi.prototype,"copyWithin",(function(r,e){if(!ki(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),D(Bi.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!ki(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,D(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Jt(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),D(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Xt&&D(t,Xt,(function(){return e.entries()})),t})),D(Bi.prototype,"every",(function(r,e){var t,n;if(!ki(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(U("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=qt(r),u=zt(r),f=e;f=0;n--)if(i=Ri(t,n),r.call(e,i,n,this))return i})),D(Bi.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!ki(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=Ri(t,n),r.call(e,i,n,this))return n;return-1})),D(Bi.prototype,"forEach",(function(r,e){var t,n,i;if(!ki(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n=this._length))return Ri(this._buffer,r)})),D(Bi.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!ki(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(r))throw new TypeError(U("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Zt(Bi.prototype,"length",(function(){return this._length})),D(Bi.prototype,"map",(function(r,e){var t,n,i,o,a;if(!ki(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Ri(t,0),o=1}for(;o1){if(!At(t=arguments[1]))throw new TypeError(U("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pt(r)){if(t>=this._length)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=qt(r),void(n[t+1]=zt(r))}if(ki(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*ji,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*ji,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*ji):(i=e-r,t=n.byteOffset+r*ji),new this.constructor(n.buffer,t,i<0?0:i)})),D(Bi.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!ki(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i=i)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pt(e))throw new TypeError(U("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=qt(e),t[2*r+1]=zt(e),n}));var Oi=[Ne,Ge,rt,ze,st,ot,Vt,gt,dt,Bi,gn],Ii=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],Mi=Ii.length;function Ci(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(kt(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!Pt(n))return new TypeError(U("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));e.push(qt(n),zt(n))}return e}var Pi=2*Ge.BYTES_PER_ELEMENT,Ni=Gt();function Yi(r){return r instanceof $i||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function Ui(r){return r===$i||"Complex128Array"===r.name}function Wi(r,e){return new Jt(r[e*=2],r[e+1])}function $i(){var r,e,t,n;if(e=arguments.length,!(this instanceof $i))return 0===e?new $i:1===e?new $i(arguments[0]):2===e?new $i(arguments[0],arguments[1]):new $i(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Ge(0);else if(1===e)if(At(arguments[0]))t=new Ge(2*arguments[0]);else if(Lr(arguments[0]))if((n=(t=arguments[0]).length)&&Tr(t)&&Pt(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;it.byteLength-r)throw new RangeError(U("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Pi));t=new Ge(t,r,2*n)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D($i,"BYTES_PER_ELEMENT",Pi),D($i,"name","Complex64Array"),D($i,"from",(function(r){var e,t,n,i,o,a,u,f,l,s,h,c;if(!ue(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Ui(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!ue(n=arguments[1]))throw new TypeError(U("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(Yi(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(Lr(r)){if(n){for(f=r.length,u=r.get&&r.set?Le("default"):Be("default"),h=0;h=2))throw new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",s));o[c]=s[0],o[c+1]=s[1]}c+=2}return i}return new this(r)}if(ae(r)&&Ni&&ue(r[Xt])){if(!ue((o=r[Xt]()).next))throw new TypeError(U("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(a=n?function(r,e,t){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,kt(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Pt(o))return new TypeError(U("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(qt(o),zt(o))}return n}(o,n,e):Ci(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h=this._length))return Wi(this._buffer,r)})),Zt($i.prototype,"buffer",(function(){return this._buffer.buffer})),Zt($i.prototype,"byteLength",(function(){return this._buffer.byteLength})),Zt($i.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),D($i.prototype,"BYTES_PER_ELEMENT",$i.BYTES_PER_ELEMENT),D($i.prototype,"copyWithin",(function(r,e){if(!Yi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*e):this._buffer.copyWithin(2*r,2*e,2*arguments[2]),this})),D($i.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!Yi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,r=this._buffer,n=this._length,o=-1,a=-2,D(t={},"next",(function(){var e;if(o+=1,i||o>=n)return{done:!0};return e=new Jt(r[a+=2],r[a+1]),{value:[o,e],done:!1}})),D(t,"return",(function(r){if(i=!0,arguments.length)return{value:r,done:!0};return{done:!0}})),Xt&&D(t,Xt,(function(){return e.entries()})),t})),D($i.prototype,"every",(function(r,e){var t,n;if(!Yi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!gr(t))throw new TypeError(U("invalid argument. Third argument must be an integer. Value: `%s`.",t));t<0&&(t+=i)<0&&(t=0),t>i&&(t=i)}else t=i}else e=0,t=i;for(a=qt(r),u=zt(r),f=e;f=0;n--)if(i=Wi(t,n),r.call(e,i,n,this))return i})),D($i.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!Yi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=Wi(t,n),r.call(e,i,n,this))return n;return-1})),D($i.prototype,"forEach",(function(r,e){var t,n,i;if(!Yi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n=this._length))return Wi(this._buffer,r)})),D($i.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!Yi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pt(r))throw new TypeError(U("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a1){if(!gr(e))throw new TypeError(U("invalid argument. Second argument must be an integer. Value: `%s`.",e));e>=this._length?e=this._length-1:e<0&&(e+=this._length)}else e=this._length-1;for(i=qt(r),o=zt(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Zt($i.prototype,"length",(function(){return this._length})),D($i.prototype,"map",(function(r,e){var t,n,i,o,a;if(!Yi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ue(r))throw new TypeError(U("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o1)n=e,o=0;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=Wi(t,0),o=1}for(;o1){if(!At(t=arguments[1]))throw new TypeError(U("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Pt(r)){if(t>=this._length)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=qt(r),void(n[t+1]=zt(r))}if(Yi(r)){if(t+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r._buffer,l=n.byteOffset+t*Pi,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(e.length),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,l=n.byteOffset+t*Pi,e.buffer===n.buffer&&e.byteOffsetl){for(i=new Ge(a),f=0;fthis._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;fu&&(e=u)}}for(t=ri&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*Pi):(i=e-r,t=n.byteOffset+r*Pi),new this.constructor(n.buffer,t,i<0?0:i)})),D($i.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!Yi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=new this.constructor(t),n=this._buffer,r=e._buffer,i=0;i=i)throw new RangeError(U("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!Pt(e))throw new TypeError(U("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=qt(e),t[2*r+1]=zt(e),n}));var Gi={float64:Ne,float32:Ge,generic:Array,int16:st,int32:rt,int8:Vt,uint16:ot,uint32:ze,uint8:gt,uint8c:dt,complex64:$i,complex128:gn};function Xi(r,e,t,n,i,o,a){var u,f,l,s,h,c,m;for(u=e.data,f=i.data,s=e.accessors[0],l=i.accessors[1],h=n,c=a,m=0;m0)for(s=0;s0)for(c=0;c3&&(i=function(r,e){return me(e)?a(e,"mode")&&(r.mode=e.mode,!Qi(r.mode))?new TypeError(Hi("null4S","mode",Ki.join('", "'),r.mode)):null:new TypeError(Hi("null2V",e))}(n,arguments[3]),i))throw i;if(o=Vi(r)||"generic",u=Vi(t)||"generic",!((f=u)===(l=o)||Fe[f][l]>0))throw new TypeError(Hi("invalid argument. Third argument cannot be safely cast to the input array data type. Data types: [%s, %s].",u,o));return Vn(o)&&xn(u)&&(t=Di(t,o)),function(r,e,t,n){var i,o,a,u;if(u=t.length,"strict"===n){if(ui(e)!==u)throw new Error("invalid arguments. Number of values does not equal the number of truthy values in the mask array.")}else if("broadcast"===n){if(1!==u&&ui(e)>u)throw new Error("invalid arguments. Insufficient values to satisfy mask array.")}else if("strict_broadcast"===n){if(1!==u&&ui(e)!==u)throw new Error("invalid arguments. Number of values does not equal the number of truthy values in the mask array.")}else if("non_strict"===n&&ui(e)>u)throw new Error("invalid arguments. Insufficient values to satisfy mask array.");return i=Wn(r),o=Wn(e),a=Wn(t),i.accessorProtocol||o.accessorProtocol||a.accessorProtocol?Vn(i.dtype)&&Vn(a.dtype)?(function(r,e,t){var n,i,o,a,u;for(n=e.data,i=e.accessors[0],a=t.length,o=0,u=0;u