numpy-ts 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,397 +1,2 @@
1
- var km=Object.create;var dn=Object.defineProperty;var Pm=Object.getOwnPropertyDescriptor;var $m=Object.getOwnPropertyNames;var Gm=Object.getPrototypeOf,Ym=Object.prototype.hasOwnProperty;var c=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Wm=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of $m(r))!Ym.call(e,i)&&i!==t&&dn(e,i,{get:()=>r[i],enumerable:!(n=Pm(r,i))||n.enumerable});return e};var Zm=(e,r,t)=>(t=e!=null?km(Gm(e)):{},Wm(r||!e||!e.__esModule?dn(t,"default",{value:e,enumerable:!0}):t,e));var Hn=c((XT,Jn)=>{"use strict";var gh=typeof Object.defineProperty=="function"?Object.defineProperty:null;Jn.exports=gh});var Qn=c((QT,Xn)=>{"use strict";var vh=Hn();function bh(){try{return vh({},"x",{}),!0}catch{return!1}}Xn.exports=bh});var ri=c((KT,Kn)=>{"use strict";var dh=Object.defineProperty;Kn.exports=dh});var Xe=c((r_,ei)=>{"use strict";function wh(e){return typeof e=="number"}ei.exports=wh});var Qe=c((e_,ni)=>{"use strict";function Ah(e){return e[0]==="-"}function ti(e){var r="",t;for(t=0;t<e;t++)r+="0";return r}function xh(e,r,t){var n=!1,i=r-e.length;return i<0||(Ah(e)&&(n=!0,e=e.substr(1)),e=t?e+ti(i):ti(i)+e,n&&(e="-"+e)),e}ni.exports=xh});var si=c((t_,oi)=>{"use strict";var Eh=Xe(),ii=Qe(),Sh=String.prototype.toLowerCase,ai=String.prototype.toUpperCase;function Th(e){var r,t,n;switch(e.specifier){case"b":r=2;break;case"o":r=8;break;case"x":case"X":r=16;break;case"d":case"i":case"u":default:r=10;break}if(t=e.arg,n=parseInt(t,10),!isFinite(n)){if(!Eh(t))throw new Error("invalid integer. Value: "+t);n=0}return n<0&&(e.specifier==="u"||r!==10)&&(n=4294967295+n+1),n<0?(t=(-n).toString(r),e.precision&&(t=ii(t,e.precision,e.padRight)),t="-"+t):(t=n.toString(r),!n&&!e.precision?t="":e.precision&&(t=ii(t,e.precision,e.padRight)),e.sign&&(t=e.sign+t)),r===16&&(e.alternate&&(t="0x"+t),t=e.specifier===ai.call(e.specifier)?ai.call(t):Sh.call(t)),r===8&&e.alternate&&t.charAt(0)!=="0"&&(t="0"+t),t}oi.exports=Th});var fi=c((n_,ui)=>{"use strict";function _h(e){return typeof e=="string"}ui.exports=_h});var pi=c((i_,ci)=>{"use strict";var qh=Xe(),Ih=Math.abs,Dh=String.prototype.toLowerCase,li=String.prototype.toUpperCase,Dr=String.prototype.replace,Nh=/e\+(\d)$/,Bh=/e-(\d)$/,Oh=/^(\d+)$/,Vh=/^(\d+)e/,Uh=/\.0$/,zh=/\.0*e/,Fh=/(\..*[^0])0*e/;function Rh(e){var r,t,n=parseFloat(e.arg);if(!isFinite(n)){if(!qh(e.arg))throw new Error("invalid floating-point number. Value: "+t);n=e.arg}switch(e.specifier){case"e":case"E":t=n.toExponential(e.precision);break;case"f":case"F":t=n.toFixed(e.precision);break;case"g":case"G":Ih(n)<1e-4?(r=e.precision,r>0&&(r-=1),t=n.toExponential(r)):t=n.toPrecision(e.precision),e.alternate||(t=Dr.call(t,Fh,"$1e"),t=Dr.call(t,zh,"e"),t=Dr.call(t,Uh,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return t=Dr.call(t,Nh,"e+0$1"),t=Dr.call(t,Bh,"e-0$1"),e.alternate&&(t=Dr.call(t,Oh,"$1."),t=Dr.call(t,Vh,"$1.e")),n>=0&&e.sign&&(t=e.sign+t),t=e.specifier===li.call(e.specifier)?li.call(t):Dh.call(t),t}ci.exports=Rh});var hi=c((a_,mi)=>{"use strict";function yi(e){var r="",t;for(t=0;t<e;t++)r+=" ";return r}function Ch(e,r,t){var n=r-e.length;return n<0||(e=t?e+yi(n):yi(n)+e),e}mi.exports=Ch});var vi=c((o_,gi)=>{"use strict";var jh=si(),Lh=fi(),Mh=pi(),kh=hi(),Ph=Qe(),$h=String.fromCharCode,Gh=Array.isArray;function me(e){return e!==e}function Yh(e){var r={};return r.specifier=e.specifier,r.precision=e.precision===void 0?1:e.precision,r.width=e.width,r.flags=e.flags||"",r.mapping=e.mapping,r}function Wh(e){var r,t,n,i,a,s,o,f,u;if(!Gh(e))throw new TypeError("invalid argument. First argument must be an array. Value: `"+e+"`.");for(s="",o=1,f=0;f<e.length;f++)if(n=e[f],Lh(n))s+=n;else{if(r=n.precision!==void 0,n=Yh(n),!n.specifier)throw new TypeError("invalid argument. Token is missing `specifier` property. Index: `"+f+"`. Value: `"+n+"`.");for(n.mapping&&(o=n.mapping),t=n.flags,u=0;u<t.length;u++)switch(i=t.charAt(u),i){case" ":n.sign=" ";break;case"+":n.sign="+";break;case"-":n.padRight=!0,n.padZeros=!1;break;case"0":n.padZeros=t.indexOf("-")<0;break;case"#":n.alternate=!0;break;default:throw new Error("invalid flag: "+i)}if(n.width==="*"){if(n.width=parseInt(arguments[o],10),o+=1,me(n.width))throw new TypeError("the argument for * width at position "+o+" is not a number. Value: `"+n.width+"`.");n.width<0&&(n.padRight=!0,n.width=-n.width)}if(r&&n.precision==="*"){if(n.precision=parseInt(arguments[o],10),o+=1,me(n.precision))throw new TypeError("the argument for * precision at position "+o+" is not a number. Value: `"+n.precision+"`.");n.precision<0&&(n.precision=1,r=!1)}switch(n.arg=arguments[o],n.specifier){case"b":case"o":case"x":case"X":case"d":case"i":case"u":r&&(n.padZeros=!1),n.arg=jh(n);break;case"s":n.maxWidth=r?n.precision:-1,n.arg=String(n.arg);break;case"c":if(!me(n.arg)){if(a=parseInt(n.arg,10),a<0||a>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=me(a)?String(n.arg):$h(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":r||(n.precision=6),n.arg=Mh(n);break;default:throw new Error("invalid specifier: "+n.specifier)}n.maxWidth>=0&&n.arg.length>n.maxWidth&&(n.arg=n.arg.substring(0,n.maxWidth)),n.padZeros?n.arg=Ph(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=kh(n.arg,n.width,n.padRight)),s+=n.arg||"",o+=1}return s}gi.exports=Wh});var di=c((s_,bi)=>{"use strict";var Zh=vi();bi.exports=Zh});var Ai=c((u_,wi)=>{"use strict";var he=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function Jh(e){var r={mapping:e[1]?parseInt(e[1],10):void 0,flags:e[2],width:e[3],precision:e[5],specifier:e[6]};return e[4]==="."&&e[5]===void 0&&(r.precision="1"),r}function Hh(e){var r,t,n,i;for(t=[],i=0,n=he.exec(e);n;)r=e.slice(i,he.lastIndex-n[0].length),r.length&&t.push(r),t.push(Jh(n)),i=he.lastIndex,n=he.exec(e);return r=e.slice(i),r.length&&t.push(r),t}wi.exports=Hh});var Ei=c((f_,xi)=>{"use strict";var Xh=Ai();xi.exports=Xh});var Ti=c((l_,Si)=>{"use strict";function Qh(e){return typeof e=="string"}Si.exports=Qh});var Ii=c((c_,qi)=>{"use strict";var Kh=di(),rg=Ei(),eg=Ti();function _i(e){var r,t;if(!eg(e))throw new TypeError(_i("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[rg(e)],t=1;t<arguments.length;t++)r.push(arguments[t]);return Kh.apply(null,r)}qi.exports=_i});var Z=c((p_,Di)=>{"use strict";var tg=Ii();Di.exports=tg});var zi=c((y_,Ui)=>{"use strict";var Ni=Z(),Fr=Object.prototype,Bi=Fr.toString,Oi=Fr.__defineGetter__,Vi=Fr.__defineSetter__,ng=Fr.__lookupGetter__,ig=Fr.__lookupSetter__;function ag(e,r,t){var n,i,a,s;if(typeof e!="object"||e===null||Bi.call(e)==="[object Array]")throw new TypeError(Ni("invalid argument. First argument must be an object. Value: `%s`.",e));if(typeof t!="object"||t===null||Bi.call(t)==="[object Array]")throw new TypeError(Ni("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if(i="value"in t,i&&(ng.call(e,r)||ig.call(e,r)?(n=e.__proto__,e.__proto__=Fr,delete e[r],e[r]=t.value,e.__proto__=n):e[r]=t.value),a="get"in t,s="set"in t,i&&(a||s))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return a&&Oi&&Oi.call(e,r,t.get),s&&Vi&&Vi.call(e,r,t.set),e}Ui.exports=ag});var kr=c((m_,Fi)=>{"use strict";var og=Qn(),sg=ri(),ug=zi(),Ke;og()?Ke=sg:Ke=ug;Fi.exports=Ke});var Ci=c((h_,Ri)=>{"use strict";var fg=kr();function lg(e,r,t){fg(e,r,{configurable:!1,enumerable:!1,writable:!1,value:t})}Ri.exports=lg});var W=c((g_,ji)=>{"use strict";var cg=Ci();ji.exports=cg});var Mi=c((v_,Li)=>{"use strict";function pg(e,r){return e>r?e:r}Li.exports=pg});var Pi=c((b_,ki)=>{"use strict";var yg=Mi();ki.exports=yg});var Yi=c((d_,Gi)=>{"use strict";var $i="function";function mg(e){return typeof e.get===$i&&typeof e.set===$i}Gi.exports=mg});var rt=c((w_,Wi)=>{"use strict";var hg=Yi();Wi.exports=hg});var Hi=c((A_,Ji)=>{"use strict";var Zi={complex128:gg,complex64:vg,default:bg};function gg(e,r){return e.get(r)}function vg(e,r){return e.get(r)}function bg(e,r){return e.get(r)}function dg(e){var r=Zi[e];return typeof r=="function"?r:Zi.default}Ji.exports=dg});var Rr=c((x_,Xi)=>{"use strict";var wg=Hi();Xi.exports=wg});var ra=c((E_,Ki)=>{"use strict";var Qi={float64:Ag,float32:xg,int32:Eg,int16:Sg,int8:Tg,uint32:_g,uint16:qg,uint8:Ig,uint8c:Dg,generic:Ng,default:Bg};function Ag(e,r){return e[r]}function xg(e,r){return e[r]}function Eg(e,r){return e[r]}function Sg(e,r){return e[r]}function Tg(e,r){return e[r]}function _g(e,r){return e[r]}function qg(e,r){return e[r]}function Ig(e,r){return e[r]}function Dg(e,r){return e[r]}function Ng(e,r){return e[r]}function Bg(e,r){return e[r]}function Og(e){var r=Qi[e];return typeof r=="function"?r:Qi.default}Ki.exports=Og});var Pr=c((S_,ea)=>{"use strict";var Vg=ra();ea.exports=Vg});var na=c((T_,ta)=>{"use strict";function Ug(){return typeof Symbol=="function"&&typeof Symbol("foo")=="symbol"}ta.exports=Ug});var aa=c((__,ia)=>{"use strict";var zg=na();ia.exports=zg});var sa=c((q_,oa)=>{"use strict";var Fg=aa(),Rg=Fg();function Cg(){return Rg&&typeof Symbol.toStringTag=="symbol"}oa.exports=Cg});var $r=c((I_,ua)=>{"use strict";var jg=sa();ua.exports=jg});var et=c((D_,fa)=>{"use strict";var Lg=Object.prototype.toString;fa.exports=Lg});var ca=c((N_,la)=>{"use strict";var Mg=et();function kg(e){return Mg.call(e)}la.exports=kg});var ya=c((B_,pa)=>{"use strict";var Pg=Object.prototype.hasOwnProperty;function $g(e,r){return e==null?!1:Pg.call(e,r)}pa.exports=$g});var tt=c((O_,ma)=>{"use strict";var Gg=ya();ma.exports=Gg});var ga=c((V_,ha)=>{"use strict";var Yg=typeof Symbol=="function"?Symbol:void 0;ha.exports=Yg});var nt=c((U_,va)=>{"use strict";var Wg=ga();va.exports=Wg});var wa=c((z_,da)=>{"use strict";var ba=nt(),Zg=typeof ba=="function"?ba.toStringTag:"";da.exports=Zg});var xa=c((F_,Aa)=>{"use strict";var Jg=tt(),Gr=wa(),it=et();function Hg(e){var r,t,n;if(e==null)return it.call(e);t=e[Gr],r=Jg(e,Gr);try{e[Gr]=void 0}catch{return it.call(e)}return n=it.call(e),r?e[Gr]=t:delete e[Gr],n}Aa.exports=Hg});var J=c((R_,Ea)=>{"use strict";var Xg=$r(),Qg=ca(),Kg=xa(),at;Xg()?at=Kg:at=Qg;Ea.exports=at});var Ta=c((C_,Sa)=>{"use strict";var rv=J(),ot;function ev(e){return rv(e)==="[object Array]"}Array.isArray?ot=Array.isArray:ot=ev;Sa.exports=ot});var Cr=c((j_,_a)=>{"use strict";var tv=Ta();_a.exports=tv});var Ia=c((L_,qa)=>{"use strict";var nv=Cr(),iv=Z();function av(e){if(typeof e!="function")throw new TypeError(iv("invalid argument. Must provide a function. Value: `%s`.",e));return r;function r(t){var n,i;if(!nv(t)||(n=t.length,n===0))return!1;for(i=0;i<n;i++)if(e(t[i])===!1)return!1;return!0}}qa.exports=av});var st=c((M_,Da)=>{"use strict";var ov=Ia();Da.exports=ov});var Ba=c((k_,Na)=>{"use strict";function sv(e){return e!==null&&typeof e=="object"}Na.exports=sv});var Va=c((P_,Oa)=>{"use strict";var uv=W(),fv=st(),ut=Ba(),lv=fv(ut);uv(ut,"isObjectLikeArray",lv);Oa.exports=ut});var za=c(($_,Ua)=>{"use strict";var cv=Va();function pv(e){return cv(e)&&(e._isBuffer||e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))}Ua.exports=pv});var ft=c((G_,Fa)=>{"use strict";var yv=za();Fa.exports=yv});var lt=c((Y_,Ra)=>{"use strict";function mv(){return/^\s*function\s*([^(]*)/i}Ra.exports=mv});var ja=c((W_,Ca)=>{"use strict";var hv=lt(),gv=hv();Ca.exports=gv});var ka=c((Z_,Ma)=>{"use strict";var vv=W(),La=lt(),bv=ja();vv(La,"REGEXP",bv);Ma.exports=La});var $a=c((J_,Pa)=>{"use strict";var dv=J(),wv=ka().REGEXP,Av=ft();function xv(e){var r,t,n;if(t=dv(e).slice(8,-1),(t==="Object"||t==="Error")&&e.constructor){if(n=e.constructor,typeof n.name=="string")return n.name;if(r=wv.exec(n.toString()),r)return r[1]}return Av(e)?"Buffer":t}Pa.exports=xv});var ge=c((H_,Ga)=>{"use strict";var Ev=$a();Ga.exports=Ev});var Wa=c((X_,Ya)=>{"use strict";var Sv={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"};Ya.exports=Sv});var Ja=c((Q_,Za)=>{"use strict";var Tv=J(),_v=typeof Float64Array=="function";function qv(e){return _v&&e instanceof Float64Array||Tv(e)==="[object Float64Array]"}Za.exports=qv});var Xa=c((K_,Ha)=>{"use strict";var Iv=Ja();Ha.exports=Iv});var Ka=c((r1,Qa)=>{"use strict";var Dv=typeof Float64Array=="function"?Float64Array:null;Qa.exports=Dv});var to=c((e1,eo)=>{"use strict";var Nv=Xa(),ro=Ka();function Bv(){var e,r;if(typeof ro!="function")return!1;try{r=new ro([1,3.14,-3.14,NaN]),e=Nv(r)&&r[0]===1&&r[1]===3.14&&r[2]===-3.14&&r[3]!==r[3]}catch{e=!1}return e}eo.exports=Bv});var io=c((t1,no)=>{"use strict";var Ov=to();no.exports=Ov});var oo=c((n1,ao)=>{"use strict";var Vv=typeof Float64Array=="function"?Float64Array:void 0;ao.exports=Vv});var uo=c((i1,so)=>{"use strict";function Uv(){throw new Error("not implemented")}so.exports=Uv});var ve=c((a1,fo)=>{"use strict";var zv=io(),Fv=oo(),Rv=uo(),ct;zv()?ct=Fv:ct=Rv;fo.exports=ct});var co=c((o1,lo)=>{"use strict";var Cv=J(),jv=typeof Float32Array=="function";function Lv(e){return jv&&e instanceof Float32Array||Cv(e)==="[object Float32Array]"}lo.exports=Lv});var yo=c((s1,po)=>{"use strict";var Mv=co();po.exports=Mv});var pt=c((u1,mo)=>{"use strict";var kv=Number.POSITIVE_INFINITY;mo.exports=kv});var go=c((f1,ho)=>{"use strict";var Pv=typeof Float32Array=="function"?Float32Array:null;ho.exports=Pv});var wo=c((l1,bo)=>{"use strict";var $v=yo(),Gv=pt(),vo=go();function Yv(){var e,r;if(typeof vo!="function")return!1;try{r=new vo([1,3.14,-3.14,5e40]),e=$v(r)&&r[0]===1&&r[1]===3.140000104904175&&r[2]===-3.140000104904175&&r[3]===Gv}catch{e=!1}return e}bo.exports=Yv});var xo=c((c1,Ao)=>{"use strict";var Wv=wo();Ao.exports=Wv});var So=c((p1,Eo)=>{"use strict";var Zv=typeof Float32Array=="function"?Float32Array:void 0;Eo.exports=Zv});var _o=c((y1,To)=>{"use strict";function Jv(){throw new Error("not implemented")}To.exports=Jv});var Yr=c((m1,qo)=>{"use strict";var Hv=xo(),Xv=So(),Qv=_o(),yt;Hv()?yt=Xv:yt=Qv;qo.exports=yt});var Do=c((h1,Io)=>{"use strict";var Kv=J(),rb=typeof Uint32Array=="function";function eb(e){return rb&&e instanceof Uint32Array||Kv(e)==="[object Uint32Array]"}Io.exports=eb});var Bo=c((g1,No)=>{"use strict";var tb=Do();No.exports=tb});var Vo=c((v1,Oo)=>{"use strict";var nb=4294967295;Oo.exports=nb});var zo=c((b1,Uo)=>{"use strict";var ib=typeof Uint32Array=="function"?Uint32Array:null;Uo.exports=ib});var Co=c((d1,Ro)=>{"use strict";var ab=Bo(),mt=Vo(),Fo=zo();function ob(){var e,r;if(typeof Fo!="function")return!1;try{r=[1,3.14,-3.14,mt+1,mt+2],r=new Fo(r),e=ab(r)&&r[0]===1&&r[1]===3&&r[2]===mt-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}Ro.exports=ob});var Lo=c((w1,jo)=>{"use strict";var sb=Co();jo.exports=sb});var ko=c((A1,Mo)=>{"use strict";var ub=typeof Uint32Array=="function"?Uint32Array:void 0;Mo.exports=ub});var $o=c((x1,Po)=>{"use strict";function fb(){throw new Error("not implemented")}Po.exports=fb});var Yo=c((E1,Go)=>{"use strict";var lb=Lo(),cb=ko(),pb=$o(),ht;lb()?ht=cb:ht=pb;Go.exports=ht});var Zo=c((S1,Wo)=>{"use strict";var yb=J(),mb=typeof Int32Array=="function";function hb(e){return mb&&e instanceof Int32Array||yb(e)==="[object Int32Array]"}Wo.exports=hb});var Ho=c((T1,Jo)=>{"use strict";var gb=Zo();Jo.exports=gb});var Qo=c((_1,Xo)=>{"use strict";var vb=2147483647;Xo.exports=vb});var rs=c((q1,Ko)=>{"use strict";var bb=-2147483648;Ko.exports=bb});var ts=c((I1,es)=>{"use strict";var db=typeof Int32Array=="function"?Int32Array:null;es.exports=db});var as=c((D1,is)=>{"use strict";var wb=Ho(),Ab=Qo(),xb=rs(),ns=ts();function Eb(){var e,r;if(typeof ns!="function")return!1;try{r=new ns([1,3.14,-3.14,Ab+1]),e=wb(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===xb}catch{e=!1}return e}is.exports=Eb});var ss=c((N1,os)=>{"use strict";var Sb=as();os.exports=Sb});var fs=c((B1,us)=>{"use strict";var Tb=typeof Int32Array=="function"?Int32Array:void 0;us.exports=Tb});var cs=c((O1,ls)=>{"use strict";function _b(){throw new Error("not implemented")}ls.exports=_b});var ys=c((V1,ps)=>{"use strict";var qb=ss(),Ib=fs(),Db=cs(),gt;qb()?gt=Ib:gt=Db;ps.exports=gt});var hs=c((U1,ms)=>{"use strict";var Nb=J(),Bb=typeof Uint16Array=="function";function Ob(e){return Bb&&e instanceof Uint16Array||Nb(e)==="[object Uint16Array]"}ms.exports=Ob});var vs=c((z1,gs)=>{"use strict";var Vb=hs();gs.exports=Vb});var ds=c((F1,bs)=>{"use strict";var Ub=65535;bs.exports=Ub});var As=c((R1,ws)=>{"use strict";var zb=typeof Uint16Array=="function"?Uint16Array:null;ws.exports=zb});var Ss=c((C1,Es)=>{"use strict";var Fb=vs(),vt=ds(),xs=As();function Rb(){var e,r;if(typeof xs!="function")return!1;try{r=[1,3.14,-3.14,vt+1,vt+2],r=new xs(r),e=Fb(r)&&r[0]===1&&r[1]===3&&r[2]===vt-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}Es.exports=Rb});var _s=c((j1,Ts)=>{"use strict";var Cb=Ss();Ts.exports=Cb});var Is=c((L1,qs)=>{"use strict";var jb=typeof Uint16Array=="function"?Uint16Array:void 0;qs.exports=jb});var Ns=c((M1,Ds)=>{"use strict";function Lb(){throw new Error("not implemented")}Ds.exports=Lb});var Os=c((k1,Bs)=>{"use strict";var Mb=_s(),kb=Is(),Pb=Ns(),bt;Mb()?bt=kb:bt=Pb;Bs.exports=bt});var Us=c((P1,Vs)=>{"use strict";var $b=J(),Gb=typeof Int16Array=="function";function Yb(e){return Gb&&e instanceof Int16Array||$b(e)==="[object Int16Array]"}Vs.exports=Yb});var Fs=c(($1,zs)=>{"use strict";var Wb=Us();zs.exports=Wb});var Cs=c((G1,Rs)=>{"use strict";var Zb=32767;Rs.exports=Zb});var Ls=c((Y1,js)=>{"use strict";var Jb=-32768;js.exports=Jb});var ks=c((W1,Ms)=>{"use strict";var Hb=typeof Int16Array=="function"?Int16Array:null;Ms.exports=Hb});var Gs=c((Z1,$s)=>{"use strict";var Xb=Fs(),Qb=Cs(),Kb=Ls(),Ps=ks();function rd(){var e,r;if(typeof Ps!="function")return!1;try{r=new Ps([1,3.14,-3.14,Qb+1]),e=Xb(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===Kb}catch{e=!1}return e}$s.exports=rd});var Ws=c((J1,Ys)=>{"use strict";var ed=Gs();Ys.exports=ed});var Js=c((H1,Zs)=>{"use strict";var td=typeof Int16Array=="function"?Int16Array:void 0;Zs.exports=td});var Xs=c((X1,Hs)=>{"use strict";function nd(){throw new Error("not implemented")}Hs.exports=nd});var Ks=c((Q1,Qs)=>{"use strict";var id=Ws(),ad=Js(),od=Xs(),dt;id()?dt=ad:dt=od;Qs.exports=dt});var eu=c((K1,ru)=>{"use strict";var sd=J(),ud=typeof Uint8Array=="function";function fd(e){return ud&&e instanceof Uint8Array||sd(e)==="[object Uint8Array]"}ru.exports=fd});var nu=c((rq,tu)=>{"use strict";var ld=eu();tu.exports=ld});var au=c((eq,iu)=>{"use strict";var cd=255;iu.exports=cd});var su=c((tq,ou)=>{"use strict";var pd=typeof Uint8Array=="function"?Uint8Array:null;ou.exports=pd});var lu=c((nq,fu)=>{"use strict";var yd=nu(),wt=au(),uu=su();function md(){var e,r;if(typeof uu!="function")return!1;try{r=[1,3.14,-3.14,wt+1,wt+2],r=new uu(r),e=yd(r)&&r[0]===1&&r[1]===3&&r[2]===wt-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}fu.exports=md});var pu=c((iq,cu)=>{"use strict";var hd=lu();cu.exports=hd});var mu=c((aq,yu)=>{"use strict";var gd=typeof Uint8Array=="function"?Uint8Array:void 0;yu.exports=gd});var gu=c((oq,hu)=>{"use strict";function vd(){throw new Error("not implemented")}hu.exports=vd});var xt=c((sq,vu)=>{"use strict";var bd=pu(),dd=mu(),wd=gu(),At;bd()?At=dd:At=wd;vu.exports=At});var du=c((uq,bu)=>{"use strict";var Ad=J(),xd=typeof Uint8ClampedArray=="function";function Ed(e){return xd&&e instanceof Uint8ClampedArray||Ad(e)==="[object Uint8ClampedArray]"}bu.exports=Ed});var Au=c((fq,wu)=>{"use strict";var Sd=du();wu.exports=Sd});var Eu=c((lq,xu)=>{"use strict";var Td=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:null;xu.exports=Td});var _u=c((cq,Tu)=>{"use strict";var _d=Au(),Su=Eu();function qd(){var e,r;if(typeof Su!="function")return!1;try{r=new Su([-1,0,1,3.14,4.99,255,256]),e=_d(r)&&r[0]===0&&r[1]===0&&r[2]===1&&r[3]===3&&r[4]===5&&r[5]===255&&r[6]===255}catch{e=!1}return e}Tu.exports=qd});var Iu=c((pq,qu)=>{"use strict";var Id=_u();qu.exports=Id});var Nu=c((yq,Du)=>{"use strict";var Dd=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;Du.exports=Dd});var Ou=c((mq,Bu)=>{"use strict";function Nd(){throw new Error("not implemented")}Bu.exports=Nd});var Uu=c((hq,Vu)=>{"use strict";var Bd=Iu(),Od=Nu(),Vd=Ou(),Et;Bd()?Et=Od:Et=Vd;Vu.exports=Et});var Fu=c((gq,zu)=>{"use strict";var Ud=J(),zd=typeof Int8Array=="function";function Fd(e){return zd&&e instanceof Int8Array||Ud(e)==="[object Int8Array]"}zu.exports=Fd});var Cu=c((vq,Ru)=>{"use strict";var Rd=Fu();Ru.exports=Rd});var Lu=c((bq,ju)=>{"use strict";var Cd=127;ju.exports=Cd});var ku=c((dq,Mu)=>{"use strict";var jd=-128;Mu.exports=jd});var $u=c((wq,Pu)=>{"use strict";var Ld=typeof Int8Array=="function"?Int8Array:null;Pu.exports=Ld});var Wu=c((Aq,Yu)=>{"use strict";var Md=Cu(),kd=Lu(),Pd=ku(),Gu=$u();function $d(){var e,r;if(typeof Gu!="function")return!1;try{r=new Gu([1,3.14,-3.14,kd+1]),e=Md(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===Pd}catch{e=!1}return e}Yu.exports=$d});var Ju=c((xq,Zu)=>{"use strict";var Gd=Wu();Zu.exports=Gd});var Xu=c((Eq,Hu)=>{"use strict";var Yd=typeof Int8Array=="function"?Int8Array:void 0;Hu.exports=Yd});var Ku=c((Sq,Qu)=>{"use strict";function Wd(){throw new Error("not implemented")}Qu.exports=Wd});var ef=c((Tq,rf)=>{"use strict";var Zd=Ju(),Jd=Xu(),Hd=Ku(),St;Zd()?St=Jd:St=Hd;rf.exports=St});var Tt=c((_q,tf)=>{"use strict";function Xd(e){return typeof e=="number"}tf.exports=Xd});var af=c((qq,nf)=>{"use strict";nf.exports=Number});var be=c((Iq,of)=>{"use strict";var Qd=af();of.exports=Qd});var uf=c((Dq,sf)=>{"use strict";var Kd=be(),rw=Kd.prototype.toString;sf.exports=rw});var lf=c((Nq,ff)=>{"use strict";var ew=uf();function tw(e){try{return ew.call(e),!0}catch{return!1}}ff.exports=tw});var _t=c((Bq,cf)=>{"use strict";var nw=$r(),iw=J(),aw=be(),ow=lf(),sw=nw();function uw(e){return typeof e=="object"?e instanceof aw?!0:sw?ow(e):iw(e)==="[object Number]":!1}cf.exports=uw});var yf=c((Oq,pf)=>{"use strict";var fw=Tt(),lw=_t();function cw(e){return fw(e)||lw(e)}pf.exports=cw});var Wr=c((Vq,hf)=>{"use strict";var mf=W(),qt=yf(),pw=Tt(),yw=_t();mf(qt,"isPrimitive",pw);mf(qt,"isObject",yw);hf.exports=qt});var vf=c((Uq,gf)=>{"use strict";var mw=be(),hw=mw.NEGATIVE_INFINITY;gf.exports=hw});var df=c((zq,bf)=>{"use strict";var gw=Math.floor;bf.exports=gw});var Zr=c((Fq,wf)=>{"use strict";var vw=df();wf.exports=vw});var xf=c((Rq,Af)=>{"use strict";var bw=Zr();function dw(e){return bw(e)===e}Af.exports=dw});var Nr=c((Cq,Ef)=>{"use strict";var ww=xf();Ef.exports=ww});var It=c((jq,Sf)=>{"use strict";var Aw=pt(),xw=vf(),Ew=Nr();function Sw(e){return e<Aw&&e>xw&&Ew(e)}Sf.exports=Sw});var Dt=c((Lq,Tf)=>{"use strict";var Tw=Wr().isPrimitive,_w=It();function qw(e){return Tw(e)&&_w(e)}Tf.exports=qw});var Nt=c((Mq,_f)=>{"use strict";var Iw=Wr().isObject,Dw=It();function Nw(e){return Iw(e)&&Dw(e.valueOf())}_f.exports=Nw});var If=c((kq,qf)=>{"use strict";var Bw=Dt(),Ow=Nt();function Vw(e){return Bw(e)||Ow(e)}qf.exports=Vw});var de=c((Pq,Nf)=>{"use strict";var Df=W(),Bt=If(),Uw=Dt(),zw=Nt();Df(Bt,"isPrimitive",Uw);Df(Bt,"isObject",zw);Nf.exports=Bt});var Ot=c(($q,Bf)=>{"use strict";var Fw=de().isPrimitive;function Rw(e){return Fw(e)&&e>=0}Bf.exports=Rw});var Vt=c((Gq,Of)=>{"use strict";var Cw=de().isObject;function jw(e){return Cw(e)&&e.valueOf()>=0}Of.exports=jw});var Uf=c((Yq,Vf)=>{"use strict";var Lw=Ot(),Mw=Vt();function kw(e){return Lw(e)||Mw(e)}Vf.exports=kw});var we=c((Wq,Ff)=>{"use strict";var zf=W(),Ut=Uf(),Pw=Ot(),$w=Vt();zf(Ut,"isPrimitive",Pw);zf(Ut,"isObject",$w);Ff.exports=Ut});var Cf=c((Zq,Rf)=>{"use strict";var Gw=4294967295;Rf.exports=Gw});var Lf=c((Jq,jf)=>{"use strict";var Yw=Nr(),Ww=Cf();function Zw(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&Yw(e.length)&&e.length>=0&&e.length<=Ww}jf.exports=Zw});var Br=c((Hq,Mf)=>{"use strict";var Jw=Lf();Mf.exports=Jw});var Pf=c((Xq,kf)=>{"use strict";var Hw=9007199254740991;kf.exports=Hw});var Gf=c((Qq,$f)=>{"use strict";var Xw=Nr(),Qw=Pf();function Kw(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&Xw(e.length)&&e.length>=0&&e.length<=Qw}$f.exports=Kw});var Jr=c((Kq,Yf)=>{"use strict";var rA=Gf();Yf.exports=rA});var Zf=c((rI,Wf)=>{"use strict";var eA=J(),tA=typeof ArrayBuffer=="function";function nA(e){return tA&&e instanceof ArrayBuffer||eA(e)==="[object ArrayBuffer]"}Wf.exports=nA});var Ae=c((eI,Jf)=>{"use strict";var iA=Zf();Jf.exports=iA});var Xf=c((tI,Hf)=>{"use strict";var aA=Cr();function oA(e){return typeof e=="object"&&e!==null&&!aA(e)}Hf.exports=oA});var xe=c((nI,Qf)=>{"use strict";var sA=Xf();Qf.exports=sA});var zt=c((iI,Kf)=>{"use strict";function uA(e){return typeof e=="string"}Kf.exports=uA});var el=c((aI,rl)=>{"use strict";var fA=String.prototype.valueOf;rl.exports=fA});var nl=c((oI,tl)=>{"use strict";var lA=el();function cA(e){try{return lA.call(e),!0}catch{return!1}}tl.exports=cA});var Ft=c((sI,il)=>{"use strict";var pA=$r(),yA=J(),mA=nl(),hA=pA();function gA(e){return typeof e=="object"?e instanceof String?!0:hA?mA(e):yA(e)==="[object String]":!1}il.exports=gA});var ol=c((uI,al)=>{"use strict";var vA=zt(),bA=Ft();function dA(e){return vA(e)||bA(e)}al.exports=dA});var Hr=c((fI,ul)=>{"use strict";var sl=W(),Rt=ol(),wA=zt(),AA=Ft();sl(Rt,"isPrimitive",wA);sl(Rt,"isObject",AA);ul.exports=Rt});var Ee=c((lI,ll)=>{"use strict";var fl=W(),Ct=st(),jt=Hr(),xA=Ct(jt.isPrimitive),EA=Ct(jt.isObject),Lt=Ct(jt);fl(Lt,"primitives",xA);fl(Lt,"objects",EA);ll.exports=Lt});var pl=c((cI,cl)=>{"use strict";var SA=/./;cl.exports=SA});var Mt=c((pI,yl)=>{"use strict";function TA(e){return typeof e=="boolean"}yl.exports=TA});var hl=c((yI,ml)=>{"use strict";var _A=Boolean;ml.exports=_A});var jr=c((mI,gl)=>{"use strict";var qA=hl();gl.exports=qA});var bl=c((hI,vl)=>{"use strict";var IA=Boolean.prototype.toString;vl.exports=IA});var wl=c((gI,dl)=>{"use strict";var DA=bl();function NA(e){try{return DA.call(e),!0}catch{return!1}}dl.exports=NA});var kt=c((vI,Al)=>{"use strict";var BA=$r(),OA=J(),VA=jr(),UA=wl(),zA=BA();function FA(e){return typeof e=="object"?e instanceof VA?!0:zA?UA(e):OA(e)==="[object Boolean]":!1}Al.exports=FA});var El=c((bI,xl)=>{"use strict";var RA=Mt(),CA=kt();function jA(e){return RA(e)||CA(e)}xl.exports=jA});var $t=c((dI,Tl)=>{"use strict";var Sl=W(),Pt=El(),LA=Mt(),MA=kt();Sl(Pt,"isPrimitive",LA);Sl(Pt,"isObject",MA);Tl.exports=Pt});var ql=c((wI,_l)=>{"use strict";function kA(){return new Function("return this;")()}_l.exports=kA});var Dl=c((AI,Il)=>{"use strict";var PA=typeof self=="object"?self:null;Il.exports=PA});var Bl=c((xI,Nl)=>{"use strict";var $A=typeof window=="object"?window:null;Nl.exports=$A});var Vl=c((EI,Ol)=>{"use strict";var GA=typeof globalThis=="object"?globalThis:null;Ol.exports=GA});var Cl=c((SI,Rl)=>{"use strict";var YA=$t().isPrimitive,WA=Z(),ZA=ql(),Ul=Dl(),zl=Bl(),Fl=Vl();function JA(e){if(arguments.length){if(!YA(e))throw new TypeError(WA("invalid argument. Must provide a boolean. Value: `%s`.",e));if(e)return ZA()}if(Fl)return Fl;if(Ul)return Ul;if(zl)return zl;throw new Error("unexpected error. Unable to resolve global object.")}Rl.exports=JA});var Ml=c((TI,Ll)=>{"use strict";var HA=Cl(),jl=HA(),XA=jl.document&&jl.document.childNodes;Ll.exports=XA});var Pl=c((_I,kl)=>{"use strict";var QA=Int8Array;kl.exports=QA});var Gl=c((qI,$l)=>{"use strict";var KA=pl(),r0=Ml(),e0=Pl();function t0(){return typeof KA=="function"||typeof e0=="object"||typeof r0=="function"}$l.exports=t0});var Wl=c((II,Yl)=>{"use strict";var n0=ge();function i0(e){var r;return e===null?"null":(r=typeof e,r==="object"?n0(e).toLowerCase():r)}Yl.exports=i0});var Jl=c((DI,Zl)=>{"use strict";var a0=ge();function o0(e){return a0(e).toLowerCase()}Zl.exports=o0});var Xl=c((NI,Hl)=>{"use strict";var s0=Gl(),u0=Wl(),f0=Jl(),l0=s0()?f0:u0;Hl.exports=l0});var Kl=c((BI,Ql)=>{"use strict";var c0=Xl();function p0(e){return c0(e)==="function"}Ql.exports=p0});var Se=c((OI,rc)=>{"use strict";var y0=Kl();rc.exports=y0});var tc=c((VI,ec)=>{"use strict";function m0(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i",e}ec.exports=m0});var ic=c((UI,nc)=>{"use strict";function h0(){var e={};return e.type="Complex128",e.re=this.re,e.im=this.im,e}nc.exports=h0});var fc=c((zI,uc)=>{"use strict";var ac=Wr().isPrimitive,oc=kr(),Xr=W(),sc=Z(),g0=tc(),v0=ic();function Or(e,r){if(!(this instanceof Or))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!ac(e))throw new TypeError(sc("invalid argument. Real component must be a number. Value: `%s`.",e));if(!ac(r))throw new TypeError(sc("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return oc(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:e}),oc(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}Xr(Or,"BYTES_PER_ELEMENT",8);Xr(Or.prototype,"BYTES_PER_ELEMENT",8);Xr(Or.prototype,"byteLength",16);Xr(Or.prototype,"toString",g0);Xr(Or.prototype,"toJSON",v0);uc.exports=Or});var Gt=c((FI,lc)=>{"use strict";var b0=fc();lc.exports=b0});var pc=c((RI,cc)=>{"use strict";var d0=typeof Math.fround=="function"?Math.fround:null;cc.exports=d0});var hc=c((CI,mc)=>{"use strict";var w0=Yr(),yc=new w0(1);function A0(e){return yc[0]=e,yc[0]}mc.exports=A0});var bc=c((jI,vc)=>{"use strict";var gc=pc(),x0=hc(),Yt;typeof gc=="function"?Yt=gc:Yt=x0;vc.exports=Yt});var wc=c((LI,dc)=>{"use strict";function E0(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i",e}dc.exports=E0});var xc=c((MI,Ac)=>{"use strict";function S0(){var e={};return e.type="Complex64",e.re=this.re,e.im=this.im,e}Ac.exports=S0});var Ic=c((kI,qc)=>{"use strict";var Ec=Wr().isPrimitive,Sc=kr(),Qr=W(),Tc=bc(),_c=Z(),T0=wc(),_0=xc();function Vr(e,r){if(!(this instanceof Vr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Ec(e))throw new TypeError(_c("invalid argument. Real component must be a number. Value: `%s`.",e));if(!Ec(r))throw new TypeError(_c("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return Sc(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:Tc(e)}),Sc(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:Tc(r)}),this}Qr(Vr,"BYTES_PER_ELEMENT",4);Qr(Vr.prototype,"BYTES_PER_ELEMENT",4);Qr(Vr.prototype,"byteLength",8);Qr(Vr.prototype,"toString",T0);Qr(Vr.prototype,"toJSON",_0);qc.exports=Vr});var Wt=c((PI,Dc)=>{"use strict";var q0=Ic();Dc.exports=q0});var Bc=c(($I,Nc)=>{"use strict";var I0=Gt(),D0=Wt();function N0(e){return e instanceof I0||e instanceof D0?!0:typeof e=="object"&&e!==null&&typeof e.re=="number"&&typeof e.im=="number"}Nc.exports=N0});var br=c((GI,Oc)=>{"use strict";var B0=Bc();Oc.exports=B0});var Uc=c((YI,Vc)=>{"use strict";var O0=Nr();function V0(e){return O0(e/2)}Vc.exports=V0});var Zt=c((WI,zc)=>{"use strict";var U0=Uc();zc.exports=U0});var Rc=c((ZI,Fc)=>{"use strict";var z0=8;function F0(e){return typeof e=="object"&&e!==null&&e.constructor.name==="Complex64Array"&&e.BYTES_PER_ELEMENT===z0}Fc.exports=F0});var Jt=c((JI,Cc)=>{"use strict";var R0=Rc();Cc.exports=R0});var Lc=c((HI,jc)=>{"use strict";var C0=16;function j0(e){return typeof e=="object"&&e!==null&&e.constructor.name==="Complex128Array"&&e.BYTES_PER_ELEMENT===C0}jc.exports=j0});var Ht=c((XI,Mc)=>{"use strict";var L0=Lc();Mc.exports=L0});var Pc=c((QI,kc)=>{"use strict";var M0=tt(),Te=nt();function k0(){return typeof Te=="function"&&typeof Te("foo")=="symbol"&&M0(Te,"iterator")&&typeof Te.iterator=="symbol"}kc.exports=k0});var Kr=c((KI,$c)=>{"use strict";var P0=Pc();$c.exports=P0});var Yc=c((r6,Gc)=>{"use strict";var $0=Kr(),G0=$0()?Symbol.iterator:null;Gc.exports=G0});var _e=c((e6,Wc)=>{"use strict";var Y0=Yc();Wc.exports=Y0});var Jc=c((t6,Zc)=>{"use strict";var W0=kr();function Z0(e,r,t){W0(e,r,{configurable:!1,enumerable:!1,get:t})}Zc.exports=Z0});var qe=c((n6,Hc)=>{"use strict";var J0=Jc();Hc.exports=J0});var Qc=c((i6,Xc)=>{"use strict";function H0(e){return e.re}Xc.exports=H0});var re=c((a6,Kc)=>{"use strict";var X0=Qc();Kc.exports=X0});var ep=c((o6,rp)=>{"use strict";function Q0(e){return e.im}rp.exports=Q0});var ee=c((s6,tp)=>{"use strict";var K0=ep();tp.exports=K0});var ip=c((u6,np)=>{"use strict";var rx=Yr();function ex(e,r){return new rx(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}np.exports=ex});var Xt=c((f6,ap)=>{"use strict";var tx=ip();ap.exports=tx});var sp=c((l6,op)=>{"use strict";var nx=ve();function ix(e,r){return new nx(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}op.exports=ix});var Qt=c((c6,up)=>{"use strict";var ax=sp();up.exports=ax});var lp=c((p6,fp)=>{"use strict";var ox=Br(),sx=br(),ux=re(),fx=ee(),lx=Z();function cx(e){var r,t,n;for(r=[];t=e.next(),!t.done;)if(n=t.value,ox(n)&&n.length>=2)r.push(n[0],n[1]);else if(sx(n))r.push(ux(n),fx(n));else return new TypeError(lx("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return r}fp.exports=cx});var pp=c((y6,cp)=>{"use strict";var px=Br(),yx=br(),mx=re(),hx=ee(),gx=Z();function vx(e,r,t){var n,i,a,s;for(n=[],s=-1;i=e.next(),!i.done;)if(s+=1,a=r.call(t,i.value,s),px(a)&&a.length>=2)n.push(a[0],a[1]);else if(yx(a))n.push(mx(a),hx(a));else return new TypeError(gx("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));return n}cp.exports=vx});var mp=c((m6,yp)=>{"use strict";var bx=br(),dx=re(),wx=ee();function Ax(e,r){var t,n,i,a;for(t=r.length,a=0,i=0;i<t;i++){if(n=r[i],!bx(n))return null;e[a]=dx(n),e[a+1]=wx(n),a+=2}return e}yp.exports=Ax});var Ap=c((h6,wp)=>{"use strict";var te=we().isPrimitive,Kt=Br(),rn=Jr(),hp=Ae(),en=xe(),xx=Cr(),Ex=Ee().primitives,gp=Hr().isPrimitive,$=Se(),ir=br(),Ie=Zt(),Q=Nr(),Sx=Jt(),Tx=Ht(),_x=Kr(),yr=_e(),I=W(),De=qe(),nr=Yr(),qx=Wt(),x=Z(),ur=re(),fr=ee(),Ix=Zr(),Dx=Xt(),Nx=Qt(),Bx=Pr(),Ox=Rr(),vp=lp(),Vx=pp(),Ux=mp(),rr=nr.BYTES_PER_ELEMENT*2,bp=_x();function V(e){return e instanceof T||typeof e=="object"&&e!==null&&(e.constructor.name==="Complex64Array"||e.constructor.name==="Complex128Array")&&typeof e._length=="number"&&typeof e._buffer=="object"}function dp(e){return e===T||e.name==="Complex128Array"}function j(e,r){return r*=2,new qx(e[r],e[r+1])}function T(){var e,r,t,n;if(r=arguments.length,!(this instanceof T))return r===0?new T:r===1?new T(arguments[0]):r===2?new T(arguments[0],arguments[1]):new T(arguments[0],arguments[1],arguments[2]);if(r===0)t=new nr(0);else if(r===1)if(te(arguments[0]))t=new nr(arguments[0]*2);else if(rn(arguments[0]))if(t=arguments[0],n=t.length,n&&xx(t)&&ir(t[0])){if(t=Ux(new nr(n*2),t),t===null){if(!Ie(n))throw new RangeError(x("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new nr(arguments[0])}}else{if(Sx(t))t=Dx(t,0);else if(Tx(t))t=Nx(t,0);else if(!Ie(n))throw new RangeError(x("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new nr(t)}else if(hp(arguments[0])){if(t=arguments[0],!Q(t.byteLength/rr))throw new RangeError(x("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",rr,t.byteLength));t=new nr(t)}else if(en(arguments[0])){if(t=arguments[0],bp===!1)throw new TypeError(x("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!$(t[yr]))throw new TypeError(x("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(t=t[yr](),!$(t.next))throw new TypeError(x("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(t=vp(t),t instanceof Error)throw t;t=new nr(t)}else throw new TypeError(x("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));else{if(t=arguments[0],!hp(t))throw new TypeError(x("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!te(e))throw new TypeError(x("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Q(e/rr))throw new RangeError(x("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",rr,e));if(r===2){if(n=t.byteLength-e,!Q(n/rr))throw new RangeError(x("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",rr,n));t=new nr(t,e)}else{if(n=arguments[2],!te(n))throw new TypeError(x("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*rr>t.byteLength-e)throw new RangeError(x("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*rr));t=new nr(t,e,n*2)}}return I(this,"_buffer",t),I(this,"_length",t.length/2),this}I(T,"BYTES_PER_ELEMENT",rr);I(T,"name","Complex64Array");I(T,"from",function(r){var t,n,i,a,s,o,f,u,l,p,y,m;if(!$(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!dp(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=arguments.length,n>1){if(i=arguments[1],!$(i))throw new TypeError(x("invalid argument. Second argument must be a function. Value: `%s`.",i));n>2&&(t=arguments[2])}if(V(r)){if(u=r.length,i){for(a=new this(u),s=a._buffer,m=0,y=0;y<u;y++){if(p=i.call(t,r.get(y),y),ir(p))s[m]=ur(p),s[m+1]=fr(p);else if(Kt(p)&&p.length>=2)s[m]=p[0],s[m+1]=p[1];else throw new TypeError(x("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",p));m+=2}return a}return new this(r)}if(rn(r)){if(i){for(u=r.length,r.get&&r.set?f=Ox("default"):f=Bx("default"),y=0;y<u;y++)if(!ir(f(r,y))){l=!0;break}if(l){if(!Ie(u))throw new RangeError(x("invalid argument. First argument must have a length which is a multiple of %u. Length: `%u`.",2,u));for(a=new this(u/2),s=a._buffer,y=0;y<u;y++)s[y]=i.call(t,f(r,y),y);return a}for(a=new this(u),s=a._buffer,m=0,y=0;y<u;y++){if(p=i.call(t,f(r,y),y),ir(p))s[m]=ur(p),s[m+1]=fr(p);else if(Kt(p)&&p.length>=2)s[m]=p[0],s[m+1]=p[1];else throw new TypeError(x("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",p));m+=2}return a}return new this(r)}if(en(r)&&bp&&$(r[yr])){if(s=r[yr](),!$(s.next))throw new TypeError(x("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(i?o=Vx(s,i,t):o=vp(s),o instanceof Error)throw o;for(u=o.length/2,a=new this(u),s=a._buffer,y=0;y<u;y++)s[y]=o[y];return a}throw new TypeError(x("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))});I(T,"of",function(){var r,t;if(!$(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!dp(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)});I(T.prototype,"at",function(r){if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Q(r))throw new TypeError(x("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return j(this._buffer,r)});De(T.prototype,"buffer",function(){return this._buffer.buffer});De(T.prototype,"byteLength",function(){return this._buffer.byteLength});De(T.prototype,"byteOffset",function(){return this._buffer.byteOffset});I(T.prototype,"BYTES_PER_ELEMENT",T.BYTES_PER_ELEMENT);I(T.prototype,"copyWithin",function(r,t){if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(r*2,t*2):this._buffer.copyWithin(r*2,t*2,arguments[2]*2),this});I(T.prototype,"entries",function(){var r,t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,i=this._buffer,n=this._length,s=-1,t={},I(t,"next",o),I(t,"return",f),yr&&I(t,yr,u),t;function o(){return s+=1,a||s>=n?{done:!0}:{value:[s,j(i,s)],done:!1}}function f(l){return a=!0,arguments.length?{value:l,done:!0}:{done:!0}}function u(){return r.entries()}});I(T.prototype,"every",function(r,t){var n,i;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(!r.call(t,j(n,i),i,this))return!1;return!0});I(T.prototype,"fill",function(r,t,n){var i,a,s,o,f,u;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ir(r))throw new TypeError(x("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(i=this._buffer,a=this._length,arguments.length>1){if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a,t<0&&(t=0)),arguments.length>2){if(!Q(n))throw new TypeError(x("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=a,n<0&&(n=0)),n>a&&(n=a)}else n=a}else t=0,n=a;for(o=ur(r),f=fr(r),u=t;u<n;u++)s=2*u,i[s]=o,i[s+1]=f;return this});I(T.prototype,"filter",function(r,t){var n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=[],a=0;a<this._length;a++)s=j(n,a),r.call(t,s,a,this)&&i.push(s);return new this.constructor(i)});I(T.prototype,"find",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(a=j(n,i),r.call(t,a,i,this))return a});I(T.prototype,"findIndex",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(a=j(n,i),r.call(t,a,i,this))return i;return-1});I(T.prototype,"findLast",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length-1;i>=0;i--)if(a=j(n,i),r.call(t,a,i,this))return a});I(T.prototype,"findLastIndex",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length-1;i>=0;i--)if(a=j(n,i),r.call(t,a,i,this))return i;return-1});I(T.prototype,"forEach",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)a=j(n,i),r.call(t,a,i,this)});I(T.prototype,"get",function(r){if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!te(r))throw new TypeError(x("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return j(this._buffer,r)});I(T.prototype,"includes",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ir(r))throw new TypeError(x("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(a=ur(r),s=fr(r),n=this._buffer,o=t;o<this._length;o++)if(i=2*o,a===n[i]&&s===n[i+1])return!0;return!1});I(T.prototype,"indexOf",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ir(r))throw new TypeError(x("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(a=ur(r),s=fr(r),n=this._buffer,o=t;o<this._length;o++)if(i=2*o,a===n[i]&&s===n[i+1])return o;return-1});I(T.prototype,"join",function(r){var t,n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=",";else if(gp(r))i=r;else throw new TypeError(x("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[],n=this._buffer,a=0;a<this._length;a++)t.push(j(n,a).toString());return t.join(i)});I(T.prototype,"keys",function(){var r,t,n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._length,a=-1,t={},I(t,"next",s),I(t,"return",o),yr&&I(t,yr,f),t;function s(){return a+=1,i||a>=n?{done:!0}:{value:a,done:!1}}function o(u){return i=!0,arguments.length?{value:u,done:!0}:{done:!0}}function f(){return r.keys()}});I(T.prototype,"lastIndexOf",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ir(r))throw new TypeError(x("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(a=ur(r),s=fr(r),n=this._buffer,o=t;o>=0;o--)if(i=2*o,a===n[i]&&s===n[i+1])return o;return-1});De(T.prototype,"length",function(){return this._length});I(T.prototype,"map",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(i=this._buffer,a=new this.constructor(this._length),n=a._buffer,s=0;s<this._length;s++)if(o=r.call(t,j(i,s),s,this),ir(o))n[2*s]=ur(o),n[2*s+1]=fr(o);else if(Kt(o)&&o.length===2)n[2*s]=o[0],n[2*s+1]=o[1];else throw new TypeError(x("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return a});I(T.prototype,"reduce",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,a=this._length,arguments.length>1)i=t,o=0;else{if(a===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=j(n,0),o=1}for(;o<a;o++)s=j(n,o),i=r(i,s,o,this);return i});I(T.prototype,"reduceRight",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,a=this._length,arguments.length>1)i=t,o=a-1;else{if(a===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=j(n,a-1),o=a-2}for(;o>=0;o--)s=j(n,o),i=r(i,s,o,this);return i});I(T.prototype,"reverse",function(){var r,t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,r=this._buffer,i=Ix(n/2),a=0;a<i;a++)s=n-a-1,t=r[2*a],r[2*a]=r[2*s],r[2*s]=t,t=r[2*a+1],r[2*a+1]=r[2*s+1],r[2*s+1]=t;return this});I(T.prototype,"set",function(r){var t,n,i,a,s,o,f,u,l;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,arguments.length>1){if(n=arguments[1],!te(n))throw new TypeError(x("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(ir(r)){if(n>=this._length)throw new RangeError(x("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));n*=2,i[n]=ur(r),i[n+1]=fr(r);return}if(V(r)){if(o=r._length,n+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,l=i.byteOffset+n*rr,t.buffer===i.buffer&&t.byteOffset<l&&t.byteOffset+t.byteLength>l){for(a=new nr(t.length),u=0;u<t.length;u++)a[u]=t[u];t=a}for(n*=2,l=0,u=0;u<o;u++)i[n]=t[l],i[n+1]=t[l+1],n+=2,l+=2;return}if(rn(r)){for(o=r.length,u=0;u<o;u++)if(!ir(r[u])){s=!0;break}if(s){if(!Ie(o))throw new RangeError(x("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",o));if(n+o/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,l=i.byteOffset+n*rr,t.buffer===i.buffer&&t.byteOffset<l&&t.byteOffset+t.byteLength>l){for(a=new nr(o),u=0;u<o;u++)a[u]=t[u];t=a}for(n*=2,o/=2,l=0,u=0;u<o;u++)i[n]=t[l],i[n+1]=t[l+1],n+=2,l+=2;return}if(n+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(n*=2,u=0;u<o;u++)f=r[u],i[n]=ur(f),i[n+1]=fr(f),n+=2;return}throw new TypeError(x("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r))});I(T.prototype,"slice",function(r,t){var n,i,a,s,o,f,u;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(o=this._buffer,f=this._length,arguments.length===0)r=0,t=f;else{if(!Q(r))throw new TypeError(x("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=f,r<0&&(r=0)),arguments.length===1)t=f;else{if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=f,t<0&&(t=0)):t>f&&(t=f)}}for(r<t?n=t-r:n=0,a=new this.constructor(n),i=a._buffer,u=0;u<n;u++)s=2*(u+r),i[2*u]=o[s],i[2*u+1]=o[s+1];return a});I(T.prototype,"some",function(r,t){var n,i;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(r.call(t,j(n,i),i,this))return!0;return!1});I(T.prototype,"sort",function(r){var t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length,t=[],a=0;a<i;a++)t.push(j(n,a));for(t.sort(r),a=0;a<i;a++)s=2*a,n[s]=ur(t[a]),n[s+1]=fr(t[a]);return this});I(T.prototype,"subarray",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,a=this._length,arguments.length===0)r=0,t=a;else{if(!Q(r))throw new TypeError(x("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a,r<0&&(r=0)),arguments.length===1)t=a;else{if(!Q(t))throw new TypeError(x("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a)}}return r>=a?(a=0,n=i.byteLength):r>=t?(a=0,n=i.byteOffset+r*rr):(a=t-r,n=i.byteOffset+r*rr),new this.constructor(i.buffer,n,a<0?0:a)});I(T.prototype,"toLocaleString",function(r,t){var n,i,a,s,o;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=[];else if(gp(r)||Ex(r))i=r;else throw new TypeError(x("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));if(arguments.length<2)n={};else if(en(t))n=t;else throw new TypeError(x("invalid argument. Options argument must be an object. Value: `%s`.",t));for(s=this._buffer,a=[],o=0;o<this._length;o++)a.push(j(s,o).toLocaleString(i,n));return a.join(",")});I(T.prototype,"toReversed",function(){var r,t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,t=new this.constructor(n),i=this._buffer,r=t._buffer,a=0;a<n;a++)s=n-a-1,r[2*a]=i[2*s],r[2*a+1]=i[2*s+1];return t});I(T.prototype,"toSorted",function(r){var t,n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!$(r))throw new TypeError(x("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length,t=[],a=0;a<i;a++)t.push(j(n,a));return t.sort(r),new T(t)});I(T.prototype,"toString",function(){var r,t,n;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=this._buffer,n=0;n<this._length;n++)r.push(j(t,n).toString());return r.join(",")});I(T.prototype,"values",function(){var r,t,n,i,a,s;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,a=this._buffer,n=this._length,s=-1,r={},I(r,"next",o),I(r,"return",f),yr&&I(r,yr,u),r;function o(){return s+=1,i||s>=n?{done:!0}:{value:j(a,s),done:!1}}function f(l){return i=!0,arguments.length?{value:l,done:!0}:{done:!0}}function u(){return t.values()}});I(T.prototype,"with",function(r,t){var n,i,a;if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!Q(r))throw new TypeError(x("invalid argument. First argument must be an integer. Value: `%s`.",r));if(a=this._length,r<0&&(r+=a),r<0||r>=a)throw new RangeError(x("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!ir(t))throw new TypeError(x("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return i=new this.constructor(this._buffer),n=i._buffer,n[2*r]=ur(t),n[2*r+1]=fr(t),i});wp.exports=T});var Ep=c((g6,xp)=>{"use strict";var zx=Ap();xp.exports=zx});var Tp=c((v6,Sp)=>{"use strict";function Fx(e){return e.re}Sp.exports=Fx});var ne=c((b6,_p)=>{"use strict";var Rx=Tp();_p.exports=Rx});var Ip=c((d6,qp)=>{"use strict";function Cx(e){return e.im}qp.exports=Cx});var ie=c((w6,Dp)=>{"use strict";var jx=Ip();Dp.exports=jx});var Bp=c((A6,Np)=>{"use strict";var Lx=Br(),Mx=br(),kx=Z(),Px=ne(),$x=ie();function Gx(e){var r,t,n;for(r=[];t=e.next(),!t.done;)if(n=t.value,Lx(n)&&n.length>=2)r.push(n[0],n[1]);else if(Mx(n))r.push(Px(n),$x(n));else return new TypeError(kx("invalid argument. An iterator must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",n));return r}Np.exports=Gx});var Vp=c((x6,Op)=>{"use strict";var Yx=Br(),Wx=br(),Zx=Z(),Jx=ne(),Hx=ie();function Xx(e,r,t){var n,i,a,s;for(n=[],s=-1;i=e.next(),!i.done;)if(s+=1,a=r.call(t,i.value,s),Yx(a)&&a.length>=2)n.push(a[0],a[1]);else if(Wx(a))n.push(Jx(a),Hx(a));else return new TypeError(Zx("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));return n}Op.exports=Xx});var zp=c((E6,Up)=>{"use strict";var Qx=br(),Kx=ne(),rE=ie();function eE(e,r){var t,n,i,a;for(t=r.length,a=0,i=0;i<t;i++){if(n=r[i],!Qx(n))return null;e[a]=Kx(n),e[a+1]=rE(n),a+=2}return e}Up.exports=eE});var Pp=c((S6,kp)=>{"use strict";var ae=we().isPrimitive,tn=Br(),nn=Jr(),Fp=Ae(),an=xe(),tE=Cr(),nE=Ee().primitives,Rp=Hr(),G=Se(),or=br(),Ne=Zt(),K=Nr(),iE=Jt(),aE=Ht(),oE=Kr(),mr=_e(),D=W(),Be=qe(),ar=ve(),Cp=Gt(),lr=ne(),cr=ie(),sE=Zr(),uE=Xt(),fE=Qt(),lE=Pr(),cE=Rr(),E=Z(),jp=Bp(),pE=Vp(),yE=zp(),er=ar.BYTES_PER_ELEMENT*2,Lp=oE();function U(e){return e instanceof _||typeof e=="object"&&e!==null&&(e.constructor.name==="Complex64Array"||e.constructor.name==="Complex128Array")&&typeof e._length=="number"&&typeof e._buffer=="object"}function Mp(e){return e===_||e.name==="Complex64Array"}function L(e,r){return r*=2,new Cp(e[r],e[r+1])}function _(){var e,r,t,n;if(r=arguments.length,!(this instanceof _))return r===0?new _:r===1?new _(arguments[0]):r===2?new _(arguments[0],arguments[1]):new _(arguments[0],arguments[1],arguments[2]);if(r===0)t=new ar(0);else if(r===1)if(ae(arguments[0]))t=new ar(arguments[0]*2);else if(nn(arguments[0]))if(t=arguments[0],n=t.length,n&&tE(t)&&or(t[0])){if(t=yE(new ar(n*2),t),t===null){if(!Ne(n))throw new RangeError(E("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new ar(arguments[0])}}else{if(iE(t))t=uE(t,0);else if(aE(t))t=fE(t,0);else if(!Ne(n))throw new RangeError(E("invalid argument. Array-like object and typed array arguments must have a length which is a multiple of two. Length: `%u`.",n));t=new ar(t)}else if(Fp(arguments[0])){if(t=arguments[0],!K(t.byteLength/er))throw new RangeError(E("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",er,t.byteLength));t=new ar(t)}else if(an(arguments[0])){if(t=arguments[0],Lp===!1)throw new TypeError(E("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",t));if(!G(t[mr]))throw new TypeError(E("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(t=t[mr](),!G(t.next))throw new TypeError(E("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",t));if(t=jp(t),t instanceof Error)throw t;t=new ar(t)}else throw new TypeError(E("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",arguments[0]));else{if(t=arguments[0],!Fp(t))throw new TypeError(E("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!ae(e))throw new TypeError(E("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!K(e/er))throw new RangeError(E("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",er,e));if(r===2){if(n=t.byteLength-e,!K(n/er))throw new RangeError(E("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",er,n));t=new ar(t,e)}else{if(n=arguments[2],!ae(n))throw new TypeError(E("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*er>t.byteLength-e)throw new RangeError(E("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*er));t=new ar(t,e,n*2)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(_,"BYTES_PER_ELEMENT",er);D(_,"name","Complex128Array");D(_,"from",function(r){var t,n,i,a,s,o,f,u,l,p,y,m;if(!G(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Mp(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(n=arguments.length,n>1){if(i=arguments[1],!G(i))throw new TypeError(E("invalid argument. Second argument must be a function. Value: `%s`.",i));n>2&&(t=arguments[2])}if(U(r)){if(u=r.length,i){for(a=new this(u),s=a._buffer,m=0,y=0;y<u;y++){if(p=i.call(t,r.get(y),y),or(p))s[m]=lr(p),s[m+1]=cr(p);else if(tn(p)&&p.length>=2)s[m]=p[0],s[m+1]=p[1];else throw new TypeError(E("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",p));m+=2}return a}return new this(r)}if(nn(r)){if(i){for(u=r.length,r.get&&r.set?f=cE("default"):f=lE("default"),y=0;y<u;y++)if(!or(f(r,y))){l=!0;break}if(l){if(!Ne(u))throw new RangeError(E("invalid argument. First argument must have a length which is a multiple of two. Length: `%u`.",u));for(a=new this(u/2),s=a._buffer,y=0;y<u;y++)s[y]=i.call(t,f(r,y),y);return a}for(a=new this(u),s=a._buffer,m=0,y=0;y<u;y++){if(p=i.call(t,f(r,y),y),or(p))s[m]=lr(p),s[m+1]=cr(p);else if(tn(p)&&p.length>=2)s[m]=p[0],s[m+1]=p[1];else throw new TypeError(E("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",p));m+=2}return a}return new this(r)}if(an(r)&&Lp&&G(r[mr])){if(s=r[mr](),!G(s.next))throw new TypeError(E("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));if(i?o=pE(s,i,t):o=jp(s),o instanceof Error)throw o;for(u=o.length/2,a=new this(u),s=a._buffer,y=0;y<u;y++)s[y]=o[y];return a}throw new TypeError(E("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))});D(_,"of",function(){var r,t;if(!G(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Mp(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)});D(_.prototype,"at",function(r){if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!K(r))throw new TypeError(E("invalid argument. Must provide an integer. Value: `%s`.",r));if(r<0&&(r+=this._length),!(r<0||r>=this._length))return L(this._buffer,r)});Be(_.prototype,"buffer",function(){return this._buffer.buffer});Be(_.prototype,"byteLength",function(){return this._buffer.byteLength});Be(_.prototype,"byteOffset",function(){return this._buffer.byteOffset});D(_.prototype,"BYTES_PER_ELEMENT",_.BYTES_PER_ELEMENT);D(_.prototype,"copyWithin",function(r,t){if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return arguments.length===2?this._buffer.copyWithin(r*2,t*2):this._buffer.copyWithin(r*2,t*2,arguments[2]*2),this});D(_.prototype,"entries",function(){var r,t,n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,r=this._buffer,i=this._length,s=-1,o=-2,n={},D(n,"next",f),D(n,"return",u),mr&&D(n,mr,l),n;function f(){var p;return s+=1,a||s>=i?{done:!0}:(o+=2,p=new Cp(r[o],r[o+1]),{value:[s,p],done:!1})}function u(p){return a=!0,arguments.length?{value:p,done:!0}:{done:!0}}function l(){return t.entries()}});D(_.prototype,"every",function(r,t){var n,i;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(!r.call(t,L(n,i),i,this))return!1;return!0});D(_.prototype,"fill",function(r,t,n){var i,a,s,o,f,u;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!or(r))throw new TypeError(E("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(i=this._buffer,a=this._length,arguments.length>1){if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a,t<0&&(t=0)),arguments.length>2){if(!K(n))throw new TypeError(E("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=a,n<0&&(n=0)),n>a&&(n=a)}else n=a}else t=0,n=a;for(o=lr(r),f=cr(r),u=t;u<n;u++)s=2*u,i[s]=o,i[s+1]=f;return this});D(_.prototype,"filter",function(r,t){var n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=[],a=0;a<this._length;a++)s=L(n,a),r.call(t,s,a,this)&&i.push(s);return new this.constructor(i)});D(_.prototype,"find",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(a=L(n,i),r.call(t,a,i,this))return a});D(_.prototype,"findIndex",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(a=L(n,i),r.call(t,a,i,this))return i;return-1});D(_.prototype,"findLast",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length-1;i>=0;i--)if(a=L(n,i),r.call(t,a,i,this))return a});D(_.prototype,"findLastIndex",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length-1;i>=0;i--)if(a=L(n,i),r.call(t,a,i,this))return i;return-1});D(_.prototype,"forEach",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)a=L(n,i),r.call(t,a,i,this)});D(_.prototype,"get",function(r){if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ae(r))throw new TypeError(E("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return L(this._buffer,r)});Be(_.prototype,"length",function(){return this._length});D(_.prototype,"includes",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!or(r))throw new TypeError(E("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(a=lr(r),s=cr(r),n=this._buffer,o=t;o<this._length;o++)if(i=2*o,a===n[i]&&s===n[i+1])return!0;return!1});D(_.prototype,"indexOf",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!or(r))throw new TypeError(E("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(a=lr(r),s=cr(r),n=this._buffer,o=t;o<this._length;o++)if(i=2*o,a===n[i]&&s===n[i+1])return o;return-1});D(_.prototype,"join",function(r){var t,n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=",";else if(Rp(r))i=r;else throw new TypeError(E("invalid argument. First argument must be a string. Value: `%s`.",r));for(t=[],n=this._buffer,a=0;a<this._length;a++)t.push(L(n,a).toString());return t.join(i)});D(_.prototype,"keys",function(){var r,t,n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return r=this,n=this._length,a=-1,t={},D(t,"next",s),D(t,"return",o),mr&&D(t,mr,f),t;function s(){return a+=1,i||a>=n?{done:!0}:{value:a,done:!1}}function o(u){return i=!0,arguments.length?{value:u,done:!0}:{done:!0}}function f(){return r.keys()}});D(_.prototype,"lastIndexOf",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!or(r))throw new TypeError(E("invalid argument. First argument must be a complex number. Value: `%s`.",r));if(arguments.length>1){if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(a=lr(r),s=cr(r),n=this._buffer,o=t;o>=0;o--)if(i=2*o,a===n[i]&&s===n[i+1])return o;return-1});D(_.prototype,"map",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(i=this._buffer,a=new this.constructor(this._length),n=a._buffer,s=0;s<this._length;s++)if(o=r.call(t,L(i,s),s,this),or(o))n[2*s]=lr(o),n[2*s+1]=cr(o);else if(tn(o)&&o.length===2)n[2*s]=o[0],n[2*s+1]=o[1];else throw new TypeError(E("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",o));return a});D(_.prototype,"reduce",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,a=this._length,arguments.length>1)i=t,o=0;else{if(a===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=L(n,0),o=1}for(;o<a;o++)s=L(n,o),i=r(i,s,o,this);return i});D(_.prototype,"reduceRight",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,a=this._length,arguments.length>1)i=t,o=a-1;else{if(a===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");i=L(n,a-1),o=a-2}for(;o>=0;o--)s=L(n,o),i=r(i,s,o,this);return i});D(_.prototype,"reverse",function(){var r,t,n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,r=this._buffer,i=sE(n/2),a=0;a<i;a++)s=n-a-1,t=r[2*a],r[2*a]=r[2*s],r[2*s]=t,t=r[2*a+1],r[2*a+1]=r[2*s+1],r[2*s+1]=t;return this});D(_.prototype,"set",function(r){var t,n,i,a,s,o,f,u,l;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,arguments.length>1){if(n=arguments[1],!ae(n))throw new TypeError(E("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(or(r)){if(n>=this._length)throw new RangeError(E("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));n*=2,i[n]=lr(r),i[n+1]=cr(r);return}if(U(r)){if(o=r._length,n+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r._buffer,l=i.byteOffset+n*er,t.buffer===i.buffer&&t.byteOffset<l&&t.byteOffset+t.byteLength>l){for(a=new ar(t.length),u=0;u<t.length;u++)a[u]=t[u];t=a}for(n*=2,l=0,u=0;u<o;u++)i[n]=t[l],i[n+1]=t[l+1],n+=2,l+=2;return}if(nn(r)){for(o=r.length,u=0;u<o;u++)if(!or(r[u])){s=!0;break}if(s){if(!Ne(o))throw new RangeError(E("invalid argument. Array-like object arguments must have a length which is a multiple of two. Length: `%u`.",o));if(n+o/2>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(t=r,l=i.byteOffset+n*er,t.buffer===i.buffer&&t.byteOffset<l&&t.byteOffset+t.byteLength>l){for(a=new ar(o),u=0;u<o;u++)a[u]=t[u];t=a}for(n*=2,o/=2,l=0,u=0;u<o;u++)i[n]=t[l],i[n+1]=t[l+1],n+=2,l+=2;return}if(n+o>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");for(n*=2,u=0;u<o;u++)f=r[u],i[n]=lr(f),i[n+1]=cr(f),n+=2;return}throw new TypeError(E("invalid argument. First argument must be either a complex number, an array-like object, or a complex number array. Value: `%s`.",r))});D(_.prototype,"slice",function(r,t){var n,i,a,s,o,f,u;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(o=this._buffer,f=this._length,arguments.length===0)r=0,t=f;else{if(!K(r))throw new TypeError(E("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=f,r<0&&(r=0)),arguments.length===1)t=f;else{if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=f,t<0&&(t=0)):t>f&&(t=f)}}for(r<t?n=t-r:n=0,a=new this.constructor(n),i=a._buffer,u=0;u<n;u++)s=2*(u+r),i[2*u]=o[s],i[2*u+1]=o[s+1];return a});D(_.prototype,"some",function(r,t){var n,i;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(r.call(t,L(n,i),i,this))return!0;return!1});D(_.prototype,"sort",function(r){var t,n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length,t=[],a=0;a<i;a++)t.push(L(n,a));for(t.sort(r),a=0;a<i;a++)s=2*a,n[s]=lr(t[a]),n[s+1]=cr(t[a]);return this});D(_.prototype,"subarray",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(i=this._buffer,a=this._length,arguments.length===0)r=0,t=a;else{if(!K(r))throw new TypeError(E("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a,r<0&&(r=0)),arguments.length===1)t=a;else{if(!K(t))throw new TypeError(E("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a)}}return r>=a?(a=0,n=i.byteLength):r>=t?(a=0,n=i.byteOffset+r*er):(a=t-r,n=i.byteOffset+r*er),new this.constructor(i.buffer,n,a<0?0:a)});D(_.prototype,"toLocaleString",function(r,t){var n,i,a,s,o;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(arguments.length===0)i=[];else if(Rp(r)||nE(r))i=r;else throw new TypeError(E("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));if(arguments.length<2)n={};else if(an(t))n=t;else throw new TypeError(E("invalid argument. Options argument must be an object. Value: `%s`.",t));for(s=this._buffer,a=[],o=0;o<this._length;o++)a.push(L(s,o).toLocaleString(i,n));return a.join(",")});D(_.prototype,"toReversed",function(){var r,t,n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(n=this._length,t=new this.constructor(n),i=this._buffer,r=t._buffer,a=0;a<n;a++)s=n-a-1,r[2*a]=i[2*s],r[2*a+1]=i[2*s+1];return t});D(_.prototype,"toSorted",function(r){var t,n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!G(r))throw new TypeError(E("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=this._length,t=[],a=0;a<i;a++)t.push(L(n,a));return t.sort(r),new _(t)});D(_.prototype,"toString",function(){var r,t,n;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");for(r=[],t=this._buffer,n=0;n<this._length;n++)r.push(L(t,n).toString());return r.join(",")});D(_.prototype,"values",function(){var r,t,n,i,a,s;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");return t=this,a=this._buffer,n=this._length,s=-1,r={},D(r,"next",o),D(r,"return",f),mr&&D(r,mr,u),r;function o(){return s+=1,i||s>=n?{done:!0}:{value:L(a,s),done:!1}}function f(l){return i=!0,arguments.length?{value:l,done:!0}:{done:!0}}function u(){return t.values()}});D(_.prototype,"with",function(r,t){var n,i,a;if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!K(r))throw new TypeError(E("invalid argument. First argument must be an integer. Value: `%s`.",r));if(a=this._length,r<0&&(r+=a),r<0||r>=a)throw new RangeError(E("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!or(t))throw new TypeError(E("invalid argument. Second argument must be a complex number. Value: `%s`.",t));return i=new this.constructor(this._buffer),n=i._buffer,n[2*r]=lr(t),n[2*r+1]=cr(t),i});kp.exports=_});var Gp=c((T6,$p)=>{"use strict";var mE=Pp();$p.exports=mE});var Wp=c((_6,Yp)=>{"use strict";var hE=jr();function gE(e){var r,t;for(r=[];t=e.next(),!t.done;)r.push(hE(t.value));return r}Yp.exports=gE});var Jp=c((q6,Zp)=>{"use strict";var vE=jr();function bE(e,r,t){var n,i,a;for(n=[],a=-1;i=e.next(),!i.done;)a+=1,n.push(vE(r.call(t,i.value,a)));return n}Zp.exports=bE});var Xp=c((I6,Hp)=>{"use strict";var dE=jr();function wE(e,r){var t,n;for(t=r.length,n=0;n<t;n++)e[n]=dE(r[n]);return e}Hp.exports=wE});var iy=c((D6,ny)=>{"use strict";var oe=we().isPrimitive,on=Jr(),Qp=Ae(),sn=xe(),Y=Se(),se=$t().isPrimitive,pr=de().isPrimitive,Kp=Hr().isPrimitive,AE=Ee().primitives,xE=Kr(),hr=_e(),N=W(),Oe=qe(),dr=xt(),R=jr(),EE=Pr(),SE=Zr(),TE=Rr(),B=Z(),ry=Wp(),_E=Jp(),qE=Xp(),Ur=dr.BYTES_PER_ELEMENT,ey=xE();function z(e){return typeof e=="object"&&e!==null&&e.constructor.name==="BooleanArray"&&e.BYTES_PER_ELEMENT===Ur}function ty(e){return e===q}function q(){var e,r,t,n,i;if(r=arguments.length,!(this instanceof q))return r===0?new q:r===1?new q(arguments[0]):r===2?new q(arguments[0],arguments[1]):new q(arguments[0],arguments[1],arguments[2]);if(r===0)t=new dr(0);else if(r===1)if(i=arguments[0],oe(i))t=new dr(i);else if(on(i))t=qE(new dr(i.length),i);else if(Qp(i))t=new dr(i);else if(sn(i)){if(ey===!1)throw new TypeError(B("invalid argument. Environment lacks Symbol.iterator support. Must provide a length, ArrayBuffer, typed array, or array-like object. Value: `%s`.",i));if(!Y(i[hr]))throw new TypeError(B("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));if(t=i[hr](),!Y(t.next))throw new TypeError(B("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));t=new dr(ry(t))}else throw new TypeError(B("invalid argument. Must provide a length, ArrayBuffer, typed array, array-like object, or an iterable. Value: `%s`.",i));else{if(t=arguments[0],!Qp(t))throw new TypeError(B("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!oe(e))throw new TypeError(B("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(r===2)t=new dr(t,e);else{if(n=arguments[2],!oe(n))throw new TypeError(B("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*Ur>t.byteLength-e)throw new RangeError(B("invalid arguments. ArrayBuffer has insufficient capacity. Either decrease the array length or provide a bigger buffer. Minimum capacity: `%u`.",n*Ur));t=new dr(t,e,n)}}return N(this,"_buffer",t),N(this,"_length",t.length),this}N(q,"BYTES_PER_ELEMENT",Ur);N(q,"name","BooleanArray");N(q,"from",function(r){var t,n,i,a,s,o,f,u,l;if(!Y(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ty(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(n=arguments.length,n>1){if(i=arguments[1],!Y(i))throw new TypeError(B("invalid argument. Second argument must be a function. Value: `%s`.",i));n>2&&(t=arguments[2])}if(on(r)){if(i){for(u=r.length,r.get&&r.set?f=TE("default"):f=EE("default"),a=new this(u),s=a._buffer,l=0;l<u;l++)s[l]=R(i.call(t,f(r,l),l));return a}return new this(r)}if(sn(r)&&ey&&Y(r[hr])){if(s=r[hr](),!Y(s.next))throw new TypeError(B("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r));for(i?o=_E(s,i,t):o=ry(s),u=o.length,a=new this(u),s=a._buffer,l=0;l<u;l++)s[l]=o[l];return a}throw new TypeError(B("invalid argument. First argument must be an array-like object or an iterable. Value: `%s`.",r))});N(q,"of",function(){var r,t;if(!Y(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ty(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],t=0;t<arguments.length;t++)r.push(arguments[t]);return new this(r)});N(q.prototype,"at",function(r){var t,n;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(r))throw new TypeError(B("invalid argument. Must provide an integer. Value: `%s`.",r));if(n=this._length,t=this._buffer,r<0&&(r+=n),!(r<0||r>=n))return R(t[r])});Oe(q.prototype,"buffer",function(){return this._buffer.buffer});Oe(q.prototype,"byteLength",function(){return this._buffer.byteLength});Oe(q.prototype,"byteOffset",function(){return this._buffer.byteOffset});N(q.prototype,"BYTES_PER_ELEMENT",q.BYTES_PER_ELEMENT);N(q.prototype,"copyWithin",function(r,t){if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return arguments.length===2?this._buffer.copyWithin(r,t):this._buffer.copyWithin(r,t,arguments[2]),this});N(q.prototype,"entries",function(){var r,t,n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,i=this._buffer,n=this._length,s=-1,t={},N(t,"next",o),N(t,"return",f),hr&&N(t,hr,u),t;function o(){return s+=1,a||s>=n?{done:!0}:{value:[s,R(i[s])],done:!1}}function f(l){return a=!0,arguments.length?{value:l,done:!0}:{done:!0}}function u(){return r.entries()}});N(q.prototype,"every",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(!r.call(t,R(n[i]),i,this))return!1;return!0});N(q.prototype,"fill",function(r,t,n){var i,a,s,o;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!se(r))throw new TypeError(B("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(i=this._buffer,a=this._length,arguments.length>1){if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));if(t<0&&(t+=a,t<0&&(t=0)),arguments.length>2){if(!pr(n))throw new TypeError(B("invalid argument. Third argument must be an integer. Value: `%s`.",n));n<0&&(n+=a,n<0&&(n=0)),n>a&&(n=a)}else n=a}else t=0,n=a;for(r?s=1:s=0,o=t;o<n;o++)i[o]=s;return this});N(q.prototype,"filter",function(r,t){var n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=[],a=0;a<this._length;a++)s=R(n[a]),r.call(t,s,a,this)&&i.push(s);return new this.constructor(i)});N(q.prototype,"find",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,a=0;a<this._length;a++)if(i=R(n[a]),r.call(t,i,a,this))return i});N(q.prototype,"findIndex",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,a=0;a<this._length;a++)if(i=R(n[a]),r.call(t,i,a,this))return a;return-1});N(q.prototype,"findLast",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,a=this._length-1;a>=0;a--)if(i=R(n[a]),r.call(t,i,a,this))return i});N(q.prototype,"findLastIndex",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,a=this._length-1;a>=0;a--)if(i=R(n[a]),r.call(t,i,a,this))return a;return-1});N(q.prototype,"forEach",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)r.call(t,R(n[i]),i,this)});N(q.prototype,"get",function(r){if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!oe(r))throw new TypeError(B("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return R(this._buffer[r])});N(q.prototype,"includes",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!se(r))throw new TypeError(B("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=this._buffer,i=t;i<this._length;i++)if(r===R(n[i]))return!0;return!1});N(q.prototype,"indexOf",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!se(r))throw new TypeError(B("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0&&(t+=this._length,t<0&&(t=0))}else t=0;for(n=this._buffer,i=t;i<this._length;i++)if(r===R(n[i]))return i;return-1});N(q.prototype,"join",function(r){var t,n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(arguments.length>0){if(!Kp(r))throw new TypeError(B("invalid argument. First argument must be a string. Value: `%s`.",r))}else r=",";for(t=this._buffer,n=[],i=0;i<this._length;i++)t[i]?n.push("true"):n.push("false");return n.join(r)});N(q.prototype,"keys",function(){var r,t,n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return r=this,n=this._length,a=-1,t={},N(t,"next",s),N(t,"return",o),hr&&N(t,hr,f),t;function s(){return a+=1,i||a>=n?{done:!0}:{value:a,done:!1}}function o(u){return i=!0,arguments.length?{value:u,done:!0}:{done:!0}}function f(){return r.keys()}});N(q.prototype,"lastIndexOf",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!se(r))throw new TypeError(B("invalid argument. First argument must be a boolean. Value: `%s`.",r));if(arguments.length>1){if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t>=this._length?t=this._length-1:t<0&&(t+=this._length)}else t=this._length-1;for(n=this._buffer,i=t;i>=0;i--)if(r===R(n[i]))return i;return-1});Oe(q.prototype,"length",function(){return this._length});N(q.prototype,"map",function(r,t){var n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError("invalid argument. First argument must be a function. Value: `%s`.",r);for(a=this._buffer,i=new this.constructor(this._length),n=i._buffer,s=0;s<this._length;s++)n[s]=R(r.call(t,R(a[s]),s,this));return i});N(q.prototype,"reduce",function(r,t){var n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1)a=t,s=0;else{if(i===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");a=R(n[0]),s=1}for(;s<i;s++)a=r(a,R(n[s]),s,this);return a});N(q.prototype,"reduceRight",function(r,t){var n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));if(n=this._buffer,i=this._length,arguments.length>1)a=t,s=i-1;else{if(i===0)throw new Error("invalid operation. If not provided an initial value, an array must contain at least one element.");a=R(n[i-1]),s=i-2}for(;s>=0;s--)a=r(a,R(n[s]),s,this);return a});N(q.prototype,"reverse",function(){var r,t,n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=this._buffer,n=this._length,i=SE(n/2),a=0;a<i;a++)s=n-a-1,t=r[a],r[a]=r[s],r[s]=t;return this});N(q.prototype,"set",function(r){var t,n,i,a,s,o,f;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(i=this._buffer,arguments.length>1){if(n=arguments[1],!oe(n))throw new TypeError(B("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(on(r)){if(s=r.length,n+s>this._length)throw new RangeError("invalid arguments. Target array lacks sufficient storage to accommodate source values.");if(z(r)?t=r._buffer:t=r,f=i.byteOffset+n*Ur,t.buffer===i.buffer&&t.byteOffset<f&&t.byteOffset+t.byteLength>f){for(a=new dr(t.length),o=0;o<t.length;o++)a[o]=t[o];t=a}for(o=0;o<s;n++,o++)i[n]=t[o]?1:0;return}if(n>=this._length)throw new RangeError(B("invalid argument. Index argument is out-of-bounds. Value: `%u`.",n));i[n]=r?1:0});N(q.prototype,"slice",function(r,t){var n,i,a,s,o,f;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(s=this._buffer,o=this._length,arguments.length===0)r=0,t=o;else{if(!pr(r))throw new TypeError(B("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=o,r<0&&(r=0)),arguments.length===1)t=o;else{if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o)}}for(r<t?n=t-r:n=0,a=new this.constructor(n),i=a._buffer,f=0;f<n;f++)i[f]=s[f+r];return a});N(q.prototype,"some",function(r,t){var n,i;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));for(n=this._buffer,i=0;i<this._length;i++)if(r.call(t,R(n[i]),i,this))return!0;return!1});N(q.prototype,"sort",function(r){var t;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(t=this._buffer,arguments.length===0)return t.sort(),this;if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));return t.sort(n),this;function n(i,a){return r(R(i),R(a))}});N(q.prototype,"subarray",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(i=this._buffer,a=this._length,arguments.length===0)r=0,t=a;else{if(!pr(r))throw new TypeError(B("invalid argument. First argument must be an integer. Value: `%s`.",r));if(r<0&&(r+=a,r<0&&(r=0)),arguments.length===1)t=a;else{if(!pr(t))throw new TypeError(B("invalid argument. Second argument must be an integer. Value: `%s`.",t));t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a)}}return r>=a?(a=0,n=i.byteLength):r>=t?(a=0,n=i.byteOffset+r*Ur):(a=t-r,n=i.byteOffset+r*Ur),new this.constructor(i.buffer,n,a<0?0:a)});N(q.prototype,"toLocaleString",function(r,t){var n,i,a,s,o;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(arguments.length===0)i=[];else if(Kp(r)||AE(r))i=r;else throw new TypeError(B("invalid argument. First argument must be a string or an array of strings. Value: `%s`.",r));if(arguments.length<2)n={};else if(sn(t))n=t;else throw new TypeError(B("invalid argument. Options argument must be an object. Value: `%s`.",t));for(s=this._buffer,a=[],o=0;o<this._length;o++)a.push(R(s[o]).toLocaleString(i,n));return a.join(",")});N(q.prototype,"toReversed",function(){var r,t,n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(n=this._length,t=new this.constructor(n),i=this._buffer,r=t._buffer,a=0;a<n;a++)r[a]=i[n-a-1];return t});N(q.prototype,"toSorted",function(r){var t,n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(i=this._length,n=new this.constructor(i),a=this._buffer,t=n._buffer,s=0;s<i;s++)t[s]=a[s];if(arguments.length===0)return t.sort(),n;if(!Y(r))throw new TypeError(B("invalid argument. First argument must be a function. Value: `%s`.",r));return t.sort(o),n;function o(f,u){return r(R(f),R(u))}});N(q.prototype,"toString",function(){var r,t,n;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");for(r=[],t=this._buffer,n=0;n<this._length;n++)t[n]?r.push("true"):r.push("false");return r.join(",")});N(q.prototype,"values",function(){var r,t,n,i,a,s;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");return t=this,a=this._buffer,n=this._length,s=-1,r={},N(r,"next",o),N(r,"return",f),hr&&N(r,hr,u),r;function o(){return s+=1,i||s>=n?{done:!0}:{value:R(a[s]),done:!1}}function f(l){return i=!0,arguments.length?{value:l,done:!0}:{done:!0}}function u(){return t.values()}});N(q.prototype,"with",function(r,t){var n,i,a;if(!z(this))throw new TypeError("invalid invocation. `this` is not a boolean array.");if(!pr(r))throw new TypeError(B("invalid argument. First argument must be an integer. Value: `%s`.",r));if(a=this._length,r<0&&(r+=a),r<0||r>=a)throw new RangeError(B("invalid argument. Index argument is out-of-bounds. Value: `%s`.",r));if(!se(t))throw new TypeError(B("invalid argument. Second argument must be a boolean. Value: `%s`.",t));return i=new this.constructor(this._buffer),n=i._buffer,t?n[r]=1:n[r]=0,i});ny.exports=q});var oy=c((N6,ay)=>{"use strict";var IE=iy();ay.exports=IE});var uy=c((B6,sy)=>{"use strict";var DE=ve(),NE=Yr(),BE=Yo(),OE=ys(),VE=Os(),UE=Ks(),zE=xt(),FE=Uu(),RE=ef(),CE=Ep(),jE=Gp(),LE=oy(),ME=[DE,NE,OE,BE,UE,VE,RE,zE,FE,CE,jE,LE];sy.exports=ME});var ly=c((O6,fy)=>{"use strict";var kE=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"];fy.exports=kE});var yy=c((V6,py)=>{"use strict";var PE=ft(),$E=Cr(),GE=ge(),YE=Wa(),WE=uy(),cy=ly(),ZE=cy.length;function JE(e){var r;if($E(e))return"generic";if(PE(e))return null;for(r=0;r<ZE;r++)if(e instanceof WE[r])return cy[r];return YE[GE(e)]||null}py.exports=JE});var un=c((U6,my)=>{"use strict";var HE=yy();my.exports=HE});var gy=c((z6,hy)=>{"use strict";var XE=rt(),QE=Rr(),KE=Pr(),rS=un();function eS(e,r){var t,n,i,a;for(i=rS(e),XE(e)?n=QE(i):n=KE(i),t=e.length,a=0;a<t;a++)if(n(e,a)===r)return!0;return!1}hy.exports=eS});var by=c((F6,vy)=>{"use strict";var tS=Jr(),nS=rt(),iS=Rr(),aS=un(),oS=Z();function sS(e){var r,t,n;if(!tS(e))throw new TypeError(oS("invalid argument. Must provide an array-like object. Value: `%s`.",e));return n=aS(e),nS(e)&&(r=iS(n)),t=e.length,r===void 0?i:a;function i(s){var o;for(o=0;o<t;o++)if(e[o]===s)return!0;return!1}function a(s){var o;for(o=0;o<t;o++)if(r(e,o)===s)return!0;return!1}}vy.exports=sS});var fn=c((R6,wy)=>{"use strict";var uS=W(),dy=gy(),fS=by();uS(dy,"factory",fS);wy.exports=dy});var Ay=c((C6,lS)=>{lS.exports=["row-major","column-major"]});var Ey=c((j6,xy)=>{"use strict";var cS=Ay();function pS(){return cS.slice()}xy.exports=pS});var Ty=c((L6,Sy)=>{"use strict";function yS(){return{"row-major":101,"column-major":102}}Sy.exports=yS});var Iy=c((M6,qy)=>{"use strict";var mS=W(),_y=Ey(),hS=Ty();mS(_y,"enum",hS);qy.exports=_y});var Ny=c((k6,Dy)=>{"use strict";var gS=fn().factory,vS=Iy(),bS=gS(vS());Dy.exports=bS});var Oy=c((P6,By)=>{"use strict";var dS=Ny();By.exports=dS});var Vy=c(($6,wS)=>{wS.exports=["no-transpose","transpose","conjugate-transpose"]});var zy=c((G6,Uy)=>{"use strict";var AS=Vy();function xS(){return AS.slice()}Uy.exports=xS});var Ry=c((Y6,Fy)=>{"use strict";function ES(){return{"no-transpose":111,transpose:112,"conjugate-transpose":113}}Fy.exports=ES});var Ly=c((W6,jy)=>{"use strict";var SS=W(),Cy=zy(),TS=Ry();SS(Cy,"enum",TS);jy.exports=Cy});var ky=c((Z6,My)=>{"use strict";var _S=fn().factory,qS=Ly(),IS=_S(qS());My.exports=IS});var ln=c((J6,Py)=>{"use strict";var DS=ky();Py.exports=DS});var Gy=c((H6,$y)=>{"use strict";function NS(e){return Math.abs(e)}$y.exports=NS});var Wy=c((X6,Yy)=>{"use strict";var BS=Gy();Yy.exports=BS});var Hy=c((Q6,Jy)=>{"use strict";var Zy=Wy();function OS(e){var r,t,n,i;if(r=e.length,r===0)return!1;for(t=Zy(e[0]),i=1;i<r;i++){if(n=Zy(e[i]),n>t)return!1;t=n}return!0}Jy.exports=OS});var Qy=c((K6,Xy)=>{"use strict";var VS=Hy();Xy.exports=VS});var rm=c((r2,Ky)=>{"use strict";function US(e,r){return r>0?0:(1-e)*r}Ky.exports=US});var tm=c((e2,em)=>{"use strict";var zS=rm();em.exports=zS});var cn=c((t2,nm)=>{"use strict";var ue=5;function FS(e,r,t,n,i,a,s){var o,f,u,l,p;if(o=0,e<=0)return o;if(f=n,u=s,t===1&&a===1){if(l=e%ue,l>0)for(p=0;p<l;p++)o+=r[f]*i[u],f+=1,u+=1;if(e<ue)return o;for(p=l;p<e;p+=ue)o+=r[f]*i[u]+r[f+1]*i[u+1]+r[f+2]*i[u+2]+r[f+3]*i[u+3]+r[f+4]*i[u+4],f+=ue,u+=ue;return o}for(p=0;p<e;p++)o+=r[f]*i[u],f+=t,u+=a;return o}nm.exports=FS});var om=c((n2,am)=>{"use strict";var im=tm(),RS=cn();function CS(e,r,t,n,i){var a,s;return e<=0?0:(a=im(e,t),s=im(e,i),RS(e,r,t,a,n,i,s))}am.exports=CS});var fm=c((i2,um)=>{"use strict";var jS=W(),sm=om(),LS=cn();jS(sm,"ndarray",LS);um.exports=sm});var lm=c((a2,MS)=>{MS.exports={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}});var pm=c((o2,cm)=>{"use strict";var kS=lm();function PS(e){return kS[e]||null}cm.exports=PS});var mm=c((s2,ym)=>{"use strict";var $S=pm();ym.exports=$S});var gm=c((u2,hm)=>{"use strict";var GS={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};hm.exports=GS});var dm=c((f2,bm)=>{"use strict";var vm=mm(),pn=gm();function YS(e,r){var t,n;return t=vm(e),n=vm(r),t===null||n===null?pn.BLOCK_SIZE_IN_ELEMENTS:t>n?pn.BLOCK_SIZE_IN_BYTES/t|0:pn.BLOCK_SIZE_IN_BYTES/n|0}bm.exports=YS});var Am=c((l2,wm)=>{"use strict";var WS=dm();wm.exports=WS});var yn=c((c2,Em)=>{"use strict";var Ue=Qy(),xm=fm().ndarray,ZS=Am(),wr=ZS("float64");function qr(e){return e!=="no-transpose"}function JS(e,r,t,n,i,a){var s,o,f,u,l,p,y;for(Ue([n,i])?(f=r,u=e,s=i,o=n-f*i):(f=e,u=r,s=n,o=i-f*n),y=a,p=0;p<u;p++){for(l=0;l<f;l++)t[y]=0,y+=s;y+=o}return t}function HS(e,r,t,n,i,a,s){var o,f,u,l,p,y,m;for(Ue([i,a])?(u=r,l=e,o=a,f=i-u*a):(u=e,l=r,o=i,f=a-u*i),m=s,y=0;y<l;y++){for(p=0;p<u;p++)n[m]*=t,m+=o;m+=f}return n}function Ve(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g){var v,w,A,S,O,C,F,M,gr,Lr,vr;for(O=r,C=e,v=s,w=u,A=h,S=m-O*h,vr=g,M=0;M<C;M++){for(gr=o+M*a,F=0;F<O;F++)Lr=p+F*l,y[vr]+=n*xm(t,i,v,gr,f,w,Lr),vr+=A;vr+=S}return y}function XS(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g){var v,w,A,S,O,C,F,M,gr,Lr,vr,Fe,Re,le,ce,xr,Er,hn,gn,pe,vn,bn,Sr;for(gr=r,Lr=e,v=s,w=u,A=h,Er=Lr;Er>0;)for(Er<wr?(Fe=Er,Er=0):(Fe=wr,Er-=wr),O=o+Er*a,M=g+Er*m,xr=gr;xr>0;)for(xr<wr?(vr=xr,xr=0):(vr=wr,xr-=wr),C=p+xr*l,F=M+xr*h,S=m-vr*h,Sr=t;Sr>0;)for(Sr<wr?(Re=Sr,Sr=0):(Re=wr,Sr-=wr),vn=O+Sr*s,bn=C+Sr*u,pe=F,ce=0;ce<Fe;ce++){for(hn=vn+ce*a,le=0;le<vr;le++)gn=bn+le*l,y[pe]+=n*xm(Re,i,v,hn,f,w,gn),pe+=A;pe+=S}return y}function QS(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g,v,w,A){var S,O,C,F,M,gr;if(t===0||n===0||h===1&&(a===0||i===0)||(h===0?g=JS(t,n,g,v,w,A):h!==1&&(g=HS(t,n,h,g,v,w,A)),a===0))return g;if(S=Ue([o,f]),O=Ue([p,y]),S){if(!qr(e)){if(!O&&!qr(r))return Ve(t,n,i,a,s,o,f,u,l,p,y,m,g,v,w,A);if(O&&qr(r))return Ve(t,n,i,a,s,o,f,u,l,y,p,m,g,v,w,A)}}else if(qr(e)){if(O&&qr(r))return Ve(t,n,i,a,s,f,o,u,l,y,p,m,g,v,w,A);if(!O&&!qr(r))return Ve(t,n,i,a,s,f,o,u,l,p,y,m,g,v,w,A)}return qr(e)?(C=f,F=o):(C=o,F=f),qr(r)?(M=y,gr=p):(M=p,gr=y),XS(t,n,i,a,s,C,F,u,l,M,gr,m,g,v,w,A)}Em.exports=QS});var _m=c((p2,Tm)=>{"use strict";var mn=Pi(),KS=Oy(),Sm=ln(),Ar=Z(),rT=yn();function eT(e,r,t,n,i,a,s,o,f,u,l,p,y,m){var h,g,v,w,A,S,O,C,F;if(!KS(e))throw new TypeError(Ar("invalid argument. First argument must be a valid order. Value: `%s`.",e));if(!Sm(r))throw new TypeError(Ar("invalid argument. Second argument must be a valid transpose operation. Value: `%s`.",r));if(!Sm(t))throw new TypeError(Ar("invalid argument. Third argument must be a valid transpose operation. Value: `%s`.",t));if(n<0)throw new RangeError(Ar("invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.",n));if(i<0)throw new RangeError(Ar("invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.",n));if(a<0)throw new RangeError(Ar("invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.",a));if(e==="row-major"&&r==="no-transpose"||e==="column-major"&&r==="transpose"?h=a:h=n,e==="row-major"&&t==="no-transpose"||e==="column-major"&&t==="transpose"?g=i:g=a,f<mn(1,h))throw new RangeError(Ar("invalid argument. Ninth argument must be greater than or equal to max(1,%d). Value: `%d`.",h,f));if(l<mn(1,g))throw new RangeError(Ar("invalid argument. Eleventh argument must be greater than or equal to max(1,%d). Value: `%d`.",g,l));if(e==="row-major"?v=i:v=n,m<mn(1,v))throw new RangeError(Ar("invalid argument. Fourteenth argument must be greater than or equal to max(1,%d). Value: `%d`.",v,m));return e==="column-major"?(w=1,A=f,S=1,O=l,C=1,F=m):(w=f,A=1,S=l,O=1,C=m,F=1),rT(r,t,n,i,a,s,o,w,A,0,u,S,O,0,p,y,C,F,0)}Tm.exports=eT});var Dm=c((y2,Im)=>{"use strict";var qm=ln(),fe=Z(),tT=yn();function nT(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g,v,w,A){if(!qm(e))throw new TypeError(fe("invalid argument. First argument must be a valid transpose operation. Value: `%s`.",e));if(!qm(r))throw new TypeError(fe("invalid argument. Second argument must be a valid transpose operation. Value: `%s`.",r));if(t<0)throw new RangeError(fe("invalid argument. Third argument must be a nonnegative integer. Value: `%d`.",t));if(n<0)throw new RangeError(fe("invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.",t));if(i<0)throw new RangeError(fe("invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.",i));return tT(e,r,t,n,i,a,s,o,f,u,l,p,y,m,h,g,v,w,A)}Im.exports=nT});var Om=c((m2,Bm)=>{"use strict";var iT=W(),Nm=_m(),aT=Dm();iT(Nm,"ndarray",aT);Bm.exports=Nm});function wn(e){if(!e.includes(":")){if(e.includes("."))throw new Error(`Invalid slice index: "${e}" (must be integer)`);let a=parseInt(e,10);if(isNaN(a))throw new Error(`Invalid slice index: "${e}"`);return{start:a,stop:null,step:1,isIndex:!0}}let r=e.split(":");if(r.length>3)throw new Error(`Invalid slice notation: "${e}" (too many colons)`);let t=r[0]===""?null:parseInt(r[0],10),n=r[1]===""||r[1]===void 0?null:parseInt(r[1],10),i=r[2]===""||r[2]===void 0?1:parseInt(r[2],10);if(t!==null&&isNaN(t))throw new Error(`Invalid start index in slice: "${e}"`);if(n!==null&&isNaN(n))throw new Error(`Invalid stop index in slice: "${e}"`);if(isNaN(i))throw new Error(`Invalid step in slice: "${e}"`);if(i===0)throw new Error("Slice step cannot be zero");return{start:t,stop:n,step:i,isIndex:!1}}function An(e,r){let{start:t,stop:n}=e,{step:i,isIndex:a}=e;if(a){if(t===null)throw new Error("Index cannot be null");let s=t<0?r+t:t;if(s<0||s>=r)throw new Error(`Index ${t} is out of bounds for size ${r}`);return{start:s,stop:s+1,step:1,isIndex:!0}}return i>0?(t===null&&(t=0),n===null&&(n=r)):(t===null&&(t=r-1),n===null&&(n=-r-1)),t<0&&(t=r+t),n<0&&(n=r+n),t=Math.max(0,Math.min(t,r)),n=Math.max(-1,Math.min(n,r)),{start:t,stop:n,step:i,isIndex:!1}}var H="float64";function X(e){switch(e){case"float64":return Float64Array;case"float32":return Float32Array;case"int64":return BigInt64Array;case"int32":return Int32Array;case"int16":return Int16Array;case"int8":return Int8Array;case"uint64":return BigUint64Array;case"uint32":return Uint32Array;case"uint16":return Uint16Array;case"uint8":return Uint8Array;case"bool":return Uint8Array;default:throw new Error(`Unknown dtype: ${e}`)}}function xn(e){return e==="float64"||e==="float32"}function d(e){return e==="int64"||e==="uint64"}function Tr(e,r){if(e===r)return e;if(e==="bool")return r;if(r==="bool")return e;if(xn(e)||xn(r)){if(e==="float64"||r==="float64")return"float64";if(e==="float32"){let u=r;return u==="int32"||u==="int64"||u==="uint32"||u==="uint64"?"float64":"float32"}if(r==="float32"){let u=e;return u==="int32"||u==="int64"||u==="uint32"||u==="uint64"?"float64":"float32"}return"float32"}let t=e.startsWith("int"),n=r.startsWith("int"),i=e.startsWith("uint"),a=r.startsWith("uint"),s=u=>u.includes("64")?64:u.includes("32")?32:u.includes("16")?16:u.includes("8")?8:0,o=s(e),f=s(r);if(e==="int64"&&r==="uint64"||e==="uint64"&&r==="int64")return"float64";if(t&&a&&o===f){if(o===8)return"int16";if(o===16)return"int32";if(o===32)return"int64"}if(i&&n&&o===f){if(f===8)return"int16";if(f===16)return"int32";if(f===32)return"int64"}if(t&&n||i&&a){let u=Math.max(o,f);return t?u===64?"int64":u===32?"int32":u===16?"int16":"int8":u===64?"uint64":u===32?"uint32":u===16?"uint16":"uint8"}return t&&a?o>f?e:f===8?"int16":f===16?"int32":f===32?"int64":"float64":i&&n?f>o?r:o===8?"int16":o===16?"int32":o===32?"int64":"float64":"float64"}var b=class e{constructor(r,t,n,i,a){this._data=r,this._shape=t,this._strides=n,this._offset=i,this._dtype=a}get shape(){return this._shape}get ndim(){return this._shape.length}get size(){return this._shape.reduce((r,t)=>r*t,1)}get dtype(){return this._dtype}get data(){return this._data}get strides(){return this._strides}get offset(){return this._offset}get isCContiguous(){let r=this._shape,t=this._strides,n=r.length;if(n===0)return!0;if(n===1)return t[0]===1;let i=1;for(let a=n-1;a>=0;a--){if(t[a]!==i)return!1;i*=r[a]}return!0}get isFContiguous(){let r=this._shape,t=this._strides,n=r.length;if(n===0)return!0;if(n===1)return t[0]===1;let i=1;for(let a=0;a<n;a++){if(t[a]!==i)return!1;i*=r[a]}return!0}iget(r){let t=this._shape,n=this._strides,i=t.length;if(i===0)return this._data[this._offset];let a=r,s=this._offset;for(let o=0;o<i;o++){let f=1;for(let l=o+1;l<i;l++)f*=t[l];let u=Math.floor(a/f);a=a%f,s+=u*n[o]}return this._data[s]}iset(r,t){let n=this._shape,i=this._strides,a=n.length;if(a===0){this._data[this._offset]=t;return}let s=r,o=this._offset;for(let f=0;f<a;f++){let u=1;for(let p=f+1;p<a;p++)u*=n[p];let l=Math.floor(s/u);s=s%u,o+=l*i[f]}this._data[o]=t}get(...r){let t=this._strides,n=this._offset;for(let i=0;i<r.length;i++)n+=r[i]*t[i];return this._data[n]}set(r,t){let n=this._strides,i=this._offset;for(let a=0;a<r.length;a++)i+=r[a]*n[a];this._data[i]=t}copy(){let r=Array.from(this._shape),t=this._dtype,n=this.size,i=X(t);if(!i)throw new Error(`Cannot copy array with dtype ${t}`);let a=new i(n);if(this.isCContiguous&&this._offset===0)if(d(t)){let s=this._data,o=a;for(let f=0;f<n;f++)o[f]=s[f]}else a.set(this._data);else if(d(t)){let s=a;for(let o=0;o<n;o++)s[o]=this.iget(o)}else for(let s=0;s<n;s++)a[s]=this.iget(s);return new e(a,r,e._computeStrides(r),0,t)}static fromData(r,t,n,i,a){let s=i??e._computeStrides(t),o=a??0;return new e(r,t,s,o,n)}static zeros(r,t=H){let n=r.reduce((s,o)=>s*o,1),i=X(t);if(!i)throw new Error(`Cannot create array with dtype ${t}`);let a=new i(n);return new e(a,r,e._computeStrides(r),0,t)}static ones(r,t=H){let n=r.reduce((s,o)=>s*o,1),i=X(t);if(!i)throw new Error(`Cannot create array with dtype ${t}`);let a=new i(n);return d(t)?a.fill(BigInt(1)):a.fill(1),new e(a,r,e._computeStrides(r),0,t)}static _computeStrides(r){let t=new Array(r.length),n=1;for(let i=r.length-1;i>=0;i--)t[i]=n,n*=r[i];return t}};function Ce(e){let r=new Array(e.length),t=1;for(let n=e.length-1;n>=0;n--)r[n]=t,t*=e[n];return r}function En(e,r){let t=e.length,n=r.length,i=Math.max(t,n),a=new Array(i);for(let s=0;s<i;s++){let o=s<i-t?1:e[s-(i-t)],f=s<i-n?1:r[s-(i-n)];if(o===f)a[s]=o;else if(o===1)a[s]=f;else if(f===1)a[s]=o;else throw new Error(`operands could not be broadcast together with shapes ${JSON.stringify(Array.from(e))} ${JSON.stringify(Array.from(r))}`)}return a}function Jm(e,r,t){let n=e.length,i=t.length,a=new Array(i).fill(0);for(let s=0;s<n;s++){let o=i-n+s,f=e[s],u=t[o];if(f===u)a[o]=r[s];else if(f===1)a[o]=0;else throw new Error("Invalid broadcast")}return a}function ye(e,r){let t=Jm(e.shape,e.strides,r);return b.fromData(e.data,Array.from(r),e.dtype,t,e.offset)}function sr(e,r,t,n){let i=En(e.shape,r.shape),a=ye(e,i),s=ye(r,i),o=Tr(e.dtype,r.dtype),f=b.zeros(i,o),u=f.data,l=f.size;if(d(o)){let p=u;for(let y=0;y<l;y++){let m=a.iget(y),h=s.iget(y),g=typeof m=="bigint"?m:BigInt(Math.round(m)),v=typeof h=="bigint"?h:BigInt(Math.round(h));n==="add"?p[y]=g+v:n==="subtract"?p[y]=g-v:n==="multiply"?p[y]=g*v:n==="divide"?p[y]=g/v:p[y]=BigInt(Math.round(t(Number(g),Number(v))))}}else{let p=d(e.dtype)||d(r.dtype);for(let y=0;y<l;y++){let m=a.iget(y),h=s.iget(y),g=Number(m),v=Number(h);u[y]=t(g,v)}}return f}function _r(e,r,t){let n=En(e.shape,r.shape),i=ye(e,n),a=ye(r,n),s=n.reduce((u,l)=>u*l,1),o=new Uint8Array(s),f=d(e.dtype)||d(r.dtype);for(let u=0;u<s;u++){let l=i.iget(u),p=a.iget(u),y=Number(l),m=Number(p);o[u]=t(y,m)?1:0}return b.fromData(o,n,"bool")}function Sn(e,r,t=!0){let n=e.dtype,i=Array.from(e.shape),a=e.size,o=t?n:n!=="float32"&&n!=="float64"?"float64":n,f=b.zeros(i,o),u=f.data,l=e.data;if(d(n))if(d(o)){let p=u;for(let y=0;y<a;y++){let m=Number(l[y]);p[y]=BigInt(Math.round(r(m)))}}else for(let p=0;p<a;p++)u[p]=r(Number(l[p]));else for(let p=0;p<a;p++)u[p]=r(Number(l[p]));return f}function je(e,r){return e.isCContiguous&&r.isCContiguous&&e.shape.length===r.shape.length&&e.shape.every((t,n)=>t===r.shape[n])}function Tn(e,r){return typeof r=="number"?Km(e,r):je(e,r)?Hm(e,r):sr(e,r,(t,n)=>t+n,"add")}function Hm(e,r){let t=Tr(e.dtype,r.dtype),n=b.zeros(Array.from(e.shape),t),i=e.size,a=e.data,s=r.data,o=n.data;if(d(t)){let f=o;if(!d(e.dtype)||!d(r.dtype))for(let l=0;l<i;l++){let p=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),y=typeof s[l]=="bigint"?s[l]:BigInt(Math.round(Number(s[l])));f[l]=p+y}else{let l=a,p=s;for(let y=0;y<i;y++)f[y]=l[y]+p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let l=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=l+p}else for(let u=0;u<i;u++)o[u]=a[u]+s[u];return n}function _n(e,r){return typeof r=="number"?rh(e,r):je(e,r)?Xm(e,r):sr(e,r,(t,n)=>t-n,"subtract")}function Xm(e,r){let t=Tr(e.dtype,r.dtype),n=b.zeros(Array.from(e.shape),t),i=e.size,a=e.data,s=r.data,o=n.data;if(d(t)){let f=o;if(!d(e.dtype)||!d(r.dtype))for(let l=0;l<i;l++){let p=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),y=typeof s[l]=="bigint"?s[l]:BigInt(Math.round(Number(s[l])));f[l]=p-y}else{let l=a,p=s;for(let y=0;y<i;y++)f[y]=l[y]-p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let l=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=l-p}else for(let u=0;u<i;u++)o[u]=a[u]-s[u];return n}function qn(e,r){return typeof r=="number"?eh(e,r):je(e,r)?Qm(e,r):sr(e,r,(t,n)=>t*n,"multiply")}function Qm(e,r){let t=Tr(e.dtype,r.dtype),n=b.zeros(Array.from(e.shape),t),i=e.size,a=e.data,s=r.data,o=n.data;if(d(t)){let f=o;if(!d(e.dtype)||!d(r.dtype))for(let l=0;l<i;l++){let p=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),y=typeof s[l]=="bigint"?s[l]:BigInt(Math.round(Number(s[l])));f[l]=p*y}else{let l=a,p=s;for(let y=0;y<i;y++)f[y]=l[y]*p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let l=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=l*p}else for(let u=0;u<i;u++)o[u]=a[u]*s[u];return n}function In(e,r){if(typeof r=="number")return th(e,r);let t=e.dtype==="float64",n=r.dtype==="float64",i=e.dtype==="float32",a=r.dtype==="float32";if(t||n){let f=t?e:zr(e,"float64"),u=n?r:zr(r,"float64");return sr(f,u,(l,p)=>l/p,"divide")}if(i||a){let f=i?e:zr(e,"float32"),u=a?r:zr(r,"float32");return sr(f,u,(l,p)=>l/p,"divide")}let s=zr(e,"float64"),o=zr(r,"float64");return sr(s,o,(f,u)=>f/u,"divide")}function zr(e,r){let t=b.zeros(Array.from(e.shape),r),n=e.size,i=e.data,a=t.data;for(let s=0;s<n;s++)a[s]=Number(i[s]);return t}function Km(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,l=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]+l}else for(let f=0;f<a;f++)o[f]=Number(i[f])+r;return s}function rh(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,l=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]-l}else for(let f=0;f<a;f++)o[f]=Number(i[f])-r;return s}function eh(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,l=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]*l}else for(let f=0;f<a;f++)o[f]=Number(i[f])*r;return s}function th(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,o=t!=="float32"&&t!=="float64"?"float64":t,f=b.zeros(n,o),u=f.data;if(d(t))for(let l=0;l<a;l++)u[l]=Number(i[l])/r;else for(let l=0;l<a;l++)u[l]=Number(i[l])/r;return f}function Dn(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,a=b.zeros(t,r),s=a.data;if(d(r)){let o=n,f=s;for(let u=0;u<i;u++){let l=o[u];f[u]=l<0n?-l:l}}else for(let o=0;o<i;o++)s[o]=Math.abs(Number(n[o]));return a}function Nn(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,a=b.zeros(t,r),s=a.data;if(d(r)){let o=n,f=s;for(let u=0;u<i;u++)f[u]=-o[u]}else for(let o=0;o<i;o++)s[o]=-Number(n[o]);return a}function Bn(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,a=b.zeros(t,r),s=a.data;if(d(r)){let o=n,f=s;for(let u=0;u<i;u++){let l=o[u];f[u]=l>0n?1n:l<0n?-1n:0n}}else for(let o=0;o<i;o++){let f=Number(n[o]);s[o]=f>0?1:f<0?-1:0}return a}function On(e,r){return typeof r=="number"?nh(e,r):sr(e,r,(t,n)=>(t%n+n)%n,"mod")}function nh(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,l=BigInt(Math.round(r));for(let p=0;p<a;p++){let y=f[p];u[p]=(y%l+l)%l}}else for(let f=0;f<a;f++){let u=Number(i[f]);o[f]=(u%r+r)%r}return s}function Vn(e,r){return typeof r=="number"?ih(e,r):sr(e,r,(t,n)=>Math.floor(t/n),"floor_divide")}function ih(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,s=b.zeros(n,t),o=s.data;if(d(t)){let f=i,u=o,l=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]/l}else for(let f=0;f<a;f++)o[f]=Math.floor(Number(i[f])/r);return s}function Un(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,a=b.zeros(t,r),s=a.data;for(let o=0;o<i;o++)s[o]=n[o];return a}function zn(e){let r=e.dtype,t=Array.from(e.shape),n=e.data,i=e.size,s=r!=="float32"&&r!=="float64"?"float64":r,o=b.zeros(t,s),f=o.data;if(d(r))for(let u=0;u<i;u++)f[u]=1/Number(n[u]);else for(let u=0;u<i;u++)f[u]=1/Number(n[u]);return o}function Fn(e,r){return typeof r=="number"?oh(e,r):_r(e,r,(t,n)=>t>n)}function Rn(e,r){return typeof r=="number"?sh(e,r):_r(e,r,(t,n)=>t>=n)}function Cn(e,r){return typeof r=="number"?uh(e,r):_r(e,r,(t,n)=>t<n)}function jn(e,r){return typeof r=="number"?fh(e,r):_r(e,r,(t,n)=>t<=n)}function Ln(e,r){return typeof r=="number"?lh(e,r):_r(e,r,(t,n)=>t===n)}function Mn(e,r){return typeof r=="number"?ch(e,r):_r(e,r,(t,n)=>t!==n)}function Le(e,r,t=1e-5,n=1e-8){return typeof r=="number"?ph(e,r,t,n):_r(e,r,(i,a)=>{let s=Math.abs(i-a),o=n+t*Math.abs(a);return s<=o})}function kn(e,r,t=1e-5,n=1e-8){let i=Le(e,r,t,n),a=i.data;for(let s=0;s<i.size;s++)if(a[s]===0)return!1;return!0}function oh(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]>r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function sh(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]>=r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function uh(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]<r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function fh(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]<=r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function lh(e,r){let t=new Uint8Array(e.size),n=e.data,i=e.dtype;if(d(i)){let a=BigInt(Math.round(r)),s=n;for(let o=0;o<e.size;o++)t[o]=s[o]===a?1:0}else for(let a=0;a<e.size;a++)t[a]=n[a]===r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function ch(e,r){let t=new Uint8Array(e.size),n=e.data;for(let i=0;i<e.size;i++)t[i]=n[i]!==r?1:0;return b.fromData(t,Array.from(e.shape),"bool")}function ph(e,r,t,n){let i=new Uint8Array(e.size),a=e.data,s=e.dtype;if(d(s)){let o=a;for(let f=0;f<e.size;f++){let u=Number(o[f]),l=Math.abs(u-r),p=n+t*Math.abs(r);i[f]=l<=p?1:0}}else for(let o=0;o<e.size;o++){let f=Number(a[o]),u=Math.abs(f-r),l=n+t*Math.abs(r);i[o]=u<=l?1:0}return b.fromData(i,Array.from(e.shape),"bool")}function k(e,r){let t=0,n=1;for(let i=e.length-1;i>=0;i--)t+=e[i]*n,n*=r[i];return t}function P(e,r,t,n){let i=n.length,a=new Array(i),s=Array.from(n).filter((f,u)=>u!==r),o=e;for(let f=s.length-1;f>=0;f--)a[f>=r?f+1:f]=o%s[f],o=Math.floor(o/s[f]);return a[r]=t,a}function Mr(e,r,t=!1){let n=e.dtype,i=e.shape,a=i.length,s=e.size,o=e.data;if(r===void 0)if(d(n)){let h=o,g=BigInt(0);for(let v=0;v<s;v++)g+=h[v];return Number(g)}else{let h=0;for(let g=0;g<s;g++)h+=Number(o[g]);return h}let f=r;if(f<0&&(f=a+f),f<0||f>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(i).filter((h,g)=>g!==f);if(u.length===0)return Mr(e);let l=b.zeros(u,n),p=l.data,y=i[f],m=u.reduce((h,g)=>h*g,1);if(d(n)){let h=o,g=p;for(let v=0;v<m;v++){let w=BigInt(0);for(let A=0;A<y;A++){let S=P(v,f,A,i),O=k(S,i);w+=h[O]}g[v]=w}}else for(let h=0;h<m;h++){let g=0;for(let v=0;v<y;v++){let w=P(h,f,v,i),A=k(w,i);g+=Number(o[A])}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return l}function Me(e,r,t=!1){let n=e.dtype,i=e.shape;if(r===void 0)return Mr(e)/e.size;let a=r;if(a<0&&(a=i.length+a),a<0||a>=i.length)throw new Error(`axis ${r} is out of bounds for array of dimension ${i.length}`);let s=Mr(e,r,t);if(typeof s=="number")return s/i[a];let o=i[a],f=n;(d(n)||n.startsWith("int")||n.startsWith("uint"))&&(f="float64");let u=b.zeros(Array.from(s.shape),f),l=u.data,p=s.data;if(d(n)){let y=p;for(let m=0;m<l.length;m++)l[m]=Number(y[m])/o}else for(let y=0;y<l.length;y++)l[y]=Number(p[y])/o;return u}function ke(e,r,t=!1){let n=e.dtype,i=e.shape,a=i.length,s=e.size,o=e.data;if(r===void 0){if(s===0)throw new Error("max of empty array");let h=o[0];for(let g=1;g<s;g++)o[g]>h&&(h=o[g]);return Number(h)}let f=r;if(f<0&&(f=a+f),f<0||f>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(i).filter((h,g)=>g!==f);if(u.length===0)return ke(e);let l=b.zeros(u,n),p=l.data,y=i[f],m=u.reduce((h,g)=>h*g,1);if(d(n)){let h=o,g=p;for(let v=0;v<m;v++){let w=P(v,f,0,i),A=k(w,i),S=h[A];for(let O=1;O<y;O++){let C=P(v,f,O,i),F=k(C,i),M=h[F];M>S&&(S=M)}g[v]=S}}else for(let h=0;h<m;h++){let g=-1/0;for(let v=0;v<y;v++){let w=P(h,f,v,i),A=k(w,i),S=Number(o[A]);S>g&&(g=S)}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return l}function Pe(e,r,t=!1){let n=e.dtype,i=e.shape,a=i.length,s=e.size,o=e.data;if(r===void 0)if(d(n)){let h=o,g=BigInt(1);for(let v=0;v<s;v++)g*=h[v];return Number(g)}else{let h=1;for(let g=0;g<s;g++)h*=Number(o[g]);return h}let f=r;if(f<0&&(f=a+f),f<0||f>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(i).filter((h,g)=>g!==f);if(u.length===0)return Pe(e);let l=b.zeros(u,n),p=l.data,y=i[f],m=u.reduce((h,g)=>h*g,1);if(d(n)){let h=o,g=p;for(let v=0;v<m;v++){let w=BigInt(1);for(let A=0;A<y;A++){let S=P(v,f,A,i),O=k(S,i);w*=h[O]}g[v]=w}}else for(let h=0;h<m;h++){let g=1;for(let v=0;v<y;v++){let w=P(h,f,v,i),A=k(w,i);g*=Number(o[A])}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return l}function $e(e,r,t=!1){let n=e.dtype,i=e.shape,a=i.length,s=e.size,o=e.data;if(r===void 0){if(s===0)throw new Error("min of empty array");let h=o[0];for(let g=1;g<s;g++)o[g]<h&&(h=o[g]);return Number(h)}let f=r;if(f<0&&(f=a+f),f<0||f>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(i).filter((h,g)=>g!==f);if(u.length===0)return $e(e);let l=b.zeros(u,n),p=l.data,y=i[f],m=u.reduce((h,g)=>h*g,1);if(d(n)){let h=o,g=p;for(let v=0;v<m;v++){let w=P(v,f,0,i),A=k(w,i),S=h[A];for(let O=1;O<y;O++){let C=P(v,f,O,i),F=k(C,i),M=h[F];M<S&&(S=M)}g[v]=S}}else for(let h=0;h<m;h++){let g=1/0;for(let v=0;v<y;v++){let w=P(h,f,v,i),A=k(w,i),S=Number(o[A]);S<g&&(g=S)}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return l}function Ge(e,r){let t=e.dtype,n=e.shape,i=n.length,a=e.size,s=e.data;if(r===void 0){if(a===0)throw new Error("argmin of empty array");let m=s[0],h=0;for(let g=1;g<a;g++)s[g]<m&&(m=s[g],h=g);return h}let o=r;if(o<0&&(o=i+o),o<0||o>=i)throw new Error(`axis ${r} is out of bounds for array of dimension ${i}`);let f=Array.from(n).filter((m,h)=>h!==o);if(f.length===0)return Ge(e);let u=b.zeros(f,"int32"),l=u.data,p=n[o],y=f.reduce((m,h)=>m*h,1);if(d(t)){let m=s;for(let h=0;h<y;h++){let g=P(h,o,0,n),v=k(g,n),w=m[v],A=0;for(let S=1;S<p;S++){let O=P(h,o,S,n),C=k(O,n),F=m[C];F<w&&(w=F,A=S)}l[h]=A}}else for(let m=0;m<y;m++){let h=1/0,g=0;for(let v=0;v<p;v++){let w=P(m,o,v,n),A=k(w,n),S=Number(s[A]);S<h&&(h=S,g=v)}l[m]=g}return u}function Ye(e,r){let t=e.dtype,n=e.shape,i=n.length,a=e.size,s=e.data;if(r===void 0){if(a===0)throw new Error("argmax of empty array");let m=s[0],h=0;for(let g=1;g<a;g++)s[g]>m&&(m=s[g],h=g);return h}let o=r;if(o<0&&(o=i+o),o<0||o>=i)throw new Error(`axis ${r} is out of bounds for array of dimension ${i}`);let f=Array.from(n).filter((m,h)=>h!==o);if(f.length===0)return Ye(e);let u=b.zeros(f,"int32"),l=u.data,p=n[o],y=f.reduce((m,h)=>m*h,1);if(d(t)){let m=s;for(let h=0;h<y;h++){let g=P(h,o,0,n),v=k(g,n),w=m[v],A=0;for(let S=1;S<p;S++){let O=P(h,o,S,n),C=k(O,n),F=m[C];F>w&&(w=F,A=S)}l[h]=A}}else for(let m=0;m<y;m++){let h=-1/0,g=0;for(let v=0;v<p;v++){let w=P(m,o,v,n),A=k(w,n),S=Number(s[A]);S>h&&(h=S,g=v)}l[m]=g}return u}function We(e,r,t=0,n=!1){let i=e.shape,a=i.length,s=e.size,o=e.data,f=Me(e,r,n);if(r===void 0){let w=f,A=0;for(let S=0;S<s;S++){let O=Number(o[S])-w;A+=O*O}return A/(s-t)}let u=r;if(u<0&&(u=a+u),u<0||u>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let l=i[u],p=f,y=p.data,m=n?p.shape:Array.from(i).filter((w,A)=>A!==u),h=b.zeros(Array.from(m),"float64"),g=h.data,v=m.reduce((w,A)=>w*A,1);for(let w=0;w<v;w++){let A=0,S=Number(y[w]);for(let O=0;O<l;O++){let C=P(w,u,O,i),F=k(C,i),M=Number(o[F])-S;A+=M*M}g[w]=A/(l-t)}return h}function Pn(e,r,t=0,n=!1){let i=We(e,r,t,n);if(typeof i=="number")return Math.sqrt(i);let a=b.zeros(Array.from(i.shape),"float64"),s=i.data,o=a.data;for(let f=0;f<s.length;f++)o[f]=Math.sqrt(Number(s[f]));return a}function Ze(e,r,t=!1){let n=e.shape,i=n.length,a=e.size,s=e.data;if(r===void 0){for(let m=0;m<a;m++)if(!s[m])return!1;return!0}let o=r;if(o<0&&(o=i+o),o<0||o>=i)throw new Error(`axis ${r} is out of bounds for array of dimension ${i}`);let f=Array.from(n).filter((m,h)=>h!==o);if(f.length===0)return Ze(e);let u=b.zeros(f,"bool"),l=u.data,p=n[o],y=f.reduce((m,h)=>m*h,1);for(let m=0;m<y;m++){let h=!0;for(let g=0;g<p;g++){let v=P(m,o,g,n),w=k(v,n);if(!s[w]){h=!1;break}}l[m]=h?1:0}if(t){let m=[...n];return m[o]=1,b.fromData(l,m,"bool")}return u}function Je(e,r,t=!1){let n=e.shape,i=n.length,a=e.size,s=e.data;if(r===void 0){for(let m=0;m<a;m++)if(s[m])return!0;return!1}let o=r;if(o<0&&(o=i+o),o<0||o>=i)throw new Error(`axis ${r} is out of bounds for array of dimension ${i}`);let f=Array.from(n).filter((m,h)=>h!==o);if(f.length===0)return Je(e);let u=b.zeros(f,"bool"),l=u.data,p=n[o],y=f.reduce((m,h)=>m*h,1);for(let m=0;m<y;m++){let h=!1;for(let g=0;g<p;g++){let v=P(m,o,g,n),w=k(v,n);if(s[w]){h=!0;break}}l[m]=h?1:0}if(t){let m=[...n];return m[o]=1,b.fromData(l,m,"bool")}return u}function $n(e,r){let t=e.size,n=e.dtype,i=r.indexOf(-1),a;if(i!==-1){let u=r.reduce((p,y,m)=>m===i?p:p*y,1),l=t/u;if(!Number.isInteger(l))throw new Error(`cannot reshape array of size ${t} into shape ${JSON.stringify(r)}`);a=r.map((p,y)=>y===i?l:p)}else a=r;if(a.reduce((u,l)=>u*l,1)!==t)throw new Error(`cannot reshape array of size ${t} into shape ${JSON.stringify(a)}`);if(e.isCContiguous){let u=e.data;return b.fromData(u,a,n,Ce(a),0)}let f=e.copy().data;return b.fromData(f,a,n,Ce(a),0)}function He(e){let r=e.shape,t=r.length,n=e.size,i=e.dtype,a=X(i);if(!a)throw new Error(`Cannot flatten array with dtype ${i}`);let s=new a(n),o=0,f=(u,l)=>{if(l===t){let p=e.get(...u);s[o++]=p;return}for(let p=0;p<r[l];p++)u[l]=p,f(u,l+1)};return f(new Array(t),0),b.fromData(s,[n],i,[1],0)}function Gn(e){let r=e.size,t=e.dtype;if(e.isCContiguous){let n=e.data;return b.fromData(n,[r],t,[1],0)}return He(e)}function Yn(e,r){let t=e.shape,n=t.length,i=e.strides,a=e.data,s=e.dtype,o;if(r===void 0)o=Array.from({length:n},(p,y)=>n-1-y);else{if(r.length!==n)throw new Error(`axes must have length ${n}, got ${r.length}`);let p=new Set;for(let y of r){let m=y<0?n+y:y;if(m<0||m>=n)throw new Error(`axis ${y} is out of bounds for array of dimension ${n}`);if(p.has(m))throw new Error("repeated axis in transpose");p.add(m)}o=r.map(y=>y<0?n+y:y)}let f=o.map(p=>t[p]),u=Array.from(i),l=o.map(p=>u[p]);return b.fromData(a,f,s,l,e.offset)}function Wn(e,r){let t=e.shape,n=t.length,i=e.strides,a=e.data,s=e.dtype;if(r===void 0){let o=[],f=[];for(let u=0;u<n;u++)t[u]!==1&&(o.push(t[u]),f.push(i[u]));return o.length===0&&(o.push(1),f.push(1)),b.fromData(a,o,s,f,e.offset)}else{let o=r<0?n+r:r;if(o<0||o>=n)throw new Error(`axis ${r} is out of bounds for array of dimension ${n}`);if(t[o]!==1)throw new Error(`cannot select an axis which has size not equal to one (axis ${r} has size ${t[o]})`);let f=[],u=[];for(let l=0;l<n;l++)l!==o&&(f.push(t[l]),u.push(i[l]));return b.fromData(a,f,s,u,e.offset)}}function Zn(e,r){let t=e.shape,n=t.length,i=e.strides,a=e.data,s=e.dtype,o=r;if(o<0&&(o=n+r+1),o<0||o>n)throw new Error(`axis ${r} is out of bounds for array of dimension ${n+1}`);let f=[...Array.from(t)];f.splice(o,0,1);let u=[...Array.from(i)],l=o<n?i[o]*(t[o]||1):1;return u.splice(o,0,l),b.fromData(a,f,s,u,e.offset)}var Vm=Zm(Om(),1);function Um(e,r){if(e.ndim!==2||r.ndim!==2)throw new Error("matmul requires 2D arrays");let[t=0,n=0]=e.shape,[i=0,a=0]=r.shape;if(n!==i)throw new Error(`matmul shape mismatch: (${t},${n}) @ (${i},${a})`);let s=Tr(e.dtype,r.dtype),o=s.startsWith("int")||s.startsWith("uint")||s==="bool"?"float64":s;if(o!=="float64")throw new Error(`matmul currently only supports float64, got ${o}`);let f=e.dtype==="float64"?e.data:Float64Array.from(Array.from(e.data).map(Number)),u=r.dtype==="float64"?r.data:Float64Array.from(Array.from(r.data).map(Number)),l=b.zeros([t,a],"float64");return(0,Vm.default)("row-major","no-transpose","no-transpose",t,a,n,1,f,n,u,a,0,l.data,a),l}function zm(e){return Sn(e,Math.sqrt,!1)}function Fm(e,r){return typeof r=="number"?sT(e,r):sr(e,r,Math.pow,"power")}function sT(e,r){let t=e.dtype,n=Array.from(e.shape),i=e.data,a=e.size,f=t!=="float32"&&t!=="float64"&&(r<0||!Number.isInteger(r))?"float64":t,u=b.zeros(n,f),l=u.data;if(d(t))if(d(f)&&Number.isInteger(r)&&r>=0){let p=i,y=l;for(let m=0;m<a;m++)y[m]=p[m]**BigInt(r)}else for(let p=0;p<a;p++)l[p]=Math.pow(Number(i[p]),r);else for(let p=0;p<a;p++)l[p]=Math.pow(Number(i[p]),r);return u}var tr=class e{constructor(r,t){this._storage=r,this._base=t}get storage(){return this._storage}static _fromStorage(r,t){return new e(r,t)}get shape(){return this._storage.shape}get ndim(){return this._storage.ndim}get size(){return this._storage.size}get dtype(){return this._storage.dtype}get data(){return this._storage.data}get strides(){return this._storage.strides}get flags(){return{C_CONTIGUOUS:this._storage.isCContiguous,F_CONTIGUOUS:this._storage.isFContiguous,OWNDATA:this._base===void 0}}get base(){return this._base??null}get(r){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);let t=r.map((n,i)=>{let a=n;if(a<0&&(a=this.shape[i]+a),a<0||a>=this.shape[i])throw new Error(`Index ${n} is out of bounds for axis ${i} with size ${this.shape[i]}`);return a});return this._storage.get(...t)}set(r,t){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);let n=r.map((s,o)=>{let f=s;if(f<0&&(f=this.shape[o]+f),f<0||f>=this.shape[o])throw new Error(`Index ${s} is out of bounds for axis ${o} with size ${this.shape[o]}`);return f}),i=this.dtype,a;d(i)?a=typeof t=="bigint"?t:BigInt(Math.round(t)):i==="bool"?a=t?1:0:a=Number(t),this._storage.set(n,a)}copy(){return new e(this._storage.copy())}astype(r,t=!0){let n=this.dtype;if(n===r&&!t)return this;if(n===r&&t)return this.copy();let i=Array.from(this.shape),a=this.size,s=X(r);if(!s)throw new Error(`Cannot convert to dtype ${r}`);let o=new s(a),f=this.data;if(d(n)&&!d(r)){let l=f;if(r==="bool")for(let p=0;p<a;p++)o[p]=l[p]!==BigInt(0)?1:0;else for(let p=0;p<a;p++)o[p]=Number(l[p])}else if(!d(n)&&d(r)){let l=f;for(let p=0;p<a;p++)o[p]=BigInt(Math.round(Number(l[p])))}else if(r==="bool"){let l=f;for(let p=0;p<a;p++)o[p]=l[p]!==0?1:0}else if(n==="bool"&&!d(r)){let l=f;for(let p=0;p<a;p++)o[p]=l[p]}else if(!d(n)&&!d(r)){let l=f;for(let p=0;p<a;p++)o[p]=l[p]}else{let l=f;for(let p=0;p<a;p++)o[p]=l[p]}let u=b.fromData(o,i,r);return new e(u)}add(r){let t=typeof r=="number"?r:r._storage,n=Tn(this._storage,t);return e._fromStorage(n)}subtract(r){let t=typeof r=="number"?r:r._storage,n=_n(this._storage,t);return e._fromStorage(n)}multiply(r){let t=typeof r=="number"?r:r._storage,n=qn(this._storage,t);return e._fromStorage(n)}divide(r){let t=typeof r=="number"?r:r._storage,n=In(this._storage,t);return e._fromStorage(n)}mod(r){let t=typeof r=="number"?r:r._storage,n=On(this._storage,t);return e._fromStorage(n)}floor_divide(r){let t=typeof r=="number"?r:r._storage,n=Vn(this._storage,t);return e._fromStorage(n)}positive(){let r=Un(this._storage);return e._fromStorage(r)}reciprocal(){let r=zn(this._storage);return e._fromStorage(r)}sqrt(){let r=zm(this._storage);return e._fromStorage(r)}power(r){let t=typeof r=="number"?r:r._storage,n=Fm(this._storage,t);return e._fromStorage(n)}absolute(){let r=Dn(this._storage);return e._fromStorage(r)}negative(){let r=Nn(this._storage);return e._fromStorage(r)}sign(){let r=Bn(this._storage);return e._fromStorage(r)}greater(r){let t=typeof r=="number"?r:r._storage,n=Fn(this._storage,t);return e._fromStorage(n)}greater_equal(r){let t=typeof r=="number"?r:r._storage,n=Rn(this._storage,t);return e._fromStorage(n)}less(r){let t=typeof r=="number"?r:r._storage,n=Cn(this._storage,t);return e._fromStorage(n)}less_equal(r){let t=typeof r=="number"?r:r._storage,n=jn(this._storage,t);return e._fromStorage(n)}equal(r){let t=typeof r=="number"?r:r._storage,n=Ln(this._storage,t);return e._fromStorage(n)}not_equal(r){let t=typeof r=="number"?r:r._storage,n=Mn(this._storage,t);return e._fromStorage(n)}isclose(r,t=1e-5,n=1e-8){let i=typeof r=="number"?r:r._storage,a=Le(this._storage,i,t,n);return e._fromStorage(a)}allclose(r,t=1e-5,n=1e-8){let i=typeof r=="number"?r:r._storage;return kn(this._storage,i,t,n)}sum(r,t=!1){let n=Mr(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}mean(r,t=!1){let n=Me(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}max(r,t=!1){let n=ke(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}min(r,t=!1){let n=$e(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}prod(r,t=!1){let n=Pe(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}argmin(r){let t=Ge(this._storage,r);return typeof t=="number"?t:e._fromStorage(t)}argmax(r){let t=Ye(this._storage,r);return typeof t=="number"?t:e._fromStorage(t)}var(r,t=0,n=!1){let i=We(this._storage,r,t,n);return typeof i=="number"?i:e._fromStorage(i)}std(r,t=0,n=!1){let i=Pn(this._storage,r,t,n);return typeof i=="number"?i:e._fromStorage(i)}all(r,t=!1){let n=Ze(this._storage,r,t);return typeof n=="boolean"?n:e._fromStorage(n)}any(r,t=!1){let n=Je(this._storage,r,t);return typeof n=="boolean"?n:e._fromStorage(n)}reshape(...r){let t=r.length===1&&Array.isArray(r[0])?r[0]:r,n=$n(this._storage,t),a=n.data===this.data?this._base??this:void 0;return e._fromStorage(n,a)}flatten(){let r=He(this._storage);return e._fromStorage(r)}ravel(){let r=Gn(this._storage),n=r.data===this.data?this._base??this:void 0;return e._fromStorage(r,n)}transpose(r){let t=Yn(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}squeeze(r){let t=Wn(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}expand_dims(r){let t=Zn(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}matmul(r){let t=Um(this._storage,r._storage);return e._fromStorage(t)}slice(...r){if(r.length===0)return this;if(r.length>this.ndim)throw new Error(`Too many indices for array: array is ${this.ndim}-dimensional, but ${r.length} were indexed`);let t=r.map((f,u)=>{let l=wn(f);return An(l,this.shape[u])});for(;t.length<this.ndim;)t.push({start:0,stop:this.shape[t.length],step:1,isIndex:!1});let n=[],i=[],a=this._storage.offset;for(let f=0;f<t.length;f++){let u=t[f],l=this._storage.strides[f];if(a+=u.start*l,!u.isIndex){let p;u.step>0?p=Math.max(0,Math.ceil((u.stop-u.start)/u.step)):p=Math.max(0,Math.ceil((u.start-u.stop)/Math.abs(u.step))),n.push(p),i.push(l*u.step)}}let s=b.fromData(this._storage.data,n,this._storage.dtype,i,a),o=this._base??this;return new e(s,o)}row(r){if(this.ndim<2)throw new Error("row() requires at least 2 dimensions");return this.slice(String(r),":")}col(r){if(this.ndim<2)throw new Error("col() requires at least 2 dimensions");return this.slice(":",String(r))}rows(r,t){if(this.ndim<2)throw new Error("rows() requires at least 2 dimensions");return this.slice(`${r}:${t}`,":")}cols(r,t){if(this.ndim<2)throw new Error("cols() requires at least 2 dimensions");return this.slice(":",`${r}:${t}`)}toString(){return`NDArray(shape=${JSON.stringify(this.shape)}, dtype=${this.dtype})`}toArray(){if(this.ndim===0)return this._storage.iget(0);let r=this.shape,t=r.length,n=(i,a)=>{if(a===t)return this._storage.get(...i);let s=[];for(let o=0;o<r[a];o++)i[a]=o,s.push(n(i,a+1));return s};return n(new Array(t),0)}};function ze(e,r=H){let t=b.zeros(e,r);return new tr(t)}function Rm(e,r=H){let t=b.ones(e,r);return new tr(t)}function fT(e){let r=[],t=e;for(;Array.isArray(t);)r.push(t.length),t=t[0];return r}function Cm(e){return typeof e=="bigint"?!0:Array.isArray(e)?e.some(r=>Cm(r)):!1}function lT(e){let r=[];function t(n){Array.isArray(n)?n.forEach(i=>t(i)):r.push(n)}return t(e),r}function Ir(e,r){if(e instanceof tr)return!r||e.dtype===r?e.copy():e.astype(r);let t=Cm(e),n=fT(e),i=n.reduce((l,p)=>l*p,1),a=r;a||(t?a="int64":a=H);let s=X(a);if(!s)throw new Error(`Cannot create array with dtype ${a}`);let o=new s(i),f=lT(e);if(d(a)){let l=o;for(let p=0;p<i;p++){let y=f[p];l[p]=typeof y=="bigint"?y:BigInt(Math.round(Number(y)))}}else if(a==="bool"){let l=o;for(let p=0;p<i;p++)l[p]=f[p]?1:0}else{let l=o;for(let p=0;p<i;p++){let y=f[p];l[p]=Number(y)}}let u=b.fromData(o,n,a);return new tr(u)}function cT(e,r,t=1,n=H){let i=e,a=r;if(r===void 0&&(i=0,a=e),a===void 0)throw new Error("stop is required");let s=Math.max(0,Math.ceil((a-i)/t)),o=X(n);if(!o)throw new Error(`Cannot create arange array with dtype ${n}`);let f=new o(s);if(d(n))for(let l=0;l<s;l++)f[l]=BigInt(Math.round(i+l*t));else if(n==="bool")for(let l=0;l<s;l++)f[l]=i+l*t!==0?1:0;else for(let l=0;l<s;l++)f[l]=i+l*t;let u=b.fromData(f,[s],n);return new tr(u)}function pT(e,r,t=50,n=H){if(t<0)throw new Error("num must be non-negative");if(t===0)return Ir([],n);if(t===1)return Ir([e],n);let i=X(n);if(!i)throw new Error(`Cannot create linspace array with dtype ${n}`);let a=new i(t),s=(r-e)/(t-1);if(d(n))for(let f=0;f<t;f++)a[f]=BigInt(Math.round(e+f*s));else if(n==="bool")for(let f=0;f<t;f++)a[f]=e+f*s!==0?1:0;else for(let f=0;f<t;f++)a[f]=e+f*s;let o=b.fromData(a,[t],n);return new tr(o)}function yT(e,r,t=50,n=10,i=H){if(t<0)throw new Error("num must be non-negative");if(t===0)return Ir([],i);if(t===1)return Ir([Math.pow(n,e)],i);let a=X(i);if(!a)throw new Error(`Cannot create logspace array with dtype ${i}`);let s=new a(t),o=(r-e)/(t-1);if(d(i))for(let u=0;u<t;u++){let l=e+u*o;s[u]=BigInt(Math.round(Math.pow(n,l)))}else if(i==="bool")for(let u=0;u<t;u++){let l=e+u*o;s[u]=Math.pow(n,l)!==0?1:0}else for(let u=0;u<t;u++){let l=e+u*o;s[u]=Math.pow(n,l)}let f=b.fromData(s,[t],i);return new tr(f)}function mT(e,r,t=50,n=H){if(t<0)throw new Error("num must be non-negative");if(e===0||r===0)throw new Error("Geometric sequence cannot include zero");if(t===0)return Ir([],n);if(t===1)return Ir([e],n);let i=Math.sign(e),a=Math.sign(r);if(i!==a)throw new Error("Geometric sequence cannot contain both positive and negative values");let s=X(n);if(!s)throw new Error(`Cannot create geomspace array with dtype ${n}`);let o=new s(t),f=Math.log(Math.abs(e)),l=(Math.log(Math.abs(r))-f)/(t-1);if(d(n))for(let y=0;y<t;y++){let m=i*Math.exp(f+y*l);o[y]=BigInt(Math.round(m))}else if(n==="bool")for(let y=0;y<t;y++){let m=i*Math.exp(f+y*l);o[y]=m!==0?1:0}else for(let y=0;y<t;y++){let m=i*Math.exp(f+y*l);o[y]=m}let p=b.fromData(o,[t],n);return new tr(p)}function jm(e,r,t=0,n=H){let i=r??e,a=ze([e,i],n),s=a.data;if(d(n)){let o=s;for(let f=0;f<e;f++){let u=f+t;u>=0&&u<i&&(o[f*i+u]=BigInt(1))}}else{let o=s;for(let f=0;f<e;f++){let u=f+t;u>=0&&u<i&&(o[f*i+u]=1)}}return a}function Lm(e,r=H){return ze(e,r)}function Mm(e,r,t){let n=t;n||(typeof r=="bigint"?n="int64":typeof r=="boolean"?n="bool":Number.isInteger(r)?n="int32":n=H);let i=X(n);if(!i)throw new Error(`Cannot create full array with dtype ${n}`);let a=e.reduce((f,u)=>f*u,1),s=new i(a);if(d(n)){let f=typeof r=="bigint"?r:BigInt(Math.round(Number(r)));s.fill(f)}else n==="bool"?s.fill(r?1:0):s.fill(Number(r));let o=b.fromData(s,e,n);return new tr(o)}function hT(e,r=H){return jm(e,e,0,r)}function gT(e,r){return e instanceof tr?!r||e.dtype===r?e:e.astype(r):Ir(e,r)}function vT(e){return e.copy()}function bT(e,r){return ze(Array.from(e.shape),r??e.dtype)}function dT(e,r){return Rm(Array.from(e.shape),r??e.dtype)}function wT(e,r){return Lm(Array.from(e.shape),r??e.dtype)}function AT(e,r,t){return Mm(Array.from(e.shape),r,t??e.dtype)}function xT(e){return e.sqrt()}function ET(e,r){return e.power(r)}function ST(e){return e.absolute()}function TT(e){return e.negative()}function _T(e){return e.sign()}function qT(e,r){return e.mod(r)}function IT(e,r){return e.floor_divide(r)}function DT(e){return e.positive()}function NT(e){return e.reciprocal()}var S2="0.3.0";export{tr as NDArray,S2 as __version__,ST as absolute,cT as arange,Ir as array,gT as asarray,vT as copy,Lm as empty,wT as empty_like,jm as eye,IT as floor_divide,Mm as full,AT as full_like,mT as geomspace,hT as identity,pT as linspace,yT as logspace,qT as mod,TT as negative,Rm as ones,dT as ones_like,DT as positive,ET as power,NT as reciprocal,_T as sign,xT as sqrt,ze as zeros,bT as zeros_like};
2
- /*! Bundled license information:
3
-
4
- @stdlib/utils/define-property/lib/define_property.js:
5
- @stdlib/utils/define-property/lib/has_define_property_support.js:
6
- @stdlib/regexp/function-name/lib/main.js:
7
- @stdlib/regexp/function-name/lib/index.js:
8
- @stdlib/complex/float32/real/lib/main.js:
9
- @stdlib/complex/float32/real/lib/index.js:
10
- @stdlib/complex/float32/imag/lib/main.js:
11
- @stdlib/complex/float32/imag/lib/index.js:
12
- @stdlib/strided/base/reinterpret-complex64/lib/main.js:
13
- @stdlib/strided/base/reinterpret-complex64/lib/index.js:
14
- @stdlib/strided/base/reinterpret-complex128/lib/main.js:
15
- @stdlib/strided/base/reinterpret-complex128/lib/index.js:
16
- @stdlib/math/base/special/abs/lib/main.js:
17
- (**
18
- * @license Apache-2.0
19
- *
20
- * Copyright (c) 2021 The Stdlib Authors.
21
- *
22
- * Licensed under the Apache License, Version 2.0 (the "License");
23
- * you may not use this file except in compliance with the License.
24
- * You may obtain a copy of the License at
25
- *
26
- * http://www.apache.org/licenses/LICENSE-2.0
27
- *
28
- * Unless required by applicable law or agreed to in writing, software
29
- * distributed under the License is distributed on an "AS IS" BASIS,
30
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
- * See the License for the specific language governing permissions and
32
- * limitations under the License.
33
- *)
34
-
35
- @stdlib/utils/define-property/lib/builtin.js:
36
- @stdlib/utils/define-property/lib/polyfill.js:
37
- @stdlib/utils/define-property/lib/index.js:
38
- @stdlib/utils/define-nonenumerable-read-only-property/lib/main.js:
39
- @stdlib/utils/define-nonenumerable-read-only-property/lib/index.js:
40
- @stdlib/math/base/special/fast/max/lib/main.js:
41
- @stdlib/math/base/special/fast/max/lib/index.js:
42
- @stdlib/assert/has-symbol-support/lib/main.js:
43
- @stdlib/assert/has-symbol-support/lib/index.js:
44
- @stdlib/assert/has-tostringtag-support/lib/main.js:
45
- @stdlib/assert/has-tostringtag-support/lib/index.js:
46
- @stdlib/utils/native-class/lib/tostring.js:
47
- @stdlib/utils/native-class/lib/main.js:
48
- @stdlib/assert/has-own-property/lib/main.js:
49
- @stdlib/assert/has-own-property/lib/index.js:
50
- @stdlib/symbol/ctor/lib/main.js:
51
- @stdlib/symbol/ctor/lib/index.js:
52
- @stdlib/utils/native-class/lib/tostringtag.js:
53
- @stdlib/utils/native-class/lib/polyfill.js:
54
- @stdlib/utils/native-class/lib/index.js:
55
- @stdlib/assert/is-array/lib/main.js:
56
- @stdlib/assert/is-array/lib/index.js:
57
- @stdlib/assert/tools/array-function/lib/main.js:
58
- @stdlib/assert/tools/array-function/lib/index.js:
59
- @stdlib/assert/is-object-like/lib/main.js:
60
- @stdlib/assert/is-object-like/lib/index.js:
61
- @stdlib/assert/is-buffer/lib/main.js:
62
- @stdlib/assert/is-buffer/lib/index.js:
63
- @stdlib/regexp/function-name/lib/regexp.js:
64
- @stdlib/utils/constructor-name/lib/main.js:
65
- @stdlib/utils/constructor-name/lib/index.js:
66
- @stdlib/assert/is-float64array/lib/main.js:
67
- @stdlib/assert/is-float64array/lib/index.js:
68
- @stdlib/assert/has-float64array-support/lib/float64array.js:
69
- @stdlib/assert/has-float64array-support/lib/main.js:
70
- @stdlib/assert/has-float64array-support/lib/index.js:
71
- @stdlib/array/float64/lib/main.js:
72
- @stdlib/array/float64/lib/polyfill.js:
73
- @stdlib/array/float64/lib/index.js:
74
- @stdlib/assert/is-float32array/lib/main.js:
75
- @stdlib/assert/is-float32array/lib/index.js:
76
- @stdlib/constants/float64/pinf/lib/index.js:
77
- @stdlib/assert/has-float32array-support/lib/float32array.js:
78
- @stdlib/assert/has-float32array-support/lib/main.js:
79
- @stdlib/assert/has-float32array-support/lib/index.js:
80
- @stdlib/array/float32/lib/main.js:
81
- @stdlib/array/float32/lib/polyfill.js:
82
- @stdlib/array/float32/lib/index.js:
83
- @stdlib/assert/is-uint32array/lib/main.js:
84
- @stdlib/assert/is-uint32array/lib/index.js:
85
- @stdlib/constants/uint32/max/lib/index.js:
86
- @stdlib/assert/has-uint32array-support/lib/uint32array.js:
87
- @stdlib/assert/has-uint32array-support/lib/main.js:
88
- @stdlib/assert/has-uint32array-support/lib/index.js:
89
- @stdlib/array/uint32/lib/main.js:
90
- @stdlib/array/uint32/lib/polyfill.js:
91
- @stdlib/array/uint32/lib/index.js:
92
- @stdlib/assert/is-int32array/lib/main.js:
93
- @stdlib/assert/is-int32array/lib/index.js:
94
- @stdlib/constants/int32/max/lib/index.js:
95
- @stdlib/constants/int32/min/lib/index.js:
96
- @stdlib/assert/has-int32array-support/lib/int32array.js:
97
- @stdlib/assert/has-int32array-support/lib/main.js:
98
- @stdlib/assert/has-int32array-support/lib/index.js:
99
- @stdlib/array/int32/lib/main.js:
100
- @stdlib/array/int32/lib/polyfill.js:
101
- @stdlib/array/int32/lib/index.js:
102
- @stdlib/assert/is-uint16array/lib/main.js:
103
- @stdlib/assert/is-uint16array/lib/index.js:
104
- @stdlib/constants/uint16/max/lib/index.js:
105
- @stdlib/assert/has-uint16array-support/lib/uint16array.js:
106
- @stdlib/assert/has-uint16array-support/lib/main.js:
107
- @stdlib/assert/has-uint16array-support/lib/index.js:
108
- @stdlib/array/uint16/lib/main.js:
109
- @stdlib/array/uint16/lib/polyfill.js:
110
- @stdlib/array/uint16/lib/index.js:
111
- @stdlib/assert/is-int16array/lib/main.js:
112
- @stdlib/assert/is-int16array/lib/index.js:
113
- @stdlib/constants/int16/max/lib/index.js:
114
- @stdlib/constants/int16/min/lib/index.js:
115
- @stdlib/assert/has-int16array-support/lib/int16array.js:
116
- @stdlib/assert/has-int16array-support/lib/main.js:
117
- @stdlib/assert/has-int16array-support/lib/index.js:
118
- @stdlib/array/int16/lib/main.js:
119
- @stdlib/array/int16/lib/polyfill.js:
120
- @stdlib/array/int16/lib/index.js:
121
- @stdlib/assert/is-uint8array/lib/main.js:
122
- @stdlib/assert/is-uint8array/lib/index.js:
123
- @stdlib/constants/uint8/max/lib/index.js:
124
- @stdlib/assert/has-uint8array-support/lib/uint8array.js:
125
- @stdlib/assert/has-uint8array-support/lib/main.js:
126
- @stdlib/assert/has-uint8array-support/lib/index.js:
127
- @stdlib/array/uint8/lib/main.js:
128
- @stdlib/array/uint8/lib/polyfill.js:
129
- @stdlib/array/uint8/lib/index.js:
130
- @stdlib/assert/is-uint8clampedarray/lib/main.js:
131
- @stdlib/assert/is-uint8clampedarray/lib/index.js:
132
- @stdlib/assert/has-uint8clampedarray-support/lib/uint8clampedarray.js:
133
- @stdlib/assert/has-uint8clampedarray-support/lib/main.js:
134
- @stdlib/assert/has-uint8clampedarray-support/lib/index.js:
135
- @stdlib/array/uint8c/lib/main.js:
136
- @stdlib/array/uint8c/lib/polyfill.js:
137
- @stdlib/array/uint8c/lib/index.js:
138
- @stdlib/assert/is-int8array/lib/main.js:
139
- @stdlib/assert/is-int8array/lib/index.js:
140
- @stdlib/constants/int8/max/lib/index.js:
141
- @stdlib/constants/int8/min/lib/index.js:
142
- @stdlib/assert/has-int8array-support/lib/int8array.js:
143
- @stdlib/assert/has-int8array-support/lib/main.js:
144
- @stdlib/assert/has-int8array-support/lib/index.js:
145
- @stdlib/array/int8/lib/main.js:
146
- @stdlib/array/int8/lib/polyfill.js:
147
- @stdlib/array/int8/lib/index.js:
148
- @stdlib/assert/is-number/lib/primitive.js:
149
- @stdlib/number/ctor/lib/main.js:
150
- @stdlib/number/ctor/lib/index.js:
151
- @stdlib/assert/is-number/lib/tostring.js:
152
- @stdlib/assert/is-number/lib/try2serialize.js:
153
- @stdlib/assert/is-number/lib/object.js:
154
- @stdlib/assert/is-number/lib/main.js:
155
- @stdlib/assert/is-number/lib/index.js:
156
- @stdlib/constants/float64/ninf/lib/index.js:
157
- @stdlib/math/base/special/floor/lib/main.js:
158
- @stdlib/math/base/special/floor/lib/index.js:
159
- @stdlib/math/base/assert/is-integer/lib/main.js:
160
- @stdlib/math/base/assert/is-integer/lib/index.js:
161
- @stdlib/assert/is-integer/lib/integer.js:
162
- @stdlib/assert/is-integer/lib/primitive.js:
163
- @stdlib/assert/is-integer/lib/object.js:
164
- @stdlib/assert/is-integer/lib/main.js:
165
- @stdlib/assert/is-integer/lib/index.js:
166
- @stdlib/assert/is-nonnegative-integer/lib/primitive.js:
167
- @stdlib/assert/is-nonnegative-integer/lib/object.js:
168
- @stdlib/assert/is-nonnegative-integer/lib/main.js:
169
- @stdlib/assert/is-nonnegative-integer/lib/index.js:
170
- @stdlib/constants/array/max-array-length/lib/index.js:
171
- @stdlib/assert/is-array-like-object/lib/main.js:
172
- @stdlib/assert/is-array-like-object/lib/index.js:
173
- @stdlib/constants/array/max-typed-array-length/lib/index.js:
174
- @stdlib/assert/is-collection/lib/main.js:
175
- @stdlib/assert/is-collection/lib/index.js:
176
- @stdlib/assert/is-arraybuffer/lib/main.js:
177
- @stdlib/assert/is-arraybuffer/lib/index.js:
178
- @stdlib/assert/is-object/lib/main.js:
179
- @stdlib/assert/is-object/lib/index.js:
180
- @stdlib/assert/is-string/lib/primitive.js:
181
- @stdlib/assert/is-string/lib/valueof.js:
182
- @stdlib/assert/is-string/lib/try2valueof.js:
183
- @stdlib/assert/is-string/lib/object.js:
184
- @stdlib/assert/is-string/lib/main.js:
185
- @stdlib/assert/is-string/lib/index.js:
186
- @stdlib/assert/is-string-array/lib/index.js:
187
- @stdlib/utils/type-of/lib/fixtures/re.js:
188
- @stdlib/assert/is-boolean/lib/primitive.js:
189
- @stdlib/assert/is-boolean/lib/tostring.js:
190
- @stdlib/assert/is-boolean/lib/try2serialize.js:
191
- @stdlib/assert/is-boolean/lib/object.js:
192
- @stdlib/assert/is-boolean/lib/main.js:
193
- @stdlib/assert/is-boolean/lib/index.js:
194
- @stdlib/utils/global/lib/codegen.js:
195
- @stdlib/utils/global/lib/self.js:
196
- @stdlib/utils/global/lib/window.js:
197
- @stdlib/utils/type-of/lib/fixtures/nodelist.js:
198
- @stdlib/utils/type-of/lib/fixtures/typedarray.js:
199
- @stdlib/utils/type-of/lib/check.js:
200
- @stdlib/utils/type-of/lib/main.js:
201
- @stdlib/utils/type-of/lib/polyfill.js:
202
- @stdlib/utils/type-of/lib/index.js:
203
- @stdlib/assert/is-function/lib/main.js:
204
- @stdlib/assert/is-function/lib/index.js:
205
- @stdlib/complex/float64/ctor/lib/tostring.js:
206
- @stdlib/complex/float64/ctor/lib/tojson.js:
207
- @stdlib/complex/float64/ctor/lib/main.js:
208
- @stdlib/complex/float64/ctor/lib/index.js:
209
- @stdlib/number/float64/base/to-float32/lib/main.js:
210
- @stdlib/number/float64/base/to-float32/lib/polyfill.js:
211
- @stdlib/number/float64/base/to-float32/lib/index.js:
212
- @stdlib/complex/float32/ctor/lib/tostring.js:
213
- @stdlib/complex/float32/ctor/lib/tojson.js:
214
- @stdlib/complex/float32/ctor/lib/main.js:
215
- @stdlib/complex/float32/ctor/lib/index.js:
216
- @stdlib/assert/is-complex-like/lib/main.js:
217
- @stdlib/assert/is-complex-like/lib/index.js:
218
- @stdlib/math/base/assert/is-even/lib/main.js:
219
- @stdlib/math/base/assert/is-even/lib/index.js:
220
- @stdlib/assert/has-iterator-symbol-support/lib/main.js:
221
- @stdlib/assert/has-iterator-symbol-support/lib/index.js:
222
- @stdlib/symbol/iterator/lib/main.js:
223
- @stdlib/symbol/iterator/lib/index.js:
224
- @stdlib/utils/define-nonenumerable-read-only-accessor/lib/main.js:
225
- @stdlib/utils/define-nonenumerable-read-only-accessor/lib/index.js:
226
- @stdlib/array/complex64/lib/from_iterator.js:
227
- @stdlib/array/complex64/lib/from_iterator_map.js:
228
- @stdlib/array/complex64/lib/from_array.js:
229
- @stdlib/array/complex64/lib/main.js:
230
- @stdlib/array/complex64/lib/index.js:
231
- @stdlib/complex/float64/real/lib/main.js:
232
- @stdlib/complex/float64/real/lib/index.js:
233
- @stdlib/complex/float64/imag/lib/main.js:
234
- @stdlib/complex/float64/imag/lib/index.js:
235
- @stdlib/array/complex128/lib/from_iterator.js:
236
- @stdlib/array/complex128/lib/from_iterator_map.js:
237
- @stdlib/array/complex128/lib/from_array.js:
238
- @stdlib/array/complex128/lib/index.js:
239
- @stdlib/array/dtype/lib/main.js:
240
- @stdlib/array/dtype/lib/index.js:
241
- @stdlib/math/base/special/abs/lib/index.js:
242
- @stdlib/ndarray/base/assert/is-row-major/lib/main.js:
243
- @stdlib/ndarray/base/assert/is-row-major/lib/index.js:
244
- @stdlib/ndarray/base/bytes-per-element/lib/main.js:
245
- @stdlib/ndarray/base/bytes-per-element/lib/index.js:
246
- (**
247
- * @license Apache-2.0
248
- *
249
- * Copyright (c) 2018 The Stdlib Authors.
250
- *
251
- * Licensed under the Apache License, Version 2.0 (the "License");
252
- * you may not use this file except in compliance with the License.
253
- * You may obtain a copy of the License at
254
- *
255
- * http://www.apache.org/licenses/LICENSE-2.0
256
- *
257
- * Unless required by applicable law or agreed to in writing, software
258
- * distributed under the License is distributed on an "AS IS" BASIS,
259
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
260
- * See the License for the specific language governing permissions and
261
- * limitations under the License.
262
- *)
263
-
264
- @stdlib/string/base/format-interpolate/lib/is_number.js:
265
- @stdlib/string/base/format-interpolate/lib/zero_pad.js:
266
- @stdlib/string/base/format-interpolate/lib/format_integer.js:
267
- @stdlib/string/base/format-interpolate/lib/is_string.js:
268
- @stdlib/string/base/format-interpolate/lib/format_double.js:
269
- @stdlib/string/base/format-interpolate/lib/space_pad.js:
270
- @stdlib/string/base/format-interpolate/lib/main.js:
271
- @stdlib/string/base/format-interpolate/lib/index.js:
272
- @stdlib/string/base/format-tokenize/lib/main.js:
273
- @stdlib/string/base/format-tokenize/lib/index.js:
274
- @stdlib/string/format/lib/is_string.js:
275
- @stdlib/string/format/lib/main.js:
276
- @stdlib/string/format/lib/index.js:
277
- @stdlib/array/base/assert/is-accessor-array/lib/main.js:
278
- @stdlib/array/base/assert/is-accessor-array/lib/index.js:
279
- @stdlib/array/base/accessor-getter/lib/main.js:
280
- @stdlib/array/base/accessor-getter/lib/index.js:
281
- @stdlib/array/base/getter/lib/main.js:
282
- @stdlib/array/base/getter/lib/index.js:
283
- @stdlib/boolean/ctor/lib/main.js:
284
- @stdlib/boolean/ctor/lib/index.js:
285
- @stdlib/utils/global/lib/global_this.js:
286
- @stdlib/utils/global/lib/browser.js:
287
- @stdlib/ndarray/base/unary-tiling-block-size/lib/defaults.js:
288
- @stdlib/ndarray/base/unary-tiling-block-size/lib/main.js:
289
- @stdlib/ndarray/base/unary-tiling-block-size/lib/index.js:
290
- (**
291
- * @license Apache-2.0
292
- *
293
- * Copyright (c) 2022 The Stdlib Authors.
294
- *
295
- * Licensed under the Apache License, Version 2.0 (the "License");
296
- * you may not use this file except in compliance with the License.
297
- * You may obtain a copy of the License at
298
- *
299
- * http://www.apache.org/licenses/LICENSE-2.0
300
- *
301
- * Unless required by applicable law or agreed to in writing, software
302
- * distributed under the License is distributed on an "AS IS" BASIS,
303
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
304
- * See the License for the specific language governing permissions and
305
- * limitations under the License.
306
- *)
307
-
308
- @stdlib/array/dtype/lib/ctor2dtype.js:
309
- @stdlib/array/base/assert/is-complex64array/lib/main.js:
310
- @stdlib/array/base/assert/is-complex64array/lib/index.js:
311
- @stdlib/array/base/assert/is-complex128array/lib/main.js:
312
- @stdlib/array/base/assert/is-complex128array/lib/index.js:
313
- @stdlib/array/complex128/lib/main.js:
314
- @stdlib/array/bool/lib/from_iterator.js:
315
- @stdlib/array/bool/lib/from_iterator_map.js:
316
- @stdlib/array/bool/lib/from_array.js:
317
- @stdlib/array/bool/lib/main.js:
318
- @stdlib/array/bool/lib/index.js:
319
- @stdlib/array/dtype/lib/ctors.js:
320
- @stdlib/array/dtype/lib/dtypes.js:
321
- @stdlib/blas/base/layouts/lib/main.js:
322
- @stdlib/blas/base/layouts/lib/enum.js:
323
- @stdlib/blas/base/layouts/lib/index.js:
324
- @stdlib/blas/base/assert/is-layout/lib/main.js:
325
- @stdlib/blas/base/assert/is-layout/lib/index.js:
326
- @stdlib/blas/base/transpose-operations/lib/main.js:
327
- @stdlib/blas/base/transpose-operations/lib/enum.js:
328
- @stdlib/blas/base/transpose-operations/lib/index.js:
329
- @stdlib/blas/base/assert/is-transpose-operation/lib/main.js:
330
- @stdlib/blas/base/assert/is-transpose-operation/lib/index.js:
331
- @stdlib/strided/base/stride2offset/lib/main.js:
332
- @stdlib/strided/base/stride2offset/lib/index.js:
333
- @stdlib/blas/base/dgemm/lib/base.js:
334
- @stdlib/blas/base/dgemm/lib/dgemm.js:
335
- @stdlib/blas/base/dgemm/lib/ndarray.js:
336
- @stdlib/blas/base/dgemm/lib/main.js:
337
- (**
338
- * @license Apache-2.0
339
- *
340
- * Copyright (c) 2024 The Stdlib Authors.
341
- *
342
- * Licensed under the Apache License, Version 2.0 (the "License");
343
- * you may not use this file except in compliance with the License.
344
- * You may obtain a copy of the License at
345
- *
346
- * http://www.apache.org/licenses/LICENSE-2.0
347
- *
348
- * Unless required by applicable law or agreed to in writing, software
349
- * distributed under the License is distributed on an "AS IS" BASIS,
350
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
351
- * See the License for the specific language governing permissions and
352
- * limitations under the License.
353
- *)
354
-
355
- @stdlib/array/base/assert/contains/lib/main.js:
356
- @stdlib/array/base/assert/contains/lib/factory.js:
357
- @stdlib/array/base/assert/contains/lib/index.js:
358
- (**
359
- * @license Apache-2.0
360
- *
361
- * Copyright (c) 2023 The Stdlib Authors.
362
- *
363
- * Licensed under the Apache License, Version 2.0 (the "License");
364
- * you may not use this file except in compliance with the License.
365
- * You may obtain a copy of the License at
366
- *
367
- * http://www.apache.org/licenses/LICENSE-2.0
368
- *
369
- * Unless required by applicable law or agreed to in writing, software
370
- * distributed under the License is distributed on an "AS IS" BASIS,
371
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
372
- * See the License for the specific language governing permissions and
373
- * limitations under the License.
374
- *)
375
-
376
- @stdlib/blas/base/ddot/lib/ndarray.js:
377
- @stdlib/blas/base/ddot/lib/ddot.js:
378
- @stdlib/blas/base/ddot/lib/main.js:
379
- (**
380
- * @license Apache-2.0
381
- *
382
- * Copyright (c) 2019 The Stdlib Authors.
383
- *
384
- * Licensed under the Apache License, Version 2.0 (the "License");
385
- * you may not use this file except in compliance with the License.
386
- * You may obtain a copy of the License at
387
- *
388
- * http://www.apache.org/licenses/LICENSE-2.0
389
- *
390
- * Unless required by applicable law or agreed to in writing, software
391
- * distributed under the License is distributed on an "AS IS" BASIS,
392
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
393
- * See the License for the specific language governing permissions and
394
- * limitations under the License.
395
- *)
396
- */
1
+ function or(t){if(!t.includes(":")){if(t.includes("."))throw new Error(`Invalid slice index: "${t}" (must be integer)`);let a=parseInt(t,10);if(isNaN(a))throw new Error(`Invalid slice index: "${t}"`);return{start:a,stop:null,step:1,isIndex:!0}}let r=t.split(":");if(r.length>3)throw new Error(`Invalid slice notation: "${t}" (too many colons)`);let n=r[0]===""?null:parseInt(r[0],10),e=r[1]===""||r[1]===void 0?null:parseInt(r[1],10),o=r[2]===""||r[2]===void 0?1:parseInt(r[2],10);if(n!==null&&isNaN(n))throw new Error(`Invalid start index in slice: "${t}"`);if(e!==null&&isNaN(e))throw new Error(`Invalid stop index in slice: "${t}"`);if(isNaN(o))throw new Error(`Invalid step in slice: "${t}"`);if(o===0)throw new Error("Slice step cannot be zero");return{start:n,stop:e,step:o,isIndex:!1}}function sr(t,r){let{start:n,stop:e}=t,{step:o,isIndex:a}=t;if(a){if(n===null)throw new Error("Index cannot be null");let l=n<0?r+n:n;if(l<0||l>=r)throw new Error(`Index ${n} is out of bounds for size ${r}`);return{start:l,stop:l+1,step:1,isIndex:!0}}return o>0?(n===null&&(n=0),e===null&&(e=r)):(n===null&&(n=r-1),e===null&&(e=-r-1)),n<0&&(n=r+n),e<0&&(e=r+e),n=Math.max(0,Math.min(n,r)),e=Math.max(-1,Math.min(e,r)),{start:n,stop:e,step:o,isIndex:!1}}var T="float64";function U(t){switch(t){case"float64":return Float64Array;case"float32":return Float32Array;case"int64":return BigInt64Array;case"int32":return Int32Array;case"int16":return Int16Array;case"int8":return Int8Array;case"uint64":return BigUint64Array;case"uint32":return Uint32Array;case"uint16":return Uint16Array;case"uint8":return Uint8Array;case"bool":return Uint8Array;default:throw new Error(`Unknown dtype: ${t}`)}}function ar(t){return t==="float64"||t==="float32"}function x(t){return t==="int64"||t==="uint64"}function _(t,r){if(t===r)return t;if(t==="bool")return r;if(r==="bool")return t;if(ar(t)||ar(r)){if(t==="float64"||r==="float64")return"float64";if(t==="float32"){let u=r;return u==="int32"||u==="int64"||u==="uint32"||u==="uint64"?"float64":"float32"}if(r==="float32"){let u=t;return u==="int32"||u==="int64"||u==="uint32"||u==="uint64"?"float64":"float32"}return"float32"}let n=t.startsWith("int"),e=r.startsWith("int"),o=t.startsWith("uint"),a=r.startsWith("uint"),l=u=>u.includes("64")?64:u.includes("32")?32:u.includes("16")?16:u.includes("8")?8:0,i=l(t),s=l(r);if(t==="int64"&&r==="uint64"||t==="uint64"&&r==="int64")return"float64";if(n&&a&&i===s){if(i===8)return"int16";if(i===16)return"int32";if(i===32)return"int64"}if(o&&e&&i===s){if(s===8)return"int16";if(s===16)return"int32";if(s===32)return"int64"}if(n&&e||o&&a){let u=Math.max(i,s);return n?u===64?"int64":u===32?"int32":u===16?"int16":"int8":u===64?"uint64":u===32?"uint32":u===16?"uint16":"uint8"}return n&&a?i>s?t:s===8?"int16":s===16?"int32":s===32?"int64":"float64":o&&e?s>i?r:i===8?"int16":i===16?"int32":i===32?"int64":"float64":"float64"}var D=class t{constructor(r,n,e,o,a){this._data=r,this._shape=n,this._strides=e,this._offset=o,this._dtype=a}get shape(){return this._shape}get ndim(){return this._shape.length}get size(){return this._shape.reduce((r,n)=>r*n,1)}get dtype(){return this._dtype}get data(){return this._data}get strides(){return this._strides}get offset(){return this._offset}get isCContiguous(){let r=this._shape,n=this._strides,e=r.length;if(e===0)return!0;if(e===1)return n[0]===1;let o=1;for(let a=e-1;a>=0;a--){if(n[a]!==o)return!1;o*=r[a]}return!0}get isFContiguous(){let r=this._shape,n=this._strides,e=r.length;if(e===0)return!0;if(e===1)return n[0]===1;let o=1;for(let a=0;a<e;a++){if(n[a]!==o)return!1;o*=r[a]}return!0}iget(r){let n=this._shape,e=this._strides,o=n.length;if(o===0)return this._data[this._offset];let a=r,l=this._offset;for(let i=0;i<o;i++){let s=1;for(let c=i+1;c<o;c++)s*=n[c];let u=Math.floor(a/s);a=a%s,l+=u*e[i]}return this._data[l]}iset(r,n){let e=this._shape,o=this._strides,a=e.length;if(a===0){this._data[this._offset]=n;return}let l=r,i=this._offset;for(let s=0;s<a;s++){let u=1;for(let f=s+1;f<a;f++)u*=e[f];let c=Math.floor(l/u);l=l%u,i+=c*o[s]}this._data[i]=n}get(...r){let n=this._strides,e=this._offset;for(let o=0;o<r.length;o++)e+=r[o]*n[o];return this._data[e]}set(r,n){let e=this._strides,o=this._offset;for(let a=0;a<r.length;a++)o+=r[a]*e[a];this._data[o]=n}copy(){let r=Array.from(this._shape),n=this._dtype,e=this.size,o=U(n);if(!o)throw new Error(`Cannot copy array with dtype ${n}`);let a=new o(e);if(this.isCContiguous&&this._offset===0)if(x(n)){let l=this._data,i=a;for(let s=0;s<e;s++)i[s]=l[s]}else a.set(this._data);else if(x(n)){let l=a;for(let i=0;i<e;i++)l[i]=this.iget(i)}else for(let l=0;l<e;l++)a[l]=this.iget(l);return new t(a,r,t._computeStrides(r),0,n)}static fromData(r,n,e,o,a){let l=o??t._computeStrides(n),i=a??0;return new t(r,n,l,i,e)}static zeros(r,n=T){let e=r.reduce((l,i)=>l*i,1),o=U(n);if(!o)throw new Error(`Cannot create array with dtype ${n}`);let a=new o(e);return new t(a,r,t._computeStrides(r),0,n)}static ones(r,n=T){let e=r.reduce((l,i)=>l*i,1),o=U(n);if(!o)throw new Error(`Cannot create array with dtype ${n}`);let a=new o(e);return x(n)?a.fill(BigInt(1)):a.fill(1),new t(a,r,t._computeStrides(r),0,n)}static _computeStrides(r){let n=new Array(r.length),e=1;for(let o=r.length-1;o>=0;o--)n[o]=e,e*=r[o];return n}};function j(t){let r=new Array(t.length),n=1;for(let e=t.length-1;e>=0;e--)r[e]=n,n*=t[e];return r}function ir(t,r){let n=t.length,e=r.length,o=Math.max(n,e),a=new Array(o);for(let l=0;l<o;l++){let i=l<o-n?1:t[l-(o-n)],s=l<o-e?1:r[l-(o-e)];if(i===s)a[l]=i;else if(i===1)a[l]=s;else if(s===1)a[l]=i;else throw new Error(`operands could not be broadcast together with shapes ${JSON.stringify(Array.from(t))} ${JSON.stringify(Array.from(r))}`)}return a}function Rr(t,r,n){let e=t.length,o=n.length,a=new Array(o).fill(0);for(let l=0;l<e;l++){let i=o-e+l,s=t[l],u=n[i];if(s===u)a[i]=r[l];else if(s===1)a[i]=0;else throw new Error("Invalid broadcast")}return a}function k(t,r){let n=Rr(t.shape,t.strides,r);return D.fromData(t.data,Array.from(r),t.dtype,n,t.offset)}function O(t,r,n,e){let o=ir(t.shape,r.shape),a=k(t,o),l=k(r,o),i=_(t.dtype,r.dtype),s=D.zeros(o,i),u=s.data,c=s.size;if(x(i)){let f=u;for(let y=0;y<c;y++){let m=a.iget(y),p=l.iget(y),d=typeof m=="bigint"?m:BigInt(Math.round(m)),A=typeof p=="bigint"?p:BigInt(Math.round(p));e==="add"?f[y]=d+A:e==="subtract"?f[y]=d-A:e==="multiply"?f[y]=d*A:e==="divide"?f[y]=d/A:f[y]=BigInt(Math.round(n(Number(d),Number(A))))}}else{let f=x(t.dtype)||x(r.dtype);for(let y=0;y<c;y++){let m=a.iget(y),p=l.iget(y),d=Number(m),A=Number(p);u[y]=n(d,A)}}return s}function v(t,r,n){let e=ir(t.shape,r.shape),o=k(t,e),a=k(r,e),l=e.reduce((u,c)=>u*c,1),i=new Uint8Array(l),s=x(t.dtype)||x(r.dtype);for(let u=0;u<l;u++){let c=o.iget(u),f=a.iget(u),y=Number(c),m=Number(f);i[u]=n(y,m)?1:0}return D.fromData(i,e,"bool")}function ur(t,r,n=!0){let e=t.dtype,o=Array.from(t.shape),a=t.size,i=n?e:e!=="float32"&&e!=="float64"?"float64":e,s=D.zeros(o,i),u=s.data,c=t.data;if(x(e))if(x(i)){let f=u;for(let y=0;y<a;y++){let m=Number(c[y]);f[y]=BigInt(Math.round(r(m)))}}else for(let f=0;f<a;f++)u[f]=r(Number(c[f]));else for(let f=0;f<a;f++)u[f]=r(Number(c[f]));return s}function L(t,r){return t.isCContiguous&&r.isCContiguous&&t.shape.length===r.shape.length&&t.shape.every((n,e)=>n===r.shape[e])}function lr(t,r){return typeof r=="number"?Gr(t,r):L(t,r)?Wr(t,r):O(t,r,(n,e)=>n+e,"add")}function Wr(t,r){let n=_(t.dtype,r.dtype),e=D.zeros(Array.from(t.shape),n),o=t.size,a=t.data,l=r.data,i=e.data;if(x(n)){let s=i;if(!x(t.dtype)||!x(r.dtype))for(let c=0;c<o;c++){let f=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof l[c]=="bigint"?l[c]:BigInt(Math.round(Number(l[c])));s[c]=f+y}else{let c=a,f=l;for(let y=0;y<o;y++)s[y]=c[y]+f[y]}}else if(x(t.dtype)||x(r.dtype))for(let u=0;u<o;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],f=typeof l[u]=="bigint"?Number(l[u]):l[u];i[u]=c+f}else for(let u=0;u<o;u++)i[u]=a[u]+l[u];return e}function fr(t,r){return typeof r=="number"?Hr(t,r):L(t,r)?Jr(t,r):O(t,r,(n,e)=>n-e,"subtract")}function Jr(t,r){let n=_(t.dtype,r.dtype),e=D.zeros(Array.from(t.shape),n),o=t.size,a=t.data,l=r.data,i=e.data;if(x(n)){let s=i;if(!x(t.dtype)||!x(r.dtype))for(let c=0;c<o;c++){let f=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof l[c]=="bigint"?l[c]:BigInt(Math.round(Number(l[c])));s[c]=f-y}else{let c=a,f=l;for(let y=0;y<o;y++)s[y]=c[y]-f[y]}}else if(x(t.dtype)||x(r.dtype))for(let u=0;u<o;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],f=typeof l[u]=="bigint"?Number(l[u]):l[u];i[u]=c-f}else for(let u=0;u<o;u++)i[u]=a[u]-l[u];return e}function cr(t,r){return typeof r=="number"?Yr(t,r):L(t,r)?Pr(t,r):O(t,r,(n,e)=>n*e,"multiply")}function Pr(t,r){let n=_(t.dtype,r.dtype),e=D.zeros(Array.from(t.shape),n),o=t.size,a=t.data,l=r.data,i=e.data;if(x(n)){let s=i;if(!x(t.dtype)||!x(r.dtype))for(let c=0;c<o;c++){let f=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof l[c]=="bigint"?l[c]:BigInt(Math.round(Number(l[c])));s[c]=f*y}else{let c=a,f=l;for(let y=0;y<o;y++)s[y]=c[y]*f[y]}}else if(x(t.dtype)||x(r.dtype))for(let u=0;u<o;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],f=typeof l[u]=="bigint"?Number(l[u]):l[u];i[u]=c*f}else for(let u=0;u<o;u++)i[u]=a[u]*l[u];return e}function yr(t,r){if(typeof r=="number")return Qr(t,r);let n=t.dtype==="float64",e=r.dtype==="float64",o=t.dtype==="float32",a=r.dtype==="float32";if(n||e){let s=n?t:V(t,"float64"),u=e?r:V(r,"float64");return O(s,u,(c,f)=>c/f,"divide")}if(o||a){let s=o?t:V(t,"float32"),u=a?r:V(r,"float32");return O(s,u,(c,f)=>c/f,"divide")}let l=V(t,"float64"),i=V(r,"float64");return O(l,i,(s,u)=>s/u,"divide")}function V(t,r){let n=D.zeros(Array.from(t.shape),r),e=t.size,o=t.data,a=n.data;for(let l=0;l<e;l++)a[l]=Number(o[l]);return n}function Gr(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++)u[f]=s[f]+c}else for(let s=0;s<a;s++)i[s]=Number(o[s])+r;return l}function Hr(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++)u[f]=s[f]-c}else for(let s=0;s<a;s++)i[s]=Number(o[s])-r;return l}function Yr(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++)u[f]=s[f]*c}else for(let s=0;s<a;s++)i[s]=Number(o[s])*r;return l}function Qr(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,i=n!=="float32"&&n!=="float64"?"float64":n,s=D.zeros(e,i),u=s.data;if(x(n))for(let c=0;c<a;c++)u[c]=Number(o[c])/r;else for(let c=0;c<a;c++)u[c]=Number(o[c])/r;return s}function pr(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,a=D.zeros(n,r),l=a.data;if(x(r)){let i=e,s=l;for(let u=0;u<o;u++){let c=i[u];s[u]=c<0n?-c:c}}else for(let i=0;i<o;i++)l[i]=Math.abs(Number(e[i]));return a}function mr(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,a=D.zeros(n,r),l=a.data;if(x(r)){let i=e,s=l;for(let u=0;u<o;u++)s[u]=-i[u]}else for(let i=0;i<o;i++)l[i]=-Number(e[i]);return a}function dr(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,a=D.zeros(n,r),l=a.data;if(x(r)){let i=e,s=l;for(let u=0;u<o;u++){let c=i[u];s[u]=c>0n?1n:c<0n?-1n:0n}}else for(let i=0;i<o;i++){let s=Number(e[i]);l[i]=s>0?1:s<0?-1:0}return a}function gr(t,r){return typeof r=="number"?Xr(t,r):O(t,r,(n,e)=>(n%e+e)%e,"mod")}function Xr(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++){let y=s[f];u[f]=(y%c+c)%c}}else for(let s=0;s<a;s++){let u=Number(o[s]);i[s]=(u%r+r)%r}return l}function hr(t,r){return typeof r=="number"?Zr(t,r):O(t,r,(n,e)=>Math.floor(n/e),"floor_divide")}function Zr(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,l=D.zeros(e,n),i=l.data;if(x(n)){let s=o,u=i,c=BigInt(Math.round(r));for(let f=0;f<a;f++)u[f]=s[f]/c}else for(let s=0;s<a;s++)i[s]=Math.floor(Number(o[s])/r);return l}function Ar(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,a=D.zeros(n,r),l=a.data;for(let i=0;i<o;i++)l[i]=e[i];return a}function br(t){let r=t.dtype,n=Array.from(t.shape),e=t.data,o=t.size,l=r!=="float32"&&r!=="float64"?"float64":r,i=D.zeros(n,l),s=i.data;if(x(r))for(let u=0;u<o;u++)s[u]=1/Number(e[u]);else for(let u=0;u<o;u++)s[u]=1/Number(e[u]);return i}function Sr(t,r){return typeof r=="number"?rt(t,r):v(t,r,(n,e)=>n>e)}function Dr(t,r){return typeof r=="number"?tt(t,r):v(t,r,(n,e)=>n>=e)}function xr(t,r){return typeof r=="number"?et(t,r):v(t,r,(n,e)=>n<e)}function Ir(t,r){return typeof r=="number"?nt(t,r):v(t,r,(n,e)=>n<=e)}function wr(t,r){return typeof r=="number"?ot(t,r):v(t,r,(n,e)=>n===e)}function Nr(t,r){return typeof r=="number"?st(t,r):v(t,r,(n,e)=>n!==e)}function R(t,r,n=1e-5,e=1e-8){return typeof r=="number"?at(t,r,n,e):v(t,r,(o,a)=>{let l=Math.abs(o-a),i=e+n*Math.abs(a);return l<=i})}function Br(t,r,n=1e-5,e=1e-8){let o=R(t,r,n,e),a=o.data;for(let l=0;l<o.size;l++)if(a[l]===0)return!1;return!0}function rt(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]>r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function tt(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]>=r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function et(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]<r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function nt(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]<=r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function ot(t,r){let n=new Uint8Array(t.size),e=t.data,o=t.dtype;if(x(o)){let a=BigInt(Math.round(r)),l=e;for(let i=0;i<t.size;i++)n[i]=l[i]===a?1:0}else for(let a=0;a<t.size;a++)n[a]=e[a]===r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function st(t,r){let n=new Uint8Array(t.size),e=t.data;for(let o=0;o<t.size;o++)n[o]=e[o]!==r?1:0;return D.fromData(n,Array.from(t.shape),"bool")}function at(t,r,n,e){let o=new Uint8Array(t.size),a=t.data,l=t.dtype;if(x(l)){let i=a;for(let s=0;s<t.size;s++){let u=Number(i[s]),c=Math.abs(u-r),f=e+n*Math.abs(r);o[s]=c<=f?1:0}}else for(let i=0;i<t.size;i++){let s=Number(a[i]),u=Math.abs(s-r),c=e+n*Math.abs(r);o[i]=u<=c?1:0}return D.fromData(o,Array.from(t.shape),"bool")}function B(t,r){let n=0,e=1;for(let o=t.length-1;o>=0;o--)n+=t[o]*e,e*=r[o];return n}function z(t,r,n,e){let o=e.length,a=new Array(o),l=Array.from(e).filter((s,u)=>u!==r),i=t;for(let s=l.length-1;s>=0;s--)a[s>=r?s+1:s]=i%l[s],i=Math.floor(i/l[s]);return a[r]=n,a}function C(t,r,n=!1){let e=t.dtype,o=t.shape,a=o.length,l=t.size,i=t.data;if(r===void 0)if(x(e)){let p=i,d=BigInt(0);for(let A=0;A<l;A++)d+=p[A];return Number(d)}else{let p=0;for(let d=0;d<l;d++)p+=Number(i[d]);return p}let s=r;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(o).filter((p,d)=>d!==s);if(u.length===0)return C(t);let c=D.zeros(u,e),f=c.data,y=o[s],m=u.reduce((p,d)=>p*d,1);if(x(e)){let p=i,d=f;for(let A=0;A<m;A++){let g=BigInt(0);for(let h=0;h<y;h++){let S=z(A,s,h,o),b=B(S,o);g+=p[b]}d[A]=g}}else for(let p=0;p<m;p++){let d=0;for(let A=0;A<y;A++){let g=z(p,s,A,o),h=B(g,o);d+=Number(i[h])}f[p]=d}if(n){let p=[...o];return p[s]=1,D.fromData(f,p,e)}return c}function W(t,r,n=!1){let e=t.dtype,o=t.shape;if(r===void 0)return C(t)/t.size;let a=r;if(a<0&&(a=o.length+a),a<0||a>=o.length)throw new Error(`axis ${r} is out of bounds for array of dimension ${o.length}`);let l=C(t,r,n);if(typeof l=="number")return l/o[a];let i=o[a],s=e;(x(e)||e.startsWith("int")||e.startsWith("uint"))&&(s="float64");let u=D.zeros(Array.from(l.shape),s),c=u.data,f=l.data;if(x(e)){let y=f;for(let m=0;m<c.length;m++)c[m]=Number(y[m])/i}else for(let y=0;y<c.length;y++)c[y]=Number(f[y])/i;return u}function J(t,r,n=!1){let e=t.dtype,o=t.shape,a=o.length,l=t.size,i=t.data;if(r===void 0){if(l===0)throw new Error("max of empty array");let p=i[0];for(let d=1;d<l;d++)i[d]>p&&(p=i[d]);return Number(p)}let s=r;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(o).filter((p,d)=>d!==s);if(u.length===0)return J(t);let c=D.zeros(u,e),f=c.data,y=o[s],m=u.reduce((p,d)=>p*d,1);if(x(e)){let p=i,d=f;for(let A=0;A<m;A++){let g=z(A,s,0,o),h=B(g,o),S=p[h];for(let b=1;b<y;b++){let I=z(A,s,b,o),w=B(I,o),$=p[w];$>S&&(S=$)}d[A]=S}}else for(let p=0;p<m;p++){let d=-1/0;for(let A=0;A<y;A++){let g=z(p,s,A,o),h=B(g,o),S=Number(i[h]);S>d&&(d=S)}f[p]=d}if(n){let p=[...o];return p[s]=1,D.fromData(f,p,e)}return c}function P(t,r,n=!1){let e=t.dtype,o=t.shape,a=o.length,l=t.size,i=t.data;if(r===void 0)if(x(e)){let p=i,d=BigInt(1);for(let A=0;A<l;A++)d*=p[A];return Number(d)}else{let p=1;for(let d=0;d<l;d++)p*=Number(i[d]);return p}let s=r;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(o).filter((p,d)=>d!==s);if(u.length===0)return P(t);let c=D.zeros(u,e),f=c.data,y=o[s],m=u.reduce((p,d)=>p*d,1);if(x(e)){let p=i,d=f;for(let A=0;A<m;A++){let g=BigInt(1);for(let h=0;h<y;h++){let S=z(A,s,h,o),b=B(S,o);g*=p[b]}d[A]=g}}else for(let p=0;p<m;p++){let d=1;for(let A=0;A<y;A++){let g=z(p,s,A,o),h=B(g,o);d*=Number(i[h])}f[p]=d}if(n){let p=[...o];return p[s]=1,D.fromData(f,p,e)}return c}function G(t,r,n=!1){let e=t.dtype,o=t.shape,a=o.length,l=t.size,i=t.data;if(r===void 0){if(l===0)throw new Error("min of empty array");let p=i[0];for(let d=1;d<l;d++)i[d]<p&&(p=i[d]);return Number(p)}let s=r;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let u=Array.from(o).filter((p,d)=>d!==s);if(u.length===0)return G(t);let c=D.zeros(u,e),f=c.data,y=o[s],m=u.reduce((p,d)=>p*d,1);if(x(e)){let p=i,d=f;for(let A=0;A<m;A++){let g=z(A,s,0,o),h=B(g,o),S=p[h];for(let b=1;b<y;b++){let I=z(A,s,b,o),w=B(I,o),$=p[w];$<S&&(S=$)}d[A]=S}}else for(let p=0;p<m;p++){let d=1/0;for(let A=0;A<y;A++){let g=z(p,s,A,o),h=B(g,o),S=Number(i[h]);S<d&&(d=S)}f[p]=d}if(n){let p=[...o];return p[s]=1,D.fromData(f,p,e)}return c}function H(t,r){let n=t.dtype,e=t.shape,o=e.length,a=t.size,l=t.data;if(r===void 0){if(a===0)throw new Error("argmin of empty array");let m=l[0],p=0;for(let d=1;d<a;d++)l[d]<m&&(m=l[d],p=d);return p}let i=r;if(i<0&&(i=o+i),i<0||i>=o)throw new Error(`axis ${r} is out of bounds for array of dimension ${o}`);let s=Array.from(e).filter((m,p)=>p!==i);if(s.length===0)return H(t);let u=D.zeros(s,"int32"),c=u.data,f=e[i],y=s.reduce((m,p)=>m*p,1);if(x(n)){let m=l;for(let p=0;p<y;p++){let d=z(p,i,0,e),A=B(d,e),g=m[A],h=0;for(let S=1;S<f;S++){let b=z(p,i,S,e),I=B(b,e),w=m[I];w<g&&(g=w,h=S)}c[p]=h}}else for(let m=0;m<y;m++){let p=1/0,d=0;for(let A=0;A<f;A++){let g=z(m,i,A,e),h=B(g,e),S=Number(l[h]);S<p&&(p=S,d=A)}c[m]=d}return u}function Y(t,r){let n=t.dtype,e=t.shape,o=e.length,a=t.size,l=t.data;if(r===void 0){if(a===0)throw new Error("argmax of empty array");let m=l[0],p=0;for(let d=1;d<a;d++)l[d]>m&&(m=l[d],p=d);return p}let i=r;if(i<0&&(i=o+i),i<0||i>=o)throw new Error(`axis ${r} is out of bounds for array of dimension ${o}`);let s=Array.from(e).filter((m,p)=>p!==i);if(s.length===0)return Y(t);let u=D.zeros(s,"int32"),c=u.data,f=e[i],y=s.reduce((m,p)=>m*p,1);if(x(n)){let m=l;for(let p=0;p<y;p++){let d=z(p,i,0,e),A=B(d,e),g=m[A],h=0;for(let S=1;S<f;S++){let b=z(p,i,S,e),I=B(b,e),w=m[I];w>g&&(g=w,h=S)}c[p]=h}}else for(let m=0;m<y;m++){let p=-1/0,d=0;for(let A=0;A<f;A++){let g=z(m,i,A,e),h=B(g,e),S=Number(l[h]);S>p&&(p=S,d=A)}c[m]=d}return u}function Q(t,r,n=0,e=!1){let o=t.shape,a=o.length,l=t.size,i=t.data,s=W(t,r,e);if(r===void 0){let g=s,h=0;for(let S=0;S<l;S++){let b=Number(i[S])-g;h+=b*b}return h/(l-n)}let u=r;if(u<0&&(u=a+u),u<0||u>=a)throw new Error(`axis ${r} is out of bounds for array of dimension ${a}`);let c=o[u],f=s,y=f.data,m=e?f.shape:Array.from(o).filter((g,h)=>h!==u),p=D.zeros(Array.from(m),"float64"),d=p.data,A=m.reduce((g,h)=>g*h,1);for(let g=0;g<A;g++){let h=0,S=Number(y[g]);for(let b=0;b<c;b++){let I=z(g,u,b,o),w=B(I,o),$=Number(i[w])-S;h+=$*$}d[g]=h/(c-n)}return p}function zr(t,r,n=0,e=!1){let o=Q(t,r,n,e);if(typeof o=="number")return Math.sqrt(o);let a=D.zeros(Array.from(o.shape),"float64"),l=o.data,i=a.data;for(let s=0;s<l.length;s++)i[s]=Math.sqrt(Number(l[s]));return a}function X(t,r,n=!1){let e=t.shape,o=e.length,a=t.size,l=t.data;if(r===void 0){for(let m=0;m<a;m++)if(!l[m])return!1;return!0}let i=r;if(i<0&&(i=o+i),i<0||i>=o)throw new Error(`axis ${r} is out of bounds for array of dimension ${o}`);let s=Array.from(e).filter((m,p)=>p!==i);if(s.length===0)return X(t);let u=D.zeros(s,"bool"),c=u.data,f=e[i],y=s.reduce((m,p)=>m*p,1);for(let m=0;m<y;m++){let p=!0;for(let d=0;d<f;d++){let A=z(m,i,d,e),g=B(A,e);if(!l[g]){p=!1;break}}c[m]=p?1:0}if(n){let m=[...e];return m[i]=1,D.fromData(c,m,"bool")}return u}function Z(t,r,n=!1){let e=t.shape,o=e.length,a=t.size,l=t.data;if(r===void 0){for(let m=0;m<a;m++)if(l[m])return!0;return!1}let i=r;if(i<0&&(i=o+i),i<0||i>=o)throw new Error(`axis ${r} is out of bounds for array of dimension ${o}`);let s=Array.from(e).filter((m,p)=>p!==i);if(s.length===0)return Z(t);let u=D.zeros(s,"bool"),c=u.data,f=e[i],y=s.reduce((m,p)=>m*p,1);for(let m=0;m<y;m++){let p=!1;for(let d=0;d<f;d++){let A=z(m,i,d,e),g=B(A,e);if(l[g]){p=!0;break}}c[m]=p?1:0}if(n){let m=[...e];return m[i]=1,D.fromData(c,m,"bool")}return u}function _r(t,r){let n=t.size,e=t.dtype,o=r.indexOf(-1),a;if(o!==-1){let u=r.reduce((f,y,m)=>m===o?f:f*y,1),c=n/u;if(!Number.isInteger(c))throw new Error(`cannot reshape array of size ${n} into shape ${JSON.stringify(r)}`);a=r.map((f,y)=>y===o?c:f)}else a=r;if(a.reduce((u,c)=>u*c,1)!==n)throw new Error(`cannot reshape array of size ${n} into shape ${JSON.stringify(a)}`);if(t.isCContiguous){let u=t.data;return D.fromData(u,a,e,j(a),0)}let s=t.copy().data;return D.fromData(s,a,e,j(a),0)}function K(t){let r=t.shape,n=r.length,e=t.size,o=t.dtype,a=U(o);if(!a)throw new Error(`Cannot flatten array with dtype ${o}`);let l=new a(e),i=0,s=(u,c)=>{if(c===n){let f=t.get(...u);l[i++]=f;return}for(let f=0;f<r[c];f++)u[c]=f,s(u,c+1)};return s(new Array(n),0),D.fromData(l,[e],o,[1],0)}function F(t){let r=t.size,n=t.dtype;if(t.isCContiguous){let e=t.data;return D.fromData(e,[r],n,[1],0)}return K(t)}function rr(t,r){let n=t.shape,e=n.length,o=t.strides,a=t.data,l=t.dtype,i;if(r===void 0)i=Array.from({length:e},(f,y)=>e-1-y);else{if(r.length!==e)throw new Error(`axes must have length ${e}, got ${r.length}`);let f=new Set;for(let y of r){let m=y<0?e+y:y;if(m<0||m>=e)throw new Error(`axis ${y} is out of bounds for array of dimension ${e}`);if(f.has(m))throw new Error("repeated axis in transpose");f.add(m)}i=r.map(y=>y<0?e+y:y)}let s=i.map(f=>n[f]),u=Array.from(o),c=i.map(f=>u[f]);return D.fromData(a,s,l,c,t.offset)}function Tr(t,r){let n=t.shape,e=n.length,o=t.strides,a=t.data,l=t.dtype;if(r===void 0){let i=[],s=[];for(let u=0;u<e;u++)n[u]!==1&&(i.push(n[u]),s.push(o[u]));return i.length===0&&(i.push(1),s.push(1)),D.fromData(a,i,l,s,t.offset)}else{let i=r<0?e+r:r;if(i<0||i>=e)throw new Error(`axis ${r} is out of bounds for array of dimension ${e}`);if(n[i]!==1)throw new Error(`cannot select an axis which has size not equal to one (axis ${r} has size ${n[i]})`);let s=[],u=[];for(let c=0;c<e;c++)c!==i&&(s.push(n[c]),u.push(o[c]));return D.fromData(a,s,l,u,t.offset)}}function Ur(t,r){let n=t.shape,e=n.length,o=t.strides,a=t.data,l=t.dtype,i=r;if(i<0&&(i=e+r+1),i<0||i>e)throw new Error(`axis ${r} is out of bounds for array of dimension ${e+1}`);let s=[...Array.from(n)];s.splice(i,0,1);let u=[...Array.from(o)],c=i<e?o[i]*(n[i]||1):1;return u.splice(i,0,c),D.fromData(a,s,l,u,t.offset)}function lt(t,r,n,e,o,a,l,i,s,u,c,f,y,m){if(f===0)for(let g=0;g<e*o;g++)y[g]=0;else if(f!==1)for(let g=0;g<e*o;g++)y[g]=(y[g]??0)*f;let p=t==="row-major",d=r==="transpose",A=n==="transpose";if(p&&!d&&!A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[g*s+b]??0)*(u[b*c+h]??0);y[g*m+h]=(y[g*m+h]??0)+l*S}else if(p&&d&&!A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[b*s+g]??0)*(u[b*c+h]??0);y[g*m+h]=(y[g*m+h]??0)+l*S}else if(p&&!d&&A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[g*s+b]??0)*(u[h*c+b]??0);y[g*m+h]=(y[g*m+h]??0)+l*S}else if(p&&d&&A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[b*s+g]??0)*(u[h*c+b]??0);y[g*m+h]=(y[g*m+h]??0)+l*S}else if(!p&&!d&&!A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[b*s+g]??0)*(u[h*c+b]??0);y[h*m+g]=(y[h*m+g]??0)+l*S}else if(!p&&d&&!A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[g*s+b]??0)*(u[h*c+b]??0);y[h*m+g]=(y[h*m+g]??0)+l*S}else if(!p&&!d&&A)for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[b*s+g]??0)*(u[b*c+h]??0);y[h*m+g]=(y[h*m+g]??0)+l*S}else for(let g=0;g<e;g++)for(let h=0;h<o;h++){let S=0;for(let b=0;b<a;b++)S+=(i[g*s+b]??0)*(u[b*c+h]??0);y[h*m+g]=(y[h*m+g]??0)+l*S}}function tr(t,r){let n=t.ndim,e=r.ndim;if(n===0||e===0){let o=n===0?t.get():null,a=e===0?r.get():null;if(n===0&&e===0)return typeof o=="bigint"&&typeof a=="bigint"?o*a:Number(o)*Number(a);if(n===0){let l=_(t.dtype,r.dtype),i=D.zeros([...r.shape],l);for(let s=0;s<r.size;s++){let u=r.data[s+r.offset];typeof o=="bigint"&&typeof u=="bigint"?i.data[s]=o*u:i.data[s]=Number(o)*Number(u)}return i}else{let l=_(t.dtype,r.dtype),i=D.zeros([...t.shape],l);for(let s=0;s<t.size;s++){let u=t.data[s+t.offset];typeof u=="bigint"&&typeof a=="bigint"?i.data[s]=u*a:i.data[s]=Number(u)*Number(a)}return i}}if(n===1&&e===1){if(t.shape[0]!==r.shape[0])throw new Error(`dot: incompatible shapes (${t.shape[0]},) and (${r.shape[0]},)`);let o=t.shape[0],a=0;for(let l=0;l<o;l++){let i=t.get(l),s=r.get(l);typeof i=="bigint"&&typeof s=="bigint"?a=Number(a)+Number(i*s):a+=Number(i)*Number(s)}return a}if(n===2&&e===2)return er(t,r);if(n===2&&e===1){let[o,a]=t.shape,l=r.shape[0];if(a!==l)throw new Error(`dot: incompatible shapes (${o},${a}) and (${l},)`);let i=_(t.dtype,r.dtype),s=D.zeros([o],i);for(let u=0;u<o;u++){let c=0;for(let f=0;f<a;f++){let y=t.get(u,f),m=r.get(f);typeof y=="bigint"&&typeof m=="bigint"?c=Number(c)+Number(y*m):c+=Number(y)*Number(m)}s.set([u],c)}return s}if(n===1&&e===2){let o=t.shape[0],[a,l]=r.shape;if(o!==a)throw new Error(`dot: incompatible shapes (${o},) and (${a},${l})`);let i=_(t.dtype,r.dtype),s=D.zeros([l],i);for(let u=0;u<l;u++){let c=0;for(let f=0;f<o;f++){let y=t.get(f),m=r.get(f,u);typeof y=="bigint"&&typeof m=="bigint"?c=Number(c)+Number(y*m):c+=Number(y)*Number(m)}s.set([u],c)}return s}if(n>2&&e===1){let o=t.shape[n-1],a=r.shape[0];if(o!==a)throw new Error(`dot: incompatible shapes ${JSON.stringify(t.shape)} and (${a},)`);let l=[...t.shape.slice(0,-1)],i=_(t.dtype,r.dtype),s=D.zeros(l,i),u=l.reduce((c,f)=>c*f,1);for(let c=0;c<u;c++){let f=0,y=c,m=[];for(let p=l.length-1;p>=0;p--)m[p]=y%l[p],y=Math.floor(y/l[p]);for(let p=0;p<o;p++){let d=[...m,p],A=t.get(...d),g=r.get(p);typeof A=="bigint"&&typeof g=="bigint"?f=Number(f)+Number(A*g):f+=Number(A)*Number(g)}s.set(m,f)}return s}if(n===1&&e>2){let o=t.shape[0],a=1,l=r.shape[a];if(o!==l)throw new Error(`dot: incompatible shapes (${o},) and ${JSON.stringify(r.shape)}`);let i=[...r.shape.slice(0,a),...r.shape.slice(a+1)],s=_(t.dtype,r.dtype),u=D.zeros(i,s),c=i.reduce((f,y)=>f*y,1);for(let f=0;f<c;f++){let y=f,m=[];for(let g=i.length-1;g>=0;g--)m[g]=y%i[g],y=Math.floor(y/i[g]);let p=m.slice(0,a),d=m.slice(a),A=0;for(let g=0;g<o;g++){let h=t.get(g),S=[...p,g,...d],b=r.get(...S);typeof h=="bigint"&&typeof b=="bigint"?A=Number(A)+Number(h*b):A+=Number(h)*Number(b)}u.set(m,A)}return u}if(n>=2&&e>=2&&!(n===2&&e===2)){let o=t.shape[n-1],a=r.shape[e-2];if(o!==a)throw new Error(`dot: incompatible shapes ${JSON.stringify(t.shape)} and ${JSON.stringify(r.shape)}`);let l=[...t.shape.slice(0,-1),...r.shape.slice(0,-2),r.shape[e-1]],i=_(t.dtype,r.dtype),s=D.zeros(l,i),u=t.shape.slice(0,-1).reduce((m,p)=>m*p,1),c=r.shape.slice(0,-2).reduce((m,p)=>m*p,1),f=r.shape[e-1],y=o;for(let m=0;m<u;m++)for(let p=0;p<c;p++)for(let d=0;d<f;d++){let A=0;for(let h=0;h<y;h++){let S=m*y+h,b=t.data[S+t.offset],I=p*y*f+h*f+d,w=r.data[I+r.offset];typeof b=="bigint"&&typeof w=="bigint"?A=Number(A)+Number(b*w):A+=Number(b)*Number(w)}let g=m*c*f+p*f+d;s.data[g]=A}return s}throw new Error(`dot: unexpected combination of dimensions ${n}D \xB7 ${e}D`)}function er(t,r){if(t.ndim!==2||r.ndim!==2)throw new Error("matmul requires 2D arrays");let[n=0,e=0]=t.shape,[o=0,a=0]=r.shape;if(e!==o)throw new Error(`matmul shape mismatch: (${n},${e}) @ (${o},${a})`);let l=_(t.dtype,r.dtype),i=l.startsWith("int")||l.startsWith("uint")||l==="bool"?"float64":l;if(i!=="float64")throw new Error(`matmul currently only supports float64, got ${i}`);let s=t.dtype==="float64"?t.data:Float64Array.from(Array.from(t.data).map(Number)),u=r.dtype==="float64"?r.data:Float64Array.from(Array.from(r.data).map(Number));t.offset>0&&(s=s.subarray(t.offset)),r.offset>0&&(u=u.subarray(r.offset));let[c=0,f=0]=t.strides,[y=0,m=0]=r.strides,p=f>c,d=m>y,A=p?"transpose":"no-transpose",g=d?"transpose":"no-transpose",h,S;p?h=f:h=c,d?S=m:S=y;let b=D.zeros([n,a],"float64");return lt("row-major",A,g,n,a,e,1,s,h,u,S,0,b.data,a),b}function $r(t){if(t.ndim!==2)throw new Error(`trace requires 2D array, got ${t.ndim}D`);let[r=0,n=0]=t.shape,e=Math.min(r,n),o=0;for(let a=0;a<e;a++){let l=t.get(a,a);typeof l=="bigint"?o=(typeof o=="bigint"?o:BigInt(o))+l:o=(typeof o=="bigint"?Number(o):o)+l}return o}function Or(t,r){let n=t.ndim,e=r.ndim,o=t.shape[n-1],a=r.shape[e-1];if(o!==a)throw new Error(`inner: incompatible shapes - last dimensions ${o} and ${a} don't match`);if(n===1&&e===1)return tr(t,r);let l=[...t.shape.slice(0,-1),...r.shape.slice(0,-1)],i=_(t.dtype,r.dtype),s=D.zeros(l,i),u=n===1?1:t.shape.slice(0,-1).reduce((y,m)=>y*m,1),c=e===1?1:r.shape.slice(0,-1).reduce((y,m)=>y*m,1),f=o;for(let y=0;y<u;y++)for(let m=0;m<c;m++){let p=0;for(let A=0;A<f;A++){let g=n===1?A:y*f+A,h=e===1?A:m*f+A,S=t.data[g+t.offset],b=r.data[h+r.offset];typeof S=="bigint"&&typeof b=="bigint"?p=Number(p)+Number(S*b):p+=Number(S)*Number(b)}if(l.length===0)return p;let d=u===1?m:y*c+m;s.data[d]=p}return s}function vr(t,r){let n=t.ndim===1?t:F(t),e=r.ndim===1?r:F(r),o=n.size,a=e.size,l=_(t.dtype,r.dtype),i=D.zeros([o,a],l);for(let s=0;s<o;s++)for(let u=0;u<a;u++){let c=n.get(s),f=e.get(u),y;typeof c=="bigint"&&typeof f=="bigint"?y=c*f:y=Number(c)*Number(f),i.set([s,u],y)}return i}function Mr(t,r,n){let e,o;if(typeof n=="number"){let y=n;if(y<0)throw new Error("tensordot: axes must be non-negative");if(y>t.ndim||y>r.ndim)throw new Error("tensordot: axes exceeds array dimensions");e=Array.from({length:y},(m,p)=>t.ndim-y+p),o=Array.from({length:y},(m,p)=>p)}else if([e,o]=n,e.length!==o.length)throw new Error("tensordot: axes lists must have same length");for(let y=0;y<e.length;y++){let m=e[y],p=o[y];if(m<0||m>=t.ndim||p<0||p>=r.ndim)throw new Error("tensordot: axis out of bounds");if(t.shape[m]!==r.shape[p])throw new Error(`tensordot: shape mismatch on axes ${m} and ${p}: ${t.shape[m]} != ${r.shape[p]}`)}let a=[],l=[];for(let y=0;y<t.ndim;y++)e.includes(y)||a.push(y);for(let y=0;y<r.ndim;y++)o.includes(y)||l.push(y);let i=[...a.map(y=>t.shape[y]),...l.map(y=>r.shape[y])];if(i.length===0){let y=0,m=e.map(p=>t.shape[p]).reduce((p,d)=>p*d,1);for(let p=0;p<m;p++){let d=p,A=new Array(e.length);for(let I=e.length-1;I>=0;I--){let w=e[I];A[I]=d%t.shape[w],d=Math.floor(d/t.shape[w])}let g=new Array(t.ndim),h=new Array(r.ndim);for(let I=0;I<e.length;I++)g[e[I]]=A[I];for(let I=0;I<o.length;I++)h[o[I]]=A[I];let S=t.get(...g),b=r.get(...h);typeof S=="bigint"&&typeof b=="bigint"?y=Number(y)+Number(S*b):y+=Number(S)*Number(b)}return y}let s=_(t.dtype,r.dtype),u=D.zeros(i,s),c=i.reduce((y,m)=>y*m,1),f=e.map(y=>t.shape[y]).reduce((y,m)=>y*m,1);for(let y=0;y<c;y++){let m=y,p=[];for(let h=i.length-1;h>=0;h--)p[h]=m%i[h],m=Math.floor(m/i[h]);let d=p.slice(0,a.length),A=p.slice(a.length),g=0;for(let h=0;h<f;h++){m=h;let S=[];for(let N=e.length-1;N>=0;N--){let nr=e[N];S[N]=m%t.shape[nr],m=Math.floor(m/t.shape[nr])}let b=new Array(t.ndim),I=new Array(r.ndim);for(let N=0;N<a.length;N++)b[a[N]]=d[N];for(let N=0;N<l.length;N++)I[l[N]]=A[N];for(let N=0;N<e.length;N++)b[e[N]]=S[N],I[o[N]]=S[N];let w=t.get(...b),$=r.get(...I);typeof w=="bigint"&&typeof $=="bigint"?g=Number(g)+Number(w*$):g+=Number(w)*Number($)}u.set(p,g)}return u}function Vr(t){return ur(t,Math.sqrt,!1)}function Cr(t,r){return typeof r=="number"?ct(t,r):O(t,r,Math.pow,"power")}function ct(t,r){let n=t.dtype,e=Array.from(t.shape),o=t.data,a=t.size,s=n!=="float32"&&n!=="float64"&&(r<0||!Number.isInteger(r))?"float64":n,u=D.zeros(e,s),c=u.data;if(x(n))if(x(s)&&Number.isInteger(r)&&r>=0){let f=o,y=c;for(let m=0;m<a;m++)y[m]=f[m]**BigInt(r)}else for(let f=0;f<a;f++)c[f]=Math.pow(Number(o[f]),r);else for(let f=0;f<a;f++)c[f]=Math.pow(Number(o[f]),r);return u}var E=class t{constructor(r,n){this._storage=r,this._base=n}get storage(){return this._storage}static _fromStorage(r,n){return new t(r,n)}get shape(){return this._storage.shape}get ndim(){return this._storage.ndim}get size(){return this._storage.size}get dtype(){return this._storage.dtype}get data(){return this._storage.data}get strides(){return this._storage.strides}get flags(){return{C_CONTIGUOUS:this._storage.isCContiguous,F_CONTIGUOUS:this._storage.isFContiguous,OWNDATA:this._base===void 0}}get base(){return this._base??null}get(r){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);let n=r.map((e,o)=>{let a=e;if(a<0&&(a=this.shape[o]+a),a<0||a>=this.shape[o])throw new Error(`Index ${e} is out of bounds for axis ${o} with size ${this.shape[o]}`);return a});return this._storage.get(...n)}set(r,n){if(r.length!==this.ndim)throw new Error(`Index has ${r.length} dimensions, but array has ${this.ndim} dimensions`);let e=r.map((l,i)=>{let s=l;if(s<0&&(s=this.shape[i]+s),s<0||s>=this.shape[i])throw new Error(`Index ${l} is out of bounds for axis ${i} with size ${this.shape[i]}`);return s}),o=this.dtype,a;x(o)?a=typeof n=="bigint"?n:BigInt(Math.round(n)):o==="bool"?a=n?1:0:a=Number(n),this._storage.set(e,a)}copy(){return new t(this._storage.copy())}astype(r,n=!0){let e=this.dtype;if(e===r&&!n)return this;if(e===r&&n)return this.copy();let o=Array.from(this.shape),a=this.size,l=U(r);if(!l)throw new Error(`Cannot convert to dtype ${r}`);let i=new l(a),s=this.data;if(x(e)&&!x(r)){let c=s;if(r==="bool")for(let f=0;f<a;f++)i[f]=c[f]!==BigInt(0)?1:0;else for(let f=0;f<a;f++)i[f]=Number(c[f])}else if(!x(e)&&x(r)){let c=s;for(let f=0;f<a;f++)i[f]=BigInt(Math.round(Number(c[f])))}else if(r==="bool"){let c=s;for(let f=0;f<a;f++)i[f]=c[f]!==0?1:0}else if(e==="bool"&&!x(r)){let c=s;for(let f=0;f<a;f++)i[f]=c[f]}else if(!x(e)&&!x(r)){let c=s;for(let f=0;f<a;f++)i[f]=c[f]}else{let c=s;for(let f=0;f<a;f++)i[f]=c[f]}let u=D.fromData(i,o,r);return new t(u)}add(r){let n=typeof r=="number"?r:r._storage,e=lr(this._storage,n);return t._fromStorage(e)}subtract(r){let n=typeof r=="number"?r:r._storage,e=fr(this._storage,n);return t._fromStorage(e)}multiply(r){let n=typeof r=="number"?r:r._storage,e=cr(this._storage,n);return t._fromStorage(e)}divide(r){let n=typeof r=="number"?r:r._storage,e=yr(this._storage,n);return t._fromStorage(e)}mod(r){let n=typeof r=="number"?r:r._storage,e=gr(this._storage,n);return t._fromStorage(e)}floor_divide(r){let n=typeof r=="number"?r:r._storage,e=hr(this._storage,n);return t._fromStorage(e)}positive(){let r=Ar(this._storage);return t._fromStorage(r)}reciprocal(){let r=br(this._storage);return t._fromStorage(r)}sqrt(){let r=Vr(this._storage);return t._fromStorage(r)}power(r){let n=typeof r=="number"?r:r._storage,e=Cr(this._storage,n);return t._fromStorage(e)}absolute(){let r=pr(this._storage);return t._fromStorage(r)}negative(){let r=mr(this._storage);return t._fromStorage(r)}sign(){let r=dr(this._storage);return t._fromStorage(r)}greater(r){let n=typeof r=="number"?r:r._storage,e=Sr(this._storage,n);return t._fromStorage(e)}greater_equal(r){let n=typeof r=="number"?r:r._storage,e=Dr(this._storage,n);return t._fromStorage(e)}less(r){let n=typeof r=="number"?r:r._storage,e=xr(this._storage,n);return t._fromStorage(e)}less_equal(r){let n=typeof r=="number"?r:r._storage,e=Ir(this._storage,n);return t._fromStorage(e)}equal(r){let n=typeof r=="number"?r:r._storage,e=wr(this._storage,n);return t._fromStorage(e)}not_equal(r){let n=typeof r=="number"?r:r._storage,e=Nr(this._storage,n);return t._fromStorage(e)}isclose(r,n=1e-5,e=1e-8){let o=typeof r=="number"?r:r._storage,a=R(this._storage,o,n,e);return t._fromStorage(a)}allclose(r,n=1e-5,e=1e-8){let o=typeof r=="number"?r:r._storage;return Br(this._storage,o,n,e)}sum(r,n=!1){let e=C(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}mean(r,n=!1){let e=W(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}max(r,n=!1){let e=J(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}min(r,n=!1){let e=G(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}prod(r,n=!1){let e=P(this._storage,r,n);return typeof e=="number"?e:t._fromStorage(e)}argmin(r){let n=H(this._storage,r);return typeof n=="number"?n:t._fromStorage(n)}argmax(r){let n=Y(this._storage,r);return typeof n=="number"?n:t._fromStorage(n)}var(r,n=0,e=!1){let o=Q(this._storage,r,n,e);return typeof o=="number"?o:t._fromStorage(o)}std(r,n=0,e=!1){let o=zr(this._storage,r,n,e);return typeof o=="number"?o:t._fromStorage(o)}all(r,n=!1){let e=X(this._storage,r,n);return typeof e=="boolean"?e:t._fromStorage(e)}any(r,n=!1){let e=Z(this._storage,r,n);return typeof e=="boolean"?e:t._fromStorage(e)}reshape(...r){let n=r.length===1&&Array.isArray(r[0])?r[0]:r,e=_r(this._storage,n),a=e.data===this.data?this._base??this:void 0;return t._fromStorage(e,a)}flatten(){let r=K(this._storage);return t._fromStorage(r)}ravel(){let r=F(this._storage),e=r.data===this.data?this._base??this:void 0;return t._fromStorage(r,e)}transpose(r){let n=rr(this._storage,r),e=this._base??this;return t._fromStorage(n,e)}squeeze(r){let n=Tr(this._storage,r),e=this._base??this;return t._fromStorage(n,e)}expand_dims(r){let n=Ur(this._storage,r),e=this._base??this;return t._fromStorage(n,e)}matmul(r){let n=er(this._storage,r._storage);return t._fromStorage(n)}dot(r){let n=tr(this._storage,r._storage);return typeof n=="number"||typeof n=="bigint"?n:t._fromStorage(n)}trace(){return $r(this._storage)}inner(r){let n=Or(this._storage,r._storage);return typeof n=="number"||typeof n=="bigint"?n:t._fromStorage(n)}outer(r){let n=vr(this._storage,r._storage);return t._fromStorage(n)}tensordot(r,n=2){let e=Mr(this._storage,r._storage,n);return typeof e=="number"||typeof e=="bigint"?e:t._fromStorage(e)}slice(...r){if(r.length===0)return this;if(r.length>this.ndim)throw new Error(`Too many indices for array: array is ${this.ndim}-dimensional, but ${r.length} were indexed`);let n=r.map((s,u)=>{let c=or(s);return sr(c,this.shape[u])});for(;n.length<this.ndim;)n.push({start:0,stop:this.shape[n.length],step:1,isIndex:!1});let e=[],o=[],a=this._storage.offset;for(let s=0;s<n.length;s++){let u=n[s],c=this._storage.strides[s];if(a+=u.start*c,!u.isIndex){let f;u.step>0?f=Math.max(0,Math.ceil((u.stop-u.start)/u.step)):f=Math.max(0,Math.ceil((u.start-u.stop)/Math.abs(u.step))),e.push(f),o.push(c*u.step)}}let l=D.fromData(this._storage.data,e,this._storage.dtype,o,a),i=this._base??this;return new t(l,i)}row(r){if(this.ndim<2)throw new Error("row() requires at least 2 dimensions");return this.slice(String(r),":")}col(r){if(this.ndim<2)throw new Error("col() requires at least 2 dimensions");return this.slice(":",String(r))}rows(r,n){if(this.ndim<2)throw new Error("rows() requires at least 2 dimensions");return this.slice(`${r}:${n}`,":")}cols(r,n){if(this.ndim<2)throw new Error("cols() requires at least 2 dimensions");return this.slice(":",`${r}:${n}`)}toString(){return`NDArray(shape=${JSON.stringify(this.shape)}, dtype=${this.dtype})`}toArray(){if(this.ndim===0)return this._storage.iget(0);let r=this.shape,n=r.length,e=(o,a)=>{if(a===n)return this._storage.get(...o);let l=[];for(let i=0;i<r[a];i++)o[a]=i,l.push(e(o,a+1));return l};return e(new Array(n),0)}};function q(t,r=T){let n=D.zeros(t,r);return new E(n)}function Fr(t,r=T){let n=D.ones(t,r);return new E(n)}function pt(t){let r=[],n=t;for(;Array.isArray(n);)r.push(n.length),n=n[0];return r}function kr(t){return typeof t=="bigint"?!0:Array.isArray(t)?t.some(r=>kr(r)):!1}function mt(t){let r=[];function n(e){Array.isArray(e)?e.forEach(o=>n(o)):r.push(e)}return n(t),r}function M(t,r){if(t instanceof E)return!r||t.dtype===r?t.copy():t.astype(r);let n=kr(t),e=pt(t),o=e.reduce((c,f)=>c*f,1),a=r;a||(n?a="int64":a=T);let l=U(a);if(!l)throw new Error(`Cannot create array with dtype ${a}`);let i=new l(o),s=mt(t);if(x(a)){let c=i;for(let f=0;f<o;f++){let y=s[f];c[f]=typeof y=="bigint"?y:BigInt(Math.round(Number(y)))}}else if(a==="bool"){let c=i;for(let f=0;f<o;f++)c[f]=s[f]?1:0}else{let c=i;for(let f=0;f<o;f++){let y=s[f];c[f]=Number(y)}}let u=D.fromData(i,e,a);return new E(u)}function dt(t,r,n=1,e=T){let o=t,a=r;if(r===void 0&&(o=0,a=t),a===void 0)throw new Error("stop is required");let l=Math.max(0,Math.ceil((a-o)/n)),i=U(e);if(!i)throw new Error(`Cannot create arange array with dtype ${e}`);let s=new i(l);if(x(e))for(let c=0;c<l;c++)s[c]=BigInt(Math.round(o+c*n));else if(e==="bool")for(let c=0;c<l;c++)s[c]=o+c*n!==0?1:0;else for(let c=0;c<l;c++)s[c]=o+c*n;let u=D.fromData(s,[l],e);return new E(u)}function gt(t,r,n=50,e=T){if(n<0)throw new Error("num must be non-negative");if(n===0)return M([],e);if(n===1)return M([t],e);let o=U(e);if(!o)throw new Error(`Cannot create linspace array with dtype ${e}`);let a=new o(n),l=(r-t)/(n-1);if(x(e))for(let s=0;s<n;s++)a[s]=BigInt(Math.round(t+s*l));else if(e==="bool")for(let s=0;s<n;s++)a[s]=t+s*l!==0?1:0;else for(let s=0;s<n;s++)a[s]=t+s*l;let i=D.fromData(a,[n],e);return new E(i)}function ht(t,r,n=50,e=10,o=T){if(n<0)throw new Error("num must be non-negative");if(n===0)return M([],o);if(n===1)return M([Math.pow(e,t)],o);let a=U(o);if(!a)throw new Error(`Cannot create logspace array with dtype ${o}`);let l=new a(n),i=(r-t)/(n-1);if(x(o))for(let u=0;u<n;u++){let c=t+u*i;l[u]=BigInt(Math.round(Math.pow(e,c)))}else if(o==="bool")for(let u=0;u<n;u++){let c=t+u*i;l[u]=Math.pow(e,c)!==0?1:0}else for(let u=0;u<n;u++){let c=t+u*i;l[u]=Math.pow(e,c)}let s=D.fromData(l,[n],o);return new E(s)}function At(t,r,n=50,e=T){if(n<0)throw new Error("num must be non-negative");if(t===0||r===0)throw new Error("Geometric sequence cannot include zero");if(n===0)return M([],e);if(n===1)return M([t],e);let o=Math.sign(t),a=Math.sign(r);if(o!==a)throw new Error("Geometric sequence cannot contain both positive and negative values");let l=U(e);if(!l)throw new Error(`Cannot create geomspace array with dtype ${e}`);let i=new l(n),s=Math.log(Math.abs(t)),c=(Math.log(Math.abs(r))-s)/(n-1);if(x(e))for(let y=0;y<n;y++){let m=o*Math.exp(s+y*c);i[y]=BigInt(Math.round(m))}else if(e==="bool")for(let y=0;y<n;y++){let m=o*Math.exp(s+y*c);i[y]=m!==0?1:0}else for(let y=0;y<n;y++){let m=o*Math.exp(s+y*c);i[y]=m}let f=D.fromData(i,[n],e);return new E(f)}function qr(t,r,n=0,e=T){let o=r??t,a=q([t,o],e),l=a.data;if(x(e)){let i=l;for(let s=0;s<t;s++){let u=s+n;u>=0&&u<o&&(i[s*o+u]=BigInt(1))}}else{let i=l;for(let s=0;s<t;s++){let u=s+n;u>=0&&u<o&&(i[s*o+u]=1)}}return a}function jr(t,r=T){return q(t,r)}function Lr(t,r,n){let e=n;e||(typeof r=="bigint"?e="int64":typeof r=="boolean"?e="bool":Number.isInteger(r)?e="int32":e=T);let o=U(e);if(!o)throw new Error(`Cannot create full array with dtype ${e}`);let a=t.reduce((s,u)=>s*u,1),l=new o(a);if(x(e)){let s=typeof r=="bigint"?r:BigInt(Math.round(Number(r)));l.fill(s)}else e==="bool"?l.fill(r?1:0):l.fill(Number(r));let i=D.fromData(l,t,e);return new E(i)}function bt(t,r=T){return qr(t,t,0,r)}function St(t,r){return t instanceof E?!r||t.dtype===r?t:t.astype(r):M(t,r)}function Dt(t){return t.copy()}function xt(t,r){return q(Array.from(t.shape),r??t.dtype)}function It(t,r){return Fr(Array.from(t.shape),r??t.dtype)}function wt(t,r){return jr(Array.from(t.shape),r??t.dtype)}function Nt(t,r,n){return Lr(Array.from(t.shape),r,n??t.dtype)}function Bt(t){return t.sqrt()}function zt(t,r){return t.power(r)}function _t(t){return t.absolute()}function Tt(t){return t.negative()}function Ut(t){return t.sign()}function Et(t,r){return t.mod(r)}function $t(t,r){return t.floor_divide(r)}function Ot(t){return t.positive()}function vt(t){return t.reciprocal()}function Mt(t,r){return t.dot(r)}function Vt(t){return t.trace()}function Ct(t,r){return t.transpose(r)}function Ft(t,r){return t.inner(r)}function kt(t,r){return t.outer(r)}function qt(t,r,n=2){return t.tensordot(r,n)}var de="0.4.0";export{E as NDArray,de as __version__,_t as absolute,dt as arange,M as array,St as asarray,Dt as copy,Mt as dot,jr as empty,wt as empty_like,qr as eye,$t as floor_divide,Lr as full,Nt as full_like,At as geomspace,bt as identity,Ft as inner,gt as linspace,ht as logspace,Et as mod,Tt as negative,Fr as ones,It as ones_like,kt as outer,Ot as positive,zt as power,vt as reciprocal,Ut as sign,Bt as sqrt,qt as tensordot,Vt as trace,Ct as transpose,q as zeros,xt as zeros_like};
397
2
  //# sourceMappingURL=numpy-ts.esm.js.map