@getsoren/shared-module 2.61.0 → 2.63.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/components/Utils/InitializeAmplitude.d.ts +11 -2
- package/dist/events/catalog/clientEvents.d.ts +8 -6
- package/dist/events/hooks/useEventDeclaration/useEventDeclaration.d.ts +5 -1
- package/dist/events/types.d.ts +5 -0
- package/dist/events/utils/amounts/amounts.d.ts +12 -0
- package/dist/events/utils/steps/steps.d.ts +5 -2
- package/dist/events.js +144 -134
- package/dist/hooks/tests/useAmplitude.test.d.ts +1 -0
- package/dist/main.js +38 -22
- package/package.json +1 -1
|
@@ -58,13 +58,22 @@ export interface InitializeAmplitudeProps {
|
|
|
58
58
|
* overrides the remote rate for this app and disables Dynamic Sampling org-wide.
|
|
59
59
|
*/
|
|
60
60
|
sessionReplaySampleRate?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Id of the authenticated user, `undefined` while nobody is signed in. Amplitude bills every distinct visitor as a
|
|
63
|
+
* Monthly Tracked User, so nothing is tracked until a user id is known: no SDK init, no session, no page view, no
|
|
64
|
+
* replay on the sign-in page. Signing out (back to `undefined`) opts the SDK out until the next user id arrives.
|
|
65
|
+
* Required on purpose, so an app cannot start tracking anonymous visitors by forgetting it.
|
|
66
|
+
*/
|
|
67
|
+
userId: string | undefined;
|
|
61
68
|
}
|
|
62
69
|
/**
|
|
63
|
-
* Initializes the Amplitude SDK once
|
|
70
|
+
* Initializes the Amplitude SDK once a user is signed in, and only tracks while one is:
|
|
71
|
+
* - tracks authenticated users only: anonymous visitors (sign-in page, bots, link previews) are never sent, since
|
|
72
|
+
* Amplitude bills each of them as a Monthly Tracked User,
|
|
64
73
|
* - enables click autocapture (with our feature selector) and rage/dead click detection, the data behind heatmaps,
|
|
65
74
|
* - tracks SPA page views on path changes only (query-string churn from filters doesn't count as a new view),
|
|
66
75
|
* - registers the session replay plugin, remote-controlled sample rate by default (Dynamic Sampling ready),
|
|
67
76
|
* - registers an enrichment plugin that adds `platform` to every event's properties.
|
|
68
77
|
*/
|
|
69
|
-
declare const InitializeAmplitude: ({ apiKey, appVersion, sessionReplaySampleRate, serverZone, elementInteractions, frustrationInteractions, platform, sessionReplayPrivacy, ...props }: InitializeAmplitudeProps) => null;
|
|
78
|
+
declare const InitializeAmplitude: ({ apiKey, appVersion, sessionReplaySampleRate, serverZone, elementInteractions, frustrationInteractions, platform, sessionReplayPrivacy, userId, ...props }: InitializeAmplitudeProps) => null;
|
|
70
79
|
export default InitializeAmplitude;
|
|
@@ -5,11 +5,11 @@ import { EventFunnel } from '../types';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const CLIENT_EVENTS: {
|
|
7
7
|
breakage: {
|
|
8
|
-
amountGate: "known";
|
|
9
8
|
dates: "single";
|
|
10
9
|
dayHint: "breakage";
|
|
11
10
|
defaultsToToday: true;
|
|
12
11
|
hasIntervention: true;
|
|
12
|
+
hasOptionalAmount: true;
|
|
13
13
|
id: string;
|
|
14
14
|
price: "amount";
|
|
15
15
|
questions: {
|
|
@@ -31,9 +31,9 @@ export declare const CLIENT_EVENTS: {
|
|
|
31
31
|
reason: string;
|
|
32
32
|
};
|
|
33
33
|
delivery_problem: {
|
|
34
|
-
amountGate: "known";
|
|
35
34
|
dates: "single";
|
|
36
35
|
dayHint: "deliveryProblem";
|
|
36
|
+
hasOptionalAmount: true;
|
|
37
37
|
id: string;
|
|
38
38
|
price: "amount";
|
|
39
39
|
questions: {
|
|
@@ -72,6 +72,7 @@ export declare const CLIENT_EVENTS: {
|
|
|
72
72
|
id: string;
|
|
73
73
|
price: "credit";
|
|
74
74
|
reason: string;
|
|
75
|
+
suggestsDailyShare: true;
|
|
75
76
|
};
|
|
76
77
|
inventory: {
|
|
77
78
|
closesOnSubmit: true;
|
|
@@ -102,9 +103,9 @@ export declare const CLIENT_EVENTS: {
|
|
|
102
103
|
reason: string;
|
|
103
104
|
};
|
|
104
105
|
material_usage: {
|
|
105
|
-
amountGate: "known";
|
|
106
106
|
dates: "single";
|
|
107
107
|
dayHint: "problem";
|
|
108
|
+
hasOptionalAmount: true;
|
|
108
109
|
id: string;
|
|
109
110
|
price: "amount";
|
|
110
111
|
questions: {
|
|
@@ -160,17 +161,17 @@ export declare const CLIENT_EVENTS: {
|
|
|
160
161
|
reason: string;
|
|
161
162
|
};
|
|
162
163
|
other: {
|
|
163
|
-
amountGate: "known";
|
|
164
164
|
dates: "single";
|
|
165
165
|
dayHint: "event";
|
|
166
|
+
hasOptionalAmount: true;
|
|
166
167
|
hasTitle: true;
|
|
167
168
|
id: string;
|
|
168
169
|
price: "amount";
|
|
169
170
|
};
|
|
170
171
|
other_material: {
|
|
171
|
-
amountGate: "known";
|
|
172
172
|
dates: "single";
|
|
173
173
|
dayHint: "problem";
|
|
174
|
+
hasOptionalAmount: true;
|
|
174
175
|
hasTitle: true;
|
|
175
176
|
id: string;
|
|
176
177
|
price: "amount";
|
|
@@ -186,9 +187,9 @@ export declare const CLIENT_EVENTS: {
|
|
|
186
187
|
price: "amount";
|
|
187
188
|
};
|
|
188
189
|
robbery: {
|
|
189
|
-
amountGate: "known";
|
|
190
190
|
dates: "single";
|
|
191
191
|
dayHint: "robbery";
|
|
192
|
+
hasOptionalAmount: true;
|
|
192
193
|
id: string;
|
|
193
194
|
price: "amount";
|
|
194
195
|
questions: {
|
|
@@ -206,6 +207,7 @@ export declare const CLIENT_EVENTS: {
|
|
|
206
207
|
dates: "weatherDays";
|
|
207
208
|
};
|
|
208
209
|
reason: string;
|
|
210
|
+
suggestsDailyShare: true;
|
|
209
211
|
};
|
|
210
212
|
};
|
|
211
213
|
export type ClientEventId = keyof typeof CLIENT_EVENTS;
|
|
@@ -14,9 +14,13 @@ export interface UseEventDeclarationParams {
|
|
|
14
14
|
* Today (YYYY-MM-DD) when the order's calendar offers it: an event declared the day it happens starts on it.
|
|
15
15
|
*/
|
|
16
16
|
today?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The one day (YYYY-MM-DD) of an order of one day: its events happen that day, their dates step is not asked.
|
|
19
|
+
*/
|
|
20
|
+
onlyDay?: string;
|
|
17
21
|
}
|
|
18
22
|
/** The declaration of an event, step by step, whatever renders it. */
|
|
19
|
-
declare const useEventDeclaration: ({ funnel, countBillableDays, dailyPrice, lastReBillRatio, isEditing, today, }: UseEventDeclarationParams) => {
|
|
23
|
+
declare const useEventDeclaration: ({ funnel, countBillableDays, dailyPrice, lastReBillRatio, isEditing, today, onlyDay, }: UseEventDeclarationParams) => {
|
|
20
24
|
amounts: import('../../utils/amounts/amounts').EventAmounts;
|
|
21
25
|
answers: EventAnswers;
|
|
22
26
|
asksAmount: boolean;
|
package/dist/events/types.d.ts
CHANGED
|
@@ -53,6 +53,11 @@ export interface EventDefinition {
|
|
|
53
53
|
amountGate?: EventAmountGate;
|
|
54
54
|
/** The amount asked can be left empty: the event is then declared without one. */
|
|
55
55
|
hasOptionalAmount?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* A credit a supplier settles as a share of the daily price over the days hit (half of it for these two days), the
|
|
58
|
+
* shares of `DAILY_PRICE_SHARES` offered before an amount per day.
|
|
59
|
+
*/
|
|
60
|
+
suggestsDailyShare?: boolean;
|
|
56
61
|
/**
|
|
57
62
|
* The sum is billed or taken off the invoice, the user saying which (`answers.isCreditNote`): a credit note is
|
|
58
63
|
* declared like an extra.
|
|
@@ -19,6 +19,18 @@ export declare const getUnitPrice: (event: EventDefinition, answers: Pick<EventA
|
|
|
19
19
|
* A period of one day counts one whatever the calendar, as the backend bills it, and so does an event without a period.
|
|
20
20
|
*/
|
|
21
21
|
export declare const getEventAmounts: (event: EventDefinition | undefined, answers: EventAnswers, billableDays: number) => EventAmounts;
|
|
22
|
+
/**
|
|
23
|
+
* The shares of the daily price a supplier usually deducts, in percent, the whole of it first.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DAILY_PRICE_SHARES: number[];
|
|
26
|
+
/**
|
|
27
|
+
* A share of the daily price, to the cent: 75 % of 36,50 € is 27,38 €.
|
|
28
|
+
*/
|
|
29
|
+
export declare const getShareAmount: (dailyPrice: number, percent: number) => number;
|
|
30
|
+
/**
|
|
31
|
+
* The share an amount matches, if any: another amount is no share.
|
|
32
|
+
*/
|
|
33
|
+
export declare const findShare: (dailyPrice: number, amount: number | null) => number | undefined;
|
|
22
34
|
/**
|
|
23
35
|
* Whether an event still waits for its amount: it has a price and none goes with it, though its days are billed and
|
|
24
36
|
* nobody answered that there was nothing to bill. `isSent` is false for a user who sees no price, whose amount on
|
|
@@ -7,8 +7,11 @@ export interface FunnelGroup extends Omit<EventGroup, "events"> {
|
|
|
7
7
|
export declare const getFunnelGroups: ({ groups, events }: EventFunnel) => FunnelGroup[];
|
|
8
8
|
/** The one date of an end of rental, which depends on the end picked. */
|
|
9
9
|
export declare const getEndDate: (event: EventDefinition, reason: string) => import('../../types').EventEndDate | undefined;
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* `asksAmount` is false for a user who sees no price, or a credit that falls on no billed day. `hasOnlyDay` is true on
|
|
12
|
+
* an order of one day, whose events happen that day: their dates are not asked (an end of rental still asks its own).
|
|
13
|
+
*/
|
|
14
|
+
export declare const getSteps: (group: FunnelGroup | undefined, event: EventDefinition | undefined, answers: EventAnswers, asksAmount: boolean, hasOnlyDay?: boolean) => EventStep[];
|
|
12
15
|
/** First question after the family and the event, skipping a reason already given unless asked again. */
|
|
13
16
|
export declare const getFirstQuestion: (steps: EventStep[], answers: EventAnswers, asksAgain?: boolean) => EventStep;
|
|
14
17
|
export declare const isStepAnswered: (step: EventStep, event: EventDefinition, answers: EventAnswers) => boolean;
|
package/dist/events.js
CHANGED
|
@@ -10,11 +10,11 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
10
10
|
unitPrice: "unitPrice"
|
|
11
11
|
}, o = "inventory", s = {
|
|
12
12
|
breakage: {
|
|
13
|
-
amountGate: "known",
|
|
14
13
|
dates: "single",
|
|
15
14
|
dayHint: "breakage",
|
|
16
15
|
defaultsToToday: !0,
|
|
17
16
|
hasIntervention: !0,
|
|
17
|
+
hasOptionalAmount: !0,
|
|
18
18
|
id: "breakage",
|
|
19
19
|
price: "amount",
|
|
20
20
|
questions: { reason: "breakageKind" },
|
|
@@ -34,9 +34,9 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
34
34
|
reason: "breakdown"
|
|
35
35
|
},
|
|
36
36
|
delivery_problem: {
|
|
37
|
-
amountGate: "known",
|
|
38
37
|
dates: "single",
|
|
39
38
|
dayHint: "deliveryProblem",
|
|
39
|
+
hasOptionalAmount: !0,
|
|
40
40
|
id: "delivery_problem",
|
|
41
41
|
price: "amount",
|
|
42
42
|
questions: { reason: "deliveryProblemKind" },
|
|
@@ -74,7 +74,8 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
74
74
|
hasOptionalAmount: !0,
|
|
75
75
|
id: "immobilisation",
|
|
76
76
|
price: "credit",
|
|
77
|
-
reason: "immobilisation"
|
|
77
|
+
reason: "immobilisation",
|
|
78
|
+
suggestsDailyShare: !0
|
|
78
79
|
},
|
|
79
80
|
[o]: {
|
|
80
81
|
closesOnSubmit: !0,
|
|
@@ -111,9 +112,9 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
111
112
|
reason: "Affectation machine"
|
|
112
113
|
},
|
|
113
114
|
material_usage: {
|
|
114
|
-
amountGate: "known",
|
|
115
115
|
dates: "single",
|
|
116
116
|
dayHint: "problem",
|
|
117
|
+
hasOptionalAmount: !0,
|
|
117
118
|
id: "material_usage",
|
|
118
119
|
price: "amount",
|
|
119
120
|
questions: { reason: "materialUsageKind" },
|
|
@@ -188,17 +189,17 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
188
189
|
reason: "operator_change"
|
|
189
190
|
},
|
|
190
191
|
other: {
|
|
191
|
-
amountGate: "known",
|
|
192
192
|
dates: "single",
|
|
193
193
|
dayHint: "event",
|
|
194
|
+
hasOptionalAmount: !0,
|
|
194
195
|
hasTitle: !0,
|
|
195
196
|
id: "other",
|
|
196
197
|
price: "amount"
|
|
197
198
|
},
|
|
198
199
|
other_material: {
|
|
199
|
-
amountGate: "known",
|
|
200
200
|
dates: "single",
|
|
201
201
|
dayHint: "problem",
|
|
202
|
+
hasOptionalAmount: !0,
|
|
202
203
|
hasTitle: !0,
|
|
203
204
|
id: "other_material",
|
|
204
205
|
price: "amount"
|
|
@@ -214,9 +215,9 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
214
215
|
price: "amount"
|
|
215
216
|
},
|
|
216
217
|
robbery: {
|
|
217
|
-
amountGate: "known",
|
|
218
218
|
dates: "single",
|
|
219
219
|
dayHint: "robbery",
|
|
220
|
+
hasOptionalAmount: !0,
|
|
220
221
|
id: "robbery",
|
|
221
222
|
price: "amount",
|
|
222
223
|
questions: {
|
|
@@ -231,7 +232,8 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
231
232
|
id: "weather",
|
|
232
233
|
price: "credit",
|
|
233
234
|
questions: { dates: "weatherDays" },
|
|
234
|
-
reason: "weather"
|
|
235
|
+
reason: "weather",
|
|
236
|
+
suggestsDailyShare: !0
|
|
235
237
|
}
|
|
236
238
|
}, c = {
|
|
237
239
|
admin_request: {
|
|
@@ -445,36 +447,41 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
445
447
|
total: a === null ? null : a * o,
|
|
446
448
|
unitPrice: a
|
|
447
449
|
};
|
|
448
|
-
}, h =
|
|
450
|
+
}, h = [
|
|
451
|
+
100,
|
|
452
|
+
75,
|
|
453
|
+
50,
|
|
454
|
+
25
|
|
455
|
+
], g = (e, t) => Math.round(e * t) / 100, _ = (e, t) => h.find((n) => t === g(e, n)), v = (e, { hasNothingToBill: t, unitPrice: n }, r = !0) => !!e.price && !(r && n !== null) && !t && e.amountGate !== "billed", y = ({ groups: e, events: t }) => e.flatMap((e) => {
|
|
449
456
|
let n = t.filter(({ id: t }) => e.events.includes(t));
|
|
450
457
|
return n.length ? [{
|
|
451
458
|
...e,
|
|
452
459
|
events: n
|
|
453
460
|
}] : [];
|
|
454
|
-
}),
|
|
461
|
+
}), b = (e, t) => e.endDates?.[t], x = (e, t, n, r, i = !1) => [
|
|
455
462
|
"kind",
|
|
456
463
|
...(e?.events.length ?? 0) > 1 ? ["event"] : [],
|
|
457
464
|
...t?.reasons?.length ? ["reason"] : [],
|
|
458
|
-
...t?.dates || t &&
|
|
465
|
+
...t?.dates && !i || t && b(t, n.reason) ? ["dates"] : [],
|
|
459
466
|
...t?.checks?.length ? ["checks"] : [],
|
|
460
467
|
...t?.hasTitle || t?.fields?.length ? ["fields"] : [],
|
|
461
468
|
...r && t?.price && t.amountGate ? ["amountGate"] : [],
|
|
462
469
|
...r && t?.price && (!t.amountGate || n.amountGate) ? ["amount"] : [],
|
|
463
470
|
...t ? ["details"] : []
|
|
464
|
-
],
|
|
471
|
+
], S = (e, t, n = !1) => e.find((e) => e !== "kind" && e !== "event" && (n || e !== "reason" || !t.reason)) ?? "details", C = ({ name: e, required: t, type: n }, { fields: r }) => {
|
|
465
472
|
let i = r[e]?.trim() ?? "";
|
|
466
473
|
return i ? n !== "number" || f(i) !== null : !t;
|
|
467
|
-
},
|
|
474
|
+
}, w = (e, t, n) => {
|
|
468
475
|
switch (e) {
|
|
469
476
|
case "reason": return !!n.reason;
|
|
470
477
|
case "dates": return !!(n.dates.fromDate && n.dates.toDate);
|
|
471
|
-
case "fields": return (!t.hasTitle || !!n.title.trim()) && (t.fields ?? []).every((e) =>
|
|
478
|
+
case "fields": return (!t.hasTitle || !!n.title.trim()) && (t.fields ?? []).every((e) => C(e, n));
|
|
472
479
|
case "amountGate": return n.amountGate !== void 0;
|
|
473
480
|
case "amount": return !!t.hasOptionalAmount && !n.isCreditNote || p(t, n) !== null;
|
|
474
481
|
default: return !0;
|
|
475
482
|
}
|
|
476
|
-
},
|
|
477
|
-
let r =
|
|
483
|
+
}, T = (e, t) => e.hasTitle ? t.title.trim() : e.reasonDetail ? e.reason ?? "" : t.reason || (e.reason ?? ""), E = (e, t, n) => {
|
|
484
|
+
let r = T(e, t);
|
|
478
485
|
if (e.hasTitle) return {
|
|
479
486
|
label: n("values.title"),
|
|
480
487
|
name: a.reason,
|
|
@@ -493,8 +500,8 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
493
500
|
value: r
|
|
494
501
|
}
|
|
495
502
|
};
|
|
496
|
-
},
|
|
497
|
-
let o =
|
|
503
|
+
}, D = (e, { dates: { fromDate: t, toDate: n }, reason: r }, i) => {
|
|
504
|
+
let o = b(e, r);
|
|
498
505
|
return t && n ? o ? [{
|
|
499
506
|
label: i(`values.${o.name}`),
|
|
500
507
|
name: o.name,
|
|
@@ -511,18 +518,18 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
511
518
|
type: "date",
|
|
512
519
|
value: t
|
|
513
520
|
}] : [] : [];
|
|
514
|
-
},
|
|
521
|
+
}, O = (e, t) => {
|
|
515
522
|
let n = e === "number" ? f(t) : null;
|
|
516
523
|
return n === null ? t.trim() : String(n);
|
|
517
|
-
},
|
|
524
|
+
}, k = "dedicated", A = (e, t) => ({
|
|
518
525
|
eventId: t,
|
|
519
|
-
funnel:
|
|
526
|
+
funnel: k,
|
|
520
527
|
side: e,
|
|
521
528
|
source: r,
|
|
522
529
|
version: 2
|
|
523
|
-
}),
|
|
530
|
+
}), j = (e) => typeof e == "object" && !!e && "source" in e && e.source === "soren-event" && "eventId" in e && typeof e.eventId == "string", M = ({ funnel: e, event: t, answers: n, translate: i, bookingItemId: o, withPrice: s, billableDays: c, withReBillRatio: l = e.pricing.asksReBillRatio }) => {
|
|
524
531
|
let { fromDate: u, toDate: d } = n.dates, m = !!(t.dates && u && d) && c !== 0, h = s ? p(t, n) : null, g = f(n.reBillRatio), _ = n.description.trim(), v = t.billingType === "DELTA", y = f(n.fields.quantity ?? ""), b = [
|
|
525
|
-
|
|
532
|
+
E(t, n, i),
|
|
526
533
|
...t.reasonDetail && n.reason ? [{
|
|
527
534
|
label: i(`values.${t.reasonDetail}`),
|
|
528
535
|
name: t.reasonDetail,
|
|
@@ -532,7 +539,7 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
532
539
|
value: n.reason
|
|
533
540
|
}
|
|
534
541
|
}] : [],
|
|
535
|
-
...
|
|
542
|
+
...D(t, n, i),
|
|
536
543
|
..._ ? [{
|
|
537
544
|
label: i("values.description"),
|
|
538
545
|
name: a.description,
|
|
@@ -550,7 +557,7 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
550
557
|
label: i(`fields.${e}`),
|
|
551
558
|
name: e,
|
|
552
559
|
type: t,
|
|
553
|
-
value:
|
|
560
|
+
value: O(t, n.fields[e])
|
|
554
561
|
})),
|
|
555
562
|
...t.hasIntervention ? [{
|
|
556
563
|
label: i("values.intervention"),
|
|
@@ -590,7 +597,7 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
590
597
|
quantity: y
|
|
591
598
|
}
|
|
592
599
|
};
|
|
593
|
-
},
|
|
600
|
+
}, N = {
|
|
594
601
|
amount: "",
|
|
595
602
|
checks: {},
|
|
596
603
|
dates: {
|
|
@@ -603,99 +610,102 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
603
610
|
reason: "",
|
|
604
611
|
reBillRatio: "",
|
|
605
612
|
title: ""
|
|
606
|
-
},
|
|
607
|
-
let [
|
|
613
|
+
}, P = ({ funnel: n, countBillableDays: r, dailyPrice: i, lastReBillRatio: a = "", isEditing: o = !1, today: s, onlyDay: c }) => {
|
|
614
|
+
let [l, u] = t(), [d, f] = t(), [p, h] = t("kind"), [g, _] = t(N), [v, b] = t(!1), C = e(() => y(n), [n]), T = C.find(({ id: e }) => e === l), E = T?.events.find(({ id: e }) => e === d), { showsPrice: D, asksReBillRatio: O } = n.pricing, k = m(E, g, E?.dates === "range" ? r(g.dates) : 1), A = D && !!E?.price, j = A && !k.hasNothingToBill, P = x(T, E, g, j, !!c), F = P[P.indexOf(p) - 1], I = (e) => _((t) => ({
|
|
608
615
|
...t,
|
|
609
616
|
...e
|
|
610
|
-
})),
|
|
611
|
-
|
|
617
|
+
})), L = (e) => c && e.dates ? {
|
|
618
|
+
fromDate: c,
|
|
619
|
+
toDate: c
|
|
620
|
+
} : e.defaultsToToday && s ? {
|
|
621
|
+
fromDate: s,
|
|
622
|
+
toDate: s
|
|
623
|
+
} : N.dates, R = (e) => e.price === "credit" && i ? String(Math.abs(i)) : "", z = (e, t) => {
|
|
624
|
+
let n = x(T, E, t, j, !!c);
|
|
612
625
|
return n[n.indexOf(e) + 1] ?? "details";
|
|
613
|
-
},
|
|
614
|
-
|
|
615
|
-
},
|
|
626
|
+
}, B = () => {
|
|
627
|
+
u(void 0), f(void 0), h("kind"), _(N), b(!1);
|
|
628
|
+
}, V = (e, t, n = {}) => {
|
|
616
629
|
let r = {
|
|
617
|
-
...
|
|
618
|
-
amount:
|
|
619
|
-
dates: t
|
|
620
|
-
fromDate: s,
|
|
621
|
-
toDate: s
|
|
622
|
-
} : A.dates,
|
|
630
|
+
...N,
|
|
631
|
+
amount: R(t),
|
|
632
|
+
dates: L(t),
|
|
623
633
|
reason: t.reasons?.length ? "" : t.reason ?? "",
|
|
624
|
-
reBillRatio:
|
|
634
|
+
reBillRatio: O ? a : "",
|
|
625
635
|
...n
|
|
626
636
|
};
|
|
627
|
-
|
|
628
|
-
},
|
|
637
|
+
u(e.id), f(t.id), _(r), h(S(x(e, t, r, D && !!t.price, !!c), r, o));
|
|
638
|
+
}, H = ({ eventId: e, answers: t }) => {
|
|
629
639
|
let n = C.find(({ events: t }) => t.some(({ id: t }) => t === e)), r = n?.events.find(({ id: t }) => t === e);
|
|
630
|
-
return n && r ? (
|
|
631
|
-
},
|
|
640
|
+
return n && r ? (V(n, r, t), b(!0), !0) : !1;
|
|
641
|
+
}, U = (e, t) => {
|
|
632
642
|
if (e.events.length === 1) {
|
|
633
|
-
|
|
643
|
+
V(e, e.events[0], t);
|
|
634
644
|
return;
|
|
635
645
|
}
|
|
636
|
-
|
|
637
|
-
},
|
|
638
|
-
|
|
639
|
-
},
|
|
640
|
-
let t =
|
|
641
|
-
dates:
|
|
646
|
+
u(e.id), f(void 0), h("event");
|
|
647
|
+
}, W = (e) => {
|
|
648
|
+
T && V(T, e);
|
|
649
|
+
}, G = () => h(z(p, g)), K = (e) => {
|
|
650
|
+
let t = E?.endDates && e !== g.reason ? {
|
|
651
|
+
dates: N.dates,
|
|
642
652
|
reason: e
|
|
643
653
|
} : { reason: e }, n = {
|
|
644
|
-
...
|
|
654
|
+
...g,
|
|
645
655
|
...t
|
|
646
656
|
};
|
|
647
|
-
|
|
648
|
-
},
|
|
657
|
+
I(t), h(z("reason", n));
|
|
658
|
+
}, q = (e) => {
|
|
649
659
|
let t = {
|
|
650
|
-
amount: e &&
|
|
660
|
+
amount: e && E ? g.amount || R(E) : "",
|
|
651
661
|
amountGate: e
|
|
652
662
|
};
|
|
653
|
-
|
|
654
|
-
...
|
|
663
|
+
I(t), h(z("amountGate", {
|
|
664
|
+
...g,
|
|
655
665
|
...t
|
|
656
666
|
}));
|
|
657
|
-
},
|
|
658
|
-
if (!
|
|
659
|
-
|
|
667
|
+
}, J = () => {
|
|
668
|
+
if (!F || F === "kind") {
|
|
669
|
+
B();
|
|
660
670
|
return;
|
|
661
671
|
}
|
|
662
|
-
|
|
663
|
-
},
|
|
672
|
+
h(F);
|
|
673
|
+
}, Y = !!E && P.every((e) => w(e, E, g)), X = o && !D && !k.hasNothingToBill;
|
|
664
674
|
return {
|
|
665
|
-
amounts:
|
|
666
|
-
answers:
|
|
667
|
-
asksAmount:
|
|
668
|
-
buildPayload: (e, t) =>
|
|
669
|
-
answers:
|
|
670
|
-
billableDays:
|
|
675
|
+
amounts: k,
|
|
676
|
+
answers: g,
|
|
677
|
+
asksAmount: j,
|
|
678
|
+
buildPayload: (e, t) => E && Y ? M({
|
|
679
|
+
answers: g,
|
|
680
|
+
billableDays: k.billableDays,
|
|
671
681
|
bookingItemId: t,
|
|
672
|
-
event:
|
|
682
|
+
event: E,
|
|
673
683
|
funnel: n,
|
|
674
684
|
translate: e,
|
|
675
|
-
withPrice:
|
|
676
|
-
withReBillRatio:
|
|
685
|
+
withPrice: j || X,
|
|
686
|
+
withReBillRatio: O || o
|
|
677
687
|
}) : void 0,
|
|
678
|
-
canGoBack:
|
|
679
|
-
canGoNext: !!
|
|
680
|
-
event:
|
|
681
|
-
goBack:
|
|
682
|
-
goNext:
|
|
683
|
-
group:
|
|
688
|
+
canGoBack: p !== "kind" && !(v && (F === "kind" || F === "event")),
|
|
689
|
+
canGoNext: !!E && w(p, E, g),
|
|
690
|
+
event: E,
|
|
691
|
+
goBack: J,
|
|
692
|
+
goNext: G,
|
|
693
|
+
group: T,
|
|
684
694
|
groups: C,
|
|
685
|
-
isComplete:
|
|
686
|
-
isPriced:
|
|
687
|
-
reset:
|
|
688
|
-
selectAmountGate:
|
|
689
|
-
selectEvent:
|
|
690
|
-
selectGroup:
|
|
691
|
-
selectReason:
|
|
692
|
-
setAnswers:
|
|
693
|
-
showsReBillRatio:
|
|
694
|
-
startPrefill:
|
|
695
|
-
step:
|
|
696
|
-
steps:
|
|
695
|
+
isComplete: Y,
|
|
696
|
+
isPriced: A,
|
|
697
|
+
reset: B,
|
|
698
|
+
selectAmountGate: q,
|
|
699
|
+
selectEvent: W,
|
|
700
|
+
selectGroup: U,
|
|
701
|
+
selectReason: K,
|
|
702
|
+
setAnswers: I,
|
|
703
|
+
showsReBillRatio: O && A,
|
|
704
|
+
startPrefill: H,
|
|
705
|
+
step: p,
|
|
706
|
+
steps: P
|
|
697
707
|
};
|
|
698
|
-
},
|
|
708
|
+
}, F = {
|
|
699
709
|
ar: {
|
|
700
710
|
checks: {
|
|
701
711
|
ce_conformity: "تم التحقق من شهادة أو إقرار CE",
|
|
@@ -1823,7 +1833,7 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
1823
1833
|
title: "Título do evento"
|
|
1824
1834
|
}
|
|
1825
1835
|
}
|
|
1826
|
-
},
|
|
1836
|
+
}, I = ["companion", "operative"], L = {
|
|
1827
1837
|
...s,
|
|
1828
1838
|
breakage: {
|
|
1829
1839
|
...s.breakage,
|
|
@@ -1861,7 +1871,7 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
1861
1871
|
...s.robbery,
|
|
1862
1872
|
reasons: ["robbery_machine", "robbery_option"]
|
|
1863
1873
|
}
|
|
1864
|
-
},
|
|
1874
|
+
}, R = [
|
|
1865
1875
|
"n1_control",
|
|
1866
1876
|
"other_request",
|
|
1867
1877
|
"breakdown",
|
|
@@ -1879,13 +1889,13 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
1879
1889
|
"hours_record",
|
|
1880
1890
|
"robbery",
|
|
1881
1891
|
"other"
|
|
1882
|
-
],
|
|
1892
|
+
], z = [
|
|
1883
1893
|
"n1_control",
|
|
1884
1894
|
"n3_control",
|
|
1885
1895
|
"machine_assignment",
|
|
1886
1896
|
"operator_change",
|
|
1887
1897
|
"hours_record"
|
|
1888
|
-
],
|
|
1898
|
+
], B = [
|
|
1889
1899
|
c.controls,
|
|
1890
1900
|
c.admin_request,
|
|
1891
1901
|
c.machine_problem,
|
|
@@ -1894,88 +1904,88 @@ var n = "eventDeclaration", r = "soren-event", i = 2, a = {
|
|
|
1894
1904
|
c.delivery,
|
|
1895
1905
|
c.documents,
|
|
1896
1906
|
c.other
|
|
1897
|
-
],
|
|
1898
|
-
events:
|
|
1899
|
-
groups:
|
|
1907
|
+
], V = {
|
|
1908
|
+
events: R.map((e) => L[e]),
|
|
1909
|
+
groups: B,
|
|
1900
1910
|
id: "bouygues",
|
|
1901
1911
|
pricing: {
|
|
1902
1912
|
asksReBillRatio: !0,
|
|
1903
1913
|
showsPrice: !0
|
|
1904
1914
|
},
|
|
1905
1915
|
side: "client"
|
|
1906
|
-
},
|
|
1907
|
-
events:
|
|
1908
|
-
groups:
|
|
1916
|
+
}, H = {
|
|
1917
|
+
events: R.filter((e) => !z.includes(e)).map((e) => L[e]),
|
|
1918
|
+
groups: B,
|
|
1909
1919
|
id: "bouyguesField",
|
|
1910
1920
|
pricing: {
|
|
1911
1921
|
asksReBillRatio: !1,
|
|
1912
1922
|
showsPrice: !1
|
|
1913
1923
|
},
|
|
1914
1924
|
side: "client"
|
|
1915
|
-
},
|
|
1916
|
-
funnels: [
|
|
1917
|
-
getFunnel: (e) =>
|
|
1925
|
+
}, U = [{
|
|
1926
|
+
funnels: [V, H],
|
|
1927
|
+
getFunnel: (e) => I.includes(e ?? "") ? H : V,
|
|
1918
1928
|
tenants: ["bouygues"]
|
|
1919
|
-
}],
|
|
1929
|
+
}], W = [
|
|
1920
1930
|
l,
|
|
1921
1931
|
u,
|
|
1922
|
-
...
|
|
1923
|
-
],
|
|
1924
|
-
let t =
|
|
1932
|
+
...U.flatMap(({ funnels: e }) => e)
|
|
1933
|
+
], G = ({ side: e, tenantName: t, roleName: n }) => e === "supplier" ? u : U.find(({ tenants: e }) => e.includes(t ?? ""))?.getFunnel(n) ?? l, K = (e) => W.find((t) => t.id === e), q = 10, J = (e) => e.slice(0, q), Y = (e) => e.lineType === "booking_events", X = ({ workflowValues: e }, t) => Array.isArray(e) ? e.find((e) => typeof e == "object" && !!e && e.name === t) : void 0, ee = (e) => {
|
|
1934
|
+
let t = X(e, a.unitPrice)?.value;
|
|
1925
1935
|
return typeof t == "string" || typeof t == "number" ? f(String(t)) : null;
|
|
1926
|
-
},
|
|
1927
|
-
let t =
|
|
1928
|
-
return t !== null && t < 0 && !!
|
|
1929
|
-
},
|
|
1936
|
+
}, te = (e) => {
|
|
1937
|
+
let t = ee(e);
|
|
1938
|
+
return t !== null && t < 0 && !!X(e, a.dates);
|
|
1939
|
+
}, ne = (e = [], t) => e.filter(Y).flatMap((e) => {
|
|
1930
1940
|
let [n, r] = e.dates ?? [];
|
|
1931
|
-
return e.id !== t && n && r &&
|
|
1932
|
-
fromDate:
|
|
1941
|
+
return e.id !== t && n && r && te(e) ? [{
|
|
1942
|
+
fromDate: J(n),
|
|
1933
1943
|
line: e,
|
|
1934
|
-
toDate:
|
|
1944
|
+
toDate: J(r)
|
|
1935
1945
|
}] : [];
|
|
1936
|
-
}),
|
|
1946
|
+
}), re = (e, t) => t.find(({ fromDate: t, toDate: n }) => J(t) <= J(e) && J(e) <= J(n)), ie = ({ fromDate: e, toDate: t }, n) => e && t ? n.find((n) => J(e) <= J(n.toDate) && J(n.fromDate) <= J(t)) : void 0, Z = (e, t) => e.billingType !== "DELTA" || t?.qtyUnit === "HOURS", ae = (e, t) => ({
|
|
1937
1947
|
...e,
|
|
1938
|
-
events: e.events.filter((e) =>
|
|
1939
|
-
}),
|
|
1948
|
+
events: e.events.filter((e) => Z(e, t))
|
|
1949
|
+
}), Q = 10, $ = (e) => typeof e == "object" && e && "value" in e ? $(e.value) : typeof e == "string" || typeof e == "number" ? String(e) : "", oe = (e) => e === !0 || e === "true", se = (e) => {
|
|
1940
1950
|
let t = f(e);
|
|
1941
1951
|
return t === null ? e : String(t);
|
|
1942
|
-
},
|
|
1943
|
-
let n = (e) => t.find((t) => t.name === e)?.value, r =
|
|
1952
|
+
}, ce = (e, t) => {
|
|
1953
|
+
let n = (e) => t.find((t) => t.name === e)?.value, r = $(t.find(({ tag: e }) => e === "reason")?.value), i = t.find(({ tag: e }) => e === "description")?.value ?? n(a.description), o = e.hasTitle ? "" : $(e.reasonDetail ? n(e.reasonDetail) : r), s = n(a.dates), [c = "", l = ""] = Array.isArray(s) ? s.map($) : [], u = $(n(b(e, o)?.name ?? a.date)), d = Number($(n(a.unitPrice)) || NaN), f = Number.isFinite(d);
|
|
1944
1954
|
return {
|
|
1945
1955
|
amount: f ? String(e.price === "credit" || e.hasCreditNoteChoice ? Math.abs(d) : d) : "",
|
|
1946
1956
|
...e.amountGate && { amountGate: f },
|
|
1947
1957
|
...e.hasCreditNoteChoice && f && { isCreditNote: d < 0 },
|
|
1948
|
-
checks: Object.fromEntries((e.checks ?? []).map((e) => [e,
|
|
1958
|
+
checks: Object.fromEntries((e.checks ?? []).map((e) => [e, oe(n(e))])),
|
|
1949
1959
|
dates: {
|
|
1950
|
-
fromDate: (c || u).slice(0,
|
|
1951
|
-
toDate: (l || u).slice(0,
|
|
1960
|
+
fromDate: (c || u).slice(0, Q),
|
|
1961
|
+
toDate: (l || u).slice(0, Q)
|
|
1952
1962
|
},
|
|
1953
|
-
description:
|
|
1954
|
-
fields: Object.fromEntries((e.fields ?? []).map(({ name: e, type: t }) => [e, t === "number" ? $(
|
|
1955
|
-
intervention:
|
|
1963
|
+
description: $(i),
|
|
1964
|
+
fields: Object.fromEntries((e.fields ?? []).map(({ name: e, type: t }) => [e, t === "number" ? se($(n(e))) : $(n(e))])),
|
|
1965
|
+
intervention: oe(n(a.intervention)),
|
|
1956
1966
|
reason: o,
|
|
1957
|
-
reBillRatio: $(
|
|
1967
|
+
reBillRatio: se($(n(a.reBillRatio))),
|
|
1958
1968
|
title: e.hasTitle ? r : ""
|
|
1959
1969
|
};
|
|
1960
|
-
},
|
|
1961
|
-
if (!
|
|
1962
|
-
let r =
|
|
1970
|
+
}, le = (e, t, { reason: n }) => e.reasonDetail === t.reasonDetail && !!e.hasTitle == !!t.hasTitle && (!!e.hasTitle || !!e.reasonDetail || (e.reasons?.includes(n) ?? n === e.reason)), ue = (e, t) => e === "client" && t === "supplier", de = ({ workflow: e, workflowValues: t }, n) => {
|
|
1971
|
+
if (!j(e)) return;
|
|
1972
|
+
let r = K(e.funnel), i = n.side === e.side ? n.events.find(({ id: t }) => t === e.eventId) : void 0, a = r?.events.find(({ id: t }) => t === e.eventId) ?? i;
|
|
1963
1973
|
if (!a) return;
|
|
1964
|
-
let o =
|
|
1965
|
-
return i &&
|
|
1974
|
+
let o = ce(a, t ?? []);
|
|
1975
|
+
return i && le(i, a, o) ? {
|
|
1966
1976
|
answers: o,
|
|
1967
1977
|
editFunnel: n,
|
|
1968
1978
|
event: i,
|
|
1969
1979
|
side: e.side
|
|
1970
1980
|
} : {
|
|
1971
1981
|
answers: o,
|
|
1972
|
-
editFunnel: r && !a.isProof &&
|
|
1982
|
+
editFunnel: r && !a.isProof && ue(n.side, e.side) ? {
|
|
1973
1983
|
...r,
|
|
1974
1984
|
pricing: n.pricing
|
|
1975
1985
|
} : void 0,
|
|
1976
1986
|
event: a,
|
|
1977
1987
|
side: e.side
|
|
1978
1988
|
};
|
|
1979
|
-
},
|
|
1989
|
+
}, fe = ({ answers: e, event: t }) => !!t.hasTitle && !!e.title || !t.reasons?.length;
|
|
1980
1990
|
//#endregion
|
|
1981
|
-
export { s as CLIENT_EVENTS, c as CLIENT_GROUPS,
|
|
1991
|
+
export { s as CLIENT_EVENTS, c as CLIENT_GROUPS, h as DAILY_PRICE_SHARES, k as DEDICATED_FUNNEL, l as DEFAULT_CLIENT_FUNNEL, F as EVENT_LOCALES, n as EVENT_NAMESPACE, o as INVENTORY_ID, r as NATIVE_EVENT_SOURCE, i as NATIVE_EVENT_VERSION, u as SUPPLIER_FUNNEL, a as VALUE_NAMES, Z as billsOnLine, M as buildEventPayload, re as findCreditOfDay, ie as findCreditOverlap, K as findEventFunnel, _ as findShare, ne as getCreditedPeriods, A as getDedicatedEventWorkflow, b as getEndDate, m as getEventAmounts, G as getEventFunnel, S as getFirstQuestion, y as getFunnelGroups, ae as getLineFunnel, T as getReason, g as getShareAmount, x as getSteps, p as getUnitPrice, v as isAmountToComplete, fe as isNamedByDeclaration, j as isNativeEventWorkflow, w as isStepAnswered, de as readEvent, f as toDecimal, P as useEventDeclaration };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/main.js
CHANGED
|
@@ -206,31 +206,32 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
206
206
|
deadClicks: !0,
|
|
207
207
|
rageClicks: !0,
|
|
208
208
|
...e === !0 ? {} : e
|
|
209
|
-
}, N = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: c = !0, platform:
|
|
210
|
-
let { libraries:
|
|
209
|
+
}, N = ({ apiKey: e, appVersion: t, sessionReplaySampleRate: n, serverZone: r, elementInteractions: i = !0, frustrationInteractions: c = !0, platform: d = "desktop", sessionReplayPrivacy: f = te, userId: p, ...m }) => {
|
|
210
|
+
let [h, g] = u(!!p), { libraries: _ } = a(y), v = m.amplitude || _?.amplitude, b = l({
|
|
211
211
|
elementInteractions: i,
|
|
212
212
|
frustrationInteractions: c,
|
|
213
|
-
sessionReplayPrivacy:
|
|
214
|
-
});
|
|
215
|
-
return s(() => {
|
|
216
|
-
|
|
213
|
+
sessionReplayPrivacy: f
|
|
214
|
+
}), x = l(p);
|
|
215
|
+
return p && !h && g(!0), s(() => {
|
|
216
|
+
b.current = {
|
|
217
217
|
elementInteractions: i,
|
|
218
218
|
frustrationInteractions: c,
|
|
219
|
-
sessionReplayPrivacy:
|
|
220
|
-
};
|
|
219
|
+
sessionReplayPrivacy: f
|
|
220
|
+
}, x.current = p;
|
|
221
221
|
}), o(() => {
|
|
222
|
-
let i =
|
|
223
|
-
if (!(e && i)) return;
|
|
224
|
-
let { elementInteractions: o, frustrationInteractions: s, sessionReplayPrivacy: c } =
|
|
225
|
-
return i.init(e, {
|
|
222
|
+
let i = v?.analytics, a = v?.sessionReplayPlugin;
|
|
223
|
+
if (!(e && i && h)) return;
|
|
224
|
+
let { elementInteractions: o, frustrationInteractions: s, sessionReplayPrivacy: c } = b.current, l = x.current, u = !l, f = "platform-enrichment", p = j(o, i.Types?.DEFAULT_CSS_SELECTOR_ALLOWLIST ?? A);
|
|
225
|
+
return i.init(e, l, {
|
|
226
226
|
appVersion: t,
|
|
227
227
|
autocapture: {
|
|
228
|
-
elementInteractions:
|
|
229
|
-
frustrationInteractions: M(s,
|
|
228
|
+
elementInteractions: p,
|
|
229
|
+
frustrationInteractions: M(s, p !== !1),
|
|
230
230
|
pageViews: { trackHistoryChanges: "pathOnly" }
|
|
231
231
|
},
|
|
232
|
+
optOut: u,
|
|
232
233
|
serverZone: r
|
|
233
|
-
}), a && i.add(a({
|
|
234
|
+
}), i.setOptOut(u), a && i.add(a({
|
|
234
235
|
privacyConfig: c,
|
|
235
236
|
...n === void 0 ? {} : { sampleRate: n }
|
|
236
237
|
})), i.add({
|
|
@@ -238,21 +239,36 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
238
239
|
...e,
|
|
239
240
|
event_properties: {
|
|
240
241
|
...e.event_properties,
|
|
241
|
-
platform:
|
|
242
|
+
platform: d
|
|
242
243
|
}
|
|
243
244
|
}),
|
|
244
|
-
name:
|
|
245
|
+
name: f,
|
|
245
246
|
type: "enrichment"
|
|
246
247
|
}), () => {
|
|
247
|
-
a && i.remove("@amplitude/plugin-session-replay-browser"), i.remove(
|
|
248
|
+
a && i.remove("@amplitude/plugin-session-replay-browser"), i.remove(f), i.setOptOut(!0);
|
|
248
249
|
};
|
|
249
250
|
}, [
|
|
250
251
|
e,
|
|
251
|
-
|
|
252
|
+
v,
|
|
252
253
|
t,
|
|
253
|
-
|
|
254
|
+
d,
|
|
254
255
|
r,
|
|
255
|
-
n
|
|
256
|
+
n,
|
|
257
|
+
h
|
|
258
|
+
]), o(() => {
|
|
259
|
+
let t = v?.analytics;
|
|
260
|
+
if (e && t && h) {
|
|
261
|
+
if (!p) {
|
|
262
|
+
t.setOptOut(!0);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
t.setUserId(p), t.setOptOut(!1);
|
|
266
|
+
}
|
|
267
|
+
}, [
|
|
268
|
+
e,
|
|
269
|
+
v,
|
|
270
|
+
h,
|
|
271
|
+
p
|
|
256
272
|
]), null;
|
|
257
273
|
}, P = (() => {
|
|
258
274
|
try {
|
|
@@ -547,7 +563,7 @@ var f = 3e4, p = 1e3, m = 1e4, h = (e) => Array.isArray(e) ? e.map(h) : typeof e
|
|
|
547
563
|
return {
|
|
548
564
|
identify: n,
|
|
549
565
|
reset: i(() => {
|
|
550
|
-
t && t.reset();
|
|
566
|
+
t && (t.setOptOut(!0), t.reset());
|
|
551
567
|
}, [t]),
|
|
552
568
|
setGroup: r,
|
|
553
569
|
track: o
|