-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
3 lines (3 loc) · 160 KB
/
index.js
1
2
3
// Copyright (c) 2025 The Stdlib Authors. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("buffer")):"function"==typeof define&&define.amd?define(["buffer"],r):(e="undefined"!=typeof globalThis?globalThis:e||self).emptyLike=r(e.require$$0)}(this,(function(e){"use strict";var r="function"==typeof Object.defineProperty?Object.defineProperty:null;var t=Object.defineProperty;function n(e){return"number"==typeof e}function i(e){var r,t="";for(r=0;r<e;r++)t+="0";return t}function o(e,r,t){var n=!1,o=r-e.length;return o<0||(function(e){return"-"===e[0]}(e)&&(n=!0,e=e.substr(1)),e=t?e+i(o):i(o)+e,n&&(e="-"+e)),e}var a=String.prototype.toLowerCase,u=String.prototype.toUpperCase;function s(e){var r,t,i;switch(e.specifier){case"b":r=2;break;case"o":r=8;break;case"x":case"X":r=16;break;default:r=10}if(t=e.arg,i=parseInt(t,10),!isFinite(i)){if(!n(t))throw new Error("invalid integer. Value: "+t);i=0}return i<0&&("u"===e.specifier||10!==r)&&(i=4294967295+i+1),i<0?(t=(-i).toString(r),e.precision&&(t=o(t,e.precision,e.padRight)),t="-"+t):(t=i.toString(r),i||e.precision?e.precision&&(t=o(t,e.precision,e.padRight)):t="",e.sign&&(t=e.sign+t)),16===r&&(e.alternate&&(t="0x"+t),t=e.specifier===u.call(e.specifier)?u.call(t):a.call(t)),8===r&&e.alternate&&"0"!==t.charAt(0)&&(t="0"+t),t}var f=Math.abs,l=String.prototype.toLowerCase,h=String.prototype.toUpperCase,c=String.prototype.replace,m=/e\+(\d)$/,p=/e-(\d)$/,g=/^(\d+)$/,y=/^(\d+)e/,w=/\.0$/,v=/\.0*e/,d=/(\..*[^0])0*e/;function b(e){var r,t,i=parseFloat(e.arg);if(!isFinite(i)){if(!n(e.arg))throw new Error("invalid floating-point number. Value: "+t);i=e.arg}switch(e.specifier){case"e":case"E":t=i.toExponential(e.precision);break;case"f":case"F":t=i.toFixed(e.precision);break;case"g":case"G":f(i)<1e-4?((r=e.precision)>0&&(r-=1),t=i.toExponential(r)):t=i.toPrecision(e.precision),e.alternate||(t=c.call(t,d,"$1e"),t=c.call(t,v,"e"),t=c.call(t,w,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return t=c.call(t,m,"e+0$1"),t=c.call(t,p,"e-0$1"),e.alternate&&(t=c.call(t,g,"$1."),t=c.call(t,y,"$1.e")),i>=0&&e.sign&&(t=e.sign+t),t=e.specifier===h.call(e.specifier)?h.call(t):l.call(t)}function E(e){var r,t="";for(r=0;r<e;r++)t+=" ";return t}var _=String.fromCharCode,T=Array.isArray;function x(e){return e!=e}function V(e){var r={};return r.specifier=e.specifier,r.precision=void 0===e.precision?1:e.precision,r.width=e.width,r.flags=e.flags||"",r.mapping=e.mapping,r}function A(e){var r,t,n,i,a,u,f,l,h,c,m,p,g;if(!T(e))throw new TypeError("invalid argument. First argument must be an array. Value: `"+e+"`.");for(u="",f=1,l=0;l<e.length;l++)if(n=e[l],"string"==typeof n)u+=n;else{if(r=void 0!==n.precision,!(n=V(n)).specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+l+"`. Value: `"+n+"`.");for(n.mapping&&(f=n.mapping),t=n.flags,h=0;h<t.length;h++)switch(i=t.charAt(h)){case" ":n.sign=" ";break;case"+":n.sign="+";break;case"-":n.padRight=!0,n.padZeros=!1;break;case"0":n.padZeros=t.indexOf("-")<0;break;case"#":n.alternate=!0;break;default:throw new Error("invalid flag: "+i)}if("*"===n.width){if(n.width=parseInt(arguments[f],10),f+=1,x(n.width))throw new TypeError("the argument for * width at position "+f+" is not a number. Value: `"+n.width+"`.");n.width<0&&(n.padRight=!0,n.width=-n.width)}if(r&&"*"===n.precision){if(n.precision=parseInt(arguments[f],10),f+=1,x(n.precision))throw new TypeError("the argument for * precision at position "+f+" is not a number. Value: `"+n.precision+"`.");n.precision<0&&(n.precision=1,r=!1)}switch(n.arg=arguments[f],n.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":r&&(n.padZeros=!1),n.arg=s(n);break;case"s":n.maxWidth=r?n.precision:-1,n.arg=String(n.arg);break;case"c":if(!x(n.arg)){if((a=parseInt(n.arg,10))<0||a>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=x(a)?String(n.arg):_(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":r||(n.precision=6),n.arg=b(n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=o(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=(c=n.arg,m=n.width,p=n.padRight,g=void 0,(g=m-c.length)<0?c:c=p?c+E(g):E(g)+c)),u+=n.arg||"",f+=1}return u}var j=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function F(e){var r={mapping:e[1]?parseInt(e[1],10):void 0,flags:e[2],width:e[3],precision:e[5],specifier:e[6]};return"."===e[4]&&void 0===e[5]&&(r.precision="1"),r}function O(e){var r,t,n,i;for(t=[],i=0,n=j.exec(e);n;)(r=e.slice(i,j.lastIndex-n[0].length)).length&&t.push(r),t.push(F(n)),i=j.lastIndex,n=j.exec(e);return(r=e.slice(i)).length&&t.push(r),t}function S(e){var r,t;if("string"!=typeof e)throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[O(e)],t=1;t<arguments.length;t++)r.push(arguments[t]);return A.apply(null,r)}var R,L=Object.prototype,k=L.toString,I=L.__defineGetter__,B=L.__defineSetter__,M=L.__lookupGetter__,C=L.__lookupSetter__;R=function(){try{return r({},"x",{}),!0}catch(e){return!1}}()?t:function(e,r,t){var n,i,o,a;if("object"!=typeof e||null===e||"[object Array]"===k.call(e))throw new TypeError(S("invalid argument. First argument must be an object. Value: `%s`.",e));if("object"!=typeof t||null===t||"[object Array]"===k.call(t))throw new TypeError(S("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if((i="value"in t)&&(M.call(e,r)||C.call(e,r)?(n=e.__proto__,e.__proto__=L,delete e[r],e[r]=t.value,e.__proto__=n):e[r]=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(e,r,t.get),a&&B&&B.call(e,r,t.set),e};var N=R;function U(e,r,t){N(e,r,{configurable:!1,enumerable:!1,writable:!1,value:t})}function P(e){return"number"==typeof e}var Y="function"==typeof Symbol&&"symbol"==typeof Symbol("foo");function W(){return Y&&"symbol"==typeof Symbol.toStringTag}var D=Object.prototype.toString;var G=Object.prototype.hasOwnProperty;function $(e,r){return null!=e&&G.call(e,r)}var J="function"==typeof Symbol?Symbol:void 0,z="function"==typeof J?J.toStringTag:"";var Z=W()?function(e){var r,t,n;if(null==e)return D.call(e);t=e[z],r=$(e,z);try{e[z]=void 0}catch(r){return D.call(e)}return n=D.call(e),r?e[z]=t:delete e[z],n}:function(e){return D.call(e)},X=Number,q=X.prototype.toString;var H=W();function K(e){return"object"==typeof e&&(e instanceof X||(H?function(e){try{return q.call(e),!0}catch(e){return!1}}(e):"[object Number]"===Z(e)))}function Q(e){return P(e)||K(e)}function ee(e){return"boolean"==typeof e}U(Q,"isPrimitive",P),U(Q,"isObject",K);var re=Boolean,te=Boolean.prototype.toString;var ne=W();function ie(e){return"object"==typeof e&&(e instanceof re||(ne?function(e){try{return te.call(e),!0}catch(e){return!1}}(e):"[object Boolean]"===Z(e)))}function oe(e){return ee(e)||ie(e)}U(oe,"isPrimitive",ee),U(oe,"isObject",ie);var ae="object"==typeof self?self:null,ue="object"==typeof window?window:null,se="object"==typeof global?global:null,fe="object"==typeof globalThis?globalThis:null;function le(e){if(arguments.length){if(!ee(e))throw new TypeError(S("invalid argument. Must provide a boolean. Value: `%s`.",e));if(e)return new Function("return this;")()}if(fe)return fe;if(ae)return ae;if(ue)return ue;if(se)return se;throw new Error("unexpected error. Unable to resolve global object.")}var he=le();function ce(e,r,t){N(e,r,{configurable:!1,enumerable:!1,get:t})}var me={binary:1,bool:1,complex64:8,complex128:16,float16:2,bfloat16:2,float32:4,float64:8,float128:16,generic:null,int8:1,int16:2,int32:4,int64:8,int128:16,int256:32,uint8:1,uint8c:1,uint16:2,uint32:4,uint64:8,uint128:16,uint256:32};function pe(e){return me[e]||null}function ge(e){return Math.abs(e)}function ye(e){var r,t,n,i,o,a;if(0===(t=e.length))return 0;for(r=!0,n=!0,i=ge(e[0]),a=1;a<t;a++){if(o=ge(e[a]),r&&o<i?r=!1:n&&o>i&&(n=!1),!n&&!r)return 0;i=o}return n&&r?3:n?1:2}function we(e,r){return r&&(2===e||3===e)}function ve(e,r){return r&&(1===e||3===e)}function de(e,r,t){var n,i,o,a,u;for(n=e.length,i=t,o=t,u=0;u<n;u++){if(0===e[u])return[t,t];(a=r[u])>0?o+=a*(e[u]-1):a<0&&(i+=a*(e[u]-1))}return[i,o]}function be(e){return e.re}function Ee(e){return e.im}function _e(e){return"string"==typeof e}U(de,"assign",(function(e,r,t,n){var i,o,a,u,s;for(i=e.length,o=t,a=t,s=0;s<i;s++){if(0===e[s])return n[0]=t,n[1]=t,n;(u=r[s])>0?a+=u*(e[s]-1):u<0&&(o+=u*(e[s]-1))}return n[0]=o,n[1]=a,n}));var Te=String.prototype.valueOf;var xe=W();function Ve(e){return"object"==typeof e&&(e instanceof String||(xe?function(e){try{return Te.call(e),!0}catch(e){return!1}}(e):"[object String]"===Z(e)))}function Ae(e){return _e(e)||Ve(e)}U(Ae,"isPrimitive",_e),U(Ae,"isObject",Ve);var je=/[-\/\\^$*+?.()|[\]{}]/g;var Fe=/./,Oe=le(),Se=Oe.document&&Oe.document.childNodes,Re=Int8Array;function Le(){return/^\s*function\s*([^(]*)/i}var ke=/^\s*function\s*([^(]*)/i;U(Le,"REGEXP",ke);var Ie=Array.isArray?Array.isArray:function(e){return"[object Array]"===Z(e)};function Be(e){return null!==e&&"object"==typeof e}var Me=function(e){if("function"!=typeof e)throw new TypeError(S("invalid argument. Must provide a function. Value: `%s`.",e));return function(r){var t,n;if(!Ie(r))return!1;if(t=r.length,0===t)return!1;for(n=0;n<t;n++)if(!1===e(r[n]))return!1;return!0}}(Be);function Ce(e){return Be(e)&&(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))}function Ne(e){var r,t,n;if(("Object"===(t=Z(e).slice(8,-1))||"Error"===t)&&e.constructor){if("string"==typeof(n=e.constructor).name)return n.name;if(r=ke.exec(n.toString()))return r[1]}return Ce(e)?"Buffer":t}U(Be,"isObjectLikeArray",Me);var Ue="function"==typeof Fe||"object"==typeof Re||"function"==typeof Se?function(e){return Ne(e).toLowerCase()}:function(e){var r;return null===e?"null":"object"===(r=typeof e)?Ne(e).toLowerCase():r};function Pe(e){return"function"===Ue(e)}var Ye=RegExp.prototype.exec;var We=W();function De(e){return"object"==typeof e&&(e instanceof RegExp||(We?function(e){try{return Ye.call(e),!0}catch(e){return!1}}(e):"[object RegExp]"===Z(e)))}function Ge(e,r,t){return e.replace(r,t)}function $e(e,r,t){if(!_e(e))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",e));if(_e(r))r=new RegExp(function(e){var r,t;if(!_e(e))throw new TypeError(S("invalid argument. Must provide a regular expression string. Value: `%s`.",e));if("/"===e[0])for(t=e.length-1;t>=0&&"/"!==e[t];t--);return void 0===t||t<=0?e.replace(je,"\\$&"):(r=(r=e.substring(1,t)).replace(je,"\\$&"),e=e[0]+r+e.substring(t))}(r),"g");else if(!De(r))throw new TypeError(S("invalid argument. Second argument must be a string or regular expression. Value: `%s`.",r));if(!_e(t)&&!Pe(t))throw new TypeError(S("invalid argument. Third argument must be a string or replacement function. Value: `%s`.",t));return Ge(e,r,t)}var Je={int8:"new Int8Array( [ {{data}} ] )",uint8:"new Uint8Array( [ {{data}} ] )",uint8c:"new Uint8ClampedArray( [ {{data}} ] )",int16:"new Int16Array( [ {{data}} ] )",uint16:"new Uint16Array( [ {{data}} ] )",int32:"new Int32Array( [ {{data}} ] )",uint32:"new Uint32Array( [ {{data}} ] )",float32:"new Float32Array( [ {{data}} ] )",float64:"new Float64Array( [ {{data}} ] )",generic:"[ {{data}} ]",binary:"new Buffer( [ {{data}} ] )",complex64:"new Complex64Array( [ {{data}} ] )",complex128:"new Complex128Array( [ {{data}} ] )"};var ze="function"==typeof Uint8Array;function Ze(e){return ze&&e instanceof Uint8Array||"[object Uint8Array]"===Z(e)}var Xe="function"==typeof Uint8Array?Uint8Array:null;var qe,He="function"==typeof Uint8Array?Uint8Array:void 0;qe=function(){var e,r;if("function"!=typeof Xe)return!1;try{e=Ze(r=new Xe(r=[1,3.14,-3.14,256,257]))&&1===r[0]&&3===r[1]&&253===r[2]&&0===r[3]&&1===r[4]}catch(r){e=!1}return e}()?He:function(){throw new Error("not implemented")};var Ke=qe,Qe="function"==typeof Uint16Array;var er="function"==typeof Uint16Array?Uint16Array:null;var rr,tr="function"==typeof Uint16Array?Uint16Array:void 0;rr=function(){var e,r,t;if("function"!=typeof er)return!1;try{r=new er(r=[1,3.14,-3.14,65536,65537]),t=r,e=(Qe&&t instanceof Uint16Array||"[object Uint16Array]"===Z(t))&&1===r[0]&&3===r[1]&&65533===r[2]&&0===r[3]&&1===r[4]}catch(r){e=!1}return e}()?tr:function(){throw new Error("not implemented")};var nr,ir=rr,or={uint16:ir,uint8:Ke};(nr=new or.uint16(1))[0]=4660;var ar=52===new or.uint8(nr.buffer)[0],ur="function"==typeof ArrayBuffer;function sr(e){return ur&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Z(e)}var fr="function"==typeof Float64Array;var lr="function"==typeof Float64Array?Float64Array:null;var hr,cr="function"==typeof Float64Array?Float64Array:void 0;hr=function(){var e,r,t;if("function"!=typeof lr)return!1;try{r=new lr([1,3.14,-3.14,NaN]),t=r,e=(fr&&t instanceof Float64Array||"[object Float64Array]"===Z(t))&&1===r[0]&&3.14===r[1]&&-3.14===r[2]&&r[3]!=r[3]}catch(r){e=!1}return e}()?cr:function(){throw new Error("not implemented")};var mr=hr,pr="function"==typeof ArrayBuffer?ArrayBuffer:null;var gr,yr="function"==typeof ArrayBuffer?ArrayBuffer:void 0;gr=function(){var e,r,t;if("function"!=typeof pr)return!1;try{(e=sr(t=new pr(16))&&"function"==typeof pr.isView)&&((r=new mr(t))[0]=-3.14,r[1]=NaN,e=e&&pr.isView(r)&&16===t.byteLength&&-3.14===r[0]&&r[1]!=r[1])}catch(r){e=!1}return e}()?yr:function(){throw new Error("not implemented")};var wr=gr,vr="function"==typeof DataView;var dr="function"==typeof DataView?DataView:null;var br,Er="function"==typeof DataView?DataView:void 0;br=function(){var e,r,t,n;if("function"!=typeof dr)return!1;try{t=new wr(24),r=new dr(t,8),n=r,(e=(vr&&n instanceof DataView||"[object DataView]"===Z(n))&&"function"==typeof r.getFloat64&&"function"==typeof r.setFloat64)&&(r.setFloat64(0,-3.14),r.setFloat64(8,NaN),e=e&&r.buffer===t&&16===r.byteLength&&8===r.byteOffset&&-3.14===r.getFloat64(0)&&r.getFloat64(8)!=r.getFloat64(8))}catch(r){e=!1}return e}()?Er:function(){throw new Error("not implemented")};var _r=br,Tr="function"==typeof BigInt?BigInt:void 0,xr={all:["binary","bool","complex64","complex128","float32","float64","generic","int16","int32","int8","uint16","uint32","uint8","uint8c"],typed:["binary","bool","complex64","complex128","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],floating_point:["complex64","complex128","float32","float64"],real_floating_point:["float32","float64"],complex_floating_point:["complex64","complex128"],boolean:["bool"],integer:["int16","int32","int8","uint16","uint32","uint8","uint8c"],signed_integer:["int16","int32","int8"],unsigned_integer:["uint16","uint32","uint8","uint8c"],real:["float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"],numeric:["complex64","complex128","float32","float64","int16","int32","int8","uint16","uint32","uint8","uint8c"]},Vr=/_and_generic$/;function Ar(){var e,r,t;return 0===arguments.length?xr.all.slice():(t=!1,e=arguments[0],Vr.test(e)&&"all"!==(e=Ge(e,Vr,""))&&(t=!0),r=(r=xr[e])?r.slice():[],t&&r.length>0&&r.push("generic"),r)}function jr(){return{bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256}}function Fr(e,r,t){N(e,r,{configurable:!1,enumerable:!0,writable:!1,value:t})}function Or(e){return Object.keys(Object(e))}var Sr,Rr=void 0!==Object.keys;function Lr(e){return"[object Arguments]"===Z(e)}Sr=function(){return Lr(arguments)}();var kr=Sr;function Ir(e){return e!=e}function Br(e){return P(e)&&Ir(e)}function Mr(e){return K(e)&&Ir(e.valueOf())}function Cr(e){return Br(e)||Mr(e)}U(Cr,"isPrimitive",Br),U(Cr,"isObject",Mr);var Nr=Number.POSITIVE_INFINITY,Ur=X.NEGATIVE_INFINITY,Pr=Math.floor;function Yr(e){return Pr(e)===e}function Wr(e){return e<Nr&&e>Ur&&Yr(e)}function Dr(e){return P(e)&&Wr(e)}function Gr(e){return K(e)&&Wr(e.valueOf())}function $r(e){return Dr(e)||Gr(e)}U($r,"isPrimitive",Dr),U($r,"isObject",Gr);var Jr=Object.prototype.propertyIsEnumerable;var zr=!Jr.call("beep","0");function Zr(e,r){var t;return null!=e&&(!(t=Jr.call(e,r))&&zr&&Ae(e)?!Br(r=+r)&&Dr(r)&&r>=0&&r<e.length:t)}var Xr=4294967295;var qr=kr?Lr:function(e){return null!==e&&"object"==typeof e&&!Ie(e)&&"number"==typeof e.length&&Yr(e.length)&&e.length>=0&&e.length<=Xr&&$(e,"callee")&&!Zr(e,"callee")},Hr=Array.prototype.slice;var Kr=Zr((function(){}),"prototype"),Qr=!Zr({toString:null},"toString"),et=9007199254740991;function rt(e){return"object"==typeof e&&null!==e&&"number"==typeof e.length&&Yr(e.length)&&e.length>=0&&e.length<=et}function tt(e,r,t){var n,i;if(!rt(e)&&!_e(e))throw new TypeError(S("invalid argument. First argument must be an array-like object. Value: `%s`.",e));if(0===(n=e.length))return-1;if(3===arguments.length){if(!Dr(t))throw new TypeError(S("invalid argument. Third argument must be an integer. Value: `%s`.",t));if(t>=0){if(t>=n)return-1;i=t}else(i=n+t)<0&&(i=0)}else i=0;if(Cr(r)){for(;i<n;i++)if(Cr(e[i]))return i}else for(;i<n;i++)if(e[i]===r)return i;return-1}function nt(e){return e.constructor&&e.constructor.prototype===e}var it=["console","external","frame","frameElement","frames","innerHeight","innerWidth","outerHeight","outerWidth","pageXOffset","pageYOffset","parent","scrollLeft","scrollTop","scrollX","scrollY","self","webkitIndexedDB","webkitStorageInfo","window"],ot="undefined"==typeof window?void 0:window;var at=function(){var e;if("undefined"===Ue(ot))return!1;for(e in ot)try{-1===tt(it,e)&&$(ot,e)&&null!==ot[e]&&"object"===Ue(ot[e])&&nt(ot[e])}catch(e){return!0}return!1}(),ut="undefined"!=typeof window;var st,ft=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];st=Rr?function(){return 2!==(Or(arguments)||"").length}(1,2)?function(e){return qr(e)?Or(Hr.call(e)):Or(e)}:Or:function(e){var r,t,n,i,o,a,u;if(i=[],qr(e)){for(u=0;u<e.length;u++)i.push(u.toString());return i}if("string"==typeof e){if(e.length>0&&!$(e,"0"))for(u=0;u<e.length;u++)i.push(u.toString())}else{if(!1==(n="function"==typeof e)&&!Be(e))return i;t=Kr&&n}for(o in e)t&&"prototype"===o||!$(e,o)||i.push(String(o));if(Qr)for(r=function(e){if(!1===ut&&!at)return nt(e);try{return nt(e)}catch(e){return!1}}(e),u=0;u<ft.length;u++)a=ft[u],r&&"constructor"===a||!$(e,a)||i.push(String(a));return i};var lt=st;U(Ar,"enum",jr),function(e,r){var t,n,i;for(t=lt(r),i=0;i<t.length;i++)Fr(e,n=t[i],r[n])}(Ar,{bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256});var ht=["row-major","column-major"];function ct(){return ht.slice()}var mt=["row-major","column-major"];function pt(){return{"row-major":101,"column-major":102}}U((function(){return mt.slice()}),"enum",pt);var gt={"row-major":101,"column-major":102};function yt(){return{"row-major":gt["row-major"],"column-major":gt["column-major"]}}U(ct,"enum",yt);var wt=["throw","normalize","clamp","wrap"];function vt(){return wt.slice()}function dt(){return{throw:1,clamp:2,wrap:3,normalize:4}}U(vt,"enum",dt);var bt={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},Et=yt(),_t={throw:1,clamp:2,wrap:3,normalize:4};var Tt=4294967295,xt=4294967296,Vt=new Ke(8),At=new _r(Vt.buffer);function jt(e,r,t,n){var i,o,a;if(0===e){for(a=0;a<Vt.length;a++)r[n]=0,n+=t;return r}for(o=(e&Tt)>>>0,i=Pr(e/xt),ar?(At.setUint32(0,o,ar),At.setUint32(4,i,ar)):(At.setUint32(0,i,ar),At.setUint32(4,o,ar)),a=0;a<Vt.length;a++)r[n]=Vt[a],n+=t;return r}U((function(e){var r,t,n,i;return r=new Ke(8),0===e||(i=(4294967295&e)>>>0,n=Pr(e/4294967296),t=new _r(r.buffer),ar?(t.setUint32(0,i,ar),t.setUint32(4,n,ar)):(t.setUint32(0,n,ar),t.setUint32(4,i,ar))),r}),"assign",jt);var Ft={bool:0,int8:1,uint8:2,uint8c:3,int16:4,uint16:5,int32:6,uint32:7,int64:8,uint64:9,float32:10,float64:11,complex64:12,complex128:13,binary:14,generic:15,notype:17,userdefined_type:256},Ot=yt(),St={throw:1,clamp:2,wrap:3,normalize:4};function Rt(e,r,t,n,i,o){var a,u,s,f,l;if(!(this instanceof Rt))return new Rt(e,r,t,n,i,o);for(f=1,l=0;l<t.length;l++)f*=t[l];return u=r.BYTES_PER_ELEMENT?r.BYTES_PER_ELEMENT*f:null,this._byteLength=u,this._bytesPerElement=pe(e),this._buffer=r,this._dtype=e,this._length=f,this._ndims=t.length,this._offset=i,this._order=o,this._shape=t,this._strides=n,this._accessors=re(r.get&&r.set),this._iterationOrder=function(e){var r,t;for(r=0,t=0;t<e.length;t++)e[t]<0&&(r+=1);return 0===r?1:r===e.length?-1:0}(n),a=function(e,r,t,n,i){var o;return 0!==e&&0!==i&&e===(o=de(r,t,n))[1]-o[0]+1}(f,t,n,i,this._iterationOrder),s=ye(n),this._flags={ROW_MAJOR_CONTIGUOUS:ve(s,a),COLUMN_MAJOR_CONTIGUOUS:we(s,a),READONLY:!1},this.__meta_dataview__=null,this}function Lt(e){return"object"==typeof e&&null!==e&&!Ie(e)}U(Rt,"name","ndarray"),ce(Rt.prototype,"byteLength",(function(){return this._byteLength})),ce(Rt.prototype,"BYTES_PER_ELEMENT",(function(){return this._bytesPerElement})),ce(Rt.prototype,"data",(function(){return this._buffer})),ce(Rt.prototype,"dtype",(function(){return this._dtype})),ce(Rt.prototype,"flags",(function(){return{ROW_MAJOR_CONTIGUOUS:(e=this._flags).ROW_MAJOR_CONTIGUOUS,COLUMN_MAJOR_CONTIGUOUS:e.COLUMN_MAJOR_CONTIGUOUS,READONLY:e.READONLY};var e})),ce(Rt.prototype,"length",(function(){return this._length})),ce(Rt.prototype,"ndims",(function(){return this._ndims})),ce(Rt.prototype,"offset",(function(){return this._offset})),ce(Rt.prototype,"order",(function(){return this._order})),ce(Rt.prototype,"shape",(function(){return this._shape.slice()})),ce(Rt.prototype,"strides",(function(){return this._strides.slice()})),U(Rt.prototype,"get",(function(){var e,r;for(e=this._offset,r=0;r<arguments.length;r++)e+=this._strides[r]*arguments[r];return this._accessors?this._buffer.get(e):this._buffer[e]})),U(Rt.prototype,"iget",(function(e){var r,t,n,i,o,a;if(0===(n=this._ndims))return this._accessors?this._buffer.get(this._offset):this._buffer[this._offset];if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(1===this._iterationOrder)return this._accessors?this._buffer.get(this._offset+e):this._buffer[this._offset+e];if(-1===this._iterationOrder)return this._accessors?this._buffer.get(this.offset-e):this._buffer[this._offset-e]}if(t=this._shape,r=this._strides,i=this._offset,"column-major"===this._order){for(a=0;a<n;a++)e-=o=e%t[a],e/=t[a],i+=o*r[a];return this._accessors?this._buffer.get(i):this._buffer[i]}for(a=n-1;a>=0;a--)e-=o=e%t[a],e/=t[a],i+=o*r[a];return this._accessors?this._buffer.get(i):this._buffer[i]})),U(Rt.prototype,"set",(function(){var e,r;for(e=this._offset,r=0;r<arguments.length-1;r++)e+=this._strides[r]*arguments[r];return this._accessors?this._buffer.set(arguments[r],e):this._buffer[e]=arguments[r],this})),U(Rt.prototype,"iset",(function(e,r){var t,n,i,o,a,u;if(0===(i=this._ndims))return this._accessors?this._buffer.set(e,this._offset):this._buffer[this._offset]=e,this;if(this._flags.ROW_MAJOR_CONTIGUOUS||this._flags.COLUMN_MAJOR_CONTIGUOUS){if(1===this._iterationOrder)return this._accessors?this._buffer.set(r,this._offset+e):this._buffer[this._offset+e]=r,this;if(-1===this._iterationOrder)return this._accessors?this._buffer.set(r,this._offset-e):this._buffer[this._offset-e]=r,this}if(n=this._shape,t=this._strides,o=this._offset,"column-major"===this._order){for(u=0;u<i;u++)e-=a=e%n[u],e/=n[u],o+=a*t[u];return this._accessors?this._buffer.set(r,o):this._buffer[o]=r,this}for(u=i-1;u>=0;u--)e-=a=e%n[u],e/=n[u],o+=a*t[u];return this._accessors?this._buffer.set(r,o):this._buffer[o]=r,this})),U(Rt.prototype,"toString",(function(){var e,r,t,n,i,o;if(r=this._shape.length,t="ndarray( '"+(n=this._dtype)+"', ",e="",this._length<=100)if("complex64"===n||"complex128"===n)for(o=0;o<this._length;o++)e+=be(i=this.iget(o))+", "+Ee(i),o<this._length-1&&(e+=", ");else for(o=0;o<this._length;o++)e+=this.iget(o),o<this._length-1&&(e+=", ");else{if("complex64"===n||"complex128"===n)for(o=0;o<3;o++)e+=be(i=this.iget(o))+", "+Ee(i),o<2&&(e+=", ");else for(o=0;o<3;o++)e+=this.iget(o),o<2&&(e+=", ");if(e+=", ..., ","complex64"===n||"complex128"===n)for(o=2;o>=0;o--)e+=be(i=this.iget(this._length-1-o))+", "+Ee(i),o>0&&(e+=", ");else for(o=2;o>=0;o--)e+=this.iget(this._length-1-o),o>0&&(e+=", ")}if(t+=$e(Je[this.dtype],"{{data}}",e),t+=", ",t+=0===r?"[]":"[ "+this._shape.join(", ")+" ]",t+=", ",t+="[ ",0===r)t+="0";else for(o=0;o<r;o++)this._strides[o]<0?t+=-this._strides[o]:t+=this._strides[o],o<r-1&&(t+=", ");return t+=" ]",t+=", ",t+="0",t+=", ",t+="'"+this._order+"'",t+=" )"})),U(Rt.prototype,"toJSON",(function(){var e,r,t,n;for(r=this._length,(e={}).type="ndarray",e.dtype=this.dtype,e.flags={READONLY:this._flags.READONLY},e.order=this._order,e.shape=this._shape.slice(),e.strides=this._strides.slice(),n=0;n<r;n++)e.strides[n]<0&&(e.strides[n]*=-1);if(e.data=[],"complex64"===e.dtype||"complex128"===e.dtype)for(n=0;n<r;n++)t=this.iget(n),e.data.push(be(t),Ee(t));else for(n=0;n<r;n++)e.data.push(this.iget(n));return e})),U(Rt.prototype,"__array_meta_dataview__","function"==typeof he.BigInt&&"function"==typeof BigInt&&"bigint"==typeof he.BigInt("1")&&"bigint"==typeof BigInt("1")?function(){var e,r,t,n,i,o,a,u,s,f,l,h,c,m;if(s=this._mode||"throw",a=this._submode||[s],t=33+16*(h=this._ndims)+(c=a.length),(u=this.__meta_dataview__)&&u.byteLength===t)return u;for(u=new _r(new wr(t)),i=this._shape,o=this._strides,n=this._dtype,e=this._bytesPerElement,f=0,u.setInt8(f,ar?1:0),f+=1,u.setInt16(f,bt[n],ar),f+=2,u.setBigInt64(f,Tr(h),ar),l=8*h,f+=8,m=0;m<h;m++)u.setBigInt64(f,Tr(i[m]),ar),u.setBigInt64(f+l,Tr(o[m]*e),ar),f+=8;for(f+=l,u.setBigInt64(f,Tr(this._offset*e),ar),f+=8,u.setInt8(f,Et[this._order]),f+=1,u.setInt8(f,_t[s]),f+=1,u.setBigInt64(f,Tr(c),ar),f+=8,m=0;m<c;m++)u.setInt8(f,_t[a[m]]),f+=1;return r=0,r|=this._flags.READONLY?4:0,u.setInt32(f,r,ar),this.__meta_dataview__=u,u}:function(){var e,r,t,n,i,o,a,u,s,f,l,h,c,m,p;if(f=this._mode||"throw",u=this._submode||[f],n=33+16*(c=this._ndims)+(m=u.length),(s=this.__meta_dataview__)&&s.byteLength===n)return s;for(s=new _r(new wr(n)),r=new Ke(s.buffer),o=this._shape,a=this._strides,i=this._dtype,e=this._bytesPerElement,l=0,s.setInt8(l,ar?1:0),l+=1,s.setInt16(l,Ft[i],ar),jt(c,r,1,l+=2),h=8*c,l+=8,p=0;p<c;p++)jt(o[p],r,1,l),jt(a[p]*e,r,1,l+h),l+=8;for(l+=h,jt(this._offset*e,r,1,l),l+=8,s.setInt8(l,Ot[this._order]),l+=1,s.setInt8(l,St[f]),jt(m,r,1,l+=1),l+=8,p=0;p<m;p++)s.setInt8(l,St[u[p]]),l+=1;return t=0,t|=this._flags.READONLY?4:0,s.setInt32(l,t,ar),this.__meta_dataview__=s,s});var kt,It=Object,Bt=Object.getPrototypeOf;kt=Pe(Object.getPrototypeOf)?Bt:function(e){var r=function(e){return e.__proto__}(e);return r||null===r?r:"[object Function]"===Z(e.constructor)?e.constructor.prototype:e instanceof Object?Object.prototype:null};var Mt=kt;var Ct=Object.prototype;function Nt(e){var r;return!!Lt(e)&&(r=function(e){return null==e?null:(e=It(e),Mt(e))}(e),!r||!$(e,"constructor")&&$(r,"constructor")&&Pe(r.constructor)&&"[object Function]"===Z(r.constructor)&&$(r,"isPrototypeOf")&&Pe(r.isPrototypeOf)&&(r===Ct||function(e){var r;for(r in e)if(!$(e,r))return!1;return!0}(e)))}function Ut(e){return Dr(e)&&e>=0}function Pt(e){return Gr(e)&&e.valueOf()>=0}function Yt(e){return Ut(e)||Pt(e)}U(Yt,"isPrimitive",Ut),U(Yt,"isObject",Pt);var Wt=4294967295;function Dt(e){if("function"!=typeof e)throw new TypeError(S("invalid argument. Must provide a function. Value: `%s`.",e));return function(r){var t,n;if(!function(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length&&Yr(e.length)&&e.length>=0&&e.length<=Wt}(r))return!1;if(t=r.length,0===t)return!1;for(n=0;n<t;n++)if(!1===e(r[n]))return!1;return!0}}var Gt=Dt(Yt.isPrimitive),$t=Dt(Yt.isObject),Jt=Dt(Yt);function zt(e,r){return"column-major"===r?function(e){var r,t,n;for(r=[],t=1,n=0;n<e.length;n++)r.push(t),t*=e[n];return r}(e):function(e){var r,t,n,i;for(r=e.length,t=[],i=0;i<r;i++)t.push(0);for(n=1,i=r-1;i>=0;i--)t[i]=n,n*=e[i];return t}(e)}function Zt(e){var r,t,n;if(0===(r=e.length))return 0;for(t=1,n=0;n<r;n++)t*=e[n];return t}U(Jt,"primitives",Gt),U(Jt,"objects",$t),U(zt,"assign",(function(e,r,t){return"column-major"===r?function(e,r){var t,n;for(t=1,n=0;n<e.length;n++)r[n]=t,t*=e[n];return r}(e,t):function(e,r){var t,n;for(t=1,n=e.length-1;n>=0;n--)r[n]=t,t*=e[n];return r}(e,t)}));var Xt="function";function qt(e){return typeof e.get===Xt&&typeof e.set===Xt}var Ht={complex128:function(e,r){return e.get(r)},complex64:function(e,r){return e.get(r)},default:function(e,r){return e.get(r)}};function Kt(e){var r=Ht[e];return"function"==typeof r?r:Ht.default}var Qt={float64:function(e,r){return e[r]},float32:function(e,r){return e[r]},int32:function(e,r){return e[r]},int16:function(e,r){return e[r]},int8:function(e,r){return e[r]},uint32:function(e,r){return e[r]},uint16:function(e,r){return e[r]},uint8:function(e,r){return e[r]},uint8c:function(e,r){return e[r]},generic:function(e,r){return e[r]},default:function(e,r){return e[r]}};function en(e){var r=Qt[e];return"function"==typeof r?r:Qt.default}var rn={Float32Array:"float32",Float64Array:"float64",Array:"generic",Int16Array:"int16",Int32Array:"int32",Int8Array:"int8",Uint16Array:"uint16",Uint32Array:"uint32",Uint8Array:"uint8",Uint8ClampedArray:"uint8c",Complex64Array:"complex64",Complex128Array:"complex128"},tn="function"==typeof Float32Array;var nn="function"==typeof Float32Array?Float32Array:null;var on,an="function"==typeof Float32Array?Float32Array:void 0;on=function(){var e,r,t;if("function"!=typeof nn)return!1;try{r=new nn([1,3.14,-3.14,5e40]),t=r,e=(tn&&t instanceof Float32Array||"[object Float32Array]"===Z(t))&&1===r[0]&&3.140000104904175===r[1]&&-3.140000104904175===r[2]&&r[3]===Nr}catch(r){e=!1}return e}()?an:function(){throw new Error("not implemented")};var un=on,sn="function"==typeof Uint32Array;var fn="function"==typeof Uint32Array?Uint32Array:null;var ln,hn="function"==typeof Uint32Array?Uint32Array:void 0;ln=function(){var e,r,t;if("function"!=typeof fn)return!1;try{r=new fn(r=[1,3.14,-3.14,4294967296,4294967297]),t=r,e=(sn&&t instanceof Uint32Array||"[object Uint32Array]"===Z(t))&&1===r[0]&&3===r[1]&&4294967293===r[2]&&0===r[3]&&1===r[4]}catch(r){e=!1}return e}()?hn:function(){throw new Error("not implemented")};var cn=ln,mn="function"==typeof Int32Array;var pn="function"==typeof Int32Array?Int32Array:null;var gn,yn="function"==typeof Int32Array?Int32Array:void 0;gn=function(){var e,r,t;if("function"!=typeof pn)return!1;try{r=new pn([1,3.14,-3.14,2147483648]),t=r,e=(mn&&t instanceof Int32Array||"[object Int32Array]"===Z(t))&&1===r[0]&&3===r[1]&&-3===r[2]&&-2147483648===r[3]}catch(r){e=!1}return e}()?yn:function(){throw new Error("not implemented")};var wn=gn,vn="function"==typeof Int16Array;var dn="function"==typeof Int16Array?Int16Array:null;var bn,En="function"==typeof Int16Array?Int16Array:void 0;bn=function(){var e,r,t;if("function"!=typeof dn)return!1;try{r=new dn([1,3.14,-3.14,32768]),t=r,e=(vn&&t instanceof Int16Array||"[object Int16Array]"===Z(t))&&1===r[0]&&3===r[1]&&-3===r[2]&&-32768===r[3]}catch(r){e=!1}return e}()?En:function(){throw new Error("not implemented")};var _n=bn,Tn="function"==typeof Uint8ClampedArray;var xn="function"==typeof Uint8ClampedArray?Uint8ClampedArray:null;var Vn,An="function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0;Vn=function(){var e,r,t;if("function"!=typeof xn)return!1;try{r=new xn([-1,0,1,3.14,4.99,255,256]),t=r,e=(Tn&&t instanceof Uint8ClampedArray||"[object Uint8ClampedArray]"===Z(t))&&0===r[0]&&0===r[1]&&1===r[2]&&3===r[3]&&5===r[4]&&255===r[5]&&255===r[6]}catch(r){e=!1}return e}()?An:function(){throw new Error("not implemented")};var jn=Vn,Fn="function"==typeof Int8Array;var On="function"==typeof Int8Array?Int8Array:null;var Sn,Rn="function"==typeof Int8Array?Int8Array:void 0;Sn=function(){var e,r,t;if("function"!=typeof On)return!1;try{r=new On([1,3.14,-3.14,128]),t=r,e=(Fn&&t instanceof Int8Array||"[object Int8Array]"===Z(t))&&1===r[0]&&3===r[1]&&-3===r[2]&&-128===r[3]}catch(r){e=!1}return e}()?Rn:function(){throw new Error("not implemented")};var Ln=Sn;function kn(e){return"object"==typeof e&&null!==e&&"number"==typeof e.length&&Yr(e.length)&&e.length>=0&&e.length<=Wt}function In(e,r){if(!(this instanceof In))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!P(e))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",e));if(!P(r))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return N(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:e}),N(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}U(In,"BYTES_PER_ELEMENT",8),U(In.prototype,"BYTES_PER_ELEMENT",8),U(In.prototype,"byteLength",16),U(In.prototype,"toString",(function(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i"})),U(In.prototype,"toJSON",(function(){var e={type:"Complex128"};return e.re=this.re,e.im=this.im,e}));var Bn="function"==typeof Math.fround?Math.fround:null,Mn=new un(1);var Cn="function"==typeof Bn?Bn:function(e){return Mn[0]=e,Mn[0]};function Nn(e,r){if(!(this instanceof Nn))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!P(e))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",e));if(!P(r))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return N(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Cn(e)}),N(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Cn(r)}),this}function Un(e){return e instanceof In||e instanceof Nn||"object"==typeof e&&null!==e&&"number"==typeof e.re&&"number"==typeof e.im}function Pn(e){return Yr(e/2)}U(Nn,"BYTES_PER_ELEMENT",4),U(Nn.prototype,"BYTES_PER_ELEMENT",4),U(Nn.prototype,"byteLength",8),U(Nn.prototype,"toString",(function(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i"})),U(Nn.prototype,"toJSON",(function(){var e={type:"Complex64"};return e.re=this.re,e.im=this.im,e}));var Yn=8;function Wn(e){return"object"==typeof e&&null!==e&&"Complex64Array"===e.constructor.name&&e.BYTES_PER_ELEMENT===Yn}var Dn=16;function Gn(e){return"object"==typeof e&&null!==e&&"Complex128Array"===e.constructor.name&&e.BYTES_PER_ELEMENT===Dn}function $n(){return"function"==typeof J&&"symbol"==typeof J("foo")&&$(J,"iterator")&&"symbol"==typeof J.iterator}var Jn=$n()?Symbol.iterator:null;function zn(e,r){if(!(this instanceof zn))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!P(e))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",e));if(!P(r))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return N(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Cn(e)}),N(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Cn(r)}),this}function Zn(e){return e.re}function Xn(e){return e.im}function qn(e,r){return new un(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}function Hn(e,r){return new mr(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}function Kn(e){var r,t,n;for(r=[];!(t=e.next()).done;)if(kn(n=t.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Un(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));r.push(Zn(n),Xn(n))}return r}U(zn,"BYTES_PER_ELEMENT",4),U(zn.prototype,"BYTES_PER_ELEMENT",4),U(zn.prototype,"byteLength",8),U(zn.prototype,"toString",(function(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i"})),U(zn.prototype,"toJSON",(function(){var e={type:"Complex64"};return e.re=this.re,e.im=this.im,e}));var Qn=2*un.BYTES_PER_ELEMENT,ei=$n();function ri(e){return e instanceof ii||"object"==typeof e&&null!==e&&("Complex64Array"===e.constructor.name||"Complex128Array"===e.constructor.name)&&"number"==typeof e._length&&"object"==typeof e._buffer}function ti(e){return e===ii||"Complex128Array"===e.name}function ni(e,r){return new zn(e[r*=2],e[r+1])}function ii(){var e,r,t,n;if(r=arguments.length,!(this instanceof ii))return 0===r?new ii:1===r?new ii(arguments[0]):2===r?new ii(arguments[0],arguments[1]):new ii(arguments[0],arguments[1],arguments[2]);if(0===r)t=new un(0);else if(1===r)if(Ut(arguments[0]))t=new un(2*arguments[0]);else if(rt(arguments[0]))if((n=(t=arguments[0]).length)&&Ie(t)&&Un(t[0])){if(t=function(e,r){var t,n,i,o;for(t=r.length,o=0,i=0;i<t;i++){if(!Un(n=r[i]))return null;e[o]=Zn(n),e[o+1]=Xn(n),o+=2}return e}(new un(2*n),t),null===t){if(!Pn(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 un(arguments[0])}}else{if(Wn(t))t=qn(t,0);else if(Gn(t))t=Hn(t,0);else if(!Pn(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 un(t)}else if(sr(arguments[0])){if(!Yr((t=arguments[0]).byteLength/Qn))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",Qn,t.byteLength));t=new un(t)}else{if(!Lt(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===ei)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(!Pe(t[Jn]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Pe((t=t[Jn]()).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=Kn(t))instanceof Error)throw t;t=new un(t)}else{if(!sr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ut(e=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Yr(e/Qn))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",Qn,e));if(2===r){if(!Yr((n=t.byteLength-e)/Qn))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",Qn,n));t=new un(t,e)}else{if(!Ut(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*Qn>t.byteLength-e)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Qn));t=new un(t,e,2*n)}}return U(this,"_buffer",t),U(this,"_length",t.length/2),this}function oi(e,r){if(!(this instanceof oi))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!P(e))throw new TypeError(S("invalid argument. Real component must be a number. Value: `%s`.",e));if(!P(r))throw new TypeError(S("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return N(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:e}),N(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}function ai(e){return e.re}function ui(e){return e.im}function si(e){var r,t,n;for(r=[];!(t=e.next()).done;)if(kn(n=t.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Un(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));r.push(ai(n),ui(n))}return r}U(ii,"BYTES_PER_ELEMENT",Qn),U(ii,"name","Complex64Array"),U(ii,"from",(function(e){var r,t,n,i,o,a,u,s,f,l,h,c;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ti(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Pe(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(r=arguments[2])}if(ri(e)){if(s=e.length,n){for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,e.get(h),h)))o[c]=Zn(l),o[c+1]=Xn(l);else{if(!(kn(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(e)}if(rt(e)){if(n){for(s=e.length,u=e.get&&e.set?Kt("default"):en("default"),h=0;h<s;h++)if(!Un(u(e,h))){f=!0;break}if(f){if(!Pn(s))throw new RangeError(S("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,s));for(o=(i=new this(s/2))._buffer,h=0;h<s;h++)o[h]=n.call(r,u(e,h),h);return i}for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,u(e,h),h)))o[c]=Zn(l),o[c+1]=Xn(l);else{if(!(kn(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(e)}if(Lt(e)&&ei&&Pe(e[Jn])){if(!Pe((o=e[Jn]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a=n?function(e,r,t){var n,i,o,a;for(n=[],a=-1;!(i=e.next()).done;)if(a+=1,kn(o=r.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Un(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(Zn(o),Xn(o))}return n}(o,n,r):Kn(o),a instanceof Error)throw a;for(o=(i=new this(s=a.length/2))._buffer,h=0;h<s;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`.",e))})),U(ii,"of",(function(){var e,r;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ti(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);return new this(e)})),U(ii.prototype,"at",(function(e){if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",e));if(e<0&&(e+=this._length),!(e<0||e>=this._length))return ni(this._buffer,e)})),ce(ii.prototype,"buffer",(function(){return this._buffer.buffer})),ce(ii.prototype,"byteLength",(function(){return this._buffer.byteLength})),ce(ii.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),U(ii.prototype,"BYTES_PER_ELEMENT",ii.BYTES_PER_ELEMENT),U(ii.prototype,"copyWithin",(function(e,r){if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*e,2*r):this._buffer.copyWithin(2*e,2*r,2*arguments[2]),this})),U(ii.prototype,"entries",(function(){var e,r,t,n,i,o,a;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,n=this._length,o=-1,a=-2,U(t={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new zn(e[a+=2],e[a+1]),{value:[o,r],done:!1}})),U(t,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Jn&&U(t,Jn,(function(){return r.entries()})),t})),U(ii.prototype,"every",(function(e,r){var t,n;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(!e.call(r,ni(t,n),n,this))return!1;return!0})),U(ii.prototype,"fill",(function(e,r,t){var n,i,o,a,u,s;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(n=this._buffer,i=this._length,arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!Yr(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 r=0,t=i;for(a=Zn(e),u=Xn(e),s=r;s<t;s++)n[o=2*s]=a,n[o+1]=u;return this})),U(ii.prototype,"filter",(function(e,r){var t,n,i,o;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=ni(t,i),e.call(r,o,i,this)&&n.push(o);return new this.constructor(n)})),U(ii.prototype,"find",(function(e,r){var t,n,i;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=ni(t,n),e.call(r,i,n,this))return i})),U(ii.prototype,"findIndex",(function(e,r){var t,n,i;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=ni(t,n),e.call(r,i,n,this))return n;return-1})),U(ii.prototype,"findLast",(function(e,r){var t,n,i;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=ni(t,n),e.call(r,i,n,this))return i})),U(ii.prototype,"findLastIndex",(function(e,r){var t,n,i;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=ni(t,n),e.call(r,i,n,this))return n;return-1})),U(ii.prototype,"forEach",(function(e,r){var t,n,i;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)i=ni(t,n),e.call(r,i,n,this)})),U(ii.prototype,"get",(function(e){if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(e))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return ni(this._buffer,e)})),U(ii.prototype,"includes",(function(e,r){var t,n,i,o,a;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),U(ii.prototype,"indexOf",(function(e,r){var t,n,i,o,a;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(ii.prototype,"join",(function(e){var r,t,n,i;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!_e(e))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",e));n=e}for(r=[],t=this._buffer,i=0;i<this._length;i++)r.push(ni(t,i).toString());return r.join(n)})),U(ii.prototype,"lastIndexOf",(function(e,r){var t,n,i,o,a;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),ce(ii.prototype,"length",(function(){return this._length})),U(ii.prototype,"map",(function(e,r){var t,n,i,o,a;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Un(a=e.call(r,ni(n,o),o,this)))t[2*o]=Zn(a),t[2*o+1]=Xn(a);else{if(!kn(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})),U(ii.prototype,"reduce",(function(e,r){var t,n,i,o;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,i=this._length,arguments.length>1)n=r,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=ni(t,0),o=1}for(;o<i;o++)n=e(n,ni(t,o),o,this);return n})),U(ii.prototype,"reverse",(function(){var e,r,t,n,i,o;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=this._buffer,n=Pr(t/2),i=0;i<n;i++)o=t-i-1,r=e[2*i],e[2*i]=e[2*o],e[2*o]=r,r=e[2*i+1],e[2*i+1]=e[2*o+1],e[2*o+1]=r;return this})),U(ii.prototype,"set",(function(e){var r,t,n,i,o,a,u,s,f;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Ut(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Un(e)){if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=Zn(e),void(n[t+1]=Xn(e))}if(ri(e)){if(t+(a=e._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,f=n.byteOffset+t*Qn,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new un(r.length),s=0;s<r.length;s++)i[s]=r[s];r=i}for(t*=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2}else{if(!rt(e))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`.",e));for(a=e.length,s=0;s<a;s++)if(!Un(e[s])){o=!0;break}if(o){if(!Pn(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(r=e,f=n.byteOffset+t*Qn,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new un(a),s=0;s<a;s++)i[s]=r[s];r=i}for(t*=2,a/=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,s=0;s<a;s++)u=e[s],n[t]=Zn(u),n[t+1]=Xn(u),t+=2}})),U(ii.prototype,"slice",(function(e,r){var t,n,i,o,a,u,s;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)e=0,r=u;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=u)<0&&(e=0),1===arguments.length)r=u;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=u)<0&&(r=0):r>u&&(r=u)}}for(t=e<r?r-e:0,n=(i=new this.constructor(t))._buffer,s=0;s<t;s++)o=2*(s+e),n[2*s]=a[o],n[2*s+1]=a[o+1];return i})),U(ii.prototype,"some",(function(e,r){var t,n;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(e.call(r,ni(t,n),n,this))return!0;return!1})),U(ii.prototype,"subarray",(function(e,r){var t,n,i;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)e=0,r=i;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),1===arguments.length)r=i;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i)<0&&(r=0):r>i&&(r=i)}}return e>=i?(i=0,t=n.byteLength):e>=r?(i=0,t=n.byteOffset+e*Qn):(i=r-e,t=n.byteOffset+e*Qn),new this.constructor(n.buffer,t,i<0?0:i)})),U(ii.prototype,"toReversed",(function(){var e,r,t,n,i,o;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=new this.constructor(t),n=this._buffer,e=r._buffer,i=0;i<t;i++)o=t-i-1,e[2*i]=n[2*o],e[2*i+1]=n[2*o+1];return r})),U(ii.prototype,"toString",(function(){var e,r,t;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t<this._length;t++)e.push(ni(r,t).toString());return e.join(",")})),U(ii.prototype,"with",(function(e,r){var t,n,i;if(!ri(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Un(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(t=(n=new this.constructor(this._buffer))._buffer)[2*e]=Zn(r),t[2*e+1]=Xn(r),n})),U(oi,"BYTES_PER_ELEMENT",8),U(oi.prototype,"BYTES_PER_ELEMENT",8),U(oi.prototype,"byteLength",16),U(oi.prototype,"toString",(function(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i"})),U(oi.prototype,"toJSON",(function(){var e={type:"Complex128"};return e.re=this.re,e.im=this.im,e}));var fi=2*mr.BYTES_PER_ELEMENT,li=$n();function hi(e){return e instanceof pi||"object"==typeof e&&null!==e&&("Complex64Array"===e.constructor.name||"Complex128Array"===e.constructor.name)&&"number"==typeof e._length&&"object"==typeof e._buffer}function ci(e){return e===pi||"Complex64Array"===e.name}function mi(e,r){return new oi(e[r*=2],e[r+1])}function pi(){var e,r,t,n;if(r=arguments.length,!(this instanceof pi))return 0===r?new pi:1===r?new pi(arguments[0]):2===r?new pi(arguments[0],arguments[1]):new pi(arguments[0],arguments[1],arguments[2]);if(0===r)t=new mr(0);else if(1===r)if(Ut(arguments[0]))t=new mr(2*arguments[0]);else if(rt(arguments[0]))if((n=(t=arguments[0]).length)&&Ie(t)&&Un(t[0])){if(t=function(e,r){var t,n,i,o;for(t=r.length,o=0,i=0;i<t;i++){if(!Un(n=r[i]))return null;e[o]=ai(n),e[o+1]=ui(n),o+=2}return e}(new mr(2*n),t),null===t){if(!Pn(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 mr(arguments[0])}}else{if(Wn(t))t=qn(t,0);else if(Gn(t))t=Hn(t,0);else if(!Pn(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 mr(t)}else if(sr(arguments[0])){if(!Yr((t=arguments[0]).byteLength/fi))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",fi,t.byteLength));t=new mr(t)}else{if(!Lt(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===li)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(!Pe(t[Jn]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Pe((t=t[Jn]()).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=si(t))instanceof Error)throw t;t=new mr(t)}else{if(!sr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ut(e=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Yr(e/fi))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",fi,e));if(2===r){if(!Yr((n=t.byteLength-e)/fi))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",fi,n));t=new mr(t,e)}else{if(!Ut(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*fi>t.byteLength-e)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*fi));t=new mr(t,e,2*n)}}return U(this,"_buffer",t),U(this,"_length",t.length/2),this}U(pi,"BYTES_PER_ELEMENT",fi),U(pi,"name","Complex128Array"),U(pi,"from",(function(e){var r,t,n,i,o,a,u,s,f,l,h,c;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Pe(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(r=arguments[2])}if(hi(e)){if(s=e.length,n){for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,e.get(h),h)))o[c]=ai(l),o[c+1]=ui(l);else{if(!(kn(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(e)}if(rt(e)){if(n){for(s=e.length,u=e.get&&e.set?Kt("default"):en("default"),h=0;h<s;h++)if(!Un(u(e,h))){f=!0;break}if(f){if(!Pn(s))throw new RangeError(S("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",s));for(o=(i=new this(s/2))._buffer,h=0;h<s;h++)o[h]=n.call(r,u(e,h),h);return i}for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,u(e,h),h)))o[c]=ai(l),o[c+1]=ui(l);else{if(!(kn(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(e)}if(Lt(e)&&li&&Pe(e[Jn])){if(!Pe((o=e[Jn]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a=n?function(e,r,t){var n,i,o,a;for(n=[],a=-1;!(i=e.next()).done;)if(a+=1,kn(o=r.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Un(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(ai(o),ui(o))}return n}(o,n,r):si(o),a instanceof Error)throw a;for(o=(i=new this(s=a.length/2))._buffer,h=0;h<s;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`.",e))})),U(pi,"of",(function(){var e,r;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ci(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);return new this(e)})),U(pi.prototype,"at",(function(e){if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",e));if(e<0&&(e+=this._length),!(e<0||e>=this._length))return mi(this._buffer,e)})),ce(pi.prototype,"buffer",(function(){return this._buffer.buffer})),ce(pi.prototype,"byteLength",(function(){return this._buffer.byteLength})),ce(pi.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),U(pi.prototype,"BYTES_PER_ELEMENT",pi.BYTES_PER_ELEMENT),U(pi.prototype,"copyWithin",(function(e,r){if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*e,2*r):this._buffer.copyWithin(2*e,2*r,2*arguments[2]),this})),U(pi.prototype,"entries",(function(){var e,r,t,n,i,o,a;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,n=this._length,o=-1,a=-2,U(t={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new oi(e[a+=2],e[a+1]),{value:[o,r],done:!1}})),U(t,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Jn&&U(t,Jn,(function(){return r.entries()})),t})),U(pi.prototype,"every",(function(e,r){var t,n;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(!e.call(r,mi(t,n),n,this))return!1;return!0})),U(pi.prototype,"fill",(function(e,r,t){var n,i,o,a,u,s;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(n=this._buffer,i=this._length,arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!Yr(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 r=0,t=i;for(a=ai(e),u=ui(e),s=r;s<t;s++)n[o=2*s]=a,n[o+1]=u;return this})),U(pi.prototype,"filter",(function(e,r){var t,n,i,o;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=mi(t,i),e.call(r,o,i,this)&&n.push(o);return new this.constructor(n)})),U(pi.prototype,"find",(function(e,r){var t,n,i;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=mi(t,n),e.call(r,i,n,this))return i})),U(pi.prototype,"findIndex",(function(e,r){var t,n,i;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=mi(t,n),e.call(r,i,n,this))return n;return-1})),U(pi.prototype,"findLast",(function(e,r){var t,n,i;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=mi(t,n),e.call(r,i,n,this))return i})),U(pi.prototype,"findLastIndex",(function(e,r){var t,n,i;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=mi(t,n),e.call(r,i,n,this))return n;return-1})),U(pi.prototype,"forEach",(function(e,r){var t,n,i;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)i=mi(t,n),e.call(r,i,n,this)})),U(pi.prototype,"get",(function(e){if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(e))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return mi(this._buffer,e)})),ce(pi.prototype,"length",(function(){return this._length})),U(pi.prototype,"includes",(function(e,r){var t,n,i,o,a;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),U(pi.prototype,"indexOf",(function(e,r){var t,n,i,o,a;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(pi.prototype,"join",(function(e){var r,t,n,i;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Ae(e))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",e));n=e}for(r=[],t=this._buffer,i=0;i<this._length;i++)r.push(mi(t,i).toString());return r.join(n)})),U(pi.prototype,"lastIndexOf",(function(e,r){var t,n,i,o,a;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(pi.prototype,"map",(function(e,r){var t,n,i,o,a;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Un(a=e.call(r,mi(n,o),o,this)))t[2*o]=ai(a),t[2*o+1]=ui(a);else{if(!kn(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})),U(pi.prototype,"reduce",(function(e,r){var t,n,i,o;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,i=this._length,arguments.length>1)n=r,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=mi(t,0),o=1}for(;o<i;o++)n=e(n,mi(t,o),o,this);return n})),U(pi.prototype,"reverse",(function(){var e,r,t,n,i,o;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=this._buffer,n=Pr(t/2),i=0;i<n;i++)o=t-i-1,r=e[2*i],e[2*i]=e[2*o],e[2*o]=r,r=e[2*i+1],e[2*i+1]=e[2*o+1],e[2*o+1]=r;return this})),U(pi.prototype,"set",(function(e){var r,t,n,i,o,a,u,s,f;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Ut(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Un(e)){if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=ai(e),void(n[t+1]=ui(e))}if(hi(e)){if(t+(a=e._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,f=n.byteOffset+t*fi,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new mr(r.length),s=0;s<r.length;s++)i[s]=r[s];r=i}for(t*=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2}else{if(!rt(e))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`.",e));for(a=e.length,s=0;s<a;s++)if(!Un(e[s])){o=!0;break}if(o){if(!Pn(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(r=e,f=n.byteOffset+t*fi,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new mr(a),s=0;s<a;s++)i[s]=r[s];r=i}for(t*=2,a/=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,s=0;s<a;s++)u=e[s],n[t]=ai(u),n[t+1]=ui(u),t+=2}})),U(pi.prototype,"slice",(function(e,r){var t,n,i,o,a,u,s;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)e=0,r=u;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=u)<0&&(e=0),1===arguments.length)r=u;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=u)<0&&(r=0):r>u&&(r=u)}}for(t=e<r?r-e:0,n=(i=new this.constructor(t))._buffer,s=0;s<t;s++)o=2*(s+e),n[2*s]=a[o],n[2*s+1]=a[o+1];return i})),U(pi.prototype,"some",(function(e,r){var t,n;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(e.call(r,mi(t,n),n,this))return!0;return!1})),U(pi.prototype,"subarray",(function(e,r){var t,n,i;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)e=0,r=i;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),1===arguments.length)r=i;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i)<0&&(r=0):r>i&&(r=i)}}return e>=i?(i=0,t=n.byteLength):e>=r?(i=0,t=n.byteOffset+e*fi):(i=r-e,t=n.byteOffset+e*fi),new this.constructor(n.buffer,t,i<0?0:i)})),U(pi.prototype,"toReversed",(function(){var e,r,t,n,i,o;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=new this.constructor(t),n=this._buffer,e=r._buffer,i=0;i<t;i++)o=t-i-1,e[2*i]=n[2*o],e[2*i+1]=n[2*o+1];return r})),U(pi.prototype,"toString",(function(){var e,r,t;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t<this._length;t++)e.push(mi(r,t).toString());return e.join(",")})),U(pi.prototype,"with",(function(e,r){var t,n,i;if(!hi(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Un(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(t=(n=new this.constructor(this._buffer))._buffer)[2*e]=ai(r),t[2*e+1]=ui(r),n}));var gi=[mr,un,wn,cn,_n,ir,Ln,Ke,jn,ii,pi],yi=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128"],wi=yi.length;function vi(e){var r;if(Ie(e))return"generic";if(Ce(e))return null;for(r=0;r<wi;r++)if(e instanceof gi[r])return yi[r];return rn[Ne(e)]||null}function di(e){var r,t,n;if(!rt(e))throw new TypeError(S("invalid argument. Must provide an array-like object. Value: `%s`.",e));return n=vi(e),qt(e)&&(r=Kt(n)),t=e.length,void 0===r?function(r){var n;for(n=0;n<t;n++)if(e[n]===r)return!0;return!1}:function(n){var i;for(i=0;i<t;i++)if(r(e,i)===n)return!0;return!1}}U((function(e,r){var t,n,i,o;for(i=vi(e),n=qt(e)?Kt(i):en(i),t=e.length,o=0;o<t;o++)if(n(e,o)===r)return!0;return!1}),"factory",di);var bi=di(Ar());function Ei(e){var r;if("object"!=typeof e||null===e)throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));if(r=e.dtype,bi(r))return r;throw new TypeError(S("invalid argument. Must provide an ndarray having a supported data type. Value: `%s`.",r))}function _i(e){var r,t,n,i;if("object"!=typeof e||null===e)throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));if(!rt(t=e.shape))throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));for(r=[],i=0;i<t.length;i++){if(!Ut(n=t[i]))throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));r.push(n)}return r}var Ti=ct(),xi=Ti.length;function Vi(e){var r;for(r=0;r<xi;r++)if(e===Ti[r])return!0;return!1}var Ai="row-major",ji="column-major";function Fi(e){var r,t;if("object"!=typeof e||null===e)throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));return Vi(t=e.order)?t:(r=function(e){var r,t,n,i,o,a;if("object"!=typeof e||null===e)throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));if(!rt(i=e.strides)){if(!rt(n=e.shape))throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));return 0===n.length?[0]:(Vi(t=e.order)||(t="row-major"),zt(n,t))}for(r=[],a=0;a<i.length;a++){if(!Dr(o=i[a]))throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));r.push(o)}return r}(e),1===(t=ye(r))||3===t?Ai:2===t?ji:0===function(e){var r,t;if("object"!=typeof e||null===e)throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));if(Ut(t=e.ndims))return t;if(!rt(r=e.shape))throw new TypeError(S("invalid argument. Must provide an ndarray. Value: `%s`.",e));return r.length}(e)?Ai:null)}var Oi=Dt($r.isPrimitive),Si=Dt($r.isObject),Ri=Dt($r);function Li(){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"},order:"row-major",casting:"safe",index_mode:"throw"}}U(Ri,"primitives",Oi),U(Ri,"objects",Si);var ki={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"},order:"row-major",casting:"safe",index_mode:"throw"},Ii={"dtypes.default":ki.dtypes.default,"dtypes.numeric":ki.dtypes.numeric,"dtypes.real":ki.dtypes.real,"dtypes.floating_point":ki.dtypes.floating_point,"dtypes.real_floating_point":ki.dtypes.real_floating_point,"dtypes.complex_floating_point":ki.dtypes.complex_floating_point,"dtypes.integer":ki.dtypes.integer,"dtypes.signed_integer":ki.dtypes.signed_integer,"dtypes.unsigned_integer":ki.dtypes.unsigned_integer,"dtypes.boolean":ki.dtypes.boolean,order:ki.order,casting:ki.casting,index_mode:ki.index_mode};function Bi(e){var r=typeof e;return null===e||"object"!==r&&"function"!==r?new TypeError(S("invalid argument. A provided constructor must be either an object (except null) or a function. Value: `%s`.",e)):null}U(Li,"get",(function(e){var r=Ii[e];return void 0===r?null:r}));var Mi=Object.create;function Ci(){}var Ni="function"==typeof Mi?Mi:function(e){return Ci.prototype=e,new Ci};function Ui(e,r){return e<0?0:e>r?r:e}function Pi(e,r){var t=r+1;return e<0?((e+=t)<0&&0!==(e%=t)&&(e+=t),e):e>r?((e-=t)>r&&(e%=t),e):e}function Yi(e,r){return e<0?(e+=r+1)<0?-1:e:e>r?-1:e}var Wi=di(vt()),Di={wrap:Pi,clamp:Ui,normalize:function(e,r){var t=Yi(e,r);if(t<0||t>r)throw new RangeError(S("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",r,e));return t},throw:function(e,r){if(e<0||e>r)throw new RangeError(S("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",r,e));return e}};function Gi(e,r,t){var n;if("clamp"===t)return Ui(e,r);if("wrap"===t)return Pi(e,r);if(n=e,"normalize"===t&&(n=Yi(n,r)),n<0||n>r)throw new RangeError(S("invalid argument. Index must resolve to a value on the interval: [0, %d]. Value: `%d`.",r,e));return n}U(Gi,"factory",(function(e){if(!Wi(e))throw new TypeError(S("invalid argument. First argument must be a recognized index mode. Value: `%s`.",e));return Di[e]}));var $i=Rt.prototype.iget;var Ji=Rt.prototype.iset;function zi(e,r){var t,n;for(t=[],n=0;n<r;n++)t.push(e[n]);return t}var Zi=32767,Xi=Li.get("index_mode"),qi=!1;function Hi(e,r,t,n,i,o,a){var u,s,f,l,h;if(!(this instanceof Hi))return arguments.length<7?new Hi(e,r,t,n,i,o):new Hi(e,r,t,n,i,o,a);if(!bi(e))throw new TypeError(S("invalid argument. First argument must be a supported ndarray data type. Value: `%s`.",e));if(!rt(r))throw new TypeError(S("invalid argument. Second argument must be an array-like object, typed-array-like, or a Buffer. Value: `%s`.",r));if(r.get&&r.set&&(!Pe(r.get)||!Pe(r.set)))throw new TypeError(S("invalid argument. Second argument `get` and `set` properties must be functions. Value: `%s`.",r));if(!Gt(t)&&(!rt(t)||t.length>0))throw new TypeError(S("invalid argument. Third argument must be an array-like object containing nonnegative integers. Value: `%s`.",t));if((u=t.length)>Zi)throw new RangeError(S("invalid argument. Number of dimensions must not exceed %u due to stack limits. Value: `%u`.",Zi,u));if(!Oi(n))throw new TypeError(S("invalid argument. Fourth argument must be an array-like object containing integers. Value: `%s`.",n));if(u>0){if(n.length!==u)throw new RangeError(S("invalid argument. Fourth argument length must match the number of dimensions. Expected number of dimensions: `%u`. Strides length: `%u`.",u,n.length))}else{if(1!==n.length)throw new RangeError("invalid argument. Fourth argument length must be equal to 1 when creating a zero-dimensional ndarray.");if(0!==n[0])throw new RangeError(S("invalid argument. Fourth argument must contain a single element equal to 0. Value: `%d`.",n[0]))}if(!Ut(i))throw new TypeError(S("invalid argument. Fifth argument must be a nonnegative integer. Value: `%s`.",i));if(!Vi(o))throw new TypeError(S("invalid argument. Sixth argument must be a supported order. Value: `%s`.",o));if(u>0&&!function(e,r,t,n){var i=de(r,t,n);return i[0]>=0&&i[1]<e}(r.length,t,n,i)&&Zt(t)>0)throw new Error("invalid arguments. Input buffer is incompatible with the specified meta data. Ensure that the offset is valid with regard to the strides array and that the buffer has enough elements to satisfy the desired array shape.");if((s={}).mode=Xi,s.readonly=qi,arguments.length>6&&(f=function(e,r){var t;if(!Nt(r))return new TypeError(S("invalid argument. Options argument must be an object. Value: `%s`.",r));if($(r,"mode")&&(e.mode=r.mode,!Wi(e.mode)))return new TypeError(S("invalid option. `%s` option must be a recognized mode. Option: `%s`.","mode",e.mode));if($(r,"submode")){if(e.submode=r.submode,!Ie(e.submode))return new TypeError(S("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",e.submode));if(0===e.submode.length)return new TypeError(S("invalid option. `%s` option must be an array containing recognized modes. Option: `%s`.","submode",e.submode.join(",")));for(t=0;t<e.submode.length;t++)if(!Wi(e.submode[t]))return new TypeError(S("invalid option. Each submode must be a recognized mode. Option: `%s`.",e.submode[t]));e.submode=e.submode.slice()}return $(r,"readonly")&&(e.readonly=r.readonly,!ee(e.readonly))?new TypeError(S("invalid option. `%s` option must be a boolean. Option: `%s`.","readonly",e.readonly)):null}(s,a),f))throw f;return this._mode=s.mode,void 0===s.submode&&(s.submode=[this._mode]),this._submode=s.submode,l=zi(t,u),h=zi(n,u||1),Rt.call(this,e,r,l,h,i,o),this._flags.READONLY=s.readonly,this}!function(e,r){var t=Bi(e);if(t)throw t;if(t=Bi(r))throw t;if(void 0===r.prototype)throw new TypeError(S("invalid argument. Second argument must have a prototype from which another object can inherit. Value: `%s`.",r.prototype));e.prototype=Ni(r.prototype),N(e.prototype,"constructor",{configurable:!0,enumerable:!1,writable:!0,value:e})}(Hi,Rt),U(Hi,"name","ndarray"),U(Hi.prototype,"get",(function(){var e,r,t,n;if(arguments.length!==this._ndims)throw new RangeError(S("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(e=this._offset,t=this._submode.length,n=0;n<arguments.length;n++){if(!Dr(arguments[n]))throw new TypeError(S("invalid argument. Indices must be integer valued. Argument: `%u`. Value: `%s`.",n,arguments[n]));r=Gi(arguments[n],this._shape[n]-1,this._submode[n%t]),e+=this._strides[n]*r}return this._accessors?this._buffer.get(e):this._buffer[e]})),U(Hi.prototype,"iget",(function(e){if(this._ndims>0){if(!Dr(e))throw new TypeError(S("invalid argument. Index must be an integer. Value: `%s`.",e));return e=Gi(e,this._length-1,this._mode),$i.call(this,e)}return $i.call(this)})),U(Hi.prototype,"set",(function(){var e,r,t,n;if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(arguments.length!==this._ndims+1)throw new RangeError(S("invalid arguments. Number of indices must match the number of dimensions. ndims: `%u`. nargs: `%u`.",this._ndims,arguments.length));for(e=this._offset,t=this._submode.length,n=0;n<arguments.length-1;n++){if(!Dr(arguments[n]))throw new TypeError(S("invalid argument. Indices must be integer valued. Argument: `%i`. Value: `%s`.",n,arguments[n]));r=Gi(arguments[n],this._shape[n]-1,this._submode[n%t]),e+=this._strides[n]*r}return this._accessors?this._buffer.set(arguments[n],e):this._buffer[e]=arguments[n],this})),U(Hi.prototype,"iset",(function(e,r){if(this._flags.READONLY)throw new Error("invalid invocation. Cannot write to a read-only array.");if(this._ndims>0){if(!Dr(e))throw new TypeError(S("invalid argument. Index must be an integer. Value: `%s`.",e));e=Gi(e,this._length-1,this._mode),Ji.call(this,e,r)}else Ji.call(this,e);return this}));var Ki="function"==typeof Buffer?Buffer:null;var Qi,eo=e.Buffer;Qi=function(){var e,r;if("function"!=typeof Ki)return!1;try{e=Ce(r="function"==typeof Ki.from?Ki.from([1,2,3,4]):new Ki([1,2,3,4]))&&1===r[0]&&2===r[1]&&3===r[2]&&4===r[3]}catch(r){e=!1}return e}()?eo:function(){throw new Error("not implemented")};var ro=Qi;var to=Pe(ro.allocUnsafe)?function(e){if(!Yt(e))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));return ro.allocUnsafe(e)}:function(e){if(!Yt(e))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));return new ro(e)};function no(e){var r,t,n;for(r=[];!(t=e.next()).done;)if(kn(n=t.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Un(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));r.push(Zn(n),Xn(n))}return r}var io=2*un.BYTES_PER_ELEMENT,oo=$n();function ao(e){return e instanceof fo||"object"==typeof e&&null!==e&&("Complex64Array"===e.constructor.name||"Complex128Array"===e.constructor.name)&&"number"==typeof e._length&&"object"==typeof e._buffer}function uo(e){return e===fo||"Complex128Array"===e.name}function so(e,r){return new zn(e[r*=2],e[r+1])}function fo(){var e,r,t,n;if(r=arguments.length,!(this instanceof fo))return 0===r?new fo:1===r?new fo(arguments[0]):2===r?new fo(arguments[0],arguments[1]):new fo(arguments[0],arguments[1],arguments[2]);if(0===r)t=new un(0);else if(1===r)if(Ut(arguments[0]))t=new un(2*arguments[0]);else if(rt(arguments[0]))if((n=(t=arguments[0]).length)&&Ie(t)&&Un(t[0])){if(t=function(e,r){var t,n,i,o;for(t=r.length,o=0,i=0;i<t;i++){if(!Un(n=r[i]))return null;e[o]=Zn(n),e[o+1]=Xn(n),o+=2}return e}(new un(2*n),t),null===t){if(!Pn(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 un(arguments[0])}}else{if(Wn(t))t=qn(t,0);else if(Gn(t))t=Hn(t,0);else if(!Pn(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 un(t)}else if(sr(arguments[0])){if(!Yr((t=arguments[0]).byteLength/io))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",io,t.byteLength));t=new un(t)}else{if(!Lt(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===oo)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(!Pe(t[Jn]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Pe((t=t[Jn]()).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=no(t))instanceof Error)throw t;t=new un(t)}else{if(!sr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ut(e=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Yr(e/io))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",io,e));if(2===r){if(!Yr((n=t.byteLength-e)/io))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",io,n));t=new un(t,e)}else{if(!Ut(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*io>t.byteLength-e)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*io));t=new un(t,e,2*n)}}return U(this,"_buffer",t),U(this,"_length",t.length/2),this}function lo(e){var r,t,n;for(r=[];!(t=e.next()).done;)if(kn(n=t.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Un(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));r.push(ai(n),ui(n))}return r}U(fo,"BYTES_PER_ELEMENT",io),U(fo,"name","Complex64Array"),U(fo,"from",(function(e){var r,t,n,i,o,a,u,s,f,l,h,c;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!uo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Pe(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(r=arguments[2])}if(ao(e)){if(s=e.length,n){for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,e.get(h),h)))o[c]=Zn(l),o[c+1]=Xn(l);else{if(!(kn(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(e)}if(rt(e)){if(n){for(s=e.length,u=e.get&&e.set?Kt("default"):en("default"),h=0;h<s;h++)if(!Un(u(e,h))){f=!0;break}if(f){if(!Pn(s))throw new RangeError(S("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,s));for(o=(i=new this(s/2))._buffer,h=0;h<s;h++)o[h]=n.call(r,u(e,h),h);return i}for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,u(e,h),h)))o[c]=Zn(l),o[c+1]=Xn(l);else{if(!(kn(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(e)}if(Lt(e)&&oo&&Pe(e[Jn])){if(!Pe((o=e[Jn]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a=n?function(e,r,t){var n,i,o,a;for(n=[],a=-1;!(i=e.next()).done;)if(a+=1,kn(o=r.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Un(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(Zn(o),Xn(o))}return n}(o,n,r):no(o),a instanceof Error)throw a;for(o=(i=new this(s=a.length/2))._buffer,h=0;h<s;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`.",e))})),U(fo,"of",(function(){var e,r;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!uo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);return new this(e)})),U(fo.prototype,"at",(function(e){if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",e));if(e<0&&(e+=this._length),!(e<0||e>=this._length))return so(this._buffer,e)})),ce(fo.prototype,"buffer",(function(){return this._buffer.buffer})),ce(fo.prototype,"byteLength",(function(){return this._buffer.byteLength})),ce(fo.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),U(fo.prototype,"BYTES_PER_ELEMENT",fo.BYTES_PER_ELEMENT),U(fo.prototype,"copyWithin",(function(e,r){if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*e,2*r):this._buffer.copyWithin(2*e,2*r,2*arguments[2]),this})),U(fo.prototype,"entries",(function(){var e,r,t,n,i,o,a;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,n=this._length,o=-1,a=-2,U(t={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new zn(e[a+=2],e[a+1]),{value:[o,r],done:!1}})),U(t,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Jn&&U(t,Jn,(function(){return r.entries()})),t})),U(fo.prototype,"every",(function(e,r){var t,n;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(!e.call(r,so(t,n),n,this))return!1;return!0})),U(fo.prototype,"fill",(function(e,r,t){var n,i,o,a,u,s;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(n=this._buffer,i=this._length,arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!Yr(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 r=0,t=i;for(a=Zn(e),u=Xn(e),s=r;s<t;s++)n[o=2*s]=a,n[o+1]=u;return this})),U(fo.prototype,"filter",(function(e,r){var t,n,i,o;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=so(t,i),e.call(r,o,i,this)&&n.push(o);return new this.constructor(n)})),U(fo.prototype,"find",(function(e,r){var t,n,i;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=so(t,n),e.call(r,i,n,this))return i})),U(fo.prototype,"findIndex",(function(e,r){var t,n,i;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=so(t,n),e.call(r,i,n,this))return n;return-1})),U(fo.prototype,"findLast",(function(e,r){var t,n,i;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=so(t,n),e.call(r,i,n,this))return i})),U(fo.prototype,"findLastIndex",(function(e,r){var t,n,i;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=so(t,n),e.call(r,i,n,this))return n;return-1})),U(fo.prototype,"forEach",(function(e,r){var t,n,i;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)i=so(t,n),e.call(r,i,n,this)})),U(fo.prototype,"get",(function(e){if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(e))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return so(this._buffer,e)})),U(fo.prototype,"includes",(function(e,r){var t,n,i,o,a;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),U(fo.prototype,"indexOf",(function(e,r){var t,n,i,o,a;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(fo.prototype,"join",(function(e){var r,t,n,i;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!_e(e))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",e));n=e}for(r=[],t=this._buffer,i=0;i<this._length;i++)r.push(so(t,i).toString());return r.join(n)})),U(fo.prototype,"lastIndexOf",(function(e,r){var t,n,i,o,a;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),ce(fo.prototype,"length",(function(){return this._length})),U(fo.prototype,"map",(function(e,r){var t,n,i,o,a;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Un(a=e.call(r,so(n,o),o,this)))t[2*o]=Zn(a),t[2*o+1]=Xn(a);else{if(!kn(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})),U(fo.prototype,"reduce",(function(e,r){var t,n,i,o;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,i=this._length,arguments.length>1)n=r,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=so(t,0),o=1}for(;o<i;o++)n=e(n,so(t,o),o,this);return n})),U(fo.prototype,"reverse",(function(){var e,r,t,n,i,o;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=this._buffer,n=Pr(t/2),i=0;i<n;i++)o=t-i-1,r=e[2*i],e[2*i]=e[2*o],e[2*o]=r,r=e[2*i+1],e[2*i+1]=e[2*o+1],e[2*o+1]=r;return this})),U(fo.prototype,"set",(function(e){var r,t,n,i,o,a,u,s,f;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Ut(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Un(e)){if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=Zn(e),void(n[t+1]=Xn(e))}if(ao(e)){if(t+(a=e._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,f=n.byteOffset+t*io,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new un(r.length),s=0;s<r.length;s++)i[s]=r[s];r=i}for(t*=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2}else{if(!rt(e))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`.",e));for(a=e.length,s=0;s<a;s++)if(!Un(e[s])){o=!0;break}if(o){if(!Pn(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(r=e,f=n.byteOffset+t*io,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new un(a),s=0;s<a;s++)i[s]=r[s];r=i}for(t*=2,a/=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,s=0;s<a;s++)u=e[s],n[t]=Zn(u),n[t+1]=Xn(u),t+=2}})),U(fo.prototype,"slice",(function(e,r){var t,n,i,o,a,u,s;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)e=0,r=u;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=u)<0&&(e=0),1===arguments.length)r=u;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=u)<0&&(r=0):r>u&&(r=u)}}for(t=e<r?r-e:0,n=(i=new this.constructor(t))._buffer,s=0;s<t;s++)o=2*(s+e),n[2*s]=a[o],n[2*s+1]=a[o+1];return i})),U(fo.prototype,"some",(function(e,r){var t,n;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(e.call(r,so(t,n),n,this))return!0;return!1})),U(fo.prototype,"subarray",(function(e,r){var t,n,i;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)e=0,r=i;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),1===arguments.length)r=i;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i)<0&&(r=0):r>i&&(r=i)}}return e>=i?(i=0,t=n.byteLength):e>=r?(i=0,t=n.byteOffset+e*io):(i=r-e,t=n.byteOffset+e*io),new this.constructor(n.buffer,t,i<0?0:i)})),U(fo.prototype,"toReversed",(function(){var e,r,t,n,i,o;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=new this.constructor(t),n=this._buffer,e=r._buffer,i=0;i<t;i++)o=t-i-1,e[2*i]=n[2*o],e[2*i+1]=n[2*o+1];return r})),U(fo.prototype,"toString",(function(){var e,r,t;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t<this._length;t++)e.push(so(r,t).toString());return e.join(",")})),U(fo.prototype,"with",(function(e,r){var t,n,i;if(!ao(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Un(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(t=(n=new this.constructor(this._buffer))._buffer)[2*e]=Zn(r),t[2*e+1]=Xn(r),n}));var ho=2*mr.BYTES_PER_ELEMENT,co=$n();function mo(e){return e instanceof yo||"object"==typeof e&&null!==e&&("Complex64Array"===e.constructor.name||"Complex128Array"===e.constructor.name)&&"number"==typeof e._length&&"object"==typeof e._buffer}function po(e){return e===yo||"Complex64Array"===e.name}function go(e,r){return new oi(e[r*=2],e[r+1])}function yo(){var e,r,t,n;if(r=arguments.length,!(this instanceof yo))return 0===r?new yo:1===r?new yo(arguments[0]):2===r?new yo(arguments[0],arguments[1]):new yo(arguments[0],arguments[1],arguments[2]);if(0===r)t=new mr(0);else if(1===r)if(Ut(arguments[0]))t=new mr(2*arguments[0]);else if(rt(arguments[0]))if((n=(t=arguments[0]).length)&&Ie(t)&&Un(t[0])){if(t=function(e,r){var t,n,i,o;for(t=r.length,o=0,i=0;i<t;i++){if(!Un(n=r[i]))return null;e[o]=ai(n),e[o+1]=ui(n),o+=2}return e}(new mr(2*n),t),null===t){if(!Pn(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 mr(arguments[0])}}else{if(Wn(t))t=qn(t,0);else if(Gn(t))t=Hn(t,0);else if(!Pn(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 mr(t)}else if(sr(arguments[0])){if(!Yr((t=arguments[0]).byteLength/ho))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",ho,t.byteLength));t=new mr(t)}else{if(!Lt(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===co)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(!Pe(t[Jn]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Pe((t=t[Jn]()).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=lo(t))instanceof Error)throw t;t=new mr(t)}else{if(!sr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ut(e=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Yr(e/ho))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",ho,e));if(2===r){if(!Yr((n=t.byteLength-e)/ho))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",ho,n));t=new mr(t,e)}else{if(!Ut(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*ho>t.byteLength-e)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*ho));t=new mr(t,e,2*n)}}return U(this,"_buffer",t),U(this,"_length",t.length/2),this}U(yo,"BYTES_PER_ELEMENT",ho),U(yo,"name","Complex128Array"),U(yo,"from",(function(e){var r,t,n,i,o,a,u,s,f,l,h,c;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!po(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Pe(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(r=arguments[2])}if(mo(e)){if(s=e.length,n){for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,e.get(h),h)))o[c]=ai(l),o[c+1]=ui(l);else{if(!(kn(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(e)}if(rt(e)){if(n){for(s=e.length,u=e.get&&e.set?Kt("default"):en("default"),h=0;h<s;h++)if(!Un(u(e,h))){f=!0;break}if(f){if(!Pn(s))throw new RangeError(S("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",s));for(o=(i=new this(s/2))._buffer,h=0;h<s;h++)o[h]=n.call(r,u(e,h),h);return i}for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,u(e,h),h)))o[c]=ai(l),o[c+1]=ui(l);else{if(!(kn(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(e)}if(Lt(e)&&co&&Pe(e[Jn])){if(!Pe((o=e[Jn]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a=n?function(e,r,t){var n,i,o,a;for(n=[],a=-1;!(i=e.next()).done;)if(a+=1,kn(o=r.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Un(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(ai(o),ui(o))}return n}(o,n,r):lo(o),a instanceof Error)throw a;for(o=(i=new this(s=a.length/2))._buffer,h=0;h<s;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`.",e))})),U(yo,"of",(function(){var e,r;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!po(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);return new this(e)})),U(yo.prototype,"at",(function(e){if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",e));if(e<0&&(e+=this._length),!(e<0||e>=this._length))return go(this._buffer,e)})),ce(yo.prototype,"buffer",(function(){return this._buffer.buffer})),ce(yo.prototype,"byteLength",(function(){return this._buffer.byteLength})),ce(yo.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),U(yo.prototype,"BYTES_PER_ELEMENT",yo.BYTES_PER_ELEMENT),U(yo.prototype,"copyWithin",(function(e,r){if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*e,2*r):this._buffer.copyWithin(2*e,2*r,2*arguments[2]),this})),U(yo.prototype,"entries",(function(){var e,r,t,n,i,o,a;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,n=this._length,o=-1,a=-2,U(t={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new oi(e[a+=2],e[a+1]),{value:[o,r],done:!1}})),U(t,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Jn&&U(t,Jn,(function(){return r.entries()})),t})),U(yo.prototype,"every",(function(e,r){var t,n;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(!e.call(r,go(t,n),n,this))return!1;return!0})),U(yo.prototype,"fill",(function(e,r,t){var n,i,o,a,u,s;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(n=this._buffer,i=this._length,arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!Yr(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 r=0,t=i;for(a=ai(e),u=ui(e),s=r;s<t;s++)n[o=2*s]=a,n[o+1]=u;return this})),U(yo.prototype,"filter",(function(e,r){var t,n,i,o;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=go(t,i),e.call(r,o,i,this)&&n.push(o);return new this.constructor(n)})),U(yo.prototype,"find",(function(e,r){var t,n,i;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=go(t,n),e.call(r,i,n,this))return i})),U(yo.prototype,"findIndex",(function(e,r){var t,n,i;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=go(t,n),e.call(r,i,n,this))return n;return-1})),U(yo.prototype,"findLast",(function(e,r){var t,n,i;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=go(t,n),e.call(r,i,n,this))return i})),U(yo.prototype,"findLastIndex",(function(e,r){var t,n,i;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=go(t,n),e.call(r,i,n,this))return n;return-1})),U(yo.prototype,"forEach",(function(e,r){var t,n,i;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)i=go(t,n),e.call(r,i,n,this)})),U(yo.prototype,"get",(function(e){if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(e))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return go(this._buffer,e)})),ce(yo.prototype,"length",(function(){return this._length})),U(yo.prototype,"includes",(function(e,r){var t,n,i,o,a;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),U(yo.prototype,"indexOf",(function(e,r){var t,n,i,o,a;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(yo.prototype,"join",(function(e){var r,t,n,i;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Ae(e))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",e));n=e}for(r=[],t=this._buffer,i=0;i<this._length;i++)r.push(go(t,i).toString());return r.join(n)})),U(yo.prototype,"lastIndexOf",(function(e,r){var t,n,i,o,a;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(yo.prototype,"map",(function(e,r){var t,n,i,o,a;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Un(a=e.call(r,go(n,o),o,this)))t[2*o]=ai(a),t[2*o+1]=ui(a);else{if(!kn(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})),U(yo.prototype,"reduce",(function(e,r){var t,n,i,o;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,i=this._length,arguments.length>1)n=r,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=go(t,0),o=1}for(;o<i;o++)n=e(n,go(t,o),o,this);return n})),U(yo.prototype,"reverse",(function(){var e,r,t,n,i,o;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=this._buffer,n=Pr(t/2),i=0;i<n;i++)o=t-i-1,r=e[2*i],e[2*i]=e[2*o],e[2*o]=r,r=e[2*i+1],e[2*i+1]=e[2*o+1],e[2*o+1]=r;return this})),U(yo.prototype,"set",(function(e){var r,t,n,i,o,a,u,s,f;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Ut(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Un(e)){if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=ai(e),void(n[t+1]=ui(e))}if(mo(e)){if(t+(a=e._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,f=n.byteOffset+t*ho,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new mr(r.length),s=0;s<r.length;s++)i[s]=r[s];r=i}for(t*=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2}else{if(!rt(e))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`.",e));for(a=e.length,s=0;s<a;s++)if(!Un(e[s])){o=!0;break}if(o){if(!Pn(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(r=e,f=n.byteOffset+t*ho,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new mr(a),s=0;s<a;s++)i[s]=r[s];r=i}for(t*=2,a/=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,s=0;s<a;s++)u=e[s],n[t]=ai(u),n[t+1]=ui(u),t+=2}})),U(yo.prototype,"slice",(function(e,r){var t,n,i,o,a,u,s;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)e=0,r=u;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=u)<0&&(e=0),1===arguments.length)r=u;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=u)<0&&(r=0):r>u&&(r=u)}}for(t=e<r?r-e:0,n=(i=new this.constructor(t))._buffer,s=0;s<t;s++)o=2*(s+e),n[2*s]=a[o],n[2*s+1]=a[o+1];return i})),U(yo.prototype,"some",(function(e,r){var t,n;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(e.call(r,go(t,n),n,this))return!0;return!1})),U(yo.prototype,"subarray",(function(e,r){var t,n,i;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)e=0,r=i;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),1===arguments.length)r=i;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i)<0&&(r=0):r>i&&(r=i)}}return e>=i?(i=0,t=n.byteLength):e>=r?(i=0,t=n.byteOffset+e*ho):(i=r-e,t=n.byteOffset+e*ho),new this.constructor(n.buffer,t,i<0?0:i)})),U(yo.prototype,"toReversed",(function(){var e,r,t,n,i,o;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=new this.constructor(t),n=this._buffer,e=r._buffer,i=0;i<t;i++)o=t-i-1,e[2*i]=n[2*o],e[2*i+1]=n[2*o+1];return r})),U(yo.prototype,"toString",(function(){var e,r,t;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t<this._length;t++)e.push(go(r,t).toString());return e.join(",")})),U(yo.prototype,"with",(function(e,r){var t,n,i;if(!mo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Un(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(t=(n=new this.constructor(this._buffer))._buffer)[2*e]=ai(r),t[2*e+1]=ui(r),n}));var wo={float64:mr,float32:un,int16:_n,int32:wn,int8:Ln,uint16:ir,uint32:cn,uint8:Ke,uint8c:jn,complex64:fo,complex128:yo};function vo(e){return function(e,r){var t,n;for(t=[],n=0;n<r;n++)t.push(e);return t}(0,e)}function bo(){return{dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",boolean:"bool",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32"}}}var Eo={dtypes:{default:"float64",numeric:"float64",real:"float64",floating_point:"float64",real_floating_point:"float64",complex_floating_point:"complex128",boolean:"bool",integer:"int32",signed_integer:"int32",unsigned_integer:"uint32"}},_o={"dtypes.default":Eo.dtypes.default,"dtypes.numeric":Eo.dtypes.numeric,"dtypes.real":Eo.dtypes.real,"dtypes.floating_point":Eo.dtypes.floating_point,"dtypes.real_floating_point":Eo.dtypes.real_floating_point,"dtypes.complex_floating_point":Eo.dtypes.complex_floating_point,"dtypes.boolean":Eo.dtypes.boolean,"dtypes.integer":Eo.dtypes.integer,"dtypes.signed_integer":Eo.dtypes.signed_integer,"dtypes.unsigned_integer":Eo.dtypes.unsigned_integer};U(bo,"get",(function(e){var r=_o[e];return void 0===r?null:r}));var To=bo.get("dtypes.default");function xo(e){var r,t,n;for(r=[];!(t=e.next()).done;)if(kn(n=t.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Un(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));r.push(Zn(n),Xn(n))}return r}var Vo=2*un.BYTES_PER_ELEMENT,Ao=$n();function jo(e){return e instanceof So||"object"==typeof e&&null!==e&&("Complex64Array"===e.constructor.name||"Complex128Array"===e.constructor.name)&&"number"==typeof e._length&&"object"==typeof e._buffer}function Fo(e){return e===So||"Complex128Array"===e.name}function Oo(e,r){return new zn(e[r*=2],e[r+1])}function So(){var e,r,t,n;if(r=arguments.length,!(this instanceof So))return 0===r?new So:1===r?new So(arguments[0]):2===r?new So(arguments[0],arguments[1]):new So(arguments[0],arguments[1],arguments[2]);if(0===r)t=new un(0);else if(1===r)if(Ut(arguments[0]))t=new un(2*arguments[0]);else if(rt(arguments[0]))if((n=(t=arguments[0]).length)&&Ie(t)&&Un(t[0])){if(t=function(e,r){var t,n,i,o;for(t=r.length,o=0,i=0;i<t;i++){if(!Un(n=r[i]))return null;e[o]=Zn(n),e[o+1]=Xn(n),o+=2}return e}(new un(2*n),t),null===t){if(!Pn(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 un(arguments[0])}}else{if(Wn(t))t=qn(t,0);else if(Gn(t))t=Hn(t,0);else if(!Pn(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 un(t)}else if(sr(arguments[0])){if(!Yr((t=arguments[0]).byteLength/Vo))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",Vo,t.byteLength));t=new un(t)}else{if(!Lt(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===Ao)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(!Pe(t[Jn]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Pe((t=t[Jn]()).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=xo(t))instanceof Error)throw t;t=new un(t)}else{if(!sr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ut(e=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Yr(e/Vo))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",Vo,e));if(2===r){if(!Yr((n=t.byteLength-e)/Vo))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",Vo,n));t=new un(t,e)}else{if(!Ut(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*Vo>t.byteLength-e)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Vo));t=new un(t,e,2*n)}}return U(this,"_buffer",t),U(this,"_length",t.length/2),this}function Ro(e){var r,t,n;for(r=[];!(t=e.next()).done;)if(kn(n=t.value)&&n.length>=2)r.push(n[0],n[1]);else{if(!Un(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));r.push(ai(n),ui(n))}return r}U(So,"BYTES_PER_ELEMENT",Vo),U(So,"name","Complex64Array"),U(So,"from",(function(e){var r,t,n,i,o,a,u,s,f,l,h,c;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Pe(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(r=arguments[2])}if(jo(e)){if(s=e.length,n){for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,e.get(h),h)))o[c]=Zn(l),o[c+1]=Xn(l);else{if(!(kn(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(e)}if(rt(e)){if(n){for(s=e.length,u=e.get&&e.set?Kt("default"):en("default"),h=0;h<s;h++)if(!Un(u(e,h))){f=!0;break}if(f){if(!Pn(s))throw new RangeError(S("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,s));for(o=(i=new this(s/2))._buffer,h=0;h<s;h++)o[h]=n.call(r,u(e,h),h);return i}for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,u(e,h),h)))o[c]=Zn(l),o[c+1]=Xn(l);else{if(!(kn(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(e)}if(Lt(e)&&Ao&&Pe(e[Jn])){if(!Pe((o=e[Jn]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a=n?function(e,r,t){var n,i,o,a;for(n=[],a=-1;!(i=e.next()).done;)if(a+=1,kn(o=r.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Un(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(Zn(o),Xn(o))}return n}(o,n,r):xo(o),a instanceof Error)throw a;for(o=(i=new this(s=a.length/2))._buffer,h=0;h<s;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`.",e))})),U(So,"of",(function(){var e,r;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Fo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);return new this(e)})),U(So.prototype,"at",(function(e){if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",e));if(e<0&&(e+=this._length),!(e<0||e>=this._length))return Oo(this._buffer,e)})),ce(So.prototype,"buffer",(function(){return this._buffer.buffer})),ce(So.prototype,"byteLength",(function(){return this._buffer.byteLength})),ce(So.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),U(So.prototype,"BYTES_PER_ELEMENT",So.BYTES_PER_ELEMENT),U(So.prototype,"copyWithin",(function(e,r){if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*e,2*r):this._buffer.copyWithin(2*e,2*r,2*arguments[2]),this})),U(So.prototype,"entries",(function(){var e,r,t,n,i,o,a;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,n=this._length,o=-1,a=-2,U(t={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new zn(e[a+=2],e[a+1]),{value:[o,r],done:!1}})),U(t,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Jn&&U(t,Jn,(function(){return r.entries()})),t})),U(So.prototype,"every",(function(e,r){var t,n;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(!e.call(r,Oo(t,n),n,this))return!1;return!0})),U(So.prototype,"fill",(function(e,r,t){var n,i,o,a,u,s;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(n=this._buffer,i=this._length,arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!Yr(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 r=0,t=i;for(a=Zn(e),u=Xn(e),s=r;s<t;s++)n[o=2*s]=a,n[o+1]=u;return this})),U(So.prototype,"filter",(function(e,r){var t,n,i,o;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=Oo(t,i),e.call(r,o,i,this)&&n.push(o);return new this.constructor(n)})),U(So.prototype,"find",(function(e,r){var t,n,i;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=Oo(t,n),e.call(r,i,n,this))return i})),U(So.prototype,"findIndex",(function(e,r){var t,n,i;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=Oo(t,n),e.call(r,i,n,this))return n;return-1})),U(So.prototype,"findLast",(function(e,r){var t,n,i;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=Oo(t,n),e.call(r,i,n,this))return i})),U(So.prototype,"findLastIndex",(function(e,r){var t,n,i;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=Oo(t,n),e.call(r,i,n,this))return n;return-1})),U(So.prototype,"forEach",(function(e,r){var t,n,i;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)i=Oo(t,n),e.call(r,i,n,this)})),U(So.prototype,"get",(function(e){if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(e))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return Oo(this._buffer,e)})),U(So.prototype,"includes",(function(e,r){var t,n,i,o,a;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),U(So.prototype,"indexOf",(function(e,r){var t,n,i,o,a;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(So.prototype,"join",(function(e){var r,t,n,i;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!_e(e))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",e));n=e}for(r=[],t=this._buffer,i=0;i<this._length;i++)r.push(Oo(t,i).toString());return r.join(n)})),U(So.prototype,"lastIndexOf",(function(e,r){var t,n,i,o,a;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=Zn(e),o=Xn(e),t=this._buffer,a=r;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),ce(So.prototype,"length",(function(){return this._length})),U(So.prototype,"map",(function(e,r){var t,n,i,o,a;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Un(a=e.call(r,Oo(n,o),o,this)))t[2*o]=Zn(a),t[2*o+1]=Xn(a);else{if(!kn(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})),U(So.prototype,"reduce",(function(e,r){var t,n,i,o;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,i=this._length,arguments.length>1)n=r,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=Oo(t,0),o=1}for(;o<i;o++)n=e(n,Oo(t,o),o,this);return n})),U(So.prototype,"reverse",(function(){var e,r,t,n,i,o;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=this._buffer,n=Pr(t/2),i=0;i<n;i++)o=t-i-1,r=e[2*i],e[2*i]=e[2*o],e[2*o]=r,r=e[2*i+1],e[2*i+1]=e[2*o+1],e[2*o+1]=r;return this})),U(So.prototype,"set",(function(e){var r,t,n,i,o,a,u,s,f;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Ut(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Un(e)){if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=Zn(e),void(n[t+1]=Xn(e))}if(jo(e)){if(t+(a=e._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,f=n.byteOffset+t*Vo,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new un(r.length),s=0;s<r.length;s++)i[s]=r[s];r=i}for(t*=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2}else{if(!rt(e))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`.",e));for(a=e.length,s=0;s<a;s++)if(!Un(e[s])){o=!0;break}if(o){if(!Pn(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(r=e,f=n.byteOffset+t*Vo,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new un(a),s=0;s<a;s++)i[s]=r[s];r=i}for(t*=2,a/=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,s=0;s<a;s++)u=e[s],n[t]=Zn(u),n[t+1]=Xn(u),t+=2}})),U(So.prototype,"slice",(function(e,r){var t,n,i,o,a,u,s;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)e=0,r=u;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=u)<0&&(e=0),1===arguments.length)r=u;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=u)<0&&(r=0):r>u&&(r=u)}}for(t=e<r?r-e:0,n=(i=new this.constructor(t))._buffer,s=0;s<t;s++)o=2*(s+e),n[2*s]=a[o],n[2*s+1]=a[o+1];return i})),U(So.prototype,"some",(function(e,r){var t,n;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(e.call(r,Oo(t,n),n,this))return!0;return!1})),U(So.prototype,"subarray",(function(e,r){var t,n,i;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)e=0,r=i;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),1===arguments.length)r=i;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i)<0&&(r=0):r>i&&(r=i)}}return e>=i?(i=0,t=n.byteLength):e>=r?(i=0,t=n.byteOffset+e*Vo):(i=r-e,t=n.byteOffset+e*Vo),new this.constructor(n.buffer,t,i<0?0:i)})),U(So.prototype,"toReversed",(function(){var e,r,t,n,i,o;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=new this.constructor(t),n=this._buffer,e=r._buffer,i=0;i<t;i++)o=t-i-1,e[2*i]=n[2*o],e[2*i+1]=n[2*o+1];return r})),U(So.prototype,"toString",(function(){var e,r,t;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t<this._length;t++)e.push(Oo(r,t).toString());return e.join(",")})),U(So.prototype,"with",(function(e,r){var t,n,i;if(!jo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Un(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(t=(n=new this.constructor(this._buffer))._buffer)[2*e]=Zn(r),t[2*e+1]=Xn(r),n}));var Lo=2*mr.BYTES_PER_ELEMENT,ko=$n();function Io(e){return e instanceof Co||"object"==typeof e&&null!==e&&("Complex64Array"===e.constructor.name||"Complex128Array"===e.constructor.name)&&"number"==typeof e._length&&"object"==typeof e._buffer}function Bo(e){return e===Co||"Complex64Array"===e.name}function Mo(e,r){return new oi(e[r*=2],e[r+1])}function Co(){var e,r,t,n;if(r=arguments.length,!(this instanceof Co))return 0===r?new Co:1===r?new Co(arguments[0]):2===r?new Co(arguments[0],arguments[1]):new Co(arguments[0],arguments[1],arguments[2]);if(0===r)t=new mr(0);else if(1===r)if(Ut(arguments[0]))t=new mr(2*arguments[0]);else if(rt(arguments[0]))if((n=(t=arguments[0]).length)&&Ie(t)&&Un(t[0])){if(t=function(e,r){var t,n,i,o;for(t=r.length,o=0,i=0;i<t;i++){if(!Un(n=r[i]))return null;e[o]=ai(n),e[o+1]=ui(n),o+=2}return e}(new mr(2*n),t),null===t){if(!Pn(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 mr(arguments[0])}}else{if(Wn(t))t=qn(t,0);else if(Gn(t))t=Hn(t,0);else if(!Pn(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 mr(t)}else if(sr(arguments[0])){if(!Yr((t=arguments[0]).byteLength/Lo))throw new RangeError(S("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",Lo,t.byteLength));t=new mr(t)}else{if(!Lt(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===ko)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(!Pe(t[Jn]))throw new TypeError(S("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(!Pe((t=t[Jn]()).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=Ro(t))instanceof Error)throw t;t=new mr(t)}else{if(!sr(t=arguments[0]))throw new TypeError(S("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(!Ut(e=arguments[1]))throw new TypeError(S("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Yr(e/Lo))throw new RangeError(S("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",Lo,e));if(2===r){if(!Yr((n=t.byteLength-e)/Lo))throw new RangeError(S("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",Lo,n));t=new mr(t,e)}else{if(!Ut(n=arguments[2]))throw new TypeError(S("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*Lo>t.byteLength-e)throw new RangeError(S("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Lo));t=new mr(t,e,2*n)}}return U(this,"_buffer",t),U(this,"_length",t.length/2),this}U(Co,"BYTES_PER_ELEMENT",Lo),U(Co,"name","Complex128Array"),U(Co,"from",(function(e){var r,t,n,i,o,a,u,s,f,l,h,c;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Bo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if((t=arguments.length)>1){if(!Pe(n=arguments[1]))throw new TypeError(S("invalid argument. Second argument must be a function. Value: `%s`.",n));t>2&&(r=arguments[2])}if(Io(e)){if(s=e.length,n){for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,e.get(h),h)))o[c]=ai(l),o[c+1]=ui(l);else{if(!(kn(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(e)}if(rt(e)){if(n){for(s=e.length,u=e.get&&e.set?Kt("default"):en("default"),h=0;h<s;h++)if(!Un(u(e,h))){f=!0;break}if(f){if(!Pn(s))throw new RangeError(S("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",s));for(o=(i=new this(s/2))._buffer,h=0;h<s;h++)o[h]=n.call(r,u(e,h),h);return i}for(o=(i=new this(s))._buffer,c=0,h=0;h<s;h++){if(Un(l=n.call(r,u(e,h),h)))o[c]=ai(l),o[c+1]=ui(l);else{if(!(kn(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(e)}if(Lt(e)&&ko&&Pe(e[Jn])){if(!Pe((o=e[Jn]()).next))throw new TypeError(S("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",e));if(a=n?function(e,r,t){var n,i,o,a;for(n=[],a=-1;!(i=e.next()).done;)if(a+=1,kn(o=r.call(t,i.value,a))&&o.length>=2)n.push(o[0],o[1]);else{if(!Un(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(ai(o),ui(o))}return n}(o,n,r):Ro(o),a instanceof Error)throw a;for(o=(i=new this(s=a.length/2))._buffer,h=0;h<s;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`.",e))})),U(Co,"of",(function(){var e,r;if(!Pe(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Bo(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);return new this(e)})),U(Co.prototype,"at",(function(e){if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. Must provide an integer. Value: `%s`.",e));if(e<0&&(e+=this._length),!(e<0||e>=this._length))return Mo(this._buffer,e)})),ce(Co.prototype,"buffer",(function(){return this._buffer.buffer})),ce(Co.prototype,"byteLength",(function(){return this._buffer.byteLength})),ce(Co.prototype,"byteOffset",(function(){return this._buffer.byteOffset})),U(Co.prototype,"BYTES_PER_ELEMENT",Co.BYTES_PER_ELEMENT),U(Co.prototype,"copyWithin",(function(e,r){if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return 2===arguments.length?this._buffer.copyWithin(2*e,2*r):this._buffer.copyWithin(2*e,2*r,2*arguments[2]),this})),U(Co.prototype,"entries",(function(){var e,r,t,n,i,o,a;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,e=this._buffer,n=this._length,o=-1,a=-2,U(t={},"next",(function(){var r;if(o+=1,i||o>=n)return{done:!0};return r=new oi(e[a+=2],e[a+1]),{value:[o,r],done:!1}})),U(t,"return",(function(e){if(i=!0,arguments.length)return{value:e,done:!0};return{done:!0}})),Jn&&U(t,Jn,(function(){return r.entries()})),t})),U(Co.prototype,"every",(function(e,r){var t,n;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(!e.call(r,Mo(t,n),n,this))return!1;return!0})),U(Co.prototype,"fill",(function(e,r,t){var n,i,o,a,u,s;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(n=this._buffer,i=this._length,arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=i)<0&&(r=0),arguments.length>2){if(!Yr(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 r=0,t=i;for(a=ai(e),u=ui(e),s=r;s<t;s++)n[o=2*s]=a,n[o+1]=u;return this})),U(Co.prototype,"filter",(function(e,r){var t,n,i,o;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=[],i=0;i<this._length;i++)o=Mo(t,i),e.call(r,o,i,this)&&n.push(o);return new this.constructor(n)})),U(Co.prototype,"find",(function(e,r){var t,n,i;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=Mo(t,n),e.call(r,i,n,this))return i})),U(Co.prototype,"findIndex",(function(e,r){var t,n,i;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(i=Mo(t,n),e.call(r,i,n,this))return n;return-1})),U(Co.prototype,"findLast",(function(e,r){var t,n,i;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=Mo(t,n),e.call(r,i,n,this))return i})),U(Co.prototype,"findLastIndex",(function(e,r){var t,n,i;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=this._length-1;n>=0;n--)if(i=Mo(t,n),e.call(r,i,n,this))return n;return-1})),U(Co.prototype,"forEach",(function(e,r){var t,n,i;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)i=Mo(t,n),e.call(r,i,n,this)})),U(Co.prototype,"get",(function(e){if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Ut(e))throw new TypeError(S("invalid argument. Must provide a nonnegative integer. Value: `%s`.",e));if(!(e>=this._length))return Mo(this._buffer,e)})),ce(Co.prototype,"length",(function(){return this._length})),U(Co.prototype,"includes",(function(e,r){var t,n,i,o,a;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return!0;return!1})),U(Co.prototype,"indexOf",(function(e,r){var t,n,i,o,a;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0&&(r+=this._length)<0&&(r=0)}else r=0;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a<this._length;a++)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(Co.prototype,"join",(function(e){var r,t,n,i;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(0===arguments.length)n=",";else{if(!Ae(e))throw new TypeError(S("invalid argument. First argument must be a string. Value: `%s`.",e));n=e}for(r=[],t=this._buffer,i=0;i<this._length;i++)r.push(Mo(t,i).toString());return r.join(n)})),U(Co.prototype,"lastIndexOf",(function(e,r){var t,n,i,o,a;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Un(e))throw new TypeError(S("invalid argument. First argument must be a complex number. Value: `%s`.",e));if(arguments.length>1){if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r>=this._length?r=this._length-1:r<0&&(r+=this._length)}else r=this._length-1;for(i=ai(e),o=ui(e),t=this._buffer,a=r;a>=0;a--)if(i===t[n=2*a]&&o===t[n+1])return a;return-1})),U(Co.prototype,"map",(function(e,r){var t,n,i,o,a;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(n=this._buffer,t=(i=new this.constructor(this._length))._buffer,o=0;o<this._length;o++)if(Un(a=e.call(r,Mo(n,o),o,this)))t[2*o]=ai(a),t[2*o+1]=ui(a);else{if(!kn(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})),U(Co.prototype,"reduce",(function(e,r){var t,n,i,o;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));if(t=this._buffer,i=this._length,arguments.length>1)n=r,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=Mo(t,0),o=1}for(;o<i;o++)n=e(n,Mo(t,o),o,this);return n})),U(Co.prototype,"reverse",(function(){var e,r,t,n,i,o;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,e=this._buffer,n=Pr(t/2),i=0;i<n;i++)o=t-i-1,r=e[2*i],e[2*i]=e[2*o],e[2*o]=r,r=e[2*i+1],e[2*i+1]=e[2*o+1],e[2*o+1]=r;return this})),U(Co.prototype,"set",(function(e){var r,t,n,i,o,a,u,s,f;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,arguments.length>1){if(!Ut(t=arguments[1]))throw new TypeError(S("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",t))}else t=0;if(Un(e)){if(t>=this._length)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%u`.",t));return n[t*=2]=ai(e),void(n[t+1]=ui(e))}if(Io(e)){if(t+(a=e._length)>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(r=e._buffer,f=n.byteOffset+t*Lo,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new mr(r.length),s=0;s<r.length;s++)i[s]=r[s];r=i}for(t*=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2}else{if(!rt(e))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`.",e));for(a=e.length,s=0;s<a;s++)if(!Un(e[s])){o=!0;break}if(o){if(!Pn(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(r=e,f=n.byteOffset+t*Lo,r.buffer===n.buffer&&r.byteOffset<f&&r.byteOffset+r.byteLength>f){for(i=new mr(a),s=0;s<a;s++)i[s]=r[s];r=i}for(t*=2,a/=2,f=0,s=0;s<a;s++)n[t]=r[f],n[t+1]=r[f+1],t+=2,f+=2;return}if(t+a>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(t*=2,s=0;s<a;s++)u=e[s],n[t]=ai(u),n[t+1]=ui(u),t+=2}})),U(Co.prototype,"slice",(function(e,r){var t,n,i,o,a,u,s;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(a=this._buffer,u=this._length,0===arguments.length)e=0,r=u;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=u)<0&&(e=0),1===arguments.length)r=u;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=u)<0&&(r=0):r>u&&(r=u)}}for(t=e<r?r-e:0,n=(i=new this.constructor(t))._buffer,s=0;s<t;s++)o=2*(s+e),n[2*s]=a[o],n[2*s+1]=a[o+1];return i})),U(Co.prototype,"some",(function(e,r){var t,n;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Pe(e))throw new TypeError(S("invalid argument. First argument must be a function. Value: `%s`.",e));for(t=this._buffer,n=0;n<this._length;n++)if(e.call(r,Mo(t,n),n,this))return!0;return!1})),U(Co.prototype,"subarray",(function(e,r){var t,n,i;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=this._buffer,i=this._length,0===arguments.length)e=0,r=i;else{if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(e<0&&(e+=i)<0&&(e=0),1===arguments.length)r=i;else{if(!Yr(r))throw new TypeError(S("invalid argument. Second argument must be an integer. Value: `%s`.",r));r<0?(r+=i)<0&&(r=0):r>i&&(r=i)}}return e>=i?(i=0,t=n.byteLength):e>=r?(i=0,t=n.byteOffset+e*Lo):(i=r-e,t=n.byteOffset+e*Lo),new this.constructor(n.buffer,t,i<0?0:i)})),U(Co.prototype,"toReversed",(function(){var e,r,t,n,i,o;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(t=this._length,r=new this.constructor(t),n=this._buffer,e=r._buffer,i=0;i<t;i++)o=t-i-1,e[2*i]=n[2*o],e[2*i+1]=n[2*o+1];return r})),U(Co.prototype,"toString",(function(){var e,r,t;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(e=[],r=this._buffer,t=0;t<this._length;t++)e.push(Mo(r,t).toString());return e.join(",")})),U(Co.prototype,"with",(function(e,r){var t,n,i;if(!Io(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Yr(e))throw new TypeError(S("invalid argument. First argument must be an integer. Value: `%s`.",e));if(i=this._length,e<0&&(e+=i),e<0||e>=i)throw new RangeError(S("invalid argument. Index argument is out-of-bounds. Value: `%s`.",e));if(!Un(r))throw new TypeError(S("invalid argument. Second argument must be a complex number. Value: `%s`.",r));return(t=(n=new this.constructor(this._buffer))._buffer)[2*e]=ai(r),t[2*e+1]=ui(r),n}));var No={float64:mr,float32:un,generic:Array,int16:_n,int32:wn,int8:Ln,uint16:ir,uint32:cn,uint8:Ke,uint8c:jn,complex64:So,complex128:Co};var Uo,Po=bo.get("dtypes.default");function Yo(e){var r,t;if(!Ut(e))throw new TypeError(S("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if("generic"===(r=arguments.length>1?arguments[1]:Po))return vo(e);if(t=function(e){return No[e]||null}(r),null===t)throw new TypeError(S("invalid argument. Second argument must be a recognized data type. Value: `%s`.",r));return new t(e)}Uo=Ze(to(1))?function(e){var r,t,n,i,o,a;if(!Ut(e))throw new TypeError(S("invalid argument. First argument must be a nonnegative integer. Value: `%s`.",e));if("generic"===(n=arguments.length>1?arguments[1]:To))return vo(e);if(null===(r=pe(n)))throw new TypeError(S("invalid argument. Second argument must be a supported data type. Value: `%s`.",n));return i=function(e){return wo[e]||null}(n),a=r*e,"complex128"===n&&(a+=8),t=(o=to(a)).byteOffset,"complex128"===n&&(Ut(t/r)||(t+=8)),new i(o.buffer,t,e)}:function(e){return arguments.length>1?Yo(e,arguments[1]):Yo(e)};var Wo=Uo;function Do(){var e,r=arguments,t="https://stdlib.io/e/"+r[0]+"?";for(e=1;e<r.length;e++)t+="&arg[]="+encodeURIComponent(r[e]);return t}return function(e){var r,t,n,i,o,a,u,s,f;if(!((s=e)instanceof Rt||null!==s&&"object"==typeof s&&"object"==typeof s.data&&"object"==typeof s.shape&&"object"==typeof s.strides&&"number"==typeof s.offset&&"string"==typeof s.order&&"number"==typeof s.ndims&&"string"==typeof s.dtype&&"number"==typeof s.length&&"object"==typeof s.flags&&"function"==typeof s.get&&"function"==typeof s.set))throw new TypeError(Do("1dZ5t",e));if(i={},arguments.length>1){if(!Nt(r=arguments[1]))throw new TypeError(Do("1dZ2V",r));if(t=$(r,"dtype")?r.dtype:Ei(e),$(r,"shape")){if(P(u=r.shape)&&(u=[u]),!Gt(u)&&("object"!=typeof(f=u)||null===f||0!==f.length))throw new TypeError(Do("1dZDs","shape",u))}else u=_i(e);n=$(r,"order")?r.order:Fi(e),$(r,"mode")&&(i.mode=r.mode),$(r,"submode")&&(i.submode=r.submode)}else t=Ei(e),u=_i(e),n=Fi(e);return u.length>0?(o=Zt(u),a=zt(u,n)):(o=1,a=[0]),new Hi(t,"binary"===t?to(o):Wo(o,t),u,a,function(e,r){var t,n,i;for(n=e.length,t=0,i=0;i<n;i++)r[i]<0&&(t-=r[i]*(e[i]-1));return t}(u,a),n,i)}}));
//# sourceMappingURL=index.js.map