Repository navigation
Expand file tree
/
Copy path789.bundle.js
More file actions
52 lines (52 loc) · 1.55 KB
/
Copy path789.bundle.js
File metadata and controls
52 lines (52 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"use strict";
(self.webpackChunk = self.webpackChunk || []).push([
[789],
{
3789: (t, e, i) => {
i.d(e, { HapticsWeb: () => r });
var a = i(6546),
n = i(3693);
class r extends a.E_ {
constructor() {
(super(...arguments), (this.selectionStarted = !1));
}
async impact(t) {
const e = this.patternForImpact(null == t ? void 0 : t.style);
this.vibrateWithPattern(e);
}
async notification(t) {
const e = this.patternForNotification(null == t ? void 0 : t.type);
this.vibrateWithPattern(e);
}
async vibrate(t) {
const e = (null == t ? void 0 : t.duration) || 300;
this.vibrateWithPattern([e]);
}
async selectionStart() {
this.selectionStarted = !0;
}
async selectionChanged() {
this.selectionStarted && this.vibrateWithPattern([70]);
}
async selectionEnd() {
this.selectionStarted = !1;
}
patternForImpact(t = n.k.Heavy) {
return t === n.k.Medium ? [43] : t === n.k.Light ? [20] : [61];
}
patternForNotification(t = n._.Success) {
return t === n._.Warning
? [30, 40, 30, 50, 60]
: t === n._.Error
? [27, 45, 50]
: [35, 65, 21];
}
vibrateWithPattern(t) {
if (!navigator.vibrate)
throw this.unavailable("Browser does not support the vibrate API");
navigator.vibrate(t);
}
}
},
},
]);