-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser.js
More file actions
3 lines (3 loc) · 77 KB
/
Copy pathbrowser.js
File metadata and controls
3 lines (3 loc) · 77 KB
1
2
3
// Copyright (c) 2026 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
var r,e;r=this,e=function(){"use strict";var r="function"==typeof Object.defineProperty?Object.defineProperty:null,e=Object.defineProperty;function t(r){return"number"==typeof r}function n(r){var e,t="";for(e=0;e<r;e++)t+="0";return t}function i(r,e,t){var i=!1,o=e-r.length;return o<0||(function(r){return"-"===r[0]}(r)&&(i=!0,r=r.substr(1)),r=t?r+n(o):n(o)+r,i&&(r="-"+r)),r}var o=String.prototype.toLowerCase,a=String.prototype.toUpperCase;function u(r){var e,n,u;switch(r.specifier){case"b":e=2;break;case"o":e=8;break;case"x":case"X":e=16;break;default:e=10}if(n=r.arg,u=parseInt(n,10),!isFinite(u)){if(!t(n))throw new Error("invalid integer. Value: "+n);u=0}return u<0&&("u"===r.specifier||10!==e)&&(u=4294967295+u+1),u<0?(n=(-u).toString(e),r.precision&&(n=i(n,r.precision,r.padRight)),n="-"+n):(n=u.toString(e),u||r.precision?r.precision&&(n=i(n,r.precision,r.padRight)):n="",r.sign&&(n=r.sign+n)),16===e&&(r.alternate&&(n="0x"+n),n=r.specifier===a.call(r.specifier)?a.call(n):o.call(n)),8===e&&r.alternate&&"0"!==n.charAt(0)&&(n="0"+n),n}var f=Math.abs,s=String.prototype.toLowerCase,l=String.prototype.toUpperCase,h=String.prototype.replace,c=/e\+(\d)$/,p=/e-(\d)$/,y=/^(\d+)$/,g=/^(\d+)e/,m=/\.0$/,w=/\.0*e/,v=/(\..*[^0])0*e/;function b(r,e){var t,n;switch(e.specifier){case"e":case"E":n=r.toExponential(e.precision);break;case"f":case"F":n=r.toFixed(e.precision);break;case"g":case"G":f(r)<1e-4?((t=e.precision)>0&&(t-=1),n=r.toExponential(t)):n=r.toPrecision(e.precision),e.alternate||(n=h.call(n,v,"$1e"),n=h.call(n,w,"e"),n=h.call(n,m,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return n=h.call(n,c,"e+0$1"),n=h.call(n,p,"e-0$1"),e.alternate&&(n=h.call(n,y,"$1."),n=h.call(n,g,"$1.e")),r>=0&&e.sign&&(n=e.sign+n),n=e.specifier===l.call(e.specifier)?l.call(n):s.call(n)}function d(r){var e,t="";for(e=0;e<r;e++)t+=" ";return t}var E=String.fromCharCode,_=Array.isArray;function T(r){return r!=r}function x(r){var e={};return e.specifier=r.specifier,e.precision=void 0===r.precision?1:r.precision,e.width=r.width,e.flags=r.flags||"",e.mapping=r.mapping,e}function V(r){var e,n,o,a,f,s,l,h,c,p,y,g,m,w;if(!_(r))throw new TypeError("invalid argument. First argument must be an array. Value: `"+r+"`.");for(s="",l=1,c=0;c<r.length;c++)if("string"==typeof(o=r[c]))s+=o;else{if(e=void 0!==o.precision,!(o=x(o)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+c+"`. Value: `"+o+"`.");for(o.mapping&&(l=o.mapping),n=o.flags,p=0;p<n.length;p++)switch(a=n.charAt(p)){case" ":o.sign=" ";break;case"+":o.sign="+";break;case"-":o.padRight=!0,o.padZeros=!1;break;case"0":o.padZeros=n.indexOf("-")<0;break;case"#":o.alternate=!0;break;default:throw new Error("invalid flag: "+a)}if("*"===o.width){if(o.width=parseInt(arguments[l],10),l+=1,T(o.width))throw new TypeError("the argument for * width at position "+l+" is not a number. Value: `"+o.width+"`.");o.width<0&&(o.padRight=!0,o.width=-o.width)}if(e&&"*"===o.precision){if(o.precision=parseInt(arguments[l],10),l+=1,T(o.precision))throw new TypeError("the argument for * precision at position "+l+" is not a number. Value: `"+o.precision+"`.");o.precision<0&&(o.precision=1,e=!1)}switch(o.arg=arguments[l],o.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":e&&(o.padZeros=!1),o.arg=u(o);break;case"s":o.maxWidth=e?o.precision:-1,o.arg=String(o.arg);break;case"c":if(!T(o.arg)){if((f=parseInt(o.arg,10))<0||f>127)throw new Error("invalid character code. Value: "+o.arg);o.arg=T(f)?String(o.arg):E(f)}break;case"e":case"E":case"f":case"F":case"g":case"G":if(e||(o.precision=6),h=parseFloat(o.arg),!isFinite(h)){if(!t(o.arg))throw new Error("invalid floating-point number. Value: "+s);h=o.arg,o.padZeros=!1}o.arg=b(h,o);break;default:throw new Error("invalid specifier: "+o.specifier)}o.maxWidth>=0&&o.arg.length>o.maxWidth&&(o.arg=o.arg.substring(0,o.maxWidth)),o.padZeros?o.arg=i(o.arg,o.width||o.precision,o.padRight):o.width&&(o.arg=(y=o.arg,g=o.width,m=o.padRight,w=void 0,(w=g-y.length)<0?y:y=m?y+d(w):d(w)+y)),s+=o.arg||"",l+=1}return s}var A=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function F(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 j(r){var e,t,n,i;for(t=[],i=0,n=A.exec(r);n;)(e=r.slice(i,A.lastIndex-n[0].length)).length&&t.push(e),"%"===n[6]?t.push("%"):t.push(F(n)),i=A.lastIndex,n=A.exec(r);return(e=r.slice(i)).length&&t.push(e),t}function S(r){var e,t;if("string"!=typeof r)throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r));for(e=[j(r)],t=1;t<arguments.length;t++)e.push(arguments[t]);return V.apply(null,e)}var k,L=Object.prototype,R=L.toString,I=L.__defineGetter__,B=L.__defineSetter__,O=L.__lookupGetter__,M=L.__lookupSetter__;k=function(){try{return r({},"x",{}),!0}catch(r){return!1}}()?e:function(r,e,t){var n,i,o,a;if("object"!=typeof r||null===r||"[object Array]"===R.call(r))throw new TypeError(S("invalid argument. First argument must be an object. Value: `%s`.",r));if("object"!=typeof t||null===t||"[object Array]"===R.call(t))throw new TypeError(S("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if((i="value"in t)&&(O.call(r,e)||M.call(r,e)?(n=r.__proto__,r.__proto__=L,delete r[e],r[e]=t.value,r.__proto__=n):r[e]=t.value),o="get"in t,a="set"in t,i&&(o||a))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return o&&I&&I.call(r,e,t.get),a&&B&&B.call(r,e,t.set),r};var C=k;function P(r,e,t){C(r,e,{configurable:!1,enumerable:!1,writable:!1,value:t})}function N(r){return"number"==typeof r}var U="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function Y(){return U&&"symbol"==typeof Symbol.toStringTag}var W=Object.prototype.toString,$=Object.prototype.hasOwnProperty;function G(r,e){return null!=r&&$.call(r,e)}var Z="function"==typeof Symbol?Symbol:void 0,X="function"==typeof Z?Z.toStringTag:"",z=Y()?function(r){var e,t,n;if(null==r)return W.call(r);t=r[X],e=G(r,X);try{r[X]=void 0}catch(e){return W.call(r)}return n=W.call(r),e?r[X]=t:delete r[X],n}:function(r){return W.call(r)},J=Number,q=J.prototype.toString,D=Y();function H(r){return"object"==typeof r&&(r instanceof J||(D?function(r){try{return q.call(r),!0}catch(r){return!1}}(r):"[object Number]"===z(r)))}function K(r){return N(r)||H(r)}P(K,"isPrimitive",N),P(K,"isObject",H);var Q=Number.POSITIVE_INFINITY,rr=J.NEGATIVE_INFINITY,er=Math.floor;function tr(r){return er(r)===r}function nr(r){return r<Q&&r>rr&&tr(r)}function ir(r){return N(r)&&nr(r)}function or(r){return H(r)&&nr(r.valueOf())}function ar(r){return ir(r)||or(r)}function ur(r){return ir(r)&&r>=0}function fr(r){return or(r)&&r.valueOf()>=0}function sr(r){return ur(r)||fr(r)}P(ar,"isPrimitive",ir),P(ar,"isObject",or),P(sr,"isPrimitive",ur),P(sr,"isObject",fr);var lr=9007199254740991;function hr(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&tr(r.length)&&r.length>=0&&r.length<=lr}var cr="function"==typeof ArrayBuffer;function pr(r){return cr&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===z(r)}var yr=Array.isArray?Array.isArray:function(r){return"[object Array]"===z(r)};function gr(r){return"object"==typeof r&&null!==r&&!yr(r)}var mr=/./;function wr(r){return"boolean"==typeof r}var vr=Boolean,br=Boolean.prototype.toString,dr=Y();function Er(r){return"object"==typeof r&&(r instanceof vr||(dr?function(r){try{return br.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===z(r)))}function _r(r){return wr(r)||Er(r)}P(_r,"isPrimitive",wr),P(_r,"isObject",Er);var Tr="object"==typeof self?self:null,xr="object"==typeof window?window:null,Vr="object"==typeof globalThis?globalThis:null,Ar=function(r){if(arguments.length){if(!wr(r))throw new TypeError(S("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(Vr)return Vr;if(Tr)return Tr;if(xr)return xr;throw new Error("unexpected error. Unable to resolve global object.")}(),Fr=Ar.document&&Ar.document.childNodes,jr=Int8Array;function Sr(){return/^\s*function\s*([^(]*)/i}var kr=/^\s*function\s*([^(]*)/i;function Lr(r){if("function"!=typeof r)throw new TypeError(S("invalid argument. Must provide a function. Value: `%s`.",r));return function(e){var t,n;if(!yr(e))return!1;if(0===(t=e.length))return!1;for(n=0;n<t;n++)if(!1===r(e[n]))return!1;return!0}}function Rr(r){return null!==r&&"object"==typeof r}function Ir(r){var e,t,n,i;if(("Object"===(t=z(r).slice(8,-1))||"Error"===t)&&r.constructor){if("string"==typeof(n=r.constructor).name)return n.name;if(e=kr.exec(n.toString()))return e[1]}return Rr(i=r)&&(i._isBuffer||i.constructor&&"function"==typeof i.constructor.isBuffer&&i.constructor.isBuffer(i))?"Buffer":t}P(Sr,"REGEXP",kr),P(Rr,"isObjectLikeArray",Lr(Rr));var Br="function"==typeof mr||"object"==typeof jr||"function"==typeof Fr?function(r){return Ir(r).toLowerCase()}:function(r){var e;return null===r?"null":"object"==(e=typeof r)?Ir(r).toLowerCase():e};function Or(r){return"function"===Br(r)}function Mr(r){return"string"==typeof r}var Cr=String.prototype.valueOf,Pr=Y();function Nr(r){return"object"==typeof r&&(r instanceof String||(Pr?function(r){try{return Cr.call(r),!0}catch(r){return!1}}(r):"[object String]"===z(r)))}function Ur(r){return Mr(r)||Nr(r)}P(Ur,"isPrimitive",Mr),P(Ur,"isObject",Nr);var Yr=Lr(Ur.isPrimitive),Wr=Lr(Ur.isObject),$r=Lr(Ur);function Gr(){return"function"==typeof Z&&"symbol"==typeof Z("foo")&&G(Z,"iterator")&&"symbol"==typeof Z.iterator}P($r,"primitives",Yr),P($r,"objects",Wr);var Zr=Gr()?Symbol.iterator:null;function Xr(r,e,t){C(r,e,{configurable:!1,enumerable:!1,get:t})}var zr="function"==typeof Uint8Array,Jr="function"==typeof Uint8Array?Uint8Array:null,qr="function"==typeof Uint8Array?Uint8Array:void 0,Dr=function(){var r,e,t;if("function"!=typeof Jr)return!1;try{e=new Jr(e=[1,3.14,-3.14,256,257]),t=e,r=(zr&&t instanceof Uint8Array||"[object Uint8Array]"===z(t))&&1===e[0]&&3===e[1]&&253===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?qr:function(){throw new Error("not implemented")},Hr={float64:function(r,e){return r[e]},float32:function(r,e){return r[e]},int32:function(r,e){return r[e]},int16:function(r,e){return r[e]},int8:function(r,e){return r[e]},uint32:function(r,e){return r[e]},uint16:function(r,e){return r[e]},uint8:function(r,e){return r[e]},uint8c:function(r,e){return r[e]},generic:function(r,e){return r[e]},default:function(r,e){return r[e]}};function Kr(r){var e=Hr[r];return"function"==typeof e?e:Hr.default}var Qr={complex128:function(r,e){return r.get(e)},complex64:function(r,e){return r.get(e)},default:function(r,e){return r.get(e)}};function re(r){var e=Qr[r];return"function"==typeof e?e:Qr.default}function ee(r){var e,t;for(e=[];!(t=r.next()).done;)e.push(vr(t.value));return e}var te=Dr.BYTES_PER_ELEMENT,ne=Gr();function ie(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===te}function oe(r){return r===ae}function ae(){var r,e,t,n,i;if(e=arguments.length,!(this instanceof ae))return 0===e?new ae:1===e?new ae(arguments[0]):2===e?new ae(arguments[0],arguments[1]):new ae(arguments[0],arguments[1],arguments[2]);if(0===e)t=new Dr(0);else if(1===e)if(ur(i=arguments[0]))t=new Dr(i);else if(hr(i))t=function(r,e){var t,n;for(t=e.length,n=0;n<t;n++)r[n]=vr(e[n]);return r}(new Dr(i.length),i);else if(pr(i))t=new Dr(i);else{if(!gr(i))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!1===ne)throw new TypeError(S("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",i));if(!Or(i[Zr]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!Or((t=i[Zr]()).next))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));t=new Dr(ee(t))}else{if(!pr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!ur(r=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(2===e)t=new Dr(t,r);else{if(!ur(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*te>t.byteLength-r)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*te));t=new Dr(t,r,n)}}return P(this,"_buffer",t),P(this,"_length",t.length),this}P(ae,"BYTES_PER_ELEMENT",te),P(ae,"name","BooleanArray"),P(ae,"from",(function(r){var e,t,n,i,o,a,u,f,s;if(!Or(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!oe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((t=arguments.length)>1){if(!Or(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(hr(r)){if(n){for(f=r.length,u=r.get&&r.set?re("default"):Kr("default"),o=(i=new this(f))._buffer,s=0;s<f;s++)o[s]=vr(n.call(e,u(r,s),s));return i}return new this(r)}if(gr(r)&&ne&&Or(r[Zr])){if(!Or((o=r[Zr]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));for(a=n?function(r,e,t){var n,i,o;for(n=[],o=-1;!(i=r.next()).done;)o+=1,n.push(vr(e.call(t,i.value,o)));return n}(o,n,e):ee(o),o=(i=new this(f=a.length))._buffer,s=0;s<f;s++)o[s]=a[s];return i}throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),P(ae,"of",(function(){var r,e;if(!Or(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!oe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),P(ae.prototype,"at",(function(r){var e,t;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ir(r))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",r));if(t=this._length,e=this._buffer,r<0&&(r+=t),!(r<0||r>=t))return vr(e[r])})),Xr(ae.prototype,"buffer",(function(){return this._buffer.buffer})),Xr(ae.prototype,"byteLength",(function(){return this._buffer.byteLength})),Xr(ae.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(ae.prototype,"BYTES_PER_ELEMENT",ae.BYTES_PER_ELEMENT),P(ae.prototype,"copyWithin",(function(r,e){if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(r,e):this._buffer.copyWithin(r,e,arguments[2]),this})),P(ae.prototype,"entries",(function(){var r,e,t,n,i,o;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,n=this._buffer,t=this._length,o=-1,P(e={},"next",(function(){return o+=1,i||o>=t?{done:!0}:{value:[o,vr(n[o])],done:!1}})),P(e,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(e,Zr,(function(){return r.entries()})),e})),P(ae.prototype,"every",(function(r,e){var t,n;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(!r.call(e,vr(t[n]),n,this))return!1;return!0})),P(ae.prototype,"fill",(function(r,e,t){var n,i,o,a;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!wr(r))throw new TypeError(S("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1){if(!ir(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!ir(t))throw new TypeError(S("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(o=r?1:0,a=e;a<t;a++)n[a]=o;return this})),P(ae.prototype,"filter",(function(r,e){var t,n,i,o;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=vr(t[i]),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),P(ae.prototype,"find",(function(r,e){var t,n,i;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=0;i<this._length;i++)if(n=vr(t[i]),r.call(e,n,i,this))return n})),P(ae.prototype,"findIndex",(function(r,e){var t,n,i;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=0;i<this._length;i++)if(n=vr(t[i]),r.call(e,n,i,this))return i;return-1})),P(ae.prototype,"findLast",(function(r,e){var t,n,i;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=vr(t[i]),r.call(e,n,i,this))return n})),P(ae.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,i=this._length-1;i>=0;i--)if(n=vr(t[i]),r.call(e,n,i,this))return i;return-1})),P(ae.prototype,"forEach",(function(r,e){var t,n;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)r.call(e,vr(t[n]),n,this)})),P(ae.prototype,"get",(function(r){if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ur(r))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return vr(this._buffer[r])})),P(ae.prototype,"includes",(function(r,e){var t,n;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!wr(r))throw new TypeError(S("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!ir(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(t=this._buffer,n=e;n<this._length;n++)if(r===vr(t[n]))return!0;return!1})),P(ae.prototype,"indexOf",(function(r,e){var t,n;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!wr(r))throw new TypeError(S("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!ir(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(t=this._buffer,n=e;n<this._length;n++)if(r===vr(t[n]))return n;return-1})),P(ae.prototype,"join",(function(r){var e,t,n;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(arguments.length>0){if(!Mr(r))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r))}else r=",";for(e=this._buffer,t=[],n=0;n<this._length;n++)e[n]?t.push("true"):t.push("false");return t.join(r)})),P(ae.prototype,"keys",(function(){var r,e,t,n,i;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,t=this._length,i=-1,P(e={},"next",(function(){return i+=1,n||i>=t?{done:!0}:{value:i,done:!1}})),P(e,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(e,Zr,(function(){return r.keys()})),e})),P(ae.prototype,"lastIndexOf",(function(r,e){var t,n;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!wr(r))throw new TypeError(S("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!ir(e))throw new TypeError(S("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(t=this._buffer,n=e;n>=0;n--)if(r===vr(t[n]))return n;return-1})),Xr(ae.prototype,"length",(function(){return this._length})),P(ae.prototype,"map",(function(r,e){var t,n,i,o;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(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;o<this._length;o++)t[o]=vr(r.call(e,vr(i[o]),o,this));return n})),P(ae.prototype,"reduce",(function(r,e){var t,n,i,o;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,n=this._length,arguments.length>1)i=e,o=0;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=vr(t[0]),o=1}for(;o<n;o++)i=r(i,vr(t[o]),o,this);return i})),P(ae.prototype,"reduceRight",(function(r,e){var t,n,i,o;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,n=this._length,arguments.length>1)i=e,o=n-1;else{if(0===n)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=vr(t[n-1]),o=n-2}for(;o>=0;o--)i=r(i,vr(t[o]),o,this);return i})),P(ae.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,t=this._length,n=er(t/2),i=0;i<n;i++)o=t-i-1,e=r[i],r[i]=r[o],r[o]=e;return this})),P(ae.prototype,"set",(function(r){var e,t,n,i,o,a,u;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,arguments.length>1){if(!ur(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(hr(r)){if(t+(o=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=ie(r)?r._buffer:r,u=n.byteOffset+t*te,e.buffer===n.buffer&&e.byteOffset<u&&e.byteOffset+e.byteLength>u){for(i=new Dr(e.length),a=0;a<e.length;a++)i[a]=e[a];e=i}for(a=0;a<o;t++,a++)n[t]=e[a]?1:0}else{if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));n[t]=r?1:0}})),P(ae.prototype,"slice",(function(r,e){var t,n,i,o,a,u;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(o=this._buffer,a=this._length,0===arguments.length)r=0,e=a;else{if(!ir(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a)<0&&(r=0),1===arguments.length)e=a;else{if(!ir(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=a)<0&&(e=0):e>a&&(e=a)}}for(t=r<e?e-r:0,n=(i=new this.constructor(t))._buffer,u=0;u<t;u++)n[u]=o[u+r];return i})),P(ae.prototype,"some",(function(r,e){var t,n;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(r.call(e,vr(t[n]),n,this))return!0;return!1})),P(ae.prototype,"sort",(function(r){var e;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(e=this._buffer,0===arguments.length)return e.sort(),this;if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));return e.sort((function(e,t){return r(vr(e),vr(t))})),this})),P(ae.prototype,"subarray",(function(r,e){var t,n,i;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,i=this._length,0===arguments.length)r=0,e=i;else{if(!ir(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),1===arguments.length)e=i;else{if(!ir(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*te):(i=e-r,t=n.byteOffset+r*te),new this.constructor(n.buffer,t,i<0?0:i)})),P(ae.prototype,"toLocaleString",(function(r,e){var t,n,i,o,a;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)n=[];else{if(!Mr(r)&&!Yr(r))throw new TypeError(S("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)t={};else{if(!gr(e))throw new TypeError(S("invalid argument. Options argument must be an object. Value: `%s`.",e));t=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(vr(o[a]).toLocaleString(n,t));return i.join(",")})),P(ae.prototype,"toReversed",(function(){var r,e,t,n,i;if(!ie(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<t;i++)r[i]=n[t-i-1];return e})),P(ae.prototype,"toSorted",(function(r){var e,t,n,i,o;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(n=this._length,t=new this.constructor(n),i=this._buffer,e=t._buffer,o=0;o<n;o++)e[o]=i[o];if(0===arguments.length)return e.sort(),t;if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));return e.sort((function(e,t){return r(vr(e),vr(t))})),t})),P(ae.prototype,"toString",(function(){var r,e,t;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],e=this._buffer,t=0;t<this._length;t++)e[t]?r.push("true"):r.push("false");return r.join(",")})),P(ae.prototype,"values",(function(){var r,e,t,n,i,o;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return e=this,i=this._buffer,t=this._length,o=-1,P(r={},"next",(function(){return o+=1,n||o>=t?{done:!0}:{value:vr(i[o]),done:!1}})),P(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(r,Zr,(function(){return e.values()})),r})),P(ae.prototype,"with",(function(r,e){var t,n;if(!ie(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!ir(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(n=this._length,r<0&&(r+=n),r<0||r>=n)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!wr(e))throw new TypeError(S("invalid argument. Second argument must be a boolean. Value: `%s`.",e));return(t=new this.constructor(this._buffer))._buffer[r]=e?1:0,t}));var ue="function"==typeof Float64Array,fe="function"==typeof Float64Array?Float64Array:null,se="function"==typeof Float64Array?Float64Array:void 0,le=function(){var r,e,t;if("function"!=typeof fe)return!1;try{e=new fe([1,3.14,-3.14,NaN]),t=e,r=(ue&&t instanceof Float64Array||"[object Float64Array]"===z(t))&&1===e[0]&&3.14===e[1]&&-3.14===e[2]&&e[3]!=e[3]}catch(e){r=!1}return r}()?se:function(){throw new Error("not implemented")},he="function"==typeof Float32Array,ce="function"==typeof Float32Array?Float32Array:null,pe="function"==typeof Float32Array?Float32Array:void 0,ye=function(){var r,e,t;if("function"!=typeof ce)return!1;try{e=new ce([1,3.14,-3.14,5e40]),t=e,r=(he&&t instanceof Float32Array||"[object Float32Array]"===z(t))&&1===e[0]&&3.140000104904175===e[1]&&-3.140000104904175===e[2]&&e[3]===Q}catch(e){r=!1}return r}()?pe:function(){throw new Error("not implemented")},ge="function"==typeof Int16Array,me="function"==typeof Int16Array?Int16Array:null,we="function"==typeof Int16Array?Int16Array:void 0,ve=function(){var r,e,t;if("function"!=typeof me)return!1;try{e=new me([1,3.14,-3.14,32768]),t=e,r=(ge&&t instanceof Int16Array||"[object Int16Array]"===z(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-32768===e[3]}catch(e){r=!1}return r}()?we:function(){throw new Error("not implemented")},be="function"==typeof Int32Array,de="function"==typeof Int32Array?Int32Array:null,Ee="function"==typeof Int32Array?Int32Array:void 0,_e=function(){var r,e,t;if("function"!=typeof de)return!1;try{e=new de([1,3.14,-3.14,2147483648]),t=e,r=(be&&t instanceof Int32Array||"[object Int32Array]"===z(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-2147483648===e[3]}catch(e){r=!1}return r}()?Ee:function(){throw new Error("not implemented")},Te="function"==typeof Int8Array,xe="function"==typeof Int8Array?Int8Array:null,Ve="function"==typeof Int8Array?Int8Array:void 0,Ae=function(){var r,e,t;if("function"!=typeof xe)return!1;try{e=new xe([1,3.14,-3.14,128]),t=e,r=(Te&&t instanceof Int8Array||"[object Int8Array]"===z(t))&&1===e[0]&&3===e[1]&&-3===e[2]&&-128===e[3]}catch(e){r=!1}return r}()?Ve:function(){throw new Error("not implemented")},Fe="function"==typeof Uint16Array,je="function"==typeof Uint16Array?Uint16Array:null,Se="function"==typeof Uint16Array?Uint16Array:void 0,ke=function(){var r,e,t;if("function"!=typeof je)return!1;try{e=new je(e=[1,3.14,-3.14,65536,65537]),t=e,r=(Fe&&t instanceof Uint16Array||"[object Uint16Array]"===z(t))&&1===e[0]&&3===e[1]&&65533===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Se:function(){throw new Error("not implemented")},Le="function"==typeof Uint32Array,Re="function"==typeof Uint32Array?Uint32Array:null,Ie="function"==typeof Uint32Array?Uint32Array:void 0,Be=function(){var r,e,t;if("function"!=typeof Re)return!1;try{e=new Re(e=[1,3.14,-3.14,4294967296,4294967297]),t=e,r=(Le&&t instanceof Uint32Array||"[object Uint32Array]"===z(t))&&1===e[0]&&3===e[1]&&4294967293===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r}()?Ie:function(){throw new Error("not implemented")},Oe="function"==typeof Uint8ClampedArray,Me="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null,Ce="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0,Pe=function(){var r,e,t;if("function"!=typeof Me)return!1;try{e=new Me([-1,0,1,3.14,4.99,255,256]),t=e,r=(Oe&&t instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===z(t))&&0===e[0]&&0===e[1]&&1===e[2]&&3===e[3]&&5===e[4]&&255===e[5]&&255===e[6]}catch(e){r=!1}return r}()?Ce:function(){throw new Error("not implemented")},Ne=4294967295;function Ue(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&tr(r.length)&&r.length>=0&&r.length<=Ne}function Ye(r,e,t){C(r,e,{configurable:!1,enumerable:!0,writable:!1,value:t})}function We(r,e){if(!(this instanceof We))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!N(r))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",r));if(!N(e))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return Ye(this,"re",r),Ye(this,"im",e),this}P(We,"name","Complex128"),P(We,"BYTES_PER_ELEMENT",8),P(We.prototype,"BYTES_PER_ELEMENT",8),P(We.prototype,"byteLength",16),P(We.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),P(We.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var $e="function"==typeof Math.fround?Math.fround:null,Ge=new ye(1),Ze="function"==typeof $e?$e:function(r){return Ge[0]=r,Ge[0]};function Xe(r,e){if(!(this instanceof Xe))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!N(r))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",r));if(!N(e))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",e));return Ye(this,"re",Ze(r)),Ye(this,"im",Ze(e)),this}function ze(r){return r instanceof We||r instanceof Xe||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function Je(r){return tr(r/2)}P(Xe,"name","Complex64"),P(Xe,"BYTES_PER_ELEMENT",4),P(Xe.prototype,"BYTES_PER_ELEMENT",4),P(Xe.prototype,"byteLength",8),P(Xe.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),P(Xe.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var qe=8;function De(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===qe}var He=16;function Ke(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===He}function Qe(r){return r.re}function rt(r){return r.im}function et(r,e){return new ye(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function tt(r,e){return new le(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*e,2*(r.length-e))}function nt(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(Ue(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!ze(n))return new TypeError(S("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(Qe(n),rt(n))}return e}var it=2*ye.BYTES_PER_ELEMENT,ot=Gr();function at(r){return r instanceof st||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function ut(r){return r===st||"Complex128Array"===r.name}function ft(r,e){return new Xe(r[e*=2],r[e+1])}function st(){var r,e,t,n;if(e=arguments.length,!(this instanceof st))return 0===e?new st:1===e?new st(arguments[0]):2===e?new st(arguments[0],arguments[1]):new st(arguments[0],arguments[1],arguments[2]);if(0===e)t=new ye(0);else if(1===e)if(ur(arguments[0]))t=new ye(2*arguments[0]);else if(hr(arguments[0]))if((n=(t=arguments[0]).length)&&yr(t)&&ze(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!ze(n=e[i]))return null;r[o]=Qe(n),r[o+1]=rt(n),o+=2}return r}(new ye(2*n),t),null===t){if(!Je(n))throw new RangeError(S("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new ye(arguments[0])}}else{if(De(t))t=et(t,0);else if(Ke(t))t=tt(t,0);else if(!Je(n))throw new RangeError(S("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new ye(t)}else if(pr(arguments[0])){if(!tr((t=arguments[0]).byteLength/it))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",it,t.byteLength));t=new ye(t)}else{if(!gr(arguments[0]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(t=arguments[0],!1===ot)throw new TypeError(S("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!Or(t[Zr]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Or((t=t[Zr]()).next))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if((t=nt(t))instanceof Error)throw t;t=new ye(t)}else{if(!pr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!ur(r=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!tr(r/it))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",it,r));if(2===e){if(!tr((n=t.byteLength-r)/it))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",it,n));t=new ye(t,r)}else{if(!ur(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*it>t.byteLength-r)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*it));t=new ye(t,r,2*n)}}return P(this,"_buffer",t),P(this,"_length",t.length/2),this}function lt(r){return r.re}function ht(r){return r.im}function ct(r){var e,t,n;for(e=[];!(t=r.next()).done;)if(Ue(n=t.value)&&n.length>=2)e.push(n[0],n[1]);else{if(!ze(n))return new TypeError(S("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(lt(n),ht(n))}return e}P(st,"BYTES_PER_ELEMENT",it),P(st,"name","Complex64Array"),P(st,"from",(function(r){var e,t,n,i,o,a,u,f,s,l,h,c;if(!Or(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ut(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Or(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(at(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(ze(l=n.call(e,r.get(h),h)))o[c]=Qe(l),o[c+1]=rt(l);else{if(!(Ue(l)&&l.length>=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(r)}if(hr(r)){if(n){for(f=r.length,u=r.get&&r.set?re("default"):Kr("default"),h=0;h<f;h++)if(!ze(u(r,h))){s=!0;break}if(s){if(!Je(f))throw new RangeError(S("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(e,u(r,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(ze(l=n.call(e,u(r,h),h)))o[c]=Qe(l),o[c+1]=rt(l);else{if(!(Ue(l)&&l.length>=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(r)}if(gr(r)&&ot&&Or(r[Zr])){if(!Or((o=r[Zr]()).next))throw new TypeError(S("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,Ue(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!ze(o))return new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(Qe(o),rt(o))}return n}(o,n,e):nt(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),P(st,"of",(function(){var r,e;if(!Or(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ut(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),P(st.prototype,"at",(function(r){if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(r))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return ft(this._buffer,r)})),Xr(st.prototype,"buffer",(function(){return this._buffer.buffer})),Xr(st.prototype,"byteLength",(function(){return this._buffer.byteLength})),Xr(st.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(st.prototype,"BYTES_PER_ELEMENT",st.BYTES_PER_ELEMENT),P(st.prototype,"copyWithin",(function(r,e){if(!at(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})),P(st.prototype,"entries",(function(){var r,e,t,n,i,o;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._buffer,t=this._length,o=-1,P(e={},"next",(function(){return o+=1,i||o>=t?{done:!0}:{value:[o,ft(n,o)],done:!1}})),P(e,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(e,Zr,(function(){return r.entries()})),e})),P(st.prototype,"every",(function(r,e){var t,n;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(!r.call(e,ft(t,n),n,this))return!1;return!0})),P(st.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ze(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1){if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!tr(t))throw new TypeError(S("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=Qe(r),u=rt(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),P(st.prototype,"filter",(function(r,e){var t,n,i,o;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=ft(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),P(st.prototype,"find",(function(r,e){var t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=ft(t,n),r.call(e,i,n,this))return i})),P(st.prototype,"findIndex",(function(r,e){var t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=ft(t,n),r.call(e,i,n,this))return n;return-1})),P(st.prototype,"findLast",(function(r,e){var t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=ft(t,n),r.call(e,i,n,this))return i})),P(st.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=ft(t,n),r.call(e,i,n,this))return n;return-1})),P(st.prototype,"forEach",(function(r,e){var t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)i=ft(t,n),r.call(e,i,n,this)})),P(st.prototype,"get",(function(r){if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ur(r))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return ft(this._buffer,r)})),P(st.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ze(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Qe(r),o=rt(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),P(st.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ze(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=Qe(r),o=rt(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),P(st.prototype,"join",(function(r){var e,t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Mr(r))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r));n=r}for(e=[],t=this._buffer,i=0;i<this._length;i++)e.push(ft(t,i).toString());return e.join(n)})),P(st.prototype,"keys",(function(){var r,e,t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._length,i=-1,P(e={},"next",(function(){return i+=1,n||i>=t?{done:!0}:{value:i,done:!1}})),P(e,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(e,Zr,(function(){return r.keys()})),e})),P(st.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ze(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(S("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=Qe(r),o=rt(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),Xr(st.prototype,"length",(function(){return this._length})),P(st.prototype,"map",(function(r,e){var t,n,i,o,a;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("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;o<this._length;o++)if(ze(a=r.call(e,ft(n,o),o,this)))t[2*o]=Qe(a),t[2*o+1]=rt(a);else{if(!Ue(a)||2!==a.length)throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));t[2*o]=a[0],t[2*o+1]=a[1]}return i})),P(st.prototype,"reduce",(function(r,e){var t,n,i,o;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)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=ft(t,0),o=1}for(;o<i;o++)n=r(n,ft(t,o),o,this);return n})),P(st.prototype,"reduceRight",(function(r,e){var t,n,i,o;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)n=e,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=ft(t,i-1),o=i-2}for(;o>=0;o--)n=r(n,ft(t,o),o,this);return n})),P(st.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=er(t/2),i=0;i<n;i++)o=t-i-1,e=r[2*i],r[2*i]=r[2*o],r[2*o]=e,e=r[2*i+1],r[2*i+1]=r[2*o+1],r[2*o+1]=e;return this})),P(st.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,s;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!ur(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(ze(r)){if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=Qe(r),void(n[t+1]=rt(r))}if(at(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,s=n.byteOffset+t*it,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new ye(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(t*=2,s=0,f=0;f<a;f++)n[t]=e[s],n[t+1]=e[s+1],t+=2,s+=2}else{if(!hr(r))throw new TypeError(S("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r));for(a=r.length,f=0;f<a;f++)if(!ze(r[f])){o=!0;break}if(o){if(!Je(a))throw new RangeError(S("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(t+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,s=n.byteOffset+t*it,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new ye(a),f=0;f<a;f++)i[f]=e[f];e=i}for(t*=2,a/=2,s=0,f=0;f<a;f++)n[t]=e[s],n[t+1]=e[s+1],t+=2,s+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;f<a;f++)u=r[f],n[t]=Qe(u),n[t+1]=rt(u),t+=2}})),P(st.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)r=0,e=u;else{if(!tr(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=u)<0&&(r=0),1===arguments.length)e=u;else{if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(t=r<e?e-r:0,n=(i=new this.constructor(t))._buffer,f=0;f<t;f++)o=2*(f+r),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),P(st.prototype,"some",(function(r,e){var t,n;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(r.call(e,ft(t,n),n,this))return!0;return!1})),P(st.prototype,"sort",(function(r){var e,t,n,i,o;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(ft(t,i));for(e.sort(r),i=0;i<n;i++)t[o=2*i]=Qe(e[i]),t[o+1]=rt(e[i]);return this})),P(st.prototype,"subarray",(function(r,e){var t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)r=0,e=i;else{if(!tr(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),1===arguments.length)e=i;else{if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*it):(i=e-r,t=n.byteOffset+r*it),new this.constructor(n.buffer,t,i<0?0:i)})),P(st.prototype,"toLocaleString",(function(r,e){var t,n,i,o,a;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!Mr(r)&&!Yr(r))throw new TypeError(S("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)t={};else{if(!gr(e))throw new TypeError(S("invalid argument. Options argument must be an object. Value: `%s`.",e));t=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(ft(o,a).toLocaleString(n,t));return i.join(",")})),P(st.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!at(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<t;i++)o=t-i-1,r[2*i]=n[2*o],r[2*i+1]=n[2*o+1];return e})),P(st.prototype,"toSorted",(function(r){var e,t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(ft(t,i));return e.sort(r),new st(e)})),P(st.prototype,"toString",(function(){var r,e,t;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=this._buffer,t=0;t<this._length;t++)r.push(ft(e,t).toString());return r.join(",")})),P(st.prototype,"values",(function(){var r,e,t,n,i,o;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,i=this._buffer,t=this._length,o=-1,P(r={},"next",(function(){return o+=1,n||o>=t?{done:!0}:{value:ft(i,o),done:!1}})),P(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(r,Zr,(function(){return e.values()})),r})),P(st.prototype,"with",(function(r,e){var t,n,i;if(!at(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(i=this._length,r<0&&(r+=i),r<0||r>=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ze(e))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=Qe(e),t[2*r+1]=rt(e),n}));var pt=2*le.BYTES_PER_ELEMENT,yt=Gr();function gt(r){return r instanceof vt||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function mt(r){return r===vt||"Complex64Array"===r.name}function wt(r,e){return new We(r[e*=2],r[e+1])}function vt(){var r,e,t,n;if(e=arguments.length,!(this instanceof vt))return 0===e?new vt:1===e?new vt(arguments[0]):2===e?new vt(arguments[0],arguments[1]):new vt(arguments[0],arguments[1],arguments[2]);if(0===e)t=new le(0);else if(1===e)if(ur(arguments[0]))t=new le(2*arguments[0]);else if(hr(arguments[0]))if((n=(t=arguments[0]).length)&&yr(t)&&ze(t[0])){if(t=function(r,e){var t,n,i,o;for(t=e.length,o=0,i=0;i<t;i++){if(!ze(n=e[i]))return null;r[o]=lt(n),r[o+1]=ht(n),o+=2}return r}(new le(2*n),t),null===t){if(!Je(n))throw new RangeError(S("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new le(arguments[0])}}else{if(De(t))t=et(t,0);else if(Ke(t))t=tt(t,0);else if(!Je(n))throw new RangeError(S("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new le(t)}else if(pr(arguments[0])){if(!tr((t=arguments[0]).byteLength/pt))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",pt,t.byteLength));t=new le(t)}else{if(!gr(arguments[0]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));if(t=arguments[0],!1===yt)throw new TypeError(S("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!Or(t[Zr]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Or((t=t[Zr]()).next))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if((t=ct(t))instanceof Error)throw t;t=new le(t)}else{if(!pr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!ur(r=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!tr(r/pt))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",pt,r));if(2===e){if(!tr((n=t.byteLength-r)/pt))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",pt,n));t=new le(t,r)}else{if(!ur(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*pt>t.byteLength-r)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*pt));t=new le(t,r,2*n)}}return P(this,"_buffer",t),P(this,"_length",t.length/2),this}P(vt,"BYTES_PER_ELEMENT",pt),P(vt,"name","Complex128Array"),P(vt,"from",(function(r){var e,t,n,i,o,a,u,f,s,l,h,c;if(!Or(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!mt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Or(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(e=arguments[2])}if(gt(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(ze(l=n.call(e,r.get(h),h)))o[c]=lt(l),o[c+1]=ht(l);else{if(!(Ue(l)&&l.length>=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(r)}if(hr(r)){if(n){for(f=r.length,u=r.get&&r.set?re("default"):Kr("default"),h=0;h<f;h++)if(!ze(u(r,h))){s=!0;break}if(s){if(!Je(f))throw new RangeError(S("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",f));for(o=(i=new this(f/2))._buffer,h=0;h<f;h++)o[h]=n.call(e,u(r,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(ze(l=n.call(e,u(r,h),h)))o[c]=lt(l),o[c+1]=ht(l);else{if(!(Ue(l)&&l.length>=2))throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",l));o[c]=l[0],o[c+1]=l[1]}c+=2}return i}return new this(r)}if(gr(r)&&yt&&Or(r[Zr])){if(!Or((o=r[Zr]()).next))throw new TypeError(S("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,Ue(o=e.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!ze(o))return new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));n.push(lt(o),ht(o))}return n}(o,n,e):ct(o),a instanceof Error)throw a;for(o=(i=new this(f=a.length/2))._buffer,h=0;h<f;h++)o[h]=a[h];return i}throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))})),P(vt,"of",(function(){var r,e;if(!Or(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!mt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=0;e<arguments.length;e++)r.push(arguments[e]);return new this(r)})),P(vt.prototype,"at",(function(r){if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(r))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return wt(this._buffer,r)})),Xr(vt.prototype,"buffer",(function(){return this._buffer.buffer})),Xr(vt.prototype,"byteLength",(function(){return this._buffer.byteLength})),Xr(vt.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(vt.prototype,"BYTES_PER_ELEMENT",vt.BYTES_PER_ELEMENT),P(vt.prototype,"copyWithin",(function(r,e){if(!gt(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})),P(vt.prototype,"entries",(function(){var r,e,t,n,i,o,a;if(!gt(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,P(t={},"next",(function(){var e;return o+=1,i||o>=n?{done:!0}:(e=new We(r[a+=2],r[a+1]),{value:[o,e],done:!1})})),P(t,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(t,Zr,(function(){return e.entries()})),t})),P(vt.prototype,"every",(function(r,e){var t,n;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(!r.call(e,wt(t,n),n,this))return!1;return!0})),P(vt.prototype,"fill",(function(r,e,t){var n,i,o,a,u,f;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ze(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1){if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),arguments.length>2){if(!tr(t))throw new TypeError(S("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=lt(r),u=ht(r),f=e;f<t;f++)n[o=2*f]=a,n[o+1]=u;return this})),P(vt.prototype,"filter",(function(r,e){var t,n,i,o;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=wt(t,i),r.call(e,o,i,this)&&n.push(o);return new this.constructor(n)})),P(vt.prototype,"find",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=wt(t,n),r.call(e,i,n,this))return i})),P(vt.prototype,"findIndex",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(i=wt(t,n),r.call(e,i,n,this))return n;return-1})),P(vt.prototype,"findLast",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=wt(t,n),r.call(e,i,n,this))return i})),P(vt.prototype,"findLastIndex",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=wt(t,n),r.call(e,i,n,this))return n;return-1})),P(vt.prototype,"forEach",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)i=wt(t,n),r.call(e,i,n,this)})),P(vt.prototype,"get",(function(r){if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ur(r))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return wt(this._buffer,r)})),Xr(vt.prototype,"length",(function(){return this._length})),P(vt.prototype,"includes",(function(r,e){var t,n,i,o,a;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ze(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=lt(r),o=ht(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),P(vt.prototype,"indexOf",(function(r,e){var t,n,i,o,a;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ze(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0&&(e+=this._length)<0&&(e=0)}else e=0;for(i=lt(r),o=ht(r),t=this._buffer,a=e;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),P(vt.prototype,"join",(function(r){var e,t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Ur(r))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r));n=r}for(e=[],t=this._buffer,i=0;i<this._length;i++)e.push(wt(t,i).toString());return e.join(n)})),P(vt.prototype,"keys",(function(){var r,e,t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,t=this._length,i=-1,P(e={},"next",(function(){return i+=1,n||i>=t?{done:!0}:{value:i,done:!1}})),P(e,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(e,Zr,(function(){return r.keys()})),e})),P(vt.prototype,"lastIndexOf",(function(r,e){var t,n,i,o,a;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ze(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!tr(e))throw new TypeError(S("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=lt(r),o=ht(r),t=this._buffer,a=e;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),P(vt.prototype,"map",(function(r,e){var t,n,i,o,a;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("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;o<this._length;o++)if(ze(a=r.call(e,wt(n,o),o,this)))t[2*o]=lt(a),t[2*o+1]=ht(a);else{if(!Ue(a)||2!==a.length)throw new TypeError(S("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));t[2*o]=a[0],t[2*o+1]=a[1]}return i})),P(vt.prototype,"reduce",(function(r,e){var t,n,i,o;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)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=wt(t,0),o=1}for(;o<i;o++)n=r(n,wt(t,o),o,this);return n})),P(vt.prototype,"reduceRight",(function(r,e){var t,n,i,o;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(t=this._buffer,i=this._length,arguments.length>1)n=e,o=i-1;else{if(0===i)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");n=wt(t,i-1),o=i-2}for(;o>=0;o--)n=r(n,wt(t,o),o,this);return n})),P(vt.prototype,"reverse",(function(){var r,e,t,n,i,o;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=this._buffer,n=er(t/2),i=0;i<n;i++)o=t-i-1,e=r[2*i],r[2*i]=r[2*o],r[2*o]=e,e=r[2*i+1],r[2*i+1]=r[2*o+1],r[2*o+1]=e;return this})),P(vt.prototype,"set",(function(r){var e,t,n,i,o,a,u,f,s;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!ur(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(ze(r)){if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=lt(r),void(n[t+1]=ht(r))}if(gt(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,s=n.byteOffset+t*pt,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new le(e.length),f=0;f<e.length;f++)i[f]=e[f];e=i}for(t*=2,s=0,f=0;f<a;f++)n[t]=e[s],n[t+1]=e[s+1],t+=2,s+=2}else{if(!hr(r))throw new TypeError(S("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r));for(a=r.length,f=0;f<a;f++)if(!ze(r[f])){o=!0;break}if(o){if(!Je(a))throw new RangeError(S("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",a));if(t+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(e=r,s=n.byteOffset+t*pt,e.buffer===n.buffer&&e.byteOffset<s&&e.byteOffset+e.byteLength>s){for(i=new le(a),f=0;f<a;f++)i[f]=e[f];e=i}for(t*=2,a/=2,s=0,f=0;f<a;f++)n[t]=e[s],n[t+1]=e[s+1],t+=2,s+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,f=0;f<a;f++)u=r[f],n[t]=lt(u),n[t+1]=ht(u),t+=2}})),P(vt.prototype,"slice",(function(r,e){var t,n,i,o,a,u,f;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)r=0,e=u;else{if(!tr(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=u)<0&&(r=0),1===arguments.length)e=u;else{if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=u)<0&&(e=0):e>u&&(e=u)}}for(t=r<e?e-r:0,n=(i=new this.constructor(t))._buffer,f=0;f<t;f++)o=2*(f+r),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),P(vt.prototype,"some",(function(r,e){var t,n;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=0;n<this._length;n++)if(r.call(e,wt(t,n),n,this))return!0;return!1})),P(vt.prototype,"sort",(function(r){var e,t,n,i,o;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(wt(t,i));for(e.sort(r),i=0;i<n;i++)t[o=2*i]=lt(e[i]),t[o+1]=ht(e[i]);return this})),P(vt.prototype,"subarray",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)r=0,e=i;else{if(!tr(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),1===arguments.length)e=i;else{if(!tr(e))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",e));e<0?(e+=i)<0&&(e=0):e>i&&(e=i)}}return r>=i?(i=0,t=n.byteLength):r>=e?(i=0,t=n.byteOffset+r*pt):(i=e-r,t=n.byteOffset+r*pt),new this.constructor(n.buffer,t,i<0?0:i)})),P(vt.prototype,"toLocaleString",(function(r,e){var t,n,i,o,a;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!Ur(r)&&!Yr(r))throw new TypeError(S("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));n=r}if(arguments.length<2)t={};else{if(!gr(e))throw new TypeError(S("invalid argument. Options argument must be an object. Value: `%s`.",e));t=e}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(wt(o,a).toLocaleString(n,t));return i.join(",")})),P(vt.prototype,"toReversed",(function(){var r,e,t,n,i,o;if(!gt(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<t;i++)o=t-i-1,r[2*i]=n[2*o],r[2*i+1]=n[2*o+1];return e})),P(vt.prototype,"toSorted",(function(r){var e,t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Or(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(t=this._buffer,n=this._length,e=[],i=0;i<n;i++)e.push(wt(t,i));return e.sort(r),new vt(e)})),P(vt.prototype,"toString",(function(){var r,e,t;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],e=this._buffer,t=0;t<this._length;t++)r.push(wt(e,t).toString());return r.join(",")})),P(vt.prototype,"values",(function(){var r,e,t,n,i,o;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return e=this,i=this._buffer,t=this._length,o=-1,P(r={},"next",(function(){return o+=1,n||o>=t?{done:!0}:{value:wt(i,o),done:!1}})),P(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),Zr&&P(r,Zr,(function(){return e.values()})),r})),P(vt.prototype,"with",(function(r,e){var t,n,i;if(!gt(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!tr(r))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",r));if(i=this._length,r<0&&(r+=i),r<0||r>=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ze(e))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",e));return(t=(n=new this.constructor(this._buffer))._buffer)[2*r]=lt(e),t[2*r+1]=ht(e),n}));var bt={float64:le,float32:ye,generic:Array,int16:ve,int32:_e,int8:Ae,uint16:ke,uint32:Be,uint8:Dr,uint8c:Pe,complex64:st,complex128:vt,bool:ae};function dt(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"}}}var Et={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32",boolean:"bool",index:"int32",integer_index:"int32",boolean_index:"bool",mask_index:"uint8"}},_t={"dtypes.default":Et.dtypes.default,"dtypes.numeric":Et.dtypes.numeric,"dtypes.real":Et.dtypes.real,"dtypes.floating_point":Et.dtypes.floating_point,"dtypes.real_floating_point":Et.dtypes.real_floating_point,"dtypes.complex_floating_point":Et.dtypes.complex_floating_point,"dtypes.integer":Et.dtypes.integer,"dtypes.signed_integer":Et.dtypes.signed_integer,"dtypes.unsigned_integer":Et.dtypes.unsigned_integer,"dtypes.boolean":Et.dtypes.boolean,"dtypes.index":Et.dtypes.index,"dtypes.integer_index":Et.dtypes.integer_index,"dtypes.boolean_index":Et.dtypes.boolean_index,"dtypes.mask_index":Et.dtypes.mask_index};P(dt,"get",(function(r){var e=_t[r];return void 0===e?null:e}));var Tt=dt.get("dtypes.default");function xt(r){var e,t;if(!ur(r))throw new TypeError(S("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",r));if("generic"===(e=arguments.length>1?arguments[1]:Tt))return function(r,e){var t,n;for(t=[],n=0;n<e;n++)t.push(r);return t}(0,r);if(t=function(r){return bt[r]||null}(e),null===t)throw new TypeError(S("invalid argument. Second argument must be a recognized data type. Value: `%s`.",e));return new t(r)}return function(r){var e;return arguments.length>1?"bool"===(e=arguments[1])?new ae(r):xt(r,e):xt(r)}},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).empty=e();
//# sourceMappingURL=browser.js.map