ouisys-engine 3.0.22 → 3.0.24
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/.babelrc +9 -1
- package/dist/@types/window.d.js +1 -5
- package/dist/api/index.js +1 -760
- package/dist/common-types/AppThunk.js +1 -5
- package/dist/common-types/Either.js +1 -5
- package/dist/common-types/IError.js +1 -5
- package/dist/common-types/ITracker.js +1 -5
- package/dist/common-types/IVisitor.js +1 -5
- package/dist/common-types/RemoteDataState.js +1 -138
- package/dist/custom-hooks/useStrategyConfig.js +1 -24
- package/dist/flows/click2smsFlow.js +1 -23
- package/dist/flows/moFlow.js +1 -23
- package/dist/flows/moRedirFlow.js +1 -23
- package/dist/flows/oneClickFlow.js +1 -29
- package/dist/flows/pinFlow.js +1 -25
- package/dist/flows/strategy.js +1 -49
- package/dist/flows/ussdFlow.js +1 -22
- package/dist/index.js +0 -2
- package/dist/ips/tryGetIPRangeName.js +1 -111
- package/dist/pacman/index.js +1 -111
- package/dist/pacman/queryString.js +1 -50
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +1 -5
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +1 -5
- package/dist/reducers/click2smsFlow/index.js +1 -199
- package/dist/reducers/click2smsFlow/utils.js +1 -372
- package/dist/reducers/moFlow/IMoConstants.js +1 -5
- package/dist/reducers/moFlow/MoTypes.js +1 -5
- package/dist/reducers/moFlow/index.js +1 -257
- package/dist/reducers/moFlow/utils.js +1 -340
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +1 -5
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +1 -5
- package/dist/reducers/moRedirFlow/index.js +1 -243
- package/dist/reducers/moRedirFlow/utils.js +1 -240
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +1 -5
- package/dist/reducers/oneClickFlow/OneClickTypes.js +1 -5
- package/dist/reducers/oneClickFlow/index.js +1 -458
- package/dist/reducers/oneClickFlow/utils.js +1 -410
- package/dist/reducers/pinFlow/IPinConstants.js +1 -5
- package/dist/reducers/pinFlow/PinTypes.js +1 -5
- package/dist/reducers/pinFlow/index.js +1 -543
- package/dist/reducers/pinFlow/utils.js +1 -554
- package/dist/reducers/strategy/IStategyActionContants.js +1 -5
- package/dist/reducers/strategy/StrategyTypes.js +1 -5
- package/dist/reducers/strategy/index.js +1 -419
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +1 -581
- package/dist/reducers/strategy/strategies/ask_operator.js +1 -317
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +1 -1
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +1 -692
- package/dist/reducers/strategy/strategies/header_enrichment.js +1 -804
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +1 -118
- package/dist/reducers/strategy/utils.js +1 -710
- package/dist/reducers/ussdFlow/IUssdConstants.js +1 -5
- package/dist/reducers/ussdFlow/UssdTypes.js +1 -5
- package/dist/reducers/ussdFlow/index.js +1 -267
- package/dist/reducers/ussdFlow/utils.js +1 -247
- package/dist/store/index.js +1 -177
- package/dist/store/reducers.js +1 -38
- package/dist/utilities/handleSubmitNumber.js +1 -76
- package/dist/utilities/index.js +1 -68
- package/dist/utilities/loadScriptInnerHtml.js +1 -22
- package/dist/utilities/loadScriptSrc.js +1 -32
- package/package.json +3 -2
|
@@ -1,410 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol.description.js");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.symbol.iterator.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.iterator.js");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.string.iterator.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.array.slice.js");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.function.name.js");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.array.from.js");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.regexp.test.js");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/es.symbol.async-iterator.js");
|
|
26
|
-
|
|
27
|
-
require("core-js/modules/es.symbol.to-string-tag.js");
|
|
28
|
-
|
|
29
|
-
require("core-js/modules/es.json.to-string-tag.js");
|
|
30
|
-
|
|
31
|
-
require("core-js/modules/es.math.to-string-tag.js");
|
|
32
|
-
|
|
33
|
-
require("core-js/modules/es.object.get-prototype-of.js");
|
|
34
|
-
|
|
35
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
36
|
-
|
|
37
|
-
require("core-js/modules/es.object.set-prototype-of.js");
|
|
38
|
-
|
|
39
|
-
require("core-js/modules/es.weak-map.js");
|
|
40
|
-
|
|
41
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
42
|
-
|
|
43
|
-
Object.defineProperty(exports, "__esModule", {
|
|
44
|
-
value: true
|
|
45
|
-
});
|
|
46
|
-
exports.subscribe = exports.mockedSubscribeAjaxState = exports.mockedRedirectUrlSuccessState = exports.getRedirectUrlBupperWay = exports.getRedirectUrl = exports.additionalQueryString = void 0;
|
|
47
|
-
|
|
48
|
-
require("core-js/modules/es.object.to-string.js");
|
|
49
|
-
|
|
50
|
-
require("core-js/modules/es.promise.js");
|
|
51
|
-
|
|
52
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
53
|
-
|
|
54
|
-
require("core-js/modules/es.string.search.js");
|
|
55
|
-
|
|
56
|
-
require("core-js/modules/es.array.join.js");
|
|
57
|
-
|
|
58
|
-
require("core-js/modules/es.array.concat.js");
|
|
59
|
-
|
|
60
|
-
require("core-js/modules/es.array.map.js");
|
|
61
|
-
|
|
62
|
-
require("core-js/modules/es.object.keys.js");
|
|
63
|
-
|
|
64
|
-
require("core-js/modules/es.string.split.js");
|
|
65
|
-
|
|
66
|
-
var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
|
|
67
|
-
|
|
68
|
-
var _loadScriptInnerHtml = _interopRequireDefault(require("../../utilities/loadScriptInnerHtml"));
|
|
69
|
-
|
|
70
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
71
|
-
|
|
72
|
-
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); }
|
|
73
|
-
|
|
74
|
-
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; }
|
|
75
|
-
|
|
76
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
77
|
-
|
|
78
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
79
|
-
|
|
80
|
-
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."); }
|
|
81
|
-
|
|
82
|
-
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); }
|
|
83
|
-
|
|
84
|
-
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; }
|
|
85
|
-
|
|
86
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
87
|
-
|
|
88
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
89
|
-
|
|
90
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
91
|
-
|
|
92
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
93
|
-
|
|
94
|
-
var additionalQueryString = "msisdnSubmitted=Y&legalCheckbox=Y&incentivizedCheckbox=Y&op_confirmCheckbox=N";
|
|
95
|
-
exports.additionalQueryString = additionalQueryString;
|
|
96
|
-
|
|
97
|
-
var fetchJsonp = function fetchJsonp(_url) {
|
|
98
|
-
var url = _url;
|
|
99
|
-
var ouisys_callback_function = "ouisys_callback_function".concat(Math.floor(Math.random() * 10000));
|
|
100
|
-
return new Promise(function (resolve, reject) {
|
|
101
|
-
// @ts-ignore
|
|
102
|
-
window[ouisys_callback_function] = function (arg) {
|
|
103
|
-
resolve(arg);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
url += url.indexOf('?') === -1 ? '?' : '&';
|
|
107
|
-
url += "jsonp=".concat(ouisys_callback_function);
|
|
108
|
-
var script = document.createElement('script');
|
|
109
|
-
script.src = url;
|
|
110
|
-
script.id = ouisys_callback_function;
|
|
111
|
-
document.body.appendChild(script); // Caught if got 404/500
|
|
112
|
-
|
|
113
|
-
script.onerror = function () {
|
|
114
|
-
reject(new Error("JSONP request to ".concat(_url, " failed")));
|
|
115
|
-
};
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
var uniqidResult;
|
|
120
|
-
|
|
121
|
-
var getRedirectUrl = /*#__PURE__*/function () {
|
|
122
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(window, maybeConfig, extraParams) {
|
|
123
|
-
var host, country, slug, queryString, device, apiAction, customDomain, bupperizeCountry, offer, s, search, extraParamsQs, rockmanId, _url2, result, identifyError, _url3, _result, _identifyError, mcpShieldResult, mcpSessionCheckWithBlock, _url4, _result2, _identifyError2;
|
|
124
|
-
|
|
125
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
126
|
-
while (1) {
|
|
127
|
-
switch (_context.prev = _context.next) {
|
|
128
|
-
case 0:
|
|
129
|
-
if (!(typeof window === 'undefined')) {
|
|
130
|
-
_context.next = 4;
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
throw "javascript: console.error('SSR'); void 6";
|
|
135
|
-
|
|
136
|
-
case 4:
|
|
137
|
-
host = maybeConfig.host, country = maybeConfig.country, slug = maybeConfig.slug, queryString = maybeConfig.queryString, device = maybeConfig.device, apiAction = maybeConfig.apiAction;
|
|
138
|
-
customDomain = slug === 'evina-test-handle' ? 'dev.ng.eu.ngrok.io' : 'de-ads.tallymans.com';
|
|
139
|
-
|
|
140
|
-
bupperizeCountry = function bupperizeCountry(c) {
|
|
141
|
-
return c === 'gb' ? 'uk' : c;
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
offer = window.pac_analytics.visitor.offer;
|
|
145
|
-
s = window.location.search.substr(1);
|
|
146
|
-
search = (!!s && s.length > 0 ? [s] : []).concat((queryString || []).map(function (_ref2) {
|
|
147
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
148
|
-
k = _ref3[0],
|
|
149
|
-
v = _ref3[1];
|
|
150
|
-
|
|
151
|
-
return "".concat(k, "=").concat(v);
|
|
152
|
-
})).join('&');
|
|
153
|
-
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
154
|
-
return "".concat(k, "=").concat(extraParams[k]);
|
|
155
|
-
}).join('&'));
|
|
156
|
-
rockmanId = window.pac_analytics.visitor.rockmanId;
|
|
157
|
-
|
|
158
|
-
if (!(apiAction === 'identify-user')) {
|
|
159
|
-
_context.next = 26;
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
_url2 = "https://de.tallymans.com/tallyman/v1/?action=identify-user&country=".concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=", 'smart', "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
|
|
164
|
-
_context.next = 16;
|
|
165
|
-
return fetchJsonp(_url2);
|
|
166
|
-
|
|
167
|
-
case 16:
|
|
168
|
-
result = _context.sent;
|
|
169
|
-
|
|
170
|
-
if (!(result.success === false)) {
|
|
171
|
-
_context.next = 23;
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
identifyError = new Error("Error in getRedirectUrl() identify-user action:\n".concat(result.message));
|
|
176
|
-
identifyError.type = 'NotOn3g';
|
|
177
|
-
throw identifyError;
|
|
178
|
-
|
|
179
|
-
case 23:
|
|
180
|
-
return _context.abrupt("return", {
|
|
181
|
-
subscription_url: result.subscription_url || result.redirect_url,
|
|
182
|
-
action: function action() {
|
|
183
|
-
return subscribe(result.subscription_url);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
case 24:
|
|
188
|
-
_context.next = 63;
|
|
189
|
-
break;
|
|
190
|
-
|
|
191
|
-
case 26:
|
|
192
|
-
if (!(apiAction === 'he')) {
|
|
193
|
-
_context.next = 41;
|
|
194
|
-
break;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
_url3 = "https://de.tallymans.com/tallyman/v1/?action=he&country=".concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=", 'smart', "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
|
|
198
|
-
_context.next = 30;
|
|
199
|
-
return fetch(_url3).then(function (x) {
|
|
200
|
-
return x.json();
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
case 30:
|
|
204
|
-
_result = _context.sent;
|
|
205
|
-
|
|
206
|
-
if (!(_result.success === false)) {
|
|
207
|
-
_context.next = 37;
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
_identifyError = new Error("Error in getRedirectUrl() identify-user action:\n".concat(_result.message));
|
|
212
|
-
_identifyError.type = 'NotOn3g';
|
|
213
|
-
throw _identifyError;
|
|
214
|
-
|
|
215
|
-
case 37:
|
|
216
|
-
(0, _loadScriptInnerHtml.default)(_result.source);
|
|
217
|
-
return _context.abrupt("return", {
|
|
218
|
-
redirect_url: _result.redirectUrlWithReplacedUniqid
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
case 39:
|
|
222
|
-
_context.next = 63;
|
|
223
|
-
break;
|
|
224
|
-
|
|
225
|
-
case 41:
|
|
226
|
-
if (!(country.toLowerCase() === 'za' && slug !== 'evina-test-handle')) {
|
|
227
|
-
_context.next = 52;
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
_context.prev = 42;
|
|
232
|
-
_context.next = 45;
|
|
233
|
-
return window.tallymanApi.mcpShield(host, country, slug, device, offer, rockmanId);
|
|
234
|
-
|
|
235
|
-
case 45:
|
|
236
|
-
mcpShieldResult = _context.sent;
|
|
237
|
-
|
|
238
|
-
if (mcpShieldResult.success === false) {
|
|
239
|
-
console.warn(mcpShieldResult.message);
|
|
240
|
-
} else {
|
|
241
|
-
(0, _loadScriptInnerHtml.default)(mcpShieldResult.source);
|
|
242
|
-
uniqidResult = mcpShieldResult.uniqid;
|
|
243
|
-
mcpSessionCheckWithBlock = "\n \n document.addEventListener('click', function (event) {\n \n event.preventDefault();\n try{\n if (!event.target.matches('.mcp')) return;\n if (!window.isMcpSessionChecked) {\n \n var url = \"https://de-ads.tallymans.com/tallyman/v1/?action=mcp-session-check&slug=".concat(slug, "&country=").concat(country, "&device=").concat(device, "&rockman_id=").concat(rockmanId, "&mcpUniqid=").concat(uniqidResult, "\";\n \n fetch(url).then(function(res) {\n return res.json()\n }).then(function(resJson) {\n window.isMcpSessionChecked = true;\n console.log('MCP');\n \n if (resJson[\"should-block\"] === true) {\n document.body.innerHTML = \"\"\n \n var div = document.createElement(\"div\");\n div.setAttribute(\"id\", \"page_blocked\")\n div.style.width = \"100%\";\n div.style.height = \"100%\";\n div.style.background = \"#fff\";\n div.style.color = \"#000\";\n div.style.position = \"fixed\";\n div.style.display = \"flex\";\n div.style.justifyContent = \"center\";\n div.style.alignItems = \"center\";\n div.style.fontSize = \"40px\";\n div.style.top = \"0\";\n div.style.bottom = \"0\";\n div.style.left = \"0\";\n div.style.right = \"0\";\n div.innerHTML = \"Offer Expired\";\n document.body.appendChild(div);\n }else{\n const target = event.target || event.srcElement;\n\n while (target) {\n if (target instanceof HTMLAnchorElement) {\n console.log(target.getAttribute('href'));\n window.location.href = target.getAttribute('href')\n break;\n }\n \n target = target.parentNode;\n }\n }\n });\n }\n }catch(err){\n console.error(err);\n }\n },false)\n ");
|
|
244
|
-
(0, _loadScriptInnerHtml.default)(mcpSessionCheckWithBlock);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
_context.next = 52;
|
|
248
|
-
break;
|
|
249
|
-
|
|
250
|
-
case 49:
|
|
251
|
-
_context.prev = 49;
|
|
252
|
-
_context.t0 = _context["catch"](42);
|
|
253
|
-
console.warn(_context.t0);
|
|
254
|
-
|
|
255
|
-
case 52:
|
|
256
|
-
_url4 = "https://".concat(customDomain, "/tallyman/v1/?action=redirect&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=", 'smart', "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId).concat(extraParamsQs, "&").concat(search);
|
|
257
|
-
_context.next = 55;
|
|
258
|
-
return fetch(_url4).then(function (x) {
|
|
259
|
-
return x.json();
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
case 55:
|
|
263
|
-
_result2 = _context.sent;
|
|
264
|
-
|
|
265
|
-
if (!(_result2.success === false)) {
|
|
266
|
-
_context.next = 62;
|
|
267
|
-
break;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
_identifyError2 = new Error("Error in getRedirectUrl() identify-user action:\n".concat(_result2.message));
|
|
271
|
-
_identifyError2.type = 'NotOn3g';
|
|
272
|
-
throw _identifyError2;
|
|
273
|
-
|
|
274
|
-
case 62:
|
|
275
|
-
return _context.abrupt("return", {
|
|
276
|
-
redirect_url: _result2.redirect_url
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
case 63:
|
|
280
|
-
case "end":
|
|
281
|
-
return _context.stop();
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}, _callee, null, [[42, 49]]);
|
|
285
|
-
}));
|
|
286
|
-
|
|
287
|
-
return function getRedirectUrl(_x, _x2, _x3) {
|
|
288
|
-
return _ref.apply(this, arguments);
|
|
289
|
-
};
|
|
290
|
-
}();
|
|
291
|
-
|
|
292
|
-
exports.getRedirectUrl = getRedirectUrl;
|
|
293
|
-
|
|
294
|
-
var subscribe = /*#__PURE__*/function () {
|
|
295
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(url, extraParams) {
|
|
296
|
-
var evinaTid, extraParamsQs, isCleanTraffic, result, subscribeError;
|
|
297
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
298
|
-
while (1) {
|
|
299
|
-
switch (_context2.prev = _context2.next) {
|
|
300
|
-
case 0:
|
|
301
|
-
evinaTid = typeof window !== 'undefined' && window.tid ? window.tid : '';
|
|
302
|
-
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
303
|
-
return "".concat(k, "=").concat(extraParams[k]);
|
|
304
|
-
}).join('&'));
|
|
305
|
-
isCleanTraffic = typeof window !== 'undefined' && window.shouldBlock === true ? '&is-clean-traffic=false' : '&is-clean-traffic=true';
|
|
306
|
-
_context2.next = 5;
|
|
307
|
-
return fetch("".concat(url, "&sam_evina_tid=").concat(evinaTid).concat(isCleanTraffic).concat(extraParamsQs)).then(function (x) {
|
|
308
|
-
return x.json();
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
case 5:
|
|
312
|
-
result = _context2.sent;
|
|
313
|
-
|
|
314
|
-
if (!(result.success === false)) {
|
|
315
|
-
_context2.next = 13;
|
|
316
|
-
break;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
subscribeError = new Error("Error in subscribe() one-click-subscribe action:\n".concat(result.message));
|
|
320
|
-
subscribeError.type = result.message === 'ALREADY SUBSCRIBED' ? 'AlreadySubscribed' : 'SubscriptionError';
|
|
321
|
-
subscribeError.productUrl = result.product_url ? result.product_url : '';
|
|
322
|
-
throw subscribeError;
|
|
323
|
-
|
|
324
|
-
case 13:
|
|
325
|
-
return _context2.abrupt("return", result.product_url || result.redirect_url);
|
|
326
|
-
|
|
327
|
-
case 14:
|
|
328
|
-
case "end":
|
|
329
|
-
return _context2.stop();
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}, _callee2);
|
|
333
|
-
}));
|
|
334
|
-
|
|
335
|
-
return function subscribe(_x4, _x5) {
|
|
336
|
-
return _ref4.apply(this, arguments);
|
|
337
|
-
};
|
|
338
|
-
}();
|
|
339
|
-
|
|
340
|
-
exports.subscribe = subscribe;
|
|
341
|
-
|
|
342
|
-
var getRedirectUrlBupperWay = /*#__PURE__*/function () {
|
|
343
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(window, maybeConfig, extraParams) {
|
|
344
|
-
var host, country, slug, queryString, bupperizeCountry, offer, s, search, extraParamsQs, xcid;
|
|
345
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
346
|
-
while (1) {
|
|
347
|
-
switch (_context3.prev = _context3.next) {
|
|
348
|
-
case 0:
|
|
349
|
-
if (!(typeof window === 'undefined')) {
|
|
350
|
-
_context3.next = 2;
|
|
351
|
-
break;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return _context3.abrupt("return", "javascript: console.error('SSR'); void 6");
|
|
355
|
-
|
|
356
|
-
case 2:
|
|
357
|
-
host = maybeConfig.host, country = maybeConfig.country, slug = maybeConfig.slug, queryString = maybeConfig.queryString;
|
|
358
|
-
|
|
359
|
-
bupperizeCountry = function bupperizeCountry(c) {
|
|
360
|
-
return c === 'gb' ? 'uk' : c;
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
offer = window.pac_analytics.visitor.offer;
|
|
364
|
-
s = window.location.search.substr(1);
|
|
365
|
-
search = (!!s && s.length > 0 ? [s] : []).concat((queryString || []).map(function (_ref6) {
|
|
366
|
-
var _ref7 = _slicedToArray(_ref6, 2),
|
|
367
|
-
k = _ref7[0],
|
|
368
|
-
v = _ref7[1];
|
|
369
|
-
|
|
370
|
-
return "".concat(k, "=").concat(v);
|
|
371
|
-
})).join('&');
|
|
372
|
-
extraParamsQs = !extraParams ? '' : "&".concat(Object.keys(extraParams).map(function (k) {
|
|
373
|
-
return "".concat(k, "=").concat(extraParams[k]);
|
|
374
|
-
}).join('&')); // one click flow must use http not https
|
|
375
|
-
|
|
376
|
-
xcid = window.location.href.split('/')[3].split('?')[0];
|
|
377
|
-
return _context3.abrupt("return", "http://".concat(host, "/").concat(bupperizeCountry(country), "/").concat(slug, "?offer=").concat(offer, "&atmobirun=1&rockman_id=").concat(window.pac_analytics.visitor.rockmanId, "&redirPixels=").concat(window.location.host, "&x-xcid=").concat(xcid).concat(extraParamsQs).concat(search));
|
|
378
|
-
|
|
379
|
-
case 10:
|
|
380
|
-
case "end":
|
|
381
|
-
return _context3.stop();
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}, _callee3);
|
|
385
|
-
}));
|
|
386
|
-
|
|
387
|
-
return function getRedirectUrlBupperWay(_x6, _x7, _x8) {
|
|
388
|
-
return _ref5.apply(this, arguments);
|
|
389
|
-
};
|
|
390
|
-
}();
|
|
391
|
-
|
|
392
|
-
exports.getRedirectUrlBupperWay = getRedirectUrlBupperWay;
|
|
393
|
-
var mockedRedirectUrlSuccessState = {
|
|
394
|
-
currentState: {
|
|
395
|
-
type: 'GET_REDIRECT_URL',
|
|
396
|
-
// @ts-ignore
|
|
397
|
-
result: RDS.Success({
|
|
398
|
-
redirectUrl: 'https://google.com'
|
|
399
|
-
})
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
exports.mockedRedirectUrlSuccessState = mockedRedirectUrlSuccessState;
|
|
403
|
-
var mockedSubscribeAjaxState = {
|
|
404
|
-
currentState: {
|
|
405
|
-
type: 'SUBCRIBE_AJAX',
|
|
406
|
-
// @ts-ignore
|
|
407
|
-
result: RDS.NothingYet()
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
exports.mockedSubscribeAjaxState = mockedSubscribeAjaxState;
|
|
1
|
+
"use strict";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)}require("core-js/modules/es.symbol.js"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.iterator.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.regexp.test.js"),require("core-js/modules/es.symbol.async-iterator.js"),require("core-js/modules/es.symbol.to-string-tag.js"),require("core-js/modules/es.json.to-string-tag.js"),require("core-js/modules/es.math.to-string-tag.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.weak-map.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribe=exports.mockedSubscribeAjaxState=exports.mockedRedirectUrlSuccessState=exports.getRedirectUrlBupperWay=exports.getRedirectUrl=exports.additionalQueryString=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.string.split.js");var RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_loadScriptInnerHtml=_interopRequireDefault(require("../../utilities/loadScriptInnerHtml"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _regeneratorRuntime(){"use strict";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return generator._invoke=function(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}(innerFn,self,context),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},function(error){return invoke("throw",error,resolve,reject)})}reject(record.arg)}var previousPromise;this._invoke=function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(delegate,context){var method=delegate.iterator[context.method];if(void 0===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method))return ContinueSentinel;context.method="throw",context.arg=new TypeError("The iterator does not provide a 'throw' method")}return ContinueSentinel}var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(Gp,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name))},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun},exports.awrap=function(arg){return{__await:arg}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next()})},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this}),define(Gp,"toString",function(){return"[object Generator]"}),exports.keys=function(object){var keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next}return next.done=!0,next}},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval},dispatchException:function dispatchException(exception){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(!hasCatch){if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record)},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel},finish:function finish(finallyLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}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.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!(i&&_arr.length===i));_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i["return"]||_i["return"]()}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}var additionalQueryString="msisdnSubmitted=Y&legalCheckbox=Y&incentivizedCheckbox=Y&op_confirmCheckbox=N";exports.additionalQueryString=additionalQueryString;var uniqidResult,fetchJsonp=function(_url){var url=_url,ouisys_callback_function="ouisys_callback_function".concat(Math.floor(1e4*Math.random()));return new Promise(function(resolve,reject){window[ouisys_callback_function]=function(arg){resolve(arg)},url+=-1===url.indexOf("?")?"?":"&",url+="jsonp=".concat(ouisys_callback_function);var script=document.createElement("script");script.src=url,script.id=ouisys_callback_function,document.body.appendChild(script),script.onerror=function(){reject(new Error("JSONP request to ".concat(_url," failed")))}})},getRedirectUrl=function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(window,maybeConfig,extraParams){var host,country,slug,queryString,device,apiAction,customDomain,bupperizeCountry,offer,s,search,extraParamsQs,rockmanId,_url2,result,identifyError,_url3,_result,_identifyError,mcpShieldResult,mcpSessionCheckWithBlock,_url4,_result2,_identifyError2;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if("undefined"!=typeof window){_context.next=4;break}throw"javascript: console.error('SSR'); void 6";case 4:if(host=maybeConfig.host,country=maybeConfig.country,slug=maybeConfig.slug,queryString=maybeConfig.queryString,device=maybeConfig.device,apiAction=maybeConfig.apiAction,customDomain="evina-test-handle"===slug?"dev.ng.eu.ngrok.io":"de-ads.tallymans.com",bupperizeCountry=function bupperizeCountry(c){return"gb"===c?"uk":c},offer=window.pac_analytics.visitor.offer,s=window.location.search.substr(1),search=(!!s&&0<s.length?[s]:[]).concat((queryString||[]).map(function(_ref2){var _ref3=_slicedToArray(_ref2,2),k=_ref3[0],v=_ref3[1];return"".concat(k,"=").concat(v)})).join("&"),extraParamsQs=extraParams?"&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")):"",rockmanId=window.pac_analytics.visitor.rockmanId,"identify-user"!==apiAction){_context.next=26;break}return _url2="https://de.tallymans.com/tallyman/v1/?action=identify-user&country=".concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=","smart","&offerId=").concat(offer,"&rockman_id=").concat(rockmanId).concat(extraParamsQs,"&").concat(search),_context.next=16,fetchJsonp(_url2);case 16:if(result=_context.sent,!1!==result.success){_context.next=23;break}throw identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat(result.message)),identifyError.type="NotOn3g",identifyError;case 23:return _context.abrupt("return",{subscription_url:result.subscription_url||result.redirect_url,action:function action(){return subscribe(result.subscription_url)}});case 24:_context.next=63;break;case 26:if("he"!==apiAction){_context.next=41;break}return _url3="https://de.tallymans.com/tallyman/v1/?action=he&country=".concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=","smart","&offerId=").concat(offer,"&rockman_id=").concat(rockmanId).concat(extraParamsQs,"&").concat(search),_context.next=30,fetch(_url3).then(function(x){return x.json()});case 30:if(_result=_context.sent,!1!==_result.success){_context.next=37;break}throw _identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat(_result.message)),_identifyError.type="NotOn3g",_identifyError;case 37:return(0,_loadScriptInnerHtml.default)(_result.source),_context.abrupt("return",{redirect_url:_result.redirectUrlWithReplacedUniqid});case 39:_context.next=63;break;case 41:if("za"!==country.toLowerCase()||"evina-test-handle"===slug){_context.next=52;break}return _context.prev=42,_context.next=45,window.tallymanApi.mcpShield(host,country,slug,device,offer,rockmanId);case 45:mcpShieldResult=_context.sent,!1===mcpShieldResult.success?console.warn(mcpShieldResult.message):((0,_loadScriptInnerHtml.default)(mcpShieldResult.source),uniqidResult=mcpShieldResult.uniqid,mcpSessionCheckWithBlock="\n \n document.addEventListener('click', function (event) {\n \n event.preventDefault();\n try{\n if (!event.target.matches('.mcp')) return;\n if (!window.isMcpSessionChecked) {\n \n var url = \"https://de-ads.tallymans.com/tallyman/v1/?action=mcp-session-check&slug=".concat(slug,"&country=").concat(country,"&device=").concat(device,"&rockman_id=").concat(rockmanId,"&mcpUniqid=").concat(uniqidResult,"\";\n \n fetch(url).then(function(res) {\n return res.json()\n }).then(function(resJson) {\n window.isMcpSessionChecked = true;\n console.log('MCP');\n \n if (resJson[\"should-block\"] === true) {\n document.body.innerHTML = \"\"\n \n var div = document.createElement(\"div\");\n div.setAttribute(\"id\", \"page_blocked\")\n div.style.width = \"100%\";\n div.style.height = \"100%\";\n div.style.background = \"#fff\";\n div.style.color = \"#000\";\n div.style.position = \"fixed\";\n div.style.display = \"flex\";\n div.style.justifyContent = \"center\";\n div.style.alignItems = \"center\";\n div.style.fontSize = \"40px\";\n div.style.top = \"0\";\n div.style.bottom = \"0\";\n div.style.left = \"0\";\n div.style.right = \"0\";\n div.innerHTML = \"Offer Expired\";\n document.body.appendChild(div);\n }else{\n const target = event.target || event.srcElement;\n\n while (target) {\n if (target instanceof HTMLAnchorElement) {\n console.log(target.getAttribute('href'));\n window.location.href = target.getAttribute('href')\n break;\n }\n \n target = target.parentNode;\n }\n }\n });\n }\n }catch(err){\n console.error(err);\n }\n },false)\n "),(0,_loadScriptInnerHtml.default)(mcpSessionCheckWithBlock)),_context.next=52;break;case 49:_context.prev=49,_context.t0=_context["catch"](42),console.warn(_context.t0);case 52:return _url4="https://".concat(customDomain,"/tallyman/v1/?action=redirect&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=","smart","&offerId=").concat(offer,"&rockman_id=").concat(rockmanId).concat(extraParamsQs,"&").concat(search),_context.next=55,fetch(_url4).then(function(x){return x.json()});case 55:if(_result2=_context.sent,!1!==_result2.success){_context.next=62;break}throw _identifyError2=new Error("Error in getRedirectUrl() identify-user action:\n".concat(_result2.message)),_identifyError2.type="NotOn3g",_identifyError2;case 62:return _context.abrupt("return",{redirect_url:_result2.redirect_url});case 63:case"end":return _context.stop();}},_callee,null,[[42,49]])}));return function getRedirectUrl(_x,_x2,_x3){return _ref.apply(this,arguments)}}();exports.getRedirectUrl=getRedirectUrl;var subscribe=function(){var _ref4=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(url,extraParams){var evinaTid,extraParamsQs,isCleanTraffic,result,subscribeError;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:return evinaTid="undefined"!=typeof window&&window.tid?window.tid:"",extraParamsQs=extraParams?"&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")):"",isCleanTraffic="undefined"!=typeof window&&!0===window.shouldBlock?"&is-clean-traffic=false":"&is-clean-traffic=true",_context2.next=5,fetch("".concat(url,"&sam_evina_tid=").concat(evinaTid).concat(isCleanTraffic).concat(extraParamsQs)).then(function(x){return x.json()});case 5:if(result=_context2.sent,!1!==result.success){_context2.next=13;break}throw subscribeError=new Error("Error in subscribe() one-click-subscribe action:\n".concat(result.message)),subscribeError.type="ALREADY SUBSCRIBED"===result.message?"AlreadySubscribed":"SubscriptionError",subscribeError.productUrl=result.product_url?result.product_url:"",subscribeError;case 13:return _context2.abrupt("return",result.product_url||result.redirect_url);case 14:case"end":return _context2.stop();}},_callee2)}));return function subscribe(_x4,_x5){return _ref4.apply(this,arguments)}}();exports.subscribe=subscribe;var getRedirectUrlBupperWay=function(){var _ref5=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(window,maybeConfig,extraParams){var host,country,slug,queryString,bupperizeCountry,offer,s,search,extraParamsQs,xcid;return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:if("undefined"!=typeof window){_context3.next=2;break}return _context3.abrupt("return","javascript: console.error('SSR'); void 6");case 2:return host=maybeConfig.host,country=maybeConfig.country,slug=maybeConfig.slug,queryString=maybeConfig.queryString,bupperizeCountry=function bupperizeCountry(c){return"gb"===c?"uk":c},offer=window.pac_analytics.visitor.offer,s=window.location.search.substr(1),search=(!!s&&0<s.length?[s]:[]).concat((queryString||[]).map(function(_ref6){var _ref7=_slicedToArray(_ref6,2),k=_ref7[0],v=_ref7[1];return"".concat(k,"=").concat(v)})).join("&"),extraParamsQs=extraParams?"&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")):"",xcid=window.location.href.split("/")[3].split("?")[0],_context3.abrupt("return","http://".concat(host,"/").concat(bupperizeCountry(country),"/").concat(slug,"?offer=").concat(offer,"&atmobirun=1&rockman_id=").concat(window.pac_analytics.visitor.rockmanId,"&redirPixels=").concat(window.location.host,"&x-xcid=").concat(xcid).concat(extraParamsQs).concat(search));case 10:case"end":return _context3.stop();}},_callee3)}));return function getRedirectUrlBupperWay(_x6,_x7,_x8){return _ref5.apply(this,arguments)}}();exports.getRedirectUrlBupperWay=getRedirectUrlBupperWay;var mockedRedirectUrlSuccessState={currentState:{type:"GET_REDIRECT_URL",result:RDS.Success({redirectUrl:"https://google.com"})}};exports.mockedRedirectUrlSuccessState=mockedRedirectUrlSuccessState;var mockedSubscribeAjaxState={currentState:{type:"SUBCRIBE_AJAX",result:RDS.NothingYet()}};exports.mockedSubscribeAjaxState=mockedSubscribeAjaxState;
|