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