@chordcommerce/analytics 1.7.0 → 1.8.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.
@@ -1,4 +1,4 @@
1
- import type { AnyAnalytics, EventProperties, Options, ValidateResult, ChordAnalyticsOptions, AnyOptions, CartViewedInput, IdentifyTraits, CheckoutStartedInput, EmailCapturedInput, ProductListViewedInput, ProductListFilteredInput, ProductAddedInput, ProductClickedInput, ProductRemovedInput, ProductViewedInput, ProductsSearchedInput, CouponAppliedInput, CouponDeniedInput, CouponEnteredInput, CouponRemovedInput, SignedInInput, SignedOutInput, SignedUpInput, ObjectTypes } from '../types/index.js';
1
+ import type { AnyAnalytics, EventProperties, Options, ValidateResult, ChordAnalyticsOptions, AnyOptions, CartViewedInput, IdentifyTraits, CheckoutStartedInput, CheckoutStepCompletedInput, CheckoutStepViewedInput, EmailCapturedInput, ProductListViewedInput, ProductListFilteredInput, ProductAddedInput, ProductClickedInput, VariantClickedInput, ProductRemovedInput, ProductViewedInput, ProductsSearchedInput, CouponAppliedInput, CouponDeniedInput, CouponEnteredInput, CouponRemovedInput, SignedInInput, SignedOutInput, SignedUpInput, LoginStartedInput, ObjectTypes, SubscriptionCancelledInput, NavigationClickedInput, PaymentInfoEnteredInput } from '../types/index.js';
2
2
  export interface ChordAnalyticsSnippet {
3
3
  _loadOptions: ChordAnalyticsOptions<ObjectTypes>;
4
4
  invoked: boolean;
@@ -66,6 +66,8 @@ export declare class ChordAnalytics<T extends ObjectTypes = ObjectTypes> {
66
66
  reset: () => void;
67
67
  trackCartViewed: (props: CartViewedInput<T>, options?: AnyOptions) => Promise<void>;
68
68
  trackCheckoutStarted: (props: CheckoutStartedInput<T>, options?: AnyOptions) => Promise<void>;
69
+ trackCheckoutStepCompleted: (props: CheckoutStepCompletedInput, options?: AnyOptions) => Promise<void>;
70
+ trackCheckoutStepViewed: (props: CheckoutStepViewedInput, options?: AnyOptions) => Promise<void>;
69
71
  trackCouponApplied: (props: CouponAppliedInput, options?: AnyOptions) => Promise<void>;
70
72
  trackCouponDenied: (props: CouponDeniedInput, options?: AnyOptions) => Promise<void>;
71
73
  trackCouponEntered: (props: CouponEnteredInput, options?: AnyOptions) => Promise<void>;
@@ -73,6 +75,7 @@ export declare class ChordAnalytics<T extends ObjectTypes = ObjectTypes> {
73
75
  trackEmailCaptured: (props: EmailCapturedInput, options?: AnyOptions) => Promise<void>;
74
76
  trackProductAdded: (props: ProductAddedInput<T>, options?: AnyOptions) => Promise<void>;
75
77
  trackProductClicked: (props: ProductClickedInput<T>, options?: AnyOptions) => Promise<void>;
78
+ trackVariantClicked: (props: VariantClickedInput<T>, options?: AnyOptions) => Promise<void>;
76
79
  trackProductListFiltered: (props: ProductListFilteredInput, options?: AnyOptions) => Promise<void>;
77
80
  trackProductListViewed: (props: ProductListViewedInput<T>, options?: AnyOptions) => Promise<void>;
78
81
  trackProductRemoved: (props: ProductRemovedInput<T>, options?: AnyOptions) => Promise<void>;
@@ -81,4 +84,8 @@ export declare class ChordAnalytics<T extends ObjectTypes = ObjectTypes> {
81
84
  trackSignedIn: (props: SignedInInput, options?: AnyOptions) => Promise<void>;
82
85
  trackSignedOut: (props?: SignedOutInput, options?: AnyOptions) => Promise<void>;
83
86
  trackSignedUp: (props?: SignedUpInput, options?: AnyOptions) => Promise<void>;
87
+ trackLoginStarted: (props: LoginStartedInput, options?: AnyOptions) => Promise<void>;
88
+ trackSubscriptionCancelled: (props: SubscriptionCancelledInput, options?: AnyOptions) => Promise<void>;
89
+ trackNavigationClicked: (props: NavigationClickedInput, options?: AnyOptions) => Promise<void>;
90
+ trackPaymentInfoEntered: (props: PaymentInfoEnteredInput, options?: AnyOptions) => Promise<void>;
84
91
  }
@@ -165,9 +165,39 @@ export class ChordAnalytics {
165
165
  }
166
166
  return this.track('Checkout Started', payload, options);
167
167
  });
168
- this.trackCouponApplied = (props, options) => __awaiter(this, void 0, void 0, function* () {
168
+ this.trackCheckoutStepCompleted = (props, options) => __awaiter(this, void 0, void 0, function* () {
169
169
  var _t, _u, _v;
170
- const formatter = (_v = (_u = (_t = this.options) === null || _t === void 0 ? void 0 : _t.formatters) === null || _u === void 0 ? void 0 : _u.events) === null || _v === void 0 ? void 0 : _v.couponApplied;
170
+ const formatter = (_v = (_u = (_t = this.options) === null || _t === void 0 ? void 0 : _t.formatters) === null || _u === void 0 ? void 0 : _u.events) === null || _v === void 0 ? void 0 : _v.checkoutStepCompleted;
171
+ const payload = {
172
+ checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
173
+ payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
174
+ shipping_method: props === null || props === void 0 ? void 0 : props.shippingMethod,
175
+ step: props === null || props === void 0 ? void 0 : props.step,
176
+ };
177
+ if (typeof formatter === 'function') {
178
+ const formattedPayload = formatter(props, payload);
179
+ return this.track('Checkout Step Completed', formattedPayload, options);
180
+ }
181
+ return this.track('Checkout Step Completed', payload, options);
182
+ });
183
+ this.trackCheckoutStepViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
184
+ var _w, _x, _y;
185
+ const formatter = (_y = (_x = (_w = this.options) === null || _w === void 0 ? void 0 : _w.formatters) === null || _x === void 0 ? void 0 : _x.events) === null || _y === void 0 ? void 0 : _y.checkoutStepViewed;
186
+ const payload = {
187
+ checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
188
+ payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
189
+ shipping_method: props === null || props === void 0 ? void 0 : props.shippingMethod,
190
+ step: props === null || props === void 0 ? void 0 : props.step,
191
+ };
192
+ if (typeof formatter === 'function') {
193
+ const formattedPayload = formatter(props, payload);
194
+ return this.track('Checkout Step Viewed', formattedPayload, options);
195
+ }
196
+ return this.track('Checkout Step Viewed', payload, options);
197
+ });
198
+ this.trackCouponApplied = (props, options) => __awaiter(this, void 0, void 0, function* () {
199
+ var _z, _0, _1;
200
+ const formatter = (_1 = (_0 = (_z = this.options) === null || _z === void 0 ? void 0 : _z.formatters) === null || _0 === void 0 ? void 0 : _0.events) === null || _1 === void 0 ? void 0 : _1.couponApplied;
171
201
  const payload = {
172
202
  cart_id: props === null || props === void 0 ? void 0 : props.cartId,
173
203
  coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
@@ -182,8 +212,8 @@ export class ChordAnalytics {
182
212
  return this.track('Coupon Applied', payload, options);
183
213
  });
184
214
  this.trackCouponDenied = (props, options) => __awaiter(this, void 0, void 0, function* () {
185
- var _w, _x, _y;
186
- const formatter = (_y = (_x = (_w = this.options) === null || _w === void 0 ? void 0 : _w.formatters) === null || _x === void 0 ? void 0 : _x.events) === null || _y === void 0 ? void 0 : _y.couponDenied;
215
+ var _2, _3, _4;
216
+ const formatter = (_4 = (_3 = (_2 = this.options) === null || _2 === void 0 ? void 0 : _2.formatters) === null || _3 === void 0 ? void 0 : _3.events) === null || _4 === void 0 ? void 0 : _4.couponDenied;
187
217
  const payload = {
188
218
  cart_id: props === null || props === void 0 ? void 0 : props.cartId,
189
219
  coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
@@ -198,8 +228,8 @@ export class ChordAnalytics {
198
228
  return this.track('Coupon Denied', payload, options);
199
229
  });
200
230
  this.trackCouponEntered = (props, options) => __awaiter(this, void 0, void 0, function* () {
201
- var _z, _0, _1;
202
- const formatter = (_1 = (_0 = (_z = this.options) === null || _z === void 0 ? void 0 : _z.formatters) === null || _0 === void 0 ? void 0 : _0.events) === null || _1 === void 0 ? void 0 : _1.couponEntered;
231
+ var _5, _6, _7;
232
+ const formatter = (_7 = (_6 = (_5 = this.options) === null || _5 === void 0 ? void 0 : _5.formatters) === null || _6 === void 0 ? void 0 : _6.events) === null || _7 === void 0 ? void 0 : _7.couponEntered;
203
233
  const payload = {
204
234
  cart_id: props === null || props === void 0 ? void 0 : props.cartId,
205
235
  coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
@@ -213,8 +243,8 @@ export class ChordAnalytics {
213
243
  return this.track('Coupon Entered', payload, options);
214
244
  });
215
245
  this.trackCouponRemoved = (props, options) => __awaiter(this, void 0, void 0, function* () {
216
- var _2, _3, _4;
217
- const formatter = (_4 = (_3 = (_2 = this.options) === null || _2 === void 0 ? void 0 : _2.formatters) === null || _3 === void 0 ? void 0 : _3.events) === null || _4 === void 0 ? void 0 : _4.couponRemoved;
246
+ var _8, _9, _10;
247
+ const formatter = (_10 = (_9 = (_8 = this.options) === null || _8 === void 0 ? void 0 : _8.formatters) === null || _9 === void 0 ? void 0 : _9.events) === null || _10 === void 0 ? void 0 : _10.couponRemoved;
218
248
  const payload = {
219
249
  cart_id: props === null || props === void 0 ? void 0 : props.cartId,
220
250
  coupon_id: props === null || props === void 0 ? void 0 : props.couponId,
@@ -229,8 +259,8 @@ export class ChordAnalytics {
229
259
  return this.track('Coupon Removed', payload, options);
230
260
  });
231
261
  this.trackEmailCaptured = (props, options) => __awaiter(this, void 0, void 0, function* () {
232
- var _5, _6, _7;
233
- const formatter = (_7 = (_6 = (_5 = this.options) === null || _5 === void 0 ? void 0 : _5.formatters) === null || _6 === void 0 ? void 0 : _6.events) === null || _7 === void 0 ? void 0 : _7.emailCaptured;
262
+ var _11, _12, _13;
263
+ const formatter = (_13 = (_12 = (_11 = this.options) === null || _11 === void 0 ? void 0 : _11.formatters) === null || _12 === void 0 ? void 0 : _12.events) === null || _13 === void 0 ? void 0 : _13.emailCaptured;
234
264
  const payload = {
235
265
  email: props === null || props === void 0 ? void 0 : props.email,
236
266
  placement_component: props === null || props === void 0 ? void 0 : props.placementComponent,
@@ -243,13 +273,13 @@ export class ChordAnalytics {
243
273
  return this.track('Email Captured', payload, options);
244
274
  });
245
275
  this.trackProductAdded = (props, options) => __awaiter(this, void 0, void 0, function* () {
246
- var _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19;
247
- const formatter = (_10 = (_9 = (_8 = this.options) === null || _8 === void 0 ? void 0 : _8.formatters) === null || _9 === void 0 ? void 0 : _9.events) === null || _10 === void 0 ? void 0 : _10.productAdded;
248
- const product = (_14 = (_13 = (_12 = (_11 = this.options) === null || _11 === void 0 ? void 0 : _11.formatters) === null || _12 === void 0 ? void 0 : _12.objects) === null || _13 === void 0 ? void 0 : _13.product) === null || _14 === void 0 ? void 0 : _14.call(_13, props === null || props === void 0 ? void 0 : props.product);
249
- const cart = (_18 = (_17 = (_16 = (_15 = this.options) === null || _15 === void 0 ? void 0 : _15.formatters) === null || _16 === void 0 ? void 0 : _16.objects) === null || _17 === void 0 ? void 0 : _17.cart) === null || _18 === void 0 ? void 0 : _18.call(_17, {
276
+ var _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25;
277
+ const formatter = (_16 = (_15 = (_14 = this.options) === null || _14 === void 0 ? void 0 : _14.formatters) === null || _15 === void 0 ? void 0 : _15.events) === null || _16 === void 0 ? void 0 : _16.productAdded;
278
+ const product = (_20 = (_19 = (_18 = (_17 = this.options) === null || _17 === void 0 ? void 0 : _17.formatters) === null || _18 === void 0 ? void 0 : _18.objects) === null || _19 === void 0 ? void 0 : _19.product) === null || _20 === void 0 ? void 0 : _20.call(_19, props === null || props === void 0 ? void 0 : props.product);
279
+ const cart = (_24 = (_23 = (_22 = (_21 = this.options) === null || _21 === void 0 ? void 0 : _21.formatters) === null || _22 === void 0 ? void 0 : _22.objects) === null || _23 === void 0 ? void 0 : _23.cart) === null || _24 === void 0 ? void 0 : _24.call(_23, {
250
280
  cart: props === null || props === void 0 ? void 0 : props.cart,
251
281
  });
252
- const quantity = ((_19 = props === null || props === void 0 ? void 0 : props.product) === null || _19 === void 0 ? void 0 : _19.quantity) || 1;
282
+ const quantity = ((_25 = props === null || props === void 0 ? void 0 : props.product) === null || _25 === void 0 ? void 0 : _25.quantity) || 1;
253
283
  const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], total: product.price * (quantity || 1), value: product.price * (quantity || 1) });
254
284
  if (typeof formatter === 'function') {
255
285
  const formattedPayload = formatter(props, payload);
@@ -258,28 +288,43 @@ export class ChordAnalytics {
258
288
  return this.track('Product Added', payload, options);
259
289
  });
260
290
  this.trackProductClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
261
- var _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32;
262
- const formatter = (_22 = (_21 = (_20 = this.options) === null || _20 === void 0 ? void 0 : _20.formatters) === null || _21 === void 0 ? void 0 : _21.events) === null || _22 === void 0 ? void 0 : _22.productClicked;
263
- const product = (_26 = (_25 = (_24 = (_23 = this.options) === null || _23 === void 0 ? void 0 : _23.formatters) === null || _24 === void 0 ? void 0 : _24.objects) === null || _25 === void 0 ? void 0 : _25.product) === null || _26 === void 0 ? void 0 : _26.call(_25, props === null || props === void 0 ? void 0 : props.product);
264
- const cart = (_30 = (_29 = (_28 = (_27 = this.options) === null || _27 === void 0 ? void 0 : _27.formatters) === null || _28 === void 0 ? void 0 : _28.objects) === null || _29 === void 0 ? void 0 : _29.cart) === null || _30 === void 0 ? void 0 : _30.call(_29, {
291
+ var _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38;
292
+ const formatter = (_28 = (_27 = (_26 = this.options) === null || _26 === void 0 ? void 0 : _26.formatters) === null || _27 === void 0 ? void 0 : _27.events) === null || _28 === void 0 ? void 0 : _28.productClicked;
293
+ const product = (_32 = (_31 = (_30 = (_29 = this.options) === null || _29 === void 0 ? void 0 : _29.formatters) === null || _30 === void 0 ? void 0 : _30.objects) === null || _31 === void 0 ? void 0 : _31.product) === null || _32 === void 0 ? void 0 : _32.call(_31, props === null || props === void 0 ? void 0 : props.product);
294
+ const cart = (_36 = (_35 = (_34 = (_33 = this.options) === null || _33 === void 0 ? void 0 : _33.formatters) === null || _34 === void 0 ? void 0 : _34.objects) === null || _35 === void 0 ? void 0 : _35.cart) === null || _36 === void 0 ? void 0 : _36.call(_35, {
265
295
  cart: props === null || props === void 0 ? void 0 : props.cart,
266
296
  });
267
- const quantity = ((_31 = props === null || props === void 0 ? void 0 : props.product) === null || _31 === void 0 ? void 0 : _31.quantity) || 1;
268
- const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, item_list_id: (_32 = props === null || props === void 0 ? void 0 : props.listId) === null || _32 === void 0 ? void 0 : _32.toString(), item_list_name: props === null || props === void 0 ? void 0 : props.listName, products: [Object.assign(Object.assign({}, product), { quantity })] });
297
+ const quantity = ((_37 = props === null || props === void 0 ? void 0 : props.product) === null || _37 === void 0 ? void 0 : _37.quantity) || 1;
298
+ const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, item_list_id: (_38 = props === null || props === void 0 ? void 0 : props.listId) === null || _38 === void 0 ? void 0 : _38.toString(), item_list_name: props === null || props === void 0 ? void 0 : props.listName, products: [Object.assign(Object.assign({}, product), { quantity })] });
269
299
  if (typeof formatter === 'function') {
270
300
  const formattedPayload = formatter(props, payload);
271
301
  return this.track('Product Clicked', formattedPayload, options);
272
302
  }
273
303
  return this.track('Product Clicked', payload, options);
274
304
  });
305
+ this.trackVariantClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
306
+ var _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50;
307
+ const formatter = (_41 = (_40 = (_39 = this.options) === null || _39 === void 0 ? void 0 : _39.formatters) === null || _40 === void 0 ? void 0 : _40.events) === null || _41 === void 0 ? void 0 : _41.variantClicked;
308
+ const product = (_45 = (_44 = (_43 = (_42 = this.options) === null || _42 === void 0 ? void 0 : _42.formatters) === null || _43 === void 0 ? void 0 : _43.objects) === null || _44 === void 0 ? void 0 : _44.product) === null || _45 === void 0 ? void 0 : _45.call(_44, props === null || props === void 0 ? void 0 : props.product);
309
+ const cart = (_49 = (_48 = (_47 = (_46 = this.options) === null || _46 === void 0 ? void 0 : _46.formatters) === null || _47 === void 0 ? void 0 : _47.objects) === null || _48 === void 0 ? void 0 : _48.cart) === null || _49 === void 0 ? void 0 : _49.call(_48, {
310
+ cart: props === null || props === void 0 ? void 0 : props.cart,
311
+ });
312
+ const quantity = ((_50 = props === null || props === void 0 ? void 0 : props.product) === null || _50 === void 0 ? void 0 : _50.quantity) || 1;
313
+ const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, quantity: quantity, line_item_id: props === null || props === void 0 ? void 0 : props.lineItemId, coupon: props === null || props === void 0 ? void 0 : props.coupon });
314
+ if (typeof formatter === 'function') {
315
+ const formattedPayload = formatter(props, payload);
316
+ return this.track('Variant Clicked', formattedPayload, options);
317
+ }
318
+ return this.track('Variant Clicked', payload, options);
319
+ });
275
320
  this.trackProductListFiltered = (props, options) => __awaiter(this, void 0, void 0, function* () {
276
- var _33, _34, _35, _36, _37;
277
- const formatter = (_35 = (_34 = (_33 = this.options) === null || _33 === void 0 ? void 0 : _33.formatters) === null || _34 === void 0 ? void 0 : _34.events) === null || _35 === void 0 ? void 0 : _35.productListFiltered;
321
+ var _51, _52, _53, _54, _55;
322
+ const formatter = (_53 = (_52 = (_51 = this.options) === null || _51 === void 0 ? void 0 : _51.formatters) === null || _52 === void 0 ? void 0 : _52.events) === null || _53 === void 0 ? void 0 : _53.productListFiltered;
278
323
  const payload = {
279
324
  category: props === null || props === void 0 ? void 0 : props.category,
280
325
  filters: props === null || props === void 0 ? void 0 : props.filters,
281
- list_id: (_36 = props === null || props === void 0 ? void 0 : props.listId) === null || _36 === void 0 ? void 0 : _36.toString(),
282
- item_list_id: (_37 = props === null || props === void 0 ? void 0 : props.listId) === null || _37 === void 0 ? void 0 : _37.toString(),
326
+ list_id: (_54 = props === null || props === void 0 ? void 0 : props.listId) === null || _54 === void 0 ? void 0 : _54.toString(),
327
+ item_list_id: (_55 = props === null || props === void 0 ? void 0 : props.listId) === null || _55 === void 0 ? void 0 : _55.toString(),
283
328
  item_list_name: props === null || props === void 0 ? void 0 : props.listName,
284
329
  sorts: props === null || props === void 0 ? void 0 : props.sorts,
285
330
  };
@@ -290,14 +335,14 @@ export class ChordAnalytics {
290
335
  return this.track('Product List Filtered', payload, options);
291
336
  });
292
337
  this.trackProductListViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
293
- var _38, _39, _40, _41, _42, _43;
294
- const formatter = (_40 = (_39 = (_38 = this.options) === null || _38 === void 0 ? void 0 : _38.formatters) === null || _39 === void 0 ? void 0 : _39.events) === null || _40 === void 0 ? void 0 : _40.productListViewed;
338
+ var _56, _57, _58, _59, _60, _61;
339
+ const formatter = (_58 = (_57 = (_56 = this.options) === null || _56 === void 0 ? void 0 : _56.formatters) === null || _57 === void 0 ? void 0 : _57.events) === null || _58 === void 0 ? void 0 : _58.productListViewed;
295
340
  const payload = {
296
341
  category: props === null || props === void 0 ? void 0 : props.category,
297
- list_id: (_41 = props === null || props === void 0 ? void 0 : props.listId) === null || _41 === void 0 ? void 0 : _41.toString(),
298
- item_list_id: (_42 = props === null || props === void 0 ? void 0 : props.listId) === null || _42 === void 0 ? void 0 : _42.toString(),
342
+ list_id: (_59 = props === null || props === void 0 ? void 0 : props.listId) === null || _59 === void 0 ? void 0 : _59.toString(),
343
+ item_list_id: (_60 = props === null || props === void 0 ? void 0 : props.listId) === null || _60 === void 0 ? void 0 : _60.toString(),
299
344
  item_list_name: props === null || props === void 0 ? void 0 : props.listName,
300
- products: (_43 = props === null || props === void 0 ? void 0 : props.products) === null || _43 === void 0 ? void 0 : _43.map((p, i) => {
345
+ products: (_61 = props === null || props === void 0 ? void 0 : props.products) === null || _61 === void 0 ? void 0 : _61.map((p, i) => {
301
346
  var _a, _b, _c, _d;
302
347
  return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
303
348
  }),
@@ -310,8 +355,8 @@ export class ChordAnalytics {
310
355
  return this.track('Product List Viewed', payload, options);
311
356
  });
312
357
  this.trackProductRemoved = (props, options) => __awaiter(this, void 0, void 0, function* () {
313
- var _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58;
314
- const formatter = (_46 = (_45 = (_44 = this.options) === null || _44 === void 0 ? void 0 : _44.formatters) === null || _45 === void 0 ? void 0 : _45.events) === null || _46 === void 0 ? void 0 : _46.productRemoved;
358
+ var _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76;
359
+ const formatter = (_64 = (_63 = (_62 = this.options) === null || _62 === void 0 ? void 0 : _62.formatters) === null || _63 === void 0 ? void 0 : _63.events) === null || _64 === void 0 ? void 0 : _64.productRemoved;
315
360
  /*
316
361
  const product = this.options?.formatters?.objects?.product?.({
317
362
  position: props?.position,
@@ -320,13 +365,13 @@ export class ChordAnalytics {
320
365
  variantId: props?.variantId,
321
366
  })
322
367
  */
323
- const lineItem = (_50 = (_49 = (_48 = (_47 = this.options) === null || _47 === void 0 ? void 0 : _47.formatters) === null || _48 === void 0 ? void 0 : _48.objects) === null || _49 === void 0 ? void 0 : _49.lineItem) === null || _50 === void 0 ? void 0 : _50.call(_49, {
368
+ const lineItem = (_68 = (_67 = (_66 = (_65 = this.options) === null || _65 === void 0 ? void 0 : _65.formatters) === null || _66 === void 0 ? void 0 : _66.objects) === null || _67 === void 0 ? void 0 : _67.lineItem) === null || _68 === void 0 ? void 0 : _68.call(_67, {
324
369
  lineItem: props === null || props === void 0 ? void 0 : props.lineItem,
325
370
  });
326
- const cart = (_54 = (_53 = (_52 = (_51 = this.options) === null || _51 === void 0 ? void 0 : _51.formatters) === null || _52 === void 0 ? void 0 : _52.objects) === null || _53 === void 0 ? void 0 : _53.cart) === null || _54 === void 0 ? void 0 : _54.call(_53, {
371
+ const cart = (_72 = (_71 = (_70 = (_69 = this.options) === null || _69 === void 0 ? void 0 : _69.formatters) === null || _70 === void 0 ? void 0 : _70.objects) === null || _71 === void 0 ? void 0 : _71.cart) === null || _72 === void 0 ? void 0 : _72.call(_71, {
327
372
  cart: props === null || props === void 0 ? void 0 : props.cart,
328
373
  });
329
- const payload = Object.assign(Object.assign({}, lineItem), { cart_id: cart.cart_id, currency: cart.currency, products: [lineItem], total: ((_55 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _55 !== void 0 ? _55 : 0) * ((_56 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _56 !== void 0 ? _56 : 1), value: ((_57 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _57 !== void 0 ? _57 : 0) * ((_58 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _58 !== void 0 ? _58 : 1) });
374
+ const payload = Object.assign(Object.assign({}, lineItem), { cart_id: cart.cart_id, currency: cart.currency, products: [lineItem], total: ((_73 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _73 !== void 0 ? _73 : 0) * ((_74 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _74 !== void 0 ? _74 : 1), value: ((_75 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.price) !== null && _75 !== void 0 ? _75 : 0) * ((_76 = lineItem === null || lineItem === void 0 ? void 0 : lineItem.quantity) !== null && _76 !== void 0 ? _76 : 1) });
330
375
  if (typeof formatter === 'function') {
331
376
  const formattedPayload = formatter(props, payload);
332
377
  return this.track('Product Removed', formattedPayload, options);
@@ -334,14 +379,14 @@ export class ChordAnalytics {
334
379
  return this.track('Product Removed', payload, options);
335
380
  });
336
381
  this.trackProductViewed = (props, options) => __awaiter(this, void 0, void 0, function* () {
337
- var _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71;
338
- const formatter = (_61 = (_60 = (_59 = this.options) === null || _59 === void 0 ? void 0 : _59.formatters) === null || _60 === void 0 ? void 0 : _60.events) === null || _61 === void 0 ? void 0 : _61.productViewed;
339
- const product = (_65 = (_64 = (_63 = (_62 = this.options) === null || _62 === void 0 ? void 0 : _62.formatters) === null || _63 === void 0 ? void 0 : _63.objects) === null || _64 === void 0 ? void 0 : _64.product) === null || _65 === void 0 ? void 0 : _65.call(_64, props === null || props === void 0 ? void 0 : props.product);
340
- const cart = (_69 = (_68 = (_67 = (_66 = this.options) === null || _66 === void 0 ? void 0 : _66.formatters) === null || _67 === void 0 ? void 0 : _67.objects) === null || _68 === void 0 ? void 0 : _68.cart) === null || _69 === void 0 ? void 0 : _69.call(_68, {
382
+ var _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89;
383
+ const formatter = (_79 = (_78 = (_77 = this.options) === null || _77 === void 0 ? void 0 : _77.formatters) === null || _78 === void 0 ? void 0 : _78.events) === null || _79 === void 0 ? void 0 : _79.productViewed;
384
+ const product = (_83 = (_82 = (_81 = (_80 = this.options) === null || _80 === void 0 ? void 0 : _80.formatters) === null || _81 === void 0 ? void 0 : _81.objects) === null || _82 === void 0 ? void 0 : _82.product) === null || _83 === void 0 ? void 0 : _83.call(_82, props === null || props === void 0 ? void 0 : props.product);
385
+ const cart = (_87 = (_86 = (_85 = (_84 = this.options) === null || _84 === void 0 ? void 0 : _84.formatters) === null || _85 === void 0 ? void 0 : _85.objects) === null || _86 === void 0 ? void 0 : _86.cart) === null || _87 === void 0 ? void 0 : _87.call(_86, {
341
386
  cart: props === null || props === void 0 ? void 0 : props.cart,
342
387
  });
343
- const quantity = ((_70 = props === null || props === void 0 ? void 0 : props.product) === null || _70 === void 0 ? void 0 : _70.quantity) || 1;
344
- const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], value: product.price * (((_71 = props === null || props === void 0 ? void 0 : props.product) === null || _71 === void 0 ? void 0 : _71.quantity) || 1) });
388
+ const quantity = ((_88 = props === null || props === void 0 ? void 0 : props.product) === null || _88 === void 0 ? void 0 : _88.quantity) || 1;
389
+ const payload = Object.assign(Object.assign({}, product), { cart_id: cart.cart_id, currency: cart.currency, products: [Object.assign(Object.assign({}, product), { quantity })], value: product.price * (((_89 = props === null || props === void 0 ? void 0 : props.product) === null || _89 === void 0 ? void 0 : _89.quantity) || 1) });
345
390
  if (typeof formatter === 'function') {
346
391
  const formattedPayload = formatter(props, payload);
347
392
  return this.track('Product Viewed', formattedPayload, options);
@@ -349,12 +394,12 @@ export class ChordAnalytics {
349
394
  return this.track('Product Viewed', payload, options);
350
395
  });
351
396
  this.trackProductsSearched = (props, options) => __awaiter(this, void 0, void 0, function* () {
352
- var _72, _73, _74, _75;
353
- const formatter = (_74 = (_73 = (_72 = this.options) === null || _72 === void 0 ? void 0 : _72.formatters) === null || _73 === void 0 ? void 0 : _73.events) === null || _74 === void 0 ? void 0 : _74.productsSearched;
397
+ var _90, _91, _92, _93;
398
+ const formatter = (_92 = (_91 = (_90 = this.options) === null || _90 === void 0 ? void 0 : _90.formatters) === null || _91 === void 0 ? void 0 : _91.events) === null || _92 === void 0 ? void 0 : _92.productsSearched;
354
399
  const payload = {
355
400
  currency: props === null || props === void 0 ? void 0 : props.currency,
356
401
  price: typeof (props === null || props === void 0 ? void 0 : props.price) !== 'undefined' ? Number(props === null || props === void 0 ? void 0 : props.price) : undefined,
357
- product_id: (_75 = props === null || props === void 0 ? void 0 : props.productId) === null || _75 === void 0 ? void 0 : _75.toString(),
402
+ product_id: (_93 = props === null || props === void 0 ? void 0 : props.productId) === null || _93 === void 0 ? void 0 : _93.toString(),
358
403
  quantity: props === null || props === void 0 ? void 0 : props.quantity,
359
404
  query: props === null || props === void 0 ? void 0 : props.query,
360
405
  };
@@ -365,8 +410,8 @@ export class ChordAnalytics {
365
410
  return this.track('Products Searched', payload, options);
366
411
  });
367
412
  this.trackSignedIn = (props, options) => __awaiter(this, void 0, void 0, function* () {
368
- var _76, _77, _78;
369
- const formatter = (_78 = (_77 = (_76 = this.options) === null || _76 === void 0 ? void 0 : _76.formatters) === null || _77 === void 0 ? void 0 : _77.events) === null || _78 === void 0 ? void 0 : _78.signedIn;
413
+ var _94, _95, _96;
414
+ const formatter = (_96 = (_95 = (_94 = this.options) === null || _94 === void 0 ? void 0 : _94.formatters) === null || _95 === void 0 ? void 0 : _95.events) === null || _96 === void 0 ? void 0 : _96.signedIn;
370
415
  const payload = {
371
416
  email: props === null || props === void 0 ? void 0 : props.email,
372
417
  method: props === null || props === void 0 ? void 0 : props.method,
@@ -378,8 +423,8 @@ export class ChordAnalytics {
378
423
  return this.track('Signed In', payload, options);
379
424
  });
380
425
  this.trackSignedOut = (props, options) => __awaiter(this, void 0, void 0, function* () {
381
- var _79, _80, _81;
382
- const formatter = (_81 = (_80 = (_79 = this.options) === null || _79 === void 0 ? void 0 : _79.formatters) === null || _80 === void 0 ? void 0 : _80.events) === null || _81 === void 0 ? void 0 : _81.signedOut;
426
+ var _97, _98, _99;
427
+ const formatter = (_99 = (_98 = (_97 = this.options) === null || _97 === void 0 ? void 0 : _97.formatters) === null || _98 === void 0 ? void 0 : _98.events) === null || _99 === void 0 ? void 0 : _99.signedOut;
383
428
  const payload = {
384
429
  email: props === null || props === void 0 ? void 0 : props.email,
385
430
  };
@@ -390,8 +435,8 @@ export class ChordAnalytics {
390
435
  return this.track('Signed Out', payload, options);
391
436
  });
392
437
  this.trackSignedUp = (props, options) => __awaiter(this, void 0, void 0, function* () {
393
- var _82, _83, _84;
394
- const formatter = (_84 = (_83 = (_82 = this.options) === null || _82 === void 0 ? void 0 : _82.formatters) === null || _83 === void 0 ? void 0 : _83.events) === null || _84 === void 0 ? void 0 : _84.signedUp;
438
+ var _100, _101, _102;
439
+ const formatter = (_102 = (_101 = (_100 = this.options) === null || _100 === void 0 ? void 0 : _100.formatters) === null || _101 === void 0 ? void 0 : _101.events) === null || _102 === void 0 ? void 0 : _102.signedUp;
395
440
  const payload = {
396
441
  email: props === null || props === void 0 ? void 0 : props.email,
397
442
  method: props === null || props === void 0 ? void 0 : props.method,
@@ -402,6 +447,82 @@ export class ChordAnalytics {
402
447
  }
403
448
  return this.track('Signed Up', payload, options);
404
449
  });
450
+ this.trackLoginStarted = (props, options) => __awaiter(this, void 0, void 0, function* () {
451
+ var _103, _104, _105;
452
+ const formatter = (_105 = (_104 = (_103 = this.options) === null || _103 === void 0 ? void 0 : _103.formatters) === null || _104 === void 0 ? void 0 : _104.events) === null || _105 === void 0 ? void 0 : _105.loginStarted;
453
+ const payload = {
454
+ email: props === null || props === void 0 ? void 0 : props.email,
455
+ };
456
+ if (typeof formatter === 'function') {
457
+ const formattedPayload = formatter(props, payload);
458
+ return this.track('Login Started', formattedPayload, options);
459
+ }
460
+ return this.track('Login Started', payload, options);
461
+ });
462
+ this.trackSubscriptionCancelled = (props, options) => __awaiter(this, void 0, void 0, function* () {
463
+ var _106, _107, _108, _109;
464
+ const formatter = (_108 = (_107 = (_106 = this.options) === null || _106 === void 0 ? void 0 : _106.formatters) === null || _107 === void 0 ? void 0 : _107.events) === null || _108 === void 0 ? void 0 : _108.subscriptionCancelled;
465
+ const payload = {
466
+ actionable_date: props === null || props === void 0 ? void 0 : props.actionableDate,
467
+ address: props === null || props === void 0 ? void 0 : props.address,
468
+ brand: props === null || props === void 0 ? void 0 : props.brand,
469
+ email: props === null || props === void 0 ? void 0 : props.email,
470
+ end_date: props === null || props === void 0 ? void 0 : props.endDate,
471
+ interval_length: props === null || props === void 0 ? void 0 : props.intervalLength,
472
+ interval_units: props === null || props === void 0 ? void 0 : props.intervalUnits,
473
+ products: (_109 = props === null || props === void 0 ? void 0 : props.products) === null || _109 === void 0 ? void 0 : _109.map((p, i) => {
474
+ var _a, _b, _c, _d;
475
+ return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
476
+ }),
477
+ state: props === null || props === void 0 ? void 0 : props.state,
478
+ subscription_id: props === null || props === void 0 ? void 0 : props.subscriptionId,
479
+ currency: props === null || props === void 0 ? void 0 : props.currency,
480
+ };
481
+ if (typeof formatter === 'function') {
482
+ const formattedPayload = formatter(props || {}, payload);
483
+ return this.track('Subscription Cancelled', formattedPayload, options);
484
+ }
485
+ return this.track('Subscription Cancelled', payload, options);
486
+ });
487
+ this.trackNavigationClicked = (props, options) => __awaiter(this, void 0, void 0, function* () {
488
+ var _110, _111, _112;
489
+ const formatter = (_112 = (_111 = (_110 = this.options) === null || _110 === void 0 ? void 0 : _110.formatters) === null || _111 === void 0 ? void 0 : _111.events) === null || _112 === void 0 ? void 0 : _112.navigationClicked;
490
+ const payload = {
491
+ category: props === null || props === void 0 ? void 0 : props.category,
492
+ label: props === null || props === void 0 ? void 0 : props.label,
493
+ navigation_placement: props === null || props === void 0 ? void 0 : props.navigationPlacement,
494
+ navigation_title: props === null || props === void 0 ? void 0 : props.navigationTitle,
495
+ navigation_url: props === null || props === void 0 ? void 0 : props.navigationUrl,
496
+ };
497
+ if (typeof formatter === 'function') {
498
+ const formattedPayload = formatter(props, payload);
499
+ return this.track('Navigation Clicked', formattedPayload, options);
500
+ }
501
+ return this.track('Navigation Clicked', payload, options);
502
+ });
503
+ this.trackPaymentInfoEntered = (props, options) => __awaiter(this, void 0, void 0, function* () {
504
+ var _113, _114, _115, _116;
505
+ const formatter = (_115 = (_114 = (_113 = this.options) === null || _113 === void 0 ? void 0 : _113.formatters) === null || _114 === void 0 ? void 0 : _114.events) === null || _115 === void 0 ? void 0 : _115.paymentInfoEntered;
506
+ const payload = {
507
+ checkout_id: props === null || props === void 0 ? void 0 : props.checkoutId,
508
+ coupon: props === null || props === void 0 ? void 0 : props.coupon,
509
+ currency: props === null || props === void 0 ? void 0 : props.currency,
510
+ order_id: props === null || props === void 0 ? void 0 : props.orderId,
511
+ payment_method: props === null || props === void 0 ? void 0 : props.paymentMethod,
512
+ products: (_116 = props === null || props === void 0 ? void 0 : props.products) === null || _116 === void 0 ? void 0 : _116.map((p, i) => {
513
+ var _a, _b, _c, _d;
514
+ return (_d = (_c = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.formatters) === null || _b === void 0 ? void 0 : _b.objects) === null || _c === void 0 ? void 0 : _c.product) === null || _d === void 0 ? void 0 : _d.call(_c, Object.assign(Object.assign({}, p), { position: i + 1 }));
515
+ }),
516
+ shipping_method: props === null || props === void 0 ? void 0 : props.shippingMethod,
517
+ step: props === null || props === void 0 ? void 0 : props.step,
518
+ value: props === null || props === void 0 ? void 0 : props.value,
519
+ };
520
+ if (typeof formatter === 'function') {
521
+ const formattedPayload = formatter(props, payload);
522
+ return this.track('Payment Info Entered', formattedPayload, options);
523
+ }
524
+ return this.track('Payment Info Entered', payload, options);
525
+ });
405
526
  const defaults = {
406
527
  debug: false,
407
528
  enableLogging: true,
@@ -1,6 +1,6 @@
1
- import type { CartViewed, CheckoutStarted, ProductAdded, ProductClicked, ProductViewed, ProductListViewed, CouponApplied, CouponDenied, CouponEntered, CouponRemoved, EmailCaptured, ProductListFiltered, ProductRemoved, ProductsSearched, SignedIn, SignedOut, SignedUp } from './typewriter.js';
1
+ import type { CartViewed, CheckoutStarted, CheckoutStepCompleted, CheckoutStepViewed, ProductAdded, ProductClicked, VariantClicked, ProductViewed, ProductListViewed, CouponApplied, CouponDenied, CouponEntered, CouponRemoved, EmailCaptured, ProductListFiltered, ProductRemoved, ProductsSearched, SignedIn, SignedOut, SignedUp, LoginStarted, SubscriptionCancelled, NavigationClicked, PaymentInfoEntered } from './typewriter.js';
2
2
  import type { Cart, Checkout, LineItem, Product } from './objects.js';
3
- import type { CartInput, CheckoutInput, LineItemInput, ProductInput, CartViewedInput, CheckoutStartedInput, ProductAddedInput, ProductClickedInput, ProductViewedInput, ProductListViewedInput, ProductListFilteredInput, ProductRemovedInput, CouponAppliedInput, CouponDeniedInput, CouponEnteredInput, CouponRemovedInput, EmailCapturedInput, ProductsSearchedInput, SignedInInput, SignedOutInput, SignedUpInput } from './input.js';
3
+ import type { CartInput, CheckoutInput, CheckoutStepCompletedInput, CheckoutStepViewedInput, LineItemInput, ProductInput, CartViewedInput, CheckoutStartedInput, ProductAddedInput, ProductClickedInput, VariantClickedInput, ProductViewedInput, ProductListViewedInput, ProductListFilteredInput, ProductRemovedInput, CouponAppliedInput, CouponDeniedInput, CouponEnteredInput, CouponRemovedInput, EmailCapturedInput, ProductsSearchedInput, SignedInInput, SignedOutInput, SignedUpInput, LoginStartedInput, SubscriptionCancelledInput, NavigationClickedInput, PaymentInfoEnteredInput } from './input.js';
4
4
  import type { ObjectTypes } from './client.js';
5
5
  export type CartFormatter<T = ObjectTypes['Cart']> = (props: CartInput<T>) => Cart;
6
6
  export type CheckoutFormatter<T = ObjectTypes['Checkout']> = (props: CheckoutInput<T>) => Checkout;
@@ -12,6 +12,12 @@ export interface CartViewedFormatter<T extends ObjectTypes = ObjectTypes> {
12
12
  export interface CheckoutStartedFormatter<T extends ObjectTypes = ObjectTypes> {
13
13
  (props: CheckoutStartedInput<T>, event: CheckoutStarted): CheckoutStarted;
14
14
  }
15
+ export interface CheckoutStepCompletedFormatter {
16
+ (props: CheckoutStepCompletedInput, event: CheckoutStepCompleted): CheckoutStepCompleted;
17
+ }
18
+ export interface CheckoutStepViewedFormatter {
19
+ (props: CheckoutStepViewedInput, event: CheckoutStepViewed): CheckoutStepViewed;
20
+ }
15
21
  export interface CouponAppliedFormatter {
16
22
  (props: CouponAppliedInput, event: CouponApplied): CouponApplied;
17
23
  }
@@ -33,6 +39,9 @@ export interface ProductAddedFormatter<T extends ObjectTypes = ObjectTypes> {
33
39
  export interface ProductClickedFormatter<T extends ObjectTypes = ObjectTypes> {
34
40
  (props: ProductClickedInput<T>, event: ProductClicked): ProductClicked;
35
41
  }
42
+ export interface VariantClickedFormatter<T extends ObjectTypes = ObjectTypes> {
43
+ (props: VariantClickedInput<T>, event: VariantClicked): VariantClicked;
44
+ }
36
45
  export interface ProductListFilteredFormatter {
37
46
  (props: ProductListFilteredInput, event: ProductListFiltered): ProductListFiltered;
38
47
  }
@@ -57,10 +66,24 @@ export interface SignedOutFormatter {
57
66
  export interface SignedUpFormatter {
58
67
  (props: SignedUpInput, event: SignedUp): SignedUp;
59
68
  }
69
+ export interface LoginStartedFormatter {
70
+ (props: LoginStartedInput, event: LoginStarted): LoginStarted;
71
+ }
72
+ export interface SubscriptionCancelledFormatter {
73
+ (props: SubscriptionCancelledInput, event: SubscriptionCancelled): SubscriptionCancelled;
74
+ }
75
+ export interface NavigationClickedFormatter {
76
+ (props: NavigationClickedInput, event: NavigationClicked): NavigationClicked;
77
+ }
78
+ export interface PaymentInfoEnteredFormatter {
79
+ (props: PaymentInfoEnteredInput, event: PaymentInfoEntered): PaymentInfoEntered;
80
+ }
60
81
  export interface ChordAnalyticsFormatters<T extends ObjectTypes = ObjectTypes> {
61
82
  events?: {
62
83
  cartViewed?: CartViewedFormatter<T>;
63
84
  checkoutStarted?: CheckoutStartedFormatter<T>;
85
+ checkoutStepCompleted?: CheckoutStepCompletedFormatter;
86
+ checkoutStepViewed?: CheckoutStepViewedFormatter;
64
87
  couponApplied?: CouponAppliedFormatter;
65
88
  couponDenied?: CouponDeniedFormatter;
66
89
  couponEntered?: CouponEnteredFormatter;
@@ -68,6 +91,7 @@ export interface ChordAnalyticsFormatters<T extends ObjectTypes = ObjectTypes> {
68
91
  emailCaptured?: EmailCapturedFormatter;
69
92
  productAdded?: ProductAddedFormatter<T>;
70
93
  productClicked?: ProductClickedFormatter<T>;
94
+ variantClicked?: VariantClickedFormatter<T>;
71
95
  productListFiltered?: ProductListFilteredFormatter;
72
96
  productListViewed?: ProductListViewedFormatter<T>;
73
97
  productRemoved?: ProductRemovedFormatter<T>;
@@ -76,6 +100,10 @@ export interface ChordAnalyticsFormatters<T extends ObjectTypes = ObjectTypes> {
76
100
  signedIn?: SignedInFormatter;
77
101
  signedOut?: SignedOutFormatter;
78
102
  signedUp?: SignedUpFormatter;
103
+ loginStarted?: LoginStartedFormatter;
104
+ subscriptionCancelled?: SubscriptionCancelledFormatter;
105
+ navigationClicked?: NavigationClickedFormatter;
106
+ paymentInfoEntered?: PaymentInfoEnteredFormatter;
79
107
  };
80
108
  objects: {
81
109
  cart: CartFormatter<T['Cart']>;