gesturx 1.8.8 → 1.8.10

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,51 +1,49 @@
1
1
  var ie = Object.defineProperty;
2
- var se = (t, n, e) => n in t ? ie(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var $ = (t, n, e) => se(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { filter as h, fromEvent as S, mergeMap as b, defer as pe, of as T, merge as g, takeWhile as V, scan as L, map as c, BehaviorSubject as q, switchMap as v, share as P, distinctUntilChanged as oe, startWith as re, shareReplay as M, combineLatest as j, exhaustMap as H, first as z, timer as J, withLatestFrom as C, takeUntil as I, skip as ae, tap as K, ignoreElements as le, buffer as he, debounceTime as ce, NEVER as $e, defaultIfEmpty as ue } from "rxjs";
5
- function de(t, n) {
6
- return Math.sqrt(
7
- Math.pow(n.x - t.x, 2) + Math.pow(n.y - t.y, 2)
8
- );
2
+ var se = (t, i, e) => i in t ? ie(t, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[i] = e;
3
+ var $ = (t, i, e) => se(t, typeof i != "symbol" ? i + "" : i, e);
4
+ import { filter as h, fromEvent as S, mergeMap as b, defer as pe, of as T, merge as y, takeWhile as V, scan as L, map as c, BehaviorSubject as q, switchMap as g, share as P, distinctUntilChanged as oe, startWith as re, shareReplay as M, combineLatest as j, exhaustMap as H, first as z, timer as J, withLatestFrom as C, takeUntil as I, skip as ae, tap as K, ignoreElements as le, buffer as he, debounceTime as ce, NEVER as $e, defaultIfEmpty as ue } from "rxjs";
5
+ function de(t, i) {
6
+ return Math.sqrt((i.x - t.x) ** 2 + (i.y - t.y) ** 2);
9
7
  }
10
8
  function ve(t) {
11
- const n = t.length;
12
- if (n < 2) return 0;
13
- const e = t.reduce((o, p, a) => o + t.slice(a + 1).reduce((s, r) => s + de(p, r), 0), 0), i = n * (n - 1) / 2;
14
- return e / i;
9
+ const i = t.length;
10
+ if (i < 2) return 0;
11
+ const e = t.reduce((o, p, a) => o + t.slice(a + 1).reduce((s, r) => s + de(p, r), 0), 0), n = i * (i - 1) / 2;
12
+ return e / n;
15
13
  }
16
- function N(t, n) {
17
- const e = n.x - t.x, i = n.y - t.y;
18
- return Math.atan2(i, e);
14
+ function N(t, i) {
15
+ const e = i.x - t.x, n = i.y - t.y;
16
+ return Math.atan2(n, e);
19
17
  }
20
- function ge(t, n) {
21
- return N(t, n) * (180 / Math.PI);
18
+ function ge(t, i) {
19
+ return N(t, i) * (180 / Math.PI);
22
20
  }
23
- function k(t) {
24
- const n = t.reduce(
25
- (i, o) => (i.x += o.x, i.y += o.y, i),
21
+ function F(t) {
22
+ const i = t.reduce(
23
+ (n, o) => (n.x += o.x, n.y += o.y, n),
26
24
  { x: 0, y: 0 }
27
25
  ), e = t.length || 1;
28
26
  return {
29
- x: n.x / e,
30
- y: n.y / e
27
+ x: i.x / e,
28
+ y: i.y / e
31
29
  };
32
30
  }
33
- function ye(t, n) {
34
- if (t.length !== n.length)
31
+ function ye(t, i) {
32
+ if (t.length !== i.length)
35
33
  throw new Error("Initial and new points arrays must have the same length.");
36
- const e = k(t), i = k(n);
34
+ const e = F(t), n = F(i);
37
35
  let o = 0;
38
- for (let s = 0; s < t.length; s++) {
39
- const r = N(
36
+ t.forEach((s, r) => {
37
+ const l = N(
40
38
  e,
41
- t[s]
39
+ s
42
40
  );
43
41
  let u = N(
44
- i,
45
- n[s]
46
- ) - r;
42
+ n,
43
+ i[r] ?? s
44
+ ) - l;
47
45
  u > Math.PI ? u -= 2 * Math.PI : u < -Math.PI && (u += 2 * Math.PI), o += u;
48
- }
46
+ });
49
47
  const p = o / t.length, a = p * (180 / Math.PI);
50
48
  return { radianDelta: p, degreesDelta: a };
51
49
  }
@@ -53,33 +51,33 @@ function fe(t) {
53
51
  return t != null;
54
52
  }
55
53
  const me = (t) => t.length > 0, Ae = (t) => t.pipe(h(me));
56
- function Q(t, n, e) {
57
- const i = k([t]), o = k([n]);
58
- return Math.abs(o.x - i.x) >= e || Math.abs(o.y - i.y) >= e;
54
+ function Q(t, i, e) {
55
+ const n = F([t]), o = F([i]);
56
+ return Math.abs(o.x - n.x) >= e || Math.abs(o.y - n.y) >= e;
59
57
  }
60
- const De = (t, n, e) => {
61
- const i = t > 0 ? n / t : 0, o = t > 0 ? e / t : 0;
58
+ const De = (t, i, e) => {
59
+ const n = t > 0 ? i / t : 0, o = t > 0 ? e / t : 0;
62
60
  return {
63
- velocityX: i,
61
+ velocityX: n,
64
62
  velocityY: o
65
63
  };
66
64
  };
67
65
  function U(t) {
68
- return (n) => n.pipe(
66
+ return (i) => i.pipe(
69
67
  h((e) => e.pointerId === t.pointerId)
70
68
  );
71
69
  }
72
70
  const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.type === "pointerup", Pe = ({
73
71
  container: t,
74
- afterEventReceived: n = (e) => e
72
+ afterEventReceived: i = (e) => e
75
73
  }) => S(t, "pointerdown").pipe(
76
- c(n)
74
+ c(i)
77
75
  ), ee = ({
78
76
  pointerEvent$: t
79
- }) => (n) => {
77
+ }) => (i) => {
80
78
  const e = t.pipe(
81
79
  h((r) => r.type === "pointerup")
82
- ), i = t.pipe(
80
+ ), n = t.pipe(
83
81
  h((r) => r.type === "pointerleave")
84
82
  ), o = t.pipe(
85
83
  h((r) => r.type === "pointercancel")
@@ -88,29 +86,29 @@ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.ty
88
86
  ), a = S(window, "contextmenu"), s = (r) => ["pointercancel", "pointerleave", "pointerup", "contextmenu"].includes(
89
87
  r.type
90
88
  );
91
- return n.pipe(
89
+ return i.pipe(
92
90
  b((r) => {
93
91
  const l = pe(() => T(r));
94
- return g(
92
+ return y(
95
93
  l,
96
- g(
94
+ y(
97
95
  p,
98
96
  o,
99
- i,
97
+ n,
100
98
  e,
101
99
  a
102
100
  )
103
101
  ).pipe(
104
102
  U(r),
105
- V((m) => !s(m), !0)
103
+ V((u) => !s(u), !0)
106
104
  );
107
105
  }),
108
106
  L((r, l) => {
109
107
  if (s(l)) {
110
- const { [l.pointerId]: u, ...m } = (r == null ? void 0 : r.pointers) ?? {};
108
+ const { [l.pointerId]: d, ...u } = (r == null ? void 0 : r.pointers) ?? {};
111
109
  return {
112
110
  event: l,
113
- pointers: m
111
+ pointers: u
114
112
  };
115
113
  }
116
114
  return {
@@ -126,95 +124,103 @@ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.ty
126
124
  pointers: Object.values(l).filter(fe)
127
125
  }))
128
126
  );
129
- }, _ = (t, n, e, i) => {
130
- const o = t.x - n.x + e, p = t.y - n.y + i;
127
+ }, _ = (t) => t.pipe(
128
+ h(
129
+ (i) => !!i.container
130
+ )
131
+ ), te = (t) => t.pipe(h(Z)), G = (t, i, e, n) => {
132
+ const o = t.x - i.x + e, p = t.y - i.y + n;
131
133
  return {
132
134
  deltaX: o,
133
135
  deltaY: p
134
136
  };
135
- }, te = (t) => {
136
- const n = (e) => k(
137
+ }, ne = (t) => {
138
+ const i = (e) => F(
137
139
  e.latestActivePointers.length ? e.latestActivePointers : [e.event]
138
140
  );
139
141
  return t.pipe(
140
- L((e, i) => {
141
- var f, E;
142
- const o = n(i), p = (e == null ? void 0 : e.center) ?? o, a = (e == null ? void 0 : e.deltaX) ?? 0, s = (e == null ? void 0 : e.deltaY) ?? 0, r = ((f = e == null ? void 0 : e.latestActivePointers) == null ? void 0 : f.length) ?? 1, l = ((E = i.latestActivePointers) == null ? void 0 : E.length) ?? 1, u = ["pointerdown", "pointercancel", "pointerleave", "pointerup"].includes(
143
- i.event.type
144
- ) && r !== l, m = l > 0, { deltaX: y, deltaY: A } = u && m ? _(o, o, a, s) : _(o, p, a, s), { degreesDelta: D } = r === l && r >= 2 && l >= 2 ? ye(
142
+ L((e, n) => {
143
+ var m, E;
144
+ const o = i(n), p = (e == null ? void 0 : e.center) ?? o, a = (e == null ? void 0 : e.deltaX) ?? 0, s = (e == null ? void 0 : e.deltaY) ?? 0, r = ((m = e == null ? void 0 : e.latestActivePointers) == null ? void 0 : m.length) ?? 1, l = ((E = n.latestActivePointers) == null ? void 0 : E.length) ?? 1, d = ["pointerdown", "pointercancel", "pointerleave", "pointerup"].includes(
145
+ n.event.type
146
+ ) && r !== l, u = l > 0, { deltaX: f, deltaY: A } = d && u || /**
147
+ * A pointercancel cean come after a drag event and heven being completely
148
+ * desync, leading to erroned values. We should just ignore it.
149
+ */
150
+ n.event.type === "pointercancel" ? G(o, o, a, s) : G(o, p, a, s), { degreesDelta: D } = r === l && r >= 2 && l >= 2 && /**
151
+ * A pointercancel cean come after a drag event and heven being completely
152
+ * desync, leading to erroned values. We should just ignore it.
153
+ */
154
+ n.event.type !== "pointercancel" ? ye(
145
155
  (e == null ? void 0 : e.latestActivePointers) ?? [],
146
- i.latestActivePointers ?? []
156
+ n.latestActivePointers ?? []
147
157
  ) : { degreesDelta: 0 };
148
158
  return {
149
159
  startTime: (/* @__PURE__ */ new Date()).getTime(),
150
160
  ...e,
151
- ...i,
161
+ ...n,
152
162
  center: o,
153
- deltaX: y,
163
+ deltaX: f,
154
164
  deltaY: A,
155
165
  deltaPointersAngle: D
156
166
  };
157
167
  }, void 0),
158
168
  c((e) => {
159
169
  const {
160
- deltaX: i,
170
+ deltaX: n,
161
171
  deltaY: o,
162
172
  latestActivePointers: p,
163
173
  startTime: a,
164
174
  center: s,
165
175
  event: r,
166
176
  deltaPointersAngle: l
167
- } = e, u = p ?? [], y = Date.now() - a, { velocityX: A, velocityY: D } = De(y, i, o), f = ve(p);
177
+ } = e, d = p ?? [], f = Date.now() - a, { velocityX: A, velocityY: D } = De(f, n, o), m = ve(p);
168
178
  return {
169
- deltaX: i,
179
+ deltaX: n,
170
180
  deltaY: o,
171
181
  velocityX: A,
172
182
  velocityY: D,
173
- delay: y,
183
+ delay: f,
174
184
  center: s,
175
- pointers: u,
185
+ pointers: d,
176
186
  startTime: a,
177
187
  event: r,
178
188
  deltaPointersAngle: l,
179
- pointersAverageDistance: f
189
+ pointersAverageDistance: m
180
190
  };
181
191
  })
182
192
  );
183
- }, G = (t) => t.pipe(
184
- h(
185
- (n) => !!n.container
186
- )
187
- ), ne = (t) => t.pipe(h(Z)), Ee = ({
193
+ }, Ee = ({
188
194
  container: t,
189
- afterEventReceived: n = (e) => e
195
+ afterEventReceived: i = (e) => e
190
196
  }) => {
191
- const e = Pe({ afterEventReceived: n, container: t }), i = S(t, "pointerup").pipe(
192
- c(n)
197
+ const e = Pe({ afterEventReceived: i, container: t }), n = S(t, "pointerup").pipe(
198
+ c(i)
193
199
  ), o = S(t, "pointermove").pipe(
194
- c(n)
200
+ c(i)
195
201
  ), p = S(t, "pointerleave").pipe(
196
- c(n)
202
+ c(i)
197
203
  ), a = S(
198
204
  t,
199
205
  "pointercancel"
200
- ).pipe(c(n));
206
+ ).pipe(c(i));
201
207
  return {
202
- pointerEvents$: g(
208
+ pointerEvents$: y(
203
209
  e,
204
210
  a,
205
211
  p,
206
- i,
212
+ n,
207
213
  o
208
214
  ),
209
215
  pointerDown$: e,
210
216
  pointerCancel$: a,
211
217
  pointerLeave$: p,
212
- pointerUp$: i,
218
+ pointerUp$: n,
213
219
  pointerMove$: o
214
220
  };
215
221
  };
216
- class F {
217
- constructor(n, e) {
222
+ class O {
223
+ constructor(i, e) {
218
224
  $(this, "configSubject", new q({}));
219
225
  $(this, "pan$");
220
226
  $(this, "panStart$");
@@ -227,16 +233,16 @@ class F {
227
233
  $(this, "pointerMove$");
228
234
  $(this, "pointerOff$");
229
235
  $(this, "state$");
230
- $(this, "config$", this.configSubject.pipe(G));
236
+ $(this, "config$", this.configSubject.pipe(_));
231
237
  /**
232
238
  * Track active running failWith recognizers
233
239
  */
234
240
  $(this, "failWithActive$");
235
- const i = new q({
241
+ const n = new q({
236
242
  fingers: 0
237
243
  });
238
244
  this.pointerEvent$ = this.config$.pipe(
239
- v(
245
+ g(
240
246
  ({ container: p, afterEventReceived: a }) => Ee({
241
247
  container: p,
242
248
  afterEventReceived: a
@@ -251,16 +257,16 @@ class F {
251
257
  h((p) => p.type === "pointermove")
252
258
  ), this.pointerCancel$ = this.pointerEvent$.pipe(
253
259
  h((p) => p.type === "pointercancel")
254
- ), this.pointerOff$ = this.pointerEvent$.pipe(ne);
260
+ ), this.pointerOff$ = this.pointerEvent$.pipe(te);
255
261
  const o = this.config$.pipe(
256
262
  c(({ failWith: p }) => p),
257
263
  oe()
258
264
  );
259
265
  this.failWithActive$ = o.pipe(
260
- v((p) => {
266
+ g((p) => {
261
267
  const a = p == null ? void 0 : p.map((s) => {
262
268
  const r = s.start$.pipe(c(() => !0)), l = s.end$.pipe(c(() => !1));
263
- return g(r, l).pipe(
269
+ return y(r, l).pipe(
264
270
  re(!1),
265
271
  M(1)
266
272
  );
@@ -270,37 +276,36 @@ class F {
270
276
  c((p) => p.some((a) => a)),
271
277
  M(1)
272
278
  ), this.pan$ = this.configSubject.pipe(
273
- G,
274
- v((p) => {
275
- var y, A, D;
276
- const a = Math.max(1, ((y = p.panConfig) == null ? void 0 : y.numInputs) ?? 1), s = Math.max(0, ((A = p.panConfig) == null ? void 0 : A.posThreshold) ?? 0), r = Math.max(0, ((D = p.panConfig) == null ? void 0 : D.delay) ?? 0), l = this.pointerDown$.pipe(
279
+ _,
280
+ g((p) => {
281
+ var f, A, D;
282
+ const a = Math.max(1, ((f = p.panConfig) == null ? void 0 : f.numInputs) ?? 1), s = Math.max(0, ((A = p.panConfig) == null ? void 0 : A.posThreshold) ?? 0), r = Math.max(0, ((D = p.panConfig) == null ? void 0 : D.delay) ?? 0), l = this.pointerDown$.pipe(
277
283
  ee({
278
- pointerEvent$: this.pointerEvent$,
279
- trackMove: !0
284
+ pointerEvent$: this.pointerEvent$
280
285
  }),
281
286
  M(1)
282
- ), u = (f) => f.pipe(
287
+ ), d = (m) => m.pipe(
283
288
  h(
284
289
  (E) => E.pointers.length >= a
285
290
  )
286
- ), m = (f) => f.pipe(h((E) => E.pointers.length < a));
291
+ ), u = (m) => m.pipe(h((E) => E.pointers.length < a));
287
292
  return l.pipe(
288
- u,
289
- H(({ pointers: f }) => {
293
+ d,
294
+ H(({ pointers: m }) => {
290
295
  const E = l.pipe(
291
- m,
296
+ u,
292
297
  z(),
293
298
  P()
294
- ), X = J(r), R = g(
295
- ...f.map((d) => T(d)),
299
+ ), X = J(r), R = y(
300
+ ...m.map((v) => T(v)),
296
301
  this.pointerDown$
297
302
  ).pipe(
298
303
  b(
299
- (d) => g(this.pointerMove$, T(d)).pipe(
300
- U(d),
304
+ (v) => y(this.pointerMove$, T(v)).pipe(
305
+ U(v),
301
306
  h(
302
307
  (x) => Q(
303
- d,
308
+ v,
304
309
  x,
305
310
  s
306
311
  )
@@ -309,11 +314,11 @@ class F {
309
314
  ),
310
315
  z()
311
316
  ).pipe(
312
- v(() => X),
317
+ g(() => X),
313
318
  C(l),
314
- c(([, { event: d, pointers: x }]) => ({
319
+ c(([, { event: v, pointers: x }]) => ({
315
320
  type: "start",
316
- event: d,
321
+ event: v,
317
322
  latestActivePointers: x
318
323
  })),
319
324
  M({
@@ -321,13 +326,13 @@ class F {
321
326
  refCount: !1
322
327
  }),
323
328
  I(E)
324
- ), O = R.pipe(
329
+ ), k = R.pipe(
325
330
  b(
326
331
  () => l.pipe(
327
332
  ae(1),
328
- c(({ event: d, pointers: x }) => ({
333
+ c(({ event: v, pointers: x }) => ({
329
334
  type: "move",
330
- event: d,
335
+ event: v,
331
336
  latestActivePointers: x
332
337
  }))
333
338
  )
@@ -336,21 +341,21 @@ class F {
336
341
  ), w = R.pipe(
337
342
  b(
338
343
  () => E.pipe(
339
- c(({ event: d, pointers: x }) => ({
344
+ c(({ event: v, pointers: x }) => ({
340
345
  type: "end",
341
- event: d,
346
+ event: v,
342
347
  latestActivePointers: x
343
348
  }))
344
349
  )
345
350
  )
346
- ), W = g(R, O, w).pipe(
351
+ ), W = y(R, k, w).pipe(
347
352
  M(1)
348
353
  );
349
354
  return W.pipe(
350
- te,
355
+ ne,
351
356
  C(W),
352
- c(([d, { type: x }]) => ({
353
- ...d,
357
+ c(([v, { type: x }]) => ({
358
+ ...v,
354
359
  type: x
355
360
  }))
356
361
  );
@@ -358,7 +363,7 @@ class F {
358
363
  );
359
364
  }),
360
365
  K((p) => {
361
- i.next({
366
+ n.next({
362
367
  fingers: p.pointers.length
363
368
  });
364
369
  }),
@@ -372,27 +377,27 @@ class F {
372
377
  ), this.panEnd$ = this.pan$.pipe(
373
378
  h((p) => p.type === "end"),
374
379
  c(({ type: p, ...a }) => a)
375
- ), this.state$ = i.asObservable(), this.updateInternal(n ?? {}, e);
380
+ ), this.state$ = n.asObservable(), this.updateInternal(i ?? {}, e);
376
381
  }
377
- updateInternal(n, e) {
378
- const i = this.configSubject.getValue();
382
+ updateInternal(i, e) {
383
+ const n = this.configSubject.getValue();
379
384
  this.configSubject.next({
380
- ...i,
381
385
  ...n,
382
- ...n.options && {
383
- options: { ...i.options, ...n.options }
386
+ ...i,
387
+ ...i.options && {
388
+ options: { ...n.options, ...i.options }
384
389
  },
385
390
  panConfig: {
386
- ...i.panConfig,
391
+ ...n.panConfig,
387
392
  ...e
388
393
  }
389
394
  });
390
395
  }
391
- update(n, e) {
392
- this.updateInternal(n, e);
396
+ update(i, e) {
397
+ this.updateInternal(i, e);
393
398
  }
394
399
  }
395
- class Se extends F {
400
+ class Se extends O {
396
401
  constructor(e) {
397
402
  var a;
398
403
  super(e, {
@@ -402,7 +407,7 @@ class Se extends F {
402
407
  $(this, "events$");
403
408
  $(this, "start$");
404
409
  $(this, "end$");
405
- const i = this.panStart$.pipe(
410
+ const n = this.panStart$.pipe(
406
411
  c((s) => ({
407
412
  type: "panStart",
408
413
  ...s
@@ -423,25 +428,25 @@ class Se extends F {
423
428
  ...s
424
429
  }))
425
430
  );
426
- this.events$ = i.pipe(
427
- v((s) => {
431
+ this.events$ = n.pipe(
432
+ g((s) => {
428
433
  let r = s;
429
- const l = T(s), u = this.failWithActive$.pipe(
434
+ const l = T(s), d = this.failWithActive$.pipe(
430
435
  h((A) => A),
431
436
  z()
432
- ), m = g(l, p, o).pipe(
437
+ ), u = y(l, p, o).pipe(
433
438
  K((A) => {
434
439
  r = A;
435
440
  }),
436
- I(u)
437
- ), y = u.pipe(
441
+ I(d)
442
+ ), f = d.pipe(
438
443
  c(() => ({
439
444
  ...r,
440
445
  type: "panEnd"
441
446
  })),
442
447
  I(o)
443
448
  );
444
- return g(m, y);
449
+ return y(u, f);
445
450
  }),
446
451
  P()
447
452
  ), this.start$ = this.events$.pipe(
@@ -452,10 +457,10 @@ class Se extends F {
452
457
  super.update(e, e.options);
453
458
  }
454
459
  }
455
- const we = (t) => (n) => n.pipe(
460
+ const we = (t) => (i) => i.pipe(
456
461
  h((e) => Math.abs(e.velocityX) >= t || Math.abs(e.velocityY) >= t)
457
462
  );
458
- class be extends F {
463
+ class be extends O {
459
464
  constructor(e) {
460
465
  super(e, {
461
466
  posThreshold: 0,
@@ -463,12 +468,12 @@ class be extends F {
463
468
  });
464
469
  $(this, "events$");
465
470
  this.events$ = this.config$.pipe(
466
- v((i) => {
467
- const { escapeVelocity: o = 0.9 } = i.options ?? {};
471
+ g((n) => {
472
+ const { escapeVelocity: o = 0.9 } = n.options ?? {};
468
473
  return this.panStart$.pipe(
469
474
  C(this.failWithActive$),
470
475
  h(([, p]) => !p),
471
- v(([p]) => this.panEnd$.pipe(
476
+ g(([p]) => this.panEnd$.pipe(
472
477
  we(o),
473
478
  c((a) => ({
474
479
  type: "swipe",
@@ -493,22 +498,22 @@ class be extends F {
493
498
  }
494
499
  const Me = ({
495
500
  timeout: t,
496
- pointerEvent$: n
501
+ pointerEvent$: i
497
502
  }) => (e) => e.pipe(
498
503
  b(
499
- (i) => J(t).pipe(
504
+ (n) => J(t).pipe(
500
505
  I(
501
- n.pipe(ne, U(i))
506
+ i.pipe(te, U(n))
502
507
  )
503
508
  )
504
509
  )
505
510
  ), xe = ({
506
511
  initialPointerEvent: t,
507
- pointerEvent$: n,
512
+ pointerEvent$: i,
508
513
  tolerance: e
509
- }) => (i) => i.pipe(
514
+ }) => (n) => n.pipe(
510
515
  b(
511
- (o) => n.pipe(
516
+ (o) => i.pipe(
512
517
  U(o),
513
518
  V((p) => !Z(p), !0),
514
519
  h(
@@ -517,51 +522,50 @@ const Me = ({
517
522
  )
518
523
  )
519
524
  );
520
- class Ce extends F {
525
+ class Ce extends O {
521
526
  constructor(e) {
522
527
  super(e);
523
528
  $(this, "events$");
524
529
  this.events$ = this.config$.pipe(
525
- v((i) => {
526
- var y, A;
527
- const o = ((y = i.options) == null ? void 0 : y.maxTaps) ?? 1, p = ((A = i.options) == null ? void 0 : A.multiTapThreshold) ?? 100 * (o - 1), { maximumPressTime: a = 150, tolerance: s = 10 } = i.options ?? {}, r = this.pointerDown$.pipe(
530
+ g((n) => {
531
+ var f, A;
532
+ const o = ((f = n.options) == null ? void 0 : f.maxTaps) ?? 1, p = ((A = n.options) == null ? void 0 : A.multiTapThreshold) ?? 100 * (o - 1), { maximumPressTime: a = 150, tolerance: s = 10 } = n.options ?? {}, r = this.pointerDown$.pipe(
528
533
  ee({
529
- pointerEvent$: this.pointerEvent$,
530
- trackMove: !0
534
+ pointerEvent$: this.pointerEvent$
531
535
  }),
532
536
  M(1)
533
537
  ), l = r.pipe(
534
538
  h(({ pointers: D }) => D.length > 1)
535
- ), u = (D) => D.pipe(
539
+ ), d = (D) => D.pipe(
536
540
  he(this.pointerUp$.pipe(ce(p))),
537
541
  z()
538
542
  );
539
- return g(
543
+ return y(
540
544
  this.pointerDown$,
541
545
  r.pipe(le())
542
546
  ).pipe(
543
547
  H((D) => {
544
- const f = g(
548
+ const m = y(
545
549
  T(D),
546
550
  this.pointerDown$
547
- ).pipe(M(1)), E = f.pipe(u), X = f.pipe(
551
+ ).pipe(M(1)), E = m.pipe(d), X = m.pipe(
548
552
  xe({
549
553
  initialPointerEvent: D,
550
554
  pointerEvent$: this.pointerEvent$,
551
555
  tolerance: s
552
556
  })
553
- ), B = f.pipe(
557
+ ), B = m.pipe(
554
558
  Me({
555
559
  pointerEvent$: this.pointerEvent$,
556
560
  timeout: a
557
561
  })
558
- ), R = g(
562
+ ), R = y(
559
563
  this.failWithActive$.pipe(h((w) => w)),
560
564
  this.pointerCancel$,
561
565
  l,
562
566
  X,
563
567
  B
564
- ), O = E.pipe(
568
+ ), k = E.pipe(
565
569
  Ae,
566
570
  h((w) => w.length <= o),
567
571
  c((w) => ({
@@ -572,13 +576,13 @@ class Ce extends F {
572
576
  })),
573
577
  M(1)
574
578
  );
575
- return O.pipe(
576
- te,
577
- C(O),
578
- c(([w, { type: W, taps: d }]) => ({
579
+ return k.pipe(
580
+ ne,
581
+ C(k),
582
+ c(([w, { type: W, taps: v }]) => ({
579
583
  ...w,
580
584
  type: W,
581
- taps: d
585
+ taps: v
582
586
  })),
583
587
  I(R)
584
588
  );
@@ -592,7 +596,7 @@ class Ce extends F {
592
596
  super.update(e);
593
597
  }
594
598
  }
595
- class Re extends F {
599
+ class Re extends O {
596
600
  constructor(e = {}) {
597
601
  super(e, {
598
602
  numInputs: 2,
@@ -601,8 +605,8 @@ class Re extends F {
601
605
  });
602
606
  $(this, "events$");
603
607
  this.events$ = this.config$.pipe(
604
- v(() => {
605
- const i = this.panStart$.pipe(
608
+ g(() => {
609
+ const n = this.panStart$.pipe(
606
610
  c((s) => ({
607
611
  ...s,
608
612
  type: "rotateStart",
@@ -610,8 +614,8 @@ class Re extends F {
610
614
  deltaAngle: 0
611
615
  })),
612
616
  M(1)
613
- ), o = i.pipe(
614
- v(
617
+ ), o = n.pipe(
618
+ g(
615
619
  () => this.pan$.pipe(
616
620
  L((s, r) => {
617
621
  const l = ((s == null ? void 0 : s.angle) ?? 0) + r.deltaPointersAngle;
@@ -632,7 +636,7 @@ class Re extends F {
632
636
  h((s) => s.type === "end"),
633
637
  c((s) => ({ ...s, type: "rotateEnd" }))
634
638
  );
635
- return g(i, p, a);
639
+ return y(n, p, a);
636
640
  }),
637
641
  P()
638
642
  );
@@ -643,24 +647,24 @@ class Re extends F {
643
647
  }
644
648
  const Y = ({
645
649
  type: t,
646
- initialEvent: n
650
+ initialEvent: i
647
651
  }) => (e) => e.pipe(
648
- L((i, o) => {
649
- const a = ((i == null ? void 0 : i.pointers.length) ?? 0) !== o.pointers.length, s = (i == null ? void 0 : i.pointersAverageDistance) ?? o.pointersAverageDistance, r = a ? o.pointersAverageDistance : i && "initialPointersAverageDistance" in i ? i.initialPointersAverageDistance : o.pointersAverageDistance, l = r === 0 ? 1 : o.pointersAverageDistance / r, u = o.pointersAverageDistance - r, m = o.pointersAverageDistance - r, y = a || s === 0 ? 1 : o.pointersAverageDistance / s;
652
+ L((n, o) => {
653
+ const a = ((n == null ? void 0 : n.pointers.length) ?? 0) !== o.pointers.length, s = (n == null ? void 0 : n.pointersAverageDistance) ?? o.pointersAverageDistance, r = a ? o.pointersAverageDistance : n && "initialPointersAverageDistance" in n ? n.initialPointersAverageDistance : o.pointersAverageDistance, l = r === 0 ? 1 : o.pointersAverageDistance / r, d = o.pointersAverageDistance - r, u = o.pointersAverageDistance - r, f = a || s === 0 ? 1 : o.pointersAverageDistance / s;
650
654
  return {
651
- ...i,
655
+ ...n,
652
656
  ...o,
653
657
  type: t,
654
658
  initialPointersAverageDistance: r,
655
659
  scale: l,
656
- distance: u,
657
- deltaDistance: m,
658
- deltaDistanceScale: y
660
+ distance: d,
661
+ deltaDistance: u,
662
+ deltaDistanceScale: f
659
663
  };
660
- }, n),
661
- c(({ initialPointersAverageDistance: i, ...o }) => o)
664
+ }, i),
665
+ c(({ initialPointersAverageDistance: n, ...o }) => o)
662
666
  );
663
- class ze extends F {
667
+ class ze extends O {
664
668
  constructor(e) {
665
669
  super(e, {
666
670
  ...e == null ? void 0 : e.options,
@@ -670,12 +674,12 @@ class ze extends F {
670
674
  $(this, "start$");
671
675
  $(this, "end$");
672
676
  this.events$ = this.config$.pipe(
673
- v(() => {
674
- const i = this.panStart$.pipe(
677
+ g(() => {
678
+ const n = this.panStart$.pipe(
675
679
  C(this.failWithActive$),
676
680
  h(([, s]) => !s),
677
681
  c(([s]) => s),
678
- v(
682
+ g(
679
683
  (s) => T(s).pipe(
680
684
  // we don't want a scan on pinch start
681
685
  Y({
@@ -688,8 +692,8 @@ class ze extends F {
688
692
  ), o = this.failWithActive$.pipe(
689
693
  h((s) => s),
690
694
  z()
691
- ), p = i.pipe(
692
- v((s) => this.pan$.pipe(
695
+ ), p = n.pipe(
696
+ g((s) => this.pan$.pipe(
693
697
  V((r) => r.type !== "end"),
694
698
  Y({
695
699
  type: "pinchMove",
@@ -697,11 +701,11 @@ class ze extends F {
697
701
  })
698
702
  )),
699
703
  I(o)
700
- ), a = i.pipe(
701
- v((s) => {
704
+ ), a = n.pipe(
705
+ g((s) => {
702
706
  let r = s;
703
707
  return this.pan$.pipe(
704
- v((l) => l.type === "end" ? T(l) : (r = l, $e)),
708
+ g((l) => l.type === "end" ? T(l) : (r = l, $e)),
705
709
  I(o),
706
710
  ue(null),
707
711
  c(
@@ -715,48 +719,48 @@ class ze extends F {
715
719
  );
716
720
  })
717
721
  );
718
- return g(i, p, a);
722
+ return y(n, p, a);
719
723
  }),
720
724
  P()
721
725
  ), this.start$ = this.events$.pipe(
722
- h((i) => i.type === "pinchStart")
723
- ), this.end$ = this.events$.pipe(h((i) => i.type === "pinchEnd"));
726
+ h((n) => n.type === "pinchStart")
727
+ ), this.end$ = this.events$.pipe(h((n) => n.type === "pinchEnd"));
724
728
  }
725
729
  update(e) {
726
730
  super.update(e, e.options);
727
731
  }
728
732
  }
729
- class ke {
730
- constructor(n) {
733
+ class Fe {
734
+ constructor(i) {
731
735
  $(this, "events$");
732
736
  $(this, "recognizers");
733
737
  $(this, "state$");
734
- this.options = n, this.recognizers = n.recognizers, this.events$ = g(
735
- ...n.recognizers.map((e) => e.events$)
738
+ this.options = i, this.recognizers = i.recognizers, this.events$ = y(
739
+ ...i.recognizers.map((e) => e.events$)
736
740
  ).pipe(P()), this.state$ = j(
737
741
  this.recognizers.map((e) => e.state$)
738
742
  ).pipe(
739
743
  c(
740
- (e) => e.reduce((i, o) => ({
741
- fingers: Math.max(i.fingers, o.fingers)
744
+ (e) => e.reduce((n, o) => ({
745
+ fingers: Math.max(n.fingers, o.fingers)
742
746
  }))
743
747
  )
744
- ), this.update(n);
748
+ ), this.update(i);
745
749
  }
746
750
  update({
747
- disableTextSelection: n,
751
+ disableTextSelection: i,
748
752
  ...e
749
753
  }) {
750
- e.container && (e.container.style.touchAction = "none", n && (e.container.style.userSelect = "none")), this.options.recognizers.forEach((i) => {
751
- i.update(e);
752
- });
754
+ e.container && (e.container.style.touchAction = "none", i && (e.container.style.userSelect = "none"));
755
+ for (const n of this.options.recognizers)
756
+ n.update(e);
753
757
  }
754
758
  }
755
759
  export {
756
760
  Se as PanRecognizer,
757
761
  ze as PinchRecognizer,
758
- ke as Recognizable,
759
- F as Recognizer,
762
+ Fe as Recognizable,
763
+ O as Recognizer,
760
764
  Re as RotateRecognizer,
761
765
  be as SwipeRecognizer,
762
766
  Ce as TapRecognizer