@stdlib/array-to-fancy 0.1.1 → 0.2.1

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/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2024 The Stdlib Authors.
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -50,7 +50,7 @@ var x = [ 1, 2, 3, 4, 5, 6, 7, 8 ];
50
50
  // Turn the plain array into a "fancy" array:
51
51
  var y = array2fancy( x );
52
52
 
53
- // Select the first 3 elements:
53
+ // Select the first three elements:
54
54
  var v = y[ ':3' ];
55
55
  // returns [ 1, 2, 3 ]
56
56
 
@@ -58,7 +58,7 @@ var v = y[ ':3' ];
58
58
  v = y[ '1::2' ];
59
59
  // returns [ 2, 4, 6, 8 ]
60
60
 
61
- // Select every other element, in reverse order, starting with the least element:
61
+ // Select every other element, in reverse order, starting with the last element:
62
62
  v = y[ '::-2' ];
63
63
  // returns [ 8, 6, 4, 2 ]
64
64
 
@@ -395,6 +395,24 @@ y[ '10:20' ] = [ 8, 9, 10, 11 ];
395
395
  // throws <Error>
396
396
  ```
397
397
 
398
+ In order to broadcast a nested array element as one would a scalar, one must wrap the element in a single-element array.
399
+
400
+ ```javascript
401
+ var y = array2fancy( [ [ 1, 2 ], [ 3, 4 ] ] );
402
+
403
+ // Assign individual array elements:
404
+ y[ ':' ] = [ 5, 6 ];
405
+ var v = y[ ':' ];
406
+ // returns [ 5, 6 ]
407
+
408
+ y = array2fancy( [ [ 1, 2 ], [ 3, 4 ] ] );
409
+
410
+ // Broadcast a nested array:
411
+ y[ ':' ] = [ [ 5, 6 ] ];
412
+ v = y[ ':' ];
413
+ // returns [ [ 5, 6 ], [ 5, 6 ] ]
414
+ ```
415
+
398
416
  ### Casting
399
417
 
400
418
  Fancy arrays support [(mostly) safe casts][@stdlib/array/mostly-safe-casts] (i.e., any cast which can be performed without overflow or loss of precision, with the exception of floating-point arrays which are also allowed to downcast from higher precision to lower precision).
@@ -433,8 +451,8 @@ When assigning a real-valued scalar to a complex number array (e.g., [`Complex12
433
451
 
434
452
  ```javascript
435
453
  var Complex128Array = require( '@stdlib/array-complex128' );
436
- var real = require( '@stdlib/complex-real' );
437
- var imag = require( '@stdlib/complex-imag' );
454
+ var real = require( '@stdlib/complex-float64-real' );
455
+ var imag = require( '@stdlib/complex-float64-imag' );
438
456
 
439
457
  var x = new Complex128Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ] );
440
458
  var y = array2fancy( x );
@@ -479,6 +497,7 @@ im = imag( v );
479
497
  ```javascript
480
498
  var Uint8Array = require( '@stdlib/array-uint8' );
481
499
  var Int32Array = require( '@stdlib/array-int32' );
500
+ var BooleanArray = require( '@stdlib/array-bool' );
482
501
  var array2fancy = require( '@stdlib/array-to-fancy' );
483
502
 
484
503
  var x = [ 1, 2, 3, 4, 5, 6 ];
@@ -515,6 +534,10 @@ i = idx( [ true, false, false, true, true, true ] ); // boolean array
515
534
  z = y[ i ];
516
535
  // returns [ 1, -9, -8, 6 ]
517
536
 
537
+ i = idx( new BooleanArray( [ true, false, false, true, true, true ] ) ); // boolean array
538
+ z = y[ i ];
539
+ // returns [ 1, -9, -8, 6 ]
540
+
518
541
  i = idx( new Uint8Array( [ 0, 0, 1, 0, 0, 1 ] ) ); // mask array
519
542
  z = y[ i ];
520
543
  // returns [ 1, 2, -9, -8 ]
@@ -522,6 +545,35 @@ z = y[ i ];
522
545
  i = idx( new Int32Array( [ 0, 0, 1, 1, 2, 2 ] ) ); // integer index array
523
546
  z = y[ i ];
524
547
  // returns [ 1, 1, 2, 2, -10, -10 ]
548
+
549
+ // Array index assignment:
550
+ x = [ 1, 2, 3, 4, 5, 6 ];
551
+ y = array2fancy( x );
552
+
553
+ i = idx( [ true, false, true, false, true, false ] ); // boolean array
554
+ y[ i ] = 5;
555
+ z = y[ ':' ];
556
+ // returns [ 5, 2, 5, 4, 5, 6 ]
557
+
558
+ i = idx( new BooleanArray( [ true, false, true, false, true, false ] ) ); // boolean array
559
+ y[ i ] = 7;
560
+ z = y[ ':' ];
561
+ // returns [ 7, 2, 7, 4, 7, 6 ]
562
+
563
+ i = idx( new Uint8Array( [ 1, 1, 1, 0, 0, 0 ] ) ); // mask array
564
+ y[ i ] = 8;
565
+ z = y[ ':' ];
566
+ // returns [ 7, 2, 7, 8, 8, 8 ]
567
+
568
+ i = idx( new Int32Array( [ 5, 3, 2 ] ) ); // integer index array
569
+ y[ i ] = [ 9, 10, 11 ];
570
+ z = y[ ':' ];
571
+ // returns [ 7, 2, 11, 10, 8, 9 ]
572
+
573
+ i = idx( [ 0, 1 ] ); // integer index array
574
+ y[ i ] = -1;
575
+ z = y[ ':' ];
576
+ // returns [ -1, -1, 11, 10, 8, 9 ]
525
577
  ```
526
578
 
527
579
  </section>
@@ -577,7 +629,7 @@ See [LICENSE][stdlib-license].
577
629
 
578
630
  ## Copyright
579
631
 
580
- Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
632
+ Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].
581
633
 
582
634
  </section>
583
635
 
@@ -590,8 +642,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
590
642
  [npm-image]: http://img.shields.io/npm/v/@stdlib/array-to-fancy.svg
591
643
  [npm-url]: https://npmjs.org/package/@stdlib/array-to-fancy
592
644
 
593
- [test-image]: https://github.com/stdlib-js/array-to-fancy/actions/workflows/test.yml/badge.svg?branch=v0.1.1
594
- [test-url]: https://github.com/stdlib-js/array-to-fancy/actions/workflows/test.yml?query=branch:v0.1.1
645
+ [test-image]: https://github.com/stdlib-js/array-to-fancy/actions/workflows/test.yml/badge.svg?branch=v0.2.1
646
+ [test-url]: https://github.com/stdlib-js/array-to-fancy/actions/workflows/test.yml?query=branch:v0.2.1
595
647
 
596
648
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/array-to-fancy/main.svg
597
649
  [coverage-url]: https://codecov.io/github/stdlib-js/array-to-fancy?branch=main
@@ -603,8 +655,8 @@ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
603
655
 
604
656
  -->
605
657
 
606
- [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
607
- [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
658
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
659
+ [chat-url]: https://stdlib.zulipchat.com
608
660
 
609
661
  [stdlib]: https://github.com/stdlib-js/stdlib
610
662
 
package/dist/index.js CHANGED
@@ -1,57 +1,59 @@
1
- "use strict";var u=function(r,i){return function(){return i||r((i={exports:{}}).exports,i),i.exports}};var S=u(function(At,b){
2
- var Ar=require('@stdlib/array-base-assert-is-complex-floating-point-data-type/dist'),xr=require('@stdlib/assert-is-number/dist').isPrimitive;function Tr(r){return xr(r)?[r,0]:r}function Rr(r){return Ar(r)?Tr:null}b.exports=Rr
3
- });var A=u(function(xt,I){
4
- function Dr(r,i){return a;function a(t){return r(t,i)}}I.exports=Dr
5
- });var T=u(function(Tt,x){
6
- var kr=require('@stdlib/proxy-ctor/dist'),_r=typeof kr=="function";x.exports=_r
7
- });var D=u(function(Rt,R){
8
- var Pr=require('@stdlib/array-index/dist');function Nr(){return{cache:Pr,strict:!1}}R.exports=Nr
9
- });var P=u(function(Dt,_){
10
- var Vr=require('@stdlib/assert-is-plain-object/dist'),k=require('@stdlib/assert-has-own-property/dist'),Ur=require('@stdlib/assert-is-boolean/dist').isPrimitive,Cr=require('@stdlib/assert-is-method-in/dist'),y=require('@stdlib/error-tools-fmtprodmsg/dist');function Or(r,i){return Vr(i)?k(i,"strict")&&(r.strict=i.strict,!Ur(r.strict))?new TypeError(y('1rX2o',"strict",r.strict)):k(i,"cache")&&(r.cache=i.cache,!Cr(r.cache,"get"))?new TypeError(y('1rXFb',"cache","get",r.cache)):null:new TypeError(y('1rX2V',i));}_.exports=Or
11
- });var C=u(function(kt,U){
12
- var l=require('@stdlib/assert-is-number/dist').isPrimitive,Gr=require('@stdlib/assert-is-integer/dist').isPrimitive,f=require('@stdlib/assert-is-complex-like/dist'),Fr=require('@stdlib/array-base-assert-is-real-floating-point-data-type/dist'),Lr=require('@stdlib/array-base-assert-is-unsigned-integer-data-type/dist'),jr=require('@stdlib/array-base-assert-is-signed-integer-data-type/dist'),N=require('@stdlib/array-base-assert-is-safe-data-type-cast/dist'),V=require('@stdlib/array-min-dtype/dist'),Br=require('@stdlib/array-base-min-signed-integer-dtype/dist'),d=require('@stdlib/complex-dtype/dist'),c=require('@stdlib/error-tools-fmtprodmsg/dist');function Mr(){return null}function Wr(r,i){return l(r)?null:f(r)?new TypeError(c('1rXEw',d(r),i)):new TypeError(c('1rXEw',typeof r,i));}function zr(r,i){return l(r)||f(r)?null:new TypeError(c('1rXEw',typeof r,i));}function Qr(r,i){var a;return l(r)?Gr(r)?(a=Br(r),N(a,i)?null:new TypeError(c('1rXEw',a,i))):new TypeError(c('1rXEw',V(r),i)):f(r)?new TypeError(c('1rXEw',d(r),i)):new TypeError(c('1rXEw',typeof r,i));}function Xr(r,i){var a;return l(r)?(a=V(r),N(a,i)?null:new TypeError(c('1rXEw',a,i))):f(r)?new TypeError(c('1rXEw',d(r),i)):new TypeError(c('1rXEw',typeof r,i));}function Yr(r){return r==="generic"||r===""?Mr:Fr(r)?Wr:Lr(r)?Xr:jr(r)?Qr:zr}U.exports=Yr
13
- });var G=u(function(_t,O){
14
- function $r(r,i){return a;function a(t,n){var s,e;switch(e=n,e.length){case 0:s=new t;break;case 1:s=new t(e[0]);break;case 2:s=new t(e[0],e[1]);break;case 3:s=new t(e[0],e[1],e[2]);break;case 4:s=new t(e[0],e[1],e[2],e[3]);break;case 5:s=new t(e[0],e[1],e[2],e[3],e[4]);break;case 6:s=new t(e[0],e[1],e[2],e[3],e[4],e[5]);break;case 7:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6]);break;case 8:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]);break;case 9:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);break;case 10:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9]);break;default:s=t.apply(null,e)}return r(s,i)}}O.exports=$r
15
- });var L=u(function(Pt,F){
16
- var Hr=/^-?[0-9]+$/;F.exports=Hr
17
- });var q=u(function(Nt,j){
18
- var Jr=require('@stdlib/assert-is-string/dist').isPrimitive,Kr=L();function Zr(r){return Jr(r)&&Kr.test(r)}j.exports=Zr
19
- });var M=u(function(Vt,B){
20
- var re=/\s*ArrayIndex<[^>]+>\s*/;B.exports=re
21
- });var z=u(function(Ut,W){
22
- var ee=require('@stdlib/assert-is-string/dist').isPrimitive,te=M();function ie(r){return ee(r)&&te.test(r)}W.exports=ie
23
- });var X=u(function(Ct,Q){
24
- var ae=require('@stdlib/string-base-trim/dist'),ne=require('@stdlib/error-tools-fmtprodmsg/dist');function se(r){return r.substring(11,r.length-1)}function ue(r,i){var a=i.get(se(ae(r)));if(a===null)throw new Error(ne('1rXFa',r));return a}Q.exports=ue
25
- });var $=u(function(Ot,Y){
26
- var oe=require('@stdlib/array-take/dist'),ce=require('@stdlib/array-mskfilter/dist'),ve=require('@stdlib/array-mskreject/dist'),le=require('@stdlib/error-tools-fmtprodmsg/dist'),fe=X();function pe(r,i,a){var t=fe(i,a.cache);if(t.type==="int")return a.postGetArray(oe(r,t.data));if(t.type==="bool")return a.postGetArray(ce(r,t.data));if(t.type==="mask")return a.postGetArray(ve(r,t.data));throw new Error(le('1rXFZ',t.type))}Y.exports=pe
27
- });var g=u(function(Gt,H){
28
- var ye=require('@stdlib/ndarray-base-normalize-index/dist'),de=require('@stdlib/error-tools-fmtprodmsg/dist');function qe(r,i,a){var t,n;if(t=parseInt(r,10),n=ye(t,i-1),n===-1){if(a)throw new RangeError(de('1rXFY'));return t}return n}H.exports=qe
29
- });var K=u(function(Ft,J){
30
- var ge=g();function me(r,i,a){return a.getter(r,ge(i,r.length,a.strict))}J.exports=me
31
- });var rr=u(function(Lt,Z){
32
- var he=require('@stdlib/assert-is-function/dist');function we(r,i,a,t){var n=r[i];if(he(n))return n===r.constructor?t.ctor:s;return n;function s(){var e,o;for(e=[],o=0;o<arguments.length;o++)e.push(arguments[o]);return n.apply(this===a?r:this,e)}}Z.exports=we
33
- });var m=u(function(jt,er){
34
- var Ee=require('@stdlib/string-base-replace/dist');function be(r){return Ee(r,/^invalid arguments?/,"invalid operation")}er.exports=be
35
- });var ir=u(function(Bt,tr){
36
- var Se=/:/;tr.exports=Se
37
- });var h=u(function(Mt,nr){
38
- var Ie=require('@stdlib/string-base-trim/dist'),ar=require('@stdlib/slice-base-seq2slice/dist'),Ae=require('@stdlib/slice-base-str2slice/dist'),xe=require('@stdlib/string-base-starts-with/dist'),p=require('@stdlib/error-tools-fmtprodmsg/dist'),Te=ir();function Re(r){return r[0]==="S"&&xe(r,"Slice(",0)&&r[r.length-1]===")"}function De(r){return Te.test(r)}function ke(r,i){var a=Ae(i);if(a===null)throw new Error(p('1rXEn',r));return a}function _e(r,i,a,t){var n=ar(i,a,!0);if(n.code){if(n.code==="ERR_SLICE_INVALID_INCREMENT")throw new Error(p('1rXEq',r));if(n.code==="ERR_SLICE_INVALID_SUBSEQUENCE")throw new Error(p('1rXEn',r));if(n.code==="ERR_SLICE_OUT_OF_BOUNDS"){if(t)throw new RangeError(p('1rXFU'));n=ar(i,a,!1)}}return n}function Pe(r,i,a){var t=Ie(i);return Re(t)?ke(i,t):De(t)?_e(i,t,r.length,a):null}nr.exports=Pe
39
- });var ur=u(function(Wt,sr){
40
- var Ne=require('@stdlib/array-base-fancy-slice/dist'),Ve=m(),Ue=h();function Ce(r,i,a){var t=Ue(r,i,a.strict);if(t!==null)try{return a.postGetArray(Ne(r,t,a.strict))}catch(n){throw new n.constructor(Ve(n.message))}}sr.exports=Ce
41
- });var cr=u(function(zt,or){
42
- var Oe=require('@stdlib/assert-is-string/dist').isPrimitive,Ge=require('@stdlib/assert-has-property/dist'),Fe=q(),Le=z(),je=$(),Be=K(),Me=rr(),We=ur();function ze(r){return i;function i(a,t,n){return Fe(t)?Be(a,t,r):Ge(a,t)||!Oe(t)?Me(a,t,n,r):Le(t)?je(a,t,r):We(a,t,r)}}or.exports=ze
43
- });var lr=u(function(Qt,vr){
44
- var Qe=g();function Xe(r,i,a,t){var n,s;if(n=t.validator(a,t.dtype),n)throw n;return t.preSetElement?s=t.preSetElement(a):s=a,t.setter(r,Qe(i,r.length,t.strict),s),!0}vr.exports=Xe
45
- });var pr=u(function(Xt,fr){
46
- function Ye(r,i,a){return r[i]=a,!0}fr.exports=Ye
47
- });var dr=u(function(Yt,yr){
48
- var $e=require('@stdlib/assert-is-collection/dist'),He=require('@stdlib/array-base-fancy-slice-assign/dist'),Je=require('@stdlib/array-from-scalar/dist'),Ke=h(),Ze=m();function rt(r,i,a,t,n){var s,e,o;if(e=Ke(r,i,n.strict),e===null)return!1;if($e(a))o=a;else{if(s=n.validator(a,n.dtype),s)throw s;o=Je(a,n.dtype)}try{return He(o,t,e,n.strict),!0}catch(v){throw new v.constructor(Ze(v.message))}}yr.exports=rt
49
- });var mr=u(function($t,gr){
50
- var et=require('@stdlib/assert-is-string/dist').isPrimitive,tt=require('@stdlib/assert-has-property/dist'),it=q(),at=lr(),qr=pr(),nt=dr();function st(r){return i;function i(a,t,n,s){var e;return it(t)?at(a,t,n,r):tt(t)||!et(t)?qr(a,t,n,r):(e=nt(a,t,n,s,r),e||qr(a,t,n,r))}}gr.exports=st
51
- });var w=u(function(Ht,Er){
52
- var ut=require('@stdlib/assert-is-array-like/dist'),hr=require('@stdlib/proxy-ctor/dist'),ot=require('@stdlib/array-base-arraylike2object/dist'),ct=require('@stdlib/object-assign/dist'),vt=require('@stdlib/error-tools-fmtprodmsg/dist'),lt=S(),ft=A(),pt=T(),yt=D(),wr=P(),dt=C(),qt=G(),gt=cr(),mt=mr();function ht(){var r,i;if(r=yt(),arguments.length&&(i=wr(r,arguments[0]),i))throw i;return a;function a(t){var n,s,e,o,v;if(!ut(t))throw new TypeError(vt('1rX38',t));if(pt){if(n=ct({},r),arguments.length>1&&(s=wr(n,arguments[1]),s))throw s;return e=ot(t),o=e.dtype||"",v={ref:t,dtype:o,getter:e.accessors[0],setter:e.accessors[1],preSetElement:lt(o),postGetArray:ft(a,n),cache:n.cache,strict:n.strict,validator:dt(o),array2fancy:a,ctor:new hr(t.constructor||Array,{construct:qt(a,n)})},new hr(t,{get:gt(v),set:mt(v)})}return console.warn("WARNING: Proxy objects are not supported in the current environment. Some `FancyArray` functionality may not be available."),t}}Er.exports=ht
53
- });var Sr=u(function(Jt,br){
54
- var wt=w(),Et=wt();br.exports=Et
55
- });var Ir=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),bt=require('@stdlib/array-index/dist'),E=Sr(),St=w();Ir(E,"factory",St);Ir(E,"idx",bt);module.exports=E;
1
+ "use strict";var u=function(r,i){return function(){return i||r((i={exports:{}}).exports,i),i.exports}};var D=u(function(Yt,T){
2
+ var kr=require('@stdlib/array-base-assert-is-complex-floating-point-data-type/dist'),_r=require('@stdlib/assert-is-number/dist').isPrimitive;function Pr(r){return _r(r)?[r,0]:r}function Cr(r){return kr(r)?Pr:null}T.exports=Cr
3
+ });var R=u(function($t,x){
4
+ function Nr(r,i){return a;function a(t){return r(t,i)}}x.exports=Nr
5
+ });var _=u(function(Ht,k){
6
+ var Vr=require('@stdlib/proxy-ctor/dist'),Ur=typeof Vr=="function";k.exports=Ur
7
+ });var C=u(function(Jt,P){
8
+ var Or=require('@stdlib/array-index/dist');function Gr(){return{cache:Or,strict:!1}}P.exports=Gr
9
+ });var U=u(function(Kt,V){
10
+ var Br=require('@stdlib/assert-is-plain-object/dist'),N=require('@stdlib/assert-has-own-property/dist'),Fr=require('@stdlib/assert-is-boolean/dist').isPrimitive,Lr=require('@stdlib/assert-is-method-in/dist'),q=require('@stdlib/error-tools-fmtprodmsg/dist');function Mr(r,i){return Br(i)?N(i,"strict")&&(r.strict=i.strict,!Fr(r.strict))?new TypeError(q('1rX2o',"strict",r.strict)):N(i,"cache")&&(r.cache=i.cache,!Lr(r.cache,"get"))?new TypeError(q('1rXFb',"cache","get",r.cache)):null:new TypeError(q('1rX2V',i));}V.exports=Mr
11
+ });var F=u(function(Zt,B){
12
+ var f=require('@stdlib/assert-is-number/dist').isPrimitive,jr=require('@stdlib/assert-is-integer/dist').isPrimitive,zr=require('@stdlib/assert-is-boolean/dist').isPrimitive,p=require('@stdlib/assert-is-complex-like/dist'),Wr=require('@stdlib/array-base-assert-is-real-floating-point-data-type/dist'),Qr=require('@stdlib/array-base-assert-is-unsigned-integer-data-type/dist'),Xr=require('@stdlib/array-base-assert-is-signed-integer-data-type/dist'),Yr=require('@stdlib/array-base-assert-is-boolean-data-type/dist'),O=require('@stdlib/array-base-assert-is-safe-data-type-cast/dist'),G=require('@stdlib/array-min-dtype/dist'),$r=require('@stdlib/array-base-min-signed-integer-dtype/dist'),g=require('@stdlib/complex-dtype/dist'),v=require('@stdlib/error-tools-fmtprodmsg/dist');function Hr(){return null}function Jr(r,i){return zr(r)?null:new TypeError(v('1rXEw',typeof r,i));}function Kr(r,i){return f(r)?null:p(r)?new TypeError(v('1rXEw',g(r),i)):new TypeError(v('1rXEw',typeof r,i));}function Zr(r,i){return f(r)||p(r)?null:new TypeError(v('1rXEw',typeof r,i));}function re(r,i){var a;return f(r)?jr(r)?(a=$r(r),O(a,i)?null:new TypeError(v('1rXEw',a,i))):new TypeError(v('1rXEw',G(r),i)):p(r)?new TypeError(v('1rXEw',g(r),i)):new TypeError(v('1rXEw',typeof r,i));}function ee(r,i){var a;return f(r)?(a=G(r),O(a,i)?null:new TypeError(v('1rXEw',a,i))):p(r)?new TypeError(v('1rXEw',g(r),i)):new TypeError(v('1rXEw',typeof r,i));}function te(r){return r==="generic"||r===""?Hr:Wr(r)?Kr:Qr(r)?ee:Xr(r)?re:Yr(r)?Jr:Zr}B.exports=te
13
+ });var M=u(function(ra,L){
14
+ function ae(r,i){return a;function a(t,n){var s,e;switch(e=n,e.length){case 0:s=new t;break;case 1:s=new t(e[0]);break;case 2:s=new t(e[0],e[1]);break;case 3:s=new t(e[0],e[1],e[2]);break;case 4:s=new t(e[0],e[1],e[2],e[3]);break;case 5:s=new t(e[0],e[1],e[2],e[3],e[4]);break;case 6:s=new t(e[0],e[1],e[2],e[3],e[4],e[5]);break;case 7:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6]);break;case 8:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]);break;case 9:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]);break;case 10:s=new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9]);break;default:s=t.apply(null,e)}return r(s,i)}}L.exports=ae
15
+ });var z=u(function(ea,j){
16
+ var ie=/^-?[0-9]+$/;j.exports=ie
17
+ });var m=u(function(ta,W){
18
+ var ne=require('@stdlib/assert-is-string/dist').isPrimitive,se=z();function ue(r){return ne(r)&&se.test(r)}W.exports=ue
19
+ });var X=u(function(aa,Q){
20
+ var oe=/\s*ArrayIndex<[^>]+>\s*/;Q.exports=oe
21
+ });var h=u(function(ia,Y){
22
+ var ce=require('@stdlib/assert-is-string/dist').isPrimitive,ve=X();function le(r){return ce(r)&&ve.test(r)}Y.exports=le
23
+ });var w=u(function(na,$){
24
+ var fe=require('@stdlib/string-base-trim/dist'),pe=require('@stdlib/error-tools-fmtprodmsg/dist');function ye(r){return r.substring(11,r.length-1)}function de(r,i){var a=i.get(ye(fe(r)));if(a===null)throw new Error(pe('1rXFa',r));return a}$.exports=de
25
+ });var J=u(function(sa,H){
26
+ var qe=require('@stdlib/array-take/dist'),ge=require('@stdlib/array-mskfilter/dist'),me=require('@stdlib/array-mskreject/dist'),he=require('@stdlib/error-tools-fmtprodmsg/dist'),we=w();function Ee(r,i,a){var t=we(i,a.cache);if(t.type==="int")return a.postGetArray(qe(r,t.data));if(t.type==="bool")return a.postGetArray(ge(r,t.data));if(t.type==="mask")return a.postGetArray(me(r,t.data));throw new Error(he('1rXFZ',t.type))}H.exports=Ee
27
+ });var E=u(function(ua,K){
28
+ var be=require('@stdlib/ndarray-base-normalize-index/dist'),Se=require('@stdlib/error-tools-fmtprodmsg/dist');function Ie(r,i,a){var t,n;if(t=parseInt(r,10),n=be(t,i-1),n===-1){if(a)throw new RangeError(Se('1rXFY'));return t}return n}K.exports=Ie
29
+ });var rr=u(function(oa,Z){
30
+ var Ae=E();function Te(r,i,a){return a.getter(r,Ae(i,r.length,a.strict))}Z.exports=Te
31
+ });var tr=u(function(ca,er){
32
+ var De=require('@stdlib/assert-is-function/dist');function xe(r,i,a,t){var n=r[i];if(De(n))return n===r.constructor?t.ctor:s;return n;function s(){var e,o;for(e=[],o=0;o<arguments.length;o++)e.push(arguments[o]);return n.apply(this===a?r:this,e)}}er.exports=xe
33
+ });var y=u(function(va,ar){
34
+ var Re=require('@stdlib/string-base-replace/dist');function ke(r){return Re(r,/^invalid arguments?/,"invalid operation")}ar.exports=ke
35
+ });var nr=u(function(la,ir){
36
+ var _e=/:/;ir.exports=_e
37
+ });var b=u(function(fa,ur){
38
+ var Pe=require('@stdlib/string-base-trim/dist'),sr=require('@stdlib/slice-base-seq2slice/dist'),Ce=require('@stdlib/slice-base-str2slice/dist'),Ne=require('@stdlib/string-base-starts-with/dist'),d=require('@stdlib/error-tools-fmtprodmsg/dist'),Ve=nr();function Ue(r){return r[0]==="S"&&Ne(r,"Slice(",0)&&r[r.length-1]===")"}function Oe(r){return Ve.test(r)}function Ge(r,i){var a=Ce(i);if(a===null)throw new Error(d('1rXEn',r));return a}function Be(r,i,a,t){var n=sr(i,a,!0);if(n.code){if(n.code==="ERR_SLICE_INVALID_INCREMENT")throw new Error(d('1rXEq',r));if(n.code==="ERR_SLICE_INVALID_SUBSEQUENCE")throw new Error(d('1rXEn',r));if(n.code==="ERR_SLICE_OUT_OF_BOUNDS"){if(t)throw new RangeError(d('1rXFU'));n=sr(i,a,!1)}}return n}function Fe(r,i,a){var t=Pe(i);return Ue(t)?Ge(i,t):Oe(t)?Be(i,t,r.length,a):null}ur.exports=Fe
39
+ });var cr=u(function(pa,or){
40
+ var Le=require('@stdlib/array-base-fancy-slice/dist'),Me=y(),je=b();function ze(r,i,a){var t=je(r,i,a.strict);if(t!==null)try{return a.postGetArray(Le(r,t,a.strict))}catch(n){throw new n.constructor(Me(n.message))}}or.exports=ze
41
+ });var lr=u(function(ya,vr){
42
+ var We=require('@stdlib/assert-is-string/dist').isPrimitive,Qe=require('@stdlib/assert-has-property/dist'),Xe=m(),Ye=h(),$e=J(),He=rr(),Je=tr(),Ke=cr();function Ze(r){return i;function i(a,t,n){return Xe(t)?He(a,t,r):Qe(a,t)||!We(t)?Je(a,t,n,r):Ye(t)?$e(a,t,r):Ke(a,t,r)}}vr.exports=Ze
43
+ });var yr=u(function(da,pr){
44
+ var rt=require('@stdlib/array-base-assert-is-mostly-safe-data-type-cast/dist'),et=require('@stdlib/array-base-assert-is-real-data-type/dist'),tt=require('@stdlib/array-base-assert-is-complex-floating-point-data-type/dist'),at=require('@stdlib/assert-is-collection/dist'),it=require('@stdlib/array-from-scalar/dist'),nt=require('@stdlib/array-dtype/dist'),st=require('@stdlib/array-put/dist'),ut=require('@stdlib/array-place/dist'),ot=require('@stdlib/array-convert/dist'),ct=require('@stdlib/array-base-where/dist').assign,fr=require('@stdlib/error-tools-fmtprodmsg/dist'),vt=w(),S=y();function lt(r,i,a,t){var n,s,e,o,c;if(e=vt(i,t.cache),n=t.dtype||"generic",at(a))c=a;else{if(o=t.validator(a,n),o)throw o;t.preSetElement?c=t.preSetElement(a):c=a,c=it(c,n),s=n}if(e.type==="int"){try{st(r,e.data,c)}catch(l){throw new l.constructor(S(l.message))}return!0}if(e.type==="bool"){try{ut(r,e.data,c,{mode:"strict_broadcast"})}catch(l){throw new l.constructor(S(l.message))}return!0}if(s===void 0&&(s=nt(a)||"generic"),!rt(s,n))throw new TypeError(fr('1rXEw',s,n));if(tt(n)&&et(s)&&(c=ot(c,n)),e.type==="mask"){try{ct(e.data,r,c,r,1,0)}catch(l){throw new l.constructor(S(l.message))}return!0}throw new Error(fr('1rXFZ',e.type))}pr.exports=lt
45
+ });var qr=u(function(qa,dr){
46
+ var ft=E();function pt(r,i,a,t){var n,s;if(n=t.validator(a,t.dtype),n)throw n;return t.preSetElement?s=t.preSetElement(a):s=a,t.setter(r,ft(i,r.length,t.strict),s),!0}dr.exports=pt
47
+ });var mr=u(function(ga,gr){
48
+ function yt(r,i,a){return r[i]=a,!0}gr.exports=yt
49
+ });var wr=u(function(ma,hr){
50
+ var dt=require('@stdlib/assert-is-collection/dist'),qt=require('@stdlib/array-base-fancy-slice-assign/dist'),gt=require('@stdlib/array-from-scalar/dist'),mt=b(),ht=y();function wt(r,i,a,t,n){var s,e,o;if(e=mt(r,i,n.strict),e===null)return!1;if(dt(a))o=a;else{if(s=n.validator(a,n.dtype),s)throw s;o=gt(a,n.dtype||"generic")}try{qt(o,t,e,n.strict)}catch(c){throw new c.constructor(ht(c.message))}return!0}hr.exports=wt
51
+ });var Sr=u(function(ha,br){
52
+ var Et=require('@stdlib/assert-is-string/dist').isPrimitive,bt=require('@stdlib/assert-has-property/dist'),St=m(),It=h(),At=yr(),Tt=qr(),Er=mr(),Dt=wr();function xt(r){return i;function i(a,t,n,s){var e;return St(t)?Tt(a,t,n,r):bt(a,t)||!Et(t)?Er(a,t,n,r):It(t)?At(a,t,n,r):(e=Dt(a,t,n,s,r),e||Er(a,t,n,r))}}br.exports=xt
53
+ });var I=u(function(wa,Tr){
54
+ var Rt=require('@stdlib/assert-is-collection/dist'),kt=require('@stdlib/assert-is-array-like/dist'),Ir=require('@stdlib/proxy-ctor/dist'),_t=require('@stdlib/array-base-arraylike2object/dist'),Pt=require('@stdlib/object-assign/dist'),Ct=require('@stdlib/error-tools-fmtprodmsg/dist'),Nt=D(),Vt=R(),Ut=_(),Ot=C(),Ar=U(),Gt=F(),Bt=M(),Ft=lr(),Lt=Sr();function Mt(){var r,i;if(r=Ot(),arguments.length&&(i=Ar(r,arguments[0]),i))throw i;return a;function a(t){var n,s,e,o,c;if(!kt(t)&&!Rt(t))throw new TypeError(Ct('1rX38',t));if(Ut){if(n=Pt({},r),arguments.length>1&&(s=Ar(n,arguments[1]),s))throw s;return e=_t(t),o=e.dtype||"",c={ref:t,dtype:o,getter:e.accessors[0],setter:e.accessors[1],preSetElement:Nt(o),postGetArray:Vt(a,n),cache:n.cache,strict:n.strict,validator:Gt(o),array2fancy:a,ctor:new Ir(t.constructor||Array,{construct:Bt(a,n)})},new Ir(t,{get:Ft(c),set:Lt(c)})}return console.warn("WARNING: Proxy objects are not supported in the current environment. Some `FancyArray` functionality may not be available."),t}}Tr.exports=Mt
55
+ });var xr=u(function(Ea,Dr){
56
+ var jt=I(),zt=jt();Dr.exports=zt
57
+ });var Rr=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),Wt=require('@stdlib/array-index/dist'),A=xr(),Qt=I();Rr(A,"factory",Qt);Rr(A,"idx",Wt);module.exports=A;
56
58
  /** @license Apache-2.0 */
57
59
  //# sourceMappingURL=index.js.map