@vinicunca/perkakas 0.0.11 → 0.1.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/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
1
  // src/aria/key-codes.ts
2
2
  var KEY_CODES = {
3
- TAB: "Tab",
3
+ ALT: "Alt",
4
4
  ARROW_DOWN: "ArrowDown",
5
- ARROW_UP: "ArrowUp",
6
5
  ARROW_LEFT: "ArrowLeft",
7
6
  ARROW_RIGHT: "ArrowRight",
7
+ ARROW_UP: "ArrowUp",
8
+ AT: "@",
9
+ BACKSPACE: "Backspace",
10
+ CTRL: "Control",
11
+ DELETE: "Delete",
12
+ END: "End",
8
13
  ENTER: "Enter",
9
14
  ESC: "Escape",
10
- SPACE: "Space",
11
- SHIFT: "Shift",
15
+ HOME: "Home",
12
16
  KEY_F: "KEY_F",
13
- CTRL: "Control",
14
- ALT: "Alt",
15
17
  META: "Meta",
16
- AT: "@",
17
- DELETE: "Delete",
18
- BACKSPACE: "Backspace",
19
- HOME: "Home",
20
- END: "End",
18
+ PAGE_DOWN: "PageDown",
21
19
  PAGE_UP: "PageUp",
22
- PAGE_DOWN: "PageDown"
20
+ SHIFT: "Shift",
21
+ SPACE: "Space",
22
+ TAB: "Tab"
23
23
  };
24
24
 
25
25
  // src/function/pipe.ts
@@ -59,7 +59,7 @@ function pipe(value, ...operations) {
59
59
  }
60
60
  const acc = [];
61
61
  for (const item of ret) {
62
- if (_processItem({ item, acc, lazySeq })) {
62
+ if (_processItem({ acc, item, lazySeq })) {
63
63
  break;
64
64
  }
65
65
  }
@@ -74,9 +74,9 @@ function pipe(value, ...operations) {
74
74
  return ret;
75
75
  }
76
76
  function _processItem({
77
+ acc,
77
78
  item,
78
- lazySeq,
79
- acc
79
+ lazySeq
80
80
  }) {
81
81
  if (lazySeq.length === 0) {
82
82
  acc.push(item);
@@ -97,8 +97,8 @@ function _processItem({
97
97
  const nextValues = lazyResult.next;
98
98
  for (const subItem of nextValues) {
99
99
  const subResult = _processItem({
100
- item: subItem,
101
100
  acc,
101
+ item: subItem,
102
102
  lazySeq: lazySeq.slice(i + 1)
103
103
  });
104
104
  if (subResult) {
@@ -120,10 +120,7 @@ function _processItem({
120
120
  if (lazyResult.hasNext) {
121
121
  acc.push(item);
122
122
  }
123
- if (isDone) {
124
- return true;
125
- }
126
- return false;
123
+ return !!isDone;
127
124
  }
128
125
 
129
126
  // src/function/create-pipe.ts
@@ -154,6 +151,103 @@ function once(fn) {
154
151
  };
155
152
  }
156
153
 
154
+ // src/function/debounce.ts
155
+ function debounce(func, {
156
+ maxWaitMs,
157
+ timing = "trailing",
158
+ waitMs
159
+ }) {
160
+ if (maxWaitMs !== void 0 && waitMs !== void 0 && maxWaitMs < waitMs) {
161
+ throw new Error(
162
+ `debounce: maxWaitMs (${maxWaitMs}) cannot be less than waitMs (${waitMs})`
163
+ );
164
+ }
165
+ let coolDownTimeoutId;
166
+ let maxWaitTimeoutId;
167
+ let latestCallArgs;
168
+ let result;
169
+ function handleDebouncedCall(args) {
170
+ latestCallArgs = args;
171
+ if (maxWaitMs !== void 0 && maxWaitTimeoutId === void 0) {
172
+ maxWaitTimeoutId = setTimeout(handleInvoke, maxWaitMs);
173
+ }
174
+ }
175
+ function handleInvoke() {
176
+ if (latestCallArgs === void 0) {
177
+ return;
178
+ }
179
+ if (maxWaitTimeoutId !== void 0) {
180
+ const timeoutId = maxWaitTimeoutId;
181
+ maxWaitTimeoutId = void 0;
182
+ clearTimeout(timeoutId);
183
+ }
184
+ const args = latestCallArgs;
185
+ latestCallArgs = void 0;
186
+ result = func(...args);
187
+ }
188
+ function handleCoolDownEnd() {
189
+ if (coolDownTimeoutId === void 0) {
190
+ return;
191
+ }
192
+ const timeoutId = coolDownTimeoutId;
193
+ coolDownTimeoutId = void 0;
194
+ clearTimeout(timeoutId);
195
+ if (latestCallArgs !== void 0) {
196
+ handleInvoke();
197
+ }
198
+ }
199
+ return {
200
+ get cachedValue() {
201
+ return result;
202
+ },
203
+ call: (...args) => {
204
+ if (coolDownTimeoutId === void 0) {
205
+ if (timing === "trailing") {
206
+ handleDebouncedCall(args);
207
+ } else {
208
+ result = func(...args);
209
+ }
210
+ } else {
211
+ if (timing !== "leading") {
212
+ handleDebouncedCall(args);
213
+ }
214
+ const timeoutId = coolDownTimeoutId;
215
+ coolDownTimeoutId = void 0;
216
+ clearTimeout(timeoutId);
217
+ }
218
+ coolDownTimeoutId = setTimeout(
219
+ handleCoolDownEnd,
220
+ // If waitMs is not defined but maxWaitMs *is* it means the user is only
221
+ // interested in the leaky-bucket nature of the debouncer which is
222
+ // achieved by setting waitMs === maxWaitMs. If both are not defined we
223
+ // default to 0 which would wait until the end of the execution frame.
224
+ waitMs ?? maxWaitMs ?? 0
225
+ );
226
+ return result;
227
+ },
228
+ cancel: () => {
229
+ if (coolDownTimeoutId !== void 0) {
230
+ const timeoutId = coolDownTimeoutId;
231
+ coolDownTimeoutId = void 0;
232
+ clearTimeout(timeoutId);
233
+ }
234
+ if (maxWaitTimeoutId !== void 0) {
235
+ const timeoutId = maxWaitTimeoutId;
236
+ maxWaitTimeoutId = void 0;
237
+ clearTimeout(timeoutId);
238
+ }
239
+ latestCallArgs = void 0;
240
+ },
241
+ flush: () => {
242
+ handleCoolDownEnd();
243
+ return result;
244
+ },
245
+ get isPending() {
246
+ return coolDownTimeoutId !== void 0;
247
+ }
248
+ };
249
+ }
250
+
157
251
  // src/function/purry.ts
158
252
  function purry(fn, args, lazy) {
159
253
  const diff = fn.length - args.length;
@@ -673,8 +767,8 @@ function _flatten(items) {
673
767
  if (Array.isArray(next)) {
674
768
  return {
675
769
  done: false,
676
- hasNext: true,
677
770
  hasMany: true,
771
+ hasNext: true,
678
772
  next
679
773
  };
680
774
  }
@@ -702,8 +796,8 @@ function _flatMap(array, fn) {
702
796
  if (Array.isArray(next)) {
703
797
  return {
704
798
  done: false,
705
- hasNext: true,
706
799
  hasMany: true,
800
+ hasNext: true,
707
801
  next
708
802
  };
709
803
  }
@@ -745,8 +839,8 @@ function _flattenDeepValue(value) {
745
839
  if (Array.isArray(next)) {
746
840
  return {
747
841
  done: false,
748
- hasNext: true,
749
842
  hasMany: true,
843
+ hasNext: true,
750
844
  next
751
845
  };
752
846
  }
@@ -1474,6 +1568,9 @@ function _zip(first2, second) {
1474
1568
  }
1475
1569
  return result;
1476
1570
  }
1571
+ ((zip2) => {
1572
+ zip2.strict = zip2;
1573
+ })(zip || (zip = {}));
1477
1574
 
1478
1575
  // src/array/zip-obj.ts
1479
1576
  function zipObj(...args) {
@@ -1753,39 +1850,30 @@ function _merge(a, b) {
1753
1850
  }
1754
1851
 
1755
1852
  // src/object/merge-deep.ts
1756
- function mergeDeep({
1757
- mergeArray = false,
1758
- original,
1759
- patch
1760
- }) {
1761
- const original_ = original;
1762
- const patch_ = patch;
1763
- if (Array.isArray(patch_)) {
1764
- if (mergeArray && Array.isArray(patch_)) {
1765
- return [...original_, ...patch_];
1766
- } else {
1767
- return [...patch_];
1853
+ function mergeDeep(...args) {
1854
+ return purry(mergeDeepImplementation, args);
1855
+ }
1856
+ function mergeDeepImplementation(destination, source) {
1857
+ const output = { ...destination, ...source };
1858
+ for (const key in source) {
1859
+ if (!(key in destination)) {
1860
+ continue;
1768
1861
  }
1769
- }
1770
- const output = { ...original_ };
1771
- if (isObject(original_) && isObject(patch_)) {
1772
- Object.keys(patch_).forEach((key) => {
1773
- const areBothObjects = isObject(original_[key]) && isObject(patch_[key]);
1774
- const areBothArrays = Array.isArray(original_[key]) && Array.isArray(patch_[key]);
1775
- if (areBothObjects || areBothArrays) {
1776
- output[key] = mergeDeep({
1777
- mergeArray,
1778
- original: original_[key],
1779
- patch: patch_[key]
1780
- });
1781
- } else {
1782
- Object.assign(output, { [key]: patch_[key] });
1783
- }
1784
- ;
1785
- });
1862
+ const destinationValue = destination[key];
1863
+ if (!isRecord(destinationValue)) {
1864
+ continue;
1865
+ }
1866
+ const sourceValue = source[key];
1867
+ if (!isRecord(sourceValue)) {
1868
+ continue;
1869
+ }
1870
+ output[key] = mergeDeepImplementation(destinationValue, sourceValue);
1786
1871
  }
1787
1872
  return output;
1788
1873
  }
1874
+ function isRecord(object) {
1875
+ return typeof object === "object" && object !== null && Object.getPrototypeOf(object) === Object.prototype;
1876
+ }
1789
1877
 
1790
1878
  // src/object/omit.ts
1791
1879
  function omit(...args) {
@@ -2064,6 +2152,7 @@ export {
2064
2152
  concat,
2065
2153
  countBy,
2066
2154
  createPipe,
2155
+ debounce,
2067
2156
  difference,
2068
2157
  differenceWith,
2069
2158
  drop,
package/dist/index.min.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var tt={TAB:"Tab",ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ENTER:"Enter",ESC:"Escape",SPACE:"Space",SHIFT:"Shift",KEY_F:"KEY_F",CTRL:"Control",ALT:"Alt",META:"Meta",AT:"@",DELETE:"Delete",BACKSPACE:"Backspace",HOME:"Home",END:"End",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown"};function fn(n,...t){let e=n;const r=t.map(i=>{const{lazy:f,lazyArgs:c}=i;if(f){const s=f(...c||[]);return s.indexed=f.indexed,s.single=f.single,s.index=0,s.items=[],s}return null});let u=0;for(;u<t.length;){const i=t[u];if(!r[u]){e=i(e),u++;continue}const c=[];for(let l=u;l<t.length&&r[l];l++)if(c.push(r[l]),r[l].single)break;const s=[];for(const l of e)if(cn({item:l,acc:s,lazySeq:c}))break;c[c.length-1].single?e=s[0]:e=s,u+=c.length}return e}function cn({item:n,lazySeq:t,acc:e}){if(t.length===0)return e.push(n),!1;let r={done:!1,hasNext:!1},u=!1;for(let i=0;i<t.length;i++){const f=t[i],c=f.indexed,s=f.index,a=f.items;if(a.push(n),r=c?f(n,s,a):f(n),f.index++,r.hasNext)if(r.hasMany){const l=r.next;for(const N of l)if(cn({item:N,acc:e,lazySeq:t.slice(i+1)}))return!0;return!1}else n=r.next;if(!r.hasNext)break;r.done&&(u=!0)}return r.hasNext&&e.push(n),!!u}function et(...n){return t=>fn(t,...n)}function rt(n){return n}function ut(){}function it(n){let t=!1,e;return()=>(t||(e=n(),t=!0),e)}function o(n,t,e){const r=n.length-t.length,u=Array.from(t);if(r===0)return n(...u);if(r===1){const i=f=>n(f,...u);return(e||n.lazy)&&(i.lazy=e||n.lazy,i.lazyArgs=t),i}throw new Error("Wrong number of arguments")}function ot(n){return new Promise(t=>{setTimeout(t,n)})}function ft(...n){return o(ct,n)}function ct(n,t){return t.every(e=>e(n))}function st(...n){return o(lt,n)}function lt(n,t){return t.some(e=>e(n))}function at(...n){return o(dt,n)}function dt(n,t){const e=Array.from({length:Math.ceil(n.length/t)});for(let r=0;r<e.length;r+=1)e[r]=n.slice(r*t,(r+1)*t);return e}function sn(n){return Array.isArray(n)}function ht(n){return typeof n=="boolean"}function yt(n){return n instanceof Date}function b(n){return typeof n<"u"&&n!==null}(n=>{function t(e){return e!==void 0}n.strict=t})(b||(b={}));function xt(n){return Object.prototype.toString.call(n)}function y(n){return xt(n)==="[object Object]"}function W(n){return typeof n=="string"}function pt(n){if(sn(n)||W(n))return n.length===0;if(y(n)){for(const t in n)return!1;return!(n instanceof RegExp)}return!1}function zt(n){return n instanceof Error}function gt(n){return typeof n=="function"}function _t(n){return n==null}function At(n){return n!==null}function Nt(n){return t=>!n(t)}function mt(n){return typeof n=="number"&&!Number.isNaN(n)}function Et(n){return n instanceof Promise}function ln(n){return!!n}function Ot(n){return n.filter(ln)}function wt(...n){return o(It,n)}function It(n,t){return n.concat(t)}function an(n){return(t,e)=>t.reduce((r,u,i)=>{const f=n?e(u,i,t):e(u);return r+(f?1:0)},0)}function k(...n){return o(an(!1),n)}(n=>{function t(...e){return o(an(!0),e)}n.indexed=t})(k||(k={}));function d(n,t,e){const r=[];for(let u=0;u<n.length;u++){const i=n[u],f=e?t(i,u,n):t(i);f.hasMany===!0?r.push(...f.next):f.hasNext&&r.push(f.next)}return r}function m(...n){return o(Bt,n,m.lazy)}function Bt(n,t,e){const r=m.lazy(t,e);return d(n,r)}(n=>{function t(e,r){return u=>e.every(i=>!r(u,i))?{done:!1,hasNext:!0,next:u}:{done:!1,hasNext:!1}}n.lazy=t})(m||(m={}));function E(...n){return o(Pt,n,E.lazy)}function Pt(n,t){const e=E.lazy(t);return d(n,e)}(n=>{function t(e){const r=new Set(e);return u=>r.has(u)?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:u}}n.lazy=t})(E||(E={}));function St(...n){return o(Mt,n)}function Mt(n,t){const e=[...n];return t>0&&e.splice(-t),e}function O(...n){return o(Lt,n,O.lazy)}function Lt(n,t){return d(n,O.lazy(t))}(n=>{function t(e){let r=e;return u=>r>0?(r--,{done:!1,hasNext:!1}):{done:!1,hasNext:!0,next:u}}n.lazy=t})(O||(O={}));function h(n){return n.indexed=!0,n}function x(...n){return o(dn(!1),n,x.lazy)}function dn(n){return(t,e)=>d(t,n?x.lazyIndexed(e):x.lazy(e),n)}function hn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e))?{done:!1,hasNext:!0,next:e}:{done:!1,hasNext:!1}}(n=>{function t(...e){return o(dn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=hn(!1),n.lazyIndexed=h(hn(!0))})(x||(x={}));function M(n){return n.single=!0,n}function L(...n){return o(yn(!1),n,L.lazy)}function yn(n){return(t,e)=>n?t.findIndex(e):t.findIndex(r=>e(r))}function xn(n){return t=>{let e=0;return(r,u,i)=>(n?t(r,u,i):t(r))?{done:!0,hasNext:!0,next:e}:(e++,{done:!1,hasNext:!1})}}(n=>{function t(...e){return o(yn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=M(xn(!1)),n.lazyIndexed=M(h(xn(!0)))})(L||(L={}));function U(...n){return o(pn(!1),n)}function pn(n){return(t,e)=>{for(let r=t.length-1;r>=0;r--)if(n?e(t[r],r,t):e(t[r]))return r;return-1}}(n=>{function t(...e){return o(pn(!0),e)}n.indexed=t})(U||(U={}));function v(...n){return o(zn(!1),n)}function zn(n){return(t,e)=>{for(let r=t.length-1;r>=0;r--)if(n?e(t[r],r,t):e(t[r]))return t[r]}}(n=>{function t(...e){return o(zn(!0),e)}n.indexed=t})(v||(v={}));function C(...n){return o(gn(!1),n,C.lazy)}function gn(n){return(t,e)=>n?t.find(e):t.find(r=>e(r))}function _n(n){return t=>(e,r,u)=>{const i=n?t(e,r,u):t(e);return{done:i,hasNext:i,next:e}}}(n=>{function t(...e){return o(gn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=M(_n(!1)),n.lazyIndexed=M(h(_n(!0)))})(C||(C={}));function T(...n){return o(Ct,n,T.lazy)}function Ct([n]){return n}(n=>{function t(){return e=>({done:!0,hasNext:!0,next:e})}n.lazy=t,(e=>{e.single=!0})(t=n.lazy||(n.lazy={}))})(T||(T={}));function q(...n){return o(An(!1),n)}function An(n){return(t,e)=>t.reduce((r,u,i)=>((n?e(u,i,t):e(u)).forEach(([c,s])=>{r[c]=s}),r),{})}(n=>{function t(...e){return o(An(!0),e)}n.indexed=t})(q||(q={}));function p(...n){return o(Tt,n,p.lazy)}function Tt(n){return d(n,p.lazy())}(n=>{function t(){return e=>Array.isArray(e)?{done:!1,hasNext:!0,hasMany:!0,next:e}:{done:!1,hasNext:!0,next:e}}n.lazy=t})(p||(p={}));function R(...n){return o(Rt,n,R.lazy)}function Rt(n,t){return p(n.map(e=>t(e)))}(n=>{function t(e){return r=>{const u=e(r);return Array.isArray(u)?{done:!1,hasNext:!0,hasMany:!0,next:u}:{done:!1,hasNext:!0,next:u}}}n.lazy=t})(R||(R={}));function z(...n){return o(jt,n,z.lazy)}function jt(n){return d(n,z.lazy())}function Dt(n){if(!Array.isArray(n))return n;const t=[];return n.forEach(e=>{Array.isArray(e)?t.push(...z(e)):t.push(e)}),t}(n=>{function t(){return e=>{const r=Dt(e);return Array.isArray(r)?{done:!1,hasNext:!0,hasMany:!0,next:r}:{done:!1,hasNext:!0,next:r}}}n.lazy=t})(z||(z={}));function g(...n){return o(Nn(!1),n,g.lazy)}function Nn(n){return(t,e)=>d(t,n?g.lazyIndexed(e):g.lazy(e),n)}function mn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e),{done:!1,hasNext:!0,next:e})}(n=>{function t(...e){return o(Nn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=mn(!1),n.lazyIndexed=h(mn(!0))})(g||(g={}));function F(...n){return o(En(!1),n)}function En(n){return(t,e)=>{const r={};return t.forEach((u,i)=>{const f=n?e(u,i,t):e(u);if(f!==void 0){const c=String(f);r[c]||(r[c]=[]),r[c].push(u)}}),r}}(n=>{function t(...e){return o(En(!0),e)}n.indexed=t,n.strict=n})(F||(F={}));function K(...n){return o(On(!1),n)}function On(n){return(t,e)=>t.reduce((r,u,i)=>{const f=n?e(u,i,t):e(u),c=String(f);return r[c]=u,r},{})}(n=>{function t(...e){return o(On(!0),e)}n.indexed=t})(K||(K={}));function w(...n){return o(bt,n,w.lazy)}function bt(n,t){const e=w.lazy(t);return d(n,e)}(n=>{function t(e){return r=>new Set(e).has(r)?{done:!1,hasNext:!0,next:r}:{done:!1,hasNext:!1}}n.lazy=t})(w||(w={}));function I(...n){return o(Wt,n,I.lazy)}function Wt(n,t,e){const r=I.lazy(t,e);return d(n,r)}(n=>{function t(e,r){return u=>e.some(i=>r(u,i))?{done:!1,hasNext:!0,next:u}:{done:!1,hasNext:!1}}n.lazy=t})(I||(I={}));function kt(...n){return o(Ut,n)}function Ut(n,t){return n.join(t)}function vt(...n){return o(qt,n)}function qt(n){return n[n.length-1]}function Ft(...n){return o(Kt,n)}function Kt(n){return"length"in n?n.length:Array.from(n).length}function _(...n){return o(wn(!1),n,_.lazy)}function wn(n){return(t,e)=>d(t,n?_.lazyIndexed(e):_.lazy(e),n)}function In(n){return t=>(e,r,u)=>({done:!1,hasNext:!0,next:n?t(e,r,u):t(e)})}(n=>{function t(...e){return o(wn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=In(!1),n.lazyIndexed=h(In(!0)),n.strict=n})(_||(_={}));function $(...n){return o(Bn(!1),n)}function Bn(n){return(t,e)=>t.reduce((r,u,i)=>{const[f,c]=n?e(u,i,t):e(u);return r[f]=c,r},{})}(n=>{function t(...e){return o(Bn(!0),e)}n.indexed=t})($||($={}));function Pn(n){return(t,e)=>{let r,u;return t.forEach((i,f)=>{const c=n?e(i,f,t):e(i);(u===void 0||c>u)&&(r=i,u=c)}),r}}function G(...n){return o(Pn(!1),n)}(n=>{function t(...e){return o(Pn(!0),e)}n.indexed=t})(G||(G={}));function Sn(n){return(t,e)=>{if(t.length===0)return Number.NaN;let r=0;return t.forEach((u,i)=>{r+=n?e(u,i,t):e(u)}),r/t.length}}function H(...n){return o(Sn(!1),n)}(n=>{function t(...e){return o(Sn(!0),e)}n.indexed=t})(H||(H={}));function $t(n){return n.reduce((t,e)=>({...t,...e}),{})}function Mn(n){return(t,e)=>{let r,u;return t.forEach((i,f)=>{const c=n?e(i,f,t):e(i);(u===void 0||c<u)&&(r=i,u=c)}),r}}function Y(...n){return o(Mn(!1),n)}(n=>{function t(...e){return o(Mn(!0),e)}n.indexed=t})(Y||(Y={}));function J(...n){return o(Ln(!1),n)}function Ln(n){return(t,e)=>{const r=[[],[]];return t.forEach((u,i)=>{const f=n?e(u,i,t):e(u);r[f?0:1].push(u)}),r}}(n=>{function t(...e){return o(Ln(!0),e)}n.indexed=t})(J||(J={}));function Cn(...n){return o(Gt,n)}function Gt(n,t){const e=[];for(let r=n;r<t;r++)e.push(r);return e}function Q(...n){return o(Tn(!1),n)}function Tn(n){return(t,e,r)=>t.reduce((u,i,f)=>n?e(u,i,f,t):e(u,i),r)}(n=>{function t(...e){return o(Tn(!0),e)}n.indexed=t})(Q||(Q={}));function A(...n){return o(Rn(!1),n,A.lazy)}function Rn(n){return(t,e)=>d(t,n?A.lazyIndexed(e):A.lazy(e),n)}function jn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e))?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:e}}(n=>{function t(...e){return o(Rn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=jn(!1),n.lazyIndexed=h(jn(!0))})(A||(A={}));function Ht(...n){return o(Yt,n)}function Yt(n){return n.slice().reverse()}function Jt(...n){return o(Qt,n)}function Qt(n,t){if(t<0)throw new RangeError(`sampleSize must cannot be negative: ${t}`);if(!Number.isInteger(t))throw new TypeError(`sampleSize must be an integer: ${t}`);if(t>=n.length)return n;if(t===0)return[];const e=Math.min(t,n.length-t),r=new Set;for(;r.size<e;){const u=Math.floor(Math.random()*n.length);r.add(u)}return t===e?Array.from(r).sort((u,i)=>u-i).map(u=>n[u]):n.filter((u,i)=>!r.has(i))}function Vt(...n){return o(Xt,n)}function Xt(n){const t=n.slice();for(let e=0;e<n.length;e+=1){const r=e+Math.floor(Math.random()*(n.length-e)),u=t[r];t[r]=t[e],t[e]=u}return t}function V(...n){return o(Zt,n)}function Zt(n,t){const e=[...n];return e.sort(t),e}(n=>{n.strict=n})(V||(V={}));var ne=["asc","desc"],te={asc:(n,t)=>n>t,desc:(n,t)=>n<t};function X(n,...t){const e=ee(n)?[[n,...t]]:[n,t];return o(re,e)}function ee(n){if(typeof n=="function")return!0;const[t,e,...r]=n;return r.length>0?!1:typeof t=="function"&&ne.includes(e)}function re(n,t){return[...n].sort(Dn(...t))}function Dn(n,t,...e){const r=typeof n=="function"?n:n[0],u=typeof n=="function"?"asc":n[1],i=te[u],f=t===void 0?void 0:Dn(t,...e);return(c,s)=>{const a=r(c),l=r(s);return i(a,l)?1:i(l,a)?-1:f?.(c,s)??0}}(n=>{n.strict=n})(X||(X={}));function bn(...n){return o(ue,n)}function ue(n,t){const e=[...n],r=e.splice(t);return[e,r]}function ie(...n){return o(oe,n)}function oe(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return bn(n,e);return[n,[]]}function Wn(n){return(t,e)=>{let r=0;return t.forEach((u,i)=>{const f=n?e(u,i,t):e(u);r+=f}),r}}function Z(...n){return o(Wn(!1),n)}(n=>{function t(...e){return o(Wn(!0),e)}n.indexed=t})(Z||(Z={}));function fe(...n){return o(ce,n)}function ce(n,t,e){return typeof n=="string"?se(n,t,e):kn(n,t,e)}function kn(n,t,e){const r=n.slice();if(Number.isNaN(t)||Number.isNaN(e))return r;const u=t<0?n.length+t:t,i=e<0?n.length+e:e;return u<0||u>n.length||i<0||i>n.length||(r[u]=n[i],r[i]=n[u]),r}function se(n,t,e){return kn(n.split(""),t,e).join("")}function B(...n){return o(le,n,B.lazy)}function le(n,t){return d(n,B.lazy(t))}(n=>{function t(e){return r=>e===0?{done:!0,hasNext:!1}:(e--,e===0?{done:!0,hasNext:!0,next:r}:{done:!1,hasNext:!0,next:r})}n.lazy=t})(B||(B={}));function ae(...n){return o(de,n)}function de(n,t){const e=[];for(const r of n){if(!t(r))break;e.push(r)}return e}function P(...n){return o(he,n,P.lazy)}function he(n){return d(n,P.lazy())}(n=>{function t(){const e=new Set;return r=>e.has(r)?{done:!1,hasNext:!1}:(e.add(r),{done:!1,hasNext:!0,next:r})}n.lazy=t})(P||(P={}));function ye(...n){return o(xe,n,Un)}function xe(n,t){return d(n,Un(t))}function Un(n){const t=new Set;return e=>{const r=n(e);return t.has(r)?{done:!1,hasNext:!1}:(t.add(r),{done:!1,hasNext:!0,next:e})}}function S(...n){return o(pe,n,S.lazy)}function pe(n,t){const e=S.lazy(t);return d(n,e,!0)}function ze(n){return(t,e,r)=>r&&r.findIndex(u=>n(t,u))===e?{done:!1,hasNext:!0,next:t}:{done:!1,hasNext:!1}}(n=>{n.lazy=h(ze)})(S||(S={}));function ge(...n){return o(_e,n)}function _e(n,t){const e=n.length>t.length?t.length:n.length,r=[];for(let u=0;u<e;u++)r.push([n[u],t[u]]);return r}function Ae(...n){return o(Ne,n)}function Ne(n,t){const e=n.length>t.length?t.length:n.length,r={};for(let u=0;u<e;u++)r[n[u]]=t[u];return r}function me(...n){if(typeof n[0]=="function"&&n.length===1)return function(t,e){return nn(t,e,n[0])};if(typeof n[0]=="function"&&n.length===2)return function(t){return nn(t,n[1],n[0])};if(n.length===3)return nn(n[0],n[1],n[2])}function nn(n,t,e){const r=n.length>t.length?t.length:n.length,u=[];for(let i=0;i<r;i++)u.push(e(n[i],t[i]));return u}function Ee(...n){return o(Oe,n)}function Oe(n,t){return t.min!=null&&t.min>n?t.min:t.max!=null&&t.max<n?t.max:n}function we(...n){return o(Ie,n)}function Ie(n,t,e){return{...n,[t]:e}}function vn(n){return n===null?"Null":n===void 0?"Undefined":Object.prototype.toString.call(n).slice(8,-1)}function Be(n){return new RegExp(n.source,(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":""))}function qn(n,t,e,r){function u(i){const f=t.length;let c=0;for(;c<f;){if(n===t[c])return e[c];c+=1}t[c+1]=n,e[c+1]=i;for(const s in n)i[s]=r?qn(n[s],t,e,!0):n[s];return i}switch(vn(n)){case"Object":return u({});case"Array":return u([]);case"Date":return new Date(n.valueOf());case"RegExp":return Be(n);default:return n}}function Pe(n){return n!=null&&typeof n.clone=="function"?n.clone():qn(n,[],[],!0)}var Fn=Array.isArray,Kn=Object.keys;function tn(...n){return o(Se,n)}function Se(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){const e=Fn(n),r=Fn(t);let u,i,f;if(e&&r){if(i=n.length,i!==t.length)return!1;for(u=i;u--!==0;)if(!tn(n[u],t[u]))return!1;return!0}if(e!==r)return!1;const c=n instanceof Date,s=t instanceof Date;if(c!==s)return!1;if(c&&s)return n.getTime()===t.getTime();const a=n instanceof RegExp,l=t instanceof RegExp;if(a!==l)return!1;if(a&&l)return n.toString()===t.toString();const N=Kn(n);if(i=N.length,i!==Kn(t).length)return!1;for(u=i;u--!==0;)if(!Object.prototype.hasOwnProperty.call(t,N[u]))return!1;for(u=i;u--!==0;)if(f=N[u],!tn(n[f],t[f]))return!1;return!0}return n!==n&&t!==t}function en(...n){return o($n(!1),n)}function $n(n){return(t,e)=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const u=t[r];n?e(u,r,t):e(u)}return t}}(n=>{function t(...e){return o($n(!0),e)}n.indexed=t})(en||(en={}));function j(n){const t={};for(const[e,r]of n)t[e]=r;return t}(n=>{n.strict=n})(j||(j={}));function Me(...n){return o(Le,n)}function Le(n){const t={};for(const e in n)t[n[e]]=e;return t}function rn(n){return Object.keys(n)}(n=>{n.strict=n})(rn||(rn={}));function Ce(n,t){return arguments.length===1?e=>Gn(e,n):Gn(n,t)}function Gn(n,t){return Object.keys(n).reduce((e,r)=>(e[t(r,n[r])]=n[r],e),{})}function Te(n,t){return arguments.length===1?e=>Hn(e,n):Hn(n,t)}function Hn(n,t){return Object.keys(n).reduce((e,r)=>(e[r]=t(n[r],r),e),{})}function Re(...n){return o(je,n)}function je(n,t){return Object.assign({},n,t)}function Yn({mergeArray:n=!1,original:t,patch:e}){const r=t,u=e;if(Array.isArray(u))return n&&Array.isArray(u)?[...r,...u]:[...u];const i={...r};return y(r)&&y(u)&&Object.keys(u).forEach(f=>{const c=y(r[f])&&y(u[f]),s=Array.isArray(r[f])&&Array.isArray(u[f]);c||s?i[f]=Yn({mergeArray:n,original:r[f],patch:u[f]}):Object.assign(i,{[f]:u[f]})}),i}function De(...n){return o(be,n)}function be(n,t){if(t.length===0)return{...n};if(t.length===1){const[r]=t,{[r]:u,...i}=n;return i}if(!t.some(r=>r in n))return{...n};const e=new Set(t);return j(Object.entries(n).filter(([r])=>!e.has(r)))}function We(...n){return o(ke,n)}function ke(n,t){return Object.keys(n).reduce((e,r)=>(t(n[r],r)||(e[r]=n[r]),e),{})}function Ue(...n){return o(ve,n)}function ve(n,t,e){let r=n;for(const u of t){if(r==null||r[u]==null)return e;r=r[u]}return r}function qe(...n){return o(Fe,n)}function Fe(n,t){return n==null?{}:t.reduce((e,r)=>(r in n&&(e[r]=n[r]),e),{})}function Ke(...n){return o($e,n)}function $e(n,t){return n==null?{}:Object.keys(n).reduce((e,r)=>(t(n[r],r)&&(e[r]=n[r]),e),{})}function Ge(n){return({[n]:t})=>t}function He(...n){return o(Ye,n)}function Ye(n,t,e){return{...n,[t]:e}}function Je(...n){return o(D,n)}function D(n,t,e){return t.length===0?e:Array.isArray(n)?n.map((r,u)=>u===t[0]?D(r,t.slice(1),e):r):{...n,[t[0]]:D(n[t[0]],t.slice(1),e)}}function Qe(...n){return o(Ve,n)}function Ve(n,t,e){const{[t]:r,[e]:u}=n;return{...n,[t]:u,[e]:r}}function un(n){return Object.entries(n)}(n=>{function t(e){return Object.entries(e)}n.strict=t})(un||(un={}));function Xe(n){return Object.values(n)}var Ze=/\d/,nr=["-","_","/","."];function Jn(n=""){if(!Ze.test(n))return n.toUpperCase()===n}function on(n,t){const e=t??nr,r=[];if(!n||!W(n))return r;let u="",i,f;for(const c of n){const s=e.includes(c);if(s===!0){r.push(u),u="",i=void 0;continue}const a=Jn(c);if(f===!1){if(i===!1&&a===!0){r.push(u),u=c,i=a;continue}if(i===!0&&a===!1&&u.length>1){const l=u[u.length-1];r.push(u.slice(0,Math.max(0,u.length-1))),u=l+c,i=a;continue}}u+=c,i=a,f=s}return r.push(u),r}function Qn(n){return n?n[0].toUpperCase()+n.slice(1):""}function Vn(n){return n?n[0].toLowerCase()+n.slice(1):""}function Xn(n){return n?(Array.isArray(n)?n:on(n)).map(t=>Qn(t)).join(""):""}function tr(n){return Vn(Xn(n||""))}function Zn(n,t){return n?(Array.isArray(n)?n:on(n)).map(e=>e.toLowerCase()).join(t??"-"):""}function er(n){return Zn(n||"","_")}function rr(n,t=1e3){if(n<t)return`${n} B`;const e=t===1024?["Ki","Mi","Gi"]:["k","M","G"];let r=-1;for(;Math.abs(n)>=t&&r<e.length-1;)n/=t,++r;return`${n.toFixed(1)} ${e[r]}B`}function ur(n){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=()=>t[Math.floor(Math.random()*t.length)];return Cn(0,n).reduce(r=>r+e(),"")}function ir(n){return n.normalize("NFD").replace(/[\u0300-\u036F]/g,"").toLowerCase().replace(/[^a-z0-9]/g," ").trim().replace(/\s+/g,"-")}function or(n){return nt(n)}function nt(n){if(n.length===0)return[];const t=n.match(/^\[(.+?)\](.*)$/)??n.match(/^\.?([^.[\]]+)(.*)$/);if(t){const[,e,r]=t;return[e,...nt(r)]}return[n]}var fr=typeof window<"u";export{tt as KEY_CODES,D as _setPath,we as addProp,ft as allPass,st as anyPass,at as chunk,Ee as clamp,Pe as clone,Ot as compact,wt as concat,k as countBy,et as createPipe,E as difference,m as differenceWith,O as drop,St as dropLast,tn as equals,x as filter,C as find,L as findIndex,v as findLast,U as findLastIndex,T as first,R as flatMap,q as flatMapToObj,p as flatten,z as flattenDeep,g as forEach,en as forEachObj,j as fromPairs,F as groupBy,rr as humanReadableFileSize,rt as identity,K as indexBy,w as intersection,I as intersectionWith,Me as invert,sn as isArray,ht as isBoolean,fr as isBrowser,yt as isDate,b as isDefined,pt as isEmpty,zt as isError,gt as isFunction,_t as isNil,At as isNonNull,Nt as isNot,mt as isNumber,y as isObject,Et as isPromise,W as isString,ln as isTruthy,Jn as isUppercase,kt as join,rn as keys,vt as last,Ft as length,_ as map,Ce as mapKeys,$ as mapToObj,Te as mapValues,G as maxBy,H as meanBy,Re as merge,$t as mergeAll,Yn as mergeDeep,Y as minBy,ut as noop,De as omit,We as omitBy,it as once,J as partition,Ue as pathOr,qe as pick,Ke as pickBy,fn as pipe,Ge as prop,o as purry,ur as randomString,Cn as range,Q as reduce,A as reject,Ht as reverse,Jt as sample,He as set,Je as setPath,Vt as shuffle,ot as sleep,ir as slugify,V as sort,X as sortBy,bn as splitAt,on as splitByCase,ie as splitWhen,or as stringToPath,Z as sumBy,fe as swapIndices,Qe as swapProps,B as take,ae as takeWhile,tr as toCamelCase,Zn as toKebabCase,Vn as toLowerFirst,un as toPairs,Xn as toPascalCase,er as toSnakeCase,Qn as toUpperFirst,vn as type,P as uniq,ye as uniqBy,S as uniqWith,Xe as values,ge as zip,Ae as zipObj,me as zipWith};
1
+ "use strict";var ut={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",AT:"@",BACKSPACE:"Backspace",CTRL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESC:"Escape",HOME:"Home",KEY_F:"KEY_F",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:"Space",TAB:"Tab"};function cn(n,...t){let e=n;const r=t.map(o=>{const{lazy:f,lazyArgs:c}=o;if(f){const s=f(...c||[]);return s.indexed=f.indexed,s.single=f.single,s.index=0,s.items=[],s}return null});let u=0;for(;u<t.length;){const o=t[u];if(!r[u]){e=o(e),u++;continue}const c=[];for(let l=u;l<t.length&&r[l];l++)if(c.push(r[l]),r[l].single)break;const s=[];for(const l of e)if(sn({acc:s,item:l,lazySeq:c}))break;c[c.length-1].single?e=s[0]:e=s,u+=c.length}return e}function sn({acc:n,item:t,lazySeq:e}){if(e.length===0)return n.push(t),!1;let r={done:!1,hasNext:!1},u=!1;for(let o=0;o<e.length;o++){const f=e[o],c=f.indexed,s=f.index,d=f.items;if(d.push(t),r=c?f(t,s,d):f(t),f.index++,r.hasNext)if(r.hasMany){const l=r.next;for(const a of l)if(sn({acc:n,item:a,lazySeq:e.slice(o+1)}))return!0;return!1}else t=r.next;if(!r.hasNext)break;r.done&&(u=!0)}return r.hasNext&&n.push(t),!!u}function ot(...n){return t=>cn(t,...n)}function it(n){return n}function ft(){}function ct(n){let t=!1,e;return()=>(t||(e=n(),t=!0),e)}function st(n,{maxWaitMs:t,timing:e="trailing",waitMs:r}){if(t!==void 0&&r!==void 0&&t<r)throw new Error(`debounce: maxWaitMs (${t}) cannot be less than waitMs (${r})`);let u,o,f,c;function s(a){f=a,t!==void 0&&o===void 0&&(o=setTimeout(d,t))}function d(){if(f===void 0)return;if(o!==void 0){const P=o;o=void 0,clearTimeout(P)}const a=f;f=void 0,c=n(...a)}function l(){if(u===void 0)return;const a=u;u=void 0,clearTimeout(a),f!==void 0&&d()}return{get cachedValue(){return c},call:(...a)=>{if(u===void 0)e==="trailing"?s(a):c=n(...a);else{e!=="leading"&&s(a);const P=u;u=void 0,clearTimeout(P)}return u=setTimeout(l,r??t??0),c},cancel:()=>{if(u!==void 0){const a=u;u=void 0,clearTimeout(a)}if(o!==void 0){const a=o;o=void 0,clearTimeout(a)}f=void 0},flush:()=>(l(),c),get isPending(){return u!==void 0}}}function i(n,t,e){const r=n.length-t.length,u=Array.from(t);if(r===0)return n(...u);if(r===1){const o=f=>n(f,...u);return(e||n.lazy)&&(o.lazy=e||n.lazy,o.lazyArgs=t),o}throw new Error("Wrong number of arguments")}function lt(n){return new Promise(t=>{setTimeout(t,n)})}function at(...n){return i(dt,n)}function dt(n,t){return t.every(e=>e(n))}function ht(...n){return i(yt,n)}function yt(n,t){return t.some(e=>e(n))}function pt(...n){return i(xt,n)}function xt(n,t){const e=Array.from({length:Math.ceil(n.length/t)});for(let r=0;r<e.length;r+=1)e[r]=n.slice(r*t,(r+1)*t);return e}function ln(n){return Array.isArray(n)}function gt(n){return typeof n=="boolean"}function zt(n){return n instanceof Date}function M(n){return typeof n<"u"&&n!==null}(n=>{function t(e){return e!==void 0}n.strict=t})(M||(M={}));function _t(n){return Object.prototype.toString.call(n)}function an(n){return _t(n)==="[object Object]"}function b(n){return typeof n=="string"}function mt(n){if(ln(n)||b(n))return n.length===0;if(an(n)){for(const t in n)return!1;return!(n instanceof RegExp)}return!1}function At(n){return n instanceof Error}function Nt(n){return typeof n=="function"}function Et(n){return n==null}function It(n){return n!==null}function Ot(n){return t=>!n(t)}function wt(n){return typeof n=="number"&&!Number.isNaN(n)}function Bt(n){return n instanceof Promise}function dn(n){return!!n}function Tt(n){return n.filter(dn)}function Pt(...n){return i(vt,n)}function vt(n,t){return n.concat(t)}function hn(n){return(t,e)=>t.reduce((r,u,o)=>{const f=n?e(u,o,t):e(u);return r+(f?1:0)},0)}function j(...n){return i(hn(!1),n)}(n=>{function t(...e){return i(hn(!0),e)}n.indexed=t})(j||(j={}));function h(n,t,e){const r=[];for(let u=0;u<n.length;u++){const o=n[u],f=e?t(o,u,n):t(o);f.hasMany===!0?r.push(...f.next):f.hasNext&&r.push(f.next)}return r}function A(...n){return i(St,n,A.lazy)}function St(n,t,e){const r=A.lazy(t,e);return h(n,r)}(n=>{function t(e,r){return u=>e.every(o=>!r(u,o))?{done:!1,hasNext:!0,next:u}:{done:!1,hasNext:!1}}n.lazy=t})(A||(A={}));function N(...n){return i(Ct,n,N.lazy)}function Ct(n,t){const e=N.lazy(t);return h(n,e)}(n=>{function t(e){const r=new Set(e);return u=>r.has(u)?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:u}}n.lazy=t})(N||(N={}));function Dt(...n){return i(kt,n)}function kt(n,t){const e=[...n];return t>0&&e.splice(-t),e}function E(...n){return i(Lt,n,E.lazy)}function Lt(n,t){return h(n,E.lazy(t))}(n=>{function t(e){let r=e;return u=>r>0?(r--,{done:!1,hasNext:!1}):{done:!1,hasNext:!0,next:u}}n.lazy=t})(E||(E={}));function y(n){return n.indexed=!0,n}function p(...n){return i(yn(!1),n,p.lazy)}function yn(n){return(t,e)=>h(t,n?p.lazyIndexed(e):p.lazy(e),n)}function pn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e))?{done:!1,hasNext:!0,next:e}:{done:!1,hasNext:!1}}(n=>{function t(...e){return i(yn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=pn(!1),n.lazyIndexed=y(pn(!0))})(p||(p={}));function v(n){return n.single=!0,n}function S(...n){return i(xn(!1),n,S.lazy)}function xn(n){return(t,e)=>n?t.findIndex(e):t.findIndex(r=>e(r))}function gn(n){return t=>{let e=0;return(r,u,o)=>(n?t(r,u,o):t(r))?{done:!0,hasNext:!0,next:e}:(e++,{done:!1,hasNext:!1})}}(n=>{function t(...e){return i(xn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=v(gn(!1)),n.lazyIndexed=v(y(gn(!0)))})(S||(S={}));function W(...n){return i(zn(!1),n)}function zn(n){return(t,e)=>{for(let r=t.length-1;r>=0;r--)if(n?e(t[r],r,t):e(t[r]))return r;return-1}}(n=>{function t(...e){return i(zn(!0),e)}n.indexed=t})(W||(W={}));function U(...n){return i(_n(!1),n)}function _n(n){return(t,e)=>{for(let r=t.length-1;r>=0;r--)if(n?e(t[r],r,t):e(t[r]))return t[r]}}(n=>{function t(...e){return i(_n(!0),e)}n.indexed=t})(U||(U={}));function C(...n){return i(mn(!1),n,C.lazy)}function mn(n){return(t,e)=>n?t.find(e):t.find(r=>e(r))}function An(n){return t=>(e,r,u)=>{const o=n?t(e,r,u):t(e);return{done:o,hasNext:o,next:e}}}(n=>{function t(...e){return i(mn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=v(An(!1)),n.lazyIndexed=v(y(An(!0)))})(C||(C={}));function D(...n){return i(Rt,n,D.lazy)}function Rt([n]){return n}(n=>{function t(){return e=>({done:!0,hasNext:!0,next:e})}n.lazy=t,(e=>{e.single=!0})(t=n.lazy||(n.lazy={}))})(D||(D={}));function q(...n){return i(Nn(!1),n)}function Nn(n){return(t,e)=>t.reduce((r,u,o)=>((n?e(u,o,t):e(u)).forEach(([c,s])=>{r[c]=s}),r),{})}(n=>{function t(...e){return i(Nn(!0),e)}n.indexed=t})(q||(q={}));function x(...n){return i(Mt,n,x.lazy)}function Mt(n){return h(n,x.lazy())}(n=>{function t(){return e=>Array.isArray(e)?{done:!1,hasMany:!0,hasNext:!0,next:e}:{done:!1,hasNext:!0,next:e}}n.lazy=t})(x||(x={}));function k(...n){return i(bt,n,k.lazy)}function bt(n,t){return x(n.map(e=>t(e)))}(n=>{function t(e){return r=>{const u=e(r);return Array.isArray(u)?{done:!1,hasMany:!0,hasNext:!0,next:u}:{done:!1,hasNext:!0,next:u}}}n.lazy=t})(k||(k={}));function g(...n){return i(jt,n,g.lazy)}function jt(n){return h(n,g.lazy())}function Wt(n){if(!Array.isArray(n))return n;const t=[];return n.forEach(e=>{Array.isArray(e)?t.push(...g(e)):t.push(e)}),t}(n=>{function t(){return e=>{const r=Wt(e);return Array.isArray(r)?{done:!1,hasMany:!0,hasNext:!0,next:r}:{done:!1,hasNext:!0,next:r}}}n.lazy=t})(g||(g={}));function z(...n){return i(En(!1),n,z.lazy)}function En(n){return(t,e)=>h(t,n?z.lazyIndexed(e):z.lazy(e),n)}function In(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e),{done:!1,hasNext:!0,next:e})}(n=>{function t(...e){return i(En(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=In(!1),n.lazyIndexed=y(In(!0))})(z||(z={}));function F(...n){return i(On(!1),n)}function On(n){return(t,e)=>{const r={};return t.forEach((u,o)=>{const f=n?e(u,o,t):e(u);if(f!==void 0){const c=String(f);r[c]||(r[c]=[]),r[c].push(u)}}),r}}(n=>{function t(...e){return i(On(!0),e)}n.indexed=t,n.strict=n})(F||(F={}));function K(...n){return i(wn(!1),n)}function wn(n){return(t,e)=>t.reduce((r,u,o)=>{const f=n?e(u,o,t):e(u),c=String(f);return r[c]=u,r},{})}(n=>{function t(...e){return i(wn(!0),e)}n.indexed=t})(K||(K={}));function I(...n){return i(Ut,n,I.lazy)}function Ut(n,t){const e=I.lazy(t);return h(n,e)}(n=>{function t(e){return r=>new Set(e).has(r)?{done:!1,hasNext:!0,next:r}:{done:!1,hasNext:!1}}n.lazy=t})(I||(I={}));function O(...n){return i(qt,n,O.lazy)}function qt(n,t,e){const r=O.lazy(t,e);return h(n,r)}(n=>{function t(e,r){return u=>e.some(o=>r(u,o))?{done:!1,hasNext:!0,next:u}:{done:!1,hasNext:!1}}n.lazy=t})(O||(O={}));function Ft(...n){return i(Kt,n)}function Kt(n,t){return n.join(t)}function $t(...n){return i(Gt,n)}function Gt(n){return n[n.length-1]}function Ht(...n){return i(Vt,n)}function Vt(n){return"length"in n?n.length:Array.from(n).length}function _(...n){return i(Bn(!1),n,_.lazy)}function Bn(n){return(t,e)=>h(t,n?_.lazyIndexed(e):_.lazy(e),n)}function Tn(n){return t=>(e,r,u)=>({done:!1,hasNext:!0,next:n?t(e,r,u):t(e)})}(n=>{function t(...e){return i(Bn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=Tn(!1),n.lazyIndexed=y(Tn(!0)),n.strict=n})(_||(_={}));function $(...n){return i(Pn(!1),n)}function Pn(n){return(t,e)=>t.reduce((r,u,o)=>{const[f,c]=n?e(u,o,t):e(u);return r[f]=c,r},{})}(n=>{function t(...e){return i(Pn(!0),e)}n.indexed=t})($||($={}));function vn(n){return(t,e)=>{let r,u;return t.forEach((o,f)=>{const c=n?e(o,f,t):e(o);(u===void 0||c>u)&&(r=o,u=c)}),r}}function G(...n){return i(vn(!1),n)}(n=>{function t(...e){return i(vn(!0),e)}n.indexed=t})(G||(G={}));function Sn(n){return(t,e)=>{if(t.length===0)return Number.NaN;let r=0;return t.forEach((u,o)=>{r+=n?e(u,o,t):e(u)}),r/t.length}}function H(...n){return i(Sn(!1),n)}(n=>{function t(...e){return i(Sn(!0),e)}n.indexed=t})(H||(H={}));function Yt(n){return n.reduce((t,e)=>({...t,...e}),{})}function Cn(n){return(t,e)=>{let r,u;return t.forEach((o,f)=>{const c=n?e(o,f,t):e(o);(u===void 0||c<u)&&(r=o,u=c)}),r}}function V(...n){return i(Cn(!1),n)}(n=>{function t(...e){return i(Cn(!0),e)}n.indexed=t})(V||(V={}));function Y(...n){return i(Dn(!1),n)}function Dn(n){return(t,e)=>{const r=[[],[]];return t.forEach((u,o)=>{const f=n?e(u,o,t):e(u);r[f?0:1].push(u)}),r}}(n=>{function t(...e){return i(Dn(!0),e)}n.indexed=t})(Y||(Y={}));function kn(...n){return i(Jt,n)}function Jt(n,t){const e=[];for(let r=n;r<t;r++)e.push(r);return e}function J(...n){return i(Ln(!1),n)}function Ln(n){return(t,e,r)=>t.reduce((u,o,f)=>n?e(u,o,f,t):e(u,o),r)}(n=>{function t(...e){return i(Ln(!0),e)}n.indexed=t})(J||(J={}));function m(...n){return i(Rn(!1),n,m.lazy)}function Rn(n){return(t,e)=>h(t,n?m.lazyIndexed(e):m.lazy(e),n)}function Mn(n){return t=>(e,r,u)=>(n?t(e,r,u):t(e))?{done:!1,hasNext:!1}:{done:!1,hasNext:!0,next:e}}(n=>{function t(...e){return i(Rn(!0),e,n.lazyIndexed)}n.indexed=t,n.lazy=Mn(!1),n.lazyIndexed=y(Mn(!0))})(m||(m={}));function Qt(...n){return i(Xt,n)}function Xt(n){return n.slice().reverse()}function Zt(...n){return i(ne,n)}function ne(n,t){if(t<0)throw new RangeError(`sampleSize must cannot be negative: ${t}`);if(!Number.isInteger(t))throw new TypeError(`sampleSize must be an integer: ${t}`);if(t>=n.length)return n;if(t===0)return[];const e=Math.min(t,n.length-t),r=new Set;for(;r.size<e;){const u=Math.floor(Math.random()*n.length);r.add(u)}return t===e?Array.from(r).sort((u,o)=>u-o).map(u=>n[u]):n.filter((u,o)=>!r.has(o))}function te(...n){return i(ee,n)}function ee(n){const t=n.slice();for(let e=0;e<n.length;e+=1){const r=e+Math.floor(Math.random()*(n.length-e)),u=t[r];t[r]=t[e],t[e]=u}return t}function Q(...n){return i(re,n)}function re(n,t){const e=[...n];return e.sort(t),e}(n=>{n.strict=n})(Q||(Q={}));var ue=["asc","desc"],oe={asc:(n,t)=>n>t,desc:(n,t)=>n<t};function X(n,...t){const e=ie(n)?[[n,...t]]:[n,t];return i(fe,e)}function ie(n){if(typeof n=="function")return!0;const[t,e,...r]=n;return r.length>0?!1:typeof t=="function"&&ue.includes(e)}function fe(n,t){return[...n].sort(bn(...t))}function bn(n,t,...e){const r=typeof n=="function"?n:n[0],u=typeof n=="function"?"asc":n[1],o=oe[u],f=t===void 0?void 0:bn(t,...e);return(c,s)=>{const d=r(c),l=r(s);return o(d,l)?1:o(l,d)?-1:f?.(c,s)??0}}(n=>{n.strict=n})(X||(X={}));function jn(...n){return i(ce,n)}function ce(n,t){const e=[...n],r=e.splice(t);return[e,r]}function se(...n){return i(le,n)}function le(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return jn(n,e);return[n,[]]}function Wn(n){return(t,e)=>{let r=0;return t.forEach((u,o)=>{const f=n?e(u,o,t):e(u);r+=f}),r}}function Z(...n){return i(Wn(!1),n)}(n=>{function t(...e){return i(Wn(!0),e)}n.indexed=t})(Z||(Z={}));function ae(...n){return i(de,n)}function de(n,t,e){return typeof n=="string"?he(n,t,e):Un(n,t,e)}function Un(n,t,e){const r=n.slice();if(Number.isNaN(t)||Number.isNaN(e))return r;const u=t<0?n.length+t:t,o=e<0?n.length+e:e;return u<0||u>n.length||o<0||o>n.length||(r[u]=n[o],r[o]=n[u]),r}function he(n,t,e){return Un(n.split(""),t,e).join("")}function w(...n){return i(ye,n,w.lazy)}function ye(n,t){return h(n,w.lazy(t))}(n=>{function t(e){return r=>e===0?{done:!0,hasNext:!1}:(e--,e===0?{done:!0,hasNext:!0,next:r}:{done:!1,hasNext:!0,next:r})}n.lazy=t})(w||(w={}));function pe(...n){return i(xe,n)}function xe(n,t){const e=[];for(const r of n){if(!t(r))break;e.push(r)}return e}function B(...n){return i(ge,n,B.lazy)}function ge(n){return h(n,B.lazy())}(n=>{function t(){const e=new Set;return r=>e.has(r)?{done:!1,hasNext:!1}:(e.add(r),{done:!1,hasNext:!0,next:r})}n.lazy=t})(B||(B={}));function ze(...n){return i(_e,n,qn)}function _e(n,t){return h(n,qn(t))}function qn(n){const t=new Set;return e=>{const r=n(e);return t.has(r)?{done:!1,hasNext:!1}:(t.add(r),{done:!1,hasNext:!0,next:e})}}function T(...n){return i(me,n,T.lazy)}function me(n,t){const e=T.lazy(t);return h(n,e,!0)}function Ae(n){return(t,e,r)=>r&&r.findIndex(u=>n(t,u))===e?{done:!1,hasNext:!0,next:t}:{done:!1,hasNext:!1}}(n=>{n.lazy=y(Ae)})(T||(T={}));function nn(...n){return i(Ne,n)}function Ne(n,t){const e=n.length>t.length?t.length:n.length,r=[];for(let u=0;u<e;u++)r.push([n[u],t[u]]);return r}(n=>{n.strict=n})(nn||(nn={}));function Ee(...n){return i(Ie,n)}function Ie(n,t){const e=n.length>t.length?t.length:n.length,r={};for(let u=0;u<e;u++)r[n[u]]=t[u];return r}function Oe(...n){if(typeof n[0]=="function"&&n.length===1)return function(t,e){return tn(t,e,n[0])};if(typeof n[0]=="function"&&n.length===2)return function(t){return tn(t,n[1],n[0])};if(n.length===3)return tn(n[0],n[1],n[2])}function tn(n,t,e){const r=n.length>t.length?t.length:n.length,u=[];for(let o=0;o<r;o++)u.push(e(n[o],t[o]));return u}function we(...n){return i(Be,n)}function Be(n,t){return t.min!=null&&t.min>n?t.min:t.max!=null&&t.max<n?t.max:n}function Te(...n){return i(Pe,n)}function Pe(n,t,e){return{...n,[t]:e}}function Fn(n){return n===null?"Null":n===void 0?"Undefined":Object.prototype.toString.call(n).slice(8,-1)}function ve(n){return new RegExp(n.source,(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":""))}function Kn(n,t,e,r){function u(o){const f=t.length;let c=0;for(;c<f;){if(n===t[c])return e[c];c+=1}t[c+1]=n,e[c+1]=o;for(const s in n)o[s]=r?Kn(n[s],t,e,!0):n[s];return o}switch(Fn(n)){case"Object":return u({});case"Array":return u([]);case"Date":return new Date(n.valueOf());case"RegExp":return ve(n);default:return n}}function Se(n){return n!=null&&typeof n.clone=="function"?n.clone():Kn(n,[],[],!0)}var $n=Array.isArray,Gn=Object.keys;function en(...n){return i(Ce,n)}function Ce(n,t){if(n===t)return!0;if(n&&t&&typeof n=="object"&&typeof t=="object"){const e=$n(n),r=$n(t);let u,o,f;if(e&&r){if(o=n.length,o!==t.length)return!1;for(u=o;u--!==0;)if(!en(n[u],t[u]))return!1;return!0}if(e!==r)return!1;const c=n instanceof Date,s=t instanceof Date;if(c!==s)return!1;if(c&&s)return n.getTime()===t.getTime();const d=n instanceof RegExp,l=t instanceof RegExp;if(d!==l)return!1;if(d&&l)return n.toString()===t.toString();const a=Gn(n);if(o=a.length,o!==Gn(t).length)return!1;for(u=o;u--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[u]))return!1;for(u=o;u--!==0;)if(f=a[u],!en(n[f],t[f]))return!1;return!0}return n!==n&&t!==t}function rn(...n){return i(Hn(!1),n)}function Hn(n){return(t,e)=>{for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const u=t[r];n?e(u,r,t):e(u)}return t}}(n=>{function t(...e){return i(Hn(!0),e)}n.indexed=t})(rn||(rn={}));function L(n){const t={};for(const[e,r]of n)t[e]=r;return t}(n=>{n.strict=n})(L||(L={}));function De(...n){return i(ke,n)}function ke(n){const t={};for(const e in n)t[n[e]]=e;return t}function un(n){return Object.keys(n)}(n=>{n.strict=n})(un||(un={}));function Le(n,t){return arguments.length===1?e=>Vn(e,n):Vn(n,t)}function Vn(n,t){return Object.keys(n).reduce((e,r)=>(e[t(r,n[r])]=n[r],e),{})}function Re(n,t){return arguments.length===1?e=>Yn(e,n):Yn(n,t)}function Yn(n,t){return Object.keys(n).reduce((e,r)=>(e[r]=t(n[r],r),e),{})}function Me(...n){return i(be,n)}function be(n,t){return Object.assign({},n,t)}function je(...n){return i(Jn,n)}function Jn(n,t){const e={...n,...t};for(const r in t){if(!(r in n))continue;const u=n[r];if(!Qn(u))continue;const o=t[r];Qn(o)&&(e[r]=Jn(u,o))}return e}function Qn(n){return typeof n=="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype}function We(...n){return i(Ue,n)}function Ue(n,t){if(t.length===0)return{...n};if(t.length===1){const[r]=t,{[r]:u,...o}=n;return o}if(!t.some(r=>r in n))return{...n};const e=new Set(t);return L(Object.entries(n).filter(([r])=>!e.has(r)))}function qe(...n){return i(Fe,n)}function Fe(n,t){return Object.keys(n).reduce((e,r)=>(t(n[r],r)||(e[r]=n[r]),e),{})}function Ke(...n){return i($e,n)}function $e(n,t,e){let r=n;for(const u of t){if(r==null||r[u]==null)return e;r=r[u]}return r}function Ge(...n){return i(He,n)}function He(n,t){return n==null?{}:t.reduce((e,r)=>(r in n&&(e[r]=n[r]),e),{})}function Ve(...n){return i(Ye,n)}function Ye(n,t){return n==null?{}:Object.keys(n).reduce((e,r)=>(t(n[r],r)&&(e[r]=n[r]),e),{})}function Je(n){return({[n]:t})=>t}function Qe(...n){return i(Xe,n)}function Xe(n,t,e){return{...n,[t]:e}}function Ze(...n){return i(R,n)}function R(n,t,e){return t.length===0?e:Array.isArray(n)?n.map((r,u)=>u===t[0]?R(r,t.slice(1),e):r):{...n,[t[0]]:R(n[t[0]],t.slice(1),e)}}function nr(...n){return i(tr,n)}function tr(n,t,e){const{[t]:r,[e]:u}=n;return{...n,[t]:u,[e]:r}}function on(n){return Object.entries(n)}(n=>{function t(e){return Object.entries(e)}n.strict=t})(on||(on={}));function er(n){return Object.values(n)}var rr=/\d/,ur=["-","_","/","."];function Xn(n=""){if(!rr.test(n))return n.toUpperCase()===n}function fn(n,t){const e=t??ur,r=[];if(!n||!b(n))return r;let u="",o,f;for(const c of n){const s=e.includes(c);if(s===!0){r.push(u),u="",o=void 0;continue}const d=Xn(c);if(f===!1){if(o===!1&&d===!0){r.push(u),u=c,o=d;continue}if(o===!0&&d===!1&&u.length>1){const l=u[u.length-1];r.push(u.slice(0,Math.max(0,u.length-1))),u=l+c,o=d;continue}}u+=c,o=d,f=s}return r.push(u),r}function Zn(n){return n?n[0].toUpperCase()+n.slice(1):""}function nt(n){return n?n[0].toLowerCase()+n.slice(1):""}function tt(n){return n?(Array.isArray(n)?n:fn(n)).map(t=>Zn(t)).join(""):""}function or(n){return nt(tt(n||""))}function et(n,t){return n?(Array.isArray(n)?n:fn(n)).map(e=>e.toLowerCase()).join(t??"-"):""}function ir(n){return et(n||"","_")}function fr(n,t=1e3){if(n<t)return`${n} B`;const e=t===1024?["Ki","Mi","Gi"]:["k","M","G"];let r=-1;for(;Math.abs(n)>=t&&r<e.length-1;)n/=t,++r;return`${n.toFixed(1)} ${e[r]}B`}function cr(n){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=()=>t[Math.floor(Math.random()*t.length)];return kn(0,n).reduce(r=>r+e(),"")}function sr(n){return n.normalize("NFD").replace(/[\u0300-\u036F]/g,"").toLowerCase().replace(/[^a-z0-9]/g," ").trim().replace(/\s+/g,"-")}function lr(n){return rt(n)}function rt(n){if(n.length===0)return[];const t=n.match(/^\[(.+?)\](.*)$/)??n.match(/^\.?([^.[\]]+)(.*)$/);if(t){const[,e,r]=t;return[e,...rt(r)]}return[n]}var ar=typeof window<"u";export{ut as KEY_CODES,R as _setPath,Te as addProp,at as allPass,ht as anyPass,pt as chunk,we as clamp,Se as clone,Tt as compact,Pt as concat,j as countBy,ot as createPipe,st as debounce,N as difference,A as differenceWith,E as drop,Dt as dropLast,en as equals,p as filter,C as find,S as findIndex,U as findLast,W as findLastIndex,D as first,k as flatMap,q as flatMapToObj,x as flatten,g as flattenDeep,z as forEach,rn as forEachObj,L as fromPairs,F as groupBy,fr as humanReadableFileSize,it as identity,K as indexBy,I as intersection,O as intersectionWith,De as invert,ln as isArray,gt as isBoolean,ar as isBrowser,zt as isDate,M as isDefined,mt as isEmpty,At as isError,Nt as isFunction,Et as isNil,It as isNonNull,Ot as isNot,wt as isNumber,an as isObject,Bt as isPromise,b as isString,dn as isTruthy,Xn as isUppercase,Ft as join,un as keys,$t as last,Ht as length,_ as map,Le as mapKeys,$ as mapToObj,Re as mapValues,G as maxBy,H as meanBy,Me as merge,Yt as mergeAll,je as mergeDeep,V as minBy,ft as noop,We as omit,qe as omitBy,ct as once,Y as partition,Ke as pathOr,Ge as pick,Ve as pickBy,cn as pipe,Je as prop,i as purry,cr as randomString,kn as range,J as reduce,m as reject,Qt as reverse,Zt as sample,Qe as set,Ze as setPath,te as shuffle,lt as sleep,sr as slugify,Q as sort,X as sortBy,jn as splitAt,fn as splitByCase,se as splitWhen,lr as stringToPath,Z as sumBy,ae as swapIndices,nr as swapProps,w as take,pe as takeWhile,or as toCamelCase,et as toKebabCase,nt as toLowerFirst,on as toPairs,tt as toPascalCase,ir as toSnakeCase,Zn as toUpperFirst,Fn as type,B as uniq,ze as uniqBy,T as uniqWith,er as values,nn as zip,Ee as zipObj,Oe as zipWith};
2
2
  //# sourceMappingURL=index.min.js.map