numpy-ts 0.3.0 → 0.5.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.
- package/README.md +199 -297
- package/dist/numpy-ts.browser.js +2 -397
- package/dist/numpy-ts.esm.js +2 -397
- package/dist/numpy-ts.node-io.cjs +3 -0
- package/dist/numpy-ts.node-io.cjs.map +7 -0
- package/dist/numpy-ts.node-io.mjs +3 -0
- package/dist/numpy-ts.node-io.mjs.map +7 -0
- package/dist/numpy-ts.node.cjs +2 -412
- package/dist/numpy-ts.node.cjs.map +7 -0
- package/dist/types/core/ndarray.d.ts +477 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/io/index.d.ts +17 -0
- package/dist/types/io/npy/format.d.ts +91 -0
- package/dist/types/io/npy/index.d.ts +7 -0
- package/dist/types/io/npy/parser.d.ts +28 -0
- package/dist/types/io/npy/serializer.d.ts +17 -0
- package/dist/types/io/npz/index.d.ts +6 -0
- package/dist/types/io/npz/parser.d.ts +57 -0
- package/dist/types/io/npz/serializer.d.ts +49 -0
- package/dist/types/io/zip/index.d.ts +7 -0
- package/dist/types/io/zip/reader.d.ts +22 -0
- package/dist/types/io/zip/types.d.ts +59 -0
- package/dist/types/io/zip/writer.d.ts +29 -0
- package/dist/types/node.d.ts +154 -0
- package/dist/types/ops/advanced.d.ts +34 -0
- package/dist/types/ops/hyperbolic.d.ts +59 -0
- package/dist/types/ops/linalg.d.ts +79 -0
- package/dist/types/ops/shape.d.ts +61 -0
- package/dist/types/ops/trig.d.ts +94 -0
- package/package.json +18 -10
package/dist/numpy-ts.node.cjs
CHANGED
|
@@ -1,413 +1,3 @@
|
|
|
1
|
-
"use strict";var Wh=Object.create;var he=Object.defineProperty;var Zh=Object.getOwnPropertyDescriptor;var Jh=Object.getOwnPropertyNames;var Hh=Object.getPrototypeOf,Xh=Object.prototype.hasOwnProperty;var l=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Qh=(e,r)=>{for(var t in r)he(e,t,{get:r[t],enumerable:!0})},Dn=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Jh(r))!Xh.call(e,i)&&i!==t&&he(e,i,{get:()=>r[i],enumerable:!(n=Zh(r,i))||n.enumerable});return e};var Kh=(e,r,t)=>(t=e!=null?Wh(Hh(e)):{},Dn(r||!e||!e.__esModule?he(t,"default",{value:e,enumerable:!0}):t,e)),rg=e=>Dn(he({},"__esModule",{value:!0}),e);var oi=l((g1,ai)=>{"use strict";var xg=Object;ai.exports=xg});var ui=l((v1,si)=>{"use strict";var Eg=oi();si.exports=Eg});var li=l((b1,fi)=>{"use strict";var Sg=/./;fi.exports=Sg});var pi=l((d1,ci)=>{"use strict";var _g=typeof Object.defineProperty=="function"?Object.defineProperty:null;ci.exports=_g});var mi=l((w1,yi)=>{"use strict";var Tg=pi();function qg(){try{return Tg({},"x",{}),!0}catch{return!1}}yi.exports=qg});var gi=l((A1,hi)=>{"use strict";var Ig=Object.defineProperty;hi.exports=Ig});var Ke=l((x1,vi)=>{"use strict";function Dg(e){return typeof e=="number"}vi.exports=Dg});var rt=l((E1,di)=>{"use strict";function Ng(e){return e[0]==="-"}function bi(e){var r="",t;for(t=0;t<e;t++)r+="0";return r}function Bg(e,r,t){var n=!1,i=r-e.length;return i<0||(Ng(e)&&(n=!0,e=e.substr(1)),e=t?e+bi(i):bi(i)+e,n&&(e="-"+e)),e}di.exports=Bg});var Ei=l((S1,xi)=>{"use strict";var Og=Ke(),wi=rt(),Vg=String.prototype.toLowerCase,Ai=String.prototype.toUpperCase;function Ug(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(!Og(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=wi(t,e.precision,e.padRight)),t="-"+t):(t=n.toString(r),!n&&!e.precision?t="":e.precision&&(t=wi(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):Vg.call(t)),r===8&&e.alternate&&t.charAt(0)!=="0"&&(t="0"+t),t}xi.exports=Ug});var _i=l((_1,Si)=>{"use strict";function zg(e){return typeof e=="string"}Si.exports=zg});var Ii=l((T1,qi)=>{"use strict";var Fg=Ke(),Rg=Math.abs,jg=String.prototype.toLowerCase,Ti=String.prototype.toUpperCase,Dr=String.prototype.replace,Cg=/e\+(\d)$/,Lg=/e-(\d)$/,Mg=/^(\d+)$/,Pg=/^(\d+)e/,kg=/\.0$/,$g=/\.0*e/,Gg=/(\..*[^0])0*e/;function Yg(e){var r,t,n=parseFloat(e.arg);if(!isFinite(n)){if(!Fg(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":Rg(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,Gg,"$1e"),t=Dr.call(t,$g,"e"),t=Dr.call(t,kg,""));break;default:throw new Error("invalid double notation. Value: "+e.specifier)}return t=Dr.call(t,Cg,"e+0$1"),t=Dr.call(t,Lg,"e-0$1"),e.alternate&&(t=Dr.call(t,Mg,"$1."),t=Dr.call(t,Pg,"$1.e")),n>=0&&e.sign&&(t=e.sign+t),t=e.specifier===Ti.call(e.specifier)?Ti.call(t):jg.call(t),t}qi.exports=Yg});var Bi=l((q1,Ni)=>{"use strict";function Di(e){var r="",t;for(t=0;t<e;t++)r+=" ";return r}function Wg(e,r,t){var n=r-e.length;return n<0||(e=t?e+Di(n):Di(n)+e),e}Ni.exports=Wg});var Vi=l((I1,Oi)=>{"use strict";var Zg=Ei(),Jg=_i(),Hg=Ii(),Xg=Bi(),Qg=rt(),Kg=String.fromCharCode,rv=Array.isArray;function ve(e){return e!==e}function ev(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 tv(e){var r,t,n,i,a,s,o,f,u;if(!rv(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],Jg(n))s+=n;else{if(r=n.precision!==void 0,n=ev(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,ve(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,ve(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=Zg(n);break;case"s":n.maxWidth=r?n.precision:-1,n.arg=String(n.arg);break;case"c":if(!ve(n.arg)){if(a=parseInt(n.arg,10),a<0||a>127)throw new Error("invalid character code. Value: "+n.arg);n.arg=ve(a)?String(n.arg):Kg(a)}break;case"e":case"E":case"f":case"F":case"g":case"G":r||(n.precision=6),n.arg=Hg(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=Qg(n.arg,n.width||n.precision,n.padRight):n.width&&(n.arg=Xg(n.arg,n.width,n.padRight)),s+=n.arg||"",o+=1}return s}Oi.exports=tv});var zi=l((D1,Ui)=>{"use strict";var nv=Vi();Ui.exports=nv});var Ri=l((N1,Fi)=>{"use strict";var be=/%(?:([1-9]\d*)\$)?([0 +\-#]*)(\*|\d+)?(?:(\.)(\*|\d+)?)?[hlL]?([%A-Za-z])/g;function iv(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 av(e){var r,t,n,i;for(t=[],i=0,n=be.exec(e);n;)r=e.slice(i,be.lastIndex-n[0].length),r.length&&t.push(r),t.push(iv(n)),i=be.lastIndex,n=be.exec(e);return r=e.slice(i),r.length&&t.push(r),t}Fi.exports=av});var Ci=l((B1,ji)=>{"use strict";var ov=Ri();ji.exports=ov});var Mi=l((O1,Li)=>{"use strict";function sv(e){return typeof e=="string"}Li.exports=sv});var $i=l((V1,ki)=>{"use strict";var uv=zi(),fv=Ci(),lv=Mi();function Pi(e){var r,t;if(!lv(e))throw new TypeError(Pi("invalid argument. First argument must be a string. Value: `%s`.",e));for(r=[fv(e)],t=1;t<arguments.length;t++)r.push(arguments[t]);return uv.apply(null,r)}ki.exports=Pi});var J=l((U1,Gi)=>{"use strict";var cv=$i();Gi.exports=cv});var Xi=l((z1,Hi)=>{"use strict";var Yi=J(),Fr=Object.prototype,Wi=Fr.toString,Zi=Fr.__defineGetter__,Ji=Fr.__defineSetter__,pv=Fr.__lookupGetter__,yv=Fr.__lookupSetter__;function mv(e,r,t){var n,i,a,s;if(typeof e!="object"||e===null||Wi.call(e)==="[object Array]")throw new TypeError(Yi("invalid argument. First argument must be an object. Value: `%s`.",e));if(typeof t!="object"||t===null||Wi.call(t)==="[object Array]")throw new TypeError(Yi("invalid argument. Property descriptor must be an object. Value: `%s`.",t));if(i="value"in t,i&&(pv.call(e,r)||yv.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&&Zi&&Zi.call(e,r,t.get),s&&Ji&&Ji.call(e,r,t.set),e}Hi.exports=mv});var Pr=l((F1,Qi)=>{"use strict";var hv=mi(),gv=gi(),vv=Xi(),et;hv()?et=gv:et=vv;Qi.exports=et});var ra=l((R1,Ki)=>{"use strict";var bv=Pr();function dv(e,r,t){bv(e,r,{configurable:!1,enumerable:!1,writable:!1,value:t})}Ki.exports=dv});var W=l((j1,ea)=>{"use strict";var wv=ra();ea.exports=wv});var tt=l((C1,ta)=>{"use strict";function Av(e){return typeof e=="boolean"}ta.exports=Av});var ia=l((L1,na)=>{"use strict";function xv(){return typeof Symbol=="function"&&typeof Symbol("foo")=="symbol"}na.exports=xv});var oa=l((M1,aa)=>{"use strict";var Ev=ia();aa.exports=Ev});var ua=l((P1,sa)=>{"use strict";var Sv=oa(),_v=Sv();function Tv(){return _v&&typeof Symbol.toStringTag=="symbol"}sa.exports=Tv});var kr=l((k1,fa)=>{"use strict";var qv=ua();fa.exports=qv});var nt=l(($1,la)=>{"use strict";var Iv=Object.prototype.toString;la.exports=Iv});var pa=l((G1,ca)=>{"use strict";var Dv=nt();function Nv(e){return Dv.call(e)}ca.exports=Nv});var ma=l((Y1,ya)=>{"use strict";var Bv=Object.prototype.hasOwnProperty;function Ov(e,r){return e==null?!1:Bv.call(e,r)}ya.exports=Ov});var it=l((W1,ha)=>{"use strict";var Vv=ma();ha.exports=Vv});var va=l((Z1,ga)=>{"use strict";var Uv=typeof Symbol=="function"?Symbol:void 0;ga.exports=Uv});var at=l((J1,ba)=>{"use strict";var zv=va();ba.exports=zv});var Aa=l((H1,wa)=>{"use strict";var da=at(),Fv=typeof da=="function"?da.toStringTag:"";wa.exports=Fv});var Ea=l((X1,xa)=>{"use strict";var Rv=it(),$r=Aa(),ot=nt();function jv(e){var r,t,n;if(e==null)return ot.call(e);t=e[$r],r=Rv(e,$r);try{e[$r]=void 0}catch{return ot.call(e)}return n=ot.call(e),r?e[$r]=t:delete e[$r],n}xa.exports=jv});var Z=l((Q1,Sa)=>{"use strict";var Cv=kr(),Lv=pa(),Mv=Ea(),st;Cv()?st=Mv:st=Lv;Sa.exports=st});var Ta=l((K1,_a)=>{"use strict";var Pv=Boolean;_a.exports=Pv});var Rr=l((rq,qa)=>{"use strict";var kv=Ta();qa.exports=kv});var Da=l((eq,Ia)=>{"use strict";var $v=Boolean.prototype.toString;Ia.exports=$v});var Ba=l((tq,Na)=>{"use strict";var Gv=Da();function Yv(e){try{return Gv.call(e),!0}catch{return!1}}Na.exports=Yv});var ut=l((nq,Oa)=>{"use strict";var Wv=kr(),Zv=Z(),Jv=Rr(),Hv=Ba(),Xv=Wv();function Qv(e){return typeof e=="object"?e instanceof Jv?!0:Xv?Hv(e):Zv(e)==="[object Boolean]":!1}Oa.exports=Qv});var Ua=l((iq,Va)=>{"use strict";var Kv=tt(),rb=ut();function eb(e){return Kv(e)||rb(e)}Va.exports=eb});var lt=l((aq,Fa)=>{"use strict";var za=W(),ft=Ua(),tb=tt(),nb=ut();za(ft,"isPrimitive",tb);za(ft,"isObject",nb);Fa.exports=ft});var ja=l((oq,Ra)=>{"use strict";function ib(){return new Function("return this;")()}Ra.exports=ib});var La=l((sq,Ca)=>{"use strict";var ab=typeof self=="object"?self:null;Ca.exports=ab});var Pa=l((uq,Ma)=>{"use strict";var ob=typeof window=="object"?window:null;Ma.exports=ob});var $a=l((fq,ka)=>{"use strict";var sb=typeof global=="object"?global:null;ka.exports=sb});var Ya=l((lq,Ga)=>{"use strict";var ub=typeof globalThis=="object"?globalThis:null;Ga.exports=ub});var Qa=l((cq,Xa)=>{"use strict";var fb=lt().isPrimitive,lb=J(),cb=ja(),Wa=La(),Za=Pa(),Ja=$a(),Ha=Ya();function pb(e){if(arguments.length){if(!fb(e))throw new TypeError(lb("invalid argument. Must provide a boolean. Value: `%s`.",e));if(e)return cb()}if(Ha)return Ha;if(Wa)return Wa;if(Za)return Za;if(Ja)return Ja;throw new Error("unexpected error. Unable to resolve global object.")}Xa.exports=pb});var ro=l((pq,Ka)=>{"use strict";var yb=Qa();Ka.exports=yb});var no=l((yq,to)=>{"use strict";var mb=ro(),eo=mb(),hb=eo.document&&eo.document.childNodes;to.exports=hb});var ao=l((mq,io)=>{"use strict";var gb=Int8Array;io.exports=gb});var so=l((hq,oo)=>{"use strict";var vb=li(),bb=no(),db=ao();function wb(){return typeof vb=="function"||typeof db=="object"||typeof bb=="function"}oo.exports=wb});var ct=l((gq,uo)=>{"use strict";function Ab(){return/^\s*function\s*([^(]*)/i}uo.exports=Ab});var lo=l((vq,fo)=>{"use strict";var xb=ct(),Eb=xb();fo.exports=Eb});var yo=l((bq,po)=>{"use strict";var Sb=W(),co=ct(),_b=lo();Sb(co,"REGEXP",_b);po.exports=co});var ho=l((dq,mo)=>{"use strict";var Tb=Z(),pt;function qb(e){return Tb(e)==="[object Array]"}Array.isArray?pt=Array.isArray:pt=qb;mo.exports=pt});var jr=l((wq,go)=>{"use strict";var Ib=ho();go.exports=Ib});var bo=l((Aq,vo)=>{"use strict";var Db=jr(),Nb=J();function Bb(e){if(typeof e!="function")throw new TypeError(Nb("invalid argument. Must provide a function. Value: `%s`.",e));return r;function r(t){var n,i;if(!Db(t)||(n=t.length,n===0))return!1;for(i=0;i<n;i++)if(e(t[i])===!1)return!1;return!0}}vo.exports=Bb});var yt=l((xq,wo)=>{"use strict";var Ob=bo();wo.exports=Ob});var xo=l((Eq,Ao)=>{"use strict";function Vb(e){return e!==null&&typeof e=="object"}Ao.exports=Vb});var So=l((Sq,Eo)=>{"use strict";var Ub=W(),zb=yt(),mt=xo(),Fb=zb(mt);Ub(mt,"isObjectLikeArray",Fb);Eo.exports=mt});var To=l((_q,_o)=>{"use strict";var Rb=So();function jb(e){return Rb(e)&&(e._isBuffer||e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))}_o.exports=jb});var ht=l((Tq,qo)=>{"use strict";var Cb=To();qo.exports=Cb});var Do=l((qq,Io)=>{"use strict";var Lb=Z(),Mb=yo().REGEXP,Pb=ht();function kb(e){var r,t,n;if(t=Lb(e).slice(8,-1),(t==="Object"||t==="Error")&&e.constructor){if(n=e.constructor,typeof n.name=="string")return n.name;if(r=Mb.exec(n.toString()),r)return r[1]}return Pb(e)?"Buffer":t}Io.exports=kb});var de=l((Iq,No)=>{"use strict";var $b=Do();No.exports=$b});var Oo=l((Dq,Bo)=>{"use strict";var Gb=de();function Yb(e){var r;return e===null?"null":(r=typeof e,r==="object"?Gb(e).toLowerCase():r)}Bo.exports=Yb});var Uo=l((Nq,Vo)=>{"use strict";var Wb=de();function Zb(e){return Wb(e).toLowerCase()}Vo.exports=Zb});var Fo=l((Bq,zo)=>{"use strict";var Jb=so(),Hb=Oo(),Xb=Uo(),Qb=Jb()?Xb:Hb;zo.exports=Qb});var jo=l((Oq,Ro)=>{"use strict";var Kb=Fo();function rd(e){return Kb(e)==="function"}Ro.exports=rd});var Gr=l((Vq,Co)=>{"use strict";var ed=jo();Co.exports=ed});var Mo=l((Uq,Lo)=>{"use strict";var td=Object.getPrototypeOf;Lo.exports=td});var ko=l((zq,Po)=>{"use strict";function nd(e){return e.__proto__}Po.exports=nd});var Go=l((Fq,$o)=>{"use strict";var id=Z(),ad=ko();function od(e){var r=ad(e);return r||r===null?r:id(e.constructor)==="[object Function]"?e.constructor.prototype:e instanceof Object?Object.prototype:null}$o.exports=od});var Wo=l((Rq,Yo)=>{"use strict";var sd=Gr(),ud=Mo(),fd=Go(),gt;sd(Object.getPrototypeOf)?gt=ud:gt=fd;Yo.exports=gt});var Jo=l((jq,Zo)=>{"use strict";var ld=ui(),cd=Wo();function pd(e){return e==null?null:(e=ld(e),cd(e))}Zo.exports=pd});var Xo=l((Cq,Ho)=>{"use strict";var yd=Jo();Ho.exports=yd});var Ko=l((Lq,Qo)=>{"use strict";var md=Xo(),hd=Z();function gd(e){if(typeof e!="object"||e===null)return!1;if(e instanceof Error)return!0;for(;e;){if(hd(e)==="[object Error]")return!0;e=md(e)}return!1}Qo.exports=gd});var we=l((Mq,rs)=>{"use strict";var vd=Ko();rs.exports=vd});var ts=l((Pq,es)=>{"use strict";var bd=we();function dd(e){try{return require(e)}catch(r){return bd(r)?r:typeof r=="object"?new Error(JSON.stringify(r)):new Error(r.toString())}}es.exports=dd});var vt=l((kq,ns)=>{"use strict";var wd=ts();ns.exports=wd});var as=l(($q,is)=>{"use strict";function Ad(e,r){return e>r?e:r}is.exports=Ad});var ss=l((Gq,os)=>{"use strict";var xd=as();os.exports=xd});var ls=l((Yq,fs)=>{"use strict";var us="function";function Ed(e){return typeof e.get===us&&typeof e.set===us}fs.exports=Ed});var bt=l((Wq,cs)=>{"use strict";var Sd=ls();cs.exports=Sd});var ms=l((Zq,ys)=>{"use strict";var ps={complex128:_d,complex64:Td,default:qd};function _d(e,r){return e.get(r)}function Td(e,r){return e.get(r)}function qd(e,r){return e.get(r)}function Id(e){var r=ps[e];return typeof r=="function"?r:ps.default}ys.exports=Id});var Cr=l((Jq,hs)=>{"use strict";var Dd=ms();hs.exports=Dd});var bs=l((Hq,vs)=>{"use strict";var gs={float64:Nd,float32:Bd,int32:Od,int16:Vd,int8:Ud,uint32:zd,uint16:Fd,uint8:Rd,uint8c:jd,generic:Cd,default:Ld};function Nd(e,r){return e[r]}function Bd(e,r){return e[r]}function Od(e,r){return e[r]}function Vd(e,r){return e[r]}function Ud(e,r){return e[r]}function zd(e,r){return e[r]}function Fd(e,r){return e[r]}function Rd(e,r){return e[r]}function jd(e,r){return e[r]}function Cd(e,r){return e[r]}function Ld(e,r){return e[r]}function Md(e){var r=gs[e];return typeof r=="function"?r:gs.default}vs.exports=Md});var Yr=l((Xq,ds)=>{"use strict";var Pd=bs();ds.exports=Pd});var As=l((Qq,ws)=>{"use strict";var kd={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"};ws.exports=kd});var Es=l((Kq,xs)=>{"use strict";var $d=Z(),Gd=typeof Float64Array=="function";function Yd(e){return Gd&&e instanceof Float64Array||$d(e)==="[object Float64Array]"}xs.exports=Yd});var _s=l((rI,Ss)=>{"use strict";var Wd=Es();Ss.exports=Wd});var qs=l((eI,Ts)=>{"use strict";var Zd=typeof Float64Array=="function"?Float64Array:null;Ts.exports=Zd});var Ns=l((tI,Ds)=>{"use strict";var Jd=_s(),Is=qs();function Hd(){var e,r;if(typeof Is!="function")return!1;try{r=new Is([1,3.14,-3.14,NaN]),e=Jd(r)&&r[0]===1&&r[1]===3.14&&r[2]===-3.14&&r[3]!==r[3]}catch{e=!1}return e}Ds.exports=Hd});var Os=l((nI,Bs)=>{"use strict";var Xd=Ns();Bs.exports=Xd});var Us=l((iI,Vs)=>{"use strict";var Qd=typeof Float64Array=="function"?Float64Array:void 0;Vs.exports=Qd});var Fs=l((aI,zs)=>{"use strict";function Kd(){throw new Error("not implemented")}zs.exports=Kd});var Ae=l((oI,Rs)=>{"use strict";var rw=Os(),ew=Us(),tw=Fs(),dt;rw()?dt=ew:dt=tw;Rs.exports=dt});var Cs=l((sI,js)=>{"use strict";var nw=Z(),iw=typeof Float32Array=="function";function aw(e){return iw&&e instanceof Float32Array||nw(e)==="[object Float32Array]"}js.exports=aw});var Ms=l((uI,Ls)=>{"use strict";var ow=Cs();Ls.exports=ow});var wt=l((fI,Ps)=>{"use strict";var sw=Number.POSITIVE_INFINITY;Ps.exports=sw});var $s=l((lI,ks)=>{"use strict";var uw=typeof Float32Array=="function"?Float32Array:null;ks.exports=uw});var Ws=l((cI,Ys)=>{"use strict";var fw=Ms(),lw=wt(),Gs=$s();function cw(){var e,r;if(typeof Gs!="function")return!1;try{r=new Gs([1,3.14,-3.14,5e40]),e=fw(r)&&r[0]===1&&r[1]===3.140000104904175&&r[2]===-3.140000104904175&&r[3]===lw}catch{e=!1}return e}Ys.exports=cw});var Js=l((pI,Zs)=>{"use strict";var pw=Ws();Zs.exports=pw});var Xs=l((yI,Hs)=>{"use strict";var yw=typeof Float32Array=="function"?Float32Array:void 0;Hs.exports=yw});var Ks=l((mI,Qs)=>{"use strict";function mw(){throw new Error("not implemented")}Qs.exports=mw});var Wr=l((hI,ru)=>{"use strict";var hw=Js(),gw=Xs(),vw=Ks(),At;hw()?At=gw:At=vw;ru.exports=At});var tu=l((gI,eu)=>{"use strict";var bw=Z(),dw=typeof Uint32Array=="function";function ww(e){return dw&&e instanceof Uint32Array||bw(e)==="[object Uint32Array]"}eu.exports=ww});var iu=l((vI,nu)=>{"use strict";var Aw=tu();nu.exports=Aw});var ou=l((bI,au)=>{"use strict";var xw=4294967295;au.exports=xw});var uu=l((dI,su)=>{"use strict";var Ew=typeof Uint32Array=="function"?Uint32Array:null;su.exports=Ew});var cu=l((wI,lu)=>{"use strict";var Sw=iu(),xt=ou(),fu=uu();function _w(){var e,r;if(typeof fu!="function")return!1;try{r=[1,3.14,-3.14,xt+1,xt+2],r=new fu(r),e=Sw(r)&&r[0]===1&&r[1]===3&&r[2]===xt-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}lu.exports=_w});var yu=l((AI,pu)=>{"use strict";var Tw=cu();pu.exports=Tw});var hu=l((xI,mu)=>{"use strict";var qw=typeof Uint32Array=="function"?Uint32Array:void 0;mu.exports=qw});var vu=l((EI,gu)=>{"use strict";function Iw(){throw new Error("not implemented")}gu.exports=Iw});var du=l((SI,bu)=>{"use strict";var Dw=yu(),Nw=hu(),Bw=vu(),Et;Dw()?Et=Nw:Et=Bw;bu.exports=Et});var Au=l((_I,wu)=>{"use strict";var Ow=Z(),Vw=typeof Int32Array=="function";function Uw(e){return Vw&&e instanceof Int32Array||Ow(e)==="[object Int32Array]"}wu.exports=Uw});var Eu=l((TI,xu)=>{"use strict";var zw=Au();xu.exports=zw});var _u=l((qI,Su)=>{"use strict";var Fw=2147483647;Su.exports=Fw});var qu=l((II,Tu)=>{"use strict";var Rw=-2147483648;Tu.exports=Rw});var Du=l((DI,Iu)=>{"use strict";var jw=typeof Int32Array=="function"?Int32Array:null;Iu.exports=jw});var Ou=l((NI,Bu)=>{"use strict";var Cw=Eu(),Lw=_u(),Mw=qu(),Nu=Du();function Pw(){var e,r;if(typeof Nu!="function")return!1;try{r=new Nu([1,3.14,-3.14,Lw+1]),e=Cw(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===Mw}catch{e=!1}return e}Bu.exports=Pw});var Uu=l((BI,Vu)=>{"use strict";var kw=Ou();Vu.exports=kw});var Fu=l((OI,zu)=>{"use strict";var $w=typeof Int32Array=="function"?Int32Array:void 0;zu.exports=$w});var ju=l((VI,Ru)=>{"use strict";function Gw(){throw new Error("not implemented")}Ru.exports=Gw});var Lu=l((UI,Cu)=>{"use strict";var Yw=Uu(),Ww=Fu(),Zw=ju(),St;Yw()?St=Ww:St=Zw;Cu.exports=St});var Pu=l((zI,Mu)=>{"use strict";var Jw=Z(),Hw=typeof Uint16Array=="function";function Xw(e){return Hw&&e instanceof Uint16Array||Jw(e)==="[object Uint16Array]"}Mu.exports=Xw});var $u=l((FI,ku)=>{"use strict";var Qw=Pu();ku.exports=Qw});var Yu=l((RI,Gu)=>{"use strict";var Kw=65535;Gu.exports=Kw});var Zu=l((jI,Wu)=>{"use strict";var rA=typeof Uint16Array=="function"?Uint16Array:null;Wu.exports=rA});var Xu=l((CI,Hu)=>{"use strict";var eA=$u(),_t=Yu(),Ju=Zu();function tA(){var e,r;if(typeof Ju!="function")return!1;try{r=[1,3.14,-3.14,_t+1,_t+2],r=new Ju(r),e=eA(r)&&r[0]===1&&r[1]===3&&r[2]===_t-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}Hu.exports=tA});var Ku=l((LI,Qu)=>{"use strict";var nA=Xu();Qu.exports=nA});var ef=l((MI,rf)=>{"use strict";var iA=typeof Uint16Array=="function"?Uint16Array:void 0;rf.exports=iA});var nf=l((PI,tf)=>{"use strict";function aA(){throw new Error("not implemented")}tf.exports=aA});var of=l((kI,af)=>{"use strict";var oA=Ku(),sA=ef(),uA=nf(),Tt;oA()?Tt=sA:Tt=uA;af.exports=Tt});var uf=l(($I,sf)=>{"use strict";var fA=Z(),lA=typeof Int16Array=="function";function cA(e){return lA&&e instanceof Int16Array||fA(e)==="[object Int16Array]"}sf.exports=cA});var lf=l((GI,ff)=>{"use strict";var pA=uf();ff.exports=pA});var pf=l((YI,cf)=>{"use strict";var yA=32767;cf.exports=yA});var mf=l((WI,yf)=>{"use strict";var mA=-32768;yf.exports=mA});var gf=l((ZI,hf)=>{"use strict";var hA=typeof Int16Array=="function"?Int16Array:null;hf.exports=hA});var df=l((JI,bf)=>{"use strict";var gA=lf(),vA=pf(),bA=mf(),vf=gf();function dA(){var e,r;if(typeof vf!="function")return!1;try{r=new vf([1,3.14,-3.14,vA+1]),e=gA(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===bA}catch{e=!1}return e}bf.exports=dA});var Af=l((HI,wf)=>{"use strict";var wA=df();wf.exports=wA});var Ef=l((XI,xf)=>{"use strict";var AA=typeof Int16Array=="function"?Int16Array:void 0;xf.exports=AA});var _f=l((QI,Sf)=>{"use strict";function xA(){throw new Error("not implemented")}Sf.exports=xA});var qf=l((KI,Tf)=>{"use strict";var EA=Af(),SA=Ef(),_A=_f(),qt;EA()?qt=SA:qt=_A;Tf.exports=qt});var Df=l((r6,If)=>{"use strict";var TA=Z(),qA=typeof Uint8Array=="function";function IA(e){return qA&&e instanceof Uint8Array||TA(e)==="[object Uint8Array]"}If.exports=IA});var Bf=l((e6,Nf)=>{"use strict";var DA=Df();Nf.exports=DA});var Vf=l((t6,Of)=>{"use strict";var NA=255;Of.exports=NA});var zf=l((n6,Uf)=>{"use strict";var BA=typeof Uint8Array=="function"?Uint8Array:null;Uf.exports=BA});var jf=l((i6,Rf)=>{"use strict";var OA=Bf(),It=Vf(),Ff=zf();function VA(){var e,r;if(typeof Ff!="function")return!1;try{r=[1,3.14,-3.14,It+1,It+2],r=new Ff(r),e=OA(r)&&r[0]===1&&r[1]===3&&r[2]===It-2&&r[3]===0&&r[4]===1}catch{e=!1}return e}Rf.exports=VA});var Lf=l((a6,Cf)=>{"use strict";var UA=jf();Cf.exports=UA});var Pf=l((o6,Mf)=>{"use strict";var zA=typeof Uint8Array=="function"?Uint8Array:void 0;Mf.exports=zA});var $f=l((s6,kf)=>{"use strict";function FA(){throw new Error("not implemented")}kf.exports=FA});var Nt=l((u6,Gf)=>{"use strict";var RA=Lf(),jA=Pf(),CA=$f(),Dt;RA()?Dt=jA:Dt=CA;Gf.exports=Dt});var Wf=l((f6,Yf)=>{"use strict";var LA=Z(),MA=typeof Uint8ClampedArray=="function";function PA(e){return MA&&e instanceof Uint8ClampedArray||LA(e)==="[object Uint8ClampedArray]"}Yf.exports=PA});var Jf=l((l6,Zf)=>{"use strict";var kA=Wf();Zf.exports=kA});var Xf=l((c6,Hf)=>{"use strict";var $A=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:null;Hf.exports=$A});var rl=l((p6,Kf)=>{"use strict";var GA=Jf(),Qf=Xf();function YA(){var e,r;if(typeof Qf!="function")return!1;try{r=new Qf([-1,0,1,3.14,4.99,255,256]),e=GA(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}Kf.exports=YA});var tl=l((y6,el)=>{"use strict";var WA=rl();el.exports=WA});var il=l((m6,nl)=>{"use strict";var ZA=typeof Uint8ClampedArray=="function"?Uint8ClampedArray:void 0;nl.exports=ZA});var ol=l((h6,al)=>{"use strict";function JA(){throw new Error("not implemented")}al.exports=JA});var ul=l((g6,sl)=>{"use strict";var HA=tl(),XA=il(),QA=ol(),Bt;HA()?Bt=XA:Bt=QA;sl.exports=Bt});var ll=l((v6,fl)=>{"use strict";var KA=Z(),r0=typeof Int8Array=="function";function e0(e){return r0&&e instanceof Int8Array||KA(e)==="[object Int8Array]"}fl.exports=e0});var pl=l((b6,cl)=>{"use strict";var t0=ll();cl.exports=t0});var ml=l((d6,yl)=>{"use strict";var n0=127;yl.exports=n0});var gl=l((w6,hl)=>{"use strict";var i0=-128;hl.exports=i0});var bl=l((A6,vl)=>{"use strict";var a0=typeof Int8Array=="function"?Int8Array:null;vl.exports=a0});var Al=l((x6,wl)=>{"use strict";var o0=pl(),s0=ml(),u0=gl(),dl=bl();function f0(){var e,r;if(typeof dl!="function")return!1;try{r=new dl([1,3.14,-3.14,s0+1]),e=o0(r)&&r[0]===1&&r[1]===3&&r[2]===-3&&r[3]===u0}catch{e=!1}return e}wl.exports=f0});var El=l((E6,xl)=>{"use strict";var l0=Al();xl.exports=l0});var _l=l((S6,Sl)=>{"use strict";var c0=typeof Int8Array=="function"?Int8Array:void 0;Sl.exports=c0});var ql=l((_6,Tl)=>{"use strict";function p0(){throw new Error("not implemented")}Tl.exports=p0});var Dl=l((T6,Il)=>{"use strict";var y0=El(),m0=_l(),h0=ql(),Ot;y0()?Ot=m0:Ot=h0;Il.exports=Ot});var Vt=l((q6,Nl)=>{"use strict";function g0(e){return typeof e=="number"}Nl.exports=g0});var Ol=l((I6,Bl)=>{"use strict";Bl.exports=Number});var xe=l((D6,Vl)=>{"use strict";var v0=Ol();Vl.exports=v0});var zl=l((N6,Ul)=>{"use strict";var b0=xe(),d0=b0.prototype.toString;Ul.exports=d0});var Rl=l((B6,Fl)=>{"use strict";var w0=zl();function A0(e){try{return w0.call(e),!0}catch{return!1}}Fl.exports=A0});var Ut=l((O6,jl)=>{"use strict";var x0=kr(),E0=Z(),S0=xe(),_0=Rl(),T0=x0();function q0(e){return typeof e=="object"?e instanceof S0?!0:T0?_0(e):E0(e)==="[object Number]":!1}jl.exports=q0});var Ll=l((V6,Cl)=>{"use strict";var I0=Vt(),D0=Ut();function N0(e){return I0(e)||D0(e)}Cl.exports=N0});var Zr=l((U6,Pl)=>{"use strict";var Ml=W(),zt=Ll(),B0=Vt(),O0=Ut();Ml(zt,"isPrimitive",B0);Ml(zt,"isObject",O0);Pl.exports=zt});var $l=l((z6,kl)=>{"use strict";var V0=xe(),U0=V0.NEGATIVE_INFINITY;kl.exports=U0});var Yl=l((F6,Gl)=>{"use strict";var z0=Math.floor;Gl.exports=z0});var Jr=l((R6,Wl)=>{"use strict";var F0=Yl();Wl.exports=F0});var Jl=l((j6,Zl)=>{"use strict";var R0=Jr();function j0(e){return R0(e)===e}Zl.exports=j0});var Nr=l((C6,Hl)=>{"use strict";var C0=Jl();Hl.exports=C0});var Ft=l((L6,Xl)=>{"use strict";var L0=wt(),M0=$l(),P0=Nr();function k0(e){return e<L0&&e>M0&&P0(e)}Xl.exports=k0});var Rt=l((M6,Ql)=>{"use strict";var $0=Zr().isPrimitive,G0=Ft();function Y0(e){return $0(e)&&G0(e)}Ql.exports=Y0});var jt=l((P6,Kl)=>{"use strict";var W0=Zr().isObject,Z0=Ft();function J0(e){return W0(e)&&Z0(e.valueOf())}Kl.exports=J0});var ec=l((k6,rc)=>{"use strict";var H0=Rt(),X0=jt();function Q0(e){return H0(e)||X0(e)}rc.exports=Q0});var Ee=l(($6,nc)=>{"use strict";var tc=W(),Ct=ec(),K0=Rt(),rx=jt();tc(Ct,"isPrimitive",K0);tc(Ct,"isObject",rx);nc.exports=Ct});var Lt=l((G6,ic)=>{"use strict";var ex=Ee().isPrimitive;function tx(e){return ex(e)&&e>=0}ic.exports=tx});var Mt=l((Y6,ac)=>{"use strict";var nx=Ee().isObject;function ix(e){return nx(e)&&e.valueOf()>=0}ac.exports=ix});var sc=l((W6,oc)=>{"use strict";var ax=Lt(),ox=Mt();function sx(e){return ax(e)||ox(e)}oc.exports=sx});var Se=l((Z6,fc)=>{"use strict";var uc=W(),Pt=sc(),ux=Lt(),fx=Mt();uc(Pt,"isPrimitive",ux);uc(Pt,"isObject",fx);fc.exports=Pt});var cc=l((J6,lc)=>{"use strict";var lx=4294967295;lc.exports=lx});var yc=l((H6,pc)=>{"use strict";var cx=Nr(),px=cc();function yx(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&cx(e.length)&&e.length>=0&&e.length<=px}pc.exports=yx});var Br=l((X6,mc)=>{"use strict";var mx=yc();mc.exports=mx});var gc=l((Q6,hc)=>{"use strict";var hx=9007199254740991;hc.exports=hx});var bc=l((K6,vc)=>{"use strict";var gx=Nr(),vx=gc();function bx(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&gx(e.length)&&e.length>=0&&e.length<=vx}vc.exports=bx});var Hr=l((r2,dc)=>{"use strict";var dx=bc();dc.exports=dx});var Ac=l((e2,wc)=>{"use strict";var wx=Z(),Ax=typeof ArrayBuffer=="function";function xx(e){return Ax&&e instanceof ArrayBuffer||wx(e)==="[object ArrayBuffer]"}wc.exports=xx});var _e=l((t2,xc)=>{"use strict";var Ex=Ac();xc.exports=Ex});var Sc=l((n2,Ec)=>{"use strict";var Sx=jr();function _x(e){return typeof e=="object"&&e!==null&&!Sx(e)}Ec.exports=_x});var Te=l((i2,_c)=>{"use strict";var Tx=Sc();_c.exports=Tx});var kt=l((a2,Tc)=>{"use strict";function qx(e){return typeof e=="string"}Tc.exports=qx});var Ic=l((o2,qc)=>{"use strict";var Ix=String.prototype.valueOf;qc.exports=Ix});var Nc=l((s2,Dc)=>{"use strict";var Dx=Ic();function Nx(e){try{return Dx.call(e),!0}catch{return!1}}Dc.exports=Nx});var $t=l((u2,Bc)=>{"use strict";var Bx=kr(),Ox=Z(),Vx=Nc(),Ux=Bx();function zx(e){return typeof e=="object"?e instanceof String?!0:Ux?Vx(e):Ox(e)==="[object String]":!1}Bc.exports=zx});var Vc=l((f2,Oc)=>{"use strict";var Fx=kt(),Rx=$t();function jx(e){return Fx(e)||Rx(e)}Oc.exports=jx});var Xr=l((l2,zc)=>{"use strict";var Uc=W(),Gt=Vc(),Cx=kt(),Lx=$t();Uc(Gt,"isPrimitive",Cx);Uc(Gt,"isObject",Lx);zc.exports=Gt});var qe=l((c2,Rc)=>{"use strict";var Fc=W(),Yt=yt(),Wt=Xr(),Mx=Yt(Wt.isPrimitive),Px=Yt(Wt.isObject),Zt=Yt(Wt);Fc(Zt,"primitives",Mx);Fc(Zt,"objects",Px);Rc.exports=Zt});var Cc=l((p2,jc)=>{"use strict";function kx(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i",e}jc.exports=kx});var Mc=l((y2,Lc)=>{"use strict";function $x(){var e={};return e.type="Complex128",e.re=this.re,e.im=this.im,e}Lc.exports=$x});var Yc=l((m2,Gc)=>{"use strict";var Pc=Zr().isPrimitive,kc=Pr(),Qr=W(),$c=J(),Gx=Cc(),Yx=Mc();function Or(e,r){if(!(this instanceof Or))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!Pc(e))throw new TypeError($c("invalid argument. Real component must be a number. Value: `%s`.",e));if(!Pc(r))throw new TypeError($c("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return kc(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:e}),kc(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:r}),this}Qr(Or,"BYTES_PER_ELEMENT",8);Qr(Or.prototype,"BYTES_PER_ELEMENT",8);Qr(Or.prototype,"byteLength",16);Qr(Or.prototype,"toString",Gx);Qr(Or.prototype,"toJSON",Yx);Gc.exports=Or});var Jt=l((h2,Wc)=>{"use strict";var Wx=Yc();Wc.exports=Wx});var Jc=l((g2,Zc)=>{"use strict";var Zx=typeof Math.fround=="function"?Math.fround:null;Zc.exports=Zx});var Qc=l((v2,Xc)=>{"use strict";var Jx=Wr(),Hc=new Jx(1);function Hx(e){return Hc[0]=e,Hc[0]}Xc.exports=Hx});var ep=l((b2,rp)=>{"use strict";var Kc=Jc(),Xx=Qc(),Ht;typeof Kc=="function"?Ht=Kc:Ht=Xx;rp.exports=Ht});var np=l((d2,tp)=>{"use strict";function Qx(){var e=""+this.re;return this.im<0?e+=" - "+-this.im:e+=" + "+this.im,e+="i",e}tp.exports=Qx});var ap=l((w2,ip)=>{"use strict";function Kx(){var e={};return e.type="Complex64",e.re=this.re,e.im=this.im,e}ip.exports=Kx});var cp=l((A2,lp)=>{"use strict";var op=Zr().isPrimitive,sp=Pr(),Kr=W(),up=ep(),fp=J(),rE=np(),eE=ap();function Vr(e,r){if(!(this instanceof Vr))throw new TypeError("invalid invocation. Constructor must be called with the `new` keyword.");if(!op(e))throw new TypeError(fp("invalid argument. Real component must be a number. Value: `%s`.",e));if(!op(r))throw new TypeError(fp("invalid argument. Imaginary component must be a number. Value: `%s`.",r));return sp(this,"re",{configurable:!1,enumerable:!0,writable:!1,value:up(e)}),sp(this,"im",{configurable:!1,enumerable:!0,writable:!1,value:up(r)}),this}Kr(Vr,"BYTES_PER_ELEMENT",4);Kr(Vr.prototype,"BYTES_PER_ELEMENT",4);Kr(Vr.prototype,"byteLength",8);Kr(Vr.prototype,"toString",rE);Kr(Vr.prototype,"toJSON",eE);lp.exports=Vr});var Xt=l((x2,pp)=>{"use strict";var tE=cp();pp.exports=tE});var mp=l((E2,yp)=>{"use strict";var nE=Jt(),iE=Xt();function aE(e){return e instanceof nE||e instanceof iE?!0:typeof e=="object"&&e!==null&&typeof e.re=="number"&&typeof e.im=="number"}yp.exports=aE});var br=l((S2,hp)=>{"use strict";var oE=mp();hp.exports=oE});var vp=l((_2,gp)=>{"use strict";var sE=Nr();function uE(e){return sE(e/2)}gp.exports=uE});var Qt=l((T2,bp)=>{"use strict";var fE=vp();bp.exports=fE});var wp=l((q2,dp)=>{"use strict";var lE=8;function cE(e){return typeof e=="object"&&e!==null&&e.constructor.name==="Complex64Array"&&e.BYTES_PER_ELEMENT===lE}dp.exports=cE});var Kt=l((I2,Ap)=>{"use strict";var pE=wp();Ap.exports=pE});var Ep=l((D2,xp)=>{"use strict";var yE=16;function mE(e){return typeof e=="object"&&e!==null&&e.constructor.name==="Complex128Array"&&e.BYTES_PER_ELEMENT===yE}xp.exports=mE});var rn=l((N2,Sp)=>{"use strict";var hE=Ep();Sp.exports=hE});var Tp=l((B2,_p)=>{"use strict";var gE=it(),Ie=at();function vE(){return typeof Ie=="function"&&typeof Ie("foo")=="symbol"&&gE(Ie,"iterator")&&typeof Ie.iterator=="symbol"}_p.exports=vE});var re=l((O2,qp)=>{"use strict";var bE=Tp();qp.exports=bE});var Dp=l((V2,Ip)=>{"use strict";var dE=re(),wE=dE()?Symbol.iterator:null;Ip.exports=wE});var De=l((U2,Np)=>{"use strict";var AE=Dp();Np.exports=AE});var Op=l((z2,Bp)=>{"use strict";var xE=Pr();function EE(e,r,t){xE(e,r,{configurable:!1,enumerable:!1,get:t})}Bp.exports=EE});var Ne=l((F2,Vp)=>{"use strict";var SE=Op();Vp.exports=SE});var zp=l((R2,Up)=>{"use strict";function _E(e){return e.re}Up.exports=_E});var ee=l((j2,Fp)=>{"use strict";var TE=zp();Fp.exports=TE});var jp=l((C2,Rp)=>{"use strict";function qE(e){return e.im}Rp.exports=qE});var te=l((L2,Cp)=>{"use strict";var IE=jp();Cp.exports=IE});var Mp=l((M2,Lp)=>{"use strict";var DE=Wr();function NE(e,r){return new DE(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}Lp.exports=NE});var en=l((P2,Pp)=>{"use strict";var BE=Mp();Pp.exports=BE});var $p=l((k2,kp)=>{"use strict";var OE=Ae();function VE(e,r){return new OE(e.buffer,e.byteOffset+e.BYTES_PER_ELEMENT*r,2*(e.length-r))}kp.exports=VE});var tn=l(($2,Gp)=>{"use strict";var UE=$p();Gp.exports=UE});var Wp=l((G2,Yp)=>{"use strict";var zE=Br(),FE=br(),RE=ee(),jE=te(),CE=J();function LE(e){var r,t,n;for(r=[];t=e.next(),!t.done;)if(n=t.value,zE(n)&&n.length>=2)r.push(n[0],n[1]);else if(FE(n))r.push(RE(n),jE(n));else return new TypeError(CE("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}Yp.exports=LE});var Jp=l((Y2,Zp)=>{"use strict";var ME=Br(),PE=br(),kE=ee(),$E=te(),GE=J();function YE(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),ME(a)&&a.length>=2)n.push(a[0],a[1]);else if(PE(a))n.push(kE(a),$E(a));else return new TypeError(GE("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));return n}Zp.exports=YE});var Xp=l((W2,Hp)=>{"use strict";var WE=br(),ZE=ee(),JE=te();function HE(e,r){var t,n,i,a;for(t=r.length,a=0,i=0;i<t;i++){if(n=r[i],!WE(n))return null;e[a]=ZE(n),e[a+1]=JE(n),a+=2}return e}Hp.exports=HE});var iy=l((Z2,ny)=>{"use strict";var ne=Se().isPrimitive,nn=Br(),an=Hr(),Qp=_e(),on=Te(),XE=jr(),QE=qe().primitives,Kp=Xr().isPrimitive,$=Gr(),ir=br(),Be=Qt(),Q=Nr(),KE=Kt(),rS=rn(),eS=re(),yr=De(),I=W(),Oe=Ne(),nr=Wr(),tS=Xt(),x=J(),ur=ee(),fr=te(),nS=Jr(),iS=en(),aS=tn(),oS=Yr(),sS=Cr(),ry=Wp(),uS=Jp(),fS=Xp(),er=nr.BYTES_PER_ELEMENT*2,ey=eS();function V(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 ty(e){return e===_||e.name==="Complex128Array"}function C(e,r){return r*=2,new tS(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 nr(0);else if(r===1)if(ne(arguments[0]))t=new nr(arguments[0]*2);else if(an(arguments[0]))if(t=arguments[0],n=t.length,n&&XE(t)&&ir(t[0])){if(t=fS(new nr(n*2),t),t===null){if(!Be(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(KE(t))t=iS(t,0);else if(rS(t))t=aS(t,0);else if(!Be(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(Qp(arguments[0])){if(t=arguments[0],!Q(t.byteLength/er))throw new RangeError(x("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",er,t.byteLength));t=new nr(t)}else if(on(arguments[0])){if(t=arguments[0],ey===!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=ry(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],!Qp(t))throw new TypeError(x("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!ne(e))throw new TypeError(x("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!Q(e/er))throw new RangeError(x("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",er,e));if(r===2){if(n=t.byteLength-e,!Q(n/er))throw new RangeError(x("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",er,n));t=new nr(t,e)}else{if(n=arguments[2],!ne(n))throw new TypeError(x("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*er>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*er));t=new nr(t,e,n*2)}}return I(this,"_buffer",t),I(this,"_length",t.length/2),this}I(_,"BYTES_PER_ELEMENT",er);I(_,"name","Complex64Array");I(_,"from",function(r){var t,n,i,a,s,o,f,u,c,p,y,m;if(!$(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ty(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(nn(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(an(r)){if(i){for(u=r.length,r.get&&r.set?f=sS("default"):f=oS("default"),y=0;y<u;y++)if(!ir(f(r,y))){c=!0;break}if(c){if(!Be(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(nn(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(on(r)&&ey&&$(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=uS(s,i,t):o=ry(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(_,"of",function(){var r,t;if(!$(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!ty(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(_.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 C(this._buffer,r)});Oe(_.prototype,"buffer",function(){return this._buffer.buffer});Oe(_.prototype,"byteLength",function(){return this._buffer.byteLength});Oe(_.prototype,"byteOffset",function(){return this._buffer.byteOffset});I(_.prototype,"BYTES_PER_ELEMENT",_.BYTES_PER_ELEMENT);I(_.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(_.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,C(i,s)],done:!1}}function f(c){return a=!0,arguments.length?{value:c,done:!0}:{done:!0}}function u(){return r.entries()}});I(_.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,C(n,i),i,this))return!1;return!0});I(_.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(_.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=C(n,a),r.call(t,s,a,this)&&i.push(s);return new this.constructor(i)});I(_.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=C(n,i),r.call(t,a,i,this))return a});I(_.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=C(n,i),r.call(t,a,i,this))return i;return-1});I(_.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=C(n,i),r.call(t,a,i,this))return a});I(_.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=C(n,i),r.call(t,a,i,this))return i;return-1});I(_.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=C(n,i),r.call(t,a,i,this)});I(_.prototype,"get",function(r){if(!V(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!ne(r))throw new TypeError(x("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return C(this._buffer,r)});I(_.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(_.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(_.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(Kp(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(C(n,a).toString());return t.join(i)});I(_.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(_.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});Oe(_.prototype,"length",function(){return this._length});I(_.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,C(i,s),s,this),ir(o))n[2*s]=ur(o),n[2*s+1]=fr(o);else if(nn(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(_.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=C(n,0),o=1}for(;o<a;o++)s=C(n,o),i=r(i,s,o,this);return i});I(_.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=C(n,a-1),o=a-2}for(;o>=0;o--)s=C(n,o),i=r(i,s,o,this);return i});I(_.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=nS(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(_.prototype,"set",function(r){var t,n,i,a,s,o,f,u,c;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],!ne(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,c=i.byteOffset+n*er,t.buffer===i.buffer&&t.byteOffset<c&&t.byteOffset+t.byteLength>c){for(a=new nr(t.length),u=0;u<t.length;u++)a[u]=t[u];t=a}for(n*=2,c=0,u=0;u<o;u++)i[n]=t[c],i[n+1]=t[c+1],n+=2,c+=2;return}if(an(r)){for(o=r.length,u=0;u<o;u++)if(!ir(r[u])){s=!0;break}if(s){if(!Be(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,c=i.byteOffset+n*er,t.buffer===i.buffer&&t.byteOffset<c&&t.byteOffset+t.byteLength>c){for(a=new nr(o),u=0;u<o;u++)a[u]=t[u];t=a}for(n*=2,o/=2,c=0,u=0;u<o;u++)i[n]=t[c],i[n+1]=t[c+1],n+=2,c+=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(_.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(_.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,C(n,i),i,this))return!0;return!1});I(_.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(C(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(_.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*er):(a=t-r,n=i.byteOffset+r*er),new this.constructor(i.buffer,n,a<0?0:a)});I(_.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(Kp(r)||QE(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(on(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(C(s,o).toLocaleString(i,n));return a.join(",")});I(_.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(_.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(C(n,a));return t.sort(r),new _(t)});I(_.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(C(t,n).toString());return r.join(",")});I(_.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:C(a,s),done:!1}}function f(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function u(){return t.values()}});I(_.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});ny.exports=_});var oy=l((J2,ay)=>{"use strict";var lS=iy();ay.exports=lS});var uy=l((H2,sy)=>{"use strict";function cS(e){return e.re}sy.exports=cS});var ie=l((X2,fy)=>{"use strict";var pS=uy();fy.exports=pS});var cy=l((Q2,ly)=>{"use strict";function yS(e){return e.im}ly.exports=yS});var ae=l((K2,py)=>{"use strict";var mS=cy();py.exports=mS});var my=l((r4,yy)=>{"use strict";var hS=Br(),gS=br(),vS=J(),bS=ie(),dS=ae();function wS(e){var r,t,n;for(r=[];t=e.next(),!t.done;)if(n=t.value,hS(n)&&n.length>=2)r.push(n[0],n[1]);else if(gS(n))r.push(bS(n),dS(n));else return new TypeError(vS("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}yy.exports=wS});var gy=l((e4,hy)=>{"use strict";var AS=Br(),xS=br(),ES=J(),SS=ie(),_S=ae();function TS(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),AS(a)&&a.length>=2)n.push(a[0],a[1]);else if(xS(a))n.push(SS(a),_S(a));else return new TypeError(ES("invalid argument. Callback must return either a two-element array containing real and imaginary components or a complex number. Value: `%s`.",a));return n}hy.exports=TS});var by=l((t4,vy)=>{"use strict";var qS=br(),IS=ie(),DS=ae();function NS(e,r){var t,n,i,a;for(t=r.length,a=0,i=0;i<t;i++){if(n=r[i],!qS(n))return null;e[a]=IS(n),e[a+1]=DS(n),a+=2}return e}vy.exports=NS});var Ty=l((n4,_y)=>{"use strict";var oe=Se().isPrimitive,sn=Br(),un=Hr(),dy=_e(),fn=Te(),BS=jr(),OS=qe().primitives,wy=Xr(),G=Gr(),or=br(),Ve=Qt(),K=Nr(),VS=Kt(),US=rn(),zS=re(),mr=De(),D=W(),Ue=Ne(),ar=Ae(),Ay=Jt(),lr=ie(),cr=ae(),FS=Jr(),RS=en(),jS=tn(),CS=Yr(),LS=Cr(),E=J(),xy=my(),MS=gy(),PS=by(),tr=ar.BYTES_PER_ELEMENT*2,Ey=zS();function U(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 Sy(e){return e===T||e.name==="Complex64Array"}function L(e,r){return r*=2,new Ay(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 ar(0);else if(r===1)if(oe(arguments[0]))t=new ar(arguments[0]*2);else if(un(arguments[0]))if(t=arguments[0],n=t.length,n&&BS(t)&&or(t[0])){if(t=PS(new ar(n*2),t),t===null){if(!Ve(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(VS(t))t=RS(t,0);else if(US(t))t=jS(t,0);else if(!Ve(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(dy(arguments[0])){if(t=arguments[0],!K(t.byteLength/tr))throw new RangeError(E("invalid argument. ArrayBuffer byte length must be a multiple of %u. Byte length: `%u`.",tr,t.byteLength));t=new ar(t)}else if(fn(arguments[0])){if(t=arguments[0],Ey===!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=xy(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],!dy(t))throw new TypeError(E("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!oe(e))throw new TypeError(E("invalid argument. Byte offset must be a nonnegative integer. Value: `%s`.",e));if(!K(e/tr))throw new RangeError(E("invalid argument. Byte offset must be a multiple of %u. Value: `%u`.",tr,e));if(r===2){if(n=t.byteLength-e,!K(n/tr))throw new RangeError(E("invalid arguments. ArrayBuffer view byte length must be a multiple of %u. View byte length: `%u`.",tr,n));t=new ar(t,e)}else{if(n=arguments[2],!oe(n))throw new TypeError(E("invalid argument. Length must be a nonnegative integer. Value: `%s`.",n));if(n*tr>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*tr));t=new ar(t,e,n*2)}}return D(this,"_buffer",t),D(this,"_length",t.length/2),this}D(T,"BYTES_PER_ELEMENT",tr);D(T,"name","Complex128Array");D(T,"from",function(r){var t,n,i,a,s,o,f,u,c,p,y,m;if(!G(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Sy(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(sn(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(un(r)){if(i){for(u=r.length,r.get&&r.set?f=LS("default"):f=CS("default"),y=0;y<u;y++)if(!or(f(r,y))){c=!0;break}if(c){if(!Ve(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(sn(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(fn(r)&&Ey&&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=MS(s,i,t):o=xy(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(T,"of",function(){var r,t;if(!G(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Sy(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(T.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)});Ue(T.prototype,"buffer",function(){return this._buffer.buffer});Ue(T.prototype,"byteLength",function(){return this._buffer.byteLength});Ue(T.prototype,"byteOffset",function(){return this._buffer.byteOffset});D(T.prototype,"BYTES_PER_ELEMENT",T.BYTES_PER_ELEMENT);D(T.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(T.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,c),n;function f(){var p;return s+=1,a||s>=i?{done:!0}:(o+=2,p=new Ay(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 c(){return t.entries()}});D(T.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(T.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(T.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(T.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(T.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(T.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(T.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(T.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(T.prototype,"get",function(r){if(!U(this))throw new TypeError("invalid invocation. `this` is not a complex number array.");if(!oe(r))throw new TypeError(E("invalid argument. Must provide a nonnegative integer. Value: `%s`.",r));if(!(r>=this._length))return L(this._buffer,r)});Ue(T.prototype,"length",function(){return this._length});D(T.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(T.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(T.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(wy(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(T.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(T.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(T.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(sn(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(T.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(T.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(T.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=FS(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(T.prototype,"set",function(r){var t,n,i,a,s,o,f,u,c;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],!oe(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,c=i.byteOffset+n*tr,t.buffer===i.buffer&&t.byteOffset<c&&t.byteOffset+t.byteLength>c){for(a=new ar(t.length),u=0;u<t.length;u++)a[u]=t[u];t=a}for(n*=2,c=0,u=0;u<o;u++)i[n]=t[c],i[n+1]=t[c+1],n+=2,c+=2;return}if(un(r)){for(o=r.length,u=0;u<o;u++)if(!or(r[u])){s=!0;break}if(s){if(!Ve(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,c=i.byteOffset+n*tr,t.buffer===i.buffer&&t.byteOffset<c&&t.byteOffset+t.byteLength>c){for(a=new ar(o),u=0;u<o;u++)a[u]=t[u];t=a}for(n*=2,o/=2,c=0,u=0;u<o;u++)i[n]=t[c],i[n+1]=t[c+1],n+=2,c+=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(T.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(T.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(T.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(T.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*tr):(a=t-r,n=i.byteOffset+r*tr),new this.constructor(i.buffer,n,a<0?0:a)});D(T.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(wy(r)||OS(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(fn(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(T.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(T.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(t)});D(T.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(T.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(c){return i=!0,arguments.length?{value:c,done:!0}:{done:!0}}function u(){return t.values()}});D(T.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});_y.exports=T});var Iy=l((i4,qy)=>{"use strict";var kS=Ty();qy.exports=kS});var Ny=l((a4,Dy)=>{"use strict";var $S=Rr();function GS(e){var r,t;for(r=[];t=e.next(),!t.done;)r.push($S(t.value));return r}Dy.exports=GS});var Oy=l((o4,By)=>{"use strict";var YS=Rr();function WS(e,r,t){var n,i,a;for(n=[],a=-1;i=e.next(),!i.done;)a+=1,n.push(YS(r.call(t,i.value,a)));return n}By.exports=WS});var Uy=l((s4,Vy)=>{"use strict";var ZS=Rr();function JS(e,r){var t,n;for(t=r.length,n=0;n<t;n++)e[n]=ZS(r[n]);return e}Vy.exports=JS});var My=l((u4,Ly)=>{"use strict";var se=Se().isPrimitive,ln=Hr(),zy=_e(),cn=Te(),Y=Gr(),ue=lt().isPrimitive,pr=Ee().isPrimitive,Fy=Xr().isPrimitive,HS=qe().primitives,XS=re(),hr=De(),N=W(),ze=Ne(),dr=Nt(),R=Rr(),QS=Yr(),KS=Jr(),r_=Cr(),B=J(),Ry=Ny(),e_=Oy(),t_=Uy(),Ur=dr.BYTES_PER_ELEMENT,jy=XS();function z(e){return typeof e=="object"&&e!==null&&e.constructor.name==="BooleanArray"&&e.BYTES_PER_ELEMENT===Ur}function Cy(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],se(i))t=new dr(i);else if(ln(i))t=t_(new dr(i.length),i);else if(zy(i))t=new dr(i);else if(cn(i)){if(jy===!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],!zy(t))throw new TypeError(B("invalid argument. First argument must be an ArrayBuffer. Value: `%s`.",t));if(e=arguments[1],!se(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],!se(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,c;if(!Y(this))throw new TypeError("invalid invocation. `this` context must be a constructor.");if(!Cy(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(ln(r)){if(i){for(u=r.length,r.get&&r.set?f=r_("default"):f=QS("default"),a=new this(u),s=a._buffer,c=0;c<u;c++)s[c]=R(i.call(t,f(r,c),c));return a}return new this(r)}if(cn(r)&&jy&&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,c=0;c<u;c++)s[c]=o[c];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(!Cy(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])});ze(q.prototype,"buffer",function(){return this._buffer.buffer});ze(q.prototype,"byteLength",function(){return this._buffer.byteLength});ze(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(c){return a=!0,arguments.length?{value:c,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(!ue(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(!se(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(!ue(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(!ue(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(!Fy(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(!ue(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});ze(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=KS(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],!se(n))throw new TypeError(B("invalid argument. Index argument must be a nonnegative integer. Value: `%s`.",n))}else n=0;if(ln(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(Fy(r)||HS(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(cn(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(c){return i=!0,arguments.length?{value:c,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(!ue(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});Ly.exports=q});var ky=l((f4,Py)=>{"use strict";var n_=My();Py.exports=n_});var Gy=l((l4,$y)=>{"use strict";var i_=Ae(),a_=Wr(),o_=du(),s_=Lu(),u_=of(),f_=qf(),l_=Nt(),c_=ul(),p_=Dl(),y_=oy(),m_=Iy(),h_=ky(),g_=[i_,a_,s_,o_,f_,u_,p_,l_,c_,y_,m_,h_];$y.exports=g_});var Wy=l((c4,Yy)=>{"use strict";var v_=["float64","float32","int32","uint32","int16","uint16","int8","uint8","uint8c","complex64","complex128","bool"];Yy.exports=v_});var Hy=l((p4,Jy)=>{"use strict";var b_=ht(),d_=jr(),w_=de(),A_=As(),x_=Gy(),Zy=Wy(),E_=Zy.length;function S_(e){var r;if(d_(e))return"generic";if(b_(e))return null;for(r=0;r<E_;r++)if(e instanceof x_[r])return Zy[r];return A_[w_(e)]||null}Jy.exports=S_});var pn=l((y4,Xy)=>{"use strict";var __=Hy();Xy.exports=__});var Ky=l((m4,Qy)=>{"use strict";var T_=bt(),q_=Cr(),I_=Yr(),D_=pn();function N_(e,r){var t,n,i,a;for(i=D_(e),T_(e)?n=q_(i):n=I_(i),t=e.length,a=0;a<t;a++)if(n(e,a)===r)return!0;return!1}Qy.exports=N_});var em=l((h4,rm)=>{"use strict";var B_=Hr(),O_=bt(),V_=Cr(),U_=pn(),z_=J();function F_(e){var r,t,n;if(!B_(e))throw new TypeError(z_("invalid argument. Must provide an array-like object. Value: `%s`.",e));return n=U_(e),O_(e)&&(r=V_(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}}rm.exports=F_});var yn=l((g4,nm)=>{"use strict";var R_=W(),tm=Ky(),j_=em();R_(tm,"factory",j_);nm.exports=tm});var im=l((v4,C_)=>{C_.exports=["row-major","column-major"]});var om=l((b4,am)=>{"use strict";var L_=im();function M_(){return L_.slice()}am.exports=M_});var um=l((d4,sm)=>{"use strict";function P_(){return{"row-major":101,"column-major":102}}sm.exports=P_});var cm=l((w4,lm)=>{"use strict";var k_=W(),fm=om(),$_=um();k_(fm,"enum",$_);lm.exports=fm});var ym=l((A4,pm)=>{"use strict";var G_=yn().factory,Y_=cm(),W_=G_(Y_());pm.exports=W_});var hm=l((x4,mm)=>{"use strict";var Z_=ym();mm.exports=Z_});var gm=l((E4,J_)=>{J_.exports=["no-transpose","transpose","conjugate-transpose"]});var bm=l((S4,vm)=>{"use strict";var H_=gm();function X_(){return H_.slice()}vm.exports=X_});var wm=l((_4,dm)=>{"use strict";function Q_(){return{"no-transpose":111,transpose:112,"conjugate-transpose":113}}dm.exports=Q_});var Em=l((T4,xm)=>{"use strict";var K_=W(),Am=bm(),rT=wm();K_(Am,"enum",rT);xm.exports=Am});var _m=l((q4,Sm)=>{"use strict";var eT=yn().factory,tT=Em(),nT=eT(tT());Sm.exports=nT});var mn=l((I4,Tm)=>{"use strict";var iT=_m();Tm.exports=iT});var Im=l((D4,qm)=>{"use strict";function aT(e){return Math.abs(e)}qm.exports=aT});var Nm=l((N4,Dm)=>{"use strict";var oT=Im();Dm.exports=oT});var Vm=l((B4,Om)=>{"use strict";var Bm=Nm();function sT(e){var r,t,n,i;if(r=e.length,r===0)return!1;for(t=Bm(e[0]),i=1;i<r;i++){if(n=Bm(e[i]),n>t)return!1;t=n}return!0}Om.exports=sT});var zm=l((O4,Um)=>{"use strict";var uT=Vm();Um.exports=uT});var Rm=l((V4,Fm)=>{"use strict";function fT(e,r){return r>0?0:(1-e)*r}Fm.exports=fT});var Cm=l((U4,jm)=>{"use strict";var lT=Rm();jm.exports=lT});var hn=l((z4,Lm)=>{"use strict";var fe=5;function cT(e,r,t,n,i,a,s){var o,f,u,c,p;if(o=0,e<=0)return o;if(f=n,u=s,t===1&&a===1){if(c=e%fe,c>0)for(p=0;p<c;p++)o+=r[f]*i[u],f+=1,u+=1;if(e<fe)return o;for(p=c;p<e;p+=fe)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+=fe,u+=fe;return o}for(p=0;p<e;p++)o+=r[f]*i[u],f+=t,u+=a;return o}Lm.exports=cT});var km=l((F4,Pm)=>{"use strict";var Mm=Cm(),pT=hn();function yT(e,r,t,n,i){var a,s;return e<=0?0:(a=Mm(e,t),s=Mm(e,i),pT(e,r,t,a,n,i,s))}Pm.exports=yT});var Ym=l((R4,Gm)=>{"use strict";var mT=W(),$m=km(),hT=hn();mT($m,"ndarray",hT);Gm.exports=$m});var Jm=l((j4,Zm)=>{"use strict";var gT=require("path").join,vT=vt(),bT=we(),dT=Ym(),gn,Wm=vT(gT(__dirname,"./native.js"));bT(Wm)?gn=dT:gn=Wm;Zm.exports=gn});var Hm=l((C4,wT)=>{wT.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 Qm=l((L4,Xm)=>{"use strict";var AT=Hm();function xT(e){return AT[e]||null}Xm.exports=xT});var rh=l((M4,Km)=>{"use strict";var ET=Qm();Km.exports=ET});var th=l((P4,eh)=>{"use strict";var ST={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};eh.exports=ST});var ah=l((k4,ih)=>{"use strict";var nh=rh(),vn=th();function _T(e,r){var t,n;return t=nh(e),n=nh(r),t===null||n===null?vn.BLOCK_SIZE_IN_ELEMENTS:t>n?vn.BLOCK_SIZE_IN_BYTES/t|0:vn.BLOCK_SIZE_IN_BYTES/n|0}ih.exports=_T});var sh=l(($4,oh)=>{"use strict";var TT=ah();oh.exports=TT});var bn=l((G4,fh)=>{"use strict";var Re=zm(),uh=Jm().ndarray,qT=sh(),wr=qT("float64");function Ir(e){return e!=="no-transpose"}function IT(e,r,t,n,i,a){var s,o,f,u,c,p,y;for(Re([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(c=0;c<f;c++)t[y]=0,y+=s;y+=o}return t}function DT(e,r,t,n,i,a,s){var o,f,u,c,p,y,m;for(Re([i,a])?(u=r,c=e,o=a,f=i-u*a):(u=e,c=r,o=i,f=a-u*i),m=s,y=0;y<c;y++){for(p=0;p<u;p++)n[m]*=t,m+=o;m+=f}return n}function Fe(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g){var v,w,A,S,O,j,F,M,gr,Lr,vr;for(O=r,j=e,v=s,w=u,A=h,S=m-O*h,vr=g,M=0;M<j;M++){for(gr=o+M*a,F=0;F<O;F++)Lr=p+F*c,y[vr]+=n*uh(t,i,v,gr,f,w,Lr),vr+=A;vr+=S}return y}function NT(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g){var v,w,A,S,O,j,F,M,gr,Lr,vr,je,Ce,pe,ye,Er,Sr,_n,Tn,me,qn,In,_r;for(gr=r,Lr=e,v=s,w=u,A=h,Sr=Lr;Sr>0;)for(Sr<wr?(je=Sr,Sr=0):(je=wr,Sr-=wr),O=o+Sr*a,M=g+Sr*m,Er=gr;Er>0;)for(Er<wr?(vr=Er,Er=0):(vr=wr,Er-=wr),j=p+Er*c,F=M+Er*h,S=m-vr*h,_r=t;_r>0;)for(_r<wr?(Ce=_r,_r=0):(Ce=wr,_r-=wr),qn=O+_r*s,In=j+_r*u,me=F,ye=0;ye<je;ye++){for(_n=qn+ye*a,pe=0;pe<vr;pe++)Tn=In+pe*c,y[me]+=n*uh(Ce,i,v,_n,f,w,Tn),me+=A;me+=S}return y}function BT(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g,v,w,A){var S,O,j,F,M,gr;if(t===0||n===0||h===1&&(a===0||i===0)||(h===0?g=IT(t,n,g,v,w,A):h!==1&&(g=DT(t,n,h,g,v,w,A)),a===0))return g;if(S=Re([o,f]),O=Re([p,y]),S){if(!Ir(e)){if(!O&&!Ir(r))return Fe(t,n,i,a,s,o,f,u,c,p,y,m,g,v,w,A);if(O&&Ir(r))return Fe(t,n,i,a,s,o,f,u,c,y,p,m,g,v,w,A)}}else if(Ir(e)){if(O&&Ir(r))return Fe(t,n,i,a,s,f,o,u,c,y,p,m,g,v,w,A);if(!O&&!Ir(r))return Fe(t,n,i,a,s,f,o,u,c,p,y,m,g,v,w,A)}return Ir(e)?(j=f,F=o):(j=o,F=f),Ir(r)?(M=y,gr=p):(M=p,gr=y),NT(t,n,i,a,s,j,F,u,c,M,gr,m,g,v,w,A)}fh.exports=BT});var ph=l((Y4,ch)=>{"use strict";var dn=ss(),OT=hm(),lh=mn(),Ar=J(),VT=bn();function UT(e,r,t,n,i,a,s,o,f,u,c,p,y,m){var h,g,v,w,A,S,O,j,F;if(!OT(e))throw new TypeError(Ar("invalid argument. First argument must be a valid order. Value: `%s`.",e));if(!lh(r))throw new TypeError(Ar("invalid argument. Second argument must be a valid transpose operation. Value: `%s`.",r));if(!lh(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<dn(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(c<dn(1,g))throw new RangeError(Ar("invalid argument. Eleventh argument must be greater than or equal to max(1,%d). Value: `%d`.",g,c));if(e==="row-major"?v=i:v=n,m<dn(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=c,j=1,F=m):(w=f,A=1,S=c,O=1,j=m,F=1),VT(r,t,n,i,a,s,o,w,A,0,u,S,O,0,p,y,j,F,0)}ch.exports=UT});var hh=l((W4,mh)=>{"use strict";var yh=mn(),le=J(),zT=bn();function FT(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g,v,w,A){if(!yh(e))throw new TypeError(le("invalid argument. First argument must be a valid transpose operation. Value: `%s`.",e));if(!yh(r))throw new TypeError(le("invalid argument. Second argument must be a valid transpose operation. Value: `%s`.",r));if(t<0)throw new RangeError(le("invalid argument. Third argument must be a nonnegative integer. Value: `%d`.",t));if(n<0)throw new RangeError(le("invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.",t));if(i<0)throw new RangeError(le("invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.",i));return zT(e,r,t,n,i,a,s,o,f,u,c,p,y,m,h,g,v,w,A)}mh.exports=FT});var bh=l((Z4,vh)=>{"use strict";var RT=W(),gh=ph(),jT=hh();RT(gh,"ndarray",jT);vh.exports=gh});var Ah=l((J4,wh)=>{"use strict";var CT=require("path").join,LT=vt(),MT=we(),PT=bh(),wn,dh=LT(CT(__dirname,"./native.js"));MT(dh)?wn=PT:wn=dh;wh.exports=wn});var JT={};Qh(JT,{NDArray:()=>rr,__version__:()=>ZT,absolute:()=>Lh,arange:()=>qh,array:()=>xr,asarray:()=>Oh,copy:()=>Vh,empty:()=>En,empty_like:()=>Fh,eye:()=>xn,floor_divide:()=>$h,full:()=>Sn,full_like:()=>Rh,geomspace:()=>Nh,identity:()=>Bh,linspace:()=>Ih,logspace:()=>Dh,mod:()=>kh,negative:()=>Mh,ones:()=>An,ones_like:()=>zh,positive:()=>Gh,power:()=>Ch,reciprocal:()=>Yh,sign:()=>Ph,sqrt:()=>jh,zeros:()=>ce,zeros_like:()=>Uh});module.exports=rg(JT);function Nn(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 Bn(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 On(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(On(e)||On(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 c=o+1;c<i;c++)f*=t[c];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 c=Math.floor(s/u);s=s%u,o+=c*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 Le(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 Vn(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 eg(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 ge(e,r){let t=eg(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=Vn(e.shape,r.shape),a=ge(e,i),s=ge(r,i),o=Tr(e.dtype,r.dtype),f=b.zeros(i,o),u=f.data,c=f.size;if(d(o)){let p=u;for(let y=0;y<c;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<c;y++){let m=a.iget(y),h=s.iget(y),g=Number(m),v=Number(h);u[y]=t(g,v)}}return f}function qr(e,r,t){let n=Vn(e.shape,r.shape),i=ge(e,n),a=ge(r,n),s=n.reduce((u,c)=>u*c,1),o=new Uint8Array(s),f=d(e.dtype)||d(r.dtype);for(let u=0;u<s;u++){let c=i.iget(u),p=a.iget(u),y=Number(c),m=Number(p);o[u]=t(y,m)?1:0}return b.fromData(o,n,"bool")}function Un(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,c=e.data;if(d(n))if(d(o)){let p=u;for(let y=0;y<a;y++){let m=Number(c[y]);p[y]=BigInt(Math.round(r(m)))}}else for(let p=0;p<a;p++)u[p]=r(Number(c[p]));else for(let p=0;p<a;p++)u[p]=r(Number(c[p]));return f}function Me(e,r){return e.isCContiguous&&r.isCContiguous&&e.shape.length===r.shape.length&&e.shape.every((t,n)=>t===r.shape[n])}function zn(e,r){return typeof r=="number"?ag(e,r):Me(e,r)?tg(e,r):sr(e,r,(t,n)=>t+n,"add")}function tg(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 c=0;c<i;c++){let p=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof s[c]=="bigint"?s[c]:BigInt(Math.round(Number(s[c])));f[c]=p+y}else{let c=a,p=s;for(let y=0;y<i;y++)f[y]=c[y]+p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=c+p}else for(let u=0;u<i;u++)o[u]=a[u]+s[u];return n}function Fn(e,r){return typeof r=="number"?og(e,r):Me(e,r)?ng(e,r):sr(e,r,(t,n)=>t-n,"subtract")}function ng(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 c=0;c<i;c++){let p=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof s[c]=="bigint"?s[c]:BigInt(Math.round(Number(s[c])));f[c]=p-y}else{let c=a,p=s;for(let y=0;y<i;y++)f[y]=c[y]-p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=c-p}else for(let u=0;u<i;u++)o[u]=a[u]-s[u];return n}function Rn(e,r){return typeof r=="number"?sg(e,r):Me(e,r)?ig(e,r):sr(e,r,(t,n)=>t*n,"multiply")}function ig(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 c=0;c<i;c++){let p=typeof a[c]=="bigint"?a[c]:BigInt(Math.round(Number(a[c]))),y=typeof s[c]=="bigint"?s[c]:BigInt(Math.round(Number(s[c])));f[c]=p*y}else{let c=a,p=s;for(let y=0;y<i;y++)f[y]=c[y]*p[y]}}else if(d(e.dtype)||d(r.dtype))for(let u=0;u<i;u++){let c=typeof a[u]=="bigint"?Number(a[u]):a[u],p=typeof s[u]=="bigint"?Number(s[u]):s[u];o[u]=c*p}else for(let u=0;u<i;u++)o[u]=a[u]*s[u];return n}function jn(e,r){if(typeof r=="number")return ug(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,(c,p)=>c/p,"divide")}if(i||a){let f=i?e:zr(e,"float32"),u=a?r:zr(r,"float32");return sr(f,u,(c,p)=>c/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 ag(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,c=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]+c}else for(let f=0;f<a;f++)o[f]=Number(i[f])+r;return s}function og(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,c=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]-c}else for(let f=0;f<a;f++)o[f]=Number(i[f])-r;return s}function sg(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,c=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]*c}else for(let f=0;f<a;f++)o[f]=Number(i[f])*r;return s}function ug(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 c=0;c<a;c++)u[c]=Number(i[c])/r;else for(let c=0;c<a;c++)u[c]=Number(i[c])/r;return f}function Cn(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 c=o[u];f[u]=c<0n?-c:c}}else for(let o=0;o<i;o++)s[o]=Math.abs(Number(n[o]));return a}function Ln(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 Mn(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 c=o[u];f[u]=c>0n?1n:c<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 Pn(e,r){return typeof r=="number"?fg(e,r):sr(e,r,(t,n)=>(t%n+n)%n,"mod")}function fg(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,c=BigInt(Math.round(r));for(let p=0;p<a;p++){let y=f[p];u[p]=(y%c+c)%c}}else for(let f=0;f<a;f++){let u=Number(i[f]);o[f]=(u%r+r)%r}return s}function kn(e,r){return typeof r=="number"?lg(e,r):sr(e,r,(t,n)=>Math.floor(t/n),"floor_divide")}function lg(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,c=BigInt(Math.round(r));for(let p=0;p<a;p++)u[p]=f[p]/c}else for(let f=0;f<a;f++)o[f]=Math.floor(Number(i[f])/r);return s}function $n(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 Gn(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 Yn(e,r){return typeof r=="number"?pg(e,r):qr(e,r,(t,n)=>t>n)}function Wn(e,r){return typeof r=="number"?yg(e,r):qr(e,r,(t,n)=>t>=n)}function Zn(e,r){return typeof r=="number"?mg(e,r):qr(e,r,(t,n)=>t<n)}function Jn(e,r){return typeof r=="number"?hg(e,r):qr(e,r,(t,n)=>t<=n)}function Hn(e,r){return typeof r=="number"?gg(e,r):qr(e,r,(t,n)=>t===n)}function Xn(e,r){return typeof r=="number"?vg(e,r):qr(e,r,(t,n)=>t!==n)}function Pe(e,r,t=1e-5,n=1e-8){return typeof r=="number"?bg(e,r,t,n):qr(e,r,(i,a)=>{let s=Math.abs(i-a),o=n+t*Math.abs(a);return s<=o})}function Qn(e,r,t=1e-5,n=1e-8){let i=Pe(e,r,t,n),a=i.data;for(let s=0;s<i.size;s++)if(a[s]===0)return!1;return!0}function pg(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 yg(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 mg(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 hg(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 gg(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 vg(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 bg(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]),c=Math.abs(u-r),p=n+t*Math.abs(r);i[f]=c<=p?1:0}}else for(let o=0;o<e.size;o++){let f=Number(a[o]),u=Math.abs(f-r),c=n+t*Math.abs(r);i[o]=u<=c?1:0}return b.fromData(i,Array.from(e.shape),"bool")}function P(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 k(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 c=b.zeros(u,n),p=c.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=k(v,f,A,i),O=P(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=k(h,f,v,i),A=P(w,i);g+=Number(o[A])}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return c}function ke(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),c=u.data,p=s.data;if(d(n)){let y=p;for(let m=0;m<c.length;m++)c[m]=Number(y[m])/o}else for(let y=0;y<c.length;y++)c[y]=Number(p[y])/o;return u}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("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 $e(e);let c=b.zeros(u,n),p=c.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=k(v,f,0,i),A=P(w,i),S=h[A];for(let O=1;O<y;O++){let j=k(v,f,O,i),F=P(j,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=k(h,f,v,i),A=P(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 c}function Ge(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 Ge(e);let c=b.zeros(u,n),p=c.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=k(v,f,A,i),O=P(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=k(h,f,v,i),A=P(w,i);g*=Number(o[A])}p[h]=g}if(t){let h=[...i];return h[f]=1,b.fromData(p,h,n)}return c}function Ye(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 Ye(e);let c=b.zeros(u,n),p=c.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=k(v,f,0,i),A=P(w,i),S=h[A];for(let O=1;O<y;O++){let j=k(v,f,O,i),F=P(j,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=k(h,f,v,i),A=P(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 c}function We(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 We(e);let u=b.zeros(f,"int32"),c=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=k(h,o,0,n),v=P(g,n),w=m[v],A=0;for(let S=1;S<p;S++){let O=k(h,o,S,n),j=P(O,n),F=m[j];F<w&&(w=F,A=S)}c[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=k(m,o,v,n),A=P(w,n),S=Number(s[A]);S<h&&(h=S,g=v)}c[m]=g}return u}function Ze(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 Ze(e);let u=b.zeros(f,"int32"),c=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=k(h,o,0,n),v=P(g,n),w=m[v],A=0;for(let S=1;S<p;S++){let O=k(h,o,S,n),j=P(O,n),F=m[j];F>w&&(w=F,A=S)}c[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=k(m,o,v,n),A=P(w,n),S=Number(s[A]);S>h&&(h=S,g=v)}c[m]=g}return u}function Je(e,r,t=0,n=!1){let i=e.shape,a=i.length,s=e.size,o=e.data,f=ke(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 c=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<c;O++){let j=k(w,u,O,i),F=P(j,i),M=Number(o[F])-S;A+=M*M}g[w]=A/(c-t)}return h}function Kn(e,r,t=0,n=!1){let i=Je(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 He(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 He(e);let u=b.zeros(f,"bool"),c=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=k(m,o,g,n),w=P(v,n);if(!s[w]){h=!1;break}}c[m]=h?1:0}if(t){let m=[...n];return m[o]=1,b.fromData(c,m,"bool")}return u}function Xe(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 Xe(e);let u=b.zeros(f,"bool"),c=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=k(m,o,g,n),w=P(v,n);if(s[w]){h=!0;break}}c[m]=h?1:0}if(t){let m=[...n];return m[o]=1,b.fromData(c,m,"bool")}return u}function ri(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),c=t/u;if(!Number.isInteger(c))throw new Error(`cannot reshape array of size ${t} into shape ${JSON.stringify(r)}`);a=r.map((p,y)=>y===i?c:p)}else a=r;if(a.reduce((u,c)=>u*c,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,Le(a),0)}let f=e.copy().data;return b.fromData(f,a,n,Le(a),0)}function Qe(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,c)=>{if(c===t){let p=e.get(...u);s[o++]=p;return}for(let p=0;p<r[c];p++)u[c]=p,f(u,c+1)};return f(new Array(t),0),b.fromData(s,[n],i,[1],0)}function ei(e){let r=e.size,t=e.dtype;if(e.isCContiguous){let n=e.data;return b.fromData(n,[r],t,[1],0)}return Qe(e)}function ti(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),c=o.map(p=>u[p]);return b.fromData(a,f,s,c,e.offset)}function ni(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 c=0;c<n;c++)c!==o&&(f.push(t[c]),u.push(i[c]));return b.fromData(a,f,s,u,e.offset)}}function ii(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)],c=o<n?i[o]*(t[o]||1):1;return u.splice(o,0,c),b.fromData(a,f,s,u,e.offset)}var xh=Kh(Ah(),1);function Eh(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)),c=b.zeros([t,a],"float64");return(0,xh.default)("row-major","no-transpose","no-transpose",t,a,n,1,f,n,u,a,0,c.data,a),c}function Sh(e){return Un(e,Math.sqrt,!1)}function _h(e,r){return typeof r=="number"?$T(e,r):sr(e,r,Math.pow,"power")}function $T(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),c=u.data;if(d(t))if(d(f)&&Number.isInteger(r)&&r>=0){let p=i,y=c;for(let m=0;m<a;m++)y[m]=p[m]**BigInt(r)}else for(let p=0;p<a;p++)c[p]=Math.pow(Number(i[p]),r);else for(let p=0;p<a;p++)c[p]=Math.pow(Number(i[p]),r);return u}var rr=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 c=f;if(r==="bool")for(let p=0;p<a;p++)o[p]=c[p]!==BigInt(0)?1:0;else for(let p=0;p<a;p++)o[p]=Number(c[p])}else if(!d(n)&&d(r)){let c=f;for(let p=0;p<a;p++)o[p]=BigInt(Math.round(Number(c[p])))}else if(r==="bool"){let c=f;for(let p=0;p<a;p++)o[p]=c[p]!==0?1:0}else if(n==="bool"&&!d(r)){let c=f;for(let p=0;p<a;p++)o[p]=c[p]}else if(!d(n)&&!d(r)){let c=f;for(let p=0;p<a;p++)o[p]=c[p]}else{let c=f;for(let p=0;p<a;p++)o[p]=c[p]}let u=b.fromData(o,i,r);return new e(u)}add(r){let t=typeof r=="number"?r:r._storage,n=zn(this._storage,t);return e._fromStorage(n)}subtract(r){let t=typeof r=="number"?r:r._storage,n=Fn(this._storage,t);return e._fromStorage(n)}multiply(r){let t=typeof r=="number"?r:r._storage,n=Rn(this._storage,t);return e._fromStorage(n)}divide(r){let t=typeof r=="number"?r:r._storage,n=jn(this._storage,t);return e._fromStorage(n)}mod(r){let t=typeof r=="number"?r:r._storage,n=Pn(this._storage,t);return e._fromStorage(n)}floor_divide(r){let t=typeof r=="number"?r:r._storage,n=kn(this._storage,t);return e._fromStorage(n)}positive(){let r=$n(this._storage);return e._fromStorage(r)}reciprocal(){let r=Gn(this._storage);return e._fromStorage(r)}sqrt(){let r=Sh(this._storage);return e._fromStorage(r)}power(r){let t=typeof r=="number"?r:r._storage,n=_h(this._storage,t);return e._fromStorage(n)}absolute(){let r=Cn(this._storage);return e._fromStorage(r)}negative(){let r=Ln(this._storage);return e._fromStorage(r)}sign(){let r=Mn(this._storage);return e._fromStorage(r)}greater(r){let t=typeof r=="number"?r:r._storage,n=Yn(this._storage,t);return e._fromStorage(n)}greater_equal(r){let t=typeof r=="number"?r:r._storage,n=Wn(this._storage,t);return e._fromStorage(n)}less(r){let t=typeof r=="number"?r:r._storage,n=Zn(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=Hn(this._storage,t);return e._fromStorage(n)}not_equal(r){let t=typeof r=="number"?r:r._storage,n=Xn(this._storage,t);return e._fromStorage(n)}isclose(r,t=1e-5,n=1e-8){let i=typeof r=="number"?r:r._storage,a=Pe(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 Qn(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=ke(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}max(r,t=!1){let n=$e(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}min(r,t=!1){let n=Ye(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}prod(r,t=!1){let n=Ge(this._storage,r,t);return typeof n=="number"?n:e._fromStorage(n)}argmin(r){let t=We(this._storage,r);return typeof t=="number"?t:e._fromStorage(t)}argmax(r){let t=Ze(this._storage,r);return typeof t=="number"?t:e._fromStorage(t)}var(r,t=0,n=!1){let i=Je(this._storage,r,t,n);return typeof i=="number"?i:e._fromStorage(i)}std(r,t=0,n=!1){let i=Kn(this._storage,r,t,n);return typeof i=="number"?i:e._fromStorage(i)}all(r,t=!1){let n=He(this._storage,r,t);return typeof n=="boolean"?n:e._fromStorage(n)}any(r,t=!1){let n=Xe(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=ri(this._storage,t),a=n.data===this.data?this._base??this:void 0;return e._fromStorage(n,a)}flatten(){let r=Qe(this._storage);return e._fromStorage(r)}ravel(){let r=ei(this._storage),n=r.data===this.data?this._base??this:void 0;return e._fromStorage(r,n)}transpose(r){let t=ti(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}squeeze(r){let t=ni(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}expand_dims(r){let t=ii(this._storage,r),n=this._base??this;return e._fromStorage(t,n)}matmul(r){let t=Eh(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 c=Nn(f);return Bn(c,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],c=this._storage.strides[f];if(a+=u.start*c,!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(c*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 ce(e,r=H){let t=b.zeros(e,r);return new rr(t)}function An(e,r=H){let t=b.ones(e,r);return new rr(t)}function YT(e){let r=[],t=e;for(;Array.isArray(t);)r.push(t.length),t=t[0];return r}function Th(e){return typeof e=="bigint"?!0:Array.isArray(e)?e.some(r=>Th(r)):!1}function WT(e){let r=[];function t(n){Array.isArray(n)?n.forEach(i=>t(i)):r.push(n)}return t(e),r}function xr(e,r){if(e instanceof rr)return!r||e.dtype===r?e.copy():e.astype(r);let t=Th(e),n=YT(e),i=n.reduce((c,p)=>c*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=WT(e);if(d(a)){let c=o;for(let p=0;p<i;p++){let y=f[p];c[p]=typeof y=="bigint"?y:BigInt(Math.round(Number(y)))}}else if(a==="bool"){let c=o;for(let p=0;p<i;p++)c[p]=f[p]?1:0}else{let c=o;for(let p=0;p<i;p++){let y=f[p];c[p]=Number(y)}}let u=b.fromData(o,n,a);return new rr(u)}function qh(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 c=0;c<s;c++)f[c]=BigInt(Math.round(i+c*t));else if(n==="bool")for(let c=0;c<s;c++)f[c]=i+c*t!==0?1:0;else for(let c=0;c<s;c++)f[c]=i+c*t;let u=b.fromData(f,[s],n);return new rr(u)}function Ih(e,r,t=50,n=H){if(t<0)throw new Error("num must be non-negative");if(t===0)return xr([],n);if(t===1)return xr([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 rr(o)}function Dh(e,r,t=50,n=10,i=H){if(t<0)throw new Error("num must be non-negative");if(t===0)return xr([],i);if(t===1)return xr([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 c=e+u*o;s[u]=BigInt(Math.round(Math.pow(n,c)))}else if(i==="bool")for(let u=0;u<t;u++){let c=e+u*o;s[u]=Math.pow(n,c)!==0?1:0}else for(let u=0;u<t;u++){let c=e+u*o;s[u]=Math.pow(n,c)}let f=b.fromData(s,[t],i);return new rr(f)}function Nh(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 xr([],n);if(t===1)return xr([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)),c=(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*c);o[y]=BigInt(Math.round(m))}else if(n==="bool")for(let y=0;y<t;y++){let m=i*Math.exp(f+y*c);o[y]=m!==0?1:0}else for(let y=0;y<t;y++){let m=i*Math.exp(f+y*c);o[y]=m}let p=b.fromData(o,[t],n);return new rr(p)}function xn(e,r,t=0,n=H){let i=r??e,a=ce([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 En(e,r=H){return ce(e,r)}function Sn(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 rr(o)}function Bh(e,r=H){return xn(e,e,0,r)}function Oh(e,r){return e instanceof rr?!r||e.dtype===r?e:e.astype(r):xr(e,r)}function Vh(e){return e.copy()}function Uh(e,r){return ce(Array.from(e.shape),r??e.dtype)}function zh(e,r){return An(Array.from(e.shape),r??e.dtype)}function Fh(e,r){return En(Array.from(e.shape),r??e.dtype)}function Rh(e,r,t){return Sn(Array.from(e.shape),r,t??e.dtype)}function jh(e){return e.sqrt()}function Ch(e,r){return e.power(r)}function Lh(e){return e.absolute()}function Mh(e){return e.negative()}function Ph(e){return e.sign()}function kh(e,r){return e.mod(r)}function $h(e,r){return e.floor_divide(r)}function Gh(e){return e.positive()}function Yh(e){return e.reciprocal()}var ZT="0.3.0";0&&(module.exports={NDArray,__version__,absolute,arange,array,asarray,copy,empty,empty_like,eye,floor_divide,full,full_like,geomspace,identity,linspace,logspace,mod,negative,ones,ones_like,positive,power,reciprocal,sign,sqrt,zeros,zeros_like});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
@stdlib/object/ctor/lib/main.js:
|
|
5
|
-
@stdlib/object/ctor/lib/index.js:
|
|
6
|
-
@stdlib/string/base/format-interpolate/lib/is_number.js:
|
|
7
|
-
@stdlib/string/base/format-interpolate/lib/zero_pad.js:
|
|
8
|
-
@stdlib/string/base/format-interpolate/lib/format_integer.js:
|
|
9
|
-
@stdlib/string/base/format-interpolate/lib/is_string.js:
|
|
10
|
-
@stdlib/string/base/format-interpolate/lib/format_double.js:
|
|
11
|
-
@stdlib/string/base/format-interpolate/lib/space_pad.js:
|
|
12
|
-
@stdlib/string/base/format-interpolate/lib/main.js:
|
|
13
|
-
@stdlib/string/base/format-interpolate/lib/index.js:
|
|
14
|
-
@stdlib/string/base/format-tokenize/lib/main.js:
|
|
15
|
-
@stdlib/string/base/format-tokenize/lib/index.js:
|
|
16
|
-
@stdlib/string/format/lib/is_string.js:
|
|
17
|
-
@stdlib/string/format/lib/main.js:
|
|
18
|
-
@stdlib/string/format/lib/index.js:
|
|
19
|
-
@stdlib/boolean/ctor/lib/main.js:
|
|
20
|
-
@stdlib/boolean/ctor/lib/index.js:
|
|
21
|
-
@stdlib/utils/global/lib/global_this.js:
|
|
22
|
-
@stdlib/array/base/assert/is-accessor-array/lib/main.js:
|
|
23
|
-
@stdlib/array/base/assert/is-accessor-array/lib/index.js:
|
|
24
|
-
@stdlib/array/base/accessor-getter/lib/main.js:
|
|
25
|
-
@stdlib/array/base/accessor-getter/lib/index.js:
|
|
26
|
-
@stdlib/array/base/getter/lib/main.js:
|
|
27
|
-
@stdlib/array/base/getter/lib/index.js:
|
|
28
|
-
@stdlib/ndarray/base/unary-tiling-block-size/lib/defaults.js:
|
|
29
|
-
@stdlib/ndarray/base/unary-tiling-block-size/lib/main.js:
|
|
30
|
-
@stdlib/ndarray/base/unary-tiling-block-size/lib/index.js:
|
|
31
|
-
(**
|
|
32
|
-
* @license Apache-2.0
|
|
33
|
-
*
|
|
34
|
-
* Copyright (c) 2022 The Stdlib Authors.
|
|
35
|
-
*
|
|
36
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
37
|
-
* you may not use this file except in compliance with the License.
|
|
38
|
-
* You may obtain a copy of the License at
|
|
39
|
-
*
|
|
40
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
41
|
-
*
|
|
42
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
43
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
44
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
45
|
-
* See the License for the specific language governing permissions and
|
|
46
|
-
* limitations under the License.
|
|
47
|
-
*)
|
|
48
|
-
|
|
49
|
-
@stdlib/utils/type-of/lib/fixtures/re.js:
|
|
50
|
-
@stdlib/utils/define-property/lib/builtin.js:
|
|
51
|
-
@stdlib/utils/define-property/lib/polyfill.js:
|
|
52
|
-
@stdlib/utils/define-property/lib/index.js:
|
|
53
|
-
@stdlib/utils/define-nonenumerable-read-only-property/lib/main.js:
|
|
54
|
-
@stdlib/utils/define-nonenumerable-read-only-property/lib/index.js:
|
|
55
|
-
@stdlib/assert/is-boolean/lib/primitive.js:
|
|
56
|
-
@stdlib/assert/has-symbol-support/lib/main.js:
|
|
57
|
-
@stdlib/assert/has-symbol-support/lib/index.js:
|
|
58
|
-
@stdlib/assert/has-tostringtag-support/lib/main.js:
|
|
59
|
-
@stdlib/assert/has-tostringtag-support/lib/index.js:
|
|
60
|
-
@stdlib/utils/native-class/lib/tostring.js:
|
|
61
|
-
@stdlib/utils/native-class/lib/main.js:
|
|
62
|
-
@stdlib/assert/has-own-property/lib/main.js:
|
|
63
|
-
@stdlib/assert/has-own-property/lib/index.js:
|
|
64
|
-
@stdlib/symbol/ctor/lib/main.js:
|
|
65
|
-
@stdlib/symbol/ctor/lib/index.js:
|
|
66
|
-
@stdlib/utils/native-class/lib/tostringtag.js:
|
|
67
|
-
@stdlib/utils/native-class/lib/polyfill.js:
|
|
68
|
-
@stdlib/utils/native-class/lib/index.js:
|
|
69
|
-
@stdlib/assert/is-boolean/lib/tostring.js:
|
|
70
|
-
@stdlib/assert/is-boolean/lib/try2serialize.js:
|
|
71
|
-
@stdlib/assert/is-boolean/lib/object.js:
|
|
72
|
-
@stdlib/assert/is-boolean/lib/main.js:
|
|
73
|
-
@stdlib/assert/is-boolean/lib/index.js:
|
|
74
|
-
@stdlib/utils/global/lib/codegen.js:
|
|
75
|
-
@stdlib/utils/global/lib/self.js:
|
|
76
|
-
@stdlib/utils/global/lib/window.js:
|
|
77
|
-
@stdlib/utils/global/lib/global.js:
|
|
78
|
-
@stdlib/utils/global/lib/main.js:
|
|
79
|
-
@stdlib/utils/global/lib/index.js:
|
|
80
|
-
@stdlib/utils/type-of/lib/fixtures/nodelist.js:
|
|
81
|
-
@stdlib/utils/type-of/lib/fixtures/typedarray.js:
|
|
82
|
-
@stdlib/utils/type-of/lib/check.js:
|
|
83
|
-
@stdlib/regexp/function-name/lib/regexp.js:
|
|
84
|
-
@stdlib/assert/is-array/lib/main.js:
|
|
85
|
-
@stdlib/assert/is-array/lib/index.js:
|
|
86
|
-
@stdlib/assert/tools/array-function/lib/main.js:
|
|
87
|
-
@stdlib/assert/tools/array-function/lib/index.js:
|
|
88
|
-
@stdlib/assert/is-object-like/lib/main.js:
|
|
89
|
-
@stdlib/assert/is-object-like/lib/index.js:
|
|
90
|
-
@stdlib/assert/is-buffer/lib/main.js:
|
|
91
|
-
@stdlib/assert/is-buffer/lib/index.js:
|
|
92
|
-
@stdlib/utils/constructor-name/lib/main.js:
|
|
93
|
-
@stdlib/utils/constructor-name/lib/index.js:
|
|
94
|
-
@stdlib/utils/type-of/lib/main.js:
|
|
95
|
-
@stdlib/utils/type-of/lib/polyfill.js:
|
|
96
|
-
@stdlib/utils/type-of/lib/index.js:
|
|
97
|
-
@stdlib/assert/is-function/lib/main.js:
|
|
98
|
-
@stdlib/assert/is-function/lib/index.js:
|
|
99
|
-
@stdlib/utils/get-prototype-of/lib/native.js:
|
|
100
|
-
@stdlib/utils/get-prototype-of/lib/proto.js:
|
|
101
|
-
@stdlib/utils/get-prototype-of/lib/polyfill.js:
|
|
102
|
-
@stdlib/utils/get-prototype-of/lib/detect.js:
|
|
103
|
-
@stdlib/utils/get-prototype-of/lib/main.js:
|
|
104
|
-
@stdlib/utils/get-prototype-of/lib/index.js:
|
|
105
|
-
@stdlib/assert/is-error/lib/main.js:
|
|
106
|
-
@stdlib/assert/is-error/lib/index.js:
|
|
107
|
-
@stdlib/utils/try-require/lib/main.js:
|
|
108
|
-
@stdlib/utils/try-require/lib/index.js:
|
|
109
|
-
@stdlib/math/base/special/fast/max/lib/main.js:
|
|
110
|
-
@stdlib/math/base/special/fast/max/lib/index.js:
|
|
111
|
-
@stdlib/assert/is-float64array/lib/main.js:
|
|
112
|
-
@stdlib/assert/is-float64array/lib/index.js:
|
|
113
|
-
@stdlib/assert/has-float64array-support/lib/float64array.js:
|
|
114
|
-
@stdlib/assert/has-float64array-support/lib/main.js:
|
|
115
|
-
@stdlib/assert/has-float64array-support/lib/index.js:
|
|
116
|
-
@stdlib/array/float64/lib/main.js:
|
|
117
|
-
@stdlib/array/float64/lib/polyfill.js:
|
|
118
|
-
@stdlib/array/float64/lib/index.js:
|
|
119
|
-
@stdlib/assert/is-float32array/lib/main.js:
|
|
120
|
-
@stdlib/assert/is-float32array/lib/index.js:
|
|
121
|
-
@stdlib/constants/float64/pinf/lib/index.js:
|
|
122
|
-
@stdlib/assert/has-float32array-support/lib/float32array.js:
|
|
123
|
-
@stdlib/assert/has-float32array-support/lib/main.js:
|
|
124
|
-
@stdlib/assert/has-float32array-support/lib/index.js:
|
|
125
|
-
@stdlib/array/float32/lib/main.js:
|
|
126
|
-
@stdlib/array/float32/lib/polyfill.js:
|
|
127
|
-
@stdlib/array/float32/lib/index.js:
|
|
128
|
-
@stdlib/assert/is-uint32array/lib/main.js:
|
|
129
|
-
@stdlib/assert/is-uint32array/lib/index.js:
|
|
130
|
-
@stdlib/constants/uint32/max/lib/index.js:
|
|
131
|
-
@stdlib/assert/has-uint32array-support/lib/uint32array.js:
|
|
132
|
-
@stdlib/assert/has-uint32array-support/lib/main.js:
|
|
133
|
-
@stdlib/assert/has-uint32array-support/lib/index.js:
|
|
134
|
-
@stdlib/array/uint32/lib/main.js:
|
|
135
|
-
@stdlib/array/uint32/lib/polyfill.js:
|
|
136
|
-
@stdlib/array/uint32/lib/index.js:
|
|
137
|
-
@stdlib/assert/is-int32array/lib/main.js:
|
|
138
|
-
@stdlib/assert/is-int32array/lib/index.js:
|
|
139
|
-
@stdlib/constants/int32/max/lib/index.js:
|
|
140
|
-
@stdlib/constants/int32/min/lib/index.js:
|
|
141
|
-
@stdlib/assert/has-int32array-support/lib/int32array.js:
|
|
142
|
-
@stdlib/assert/has-int32array-support/lib/main.js:
|
|
143
|
-
@stdlib/assert/has-int32array-support/lib/index.js:
|
|
144
|
-
@stdlib/array/int32/lib/main.js:
|
|
145
|
-
@stdlib/array/int32/lib/polyfill.js:
|
|
146
|
-
@stdlib/array/int32/lib/index.js:
|
|
147
|
-
@stdlib/assert/is-uint16array/lib/main.js:
|
|
148
|
-
@stdlib/assert/is-uint16array/lib/index.js:
|
|
149
|
-
@stdlib/constants/uint16/max/lib/index.js:
|
|
150
|
-
@stdlib/assert/has-uint16array-support/lib/uint16array.js:
|
|
151
|
-
@stdlib/assert/has-uint16array-support/lib/main.js:
|
|
152
|
-
@stdlib/assert/has-uint16array-support/lib/index.js:
|
|
153
|
-
@stdlib/array/uint16/lib/main.js:
|
|
154
|
-
@stdlib/array/uint16/lib/polyfill.js:
|
|
155
|
-
@stdlib/array/uint16/lib/index.js:
|
|
156
|
-
@stdlib/assert/is-int16array/lib/main.js:
|
|
157
|
-
@stdlib/assert/is-int16array/lib/index.js:
|
|
158
|
-
@stdlib/constants/int16/max/lib/index.js:
|
|
159
|
-
@stdlib/constants/int16/min/lib/index.js:
|
|
160
|
-
@stdlib/assert/has-int16array-support/lib/int16array.js:
|
|
161
|
-
@stdlib/assert/has-int16array-support/lib/main.js:
|
|
162
|
-
@stdlib/assert/has-int16array-support/lib/index.js:
|
|
163
|
-
@stdlib/array/int16/lib/main.js:
|
|
164
|
-
@stdlib/array/int16/lib/polyfill.js:
|
|
165
|
-
@stdlib/array/int16/lib/index.js:
|
|
166
|
-
@stdlib/assert/is-uint8array/lib/main.js:
|
|
167
|
-
@stdlib/assert/is-uint8array/lib/index.js:
|
|
168
|
-
@stdlib/constants/uint8/max/lib/index.js:
|
|
169
|
-
@stdlib/assert/has-uint8array-support/lib/uint8array.js:
|
|
170
|
-
@stdlib/assert/has-uint8array-support/lib/main.js:
|
|
171
|
-
@stdlib/assert/has-uint8array-support/lib/index.js:
|
|
172
|
-
@stdlib/array/uint8/lib/main.js:
|
|
173
|
-
@stdlib/array/uint8/lib/polyfill.js:
|
|
174
|
-
@stdlib/array/uint8/lib/index.js:
|
|
175
|
-
@stdlib/assert/is-uint8clampedarray/lib/main.js:
|
|
176
|
-
@stdlib/assert/is-uint8clampedarray/lib/index.js:
|
|
177
|
-
@stdlib/assert/has-uint8clampedarray-support/lib/uint8clampedarray.js:
|
|
178
|
-
@stdlib/assert/has-uint8clampedarray-support/lib/main.js:
|
|
179
|
-
@stdlib/assert/has-uint8clampedarray-support/lib/index.js:
|
|
180
|
-
@stdlib/array/uint8c/lib/main.js:
|
|
181
|
-
@stdlib/array/uint8c/lib/polyfill.js:
|
|
182
|
-
@stdlib/array/uint8c/lib/index.js:
|
|
183
|
-
@stdlib/assert/is-int8array/lib/main.js:
|
|
184
|
-
@stdlib/assert/is-int8array/lib/index.js:
|
|
185
|
-
@stdlib/constants/int8/max/lib/index.js:
|
|
186
|
-
@stdlib/constants/int8/min/lib/index.js:
|
|
187
|
-
@stdlib/assert/has-int8array-support/lib/int8array.js:
|
|
188
|
-
@stdlib/assert/has-int8array-support/lib/main.js:
|
|
189
|
-
@stdlib/assert/has-int8array-support/lib/index.js:
|
|
190
|
-
@stdlib/array/int8/lib/main.js:
|
|
191
|
-
@stdlib/array/int8/lib/polyfill.js:
|
|
192
|
-
@stdlib/array/int8/lib/index.js:
|
|
193
|
-
@stdlib/assert/is-number/lib/primitive.js:
|
|
194
|
-
@stdlib/number/ctor/lib/main.js:
|
|
195
|
-
@stdlib/number/ctor/lib/index.js:
|
|
196
|
-
@stdlib/assert/is-number/lib/tostring.js:
|
|
197
|
-
@stdlib/assert/is-number/lib/try2serialize.js:
|
|
198
|
-
@stdlib/assert/is-number/lib/object.js:
|
|
199
|
-
@stdlib/assert/is-number/lib/main.js:
|
|
200
|
-
@stdlib/assert/is-number/lib/index.js:
|
|
201
|
-
@stdlib/constants/float64/ninf/lib/index.js:
|
|
202
|
-
@stdlib/math/base/special/floor/lib/main.js:
|
|
203
|
-
@stdlib/math/base/special/floor/lib/index.js:
|
|
204
|
-
@stdlib/math/base/assert/is-integer/lib/main.js:
|
|
205
|
-
@stdlib/math/base/assert/is-integer/lib/index.js:
|
|
206
|
-
@stdlib/assert/is-integer/lib/integer.js:
|
|
207
|
-
@stdlib/assert/is-integer/lib/primitive.js:
|
|
208
|
-
@stdlib/assert/is-integer/lib/object.js:
|
|
209
|
-
@stdlib/assert/is-integer/lib/main.js:
|
|
210
|
-
@stdlib/assert/is-integer/lib/index.js:
|
|
211
|
-
@stdlib/assert/is-nonnegative-integer/lib/primitive.js:
|
|
212
|
-
@stdlib/assert/is-nonnegative-integer/lib/object.js:
|
|
213
|
-
@stdlib/assert/is-nonnegative-integer/lib/main.js:
|
|
214
|
-
@stdlib/assert/is-nonnegative-integer/lib/index.js:
|
|
215
|
-
@stdlib/constants/array/max-array-length/lib/index.js:
|
|
216
|
-
@stdlib/assert/is-array-like-object/lib/main.js:
|
|
217
|
-
@stdlib/assert/is-array-like-object/lib/index.js:
|
|
218
|
-
@stdlib/constants/array/max-typed-array-length/lib/index.js:
|
|
219
|
-
@stdlib/assert/is-collection/lib/main.js:
|
|
220
|
-
@stdlib/assert/is-collection/lib/index.js:
|
|
221
|
-
@stdlib/assert/is-arraybuffer/lib/main.js:
|
|
222
|
-
@stdlib/assert/is-arraybuffer/lib/index.js:
|
|
223
|
-
@stdlib/assert/is-object/lib/main.js:
|
|
224
|
-
@stdlib/assert/is-object/lib/index.js:
|
|
225
|
-
@stdlib/assert/is-string/lib/primitive.js:
|
|
226
|
-
@stdlib/assert/is-string/lib/valueof.js:
|
|
227
|
-
@stdlib/assert/is-string/lib/try2valueof.js:
|
|
228
|
-
@stdlib/assert/is-string/lib/object.js:
|
|
229
|
-
@stdlib/assert/is-string/lib/main.js:
|
|
230
|
-
@stdlib/assert/is-string/lib/index.js:
|
|
231
|
-
@stdlib/assert/is-string-array/lib/index.js:
|
|
232
|
-
@stdlib/complex/float64/ctor/lib/tostring.js:
|
|
233
|
-
@stdlib/complex/float64/ctor/lib/tojson.js:
|
|
234
|
-
@stdlib/complex/float64/ctor/lib/main.js:
|
|
235
|
-
@stdlib/complex/float64/ctor/lib/index.js:
|
|
236
|
-
@stdlib/number/float64/base/to-float32/lib/main.js:
|
|
237
|
-
@stdlib/number/float64/base/to-float32/lib/polyfill.js:
|
|
238
|
-
@stdlib/number/float64/base/to-float32/lib/index.js:
|
|
239
|
-
@stdlib/complex/float32/ctor/lib/tostring.js:
|
|
240
|
-
@stdlib/complex/float32/ctor/lib/tojson.js:
|
|
241
|
-
@stdlib/complex/float32/ctor/lib/main.js:
|
|
242
|
-
@stdlib/complex/float32/ctor/lib/index.js:
|
|
243
|
-
@stdlib/assert/is-complex-like/lib/main.js:
|
|
244
|
-
@stdlib/assert/is-complex-like/lib/index.js:
|
|
245
|
-
@stdlib/math/base/assert/is-even/lib/main.js:
|
|
246
|
-
@stdlib/math/base/assert/is-even/lib/index.js:
|
|
247
|
-
@stdlib/assert/has-iterator-symbol-support/lib/main.js:
|
|
248
|
-
@stdlib/assert/has-iterator-symbol-support/lib/index.js:
|
|
249
|
-
@stdlib/symbol/iterator/lib/main.js:
|
|
250
|
-
@stdlib/symbol/iterator/lib/index.js:
|
|
251
|
-
@stdlib/utils/define-nonenumerable-read-only-accessor/lib/main.js:
|
|
252
|
-
@stdlib/utils/define-nonenumerable-read-only-accessor/lib/index.js:
|
|
253
|
-
@stdlib/array/complex64/lib/from_iterator.js:
|
|
254
|
-
@stdlib/array/complex64/lib/from_iterator_map.js:
|
|
255
|
-
@stdlib/array/complex64/lib/from_array.js:
|
|
256
|
-
@stdlib/array/complex64/lib/main.js:
|
|
257
|
-
@stdlib/array/complex64/lib/index.js:
|
|
258
|
-
@stdlib/complex/float64/real/lib/main.js:
|
|
259
|
-
@stdlib/complex/float64/real/lib/index.js:
|
|
260
|
-
@stdlib/complex/float64/imag/lib/main.js:
|
|
261
|
-
@stdlib/complex/float64/imag/lib/index.js:
|
|
262
|
-
@stdlib/array/complex128/lib/from_iterator.js:
|
|
263
|
-
@stdlib/array/complex128/lib/from_iterator_map.js:
|
|
264
|
-
@stdlib/array/complex128/lib/from_array.js:
|
|
265
|
-
@stdlib/array/complex128/lib/index.js:
|
|
266
|
-
@stdlib/array/dtype/lib/main.js:
|
|
267
|
-
@stdlib/array/dtype/lib/index.js:
|
|
268
|
-
@stdlib/math/base/special/abs/lib/index.js:
|
|
269
|
-
@stdlib/ndarray/base/assert/is-row-major/lib/main.js:
|
|
270
|
-
@stdlib/ndarray/base/assert/is-row-major/lib/index.js:
|
|
271
|
-
@stdlib/ndarray/base/bytes-per-element/lib/main.js:
|
|
272
|
-
@stdlib/ndarray/base/bytes-per-element/lib/index.js:
|
|
273
|
-
(**
|
|
274
|
-
* @license Apache-2.0
|
|
275
|
-
*
|
|
276
|
-
* Copyright (c) 2018 The Stdlib Authors.
|
|
277
|
-
*
|
|
278
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
279
|
-
* you may not use this file except in compliance with the License.
|
|
280
|
-
* You may obtain a copy of the License at
|
|
281
|
-
*
|
|
282
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
283
|
-
*
|
|
284
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
285
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
286
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
287
|
-
* See the License for the specific language governing permissions and
|
|
288
|
-
* limitations under the License.
|
|
289
|
-
*)
|
|
290
|
-
|
|
291
|
-
@stdlib/utils/define-property/lib/define_property.js:
|
|
292
|
-
@stdlib/utils/define-property/lib/has_define_property_support.js:
|
|
293
|
-
@stdlib/regexp/function-name/lib/main.js:
|
|
294
|
-
@stdlib/regexp/function-name/lib/index.js:
|
|
295
|
-
@stdlib/complex/float32/real/lib/main.js:
|
|
296
|
-
@stdlib/complex/float32/real/lib/index.js:
|
|
297
|
-
@stdlib/complex/float32/imag/lib/main.js:
|
|
298
|
-
@stdlib/complex/float32/imag/lib/index.js:
|
|
299
|
-
@stdlib/strided/base/reinterpret-complex64/lib/main.js:
|
|
300
|
-
@stdlib/strided/base/reinterpret-complex64/lib/index.js:
|
|
301
|
-
@stdlib/strided/base/reinterpret-complex128/lib/main.js:
|
|
302
|
-
@stdlib/strided/base/reinterpret-complex128/lib/index.js:
|
|
303
|
-
@stdlib/math/base/special/abs/lib/main.js:
|
|
304
|
-
(**
|
|
305
|
-
* @license Apache-2.0
|
|
306
|
-
*
|
|
307
|
-
* Copyright (c) 2021 The Stdlib Authors.
|
|
308
|
-
*
|
|
309
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
310
|
-
* you may not use this file except in compliance with the License.
|
|
311
|
-
* You may obtain a copy of the License at
|
|
312
|
-
*
|
|
313
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
314
|
-
*
|
|
315
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
316
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
317
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
318
|
-
* See the License for the specific language governing permissions and
|
|
319
|
-
* limitations under the License.
|
|
320
|
-
*)
|
|
321
|
-
|
|
322
|
-
@stdlib/array/dtype/lib/ctor2dtype.js:
|
|
323
|
-
@stdlib/array/base/assert/is-complex64array/lib/main.js:
|
|
324
|
-
@stdlib/array/base/assert/is-complex64array/lib/index.js:
|
|
325
|
-
@stdlib/array/base/assert/is-complex128array/lib/main.js:
|
|
326
|
-
@stdlib/array/base/assert/is-complex128array/lib/index.js:
|
|
327
|
-
@stdlib/array/complex128/lib/main.js:
|
|
328
|
-
@stdlib/array/bool/lib/from_iterator.js:
|
|
329
|
-
@stdlib/array/bool/lib/from_iterator_map.js:
|
|
330
|
-
@stdlib/array/bool/lib/from_array.js:
|
|
331
|
-
@stdlib/array/bool/lib/main.js:
|
|
332
|
-
@stdlib/array/bool/lib/index.js:
|
|
333
|
-
@stdlib/array/dtype/lib/ctors.js:
|
|
334
|
-
@stdlib/array/dtype/lib/dtypes.js:
|
|
335
|
-
@stdlib/blas/base/layouts/lib/main.js:
|
|
336
|
-
@stdlib/blas/base/layouts/lib/enum.js:
|
|
337
|
-
@stdlib/blas/base/layouts/lib/index.js:
|
|
338
|
-
@stdlib/blas/base/assert/is-layout/lib/main.js:
|
|
339
|
-
@stdlib/blas/base/assert/is-layout/lib/index.js:
|
|
340
|
-
@stdlib/blas/base/transpose-operations/lib/main.js:
|
|
341
|
-
@stdlib/blas/base/transpose-operations/lib/enum.js:
|
|
342
|
-
@stdlib/blas/base/transpose-operations/lib/index.js:
|
|
343
|
-
@stdlib/blas/base/assert/is-transpose-operation/lib/main.js:
|
|
344
|
-
@stdlib/blas/base/assert/is-transpose-operation/lib/index.js:
|
|
345
|
-
@stdlib/strided/base/stride2offset/lib/main.js:
|
|
346
|
-
@stdlib/strided/base/stride2offset/lib/index.js:
|
|
347
|
-
@stdlib/blas/base/dgemm/lib/base.js:
|
|
348
|
-
@stdlib/blas/base/dgemm/lib/dgemm.js:
|
|
349
|
-
@stdlib/blas/base/dgemm/lib/ndarray.js:
|
|
350
|
-
@stdlib/blas/base/dgemm/lib/main.js:
|
|
351
|
-
@stdlib/blas/base/dgemm/lib/index.js:
|
|
352
|
-
(**
|
|
353
|
-
* @license Apache-2.0
|
|
354
|
-
*
|
|
355
|
-
* Copyright (c) 2024 The Stdlib Authors.
|
|
356
|
-
*
|
|
357
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
358
|
-
* you may not use this file except in compliance with the License.
|
|
359
|
-
* You may obtain a copy of the License at
|
|
360
|
-
*
|
|
361
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
362
|
-
*
|
|
363
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
364
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
365
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
366
|
-
* See the License for the specific language governing permissions and
|
|
367
|
-
* limitations under the License.
|
|
368
|
-
*)
|
|
369
|
-
|
|
370
|
-
@stdlib/array/base/assert/contains/lib/main.js:
|
|
371
|
-
@stdlib/array/base/assert/contains/lib/factory.js:
|
|
372
|
-
@stdlib/array/base/assert/contains/lib/index.js:
|
|
373
|
-
(**
|
|
374
|
-
* @license Apache-2.0
|
|
375
|
-
*
|
|
376
|
-
* Copyright (c) 2023 The Stdlib Authors.
|
|
377
|
-
*
|
|
378
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
379
|
-
* you may not use this file except in compliance with the License.
|
|
380
|
-
* You may obtain a copy of the License at
|
|
381
|
-
*
|
|
382
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
383
|
-
*
|
|
384
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
385
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
386
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
387
|
-
* See the License for the specific language governing permissions and
|
|
388
|
-
* limitations under the License.
|
|
389
|
-
*)
|
|
390
|
-
|
|
391
|
-
@stdlib/blas/base/ddot/lib/ndarray.js:
|
|
392
|
-
@stdlib/blas/base/ddot/lib/ddot.js:
|
|
393
|
-
@stdlib/blas/base/ddot/lib/main.js:
|
|
394
|
-
@stdlib/blas/base/ddot/lib/index.js:
|
|
395
|
-
(**
|
|
396
|
-
* @license Apache-2.0
|
|
397
|
-
*
|
|
398
|
-
* Copyright (c) 2019 The Stdlib Authors.
|
|
399
|
-
*
|
|
400
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
401
|
-
* you may not use this file except in compliance with the License.
|
|
402
|
-
* You may obtain a copy of the License at
|
|
403
|
-
*
|
|
404
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
405
|
-
*
|
|
406
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
407
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
408
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
409
|
-
* See the License for the specific language governing permissions and
|
|
410
|
-
* limitations under the License.
|
|
411
|
-
*)
|
|
412
|
-
*/
|
|
1
|
+
"use strict";var fr=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var Sn=Object.getOwnPropertyNames;var Dn=Object.prototype.hasOwnProperty;var wn=(r,t)=>{for(var e in t)fr(r,e,{get:t[e],enumerable:!0})},Nn=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Sn(t))!Dn.call(r,o)&&o!==e&&fr(r,o,{get:()=>t[o],enumerable:!(n=bn(t,o))||n.enumerable});return r};var xn=r=>Nn(fr({},"__esModule",{value:!0}),r);var So={};wn(So,{DTYPE_TO_DESCR:()=>Q,InvalidNpyError:()=>C,NDArray:()=>z,SUPPORTED_DTYPES:()=>sr,UnsupportedDTypeError:()=>v,__version__:()=>bo,absolute:()=>fe,arange:()=>Qt,arccos:()=>Ue,arccosh:()=>Ve,arcsin:()=>Be,arcsinh:()=>ve,arctan:()=>_e,arctan2:()=>Ee,arctanh:()=>Pe,array:()=>V,array_equal:()=>on,array_split:()=>We,asarray:()=>ne,broadcast_arrays:()=>rn,broadcast_to:()=>Ke,choose:()=>nn,concatenate:()=>Le,copy:()=>oe,cos:()=>Ie,cosh:()=>Ce,degrees:()=>Oe,dot:()=>Ae,dstack:()=>He,empty:()=>Ur,empty_like:()=>ie,eye:()=>Br,floor_divide:()=>de,full:()=>_r,full_like:()=>ue,geomspace:()=>te,hsplit:()=>Je,hstack:()=>Ze,hypot:()=>Te,identity:()=>ee,inner:()=>De,linspace:()=>Kt,loadNpz:()=>Mr,loadNpzSync:()=>Cr,logspace:()=>re,mod:()=>me,moveaxis:()=>Re,negative:()=>pe,ones:()=>zr,ones_like:()=>se,outer:()=>we,parseNpy:()=>K,parseNpyData:()=>ur,parseNpyHeader:()=>ir,parseNpz:()=>cr,parseNpzSync:()=>lr,positive:()=>ge,power:()=>le,put:()=>en,radians:()=>$e,reciprocal:()=>he,repeat:()=>Qe,serializeNpy:()=>q,serializeNpz:()=>kr,serializeNpzSync:()=>vr,sign:()=>ye,sin:()=>xe,sinh:()=>Me,split:()=>Ye,sqrt:()=>ce,stack:()=>je,swapaxes:()=>Fe,take:()=>tn,tan:()=>ze,tanh:()=>ke,tensordot:()=>Ne,tile:()=>Xe,trace:()=>be,transpose:()=>Se,vsplit:()=>Ge,vstack:()=>qe,zeros:()=>J,zeros_like:()=>ae});module.exports=xn(So);function Pr(r){if(!r.includes(":")){if(r.includes("."))throw new Error(`Invalid slice index: "${r}" (must be integer)`);let a=parseInt(r,10);if(isNaN(a))throw new Error(`Invalid slice index: "${r}"`);return{start:a,stop:null,step:1,isIndex:!0}}let t=r.split(":");if(t.length>3)throw new Error(`Invalid slice notation: "${r}" (too many colons)`);let e=t[0]===""?null:parseInt(t[0],10),n=t[1]===""||t[1]===void 0?null:parseInt(t[1],10),o=t[2]===""||t[2]===void 0?1:parseInt(t[2],10);if(e!==null&&isNaN(e))throw new Error(`Invalid start index in slice: "${r}"`);if(n!==null&&isNaN(n))throw new Error(`Invalid stop index in slice: "${r}"`);if(isNaN(o))throw new Error(`Invalid step in slice: "${r}"`);if(o===0)throw new Error("Slice step cannot be zero");return{start:e,stop:n,step:o,isIndex:!1}}function Fr(r,t){let{start:e,stop:n}=r,{step:o,isIndex:a}=r;if(a){if(e===null)throw new Error("Index cannot be null");let c=e<0?t+e:e;if(c<0||c>=t)throw new Error(`Index ${e} is out of bounds for size ${t}`);return{start:c,stop:c+1,step:1,isIndex:!0}}return o>0?(e===null&&(e=0),n===null&&(n=t)):(e===null&&(e=t-1),n===null&&(n=-t-1)),e<0&&(e=t+e),n<0&&(n=t+n),e=Math.max(0,Math.min(e,t)),n=Math.max(-1,Math.min(n,t)),{start:e,stop:n,step:o,isIndex:!1}}var M="float64";function B(r){switch(r){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: ${r}`)}}function Lr(r){switch(r){case"float64":case"int64":case"uint64":return 8;case"float32":case"int32":case"uint32":return 4;case"int16":case"uint16":return 2;case"int8":case"uint8":case"bool":return 1;default:throw new Error(`Unknown dtype: ${r}`)}}function Rr(r){return r==="float64"||r==="float32"}function w(r){return r==="int64"||r==="uint64"}function O(r,t){if(r===t)return r;if(r==="bool")return t;if(t==="bool")return r;if(Rr(r)||Rr(t)){if(r==="float64"||t==="float64")return"float64";if(r==="float32"){let i=t;return i==="int32"||i==="int64"||i==="uint32"||i==="uint64"?"float64":"float32"}if(t==="float32"){let i=r;return i==="int32"||i==="int64"||i==="uint32"||i==="uint64"?"float64":"float32"}return"float32"}let e=r.startsWith("int"),n=t.startsWith("int"),o=r.startsWith("uint"),a=t.startsWith("uint"),c=i=>i.includes("64")?64:i.includes("32")?32:i.includes("16")?16:i.includes("8")?8:0,u=c(r),s=c(t);if(r==="int64"&&t==="uint64"||r==="uint64"&&t==="int64")return"float64";if(e&&a&&u===s){if(u===8)return"int16";if(u===16)return"int32";if(u===32)return"int64"}if(o&&n&&u===s){if(s===8)return"int16";if(s===16)return"int32";if(s===32)return"int64"}if(e&&n||o&&a){let i=Math.max(u,s);return e?i===64?"int64":i===32?"int32":i===16?"int16":"int8":i===64?"uint64":i===32?"uint32":i===16?"uint16":"uint8"}return e&&a?u>s?r:s===8?"int16":s===16?"int32":s===32?"int64":"float64":o&&n?s>u?t:u===8?"int16":u===16?"int32":u===32?"int64":"float64":"float64"}var D=class r{constructor(t,e,n,o,a){this._data=t,this._shape=e,this._strides=n,this._offset=o,this._dtype=a}get shape(){return this._shape}get ndim(){return this._shape.length}get size(){return this._shape.reduce((t,e)=>t*e,1)}get dtype(){return this._dtype}get data(){return this._data}get strides(){return this._strides}get offset(){return this._offset}get isCContiguous(){let t=this._shape,e=this._strides,n=t.length;if(n===0)return!0;if(n===1)return e[0]===1;let o=1;for(let a=n-1;a>=0;a--){if(e[a]!==o)return!1;o*=t[a]}return!0}get isFContiguous(){let t=this._shape,e=this._strides,n=t.length;if(n===0)return!0;if(n===1)return e[0]===1;let o=1;for(let a=0;a<n;a++){if(e[a]!==o)return!1;o*=t[a]}return!0}iget(t){let e=this._shape,n=this._strides,o=e.length;if(o===0)return this._data[this._offset];let a=t,c=this._offset;for(let u=0;u<o;u++){let s=1;for(let l=u+1;l<o;l++)s*=e[l];let i=Math.floor(a/s);a=a%s,c+=i*n[u]}return this._data[c]}iset(t,e){let n=this._shape,o=this._strides,a=n.length;if(a===0){this._data[this._offset]=e;return}let c=t,u=this._offset;for(let s=0;s<a;s++){let i=1;for(let f=s+1;f<a;f++)i*=n[f];let l=Math.floor(c/i);c=c%i,u+=l*o[s]}this._data[u]=e}get(...t){let e=this._strides,n=this._offset;for(let o=0;o<t.length;o++)n+=t[o]*e[o];return this._data[n]}set(t,e){let n=this._strides,o=this._offset;for(let a=0;a<t.length;a++)o+=t[a]*n[a];this._data[o]=e}copy(){let t=Array.from(this._shape),e=this._dtype,n=this.size,o=B(e);if(!o)throw new Error(`Cannot copy array with dtype ${e}`);let a=new o(n);if(this.isCContiguous&&this._offset===0)if(w(e)){let c=this._data,u=a;for(let s=0;s<n;s++)u[s]=c[s]}else a.set(this._data);else if(w(e)){let c=a;for(let u=0;u<n;u++)c[u]=this.iget(u)}else for(let c=0;c<n;c++)a[c]=this.iget(c);return new r(a,t,r._computeStrides(t),0,e)}static fromData(t,e,n,o,a){let c=o??r._computeStrides(e),u=a??0;return new r(t,e,c,u,n)}static zeros(t,e=M){let n=t.reduce((c,u)=>c*u,1),o=B(e);if(!o)throw new Error(`Cannot create array with dtype ${e}`);let a=new o(n);return new r(a,t,r._computeStrides(t),0,e)}static ones(t,e=M){let n=t.reduce((c,u)=>c*u,1),o=B(e);if(!o)throw new Error(`Cannot create array with dtype ${e}`);let a=new o(n);return w(e)?a.fill(BigInt(1)):a.fill(1),new r(a,t,r._computeStrides(t),0,e)}static _computeStrides(t){let e=new Array(t.length),n=1;for(let o=t.length-1;o>=0;o--)e[o]=n,n*=t[o];return e}};function P(r){let t=new Array(r.length),e=1;for(let n=r.length-1;n>=0;n--)t[n]=e,e*=r[n];return t}function jr(r,t){let e=r.length,n=t.length,o=Math.max(e,n),a=new Array(o);for(let c=0;c<o;c++){let u=c<o-e?1:r[c-(o-e)],s=c<o-n?1:t[c-(o-n)];if(u===s)a[c]=u;else if(u===1)a[c]=s;else if(s===1)a[c]=u;else throw new Error(`operands could not be broadcast together with shapes ${JSON.stringify(Array.from(r))} ${JSON.stringify(Array.from(t))}`)}return a}function In(r,t,e){let n=r.length,o=e.length,a=new Array(o).fill(0);for(let c=0;c<n;c++){let u=o-n+c,s=r[c],i=e[u];if(s===i)a[u]=t[c];else if(s===1)a[u]=0;else throw new Error("Invalid broadcast")}return a}function er(r,t){let e=In(r.shape,r.strides,t);return D.fromData(r.data,Array.from(t),r.dtype,e,r.offset)}function k(r,t,e,n){let o=jr(r.shape,t.shape),a=er(r,o),c=er(t,o),u=O(r.dtype,t.dtype),s=D.zeros(o,u),i=s.data,l=s.size;if(w(u)){let f=i;for(let p=0;p<l;p++){let m=a.iget(p),y=c.iget(p),d=typeof m=="bigint"?m:BigInt(Math.round(m)),A=typeof y=="bigint"?y:BigInt(Math.round(y));n==="add"?f[p]=d+A:n==="subtract"?f[p]=d-A:n==="multiply"?f[p]=d*A:n==="divide"?f[p]=d/A:f[p]=BigInt(Math.round(e(Number(d),Number(A))))}}else{let f=w(r.dtype)||w(t.dtype);for(let p=0;p<l;p++){let m=a.iget(p),y=c.iget(p),d=Number(m),A=Number(y);i[p]=e(d,A)}}return s}function F(r,t,e){let n=jr(r.shape,t.shape),o=er(r,n),a=er(t,n),c=n.reduce((i,l)=>i*l,1),u=new Uint8Array(c),s=w(r.dtype)||w(t.dtype);for(let i=0;i<c;i++){let l=o.iget(i),f=a.iget(i),p=Number(l),m=Number(f);u[i]=e(p,m)?1:0}return D.fromData(u,n,"bool")}function $(r,t,e=!0){let n=r.dtype,o=Array.from(r.shape),a=r.size,u=e?n:n!=="float32"&&n!=="float64"?"float64":n,s=D.zeros(o,u),i=s.data,l=r.data;if(w(n))if(w(u)){let f=i;for(let p=0;p<a;p++){let m=Number(l[p]);f[p]=BigInt(Math.round(t(m)))}}else for(let f=0;f<a;f++)i[f]=t(Number(l[f]));else for(let f=0;f<a;f++)i[f]=t(Number(l[f]));return s}function pr(r,t){return r.isCContiguous&&t.isCContiguous&&r.shape.length===t.shape.length&&r.shape.every((e,n)=>e===t.shape[n])}function qr(r,t){return typeof t=="number"?_n(r,t):pr(r,t)?zn(r,t):k(r,t,(e,n)=>e+n,"add")}function zn(r,t){let e=O(r.dtype,t.dtype),n=D.zeros(Array.from(r.shape),e),o=r.size,a=r.data,c=t.data,u=n.data;if(w(e)){let s=u;if(!w(r.dtype)||!w(t.dtype))for(let l=0;l<o;l++){let f=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),p=typeof c[l]=="bigint"?c[l]:BigInt(Math.round(Number(c[l])));s[l]=f+p}else{let l=a,f=c;for(let p=0;p<o;p++)s[p]=l[p]+f[p]}}else if(w(r.dtype)||w(t.dtype))for(let i=0;i<o;i++){let l=typeof a[i]=="bigint"?Number(a[i]):a[i],f=typeof c[i]=="bigint"?Number(c[i]):c[i];u[i]=l+f}else for(let i=0;i<o;i++)u[i]=a[i]+c[i];return n}function Zr(r,t){return typeof t=="number"?En(r,t):pr(r,t)?Bn(r,t):k(r,t,(e,n)=>e-n,"subtract")}function Bn(r,t){let e=O(r.dtype,t.dtype),n=D.zeros(Array.from(r.shape),e),o=r.size,a=r.data,c=t.data,u=n.data;if(w(e)){let s=u;if(!w(r.dtype)||!w(t.dtype))for(let l=0;l<o;l++){let f=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),p=typeof c[l]=="bigint"?c[l]:BigInt(Math.round(Number(c[l])));s[l]=f-p}else{let l=a,f=c;for(let p=0;p<o;p++)s[p]=l[p]-f[p]}}else if(w(r.dtype)||w(t.dtype))for(let i=0;i<o;i++){let l=typeof a[i]=="bigint"?Number(a[i]):a[i],f=typeof c[i]=="bigint"?Number(c[i]):c[i];u[i]=l-f}else for(let i=0;i<o;i++)u[i]=a[i]-c[i];return n}function Hr(r,t){return typeof t=="number"?Tn(r,t):pr(r,t)?Un(r,t):k(r,t,(e,n)=>e*n,"multiply")}function Un(r,t){let e=O(r.dtype,t.dtype),n=D.zeros(Array.from(r.shape),e),o=r.size,a=r.data,c=t.data,u=n.data;if(w(e)){let s=u;if(!w(r.dtype)||!w(t.dtype))for(let l=0;l<o;l++){let f=typeof a[l]=="bigint"?a[l]:BigInt(Math.round(Number(a[l]))),p=typeof c[l]=="bigint"?c[l]:BigInt(Math.round(Number(c[l])));s[l]=f*p}else{let l=a,f=c;for(let p=0;p<o;p++)s[p]=l[p]*f[p]}}else if(w(r.dtype)||w(t.dtype))for(let i=0;i<o;i++){let l=typeof a[i]=="bigint"?Number(a[i]):a[i],f=typeof c[i]=="bigint"?Number(c[i]):c[i];u[i]=l*f}else for(let i=0;i<o;i++)u[i]=a[i]*c[i];return n}function Yr(r,t){if(typeof t=="number")return On(r,t);let e=r.dtype==="float64",n=t.dtype==="float64",o=r.dtype==="float32",a=t.dtype==="float32";if(e||n){let s=e?r:L(r,"float64"),i=n?t:L(t,"float64");return k(s,i,(l,f)=>l/f,"divide")}if(o||a){let s=o?r:L(r,"float32"),i=a?t:L(t,"float32");return k(s,i,(l,f)=>l/f,"divide")}let c=L(r,"float64"),u=L(t,"float64");return k(c,u,(s,i)=>s/i,"divide")}function L(r,t){let e=D.zeros(Array.from(r.shape),t),n=r.size,o=r.data,a=e.data;for(let c=0;c<n;c++)a[c]=Number(o[c]);return e}function _n(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,c=D.zeros(n,e),u=c.data;if(w(e)){let s=o,i=u,l=BigInt(Math.round(t));for(let f=0;f<a;f++)i[f]=s[f]+l}else for(let s=0;s<a;s++)u[s]=Number(o[s])+t;return c}function En(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,c=D.zeros(n,e),u=c.data;if(w(e)){let s=o,i=u,l=BigInt(Math.round(t));for(let f=0;f<a;f++)i[f]=s[f]-l}else for(let s=0;s<a;s++)u[s]=Number(o[s])-t;return c}function Tn(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,c=D.zeros(n,e),u=c.data;if(w(e)){let s=o,i=u,l=BigInt(Math.round(t));for(let f=0;f<a;f++)i[f]=s[f]*l}else for(let s=0;s<a;s++)u[s]=Number(o[s])*t;return c}function On(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,u=e!=="float32"&&e!=="float64"?"float64":e,s=D.zeros(n,u),i=s.data;if(w(e))for(let l=0;l<a;l++)i[l]=Number(o[l])/t;else for(let l=0;l<a;l++)i[l]=Number(o[l])/t;return s}function Wr(r){let t=r.dtype,e=Array.from(r.shape),n=r.data,o=r.size,a=D.zeros(e,t),c=a.data;if(w(t)){let u=n,s=c;for(let i=0;i<o;i++){let l=u[i];s[i]=l<0n?-l:l}}else for(let u=0;u<o;u++)c[u]=Math.abs(Number(n[u]));return a}function Gr(r){let t=r.dtype,e=Array.from(r.shape),n=r.data,o=r.size,a=D.zeros(e,t),c=a.data;if(w(t)){let u=n,s=c;for(let i=0;i<o;i++)s[i]=-u[i]}else for(let u=0;u<o;u++)c[u]=-Number(n[u]);return a}function Jr(r){let t=r.dtype,e=Array.from(r.shape),n=r.data,o=r.size,a=D.zeros(e,t),c=a.data;if(w(t)){let u=n,s=c;for(let i=0;i<o;i++){let l=u[i];s[i]=l>0n?1n:l<0n?-1n:0n}}else for(let u=0;u<o;u++){let s=Number(n[u]);c[u]=s>0?1:s<0?-1:0}return a}function Xr(r,t){return typeof t=="number"?$n(r,t):k(r,t,(e,n)=>(e%n+n)%n,"mod")}function $n(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,c=D.zeros(n,e),u=c.data;if(w(e)){let s=o,i=u,l=BigInt(Math.round(t));for(let f=0;f<a;f++){let p=s[f];i[f]=(p%l+l)%l}}else for(let s=0;s<a;s++){let i=Number(o[s]);u[s]=(i%t+t)%t}return c}function Qr(r,t){return typeof t=="number"?Mn(r,t):k(r,t,(e,n)=>Math.floor(e/n),"floor_divide")}function Mn(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,c=D.zeros(n,e),u=c.data;if(w(e)){let s=o,i=u,l=BigInt(Math.round(t));for(let f=0;f<a;f++)i[f]=s[f]/l}else for(let s=0;s<a;s++)u[s]=Math.floor(Number(o[s])/t);return c}function Kr(r){let t=r.dtype,e=Array.from(r.shape),n=r.data,o=r.size,a=D.zeros(e,t),c=a.data;for(let u=0;u<o;u++)c[u]=n[u];return a}function rt(r){let t=r.dtype,e=Array.from(r.shape),n=r.data,o=r.size,c=t!=="float32"&&t!=="float64"?"float64":t,u=D.zeros(e,c),s=u.data;if(w(t))for(let i=0;i<o;i++)s[i]=1/Number(n[i]);else for(let i=0;i<o;i++)s[i]=1/Number(n[i]);return u}function tt(r,t){return typeof t=="number"?kn(r,t):F(r,t,(e,n)=>e>n)}function et(r,t){return typeof t=="number"?vn(r,t):F(r,t,(e,n)=>e>=n)}function nt(r,t){return typeof t=="number"?Vn(r,t):F(r,t,(e,n)=>e<n)}function ot(r,t){return typeof t=="number"?Pn(r,t):F(r,t,(e,n)=>e<=n)}function at(r,t){return typeof t=="number"?Fn(r,t):F(r,t,(e,n)=>e===n)}function st(r,t){return typeof t=="number"?Rn(r,t):F(r,t,(e,n)=>e!==n)}function yr(r,t,e=1e-5,n=1e-8){return typeof t=="number"?Ln(r,t,e,n):F(r,t,(o,a)=>{let c=Math.abs(o-a),u=n+e*Math.abs(a);return c<=u})}function it(r,t,e=1e-5,n=1e-8){let o=yr(r,t,e,n),a=o.data;for(let c=0;c<o.size;c++)if(a[c]===0)return!1;return!0}function kn(r,t){let e=new Uint8Array(r.size),n=r.data;for(let o=0;o<r.size;o++)e[o]=n[o]>t?1:0;return D.fromData(e,Array.from(r.shape),"bool")}function vn(r,t){let e=new Uint8Array(r.size),n=r.data;for(let o=0;o<r.size;o++)e[o]=n[o]>=t?1:0;return D.fromData(e,Array.from(r.shape),"bool")}function Vn(r,t){let e=new Uint8Array(r.size),n=r.data;for(let o=0;o<r.size;o++)e[o]=n[o]<t?1:0;return D.fromData(e,Array.from(r.shape),"bool")}function Pn(r,t){let e=new Uint8Array(r.size),n=r.data;for(let o=0;o<r.size;o++)e[o]=n[o]<=t?1:0;return D.fromData(e,Array.from(r.shape),"bool")}function Fn(r,t){let e=new Uint8Array(r.size),n=r.data,o=r.dtype;if(w(o)){let a=BigInt(Math.round(t)),c=n;for(let u=0;u<r.size;u++)e[u]=c[u]===a?1:0}else for(let a=0;a<r.size;a++)e[a]=n[a]===t?1:0;return D.fromData(e,Array.from(r.shape),"bool")}function Rn(r,t){let e=new Uint8Array(r.size),n=r.data;for(let o=0;o<r.size;o++)e[o]=n[o]!==t?1:0;return D.fromData(e,Array.from(r.shape),"bool")}function Ln(r,t,e,n){let o=new Uint8Array(r.size),a=r.data,c=r.dtype;if(w(c)){let u=a;for(let s=0;s<r.size;s++){let i=Number(u[s]),l=Math.abs(i-t),f=n+e*Math.abs(t);o[s]=l<=f?1:0}}else for(let u=0;u<r.size;u++){let s=Number(a[u]),i=Math.abs(s-t),l=n+e*Math.abs(t);o[u]=i<=l?1:0}return D.fromData(o,Array.from(r.shape),"bool")}function _(r,t){let e=0,n=1;for(let o=r.length-1;o>=0;o--)e+=r[o]*n,n*=t[o];return e}function E(r,t,e,n){let o=n.length,a=new Array(o),c=Array.from(n).filter((s,i)=>i!==t),u=r;for(let s=c.length-1;s>=0;s--)a[s>=t?s+1:s]=u%c[s],u=Math.floor(u/c[s]);return a[t]=e,a}function H(r,t,e=!1){let n=r.dtype,o=r.shape,a=o.length,c=r.size,u=r.data;if(t===void 0)if(w(n)){let y=u,d=BigInt(0);for(let A=0;A<c;A++)d+=y[A];return Number(d)}else{let y=0;for(let d=0;d<c;d++)y+=Number(u[d]);return y}let s=t;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${t} is out of bounds for array of dimension ${a}`);let i=Array.from(o).filter((y,d)=>d!==s);if(i.length===0)return H(r);let l=D.zeros(i,n),f=l.data,p=o[s],m=i.reduce((y,d)=>y*d,1);if(w(n)){let y=u,d=f;for(let A=0;A<m;A++){let h=BigInt(0);for(let g=0;g<p;g++){let b=E(A,s,g,o),S=_(b,o);h+=y[S]}d[A]=h}}else for(let y=0;y<m;y++){let d=0;for(let A=0;A<p;A++){let h=E(y,s,A,o),g=_(h,o);d+=Number(u[g])}f[y]=d}if(e){let y=[...o];return y[s]=1,D.fromData(f,y,n)}return l}function mr(r,t,e=!1){let n=r.dtype,o=r.shape;if(t===void 0)return H(r)/r.size;let a=t;if(a<0&&(a=o.length+a),a<0||a>=o.length)throw new Error(`axis ${t} is out of bounds for array of dimension ${o.length}`);let c=H(r,t,e);if(typeof c=="number")return c/o[a];let u=o[a],s=n;(w(n)||n.startsWith("int")||n.startsWith("uint"))&&(s="float64");let i=D.zeros(Array.from(c.shape),s),l=i.data,f=c.data;if(w(n)){let p=f;for(let m=0;m<l.length;m++)l[m]=Number(p[m])/u}else for(let p=0;p<l.length;p++)l[p]=Number(f[p])/u;return i}function dr(r,t,e=!1){let n=r.dtype,o=r.shape,a=o.length,c=r.size,u=r.data;if(t===void 0){if(c===0)throw new Error("max of empty array");let y=u[0];for(let d=1;d<c;d++)u[d]>y&&(y=u[d]);return Number(y)}let s=t;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${t} is out of bounds for array of dimension ${a}`);let i=Array.from(o).filter((y,d)=>d!==s);if(i.length===0)return dr(r);let l=D.zeros(i,n),f=l.data,p=o[s],m=i.reduce((y,d)=>y*d,1);if(w(n)){let y=u,d=f;for(let A=0;A<m;A++){let h=E(A,s,0,o),g=_(h,o),b=y[g];for(let S=1;S<p;S++){let x=E(A,s,S,o),N=_(x,o),T=y[N];T>b&&(b=T)}d[A]=b}}else for(let y=0;y<m;y++){let d=-1/0;for(let A=0;A<p;A++){let h=E(y,s,A,o),g=_(h,o),b=Number(u[g]);b>d&&(d=b)}f[y]=d}if(e){let y=[...o];return y[s]=1,D.fromData(f,y,n)}return l}function gr(r,t,e=!1){let n=r.dtype,o=r.shape,a=o.length,c=r.size,u=r.data;if(t===void 0)if(w(n)){let y=u,d=BigInt(1);for(let A=0;A<c;A++)d*=y[A];return Number(d)}else{let y=1;for(let d=0;d<c;d++)y*=Number(u[d]);return y}let s=t;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${t} is out of bounds for array of dimension ${a}`);let i=Array.from(o).filter((y,d)=>d!==s);if(i.length===0)return gr(r);let l=D.zeros(i,n),f=l.data,p=o[s],m=i.reduce((y,d)=>y*d,1);if(w(n)){let y=u,d=f;for(let A=0;A<m;A++){let h=BigInt(1);for(let g=0;g<p;g++){let b=E(A,s,g,o),S=_(b,o);h*=y[S]}d[A]=h}}else for(let y=0;y<m;y++){let d=1;for(let A=0;A<p;A++){let h=E(y,s,A,o),g=_(h,o);d*=Number(u[g])}f[y]=d}if(e){let y=[...o];return y[s]=1,D.fromData(f,y,n)}return l}function hr(r,t,e=!1){let n=r.dtype,o=r.shape,a=o.length,c=r.size,u=r.data;if(t===void 0){if(c===0)throw new Error("min of empty array");let y=u[0];for(let d=1;d<c;d++)u[d]<y&&(y=u[d]);return Number(y)}let s=t;if(s<0&&(s=a+s),s<0||s>=a)throw new Error(`axis ${t} is out of bounds for array of dimension ${a}`);let i=Array.from(o).filter((y,d)=>d!==s);if(i.length===0)return hr(r);let l=D.zeros(i,n),f=l.data,p=o[s],m=i.reduce((y,d)=>y*d,1);if(w(n)){let y=u,d=f;for(let A=0;A<m;A++){let h=E(A,s,0,o),g=_(h,o),b=y[g];for(let S=1;S<p;S++){let x=E(A,s,S,o),N=_(x,o),T=y[N];T<b&&(b=T)}d[A]=b}}else for(let y=0;y<m;y++){let d=1/0;for(let A=0;A<p;A++){let h=E(y,s,A,o),g=_(h,o),b=Number(u[g]);b<d&&(d=b)}f[y]=d}if(e){let y=[...o];return y[s]=1,D.fromData(f,y,n)}return l}function Ar(r,t){let e=r.dtype,n=r.shape,o=n.length,a=r.size,c=r.data;if(t===void 0){if(a===0)throw new Error("argmin of empty array");let m=c[0],y=0;for(let d=1;d<a;d++)c[d]<m&&(m=c[d],y=d);return y}let u=t;if(u<0&&(u=o+u),u<0||u>=o)throw new Error(`axis ${t} is out of bounds for array of dimension ${o}`);let s=Array.from(n).filter((m,y)=>y!==u);if(s.length===0)return Ar(r);let i=D.zeros(s,"int32"),l=i.data,f=n[u],p=s.reduce((m,y)=>m*y,1);if(w(e)){let m=c;for(let y=0;y<p;y++){let d=E(y,u,0,n),A=_(d,n),h=m[A],g=0;for(let b=1;b<f;b++){let S=E(y,u,b,n),x=_(S,n),N=m[x];N<h&&(h=N,g=b)}l[y]=g}}else for(let m=0;m<p;m++){let y=1/0,d=0;for(let A=0;A<f;A++){let h=E(m,u,A,n),g=_(h,n),b=Number(c[g]);b<y&&(y=b,d=A)}l[m]=d}return i}function br(r,t){let e=r.dtype,n=r.shape,o=n.length,a=r.size,c=r.data;if(t===void 0){if(a===0)throw new Error("argmax of empty array");let m=c[0],y=0;for(let d=1;d<a;d++)c[d]>m&&(m=c[d],y=d);return y}let u=t;if(u<0&&(u=o+u),u<0||u>=o)throw new Error(`axis ${t} is out of bounds for array of dimension ${o}`);let s=Array.from(n).filter((m,y)=>y!==u);if(s.length===0)return br(r);let i=D.zeros(s,"int32"),l=i.data,f=n[u],p=s.reduce((m,y)=>m*y,1);if(w(e)){let m=c;for(let y=0;y<p;y++){let d=E(y,u,0,n),A=_(d,n),h=m[A],g=0;for(let b=1;b<f;b++){let S=E(y,u,b,n),x=_(S,n),N=m[x];N>h&&(h=N,g=b)}l[y]=g}}else for(let m=0;m<p;m++){let y=-1/0,d=0;for(let A=0;A<f;A++){let h=E(m,u,A,n),g=_(h,n),b=Number(c[g]);b>y&&(y=b,d=A)}l[m]=d}return i}function Sr(r,t,e=0,n=!1){let o=r.shape,a=o.length,c=r.size,u=r.data,s=mr(r,t,n);if(t===void 0){let h=s,g=0;for(let b=0;b<c;b++){let S=Number(u[b])-h;g+=S*S}return g/(c-e)}let i=t;if(i<0&&(i=a+i),i<0||i>=a)throw new Error(`axis ${t} is out of bounds for array of dimension ${a}`);let l=o[i],f=s,p=f.data,m=n?f.shape:Array.from(o).filter((h,g)=>g!==i),y=D.zeros(Array.from(m),"float64"),d=y.data,A=m.reduce((h,g)=>h*g,1);for(let h=0;h<A;h++){let g=0,b=Number(p[h]);for(let S=0;S<l;S++){let x=E(h,i,S,o),N=_(x,o),T=Number(u[N])-b;g+=T*T}d[h]=g/(l-e)}return y}function ut(r,t,e=0,n=!1){let o=Sr(r,t,e,n);if(typeof o=="number")return Math.sqrt(o);let a=D.zeros(Array.from(o.shape),"float64"),c=o.data,u=a.data;for(let s=0;s<c.length;s++)u[s]=Math.sqrt(Number(c[s]));return a}function Dr(r,t,e=!1){let n=r.shape,o=n.length,a=r.size,c=r.data;if(t===void 0){for(let m=0;m<a;m++)if(!c[m])return!1;return!0}let u=t;if(u<0&&(u=o+u),u<0||u>=o)throw new Error(`axis ${t} is out of bounds for array of dimension ${o}`);let s=Array.from(n).filter((m,y)=>y!==u);if(s.length===0)return Dr(r);let i=D.zeros(s,"bool"),l=i.data,f=n[u],p=s.reduce((m,y)=>m*y,1);for(let m=0;m<p;m++){let y=!0;for(let d=0;d<f;d++){let A=E(m,u,d,n),h=_(A,n);if(!c[h]){y=!1;break}}l[m]=y?1:0}if(e){let m=[...n];return m[u]=1,D.fromData(l,m,"bool")}return i}function wr(r,t,e=!1){let n=r.shape,o=n.length,a=r.size,c=r.data;if(t===void 0){for(let m=0;m<a;m++)if(c[m])return!0;return!1}let u=t;if(u<0&&(u=o+u),u<0||u>=o)throw new Error(`axis ${t} is out of bounds for array of dimension ${o}`);let s=Array.from(n).filter((m,y)=>y!==u);if(s.length===0)return wr(r);let i=D.zeros(s,"bool"),l=i.data,f=n[u],p=s.reduce((m,y)=>m*y,1);for(let m=0;m<p;m++){let y=!1;for(let d=0;d<f;d++){let A=E(m,u,d,n),h=_(A,n);if(c[h]){y=!0;break}}l[m]=y?1:0}if(e){let m=[...n];return m[u]=1,D.fromData(l,m,"bool")}return i}function j(r,t){let e=r.size,n=r.dtype,o=t.indexOf(-1),a;if(o!==-1){let i=t.reduce((f,p,m)=>m===o?f:f*p,1),l=e/i;if(!Number.isInteger(l))throw new Error(`cannot reshape array of size ${e} into shape ${JSON.stringify(t)}`);a=t.map((f,p)=>p===o?l:f)}else a=t;if(a.reduce((i,l)=>i*l,1)!==e)throw new Error(`cannot reshape array of size ${e} into shape ${JSON.stringify(a)}`);if(r.isCContiguous){let i=r.data;return D.fromData(i,a,n,P(a),0)}let s=r.copy().data;return D.fromData(s,a,n,P(a),0)}function Nr(r){let t=r.size,e=r.dtype,n=B(e);if(!n)throw new Error(`Cannot flatten array with dtype ${e}`);if(r.isCContiguous){let u=r.data.slice(r.offset,r.offset+t);return D.fromData(u,[t],e,[1],0)}let o=new n(t),a=w(e);for(let c=0;c<t;c++){let u=r.iget(c);o[c]=u}return D.fromData(o,[t],e,[1],0)}function W(r){let t=r.size,e=r.dtype;if(r.isCContiguous){let n=r.data;return D.fromData(n,[t],e,[1],0)}return Nr(r)}function nr(r,t){let e=r.shape,n=e.length,o=r.strides,a=r.data,c=r.dtype,u;if(t===void 0)u=Array.from({length:n},(f,p)=>n-1-p);else{if(t.length!==n)throw new Error(`axes must have length ${n}, got ${t.length}`);let f=new Set;for(let p of t){let m=p<0?n+p:p;if(m<0||m>=n)throw new Error(`axis ${p} is out of bounds for array of dimension ${n}`);if(f.has(m))throw new Error("repeated axis in transpose");f.add(m)}u=t.map(p=>p<0?n+p:p)}let s=u.map(f=>e[f]),i=Array.from(o),l=u.map(f=>i[f]);return D.fromData(a,s,c,l,r.offset)}function ct(r,t){let e=r.shape,n=e.length,o=r.strides,a=r.data,c=r.dtype;if(t===void 0){let u=[],s=[];for(let i=0;i<n;i++)e[i]!==1&&(u.push(e[i]),s.push(o[i]));return u.length===0&&(u.push(1),s.push(1)),D.fromData(a,u,c,s,r.offset)}else{let u=t<0?n+t:t;if(u<0||u>=n)throw new Error(`axis ${t} is out of bounds for array of dimension ${n}`);if(e[u]!==1)throw new Error(`cannot select an axis which has size not equal to one (axis ${t} has size ${e[u]})`);let s=[],i=[];for(let l=0;l<n;l++)l!==u&&(s.push(e[l]),i.push(o[l]));return D.fromData(a,s,c,i,r.offset)}}function Y(r,t){let e=r.shape,n=e.length,o=r.strides,a=r.data,c=r.dtype,u=t;if(u<0&&(u=n+t+1),u<0||u>n)throw new Error(`axis ${t} is out of bounds for array of dimension ${n+1}`);let s=[...Array.from(e)];s.splice(u,0,1);let i=[...Array.from(o)],l=u<n?o[u]*(e[u]||1):1;return i.splice(u,0,l),D.fromData(a,s,c,i,r.offset)}function lt(r,t,e){let n=r.shape,o=n.length,a=r.strides,c=r.data,u=r.dtype,s=t<0?o+t:t,i=e<0?o+e:e;if(s<0||s>=o)throw new Error(`axis1 ${t} is out of bounds for array of dimension ${o}`);if(i<0||i>=o)throw new Error(`axis2 ${e} is out of bounds for array of dimension ${o}`);if(s===i)return D.fromData(c,Array.from(n),u,Array.from(a),r.offset);let l=Array.from(n),f=Array.from(a);return[l[s],l[i]]=[l[i],l[s]],[f[s],f[i]]=[f[i],f[s]],D.fromData(c,l,u,f,r.offset)}function ft(r,t,e){let n=r.ndim,o=Array.isArray(t)?t:[t],a=Array.isArray(e)?e:[e];if(o.length!==a.length)throw new Error("source and destination must have the same number of elements");let c=o.map(i=>{let l=i<0?n+i:i;if(l<0||l>=n)throw new Error(`source axis ${i} is out of bounds for array of dimension ${n}`);return l}),u=a.map(i=>{let l=i<0?n+i:i;if(l<0||l>=n)throw new Error(`destination axis ${i} is out of bounds for array of dimension ${n}`);return l});if(new Set(c).size!==c.length)throw new Error("repeated axis in source");if(new Set(u).size!==u.length)throw new Error("repeated axis in destination");let s=[];for(let i=0;i<n;i++)c.includes(i)||s.push(i);for(let i=0;i<c.length;i++){let l=u[i];s.splice(l,0,c[i])}return nr(r,s)}function R(r,t=0){if(r.length===0)throw new Error("need at least one array to concatenate");if(r.length===1)return r[0].copy();let e=r[0],n=e.ndim,o=e.dtype,a=t<0?n+t:t;if(a<0||a>=n)throw new Error(`axis ${t} is out of bounds for array of dimension ${n}`);for(let m=1;m<r.length;m++){let y=r[m];if(y.ndim!==n)throw new Error("all the input arrays must have same number of dimensions");for(let d=0;d<n;d++)if(d!==a&&y.shape[d]!==e.shape[d])throw new Error("all the input array dimensions except for the concatenation axis must match exactly")}let c=Array.from(e.shape),u=e.shape[a];for(let m=1;m<r.length;m++)u+=r[m].shape[a];c[a]=u;let s=c.reduce((m,y)=>m*y,1),i=B(o);if(!i)throw new Error(`Cannot concatenate arrays with dtype ${o}`);let l=new i(s),f=P(c),p=0;for(let m of r){let y=m.shape[a];Zn(m,l,c,f,a,p,o),p+=y}return D.fromData(l,c,o)}function Zn(r,t,e,n,o,a,c){let u=r.shape,s=u.length,i=r.size,l=c==="int64"||c==="uint64";if(o===0&&r.isCContiguous&&s>0){let p=a*n[0],m=r.data,y=r.offset,d=y+i;t.set(m.subarray(y,d),p);return}let f=new Array(s).fill(0);for(let p=0;p<i;p++){let m=r.iget(p),y=[...f];y[o]+=a;let d=0;for(let A=0;A<s;A++)d+=y[A]*n[A];t[d]=m;for(let A=s-1;A>=0&&(f[A]++,!(f[A]<u[A]));A--)f[A]=0}}function pt(r,t=0){if(r.length===0)throw new Error("need at least one array to stack");let e=r[0],n=e.shape,o=e.ndim,a=t<0?o+1+t:t;if(a<0||a>o)throw new Error(`axis ${t} is out of bounds for array of dimension ${o+1}`);for(let u=1;u<r.length;u++){let s=r[u];if(s.ndim!==o)throw new Error("all input arrays must have the same shape");for(let i=0;i<o;i++)if(s.shape[i]!==n[i])throw new Error("all input arrays must have the same shape")}let c=r.map(u=>Y(u,a));return R(c,a)}function yt(r){if(r.length===0)throw new Error("need at least one array to stack");let t=r.map(e=>e.ndim===1?j(e,[1,e.shape[0]]):e);return R(t,0)}function mt(r){if(r.length===0)throw new Error("need at least one array to stack");return r.every(e=>e.ndim===1)?R(r,0):R(r,1)}function dt(r){if(r.length===0)throw new Error("need at least one array to stack");let t=r.map(e=>e.ndim===1?j(Y(j(e,[1,e.shape[0]]),2),[1,e.shape[0],1]):e.ndim===2?Y(e,2):e);return R(t,2)}function gt(r,t,e=0){let n=r.shape,o=n.length,a=e<0?o+e:e;if(a<0||a>=o)throw new Error(`axis ${e} is out of bounds for array of dimension ${o}`);let c=n[a],u;if(typeof t=="number"){if(c%t!==0)throw new Error("array split does not result in an equal division");let s=c/t;u=[];for(let i=1;i<t;i++)u.push(i*s)}else u=t;return ht(r,u,a)}function or(r,t,e=0){let n=r.shape,o=n.length,a=e<0?o+e:e;if(a<0||a>=o)throw new Error(`axis ${e} is out of bounds for array of dimension ${o}`);let c=n[a],u;if(typeof t=="number"){let s=t,i=Math.floor(c/s),l=c%s;u=[];let f=0;for(let p=0;p<s-1;p++)f+=i+(p<l?1:0),u.push(f)}else u=t;return ht(r,u,a)}function ht(r,t,e){let n=r.shape,o=n[e],a=[0,...t,o],c=[];for(let u=0;u<a.length-1;u++){let s=a[u],i=a[u+1];if(s>i)throw new Error("split indices must be in ascending order");let l=Array.from(n);l[e]=i-s;let f=r.offset+s*r.strides[e];c.push(D.fromData(r.data,l,r.dtype,Array.from(r.strides),f))}return c}function At(r,t){if(r.ndim<2)throw new Error("vsplit only works on arrays of 2 or more dimensions");return or(r,t,0)}function bt(r,t){if(r.ndim<1)throw new Error("hsplit only works on arrays of 1 or more dimensions");let e=r.ndim===1?0:1;return or(r,t,e)}function St(r,t){let e=r.shape,n=e.length,o=r.dtype,a=Array.isArray(t)?t:[t],c=Math.max(n,a.length),u=new Array(c).fill(1),s=new Array(c).fill(1);for(let g=0;g<n;g++)u[c-n+g]=e[g];for(let g=0;g<a.length;g++)s[c-a.length+g]=a[g];let i=u.map((g,b)=>g*s[b]),l=i.reduce((g,b)=>g*b,1),f=B(o);if(!f)throw new Error(`Cannot tile array with dtype ${o}`);let p=new f(l),m=P(i),y=r;n<c&&(y=j(r,u));let d=o==="int64"||o==="uint64",A=y.strides,h=new Array(c).fill(0);for(let g=0;g<l;g++){let b=y.offset;for(let N=0;N<c;N++){let T=h[N]%u[N];b+=T*A[N]}let S=y.data[b],x=0;for(let N=0;N<c;N++)x+=h[N]*m[N];p[x]=S;for(let N=c-1;N>=0&&(h[N]++,!(h[N]<i[N]));N--)h[N]=0}return D.fromData(p,i,o)}function Dt(r,t,e){let n=r.shape,o=n.length,a=r.dtype,c=r.size;if(e===void 0){let g=c,b=Array.isArray(t)?t:new Array(g).fill(t);if(b.length!==g)throw new Error(`operands could not be broadcast together with shape (${g},) (${b.length},)`);let S=b.reduce((I,U)=>I+U,0),x=B(a);if(!x)throw new Error(`Cannot repeat array with dtype ${a}`);let N=new x(S),T=0;for(let I=0;I<g;I++){let U=r.iget(I),tr=b[I];for(let Vr=0;Vr<tr;Vr++)N[T++]=U}return D.fromData(N,[S],a)}let u=e<0?o+e:e;if(u<0||u>=o)throw new Error(`axis ${e} is out of bounds for array of dimension ${o}`);let s=n[u],i=Array.isArray(t)?t:new Array(s).fill(t);if(i.length!==s)throw new Error(`operands could not be broadcast together with shape (${s},) (${i.length},)`);let l=Array.from(n);l[u]=i.reduce((g,b)=>g+b,0);let f=l.reduce((g,b)=>g*b,1),p=B(a);if(!p)throw new Error(`Cannot repeat array with dtype ${a}`);let m=new p(f),y=P(l),d=new Array(o).fill(0),A=a==="int64"||a==="uint64",h=[0];for(let g=0;g<s;g++)h.push(h[g]+i[g]);for(let g=0;g<c;g++){let b=r.iget(g),S=d[u],x=i[S],N=0;for(let U=0;U<o;U++)U!==u&&(N+=d[U]*y[U]);let T=y[u],I=h[S];for(let U=0;U<x;U++){let tr=N+(I+U)*T;m[tr]=b}for(let U=o-1;U>=0&&(d[U]++,!(d[U]<n[U]));U--)d[U]=0}return D.fromData(m,l,a)}function Hn(r,t,e,n,o,a,c,u,s,i,l,f,p,m){if(f===0)for(let h=0;h<n*o;h++)p[h]=0;else if(f!==1)for(let h=0;h<n*o;h++)p[h]=(p[h]??0)*f;let y=r==="row-major",d=t==="transpose",A=e==="transpose";if(y&&!d&&!A)for(let h=0;h<n;h++)for(let g=0;g<o;g++){let b=0;for(let S=0;S<a;S++)b+=(u[h*s+S]??0)*(i[S*l+g]??0);p[h*m+g]=(p[h*m+g]??0)+c*b}else if(y&&d&&!A)for(let h=0;h<n;h++)for(let g=0;g<o;g++){let b=0;for(let S=0;S<a;S++)b+=(u[S*s+h]??0)*(i[S*l+g]??0);p[h*m+g]=(p[h*m+g]??0)+c*b}else if(y&&!d&&A)for(let h=0;h<n;h++)for(let g=0;g<o;g++){let b=0;for(let S=0;S<a;S++)b+=(u[h*s+S]??0)*(i[g*l+S]??0);p[h*m+g]=(p[h*m+g]??0)+c*b}else if(y&&d&&A)for(let h=0;h<n;h++)for(let g=0;g<o;g++){let b=0;for(let S=0;S<a;S++)b+=(u[S*s+h]??0)*(i[g*l+S]??0);p[h*m+g]=(p[h*m+g]??0)+c*b}else if(!y&&!d&&!A)for(let h=0;h<n;h++)for(let g=0;g<o;g++){let b=0;for(let S=0;S<a;S++)b+=(u[S*s+h]??0)*(i[g*l+S]??0);p[g*m+h]=(p[g*m+h]??0)+c*b}else if(!y&&d&&!A)for(let h=0;h<n;h++)for(let g=0;g<o;g++){let b=0;for(let S=0;S<a;S++)b+=(u[h*s+S]??0)*(i[g*l+S]??0);p[g*m+h]=(p[g*m+h]??0)+c*b}else if(!y&&!d&&A)for(let h=0;h<n;h++)for(let g=0;g<o;g++){let b=0;for(let S=0;S<a;S++)b+=(u[S*s+h]??0)*(i[S*l+g]??0);p[g*m+h]=(p[g*m+h]??0)+c*b}else for(let h=0;h<n;h++)for(let g=0;g<o;g++){let b=0;for(let S=0;S<a;S++)b+=(u[h*s+S]??0)*(i[S*l+g]??0);p[g*m+h]=(p[g*m+h]??0)+c*b}}function xr(r,t){let e=r.ndim,n=t.ndim;if(e===0||n===0){let o=e===0?r.get():null,a=n===0?t.get():null;if(e===0&&n===0)return typeof o=="bigint"&&typeof a=="bigint"?o*a:Number(o)*Number(a);if(e===0){let c=O(r.dtype,t.dtype),u=D.zeros([...t.shape],c);for(let s=0;s<t.size;s++){let i=t.data[s+t.offset];typeof o=="bigint"&&typeof i=="bigint"?u.data[s]=o*i:u.data[s]=Number(o)*Number(i)}return u}else{let c=O(r.dtype,t.dtype),u=D.zeros([...r.shape],c);for(let s=0;s<r.size;s++){let i=r.data[s+r.offset];typeof i=="bigint"&&typeof a=="bigint"?u.data[s]=i*a:u.data[s]=Number(i)*Number(a)}return u}}if(e===1&&n===1){if(r.shape[0]!==t.shape[0])throw new Error(`dot: incompatible shapes (${r.shape[0]},) and (${t.shape[0]},)`);let o=r.shape[0],a=0;for(let c=0;c<o;c++){let u=r.get(c),s=t.get(c);typeof u=="bigint"&&typeof s=="bigint"?a=Number(a)+Number(u*s):a+=Number(u)*Number(s)}return a}if(e===2&&n===2)return Ir(r,t);if(e===2&&n===1){let[o,a]=r.shape,c=t.shape[0];if(a!==c)throw new Error(`dot: incompatible shapes (${o},${a}) and (${c},)`);let u=O(r.dtype,t.dtype),s=D.zeros([o],u);for(let i=0;i<o;i++){let l=0;for(let f=0;f<a;f++){let p=r.get(i,f),m=t.get(f);typeof p=="bigint"&&typeof m=="bigint"?l=Number(l)+Number(p*m):l+=Number(p)*Number(m)}s.set([i],l)}return s}if(e===1&&n===2){let o=r.shape[0],[a,c]=t.shape;if(o!==a)throw new Error(`dot: incompatible shapes (${o},) and (${a},${c})`);let u=O(r.dtype,t.dtype),s=D.zeros([c],u);for(let i=0;i<c;i++){let l=0;for(let f=0;f<o;f++){let p=r.get(f),m=t.get(f,i);typeof p=="bigint"&&typeof m=="bigint"?l=Number(l)+Number(p*m):l+=Number(p)*Number(m)}s.set([i],l)}return s}if(e>2&&n===1){let o=r.shape[e-1],a=t.shape[0];if(o!==a)throw new Error(`dot: incompatible shapes ${JSON.stringify(r.shape)} and (${a},)`);let c=[...r.shape.slice(0,-1)],u=O(r.dtype,t.dtype),s=D.zeros(c,u),i=c.reduce((l,f)=>l*f,1);for(let l=0;l<i;l++){let f=0,p=l,m=[];for(let y=c.length-1;y>=0;y--)m[y]=p%c[y],p=Math.floor(p/c[y]);for(let y=0;y<o;y++){let d=[...m,y],A=r.get(...d),h=t.get(y);typeof A=="bigint"&&typeof h=="bigint"?f=Number(f)+Number(A*h):f+=Number(A)*Number(h)}s.set(m,f)}return s}if(e===1&&n>2){let o=r.shape[0],a=1,c=t.shape[a];if(o!==c)throw new Error(`dot: incompatible shapes (${o},) and ${JSON.stringify(t.shape)}`);let u=[...t.shape.slice(0,a),...t.shape.slice(a+1)],s=O(r.dtype,t.dtype),i=D.zeros(u,s),l=u.reduce((f,p)=>f*p,1);for(let f=0;f<l;f++){let p=f,m=[];for(let h=u.length-1;h>=0;h--)m[h]=p%u[h],p=Math.floor(p/u[h]);let y=m.slice(0,a),d=m.slice(a),A=0;for(let h=0;h<o;h++){let g=r.get(h),b=[...y,h,...d],S=t.get(...b);typeof g=="bigint"&&typeof S=="bigint"?A=Number(A)+Number(g*S):A+=Number(g)*Number(S)}i.set(m,A)}return i}if(e>=2&&n>=2&&!(e===2&&n===2)){let o=r.shape[e-1],a=t.shape[n-2];if(o!==a)throw new Error(`dot: incompatible shapes ${JSON.stringify(r.shape)} and ${JSON.stringify(t.shape)}`);let c=[...r.shape.slice(0,-1),...t.shape.slice(0,-2),t.shape[n-1]],u=O(r.dtype,t.dtype),s=D.zeros(c,u),i=r.shape.slice(0,-1).reduce((m,y)=>m*y,1),l=t.shape.slice(0,-2).reduce((m,y)=>m*y,1),f=t.shape[n-1],p=o;for(let m=0;m<i;m++)for(let y=0;y<l;y++)for(let d=0;d<f;d++){let A=0;for(let g=0;g<p;g++){let b=m*p+g,S=r.data[b+r.offset],x=y*p*f+g*f+d,N=t.data[x+t.offset];typeof S=="bigint"&&typeof N=="bigint"?A=Number(A)+Number(S*N):A+=Number(S)*Number(N)}let h=m*l*f+y*f+d;s.data[h]=A}return s}throw new Error(`dot: unexpected combination of dimensions ${e}D \xB7 ${n}D`)}function Ir(r,t){if(r.ndim!==2||t.ndim!==2)throw new Error("matmul requires 2D arrays");let[e=0,n=0]=r.shape,[o=0,a=0]=t.shape;if(n!==o)throw new Error(`matmul shape mismatch: (${e},${n}) @ (${o},${a})`);let c=O(r.dtype,t.dtype),u=c.startsWith("int")||c.startsWith("uint")||c==="bool"?"float64":c;if(u!=="float64")throw new Error(`matmul currently only supports float64, got ${u}`);let s=r.dtype==="float64"?r.data:Float64Array.from(Array.from(r.data).map(Number)),i=t.dtype==="float64"?t.data:Float64Array.from(Array.from(t.data).map(Number));r.offset>0&&(s=s.subarray(r.offset)),t.offset>0&&(i=i.subarray(t.offset));let[l=0,f=0]=r.strides,[p=0,m=0]=t.strides,y=f>l,d=m>p,A=y?"transpose":"no-transpose",h=d?"transpose":"no-transpose",g,b;y?g=f:g=l,d?b=m:b=p;let S=D.zeros([e,a],"float64");return Hn("row-major",A,h,e,a,n,1,s,g,i,b,0,S.data,a),S}function Nt(r){if(r.ndim!==2)throw new Error(`trace requires 2D array, got ${r.ndim}D`);let[t=0,e=0]=r.shape,n=Math.min(t,e),o=0;for(let a=0;a<n;a++){let c=r.get(a,a);typeof c=="bigint"?o=(typeof o=="bigint"?o:BigInt(o))+c:o=(typeof o=="bigint"?Number(o):o)+c}return o}function xt(r,t){let e=r.ndim,n=t.ndim,o=r.shape[e-1],a=t.shape[n-1];if(o!==a)throw new Error(`inner: incompatible shapes - last dimensions ${o} and ${a} don't match`);if(e===1&&n===1)return xr(r,t);let c=[...r.shape.slice(0,-1),...t.shape.slice(0,-1)],u=O(r.dtype,t.dtype),s=D.zeros(c,u),i=e===1?1:r.shape.slice(0,-1).reduce((p,m)=>p*m,1),l=n===1?1:t.shape.slice(0,-1).reduce((p,m)=>p*m,1),f=o;for(let p=0;p<i;p++)for(let m=0;m<l;m++){let y=0;for(let A=0;A<f;A++){let h=e===1?A:p*f+A,g=n===1?A:m*f+A,b=r.data[h+r.offset],S=t.data[g+t.offset];typeof b=="bigint"&&typeof S=="bigint"?y=Number(y)+Number(b*S):y+=Number(b)*Number(S)}if(c.length===0)return y;let d=i===1?m:p*l+m;s.data[d]=y}return s}function It(r,t){let e=r.ndim===1?r:W(r),n=t.ndim===1?t:W(t),o=e.size,a=n.size,c=O(r.dtype,t.dtype),u=D.zeros([o,a],c);for(let s=0;s<o;s++)for(let i=0;i<a;i++){let l=e.get(s),f=n.get(i),p;typeof l=="bigint"&&typeof f=="bigint"?p=l*f:p=Number(l)*Number(f),u.set([s,i],p)}return u}function zt(r,t,e){let n,o;if(typeof e=="number"){let p=e;if(p<0)throw new Error("tensordot: axes must be non-negative");if(p>r.ndim||p>t.ndim)throw new Error("tensordot: axes exceeds array dimensions");n=Array.from({length:p},(m,y)=>r.ndim-p+y),o=Array.from({length:p},(m,y)=>y)}else if([n,o]=e,n.length!==o.length)throw new Error("tensordot: axes lists must have same length");for(let p=0;p<n.length;p++){let m=n[p],y=o[p];if(m<0||m>=r.ndim||y<0||y>=t.ndim)throw new Error("tensordot: axis out of bounds");if(r.shape[m]!==t.shape[y])throw new Error(`tensordot: shape mismatch on axes ${m} and ${y}: ${r.shape[m]} != ${t.shape[y]}`)}let a=[],c=[];for(let p=0;p<r.ndim;p++)n.includes(p)||a.push(p);for(let p=0;p<t.ndim;p++)o.includes(p)||c.push(p);let u=[...a.map(p=>r.shape[p]),...c.map(p=>t.shape[p])];if(u.length===0){let p=0,m=n.map(y=>r.shape[y]).reduce((y,d)=>y*d,1);for(let y=0;y<m;y++){let d=y,A=new Array(n.length);for(let x=n.length-1;x>=0;x--){let N=n[x];A[x]=d%r.shape[N],d=Math.floor(d/r.shape[N])}let h=new Array(r.ndim),g=new Array(t.ndim);for(let x=0;x<n.length;x++)h[n[x]]=A[x];for(let x=0;x<o.length;x++)g[o[x]]=A[x];let b=r.get(...h),S=t.get(...g);typeof b=="bigint"&&typeof S=="bigint"?p=Number(p)+Number(b*S):p+=Number(b)*Number(S)}return p}let s=O(r.dtype,t.dtype),i=D.zeros(u,s),l=u.reduce((p,m)=>p*m,1),f=n.map(p=>r.shape[p]).reduce((p,m)=>p*m,1);for(let p=0;p<l;p++){let m=p,y=[];for(let g=u.length-1;g>=0;g--)y[g]=m%u[g],m=Math.floor(m/u[g]);let d=y.slice(0,a.length),A=y.slice(a.length),h=0;for(let g=0;g<f;g++){m=g;let b=[];for(let I=n.length-1;I>=0;I--){let U=n[I];b[I]=m%r.shape[U],m=Math.floor(m/r.shape[U])}let S=new Array(r.ndim),x=new Array(t.ndim);for(let I=0;I<a.length;I++)S[a[I]]=d[I];for(let I=0;I<c.length;I++)x[c[I]]=A[I];for(let I=0;I<n.length;I++)S[n[I]]=b[I],x[o[I]]=b[I];let N=r.get(...S),T=t.get(...x);typeof N=="bigint"&&typeof T=="bigint"?h=Number(h)+Number(N*T):h+=Number(N)*Number(T)}i.set(y,h)}return i}function Bt(r){return $(r,Math.sqrt,!1)}function Ut(r,t){return typeof t=="number"?Wn(r,t):k(r,t,Math.pow,"power")}function Wn(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,s=e!=="float32"&&e!=="float64"&&(t<0||!Number.isInteger(t))?"float64":e,i=D.zeros(n,s),l=i.data;if(w(e))if(w(s)&&Number.isInteger(t)&&t>=0){let f=o,p=l;for(let m=0;m<a;m++)p[m]=f[m]**BigInt(t)}else for(let f=0;f<a;f++)l[f]=Math.pow(Number(o[f]),t);else for(let f=0;f<a;f++)l[f]=Math.pow(Number(o[f]),t);return i}function _t(r){return $(r,Math.sin,!1)}function Et(r){return $(r,Math.cos,!1)}function Tt(r){return $(r,Math.tan,!1)}function Ot(r){return $(r,Math.asin,!1)}function $t(r){return $(r,Math.acos,!1)}function Mt(r){return $(r,Math.atan,!1)}function Ct(r,t){return typeof t=="number"?Xn(r,t):Jn(r,t)}function Jn(r,t){let e=Array.from(r.shape),n=r.size,o=r.dtype,a=t.dtype,c=o==="float32"&&a==="float32"?"float32":"float64",u=D.zeros(e,c),s=u.data;for(let i=0;i<n;i++){let l=(w(o),Number(r.data[i])),f=(w(a),Number(t.data[i]));s[i]=Math.atan2(l,f)}return u}function Xn(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,c=e==="float32"?"float32":"float64",u=D.zeros(n,c),s=u.data;if(w(e))for(let i=0;i<a;i++)s[i]=Math.atan2(Number(o[i]),t);else for(let i=0;i<a;i++)s[i]=Math.atan2(Number(o[i]),t);return u}function kt(r,t){return typeof t=="number"?Kn(r,t):Qn(r,t)}function Qn(r,t){let e=Array.from(r.shape),n=r.size,o=r.dtype,a=t.dtype,c=o==="float32"&&a==="float32"?"float32":"float64",u=D.zeros(e,c),s=u.data;for(let i=0;i<n;i++){let l=(w(o),Number(r.data[i])),f=(w(a),Number(t.data[i]));s[i]=Math.hypot(l,f)}return u}function Kn(r,t){let e=r.dtype,n=Array.from(r.shape),o=r.data,a=r.size,c=e==="float32"?"float32":"float64",u=D.zeros(n,c),s=u.data;if(w(e))for(let i=0;i<a;i++)s[i]=Math.hypot(Number(o[i]),t);else for(let i=0;i<a;i++)s[i]=Math.hypot(Number(o[i]),t);return u}function vt(r){let t=180/Math.PI;return $(r,e=>e*t,!1)}function Vt(r){let t=Math.PI/180;return $(r,e=>e*t,!1)}function Pt(r){return $(r,Math.sinh,!1)}function Ft(r){return $(r,Math.cosh,!1)}function Rt(r){return $(r,Math.tanh,!1)}function Lt(r){return $(r,Math.asinh,!1)}function jt(r){return $(r,Math.acosh,!1)}function qt(r){return $(r,Math.atanh,!1)}function ar(r){if(r.length===0)return[];if(r.length===1)return Array.from(r[0]);let t=Math.max(...r.map(n=>n.length)),e=new Array(t);for(let n=0;n<t;n++){let o=1;for(let a of r){let c=a.length-t+n,u=c<0?1:a[c];if(u!==1){if(o===1)o=u;else if(o!==u)return null}}e[n]=o}return e}function eo(r,t,e){let n=r.length,o=e.length,a=new Array(o).fill(0);for(let c=0;c<n;c++){let u=o-n+c,s=r[c],i=e[u];if(s===i)a[u]=t[c];else if(s===1)a[u]=0;else throw new Error("Invalid broadcast")}return a}function G(r,t){let e=eo(r.shape,r.strides,t);return D.fromData(r.data,Array.from(t),r.dtype,e,r.offset)}function Zt(r,t){let e=r.shape,n=e.length,o=t.length;if(o<n)throw new Error("input operand has more dimensions than allowed by the axis remapping");let a=ar([Array.from(e),t]);if(a===null)throw new Error(`operands could not be broadcast together with shape (${e.join(",")}) (${t.join(",")})`);for(let c=0;c<o;c++)if(a[c]!==t[c])throw new Error(`operands could not be broadcast together with shape (${e.join(",")}) (${t.join(",")})`);return G(r,t)}function Ht(r){if(r.length===0)return[];if(r.length===1)return[r[0]];let t=r.map(n=>Array.from(n.shape)),e=ar(t);if(e===null)throw new Error(`operands could not be broadcast together with shapes ${t.map(n=>`(${n.join(",")})`).join(" ")}`);return r.map(n=>G(n,e))}function Yt(r,t,e){let n=r.shape,o=n.length,a=r.dtype;if(e===void 0){let y=r.size;for(let g of t){let b=g<0?y+g:g;if(b<0||b>=y)throw new Error(`index ${g} is out of bounds for axis 0 with size ${y}`)}let d=t.length,A=B(a);if(!A)throw new Error(`Cannot take from array with dtype ${a}`);let h=new A(d);for(let g=0;g<d;g++){let b=t[g];b<0&&(b=y+b);let S=r.iget(b);w(a),h[g]=S}return D.fromData(h,[d],a)}let c=e<0?o+e:e;if(c<0||c>=o)throw new Error(`axis ${e} is out of bounds for array of dimension ${o}`);let u=n[c];for(let y of t){let d=y<0?u+y:y;if(d<0||d>=u)throw new Error(`index ${y} is out of bounds for axis ${c} with size ${u}`)}let s=Array.from(n);s[c]=t.length;let i=s.reduce((y,d)=>y*d,1),l=B(a);if(!l)throw new Error(`Cannot take from array with dtype ${a}`);let f=new l(i),p=P(s),m=new Array(o).fill(0);for(let y=0;y<i;y++){let d=[...m],A=m[c],h=t[A];h<0&&(h=u+h),d[c]=h;let g=r.get(...d),b=0;for(let S=0;S<o;S++)b+=m[S]*p[S];w(a),f[b]=g;for(let S=o-1;S>=0&&(m[S]++,!(m[S]<s[S]));S--)m[S]=0}return D.fromData(f,s,a)}function Wt(r,t,e){let n=r.size,o=r.dtype,a;if(typeof e=="number"||typeof e=="bigint")a=new Array(t.length).fill(e);else{a=[];for(let c=0;c<e.size;c++)a.push(e.iget(c));if(a.length===1)a=new Array(t.length).fill(a[0]);else if(a.length!==t.length){let c=[...a];a=[];for(let u=0;u<t.length;u++)a.push(c[u%c.length])}}for(let c=0;c<t.length;c++){let u=t[c];if(u<0&&(u=n+u),u<0||u>=n)throw new Error(`index ${t[c]} is out of bounds for axis 0 with size ${n}`);let s=a[c];w(o)?typeof s!="bigint"&&(s=BigInt(Math.round(Number(s)))):typeof s=="bigint"&&(s=Number(s)),r.iset(u,s)}}function Gt(r,t){if(t.length===0)throw new Error("choices cannot be empty");let e=r.shape,n=t.length,o=t[0].dtype,a=t.map(p=>Array.from(p.shape));a.unshift(Array.from(e));let c=ar(a);if(c===null)throw new Error("operands could not be broadcast together");let u=G(r,c),s=t.map(p=>G(p,c)),i=c.reduce((p,m)=>p*m,1),l=B(o);if(!l)throw new Error(`Cannot choose with dtype ${o}`);let f=new l(i);for(let p=0;p<i;p++){let m=Number(u.iget(p));if(m<0||m>=n)throw new Error(`index ${m} is out of bounds for axis 0 with size ${n}`);let y=s[m].iget(p);w(o),f[p]=y}return D.fromData(f,c,o)}function Jt(r,t,e=!1){if(r.ndim!==t.ndim)return!1;for(let o=0;o<r.ndim;o++)if(r.shape[o]!==t.shape[o])return!1;let n=r.size;for(let o=0;o<n;o++){let a=r.iget(o),c=t.iget(o);if(e){let u=typeof a=="number"&&Number.isNaN(a),s=typeof c=="number"&&Number.isNaN(c);if(u&&s)continue}if(a!==c)return!1}return!0}var z=class r{constructor(t,e){this._storage=t,this._base=e}get storage(){return this._storage}static _fromStorage(t,e){return new r(t,e)}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(t){if(t.length!==this.ndim)throw new Error(`Index has ${t.length} dimensions, but array has ${this.ndim} dimensions`);let e=t.map((n,o)=>{let a=n;if(a<0&&(a=this.shape[o]+a),a<0||a>=this.shape[o])throw new Error(`Index ${n} is out of bounds for axis ${o} with size ${this.shape[o]}`);return a});return this._storage.get(...e)}set(t,e){if(t.length!==this.ndim)throw new Error(`Index has ${t.length} dimensions, but array has ${this.ndim} dimensions`);let n=t.map((c,u)=>{let s=c;if(s<0&&(s=this.shape[u]+s),s<0||s>=this.shape[u])throw new Error(`Index ${c} is out of bounds for axis ${u} with size ${this.shape[u]}`);return s}),o=this.dtype,a;w(o)?a=typeof e=="bigint"?e:BigInt(Math.round(e)):o==="bool"?a=e?1:0:a=Number(e),this._storage.set(n,a)}copy(){return new r(this._storage.copy())}astype(t,e=!0){let n=this.dtype;if(n===t&&!e)return this;if(n===t&&e)return this.copy();let o=Array.from(this.shape),a=this.size,c=B(t);if(!c)throw new Error(`Cannot convert to dtype ${t}`);let u=new c(a),s=this.data;if(w(n)&&!w(t)){let l=s;if(t==="bool")for(let f=0;f<a;f++)u[f]=l[f]!==BigInt(0)?1:0;else for(let f=0;f<a;f++)u[f]=Number(l[f])}else if(!w(n)&&w(t)){let l=s;for(let f=0;f<a;f++)u[f]=BigInt(Math.round(Number(l[f])))}else if(t==="bool"){let l=s;for(let f=0;f<a;f++)u[f]=l[f]!==0?1:0}else if(n==="bool"&&!w(t)){let l=s;for(let f=0;f<a;f++)u[f]=l[f]}else if(!w(n)&&!w(t)){let l=s;for(let f=0;f<a;f++)u[f]=l[f]}else{let l=s;for(let f=0;f<a;f++)u[f]=l[f]}let i=D.fromData(u,o,t);return new r(i)}add(t){let e=typeof t=="number"?t:t._storage,n=qr(this._storage,e);return r._fromStorage(n)}subtract(t){let e=typeof t=="number"?t:t._storage,n=Zr(this._storage,e);return r._fromStorage(n)}multiply(t){let e=typeof t=="number"?t:t._storage,n=Hr(this._storage,e);return r._fromStorage(n)}divide(t){let e=typeof t=="number"?t:t._storage,n=Yr(this._storage,e);return r._fromStorage(n)}mod(t){let e=typeof t=="number"?t:t._storage,n=Xr(this._storage,e);return r._fromStorage(n)}floor_divide(t){let e=typeof t=="number"?t:t._storage,n=Qr(this._storage,e);return r._fromStorage(n)}positive(){let t=Kr(this._storage);return r._fromStorage(t)}reciprocal(){let t=rt(this._storage);return r._fromStorage(t)}sqrt(){let t=Bt(this._storage);return r._fromStorage(t)}power(t){let e=typeof t=="number"?t:t._storage,n=Ut(this._storage,e);return r._fromStorage(n)}absolute(){let t=Wr(this._storage);return r._fromStorage(t)}negative(){let t=Gr(this._storage);return r._fromStorage(t)}sign(){let t=Jr(this._storage);return r._fromStorage(t)}sin(){let t=_t(this._storage);return r._fromStorage(t)}cos(){let t=Et(this._storage);return r._fromStorage(t)}tan(){let t=Tt(this._storage);return r._fromStorage(t)}arcsin(){let t=Ot(this._storage);return r._fromStorage(t)}arccos(){let t=$t(this._storage);return r._fromStorage(t)}arctan(){let t=Mt(this._storage);return r._fromStorage(t)}arctan2(t){let e=typeof t=="number"?t:t._storage,n=Ct(this._storage,e);return r._fromStorage(n)}hypot(t){let e=typeof t=="number"?t:t._storage,n=kt(this._storage,e);return r._fromStorage(n)}degrees(){let t=vt(this._storage);return r._fromStorage(t)}radians(){let t=Vt(this._storage);return r._fromStorage(t)}sinh(){let t=Pt(this._storage);return r._fromStorage(t)}cosh(){let t=Ft(this._storage);return r._fromStorage(t)}tanh(){let t=Rt(this._storage);return r._fromStorage(t)}arcsinh(){let t=Lt(this._storage);return r._fromStorage(t)}arccosh(){let t=jt(this._storage);return r._fromStorage(t)}arctanh(){let t=qt(this._storage);return r._fromStorage(t)}greater(t){let e=typeof t=="number"?t:t._storage,n=tt(this._storage,e);return r._fromStorage(n)}greater_equal(t){let e=typeof t=="number"?t:t._storage,n=et(this._storage,e);return r._fromStorage(n)}less(t){let e=typeof t=="number"?t:t._storage,n=nt(this._storage,e);return r._fromStorage(n)}less_equal(t){let e=typeof t=="number"?t:t._storage,n=ot(this._storage,e);return r._fromStorage(n)}equal(t){let e=typeof t=="number"?t:t._storage,n=at(this._storage,e);return r._fromStorage(n)}not_equal(t){let e=typeof t=="number"?t:t._storage,n=st(this._storage,e);return r._fromStorage(n)}isclose(t,e=1e-5,n=1e-8){let o=typeof t=="number"?t:t._storage,a=yr(this._storage,o,e,n);return r._fromStorage(a)}allclose(t,e=1e-5,n=1e-8){let o=typeof t=="number"?t:t._storage;return it(this._storage,o,e,n)}sum(t,e=!1){let n=H(this._storage,t,e);return typeof n=="number"?n:r._fromStorage(n)}mean(t,e=!1){let n=mr(this._storage,t,e);return typeof n=="number"?n:r._fromStorage(n)}max(t,e=!1){let n=dr(this._storage,t,e);return typeof n=="number"?n:r._fromStorage(n)}min(t,e=!1){let n=hr(this._storage,t,e);return typeof n=="number"?n:r._fromStorage(n)}prod(t,e=!1){let n=gr(this._storage,t,e);return typeof n=="number"?n:r._fromStorage(n)}argmin(t){let e=Ar(this._storage,t);return typeof e=="number"?e:r._fromStorage(e)}argmax(t){let e=br(this._storage,t);return typeof e=="number"?e:r._fromStorage(e)}var(t,e=0,n=!1){let o=Sr(this._storage,t,e,n);return typeof o=="number"?o:r._fromStorage(o)}std(t,e=0,n=!1){let o=ut(this._storage,t,e,n);return typeof o=="number"?o:r._fromStorage(o)}all(t,e=!1){let n=Dr(this._storage,t,e);return typeof n=="boolean"?n:r._fromStorage(n)}any(t,e=!1){let n=wr(this._storage,t,e);return typeof n=="boolean"?n:r._fromStorage(n)}reshape(...t){let e=t.length===1&&Array.isArray(t[0])?t[0]:t,n=j(this._storage,e),a=n.data===this.data?this._base??this:void 0;return r._fromStorage(n,a)}flatten(){let t=Nr(this._storage);return r._fromStorage(t)}ravel(){let t=W(this._storage),n=t.data===this.data?this._base??this:void 0;return r._fromStorage(t,n)}transpose(t){let e=nr(this._storage,t),n=this._base??this;return r._fromStorage(e,n)}squeeze(t){let e=ct(this._storage,t),n=this._base??this;return r._fromStorage(e,n)}expand_dims(t){let e=Y(this._storage,t),n=this._base??this;return r._fromStorage(e,n)}swapaxes(t,e){let n=lt(this._storage,t,e),o=this._base??this;return r._fromStorage(n,o)}moveaxis(t,e){let n=ft(this._storage,t,e),o=this._base??this;return r._fromStorage(n,o)}repeat(t,e){let n=Dt(this._storage,t,e);return r._fromStorage(n)}take(t,e){let n=Yt(this._storage,t,e);return r._fromStorage(n)}put(t,e){let n=e instanceof r?e._storage:e;Wt(this._storage,t,n)}matmul(t){let e=Ir(this._storage,t._storage);return r._fromStorage(e)}dot(t){let e=xr(this._storage,t._storage);return typeof e=="number"||typeof e=="bigint"?e:r._fromStorage(e)}trace(){return Nt(this._storage)}inner(t){let e=xt(this._storage,t._storage);return typeof e=="number"||typeof e=="bigint"?e:r._fromStorage(e)}outer(t){let e=It(this._storage,t._storage);return r._fromStorage(e)}tensordot(t,e=2){let n=zt(this._storage,t._storage,e);return typeof n=="number"||typeof n=="bigint"?n:r._fromStorage(n)}slice(...t){if(t.length===0)return this;if(t.length>this.ndim)throw new Error(`Too many indices for array: array is ${this.ndim}-dimensional, but ${t.length} were indexed`);let e=t.map((s,i)=>{let l=Pr(s);return Fr(l,this.shape[i])});for(;e.length<this.ndim;)e.push({start:0,stop:this.shape[e.length],step:1,isIndex:!1});let n=[],o=[],a=this._storage.offset;for(let s=0;s<e.length;s++){let i=e[s],l=this._storage.strides[s];if(a+=i.start*l,!i.isIndex){let f;i.step>0?f=Math.max(0,Math.ceil((i.stop-i.start)/i.step)):f=Math.max(0,Math.ceil((i.start-i.stop)/Math.abs(i.step))),n.push(f),o.push(l*i.step)}}let c=D.fromData(this._storage.data,n,this._storage.dtype,o,a),u=this._base??this;return new r(c,u)}row(t){if(this.ndim<2)throw new Error("row() requires at least 2 dimensions");return this.slice(String(t),":")}col(t){if(this.ndim<2)throw new Error("col() requires at least 2 dimensions");return this.slice(":",String(t))}rows(t,e){if(this.ndim<2)throw new Error("rows() requires at least 2 dimensions");return this.slice(`${t}:${e}`,":")}cols(t,e){if(this.ndim<2)throw new Error("cols() requires at least 2 dimensions");return this.slice(":",`${t}:${e}`)}toString(){return`NDArray(shape=${JSON.stringify(this.shape)}, dtype=${this.dtype})`}toArray(){if(this.ndim===0)return this._storage.iget(0);let t=this.shape,e=t.length,n=(o,a)=>{if(a===e)return this._storage.get(...o);let c=[];for(let u=0;u<t[a];u++)o[a]=u,c.push(n(o,a+1));return c};return n(new Array(e),0)}};function J(r,t=M){let e=D.zeros(r,t);return new z(e)}function zr(r,t=M){let e=D.ones(r,t);return new z(e)}function oo(r){let t=[],e=r;for(;Array.isArray(e);)t.push(e.length),e=e[0];return t}function Xt(r){return typeof r=="bigint"?!0:Array.isArray(r)?r.some(t=>Xt(t)):!1}function ao(r){let t=[];function e(n){Array.isArray(n)?n.forEach(o=>e(o)):t.push(n)}return e(r),t}function V(r,t){if(r instanceof z)return!t||r.dtype===t?r.copy():r.astype(t);let e=Xt(r),n=oo(r),o=n.reduce((l,f)=>l*f,1),a=t;a||(e?a="int64":a=M);let c=B(a);if(!c)throw new Error(`Cannot create array with dtype ${a}`);let u=new c(o),s=ao(r);if(w(a)){let l=u;for(let f=0;f<o;f++){let p=s[f];l[f]=typeof p=="bigint"?p:BigInt(Math.round(Number(p)))}}else if(a==="bool"){let l=u;for(let f=0;f<o;f++)l[f]=s[f]?1:0}else{let l=u;for(let f=0;f<o;f++){let p=s[f];l[f]=Number(p)}}let i=D.fromData(u,n,a);return new z(i)}function Qt(r,t,e=1,n=M){let o=r,a=t;if(t===void 0&&(o=0,a=r),a===void 0)throw new Error("stop is required");let c=Math.max(0,Math.ceil((a-o)/e)),u=B(n);if(!u)throw new Error(`Cannot create arange array with dtype ${n}`);let s=new u(c);if(w(n))for(let l=0;l<c;l++)s[l]=BigInt(Math.round(o+l*e));else if(n==="bool")for(let l=0;l<c;l++)s[l]=o+l*e!==0?1:0;else for(let l=0;l<c;l++)s[l]=o+l*e;let i=D.fromData(s,[c],n);return new z(i)}function Kt(r,t,e=50,n=M){if(e<0)throw new Error("num must be non-negative");if(e===0)return V([],n);if(e===1)return V([r],n);let o=B(n);if(!o)throw new Error(`Cannot create linspace array with dtype ${n}`);let a=new o(e),c=(t-r)/(e-1);if(w(n))for(let s=0;s<e;s++)a[s]=BigInt(Math.round(r+s*c));else if(n==="bool")for(let s=0;s<e;s++)a[s]=r+s*c!==0?1:0;else for(let s=0;s<e;s++)a[s]=r+s*c;let u=D.fromData(a,[e],n);return new z(u)}function re(r,t,e=50,n=10,o=M){if(e<0)throw new Error("num must be non-negative");if(e===0)return V([],o);if(e===1)return V([Math.pow(n,r)],o);let a=B(o);if(!a)throw new Error(`Cannot create logspace array with dtype ${o}`);let c=new a(e),u=(t-r)/(e-1);if(w(o))for(let i=0;i<e;i++){let l=r+i*u;c[i]=BigInt(Math.round(Math.pow(n,l)))}else if(o==="bool")for(let i=0;i<e;i++){let l=r+i*u;c[i]=Math.pow(n,l)!==0?1:0}else for(let i=0;i<e;i++){let l=r+i*u;c[i]=Math.pow(n,l)}let s=D.fromData(c,[e],o);return new z(s)}function te(r,t,e=50,n=M){if(e<0)throw new Error("num must be non-negative");if(r===0||t===0)throw new Error("Geometric sequence cannot include zero");if(e===0)return V([],n);if(e===1)return V([r],n);let o=Math.sign(r),a=Math.sign(t);if(o!==a)throw new Error("Geometric sequence cannot contain both positive and negative values");let c=B(n);if(!c)throw new Error(`Cannot create geomspace array with dtype ${n}`);let u=new c(e),s=Math.log(Math.abs(r)),l=(Math.log(Math.abs(t))-s)/(e-1);if(w(n))for(let p=0;p<e;p++){let m=o*Math.exp(s+p*l);u[p]=BigInt(Math.round(m))}else if(n==="bool")for(let p=0;p<e;p++){let m=o*Math.exp(s+p*l);u[p]=m!==0?1:0}else for(let p=0;p<e;p++){let m=o*Math.exp(s+p*l);u[p]=m}let f=D.fromData(u,[e],n);return new z(f)}function Br(r,t,e=0,n=M){let o=t??r,a=J([r,o],n),c=a.data;if(w(n)){let u=c;for(let s=0;s<r;s++){let i=s+e;i>=0&&i<o&&(u[s*o+i]=BigInt(1))}}else{let u=c;for(let s=0;s<r;s++){let i=s+e;i>=0&&i<o&&(u[s*o+i]=1)}}return a}function Ur(r,t=M){return J(r,t)}function _r(r,t,e){let n=e;n||(typeof t=="bigint"?n="int64":typeof t=="boolean"?n="bool":Number.isInteger(t)?n="int32":n=M);let o=B(n);if(!o)throw new Error(`Cannot create full array with dtype ${n}`);let a=r.reduce((s,i)=>s*i,1),c=new o(a);if(w(n)){let s=typeof t=="bigint"?t:BigInt(Math.round(Number(t)));c.fill(s)}else n==="bool"?c.fill(t?1:0):c.fill(Number(t));let u=D.fromData(c,r,n);return new z(u)}function ee(r,t=M){return Br(r,r,0,t)}function ne(r,t){return r instanceof z?!t||r.dtype===t?r:r.astype(t):V(r,t)}function oe(r){return r.copy()}function ae(r,t){return J(Array.from(r.shape),t??r.dtype)}function se(r,t){return zr(Array.from(r.shape),t??r.dtype)}function ie(r,t){return Ur(Array.from(r.shape),t??r.dtype)}function ue(r,t,e){return _r(Array.from(r.shape),t,e??r.dtype)}function ce(r){return r.sqrt()}function le(r,t){return r.power(t)}function fe(r){return r.absolute()}function pe(r){return r.negative()}function ye(r){return r.sign()}function me(r,t){return r.mod(t)}function de(r,t){return r.floor_divide(t)}function ge(r){return r.positive()}function he(r){return r.reciprocal()}function Ae(r,t){return r.dot(t)}function be(r){return r.trace()}function Se(r,t){return r.transpose(t)}function De(r,t){return r.inner(t)}function we(r,t){return r.outer(t)}function Ne(r,t,e=2){return r.tensordot(t,e)}function xe(r){return r.sin()}function Ie(r){return r.cos()}function ze(r){return r.tan()}function Be(r){return r.arcsin()}function Ue(r){return r.arccos()}function _e(r){return r.arctan()}function Ee(r,t){return r.arctan2(t)}function Te(r,t){return r.hypot(t)}function Oe(r){return r.degrees()}function $e(r){return r.radians()}function Me(r){return r.sinh()}function Ce(r){return r.cosh()}function ke(r){return r.tanh()}function ve(r){return r.arcsinh()}function Ve(r){return r.arccosh()}function Pe(r){return r.arctanh()}function Fe(r,t,e){return r.swapaxes(t,e)}function Re(r,t,e){return r.moveaxis(t,e)}function Le(r,t=0){if(r.length===0)throw new Error("need at least one array to concatenate");let e=r.map(o=>o.storage),n=R(e,t);return z._fromStorage(n)}function je(r,t=0){if(r.length===0)throw new Error("need at least one array to stack");let e=r.map(o=>o.storage),n=pt(e,t);return z._fromStorage(n)}function qe(r){if(r.length===0)throw new Error("need at least one array to stack");let t=r.map(n=>n.storage),e=yt(t);return z._fromStorage(e)}function Ze(r){if(r.length===0)throw new Error("need at least one array to stack");let t=r.map(n=>n.storage),e=mt(t);return z._fromStorage(e)}function He(r){if(r.length===0)throw new Error("need at least one array to stack");let t=r.map(n=>n.storage),e=dt(t);return z._fromStorage(e)}function Ye(r,t,e=0){return gt(r.storage,t,e).map(o=>z._fromStorage(o,r.base??r))}function We(r,t,e=0){return or(r.storage,t,e).map(o=>z._fromStorage(o,r.base??r))}function Ge(r,t){return At(r.storage,t).map(n=>z._fromStorage(n,r.base??r))}function Je(r,t){return bt(r.storage,t).map(n=>z._fromStorage(n,r.base??r))}function Xe(r,t){let e=St(r.storage,t);return z._fromStorage(e)}function Qe(r,t,e){return r.repeat(t,e)}function Ke(r,t){let e=Zt(r.storage,t);return z._fromStorage(e,r.base??r)}function rn(...r){let t=r.map(n=>n.storage);return Ht(t).map((n,o)=>z._fromStorage(n,r[o].base??r[o]))}function tn(r,t,e){return r.take(t,e)}function en(r,t,e){r.put(t,e)}function nn(r,t){let e=t.map(o=>o.storage),n=Gt(r.storage,e);return z._fromStorage(n)}function on(r,t,e=!1){return Jt(r.storage,t.storage,e)}var X=new Uint8Array([147,78,85,77,80,89]),sr=["float64","float32","int64","int32","int16","int8","uint64","uint32","uint16","uint8","bool"];function Er(){let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256}var so={f8:"float64",f4:"float32",i8:"int64",i4:"int32",i2:"int16",i1:"int8",u8:"uint64",u4:"uint32",u2:"uint16",u1:"uint8",b1:"bool"},Q={float64:"<f8",float32:"<f4",int64:"<i8",int32:"<i4",int16:"<i2",int8:"|i1",uint64:"<u8",uint32:"<u4",uint16:"<u2",uint8:"|u1",bool:"|b1"},an={c:"complex numbers",S:"byte strings",U:"Unicode strings",O:"Python objects",V:"structured arrays (void)",M:"datetime64",m:"timedelta64"};function sn(r){if(r.startsWith("[")||r.startsWith("("))throw new v(`Structured/compound dtypes are not supported: ${r}`);let t="",e=r;(r[0]==="<"||r[0]===">"||r[0]==="="||r[0]==="|")&&(t=r[0],e=r.slice(1));let n=e[0];if(n&&n in an)throw new v(`Unsupported dtype: ${an[n]} (${r}). Use the 'force' parameter to skip arrays with unsupported dtypes.`);let o=so[e];if(!o)throw new v(`Unknown or unsupported dtype descriptor: ${r}. Supported types: ${sr.join(", ")}. Use the 'force' parameter to skip arrays with unsupported dtypes.`);let a=Er(),c=t==="<"||t==="|"||t==="="&&a,u=t===">"||t==="="&&!a,s=parseInt(e.slice(1),10),i=s>1&&(u&&a||c&&!a);return{dtype:o,needsByteSwap:i,itemsize:s}}var v=class extends Error{constructor(t){super(t),this.name="UnsupportedDTypeError"}},C=class extends Error{constructor(t){super(t),this.name="InvalidNpyError"}};function K(r){let t=r instanceof ArrayBuffer?new Uint8Array(r):r,e=ir(t);return ur(t,e)}function ir(r){if(r.length<10)throw new C("File too small to be a valid NPY file");for(let i=0;i<X.length;i++)if(r[i]!==X[i])throw new C("Invalid NPY magic number");let t=r[6],e=r[7];if(t!==1&&t!==2&&t!==3)throw new C(`Unsupported NPY version: ${t}.${e}`);let n,o;t===1?(n=r[8]|r[9]<<8,o=10):(n=r[8]|r[9]<<8|r[10]<<16|r[11]<<24,o=12);let a=o+n;if(r.length<a)throw new C("File truncated: header extends beyond file");let c=r.slice(o,a),u=new TextDecoder("utf-8").decode(c).trim(),s=io(u);return{version:{major:t,minor:e},header:s,dataOffset:a}}function ur(r,t){let{header:e,dataOffset:n}=t,{dtype:o,needsByteSwap:a,itemsize:c}=sn(e.descr),u=e.shape.reduce((d,A)=>d*A,1),s=u*c,i=r.length-n;if(i<s)throw new C(`File truncated: expected ${s} bytes of data, got ${i}`);let l=new ArrayBuffer(s);new Uint8Array(l).set(r.subarray(n,n+s));let p=uo(l,o,u,a,c),m=e.shape,y;if(e.fortran_order&&m.length>1){let d=[...m].reverse(),A=D.fromData(p,d,o);y=co(A,d),m=e.shape}else y=D.fromData(p,[...m],o);return new z(y)}function io(r){let t=r.match(/'descr'\s*:\s*'([^']+)'/),e=r.match(/'fortran_order'\s*:\s*(True|False)/),n=r.match(/'shape'\s*:\s*\(([^)]*)\)/);if(!t||!e||!n)throw new C(`Failed to parse NPY header: ${r}`);let o=t[1],a=e[1]==="True",c=n[1].trim(),u;return c===""?u=[]:u=c.split(",").map(s=>s.trim()).filter(s=>s!=="").map(s=>{let i=parseInt(s,10);if(isNaN(i))throw new C(`Invalid shape value: ${s}`);return i}),{descr:o,fortran_order:a,shape:u}}function uo(r,t,e,n,o){let a=B(t);if(!a)throw new C(`Cannot create array for dtype: ${t}`);if(!n)return new a(r,0,e);let c=new Uint8Array(r),u=new Uint8Array(r.byteLength);for(let s=0;s<e;s++){let i=s*o;for(let l=0;l<o;l++)u[i+l]=c[i+o-1-l]}return new a(u.buffer,0,e)}function co(r,t){let e=t.length,n=r.size,o=r.dtype,a=B(o);if(!a)throw new C(`Cannot create array for dtype: ${o}`);let c=new a(n),u=[...t].reverse(),s=un(t),i=un(u),l=new Array(e).fill(0);for(let f=0;f<n;f++){let p=f;for(let y=0;y<e;y++){let d=s[y];l[y]=Math.floor(p/d),p=p%d}let m=0;for(let y=0;y<e;y++)m+=l[e-1-y]*i[y];w(o),c[m]=r.iget(f)}return D.fromData(c,u,o)}function un(r){let t=new Array(r.length),e=1;for(let n=r.length-1;n>=0;n--)t[n]=e,e*=r[n];return t}function q(r){let t=r.shape,e=r.dtype,n=Q[e],o=t.length===0?"()":t.length===1?`(${t[0]},)`:`(${t.join(", ")})`,a=`{'descr': '${n}', 'fortran_order': False, 'shape': ${o}, }`,c=12,s=(64-(c+a.length+1)%64)%64;a=a+" ".repeat(s)+`
|
|
2
|
+
`;let i=new TextEncoder().encode(a),l=i.length,f=r.size,p=Lr(e),m=f*p,y=c+l+m,d=new Uint8Array(y);d.set(X,0),d[6]=3,d[7]=0,d[8]=l&255,d[9]=l>>8&255,d[10]=l>>16&255,d[11]=l>>24&255,d.set(i,c);let A=c+l;return lo(r,d.subarray(A),p),d}function lo(r,t,e){let n=r.dtype,o=r.size,a=Er(),c=w(n),u=r._storage;if(u.isCContiguous&&u.offset===0&&a){let i=u.data,l=new Uint8Array(i.buffer,i.byteOffset,o*e);t.set(l)}else{let i=new DataView(t.buffer,t.byteOffset,t.byteLength);for(let l=0;l<o;l++){let f=u.iget(l),p=l*e;c?fo(i,p,f,n==="uint64"):po(i,p,f,n)}}}function fo(r,t,e,n){n?r.setBigUint64(t,e,!0):r.setBigInt64(t,e,!0)}function po(r,t,e,n){switch(n){case"float64":r.setFloat64(t,e,!0);break;case"float32":r.setFloat32(t,e,!0);break;case"int32":r.setInt32(t,e,!0);break;case"int16":r.setInt16(t,e,!0);break;case"int8":r.setInt8(t,e);break;case"uint32":r.setUint32(t,e,!0);break;case"uint16":r.setUint16(t,e,!0);break;case"uint8":case"bool":r.setUint8(t,e);break;default:throw new Error(`Unsupported dtype for serialization: ${n}`)}}var yo=(()=>{let r=new Uint32Array(256);for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;r[t]=e}return r})();function Tr(r){let t=4294967295;for(let e=0;e<r.length;e++)t=yo[(t^r[e])&255]^t>>>8;return(t^4294967295)>>>0}async function cn(r){let t=fn(r),e=new Map;for(let n of t){let o=await mo(n);e.set(n.name,o)}return e}function ln(r){let t=fn(r),e=new Map;for(let n of t){if(n.compressionMethod!==0)throw new Error(`Cannot read compressed entry synchronously: ${n.name}. Use readZip() (async) for DEFLATE-compressed files.`);e.set(n.name,n.compressedData)}return e}function fn(r){let t=r instanceof ArrayBuffer?new Uint8Array(r):r,e=new DataView(t.buffer,t.byteOffset,t.byteLength),n=[],o=-1;for(let i=t.length-22;i>=0;i--)if(e.getUint32(i,!0)===101010256){o=i;break}if(o===-1)throw new Error("Invalid ZIP file: end of central directory not found");let a=e.getUint32(o+16,!0),c=e.getUint16(o+10,!0),u=[],s=a;for(let i=0;i<c&&e.getUint32(s,!0)===33639248;i++){let f=e.getUint16(s+10,!0),p=e.getUint32(s+16,!0),m=e.getUint32(s+20,!0),y=e.getUint32(s+24,!0),d=e.getUint16(s+28,!0),A=e.getUint16(s+30,!0),h=e.getUint16(s+32,!0),g=e.getUint32(s+42,!0),b=t.slice(s+46,s+46+d),S=new TextDecoder("utf-8").decode(b);u.push({name:S,compressionMethod:f,crc32:p,compressedSize:m,uncompressedSize:y,localHeaderOffset:g}),s=s+46+d+A+h}for(let i of u){let l=i.localHeaderOffset;if(e.getUint32(l,!0)!==67324752)throw new Error(`Invalid local file header at offset ${l}`);let p=e.getUint16(l+26,!0),m=e.getUint16(l+28,!0),y=l+30+p+m,d=t.slice(y,y+i.compressedSize);n.push({name:i.name,compressedData:d,compressionMethod:i.compressionMethod,crc32:i.crc32,compressedSize:i.compressedSize,uncompressedSize:i.uncompressedSize})}return n}async function mo(r){if(r.compressionMethod===0)return r.compressedData;if(r.compressionMethod===8)return await go(r.compressedData);throw new Error(`Unsupported compression method: ${r.compressionMethod}`)}async function go(r){if(typeof DecompressionStream>"u")throw new Error("DecompressionStream is not available. This environment does not support the Compression Streams API. Please use a modern browser or Node.js 18+.");let t=new DecompressionStream("deflate-raw"),e=new Uint8Array(r.length);e.set(r);let n=t.writable.getWriter();n.write(e),n.close();let o=t.readable.getReader(),a=[];for(;;){let{done:i,value:l}=await o.read();if(i)break;a.push(l)}let c=a.reduce((i,l)=>i+l.length,0),u=new Uint8Array(c),s=0;for(let i of a)u.set(i,s),s+=i.length;return u}async function cr(r,t={}){let e=t.force??!1,n=await cn(r);return pn(n,e)}function lr(r,t={}){let e=t.force??!1,n=ln(r);return pn(n,e)}function pn(r,t){let e=new Map,n=[],o=new Map;for(let[a,c]of r){if(!a.endsWith(".npy"))continue;let u=a.slice(0,-4);try{let s=K(c);e.set(u,s)}catch(s){if(s instanceof v&&t)n.push(u),o.set(u,s.message);else throw s}}return{arrays:e,skipped:n,errors:o}}async function Mr(r,t={}){let e=await cr(r,t);return Object.fromEntries(e.arrays)}function Cr(r,t={}){let e=lr(r,t);return Object.fromEntries(e.arrays)}async function yn(r,t={}){let e=t.compress??!1,n=[];for(let[p,m]of r){let y=Tr(m),d,A;e?(d=await Ao(m),d.length<m.length?A=8:(d=m,A=0)):(d=m,A=0),n.push({name:p,data:m,compressedData:d,crc:y,compressionMethod:A,offset:0})}let o=0;for(let p of n){let m=new TextEncoder().encode(p.name);o+=30+m.length+p.compressedData.length}let a=0;for(let p of n){let m=new TextEncoder().encode(p.name);a+=46+m.length}let u=o+a+22,s=new Uint8Array(u),i=new DataView(s.buffer),l=0;for(let p of n)p.offset=l,l=dn(s,i,l,p);let f=l;for(let p of n)l=gn(s,i,l,p);return hn(i,l,n.length,a,f),s}function mn(r){let t=[];for(let[l,f]of r){let p=Tr(f);t.push({name:l,data:f,compressedData:f,crc:p,compressionMethod:0,offset:0})}let e=0;for(let l of t){let f=new TextEncoder().encode(l.name);e+=30+f.length+l.compressedData.length}let n=0;for(let l of t){let f=new TextEncoder().encode(l.name);n+=46+f.length}let a=e+n+22,c=new Uint8Array(a),u=new DataView(c.buffer),s=0;for(let l of t)l.offset=s,s=dn(c,u,s,l);let i=s;for(let l of t)s=gn(c,u,s,l);return hn(u,s,t.length,n,i),c}function dn(r,t,e,n){let o=new TextEncoder().encode(n.name);return t.setUint32(e,67324752,!0),e+=4,t.setUint16(e,n.compressionMethod===8?20:10,!0),e+=2,t.setUint16(e,0,!0),e+=2,t.setUint16(e,n.compressionMethod,!0),e+=2,t.setUint16(e,0,!0),e+=2,t.setUint16(e,33,!0),e+=2,t.setUint32(e,n.crc,!0),e+=4,t.setUint32(e,n.compressedData.length,!0),e+=4,t.setUint32(e,n.data.length,!0),e+=4,t.setUint16(e,o.length,!0),e+=2,t.setUint16(e,0,!0),e+=2,r.set(o,e),e+=o.length,r.set(n.compressedData,e),e+=n.compressedData.length,e}function gn(r,t,e,n){let o=new TextEncoder().encode(n.name);return t.setUint32(e,33639248,!0),e+=4,t.setUint16(e,20,!0),e+=2,t.setUint16(e,n.compressionMethod===8?20:10,!0),e+=2,t.setUint16(e,0,!0),e+=2,t.setUint16(e,n.compressionMethod,!0),e+=2,t.setUint16(e,0,!0),e+=2,t.setUint16(e,33,!0),e+=2,t.setUint32(e,n.crc,!0),e+=4,t.setUint32(e,n.compressedData.length,!0),e+=4,t.setUint32(e,n.data.length,!0),e+=4,t.setUint16(e,o.length,!0),e+=2,t.setUint16(e,0,!0),e+=2,t.setUint16(e,0,!0),e+=2,t.setUint16(e,0,!0),e+=2,t.setUint16(e,0,!0),e+=2,t.setUint32(e,0,!0),e+=4,t.setUint32(e,n.offset,!0),e+=4,r.set(o,e),e+=o.length,e}function hn(r,t,e,n,o){r.setUint32(t,101010256,!0),t+=4,r.setUint16(t,0,!0),t+=2,r.setUint16(t,0,!0),t+=2,r.setUint16(t,e,!0),t+=2,r.setUint16(t,e,!0),t+=2,r.setUint32(t,n,!0),t+=4,r.setUint32(t,o,!0),t+=4,r.setUint16(t,0,!0)}async function Ao(r){if(typeof CompressionStream>"u")throw new Error("CompressionStream is not available. This environment does not support the Compression Streams API. Please use a modern browser or Node.js 18+.");let t=new CompressionStream("deflate-raw"),e=new Uint8Array(r.length);e.set(r);let n=t.writable.getWriter();n.write(e),n.close();let o=t.readable.getReader(),a=[];for(;;){let{done:i,value:l}=await o.read();if(i)break;a.push(l)}let c=a.reduce((i,l)=>i+l.length,0),u=new Uint8Array(c),s=0;for(let i of a)u.set(i,s),s+=i.length;return u}async function kr(r,t={}){let e=An(r);return yn(e,{compress:t.compress??!1})}function vr(r){let t=An(r);return mn(t)}function An(r){let t=new Map;if(Array.isArray(r)){for(let n=0;n<r.length;n++){let o=r[n],a=q(o);t.set(`arr_${n}.npy`,a)}return t}let e=r instanceof Map?r.entries():Object.entries(r);for(let[n,o]of e){if(typeof n!="string"||n.length===0)throw new Error("Array names must be non-empty strings");let a=q(o),c=n.endsWith(".npy")?n:`${n}.npy`;t.set(c,a)}return t}var bo="0.5.0";0&&(module.exports={DTYPE_TO_DESCR,InvalidNpyError,NDArray,SUPPORTED_DTYPES,UnsupportedDTypeError,__version__,absolute,arange,arccos,arccosh,arcsin,arcsinh,arctan,arctan2,arctanh,array,array_equal,array_split,asarray,broadcast_arrays,broadcast_to,choose,concatenate,copy,cos,cosh,degrees,dot,dstack,empty,empty_like,eye,floor_divide,full,full_like,geomspace,hsplit,hstack,hypot,identity,inner,linspace,loadNpz,loadNpzSync,logspace,mod,moveaxis,negative,ones,ones_like,outer,parseNpy,parseNpyData,parseNpyHeader,parseNpz,parseNpzSync,positive,power,put,radians,reciprocal,repeat,serializeNpy,serializeNpz,serializeNpzSync,sign,sin,sinh,split,sqrt,stack,swapaxes,take,tan,tanh,tensordot,tile,trace,transpose,vsplit,vstack,zeros,zeros_like});
|
|
413
3
|
//# sourceMappingURL=numpy-ts.node.cjs.map
|