@segment/action-destinations 3.90.1-alpha.6 → 3.93.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/destinations/cordial/addProductToCart/index.js +1 -1
- package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
- package/dist/destinations/cordial/index.js +1 -1
- package/dist/destinations/cordial/index.js.map +1 -1
- package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
- package/dist/destinations/cordial/upsertOrder/index.js +8 -8
- package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
- package/dist/destinations/customerio/trackEvent/index.js.map +1 -1
- package/dist/destinations/facebook-conversions-api/constants.d.ts +1 -1
- package/dist/destinations/facebook-conversions-api/constants.js +1 -1
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js +2 -3
- package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
- package/dist/destinations/heap/trackEvent/index.js +0 -1
- package/dist/destinations/heap/trackEvent/index.js.map +1 -1
- package/dist/destinations/index.js +0 -2
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/generated-types.d.ts +0 -5
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js +3 -39
- package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js +3 -3
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/talon-one/index.js +0 -2
- package/dist/destinations/talon-one/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/actions-pardot/generated-types.d.ts +0 -5
- package/dist/destinations/actions-pardot/generated-types.js +0 -3
- package/dist/destinations/actions-pardot/generated-types.js.map +0 -1
- package/dist/destinations/actions-pardot/index.d.ts +0 -4
- package/dist/destinations/actions-pardot/index.js +0 -62
- package/dist/destinations/actions-pardot/index.js.map +0 -1
- package/dist/destinations/actions-pardot/pa-operations.d.ts +0 -17
- package/dist/destinations/actions-pardot/pa-operations.js +0 -51
- package/dist/destinations/actions-pardot/pa-operations.js.map +0 -1
- package/dist/destinations/actions-pardot/pa-properties.d.ts +0 -2
- package/dist/destinations/actions-pardot/pa-properties.js +0 -13
- package/dist/destinations/actions-pardot/pa-properties.js.map +0 -1
- package/dist/destinations/actions-pardot/pa-type.d.ts +0 -15
- package/dist/destinations/actions-pardot/pa-type.js +0 -3
- package/dist/destinations/actions-pardot/pa-type.js.map +0 -1
- package/dist/destinations/actions-pardot/prospects/generated-types.d.ts +0 -19
- package/dist/destinations/actions-pardot/prospects/generated-types.js +0 -3
- package/dist/destinations/actions-pardot/prospects/generated-types.js.map +0 -1
- package/dist/destinations/actions-pardot/prospects/index.d.ts +0 -5
- package/dist/destinations/actions-pardot/prospects/index.js +0 -204
- package/dist/destinations/actions-pardot/prospects/index.js.map +0 -1
- package/dist/destinations/intercom/generated-types.d.ts +0 -2
- package/dist/destinations/intercom/generated-types.js +0 -3
- package/dist/destinations/intercom/generated-types.js.map +0 -1
- package/dist/destinations/intercom/groupIdentifyContact/generated-types.d.ts +0 -14
- package/dist/destinations/intercom/groupIdentifyContact/generated-types.js +0 -3
- package/dist/destinations/intercom/groupIdentifyContact/generated-types.js.map +0 -1
- package/dist/destinations/intercom/groupIdentifyContact/index.d.ts +0 -5
- package/dist/destinations/intercom/groupIdentifyContact/index.js +0 -122
- package/dist/destinations/intercom/groupIdentifyContact/index.js.map +0 -1
- package/dist/destinations/intercom/identifyContact/generated-types.d.ts +0 -15
- package/dist/destinations/intercom/identifyContact/generated-types.js +0 -3
- package/dist/destinations/intercom/identifyContact/generated-types.js.map +0 -1
- package/dist/destinations/intercom/identifyContact/index.d.ts +0 -5
- package/dist/destinations/intercom/identifyContact/index.js +0 -153
- package/dist/destinations/intercom/identifyContact/index.js.map +0 -1
- package/dist/destinations/intercom/index.d.ts +0 -4
- package/dist/destinations/intercom/index.js +0 -37
- package/dist/destinations/intercom/index.js.map +0 -1
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.d.ts +0 -15
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.js +0 -3
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.js.map +0 -1
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.d.ts +0 -5
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.js +0 -71
- package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.js.map +0 -1
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const action = {
|
|
5
|
-
title: 'Identify Contact',
|
|
6
|
-
description: 'Create or Update a Contact.',
|
|
7
|
-
defaultSubscription: 'type = "identify"',
|
|
8
|
-
platform: 'web',
|
|
9
|
-
fields: {
|
|
10
|
-
role: {
|
|
11
|
-
type: 'string',
|
|
12
|
-
required: true,
|
|
13
|
-
description: 'The role of the contact. Accepted values are `user` or `lead`. Can only be updated if `lead`.',
|
|
14
|
-
label: 'Role',
|
|
15
|
-
default: 'lead'
|
|
16
|
-
},
|
|
17
|
-
external_id: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
description: 'A unique identifier generated outside Intercom. Required if role=user and email is blank.',
|
|
20
|
-
label: 'External ID',
|
|
21
|
-
default: {
|
|
22
|
-
'@path': '$.userId'
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
email: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: "The contact's email. Required if role=user and external_id is blank.",
|
|
28
|
-
label: 'Email',
|
|
29
|
-
format: 'email',
|
|
30
|
-
default: {
|
|
31
|
-
'@path': '$.traits.email'
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
phone: {
|
|
35
|
-
label: 'Phone Number',
|
|
36
|
-
description: "The contact's phone number.",
|
|
37
|
-
type: 'string',
|
|
38
|
-
default: {
|
|
39
|
-
'@path': '$.traits.phone'
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
name: {
|
|
43
|
-
type: 'string',
|
|
44
|
-
description: "The contact's name.",
|
|
45
|
-
label: 'Name',
|
|
46
|
-
default: {
|
|
47
|
-
'@path': '$.traits.name'
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
avatar: {
|
|
51
|
-
label: 'Avatar',
|
|
52
|
-
description: 'URL of image to be associated with contact profile.',
|
|
53
|
-
type: 'string',
|
|
54
|
-
format: 'uri',
|
|
55
|
-
default: {
|
|
56
|
-
'@path': '$.traits.avatar'
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
signed_up_at: {
|
|
60
|
-
label: 'Signed Up At',
|
|
61
|
-
type: 'datetime',
|
|
62
|
-
description: 'The timestamp when the contact was created.',
|
|
63
|
-
default: {
|
|
64
|
-
'@path': '$.createdAt'
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
last_seen_at: {
|
|
68
|
-
label: 'Timestamp',
|
|
69
|
-
type: 'datetime',
|
|
70
|
-
description: 'The timestamp the contact was last seen.',
|
|
71
|
-
default: {
|
|
72
|
-
'@path': '$.timestamp'
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
owner_id: {
|
|
76
|
-
label: 'Owner Id',
|
|
77
|
-
type: 'number',
|
|
78
|
-
description: 'The id of an admin that has been assigned account ownership of the contact.'
|
|
79
|
-
},
|
|
80
|
-
unsubscribed_from_emails: {
|
|
81
|
-
label: 'Unsubscribed From Emails',
|
|
82
|
-
type: 'boolean',
|
|
83
|
-
description: 'Whether the contact is unsubscribed from emails.'
|
|
84
|
-
},
|
|
85
|
-
custom_attributes: {
|
|
86
|
-
label: 'Custom Attributes',
|
|
87
|
-
description: 'The custom attributes which are set for the contact. Note: Will throw an error if the object has an attribute that isn`t explicitly defined on Intercom.',
|
|
88
|
-
type: 'object',
|
|
89
|
-
default: {
|
|
90
|
-
'@path': '$.traits.customAttributes'
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
perform: async (request, { payload }) => {
|
|
95
|
-
try {
|
|
96
|
-
const contact = await searchIntercomContact(request, payload);
|
|
97
|
-
if (contact) {
|
|
98
|
-
return updateIntercomContact(request, contact.id, payload);
|
|
99
|
-
}
|
|
100
|
-
return await createIntercomContact(request, payload);
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
103
|
-
if (error?.response?.status === 409) {
|
|
104
|
-
throw new actions_core_1.RetryableError('Contact was reported duplicated but could not be searched for, probably due to Intercom search cache not being updated');
|
|
105
|
-
}
|
|
106
|
-
throw error;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
async function createIntercomContact(request, payload) {
|
|
111
|
-
return request('https://api.intercom.io/contacts', {
|
|
112
|
-
method: 'POST',
|
|
113
|
-
json: payload
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
async function searchIntercomContact(request, payload) {
|
|
117
|
-
const searchFields = {
|
|
118
|
-
email: payload.email,
|
|
119
|
-
external_id: payload.external_id,
|
|
120
|
-
role: payload.role
|
|
121
|
-
};
|
|
122
|
-
const value = [];
|
|
123
|
-
for (const [key, fieldValue] of Object.entries(searchFields)) {
|
|
124
|
-
if (fieldValue) {
|
|
125
|
-
value.push({
|
|
126
|
-
field: key,
|
|
127
|
-
operator: '=',
|
|
128
|
-
value: fieldValue
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
const query = {
|
|
133
|
-
operator: 'AND',
|
|
134
|
-
value
|
|
135
|
-
};
|
|
136
|
-
const response = await request('https://api.intercom.io/contacts/search', {
|
|
137
|
-
method: 'POST',
|
|
138
|
-
json: { query }
|
|
139
|
-
});
|
|
140
|
-
if (response.data.total_count === 1) {
|
|
141
|
-
return response.data.data[0];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async function updateIntercomContact(request, contactId, payload) {
|
|
145
|
-
return request(`https://api.intercom.io/contacts/${contactId}`, {
|
|
146
|
-
method: 'PUT',
|
|
147
|
-
json: {
|
|
148
|
-
...payload
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
exports.default = action;
|
|
153
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/identifyContact/index.ts"],"names":[],"mappings":";;AAAA,wDAAyG;AAazG,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,6BAA6B;IAC1C,mBAAmB,EAAE,mBAAmB;IACxC,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,+FAA+F;YAC5G,KAAK,EAAE,MAAM;YACb,OAAO,EAAE,MAAM;SAChB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2FAA2F;YACxG,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,sEAAsE;YACnF,KAAK,EAAE,OAAO;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qBAAqB;YAClC,KAAK,EAAE,MAAM;YACb,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,MAAM,EAAE;YAC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EAAE,KAAK;QACb,IAAI,EAAE;YACJ,GAAG,OAAO;SACX;KACF,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const identifyContact_1 = __importDefault(require("./identifyContact"));
|
|
7
|
-
const groupIdentifyContact_1 = __importDefault(require("./groupIdentifyContact"));
|
|
8
|
-
const destination = {
|
|
9
|
-
name: 'Intercom (Actions)',
|
|
10
|
-
slug: 'actions-intercom',
|
|
11
|
-
mode: 'cloud',
|
|
12
|
-
authentication: {
|
|
13
|
-
scheme: 'oauth2',
|
|
14
|
-
fields: {},
|
|
15
|
-
testAuthentication: (request) => {
|
|
16
|
-
return request('https://api.intercom.io/admins');
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
extendRequest({ auth }) {
|
|
20
|
-
return {
|
|
21
|
-
headers: {
|
|
22
|
-
authorization: `Bearer ${auth?.accessToken}`
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
onDelete: async (request, { payload }) => {
|
|
27
|
-
return request(`https://api.intercom.io/contacts/${payload.userId}`, {
|
|
28
|
-
method: 'DELETE'
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
actions: {
|
|
32
|
-
identifyContact: identifyContact_1.default,
|
|
33
|
-
groupIdentifyContact: groupIdentifyContact_1.default
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.default = destination;
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/intercom/index.ts"],"names":[],"mappings":";;;;;AAEA,wEAA+C;AAC/C,kFAAyD;AAEzD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAG9B,OAAO,OAAO,CAAC,gCAAgC,CAAC,CAAA;QAClD,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;aAC7C;SACF,CAAA;IACH,CAAC;IAED,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACvC,OAAO,OAAO,CAAC,oCAAoC,OAAO,CAAC,MAAM,EAAE,EAAE;YACnE,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,EAAE;QACP,eAAe,EAAf,yBAAe;QACf,oBAAoB,EAApB,8BAAoB;KACrB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const t1_properties_1 = require("../t1-properties");
|
|
4
|
-
const action = {
|
|
5
|
-
title: 'Update Multiple Customer Profiles’ Attributes',
|
|
6
|
-
description: 'This updates attributes for multiple customer profiles.',
|
|
7
|
-
fields: {
|
|
8
|
-
data: {
|
|
9
|
-
label: 'Data item to change customer profile attributes',
|
|
10
|
-
description: 'An array of JSON objects that contains customer profile identifier and list of attributes and their values. Customer profile ID is required.',
|
|
11
|
-
type: 'object',
|
|
12
|
-
multiple: true,
|
|
13
|
-
properties: {
|
|
14
|
-
customerProfileId: { ...t1_properties_1.customerProfileId },
|
|
15
|
-
attributes: { ...t1_properties_1.attribute }
|
|
16
|
-
},
|
|
17
|
-
required: true
|
|
18
|
-
},
|
|
19
|
-
mutualAttributes: {
|
|
20
|
-
...t1_properties_1.attribute,
|
|
21
|
-
label: 'Mutual Attribute-Value pairs',
|
|
22
|
-
description: 'This may contain mutual list of attributes and their values for every customer profile in the "data" array.'
|
|
23
|
-
},
|
|
24
|
-
attributesInfo: {
|
|
25
|
-
label: 'Attributes with types',
|
|
26
|
-
description: 'Use this field if you want to identify an attribute with a specific type',
|
|
27
|
-
type: 'object',
|
|
28
|
-
required: false,
|
|
29
|
-
multiple: true,
|
|
30
|
-
properties: {
|
|
31
|
-
name: {
|
|
32
|
-
label: 'Name',
|
|
33
|
-
description: 'Attribute name',
|
|
34
|
-
type: 'string',
|
|
35
|
-
required: true
|
|
36
|
-
},
|
|
37
|
-
type: {
|
|
38
|
-
label: 'Type',
|
|
39
|
-
description: 'Attribute type. Can be only `string`, `time`, `number`, `boolean`, `location`',
|
|
40
|
-
type: 'string',
|
|
41
|
-
required: true
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
default: {
|
|
45
|
-
'@arrayPath': [
|
|
46
|
-
'$.traits.attributesInfo',
|
|
47
|
-
{
|
|
48
|
-
name: {
|
|
49
|
-
'@path': '$.name'
|
|
50
|
-
},
|
|
51
|
-
type: {
|
|
52
|
-
'@path': '$.type'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
perform: (request, { payload }) => {
|
|
60
|
-
return request(`https://integration.talon.one/segment/customer_profiles/attributes`, {
|
|
61
|
-
method: 'put',
|
|
62
|
-
json: {
|
|
63
|
-
data: payload.data,
|
|
64
|
-
mutualAttributes: payload.mutualAttributes,
|
|
65
|
-
attributesInfo: payload.attributesInfo
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
exports.default = action;
|
|
71
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/talon-one/updateCustomerProfilesAttributes/index.ts"],"names":[],"mappings":";;AAGA,oDAA+D;AAE/D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,yDAAyD;IACtE,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,iDAAiD;YACxD,WAAW,EACT,8IAA8I;YAChJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,iBAAiB,EAAE,EAAE,GAAG,iCAAiB,EAAE;gBAC3C,UAAU,EAAE,EAAE,GAAG,yBAAS,EAAE;aAC7B;YACD,QAAQ,EAAE,IAAI;SACf;QACD,gBAAgB,EAAE;YAChB,GAAG,yBAAS;YACZ,KAAK,EAAE,8BAA8B;YACrC,WAAW,EACT,6GAA6G;SAChH;QACD,cAAc,EAAE;YACd,KAAK,EAAE,uBAAuB;YAC9B,WAAW,EAAE,0EAA0E;YACvF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,gBAAgB;oBAC7B,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;gBACD,IAAI,EAAE;oBACJ,KAAK,EAAE,MAAM;oBACb,WAAW,EAAE,+EAA+E;oBAC5F,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;aACF;YACD,OAAO,EAAE;gBACP,YAAY,EAAE;oBACZ,yBAAyB;oBACzB;wBACE,IAAI,EAAE;4BACJ,OAAO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