@pelcro/react-pelcro-js 3.23.0-beta.1 → 3.23.0-beta.10
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 +697 -116
- package/dist/index.esm.js +697 -116
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -7470,6 +7470,51 @@ function _defineProperty$3(obj, key, value) {
|
|
|
7470
7470
|
return obj;
|
|
7471
7471
|
}
|
|
7472
7472
|
|
|
7473
|
+
// Polyfill
|
|
7474
|
+
(() => {
|
|
7475
|
+
if (typeof window.CustomEvent === "function") return false;
|
|
7476
|
+
function CustomEvent(event) {
|
|
7477
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
7478
|
+
bubbles: false,
|
|
7479
|
+
cancelable: false,
|
|
7480
|
+
detail: undefined
|
|
7481
|
+
};
|
|
7482
|
+
const evt = document.createEvent("CustomEvent");
|
|
7483
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
7484
|
+
return evt;
|
|
7485
|
+
}
|
|
7486
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
7487
|
+
window.CustomEvent = CustomEvent;
|
|
7488
|
+
})();
|
|
7489
|
+
|
|
7490
|
+
/**
|
|
7491
|
+
* Should fire when the cart is opened and expects the cartItems inside the card to be sent
|
|
7492
|
+
*/
|
|
7493
|
+
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
7494
|
+
|
|
7495
|
+
/**
|
|
7496
|
+
* Should fire when an item added to the cart and expects the added item to be sent
|
|
7497
|
+
*/
|
|
7498
|
+
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
7499
|
+
|
|
7500
|
+
/**
|
|
7501
|
+
* Should fire when an item removed from the cart and expects the removed item to be sent
|
|
7502
|
+
*/
|
|
7503
|
+
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
7504
|
+
|
|
7505
|
+
/**
|
|
7506
|
+
* Check if the browser support custom events
|
|
7507
|
+
*/
|
|
7508
|
+
function createCustomEvent(name, detail) {
|
|
7509
|
+
try {
|
|
7510
|
+
return new CustomEvent(name, {
|
|
7511
|
+
detail
|
|
7512
|
+
});
|
|
7513
|
+
} catch (e) {
|
|
7514
|
+
console.warn("Pelcro - Events are not supported in the browser");
|
|
7515
|
+
}
|
|
7516
|
+
}
|
|
7517
|
+
|
|
7473
7518
|
function warn(s) {
|
|
7474
7519
|
console.warn('[react-ga]', s);
|
|
7475
7520
|
}
|
|
@@ -8321,55 +8366,547 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
8321
8366
|
OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
|
|
8322
8367
|
OutboundLink$1.trackLink = outboundLink;
|
|
8323
8368
|
var OutboundLink = OutboundLink$1;
|
|
8324
|
-
var
|
|
8369
|
+
var ReactGA1 = _objectSpread({}, Defaults, {
|
|
8325
8370
|
OutboundLink: OutboundLink
|
|
8326
8371
|
});
|
|
8327
8372
|
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
const evt = document.createEvent("CustomEvent");
|
|
8338
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
8339
|
-
return evt;
|
|
8373
|
+
var gtag_1 = createCommonjsModule(function (module, exports) {
|
|
8374
|
+
|
|
8375
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8376
|
+
value: true
|
|
8377
|
+
});
|
|
8378
|
+
exports["default"] = void 0;
|
|
8379
|
+
var gtag = function gtag() {
|
|
8380
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8381
|
+
args[_key] = arguments[_key];
|
|
8340
8382
|
}
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8383
|
+
if (typeof window !== "undefined") {
|
|
8384
|
+
var _window;
|
|
8385
|
+
if (typeof window.gtag === "undefined") {
|
|
8386
|
+
window.dataLayer = window.dataLayer || [];
|
|
8387
|
+
window.gtag = function gtag() {
|
|
8388
|
+
window.dataLayer.push(arguments);
|
|
8389
|
+
};
|
|
8390
|
+
}
|
|
8391
|
+
(_window = window).gtag.apply(_window, args);
|
|
8392
|
+
}
|
|
8393
|
+
};
|
|
8394
|
+
var _default = gtag;
|
|
8395
|
+
exports["default"] = _default;
|
|
8396
|
+
});
|
|
8344
8397
|
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8398
|
+
unwrapExports(gtag_1);
|
|
8399
|
+
|
|
8400
|
+
var format_1 = createCommonjsModule(function (module, exports) {
|
|
8401
|
+
|
|
8402
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8403
|
+
value: true
|
|
8404
|
+
});
|
|
8405
|
+
exports["default"] = format;
|
|
8406
|
+
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
8407
|
+
function toTitleCase(string) {
|
|
8408
|
+
return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
|
|
8409
|
+
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) {
|
|
8410
|
+
return match.toLowerCase();
|
|
8411
|
+
}
|
|
8412
|
+
if (match.substr(1).search(/[A-Z]|\../) > -1) {
|
|
8413
|
+
return match;
|
|
8414
|
+
}
|
|
8415
|
+
return match.charAt(0).toUpperCase() + match.substr(1);
|
|
8416
|
+
});
|
|
8417
|
+
}
|
|
8418
|
+
|
|
8419
|
+
// See if s could be an email address. We don't want to send personal data like email.
|
|
8420
|
+
// https://support.google.com/analytics/answer/2795983?hl=en
|
|
8421
|
+
function mightBeEmail(s) {
|
|
8422
|
+
// There's no point trying to validate rfc822 fully, just look for ...@...
|
|
8423
|
+
return typeof s === "string" && s.indexOf("@") !== -1;
|
|
8424
|
+
}
|
|
8425
|
+
var redacted = "REDACTED (Potential Email Address)";
|
|
8426
|
+
function redactEmail(string) {
|
|
8427
|
+
if (mightBeEmail(string)) {
|
|
8428
|
+
console.warn("This arg looks like an email address, redacting.");
|
|
8429
|
+
return redacted;
|
|
8430
|
+
}
|
|
8431
|
+
return string;
|
|
8432
|
+
}
|
|
8433
|
+
function format() {
|
|
8434
|
+
var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
8435
|
+
var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8436
|
+
var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
8437
|
+
var _str = s || "";
|
|
8438
|
+
if (titleCase) {
|
|
8439
|
+
_str = toTitleCase(s);
|
|
8440
|
+
}
|
|
8441
|
+
if (redactingEmail) {
|
|
8442
|
+
_str = redactEmail(_str);
|
|
8443
|
+
}
|
|
8444
|
+
return _str;
|
|
8445
|
+
}
|
|
8446
|
+
});
|
|
8349
8447
|
|
|
8448
|
+
unwrapExports(format_1);
|
|
8449
|
+
|
|
8450
|
+
var ga4 = createCommonjsModule(function (module, exports) {
|
|
8451
|
+
|
|
8452
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8453
|
+
value: true
|
|
8454
|
+
});
|
|
8455
|
+
exports["default"] = exports.GA4 = void 0;
|
|
8456
|
+
var _gtag = _interopRequireDefault(gtag_1);
|
|
8457
|
+
var _format = _interopRequireDefault(format_1);
|
|
8458
|
+
var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
|
|
8459
|
+
_excluded2 = ["title", "location"],
|
|
8460
|
+
_excluded3 = ["page", "hitType"];
|
|
8461
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8462
|
+
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; }
|
|
8463
|
+
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; }
|
|
8464
|
+
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); }
|
|
8465
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8466
|
+
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."); }
|
|
8467
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8468
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8469
|
+
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; }
|
|
8470
|
+
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; }
|
|
8471
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8472
|
+
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."); }
|
|
8473
|
+
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); }
|
|
8474
|
+
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; }
|
|
8475
|
+
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; } }
|
|
8476
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8477
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8478
|
+
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); } }
|
|
8479
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8480
|
+
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; }
|
|
8481
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8482
|
+
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); }
|
|
8483
|
+
/*
|
|
8484
|
+
Links
|
|
8485
|
+
https://developers.google.com/gtagjs/reference/api
|
|
8486
|
+
https://developers.google.com/tag-platform/gtagjs/reference
|
|
8487
|
+
*/
|
|
8350
8488
|
/**
|
|
8351
|
-
*
|
|
8489
|
+
* @typedef GaOptions
|
|
8490
|
+
* @type {Object}
|
|
8491
|
+
* @property {boolean} [cookieUpdate=true]
|
|
8492
|
+
* @property {number} [cookieExpires=63072000] Default two years
|
|
8493
|
+
* @property {string} [cookieDomain="auto"]
|
|
8494
|
+
* @property {string} [cookieFlags]
|
|
8495
|
+
* @property {string} [userId]
|
|
8496
|
+
* @property {string} [clientId]
|
|
8497
|
+
* @property {boolean} [anonymizeIp]
|
|
8498
|
+
* @property {string} [contentGroup1]
|
|
8499
|
+
* @property {string} [contentGroup2]
|
|
8500
|
+
* @property {string} [contentGroup3]
|
|
8501
|
+
* @property {string} [contentGroup4]
|
|
8502
|
+
* @property {string} [contentGroup5]
|
|
8503
|
+
* @property {boolean} [allowAdFeatures=true]
|
|
8504
|
+
* @property {boolean} [allowAdPersonalizationSignals]
|
|
8505
|
+
* @property {boolean} [nonInteraction]
|
|
8506
|
+
* @property {string} [page]
|
|
8352
8507
|
*/
|
|
8353
|
-
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
8354
|
-
|
|
8355
8508
|
/**
|
|
8356
|
-
*
|
|
8509
|
+
* @typedef UaEventOptions
|
|
8510
|
+
* @type {Object}
|
|
8511
|
+
* @property {string} action
|
|
8512
|
+
* @property {string} category
|
|
8513
|
+
* @property {string} [label]
|
|
8514
|
+
* @property {number} [value]
|
|
8515
|
+
* @property {boolean} [nonInteraction]
|
|
8516
|
+
* @property {('beacon'|'xhr'|'image')} [transport]
|
|
8357
8517
|
*/
|
|
8358
|
-
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
8359
|
-
|
|
8360
8518
|
/**
|
|
8361
|
-
*
|
|
8519
|
+
* @typedef InitOptions
|
|
8520
|
+
* @type {Object}
|
|
8521
|
+
* @property {string} trackingId
|
|
8522
|
+
* @property {GaOptions|any} [gaOptions]
|
|
8523
|
+
* @property {Object} [gtagOptions] New parameter
|
|
8362
8524
|
*/
|
|
8363
|
-
function
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8525
|
+
var GA4 = /*#__PURE__*/function () {
|
|
8526
|
+
function GA4() {
|
|
8527
|
+
var _this = this;
|
|
8528
|
+
_classCallCheck(this, GA4);
|
|
8529
|
+
_defineProperty(this, "reset", function () {
|
|
8530
|
+
_this.isInitialized = false;
|
|
8531
|
+
_this._testMode = false;
|
|
8532
|
+
_this._currentMeasurementId;
|
|
8533
|
+
_this._hasLoadedGA = false;
|
|
8534
|
+
_this._isQueuing = false;
|
|
8535
|
+
_this._queueGtag = [];
|
|
8536
|
+
});
|
|
8537
|
+
_defineProperty(this, "_gtag", function () {
|
|
8538
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8539
|
+
args[_key] = arguments[_key];
|
|
8540
|
+
}
|
|
8541
|
+
if (!_this._testMode) {
|
|
8542
|
+
if (_this._isQueuing) {
|
|
8543
|
+
_this._queueGtag.push(args);
|
|
8544
|
+
} else {
|
|
8545
|
+
_gtag["default"].apply(void 0, args);
|
|
8546
|
+
}
|
|
8547
|
+
} else {
|
|
8548
|
+
_this._queueGtag.push(args);
|
|
8549
|
+
}
|
|
8367
8550
|
});
|
|
8368
|
-
|
|
8369
|
-
|
|
8551
|
+
_defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
|
|
8552
|
+
var gtagUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "https://www.googletagmanager.com/gtag/js";
|
|
8553
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
8554
|
+
return;
|
|
8555
|
+
}
|
|
8556
|
+
if (!_this._hasLoadedGA) {
|
|
8557
|
+
// Global Site Tag (gtag.js) - Google Analytics
|
|
8558
|
+
var script = document.createElement("script");
|
|
8559
|
+
script.async = true;
|
|
8560
|
+
script.src = "".concat(gtagUrl, "?id=").concat(GA_MEASUREMENT_ID);
|
|
8561
|
+
if (nonce) {
|
|
8562
|
+
script.setAttribute("nonce", nonce);
|
|
8563
|
+
}
|
|
8564
|
+
document.body.appendChild(script);
|
|
8565
|
+
window.dataLayer = window.dataLayer || [];
|
|
8566
|
+
window.gtag = function gtag() {
|
|
8567
|
+
window.dataLayer.push(arguments);
|
|
8568
|
+
};
|
|
8569
|
+
_this._hasLoadedGA = true;
|
|
8570
|
+
}
|
|
8571
|
+
});
|
|
8572
|
+
_defineProperty(this, "_toGtagOptions", function (gaOptions) {
|
|
8573
|
+
if (!gaOptions) {
|
|
8574
|
+
return;
|
|
8575
|
+
}
|
|
8576
|
+
var mapFields = {
|
|
8577
|
+
// Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
|
|
8578
|
+
// New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
|
|
8579
|
+
cookieUpdate: "cookie_update",
|
|
8580
|
+
cookieExpires: "cookie_expires",
|
|
8581
|
+
cookieDomain: "cookie_domain",
|
|
8582
|
+
cookieFlags: "cookie_flags",
|
|
8583
|
+
// must be in set method?
|
|
8584
|
+
userId: "user_id",
|
|
8585
|
+
clientId: "client_id",
|
|
8586
|
+
anonymizeIp: "anonymize_ip",
|
|
8587
|
+
// https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
|
|
8588
|
+
contentGroup1: "content_group1",
|
|
8589
|
+
contentGroup2: "content_group2",
|
|
8590
|
+
contentGroup3: "content_group3",
|
|
8591
|
+
contentGroup4: "content_group4",
|
|
8592
|
+
contentGroup5: "content_group5",
|
|
8593
|
+
// https://support.google.com/analytics/answer/9050852?hl=en
|
|
8594
|
+
allowAdFeatures: "allow_google_signals",
|
|
8595
|
+
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
8596
|
+
nonInteraction: "non_interaction",
|
|
8597
|
+
page: "page_path",
|
|
8598
|
+
hitCallback: "event_callback"
|
|
8599
|
+
};
|
|
8600
|
+
var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
|
|
8601
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
8602
|
+
key = _ref2[0],
|
|
8603
|
+
value = _ref2[1];
|
|
8604
|
+
if (mapFields[key]) {
|
|
8605
|
+
prev[mapFields[key]] = value;
|
|
8606
|
+
} else {
|
|
8607
|
+
prev[key] = value;
|
|
8608
|
+
}
|
|
8609
|
+
return prev;
|
|
8610
|
+
}, {});
|
|
8611
|
+
return gtagOptions;
|
|
8612
|
+
});
|
|
8613
|
+
_defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
|
|
8614
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8615
|
+
if (!GA_MEASUREMENT_ID) {
|
|
8616
|
+
throw new Error("Require GA_MEASUREMENT_ID");
|
|
8617
|
+
}
|
|
8618
|
+
var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
|
|
8619
|
+
trackingId: GA_MEASUREMENT_ID
|
|
8620
|
+
}] : GA_MEASUREMENT_ID;
|
|
8621
|
+
_this._currentMeasurementId = initConfigs[0].trackingId;
|
|
8622
|
+
var gaOptions = options.gaOptions,
|
|
8623
|
+
gtagOptions = options.gtagOptions,
|
|
8624
|
+
nonce = options.nonce,
|
|
8625
|
+
_options$testMode = options.testMode,
|
|
8626
|
+
testMode = _options$testMode === void 0 ? false : _options$testMode,
|
|
8627
|
+
gtagUrl = options.gtagUrl;
|
|
8628
|
+
_this._testMode = testMode;
|
|
8629
|
+
if (!testMode) {
|
|
8630
|
+
_this._loadGA(_this._currentMeasurementId, nonce, gtagUrl);
|
|
8631
|
+
}
|
|
8632
|
+
if (!_this.isInitialized) {
|
|
8633
|
+
_this._gtag("js", new Date());
|
|
8634
|
+
initConfigs.forEach(function (config) {
|
|
8635
|
+
var mergedGtagOptions = _objectSpread(_objectSpread(_objectSpread({}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions);
|
|
8636
|
+
if (Object.keys(mergedGtagOptions).length) {
|
|
8637
|
+
_this._gtag("config", config.trackingId, mergedGtagOptions);
|
|
8638
|
+
} else {
|
|
8639
|
+
_this._gtag("config", config.trackingId);
|
|
8640
|
+
}
|
|
8641
|
+
});
|
|
8642
|
+
}
|
|
8643
|
+
_this.isInitialized = true;
|
|
8644
|
+
if (!testMode) {
|
|
8645
|
+
var queues = _toConsumableArray(_this._queueGtag);
|
|
8646
|
+
_this._queueGtag = [];
|
|
8647
|
+
_this._isQueuing = false;
|
|
8648
|
+
while (queues.length) {
|
|
8649
|
+
var queue = queues.shift();
|
|
8650
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8651
|
+
if (queue[0] === "get") {
|
|
8652
|
+
_this._isQueuing = true;
|
|
8653
|
+
}
|
|
8654
|
+
}
|
|
8655
|
+
}
|
|
8656
|
+
});
|
|
8657
|
+
_defineProperty(this, "set", function (fieldsObject) {
|
|
8658
|
+
if (!fieldsObject) {
|
|
8659
|
+
console.warn("`fieldsObject` is required in .set()");
|
|
8660
|
+
return;
|
|
8661
|
+
}
|
|
8662
|
+
if (_typeof(fieldsObject) !== "object") {
|
|
8663
|
+
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
8664
|
+
return;
|
|
8665
|
+
}
|
|
8666
|
+
if (Object.keys(fieldsObject).length === 0) {
|
|
8667
|
+
console.warn("empty `fieldsObject` given to .set()");
|
|
8668
|
+
}
|
|
8669
|
+
_this._gaCommand("set", fieldsObject);
|
|
8670
|
+
});
|
|
8671
|
+
_defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
|
|
8672
|
+
_this._gtag("event", eventAction, _objectSpread(_objectSpread({
|
|
8673
|
+
event_category: eventCategory,
|
|
8674
|
+
event_label: eventLabel,
|
|
8675
|
+
value: eventValue
|
|
8676
|
+
}, fieldsObject && {
|
|
8677
|
+
non_interaction: fieldsObject.nonInteraction
|
|
8678
|
+
}), _this._toGtagOptions(fieldsObject)));
|
|
8679
|
+
});
|
|
8680
|
+
_defineProperty(this, "_gaCommandSendEventParameters", function () {
|
|
8681
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8682
|
+
args[_key2] = arguments[_key2];
|
|
8683
|
+
}
|
|
8684
|
+
if (typeof args[0] === "string") {
|
|
8685
|
+
_this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8686
|
+
} else {
|
|
8687
|
+
var _args$ = args[0],
|
|
8688
|
+
eventCategory = _args$.eventCategory,
|
|
8689
|
+
eventAction = _args$.eventAction,
|
|
8690
|
+
eventLabel = _args$.eventLabel,
|
|
8691
|
+
eventValue = _args$.eventValue;
|
|
8692
|
+
_args$.hitType;
|
|
8693
|
+
var rest = _objectWithoutProperties(_args$, _excluded);
|
|
8694
|
+
_this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
|
|
8695
|
+
}
|
|
8696
|
+
});
|
|
8697
|
+
_defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
|
|
8698
|
+
_this._gtag("event", "timing_complete", {
|
|
8699
|
+
name: timingVar,
|
|
8700
|
+
value: timingValue,
|
|
8701
|
+
event_category: timingCategory,
|
|
8702
|
+
event_label: timingLabel
|
|
8703
|
+
});
|
|
8704
|
+
});
|
|
8705
|
+
_defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
|
|
8706
|
+
if (fieldsObject && Object.keys(fieldsObject).length) {
|
|
8707
|
+
var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
|
|
8708
|
+
title = _this$_toGtagOptions.title,
|
|
8709
|
+
location = _this$_toGtagOptions.location,
|
|
8710
|
+
rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
|
|
8711
|
+
_this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
|
|
8712
|
+
page_path: page
|
|
8713
|
+
}), title && {
|
|
8714
|
+
page_title: title
|
|
8715
|
+
}), location && {
|
|
8716
|
+
page_location: location
|
|
8717
|
+
}), rest));
|
|
8718
|
+
} else if (page) {
|
|
8719
|
+
_this._gtag("event", "page_view", {
|
|
8720
|
+
page_path: page
|
|
8721
|
+
});
|
|
8722
|
+
} else {
|
|
8723
|
+
_this._gtag("event", "page_view");
|
|
8724
|
+
}
|
|
8725
|
+
});
|
|
8726
|
+
_defineProperty(this, "_gaCommandSendPageviewParameters", function () {
|
|
8727
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
8728
|
+
args[_key3] = arguments[_key3];
|
|
8729
|
+
}
|
|
8730
|
+
if (typeof args[0] === "string") {
|
|
8731
|
+
_this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8732
|
+
} else {
|
|
8733
|
+
var _args$2 = args[0],
|
|
8734
|
+
page = _args$2.page;
|
|
8735
|
+
_args$2.hitType;
|
|
8736
|
+
var rest = _objectWithoutProperties(_args$2, _excluded3);
|
|
8737
|
+
_this._gaCommandSendPageview(page, rest);
|
|
8738
|
+
}
|
|
8739
|
+
});
|
|
8740
|
+
_defineProperty(this, "_gaCommandSend", function () {
|
|
8741
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
8742
|
+
args[_key4] = arguments[_key4];
|
|
8743
|
+
}
|
|
8744
|
+
var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
|
|
8745
|
+
switch (hitType) {
|
|
8746
|
+
case "event":
|
|
8747
|
+
_this._gaCommandSendEventParameters.apply(_this, args);
|
|
8748
|
+
break;
|
|
8749
|
+
case "pageview":
|
|
8750
|
+
_this._gaCommandSendPageviewParameters.apply(_this, args);
|
|
8751
|
+
break;
|
|
8752
|
+
case "timing":
|
|
8753
|
+
_this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8754
|
+
break;
|
|
8755
|
+
case "screenview":
|
|
8756
|
+
case "transaction":
|
|
8757
|
+
case "item":
|
|
8758
|
+
case "social":
|
|
8759
|
+
case "exception":
|
|
8760
|
+
console.warn("Unsupported send command: ".concat(hitType));
|
|
8761
|
+
break;
|
|
8762
|
+
default:
|
|
8763
|
+
console.warn("Send command doesn't exist: ".concat(hitType));
|
|
8764
|
+
}
|
|
8765
|
+
});
|
|
8766
|
+
_defineProperty(this, "_gaCommandSet", function () {
|
|
8767
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
8768
|
+
args[_key5] = arguments[_key5];
|
|
8769
|
+
}
|
|
8770
|
+
if (typeof args[0] === "string") {
|
|
8771
|
+
args[0] = _defineProperty({}, args[0], args[1]);
|
|
8772
|
+
}
|
|
8773
|
+
_this._gtag("set", _this._toGtagOptions(args[0]));
|
|
8774
|
+
});
|
|
8775
|
+
_defineProperty(this, "_gaCommand", function (command) {
|
|
8776
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
8777
|
+
args[_key6 - 1] = arguments[_key6];
|
|
8778
|
+
}
|
|
8779
|
+
switch (command) {
|
|
8780
|
+
case "send":
|
|
8781
|
+
_this._gaCommandSend.apply(_this, args);
|
|
8782
|
+
break;
|
|
8783
|
+
case "set":
|
|
8784
|
+
_this._gaCommandSet.apply(_this, args);
|
|
8785
|
+
break;
|
|
8786
|
+
default:
|
|
8787
|
+
console.warn("Command doesn't exist: ".concat(command));
|
|
8788
|
+
}
|
|
8789
|
+
});
|
|
8790
|
+
_defineProperty(this, "ga", function () {
|
|
8791
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
8792
|
+
args[_key7] = arguments[_key7];
|
|
8793
|
+
}
|
|
8794
|
+
if (typeof args[0] === "string") {
|
|
8795
|
+
_this._gaCommand.apply(_this, args);
|
|
8796
|
+
} else {
|
|
8797
|
+
var readyCallback = args[0];
|
|
8798
|
+
_this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
|
|
8799
|
+
_this._isQueuing = false;
|
|
8800
|
+
var queues = _this._queueGtag;
|
|
8801
|
+
readyCallback({
|
|
8802
|
+
get: function get(property) {
|
|
8803
|
+
return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
|
|
8804
|
+
}
|
|
8805
|
+
});
|
|
8806
|
+
while (queues.length) {
|
|
8807
|
+
var queue = queues.shift();
|
|
8808
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8809
|
+
}
|
|
8810
|
+
});
|
|
8811
|
+
_this._isQueuing = true;
|
|
8812
|
+
}
|
|
8813
|
+
return _this.ga;
|
|
8814
|
+
});
|
|
8815
|
+
_defineProperty(this, "event", function (optionsOrName, params) {
|
|
8816
|
+
if (typeof optionsOrName === "string") {
|
|
8817
|
+
_this._gtag("event", optionsOrName, _this._toGtagOptions(params));
|
|
8818
|
+
} else {
|
|
8819
|
+
var action = optionsOrName.action,
|
|
8820
|
+
category = optionsOrName.category,
|
|
8821
|
+
label = optionsOrName.label,
|
|
8822
|
+
value = optionsOrName.value,
|
|
8823
|
+
nonInteraction = optionsOrName.nonInteraction,
|
|
8824
|
+
transport = optionsOrName.transport;
|
|
8825
|
+
if (!category || !action) {
|
|
8826
|
+
console.warn("args.category AND args.action are required in event()");
|
|
8827
|
+
return;
|
|
8828
|
+
}
|
|
8829
|
+
|
|
8830
|
+
// Required Fields
|
|
8831
|
+
var fieldObject = {
|
|
8832
|
+
hitType: "event",
|
|
8833
|
+
eventCategory: (0, _format["default"])(category),
|
|
8834
|
+
eventAction: (0, _format["default"])(action)
|
|
8835
|
+
};
|
|
8836
|
+
|
|
8837
|
+
// Optional Fields
|
|
8838
|
+
if (label) {
|
|
8839
|
+
fieldObject.eventLabel = (0, _format["default"])(label);
|
|
8840
|
+
}
|
|
8841
|
+
if (typeof value !== "undefined") {
|
|
8842
|
+
if (typeof value !== "number") {
|
|
8843
|
+
console.warn("Expected `args.value` arg to be a Number.");
|
|
8844
|
+
} else {
|
|
8845
|
+
fieldObject.eventValue = value;
|
|
8846
|
+
}
|
|
8847
|
+
}
|
|
8848
|
+
if (typeof nonInteraction !== "undefined") {
|
|
8849
|
+
if (typeof nonInteraction !== "boolean") {
|
|
8850
|
+
console.warn("`args.nonInteraction` must be a boolean.");
|
|
8851
|
+
} else {
|
|
8852
|
+
fieldObject.nonInteraction = nonInteraction;
|
|
8853
|
+
}
|
|
8854
|
+
}
|
|
8855
|
+
if (typeof transport !== "undefined") {
|
|
8856
|
+
if (typeof transport !== "string") {
|
|
8857
|
+
console.warn("`args.transport` must be a string.");
|
|
8858
|
+
} else {
|
|
8859
|
+
if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
|
|
8860
|
+
console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
|
|
8861
|
+
}
|
|
8862
|
+
fieldObject.transport = transport;
|
|
8863
|
+
}
|
|
8864
|
+
}
|
|
8865
|
+
_this._gaCommand("send", fieldObject);
|
|
8866
|
+
}
|
|
8867
|
+
});
|
|
8868
|
+
_defineProperty(this, "send", function (fieldObject) {
|
|
8869
|
+
_this._gaCommand("send", fieldObject);
|
|
8870
|
+
});
|
|
8871
|
+
this.reset();
|
|
8370
8872
|
}
|
|
8371
|
-
|
|
8873
|
+
_createClass(GA4, [{
|
|
8874
|
+
key: "gtag",
|
|
8875
|
+
value: function gtag() {
|
|
8876
|
+
this._gtag.apply(this, arguments);
|
|
8877
|
+
}
|
|
8878
|
+
}]);
|
|
8879
|
+
return GA4;
|
|
8880
|
+
}();
|
|
8881
|
+
exports.GA4 = GA4;
|
|
8882
|
+
var _default = new GA4();
|
|
8883
|
+
exports["default"] = _default;
|
|
8884
|
+
});
|
|
8885
|
+
|
|
8886
|
+
unwrapExports(ga4);
|
|
8887
|
+
ga4.GA4;
|
|
8888
|
+
|
|
8889
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
8890
|
+
|
|
8891
|
+
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); }
|
|
8892
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8893
|
+
value: true
|
|
8894
|
+
});
|
|
8895
|
+
exports["default"] = exports.ReactGAImplementation = void 0;
|
|
8896
|
+
var _ga = _interopRequireWildcard(ga4);
|
|
8897
|
+
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); }
|
|
8898
|
+
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; }
|
|
8899
|
+
var ReactGAImplementation = _ga.GA4;
|
|
8900
|
+
exports.ReactGAImplementation = ReactGAImplementation;
|
|
8901
|
+
var _default = _ga["default"];
|
|
8902
|
+
exports["default"] = _default;
|
|
8903
|
+
});
|
|
8372
8904
|
|
|
8905
|
+
var ReactGA4 = unwrapExports(dist);
|
|
8906
|
+
dist.ReactGAImplementation;
|
|
8907
|
+
|
|
8908
|
+
var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
|
|
8909
|
+
const ReactGA$d = (_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;
|
|
8373
8910
|
class PelcroActions {
|
|
8374
8911
|
constructor(storeSetter, storeGetter) {
|
|
8375
8912
|
var _this = this;
|
|
@@ -8561,7 +9098,7 @@ class PelcroActions {
|
|
|
8561
9098
|
return console.warn("You are already logged out.");
|
|
8562
9099
|
}
|
|
8563
9100
|
window.Pelcro.user.logout();
|
|
8564
|
-
ReactGA$
|
|
9101
|
+
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, {
|
|
8565
9102
|
category: "ACTIONS",
|
|
8566
9103
|
action: "Logged out",
|
|
8567
9104
|
nonInteraction: true
|
|
@@ -8790,6 +9327,9 @@ if (process.env.NODE_ENV === "development") {
|
|
|
8790
9327
|
c$1("Pelcro Store", usePelcro);
|
|
8791
9328
|
}
|
|
8792
9329
|
|
|
9330
|
+
var _window$c, _window$Pelcro$c, _window$Pelcro$uiSett$c;
|
|
9331
|
+
const ReactGA$c = (_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;
|
|
9332
|
+
|
|
8793
9333
|
/**
|
|
8794
9334
|
* List of zero-decimal currencies.
|
|
8795
9335
|
* @see https://stripe.com/docs/currencies#zero-decimal
|
|
@@ -8872,8 +9412,8 @@ const getLanguageWithoutRegion = localeName => {
|
|
|
8872
9412
|
* @return {string | undefined}
|
|
8873
9413
|
*/
|
|
8874
9414
|
const getPageOrDefaultLanguage = () => {
|
|
8875
|
-
var _window$Pelcro$helper, _window$
|
|
8876
|
-
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$
|
|
9415
|
+
var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
|
|
9416
|
+
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);
|
|
8877
9417
|
};
|
|
8878
9418
|
|
|
8879
9419
|
/**
|
|
@@ -8926,9 +9466,9 @@ const isValidViewFromURL = viewID => {
|
|
|
8926
9466
|
*
|
|
8927
9467
|
*/
|
|
8928
9468
|
function hasValidNewsletterUpdateUrl() {
|
|
8929
|
-
var _window$
|
|
9469
|
+
var _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
8930
9470
|
if (viewID !== "newsletter-update") return false;
|
|
8931
|
-
const newsletters = (_window$
|
|
9471
|
+
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;
|
|
8932
9472
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
8933
9473
|
if (!siteHasNewslettersDefined) {
|
|
8934
9474
|
return false;
|
|
@@ -8993,16 +9533,16 @@ const trackSubscriptionOnGA = () => {
|
|
|
8993
9533
|
return;
|
|
8994
9534
|
}
|
|
8995
9535
|
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;
|
|
8996
|
-
ReactGA$
|
|
9536
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$set = ReactGA$c.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA$c, {
|
|
8997
9537
|
currencyCode: currencyCode
|
|
8998
9538
|
});
|
|
8999
|
-
ReactGA$
|
|
9539
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$c.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", {
|
|
9000
9540
|
id: lastSubscriptionId,
|
|
9001
9541
|
affiliation: "Pelcro",
|
|
9002
9542
|
revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9003
9543
|
coupon: couponCode
|
|
9004
9544
|
});
|
|
9005
|
-
ReactGA$
|
|
9545
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin2 = ReactGA$c.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", {
|
|
9006
9546
|
id: lastSubscriptionId,
|
|
9007
9547
|
name: product.name,
|
|
9008
9548
|
category: product.description,
|
|
@@ -9010,8 +9550,8 @@ const trackSubscriptionOnGA = () => {
|
|
|
9010
9550
|
price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9011
9551
|
quantity: 1
|
|
9012
9552
|
});
|
|
9013
|
-
ReactGA$
|
|
9014
|
-
ReactGA$
|
|
9553
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin3 = ReactGA$c.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");
|
|
9554
|
+
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, {
|
|
9015
9555
|
category: "ACTIONS",
|
|
9016
9556
|
action: "Subscribed",
|
|
9017
9557
|
nonInteraction: true
|
|
@@ -9099,8 +9639,8 @@ function getDateWithoutTime(dateObject) {
|
|
|
9099
9639
|
return date;
|
|
9100
9640
|
}
|
|
9101
9641
|
function userMustVerifyEmail() {
|
|
9102
|
-
var _window$Pelcro$site$
|
|
9103
|
-
const isEmailVerificationEnabled = (_window$Pelcro$site$
|
|
9642
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
9643
|
+
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;
|
|
9104
9644
|
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;
|
|
9105
9645
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
9106
9646
|
}
|
|
@@ -9109,11 +9649,11 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9109
9649
|
//load bugsnag CDN
|
|
9110
9650
|
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
9111
9651
|
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
9112
|
-
var _window$Pelcro$enviro, _window$
|
|
9652
|
+
var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
|
|
9113
9653
|
Bugsnag.start({
|
|
9114
|
-
apiKey: (_window$Pelcro$enviro = (_window$
|
|
9654
|
+
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",
|
|
9115
9655
|
autoDetectErrors: false,
|
|
9116
|
-
releaseStage: (_window$
|
|
9656
|
+
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,
|
|
9117
9657
|
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
9118
9658
|
...startOptions
|
|
9119
9659
|
});
|
|
@@ -9123,6 +9663,17 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9123
9663
|
}
|
|
9124
9664
|
callback();
|
|
9125
9665
|
}
|
|
9666
|
+
|
|
9667
|
+
//create a safe and strong password string with special characters
|
|
9668
|
+
function generatePassword() {
|
|
9669
|
+
const length = 16;
|
|
9670
|
+
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+{}|:<>?`~";
|
|
9671
|
+
let retVal = "";
|
|
9672
|
+
for (let i = 0, n = charset.length; i < length; ++i) {
|
|
9673
|
+
retVal += charset.charAt(Math.floor(Math.random() * n));
|
|
9674
|
+
}
|
|
9675
|
+
return retVal;
|
|
9676
|
+
}
|
|
9126
9677
|
function isStringValid(str) {
|
|
9127
9678
|
// Define the regular expression to match only letters, numbers and spaces
|
|
9128
9679
|
var regex = /^[a-zA-Z0-9\s]+$/;
|
|
@@ -9464,8 +10015,10 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
|
9464
10015
|
return descriptor.value;
|
|
9465
10016
|
}
|
|
9466
10017
|
|
|
10018
|
+
var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
|
|
9467
10019
|
function _classPrivateFieldInitSpec$2(obj, privateMap, value) { _checkPrivateRedeclaration$2(obj, privateMap); privateMap.set(obj, value); }
|
|
9468
10020
|
function _checkPrivateRedeclaration$2(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
10021
|
+
const ReactGA$b = (_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;
|
|
9469
10022
|
var _isAlreadySaved = /*#__PURE__*/new WeakMap();
|
|
9470
10023
|
var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
|
|
9471
10024
|
var _removeLoadingState = /*#__PURE__*/new WeakMap();
|
|
@@ -9588,7 +10141,7 @@ class SaveToMetadataButtonClass {
|
|
|
9588
10141
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9589
10142
|
}
|
|
9590
10143
|
_classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
|
|
9591
|
-
ReactGA$
|
|
10144
|
+
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, {
|
|
9592
10145
|
category: "ACTIONS",
|
|
9593
10146
|
action: "Save/Follow",
|
|
9594
10147
|
label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
|
|
@@ -9620,7 +10173,7 @@ class SaveToMetadataButtonClass {
|
|
|
9620
10173
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9621
10174
|
}
|
|
9622
10175
|
_classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
|
|
9623
|
-
ReactGA$
|
|
10176
|
+
ReactGA$b === null || ReactGA$b === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$b.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$b, {
|
|
9624
10177
|
category: "ACTIONS",
|
|
9625
10178
|
action: "Unsave/Unfollow",
|
|
9626
10179
|
label: title
|
|
@@ -11147,6 +11700,9 @@ function getSiteCardProcessor() {
|
|
|
11147
11700
|
return "stripe";
|
|
11148
11701
|
}
|
|
11149
11702
|
|
|
11703
|
+
var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
|
|
11704
|
+
const ReactGA$a = (_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;
|
|
11705
|
+
|
|
11150
11706
|
/**
|
|
11151
11707
|
* @typedef {Object} OptionsType
|
|
11152
11708
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -11270,12 +11826,12 @@ const initSecuritySdk = () => {
|
|
|
11270
11826
|
};
|
|
11271
11827
|
const initGATracking = () => {
|
|
11272
11828
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
11273
|
-
ReactGA$
|
|
11274
|
-
ReactGA$
|
|
11829
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$initialize = ReactGA$a.initialize) === null || _ReactGA$initialize === void 0 ? void 0 : _ReactGA$initialize.call(ReactGA$a, window.Pelcro.site.read().google_analytics_id);
|
|
11830
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$a.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");
|
|
11275
11831
|
};
|
|
11276
11832
|
const dispatchModalDisplayEvents = modalName => {
|
|
11277
11833
|
var _ReactGA$event, _modalName$replace, _modalName$replace2;
|
|
11278
|
-
ReactGA$
|
|
11834
|
+
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, {
|
|
11279
11835
|
category: "VIEWS",
|
|
11280
11836
|
action: `${modalName === null || modalName === void 0 ? void 0 : (_modalName$replace = modalName.replace("pelcro-", "")) === null || _modalName$replace === void 0 ? void 0 : _modalName$replace.replaceAll("-", " ")} viewed`,
|
|
11281
11837
|
nonInteraction: true
|
|
@@ -12207,9 +12763,9 @@ const LoginContainer = _ref => {
|
|
|
12207
12763
|
});
|
|
12208
12764
|
onFailure(err);
|
|
12209
12765
|
} else {
|
|
12210
|
-
var _ReactGA
|
|
12766
|
+
var _ReactGA$event;
|
|
12211
12767
|
onSuccess(res);
|
|
12212
|
-
|
|
12768
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
12213
12769
|
category: "ACTIONS",
|
|
12214
12770
|
action: "Logged in",
|
|
12215
12771
|
nonInteraction: true
|
|
@@ -12599,11 +13155,13 @@ function ConfirmPassword(_ref) {
|
|
|
12599
13155
|
}, otherProps));
|
|
12600
13156
|
}
|
|
12601
13157
|
|
|
13158
|
+
var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
|
|
13159
|
+
const ReactGA$9 = (_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;
|
|
12602
13160
|
const Logout = props => {
|
|
12603
13161
|
const handleLogout = () => {
|
|
12604
13162
|
var _ReactGA$event;
|
|
12605
13163
|
window.Pelcro.user.logout();
|
|
12606
|
-
ReactGA$
|
|
13164
|
+
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, {
|
|
12607
13165
|
category: "ACTIONS",
|
|
12608
13166
|
action: "Logged out",
|
|
12609
13167
|
nonInteraction: true
|
|
@@ -14165,6 +14723,9 @@ const RegisterCompany = props => {
|
|
|
14165
14723
|
}, props));
|
|
14166
14724
|
};
|
|
14167
14725
|
|
|
14726
|
+
var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
|
|
14727
|
+
const ReactGA$8 = (_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;
|
|
14728
|
+
|
|
14168
14729
|
/**
|
|
14169
14730
|
*
|
|
14170
14731
|
*/
|
|
@@ -14190,7 +14751,7 @@ function RegisterModal(props) {
|
|
|
14190
14751
|
};
|
|
14191
14752
|
const handleAfterRegistrationLogic = () => {
|
|
14192
14753
|
var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
14193
|
-
ReactGA$
|
|
14754
|
+
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, {
|
|
14194
14755
|
category: "ACTIONS",
|
|
14195
14756
|
action: "Registered",
|
|
14196
14757
|
nonInteraction: true
|
|
@@ -14281,6 +14842,9 @@ function Radio(_ref) {
|
|
|
14281
14842
|
}, children));
|
|
14282
14843
|
}
|
|
14283
14844
|
|
|
14845
|
+
var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
|
|
14846
|
+
const ReactGA$7 = (_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;
|
|
14847
|
+
|
|
14284
14848
|
/**
|
|
14285
14849
|
*
|
|
14286
14850
|
*/
|
|
@@ -14374,11 +14938,11 @@ class SelectModal extends Component {
|
|
|
14374
14938
|
}
|
|
14375
14939
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14376
14940
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
14377
|
-
var _window$
|
|
14378
|
-
const userCurrency = (_window$
|
|
14379
|
-
const userCountry = (_window$
|
|
14380
|
-
const userLanguage = (_window$
|
|
14381
|
-
const productsMatchingUserCurrency = (_window$
|
|
14941
|
+
var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
|
|
14942
|
+
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;
|
|
14943
|
+
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;
|
|
14944
|
+
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;
|
|
14945
|
+
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 => {
|
|
14382
14946
|
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
14383
14947
|
if (filteredPlans.length) return filteredPlans;
|
|
14384
14948
|
});
|
|
@@ -14391,12 +14955,12 @@ class SelectModal extends Component {
|
|
|
14391
14955
|
});
|
|
14392
14956
|
notifyBugsnag(() => {
|
|
14393
14957
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14394
|
-
var _window$
|
|
14958
|
+
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;
|
|
14395
14959
|
event.addMetadata("MetaData", {
|
|
14396
|
-
site: (_window$
|
|
14397
|
-
user: (_window$
|
|
14398
|
-
uiVersion: (_window$
|
|
14399
|
-
environment: (_window$
|
|
14960
|
+
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(),
|
|
14961
|
+
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(),
|
|
14962
|
+
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,
|
|
14963
|
+
environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
|
|
14400
14964
|
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14401
14965
|
productListState: this.state.productList,
|
|
14402
14966
|
methods: {
|
|
@@ -14407,8 +14971,8 @@ class SelectModal extends Component {
|
|
|
14407
14971
|
userCurrency: userCurrency,
|
|
14408
14972
|
userCountry: userCountry,
|
|
14409
14973
|
userLanguage: userLanguage,
|
|
14410
|
-
siteLanguage: (_window$
|
|
14411
|
-
products: (_window$
|
|
14974
|
+
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(),
|
|
14975
|
+
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,
|
|
14412
14976
|
currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
|
|
14413
14977
|
country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
|
|
14414
14978
|
language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
|
|
@@ -14628,14 +15192,14 @@ class SelectModal extends Component {
|
|
|
14628
15192
|
} = this.props;
|
|
14629
15193
|
if (this.state.mode === "product") {
|
|
14630
15194
|
var _ReactGA$event;
|
|
14631
|
-
ReactGA$
|
|
15195
|
+
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, {
|
|
14632
15196
|
category: "VIEWS",
|
|
14633
15197
|
action: "Product Modal Viewed",
|
|
14634
15198
|
nonInteraction: true
|
|
14635
15199
|
});
|
|
14636
15200
|
} else if (this.state.mode === "plan") {
|
|
14637
15201
|
var _ReactGA$event2;
|
|
14638
|
-
ReactGA$
|
|
15202
|
+
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, {
|
|
14639
15203
|
category: "VIEWS",
|
|
14640
15204
|
action: "Plan Modal Viewed",
|
|
14641
15205
|
nonInteraction: true
|
|
@@ -15070,14 +15634,14 @@ class DonationModal extends Component {
|
|
|
15070
15634
|
this.props;
|
|
15071
15635
|
if (this.state.mode === "product") {
|
|
15072
15636
|
var _ReactGA$event;
|
|
15073
|
-
|
|
15637
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
15074
15638
|
category: "VIEWS",
|
|
15075
15639
|
action: "Product Modal Viewed",
|
|
15076
15640
|
nonInteraction: true
|
|
15077
15641
|
});
|
|
15078
15642
|
} else if (this.state.mode === "plan") {
|
|
15079
15643
|
var _ReactGA$event2;
|
|
15080
|
-
|
|
15644
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA1.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA1, {
|
|
15081
15645
|
category: "VIEWS",
|
|
15082
15646
|
action: "Plan Modal Viewed",
|
|
15083
15647
|
nonInteraction: true
|
|
@@ -17397,19 +17961,25 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17397
17961
|
|
|
17398
17962
|
/*====== Start Cybersource integration ========*/
|
|
17399
17963
|
const cybersourceErrorHandle = err => {
|
|
17400
|
-
var _err$details, _err$details$response;
|
|
17401
|
-
|
|
17964
|
+
var _err$details, _err$details$response, _err$details$response2;
|
|
17965
|
+
if ((err === null || err === void 0 ? void 0 : (_err$details = err.details) === null || _err$details === void 0 ? void 0 : (_err$details$response = _err$details.responseStatus) === null || _err$details$response === void 0 ? void 0 : (_err$details$response2 = _err$details$response.details) === null || _err$details$response2 === void 0 ? void 0 : _err$details$response2.length) > 0) {
|
|
17966
|
+
var _err$details2, _err$details2$respons;
|
|
17967
|
+
const errorMessages = [];
|
|
17402
17968
|
|
|
17403
|
-
|
|
17404
|
-
|
|
17405
|
-
|
|
17406
|
-
|
|
17407
|
-
|
|
17408
|
-
|
|
17409
|
-
|
|
17969
|
+
// enumerable error (ex: validation errors)
|
|
17970
|
+
Object.values(err === null || err === void 0 ? void 0 : (_err$details2 = err.details) === null || _err$details2 === void 0 ? void 0 : (_err$details2$respons = _err$details2.responseStatus) === null || _err$details2$respons === void 0 ? void 0 : _err$details2$respons.details).forEach(_ref2 => {
|
|
17971
|
+
let {
|
|
17972
|
+
message
|
|
17973
|
+
} = _ref2;
|
|
17974
|
+
errorMessages.push(message);
|
|
17975
|
+
});
|
|
17410
17976
|
|
|
17411
|
-
|
|
17412
|
-
|
|
17977
|
+
// convert to multiline string
|
|
17978
|
+
return errorMessages.join("\n");
|
|
17979
|
+
} else {
|
|
17980
|
+
var _err$details3;
|
|
17981
|
+
return getErrorMessages(err === null || err === void 0 ? void 0 : (_err$details3 = err.details) === null || _err$details3 === void 0 ? void 0 : _err$details3.responseStatus);
|
|
17982
|
+
}
|
|
17413
17983
|
};
|
|
17414
17984
|
const submitUsingCybersource = (state, dispatch) => {
|
|
17415
17985
|
var _cybersourceInstanceR;
|
|
@@ -18857,7 +19427,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18857
19427
|
const sendRegisterRequest = (state, callback) => {
|
|
18858
19428
|
window.Pelcro.user.register({
|
|
18859
19429
|
email: state.email,
|
|
18860
|
-
password:
|
|
19430
|
+
password: generatePassword()
|
|
18861
19431
|
}, (err, res) => {
|
|
18862
19432
|
if (err) {
|
|
18863
19433
|
var _err$response, _err$response$data;
|
|
@@ -19591,12 +20161,12 @@ const CheckoutForm = () => {
|
|
|
19591
20161
|
className: "plc-w-6/12 plc-pr-4"
|
|
19592
20162
|
}, /*#__PURE__*/React__default.createElement(MonthSelect, {
|
|
19593
20163
|
store: store$k,
|
|
19594
|
-
placeholder: "Exp Month"
|
|
20164
|
+
placeholder: "Exp Month *"
|
|
19595
20165
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
19596
20166
|
className: "plc-w-6/12"
|
|
19597
20167
|
}, /*#__PURE__*/React__default.createElement(YearSelect, {
|
|
19598
20168
|
store: store$k,
|
|
19599
|
-
placeholder: "Exp Year"
|
|
20169
|
+
placeholder: "Exp Year *"
|
|
19600
20170
|
}))));
|
|
19601
20171
|
}
|
|
19602
20172
|
if (cardProcessor === "stripe") {
|
|
@@ -19659,7 +20229,7 @@ const DiscountedPrice = props => {
|
|
|
19659
20229
|
};
|
|
19660
20230
|
|
|
19661
20231
|
const SubmitPaymentMethod = _ref => {
|
|
19662
|
-
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r;
|
|
20232
|
+
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
19663
20233
|
let {
|
|
19664
20234
|
onClick,
|
|
19665
20235
|
...otherProps
|
|
@@ -19667,7 +20237,8 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19667
20237
|
const {
|
|
19668
20238
|
plan,
|
|
19669
20239
|
selectedDonationAmount,
|
|
19670
|
-
customDonationAmount
|
|
20240
|
+
customDonationAmount,
|
|
20241
|
+
selectedPaymentMethodId
|
|
19671
20242
|
} = usePelcro();
|
|
19672
20243
|
const {
|
|
19673
20244
|
t
|
|
@@ -19685,13 +20256,16 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19685
20256
|
phone,
|
|
19686
20257
|
disableSubmit,
|
|
19687
20258
|
isLoading,
|
|
19688
|
-
updatedPrice
|
|
20259
|
+
updatedPrice,
|
|
20260
|
+
month,
|
|
20261
|
+
year
|
|
19689
20262
|
}
|
|
19690
20263
|
} = useContext(store$k);
|
|
19691
20264
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
19692
20265
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
19693
20266
|
const priceFormatted = (plan === null || plan === void 0 ? void 0 : plan.type) === "donation" && (selectedDonationAmount || customDonationAmount) ? getFormattedPriceByLocal(selectedDonationAmount ? selectedDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity2 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity2 !== void 0 ? _plan$quantity2 : 1) : customDonationAmount * (plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity3 = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity3 !== void 0 ? _plan$quantity3 : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage()) : getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
19694
20267
|
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
20268
|
+
const supportsCybersource = Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.cybersource_gateway_settings);
|
|
19695
20269
|
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
19696
20270
|
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
19697
20271
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
@@ -19700,9 +20274,9 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19700
20274
|
if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
|
|
19701
20275
|
setDisabled(disableSubmit);
|
|
19702
20276
|
} else {
|
|
19703
|
-
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError);
|
|
20277
|
+
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length) || emailError || passwordError || supportsCybersource && !selectedPaymentMethodId && !(month !== null && month !== void 0 && month.length) || supportsCybersource && !selectedPaymentMethodId && !(year !== null && year !== void 0 && year.length));
|
|
19704
20278
|
}
|
|
19705
|
-
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError]);
|
|
20279
|
+
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError, month, year]);
|
|
19706
20280
|
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
19707
20281
|
role: "submit",
|
|
19708
20282
|
className: "plc-w-full plc-py-3",
|
|
@@ -20341,10 +20915,6 @@ const DonationEmail = props => /*#__PURE__*/React__default.createElement(Email,
|
|
|
20341
20915
|
store: store$k
|
|
20342
20916
|
}, props));
|
|
20343
20917
|
|
|
20344
|
-
const DonationPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
|
|
20345
|
-
store: store$k
|
|
20346
|
-
}, props));
|
|
20347
|
-
|
|
20348
20918
|
/**
|
|
20349
20919
|
*
|
|
20350
20920
|
*/
|
|
@@ -20431,11 +21001,6 @@ function PaymentMethodView(_ref) {
|
|
|
20431
21001
|
label: t("labels.email"),
|
|
20432
21002
|
required: true,
|
|
20433
21003
|
autoFocus: true
|
|
20434
|
-
}), /*#__PURE__*/React__default.createElement(DonationPassword, {
|
|
20435
|
-
id: "pelcro-input-password",
|
|
20436
|
-
errorId: "pelcro-input-password-error",
|
|
20437
|
-
label: t("labels.password"),
|
|
20438
|
-
required: true
|
|
20439
21004
|
})), /*#__PURE__*/React__default.createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default.createElement("div", {
|
|
20440
21005
|
className: "plc-mb-2"
|
|
20441
21006
|
}, /*#__PURE__*/React__default.createElement(CouponCode, null), /*#__PURE__*/React__default.createElement(DiscountedPrice, null)), /*#__PURE__*/React__default.createElement(TaxAmount, null), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -20498,6 +21063,9 @@ const SubscriptionRenewView = _ref => {
|
|
|
20498
21063
|
}));
|
|
20499
21064
|
};
|
|
20500
21065
|
|
|
21066
|
+
var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
|
|
21067
|
+
const ReactGA$6 = (_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;
|
|
21068
|
+
|
|
20501
21069
|
/**
|
|
20502
21070
|
*
|
|
20503
21071
|
*/
|
|
@@ -20513,7 +21081,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20513
21081
|
const onSuccess = res => {
|
|
20514
21082
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
20515
21083
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
20516
|
-
ReactGA$
|
|
21084
|
+
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, {
|
|
20517
21085
|
category: "ACTIONS",
|
|
20518
21086
|
action: "Renewed",
|
|
20519
21087
|
nonInteraction: true
|
|
@@ -20523,7 +21091,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20523
21091
|
const onGiftRenewalSuccess = () => {
|
|
20524
21092
|
var _otherProps$onGiftRen, _ReactGA$event2;
|
|
20525
21093
|
(_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
|
|
20526
|
-
ReactGA$
|
|
21094
|
+
ReactGA$6 === null || ReactGA$6 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$6.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$6, {
|
|
20527
21095
|
category: "ACTIONS",
|
|
20528
21096
|
action: "Renewed Gift",
|
|
20529
21097
|
nonInteraction: true
|
|
@@ -20697,6 +21265,8 @@ function SvgSubscription(props) {
|
|
|
20697
21265
|
}))))));
|
|
20698
21266
|
}
|
|
20699
21267
|
|
|
21268
|
+
var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
|
|
21269
|
+
const ReactGA$5 = (_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;
|
|
20700
21270
|
const SubscriptionCancelNowButton = _ref => {
|
|
20701
21271
|
let {
|
|
20702
21272
|
subscription,
|
|
@@ -20728,7 +21298,7 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20728
21298
|
if (err) {
|
|
20729
21299
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20730
21300
|
}
|
|
20731
|
-
ReactGA$
|
|
21301
|
+
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, {
|
|
20732
21302
|
category: "ACTIONS",
|
|
20733
21303
|
action: "Canceled",
|
|
20734
21304
|
nonInteraction: true
|
|
@@ -20767,6 +21337,8 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20767
21337
|
}, t("messages.cancelNow"));
|
|
20768
21338
|
};
|
|
20769
21339
|
|
|
21340
|
+
var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
|
|
21341
|
+
const ReactGA$4 = (_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;
|
|
20770
21342
|
const SubscriptionCancelLaterButton = _ref => {
|
|
20771
21343
|
let {
|
|
20772
21344
|
subscription,
|
|
@@ -20798,7 +21370,7 @@ const SubscriptionCancelLaterButton = _ref => {
|
|
|
20798
21370
|
if (err) {
|
|
20799
21371
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20800
21372
|
}
|
|
20801
|
-
ReactGA$
|
|
21373
|
+
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, {
|
|
20802
21374
|
category: "ACTIONS",
|
|
20803
21375
|
action: "Canceled",
|
|
20804
21376
|
nonInteraction: true
|
|
@@ -21007,6 +21579,8 @@ const SubscriptionSuspendDate = props => {
|
|
|
21007
21579
|
}, props));
|
|
21008
21580
|
};
|
|
21009
21581
|
|
|
21582
|
+
var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
|
|
21583
|
+
const ReactGA$3 = (_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;
|
|
21010
21584
|
const SubscriptionSuspendButton = _ref => {
|
|
21011
21585
|
let {
|
|
21012
21586
|
subscription,
|
|
@@ -21037,7 +21611,7 @@ const SubscriptionSuspendButton = _ref => {
|
|
|
21037
21611
|
if (err) {
|
|
21038
21612
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
21039
21613
|
}
|
|
21040
|
-
ReactGA$
|
|
21614
|
+
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, {
|
|
21041
21615
|
category: "ACTIONS",
|
|
21042
21616
|
action: "Suspended",
|
|
21043
21617
|
nonInteraction: true
|
|
@@ -23887,7 +24461,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23887
24461
|
});
|
|
23888
24462
|
onFailure(err);
|
|
23889
24463
|
} else {
|
|
23890
|
-
var _ReactGA
|
|
24464
|
+
var _ReactGA$event;
|
|
23891
24465
|
dispatch({
|
|
23892
24466
|
type: SHOW_ALERT,
|
|
23893
24467
|
payload: {
|
|
@@ -23896,7 +24470,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23896
24470
|
}
|
|
23897
24471
|
});
|
|
23898
24472
|
onSuccess(res);
|
|
23899
|
-
|
|
24473
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
23900
24474
|
category: "ACTIONS",
|
|
23901
24475
|
action: "Updated address",
|
|
23902
24476
|
nonInteraction: true
|
|
@@ -24424,11 +24998,13 @@ function PaymentMethodUpdateView(props) {
|
|
|
24424
24998
|
}));
|
|
24425
24999
|
}
|
|
24426
25000
|
|
|
25001
|
+
var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
|
|
25002
|
+
const ReactGA$2 = (_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;
|
|
24427
25003
|
const PaymentMethodUpdateModal = props => {
|
|
24428
25004
|
const onSuccess = res => {
|
|
24429
25005
|
var _props$onSuccess, _ReactGA$event;
|
|
24430
25006
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
24431
|
-
ReactGA$
|
|
25007
|
+
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, {
|
|
24432
25008
|
category: "ACTIONS",
|
|
24433
25009
|
action: "Updated payment card",
|
|
24434
25010
|
nonInteraction: true
|
|
@@ -26344,6 +26920,7 @@ const GiftRedeemContainer = _ref => {
|
|
|
26344
26920
|
payload: false
|
|
26345
26921
|
});
|
|
26346
26922
|
if (err) {
|
|
26923
|
+
var _err$response, _err$response$data, _err$response$data$er;
|
|
26347
26924
|
dispatch({
|
|
26348
26925
|
type: SHOW_ALERT,
|
|
26349
26926
|
payload: {
|
|
@@ -26351,7 +26928,7 @@ const GiftRedeemContainer = _ref => {
|
|
|
26351
26928
|
content: getErrorMessages(err)
|
|
26352
26929
|
}
|
|
26353
26930
|
});
|
|
26354
|
-
if (
|
|
26931
|
+
if ((_err$response = err.response) !== null && _err$response !== void 0 && (_err$response$data = _err$response.data) !== null && _err$response$data !== void 0 && (_err$response$data$er = _err$response$data.errors) !== null && _err$response$data$er !== void 0 && _err$response$data$er.address_id) {
|
|
26355
26932
|
switchToAddressView();
|
|
26356
26933
|
} else {
|
|
26357
26934
|
return onFailure(err);
|
|
@@ -28318,6 +28895,8 @@ const OrderItems = _ref => {
|
|
|
28318
28895
|
});
|
|
28319
28896
|
};
|
|
28320
28897
|
|
|
28898
|
+
var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1;
|
|
28899
|
+
const ReactGA$1 = (_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;
|
|
28321
28900
|
const SavedItemsMenu = () => {
|
|
28322
28901
|
const {
|
|
28323
28902
|
t
|
|
@@ -29339,6 +29918,8 @@ function getMemberShipStatus(status) {
|
|
|
29339
29918
|
};
|
|
29340
29919
|
}
|
|
29341
29920
|
|
|
29921
|
+
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
29922
|
+
const ReactGA = (_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;
|
|
29342
29923
|
const SUB_MENUS = {
|
|
29343
29924
|
PROFILE: "profile",
|
|
29344
29925
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -29403,7 +29984,7 @@ class Dashboard extends Component {
|
|
|
29403
29984
|
window.Pelcro.insight.track("Modal Displayed", {
|
|
29404
29985
|
name: "dashboard"
|
|
29405
29986
|
});
|
|
29406
|
-
ReactGA
|
|
29987
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
29407
29988
|
category: "VIEWS",
|
|
29408
29989
|
action: "Dashboard Modal Viewed",
|
|
29409
29990
|
nonInteraction: true
|
|
@@ -29439,7 +30020,7 @@ class Dashboard extends Component {
|
|
|
29439
30020
|
if (err) {
|
|
29440
30021
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
29441
30022
|
}
|
|
29442
|
-
ReactGA
|
|
30023
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
29443
30024
|
category: "ACTIONS",
|
|
29444
30025
|
action: "Canceled",
|
|
29445
30026
|
nonInteraction: true
|
|
@@ -29457,7 +30038,7 @@ class Dashboard extends Component {
|
|
|
29457
30038
|
if (err) {
|
|
29458
30039
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
29459
30040
|
}
|
|
29460
|
-
ReactGA
|
|
30041
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event3 = ReactGA.event) === null || _ReactGA$event3 === void 0 ? void 0 : _ReactGA$event3.call(ReactGA, {
|
|
29461
30042
|
category: "ACTIONS",
|
|
29462
30043
|
action: "UnSuspended",
|
|
29463
30044
|
nonInteraction: true
|
|
@@ -29748,13 +30329,13 @@ class Dashboard extends Component {
|
|
|
29748
30329
|
this.menuRef = /*#__PURE__*/React__default.createRef();
|
|
29749
30330
|
}
|
|
29750
30331
|
render() {
|
|
29751
|
-
var _window$Pelcro$user$r3, _window$
|
|
30332
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
29752
30333
|
const {
|
|
29753
30334
|
isOpen
|
|
29754
30335
|
} = this.state;
|
|
29755
30336
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
29756
30337
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
29757
|
-
const newsletters = (_window$
|
|
30338
|
+
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;
|
|
29758
30339
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
29759
30340
|
return /*#__PURE__*/React__default.createElement(Transition, {
|
|
29760
30341
|
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",
|