@pelcro/react-pelcro-js 3.23.0-beta.1 → 3.23.0-beta.11
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 +705 -121
- package/dist/index.esm.js +705 -121
- 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
|
-
|
|
8428
|
+
unwrapExports(gtag_1);
|
|
8429
|
+
|
|
8430
|
+
var format_1 = createCommonjsModule(function (module, exports) {
|
|
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
|
+
}
|
|
8379
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;
|
|
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;
|
|
8402
8937
|
|
|
8938
|
+
var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
|
|
8939
|
+
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;
|
|
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$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, {
|
|
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$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;
|
|
9362
|
+
|
|
8823
9363
|
/**
|
|
8824
9364
|
* List of zero-decimal currencies.
|
|
8825
9365
|
* @see https://stripe.com/docs/currencies#zero-decimal
|
|
@@ -8834,16 +9374,19 @@ const ZERO_DECIMAL_CURRENCIES = ["BIF", "CLP", "DJF", "GNF", "JPY", "KMF", "KRW"
|
|
|
8834
9374
|
const isCurrencyZeroDecimal = currency => ZERO_DECIMAL_CURRENCIES.includes(currency.toUpperCase());
|
|
8835
9375
|
const sortCountries = countries => {
|
|
8836
9376
|
const sortable = [];
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
9377
|
+
const {
|
|
9378
|
+
CA,
|
|
9379
|
+
US,
|
|
9380
|
+
...rest
|
|
9381
|
+
} = countries;
|
|
9382
|
+
for (const abbr in rest) {
|
|
9383
|
+
sortable.push([abbr, rest[abbr]]);
|
|
8841
9384
|
}
|
|
8842
9385
|
sortable.sort((a, b) => {
|
|
8843
9386
|
if (a[1] > b[1]) return 1;
|
|
8844
9387
|
return -1;
|
|
8845
9388
|
});
|
|
8846
|
-
sortable.unshift(["US",
|
|
9389
|
+
sortable.unshift(["US", US], ["CA", CA]);
|
|
8847
9390
|
return sortable;
|
|
8848
9391
|
};
|
|
8849
9392
|
|
|
@@ -8902,8 +9445,8 @@ const getLanguageWithoutRegion = localeName => {
|
|
|
8902
9445
|
* @return {string | undefined}
|
|
8903
9446
|
*/
|
|
8904
9447
|
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$
|
|
9448
|
+
var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
|
|
9449
|
+
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
9450
|
};
|
|
8908
9451
|
|
|
8909
9452
|
/**
|
|
@@ -8956,9 +9499,9 @@ const isValidViewFromURL = viewID => {
|
|
|
8956
9499
|
*
|
|
8957
9500
|
*/
|
|
8958
9501
|
function hasValidNewsletterUpdateUrl() {
|
|
8959
|
-
var _window$
|
|
9502
|
+
var _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
8960
9503
|
if (viewID !== "newsletter-update") return false;
|
|
8961
|
-
const newsletters = (_window$
|
|
9504
|
+
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
9505
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
8963
9506
|
if (!siteHasNewslettersDefined) {
|
|
8964
9507
|
return false;
|
|
@@ -9023,16 +9566,16 @@ const trackSubscriptionOnGA = () => {
|
|
|
9023
9566
|
return;
|
|
9024
9567
|
}
|
|
9025
9568
|
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$
|
|
9569
|
+
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, {
|
|
9027
9570
|
currencyCode: currencyCode
|
|
9028
9571
|
});
|
|
9029
|
-
ReactGA$
|
|
9572
|
+
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", {
|
|
9030
9573
|
id: lastSubscriptionId,
|
|
9031
9574
|
affiliation: "Pelcro",
|
|
9032
9575
|
revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9033
9576
|
coupon: couponCode
|
|
9034
9577
|
});
|
|
9035
|
-
ReactGA$
|
|
9578
|
+
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", {
|
|
9036
9579
|
id: lastSubscriptionId,
|
|
9037
9580
|
name: product.name,
|
|
9038
9581
|
category: product.description,
|
|
@@ -9040,8 +9583,8 @@ const trackSubscriptionOnGA = () => {
|
|
|
9040
9583
|
price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
9041
9584
|
quantity: 1
|
|
9042
9585
|
});
|
|
9043
|
-
ReactGA$
|
|
9044
|
-
ReactGA$
|
|
9586
|
+
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");
|
|
9587
|
+
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, {
|
|
9045
9588
|
category: "ACTIONS",
|
|
9046
9589
|
action: "Subscribed",
|
|
9047
9590
|
nonInteraction: true
|
|
@@ -9129,8 +9672,8 @@ function getDateWithoutTime(dateObject) {
|
|
|
9129
9672
|
return date;
|
|
9130
9673
|
}
|
|
9131
9674
|
function userMustVerifyEmail() {
|
|
9132
|
-
var _window$Pelcro$site$
|
|
9133
|
-
const isEmailVerificationEnabled = (_window$Pelcro$site$
|
|
9675
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
9676
|
+
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
9677
|
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
9678
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
9136
9679
|
}
|
|
@@ -9139,11 +9682,11 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9139
9682
|
//load bugsnag CDN
|
|
9140
9683
|
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
9141
9684
|
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
9142
|
-
var _window$Pelcro$enviro, _window$
|
|
9685
|
+
var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
|
|
9143
9686
|
Bugsnag.start({
|
|
9144
|
-
apiKey: (_window$Pelcro$enviro = (_window$
|
|
9687
|
+
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
9688
|
autoDetectErrors: false,
|
|
9146
|
-
releaseStage: (_window$
|
|
9689
|
+
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
9690
|
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
9148
9691
|
...startOptions
|
|
9149
9692
|
});
|
|
@@ -9153,6 +9696,17 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9153
9696
|
}
|
|
9154
9697
|
callback();
|
|
9155
9698
|
}
|
|
9699
|
+
|
|
9700
|
+
//create a safe and strong password string with special characters
|
|
9701
|
+
function generatePassword() {
|
|
9702
|
+
const length = 16;
|
|
9703
|
+
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+{}|:<>?`~";
|
|
9704
|
+
let retVal = "";
|
|
9705
|
+
for (let i = 0, n = charset.length; i < length; ++i) {
|
|
9706
|
+
retVal += charset.charAt(Math.floor(Math.random() * n));
|
|
9707
|
+
}
|
|
9708
|
+
return retVal;
|
|
9709
|
+
}
|
|
9156
9710
|
function isStringValid(str) {
|
|
9157
9711
|
// Define the regular expression to match only letters, numbers and spaces
|
|
9158
9712
|
var regex = /^[a-zA-Z0-9\s]+$/;
|
|
@@ -9494,8 +10048,10 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
|
9494
10048
|
return descriptor.value;
|
|
9495
10049
|
}
|
|
9496
10050
|
|
|
10051
|
+
var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
|
|
9497
10052
|
function _classPrivateFieldInitSpec$2(obj, privateMap, value) { _checkPrivateRedeclaration$2(obj, privateMap); privateMap.set(obj, value); }
|
|
9498
10053
|
function _checkPrivateRedeclaration$2(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
10054
|
+
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;
|
|
9499
10055
|
var _isAlreadySaved = /*#__PURE__*/new WeakMap();
|
|
9500
10056
|
var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
|
|
9501
10057
|
var _removeLoadingState = /*#__PURE__*/new WeakMap();
|
|
@@ -9618,7 +10174,7 @@ class SaveToMetadataButtonClass {
|
|
|
9618
10174
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9619
10175
|
}
|
|
9620
10176
|
_classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
|
|
9621
|
-
ReactGA$
|
|
10177
|
+
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, {
|
|
9622
10178
|
category: "ACTIONS",
|
|
9623
10179
|
action: "Save/Follow",
|
|
9624
10180
|
label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
|
|
@@ -9650,7 +10206,7 @@ class SaveToMetadataButtonClass {
|
|
|
9650
10206
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9651
10207
|
}
|
|
9652
10208
|
_classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
|
|
9653
|
-
ReactGA$
|
|
10209
|
+
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, {
|
|
9654
10210
|
category: "ACTIONS",
|
|
9655
10211
|
action: "Unsave/Unfollow",
|
|
9656
10212
|
label: title
|
|
@@ -11177,6 +11733,9 @@ function getSiteCardProcessor() {
|
|
|
11177
11733
|
return "stripe";
|
|
11178
11734
|
}
|
|
11179
11735
|
|
|
11736
|
+
var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
|
|
11737
|
+
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;
|
|
11738
|
+
|
|
11180
11739
|
/**
|
|
11181
11740
|
* @typedef {Object} OptionsType
|
|
11182
11741
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -11300,12 +11859,12 @@ const initSecuritySdk = () => {
|
|
|
11300
11859
|
};
|
|
11301
11860
|
const initGATracking = () => {
|
|
11302
11861
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
11303
|
-
ReactGA$
|
|
11304
|
-
ReactGA$
|
|
11862
|
+
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);
|
|
11863
|
+
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");
|
|
11305
11864
|
};
|
|
11306
11865
|
const dispatchModalDisplayEvents = modalName => {
|
|
11307
11866
|
var _ReactGA$event, _modalName$replace, _modalName$replace2;
|
|
11308
|
-
ReactGA$
|
|
11867
|
+
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, {
|
|
11309
11868
|
category: "VIEWS",
|
|
11310
11869
|
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
11870
|
nonInteraction: true
|
|
@@ -12237,9 +12796,9 @@ const LoginContainer = _ref => {
|
|
|
12237
12796
|
});
|
|
12238
12797
|
onFailure(err);
|
|
12239
12798
|
} else {
|
|
12240
|
-
var _ReactGA
|
|
12799
|
+
var _ReactGA$event;
|
|
12241
12800
|
onSuccess(res);
|
|
12242
|
-
|
|
12801
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
12243
12802
|
category: "ACTIONS",
|
|
12244
12803
|
action: "Logged in",
|
|
12245
12804
|
nonInteraction: true
|
|
@@ -12629,11 +13188,13 @@ function ConfirmPassword(_ref) {
|
|
|
12629
13188
|
}, otherProps));
|
|
12630
13189
|
}
|
|
12631
13190
|
|
|
13191
|
+
var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
|
|
13192
|
+
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;
|
|
12632
13193
|
const Logout = props => {
|
|
12633
13194
|
const handleLogout = () => {
|
|
12634
13195
|
var _ReactGA$event;
|
|
12635
13196
|
window.Pelcro.user.logout();
|
|
12636
|
-
ReactGA$
|
|
13197
|
+
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, {
|
|
12637
13198
|
category: "ACTIONS",
|
|
12638
13199
|
action: "Logged out",
|
|
12639
13200
|
nonInteraction: true
|
|
@@ -14195,6 +14756,9 @@ const RegisterCompany = props => {
|
|
|
14195
14756
|
}, props));
|
|
14196
14757
|
};
|
|
14197
14758
|
|
|
14759
|
+
var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
|
|
14760
|
+
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;
|
|
14761
|
+
|
|
14198
14762
|
/**
|
|
14199
14763
|
*
|
|
14200
14764
|
*/
|
|
@@ -14220,7 +14784,7 @@ function RegisterModal(props) {
|
|
|
14220
14784
|
};
|
|
14221
14785
|
const handleAfterRegistrationLogic = () => {
|
|
14222
14786
|
var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
14223
|
-
ReactGA$
|
|
14787
|
+
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, {
|
|
14224
14788
|
category: "ACTIONS",
|
|
14225
14789
|
action: "Registered",
|
|
14226
14790
|
nonInteraction: true
|
|
@@ -14311,6 +14875,9 @@ function Radio(_ref) {
|
|
|
14311
14875
|
}, children));
|
|
14312
14876
|
}
|
|
14313
14877
|
|
|
14878
|
+
var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
|
|
14879
|
+
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;
|
|
14880
|
+
|
|
14314
14881
|
/**
|
|
14315
14882
|
*
|
|
14316
14883
|
*/
|
|
@@ -14404,11 +14971,11 @@ class SelectModal extends React.Component {
|
|
|
14404
14971
|
}
|
|
14405
14972
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14406
14973
|
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$
|
|
14974
|
+
var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
|
|
14975
|
+
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;
|
|
14976
|
+
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;
|
|
14977
|
+
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;
|
|
14978
|
+
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
14979
|
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
14413
14980
|
if (filteredPlans.length) return filteredPlans;
|
|
14414
14981
|
});
|
|
@@ -14421,12 +14988,12 @@ class SelectModal extends React.Component {
|
|
|
14421
14988
|
});
|
|
14422
14989
|
notifyBugsnag(() => {
|
|
14423
14990
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14424
|
-
var _window$
|
|
14991
|
+
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
14992
|
event.addMetadata("MetaData", {
|
|
14426
|
-
site: (_window$
|
|
14427
|
-
user: (_window$
|
|
14428
|
-
uiVersion: (_window$
|
|
14429
|
-
environment: (_window$
|
|
14993
|
+
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(),
|
|
14994
|
+
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(),
|
|
14995
|
+
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,
|
|
14996
|
+
environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
|
|
14430
14997
|
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14431
14998
|
productListState: this.state.productList,
|
|
14432
14999
|
methods: {
|
|
@@ -14437,8 +15004,8 @@ class SelectModal extends React.Component {
|
|
|
14437
15004
|
userCurrency: userCurrency,
|
|
14438
15005
|
userCountry: userCountry,
|
|
14439
15006
|
userLanguage: userLanguage,
|
|
14440
|
-
siteLanguage: (_window$
|
|
14441
|
-
products: (_window$
|
|
15007
|
+
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(),
|
|
15008
|
+
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
15009
|
currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
|
|
14443
15010
|
country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
|
|
14444
15011
|
language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
|
|
@@ -14658,14 +15225,14 @@ class SelectModal extends React.Component {
|
|
|
14658
15225
|
} = this.props;
|
|
14659
15226
|
if (this.state.mode === "product") {
|
|
14660
15227
|
var _ReactGA$event;
|
|
14661
|
-
ReactGA$
|
|
15228
|
+
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, {
|
|
14662
15229
|
category: "VIEWS",
|
|
14663
15230
|
action: "Product Modal Viewed",
|
|
14664
15231
|
nonInteraction: true
|
|
14665
15232
|
});
|
|
14666
15233
|
} else if (this.state.mode === "plan") {
|
|
14667
15234
|
var _ReactGA$event2;
|
|
14668
|
-
ReactGA$
|
|
15235
|
+
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, {
|
|
14669
15236
|
category: "VIEWS",
|
|
14670
15237
|
action: "Plan Modal Viewed",
|
|
14671
15238
|
nonInteraction: true
|
|
@@ -15100,14 +15667,14 @@ class DonationModal extends React.Component {
|
|
|
15100
15667
|
this.props;
|
|
15101
15668
|
if (this.state.mode === "product") {
|
|
15102
15669
|
var _ReactGA$event;
|
|
15103
|
-
|
|
15670
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
15104
15671
|
category: "VIEWS",
|
|
15105
15672
|
action: "Product Modal Viewed",
|
|
15106
15673
|
nonInteraction: true
|
|
15107
15674
|
});
|
|
15108
15675
|
} else if (this.state.mode === "plan") {
|
|
15109
15676
|
var _ReactGA$event2;
|
|
15110
|
-
|
|
15677
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA1.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA1, {
|
|
15111
15678
|
category: "VIEWS",
|
|
15112
15679
|
action: "Plan Modal Viewed",
|
|
15113
15680
|
nonInteraction: true
|
|
@@ -17427,19 +17994,25 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
17427
17994
|
|
|
17428
17995
|
/*====== Start Cybersource integration ========*/
|
|
17429
17996
|
const cybersourceErrorHandle = err => {
|
|
17430
|
-
var _err$details, _err$details$response;
|
|
17431
|
-
|
|
17997
|
+
var _err$details, _err$details$response, _err$details$response2;
|
|
17998
|
+
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) {
|
|
17999
|
+
var _err$details2, _err$details2$respons;
|
|
18000
|
+
const errorMessages = [];
|
|
17432
18001
|
|
|
17433
|
-
|
|
17434
|
-
|
|
17435
|
-
|
|
17436
|
-
|
|
17437
|
-
|
|
17438
|
-
|
|
17439
|
-
|
|
18002
|
+
// enumerable error (ex: validation errors)
|
|
18003
|
+
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 => {
|
|
18004
|
+
let {
|
|
18005
|
+
message
|
|
18006
|
+
} = _ref2;
|
|
18007
|
+
errorMessages.push(message);
|
|
18008
|
+
});
|
|
17440
18009
|
|
|
17441
|
-
|
|
17442
|
-
|
|
18010
|
+
// convert to multiline string
|
|
18011
|
+
return errorMessages.join("\n");
|
|
18012
|
+
} else {
|
|
18013
|
+
var _err$details3;
|
|
18014
|
+
return getErrorMessages(err === null || err === void 0 ? void 0 : (_err$details3 = err.details) === null || _err$details3 === void 0 ? void 0 : _err$details3.responseStatus);
|
|
18015
|
+
}
|
|
17443
18016
|
};
|
|
17444
18017
|
const submitUsingCybersource = (state, dispatch) => {
|
|
17445
18018
|
var _cybersourceInstanceR;
|
|
@@ -18887,7 +19460,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18887
19460
|
const sendRegisterRequest = (state, callback) => {
|
|
18888
19461
|
window.Pelcro.user.register({
|
|
18889
19462
|
email: state.email,
|
|
18890
|
-
password:
|
|
19463
|
+
password: generatePassword()
|
|
18891
19464
|
}, (err, res) => {
|
|
18892
19465
|
if (err) {
|
|
18893
19466
|
var _err$response, _err$response$data;
|
|
@@ -19621,12 +20194,12 @@ const CheckoutForm = () => {
|
|
|
19621
20194
|
className: "plc-w-6/12 plc-pr-4"
|
|
19622
20195
|
}, /*#__PURE__*/React__default['default'].createElement(MonthSelect, {
|
|
19623
20196
|
store: store$k,
|
|
19624
|
-
placeholder: "Exp Month"
|
|
20197
|
+
placeholder: "Exp Month *"
|
|
19625
20198
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19626
20199
|
className: "plc-w-6/12"
|
|
19627
20200
|
}, /*#__PURE__*/React__default['default'].createElement(YearSelect, {
|
|
19628
20201
|
store: store$k,
|
|
19629
|
-
placeholder: "Exp Year"
|
|
20202
|
+
placeholder: "Exp Year *"
|
|
19630
20203
|
}))));
|
|
19631
20204
|
}
|
|
19632
20205
|
if (cardProcessor === "stripe") {
|
|
@@ -19689,7 +20262,7 @@ const DiscountedPrice = props => {
|
|
|
19689
20262
|
};
|
|
19690
20263
|
|
|
19691
20264
|
const SubmitPaymentMethod = _ref => {
|
|
19692
|
-
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r;
|
|
20265
|
+
var _plan$quantity, _plan$quantity2, _plan$quantity3, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
19693
20266
|
let {
|
|
19694
20267
|
onClick,
|
|
19695
20268
|
...otherProps
|
|
@@ -19697,7 +20270,8 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19697
20270
|
const {
|
|
19698
20271
|
plan,
|
|
19699
20272
|
selectedDonationAmount,
|
|
19700
|
-
customDonationAmount
|
|
20273
|
+
customDonationAmount,
|
|
20274
|
+
selectedPaymentMethodId
|
|
19701
20275
|
} = usePelcro();
|
|
19702
20276
|
const {
|
|
19703
20277
|
t
|
|
@@ -19715,13 +20289,16 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19715
20289
|
phone,
|
|
19716
20290
|
disableSubmit,
|
|
19717
20291
|
isLoading,
|
|
19718
|
-
updatedPrice
|
|
20292
|
+
updatedPrice,
|
|
20293
|
+
month,
|
|
20294
|
+
year
|
|
19719
20295
|
}
|
|
19720
20296
|
} = React.useContext(store$k);
|
|
19721
20297
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
19722
20298
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
19723
20299
|
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());
|
|
19724
20300
|
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);
|
|
20301
|
+
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);
|
|
19725
20302
|
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
19726
20303
|
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
19727
20304
|
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
@@ -19730,9 +20307,9 @@ const SubmitPaymentMethod = _ref => {
|
|
|
19730
20307
|
if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
|
|
19731
20308
|
setDisabled(disableSubmit);
|
|
19732
20309
|
} else {
|
|
19733
|
-
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);
|
|
20310
|
+
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));
|
|
19734
20311
|
}
|
|
19735
|
-
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError]);
|
|
20312
|
+
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone, emailError, passwordError, month, year]);
|
|
19736
20313
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
19737
20314
|
role: "submit",
|
|
19738
20315
|
className: "plc-w-full plc-py-3",
|
|
@@ -20371,10 +20948,6 @@ const DonationEmail = props => /*#__PURE__*/React__default['default'].createElem
|
|
|
20371
20948
|
store: store$k
|
|
20372
20949
|
}, props));
|
|
20373
20950
|
|
|
20374
|
-
const DonationPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
|
|
20375
|
-
store: store$k
|
|
20376
|
-
}, props));
|
|
20377
|
-
|
|
20378
20951
|
/**
|
|
20379
20952
|
*
|
|
20380
20953
|
*/
|
|
@@ -20461,11 +21034,6 @@ function PaymentMethodView(_ref) {
|
|
|
20461
21034
|
label: t("labels.email"),
|
|
20462
21035
|
required: true,
|
|
20463
21036
|
autoFocus: true
|
|
20464
|
-
}), /*#__PURE__*/React__default['default'].createElement(DonationPassword, {
|
|
20465
|
-
id: "pelcro-input-password",
|
|
20466
|
-
errorId: "pelcro-input-password-error",
|
|
20467
|
-
label: t("labels.password"),
|
|
20468
|
-
required: true
|
|
20469
21037
|
})), /*#__PURE__*/React__default['default'].createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
20470
21038
|
className: "plc-mb-2"
|
|
20471
21039
|
}, /*#__PURE__*/React__default['default'].createElement(CouponCode, null), /*#__PURE__*/React__default['default'].createElement(DiscountedPrice, null)), /*#__PURE__*/React__default['default'].createElement(TaxAmount, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -20528,6 +21096,9 @@ const SubscriptionRenewView = _ref => {
|
|
|
20528
21096
|
}));
|
|
20529
21097
|
};
|
|
20530
21098
|
|
|
21099
|
+
var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
|
|
21100
|
+
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;
|
|
21101
|
+
|
|
20531
21102
|
/**
|
|
20532
21103
|
*
|
|
20533
21104
|
*/
|
|
@@ -20543,7 +21114,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20543
21114
|
const onSuccess = res => {
|
|
20544
21115
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
20545
21116
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
20546
|
-
ReactGA$
|
|
21117
|
+
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, {
|
|
20547
21118
|
category: "ACTIONS",
|
|
20548
21119
|
action: "Renewed",
|
|
20549
21120
|
nonInteraction: true
|
|
@@ -20553,7 +21124,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
20553
21124
|
const onGiftRenewalSuccess = () => {
|
|
20554
21125
|
var _otherProps$onGiftRen, _ReactGA$event2;
|
|
20555
21126
|
(_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
|
|
20556
|
-
ReactGA$
|
|
21127
|
+
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, {
|
|
20557
21128
|
category: "ACTIONS",
|
|
20558
21129
|
action: "Renewed Gift",
|
|
20559
21130
|
nonInteraction: true
|
|
@@ -20727,6 +21298,8 @@ function SvgSubscription(props) {
|
|
|
20727
21298
|
}))))));
|
|
20728
21299
|
}
|
|
20729
21300
|
|
|
21301
|
+
var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
|
|
21302
|
+
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;
|
|
20730
21303
|
const SubscriptionCancelNowButton = _ref => {
|
|
20731
21304
|
let {
|
|
20732
21305
|
subscription,
|
|
@@ -20758,7 +21331,7 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20758
21331
|
if (err) {
|
|
20759
21332
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20760
21333
|
}
|
|
20761
|
-
ReactGA$
|
|
21334
|
+
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, {
|
|
20762
21335
|
category: "ACTIONS",
|
|
20763
21336
|
action: "Canceled",
|
|
20764
21337
|
nonInteraction: true
|
|
@@ -20797,6 +21370,8 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
20797
21370
|
}, t("messages.cancelNow"));
|
|
20798
21371
|
};
|
|
20799
21372
|
|
|
21373
|
+
var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
|
|
21374
|
+
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;
|
|
20800
21375
|
const SubscriptionCancelLaterButton = _ref => {
|
|
20801
21376
|
let {
|
|
20802
21377
|
subscription,
|
|
@@ -20828,7 +21403,7 @@ const SubscriptionCancelLaterButton = _ref => {
|
|
|
20828
21403
|
if (err) {
|
|
20829
21404
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20830
21405
|
}
|
|
20831
|
-
ReactGA$
|
|
21406
|
+
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, {
|
|
20832
21407
|
category: "ACTIONS",
|
|
20833
21408
|
action: "Canceled",
|
|
20834
21409
|
nonInteraction: true
|
|
@@ -21037,6 +21612,8 @@ const SubscriptionSuspendDate = props => {
|
|
|
21037
21612
|
}, props));
|
|
21038
21613
|
};
|
|
21039
21614
|
|
|
21615
|
+
var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
|
|
21616
|
+
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;
|
|
21040
21617
|
const SubscriptionSuspendButton = _ref => {
|
|
21041
21618
|
let {
|
|
21042
21619
|
subscription,
|
|
@@ -21067,7 +21644,7 @@ const SubscriptionSuspendButton = _ref => {
|
|
|
21067
21644
|
if (err) {
|
|
21068
21645
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
21069
21646
|
}
|
|
21070
|
-
ReactGA$
|
|
21647
|
+
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, {
|
|
21071
21648
|
category: "ACTIONS",
|
|
21072
21649
|
action: "Suspended",
|
|
21073
21650
|
nonInteraction: true
|
|
@@ -23917,7 +24494,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23917
24494
|
});
|
|
23918
24495
|
onFailure(err);
|
|
23919
24496
|
} else {
|
|
23920
|
-
var _ReactGA
|
|
24497
|
+
var _ReactGA$event;
|
|
23921
24498
|
dispatch({
|
|
23922
24499
|
type: SHOW_ALERT,
|
|
23923
24500
|
payload: {
|
|
@@ -23926,7 +24503,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
23926
24503
|
}
|
|
23927
24504
|
});
|
|
23928
24505
|
onSuccess(res);
|
|
23929
|
-
|
|
24506
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
23930
24507
|
category: "ACTIONS",
|
|
23931
24508
|
action: "Updated address",
|
|
23932
24509
|
nonInteraction: true
|
|
@@ -24454,11 +25031,13 @@ function PaymentMethodUpdateView(props) {
|
|
|
24454
25031
|
}));
|
|
24455
25032
|
}
|
|
24456
25033
|
|
|
25034
|
+
var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
|
|
25035
|
+
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;
|
|
24457
25036
|
const PaymentMethodUpdateModal = props => {
|
|
24458
25037
|
const onSuccess = res => {
|
|
24459
25038
|
var _props$onSuccess, _ReactGA$event;
|
|
24460
25039
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
24461
|
-
ReactGA$
|
|
25040
|
+
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, {
|
|
24462
25041
|
category: "ACTIONS",
|
|
24463
25042
|
action: "Updated payment card",
|
|
24464
25043
|
nonInteraction: true
|
|
@@ -26374,6 +26953,7 @@ const GiftRedeemContainer = _ref => {
|
|
|
26374
26953
|
payload: false
|
|
26375
26954
|
});
|
|
26376
26955
|
if (err) {
|
|
26956
|
+
var _err$response, _err$response$data, _err$response$data$er;
|
|
26377
26957
|
dispatch({
|
|
26378
26958
|
type: SHOW_ALERT,
|
|
26379
26959
|
payload: {
|
|
@@ -26381,7 +26961,7 @@ const GiftRedeemContainer = _ref => {
|
|
|
26381
26961
|
content: getErrorMessages(err)
|
|
26382
26962
|
}
|
|
26383
26963
|
});
|
|
26384
|
-
if (
|
|
26964
|
+
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) {
|
|
26385
26965
|
switchToAddressView();
|
|
26386
26966
|
} else {
|
|
26387
26967
|
return onFailure(err);
|
|
@@ -28348,6 +28928,8 @@ const OrderItems = _ref => {
|
|
|
28348
28928
|
});
|
|
28349
28929
|
};
|
|
28350
28930
|
|
|
28931
|
+
var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1;
|
|
28932
|
+
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;
|
|
28351
28933
|
const SavedItemsMenu = () => {
|
|
28352
28934
|
const {
|
|
28353
28935
|
t
|
|
@@ -29369,6 +29951,8 @@ function getMemberShipStatus(status) {
|
|
|
29369
29951
|
};
|
|
29370
29952
|
}
|
|
29371
29953
|
|
|
29954
|
+
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
29955
|
+
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;
|
|
29372
29956
|
const SUB_MENUS = {
|
|
29373
29957
|
PROFILE: "profile",
|
|
29374
29958
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -29433,7 +30017,7 @@ class Dashboard extends React.Component {
|
|
|
29433
30017
|
window.Pelcro.insight.track("Modal Displayed", {
|
|
29434
30018
|
name: "dashboard"
|
|
29435
30019
|
});
|
|
29436
|
-
ReactGA
|
|
30020
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
29437
30021
|
category: "VIEWS",
|
|
29438
30022
|
action: "Dashboard Modal Viewed",
|
|
29439
30023
|
nonInteraction: true
|
|
@@ -29469,7 +30053,7 @@ class Dashboard extends React.Component {
|
|
|
29469
30053
|
if (err) {
|
|
29470
30054
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
29471
30055
|
}
|
|
29472
|
-
ReactGA
|
|
30056
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
29473
30057
|
category: "ACTIONS",
|
|
29474
30058
|
action: "Canceled",
|
|
29475
30059
|
nonInteraction: true
|
|
@@ -29487,7 +30071,7 @@ class Dashboard extends React.Component {
|
|
|
29487
30071
|
if (err) {
|
|
29488
30072
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
29489
30073
|
}
|
|
29490
|
-
ReactGA
|
|
30074
|
+
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event3 = ReactGA.event) === null || _ReactGA$event3 === void 0 ? void 0 : _ReactGA$event3.call(ReactGA, {
|
|
29491
30075
|
category: "ACTIONS",
|
|
29492
30076
|
action: "UnSuspended",
|
|
29493
30077
|
nonInteraction: true
|
|
@@ -29778,13 +30362,13 @@ class Dashboard extends React.Component {
|
|
|
29778
30362
|
this.menuRef = /*#__PURE__*/React__default['default'].createRef();
|
|
29779
30363
|
}
|
|
29780
30364
|
render() {
|
|
29781
|
-
var _window$Pelcro$user$r3, _window$
|
|
30365
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
29782
30366
|
const {
|
|
29783
30367
|
isOpen
|
|
29784
30368
|
} = this.state;
|
|
29785
30369
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
29786
30370
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
29787
|
-
const newsletters = (_window$
|
|
30371
|
+
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;
|
|
29788
30372
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
29789
30373
|
return /*#__PURE__*/React__default['default'].createElement(Transition, {
|
|
29790
30374
|
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",
|