UNPKG

shuffle-x

Version:

Creates an array of shuffled values.

15 lines 16.2 kB
/*! { "author": "Graham Fairweather", "copywrite": "Copyright (c) 2017", "date": "2019-08-28T17:14:25.979Z", "describe": "", "description": "Creates an array of shuffled values.", "file": "shuffle-x.min.js", "hash": "0496f8a511b4e1d9e149", "license": "MIT", "version": "2.2.2" } */ !function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.shuffleX=n():t.shuffleX=n()}(function(){"use strict";var t,n={}.constructor,e=n.prototype,r=n.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},i=function(){return this};try{return r?r(e,"$$globalThis$$",{get:i,configurable:!0}):e.__defineGetter__("$$globalThis$$",i),t="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete e.$$globalThis$$,t}catch(t){return o()}}(),function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=7)}([function(t,n,e){"use strict";var r=Object.prototype.toString;if(e(4)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,n,e){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"string"==typeof t||"object"==typeof t&&(i?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object String]"===o.call(t))}},function(t,n,e){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.prototype.toString,i=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o.call(t)},u=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o.call(t)&&"[object Function]"===o.call(t.callee)},c=function(){return i(arguments)}();i.isLegacyArguments=u,t.exports=c?i:u},function(t,n,e){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},function(t,n,e){"use strict";(function(n){var r=n.Symbol,o=e(6);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,e(5))},function(t,n){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,n,e){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},n=Symbol("test"),e=Object(n);if("string"==typeof n)return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;for(n in t[n]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==n)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,n);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,n,e){"use strict";e.r(n);var r=function(t){return null==t},o=function(t){if(r(t))throw new TypeError("Cannot call method on ".concat(t));return t},i={}.constructor,u=function(t){return i(o(t))},c=e(2),s=e.n(c);function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var a=function(t){return"object"===f(t)?null===t:"function"!=typeof t},l=e(1),p=e.n(l),y={}.constructor("a"),b="a"===y[0]&&0 in y,d=function(){}.bind,g="function"==typeof d&&function(){var t=null,n=null,e=null,r=[];try{var o=d.apply(function(r,o){return e=this,t=r,n=o,arguments},[r,1]),i=o(2);return 1===o.length&&2===i.length&&1===t&&2===n&&e===r}catch(t){return!1}}()&&function(){var t=null,n=null,e=null,r=[1,2,3],o=function(o,i){return t=o,n=i,e=this,r};try{var i=d.apply(o,[null]),u=new i(1,2);return i.length===o.length&&u===r&&1===t&&2===n&&e!==r}catch(t){return!1}}(),h="".split,v=Math.max,m=a.bind,S=a.call,w=g?m.call(S,h):function(t,n){return h.call(t,n)},j=function(t){return p()(t)?w(t,""):t},O=function(t,n){var e=arguments.length>2?arguments[2]:[];if("string"!=typeof t&&a(t))return e;for(var r=b?t:j(t),o=r.length,i=v(0,n)||0;i<o;i+=1)e[e.length]=t[i];return e};function T(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=[],r=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(r=(u=c.next()).done)&&(e.push(u.value),!n||e.length!==n);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return e}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var $=O.bind,x=O.call,E={},P=E.constructor,F=E.toString,M=function(t,n){return t>=n?t:n},N=function(t){if("function"!=typeof t&&"[object Function]"!==F.apply(t))throw new TypeError("bind called on incompatible "+t)},_=[function(t){return function(){return t.apply(this,O(arguments))}},function(t,n){return function(e){return t.apply(this,O(arguments,n,[e]))}},function(t,n){return function(e,r){return t.apply(this,O(arguments,n,[e,r]))}},function(t,n){return function(e,r,o){return t.apply(this,O(arguments,n,[e,r,o]))}},function(t,n){return function(e,r,o,i){return t.apply(this,O(arguments,n,[e,r,o,i]))}},function(t,n){return function(e,r,o,i,u){return t.apply(this,O(arguments,n,[e,r,o,i,u]))}},function(t,n){return function(e,r,o,i,u,c){return t.apply(this,O(arguments,n,[e,r,o,i,u,c]))}},function(t,n){return function(e,r,o,i,u,c,s){return t.apply(this,O(arguments,n,[e,r,o,i,u,c,s]))}},function(t,n){return function(e,r,o,i,u,c,s,f){return t.apply(this,O(arguments,n,[e,r,o,i,u,c,s,f]))}}],A=function(t){var n=T(t,3),e=n[0],r=n[1],o=n[2],i=M(0,r.length-M(0,o.length-2)),u=_[i],c=u?u(e,i):_[0](e);if(r.prototype){var s=function(){};s.prototype=r.prototype,c.prototype=new s,s.prototype=null}return c},C=function(t,n){var e=t.apply(this,n);return P(e)===e?e:this},k=g?x.bind($):function(t,n){N(t);var e,r=arguments,o=function(){var o=O(arguments,0,O(r,2));return this instanceof e?C.apply(this,[t,o]):t.apply(n,o)};return e=A([o,t,r])},D=TypeError,I=k.apply,L=k(k.call,I),X=k(I,{}.toString),q=function(t){if("function"!=typeof t&&"[object Function]"!==X(t))throw new D(t+" is not a function");return t},G=function(t,n){return L(q(t),n,O(arguments[2]))},z=function(t){try{return{threw:!1,value:G(t,this,O(arguments,1))}}catch(t){return{threw:!0,value:t}}},B={}.toString,H=function(t){return function(t){if("function"!=typeof t&&"[object Function]"!==G(B,t))throw new TypeError("methodize called on incompatible "+t)}(t),function(){return G(t,arguments[0],O(arguments,1))}},R=H({}.toString),U=function(t){return null===t?"[object Null]":void 0===t?"[object Undefined]":R(t)},V=[].isArray,J="function"==typeof V&&V,K=z(function(){return!0===J([])&&!1===J({length:0})}),Q=!1===K.threw&&!0===K.value?J:function(t){return"[object Array]"===U(t)},W=e(0),Y=e.n(W);for(var Z=z(function(){return function(t,n){if(t!==n)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&Y()(Symbol(""))}.bind(void 0)),tt=!1===Z.threw&&!0===Z.value,nt=e(3),et=e.n(nt),rt=function(t){return!!t},ot=tt&&Y()(Symbol.toStringTag),it="Cannot convert a Symbol value to a string".constructor,ut=function(t){if(Y()(t))throw new TypeError("Cannot convert a Symbol value to a string");return it(t)},ct=function(t){return ut(o(t))},st=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:"᠎"},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],ft="",at=st.length,lt=0;lt<at;lt+=1)st[lt].es2016&&st[lt].string,st[lt].es2018&&(ft+=st[lt].string);var pt,yt,bt,dt=ft,gt=new(0,/none/.constructor)("^[".concat(dt,"]+")),ht=H("".replace),vt=function(t){return ht(ct(t),gt,"")},mt=new(0,/none/.constructor)("[".concat(dt,"]+$")),St=H("".replace),wt=function(t){return St(ct(t),mt,"")},jt=function(t){return vt(wt(t))},Ot=new(0,/none/.constructor)("[".concat(dt,"]+"),"g"),Tt=H(" ".replace),$t=function(t){return Tt(jt(t),Ot," ")},xt=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Et=H("".replace),Pt=function(t,n){return Et(ct(t),xt,arguments.length>1?ut(n):"")},Ft=z.constructor,Mt=H(z.toString),Nt=/^class /,_t=H(Nt.test),At=!1===z(function(){return Ft('"use strict"; return class My {};')()}).threw,Ct=function(t){return _t(Nt,$t(Pt(Mt(t)," ")))},kt=function(t){var n=z(Ct,t);return!1===n.threw&&n.value},Dt=function(t,n){return!a(t)&&(ot?function(t,n){return!(At&&!1===n&&kt(t)||!1!==z(function(){return Mt(t)}).threw)}(t,rt(n)):(!At||!1!==rt(n)||!kt(t))&&function(t){var n=U(t);return"[object Function]"===n||"[object GeneratorFunction]"===n||"[object AsyncFunction]"===n}(t))},It="string".constructor,Lt=(0).constructor,Xt=tt&&Symbol.toPrimitive,qt=tt&&Symbol.prototype.valueOf,Gt=["toString","valueOf"],zt=["valueOf","toString"],Bt=function(t,n){o(t),function(t){if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"')}(n);for(var e="string"===n?Gt:zt,r=0;r<2;r+=1){var i=t[e[r]];if(Dt(i)){var u=G(i,t);if(a(u))return u}}throw new TypeError("No default value")},Ht=function(t,n){if(n){if(t===It)return"string";if(t===Lt)return"number"}return"default"},Rt=function(t){if(tt){if(Xt)return function(t,n){var e=t[n];if(!1===r(e)){if(!1===Dt(e))throw new TypeError("".concat(e," returned for property ").concat(n," of object ").concat(t," is not a function"));return e}}(t,Xt);if(Y()(t))return qt}},Ut=function(t){var n=t.exoticToPrim,e=t.input,r=t.hint,o=G(n,e,[r]);if(a(o))return o;throw new TypeError("unable to convert exotic object to primitive")},Vt=function(t,n){var e="default"===n&&(et()(t)||Y()(t))?"string":n;return Bt(t,"default"===e?"number":e)},Jt=function(t,n){if(a(t))return t;var e=Ht(n,arguments.length>1),r=Rt(t);return void 0===r?Vt(t,e):Ut({exoticToPrim:r,input:t,hint:e})},Kt=parseInt,Qt=(0).constructor,Wt=H("᠎".charAt),Yt=/^[-+]?0[xX]/,Zt=H(Yt.test),tn=function(t,n){var e=vt(ut(t));return"᠎"===Wt(e,0)?NaN:Kt(e,Qt(n)||(Zt(Yt,e)?16:10))},nn=2..constructor,en=H("Cannot convert a Symbol value to a number".slice),rn=/^0b[01]+$/i,on=rn.constructor,un=H(rn.test),cn=/^0o[0-7]+$/i,sn=new on("[…᠎​￾]","g"),fn=/^[-+]0x[0-9a-f]+$/i,an=function(t,n){return tn(en(t,2),n)},ln=function(t,n){return function(t){return un(rn,t)}(n)?t(an(n,2)):function(t){return un(cn,t)}(n)?t(an(n,8)):null},pn=function(t,n){var e=ln(t,n);if(null!==e)return e;if(function(t){return un(sn,t)}(n)||function(t){return un(fn,t)}(n))return NaN;var r=jt(n);return r!==n?t(r):null},yn=function t(n){var e=function(t){if(Y()(t))throw new TypeError("Cannot convert a Symbol value to a number");return t}(Jt(n,nn));if("string"==typeof e){var r=pn(t,e);if(null!==r)return r}return nn(e)},bn=function(t){return t!=t},dn=function(t){return"number"==typeof t&&!1===bn(t)&&t!==1/0&&t!==-1/0},gn=function(t){var n=yn(t);return 0===n||bn(n)?n:n>0?1:-1},hn=Math.abs,vn=Math.floor,mn=function(t){var n=yn(t);return bn(n)?0:0===n||!1===dn(n)?n:gn(n)*vn(hn(n))},Sn=function(t){var n=mn(t);return n<=0?0:n>9007199254740991?9007199254740991:n},wn=H("".split),jn=function(t){return t},On=b?jn:function(t){return p()(t)?wn(t,""):jn(t)},Tn=function(t,n){return t>=n?t:n},$n=function(t,n){return t<0?Tn(n+t,0):(e=t)<=(r=n)?e:r;var e,r},xn=function(t,n,e){var r=On(u(t)),o=Sn(r.length),i=$n(mn(n),o),c=void 0===e?o:mn(e),s=$n(c,o),f=[];f.length=Tn(s-i,0);for(var a=0;i<s;)i in r&&(f[a]=r[i]),a+=1,i+=1;return f},En=H([].slice),Pn=(pt=z(function(){return En([1,2,3],1,2)})).threw||!1===Q(pt.value)||1!==pt.value.length||2!==pt.value[0],Fn=function(){var t=z(function(){return En("abc",1,2)});return t.threw||!1===Q(t.value)||1!==t.value.length||"b"!==t.value[0]}(),Mn=(yt="undefined"!=typeof document&&document,!!(bt=!!yt&&z(function(){return En(yt.documentElement)}).threw)&&bt.threw),Nn=function(t,n,e){var r=u(t);return function(t){return Pn||Mn&&!1===Q(t)||Fn&&p()(t)||s()(t)}(r)?xn(r,n,e):En(r,n,e)},_n=Math.floor,An=Math.random;n.default=function(t){for(var n=Nn(u(t)),e=n.length;e>0;){var r=_n(An()*e),o=n[e-=1];n[e]=n[r],n[r]=o}return n}}])}); //# sourceMappingURL=shuffle-x.min.js.map