@pelcro/react-pelcro-js 3.23.0-beta.5 → 3.23.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +649 -81
- package/dist/index.esm.js +649 -81
- package/package.json +2 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7500,6 +7500,51 @@ function _defineProperty$3(obj, key, value) {
|
|
|
7500
7500
|
return obj;
|
|
7501
7501
|
}
|
|
7502
7502
|
|
|
7503
|
+
// Polyfill
|
|
7504
|
+
(() => {
|
|
7505
|
+
if (typeof window.CustomEvent === "function") return false;
|
|
7506
|
+
function CustomEvent(event) {
|
|
7507
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
7508
|
+
bubbles: false,
|
|
7509
|
+
cancelable: false,
|
|
7510
|
+
detail: undefined
|
|
7511
|
+
};
|
|
7512
|
+
const evt = document.createEvent("CustomEvent");
|
|
7513
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
7514
|
+
return evt;
|
|
7515
|
+
}
|
|
7516
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
7517
|
+
window.CustomEvent = CustomEvent;
|
|
7518
|
+
})();
|
|
7519
|
+
|
|
7520
|
+
/**
|
|
7521
|
+
* Should fire when the cart is opened and expects the cartItems inside the card to be sent
|
|
7522
|
+
*/
|
|
7523
|
+
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
7524
|
+
|
|
7525
|
+
/**
|
|
7526
|
+
* Should fire when an item added to the cart and expects the added item to be sent
|
|
7527
|
+
*/
|
|
7528
|
+
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
7529
|
+
|
|
7530
|
+
/**
|
|
7531
|
+
* Should fire when an item removed from the cart and expects the removed item to be sent
|
|
7532
|
+
*/
|
|
7533
|
+
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
7534
|
+
|
|
7535
|
+
/**
|
|
7536
|
+
* Check if the browser support custom events
|
|
7537
|
+
*/
|
|
7538
|
+
function createCustomEvent(name, detail) {
|
|
7539
|
+
try {
|
|
7540
|
+
return new CustomEvent(name, {
|
|
7541
|
+
detail
|
|
7542
|
+
});
|
|
7543
|
+
} catch (e) {
|
|
7544
|
+
console.warn("Pelcro - Events are not supported in the browser");
|
|
7545
|
+
}
|
|
7546
|
+
}
|
|
7547
|
+
|
|
7503
7548
|
function warn(s) {
|
|
7504
7549
|
console.warn('[react-ga]', s);
|
|
7505
7550
|
}
|
|
@@ -8351,55 +8396,547 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
8351
8396
|
OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
|
|
8352
8397
|
OutboundLink$1.trackLink = outboundLink;
|
|
8353
8398
|
var OutboundLink = OutboundLink$1;
|
|
8354
|
-
var
|
|
8399
|
+
var ReactGA1 = _objectSpread({}, Defaults, {
|
|
8355
8400
|
OutboundLink: OutboundLink
|
|
8356
8401
|
});
|
|
8357
8402
|
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
const evt = document.createEvent("CustomEvent");
|
|
8368
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
8369
|
-
return evt;
|
|
8403
|
+
var gtag_1 = createCommonjsModule(function (module, exports) {
|
|
8404
|
+
|
|
8405
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8406
|
+
value: true
|
|
8407
|
+
});
|
|
8408
|
+
exports["default"] = void 0;
|
|
8409
|
+
var gtag = function gtag() {
|
|
8410
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8411
|
+
args[_key] = arguments[_key];
|
|
8370
8412
|
}
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8413
|
+
if (typeof window !== "undefined") {
|
|
8414
|
+
var _window;
|
|
8415
|
+
if (typeof window.gtag === "undefined") {
|
|
8416
|
+
window.dataLayer = window.dataLayer || [];
|
|
8417
|
+
window.gtag = function gtag() {
|
|
8418
|
+
window.dataLayer.push(arguments);
|
|
8419
|
+
};
|
|
8420
|
+
}
|
|
8421
|
+
(_window = window).gtag.apply(_window, args);
|
|
8422
|
+
}
|
|
8423
|
+
};
|
|
8424
|
+
var _default = gtag;
|
|
8425
|
+
exports["default"] = _default;
|
|
8426
|
+
});
|
|
8374
8427
|
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
8428
|
+
unwrapExports(gtag_1);
|
|
8429
|
+
|
|
8430
|
+
var format_1 = createCommonjsModule(function (module, exports) {
|
|
8379
8431
|
|
|
8432
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8433
|
+
value: true
|
|
8434
|
+
});
|
|
8435
|
+
exports["default"] = format;
|
|
8436
|
+
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
8437
|
+
function toTitleCase(string) {
|
|
8438
|
+
return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
|
|
8439
|
+
if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && (title.charAt(index + match.length) !== "-" || title.charAt(index - 1) === "-") && title.charAt(index - 1).search(/[^\s-]/) < 0) {
|
|
8440
|
+
return match.toLowerCase();
|
|
8441
|
+
}
|
|
8442
|
+
if (match.substr(1).search(/[A-Z]|\../) > -1) {
|
|
8443
|
+
return match;
|
|
8444
|
+
}
|
|
8445
|
+
return match.charAt(0).toUpperCase() + match.substr(1);
|
|
8446
|
+
});
|
|
8447
|
+
}
|
|
8448
|
+
|
|
8449
|
+
// See if s could be an email address. We don't want to send personal data like email.
|
|
8450
|
+
// https://support.google.com/analytics/answer/2795983?hl=en
|
|
8451
|
+
function mightBeEmail(s) {
|
|
8452
|
+
// There's no point trying to validate rfc822 fully, just look for ...@...
|
|
8453
|
+
return typeof s === "string" && s.indexOf("@") !== -1;
|
|
8454
|
+
}
|
|
8455
|
+
var redacted = "REDACTED (Potential Email Address)";
|
|
8456
|
+
function redactEmail(string) {
|
|
8457
|
+
if (mightBeEmail(string)) {
|
|
8458
|
+
console.warn("This arg looks like an email address, redacting.");
|
|
8459
|
+
return redacted;
|
|
8460
|
+
}
|
|
8461
|
+
return string;
|
|
8462
|
+
}
|
|
8463
|
+
function format() {
|
|
8464
|
+
var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
8465
|
+
var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8466
|
+
var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
8467
|
+
var _str = s || "";
|
|
8468
|
+
if (titleCase) {
|
|
8469
|
+
_str = toTitleCase(s);
|
|
8470
|
+
}
|
|
8471
|
+
if (redactingEmail) {
|
|
8472
|
+
_str = redactEmail(_str);
|
|
8473
|
+
}
|
|
8474
|
+
return _str;
|
|
8475
|
+
}
|
|
8476
|
+
});
|
|
8477
|
+
|
|
8478
|
+
unwrapExports(format_1);
|
|
8479
|
+
|
|
8480
|
+
var ga4 = createCommonjsModule(function (module, exports) {
|
|
8481
|
+
|
|
8482
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8483
|
+
value: true
|
|
8484
|
+
});
|
|
8485
|
+
exports["default"] = exports.GA4 = void 0;
|
|
8486
|
+
var _gtag = _interopRequireDefault(gtag_1);
|
|
8487
|
+
var _format = _interopRequireDefault(format_1);
|
|
8488
|
+
var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
|
|
8489
|
+
_excluded2 = ["title", "location"],
|
|
8490
|
+
_excluded3 = ["page", "hitType"];
|
|
8491
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8492
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8493
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8494
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8495
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8496
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8497
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8498
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8499
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8500
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8501
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8502
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8503
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8504
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8505
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
8506
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8507
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8508
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
8509
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8510
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8511
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8512
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8513
|
+
/*
|
|
8514
|
+
Links
|
|
8515
|
+
https://developers.google.com/gtagjs/reference/api
|
|
8516
|
+
https://developers.google.com/tag-platform/gtagjs/reference
|
|
8517
|
+
*/
|
|
8380
8518
|
/**
|
|
8381
|
-
*
|
|
8519
|
+
* @typedef GaOptions
|
|
8520
|
+
* @type {Object}
|
|
8521
|
+
* @property {boolean} [cookieUpdate=true]
|
|
8522
|
+
* @property {number} [cookieExpires=63072000] Default two years
|
|
8523
|
+
* @property {string} [cookieDomain="auto"]
|
|
8524
|
+
* @property {string} [cookieFlags]
|
|
8525
|
+
* @property {string} [userId]
|
|
8526
|
+
* @property {string} [clientId]
|
|
8527
|
+
* @property {boolean} [anonymizeIp]
|
|
8528
|
+
* @property {string} [contentGroup1]
|
|
8529
|
+
* @property {string} [contentGroup2]
|
|
8530
|
+
* @property {string} [contentGroup3]
|
|
8531
|
+
* @property {string} [contentGroup4]
|
|
8532
|
+
* @property {string} [contentGroup5]
|
|
8533
|
+
* @property {boolean} [allowAdFeatures=true]
|
|
8534
|
+
* @property {boolean} [allowAdPersonalizationSignals]
|
|
8535
|
+
* @property {boolean} [nonInteraction]
|
|
8536
|
+
* @property {string} [page]
|
|
8382
8537
|
*/
|
|
8383
|
-
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
8384
|
-
|
|
8385
8538
|
/**
|
|
8386
|
-
*
|
|
8539
|
+
* @typedef UaEventOptions
|
|
8540
|
+
* @type {Object}
|
|
8541
|
+
* @property {string} action
|
|
8542
|
+
* @property {string} category
|
|
8543
|
+
* @property {string} [label]
|
|
8544
|
+
* @property {number} [value]
|
|
8545
|
+
* @property {boolean} [nonInteraction]
|
|
8546
|
+
* @property {('beacon'|'xhr'|'image')} [transport]
|
|
8387
8547
|
*/
|
|
8388
|
-
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
8389
|
-
|
|
8390
8548
|
/**
|
|
8391
|
-
*
|
|
8549
|
+
* @typedef InitOptions
|
|
8550
|
+
* @type {Object}
|
|
8551
|
+
* @property {string} trackingId
|
|
8552
|
+
* @property {GaOptions|any} [gaOptions]
|
|
8553
|
+
* @property {Object} [gtagOptions] New parameter
|
|
8392
8554
|
*/
|
|
8393
|
-
function
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8555
|
+
var GA4 = /*#__PURE__*/function () {
|
|
8556
|
+
function GA4() {
|
|
8557
|
+
var _this = this;
|
|
8558
|
+
_classCallCheck(this, GA4);
|
|
8559
|
+
_defineProperty(this, "reset", function () {
|
|
8560
|
+
_this.isInitialized = false;
|
|
8561
|
+
_this._testMode = false;
|
|
8562
|
+
_this._currentMeasurementId;
|
|
8563
|
+
_this._hasLoadedGA = false;
|
|
8564
|
+
_this._isQueuing = false;
|
|
8565
|
+
_this._queueGtag = [];
|
|
8566
|
+
});
|
|
8567
|
+
_defineProperty(this, "_gtag", function () {
|
|
8568
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8569
|
+
args[_key] = arguments[_key];
|
|
8570
|
+
}
|
|
8571
|
+
if (!_this._testMode) {
|
|
8572
|
+
if (_this._isQueuing) {
|
|
8573
|
+
_this._queueGtag.push(args);
|
|
8574
|
+
} else {
|
|
8575
|
+
_gtag["default"].apply(void 0, args);
|
|
8576
|
+
}
|
|
8577
|
+
} else {
|
|
8578
|
+
_this._queueGtag.push(args);
|
|
8579
|
+
}
|
|
8397
8580
|
});
|
|
8398
|
-
|
|
8399
|
-
|
|
8581
|
+
_defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
|
|
8582
|
+
var gtagUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "https://www.googletagmanager.com/gtag/js";
|
|
8583
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
8584
|
+
return;
|
|
8585
|
+
}
|
|
8586
|
+
if (!_this._hasLoadedGA) {
|
|
8587
|
+
// Global Site Tag (gtag.js) - Google Analytics
|
|
8588
|
+
var script = document.createElement("script");
|
|
8589
|
+
script.async = true;
|
|
8590
|
+
script.src = "".concat(gtagUrl, "?id=").concat(GA_MEASUREMENT_ID);
|
|
8591
|
+
if (nonce) {
|
|
8592
|
+
script.setAttribute("nonce", nonce);
|
|
8593
|
+
}
|
|
8594
|
+
document.body.appendChild(script);
|
|
8595
|
+
window.dataLayer = window.dataLayer || [];
|
|
8596
|
+
window.gtag = function gtag() {
|
|
8597
|
+
window.dataLayer.push(arguments);
|
|
8598
|
+
};
|
|
8599
|
+
_this._hasLoadedGA = true;
|
|
8600
|
+
}
|
|
8601
|
+
});
|
|
8602
|
+
_defineProperty(this, "_toGtagOptions", function (gaOptions) {
|
|
8603
|
+
if (!gaOptions) {
|
|
8604
|
+
return;
|
|
8605
|
+
}
|
|
8606
|
+
var mapFields = {
|
|
8607
|
+
// Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
|
|
8608
|
+
// New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
|
|
8609
|
+
cookieUpdate: "cookie_update",
|
|
8610
|
+
cookieExpires: "cookie_expires",
|
|
8611
|
+
cookieDomain: "cookie_domain",
|
|
8612
|
+
cookieFlags: "cookie_flags",
|
|
8613
|
+
// must be in set method?
|
|
8614
|
+
userId: "user_id",
|
|
8615
|
+
clientId: "client_id",
|
|
8616
|
+
anonymizeIp: "anonymize_ip",
|
|
8617
|
+
// https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
|
|
8618
|
+
contentGroup1: "content_group1",
|
|
8619
|
+
contentGroup2: "content_group2",
|
|
8620
|
+
contentGroup3: "content_group3",
|
|
8621
|
+
contentGroup4: "content_group4",
|
|
8622
|
+
contentGroup5: "content_group5",
|
|
8623
|
+
// https://support.google.com/analytics/answer/9050852?hl=en
|
|
8624
|
+
allowAdFeatures: "allow_google_signals",
|
|
8625
|
+
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
8626
|
+
nonInteraction: "non_interaction",
|
|
8627
|
+
page: "page_path",
|
|
8628
|
+
hitCallback: "event_callback"
|
|
8629
|
+
};
|
|
8630
|
+
var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
|
|
8631
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
8632
|
+
key = _ref2[0],
|
|
8633
|
+
value = _ref2[1];
|
|
8634
|
+
if (mapFields[key]) {
|
|
8635
|
+
prev[mapFields[key]] = value;
|
|
8636
|
+
} else {
|
|
8637
|
+
prev[key] = value;
|
|
8638
|
+
}
|
|
8639
|
+
return prev;
|
|
8640
|
+
}, {});
|
|
8641
|
+
return gtagOptions;
|
|
8642
|
+
});
|
|
8643
|
+
_defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
|
|
8644
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8645
|
+
if (!GA_MEASUREMENT_ID) {
|
|
8646
|
+
throw new Error("Require GA_MEASUREMENT_ID");
|
|
8647
|
+
}
|
|
8648
|
+
var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
|
|
8649
|
+
trackingId: GA_MEASUREMENT_ID
|
|
8650
|
+
}] : GA_MEASUREMENT_ID;
|
|
8651
|
+
_this._currentMeasurementId = initConfigs[0].trackingId;
|
|
8652
|
+
var gaOptions = options.gaOptions,
|
|
8653
|
+
gtagOptions = options.gtagOptions,
|
|
8654
|
+
nonce = options.nonce,
|
|
8655
|
+
_options$testMode = options.testMode,
|
|
8656
|
+
testMode = _options$testMode === void 0 ? false : _options$testMode,
|
|
8657
|
+
gtagUrl = options.gtagUrl;
|
|
8658
|
+
_this._testMode = testMode;
|
|
8659
|
+
if (!testMode) {
|
|
8660
|
+
_this._loadGA(_this._currentMeasurementId, nonce, gtagUrl);
|
|
8661
|
+
}
|
|
8662
|
+
if (!_this.isInitialized) {
|
|
8663
|
+
_this._gtag("js", new Date());
|
|
8664
|
+
initConfigs.forEach(function (config) {
|
|
8665
|
+
var mergedGtagOptions = _objectSpread(_objectSpread(_objectSpread({}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions);
|
|
8666
|
+
if (Object.keys(mergedGtagOptions).length) {
|
|
8667
|
+
_this._gtag("config", config.trackingId, mergedGtagOptions);
|
|
8668
|
+
} else {
|
|
8669
|
+
_this._gtag("config", config.trackingId);
|
|
8670
|
+
}
|
|
8671
|
+
});
|
|
8672
|
+
}
|
|
8673
|
+
_this.isInitialized = true;
|
|
8674
|
+
if (!testMode) {
|
|
8675
|
+
var queues = _toConsumableArray(_this._queueGtag);
|
|
8676
|
+
_this._queueGtag = [];
|
|
8677
|
+
_this._isQueuing = false;
|
|
8678
|
+
while (queues.length) {
|
|
8679
|
+
var queue = queues.shift();
|
|
8680
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8681
|
+
if (queue[0] === "get") {
|
|
8682
|
+
_this._isQueuing = true;
|
|
8683
|
+
}
|
|
8684
|
+
}
|
|
8685
|
+
}
|
|
8686
|
+
});
|
|
8687
|
+
_defineProperty(this, "set", function (fieldsObject) {
|
|
8688
|
+
if (!fieldsObject) {
|
|
8689
|
+
console.warn("`fieldsObject` is required in .set()");
|
|
8690
|
+
return;
|
|
8691
|
+
}
|
|
8692
|
+
if (_typeof(fieldsObject) !== "object") {
|
|
8693
|
+
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
8694
|
+
return;
|
|
8695
|
+
}
|
|
8696
|
+
if (Object.keys(fieldsObject).length === 0) {
|
|
8697
|
+
console.warn("empty `fieldsObject` given to .set()");
|
|
8698
|
+
}
|
|
8699
|
+
_this._gaCommand("set", fieldsObject);
|
|
8700
|
+
});
|
|
8701
|
+
_defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
|
|
8702
|
+
_this._gtag("event", eventAction, _objectSpread(_objectSpread({
|
|
8703
|
+
event_category: eventCategory,
|
|
8704
|
+
event_label: eventLabel,
|
|
8705
|
+
value: eventValue
|
|
8706
|
+
}, fieldsObject && {
|
|
8707
|
+
non_interaction: fieldsObject.nonInteraction
|
|
8708
|
+
}), _this._toGtagOptions(fieldsObject)));
|
|
8709
|
+
});
|
|
8710
|
+
_defineProperty(this, "_gaCommandSendEventParameters", function () {
|
|
8711
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8712
|
+
args[_key2] = arguments[_key2];
|
|
8713
|
+
}
|
|
8714
|
+
if (typeof args[0] === "string") {
|
|
8715
|
+
_this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8716
|
+
} else {
|
|
8717
|
+
var _args$ = args[0],
|
|
8718
|
+
eventCategory = _args$.eventCategory,
|
|
8719
|
+
eventAction = _args$.eventAction,
|
|
8720
|
+
eventLabel = _args$.eventLabel,
|
|
8721
|
+
eventValue = _args$.eventValue;
|
|
8722
|
+
_args$.hitType;
|
|
8723
|
+
var rest = _objectWithoutProperties(_args$, _excluded);
|
|
8724
|
+
_this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
|
|
8725
|
+
}
|
|
8726
|
+
});
|
|
8727
|
+
_defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
|
|
8728
|
+
_this._gtag("event", "timing_complete", {
|
|
8729
|
+
name: timingVar,
|
|
8730
|
+
value: timingValue,
|
|
8731
|
+
event_category: timingCategory,
|
|
8732
|
+
event_label: timingLabel
|
|
8733
|
+
});
|
|
8734
|
+
});
|
|
8735
|
+
_defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
|
|
8736
|
+
if (fieldsObject && Object.keys(fieldsObject).length) {
|
|
8737
|
+
var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
|
|
8738
|
+
title = _this$_toGtagOptions.title,
|
|
8739
|
+
location = _this$_toGtagOptions.location,
|
|
8740
|
+
rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
|
|
8741
|
+
_this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
|
|
8742
|
+
page_path: page
|
|
8743
|
+
}), title && {
|
|
8744
|
+
page_title: title
|
|
8745
|
+
}), location && {
|
|
8746
|
+
page_location: location
|
|
8747
|
+
}), rest));
|
|
8748
|
+
} else if (page) {
|
|
8749
|
+
_this._gtag("event", "page_view", {
|
|
8750
|
+
page_path: page
|
|
8751
|
+
});
|
|
8752
|
+
} else {
|
|
8753
|
+
_this._gtag("event", "page_view");
|
|
8754
|
+
}
|
|
8755
|
+
});
|
|
8756
|
+
_defineProperty(this, "_gaCommandSendPageviewParameters", function () {
|
|
8757
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
8758
|
+
args[_key3] = arguments[_key3];
|
|
8759
|
+
}
|
|
8760
|
+
if (typeof args[0] === "string") {
|
|
8761
|
+
_this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8762
|
+
} else {
|
|
8763
|
+
var _args$2 = args[0],
|
|
8764
|
+
page = _args$2.page;
|
|
8765
|
+
_args$2.hitType;
|
|
8766
|
+
var rest = _objectWithoutProperties(_args$2, _excluded3);
|
|
8767
|
+
_this._gaCommandSendPageview(page, rest);
|
|
8768
|
+
}
|
|
8769
|
+
});
|
|
8770
|
+
_defineProperty(this, "_gaCommandSend", function () {
|
|
8771
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
8772
|
+
args[_key4] = arguments[_key4];
|
|
8773
|
+
}
|
|
8774
|
+
var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
|
|
8775
|
+
switch (hitType) {
|
|
8776
|
+
case "event":
|
|
8777
|
+
_this._gaCommandSendEventParameters.apply(_this, args);
|
|
8778
|
+
break;
|
|
8779
|
+
case "pageview":
|
|
8780
|
+
_this._gaCommandSendPageviewParameters.apply(_this, args);
|
|
8781
|
+
break;
|
|
8782
|
+
case "timing":
|
|
8783
|
+
_this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8784
|
+
break;
|
|
8785
|
+
case "screenview":
|
|
8786
|
+
case "transaction":
|
|
8787
|
+
case "item":
|
|
8788
|
+
case "social":
|
|
8789
|
+
case "exception":
|
|
8790
|
+
console.warn("Unsupported send command: ".concat(hitType));
|
|
8791
|
+
break;
|
|
8792
|
+
default:
|
|
8793
|
+
console.warn("Send command doesn't exist: ".concat(hitType));
|
|
8794
|
+
}
|
|
8795
|
+
});
|
|
8796
|
+
_defineProperty(this, "_gaCommandSet", function () {
|
|
8797
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
8798
|
+
args[_key5] = arguments[_key5];
|
|
8799
|
+
}
|
|
8800
|
+
if (typeof args[0] === "string") {
|
|
8801
|
+
args[0] = _defineProperty({}, args[0], args[1]);
|
|
8802
|
+
}
|
|
8803
|
+
_this._gtag("set", _this._toGtagOptions(args[0]));
|
|
8804
|
+
});
|
|
8805
|
+
_defineProperty(this, "_gaCommand", function (command) {
|
|
8806
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
8807
|
+
args[_key6 - 1] = arguments[_key6];
|
|
8808
|
+
}
|
|
8809
|
+
switch (command) {
|
|
8810
|
+
case "send":
|
|
8811
|
+
_this._gaCommandSend.apply(_this, args);
|
|
8812
|
+
break;
|
|
8813
|
+
case "set":
|
|
8814
|
+
_this._gaCommandSet.apply(_this, args);
|
|
8815
|
+
break;
|
|
8816
|
+
default:
|
|
8817
|
+
console.warn("Command doesn't exist: ".concat(command));
|
|
8818
|
+
}
|
|
8819
|
+
});
|
|
8820
|
+
_defineProperty(this, "ga", function () {
|
|
8821
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
8822
|
+
args[_key7] = arguments[_key7];
|
|
8823
|
+
}
|
|
8824
|
+
if (typeof args[0] === "string") {
|
|
8825
|
+
_this._gaCommand.apply(_this, args);
|
|
8826
|
+
} else {
|
|
8827
|
+
var readyCallback = args[0];
|
|
8828
|
+
_this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
|
|
8829
|
+
_this._isQueuing = false;
|
|
8830
|
+
var queues = _this._queueGtag;
|
|
8831
|
+
readyCallback({
|
|
8832
|
+
get: function get(property) {
|
|
8833
|
+
return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
|
|
8834
|
+
}
|
|
8835
|
+
});
|
|
8836
|
+
while (queues.length) {
|
|
8837
|
+
var queue = queues.shift();
|
|
8838
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8839
|
+
}
|
|
8840
|
+
});
|
|
8841
|
+
_this._isQueuing = true;
|
|
8842
|
+
}
|
|
8843
|
+
return _this.ga;
|
|
8844
|
+
});
|
|
8845
|
+
_defineProperty(this, "event", function (optionsOrName, params) {
|
|
8846
|
+
if (typeof optionsOrName === "string") {
|
|
8847
|
+
_this._gtag("event", optionsOrName, _this._toGtagOptions(params));
|
|
8848
|
+
} else {
|
|
8849
|
+
var action = optionsOrName.action,
|
|
8850
|
+
category = optionsOrName.category,
|
|
8851
|
+
label = optionsOrName.label,
|
|
8852
|
+
value = optionsOrName.value,
|
|
8853
|
+
nonInteraction = optionsOrName.nonInteraction,
|
|
8854
|
+
transport = optionsOrName.transport;
|
|
8855
|
+
if (!category || !action) {
|
|
8856
|
+
console.warn("args.category AND args.action are required in event()");
|
|
8857
|
+
return;
|
|
8858
|
+
}
|
|
8859
|
+
|
|
8860
|
+
// Required Fields
|
|
8861
|
+
var fieldObject = {
|
|
8862
|
+
hitType: "event",
|
|
8863
|
+
eventCategory: (0, _format["default"])(category),
|
|
8864
|
+
eventAction: (0, _format["default"])(action)
|
|
8865
|
+
};
|
|
8866
|
+
|
|
8867
|
+
// Optional Fields
|
|
8868
|
+
if (label) {
|
|
8869
|
+
fieldObject.eventLabel = (0, _format["default"])(label);
|
|
8870
|
+
}
|
|
8871
|
+
if (typeof value !== "undefined") {
|
|
8872
|
+
if (typeof value !== "number") {
|
|
8873
|
+
console.warn("Expected `args.value` arg to be a Number.");
|
|
8874
|
+
} else {
|
|
8875
|
+
fieldObject.eventValue = value;
|
|
8876
|
+
}
|
|
8877
|
+
}
|
|
8878
|
+
if (typeof nonInteraction !== "undefined") {
|
|
8879
|
+
if (typeof nonInteraction !== "boolean") {
|
|
8880
|
+
console.warn("`args.nonInteraction` must be a boolean.");
|
|
8881
|
+
} else {
|
|
8882
|
+
fieldObject.nonInteraction = nonInteraction;
|
|
8883
|
+
}
|
|
8884
|
+
}
|
|
8885
|
+
if (typeof transport !== "undefined") {
|
|
8886
|
+
if (typeof transport !== "string") {
|
|
8887
|
+
console.warn("`args.transport` must be a string.");
|
|
8888
|
+
} else {
|
|
8889
|
+
if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
|
|
8890
|
+
console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
|
|
8891
|
+
}
|
|
8892
|
+
fieldObject.transport = transport;
|
|
8893
|
+
}
|
|
8894
|
+
}
|
|
8895
|
+
_this._gaCommand("send", fieldObject);
|
|
8896
|
+
}
|
|
8897
|
+
});
|
|
8898
|
+
_defineProperty(this, "send", function (fieldObject) {
|
|
8899
|
+
_this._gaCommand("send", fieldObject);
|
|
8900
|
+
});
|
|
8901
|
+
this.reset();
|
|
8400
8902
|
}
|
|
8401
|
-
|
|
8903
|
+
_createClass(GA4, [{
|
|
8904
|
+
key: "gtag",
|
|
8905
|
+
value: function gtag() {
|
|
8906
|
+
this._gtag.apply(this, arguments);
|
|
8907
|
+
}
|
|
8908
|
+
}]);
|
|
8909
|
+
return GA4;
|
|
8910
|
+
}();
|
|
8911
|
+
exports.GA4 = GA4;
|
|
8912
|
+
var _default = new GA4();
|
|
8913
|
+
exports["default"] = _default;
|
|
8914
|
+
});
|
|
8915
|
+
|
|
8916
|
+
unwrapExports(ga4);
|
|
8917
|
+
ga4.GA4;
|
|
8402
8918
|
|
|
8919
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
8920
|
+
|
|
8921
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8922
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8923
|
+
value: true
|
|
8924
|
+
});
|
|
8925
|
+
exports["default"] = exports.ReactGAImplementation = void 0;
|
|
8926
|
+
var _ga = _interopRequireWildcard(ga4);
|
|
8927
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
8928
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
8929
|
+
var ReactGAImplementation = _ga.GA4;
|
|
8930
|
+
exports.ReactGAImplementation = ReactGAImplementation;
|
|
8931
|
+
var _default = _ga["default"];
|
|
8932
|
+
exports["default"] = _default;
|
|
8933
|
+
});
|
|
8934
|
+
|
|
8935
|
+
var ReactGA4 = unwrapExports(dist);
|
|
8936
|
+
dist.ReactGAImplementation;
|
|
8937
|
+
|
|
8938
|
+
var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
|
|
8939
|
+
const ReactGA$e = (_window$d = window) !== null && _window$d !== void 0 && (_window$Pelcro$d = _window$d.Pelcro) !== null && _window$Pelcro$d !== void 0 && (_window$Pelcro$uiSett$d = _window$Pelcro$d.uiSettings) !== null && _window$Pelcro$uiSett$d !== void 0 && _window$Pelcro$uiSett$d.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
8403
8940
|
class PelcroActions {
|
|
8404
8941
|
constructor(storeSetter, storeGetter) {
|
|
8405
8942
|
var _this = this;
|
|
@@ -8591,7 +9128,7 @@ class PelcroActions {
|
|
|
8591
9128
|
return console.warn("You are already logged out.");
|
|
8592
9129
|
}
|
|
8593
9130
|
window.Pelcro.user.logout();
|
|
8594
|
-
ReactGA$
|
|
9131
|
+
ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$event = ReactGA$e.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$e, {
|
|
8595
9132
|
category: "ACTIONS",
|
|
8596
9133
|
action: "Logged out",
|
|
8597
9134
|
nonInteraction: true
|
|
@@ -8820,6 +9357,9 @@ if (process.env.NODE_ENV === "development") {
|
|
|
8820
9357
|
c$1("Pelcro Store", usePelcro);
|
|
8821
9358
|
}
|
|
8822
9359
|
|
|
9360
|
+
var _window$c, _window$Pelcro$c, _window$Pelcro$uiSett$c;
|
|
9361
|
+
const ReactGA$d = (_window$c = window) !== null && _window$c !== void 0 && (_window$Pelcro$c = _window$c.Pelcro) !== null && _window$Pelcro$c !== void 0 && (_window$Pelcro$uiSett$c = _window$Pelcro$c.uiSettings) !== null && _window$Pelcro$uiSett$c !== void 0 && _window$Pelcro$uiSett$c.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
9362
|
+
|
|
8823
9363
|
/**
|
|
8824
9364
|
* List of zero-decimal currencies.
|
|
8825
9365
|
* @see https://stripe.com/docs/currencies#zero-decimal
|
|
@@ -8902,8 +9442,8 @@ const getLanguageWithoutRegion = localeName => {
|
|
|
8902
9442
|
* @return {string | undefined}
|
|
8903
9443
|
*/
|
|
8904
9444
|
const getPageOrDefaultLanguage = () => {
|
|
8905
|
-
var _window$Pelcro$helper, _window$
|
|
8906
|
-
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$
|
|
9445
|
+
var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
|
|
9446
|
+
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$site = _window$Pelcro2.site) === null || _window$Pelcro2$site === void 0 ? void 0 : (_window$Pelcro2$site$ = _window$Pelcro2$site.read) === null || _window$Pelcro2$site$ === void 0 ? void 0 : (_window$Pelcro2$site$2 = _window$Pelcro2$site$.call(_window$Pelcro2$site)) === null || _window$Pelcro2$site$2 === void 0 ? void 0 : _window$Pelcro2$site$2.default_locale);
|
|
8907
9447
|
};
|
|
8908
9448
|
|
|
8909
9449
|
/**
|
|
@@ -8956,9 +9496,9 @@ const isValidViewFromURL = viewID => {
|
|
|
8956
9496
|
*
|
|
8957
9497
|
*/
|
|
8958
9498
|
function hasValidNewsletterUpdateUrl() {
|
|
8959
|
-
var _window$
|
|
9499
|
+
var _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
8960
9500
|
if (viewID !== "newsletter-update") return false;
|
|
8961
|
-
const newsletters = (_window$
|
|
9501
|
+
const newsletters = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.newsletters;
|
|
8962
9502
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
8963
9503
|
if (!siteHasNewslettersDefined) {
|
|
8964
9504
|
return false;
|
|
@@ -9023,16 +9563,16 @@ const trackSubscriptionOnGA = () => {
|
|
|
9023
9563
|
return;
|
|
9024
9564
|
}
|
|
9025
9565
|
const currencyCode = (_window$Pelcro$user$r5 = (_window$Pelcro$user$r6 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r6 === void 0 ? void 0 : _window$Pelcro$user$r6.currency) !== null && _window$Pelcro$user$r5 !== void 0 ? _window$Pelcro$user$r5 : plan.currency;
|
|
9026
|
-
ReactGA$
|
|
9566
|
+
ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$set = ReactGA$d.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA$d, {
|
|
9027
9567
|
currencyCode: currencyCode
|
|
9028
9568
|
});
|
|
9029
|
-
ReactGA$
|
|
9569
|
+
ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$d.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$execu = _ReactGA$plugin.execute) === null || _ReactGA$plugin$execu === void 0 ? void 0 : _ReactGA$plugin$execu.call(_ReactGA$plugin, "ecommerce", "addTransaction", {
|
|
9030
9570
|
id: lastSubscriptionId,
|
|
9031
9571
|
affiliation: "Pelcro",
|
|
9032
9572
|
revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9033
9573
|
coupon: couponCode
|
|
9034
9574
|
});
|
|
9035
|
-
ReactGA$
|
|
9575
|
+
ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$plugin2 = ReactGA$d.plugin) === null || _ReactGA$plugin2 === void 0 ? void 0 : (_ReactGA$plugin2$exec = _ReactGA$plugin2.execute) === null || _ReactGA$plugin2$exec === void 0 ? void 0 : _ReactGA$plugin2$exec.call(_ReactGA$plugin2, "ecommerce", "addItem", {
|
|
9036
9576
|
id: lastSubscriptionId,
|
|
9037
9577
|
name: product.name,
|
|
9038
9578
|
category: product.description,
|
|
@@ -9040,8 +9580,8 @@ const trackSubscriptionOnGA = () => {
|
|
|
9040
9580
|
price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9041
9581
|
quantity: 1
|
|
9042
9582
|
});
|
|
9043
|
-
ReactGA$
|
|
9044
|
-
ReactGA$
|
|
9583
|
+
ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$plugin3 = ReactGA$d.plugin) === null || _ReactGA$plugin3 === void 0 ? void 0 : (_ReactGA$plugin3$exec = _ReactGA$plugin3.execute) === null || _ReactGA$plugin3$exec === void 0 ? void 0 : _ReactGA$plugin3$exec.call(_ReactGA$plugin3, "ecommerce", "send");
|
|
9584
|
+
ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$event = ReactGA$d.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$d, {
|
|
9045
9585
|
category: "ACTIONS",
|
|
9046
9586
|
action: "Subscribed",
|
|
9047
9587
|
nonInteraction: true
|
|
@@ -9129,8 +9669,8 @@ function getDateWithoutTime(dateObject) {
|
|
|
9129
9669
|
return date;
|
|
9130
9670
|
}
|
|
9131
9671
|
function userMustVerifyEmail() {
|
|
9132
|
-
var _window$Pelcro$site$
|
|
9133
|
-
const isEmailVerificationEnabled = (_window$Pelcro$site$
|
|
9672
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
9673
|
+
const isEmailVerificationEnabled = (_window$Pelcro$site$r = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.email_verify_enabled) !== null && _window$Pelcro$site$r !== void 0 ? _window$Pelcro$site$r : false;
|
|
9134
9674
|
const isUserEmailVerified = (_window$Pelcro$user$r9 = (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.email_confirm) !== null && _window$Pelcro$user$r9 !== void 0 ? _window$Pelcro$user$r9 : false;
|
|
9135
9675
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
9136
9676
|
}
|
|
@@ -9139,11 +9679,11 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9139
9679
|
//load bugsnag CDN
|
|
9140
9680
|
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
9141
9681
|
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
9142
|
-
var _window$Pelcro$enviro, _window$
|
|
9682
|
+
var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
|
|
9143
9683
|
Bugsnag.start({
|
|
9144
|
-
apiKey: (_window$Pelcro$enviro = (_window$
|
|
9684
|
+
apiKey: (_window$Pelcro$enviro = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$envir = _window$Pelcro4.environment) === null || _window$Pelcro4$envir === void 0 ? void 0 : _window$Pelcro4$envir.bugsnagKey) !== null && _window$Pelcro$enviro !== void 0 ? _window$Pelcro$enviro : "e8f6852b322540e8c25386048b99ab01",
|
|
9145
9685
|
autoDetectErrors: false,
|
|
9146
|
-
releaseStage: (_window$
|
|
9686
|
+
releaseStage: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$envir = _window$Pelcro5.environment) === null || _window$Pelcro5$envir === void 0 ? void 0 : _window$Pelcro5$envir.bugsnagReleaseStage,
|
|
9147
9687
|
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
9148
9688
|
...startOptions
|
|
9149
9689
|
});
|
|
@@ -9494,8 +10034,10 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
|
9494
10034
|
return descriptor.value;
|
|
9495
10035
|
}
|
|
9496
10036
|
|
|
10037
|
+
var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
|
|
9497
10038
|
function _classPrivateFieldInitSpec$2(obj, privateMap, value) { _checkPrivateRedeclaration$2(obj, privateMap); privateMap.set(obj, value); }
|
|
9498
10039
|
function _checkPrivateRedeclaration$2(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
10040
|
+
const ReactGA$c = (_window$b = window) !== null && _window$b !== void 0 && (_window$Pelcro$b = _window$b.Pelcro) !== null && _window$Pelcro$b !== void 0 && (_window$Pelcro$uiSett$b = _window$Pelcro$b.uiSettings) !== null && _window$Pelcro$uiSett$b !== void 0 && _window$Pelcro$uiSett$b.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
9499
10041
|
var _isAlreadySaved = /*#__PURE__*/new WeakMap();
|
|
9500
10042
|
var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
|
|
9501
10043
|
var _removeLoadingState = /*#__PURE__*/new WeakMap();
|
|
@@ -9618,7 +10160,7 @@ class SaveToMetadataButtonClass {
|
|
|
9618
10160
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9619
10161
|
}
|
|
9620
10162
|
_classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
|
|
9621
|
-
ReactGA$
|
|
10163
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$event = ReactGA$c.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$c, {
|
|
9622
10164
|
category: "ACTIONS",
|
|
9623
10165
|
action: "Save/Follow",
|
|
9624
10166
|
label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
|
|
@@ -9650,7 +10192,7 @@ class SaveToMetadataButtonClass {
|
|
|
9650
10192
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9651
10193
|
}
|
|
9652
10194
|
_classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
|
|
9653
|
-
ReactGA$
|
|
10195
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$c.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$c, {
|
|
9654
10196
|
category: "ACTIONS",
|
|
9655
10197
|
action: "Unsave/Unfollow",
|
|
9656
10198
|
label: title
|
|
@@ -11177,6 +11719,9 @@ function getSiteCardProcessor() {
|
|
|
11177
11719
|
return "stripe";
|
|
11178
11720
|
}
|
|
11179
11721
|
|
|
11722
|
+
var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
|
|
11723
|
+
const ReactGA$b = (_window$a = window) !== null && _window$a !== void 0 && (_window$Pelcro$a = _window$a.Pelcro) !== null && _window$Pelcro$a !== void 0 && (_window$Pelcro$uiSett$a = _window$Pelcro$a.uiSettings) !== null && _window$Pelcro$uiSett$a !== void 0 && _window$Pelcro$uiSett$a.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
11724
|
+
|
|
11180
11725
|
/**
|
|
11181
11726
|
* @typedef {Object} OptionsType
|
|
11182
11727
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -11300,12 +11845,12 @@ const initSecuritySdk = () => {
|
|
|
11300
11845
|
};
|
|
11301
11846
|
const initGATracking = () => {
|
|
11302
11847
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
11303
|
-
ReactGA$
|
|
11304
|
-
ReactGA$
|
|
11848
|
+
ReactGA$b === null || ReactGA$b === void 0 ? void 0 : (_ReactGA$initialize = ReactGA$b.initialize) === null || _ReactGA$initialize === void 0 ? void 0 : _ReactGA$initialize.call(ReactGA$b, window.Pelcro.site.read().google_analytics_id);
|
|
11849
|
+
ReactGA$b === null || ReactGA$b === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$b.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$requi = _ReactGA$plugin.require) === null || _ReactGA$plugin$requi === void 0 ? void 0 : _ReactGA$plugin$requi.call(_ReactGA$plugin, "ecommerce");
|
|
11305
11850
|
};
|
|
11306
11851
|
const dispatchModalDisplayEvents = modalName => {
|
|
11307
11852
|
var _ReactGA$event, _modalName$replace, _modalName$replace2;
|
|
11308
|
-
ReactGA$
|
|
11853
|
+
ReactGA$b === null || ReactGA$b === void 0 ? void 0 : (_ReactGA$event = ReactGA$b.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$b, {
|
|
11309
11854
|
category: "VIEWS",
|
|
11310
11855
|
action: `${modalName === null || modalName === void 0 ? void 0 : (_modalName$replace = modalName.replace("pelcro-", "")) === null || _modalName$replace === void 0 ? void 0 : _modalName$replace.replaceAll("-", " ")} viewed`,
|
|
11311
11856
|
nonInteraction: true
|
|
@@ -12629,11 +13174,13 @@ function ConfirmPassword(_ref) {
|
|
|
12629
13174
|
}, otherProps));
|
|
12630
13175
|
}
|
|
12631
13176
|
|
|
13177
|
+
var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
|
|
13178
|
+
const ReactGA$a = (_window$9 = window) !== null && _window$9 !== void 0 && (_window$Pelcro$9 = _window$9.Pelcro) !== null && _window$Pelcro$9 !== void 0 && (_window$Pelcro$uiSett$9 = _window$Pelcro$9.uiSettings) !== null && _window$Pelcro$uiSett$9 !== void 0 && _window$Pelcro$uiSett$9.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
12632
13179
|
const Logout = props => {
|
|
12633
13180
|
const handleLogout = () => {
|
|
12634
13181
|
var _ReactGA$event;
|
|
12635
13182
|
window.Pelcro.user.logout();
|
|
12636
|
-
ReactGA$
|
|
13183
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$event = ReactGA$a.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$a, {
|
|
12637
13184
|
category: "ACTIONS",
|
|
12638
13185
|
action: "Logged out",
|
|
12639
13186
|
nonInteraction: true
|
|
@@ -14195,6 +14742,9 @@ const RegisterCompany = props => {
|
|
|
14195
14742
|
}, props));
|
|
14196
14743
|
};
|
|
14197
14744
|
|
|
14745
|
+
var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
|
|
14746
|
+
const ReactGA$9 = (_window$8 = window) !== null && _window$8 !== void 0 && (_window$Pelcro$8 = _window$8.Pelcro) !== null && _window$Pelcro$8 !== void 0 && (_window$Pelcro$uiSett$8 = _window$Pelcro$8.uiSettings) !== null && _window$Pelcro$uiSett$8 !== void 0 && _window$Pelcro$uiSett$8.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
14747
|
+
|
|
14198
14748
|
/**
|
|
14199
14749
|
*
|
|
14200
14750
|
*/
|
|
@@ -14220,7 +14770,7 @@ function RegisterModal(props) {
|
|
|
14220
14770
|
};
|
|
14221
14771
|
const handleAfterRegistrationLogic = () => {
|
|
14222
14772
|
var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
14223
|
-
ReactGA$
|
|
14773
|
+
ReactGA$9 === null || ReactGA$9 === void 0 ? void 0 : (_ReactGA$event = ReactGA$9.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$9, {
|
|
14224
14774
|
category: "ACTIONS",
|
|
14225
14775
|
action: "Registered",
|
|
14226
14776
|
nonInteraction: true
|
|
@@ -14311,6 +14861,9 @@ function Radio(_ref) {
|
|
|
14311
14861
|
}, children));
|
|
14312
14862
|
}
|
|
14313
14863
|
|
|
14864
|
+
var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
|
|
14865
|
+
const ReactGA$8 = (_window$7 = window) !== null && _window$7 !== void 0 && (_window$Pelcro$7 = _window$7.Pelcro) !== null && _window$Pelcro$7 !== void 0 && (_window$Pelcro$uiSett$7 = _window$Pelcro$7.uiSettings) !== null && _window$Pelcro$uiSett$7 !== void 0 && _window$Pelcro$uiSett$7.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
14866
|
+
|
|
14314
14867
|
/**
|
|
14315
14868
|
*
|
|
14316
14869
|
*/
|
|
@@ -14404,11 +14957,11 @@ class SelectModal extends React.Component {
|
|
|
14404
14957
|
}
|
|
14405
14958
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14406
14959
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
14407
|
-
var _window$
|
|
14408
|
-
const userCurrency = (_window$
|
|
14409
|
-
const userCountry = (_window$
|
|
14410
|
-
const userLanguage = (_window$
|
|
14411
|
-
const productsMatchingUserCurrency = (_window$
|
|
14960
|
+
var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
|
|
14961
|
+
const userCurrency = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read().currency;
|
|
14962
|
+
const userCountry = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$user = _window$Pelcro3.user) === null || _window$Pelcro3$user === void 0 ? void 0 : _window$Pelcro3$user.location.countryCode;
|
|
14963
|
+
const userLanguage = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$user = _window$Pelcro4.user) === null || _window$Pelcro4$user === void 0 ? void 0 : _window$Pelcro4$user.read().language;
|
|
14964
|
+
const productsMatchingUserCurrency = (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read().products.filter(product => {
|
|
14412
14965
|
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
14413
14966
|
if (filteredPlans.length) return filteredPlans;
|
|
14414
14967
|
});
|
|
@@ -14421,12 +14974,12 @@ class SelectModal extends React.Component {
|
|
|
14421
14974
|
});
|
|
14422
14975
|
notifyBugsnag(() => {
|
|
14423
14976
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14424
|
-
var _window$
|
|
14977
|
+
var _window$Pelcro6, _window$Pelcro6$site, _window$Pelcro7, _window$Pelcro7$user, _window$Pelcro8, _window$Pelcro8$uiSet, _window$Pelcro9, _this$props, _window$Pelcro10, _window$Pelcro10$help, _window$Pelcro11, _window$Pelcro11$site;
|
|
14425
14978
|
event.addMetadata("MetaData", {
|
|
14426
|
-
site: (_window$
|
|
14427
|
-
user: (_window$
|
|
14428
|
-
uiVersion: (_window$
|
|
14429
|
-
environment: (_window$
|
|
14979
|
+
site: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$site = _window$Pelcro6.site) === null || _window$Pelcro6$site === void 0 ? void 0 : _window$Pelcro6$site.read(),
|
|
14980
|
+
user: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$user = _window$Pelcro7.user) === null || _window$Pelcro7$user === void 0 ? void 0 : _window$Pelcro7$user.read(),
|
|
14981
|
+
uiVersion: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : (_window$Pelcro8$uiSet = _window$Pelcro8.uiSettings) === null || _window$Pelcro8$uiSet === void 0 ? void 0 : _window$Pelcro8$uiSet.uiVersion,
|
|
14982
|
+
environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
|
|
14430
14983
|
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14431
14984
|
productListState: this.state.productList,
|
|
14432
14985
|
methods: {
|
|
@@ -14437,8 +14990,8 @@ class SelectModal extends React.Component {
|
|
|
14437
14990
|
userCurrency: userCurrency,
|
|
14438
14991
|
userCountry: userCountry,
|
|
14439
14992
|
userLanguage: userLanguage,
|
|
14440
|
-
siteLanguage: (_window$
|
|
14441
|
-
products: (_window$
|
|
14993
|
+
siteLanguage: (_window$Pelcro10 = window.Pelcro) === null || _window$Pelcro10 === void 0 ? void 0 : (_window$Pelcro10$help = _window$Pelcro10.helpers) === null || _window$Pelcro10$help === void 0 ? void 0 : _window$Pelcro10$help.getHtmlLanguageAttribute(),
|
|
14994
|
+
products: (_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : (_window$Pelcro11$site = _window$Pelcro11.site) === null || _window$Pelcro11$site === void 0 ? void 0 : _window$Pelcro11$site.read().products.length,
|
|
14442
14995
|
currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
|
|
14443
14996
|
country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
|
|
14444
14997
|
language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
|
|
@@ -14658,14 +15211,14 @@ class SelectModal extends React.Component {
|
|
|
14658
15211
|
} = this.props;
|
|
14659
15212
|
if (this.state.mode === "product") {
|
|
14660
15213
|
var _ReactGA$event;
|
|
14661
|
-
ReactGA$
|
|
15214
|
+
ReactGA$8 === null || ReactGA$8 === void 0 ? void 0 : (_ReactGA$event = ReactGA$8.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$8, {
|
|
14662
15215
|
category: "VIEWS",
|
|
14663
15216
|
action: "Product Modal Viewed",
|
|
14664
15217
|
nonInteraction: true
|
|
14665
15218
|
});
|
|
14666
15219
|
} else if (this.state.mode === "plan") {
|
|
14667
15220
|
var _ReactGA$event2;
|
|
14668
|
-
ReactGA$
|
|
15221
|
+
ReactGA$8 === null || ReactGA$8 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$8.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$8, {
|
|
14669
15222
|
category: "VIEWS",
|
|
14670
15223
|
action: "Plan Modal Viewed",
|
|
14671
15224
|
nonInteraction: true
|
|
@@ -15100,14 +15653,14 @@ class DonationModal extends React.Component {
|
|
|
15100
15653
|
this.props;
|
|
15101
15654
|
if (this.state.mode === "product") {
|
|
15102
15655
|
var _ReactGA$event;
|
|
15103
|
-
|
|
15656
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
15104
15657
|
category: "VIEWS",
|
|
15105
15658
|
action: "Product Modal Viewed",
|
|
15106
15659
|
nonInteraction: true
|
|
15107
15660
|
});
|
|
15108
15661
|
} else if (this.state.mode === "plan") {
|
|
15109
15662
|
var _ReactGA$event2;
|
|
15110
|
-
|
|
15663
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA1.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA1, {
|
|
15111
15664
|
category: "VIEWS",
|
|
15112
15665
|
action: "Plan Modal Viewed",
|
|
15113
15666
|
nonInteraction: true
|
|
@@ -20537,6 +21090,9 @@ const SubscriptionRenewView = _ref => {
|
|
|
20537
21090
|
}));
|
|
20538
21091
|
};
|
|
20539
21092
|
|
|
21093
|
+
var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
|
|
21094
|
+
const ReactGA$7 = (_window$6 = window) !== null && _window$6 !== void 0 && (_window$Pelcro$6 = _window$6.Pelcro) !== null && _window$Pelcro$6 !== void 0 && (_window$Pelcro$uiSett$6 = _window$Pelcro$6.uiSettings) !== null && _window$Pelcro$uiSett$6 !== void 0 && _window$Pelcro$uiSett$6.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
21095
|
+
|
|
20540
21096
|
/**
|
|
20541
21097
|
*
|
|
20542
21098
|
*/
|
|
@@ -20552,7 +21108,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20552
21108
|
const onSuccess = res => {
|
|
20553
21109
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
20554
21110
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
20555
|
-
ReactGA$
|
|
21111
|
+
ReactGA$7 === null || ReactGA$7 === void 0 ? void 0 : (_ReactGA$event = ReactGA$7.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$7, {
|
|
20556
21112
|
category: "ACTIONS",
|
|
20557
21113
|
action: "Renewed",
|
|
20558
21114
|
nonInteraction: true
|
|
@@ -20562,7 +21118,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20562
21118
|
const onGiftRenewalSuccess = () => {
|
|
20563
21119
|
var _otherProps$onGiftRen, _ReactGA$event2;
|
|
20564
21120
|
(_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
|
|
20565
|
-
ReactGA$
|
|
21121
|
+
ReactGA$7 === null || ReactGA$7 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$7.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$7, {
|
|
20566
21122
|
category: "ACTIONS",
|
|
20567
21123
|
action: "Renewed Gift",
|
|
20568
21124
|
nonInteraction: true
|
|
@@ -20736,6 +21292,8 @@ function SvgSubscription(props) {
|
|
|
20736
21292
|
}))))));
|
|
20737
21293
|
}
|
|
20738
21294
|
|
|
21295
|
+
var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
|
|
21296
|
+
const ReactGA$6 = (_window$5 = window) !== null && _window$5 !== void 0 && (_window$Pelcro$5 = _window$5.Pelcro) !== null && _window$Pelcro$5 !== void 0 && (_window$Pelcro$uiSett$5 = _window$Pelcro$5.uiSettings) !== null && _window$Pelcro$uiSett$5 !== void 0 && _window$Pelcro$uiSett$5.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
20739
21297
|
const SubscriptionCancelNowButton = _ref => {
|
|
20740
21298
|
let {
|
|
20741
21299
|
subscription,
|
|
@@ -20767,7 +21325,7 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20767
21325
|
if (err) {
|
|
20768
21326
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20769
21327
|
}
|
|
20770
|
-
ReactGA$
|
|
21328
|
+
ReactGA$6 === null || ReactGA$6 === void 0 ? void 0 : (_ReactGA$event = ReactGA$6.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$6, {
|
|
20771
21329
|
category: "ACTIONS",
|
|
20772
21330
|
action: "Canceled",
|
|
20773
21331
|
nonInteraction: true
|
|
@@ -20806,6 +21364,8 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20806
21364
|
}, t("messages.cancelNow"));
|
|
20807
21365
|
};
|
|
20808
21366
|
|
|
21367
|
+
var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
|
|
21368
|
+
const ReactGA$5 = (_window$4 = window) !== null && _window$4 !== void 0 && (_window$Pelcro$4 = _window$4.Pelcro) !== null && _window$Pelcro$4 !== void 0 && (_window$Pelcro$uiSett$4 = _window$Pelcro$4.uiSettings) !== null && _window$Pelcro$uiSett$4 !== void 0 && _window$Pelcro$uiSett$4.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
20809
21369
|
const SubscriptionCancelLaterButton = _ref => {
|
|
20810
21370
|
let {
|
|
20811
21371
|
subscription,
|
|
@@ -20837,7 +21397,7 @@ const SubscriptionCancelLaterButton = _ref => {
|
|
|
20837
21397
|
if (err) {
|
|
20838
21398
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20839
21399
|
}
|
|
20840
|
-
ReactGA$
|
|
21400
|
+
ReactGA$5 === null || ReactGA$5 === void 0 ? void 0 : (_ReactGA$event = ReactGA$5.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$5, {
|
|
20841
21401
|
category: "ACTIONS",
|
|
20842
21402
|
action: "Canceled",
|
|
20843
21403
|
nonInteraction: true
|
|
@@ -21046,6 +21606,8 @@ const SubscriptionSuspendDate = props => {
|
|
|
21046
21606
|
}, props));
|
|
21047
21607
|
};
|
|
21048
21608
|
|
|
21609
|
+
var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
|
|
21610
|
+
const ReactGA$4 = (_window$3 = window) !== null && _window$3 !== void 0 && (_window$Pelcro$3 = _window$3.Pelcro) !== null && _window$Pelcro$3 !== void 0 && (_window$Pelcro$uiSett$3 = _window$Pelcro$3.uiSettings) !== null && _window$Pelcro$uiSett$3 !== void 0 && _window$Pelcro$uiSett$3.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
21049
21611
|
const SubscriptionSuspendButton = _ref => {
|
|
21050
21612
|
let {
|
|
21051
21613
|
subscription,
|
|
@@ -21076,7 +21638,7 @@ const SubscriptionSuspendButton = _ref => {
|
|
|
21076
21638
|
if (err) {
|
|
21077
21639
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
21078
21640
|
}
|
|
21079
|
-
ReactGA$
|
|
21641
|
+
ReactGA$4 === null || ReactGA$4 === void 0 ? void 0 : (_ReactGA$event = ReactGA$4.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$4, {
|
|
21080
21642
|
category: "ACTIONS",
|
|
21081
21643
|
action: "Suspended",
|
|
21082
21644
|
nonInteraction: true
|
|
@@ -24463,11 +25025,13 @@ function PaymentMethodUpdateView(props) {
|
|
|
24463
25025
|
}));
|
|
24464
25026
|
}
|
|
24465
25027
|
|
|
25028
|
+
var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
|
|
25029
|
+
const ReactGA$3 = (_window$2 = window) !== null && _window$2 !== void 0 && (_window$Pelcro$2 = _window$2.Pelcro) !== null && _window$Pelcro$2 !== void 0 && (_window$Pelcro$uiSett$2 = _window$Pelcro$2.uiSettings) !== null && _window$Pelcro$uiSett$2 !== void 0 && _window$Pelcro$uiSett$2.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
24466
25030
|
const PaymentMethodUpdateModal = props => {
|
|
24467
25031
|
const onSuccess = res => {
|
|
24468
25032
|
var _props$onSuccess, _ReactGA$event;
|
|
24469
25033
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
24470
|
-
ReactGA$
|
|
25034
|
+
ReactGA$3 === null || ReactGA$3 === void 0 ? void 0 : (_ReactGA$event = ReactGA$3.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$3, {
|
|
24471
25035
|
category: "ACTIONS",
|
|
24472
25036
|
action: "Updated payment card",
|
|
24473
25037
|
nonInteraction: true
|
|
@@ -28357,6 +28921,8 @@ const OrderItems = _ref => {
|
|
|
28357
28921
|
});
|
|
28358
28922
|
};
|
|
28359
28923
|
|
|
28924
|
+
var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1;
|
|
28925
|
+
const ReactGA$2 = (_window$1 = window) !== null && _window$1 !== void 0 && (_window$Pelcro$1 = _window$1.Pelcro) !== null && _window$Pelcro$1 !== void 0 && (_window$Pelcro$uiSett$1 = _window$Pelcro$1.uiSettings) !== null && _window$Pelcro$uiSett$1 !== void 0 && _window$Pelcro$uiSett$1.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
28360
28926
|
const SavedItemsMenu = () => {
|
|
28361
28927
|
const {
|
|
28362
28928
|
t
|
|
@@ -28421,7 +28987,7 @@ const SavedItems = _ref3 => {
|
|
|
28421
28987
|
return;
|
|
28422
28988
|
}
|
|
28423
28989
|
setItems(response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.metadata);
|
|
28424
|
-
ReactGA$
|
|
28990
|
+
ReactGA$2 === null || ReactGA$2 === void 0 ? void 0 : (_ReactGA$event = ReactGA$2.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$2, {
|
|
28425
28991
|
category: "ACTIONS",
|
|
28426
28992
|
action: "Unsave/Unfollow",
|
|
28427
28993
|
label: title
|
|
@@ -29378,6 +29944,8 @@ function getMemberShipStatus(status) {
|
|
|
29378
29944
|
};
|
|
29379
29945
|
}
|
|
29380
29946
|
|
|
29947
|
+
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
29948
|
+
const ReactGA$1 = (_window = window) !== null && _window !== void 0 && (_window$Pelcro = _window.Pelcro) !== null && _window$Pelcro !== void 0 && (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) !== null && _window$Pelcro$uiSett !== void 0 && _window$Pelcro$uiSett.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
29381
29949
|
const SUB_MENUS = {
|
|
29382
29950
|
PROFILE: "profile",
|
|
29383
29951
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -29787,13 +30355,13 @@ class Dashboard extends React.Component {
|
|
|
29787
30355
|
this.menuRef = /*#__PURE__*/React__default['default'].createRef();
|
|
29788
30356
|
}
|
|
29789
30357
|
render() {
|
|
29790
|
-
var _window$Pelcro$user$r3, _window$
|
|
30358
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
29791
30359
|
const {
|
|
29792
30360
|
isOpen
|
|
29793
30361
|
} = this.state;
|
|
29794
30362
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
29795
30363
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
29796
|
-
const newsletters = (_window$
|
|
30364
|
+
const newsletters = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$uiSet = _window$Pelcro2.uiSettings) === null || _window$Pelcro2$uiSet === void 0 ? void 0 : _window$Pelcro2$uiSet.newsletters;
|
|
29797
30365
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
29798
30366
|
return /*#__PURE__*/React__default['default'].createElement(Transition, {
|
|
29799
30367
|
className: "plc-fixed plc-inset-y-0 plc-right-0 plc-h-full plc-max-w-xl plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max",
|