-
-
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.1 KB
/
Copy pathbrowser.js
File metadata and controls
3 lines (3 loc) · 77.1 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,t;r=this,t=function(){"use strict";var r="function"==typeof Object.defineProperty?Object.defineProperty:null,t=Object.defineProperty;function e(r){return"number"==typeof r}function n(r){var t,e="";for(t=0;t<r;t++)e+="0";return e}function i(r,t,e){var i=!1,o=t-r.length;return o<0||(function(r){return"-"===r[0]}(r)&&(i=!0,r=r.substr(1)),r=e?r+n(o):n(o)+r,i&&(r="-"+r)),r}var o=String.prototype.toLowerCase,a=String.prototype.toUpperCase;function u(r){var t,n,u;switch(r.specifier){case"b":t=2;break;case"o":t=8;break;case"x":case"X":t=16;break;default:t=10}if(n=r.arg,u=parseInt(n,10),!isFinite(u)){if(!e(n))throw new Error("invalid integer. Value: "+n);u=0}return u<0&&("u"===r.specifier||10!==t)&&(u=4294967295+u+1),u<0?(n=(-u).toString(t),r.precision&&(n=i(n,r.precision,r.padRight)),n="-"+n):(n=u.toString(t),u||r.precision?r.precision&&(n=i(n,r.precision,r.padRight)):n="",r.sign&&(n=r.sign+n)),16===t&&(r.alternate&&(n="0x"+n),n=r.specifier===a.call(r.specifier)?a.call(n):o.call(n)),8===t&&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,t){var e,n;switch(t.specifier){case"e":case"E":n=r.toExponential(t.precision);break;case"f":case"F":n=r.toFixed(t.precision);break;case"g":case"G":f(r)<1e-4?((e=t.precision)>0&&(e-=1),n=r.toExponential(e)):n=r.toPrecision(t.precision),t.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: "+t.specifier)}return n=h.call(n,c,"e+0$1"),n=h.call(n,p,"e-0$1"),t.alternate&&(n=h.call(n,y,"$1."),n=h.call(n,g,"$1.e")),r>=0&&t.sign&&(n=t.sign+n),n=t.specifier===l.call(t.specifier)?l.call(n):s.call(n)}function d(r){var t,e="";for(t=0;t<r;t++)e+=" ";return e}var E=String.fromCharCode,_=Array.isArray;function T(r){return r!=r}function x(r){var t={};return t.specifier=r.specifier,t.precision=void 0===r.precision?1:r.precision,t.width=r.width,t.flags=r.flags||"",t.mapping=r.mapping,t}function V(r){var t,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(t=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(t&&"*"===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,t=!1)}switch(o.arg=arguments[l],o.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":t&&(o.padZeros=!1),o.arg=u(o);break;case"s":o.maxWidth=t?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(t||(o.precision=6),h=parseFloat(o.arg),!isFinite(h)){if(!e(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 t={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]&&(t.precision="1"),t}function j(r){var t,e,n,i;for(e=[],i=0,n=A.exec(r);n;)(t=r.slice(i,A.lastIndex-n[0].length)).length&&e.push(t),"%"===n[6]?e.push("%"):e.push(F(n)),i=A.lastIndex,n=A.exec(r);return(t=r.slice(i)).length&&e.push(t),e}function S(r){var t,e;if("string"!=typeof r)throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[j(r)],e=1;e<arguments.length;e++)t.push(arguments[e]);return V.apply(null,t)}var k,L=Object.prototype,I=L.toString,R=L.__defineGetter__,B=L.__defineSetter__,O=L.__lookupGetter__,M=L.__lookupSetter__;k=function(){try{return r({},"x",{}),!0}catch(r){return!1}}()?t:function(r,t,e){var n,i,o,a;if("object"!=typeof r||null===r||"[object Array]"===I.call(r))throw new TypeError(S("invalid argument. First argument must be an object. Value: `%s`.",r));if("object"!=typeof e||null===e||"[object Array]"===I.call(e))throw new TypeError(S("invalid argument. Property descriptor must be an object. Value: `%s`.",e));if((i="value"in e)&&(O.call(r,t)||M.call(r,t)?(n=r.__proto__,r.__proto__=L,delete r[t],r[t]=e.value,r.__proto__=n):r[t]=e.value),o="get"in e,a="set"in e,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&&R&&R.call(r,t,e.get),a&&B&&B.call(r,t,e.set),r};var C=k;function P(r,t,e){C(r,t,{configurable:!1,enumerable:!1,writable:!1,value:e})}function U(r,t){return t>0?0:(1-r)*t}function N(r){return r!=r}function Y(r){return Math.abs(r)}var W="function",$={float64:function(r,t){return r[t]},float32:function(r,t){return r[t]},int32:function(r,t){return r[t]},int16:function(r,t){return r[t]},int8:function(r,t){return r[t]},uint32:function(r,t){return r[t]},uint16:function(r,t){return r[t]},uint8:function(r,t){return r[t]},uint8c:function(r,t){return r[t]},generic:function(r,t){return r[t]},default:function(r,t){return r[t]}};function G(r){var t=$[r];return"function"==typeof t?t:$.default}var Z={float64:function(r,t,e){r[t]=e},float32:function(r,t,e){r[t]=e},int32:function(r,t,e){r[t]=e},int16:function(r,t,e){r[t]=e},int8:function(r,t,e){r[t]=e},uint32:function(r,t,e){r[t]=e},uint16:function(r,t,e){r[t]=e},uint8:function(r,t,e){r[t]=e},uint8c:function(r,t,e){r[t]=e},generic:function(r,t,e){r[t]=e},default:function(r,t,e){r[t]=e}};function X(r){var t=Z[r];return"function"==typeof t?t:Z.default}var J={complex128:function(r,t){return r.get(t)},complex64:function(r,t){return r.get(t)},default:function(r,t){return r.get(t)}};function z(r){var t=J[r];return"function"==typeof t?t:J.default}var q={complex128:function(r,t,e){r.set(e,t)},complex64:function(r,t,e){r.set(e,t)},default:function(r,t,e){r.set(e,t)}};function D(r){var t=q[r];return"function"==typeof t?t:q.default}var H="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function K(){return H&&"symbol"==typeof Symbol.toStringTag}var Q=Object.prototype.toString,rr=Object.prototype.hasOwnProperty;function tr(r,t){return null!=r&&rr.call(r,t)}var er="function"==typeof Symbol?Symbol:void 0,nr="function"==typeof er?er.toStringTag:"",ir=K()?function(r){var t,e,n;if(null==r)return Q.call(r);e=r[nr],t=tr(r,nr);try{r[nr]=void 0}catch(t){return Q.call(r)}return n=Q.call(r),t?r[nr]=e:delete r[nr],n}:function(r){return Q.call(r)},or=Array.isArray?Array.isArray:function(r){return"[object Array]"===ir(r)};function ar(r){if("function"!=typeof r)throw new TypeError(S("invalid argument. Must provide a function. Value: `%s`.",r));return function(t){var e,n;if(!or(t))return!1;if(0===(e=t.length))return!1;for(n=0;n<e;n++)if(!1===r(t[n]))return!1;return!0}}function ur(r){return null!==r&&"object"==typeof r}function fr(r){return ur(r)&&(r._isBuffer||r.constructor&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))}function sr(){return/^\s*function\s*([^(]*)/i}P(ur,"isObjectLikeArray",ar(ur));var lr=/^\s*function\s*([^(]*)/i;function hr(r){var t,e,n;if(("Object"===(e=ir(r).slice(8,-1))||"Error"===e)&&r.constructor){if("string"==typeof(n=r.constructor).name)return n.name;if(t=lr.exec(n.toString()))return t[1]}return fr(r)?"Buffer":e}P(sr,"REGEXP",lr);var cr={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128",BooleanArray:"bool"},pr="function"==typeof Float64Array,yr="function"==typeof Float64Array?Float64Array:null,gr="function"==typeof Float64Array?Float64Array:void 0,mr=function(){var r,t,e;if("function"!=typeof yr)return!1;try{t=new yr([1,3.14,-3.14,NaN]),e=t,r=(pr&&e instanceof Float64Array||"[object Float64Array]"===ir(e))&&1===t[0]&&3.14===t[1]&&-3.14===t[2]&&t[3]!=t[3]}catch(t){r=!1}return r}()?gr:function(){throw new Error("not implemented")},wr="function"==typeof Float32Array,vr=Number.POSITIVE_INFINITY,br="function"==typeof Float32Array?Float32Array:null,dr="function"==typeof Float32Array?Float32Array:void 0,Er=function(){var r,t,e;if("function"!=typeof br)return!1;try{t=new br([1,3.14,-3.14,5e40]),e=t,r=(wr&&e instanceof Float32Array||"[object Float32Array]"===ir(e))&&1===t[0]&&3.140000104904175===t[1]&&-3.140000104904175===t[2]&&t[3]===vr}catch(t){r=!1}return r}()?dr:function(){throw new Error("not implemented")},_r="function"==typeof Uint32Array,Tr="function"==typeof Uint32Array?Uint32Array:null,xr="function"==typeof Uint32Array?Uint32Array:void 0,Vr=function(){var r,t,e;if("function"!=typeof Tr)return!1;try{t=new Tr(t=[1,3.14,-3.14,4294967296,4294967297]),e=t,r=(_r&&e instanceof Uint32Array||"[object Uint32Array]"===ir(e))&&1===t[0]&&3===t[1]&&4294967293===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?xr:function(){throw new Error("not implemented")},Ar="function"==typeof Int32Array,Fr="function"==typeof Int32Array?Int32Array:null,jr="function"==typeof Int32Array?Int32Array:void 0,Sr=function(){var r,t,e;if("function"!=typeof Fr)return!1;try{t=new Fr([1,3.14,-3.14,2147483648]),e=t,r=(Ar&&e instanceof Int32Array||"[object Int32Array]"===ir(e))&&1===t[0]&&3===t[1]&&-3===t[2]&&-2147483648===t[3]}catch(t){r=!1}return r}()?jr:function(){throw new Error("not implemented")},kr="function"==typeof Uint16Array,Lr="function"==typeof Uint16Array?Uint16Array:null,Ir="function"==typeof Uint16Array?Uint16Array:void 0,Rr=function(){var r,t,e;if("function"!=typeof Lr)return!1;try{t=new Lr(t=[1,3.14,-3.14,65536,65537]),e=t,r=(kr&&e instanceof Uint16Array||"[object Uint16Array]"===ir(e))&&1===t[0]&&3===t[1]&&65533===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?Ir:function(){throw new Error("not implemented")},Br="function"==typeof Int16Array,Or="function"==typeof Int16Array?Int16Array:null,Mr="function"==typeof Int16Array?Int16Array:void 0,Cr=function(){var r,t,e;if("function"!=typeof Or)return!1;try{t=new Or([1,3.14,-3.14,32768]),e=t,r=(Br&&e instanceof Int16Array||"[object Int16Array]"===ir(e))&&1===t[0]&&3===t[1]&&-3===t[2]&&-32768===t[3]}catch(t){r=!1}return r}()?Mr:function(){throw new Error("not implemented")},Pr="function"==typeof Uint8Array,Ur="function"==typeof Uint8Array?Uint8Array:null,Nr="function"==typeof Uint8Array?Uint8Array:void 0,Yr=function(){var r,t,e;if("function"!=typeof Ur)return!1;try{t=new Ur(t=[1,3.14,-3.14,256,257]),e=t,r=(Pr&&e instanceof Uint8Array||"[object Uint8Array]"===ir(e))&&1===t[0]&&3===t[1]&&253===t[2]&&0===t[3]&&1===t[4]}catch(t){r=!1}return r}()?Nr:function(){throw new Error("not implemented")},Wr="function"==typeof Uint8ClampedArray,$r="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null,Gr="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0,Zr=function(){var r,t,e;if("function"!=typeof $r)return!1;try{t=new $r([-1,0,1,3.14,4.99,255,256]),e=t,r=(Wr&&e instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===ir(e))&&0===t[0]&&0===t[1]&&1===t[2]&&3===t[3]&&5===t[4]&&255===t[5]&&255===t[6]}catch(t){r=!1}return r}()?Gr:function(){throw new Error("not implemented")},Xr="function"==typeof Int8Array,Jr="function"==typeof Int8Array?Int8Array:null,zr="function"==typeof Int8Array?Int8Array:void 0,qr=function(){var r,t,e;if("function"!=typeof Jr)return!1;try{t=new Jr([1,3.14,-3.14,128]),e=t,r=(Xr&&e instanceof Int8Array||"[object Int8Array]"===ir(e))&&1===t[0]&&3===t[1]&&-3===t[2]&&-128===t[3]}catch(t){r=!1}return r}()?zr:function(){throw new Error("not implemented")};function Dr(r){return"number"==typeof r}var Hr=Number,Kr=Hr.prototype.toString,Qr=K();function rt(r){return"object"==typeof r&&(r instanceof Hr||(Qr?function(r){try{return Kr.call(r),!0}catch(r){return!1}}(r):"[object Number]"===ir(r)))}function tt(r){return Dr(r)||rt(r)}P(tt,"isPrimitive",Dr),P(tt,"isObject",rt);var et=Hr.NEGATIVE_INFINITY,nt=Math.floor;function it(r){return nt(r)===r}function ot(r){return r<vr&&r>et&&it(r)}function at(r){return Dr(r)&&ot(r)}function ut(r){return rt(r)&&ot(r.valueOf())}function ft(r){return at(r)||ut(r)}function st(r){return at(r)&&r>=0}function lt(r){return ut(r)&&r.valueOf()>=0}function ht(r){return st(r)||lt(r)}P(ft,"isPrimitive",at),P(ft,"isObject",ut),P(ht,"isPrimitive",st),P(ht,"isObject",lt);var ct=4294967295;function pt(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&it(r.length)&&r.length>=0&&r.length<=ct}var yt=9007199254740991;function gt(r){return"object"==typeof r&&null!==r&&"number"==typeof r.length&&it(r.length)&&r.length>=0&&r.length<=yt}var mt="function"==typeof ArrayBuffer;function wt(r){return mt&&r instanceof ArrayBuffer||"[object ArrayBuffer]"===ir(r)}function vt(r){return"object"==typeof r&&null!==r&&!or(r)}function bt(r){return"string"==typeof r}var dt=String.prototype.valueOf,Et=K();function _t(r){return"object"==typeof r&&(r instanceof String||(Et?function(r){try{return dt.call(r),!0}catch(r){return!1}}(r):"[object String]"===ir(r)))}function Tt(r){return bt(r)||_t(r)}P(Tt,"isPrimitive",bt),P(Tt,"isObject",_t);var xt=ar(Tt.isPrimitive),Vt=ar(Tt.isObject),At=ar(Tt);P(At,"primitives",xt),P(At,"objects",Vt);var Ft=/./;function jt(r){return"boolean"==typeof r}var St=Boolean,kt=Boolean.prototype.toString,Lt=K();function It(r){return"object"==typeof r&&(r instanceof St||(Lt?function(r){try{return kt.call(r),!0}catch(r){return!1}}(r):"[object Boolean]"===ir(r)))}function Rt(r){return jt(r)||It(r)}P(Rt,"isPrimitive",jt),P(Rt,"isObject",It);var Bt="object"==typeof self?self:null,Ot="object"==typeof window?window:null,Mt="object"==typeof globalThis?globalThis:null,Ct=function(r){if(arguments.length){if(!jt(r))throw new TypeError(S("invalid argument. Must provide a boolean. Value: `%s`.",r));if(r)return new Function("return this;")()}if(Mt)return Mt;if(Bt)return Bt;if(Ot)return Ot;throw new Error("unexpected error. Unable to resolve global object.")}(),Pt=Ct.document&&Ct.document.childNodes,Ut=Int8Array,Nt="function"==typeof Ft||"object"==typeof Ut||"function"==typeof Pt?function(r){return hr(r).toLowerCase()}:function(r){var t;return null===r?"null":"object"==(t=typeof r)?hr(r).toLowerCase():t};function Yt(r){return"function"===Nt(r)}function Wt(r,t,e){C(r,t,{configurable:!1,enumerable:!0,writable:!1,value:e})}function $t(r,t){if(!(this instanceof $t))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Dr(r))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Dr(t))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return Wt(this,"re",r),Wt(this,"im",t),this}P($t,"name","Complex128"),P($t,"BYTES_PER_ELEMENT",8),P($t.prototype,"BYTES_PER_ELEMENT",8),P($t.prototype,"byteLength",16),P($t.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),P($t.prototype,"toJSON",(function(){var r={type:"Complex128"};return r.re=this.re,r.im=this.im,r}));var Gt="function"==typeof Math.fround?Math.fround:null,Zt=new Er(1),Xt="function"==typeof Gt?Gt:function(r){return Zt[0]=r,Zt[0]};function Jt(r,t){if(!(this instanceof Jt))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Dr(r))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",r));if(!Dr(t))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",t));return Wt(this,"re",Xt(r)),Wt(this,"im",Xt(t)),this}function zt(r){return r instanceof $t||r instanceof Jt||"object"==typeof r&&null!==r&&"number"==typeof r.re&&"number"==typeof r.im}function qt(r){return it(r/2)}P(Jt,"name","Complex64"),P(Jt,"BYTES_PER_ELEMENT",4),P(Jt.prototype,"BYTES_PER_ELEMENT",4),P(Jt.prototype,"byteLength",8),P(Jt.prototype,"toString",(function(){var r=""+this.re;return this.im<0?r+=" - "+-this.im:r+=" + "+this.im,r+="i"})),P(Jt.prototype,"toJSON",(function(){var r={type:"Complex64"};return r.re=this.re,r.im=this.im,r}));var Dt=8;function Ht(r){return"object"==typeof r&&null!==r&&"Complex64Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Dt}var Kt=16;function Qt(r){return"object"==typeof r&&null!==r&&"Complex128Array"===r.constructor.name&&r.BYTES_PER_ELEMENT===Kt}function re(){return"function"==typeof er&&"symbol"==typeof er("foo")&&tr(er,"iterator")&&"symbol"==typeof er.iterator}var te=re()?Symbol.iterator:null;function ee(r,t,e){C(r,t,{configurable:!1,enumerable:!1,get:e})}function ne(r){return r.re}function ie(r){return r.im}function oe(r,t){return new Er(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}function ae(r,t){return new mr(r.buffer,r.byteOffset+r.BYTES_PER_ELEMENT*t,2*(r.length-t))}function ue(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(pt(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!zt(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));t.push(ne(n),ie(n))}return t}var fe=2*Er.BYTES_PER_ELEMENT,se=re();function le(r){return r instanceof pe||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function he(r){return r===pe||"Complex128Array"===r.name}function ce(r,t){return new Jt(r[t*=2],r[t+1])}function pe(){var r,t,e,n;if(t=arguments.length,!(this instanceof pe))return 0===t?new pe:1===t?new pe(arguments[0]):2===t?new pe(arguments[0],arguments[1]):new pe(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Er(0);else if(1===t)if(st(arguments[0]))e=new Er(2*arguments[0]);else if(gt(arguments[0]))if((n=(e=arguments[0]).length)&&or(e)&&zt(e[0])){if(e=function(r,t){var e,n,i,o;for(e=t.length,o=0,i=0;i<e;i++){if(!zt(n=t[i]))return null;r[o]=ne(n),r[o+1]=ie(n),o+=2}return r}(new Er(2*n),e),null===e){if(!qt(n))throw new RangeError(S("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));e=new Er(arguments[0])}}else{if(Ht(e))e=oe(e,0);else if(Qt(e))e=ae(e,0);else if(!qt(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));e=new Er(e)}else if(wt(arguments[0])){if(!it((e=arguments[0]).byteLength/fe))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",fe,e.byteLength));e=new Er(e)}else{if(!vt(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(e=arguments[0],!1===se)throw new TypeError(S("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",e));if(!Yt(e[te]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",e));if(!Yt((e=e[te]()).next))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",e));if((e=ue(e))instanceof Error)throw e;e=new Er(e)}else{if(!wt(e=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!st(r=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!it(r/fe))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",fe,r));if(2===t){if(!it((n=e.byteLength-r)/fe))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",fe,n));e=new Er(e,r)}else{if(!st(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*fe>e.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*fe));e=new Er(e,r,2*n)}}return P(this,"_buffer",e),P(this,"_length",e.length/2),this}function ye(r){return r.re}function ge(r){return r.im}function me(r){var t,e,n;for(t=[];!(e=r.next()).done;)if(pt(n=e.value)&&n.length>=2)t.push(n[0],n[1]);else{if(!zt(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));t.push(ye(n),ge(n))}return t}P(pe,"BYTES_PER_ELEMENT",fe),P(pe,"name","Complex64Array"),P(pe,"from",(function(r){var t,e,n,i,o,a,u,f,s,l,h,c;if(!Yt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!he(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Yt(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(le(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(zt(l=n.call(t,r.get(h),h)))o[c]=ne(l),o[c+1]=ie(l);else{if(!(pt(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(gt(r)){if(n){for(f=r.length,u=r.get&&r.set?z("default"):G("default"),h=0;h<f;h++)if(!zt(u(r,h))){s=!0;break}if(s){if(!qt(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(t,u(r,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(zt(l=n.call(t,u(r,h),h)))o[c]=ne(l),o[c+1]=ie(l);else{if(!(pt(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(vt(r)&&se&&Yt(r[te])){if(!Yt((o=r[te]()).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,t,e){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,pt(o=t.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!zt(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(ne(o),ie(o))}return n}(o,n,t):ue(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(pe,"of",(function(){var r,t;if(!Yt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!he(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)})),P(pe.prototype,"at",(function(r){if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(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 ce(this._buffer,r)})),ee(pe.prototype,"buffer",(function(){return this._buffer.buffer})),ee(pe.prototype,"byteLength",(function(){return this._buffer.byteLength})),ee(pe.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(pe.prototype,"BYTES_PER_ELEMENT",pe.BYTES_PER_ELEMENT),P(pe.prototype,"copyWithin",(function(r,t){if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*t):this._buffer.copyWithin(2*r,2*t,2*arguments[2]),this})),P(pe.prototype,"entries",(function(){var r,t,e,n,i,o;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._buffer,e=this._length,o=-1,P(t={},"next",(function(){return o+=1,i||o>=e?{done:!0}:{value:[o,ce(n,o)],done:!1}})),P(t,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(t,te,(function(){return r.entries()})),t})),P(pe.prototype,"every",(function(r,t){var e,n;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(!r.call(t,ce(e,n),n,this))return!1;return!0})),P(pe.prototype,"fill",(function(r,t,e){var n,i,o,a,u,f;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zt(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(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),arguments.length>2){if(!it(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else t=0,e=i;for(a=ne(r),u=ie(r),f=t;f<e;f++)n[o=2*f]=a,n[o+1]=u;return this})),P(pe.prototype,"filter",(function(r,t){var e,n,i,o;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=[],i=0;i<this._length;i++)o=ce(e,i),r.call(t,o,i,this)&&n.push(o);return new this.constructor(n)})),P(pe.prototype,"find",(function(r,t){var e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(i=ce(e,n),r.call(t,i,n,this))return i})),P(pe.prototype,"findIndex",(function(r,t){var e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(i=ce(e,n),r.call(t,i,n,this))return n;return-1})),P(pe.prototype,"findLast",(function(r,t){var e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=ce(e,n),r.call(t,i,n,this))return i})),P(pe.prototype,"findLastIndex",(function(r,t){var e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=ce(e,n),r.call(t,i,n,this))return n;return-1})),P(pe.prototype,"forEach",(function(r,t){var e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)i=ce(e,n),r.call(t,i,n,this)})),P(pe.prototype,"get",(function(r){if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!st(r))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return ce(this._buffer,r)})),P(pe.prototype,"includes",(function(r,t){var e,n,i,o,a;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zt(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(i=ne(r),o=ie(r),e=this._buffer,a=t;a<this._length;a++)if(i===e[n=2*a]&&o===e[n+1])return!0;return!1})),P(pe.prototype,"indexOf",(function(r,t){var e,n,i,o,a;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zt(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(i=ne(r),o=ie(r),e=this._buffer,a=t;a<this._length;a++)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),P(pe.prototype,"join",(function(r){var t,e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!bt(r))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r));n=r}for(t=[],e=this._buffer,i=0;i<this._length;i++)t.push(ce(e,i).toString());return t.join(n)})),P(pe.prototype,"keys",(function(){var r,t,e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._length,i=-1,P(t={},"next",(function(){return i+=1,n||i>=e?{done:!0}:{value:i,done:!1}})),P(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(t,te,(function(){return r.keys()})),t})),P(pe.prototype,"lastIndexOf",(function(r,t){var e,n,i,o,a;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zt(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(i=ne(r),o=ie(r),e=this._buffer,a=t;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),ee(pe.prototype,"length",(function(){return this._length})),P(pe.prototype,"map",(function(r,t){var e,n,i,o,a;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(zt(a=r.call(t,ce(n,o),o,this)))e[2*o]=ne(a),e[2*o+1]=ie(a);else{if(!pt(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));e[2*o]=a[0],e[2*o+1]=a[1]}return i})),P(pe.prototype,"reduce",(function(r,t){var e,n,i,o;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(e=this._buffer,i=this._length,arguments.length>1)n=t,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=ce(e,0),o=1}for(;o<i;o++)n=r(n,ce(e,o),o,this);return n})),P(pe.prototype,"reduceRight",(function(r,t){var e,n,i,o;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(e=this._buffer,i=this._length,arguments.length>1)n=t,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=ce(e,i-1),o=i-2}for(;o>=0;o--)n=r(n,ce(e,o),o,this);return n})),P(pe.prototype,"reverse",(function(){var r,t,e,n,i,o;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=nt(e/2),i=0;i<n;i++)o=e-i-1,t=r[2*i],r[2*i]=r[2*o],r[2*o]=t,t=r[2*i+1],r[2*i+1]=r[2*o+1],r[2*o+1]=t;return this})),P(pe.prototype,"set",(function(r){var t,e,n,i,o,a,u,f,s;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!st(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(zt(r)){if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=ne(r),void(n[e+1]=ie(r))}if(le(r)){if(e+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,s=n.byteOffset+e*fe,t.buffer===n.buffer&&t.byteOffset<s&&t.byteOffset+t.byteLength>s){for(i=new Er(t.length),f=0;f<t.length;f++)i[f]=t[f];t=i}for(e*=2,s=0,f=0;f<a;f++)n[e]=t[s],n[e+1]=t[s+1],e+=2,s+=2}else{if(!gt(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(!zt(r[f])){o=!0;break}if(o){if(!qt(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(e+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,s=n.byteOffset+e*fe,t.buffer===n.buffer&&t.byteOffset<s&&t.byteOffset+t.byteLength>s){for(i=new Er(a),f=0;f<a;f++)i[f]=t[f];t=i}for(e*=2,a/=2,s=0,f=0;f<a;f++)n[e]=t[s],n[e+1]=t[s+1],e+=2,s+=2;return}if(e+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,f=0;f<a;f++)u=r[f],n[e]=ne(u),n[e+1]=ie(u),e+=2}})),P(pe.prototype,"slice",(function(r,t){var e,n,i,o,a,u,f;if(!le(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,t=u;else{if(!it(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)t=u;else{if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=u)<0&&(t=0):t>u&&(t=u)}}for(e=r<t?t-r:0,n=(i=new this.constructor(e))._buffer,f=0;f<e;f++)o=2*(f+r),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),P(pe.prototype,"some",(function(r,t){var e,n;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(r.call(t,ce(e,n),n,this))return!0;return!1})),P(pe.prototype,"sort",(function(r){var t,e,n,i,o;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length,t=[],i=0;i<n;i++)t.push(ce(e,i));for(t.sort(r),i=0;i<n;i++)e[o=2*i]=ne(t[i]),e[o+1]=ie(t[i]);return this})),P(pe.prototype,"subarray",(function(r,t){var e,n,i;if(!le(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,t=i;else{if(!it(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)t=i;else{if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=i)<0&&(t=0):t>i&&(t=i)}}return r>=i?(i=0,e=n.byteLength):r>=t?(i=0,e=n.byteOffset+r*fe):(i=t-r,e=n.byteOffset+r*fe),new this.constructor(n.buffer,e,i<0?0:i)})),P(pe.prototype,"toLocaleString",(function(r,t){var e,n,i,o,a;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!bt(r)&&!xt(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)e={};else{if(!vt(t))throw new TypeError(S("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(ce(o,a).toLocaleString(n,e));return i.join(",")})),P(pe.prototype,"toReversed",(function(){var r,t,e,n,i,o;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=new this.constructor(e),n=this._buffer,r=t._buffer,i=0;i<e;i++)o=e-i-1,r[2*i]=n[2*o],r[2*i+1]=n[2*o+1];return t})),P(pe.prototype,"toSorted",(function(r){var t,e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length,t=[],i=0;i<n;i++)t.push(ce(e,i));return t.sort(r),new pe(t)})),P(pe.prototype,"toString",(function(){var r,t,e;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=this._buffer,e=0;e<this._length;e++)r.push(ce(t,e).toString());return r.join(",")})),P(pe.prototype,"values",(function(){var r,t,e,n,i,o;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,i=this._buffer,e=this._length,o=-1,P(r={},"next",(function(){return o+=1,n||o>=e?{done:!0}:{value:ce(i,o),done:!1}})),P(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(r,te,(function(){return t.values()})),r})),P(pe.prototype,"with",(function(r,t){var e,n,i;if(!le(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(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(!zt(t))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(e=(n=new this.constructor(this._buffer))._buffer)[2*r]=ne(t),e[2*r+1]=ie(t),n}));var we=2*mr.BYTES_PER_ELEMENT,ve=re();function be(r){return r instanceof _e||"object"==typeof r&&null!==r&&("Complex64Array"===r.constructor.name||"Complex128Array"===r.constructor.name)&&"number"==typeof r._length&&"object"==typeof r._buffer}function de(r){return r===_e||"Complex64Array"===r.name}function Ee(r,t){return new $t(r[t*=2],r[t+1])}function _e(){var r,t,e,n;if(t=arguments.length,!(this instanceof _e))return 0===t?new _e:1===t?new _e(arguments[0]):2===t?new _e(arguments[0],arguments[1]):new _e(arguments[0],arguments[1],arguments[2]);if(0===t)e=new mr(0);else if(1===t)if(st(arguments[0]))e=new mr(2*arguments[0]);else if(gt(arguments[0]))if((n=(e=arguments[0]).length)&&or(e)&&zt(e[0])){if(e=function(r,t){var e,n,i,o;for(e=t.length,o=0,i=0;i<e;i++){if(!zt(n=t[i]))return null;r[o]=ye(n),r[o+1]=ge(n),o+=2}return r}(new mr(2*n),e),null===e){if(!qt(n))throw new RangeError(S("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));e=new mr(arguments[0])}}else{if(Ht(e))e=oe(e,0);else if(Qt(e))e=ae(e,0);else if(!qt(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));e=new mr(e)}else if(wt(arguments[0])){if(!it((e=arguments[0]).byteLength/we))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",we,e.byteLength));e=new mr(e)}else{if(!vt(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(e=arguments[0],!1===ve)throw new TypeError(S("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",e));if(!Yt(e[te]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",e));if(!Yt((e=e[te]()).next))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",e));if((e=me(e))instanceof Error)throw e;e=new mr(e)}else{if(!wt(e=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!st(r=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(!it(r/we))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",we,r));if(2===t){if(!it((n=e.byteLength-r)/we))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",we,n));e=new mr(e,r)}else{if(!st(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*we>e.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*we));e=new mr(e,r,2*n)}}return P(this,"_buffer",e),P(this,"_length",e.length/2),this}function Te(r){var t,e;for(t=[];!(e=r.next()).done;)t.push(St(e.value));return t}P(_e,"BYTES_PER_ELEMENT",we),P(_e,"name","Complex128Array"),P(_e,"from",(function(r){var t,e,n,i,o,a,u,f,s,l,h,c;if(!Yt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((e=arguments.length)>1){if(!Yt(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(be(r)){if(f=r.length,n){for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(zt(l=n.call(t,r.get(h),h)))o[c]=ye(l),o[c+1]=ge(l);else{if(!(pt(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(gt(r)){if(n){for(f=r.length,u=r.get&&r.set?z("default"):G("default"),h=0;h<f;h++)if(!zt(u(r,h))){s=!0;break}if(s){if(!qt(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(t,u(r,h),h);return i}for(o=(i=new this(f))._buffer,c=0,h=0;h<f;h++){if(zt(l=n.call(t,u(r,h),h)))o[c]=ye(l),o[c+1]=ge(l);else{if(!(pt(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(vt(r)&&ve&&Yt(r[te])){if(!Yt((o=r[te]()).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,t,e){var n,i,o,a;for(n=[],a=-1;!(i=r.next()).done;)if(a+=1,pt(o=t.call(e,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!zt(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(ye(o),ge(o))}return n}(o,n,t):me(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(_e,"of",(function(){var r,t;if(!Yt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!de(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)})),P(_e.prototype,"at",(function(r){if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(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 Ee(this._buffer,r)})),ee(_e.prototype,"buffer",(function(){return this._buffer.buffer})),ee(_e.prototype,"byteLength",(function(){return this._buffer.byteLength})),ee(_e.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(_e.prototype,"BYTES_PER_ELEMENT",_e.BYTES_PER_ELEMENT),P(_e.prototype,"copyWithin",(function(r,t){if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*r,2*t):this._buffer.copyWithin(2*r,2*t,2*arguments[2]),this})),P(_e.prototype,"entries",(function(){var r,t,e,n,i,o,a;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,n=this._length,o=-1,a=-2,P(e={},"next",(function(){var t;return o+=1,i||o>=n?{done:!0}:(t=new $t(r[a+=2],r[a+1]),{value:[o,t],done:!1})})),P(e,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(e,te,(function(){return t.entries()})),e})),P(_e.prototype,"every",(function(r,t){var e,n;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(!r.call(t,Ee(e,n),n,this))return!1;return!0})),P(_e.prototype,"fill",(function(r,t,e){var n,i,o,a,u,f;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zt(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(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),arguments.length>2){if(!it(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else t=0,e=i;for(a=ye(r),u=ge(r),f=t;f<e;f++)n[o=2*f]=a,n[o+1]=u;return this})),P(_e.prototype,"filter",(function(r,t){var e,n,i,o;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=[],i=0;i<this._length;i++)o=Ee(e,i),r.call(t,o,i,this)&&n.push(o);return new this.constructor(n)})),P(_e.prototype,"find",(function(r,t){var e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(i=Ee(e,n),r.call(t,i,n,this))return i})),P(_e.prototype,"findIndex",(function(r,t){var e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(i=Ee(e,n),r.call(t,i,n,this))return n;return-1})),P(_e.prototype,"findLast",(function(r,t){var e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=Ee(e,n),r.call(t,i,n,this))return i})),P(_e.prototype,"findLastIndex",(function(r,t){var e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length-1;n>=0;n--)if(i=Ee(e,n),r.call(t,i,n,this))return n;return-1})),P(_e.prototype,"forEach",(function(r,t){var e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)i=Ee(e,n),r.call(t,i,n,this)})),P(_e.prototype,"get",(function(r){if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!st(r))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return Ee(this._buffer,r)})),ee(_e.prototype,"length",(function(){return this._length})),P(_e.prototype,"includes",(function(r,t){var e,n,i,o,a;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zt(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(i=ye(r),o=ge(r),e=this._buffer,a=t;a<this._length;a++)if(i===e[n=2*a]&&o===e[n+1])return!0;return!1})),P(_e.prototype,"indexOf",(function(r,t){var e,n,i,o,a;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zt(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(i=ye(r),o=ge(r),e=this._buffer,a=t;a<this._length;a++)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),P(_e.prototype,"join",(function(r){var t,e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Tt(r))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r));n=r}for(t=[],e=this._buffer,i=0;i<this._length;i++)t.push(Ee(e,i).toString());return t.join(n)})),P(_e.prototype,"keys",(function(){var r,t,e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._length,i=-1,P(t={},"next",(function(){return i+=1,n||i>=e?{done:!0}:{value:i,done:!1}})),P(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(t,te,(function(){return r.keys()})),t})),P(_e.prototype,"lastIndexOf",(function(r,t){var e,n,i,o,a;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!zt(r))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(i=ye(r),o=ge(r),e=this._buffer,a=t;a>=0;a--)if(i===e[n=2*a]&&o===e[n+1])return a;return-1})),P(_e.prototype,"map",(function(r,t){var e,n,i,o,a;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,e=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(zt(a=r.call(t,Ee(n,o),o,this)))e[2*o]=ye(a),e[2*o+1]=ge(a);else{if(!pt(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));e[2*o]=a[0],e[2*o+1]=a[1]}return i})),P(_e.prototype,"reduce",(function(r,t){var e,n,i,o;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(e=this._buffer,i=this._length,arguments.length>1)n=t,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=Ee(e,0),o=1}for(;o<i;o++)n=r(n,Ee(e,o),o,this);return n})),P(_e.prototype,"reduceRight",(function(r,t){var e,n,i,o;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(e=this._buffer,i=this._length,arguments.length>1)n=t,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=Ee(e,i-1),o=i-2}for(;o>=0;o--)n=r(n,Ee(e,o),o,this);return n})),P(_e.prototype,"reverse",(function(){var r,t,e,n,i,o;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,r=this._buffer,n=nt(e/2),i=0;i<n;i++)o=e-i-1,t=r[2*i],r[2*i]=r[2*o],r[2*o]=t,t=r[2*i+1],r[2*i+1]=r[2*o+1],r[2*o+1]=t;return this})),P(_e.prototype,"set",(function(r){var t,e,n,i,o,a,u,f,s;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!st(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(zt(r)){if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));return n[e*=2]=ye(r),void(n[e+1]=ge(r))}if(be(r)){if(e+(a=r._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,s=n.byteOffset+e*we,t.buffer===n.buffer&&t.byteOffset<s&&t.byteOffset+t.byteLength>s){for(i=new mr(t.length),f=0;f<t.length;f++)i[f]=t[f];t=i}for(e*=2,s=0,f=0;f<a;f++)n[e]=t[s],n[e+1]=t[s+1],e+=2,s+=2}else{if(!gt(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(!zt(r[f])){o=!0;break}if(o){if(!qt(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(e+a/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,s=n.byteOffset+e*we,t.buffer===n.buffer&&t.byteOffset<s&&t.byteOffset+t.byteLength>s){for(i=new mr(a),f=0;f<a;f++)i[f]=t[f];t=i}for(e*=2,a/=2,s=0,f=0;f<a;f++)n[e]=t[s],n[e+1]=t[s+1],e+=2,s+=2;return}if(e+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(e*=2,f=0;f<a;f++)u=r[f],n[e]=ye(u),n[e+1]=ge(u),e+=2}})),P(_e.prototype,"slice",(function(r,t){var e,n,i,o,a,u,f;if(!be(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,t=u;else{if(!it(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)t=u;else{if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=u)<0&&(t=0):t>u&&(t=u)}}for(e=r<t?t-r:0,n=(i=new this.constructor(e))._buffer,f=0;f<e;f++)o=2*(f+r),n[2*f]=a[o],n[2*f+1]=a[o+1];return i})),P(_e.prototype,"some",(function(r,t){var e,n;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(r.call(t,Ee(e,n),n,this))return!0;return!1})),P(_e.prototype,"sort",(function(r){var t,e,n,i,o;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length,t=[],i=0;i<n;i++)t.push(Ee(e,i));for(t.sort(r),i=0;i<n;i++)e[o=2*i]=ye(t[i]),e[o+1]=ge(t[i]);return this})),P(_e.prototype,"subarray",(function(r,t){var e,n,i;if(!be(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,t=i;else{if(!it(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)t=i;else{if(!it(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=i)<0&&(t=0):t>i&&(t=i)}}return r>=i?(i=0,e=n.byteLength):r>=t?(i=0,e=n.byteOffset+r*we):(i=t-r,e=n.byteOffset+r*we),new this.constructor(n.buffer,e,i<0?0:i)})),P(_e.prototype,"toLocaleString",(function(r,t){var e,n,i,o,a;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=[];else{if(!Tt(r)&&!xt(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)e={};else{if(!vt(t))throw new TypeError(S("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(Ee(o,a).toLocaleString(n,e));return i.join(",")})),P(_e.prototype,"toReversed",(function(){var r,t,e,n,i,o;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=this._length,t=new this.constructor(e),n=this._buffer,r=t._buffer,i=0;i<e;i++)o=e-i-1,r[2*i]=n[2*o],r[2*i+1]=n[2*o+1];return t})),P(_e.prototype,"toSorted",(function(r){var t,e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=this._length,t=[],i=0;i<n;i++)t.push(Ee(e,i));return t.sort(r),new _e(t)})),P(_e.prototype,"toString",(function(){var r,t,e;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=this._buffer,e=0;e<this._length;e++)r.push(Ee(t,e).toString());return r.join(",")})),P(_e.prototype,"values",(function(){var r,t,e,n,i,o;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,i=this._buffer,e=this._length,o=-1,P(r={},"next",(function(){return o+=1,n||o>=e?{done:!0}:{value:Ee(i,o),done:!1}})),P(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(r,te,(function(){return t.values()})),r})),P(_e.prototype,"with",(function(r,t){var e,n,i;if(!be(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!it(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(!zt(t))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return(e=(n=new this.constructor(this._buffer))._buffer)[2*r]=ye(t),e[2*r+1]=ge(t),n}));var xe=Yr.BYTES_PER_ELEMENT,Ve=re();function Ae(r){return"object"==typeof r&&null!==r&&"BooleanArray"===r.constructor.name&&r.BYTES_PER_ELEMENT===xe}function Fe(r){return r===je}function je(){var r,t,e,n,i;if(t=arguments.length,!(this instanceof je))return 0===t?new je:1===t?new je(arguments[0]):2===t?new je(arguments[0],arguments[1]):new je(arguments[0],arguments[1],arguments[2]);if(0===t)e=new Yr(0);else if(1===t)if(st(i=arguments[0]))e=new Yr(i);else if(gt(i))e=function(r,t){var e,n;for(e=t.length,n=0;n<e;n++)r[n]=St(t[n]);return r}(new Yr(i.length),i);else if(wt(i))e=new Yr(i);else{if(!vt(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===Ve)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(!Yt(i[te]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(!Yt((e=i[te]()).next))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));e=new Yr(Te(e))}else{if(!wt(e=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",e));if(!st(r=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",r));if(2===t)e=new Yr(e,r);else{if(!st(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*xe>e.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*xe));e=new Yr(e,r,n)}}return P(this,"_buffer",e),P(this,"_length",e.length),this}P(je,"BYTES_PER_ELEMENT",xe),P(je,"name","BooleanArray"),P(je,"from",(function(r){var t,e,n,i,o,a,u,f,s;if(!Yt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Fe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if((e=arguments.length)>1){if(!Yt(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));e>2&&(t=arguments[2])}if(gt(r)){if(n){for(f=r.length,u=r.get&&r.set?z("default"):G("default"),o=(i=new this(f))._buffer,s=0;s<f;s++)o[s]=St(n.call(t,u(r,s),s));return i}return new this(r)}if(vt(r)&&Ve&&Yt(r[te])){if(!Yt((o=r[te]()).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,t,e){var n,i,o;for(n=[],o=-1;!(i=r.next()).done;)o+=1,n.push(St(t.call(e,i.value,o)));return n}(o,n,t):Te(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(je,"of",(function(){var r,t;if(!Yt(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Fe(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)})),P(je.prototype,"at",(function(r){var t,e;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!at(r))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",r));if(e=this._length,t=this._buffer,r<0&&(r+=e),!(r<0||r>=e))return St(t[r])})),ee(je.prototype,"buffer",(function(){return this._buffer.buffer})),ee(je.prototype,"byteLength",(function(){return this._buffer.byteLength})),ee(je.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),P(je.prototype,"BYTES_PER_ELEMENT",je.BYTES_PER_ELEMENT),P(je.prototype,"copyWithin",(function(r,t){if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return 2===arguments.length?this._buffer.copyWithin(r,t):this._buffer.copyWithin(r,t,arguments[2]),this})),P(je.prototype,"entries",(function(){var r,t,e,n,i,o;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,n=this._buffer,e=this._length,o=-1,P(t={},"next",(function(){return o+=1,i||o>=e?{done:!0}:{value:[o,St(n[o])],done:!1}})),P(t,"return",(function(r){return i=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(t,te,(function(){return r.entries()})),t})),P(je.prototype,"every",(function(r,t){var e,n;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(!r.call(t,St(e[n]),n,this))return!1;return!0})),P(je.prototype,"fill",(function(r,t,e){var n,i,o,a;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!jt(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(!at(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=i)<0&&(t=0),arguments.length>2){if(!at(e))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",e));e<0&&(e+=i)<0&&(e=0),e>i&&(e=i)}else e=i}else t=0,e=i;for(o=r?1:0,a=t;a<e;a++)n[a]=o;return this})),P(je.prototype,"filter",(function(r,t){var e,n,i,o;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=[],i=0;i<this._length;i++)o=St(e[i]),r.call(t,o,i,this)&&n.push(o);return new this.constructor(n)})),P(je.prototype,"find",(function(r,t){var e,n,i;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,i=0;i<this._length;i++)if(n=St(e[i]),r.call(t,n,i,this))return n})),P(je.prototype,"findIndex",(function(r,t){var e,n,i;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,i=0;i<this._length;i++)if(n=St(e[i]),r.call(t,n,i,this))return i;return-1})),P(je.prototype,"findLast",(function(r,t){var e,n,i;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,i=this._length-1;i>=0;i--)if(n=St(e[i]),r.call(t,n,i,this))return n})),P(je.prototype,"findLastIndex",(function(r,t){var e,n,i;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,i=this._length-1;i>=0;i--)if(n=St(e[i]),r.call(t,n,i,this))return i;return-1})),P(je.prototype,"forEach",(function(r,t){var e,n;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)r.call(t,St(e[n]),n,this)})),P(je.prototype,"get",(function(r){if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!st(r))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return St(this._buffer[r])})),P(je.prototype,"includes",(function(r,t){var e,n;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!jt(r))throw new TypeError(S("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!at(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(e=this._buffer,n=t;n<this._length;n++)if(r===St(e[n]))return!0;return!1})),P(je.prototype,"indexOf",(function(r,t){var e,n;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!jt(r))throw new TypeError(S("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!at(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length)<0&&(t=0)}else t=0;for(e=this._buffer,n=t;n<this._length;n++)if(r===St(e[n]))return n;return-1})),P(je.prototype,"join",(function(r){var t,e,n;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(arguments.length>0){if(!bt(r))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",r))}else r=",";for(t=this._buffer,e=[],n=0;n<this._length;n++)t[n]?e.push("true"):e.push("false");return e.join(r)})),P(je.prototype,"keys",(function(){var r,t,e,n,i;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,e=this._length,i=-1,P(t={},"next",(function(){return i+=1,n||i>=e?{done:!0}:{value:i,done:!1}})),P(t,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(t,te,(function(){return r.keys()})),t})),P(je.prototype,"lastIndexOf",(function(r,t){var e,n;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!jt(r))throw new TypeError(S("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!at(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(e=this._buffer,n=t;n>=0;n--)if(r===St(e[n]))return n;return-1})),ee(je.prototype,"length",(function(){return this._length})),P(je.prototype,"map",(function(r,t){var e,n,i,o;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(i=this._buffer,e=(n=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)e[o]=St(r.call(t,St(i[o]),o,this));return n})),P(je.prototype,"reduce",(function(r,t){var e,n,i,o;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(e=this._buffer,n=this._length,arguments.length>1)i=t,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=St(e[0]),o=1}for(;o<n;o++)i=r(i,St(e[o]),o,this);return i})),P(je.prototype,"reduceRight",(function(r,t){var e,n,i,o;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));if(e=this._buffer,n=this._length,arguments.length>1)i=t,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=St(e[n-1]),o=n-2}for(;o>=0;o--)i=r(i,St(e[o]),o,this);return i})),P(je.prototype,"reverse",(function(){var r,t,e,n,i,o;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,e=this._length,n=nt(e/2),i=0;i<n;i++)o=e-i-1,t=r[i],r[i]=r[o],r[o]=t;return this})),P(je.prototype,"set",(function(r){var t,e,n,i,o,a,u;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,arguments.length>1){if(!st(e=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",e))}else e=0;if(gt(r)){if(e+(o=r.length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=Ae(r)?r._buffer:r,u=n.byteOffset+e*xe,t.buffer===n.buffer&&t.byteOffset<u&&t.byteOffset+t.byteLength>u){for(i=new Yr(t.length),a=0;a<t.length;a++)i[a]=t[a];t=i}for(a=0;a<o;e++,a++)n[e]=t[a]?1:0}else{if(e>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",e));n[e]=r?1:0}})),P(je.prototype,"slice",(function(r,t){var e,n,i,o,a,u;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(o=this._buffer,a=this._length,0===arguments.length)r=0,t=a;else{if(!at(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)t=a;else{if(!at(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a)<0&&(t=0):t>a&&(t=a)}}for(e=r<t?t-r:0,n=(i=new this.constructor(e))._buffer,u=0;u<e;u++)n[u]=o[u+r];return i})),P(je.prototype,"some",(function(r,t){var e,n;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));for(e=this._buffer,n=0;n<this._length;n++)if(r.call(t,St(e[n]),n,this))return!0;return!1})),P(je.prototype,"sort",(function(r){var t;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(t=this._buffer,0===arguments.length)return t.sort(),this;if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));return t.sort((function(t,e){return r(St(t),St(e))})),this})),P(je.prototype,"subarray",(function(r,t){var e,n,i;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=this._buffer,i=this._length,0===arguments.length)r=0,t=i;else{if(!at(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)t=i;else{if(!at(t))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=i)<0&&(t=0):t>i&&(t=i)}}return r>=i?(i=0,e=n.byteLength):r>=t?(i=0,e=n.byteOffset+r*xe):(i=t-r,e=n.byteOffset+r*xe),new this.constructor(n.buffer,e,i<0?0:i)})),P(je.prototype,"toLocaleString",(function(r,t){var e,n,i,o,a;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(0===arguments.length)n=[];else{if(!bt(r)&&!xt(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)e={};else{if(!vt(t))throw new TypeError(S("invalid argument. Options argument must be an object. Value: `%s`.",t));e=t}for(o=this._buffer,i=[],a=0;a<this._length;a++)i.push(St(o[a]).toLocaleString(n,e));return i.join(",")})),P(je.prototype,"toReversed",(function(){var r,t,e,n,i;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(e=this._length,t=new this.constructor(e),n=this._buffer,r=t._buffer,i=0;i<e;i++)r[i]=n[e-i-1];return t})),P(je.prototype,"toSorted",(function(r){var t,e,n,i,o;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(n=this._length,e=new this.constructor(n),i=this._buffer,t=e._buffer,o=0;o<n;o++)t[o]=i[o];if(0===arguments.length)return t.sort(),e;if(!Yt(r))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",r));return t.sort((function(t,e){return r(St(t),St(e))})),e})),P(je.prototype,"toString",(function(){var r,t,e;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],t=this._buffer,e=0;e<this._length;e++)t[e]?r.push("true"):r.push("false");return r.join(",")})),P(je.prototype,"values",(function(){var r,t,e,n,i,o;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,i=this._buffer,e=this._length,o=-1,P(r={},"next",(function(){return o+=1,n||o>=e?{done:!0}:{value:St(i[o]),done:!1}})),P(r,"return",(function(r){return n=!0,arguments.length?{value:r,done:!0}:{done:!0}})),te&&P(r,te,(function(){return t.values()})),r})),P(je.prototype,"with",(function(r,t){var e,n;if(!Ae(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!at(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(!jt(t))throw new TypeError(S("invalid argument. Second argument must be a boolean. Value: `%s`.",t));return(e=new this.constructor(this._buffer))._buffer[r]=t?1:0,e}));var Se=[mr,Er,Sr,Vr,Cr,Rr,qr,Yr,Zr,pe,_e,je],ke=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"],Le=ke.length;function Ie(r){var t,e=function(r){var t;if(or(r))return"generic";if(fr(r))return null;for(t=0;t<Le;t++)if(r instanceof Se[t])return ke[t];return cr[hr(r)]||null}(r);return typeof(t=r).get===W&&typeof t.set===W?{data:r,dtype:e,accessorProtocol:!0,accessors:[z(e),D(e)]}:{data:r,dtype:e,accessorProtocol:!1,accessors:[G(e),X(e)]}}function Re(r,t,e,n,i,o,a){var u,f,s,l,h,c,p;if(r<=0)return i;if(l=Ie(t),h=Ie(i),l.accessorProtocol||h.accessorProtocol)return function(r,t,e,n,i,o,a){var u,f,s,l,h,c,p,y,g;if(u=t.data,f=i.data,s=t.accessors[0],(l=i.accessors[1])(f,p=a,h=Y(s(u,c=n))),p+=o,g=1,!1===N(h))for(;g<r;g++){if(N(y=Y(s(u,c+=e)))){h=y;break}y<h&&(h=y),l(f,p,h),p+=o}if(N(h))for(;g<r;g++)l(f,p,h),p+=o}(r,l,e,n,h,o,a),i;if(s=a,u=Y(t[f=n]),i[s]=u,s+=o,p=1,!1===N(u))for(;p<r;p++){if(N(c=Y(t[f+=e]))){u=c;break}c<u&&(u=c),i[s]=u,s+=o}if(N(u))for(;p<r;p++)i[s]=u,s+=o;return i}function Be(r,t,e,n,i){return Re(r,t,e,U(r,e),n,i,U(r,i))}return P(Be,"ndarray",Re),Be},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(r="undefined"!=typeof globalThis?globalThis:r||self).cuminabs=t();
//# sourceMappingURL=browser.js.map