ouisys-engine 3.0.33 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import { IFetchResult } from '../reducers/click2smsFlow/Click2smsTypes';
2
+ import { IUserDetails, IUserDetailsSubmissionResult } from '../reducers/creditCardFlow/CreditCardTypes';
2
3
  import { IGoogleReCaptcha, IMSISDNSubmissionResult as IMoMSISDNSubmissionResult } from '../reducers/moFlow/MoTypes';
3
4
  import { IMSISDNSubmissionResult as IMoRedirMSISDNSubmissionResult } from '../reducers/moRedirFlow/MoRedirTypes';
4
5
  import { ICheckSubscriptionResult, IMcpShieldResult, IMSISDNSubmissionResult, IPINSubmissionResult } from '../reducers/pinFlow/PinTypes';
@@ -20,6 +21,7 @@ export interface ITallyman {
20
21
  mcpShield: (host: string, country: string, slug: string, device: string, offer: number, rockmanId: string, operator?: string, uniqid?: string) => Promise<IMcpShieldResult>;
21
22
  getGoogleCaptcha: (host: string, country: string, slug: string, device: string, domain: string) => Promise<IGoogleReCaptcha>;
22
23
  storeEmail: (host: string, slug: string, rockmanId: string, email: string, service: string) => Promise<IStoreEmailResult>;
24
+ creditCardPayment: (host: string, slug: string, device: string, offer: number, rockmanId: string, userDetails: IUserDetails) => Promise<IUserDetailsSubmissionResult>;
23
25
  }
24
26
  export declare const MockTallyman: ITallyman;
25
27
  export declare const RealTallyman: ITallyman;
package/dist/api/index.js CHANGED
@@ -1 +1 @@
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.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.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.RealTallyman=exports.MockTallyman=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.concat.js");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 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 bupperizeCountry=function(c){return"gb"===c?"uk":c},logMockTallyman=function(mock){return console.log(mock)},checkIsCleanTraffic=function(country){return"be"===country?"undefined"!=typeof window&&!0===window.shouldBlock?"&is-clean-traffic=false":"&is-clean-traffic=true":""};function sleep(milliseconds){var date=Date.now(),currentDate=null;do currentDate=Date.now();while(currentDate-date<milliseconds)}var MockTallyman={identify:function(){function identify(){return _identify.apply(this,arguments)}var _identify=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context.abrupt("return",{operator:"",flow:"",success:!0,rockman_id:""});case 3:case"end":return _context.stop();}},_callee)}));return identify}(),triggerPin:function(){function triggerPin(_x8,_x9,_x10,_x11,_x12,_x13,_x14,_x15,_x16,_x17,_x18){return _triggerPin.apply(this,arguments)}var _triggerPin=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(_host,_country,_slug,_device,_offer,_msisdn,_rockmanId,_extraParamsQs,_search,_uniqid,_evinaTid){return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context2.abrupt("return",{success:!0,operator:"",rockman_id:"",pin:"",product_url:""});case 3:case"end":return _context2.stop();}},_callee2)}));return triggerPin}(),verifyPin:function(){function verifyPin(_x19,_x20,_x21,_x22,_x23,_x24,_x25,_x26,_x27){return _verifyPin.apply(this,arguments)}var _verifyPin=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(_host,_country,_slug,_device,_offer,_rockmanId,_pin,_extraParamsQs,_uniqid){return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context3.abrupt("return",{success:!0,rockman_id:"000",product_url:"https://google.com",async:!1});case 3:case"end":return _context3.stop();}},_callee3)}));return verifyPin}(),checkSubscription:function(){function checkSubscription(_x28,_x29,_x30,_x31,_x32,_x33,_x34,_x35){return _checkSubscription.apply(this,arguments)}var _checkSubscription=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(_host,_country,_slug,_device,_offer,_rockmanId,_pin,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context4.abrupt("return",{success:!0,rockman_id:"000",product_url:"https://google.com",msisdn:"000"});case 3:case"end":return _context4.stop();}},_callee4)}));return checkSubscription}(),checkSubscriptionByRockmanIdOnly:function(){function checkSubscriptionByRockmanIdOnly(_x36,_x37){return _checkSubscriptionByRockmanIdOnly.apply(this,arguments)}var _checkSubscriptionByRockmanIdOnly=_asyncToGenerator(_regeneratorRuntime().mark(function _callee5(_host,_rockmanId){return _regeneratorRuntime().wrap(function _callee5$(_context5){for(;1;)switch(_context5.prev=_context5.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context5.abrupt("return",{success:!0,rockman_id:"000",product_url:"https://google.com",msisdn:"000"});case 3:case"end":return _context5.stop();}},_callee5)}));return checkSubscriptionByRockmanIdOnly}(),redirect:function(){function redirect(_x38,_x39,_x40,_x41,_x42,_x43,_x44,_x45,_x46,_x47){return _redirect.apply(this,arguments)}var _redirect=_asyncToGenerator(_regeneratorRuntime().mark(function _callee6(_host,_slug,_country,_msisdn,_device,_offer,_rockmanId,_ip_range_name,_search,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee6$(_context6){for(;1;)switch(_context6.prev=_context6.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context6.abrupt("return",{success:!0,rockman_id:"000",redirect_url:"https://google.com"});case 3:case"end":return _context6.stop();}},_callee6)}));return redirect}(),triggerMessage:function(){function triggerMessage(_x48,_x49,_x50,_x51,_x52,_x53,_x54,_x55,_x56){return _triggerMessage.apply(this,arguments)}var _triggerMessage=_asyncToGenerator(_regeneratorRuntime().mark(function _callee7(_host,_slug,_country,_msisdn,_device,_offer,_rockmanId,_search,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee7$(_context7){for(;1;)switch(_context7.prev=_context7.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context7.abrupt("return",{success:!0,rockman_id:"0000",keyword:"TEST OK",shortcode:"777"});case 3:case"end":return _context7.stop();}},_callee7)}));return triggerMessage}(),ussd:function(){function ussd(_x57,_x58,_x59,_x60,_x61,_x62,_x63,_x64,_x65){return _ussd.apply(this,arguments)}var _ussd=_asyncToGenerator(_regeneratorRuntime().mark(function _callee8(_host,_slug,_country,_msisdn,_device,_offer,_rockmanId,_search,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee8$(_context8){for(;1;)switch(_context8.prev=_context8.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context8.abrupt("return",{success:!0,rockman_id:"0000",keyword:"TEST OK",shortcode:"777"});case 3:case"end":return _context8.stop();}},_callee8)}));return ussd}(),oc2sms:function(){function oc2sms(_x66,_x67,_x68,_x69,_x70,_x71,_x72,_x73){return _oc2sms.apply(this,arguments)}var _oc2sms=_asyncToGenerator(_regeneratorRuntime().mark(function _callee9(_host,_country,_slug,_offer,_rockmanId,_keyword,_operator,_search){return _regeneratorRuntime().wrap(function _callee9$(_context9){for(;1;)switch(_context9.prev=_context9.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context9.abrupt("return",{success:!0,uid:"1",keyword:"TEST OK",displayKeyword:"TEST OK",shortcode:"777"});case 3:case"end":return _context9.stop();}},_callee9)}));return oc2sms}(),mcpShield:function(){function mcpShield(_x74,_x75,_x76,_x77,_x78,_x79,_x80){return _mcpShield.apply(this,arguments)}var _mcpShield=_asyncToGenerator(_regeneratorRuntime().mark(function _callee10(_host,_country,_slug,_device,_offer,_rockmanId,_operator){return _regeneratorRuntime().wrap(function _callee10$(_context10){for(;1;)switch(_context10.prev=_context10.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context10.abrupt("return",{source:"**********some very long text**********",uniqid:"a26e7c3983a9cebd469601d695c7dbc4",success:!0,rockman_id:"d66ac1a3ee6d40c289c23322ecd9aa79"});case 3:case"end":return _context10.stop();}},_callee10)}));return mcpShield}(),getGoogleCaptcha:function(){function getGoogleCaptcha(_x81,_x82,_x83,_x84,_x85){return _getGoogleCaptcha.apply(this,arguments)}var _getGoogleCaptcha=_asyncToGenerator(_regeneratorRuntime().mark(function _callee11(_host,_country,_slug,_device,_domain){return _regeneratorRuntime().wrap(function _callee11$(_context11){for(;1;)switch(_context11.prev=_context11.next){case 0:return _context11.abrupt("return",{site_key:"6LfMTS8fAAAAAHw-cibJXMfnsIYNpWh81GatD1lw",secret_key:"6LfMTS8fAAAAAIAET7tvHjrU-tRPGuqSdfCZZX6G",domains:"n.gamiclub.com",success:!0});case 1:case"end":return _context11.stop();}},_callee11)}));return getGoogleCaptcha}(),storeEmail:function(){function storeEmail(_x86,_x87,_x88,_x89,_x90){return _storeEmail.apply(this,arguments)}var _storeEmail=_asyncToGenerator(_regeneratorRuntime().mark(function _callee12(_host,_slug,_service,_rockmanId,_email){return _regeneratorRuntime().wrap(function _callee12$(_context12){for(;1;)switch(_context12.prev=_context12.next){case 0:return _context12.abrupt("return",{success:!0});case 1:case"end":return _context12.stop();}},_callee12)}));return storeEmail}()};exports.MockTallyman=MockTallyman;var RealTallyman={identify:function(){function identify(_x91,_x92,_x93,_x94,_x95,_x96,_x97){return _identify2.apply(this,arguments)}var _identify2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee13(host,slug,country,msisdn,device,offer,rockmanId){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee13$(_context13){for(;1;)switch(_context13.prev=_context13.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context13.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=identify&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId)).then(function(x){return x.json()}));case 3:case"end":return _context13.stop();}},_callee13)}));return identify}(),triggerPin:function(){function triggerPin(_x98,_x99,_x100,_x101,_x102,_x103,_x104,_x105,_x106,_x107){return _triggerPin2.apply(this,arguments)}var _triggerPin2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee14(host,country,slug,device,offer,msisdn,rockmanId,extraParamsQs,search,uniqid){var isDMB,newHost,isCleanTraffic;return _regeneratorRuntime().wrap(function _callee14$(_context14){for(;1;)switch(_context14.prev=_context14.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,isCleanTraffic=checkIsCleanTraffic(country),_context14.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=trigger-pin&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&msisdn=").concat(msisdn,"&rockman_id=").concat(rockmanId).concat(uniqid).concat(isCleanTraffic).concat(extraParamsQs,"&").concat(search)).then(function(x){return x.json()}));case 4:case"end":return _context14.stop();}},_callee14)}));return triggerPin}(),verifyPin:function(){function verifyPin(_x108,_x109,_x110,_x111,_x112,_x113,_x114,_x115,_x116,_x117){return _verifyPin2.apply(this,arguments)}var _verifyPin2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee15(host,country,slug,device,offer,rockmanId,pin,extraParamsQs,uniqid,evinaTid){var isDMB,newHost,isCleanTraffic;return _regeneratorRuntime().wrap(function _callee15$(_context15){for(;1;)switch(_context15.prev=_context15.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,isCleanTraffic=checkIsCleanTraffic(country),_context15.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=verify-pin&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&pin=").concat(pin).concat(uniqid,"&sam_evina_tid=").concat(evinaTid).concat(isCleanTraffic).concat(extraParamsQs)).then(function(x){return x.json()}));case 4:case"end":return _context15.stop();}},_callee15)}));return verifyPin}(),checkSubscription:function(){function checkSubscription(_x118,_x119,_x120,_x121,_x122,_x123,_x124,_x125){return _checkSubscription2.apply(this,arguments)}var _checkSubscription2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee16(host,country,slug,device,offer,rockmanId,_pin,_extraParamsQs){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee16$(_context16){for(;1;)switch(_context16.prev=_context16.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context16.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=check-subscription&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId)).then(function(x){return x.json()}));case 3:case"end":return _context16.stop();}},_callee16)}));return checkSubscription}(),checkSubscriptionByRockmanIdOnly:function(){function checkSubscriptionByRockmanIdOnly(_x126,_x127){return _checkSubscriptionByRockmanIdOnly2.apply(this,arguments)}var _checkSubscriptionByRockmanIdOnly2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee17(host,rockmanId){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee17$(_context17){for(;1;)switch(_context17.prev=_context17.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context17.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=check-subscription&rockman_id=").concat(rockmanId)).then(function(x){return x.json()}));case 3:case"end":return _context17.stop();}},_callee17)}));return checkSubscriptionByRockmanIdOnly}(),redirect:function(){function redirect(_x128,_x129,_x130,_x131,_x132,_x133,_x134,_x135,_x136,_x137){return _redirect2.apply(this,arguments)}var _redirect2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee18(host,slug,country,msisdn,device,offer,rockmanId,ip_range_name,search,extraParamsQs){var isDMB,newHost,evinaTi;return _regeneratorRuntime().wrap(function _callee18$(_context18){for(;1;)switch(_context18.prev=_context18.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,evinaTi="a2"===country.toLowerCase()?"&evinaTi=".concat(rockmanId):"",_context18.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=redirect&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&network_type=").concat(ip_range_name?"":"wifi","&").concat(search).concat(evinaTi).concat(extraParamsQs)).then(function(x){return x.json()}));case 4:case"end":return _context18.stop();}},_callee18)}));return redirect}(),triggerMessage:function(){function triggerMessage(_x138,_x139,_x140,_x141,_x142,_x143,_x144,_x145,_x146){return _triggerMessage2.apply(this,arguments)}var _triggerMessage2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee19(host,slug,country,msisdn,device,offer,rockmanId,search,extraParamsQs){var isDMB,newHost,samGtoken;return _regeneratorRuntime().wrap(function _callee19$(_context19){for(;1;)switch(_context19.prev=_context19.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,samGtoken=window.reCaptchaToken?"sam-g-token=".concat(window.reCaptchaToken):"",_context19.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=trigger-message&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&").concat(samGtoken).concat(search).concat(extraParamsQs)).then(function(x){return x.json()}));case 4:case"end":return _context19.stop();}},_callee19)}));return triggerMessage}(),ussd:function(){function ussd(_x147,_x148,_x149,_x150,_x151,_x152,_x153,_x154,_x155){return _ussd2.apply(this,arguments)}var _ussd2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee20(host,slug,country,msisdn,device,offer,rockmanId,search,extraParamsQs){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee20$(_context20){for(;1;)switch(_context20.prev=_context20.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context20.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=ussd&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&").concat(search).concat(extraParamsQs)).then(function(x){return x.json()}));case 3:case"end":return _context20.stop();}},_callee20)}));return ussd}(),oc2sms:function(){function oc2sms(_x156,_x157,_x158,_x159,_x160,_x161,_x162,_x163){return _oc2sms2.apply(this,arguments)}var _oc2sms2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee21(host,country,slug,offer,rockmanId,keyword,operator,search){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee21$(_context21){for(;1;)switch(_context21.prev=_context21.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context21.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=oc2sms&country=").concat(country,"&slug=").concat(slug,"&offerId=").concat(offer).concat(keyword?"&keyword=".concat(keyword):"","&device=smart&rockman_id=").concat(rockmanId).concat(operator?"&operator=".concat(operator):"","&").concat(search)).then(function(x){return x.json()}));case 3:case"end":return _context21.stop();}},_callee21)}));return oc2sms}(),mcpShield:function(){function mcpShield(_x164,_x165,_x166,_x167,_x168,_x169,_x170,_x171){return _mcpShield2.apply(this,arguments)}var _mcpShield2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee22(host,country,slug,device,offer,rockmanId,operator,uniqid){var isDMB,newHost,pageUrl,ipAdd,userIp;return _regeneratorRuntime().wrap(function _callee22$(_context22){for(;1;)switch(_context22.prev=_context22.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,pageUrl=window.location.href,ipAdd=window.pac_analytics.visitor.ip,userIp=ipAdd?"&client_ip=".concat(ipAdd):"",_context22.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=mcp-shield&country=").concat(country,"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&operator=").concat(operator||"","&rockman_id=").concat(rockmanId,"&client_lpu=").concat(pageUrl).concat(userIp).concat(uniqid||"")).then(function(x){return x.json()}));case 6:case"end":return _context22.stop();}},_callee22)}));return mcpShield}(),getGoogleCaptcha:function(){function getGoogleCaptcha(_x172,_x173,_x174,_x175,_x176){return _getGoogleCaptcha2.apply(this,arguments)}var _getGoogleCaptcha2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee23(host,country,slug,device,domain){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee23$(_context23){for(;1;)switch(_context23.prev=_context23.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context23.abrupt("return",fetch("https://".concat(newHost,"/tallyman/helper/?action=google-captcha-v3-config&country=").concat(country,"&slug=").concat(slug,"&device=").concat(device,"&domain=").concat(domain)).then(function(x){return x.json()}));case 3:case"end":return _context23.stop();}},_callee23)}));return getGoogleCaptcha}(),storeEmail:function(){function storeEmail(_x177,_x178,_x179,_x180,_x181){return _storeEmail2.apply(this,arguments)}var _storeEmail2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee24(host,slug,service,rockmanId,email){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee24$(_context24){for(;1;)switch(_context24.prev=_context24.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context24.abrupt("return",fetch("https://".concat(newHost,"/tallyman/helper/?action=store-email&slug=").concat(slug,"&rockman_id=").concat(rockmanId,"&email=").concat(email,"&product_identifier=").concat(service)).then(function(x){return x.json()}));case 3:case"end":return _context24.stop();}},_callee24)}));return storeEmail}()};exports.RealTallyman=RealTallyman;
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.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.array.slice.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.RealTallyman=exports.MockTallyman=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.function.name.js");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 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 bupperizeCountry=function(c){return"gb"===c?"uk":c},logMockTallyman=function(mock){return console.log(mock)},checkIsCleanTraffic=function(country){return"be"===country?"undefined"!=typeof window&&!0===window.shouldBlock?"&is-clean-traffic=false":"&is-clean-traffic=true":""};function sleep(milliseconds){var date=Date.now(),currentDate=null;do currentDate=Date.now();while(currentDate-date<milliseconds)}var MockTallyman={identify:function(){function identify(){return _identify.apply(this,arguments)}var _identify=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(){return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context.abrupt("return",{operator:"",flow:"",success:!0,rockman_id:""});case 3:case"end":return _context.stop();}},_callee)}));return identify}(),triggerPin:function(){function triggerPin(_x8,_x9,_x10,_x11,_x12,_x13,_x14,_x15,_x16,_x17,_x18){return _triggerPin.apply(this,arguments)}var _triggerPin=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(_host,_country,_slug,_device,_offer,_msisdn,_rockmanId,_extraParamsQs,_search,_uniqid,_evinaTid){return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context2.abrupt("return",{success:!0,operator:"",rockman_id:"",pin:"",product_url:""});case 3:case"end":return _context2.stop();}},_callee2)}));return triggerPin}(),verifyPin:function(){function verifyPin(_x19,_x20,_x21,_x22,_x23,_x24,_x25,_x26,_x27){return _verifyPin.apply(this,arguments)}var _verifyPin=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(_host,_country,_slug,_device,_offer,_rockmanId,_pin,_extraParamsQs,_uniqid){return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context3.abrupt("return",{success:!0,rockman_id:"000",product_url:"https://google.com",async:!1});case 3:case"end":return _context3.stop();}},_callee3)}));return verifyPin}(),checkSubscription:function(){function checkSubscription(_x28,_x29,_x30,_x31,_x32,_x33,_x34,_x35){return _checkSubscription.apply(this,arguments)}var _checkSubscription=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(_host,_country,_slug,_device,_offer,_rockmanId,_pin,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context4.abrupt("return",{success:!0,rockman_id:"000",product_url:"https://google.com",msisdn:"000"});case 3:case"end":return _context4.stop();}},_callee4)}));return checkSubscription}(),checkSubscriptionByRockmanIdOnly:function(){function checkSubscriptionByRockmanIdOnly(_x36,_x37){return _checkSubscriptionByRockmanIdOnly.apply(this,arguments)}var _checkSubscriptionByRockmanIdOnly=_asyncToGenerator(_regeneratorRuntime().mark(function _callee5(_host,_rockmanId){return _regeneratorRuntime().wrap(function _callee5$(_context5){for(;1;)switch(_context5.prev=_context5.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context5.abrupt("return",{success:!0,rockman_id:"000",product_url:"https://google.com",msisdn:"000"});case 3:case"end":return _context5.stop();}},_callee5)}));return checkSubscriptionByRockmanIdOnly}(),redirect:function(){function redirect(_x38,_x39,_x40,_x41,_x42,_x43,_x44,_x45,_x46,_x47){return _redirect.apply(this,arguments)}var _redirect=_asyncToGenerator(_regeneratorRuntime().mark(function _callee6(_host,_slug,_country,_msisdn,_device,_offer,_rockmanId,_ip_range_name,_search,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee6$(_context6){for(;1;)switch(_context6.prev=_context6.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context6.abrupt("return",{success:!0,rockman_id:"000",redirect_url:"https://google.com"});case 3:case"end":return _context6.stop();}},_callee6)}));return redirect}(),triggerMessage:function(){function triggerMessage(_x48,_x49,_x50,_x51,_x52,_x53,_x54,_x55,_x56){return _triggerMessage.apply(this,arguments)}var _triggerMessage=_asyncToGenerator(_regeneratorRuntime().mark(function _callee7(_host,_slug,_country,_msisdn,_device,_offer,_rockmanId,_search,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee7$(_context7){for(;1;)switch(_context7.prev=_context7.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context7.abrupt("return",{success:!0,rockman_id:"0000",keyword:"TEST OK",shortcode:"777"});case 3:case"end":return _context7.stop();}},_callee7)}));return triggerMessage}(),ussd:function(){function ussd(_x57,_x58,_x59,_x60,_x61,_x62,_x63,_x64,_x65){return _ussd.apply(this,arguments)}var _ussd=_asyncToGenerator(_regeneratorRuntime().mark(function _callee8(_host,_slug,_country,_msisdn,_device,_offer,_rockmanId,_search,_extraParamsQs){return _regeneratorRuntime().wrap(function _callee8$(_context8){for(;1;)switch(_context8.prev=_context8.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context8.abrupt("return",{success:!0,rockman_id:"0000",keyword:"TEST OK",shortcode:"777"});case 3:case"end":return _context8.stop();}},_callee8)}));return ussd}(),oc2sms:function(){function oc2sms(_x66,_x67,_x68,_x69,_x70,_x71,_x72,_x73){return _oc2sms.apply(this,arguments)}var _oc2sms=_asyncToGenerator(_regeneratorRuntime().mark(function _callee9(_host,_country,_slug,_offer,_rockmanId,_keyword,_operator,_search){return _regeneratorRuntime().wrap(function _callee9$(_context9){for(;1;)switch(_context9.prev=_context9.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context9.abrupt("return",{success:!0,uid:"1",keyword:"TEST OK",displayKeyword:"TEST OK",shortcode:"777"});case 3:case"end":return _context9.stop();}},_callee9)}));return oc2sms}(),mcpShield:function(){function mcpShield(_x74,_x75,_x76,_x77,_x78,_x79,_x80){return _mcpShield.apply(this,arguments)}var _mcpShield=_asyncToGenerator(_regeneratorRuntime().mark(function _callee10(_host,_country,_slug,_device,_offer,_rockmanId,_operator){return _regeneratorRuntime().wrap(function _callee10$(_context10){for(;1;)switch(_context10.prev=_context10.next){case 0:return logMockTallyman("MockTallyman"),sleep(2e3),_context10.abrupt("return",{source:"**********some very long text**********",uniqid:"a26e7c3983a9cebd469601d695c7dbc4",success:!0,rockman_id:"d66ac1a3ee6d40c289c23322ecd9aa79"});case 3:case"end":return _context10.stop();}},_callee10)}));return mcpShield}(),getGoogleCaptcha:function(){function getGoogleCaptcha(_x81,_x82,_x83,_x84,_x85){return _getGoogleCaptcha.apply(this,arguments)}var _getGoogleCaptcha=_asyncToGenerator(_regeneratorRuntime().mark(function _callee11(_host,_country,_slug,_device,_domain){return _regeneratorRuntime().wrap(function _callee11$(_context11){for(;1;)switch(_context11.prev=_context11.next){case 0:return _context11.abrupt("return",{site_key:"6LfMTS8fAAAAAHw-cibJXMfnsIYNpWh81GatD1lw",secret_key:"6LfMTS8fAAAAAIAET7tvHjrU-tRPGuqSdfCZZX6G",domains:"n.gamiclub.com",success:!0});case 1:case"end":return _context11.stop();}},_callee11)}));return getGoogleCaptcha}(),storeEmail:function(){function storeEmail(_x86,_x87,_x88,_x89,_x90){return _storeEmail.apply(this,arguments)}var _storeEmail=_asyncToGenerator(_regeneratorRuntime().mark(function _callee12(_host,_slug,_service,_rockmanId,_email){return _regeneratorRuntime().wrap(function _callee12$(_context12){for(;1;)switch(_context12.prev=_context12.next){case 0:return _context12.abrupt("return",{success:!0});case 1:case"end":return _context12.stop();}},_callee12)}));return storeEmail}(),creditCardPayment:function creditCardPayment(_host,_slug,_device,_offer,_rockmanId,_userDetails){return{GatewayUrl:"https://google.com",success:!0}}};exports.MockTallyman=MockTallyman;var RealTallyman={identify:function(){function identify(_x91,_x92,_x93,_x94,_x95,_x96,_x97){return _identify2.apply(this,arguments)}var _identify2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee13(host,slug,country,msisdn,device,offer,rockmanId){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee13$(_context13){for(;1;)switch(_context13.prev=_context13.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context13.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=identify&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId)).then(function(x){return x.json()}));case 3:case"end":return _context13.stop();}},_callee13)}));return identify}(),triggerPin:function(){function triggerPin(_x98,_x99,_x100,_x101,_x102,_x103,_x104,_x105,_x106,_x107){return _triggerPin2.apply(this,arguments)}var _triggerPin2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee14(host,country,slug,device,offer,msisdn,rockmanId,extraParamsQs,search,uniqid){var isDMB,newHost,isCleanTraffic;return _regeneratorRuntime().wrap(function _callee14$(_context14){for(;1;)switch(_context14.prev=_context14.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,isCleanTraffic=checkIsCleanTraffic(country),_context14.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=trigger-pin&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&msisdn=").concat(msisdn,"&rockman_id=").concat(rockmanId).concat(uniqid).concat(isCleanTraffic).concat(extraParamsQs,"&").concat(search)).then(function(x){return x.json()}));case 4:case"end":return _context14.stop();}},_callee14)}));return triggerPin}(),verifyPin:function(){function verifyPin(_x108,_x109,_x110,_x111,_x112,_x113,_x114,_x115,_x116,_x117){return _verifyPin2.apply(this,arguments)}var _verifyPin2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee15(host,country,slug,device,offer,rockmanId,pin,extraParamsQs,uniqid,evinaTid){var isDMB,newHost,isCleanTraffic;return _regeneratorRuntime().wrap(function _callee15$(_context15){for(;1;)switch(_context15.prev=_context15.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,isCleanTraffic=checkIsCleanTraffic(country),_context15.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=verify-pin&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&pin=").concat(pin).concat(uniqid,"&sam_evina_tid=").concat(evinaTid).concat(isCleanTraffic).concat(extraParamsQs)).then(function(x){return x.json()}));case 4:case"end":return _context15.stop();}},_callee15)}));return verifyPin}(),checkSubscription:function(){function checkSubscription(_x118,_x119,_x120,_x121,_x122,_x123,_x124,_x125){return _checkSubscription2.apply(this,arguments)}var _checkSubscription2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee16(host,country,slug,device,offer,rockmanId,_pin,_extraParamsQs){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee16$(_context16){for(;1;)switch(_context16.prev=_context16.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context16.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=check-subscription&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId)).then(function(x){return x.json()}));case 3:case"end":return _context16.stop();}},_callee16)}));return checkSubscription}(),checkSubscriptionByRockmanIdOnly:function(){function checkSubscriptionByRockmanIdOnly(_x126,_x127){return _checkSubscriptionByRockmanIdOnly2.apply(this,arguments)}var _checkSubscriptionByRockmanIdOnly2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee17(host,rockmanId){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee17$(_context17){for(;1;)switch(_context17.prev=_context17.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context17.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=check-subscription&rockman_id=").concat(rockmanId)).then(function(x){return x.json()}));case 3:case"end":return _context17.stop();}},_callee17)}));return checkSubscriptionByRockmanIdOnly}(),redirect:function(){function redirect(_x128,_x129,_x130,_x131,_x132,_x133,_x134,_x135,_x136,_x137){return _redirect2.apply(this,arguments)}var _redirect2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee18(host,slug,country,msisdn,device,offer,rockmanId,ip_range_name,search,extraParamsQs){var isDMB,newHost,evinaTi;return _regeneratorRuntime().wrap(function _callee18$(_context18){for(;1;)switch(_context18.prev=_context18.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,evinaTi="a2"===country.toLowerCase()?"&evinaTi=".concat(rockmanId):"",_context18.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=redirect&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&network_type=").concat(ip_range_name?"":"wifi","&").concat(search).concat(evinaTi).concat(extraParamsQs)).then(function(x){return x.json()}));case 4:case"end":return _context18.stop();}},_callee18)}));return redirect}(),triggerMessage:function(){function triggerMessage(_x138,_x139,_x140,_x141,_x142,_x143,_x144,_x145,_x146){return _triggerMessage2.apply(this,arguments)}var _triggerMessage2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee19(host,slug,country,msisdn,device,offer,rockmanId,search,extraParamsQs){var isDMB,newHost,samGtoken;return _regeneratorRuntime().wrap(function _callee19$(_context19){for(;1;)switch(_context19.prev=_context19.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,samGtoken=window.reCaptchaToken?"sam-g-token=".concat(window.reCaptchaToken):"",_context19.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=trigger-message&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&").concat(samGtoken).concat(search).concat(extraParamsQs)).then(function(x){return x.json()}));case 4:case"end":return _context19.stop();}},_callee19)}));return triggerMessage}(),ussd:function(){function ussd(_x147,_x148,_x149,_x150,_x151,_x152,_x153,_x154,_x155){return _ussd2.apply(this,arguments)}var _ussd2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee20(host,slug,country,msisdn,device,offer,rockmanId,search,extraParamsQs){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee20$(_context20){for(;1;)switch(_context20.prev=_context20.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context20.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=ussd&slug=").concat(slug,"&country=").concat(country,"&msisdn=").concat(msisdn,"&device=").concat(device,"&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&").concat(search).concat(extraParamsQs)).then(function(x){return x.json()}));case 3:case"end":return _context20.stop();}},_callee20)}));return ussd}(),oc2sms:function(){function oc2sms(_x156,_x157,_x158,_x159,_x160,_x161,_x162,_x163){return _oc2sms2.apply(this,arguments)}var _oc2sms2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee21(host,country,slug,offer,rockmanId,keyword,operator,search){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee21$(_context21){for(;1;)switch(_context21.prev=_context21.next){case 0:return isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context21.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=oc2sms&country=").concat(country,"&slug=").concat(slug,"&offerId=").concat(offer).concat(keyword?"&keyword=".concat(keyword):"","&device=smart&rockman_id=").concat(rockmanId).concat(operator?"&operator=".concat(operator):"","&").concat(search)).then(function(x){return x.json()}));case 3:case"end":return _context21.stop();}},_callee21)}));return oc2sms}(),mcpShield:function(){function mcpShield(_x164,_x165,_x166,_x167,_x168,_x169,_x170,_x171){return _mcpShield2.apply(this,arguments)}var _mcpShield2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee22(host,country,slug,device,offer,rockmanId,operator,uniqid){var isDMB,newHost,pageUrl,ipAdd,userIp;return _regeneratorRuntime().wrap(function _callee22$(_context22){for(;1;)switch(_context22.prev=_context22.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,pageUrl=window.location.href,ipAdd=window.pac_analytics.visitor.ip,userIp=ipAdd?"&client_ip=".concat(ipAdd):"",_context22.abrupt("return",fetch("https://".concat(newHost,"/tallyman/v1/?action=mcp-shield&country=").concat(country,"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&operator=").concat(operator||"","&rockman_id=").concat(rockmanId,"&client_lpu=").concat(pageUrl).concat(userIp).concat(uniqid||"")).then(function(x){return x.json()}));case 6:case"end":return _context22.stop();}},_callee22)}));return mcpShield}(),getGoogleCaptcha:function(){function getGoogleCaptcha(_x172,_x173,_x174,_x175,_x176){return _getGoogleCaptcha2.apply(this,arguments)}var _getGoogleCaptcha2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee23(host,country,slug,device,domain){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee23$(_context23){for(;1;)switch(_context23.prev=_context23.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context23.abrupt("return",fetch("https://".concat(newHost,"/tallyman/helper/?action=google-captcha-v3-config&country=").concat(country,"&slug=").concat(slug,"&device=").concat(device,"&domain=").concat(domain)).then(function(x){return x.json()}));case 3:case"end":return _context23.stop();}},_callee23)}));return getGoogleCaptcha}(),storeEmail:function(){function storeEmail(_x177,_x178,_x179,_x180,_x181){return _storeEmail2.apply(this,arguments)}var _storeEmail2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee24(host,slug,service,rockmanId,email){var isDMB,newHost;return _regeneratorRuntime().wrap(function _callee24$(_context24){for(;1;)switch(_context24.prev=_context24.next){case 0:return isDMB=null!=window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,_context24.abrupt("return",fetch("https://".concat(newHost,"/tallyman/helper/?action=store-email&slug=").concat(slug,"&rockman_id=").concat(rockmanId,"&email=").concat(email,"&product_identifier=").concat(service)).then(function(x){return x.json()}));case 3:case"end":return _context24.stop();}},_callee24)}));return storeEmail}(),creditCardPayment:function creditCardPayment(host,slug,device,offer,rockmanId,userDetails){var name=userDetails.name,email=userDetails.email,address=userDetails.address,postcode=userDetails.postcode,city=userDetails.city,country=userDetails.country,isDMB=!(null==window.pac_analytics.visitor.xaid||-1===(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host;return fetch("https://".concat(newHost,"/tallyman/helper/?action=credit-card-payment&slug=").concat(slug,"&rockman_id=").concat(rockmanId,"&device=").concat(device,"&offerId=").concat(offer,"&name=").concat(name,"&email=").concat(email,"&addr=").concat(address,"&postcode=").concat(postcode,"&city=").concat(city,"&country=").concat(country)).then(function(x){return x.json()})}};exports.RealTallyman=RealTallyman;
@@ -1,6 +1,7 @@
1
1
  import { Action } from 'redux';
2
2
  import { ThunkAction } from 'redux-thunk';
3
3
  import IClick2smsConstants from '../reducers/click2smsFlow/IClick2smsConstants';
4
+ import ICreditCardConstants from '../reducers/creditCardFlow/ICreditCardConstants';
4
5
  import IMoConstants from '../reducers/moFlow/IMoConstants';
5
6
  import IMoRedirConstants from '../reducers/moRedirFlow/IMoRedirConstants';
6
7
  import IOneClickConstants from '../reducers/oneClickFlow/IOneClickConstants';
@@ -8,5 +9,5 @@ import IPinConstants from '../reducers/pinFlow/IPinConstants';
8
9
  import IStategyActionContants from '../reducers/strategy/IStategyActionContants';
9
10
  import IUssdConstants from '../reducers/ussdFlow/IUssdConstants';
10
11
  import { IApplicationState } from '../store/reducers';
11
- export declare type IAllActionConstants = IStategyActionContants | IPinConstants | IMoConstants | IMoRedirConstants | IOneClickConstants | IClick2smsConstants | IUssdConstants;
12
+ export declare type IAllActionConstants = IStategyActionContants | IPinConstants | IMoConstants | IMoRedirConstants | IOneClickConstants | IClick2smsConstants | IUssdConstants | ICreditCardConstants;
12
13
  export declare type AppThunk<ReturnType = void> = ThunkAction<ReturnType, IApplicationState, unknown, Action<IAllActionConstants>>;
@@ -0,0 +1,6 @@
1
+ import * as RDS from '../common-types/RemoteDataState';
2
+ import { ICreditCardFlowCurrentState, SubmitUserDetailsFailure, SubmitUserDetailsSuccess } from '../reducers/creditCardFlow/CreditCardTypes';
3
+ declare function creditCardFlowMatch<R>({ userDetailsEntry }: {
4
+ userDetailsEntry: (rds: RDS.RemoteDataState<SubmitUserDetailsFailure, SubmitUserDetailsSuccess>) => R;
5
+ }): (state: ICreditCardFlowCurrentState) => R;
6
+ export default creditCardFlowMatch;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function creditCardFlowMatch(_ref){var userDetailsEntry=_ref.userDetailsEntry;return function(state){switch(state.type){case"USER_DETAILS_ENTRY":return userDetailsEntry(state.result);}}}var _default=creditCardFlowMatch;exports.default=_default;
@@ -1,13 +1,14 @@
1
1
  import * as RDS from '../common-types/RemoteDataState';
2
2
  import { IdentifyFlowOptionsResult, IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess, IIdenyifyFlowByMsisdnSumbitNextData, IStrategyCurrentState, OPERATORSelectFlowIdentifySuccess } from '../reducers/strategy/StrategyTypes';
3
- declare function strategy<R>({ identifyFlowByOperatorSelect, identifyFlowByMsisdn, pinFlow, moFlow, moRedirFlow, oneClickFlow, click2smsFlow, ussdFlow }: {
3
+ declare function strategy<R>({ identifyFlowByOperatorSelect, identifyFlowByMsisdn, pinFlow, moFlow, moRedirFlow, oneClickFlow, click2smsFlow, ussdFlow, creditCardFlow }: {
4
4
  identifyFlowByOperatorSelect: (data: OPERATORSelectFlowIdentifySuccess) => R;
5
5
  identifyFlowByMsisdn: (rds: RDS.RemoteDataState<IDENTIFYMSISDNEntryFailure, IDENTIFYMSISDNEntrySuccess>, nextData: IIdenyifyFlowByMsisdnSumbitNextData) => R;
6
- pinFlow: (data: IdentifyFlowOptionsResult<'submitMSISDNAction'>) => R;
7
- moFlow: (data: IdentifyFlowOptionsResult<'submitMSISDNAction'>) => R;
8
- moRedirFlow: (data: IdentifyFlowOptionsResult<'submitMSISDNAction'>) => R;
9
- oneClickFlow: (data: IdentifyFlowOptionsResult<'getRedirectUrlAction'>) => R;
10
- click2smsFlow: (data: IdentifyFlowOptionsResult<'loadOc2sms'>) => R;
11
- ussdFlow: (data: IdentifyFlowOptionsResult<'submitMSISDNAction'>) => R;
6
+ pinFlow: (data: IdentifyFlowOptionsResult) => R;
7
+ moFlow: (data: IdentifyFlowOptionsResult) => R;
8
+ moRedirFlow: (data: IdentifyFlowOptionsResult) => R;
9
+ oneClickFlow: (data: IdentifyFlowOptionsResult) => R;
10
+ click2smsFlow: (data: IdentifyFlowOptionsResult) => R;
11
+ ussdFlow: (data: IdentifyFlowOptionsResult) => R;
12
+ creditCardFlow: (data: IdentifyFlowOptionsResult) => R;
12
13
  }): (state: IStrategyCurrentState) => R;
13
14
  export default strategy;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function strategy(_ref){var identifyFlowByOperatorSelect=_ref.identifyFlowByOperatorSelect,identifyFlowByMsisdn=_ref.identifyFlowByMsisdn,pinFlow=_ref.pinFlow,moFlow=_ref.moFlow,moRedirFlow=_ref.moRedirFlow,oneClickFlow=_ref.oneClickFlow,click2smsFlow=_ref.click2smsFlow,ussdFlow=_ref.ussdFlow;return function(state){switch(state.type){case"IDENTIFY_FLOW_BY_OPERATOR_SELECT":return identifyFlowByOperatorSelect(state.result);case"IDENTIFY_FLOW_BY_MSISDN":return identifyFlowByMsisdn(state.result,state.nextData);case"PIN":return pinFlow(state.result);case"MO":return moFlow(state.result);case"MO_REDIR":return moRedirFlow(state.result);case"ONE_CLICK":return oneClickFlow(state.result);case"CLICK2SMS":return click2smsFlow(state.result);case"USSD":return ussdFlow(state.result);}}}var _default=strategy;exports.default=_default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;function strategy(_ref){var identifyFlowByOperatorSelect=_ref.identifyFlowByOperatorSelect,identifyFlowByMsisdn=_ref.identifyFlowByMsisdn,pinFlow=_ref.pinFlow,moFlow=_ref.moFlow,moRedirFlow=_ref.moRedirFlow,oneClickFlow=_ref.oneClickFlow,click2smsFlow=_ref.click2smsFlow,ussdFlow=_ref.ussdFlow,creditCardFlow=_ref.creditCardFlow;return function(state){switch(state.type){case"IDENTIFY_FLOW_BY_OPERATOR_SELECT":return identifyFlowByOperatorSelect(state.result);case"IDENTIFY_FLOW_BY_MSISDN":return identifyFlowByMsisdn(state.result,state.nextData);case"PIN":return pinFlow(state.result);case"MO":return moFlow(state.result);case"MO_REDIR":return moRedirFlow(state.result);case"ONE_CLICK":return oneClickFlow(state.result);case"CLICK2SMS":return click2smsFlow(state.result);case"USSD":return ussdFlow(state.result);case"CREDIT_CARD":return creditCardFlow(state.result);}}}var _default=strategy;exports.default=_default;
@@ -0,0 +1,44 @@
1
+ import * as RDS from '../../common-types/RemoteDataState';
2
+ export interface IUserDetails {
3
+ name: string;
4
+ email: string;
5
+ address: string;
6
+ postcode: string;
7
+ city: string;
8
+ country: string;
9
+ }
10
+ export declare type ICreditCardFlowCurrentState = {
11
+ type: 'USER_DETAILS_ENTRY';
12
+ result: RDS.RemoteDataState<SubmitUserDetailsFailure, SubmitUserDetailsSuccess>;
13
+ };
14
+ export declare type SubmitUserDetailsErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN' | 'UnexpectedState';
15
+ export declare type SubmitUserDetailsFailure = {
16
+ errorType: SubmitUserDetailsErrorTypes;
17
+ error: any;
18
+ productUrl?: string;
19
+ };
20
+ export declare type SubmitUserDetailsSuccess = {
21
+ gatewayUrl: string;
22
+ };
23
+ export declare type IUserDetailsSubmissionResult = {
24
+ GatewayUrl: string;
25
+ success: true;
26
+ } | {
27
+ success: false;
28
+ message: string;
29
+ };
30
+ export declare type IUserDetailsSubmitActionPayload = {
31
+ type: 'USER_DETAILS_ENTRY';
32
+ result: RDS.RemoteDataState<SubmitUserDetailsFailure, SubmitUserDetailsSuccess>;
33
+ };
34
+ export interface ICreditCardFlowReducerState {
35
+ currentState: ICreditCardFlowCurrentState;
36
+ }
37
+ export declare type ICreditCardActions = {
38
+ type: 'CREDIT_CARD_USER_DETAILS_SUBMIT';
39
+ payload: IUserDetailsSubmitActionPayload;
40
+ } | {
41
+ type: 'MOCK_CREDIT_CARD_USER_DETAILS_FLOW_STATE';
42
+ payload: ICreditCardFlowCurrentState;
43
+ };
44
+ export declare type IMockCreditCardFlowStates = 'user-details-entry-success-state' | 'user-details-entry-failure-state';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,2 @@
1
+ declare type ICreditCardConstants = 'CREDIT_CARD_USER_DETAILS_SUBMIT' | 'CREDIT_CARD_USER_DETAILS_SUBMIT_ERROR' | 'CREDIT_CARD_USER_DETAILS_BACK_TO_START' | 'MOCK_CREDIT_CARD_USER_DETAILS_FLOW_STATE';
2
+ export default ICreditCardConstants;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -0,0 +1,5 @@
1
+ import { AppThunk } from '../../common-types/AppThunk';
2
+ import { ICreditCardActions, ICreditCardFlowReducerState, IMockCreditCardFlowStates, IUserDetails } from './CreditCardTypes';
3
+ export declare function mockCreditCardFlow(mockState: IMockCreditCardFlowStates): AppThunk;
4
+ export declare function submitUserDetailsAction(userDetails: IUserDetails): AppThunk;
5
+ export default function CreditCardFlowReducer(state: ICreditCardFlowReducerState, action: ICreditCardActions): ICreditCardFlowReducerState;
@@ -0,0 +1 @@
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.object.keys.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.object.get-own-property-descriptors.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.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/es.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=CreditCardFlowReducer,exports.mockCreditCardFlow=mockCreditCardFlow,exports.submitUserDetailsAction=submitUserDetailsAction,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_strategy=require("../strategy"),_utils=require("./utils");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 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}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)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}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}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)})}}function mockCreditCardFlow(mockState){return function(dispatch){if(mockState!==void 0)switch(mockState){case"user-details-entry-failure-state":return dispatch({type:"MOCK_CREDIT_CARD_USER_DETAILS_FLOW_STATE",payload:_utils.mockedUserDetailsEntryFailure.currentState});case"user-details-entry-success-state":return dispatch({type:"MOCK_CREDIT_CARD_USER_DETAILS_FLOW_STATE",payload:_utils.mockedUserDetailsEntrySuccess.currentState});default:throw"Mock Flow not supported";}}}function submitUserDetailsAction(userDetails){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch,store){var currentState,config,gatewayUrl,errorType;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(currentState=store().strategy.currentState,"CREDIT_CARD"!==currentState.type){_context.next=21;break}return config=currentState.result.config,_context.prev=3,dispatch({type:"CREDIT_CARD_USER_DETAILS_SUBMIT",payload:{type:"USER_DETAILS_ENTRY",result:RDS.Loading()}}),_strategy.tracker.advancedInFlow("tallyman.v1-credit-card","user-details-submitted",userDetails),_context.next=8,(0,_utils.submitUserDetails)(window,config,userDetails);case 8:gatewayUrl=_context.sent,_strategy.tracker.advancedInFlow("tallyman.v1-credit-card","user-details-success",userDetails),dispatch({type:"CREDIT_CARD_USER_DETAILS_SUBMIT",payload:{type:"USER_DETAILS_ENTRY",result:RDS.Success({gatewayUrl:gatewayUrl})}}),_context.next=19;break;case 13:_context.prev=13,_context.t0=_context["catch"](3),console.warn(_context.t0),errorType="SEAlreadySubscribed"===_context.t0.type?"AlreadySubscribed":"SEInvalidMSISDN"===_context.t0.type?"InvalidMSISDN":"UnknownError",_strategy.tracker.recedeInFlow("tallyman.v1-mo-redir","msisdn-submission-failure",_objectSpread(_objectSpread({},userDetails),{},{errorType:errorType||"UnknownError"})),dispatch({type:"CREDIT_CARD_USER_DETAILS_SUBMIT",payload:{type:"USER_DETAILS_ENTRY",result:RDS.Failure({errorType:errorType,error:_context.t0,productUrl:_context.t0.productUrl})}});case 19:_context.next=24;break;case 21:throw _strategy.tracker.recedeInFlow("tallyman.v1-credit-card","user-details-failure",_objectSpread(_objectSpread({},userDetails),{},{errorType:"UnknownError"})),dispatch({type:"CREDIT_CARD_USER_DETAILS_SUBMIT",payload:{type:"USER_DETAILS_ENTRY",result:RDS.Failure({errorType:"UnexpectedState",error:null})}}),"Unexpected state";case 24:case"end":return _context.stop();}},_callee,null,[[3,13]])}));return function(_x,_x2){return _ref.apply(this,arguments)}}()}var initialState={currentState:{type:"USER_DETAILS_ENTRY",result:RDS.NothingYet()}};function CreditCardFlowReducer(){var state=0<arguments.length&&arguments[0]!==void 0?arguments[0]:initialState,action=1<arguments.length?arguments[1]:void 0;switch(action.type){case"CREDIT_CARD_USER_DETAILS_SUBMIT":return(0,_strategy.genericHandler)(state,action.payload);case"MOCK_CREDIT_CARD_USER_DETAILS_FLOW_STATE":return(0,_strategy.genericHandler)(state,action.payload);default:return state;}}
@@ -0,0 +1,12 @@
1
+ import { IConfig } from '../strategy/StrategyTypes';
2
+ import { ICreditCardFlowReducerState } from './CreditCardTypes';
3
+ export declare function submitUserDetails(window: Window, config: IConfig, userDetails: {
4
+ name: string;
5
+ email: string;
6
+ address: string;
7
+ postcode: string;
8
+ city: string;
9
+ country: string;
10
+ }): Promise<string>;
11
+ export declare const mockedUserDetailsEntrySuccess: ICreditCardFlowReducerState;
12
+ export declare const mockedUserDetailsEntryFailure: ICreditCardFlowReducerState;
@@ -0,0 +1 @@
1
+ "use strict";var RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState"));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.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.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.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.mockedUserDetailsEntrySuccess=exports.mockedUserDetailsEntryFailure=void 0,exports.submitUserDetails=submitUserDetails,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.concat.js");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 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)})}}function submitUserDetails(){return _submitUserDetails.apply(this,arguments)}function _submitUserDetails(){return _submitUserDetails=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(window,config,userDetails){var slug,device,offer,host,visitor,rockmanId,result,type,error;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return slug=config.slug,device=config.device,offer=config.offer,host=config.host,visitor=window.pac_analytics.visitor,rockmanId=visitor.rockmanId,_context.next=5,window.tallymanApi.creditCardPayment(host,slug,device,offer,rockmanId,userDetails);case 5:if(result=_context.sent,!1!==result.success){_context.next=14;break}throw type="ALREADY SUBSCRIBED"===result.message?"AlreadySubscribed":"InvalidMSISDN",error=new Error("".concat(type,":\n").concat(result.message)),error.type=type,console.error(error),error;case 14:return _context.abrupt("return",result.GatewayUrl);case 15:case"end":return _context.stop();}},_callee)})),_submitUserDetails.apply(this,arguments)}var mockedUserDetailsEntrySuccess={currentState:{type:"USER_DETAILS_ENTRY",result:RDS.Success({gatewayUrl:"https://www.google.com"})}};exports.mockedUserDetailsEntrySuccess=mockedUserDetailsEntrySuccess;var mockedUserDetailsEntryFailure={currentState:{type:"USER_DETAILS_ENTRY",result:RDS.Failure({errorType:"AlreadySubscribed",error:"Already Subscribed"})}};exports.mockedUserDetailsEntryFailure=mockedUserDetailsEntryFailure;
@@ -28,7 +28,7 @@ export declare type IConfig = {
28
28
  operators?: string[];
29
29
  service?: string;
30
30
  };
31
- export declare type ISupportedFlows = 'pin' | 'mo' | 'oneClick' | 'click2sms' | 'moRedir' | 'ussd' | 'tpayHe';
31
+ export declare type ISupportedFlows = 'pin' | 'mo' | 'oneClick' | 'click2sms' | 'moRedir' | 'ussd' | 'tpayHe' | 'creditCard';
32
32
  export declare type IFlow = {
33
33
  flow: ISupportedFlows;
34
34
  operator?: string;
@@ -48,7 +48,7 @@ export declare type IStrategy = {
48
48
  country: string;
49
49
  strategyConfigs: StrategyConfig;
50
50
  };
51
- export declare type IStrategyNames = 'pin' | 'mo' | 'mo-redir' | 'click2sms' | 'one-click' | 'ussd' | 'tpay-he' | 'tallyman-one-click' | 'pin-mo-ask-operator' | 'pin-mo-ask-mobile-number' | 'pin-one-click-ask-operator' | 'pin-one-click-detect-operator-by-ip' | 'one-click-mo-pin-detect-operator-by-ip-or-msisdn' | 'pin-click2sms-ask-operator' | 'mo-redir-one-click-detect-operator-by-ip' | 'pin-mo-redir-ask-mobile-number' | 'pin-click2sms-ask-mobile-number' | 'mo-one-click-detect-operator-by-ip' | 'click2sms-one-click-detect-operator-by-ip' | 'pin-header-enrichment' | 'pin-msisdn-fowarding-pin-header-enrichment' | 'he-pin-mo-redir-header-enrichment' | 'he-pin-one-click-header-enrichment' | 'he-pin-one-click-ask-operator' | 'click2sms-one-click-ask-operator' | 'pin-mo-detect-operator-by-ip' | 'he-mo-redir-one-click-header-enrichment' | 'pin-combo-ask-mobile-number' | 'header-enrichment-script';
51
+ export declare type IStrategyNames = 'pin' | 'mo' | 'mo-redir' | 'click2sms' | 'one-click' | 'ussd' | 'tpay-he' | 'credit-card' | 'tallyman-one-click' | 'pin-mo-ask-operator' | 'pin-mo-ask-mobile-number' | 'pin-one-click-ask-operator' | 'pin-one-click-detect-operator-by-ip' | 'one-click-mo-pin-detect-operator-by-ip-or-msisdn' | 'pin-click2sms-ask-operator' | 'mo-redir-one-click-detect-operator-by-ip' | 'pin-mo-redir-ask-mobile-number' | 'pin-click2sms-ask-mobile-number' | 'mo-one-click-detect-operator-by-ip' | 'click2sms-one-click-detect-operator-by-ip' | 'pin-header-enrichment' | 'pin-msisdn-fowarding-pin-header-enrichment' | 'he-pin-mo-redir-header-enrichment' | 'he-pin-one-click-header-enrichment' | 'he-pin-one-click-ask-operator' | 'click2sms-one-click-ask-operator' | 'pin-mo-detect-operator-by-ip' | 'he-mo-redir-one-click-header-enrichment' | 'pin-combo-ask-mobile-number' | 'header-enrichment-script';
52
52
  export interface IHash {
53
53
  [key: string]: string;
54
54
  }
@@ -57,9 +57,9 @@ export declare type IDENTIFYMSISDNEntryFailure = {
57
57
  errorType: IDENTIFYMSISDNEntryErrorTypes;
58
58
  error: unknown;
59
59
  };
60
- export declare type IdentifyFlowOptionsResult<F> = {
60
+ export declare type IdentifyFlowOptionsResult = {
61
61
  config: IConfig;
62
- nextAction: F;
62
+ nextAction?: unknown;
63
63
  msisdn?: string;
64
64
  operator?: string;
65
65
  subscription_url?: string;
@@ -71,11 +71,11 @@ export declare type IdentifyFlowOptionsResult<F> = {
71
71
  };
72
72
  export declare type IDENTIFYMSISDNEntrySuccess = {};
73
73
  export declare type OPERATORSelectFailure = {};
74
- export declare type OPERATORSelectSuccess = IdentifyFlowOptionsResult<'submitMSISDNAction' | 'loadOc2sms'>;
74
+ export declare type OPERATORSelectSuccess = IdentifyFlowOptionsResult;
75
75
  export declare type IDETECTYOPERATOBYIPFailure = {};
76
- export declare type IDETECTYOPERATOBYIPSuccess = IdentifyFlowOptionsResult<'getRedirectUrlAction'>;
77
- export declare type IDENTIFY_OPERATOR_MSISDNEntrySuccess = IdentifyFlowOptionsResult<'submitMSISDNAction'>;
78
- export declare type IDENTIFY_FLOW_HESuccess = IdentifyFlowOptionsResult<'subscribeAction'>;
76
+ export declare type IDETECTYOPERATOBYIPSuccess = IdentifyFlowOptionsResult;
77
+ export declare type IDENTIFY_OPERATOR_MSISDNEntrySuccess = IdentifyFlowOptionsResult;
78
+ export declare type IDENTIFY_FLOW_HESuccess = IdentifyFlowOptionsResult;
79
79
  export declare type OPERATORSelectFlowIdentifyFailure = {};
80
80
  export declare type OPERATORSelectFlowIdentifySuccess = {
81
81
  operators: Array<string>;
@@ -92,7 +92,7 @@ export declare type IDetectOperatorByIpPayload = {
92
92
  type: 'DETECT_OPERATOR_BY_IP';
93
93
  result: RDS.RemoteDataState<IDETECTYOPERATOBYIPFailure, IDETECTYOPERATOBYIPSuccess>;
94
94
  };
95
- export declare type IPossibleFlows = 'PIN' | 'MO' | 'MO_REDIR' | 'ONE_CLICK' | 'CLICK2SMS' | 'USSD' | 'TPAY_HE';
95
+ export declare type IPossibleFlows = 'PIN' | 'MO' | 'MO_REDIR' | 'ONE_CLICK' | 'CLICK2SMS' | 'USSD' | 'TPAY_HE' | 'CREDIT_CARD';
96
96
  export declare type IOperatorSelectPayload = {
97
97
  type: IPossibleFlows;
98
98
  result: OPERATORSelectSuccess;
@@ -183,25 +183,28 @@ export declare type IStrategyCurrentState = {
183
183
  nextData: IIdenyifyFlowByMsisdnSumbitNextData;
184
184
  } | {
185
185
  type: 'PIN';
186
- result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
186
+ result: IdentifyFlowOptionsResult;
187
187
  } | {
188
188
  type: 'MO';
189
- result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
189
+ result: IdentifyFlowOptionsResult;
190
190
  } | {
191
191
  type: 'USSD';
192
- result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
192
+ result: IdentifyFlowOptionsResult;
193
193
  } | {
194
194
  type: 'MO_REDIR';
195
- result: IdentifyFlowOptionsResult<'submitMSISDNAction'>;
195
+ result: IdentifyFlowOptionsResult;
196
196
  } | {
197
197
  type: 'ONE_CLICK';
198
- result: IdentifyFlowOptionsResult<'getRedirectUrlAction'>;
198
+ result: IdentifyFlowOptionsResult;
199
199
  } | {
200
200
  type: 'CLICK2SMS';
201
- result: IdentifyFlowOptionsResult<'loadOc2sms'>;
201
+ result: IdentifyFlowOptionsResult;
202
202
  } | {
203
203
  type: 'TPAY_HE';
204
- result: IdentifyFlowOptionsResult<'loadTpayAction'>;
204
+ result: IdentifyFlowOptionsResult;
205
+ } | {
206
+ type: 'CREDIT_CARD';
207
+ result: IdentifyFlowOptionsResult;
205
208
  };
206
209
  export declare type IStrategyReducerState = {
207
210
  currentState: IStrategyCurrentState;
@@ -226,7 +229,7 @@ export declare type IStrategyIDentifyUserResult = {
226
229
  message: string;
227
230
  'redirect-back'?: string;
228
231
  };
229
- export declare type IMockFlows = 'pin' | 'mo' | 'oneclick' | 'click2sms' | 'moredir' | 'ussd' | 'tpay';
232
+ export declare type IMockFlows = 'pin' | 'mo' | 'oneclick' | 'click2sms' | 'moredir' | 'ussd' | 'tpay' | 'creditcard';
230
233
  export interface IMockFlowParams<T> {
231
234
  'mock-flow': IMockFlows;
232
235
  'current-state': T;
@@ -1 +1 @@
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.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.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.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.StrategyFlowActionMaps=void 0,exports.checkSubscriptionAction=checkSubscriptionAction,exports.default=StrategyReducer,exports.genericHandler=genericHandler,exports.identifyStrategy=identifyStrategy,exports.mockStrategyStateByUrlParam=mockStrategyStateByUrlParam,exports.tracker=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _immutabilityHelper=_interopRequireDefault(require("immutability-helper")),RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_pacman=_interopRequireDefault(require("../../pacman")),_click2smsFlow=require("../click2smsFlow"),_utils=require("../click2smsFlow/utils"),_moFlow=require("../moFlow"),_moRedirFlow=require("../moRedirFlow"),_oneClickFlow=require("../oneClickFlow"),_pinFlow=require("../pinFlow"),_ussdFlow=require("../ussdFlow"),_ask_mobile_number=_interopRequireWildcard(require("./strategies/ask_mobile_number")),_ask_operator=_interopRequireWildcard(require("./strategies/ask_operator")),_detect_operator_by_ip=_interopRequireDefault(require("./strategies/detect_operator_by_ip")),_header_enrichment=_interopRequireDefault(require("./strategies/header_enrichment")),_injectHeaderEnrichmentScript=_interopRequireDefault(require("./strategies/injectHeaderEnrichmentScript")),_utils2=require("./utils");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 _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}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 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 tracker=(0,_pacman.default)("undefined"==typeof window?null:window);exports.tracker=tracker;function mockStrategyStateByUrlParam(){return function(dispatch){var search=(0,_utils2.searchToObject)();if(search["mock-flow"]!==void 0)switch(search["mock-flow"]){case"pin":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedPinFlow.currentState}),dispatch((0,_pinFlow.mockPinFlow)(search["current-state"]));break;case"mo":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedMoFlow.currentState}),dispatch((0,_moFlow.mockMoFlow)(search["current-state"]));break;case"moredir":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedMoRdirFlow.currentState}),dispatch((0,_moRedirFlow.mockMoRedirFlow)(search["current-state"]));break;case"oneclick":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedOneClickFlow.currentState}),setTimeout(function(){dispatch((0,_oneClickFlow.mockOneClickFlow)(search["current-state"]))},2e3);break;case"click2sms":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedClick2smsFlow.currentState});break;case"ussd":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedUssdFlow.currentState}),dispatch((0,_ussdFlow.mockUssdFlow)(search["current-state"]));break;default:throw new Error("Mock Flow not supported");}}}function identifyStrategy(){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch){var _getConfig,strategy,strategyConfigs,isUseMsisdnPrefix,search;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(_getConfig=(0,_utils2.getConfig)(),strategy=_getConfig.strategy,strategyConfigs=_getConfig.strategyConfigs,isUseMsisdnPrefix=strategyConfigs.isUseMsisdnPrefix,search=(0,_utils2.searchToObject)(),dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"IDENTIFY_STRATEGY",result:RDS.Loading()}}),void 0===search["mock-flow"]){_context.next=8;break}dispatch(mockStrategyStateByUrlParam()),_context.next=32;break;case 8:_context.t0=strategy,_context.next="pin-mo-ask-operator"===_context.t0?11:"pin-mo-redir-ask-mobile-number"===_context.t0?12:"pin-mo-ask-mobile-number"===_context.t0?12:"pin-combo-ask-mobile-number"===_context.t0?12:"pin-one-click-detect-operator-by-ip"===_context.t0?13:"one-click-mo-pin-detect-operator-by-ip-or-msisdn"===_context.t0?13:"mo-redir-one-click-detect-operator-by-ip"===_context.t0?13:"mo-one-click-detect-operator-by-ip"===_context.t0?13:"click2sms-one-click-detect-operator-by-ip"===_context.t0?13:"pin-mo-detect-operator-by-ip"===_context.t0?13:"pin-click2sms-ask-operator"===_context.t0?14:"he-pin-one-click-ask-operator"===_context.t0?14:"click2sms-one-click-ask-operator"===_context.t0?14:"pin-one-click-ask-operator"===_context.t0?14:"pin-header-enrichment"===_context.t0?15:"he-pin-mo-redir-header-enrichment"===_context.t0?15:"he-pin-one-click-header-enrichment"===_context.t0?15:"he-mo-redir-one-click-header-enrichment"===_context.t0?15:"header-enrichment-script"===_context.t0?16:"pin"===_context.t0?17:"mo"===_context.t0?19:"mo-redir"===_context.t0?21:"one-click"===_context.t0?23:"click2sms"===_context.t0?25:"ussd"===_context.t0?27:"tpay-he"===_context.t0?29:31;break;case 11:return _context.abrupt("return",dispatch((0,_ask_operator.default)()));case 12:return _context.abrupt("return",dispatch((0,_ask_mobile_number.default)()));case 13:return _context.abrupt("return",dispatch((0,_detect_operator_by_ip.default)()));case 14:return _context.abrupt("return",dispatch((0,_ask_operator.default)()));case 15:return _context.abrupt("return",dispatch((0,_header_enrichment.default)()));case 16:return _context.abrupt("return",dispatch((0,_injectHeaderEnrichmentScript.default)()));case 17:return tracker.sendOptInFlowEvent("Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig,isUseMsisdnPrefix:isUseMsisdnPrefix}}}));case 19:return tracker.sendOptInFlowEvent("Msisdn to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 21:return tracker.sendOptInFlowEvent("Redirect"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 23:return tracker.sendOptInFlowEvent("3G click"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:strategyConfigs.default.flowConfig}}}));case 25:return tracker.sendOptInFlowEvent("Click to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:strategyConfigs.default.flowConfig}}}));case 27:return tracker.sendOptInFlowEvent("Msisdn to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"USSD",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 29:return tracker.sendOptInFlowEvent("Hybrid Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"TPAY_HE",result:{nextAction:"loadTpayAction",config:strategyConfigs.default.flowConfig}}}));case 31:throw new Error("Strategy not supported");case 32:case"end":return _context.stop();}},_callee)}));return function(_x){return _ref.apply(this,arguments)}}()}function checkSubscriptionAction(trackingArgs){return function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(dispatch,store){var currentState,maybeConfig;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:currentState=store().strategy.currentState,maybeConfig=currentState.result.config;try{dispatch({type:"CHECK_SUBSCRIPTION"}),(0,_utils.checkSubscription)(window,maybeConfig).then(function(product_url){tracker.advancedInFlow(trackingArgs.flow,trackingArgs.action,trackingArgs.args),setTimeout(function(){window.location.href=product_url},1e3)})}catch(ex){console.warn(ex)}case 3:case"end":return _context2.stop();}},_callee2)}));return function(_x2,_x3){return _ref2.apply(this,arguments)}}()}function genericHandler(state,payload){return(0,_immutabilityHelper.default)(state,{currentState:{$set:payload}})}var initialState={currentState:{type:"IDENTIFY_STRATEGY",result:RDS.NothingYet()}},StrategyFlowActionMaps={selectOperator:_ask_operator.selectOperator,submitMSISDNAction:_ask_mobile_number.submitMSISDNAction,loadOc2sms:_click2smsFlow.loadOc2sms};exports.StrategyFlowActionMaps=StrategyFlowActionMaps;function StrategyReducer(){var state=0<arguments.length&&arguments[0]!==void 0?arguments[0]:initialState,action=1<arguments.length?arguments[1]:void 0;switch(action.type){case"IDENTIFY_STRATEGY":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_OPERATOR_SELECT":return genericHandler(state,action.payload);case"OPERATOR_SELECT":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_MSISDN":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_MSISDN_SUBMIT":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_IP":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_IP_OPERATOR":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_HE":return genericHandler(state,action.payload);case"HE_IDENTIFY":return genericHandler(state,action.payload);case"MOCK_STRATEGY_STATE":return genericHandler(state,action.payload);default:return state;}}
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.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.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.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.StrategyFlowActionMaps=void 0,exports.checkSubscriptionAction=checkSubscriptionAction,exports.default=StrategyReducer,exports.genericHandler=genericHandler,exports.identifyStrategy=identifyStrategy,exports.mockStrategyStateByUrlParam=mockStrategyStateByUrlParam,exports.tracker=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _immutabilityHelper=_interopRequireDefault(require("immutability-helper")),RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_pacman=_interopRequireDefault(require("../../pacman")),_click2smsFlow=require("../click2smsFlow"),_utils=require("../click2smsFlow/utils"),_creditCardFlow=require("../creditCardFlow"),_moFlow=require("../moFlow"),_moRedirFlow=require("../moRedirFlow"),_oneClickFlow=require("../oneClickFlow"),_pinFlow=require("../pinFlow"),_ussdFlow=require("../ussdFlow"),_ask_mobile_number=_interopRequireWildcard(require("./strategies/ask_mobile_number")),_ask_operator=_interopRequireWildcard(require("./strategies/ask_operator")),_detect_operator_by_ip=_interopRequireDefault(require("./strategies/detect_operator_by_ip")),_header_enrichment=_interopRequireDefault(require("./strategies/header_enrichment")),_injectHeaderEnrichmentScript=_interopRequireDefault(require("./strategies/injectHeaderEnrichmentScript")),_utils2=require("./utils");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 _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}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 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 tracker=(0,_pacman.default)("undefined"==typeof window?null:window);exports.tracker=tracker;function mockStrategyStateByUrlParam(){return function(dispatch){var search=(0,_utils2.searchToObject)();if(search["mock-flow"]!==void 0)switch(search["mock-flow"]){case"pin":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedPinFlow.currentState}),dispatch((0,_pinFlow.mockPinFlow)(search["current-state"]));break;case"mo":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedMoFlow.currentState}),dispatch((0,_moFlow.mockMoFlow)(search["current-state"]));break;case"moredir":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedMoRdirFlow.currentState}),dispatch((0,_moRedirFlow.mockMoRedirFlow)(search["current-state"]));break;case"oneclick":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedOneClickFlow.currentState}),setTimeout(function(){dispatch((0,_oneClickFlow.mockOneClickFlow)(search["current-state"]))},2e3);break;case"click2sms":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedClick2smsFlow.currentState});break;case"ussd":dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedUssdFlow.currentState}),dispatch((0,_ussdFlow.mockUssdFlow)(search["current-state"]));break;case"creditcard":console.log("HERE"),dispatch({type:"MOCK_STRATEGY_STATE",payload:_utils2.mockedCreditCardFlow.currentState}),dispatch((0,_creditCardFlow.mockCreditCardFlow)(search["current-state"]));break;default:throw new Error("(mockStrategyStateByUrlParam) Strategy Mock Flow not supported");}}}function identifyStrategy(){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch){var _getConfig,strategy,strategyConfigs,isUseMsisdnPrefix,search;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(_getConfig=(0,_utils2.getConfig)(),strategy=_getConfig.strategy,strategyConfigs=_getConfig.strategyConfigs,isUseMsisdnPrefix=strategyConfigs.isUseMsisdnPrefix,search=(0,_utils2.searchToObject)(),dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"IDENTIFY_STRATEGY",result:RDS.Loading()}}),void 0===search["mock-flow"]){_context.next=8;break}dispatch(mockStrategyStateByUrlParam()),_context.next=33;break;case 8:_context.t0=strategy,_context.next="pin-mo-ask-operator"===_context.t0?11:"pin-mo-redir-ask-mobile-number"===_context.t0?12:"pin-mo-ask-mobile-number"===_context.t0?12:"pin-combo-ask-mobile-number"===_context.t0?12:"pin-one-click-detect-operator-by-ip"===_context.t0?13:"one-click-mo-pin-detect-operator-by-ip-or-msisdn"===_context.t0?13:"mo-redir-one-click-detect-operator-by-ip"===_context.t0?13:"mo-one-click-detect-operator-by-ip"===_context.t0?13:"click2sms-one-click-detect-operator-by-ip"===_context.t0?13:"pin-mo-detect-operator-by-ip"===_context.t0?13:"pin-click2sms-ask-operator"===_context.t0?14:"he-pin-one-click-ask-operator"===_context.t0?14:"click2sms-one-click-ask-operator"===_context.t0?14:"pin-one-click-ask-operator"===_context.t0?14:"pin-header-enrichment"===_context.t0?15:"he-pin-mo-redir-header-enrichment"===_context.t0?15:"he-pin-one-click-header-enrichment"===_context.t0?15:"he-mo-redir-one-click-header-enrichment"===_context.t0?15:"header-enrichment-script"===_context.t0?16:"pin"===_context.t0?17:"mo"===_context.t0?19:"mo-redir"===_context.t0?21:"one-click"===_context.t0?23:"click2sms"===_context.t0?25:"ussd"===_context.t0?27:"tpay-he"===_context.t0?29:"credit-card"===_context.t0?31:32;break;case 11:return _context.abrupt("return",dispatch((0,_ask_operator.default)()));case 12:return _context.abrupt("return",dispatch((0,_ask_mobile_number.default)()));case 13:return _context.abrupt("return",dispatch((0,_detect_operator_by_ip.default)()));case 14:return _context.abrupt("return",dispatch((0,_ask_operator.default)()));case 15:return _context.abrupt("return",dispatch((0,_header_enrichment.default)()));case 16:return _context.abrupt("return",dispatch((0,_injectHeaderEnrichmentScript.default)()));case 17:return tracker.sendOptInFlowEvent("Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig,isUseMsisdnPrefix:isUseMsisdnPrefix}}}));case 19:return tracker.sendOptInFlowEvent("Msisdn to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 21:return tracker.sendOptInFlowEvent("Redirect"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 23:return tracker.sendOptInFlowEvent("3G click"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:strategyConfigs.default.flowConfig}}}));case 25:return tracker.sendOptInFlowEvent("Click to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:strategyConfigs.default.flowConfig}}}));case 27:return tracker.sendOptInFlowEvent("Msisdn to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"USSD",result:{nextAction:"submitMSISDNAction",config:strategyConfigs.default.flowConfig}}}));case 29:return tracker.sendOptInFlowEvent("Hybrid Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"TPAY_HE",result:{nextAction:"loadTpayAction",config:strategyConfigs.default.flowConfig}}}));case 31:return _context.abrupt("return",dispatch({type:"IDENTIFY_STRATEGY",payload:{type:"CREDIT_CARD",result:{config:strategyConfigs.default.flowConfig,isUseMsisdnPrefix:isUseMsisdnPrefix}}}));case 32:throw new Error("Strategy not supported");case 33:case"end":return _context.stop();}},_callee)}));return function(_x){return _ref.apply(this,arguments)}}()}function checkSubscriptionAction(trackingArgs){return function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(dispatch,store){var currentState,maybeConfig;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:currentState=store().strategy.currentState,maybeConfig=currentState.result.config;try{dispatch({type:"CHECK_SUBSCRIPTION"}),(0,_utils.checkSubscription)(window,maybeConfig).then(function(product_url){tracker.advancedInFlow(trackingArgs.flow,trackingArgs.action,trackingArgs.args),setTimeout(function(){window.location.href=product_url},1e3)})}catch(ex){console.warn(ex)}case 3:case"end":return _context2.stop();}},_callee2)}));return function(_x2,_x3){return _ref2.apply(this,arguments)}}()}function genericHandler(state,payload){return(0,_immutabilityHelper.default)(state,{currentState:{$set:payload}})}var initialState={currentState:{type:"IDENTIFY_STRATEGY",result:RDS.NothingYet()}},StrategyFlowActionMaps={selectOperator:_ask_operator.selectOperator,submitMSISDNAction:_ask_mobile_number.submitMSISDNAction,loadOc2sms:_click2smsFlow.loadOc2sms};exports.StrategyFlowActionMaps=StrategyFlowActionMaps;function StrategyReducer(){var state=0<arguments.length&&arguments[0]!==void 0?arguments[0]:initialState,action=1<arguments.length?arguments[1]:void 0;switch(action.type){case"IDENTIFY_STRATEGY":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_OPERATOR_SELECT":return genericHandler(state,action.payload);case"OPERATOR_SELECT":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_MSISDN":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_MSISDN_SUBMIT":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_IP":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_IP_OPERATOR":return genericHandler(state,action.payload);case"IDENTIFY_FLOW_BY_HE":return genericHandler(state,action.payload);case"HE_IDENTIFY":return genericHandler(state,action.payload);case"MOCK_STRATEGY_STATE":return genericHandler(state,action.payload);default:return state;}}
@@ -27,3 +27,4 @@ export declare const mockedMoRdirFlow: IStrategyReducerState;
27
27
  export declare const mockedClick2smsFlow: IStrategyReducerState;
28
28
  export declare const mockedOneClickFlow: IStrategyReducerState;
29
29
  export declare const mockedTPayFlow: IStrategyReducerState;
30
+ export declare const mockedCreditCardFlow: IStrategyReducerState;
@@ -1 +1 @@
1
- "use strict";var _tryGetIPRangeName=_interopRequireDefault(require("../../ips/tryGetIPRangeName"));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.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.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/es.object.get-own-property-descriptors.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.regexp.test.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.determineFlowByMsidn=determineFlowByMsidn,exports.determineFlowByOperator=determineFlowByOperator,exports.determineFlowByOperatorFromIp=determineFlowByOperatorFromIp,exports.getConfig=void 0,exports.getOperators=getOperators,exports.identifyUser=void 0,exports.left=left,exports.loop=void 0,exports.mockConfig=mockConfig,exports.mockedUssdFlow=exports.mockedTPayFlow=exports.mockedPinFlow=exports.mockedOneClickFlow=exports.mockedMoRdirFlow=exports.mockedMoFlow=exports.mockedClick2smsFlow=void 0,exports.right=right,exports.wait=exports.subscribe=exports.searchToObject=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.split.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.concat.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/web.url.js"),require("core-js/modules/web.url-search-params.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.string.match.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}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 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}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)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}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}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 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 wait=function(ms){return new Promise(function(resolve){return setTimeout(function(){return resolve()},ms)})};exports.wait=wait;var loop=function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(f,max,stop,i){var r;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return _context.next=2,f();case 2:if(r=_context.sent,!(stop(r)||i>=max)){_context.next=5;break}return _context.abrupt("return",r);case 5:return _context.next=7,wait(1e3);case 7:return _context.abrupt("return",loop(f,max,stop,i+1));case 8:case"end":return _context.stop();}},_callee)}));return function loop(_x,_x2,_x3,_x4){return _ref.apply(this,arguments)}}();exports.loop=loop;function right(r){return{type:"right",value:r}}function left(l){return{type:"left",value:l}}var getConfig=function getConfig(){try{if("true"===process.env.testing){var _configs2=require("../../../mockData/config.json");return _configs2}var _configs=require("../../../../../config.json");return _configs}catch(ex){throw new Error("config.json not found")}};exports.getConfig=getConfig;var configs=getConfig(),defaultFlowConfig=configs.strategyConfigs.default,operatorsConfig=configs.strategyConfigs.operators,searchToObject=function searchToObject(){return"undefined"==typeof window?{}:window.location.search.substring(1).split("&").filter(function(x){return!!x&&0<x.length}).map(function(kv){return kv.split("=")}).reduce(function(a,b){return _objectSpread(_objectSpread({},a),{},_defineProperty({},b[0],b[1]))},{})};exports.searchToObject=searchToObject;function determineFlowByMsidn(_x5){return _determineFlowByMsidn.apply(this,arguments)}function _determineFlowByMsidn(){return _determineFlowByMsidn=_asyncToGenerator(_regeneratorRuntime().mark(function _callee5(internationalMSISDN){var submissionError,msisdn,indentifyFlow,theResult,mapAgencyOperator,flow,cannotDetect,hlrError,_submissionError,flowObj,_flowObj,_submissionError2;return _regeneratorRuntime().wrap(function _callee5$(_context5){for(;1;)switch(_context5.prev=_context5.next){case 0:if(internationalMSISDN){_context5.next=4;break}throw submissionError=new Error("Error in submitMSISDN() trigger-pin action"),submissionError.type="SEInvalidMSISDN",submissionError;case 4:return msisdn=internationalMSISDN.match(/\d+/gi).join(""),indentifyFlow=function(){var _ref6=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(){var config,slug,country,device,host,rockmanId,offer,flowOperatorResult;return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:return config=defaultFlowConfig.flowConfig,slug=config.slug,country=config.country,device=config.device,host=config.host,rockmanId=window.pac_analytics.visitor.rockmanId,offer=window.pac_analytics.visitor.offer,_context4.next=6,window.tallymanApi.identify(host,slug,country,msisdn,device,offer,rockmanId);case 6:return flowOperatorResult=_context4.sent,_context4.abrupt("return",flowOperatorResult);case 8:case"end":return _context4.stop();}},_callee4)}));return function indentifyFlow(){return _ref6.apply(this,arguments)}}(),_context5.next=8,indentifyFlow();case 8:if(theResult=_context5.sent,mapAgencyOperator={SA_STC:"S2_STC",SA_MOBILY:"S2_MOBILY",SA_ZAIN:"S2_ZAIN",KW_ZAIN:"K2_ZAIN",KW_OOREDOO:"K2_OOREDOO",KW_VIVA:"K2_VIVA",AE_DU:"A2_DU",AE_ETISALAT:"A2_ETISALAT",CA_SUNRISE:"C2_SUNRISE",CA_TELE2:"C2_TELE2",CA_SWISSCOM:"C2_SWISSCOM",CA_SALT:"C2_SALT",OM_OOREDOO:"O2_OOREDOO",OM_OMANTEL:"O2_OMANTEL",RS_TELEKOM:"R2_TELEKOM",RS_VIP:"R2_VIP",RS_TELIM:"R2_TELIM"},flow=operatorsConfig[theResult.operator]||operatorsConfig[mapAgencyOperator[theResult.operator]]?operatorsConfig[theResult.operator]||operatorsConfig[mapAgencyOperator[theResult.operator]]:null,cannotDetect=!1===theResult.success&&"Operator could not be found for the given MSISDN"===theResult.message,hlrError=!1===theResult.success&&-1!==theResult.message.indexOf("HLR did not find the operator for given MSISDN"),!(cannotDetect||hlrError)){_context5.next=20;break}throw _submissionError=new Error("Error in submitMSISDN() identify flow"),_submissionError.type="FlowDetectFailed",_submissionError.msisdn=msisdn,_submissionError;case 20:if(null===flow){_context5.next=25;break}return flowObj=_objectSpread({operator:theResult.operator,default:defaultFlowConfig},flow),_context5.abrupt("return",flowObj);case 25:if(null!==flow){_context5.next=30;break}return _flowObj=_objectSpread({operator:theResult.operator},defaultFlowConfig),_context5.abrupt("return",_flowObj);case 30:throw _submissionError2=new Error("Error in submitMSISDN() trigger-pin action"),_submissionError2.type="SEInvalidMSISDN",_submissionError2;case 33:case"end":return _context5.stop();}},_callee5)})),_determineFlowByMsidn.apply(this,arguments)}function determineFlowByOperator(operator){var flowObj=_objectSpread({operator:null===operator||void 0===operator?void 0:operator.toUpperCase(),default:defaultFlowConfig},operatorsConfig[null===operator||void 0===operator?void 0:operator.toUpperCase()]);return flowObj}function determineFlowByOperatorFromIp(){return _determineFlowByOperatorFromIp.apply(this,arguments)}function _determineFlowByOperatorFromIp(){return _determineFlowByOperatorFromIp=_asyncToGenerator(_regeneratorRuntime().mark(function _callee6(){var operator,flowObj;return _regeneratorRuntime().wrap(function _callee6$(_context6){for(;1;)switch(_context6.prev=_context6.next){case 0:return _context6.next=2,(0,_tryGetIPRangeName.default)(window.pac_analytics.visitor);case 2:return operator=_context6.sent,flowObj=determineFlowByOperator(operator?operator.toUpperCase():""),_context6.abrupt("return",flowObj);case 5:case"end":return _context6.stop();}},_callee6)})),_determineFlowByOperatorFromIp.apply(this,arguments)}function getOperators(){var operators=Object.keys(operatorsConfig);return operators}var fetchJsonp=function fetchJsonp(_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")))}})},identifyUser=function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(extraParams){var config,host,country,slug,queryString,device,bupperizeCountry,offer,rockmanId,s,search,extraParamsQs,isDMB,newHost,searchObj,identifyError,subscription_url,_newUrl,_newQueryString,_urlParams,_msisdn,_operator,redirect_url,_newUrl2,_newQueryString2,_urlParams2,_msisdn2,_operator2,newUrl,newQueryString,urlParams,msisdn,operator,url,result,_identifyError;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:if("undefined"!=typeof window){_context2.next=4;break}throw new Error("Error");case 4:if(config=defaultFlowConfig.flowConfig,host=config.host,country=config.country,slug=config.slug,queryString=config.queryString,device=config.device,bupperizeCountry=function bupperizeCountry(c){return"gb"===c?"uk":c},offer=window.pac_analytics.visitor.offer,rockmanId=window.pac_analytics.visitor.rockmanId,s=window.location.search.substr(1),search=(!!s&&0<s.length?[s]:[]).concat((queryString||[]).map(function(_ref3){var _ref4=_slicedToArray(_ref3,2),k=_ref4[0],v=_ref4[1];return"".concat(k,"=").concat(v)})).join("&"),extraParamsQs=extraParams?"&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")):"",isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,searchObj=searchToObject(),!searchObj["redirect-back"]){_context2.next=46;break}if("false"!==(null===searchObj||void 0===searchObj?void 0:searchObj.success)){_context2.next=22;break}throw identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat((null===searchObj||void 0===searchObj?void 0:searchObj.message)||"NotOn3g")),identifyError.type="NotOn3g",identifyError;case 22:if(!searchObj.subscription_url){_context2.next=30;break}return subscription_url=window.atob(searchObj.subscription_url),_newUrl=new URL(subscription_url),_newQueryString=_newUrl.search,_urlParams=new URLSearchParams(_newQueryString),_msisdn=_urlParams.get("msisdn")||(null===searchObj||void 0===searchObj?void 0:searchObj.msisdn)||null,_operator=_urlParams.get("operator")||(null===searchObj||void 0===searchObj?void 0:searchObj.operator)||null,_context2.abrupt("return",{subscription_url:subscription_url,action:function action(){return subscribe(subscription_url)},msisdn:_msisdn,operator:_operator});case 30:if(!(null!==searchObj&&void 0!==searchObj&&searchObj.redirect_url)){_context2.next=38;break}return redirect_url=window.atob(null===searchObj||void 0===searchObj?void 0:searchObj.redirect_url),_newUrl2=new URL(redirect_url),_newQueryString2=_newUrl2.search,_urlParams2=new URLSearchParams(_newQueryString2),_msisdn2=_urlParams2.get("msisdn")||(null===searchObj||void 0===searchObj?void 0:searchObj.msisdn)||null,_operator2=_urlParams2.get("operator")||(null===searchObj||void 0===searchObj?void 0:searchObj.operator)||null,_context2.abrupt("return",{redirect_url:redirect_url,msisdn:_msisdn2,operator:_operator2});case 38:return newUrl=new URL(window.location.href),newQueryString=newUrl.search,urlParams=new URLSearchParams(newQueryString),msisdn=urlParams.get("msisdn")||(null===searchObj||void 0===searchObj?void 0:searchObj.msisdn)||null,operator=urlParams.get("operator")||(null===searchObj||void 0===searchObj?void 0:searchObj.operator)||null,_context2.abrupt("return",{msisdn:msisdn,operator:operator});case 44:_context2.next=57;break;case 46:return url="https://".concat(newHost,"/tallyman/v1/?action=identify-user&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&page=").concat(window.location.href,"&pixel_url=").concat(encodeURIComponent("http://".concat(window.location.host,"/pixels?xcid=").concat(window.location.pathname.replace("/",""),"&xaid=").concat(window.pac_analytics.visitor.xaid,"&country=").concat(bupperizeCountry(country))),"&rockman_id=").concat(rockmanId).concat(extraParamsQs,"&").concat(search),_context2.next=49,fetchJsonp(url);case 49:if(result=_context2.sent,"false"!==result.success){_context2.next=56;break}throw _identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat(result.message)),_identifyError.type="NotOn3g",_identifyError;case 56:return _context2.abrupt("return",{subscription_url:result.subscription_url||result.redirect_url,action:function action(){return subscribe(result.subscription_url)},msisdn:result.msisdn,operator:result.operator});case 57:case"end":return _context2.stop();}},_callee2)}));return function identifyUser(_x6){return _ref2.apply(this,arguments)}}();exports.identifyUser=identifyUser;var subscribe=function(){var _ref5=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(_url){return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:return _context3.abrupt("return","https://google.com");case 1:case"end":return _context3.stop();}},_callee3)}));return function subscribe(_x7){return _ref5.apply(this,arguments)}}();exports.subscribe=subscribe;function mockConfig(flow){var opArr=Object.keys(operatorsConfig),r=opArr.filter(function(o){return operatorsConfig[o].flow===flow}),operator=r[0],flowObj=_objectSpread({offer:1,operator:operator,default:defaultFlowConfig},operatorsConfig[operator]);return flowObj}var mockedPinFlow={currentState:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:mockConfig("pin")}}};exports.mockedPinFlow=mockedPinFlow;var mockedMoFlow={currentState:{type:"MO",result:{nextAction:"submitMSISDNAction",config:mockConfig("mo")}}};exports.mockedMoFlow=mockedMoFlow;var mockedUssdFlow={currentState:{type:"USSD",result:{nextAction:"submitMSISDNAction",config:mockConfig("ussd")}}};exports.mockedUssdFlow=mockedUssdFlow;var mockedMoRdirFlow={currentState:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:mockConfig("moRedir")}}};exports.mockedMoRdirFlow=mockedMoRdirFlow;var mockedClick2smsFlow={currentState:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:mockConfig("click2sms")}}};exports.mockedClick2smsFlow=mockedClick2smsFlow;var mockedOneClickFlow={currentState:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:mockConfig("oneClick")}}};exports.mockedOneClickFlow=mockedOneClickFlow;var mockedTPayFlow={currentState:{type:"TPAY_HE",result:{nextAction:"loadTpayAction",config:mockConfig("tpayHe")}}};exports.mockedTPayFlow=mockedTPayFlow;
1
+ "use strict";var _tryGetIPRangeName=_interopRequireDefault(require("../../ips/tryGetIPRangeName"));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.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.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/es.object.get-own-property-descriptors.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.regexp.test.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.determineFlowByMsidn=determineFlowByMsidn,exports.determineFlowByOperator=determineFlowByOperator,exports.determineFlowByOperatorFromIp=determineFlowByOperatorFromIp,exports.getConfig=void 0,exports.getOperators=getOperators,exports.identifyUser=void 0,exports.left=left,exports.loop=void 0,exports.mockConfig=mockConfig,exports.mockedUssdFlow=exports.mockedTPayFlow=exports.mockedPinFlow=exports.mockedOneClickFlow=exports.mockedMoRdirFlow=exports.mockedMoFlow=exports.mockedCreditCardFlow=exports.mockedClick2smsFlow=void 0,exports.right=right,exports.wait=exports.subscribe=exports.searchToObject=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.split.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.concat.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/web.url.js"),require("core-js/modules/web.url-search-params.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.string.match.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}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 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}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)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}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}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 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 wait=function(ms){return new Promise(function(resolve){return setTimeout(function(){return resolve()},ms)})};exports.wait=wait;var loop=function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(f,max,stop,i){var r;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return _context.next=2,f();case 2:if(r=_context.sent,!(stop(r)||i>=max)){_context.next=5;break}return _context.abrupt("return",r);case 5:return _context.next=7,wait(1e3);case 7:return _context.abrupt("return",loop(f,max,stop,i+1));case 8:case"end":return _context.stop();}},_callee)}));return function loop(_x,_x2,_x3,_x4){return _ref.apply(this,arguments)}}();exports.loop=loop;function right(r){return{type:"right",value:r}}function left(l){return{type:"left",value:l}}var getConfig=function getConfig(){try{if("true"===process.env.testing){var _configs2=require("../../../mockData/config.json");return _configs2}var _configs=require("../../../../../config.json");return _configs}catch(ex){throw new Error("config.json not found")}};exports.getConfig=getConfig;var configs=getConfig(),defaultFlowConfig=configs.strategyConfigs.default,operatorsConfig=configs.strategyConfigs.operators,searchToObject=function searchToObject(){return"undefined"==typeof window?{}:window.location.search.substring(1).split("&").filter(function(x){return!!x&&0<x.length}).map(function(kv){return kv.split("=")}).reduce(function(a,b){return _objectSpread(_objectSpread({},a),{},_defineProperty({},b[0],b[1]))},{})};exports.searchToObject=searchToObject;function determineFlowByMsidn(_x5){return _determineFlowByMsidn.apply(this,arguments)}function _determineFlowByMsidn(){return _determineFlowByMsidn=_asyncToGenerator(_regeneratorRuntime().mark(function _callee5(internationalMSISDN){var submissionError,msisdn,indentifyFlow,theResult,mapAgencyOperator,flow,cannotDetect,hlrError,_submissionError,flowObj,_flowObj,_submissionError2;return _regeneratorRuntime().wrap(function _callee5$(_context5){for(;1;)switch(_context5.prev=_context5.next){case 0:if(internationalMSISDN){_context5.next=4;break}throw submissionError=new Error("Error in submitMSISDN() trigger-pin action"),submissionError.type="SEInvalidMSISDN",submissionError;case 4:return msisdn=internationalMSISDN.match(/\d+/gi).join(""),indentifyFlow=function(){var _ref6=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(){var config,slug,country,device,host,rockmanId,offer,flowOperatorResult;return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:return config=defaultFlowConfig.flowConfig,slug=config.slug,country=config.country,device=config.device,host=config.host,rockmanId=window.pac_analytics.visitor.rockmanId,offer=window.pac_analytics.visitor.offer,_context4.next=6,window.tallymanApi.identify(host,slug,country,msisdn,device,offer,rockmanId);case 6:return flowOperatorResult=_context4.sent,_context4.abrupt("return",flowOperatorResult);case 8:case"end":return _context4.stop();}},_callee4)}));return function indentifyFlow(){return _ref6.apply(this,arguments)}}(),_context5.next=8,indentifyFlow();case 8:if(theResult=_context5.sent,mapAgencyOperator={SA_STC:"S2_STC",SA_MOBILY:"S2_MOBILY",SA_ZAIN:"S2_ZAIN",KW_ZAIN:"K2_ZAIN",KW_OOREDOO:"K2_OOREDOO",KW_VIVA:"K2_VIVA",AE_DU:"A2_DU",AE_ETISALAT:"A2_ETISALAT",CA_SUNRISE:"C2_SUNRISE",CA_TELE2:"C2_TELE2",CA_SWISSCOM:"C2_SWISSCOM",CA_SALT:"C2_SALT",OM_OOREDOO:"O2_OOREDOO",OM_OMANTEL:"O2_OMANTEL",RS_TELEKOM:"R2_TELEKOM",RS_VIP:"R2_VIP",RS_TELIM:"R2_TELIM"},flow=operatorsConfig[theResult.operator]||operatorsConfig[mapAgencyOperator[theResult.operator]]?operatorsConfig[theResult.operator]||operatorsConfig[mapAgencyOperator[theResult.operator]]:null,cannotDetect=!1===theResult.success&&"Operator could not be found for the given MSISDN"===theResult.message,hlrError=!1===theResult.success&&-1!==theResult.message.indexOf("HLR did not find the operator for given MSISDN"),!(cannotDetect||hlrError)){_context5.next=20;break}throw _submissionError=new Error("Error in submitMSISDN() identify flow"),_submissionError.type="FlowDetectFailed",_submissionError.msisdn=msisdn,_submissionError;case 20:if(null===flow){_context5.next=25;break}return flowObj=_objectSpread({operator:theResult.operator,default:defaultFlowConfig},flow),_context5.abrupt("return",flowObj);case 25:if(null!==flow){_context5.next=30;break}return _flowObj=_objectSpread({operator:theResult.operator},defaultFlowConfig),_context5.abrupt("return",_flowObj);case 30:throw _submissionError2=new Error("Error in submitMSISDN() trigger-pin action"),_submissionError2.type="SEInvalidMSISDN",_submissionError2;case 33:case"end":return _context5.stop();}},_callee5)})),_determineFlowByMsidn.apply(this,arguments)}function determineFlowByOperator(operator){var flowObj=_objectSpread({operator:null===operator||void 0===operator?void 0:operator.toUpperCase(),default:defaultFlowConfig},operatorsConfig[null===operator||void 0===operator?void 0:operator.toUpperCase()]);return flowObj}function determineFlowByOperatorFromIp(){return _determineFlowByOperatorFromIp.apply(this,arguments)}function _determineFlowByOperatorFromIp(){return _determineFlowByOperatorFromIp=_asyncToGenerator(_regeneratorRuntime().mark(function _callee6(){var operator,flowObj;return _regeneratorRuntime().wrap(function _callee6$(_context6){for(;1;)switch(_context6.prev=_context6.next){case 0:return _context6.next=2,(0,_tryGetIPRangeName.default)(window.pac_analytics.visitor);case 2:return operator=_context6.sent,flowObj=determineFlowByOperator(operator?operator.toUpperCase():""),_context6.abrupt("return",flowObj);case 5:case"end":return _context6.stop();}},_callee6)})),_determineFlowByOperatorFromIp.apply(this,arguments)}function getOperators(){var operators=Object.keys(operatorsConfig);return operators}var fetchJsonp=function fetchJsonp(_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")))}})},identifyUser=function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(extraParams){var config,host,country,slug,queryString,device,bupperizeCountry,offer,rockmanId,s,search,extraParamsQs,isDMB,newHost,searchObj,identifyError,subscription_url,_newUrl,_newQueryString,_urlParams,_msisdn,_operator,redirect_url,_newUrl2,_newQueryString2,_urlParams2,_msisdn2,_operator2,newUrl,newQueryString,urlParams,msisdn,operator,url,result,_identifyError;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:if("undefined"!=typeof window){_context2.next=4;break}throw new Error("Error");case 4:if(config=defaultFlowConfig.flowConfig,host=config.host,country=config.country,slug=config.slug,queryString=config.queryString,device=config.device,bupperizeCountry=function bupperizeCountry(c){return"gb"===c?"uk":c},offer=window.pac_analytics.visitor.offer,rockmanId=window.pac_analytics.visitor.rockmanId,s=window.location.search.substr(1),search=(!!s&&0<s.length?[s]:[]).concat((queryString||[]).map(function(_ref3){var _ref4=_slicedToArray(_ref3,2),k=_ref4[0],v=_ref4[1];return"".concat(k,"=").concat(v)})).join("&"),extraParamsQs=extraParams?"&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")):"",isDMB=null!==window.pac_analytics.visitor.xaid&&-1!==(-1!==window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb")||window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")),newHost=isDMB?"de.tallymans.com":host,searchObj=searchToObject(),!searchObj["redirect-back"]){_context2.next=46;break}if("false"!==(null===searchObj||void 0===searchObj?void 0:searchObj.success)){_context2.next=22;break}throw identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat((null===searchObj||void 0===searchObj?void 0:searchObj.message)||"NotOn3g")),identifyError.type="NotOn3g",identifyError;case 22:if(!searchObj.subscription_url){_context2.next=30;break}return subscription_url=window.atob(searchObj.subscription_url),_newUrl=new URL(subscription_url),_newQueryString=_newUrl.search,_urlParams=new URLSearchParams(_newQueryString),_msisdn=_urlParams.get("msisdn")||(null===searchObj||void 0===searchObj?void 0:searchObj.msisdn)||null,_operator=_urlParams.get("operator")||(null===searchObj||void 0===searchObj?void 0:searchObj.operator)||null,_context2.abrupt("return",{subscription_url:subscription_url,action:function action(){return subscribe(subscription_url)},msisdn:_msisdn,operator:_operator});case 30:if(!(null!==searchObj&&void 0!==searchObj&&searchObj.redirect_url)){_context2.next=38;break}return redirect_url=window.atob(null===searchObj||void 0===searchObj?void 0:searchObj.redirect_url),_newUrl2=new URL(redirect_url),_newQueryString2=_newUrl2.search,_urlParams2=new URLSearchParams(_newQueryString2),_msisdn2=_urlParams2.get("msisdn")||(null===searchObj||void 0===searchObj?void 0:searchObj.msisdn)||null,_operator2=_urlParams2.get("operator")||(null===searchObj||void 0===searchObj?void 0:searchObj.operator)||null,_context2.abrupt("return",{redirect_url:redirect_url,msisdn:_msisdn2,operator:_operator2});case 38:return newUrl=new URL(window.location.href),newQueryString=newUrl.search,urlParams=new URLSearchParams(newQueryString),msisdn=urlParams.get("msisdn")||(null===searchObj||void 0===searchObj?void 0:searchObj.msisdn)||null,operator=urlParams.get("operator")||(null===searchObj||void 0===searchObj?void 0:searchObj.operator)||null,_context2.abrupt("return",{msisdn:msisdn,operator:operator});case 44:_context2.next=57;break;case 46:return url="https://".concat(newHost,"/tallyman/v1/?action=identify-user&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=").concat(device,"&offerId=").concat(offer,"&page=").concat(window.location.href,"&pixel_url=").concat(encodeURIComponent("http://".concat(window.location.host,"/pixels?xcid=").concat(window.location.pathname.replace("/",""),"&xaid=").concat(window.pac_analytics.visitor.xaid,"&country=").concat(bupperizeCountry(country))),"&rockman_id=").concat(rockmanId).concat(extraParamsQs,"&").concat(search),_context2.next=49,fetchJsonp(url);case 49:if(result=_context2.sent,"false"!==result.success){_context2.next=56;break}throw _identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat(result.message)),_identifyError.type="NotOn3g",_identifyError;case 56:return _context2.abrupt("return",{subscription_url:result.subscription_url||result.redirect_url,action:function action(){return subscribe(result.subscription_url)},msisdn:result.msisdn,operator:result.operator});case 57:case"end":return _context2.stop();}},_callee2)}));return function identifyUser(_x6){return _ref2.apply(this,arguments)}}();exports.identifyUser=identifyUser;var subscribe=function(){var _ref5=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(_url){return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:return _context3.abrupt("return","https://google.com");case 1:case"end":return _context3.stop();}},_callee3)}));return function subscribe(_x7){return _ref5.apply(this,arguments)}}();exports.subscribe=subscribe;function mockConfig(flow){var opArr=Object.keys(operatorsConfig),r=opArr.filter(function(o){return operatorsConfig[o].flow===flow}),operator=r[0],flowObj=_objectSpread({offer:1,operator:operator,default:defaultFlowConfig},operatorsConfig[operator]);return flowObj}var mockedPinFlow={currentState:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:mockConfig("pin")}}};exports.mockedPinFlow=mockedPinFlow;var mockedMoFlow={currentState:{type:"MO",result:{nextAction:"submitMSISDNAction",config:mockConfig("mo")}}};exports.mockedMoFlow=mockedMoFlow;var mockedUssdFlow={currentState:{type:"USSD",result:{nextAction:"submitMSISDNAction",config:mockConfig("ussd")}}};exports.mockedUssdFlow=mockedUssdFlow;var mockedMoRdirFlow={currentState:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:mockConfig("moRedir")}}};exports.mockedMoRdirFlow=mockedMoRdirFlow;var mockedClick2smsFlow={currentState:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:mockConfig("click2sms")}}};exports.mockedClick2smsFlow=mockedClick2smsFlow;var mockedOneClickFlow={currentState:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:mockConfig("oneClick")}}};exports.mockedOneClickFlow=mockedOneClickFlow;var mockedTPayFlow={currentState:{type:"TPAY_HE",result:{nextAction:"loadTpayAction",config:mockConfig("tpayHe")}}};exports.mockedTPayFlow=mockedTPayFlow;var mockedCreditCardFlow={currentState:{type:"CREDIT_CARD",result:{config:mockConfig("creditCard")}}};exports.mockedCreditCardFlow=mockedCreditCardFlow;
@@ -1,4 +1,5 @@
1
1
  import { IClick2SmsActions } from '../reducers/click2smsFlow/Click2smsTypes';
2
+ import { ICreditCardActions } from '../reducers/creditCardFlow/CreditCardTypes';
2
3
  import { IMoActions } from '../reducers/moFlow/MoTypes';
3
4
  import { IMoRedirActions } from '../reducers/moRedirFlow/MoRedirTypes';
4
5
  import { IOneClickActions } from '../reducers/oneClickFlow/OneClickTypes';
@@ -6,7 +7,7 @@ import { IPinActions } from '../reducers/pinFlow/PinTypes';
6
7
  import { IStrategyActions } from '../reducers/strategy/StrategyTypes';
7
8
  import { IUssdActions } from '../reducers/ussdFlow/UssdTypes';
8
9
  import { IApplicationState } from './reducers';
9
- export declare type IApplicationActions = IStrategyActions | IPinActions | IMoActions | IMoRedirActions | IOneClickActions | IClick2SmsActions | IUssdActions;
10
+ export declare type IApplicationActions = IStrategyActions | IPinActions | IMoActions | IMoRedirActions | IOneClickActions | IClick2SmsActions | IUssdActions | ICreditCardActions;
10
11
  declare const store: import("redux").Store<import("redux").EmptyObject & IApplicationState, import("redux").AnyAction> & {
11
12
  dispatch: import("redux-thunk").ThunkDispatch<IApplicationState, undefined, IApplicationActions>;
12
13
  };
@@ -1,4 +1,5 @@
1
1
  import { IClick2smsFlowReducerState } from '../reducers/click2smsFlow/Click2smsTypes';
2
+ import { ICreditCardFlowReducerState } from '../reducers/creditCardFlow/CreditCardTypes';
2
3
  import { IMoFlowReducerState } from '../reducers/moFlow/MoTypes';
3
4
  import { IMoRedirFlowReducerState } from '../reducers/moRedirFlow/MoRedirTypes';
4
5
  import { IOneClickFlowReducerState } from '../reducers/oneClickFlow/OneClickTypes';
@@ -13,6 +14,7 @@ export interface IApplicationState {
13
14
  oneClickFlow: IOneClickFlowReducerState;
14
15
  click2smsFlow: IClick2smsFlowReducerState;
15
16
  ussdFlow: IUssdFlowReducerState;
17
+ creditCardFlow: ICreditCardFlowReducerState;
16
18
  }
17
19
  declare const _default: () => import("redux").Reducer<import("redux").CombinedState<IApplicationState>, import("redux").AnyAction>;
18
20
  export default _default;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _redux=require("redux"),_click2smsFlow=_interopRequireDefault(require("../reducers/click2smsFlow")),_moFlow=_interopRequireDefault(require("../reducers/moFlow")),_moRedirFlow=_interopRequireDefault(require("../reducers/moRedirFlow")),_oneClickFlow=_interopRequireDefault(require("../reducers/oneClickFlow")),_pinFlow=_interopRequireDefault(require("../reducers/pinFlow")),_strategy=_interopRequireDefault(require("../reducers/strategy")),_ussdFlow=_interopRequireDefault(require("../reducers/ussdFlow"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _default=function(){return(0,_redux.combineReducers)({strategy:_strategy.default,pinFlow:_pinFlow.default,moFlow:_moFlow.default,moRedirFlow:_moRedirFlow.default,oneClickFlow:_oneClickFlow.default,click2smsFlow:_click2smsFlow.default,ussdFlow:_ussdFlow.default})};exports.default=_default;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _redux=require("redux"),_click2smsFlow=_interopRequireDefault(require("../reducers/click2smsFlow")),_creditCardFlow=_interopRequireDefault(require("../reducers/creditCardFlow")),_moFlow=_interopRequireDefault(require("../reducers/moFlow")),_moRedirFlow=_interopRequireDefault(require("../reducers/moRedirFlow")),_oneClickFlow=_interopRequireDefault(require("../reducers/oneClickFlow")),_pinFlow=_interopRequireDefault(require("../reducers/pinFlow")),_strategy=_interopRequireDefault(require("../reducers/strategy")),_ussdFlow=_interopRequireDefault(require("../reducers/ussdFlow"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _default=function(){return(0,_redux.combineReducers)({strategy:_strategy.default,pinFlow:_pinFlow.default,moFlow:_moFlow.default,moRedirFlow:_moRedirFlow.default,oneClickFlow:_oneClickFlow.default,click2smsFlow:_click2smsFlow.default,ussdFlow:_ussdFlow.default,creditCardFlow:_creditCardFlow.default})};exports.default=_default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "3.0.33",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",