ouisys-engine 4.6.3 → 4.7.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RemoteDataState-CwHLI23e.js +75 -0
- package/dist/RemoteDataState-CwHLI23e.js.map +1 -0
- package/dist/bupperizeCountry-CCDIOHP6.js +4 -0
- package/dist/bupperizeCountry-CCDIOHP6.js.map +1 -0
- package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js +27 -0
- package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js.map +1 -0
- package/dist/checkSubscriptionHander.js +53 -0
- package/dist/checkSubscriptionHander.js.map +1 -0
- package/dist/click2smsFlow.js +246 -0
- package/dist/click2smsFlow.js.map +1 -0
- package/dist/creditCardFlow.js +248 -0
- package/dist/creditCardFlow.js.map +1 -0
- package/dist/getConfig.js +14 -0
- package/dist/getConfig.js.map +1 -0
- package/dist/handleClickChainFlow.js +32 -0
- package/dist/handleClickChainFlow.js.map +1 -0
- package/dist/handleSubmitNumber.js +65 -0
- package/dist/handleSubmitNumber.js.map +1 -0
- package/dist/helpers-J_h-ZgxH.js +29 -0
- package/dist/helpers-J_h-ZgxH.js.map +1 -0
- package/dist/loadScriptInnerHtml-DPcoY467.js +26 -0
- package/dist/loadScriptInnerHtml-DPcoY467.js.map +1 -0
- package/dist/moFlow.js +275 -0
- package/dist/moFlow.js.map +1 -0
- package/dist/moRedirFlow.js +225 -0
- package/dist/moRedirFlow.js.map +1 -0
- package/dist/oneClickFlow.js +464 -0
- package/dist/oneClickFlow.js.map +1 -0
- package/dist/pinFlow.js +697 -0
- package/dist/pinFlow.js.map +1 -0
- package/dist/searchToObject.js +19 -0
- package/dist/searchToObject.js.map +1 -0
- package/dist/storeMsisdn-ChiBh8mI.js +58 -0
- package/dist/storeMsisdn-ChiBh8mI.js.map +1 -0
- package/dist/strategy.js +50 -0
- package/dist/strategy.js.map +1 -0
- package/dist/strategySlice-bF74rxDK.js +842 -0
- package/dist/strategySlice-bF74rxDK.js.map +1 -0
- package/dist/tracker-B_zsMRN2.js +79 -0
- package/dist/tracker-B_zsMRN2.js.map +1 -0
- package/dist/tracker.js +5 -0
- package/dist/tracker.js.map +1 -0
- package/dist/tryGetIPRangeName-C69HEG5W.js +42 -0
- package/dist/tryGetIPRangeName-C69HEG5W.js.map +1 -0
- package/dist/types/CreditCardTypes-B-IT-l6I.d.ts +72 -0
- package/dist/types/IHash-0OgZ_1ij.d.ts +5 -0
- package/dist/types/MoRedirTypes-4tEJjT1g.d.ts +31 -0
- package/dist/types/MoTypes-D-UK92gs.d.ts +45 -0
- package/dist/types/OneClickTypes-DF0jodl-.d.ts +69 -0
- package/dist/types/PinTypes-BLJDBZe6.d.ts +128 -0
- package/dist/types/RemoteDataState-D1aFrz8W.d.ts +61 -0
- package/dist/types/StrategyTypes-BEIYqoJV.d.ts +325 -0
- package/dist/types/UssdTypes-C7QlIW11.d.ts +34 -0
- package/dist/types/checkSubscriptionHander.d.ts +8 -0
- package/dist/types/click2smsFlow.d.ts +37 -0
- package/dist/types/creditCardFlow.d.ts +37 -0
- package/dist/types/getConfig.d.ts +38 -0
- package/dist/types/handleClickChainFlow.d.ts +6 -0
- package/dist/types/handleSubmitNumber.d.ts +26 -0
- package/dist/types/moFlow.d.ts +70 -0
- package/dist/types/moRedirFlow.d.ts +82 -0
- package/dist/types/oneClickFlow.d.ts +56 -0
- package/dist/types/pinFlow.d.ts +179 -0
- package/dist/types/searchToObject.d.ts +3 -0
- package/dist/types/strategy.d.ts +86 -0
- package/dist/types/tracker.d.ts +5 -0
- package/dist/types/ussdFlow.d.ts +84 -0
- package/dist/ussdFlow.js +211 -0
- package/dist/ussdFlow.js.map +1 -0
- package/package.json +85 -9
- package/.babelrc +0 -30
- package/.browserslistrc +0 -6
- package/.eslintrc.js +0 -3
- package/.nvmrc +0 -1
- package/.prettierignore +0 -4
- package/dist/@types/react-tracker.d.js +0 -1
- package/dist/@types/redux-cli-logger.d.js +0 -1
- package/dist/@types/tiny-async-pool.d.js +0 -1
- package/dist/@types/window.d.js +0 -1
- package/dist/api/index.d.ts +0 -43
- package/dist/api/index.js +0 -1
- package/dist/common-types/AppThunk.d.ts +0 -13
- package/dist/common-types/AppThunk.js +0 -1
- package/dist/common-types/Either.d.ts +0 -8
- package/dist/common-types/Either.js +0 -1
- package/dist/common-types/IError.d.ts +0 -3
- package/dist/common-types/IError.js +0 -1
- package/dist/common-types/IOptInFlowName.d.ts +0 -1
- package/dist/common-types/IOptInFlowName.js +0 -1
- package/dist/common-types/ITracker.d.ts +0 -9
- package/dist/common-types/ITracker.js +0 -1
- package/dist/common-types/IVisitor.d.ts +0 -14
- package/dist/common-types/IVisitor.js +0 -1
- package/dist/common-types/RemoteDataState.d.ts +0 -38
- package/dist/common-types/RemoteDataState.js +0 -1
- package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +0 -3
- package/dist/custom-hooks/useOneClickRedirectUrl.js +0 -1
- package/dist/custom-hooks/usePinEntryState.d.ts +0 -8
- package/dist/custom-hooks/usePinEntryState.js +0 -1
- package/dist/custom-hooks/useStrategyConfig.d.ts +0 -4
- package/dist/custom-hooks/useStrategyConfig.js +0 -1
- package/dist/flows/click2smsFlow.d.ts +0 -6
- package/dist/flows/click2smsFlow.js +0 -1
- package/dist/flows/creditCardFlow.d.ts +0 -6
- package/dist/flows/creditCardFlow.js +0 -1
- package/dist/flows/moFlow.d.ts +0 -6
- package/dist/flows/moFlow.js +0 -1
- package/dist/flows/moRedirFlow.d.ts +0 -6
- package/dist/flows/moRedirFlow.js +0 -1
- package/dist/flows/oneClickFlow.d.ts +0 -7
- package/dist/flows/oneClickFlow.js +0 -1
- package/dist/flows/pinFlow.d.ts +0 -7
- package/dist/flows/pinFlow.js +0 -1
- package/dist/flows/strategy.d.ts +0 -14
- package/dist/flows/strategy.js +0 -1
- package/dist/flows/ussdFlow.d.ts +0 -6
- package/dist/flows/ussdFlow.js +0 -1
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -1
- package/dist/ips/tryGetIPRangeName.d.ts +0 -2
- package/dist/ips/tryGetIPRangeName.js +0 -1
- package/dist/jest.config.js +0 -194
- package/dist/pacman/index.d.ts +0 -6
- package/dist/pacman/index.js +0 -1
- package/dist/pacman/queryString.d.ts +0 -3
- package/dist/pacman/queryString.js +0 -1
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +0 -76
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +0 -1
- package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +0 -2
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +0 -1
- package/dist/reducers/click2smsFlow/index.d.ts +0 -5
- package/dist/reducers/click2smsFlow/index.js +0 -1
- package/dist/reducers/click2smsFlow/utils.d.ts +0 -4
- package/dist/reducers/click2smsFlow/utils.js +0 -1
- package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +0 -79
- package/dist/reducers/creditCardFlow/CreditCardTypes.js +0 -1
- package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +0 -2
- package/dist/reducers/creditCardFlow/ICreditCardConstants.js +0 -1
- package/dist/reducers/creditCardFlow/index.d.ts +0 -5
- package/dist/reducers/creditCardFlow/index.js +0 -1
- package/dist/reducers/creditCardFlow/utils.d.ts +0 -8
- package/dist/reducers/creditCardFlow/utils.js +0 -1
- package/dist/reducers/moFlow/IMoConstants.d.ts +0 -2
- package/dist/reducers/moFlow/IMoConstants.js +0 -1
- package/dist/reducers/moFlow/MoTypes.d.ts +0 -88
- package/dist/reducers/moFlow/MoTypes.js +0 -1
- package/dist/reducers/moFlow/index.d.ts +0 -16
- package/dist/reducers/moFlow/index.js +0 -1
- package/dist/reducers/moFlow/utils.d.ts +0 -12
- package/dist/reducers/moFlow/utils.js +0 -1
- package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +0 -2
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +0 -1
- package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +0 -64
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +0 -1
- package/dist/reducers/moRedirFlow/index.d.ts +0 -14
- package/dist/reducers/moRedirFlow/index.js +0 -1
- package/dist/reducers/moRedirFlow/utils.d.ts +0 -10
- package/dist/reducers/moRedirFlow/utils.js +0 -1
- package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +0 -2
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +0 -1
- package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +0 -85
- package/dist/reducers/oneClickFlow/OneClickTypes.js +0 -1
- package/dist/reducers/oneClickFlow/index.d.ts +0 -13
- package/dist/reducers/oneClickFlow/index.js +0 -1
- package/dist/reducers/oneClickFlow/utils.d.ts +0 -16
- package/dist/reducers/oneClickFlow/utils.js +0 -1
- package/dist/reducers/pinFlow/IPinConstants.d.ts +0 -2
- package/dist/reducers/pinFlow/IPinConstants.js +0 -1
- package/dist/reducers/pinFlow/PinTypes.d.ts +0 -156
- package/dist/reducers/pinFlow/PinTypes.js +0 -1
- package/dist/reducers/pinFlow/index.d.ts +0 -19
- package/dist/reducers/pinFlow/index.js +0 -1
- package/dist/reducers/pinFlow/utils.d.ts +0 -11
- package/dist/reducers/pinFlow/utils.js +0 -1
- package/dist/reducers/strategy/IStategyActionContants.d.ts +0 -2
- package/dist/reducers/strategy/IStategyActionContants.js +0 -1
- package/dist/reducers/strategy/StrategyTypes.d.ts +0 -248
- package/dist/reducers/strategy/StrategyTypes.js +0 -1
- package/dist/reducers/strategy/index.d.ts +0 -13
- package/dist/reducers/strategy/index.js +0 -1
- package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +0 -15
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +0 -1
- package/dist/reducers/strategy/strategies/ask_operator.d.ts +0 -5
- package/dist/reducers/strategy/strategies/ask_operator.js +0 -1
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +0 -10
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +0 -1
- package/dist/reducers/strategy/strategies/header_enrichment.d.ts +0 -7
- package/dist/reducers/strategy/strategies/header_enrichment.js +0 -1
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +0 -7
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +0 -1
- package/dist/reducers/strategy/utils.d.ts +0 -30
- package/dist/reducers/strategy/utils.js +0 -1
- package/dist/reducers/ussdFlow/IUssdConstants.d.ts +0 -2
- package/dist/reducers/ussdFlow/IUssdConstants.js +0 -1
- package/dist/reducers/ussdFlow/UssdTypes.d.ts +0 -77
- package/dist/reducers/ussdFlow/UssdTypes.js +0 -1
- package/dist/reducers/ussdFlow/index.d.ts +0 -14
- package/dist/reducers/ussdFlow/index.js +0 -1
- package/dist/reducers/ussdFlow/utils.d.ts +0 -11
- package/dist/reducers/ussdFlow/utils.js +0 -1
- package/dist/store/index.d.ts +0 -14
- package/dist/store/index.js +0 -1
- package/dist/store/reducers.d.ts +0 -20
- package/dist/store/reducers.js +0 -1
- package/dist/utilities/addEmpelloToken.d.ts +0 -4
- package/dist/utilities/addEmpelloToken.js +0 -1
- package/dist/utilities/handleSubmitNumber.d.ts +0 -21
- package/dist/utilities/handleSubmitNumber.js +0 -1
- package/dist/utilities/index.d.ts +0 -17
- package/dist/utilities/index.js +0 -1
- package/dist/utilities/loadScriptInnerHtml.d.ts +0 -2
- package/dist/utilities/loadScriptInnerHtml.js +0 -1
- package/dist/utilities/loadScriptSrc.d.ts +0 -8
- package/dist/utilities/loadScriptSrc.js +0 -1
- package/dist/utilities/replaceUrlParam.d.ts +0 -1
- package/dist/utilities/replaceUrlParam.js +0 -1
- package/dist/utilities/storeMsisdn.d.ts +0 -3
- package/dist/utilities/storeMsisdn.js +0 -1
- package/index.html +0 -49
- package/mockData/config.json +0 -28
- package/setupJest.js +0 -6
- package/tsconfig.json +0 -28
|
@@ -1 +0,0 @@
|
|
|
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.object.keys.js"),require("core-js/modules/es.array.filter.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.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=ask_operator,exports.he_pin_one_click_ask_operator=void 0,exports.selectOperator=selectOperator,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _=require(".."),RDS=_interopRequireWildcard(require("../../../common-types/RemoteDataState")),_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 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)})}}function ask_operator(){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch){var operators;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:try{operators=(0,_utils.getOperators)(),dispatch({type:"IDENTIFY_FLOW_BY_OPERATOR_SELECT",payload:{type:"IDENTIFY_FLOW_BY_OPERATOR_SELECT",result:{operators:operators,nextAction:"selectOperator"}}})}catch(err){dispatch({type:"IDENTIFY_FLOW_BY_OPERATOR_SELECT",payload:{type:"IDENTIFY_FLOW_BY_OPERATOR_SELECT",result:RDS.Failure(err)}})}case 1:case"end":return _context.stop();}},_callee)}));return function(_x){return _ref.apply(this,arguments)}}()}var he_pin_one_click_ask_operator=function he_pin_one_click_ask_operator(flowObj){return function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(dispatch){var heResult,msisdn;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:return _context2.prev=0,dispatch({type:"OPERATOR_SELECT",payload:{type:"PIN",result:RDS.Loading()}}),_context2.next=4,(0,_utils.identifyUser)();case 4:if(heResult=_context2.sent,void 0===heResult.msisdn||""===heResult.msisdn){_context2.next=9;break}return msisdn=heResult.msisdn,_.tracker.sendOptInFlowEvent("Hybrid Pin"),_context2.abrupt("return",dispatch({type:"OPERATOR_SELECT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id,isHeaderEnrichmentSuccess:!0}}}));case 9:return _.tracker.sendOptInFlowEvent("Pin"),_context2.abrupt("return",dispatch({type:"OPERATOR_SELECT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig}}}));case 13:_context2.prev=13,_context2.t0=_context2["catch"](0),console.warn(_context2.t0),_.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"OPERATOR_SELECT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig}}});case 18:case"end":return _context2.stop();}},_callee2,null,[[0,13]])}));return function(_x2){return _ref2.apply(this,arguments)}}()};exports.he_pin_one_click_ask_operator=he_pin_one_click_ask_operator;function selectOperator(operator){return function(dispatch){try{var flowObj=(0,_utils.determineFlowByOperator)(operator),_getConfig=(0,_utils.getConfig)(),strategy=_getConfig.strategy;switch(flowObj.flow){case"pin":return"he-pin-one-click-ask-operator"===strategy?dispatch(he_pin_one_click_ask_operator(flowObj)):(_.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"OPERATOR_SELECT",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,operator:operator}}}));case"mo":return _.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"OPERATOR_SELECT",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,operator:operator}}});case"click2sms":return _.tracker.sendOptInFlowEvent("Click to sms"),dispatch({type:"OPERATOR_SELECT",payload:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:_objectSpread({operators:[operator]},flowObj.flowConfig),operator:operator}}});case"oneClick":return _.tracker.sendOptInFlowEvent("3G click"),dispatch({type:"OPERATOR_SELECT",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:operator,autoRedirect:!0}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"OPERATOR_SELECT",payload:{type:"PIN",result:RDS.NothingYet()}});}}catch(ex){_.tracker.sendOptInFlowEvent("Pin"),console.log(ex),dispatch({type:"OPERATOR_SELECT",payload:{type:"PIN",result:RDS.NothingYet()}})}}}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../../common-types/AppThunk';
|
|
2
|
-
import { IFlow } from '../StrategyTypes';
|
|
3
|
-
export default function detect_operator_by_ip(): AppThunk;
|
|
4
|
-
export declare const pin_mo_detect_operator_by_ip: (defaultFlow: IFlow) => AppThunk;
|
|
5
|
-
export declare const mo_one_click_detect_operator_by_ip: (defaultFlow: IFlow) => AppThunk;
|
|
6
|
-
export declare const click2sms_one_click_detect_operator_by_ip: (defaultFlow: IFlow) => AppThunk;
|
|
7
|
-
export declare const pin_one_click_detect_operator_by_ip: (defaultFlow: IFlow) => AppThunk;
|
|
8
|
-
export declare const one_click_mo_pin_detect_operator_by_ip_or_msisdn: (_: IFlow) => AppThunk;
|
|
9
|
-
export declare const mo_redir_one_click_detect_operator_by_ip: (defaultFlow: IFlow) => AppThunk;
|
|
10
|
-
export declare const mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn: (_defaultFlow: IFlow) => AppThunk;
|
|
@@ -1 +0,0 @@
|
|
|
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.object.keys.js"),require("core-js/modules/es.array.filter.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.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.click2sms_one_click_detect_operator_by_ip=void 0,exports.default=detect_operator_by_ip,exports.pin_one_click_detect_operator_by_ip=exports.pin_mo_detect_operator_by_ip=exports.one_click_mo_pin_detect_operator_by_ip_or_msisdn=exports.mo_redir_one_click_detect_operator_by_ip=exports.mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=exports.mo_one_click_detect_operator_by_ip=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _2=require(".."),RDS=_interopRequireWildcard(require("../../../common-types/RemoteDataState")),_utils=require("../utils"),_ask_mobile_number=_interopRequireDefault(require("./ask_mobile_number"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function 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)})}}function detect_operator_by_ip(){return function(dispatch){try{dispatch({type:"DETECT_OPERATOR_BY_IP",payload:{type:"DETECT_OPERATOR_BY_IP",result:RDS.Loading()}});var _getConfig=(0,_utils.getConfig)(),strategy=_getConfig.strategy,strategyConfigs=_getConfig.strategyConfigs,defaultFlow=strategyConfigs.default;switch(strategy){case"pin-one-click-detect-operator-by-ip":return dispatch(pin_one_click_detect_operator_by_ip(defaultFlow));case"one-click-mo-pin-detect-operator-by-ip-or-msisdn":return dispatch(one_click_mo_pin_detect_operator_by_ip_or_msisdn(defaultFlow));case"mo-redir-one-click-detect-operator-by-ip":return dispatch(mo_redir_one_click_detect_operator_by_ip(defaultFlow));case"mo-one-click-detect-operator-by-ip":return dispatch(mo_one_click_detect_operator_by_ip(defaultFlow));case"click2sms-one-click-detect-operator-by-ip":return dispatch(click2sms_one_click_detect_operator_by_ip(defaultFlow));case"pin-mo-detect-operator-by-ip":return dispatch(pin_mo_detect_operator_by_ip(defaultFlow));case"mo-redir-mo-click2sms-one-click-detect-operator-by-ip-or-msisdn":return dispatch(mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn(defaultFlow));}}catch(err){dispatch({type:"DETECT_OPERATOR_BY_IP",payload:{type:"DETECT_OPERATOR_BY_IP",result:RDS.Failure(err)}})}}}var pin_mo_detect_operator_by_ip=function(defaultFlow){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch){var flowObj;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return _context.prev=0,_context.next=3,(0,_utils.determineFlowByOperatorFromIp)();case 3:flowObj=_context.sent,_context.t0=flowObj.flow,_context.next="mo"===_context.t0?7:"pin"===_context.t0?9:11;break;case 7:return _2.tracker.sendOptInFlowEvent("Msisdn to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 9:return _2.tracker.sendOptInFlowEvent("Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig}}}));case 11:return _2.tracker.sendOptInFlowEvent("Msisdn to sms"),_context.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:defaultFlow.flow.toUpperCase(),result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}}));case 13:_context.next=20;break;case 15:_context.prev=15,_context.t1=_context["catch"](0),console.warn(_context.t1),_2.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:defaultFlow.flow.toUpperCase(),result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}});case 20:case"end":return _context.stop();}},_callee,null,[[0,15]])}));return function(_x){return _ref.apply(this,arguments)}}()};exports.pin_mo_detect_operator_by_ip=pin_mo_detect_operator_by_ip;var mo_one_click_detect_operator_by_ip=function mo_one_click_detect_operator_by_ip(defaultFlow){return function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(dispatch){var flowObj;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:return _context2.prev=0,_context2.next=3,(0,_utils.determineFlowByOperatorFromIp)();case 3:flowObj=_context2.sent,_context2.t0=flowObj.flow,_context2.next="mo"===_context2.t0?7:"oneClick"===_context2.t0?9:11;break;case 7:return _2.tracker.sendOptInFlowEvent("Msisdn to sms"),_context2.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 9:return _2.tracker.sendOptInFlowEvent("3G click"),_context2.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 11:return _2.tracker.sendOptInFlowEvent("Msisdn to sms"),_context2.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}}));case 13:_context2.next=20;break;case 15:_context2.prev=15,_context2.t1=_context2["catch"](0),console.warn(_context2.t1),_2.tracker.sendOptInFlowEvent("Msisdn to sms"),dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"MO",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}});case 20:case"end":return _context2.stop();}},_callee2,null,[[0,15]])}));return function(_x2){return _ref2.apply(this,arguments)}}()};exports.mo_one_click_detect_operator_by_ip=mo_one_click_detect_operator_by_ip;var click2sms_one_click_detect_operator_by_ip=function click2sms_one_click_detect_operator_by_ip(defaultFlow){return function(){var _ref3=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(dispatch){var flowObj;return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:return _context3.prev=0,_context3.next=3,(0,_utils.determineFlowByOperatorFromIp)();case 3:flowObj=_context3.sent,_context3.t0=flowObj.flow,_context3.next="click2sms"===_context3.t0?7:"oneClick"===_context3.t0?9:11;break;case 7:return _2.tracker.sendOptInFlowEvent("Click to sms"),_context3.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:_objectSpread({operators:[flowObj.operator]},flowObj.flowConfig),operator:flowObj.operator}}}));case 9:return _2.tracker.sendOptInFlowEvent("3G click"),_context3.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 11:return _2.tracker.sendOptInFlowEvent("Click to sms"),_context3.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:defaultFlow.flowConfig}}}));case 13:_context3.next=20;break;case 15:_context3.prev=15,_context3.t1=_context3["catch"](0),console.warn(_context3.t1),_2.tracker.sendOptInFlowEvent("Click to sms"),dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"CLICK2SMS",result:{nextAction:"loadOc2sms",config:defaultFlow.flowConfig}}});case 20:case"end":return _context3.stop();}},_callee3,null,[[0,15]])}));return function(_x3){return _ref3.apply(this,arguments)}}()};exports.click2sms_one_click_detect_operator_by_ip=click2sms_one_click_detect_operator_by_ip;var pin_one_click_detect_operator_by_ip=function pin_one_click_detect_operator_by_ip(defaultFlow){return function(){var _ref4=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(dispatch){var flowObj;return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:return _context4.prev=0,_context4.next=3,(0,_utils.determineFlowByOperatorFromIp)();case 3:flowObj=_context4.sent,_context4.t0=flowObj.flow,_context4.next="pin"===_context4.t0?7:"oneClick"===_context4.t0?9:11;break;case 7:return _2.tracker.sendOptInFlowEvent("Pin"),_context4.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig}}}));case 9:return _2.tracker.sendOptInFlowEvent("3G click"),_context4.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 11:return _2.tracker.sendOptInFlowEvent("Pin"),_context4.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}}));case 13:_context4.next=20;break;case 15:_context4.prev=15,_context4.t1=_context4["catch"](0),console.warn(_context4.t1),_2.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}});case 20:case"end":return _context4.stop();}},_callee4,null,[[0,15]])}));return function(_x4){return _ref4.apply(this,arguments)}}()};exports.pin_one_click_detect_operator_by_ip=pin_one_click_detect_operator_by_ip;var one_click_mo_pin_detect_operator_by_ip_or_msisdn=function one_click_mo_pin_detect_operator_by_ip_or_msisdn(_){return function(){var _ref5=_asyncToGenerator(_regeneratorRuntime().mark(function _callee5(dispatch){var flowObj;return _regeneratorRuntime().wrap(function _callee5$(_context5){for(;1;)switch(_context5.prev=_context5.next){case 0:return _context5.prev=0,_context5.next=3,(0,_utils.determineFlowByOperatorFromIp)();case 3:flowObj=_context5.sent,_context5.t0=flowObj.flow,_context5.next="pin"===_context5.t0?7:"oneClick"===_context5.t0?9:11;break;case 7:return _2.tracker.sendOptInFlowEvent("Pin"),_context5.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 9:return _2.tracker.sendOptInFlowEvent("3G click"),_context5.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 11:return _2.tracker.sendOptInFlowEvent("Pin"),_context5.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig}}}));case 13:_context5.next=19;break;case 15:_context5.prev=15,_context5.t1=_context5["catch"](0),console.warn(_context5.t1),dispatch((0,_ask_mobile_number.default)());case 19:case"end":return _context5.stop();}},_callee5,null,[[0,15]])}));return function(_x5){return _ref5.apply(this,arguments)}}()};exports.one_click_mo_pin_detect_operator_by_ip_or_msisdn=one_click_mo_pin_detect_operator_by_ip_or_msisdn;var mo_redir_one_click_detect_operator_by_ip=function mo_redir_one_click_detect_operator_by_ip(defaultFlow){return function(){var _ref6=_asyncToGenerator(_regeneratorRuntime().mark(function _callee6(dispatch){var flowObj;return _regeneratorRuntime().wrap(function _callee6$(_context6){for(;1;)switch(_context6.prev=_context6.next){case 0:return _context6.prev=0,_context6.next=3,(0,_utils.determineFlowByOperatorFromIp)();case 3:flowObj=_context6.sent,_context6.t0=flowObj.flow,_context6.next="moRedir"===_context6.t0?7:"oneClick"===_context6.t0?9:11;break;case 7:return _2.tracker.sendOptInFlowEvent("Redirect"),_context6.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 9:return _2.tracker.sendOptInFlowEvent("3G click"),_context6.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 11:return _2.tracker.sendOptInFlowEvent("Redirect"),_context6.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}}));case 13:_context6.next=20;break;case 15:return _context6.prev=15,_context6.t1=_context6["catch"](0),console.warn(_context6.t1),_2.tracker.sendOptInFlowEvent("Redirect"),_context6.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}}));case 20:case"end":return _context6.stop();}},_callee6,null,[[0,15]])}));return function(_x6){return _ref6.apply(this,arguments)}}()};exports.mo_redir_one_click_detect_operator_by_ip=mo_redir_one_click_detect_operator_by_ip;var mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=function mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn(_defaultFlow){return function(){var _ref7=_asyncToGenerator(_regeneratorRuntime().mark(function _callee7(dispatch){var flowObj;return _regeneratorRuntime().wrap(function _callee7$(_context7){for(;1;)switch(_context7.prev=_context7.next){case 0:return _context7.prev=0,_context7.next=3,(0,_utils.determineFlowByOperatorFromIp)();case 3:flowObj=_context7.sent,_context7.t0=flowObj.flow,_context7.next="moRedir"===_context7.t0?7:"oneClick"===_context7.t0?9:"click2sms"===_context7.t0?11:13;break;case 7:return _2.tracker.sendOptInFlowEvent("Redirect"),_context7.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 9:return _2.tracker.sendOptInFlowEvent("3G click"),_context7.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:flowObj.operator}}}));case 11:return _2.tracker.sendOptInFlowEvent("Click to sms"),_context7.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_IP_OPERATOR",payload:{type:"CLICK2SMS",result:{config:_objectSpread({operators:[flowObj.operator]},flowObj.flowConfig),operator:flowObj.operator}}}));case 13:dispatch((0,_ask_mobile_number.default)());case 14:_context7.next=20;break;case 16:_context7.prev=16,_context7.t1=_context7["catch"](0),console.warn(_context7.t1),dispatch((0,_ask_mobile_number.default)());case 20:case"end":return _context7.stop();}},_callee7,null,[[0,16]])}));return function(_x7){return _ref7.apply(this,arguments)}}()};exports.mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn=mo_redir_mo_click2sms_one_click_detect_operator_by_ip_or_msisdn;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../../common-types/AppThunk';
|
|
2
|
-
import { IFlow } from '../StrategyTypes';
|
|
3
|
-
export default function identify_user(): AppThunk;
|
|
4
|
-
export declare const pin_header_enrichment: (defaultFlow: IFlow) => AppThunk;
|
|
5
|
-
export declare const he_pin_one_click_header_enrichment: (defaultFlow: IFlow) => AppThunk;
|
|
6
|
-
export declare const he_mo_redir_one_click_header_enrichment: (defaultFlow: IFlow) => AppThunk;
|
|
7
|
-
export declare const he_pin_mo_redir_header_enrichment: (defaultFlow: IFlow) => AppThunk;
|
|
@@ -1 +0,0 @@
|
|
|
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.default=identify_user,exports.pin_header_enrichment=exports.he_pin_one_click_header_enrichment=exports.he_pin_mo_redir_header_enrichment=exports.he_mo_redir_one_click_header_enrichment=void 0,require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _=require(".."),RDS=_interopRequireWildcard(require("../../../common-types/RemoteDataState")),_tryGetIPRangeName=_interopRequireDefault(require("../../../ips/tryGetIPRangeName")),_utilities=require("../../../utilities"),_utils=require("../utils");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _regeneratorRuntime(){"use strict";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return generator._invoke=function(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}(innerFn,self,context),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},function(error){return invoke("throw",error,resolve,reject)})}reject(record.arg)}var previousPromise;this._invoke=function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(delegate,context){var method=delegate.iterator[context.method];if(void 0===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method))return ContinueSentinel;context.method="throw",context.arg=new TypeError("The iterator does not provide a 'throw' method")}return ContinueSentinel}var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(Gp,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name))},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun},exports.awrap=function(arg){return{__await:arg}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next()})},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this}),define(Gp,"toString",function(){return"[object Generator]"}),exports.keys=function(object){var keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next}return next.done=!0,next}},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval},dispatchException:function dispatchException(exception){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(!hasCatch){if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record)},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel},finish:function finish(finallyLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}function 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 identify_user(){return function(dispatch){try{var _getConfig=(0,_utils.getConfig)(),strategy=_getConfig.strategy,strategyConfigs=_getConfig.strategyConfigs,defaultFlow=strategyConfigs.default;switch(strategy){case"pin-header-enrichment":return dispatch(pin_header_enrichment(defaultFlow));case"he-pin-mo-redir-header-enrichment":return dispatch(he_pin_mo_redir_header_enrichment(defaultFlow));case"he-pin-one-click-header-enrichment":return dispatch(he_pin_one_click_header_enrichment(defaultFlow));case"he-mo-redir-one-click-header-enrichment":return dispatch(he_mo_redir_one_click_header_enrichment(defaultFlow));}}catch(err){dispatch({type:"HE_IDENTIFY",payload:{type:"HE_IDENTIFY",result:RDS.Failure(err)}})}}}var pin_header_enrichment=function(defaultFlow){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch){var _ipRangeName$toLowerC,_window,_window$pac_analytics,_window$pac_analytics2,_window$pac_analytics3,ipRangeName,isIPInRnge,heResult,flowObj,msisdn;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return _context.prev=0,_context.next=3,(0,_tryGetIPRangeName.default)(window.pac_analytics.visitor);case 3:if(ipRangeName=_context.sent,isIPInRnge=null!==ipRangeName||(null===ipRangeName||void 0===ipRangeName||null===(_ipRangeName$toLowerC=ipRangeName.toLowerCase())||void 0===_ipRangeName$toLowerC?void 0:_ipRangeName$toLowerC.includes("".concat(null===(_window=window)||void 0===_window||null===(_window$pac_analytics=_window.pac_analytics)||void 0===_window$pac_analytics||null===(_window$pac_analytics2=_window$pac_analytics.visitor)||void 0===_window$pac_analytics2||null===(_window$pac_analytics3=_window$pac_analytics2.country)||void 0===_window$pac_analytics3?void 0:_window$pac_analytics3.toLowerCase()))),isIPInRnge&&(0,_utils.searchToObject)().msisdn){_context.next=8;break}return _.tracker.sendOptInFlowEvent("Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}}));case 8:return _context.next=10,(0,_utils.identifyUser)();case 10:if(heResult=_context.sent,flowObj=defaultFlow,void 0===heResult.msisdn||""===heResult.msisdn){_context.next=17;break}return msisdn=heResult.msisdn,_.tracker.customEvent("Flow","advance-auto","msisdn-detected",{msisdn:msisdn}),_.tracker.sendOptInFlowEvent("Hybrid Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id,isHeaderEnrichmentSuccess:!0}}}));case 17:return _.tracker.sendOptInFlowEvent("Pin"),_context.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig}}}));case 21:_context.prev=21,_context.t0=_context["catch"](0),console.warn(_context.t0),_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:null===_context.t0||void 0===_context.t0?void 0:_context.t0.message}),_.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}});case 27:case"end":return _context.stop();}},_callee,null,[[0,21]])}));return function(_x){return _ref.apply(this,arguments)}}()};exports.pin_header_enrichment=pin_header_enrichment;var he_pin_one_click_header_enrichment=function he_pin_one_click_header_enrichment(defaultFlow){return function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(dispatch){var _window2,_window2$pac_analytic,_window2$pac_analytic2,_window2$pac_analytic3,_window2$pac_analytic4,search,switchState,ipRangeName,_window3,_window3$pac_analytic,_window3$pac_analytic2,mapIpRangeToAgency,flowObj,heResult,msisdn,subscription_url,redirect_url,operator;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:if(search=(0,_utils.searchToObject)(),switchState=function switchState(_ref3){var flowObj=_ref3.flowObj,msisdn=_ref3.msisdn,operator=_ref3.operator,subscription_url=_ref3.subscription_url,redirect_url=_ref3.redirect_url,isHeaderEnrichmentSuccess=void 0!==msisdn&&""!==msisdn;switch(flowObj.flow){case"oneClick":return _.tracker.sendOptInFlowEvent("3G click"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:flowObj.operator,subscription_url:subscription_url||null,redirect_url:redirect_url||null}}});case"pin":return!0===isHeaderEnrichmentSuccess?_.tracker.sendOptInFlowEvent("Hybrid Pin"):_.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id,operator:operator,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig,rockman_id:defaultFlow.rockman_id}}});}},_context2.t0=null===search||void 0===search?void 0:search.operator,_context2.t0){_context2.next=7;break}return _context2.next=6,(0,_tryGetIPRangeName.default)(window.pac_analytics.visitor);case 6:_context2.t0=_context2.sent;case 7:if(ipRangeName=_context2.t0,null!==(_window2=window)&&void 0!==_window2&&null!==(_window2$pac_analytic=_window2.pac_analytics)&&void 0!==_window2$pac_analytic&&null!==(_window2$pac_analytic2=_window2$pac_analytic.visitor)&&void 0!==_window2$pac_analytic2&&null!==(_window2$pac_analytic3=_window2$pac_analytic2.ip_range_name)&&void 0!==_window2$pac_analytic3&&null!==(_window2$pac_analytic4=_window2$pac_analytic3.toLowerCase())&&void 0!==_window2$pac_analytic4&&_window2$pac_analytic4.includes("cz")){_context2.next=11;break}return _.tracker.sendOptInFlowEvent("Pin"),_context2.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig,rockman_id:defaultFlow.rockman_id}}}));case 11:if(_context2.prev=11,mapIpRangeToAgency={om_ooredoo:"o2_ooredoo"},flowObj=(0,_utils.determineFlowByOperator)((0,_utilities.hasNumber)(null===(_window3=window)||void 0===_window3||null===(_window3$pac_analytic=_window3.pac_analytics)||void 0===_window3$pac_analytic||null===(_window3$pac_analytic2=_window3$pac_analytic.visitor)||void 0===_window3$pac_analytic2?void 0:_window3$pac_analytic2.country)?mapIpRangeToAgency[ipRangeName]:ipRangeName),"oneClick"!==flowObj.flow){_context2.next=23;break}return _context2.next=17,(0,_utils.identifyUser)({operator:ipRangeName});case 17:heResult=_context2.sent,msisdn=heResult.msisdn,subscription_url=heResult.subscription_url,redirect_url=heResult.redirect_url,operator=heResult.operator?heResult.operator.toUpperCase():ipRangeName.toUpperCase(),msisdn&&""!==msisdn?(_.tracker.customEvent("Flow","advance-auto","msisdn-detected",{msisdn:msisdn}),switchState({flowObj:flowObj,msisdn:msisdn,operator:operator,subscription_url:subscription_url,redirect_url:redirect_url})):switchState({flowObj:flowObj,redirect_url:redirect_url,subscription_url:subscription_url,operator:operator}),_context2.next=25;break;case 23:return _.tracker.sendOptInFlowEvent("Pin"),_context2.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig,rockman_id:defaultFlow.rockman_id}}}));case 25:_context2.next=33;break;case 27:_context2.prev=27,_context2.t1=_context2["catch"](11),console.warn(_context2.t1),_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:null===_context2.t1||void 0===_context2.t1?void 0:_context2.t1.message}),_.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}});case 33:case"end":return _context2.stop();}},_callee2,null,[[11,27]])}));return function(_x2){return _ref2.apply(this,arguments)}}()};exports.he_pin_one_click_header_enrichment=he_pin_one_click_header_enrichment;var he_mo_redir_one_click_header_enrichment=function he_mo_redir_one_click_header_enrichment(defaultFlow){return function(){var _ref4=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(dispatch){var switchState,searchObj,ipRangeName,flowObj,heResult,msisdn,subscription_url,redirect_url,operator;return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:if(switchState=function switchState(_ref5){var flowObj=_ref5.flowObj,msisdn=_ref5.msisdn,operator=_ref5.operator,subscription_url=_ref5.subscription_url,redirect_url=_ref5.redirect_url,isHeaderEnrichmentSuccess=void 0!==msisdn&&""!==msisdn;switch(flowObj.flow){case"oneClick":return _.tracker.sendOptInFlowEvent("3G click"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"ONE_CLICK",result:{nextAction:"getRedirectUrlAction",config:flowObj.flowConfig,operator:flowObj.operator,subscription_url:subscription_url||null,redirect_url:redirect_url||null}}});case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id,operator:operator,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess}}});default:return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig,rockman_id:defaultFlow.rockman_id}}});}},searchObj=(0,_utils.searchToObject)(),_context3.t1=null===searchObj||void 0===searchObj?void 0:searchObj.operator,_context3.t1){_context3.next=7;break}return _context3.next=6,(0,_tryGetIPRangeName.default)(window.pac_analytics.visitor);case 6:_context3.t1=_context3.sent;case 7:if(_context3.t0=_context3.t1,_context3.t0){_context3.next=10;break}_context3.t0=null;case 10:if(ipRangeName=_context3.t0,null!==ipRangeName){_context3.next=14;break}return _.tracker.sendOptInFlowEvent("Redirect"),_context3.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig,rockman_id:defaultFlow.rockman_id}}}));case 14:if(_context3.prev=14,flowObj=(0,_utils.determineFlowByOperator)(ipRangeName.toUpperCase()),"oneClick"!==flowObj.flow){_context3.next=25;break}return _context3.next=19,(0,_utils.identifyUser)({operator:ipRangeName});case 19:heResult=_context3.sent,msisdn=heResult.msisdn,subscription_url=heResult.subscription_url,redirect_url=heResult.redirect_url,operator=heResult.operator?heResult.operator.toUpperCase():ipRangeName.toUpperCase(),msisdn&&""!==msisdn?(_.tracker.customEvent("Flow","advance-auto","msisdn-detected",{msisdn:msisdn}),switchState({flowObj:flowObj,msisdn:msisdn,operator:operator,subscription_url:subscription_url,redirect_url:redirect_url})):switchState({flowObj:flowObj,redirect_url:redirect_url,subscription_url:subscription_url,operator:operator}),_context3.next=27;break;case 25:return _.tracker.sendOptInFlowEvent("Redirect"),_context3.abrupt("return",dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig,rockman_id:defaultFlow.rockman_id}}}));case 27:_context3.next=35;break;case 29:_context3.prev=29,_context3.t2=_context3["catch"](14),console.warn(_context3.t2),_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:null===_context3.t2||void 0===_context3.t2?void 0:_context3.t2.message}),_.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}});case 35:case"end":return _context3.stop();}},_callee3,null,[[14,29]])}));return function(_x3){return _ref4.apply(this,arguments)}}()};exports.he_mo_redir_one_click_header_enrichment=he_mo_redir_one_click_header_enrichment;var he_pin_mo_redir_header_enrichment=function he_pin_mo_redir_header_enrichment(defaultFlow){return function(){var _ref6=_asyncToGenerator(_regeneratorRuntime().mark(function _callee4(dispatch){var switchState,heResult,msisdn,operator,flowObj,_flowObj,_flowObj2,_flowObj3;return _regeneratorRuntime().wrap(function _callee4$(_context4){for(;1;)switch(_context4.prev=_context4.next){case 0:return switchState=function switchState(flowObj,msisdn,operator){var isHeaderEnrichmentSuccess=void 0!==msisdn&&""!==msisdn;switch(flowObj.flow){case"moRedir":return _.tracker.sendOptInFlowEvent("Redirect"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"MO_REDIR",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id,operator:operator,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess}}});case"pin":return!0===isHeaderEnrichmentSuccess?_.tracker.sendOptInFlowEvent("Hybrid Pin"):_.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:flowObj.flowConfig,msisdn:msisdn,rockman_id:flowObj.rockman_id,operator:operator,isHeaderEnrichmentSuccess:isHeaderEnrichmentSuccess}}});default:return _.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig,rockman_id:defaultFlow.rockman_id}}});}},_context4.prev=1,_context4.next=4,(0,_utils.identifyUser)();case 4:if(heResult=_context4.sent,void 0===heResult.msisdn||""===heResult.msisdn){_context4.next=20;break}if(msisdn=heResult.msisdn,operator=heResult.operator,_.tracker.customEvent("Flow","advance-auto","msisdn-detected",{msisdn:msisdn}),!operator||""===operator){_context4.next=14;break}flowObj=(0,_utils.determineFlowByOperator)(operator),switchState(flowObj,msisdn,operator),_context4.next=18;break;case 14:return _context4.next=16,(0,_utils.determineFlowByOperatorFromIp)();case 16:_flowObj=_context4.sent,switchState(_flowObj,msisdn);case 18:_context4.next=24;break;case 20:return _context4.next=22,(0,_utils.determineFlowByOperatorFromIp)();case 22:_flowObj2=_context4.sent,switchState(_flowObj2);case 24:_context4.next=42;break;case 26:return _context4.prev=26,_context4.t0=_context4["catch"](1),console.warn(_context4.t0),_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:null===_context4.t0||void 0===_context4.t0?void 0:_context4.t0.message}),_context4.prev=30,_context4.next=33,(0,_utils.determineFlowByOperatorFromIp)();case 33:_flowObj3=_context4.sent,switchState(_flowObj3),_context4.next=42;break;case 37:_context4.prev=37,_context4.t1=_context4["catch"](30),console.warn(_context4.t1),_.tracker.sendOptInFlowEvent("Pin"),dispatch({type:"IDENTIFY_FLOW_BY_HE",payload:{type:"PIN",result:{nextAction:"submitMSISDNAction",config:defaultFlow.flowConfig}}});case 42:case"end":return _context4.stop();}},_callee4,null,[[1,26],[30,37]])}));return function(_x4){return _ref6.apply(this,arguments)}}()};exports.he_pin_mo_redir_header_enrichment=he_pin_mo_redir_header_enrichment;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../../common-types/AppThunk';
|
|
2
|
-
/**
|
|
3
|
-
* Injects the header enrichment script and performs various actions based on the script's result.
|
|
4
|
-
* If header enrichment is successful, its submits the msisdn to identify user and starts the flow.
|
|
5
|
-
* @return {AppThunk} An async function that dispatches actions based on the script's result.
|
|
6
|
-
*/
|
|
7
|
-
export default function injectHeaderEnrichmentScript(): AppThunk;
|
|
@@ -1 +0,0 @@
|
|
|
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.weak-map.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=injectHeaderEnrichmentScript,require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.array.includes.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.string.includes.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js");var _awesomePhonenumber=_interopRequireDefault(require("awesome-phonenumber")),_=require(".."),_loadScriptSrc=_interopRequireDefault(require("../../../utilities/loadScriptSrc")),_ask_mobile_number=_interopRequireWildcard(require("./ask_mobile_number"));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)})}}function injectHeaderEnrichmentScript(){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch){var _window,_window$pac_analytics,_window$pac_analytics2,_window$pac_analytics3,_window2,_window2$pac_analytic,_window2$pac_analytic2,_window3,_window3$pac_analytic,_window3$pac_analytic2,_window4,_window4$pac_analytic,_window4$pac_analytic2,_window5,_window5$pac_analytic,_window5$pac_analytic2,gateway,heMsisdn,heOperator,page,country,pn,internationalMsisdn,msisdnDetected,timerExpired,timerId,abTestPages,_window6,_window6$pac_analytic,_window6$pac_analytic2,_window7,_window7$pac_analytic,_window7$pac_analytic2,url,_window8,_window8$pac_analytic,_window8$pac_analytic2,_window8$pac_analytic3,_window9,_window9$TPay,_window9$TPay$HeaderE,isEnriched,heMsisdnTpay,_pn2,_internationalMsisdn2,operatorCode,operatorCodeMapping;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:try{if(gateway=null===(_window=window)||void 0===_window||null===(_window$pac_analytics=_window.pac_analytics)||void 0===_window$pac_analytics||null===(_window$pac_analytics2=_window$pac_analytics.visitor)||void 0===_window$pac_analytics2||null===(_window$pac_analytics3=_window$pac_analytics2.genericJsLinkResult)||void 0===_window$pac_analytics3?void 0:_window$pac_analytics3.gateway,heMsisdn=null===(_window2=window)||void 0===_window2||null===(_window2$pac_analytic=_window2.pac_analytics)||void 0===_window2$pac_analytic||null===(_window2$pac_analytic2=_window2$pac_analytic.visitor)||void 0===_window2$pac_analytic2?void 0:_window2$pac_analytic2.heMsisdn,heOperator=null===(_window3=window)||void 0===_window3||null===(_window3$pac_analytic=_window3.pac_analytics)||void 0===_window3$pac_analytic||null===(_window3$pac_analytic2=_window3$pac_analytic.visitor)||void 0===_window3$pac_analytic2?void 0:_window3$pac_analytic2.heOperator,page=null===(_window4=window)||void 0===_window4||null===(_window4$pac_analytic=_window4.pac_analytics)||void 0===_window4$pac_analytic||null===(_window4$pac_analytic2=_window4$pac_analytic.visitor)||void 0===_window4$pac_analytic2?void 0:_window4$pac_analytic2.page,country=null===(_window5=window)||void 0===_window5||null===(_window5$pac_analytic=_window5.pac_analytics)||void 0===_window5$pac_analytic||null===(_window5$pac_analytic2=_window5$pac_analytic.visitor)||void 0===_window5$pac_analytic2?void 0:_window5$pac_analytic2.country,heMsisdn&&(pn=new _awesomePhonenumber.default(heMsisdn,country),internationalMsisdn=pn.getNumber("e164"),heMsisdn=internationalMsisdn.slice(1)),msisdnDetected=!1,timerExpired=!1,abTestPages=["ae-fl-infomedia-evina-hetest","ae-video-beyondvr-he-test","ae-video-beyondvr-3sec-hetest","ae-beyondvr-fileready-he-3sec","ae-video-beyondvr-he-timer","ae-video-beyondvr-cta-visible"],abTestPages.includes(page)&&(timerId=setTimeout(function(){!1===msisdnDetected&&(timerExpired=!0,_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:"3 second timer expired"}),window.isPrelanderClicked=!0,dispatch((0,_ask_mobile_number.default)()))},3e3)),"tpay"===gateway||heMsisdn||(url="http://de-he.tallymans.com/tallyman/he?country=".concat(null===(_window6=window)||void 0===_window6||null===(_window6$pac_analytic=_window6.pac_analytics)||void 0===_window6$pac_analytic||null===(_window6$pac_analytic2=_window6$pac_analytic.visitor)||void 0===_window6$pac_analytic2?void 0:_window6$pac_analytic2.country,"&rockman_id=").concat(null===(_window7=window)||void 0===_window7||null===(_window7$pac_analytic=_window7.pac_analytics)||void 0===_window7$pac_analytic||null===(_window7$pac_analytic2=_window7$pac_analytic.visitor)||void 0===_window7$pac_analytic2?void 0:_window7$pac_analytic2.rockmanId),_.tracker.customEvent("Flow","advance-auto","msisdn-detection-start",{url:url}),(0,_loadScriptSrc.default)({url:url,callBack:function callBack(){_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:"Could not load script possible reason is page is https and script is http"}),dispatch((0,_ask_mobile_number.default)())}})),window.addEventListener("he-success",function(event){var msisdn,_ref2=event,detail=_ref2.detail;if(detail.msisdn){var _pn=new _awesomePhonenumber.default(null===detail||void 0===detail?void 0:detail.msisdn,country),_internationalMsisdn=_pn.getNumber("e164");msisdn=_internationalMsisdn.slice(1)}abTestPages.includes(page)?!1===timerExpired&&(msisdnDetected=!0,clearTimeout(timerId),_.tracker.customEvent("Flow","advance-auto","msisdn-detected",{msisdn:msisdn}),dispatch((0,_ask_mobile_number.submitMSISDNAction)(msisdn,!0))):(_.tracker.customEvent("Flow","advance-auto","msisdn-detected",{msisdn:msisdn,operator:null===detail||void 0===detail?void 0:detail.operator_code}),dispatch((0,_ask_mobile_number.submitMSISDNAction)(msisdn,!0)))}),window.addEventListener("he-fail",function(){_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:"Header enrichment failed"}),dispatch((0,_ask_mobile_number.default)())}),"tpay"===gateway)try{_.tracker.customEvent("Flow","advance-auto","msisdn-detection-start",{url:null===(_window8=window)||void 0===_window8||null===(_window8$pac_analytic=_window8.pac_analytics)||void 0===_window8$pac_analytic||null===(_window8$pac_analytic2=_window8$pac_analytic.visitor)||void 0===_window8$pac_analytic2||null===(_window8$pac_analytic3=_window8$pac_analytic2.genericJsLinkResult)||void 0===_window8$pac_analytic3?void 0:_window8$pac_analytic3.jsLink}),isEnriched=null===(_window9=window)||void 0===_window9||null===(_window9$TPay=_window9.TPay)||void 0===_window9$TPay||null===(_window9$TPay$HeaderE=_window9$TPay.HeaderEnrichment)||void 0===_window9$TPay$HeaderE?void 0:_window9$TPay$HeaderE.enriched(),isEnriched?(heMsisdnTpay=window.TPay.HeaderEnrichment.msisdn(),heMsisdnTpay&&(_pn2=new _awesomePhonenumber.default(heMsisdnTpay,country),_internationalMsisdn2=_pn2.getNumber("e164"),heMsisdnTpay=_internationalMsisdn2.slice(1)),operatorCode=window.TPay.HeaderEnrichment.operatorCode(),operatorCodeMapping={42402:"AE_ETISALAT",42403:"AE_DU"},window.dispatchEvent(new CustomEvent("he-success",{detail:{msisdn:heMsisdnTpay,operator_code:operatorCodeMapping[operatorCode]}}))):(console.warn("Enriched() false, no msisdn, user need to submit msisdn"),_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:"Enriched() false, no msisdn, user need to submit msisdn"}),dispatch((0,_ask_mobile_number.default)()))}catch(e){console.error("Tpay Error",e),_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:null===e||void 0===e?void 0:e.message}),dispatch((0,_ask_mobile_number.default)())}heMsisdn&&window.dispatchEvent(new CustomEvent("he-success",{detail:{msisdn:heMsisdn,operator_code:heOperator}}))}catch(err){_.tracker.customEvent("Flow","recede-auto","msisdn-detection-failure",{errorType:null===err||void 0===err?void 0:err.message}),dispatch((0,_ask_mobile_number.default)())}case 1:case"end":return _context.stop();}},_callee)}));return function(_x){return _ref.apply(this,arguments)}}()}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import Either from '../../common-types/Either';
|
|
2
|
-
import { ILinkExtraParams } from '../oneClickFlow/OneClickTypes';
|
|
3
|
-
import { IConfig, IFlow, IStrategy, IStrategyReducerState } from './StrategyTypes';
|
|
4
|
-
export declare const wait: (ms: number) => Promise<unknown>;
|
|
5
|
-
export declare const loop: <_I extends {}, R extends {}>(f: () => Promise<R>, max: number, stop: (r: R) => boolean, i: number) => Promise<R>;
|
|
6
|
-
export declare function right<L, R>(r: R): Either<L, R>;
|
|
7
|
-
export declare function left<L, R>(l: L): Either<L, R>;
|
|
8
|
-
export declare const getConfig: () => IStrategy;
|
|
9
|
-
export declare const searchToObject: () => {};
|
|
10
|
-
export declare function determineFlowByMsidn(internationalMSISDN: string): Promise<IFlow>;
|
|
11
|
-
export declare function determineFlowByOperator(operator: string): IFlow;
|
|
12
|
-
export declare function determineFlowByOperatorFromIp(): Promise<IFlow>;
|
|
13
|
-
export declare function getOperators(): Array<string>;
|
|
14
|
-
export declare const identifyUser: (extraParams?: ILinkExtraParams) => Promise<{
|
|
15
|
-
msisdn: string;
|
|
16
|
-
operator: string;
|
|
17
|
-
subscription_url?: string;
|
|
18
|
-
redirect_url?: string;
|
|
19
|
-
action?: () => Promise<string>;
|
|
20
|
-
}>;
|
|
21
|
-
export declare const subscribe: (_url: string) => Promise<string>;
|
|
22
|
-
export declare function mockConfig(flow: string): IConfig;
|
|
23
|
-
export declare const mockedPinFlow: IStrategyReducerState;
|
|
24
|
-
export declare const mockedMoFlow: IStrategyReducerState;
|
|
25
|
-
export declare const mockedUssdFlow: IStrategyReducerState;
|
|
26
|
-
export declare const mockedMoRdirFlow: IStrategyReducerState;
|
|
27
|
-
export declare const mockedClick2smsFlow: IStrategyReducerState;
|
|
28
|
-
export declare const mockedOneClickFlow: IStrategyReducerState;
|
|
29
|
-
export declare const mockedTPayFlow: IStrategyReducerState;
|
|
30
|
-
export declare const mockedCreditCardFlow: IStrategyReducerState;
|
|
@@ -1 +0,0 @@
|
|
|
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.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.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.array.slice.js"),require("core-js/modules/es.string.replace.js"),require("core-js/modules/es.string.match.js");var _awesomePhonenumber=_interopRequireDefault(require("awesome-phonenumber")),_tryGetIPRangeName=_interopRequireDefault(require("../../ips/tryGetIPRangeName")),_utilities=require("../../utilities");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,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,flow=operatorsConfig[theResult.operator]||operatorsConfig[_utilities.mapAgencyOperator[theResult.operator]]?operatorsConfig[theResult.operator]||operatorsConfig[_utilities.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=19;break}throw _submissionError=new Error("Error in submitMSISDN() identify flow"),_submissionError.type="FlowDetectFailed",_submissionError.msisdn=msisdn,_submissionError;case 19:if(null===flow){_context5.next=24;break}return flowObj=_objectSpread({operator:theResult.operator,default:defaultFlowConfig},flow),_context5.abrupt("return",flowObj);case 24:if(null!==flow){_context5.next=29;break}return _flowObj=_objectSpread({operator:theResult.operator},defaultFlowConfig),_context5.abrupt("return",_flowObj);case 29:throw _submissionError2=new Error("Error in submitMSISDN() trigger-pin action"),_submissionError2.type="SEInvalidMSISDN",_submissionError2;case 32: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 _window$pac_analytics,_window$pac_analytics2,_window$pac_analytics3,_window$pac_analytics4,config,host,country,slug,queryString,device,bupperizeCountry,offer,rockmanId,s,search,extraParamsQs,isDMB,newHost,searchObj,identifyError,subscription_url,_newUrl,_newQueryString,_urlParams,_msisdn,_operator,_window,_window$pac_analytics5,_window$pac_analytics6,pn,internationalMsisdn,redirect_url,_newUrl2,_newQueryString2,_urlParams2,_msisdn2,_operator2,_window2,_window2$pac_analytic,_window2$pac_analytic2,_pn,_internationalMsisdn,newUrl,newQueryString,urlParams,msisdn,operator,_window3,_window3$pac_analytic,_window3$pac_analytic2,_pn2,_internationalMsisdn2,url,result,_identifyError,_msisdn3,_window4,_window4$pac_analytic,_window4$pac_analytic2,_pn3,_internationalMsisdn3;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!==(null===(_window$pac_analytics=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics||null===(_window$pac_analytics2=_window$pac_analytics.toLowerCase())||void 0===_window$pac_analytics2?void 0:_window$pac_analytics2.indexOf("dmb"))||(null===(_window$pac_analytics3=window.pac_analytics.visitor.xaid)||void 0===_window$pac_analytics3||null===(_window$pac_analytics4=_window$pac_analytics3.toLowerCase())||void 0===_window$pac_analytics4?void 0:_window$pac_analytics4.indexOf("amb"))),newHost=isDMB?"de.tallymans.com":host,searchObj=searchToObject(),!searchObj["redirect-back"]){_context2.next=49;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=31;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,_msisdn&&(pn=new _awesomePhonenumber.default(_msisdn,null===(_window=window)||void 0===_window||null===(_window$pac_analytics5=_window.pac_analytics)||void 0===_window$pac_analytics5||null===(_window$pac_analytics6=_window$pac_analytics5.visitor)||void 0===_window$pac_analytics6?void 0:_window$pac_analytics6.country),internationalMsisdn=pn.getNumber("e164"),_msisdn=internationalMsisdn.slice(1)),_context2.abrupt("return",{subscription_url:subscription_url,action:function action(){return subscribe(subscription_url)},msisdn:_msisdn,operator:_operator});case 31:if(!(null!==searchObj&&void 0!==searchObj&&searchObj.redirect_url)){_context2.next=40;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,_msisdn2&&(_pn=new _awesomePhonenumber.default(_msisdn2,null===(_window2=window)||void 0===_window2||null===(_window2$pac_analytic=_window2.pac_analytics)||void 0===_window2$pac_analytic||null===(_window2$pac_analytic2=_window2$pac_analytic.visitor)||void 0===_window2$pac_analytic2?void 0:_window2$pac_analytic2.country),_internationalMsisdn=_pn.getNumber("e164"),_msisdn2=_internationalMsisdn.slice(1)),_context2.abrupt("return",{redirect_url:redirect_url,msisdn:_msisdn2,operator:_operator2});case 40: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,msisdn&&(_pn2=new _awesomePhonenumber.default(msisdn,null===(_window3=window)||void 0===_window3||null===(_window3$pac_analytic=_window3.pac_analytics)||void 0===_window3$pac_analytic||null===(_window3$pac_analytic2=_window3$pac_analytic.visitor)||void 0===_window3$pac_analytic2?void 0:_window3$pac_analytic2.country),_internationalMsisdn2=_pn2.getNumber("e164"),msisdn=_internationalMsisdn2.slice(1)),_context2.abrupt("return",{msisdn:msisdn,operator:operator});case 47:_context2.next=61;break;case 49: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=52,fetchJsonp(url);case 52:if(result=_context2.sent,"false"!==result.success){_context2.next=59;break}throw _identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat(result.message)),_identifyError.type="NotOn3g",_identifyError;case 59:return result.msisdn&&(_pn3=new _awesomePhonenumber.default(result.msisdn,null===(_window4=window)||void 0===_window4||null===(_window4$pac_analytic=_window4.pac_analytics)||void 0===_window4$pac_analytic||null===(_window4$pac_analytic2=_window4$pac_analytic.visitor)||void 0===_window4$pac_analytic2?void 0:_window4$pac_analytic2.country),_internationalMsisdn3=_pn3.getNumber("e164"),_msisdn3=_internationalMsisdn3.slice(1)),_context2.abrupt("return",{subscription_url:result.subscription_url||result.redirect_url,action:function action(){return subscribe(result.subscription_url)},msisdn:_msisdn3,operator:result.operator});case 61: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","/product");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 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
-
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
|
-
export declare type IUssdFlowCurrentState = {
|
|
4
|
-
type: 'MSISDNEntry';
|
|
5
|
-
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
6
|
-
};
|
|
7
|
-
export declare type MSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN' | 'UnexpectedState';
|
|
8
|
-
export declare type MSISDNEntryFailure = {
|
|
9
|
-
errorType: MSISDNEntryErrorTypes;
|
|
10
|
-
error: any;
|
|
11
|
-
productUrl?: string;
|
|
12
|
-
};
|
|
13
|
-
export declare type MSISDNEntrySuccess = IKeywordShortcode;
|
|
14
|
-
export declare type IMsisnSubmitActionPayload = {
|
|
15
|
-
type: 'MSISDNEntry';
|
|
16
|
-
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
17
|
-
};
|
|
18
|
-
export interface IUssdFlowReducerState {
|
|
19
|
-
currentState: IUssdFlowCurrentState;
|
|
20
|
-
}
|
|
21
|
-
export declare type IConfig = {
|
|
22
|
-
offer?: number;
|
|
23
|
-
slug?: string;
|
|
24
|
-
country?: string;
|
|
25
|
-
host?: string;
|
|
26
|
-
device?: 'smart' | 'feature';
|
|
27
|
-
operators?: string[];
|
|
28
|
-
};
|
|
29
|
-
export declare type IKeywordShortcode = {
|
|
30
|
-
keyword: string;
|
|
31
|
-
shortcode: string;
|
|
32
|
-
};
|
|
33
|
-
export declare type IMSISDNSubmissionResult = {
|
|
34
|
-
success: true;
|
|
35
|
-
rockman_id: string;
|
|
36
|
-
keyword: string;
|
|
37
|
-
shortcode: string;
|
|
38
|
-
} | {
|
|
39
|
-
success: false;
|
|
40
|
-
rockman_id: string;
|
|
41
|
-
message: string;
|
|
42
|
-
};
|
|
43
|
-
export declare type ICheckSubscriptionResult = {
|
|
44
|
-
success: false;
|
|
45
|
-
rockman_id: string;
|
|
46
|
-
message: string;
|
|
47
|
-
} | {
|
|
48
|
-
success: true;
|
|
49
|
-
msisdn: string;
|
|
50
|
-
product_url?: string;
|
|
51
|
-
rockman_id: string;
|
|
52
|
-
};
|
|
53
|
-
export declare type IBackToStartPayload = {
|
|
54
|
-
type: 'MSISDNEntry';
|
|
55
|
-
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
56
|
-
};
|
|
57
|
-
export declare type IUssdActions = {
|
|
58
|
-
type: 'USSD_MSISDN_SUBMIT';
|
|
59
|
-
payload: IMsisnSubmitActionPayload;
|
|
60
|
-
} | {
|
|
61
|
-
type: 'USSD_MSISDN_SUBMIT_ERROR';
|
|
62
|
-
payload: IMsisdnSubmitErrorPayload;
|
|
63
|
-
} | {
|
|
64
|
-
type: 'USSD_BACK_TO_START';
|
|
65
|
-
payload: IBackToStartPayload;
|
|
66
|
-
} | {
|
|
67
|
-
type: 'MOCK_USSD_FLOW_STATE';
|
|
68
|
-
payload: IUssdFlowCurrentState;
|
|
69
|
-
};
|
|
70
|
-
export declare type IMsisdnSubmitErrorPayload = {
|
|
71
|
-
type: 'MSISDNEntry';
|
|
72
|
-
result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
|
|
73
|
-
};
|
|
74
|
-
export declare type IUssdFlowActionMaps = {
|
|
75
|
-
submitMSISDNAction: (msisdn: string) => AppThunk;
|
|
76
|
-
};
|
|
77
|
-
export declare type IMockUssdFlowStates = 'msisdn-entry-success-state' | 'msisdn-entry-failure-state';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AppThunk } from '../../common-types/AppThunk';
|
|
2
|
-
import * as RDS from '../../common-types/RemoteDataState';
|
|
3
|
-
import { IMockUssdFlowStates, IUssdActions, IUssdFlowActionMaps, IUssdFlowReducerState, MSISDNEntryFailure } from './UssdTypes';
|
|
4
|
-
export declare function submitMSISDNAction(msisdn: string): AppThunk;
|
|
5
|
-
export declare function mockUssdFlow(mockState: IMockUssdFlowStates): AppThunk;
|
|
6
|
-
export declare function backToStart(): {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: {
|
|
9
|
-
type: string;
|
|
10
|
-
result: RDS.RemoteDataState<MSISDNEntryFailure, import("./UssdTypes").IKeywordShortcode>;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare const UssdFlowActionMaps: IUssdFlowActionMaps;
|
|
14
|
-
export default function UssdFlowReducer(state: IUssdFlowReducerState, action: IUssdActions): IUssdFlowReducerState;
|
|
@@ -1 +0,0 @@
|
|
|
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.UssdFlowActionMaps=void 0,exports.backToStart=backToStart,exports.default=UssdFlowReducer,exports.mockUssdFlow=mockUssdFlow,exports.submitMSISDNAction=submitMSISDNAction,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=_interopRequireWildcard(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 submitMSISDNAction(msisdn){return function(){var _ref=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch,store){var currentState,config,keywordAndShortcode,errorType;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(currentState=store().strategy.currentState,"USSD"!==currentState.type){_context.next=28;break}return config=currentState.result.config,_context.prev=3,dispatch({type:"USSD_MSISDN_SUBMIT",payload:{type:"MSISDNEntry",result:RDS.Loading()}}),_strategy.tracker.advancedInFlow("tallyman.v1-ussd","msisdn-submitted",{msisdn:msisdn}),_context.next=8,(0,_utils.default)(window,config,msisdn);case 8:keywordAndShortcode=_context.sent,_strategy.tracker.advancedInFlow("tallyman.v1-ussd","msisdn-submission-success",{msisdn:msisdn}),dispatch({type:"USSD_MSISDN_SUBMIT",payload:{type:"MSISDNEntry",result:RDS.Success(_objectSpread({},keywordAndShortcode))}}),_context.prev=11,(0,_utils.checkSubscription)(window,config).then(function(product_url){_strategy.tracker.advancedInFlow("tallyman.v1-ussd","sale",{msisdn:msisdn}),setTimeout(function(){window.location.href=product_url},1e3)}),_context.next=18;break;case 15:throw _context.prev=15,_context.t0=_context["catch"](11),_context.t0;case 18:_context.next=26;break;case 20:_context.prev=20,_context.t1=_context["catch"](3),console.warn(_context.t1),errorType="SEAlreadySubscribed"===_context.t1.type?"AlreadySubscribed":"SEInvalidMSISDN"==_context.t1.type?"InvalidMSISDN":"UnknownError",_strategy.tracker.recedeInFlow("tallyman.v1-ussd","msisdn-submission-failure",{msisdn:msisdn,errorType:errorType||"UnknownError"}),dispatch({type:"USSD_MSISDN_SUBMIT_ERROR",payload:{type:"MSISDNEntry",result:RDS.Failure({errorType:errorType,error:_context.t1,productUrl:_context.t1.productUrl})}});case 26:_context.next=30;break;case 28:throw dispatch({type:"USSD_MSISDN_SUBMIT_ERROR",payload:{type:"MSISDNEntry",result:RDS.Failure({errorType:"UnexpectedState",error:null})}}),"Unexpected state";case 30:case"end":return _context.stop();}},_callee,null,[[3,20],[11,15]])}));return function(_x,_x2){return _ref.apply(this,arguments)}}()}function mockUssdFlow(mockState){return function(dispatch){if(mockState!==void 0)switch(mockState){case"msisdn-entry-failure-state":return dispatch({type:"MOCK_USSD_FLOW_STATE",payload:_utils.mockedMSISDNEntryFailure.currentState});case"msisdn-entry-success-state":return dispatch({type:"MOCK_USSD_FLOW_STATE",payload:_utils.mockedMSISDNEntrySuccess.currentState});default:throw"Mock Flow not supported";}}}function backToStart(){return{type:"USSD_BACK_TO_START",payload:{type:"MSISDNEntry",result:RDS.NothingYet()}}}var initialState={currentState:{type:"MSISDNEntry",result:RDS.NothingYet()}},UssdFlowActionMaps={submitMSISDNAction:submitMSISDNAction};exports.UssdFlowActionMaps=UssdFlowActionMaps;function UssdFlowReducer(){var state=0<arguments.length&&arguments[0]!==void 0?arguments[0]:initialState,action=1<arguments.length?arguments[1]:void 0;switch(action.type){case"USSD_MSISDN_SUBMIT":return(0,_strategy.genericHandler)(state,action.payload);case"USSD_BACK_TO_START":return(0,_strategy.genericHandler)(state,action.payload);case"USSD_MSISDN_SUBMIT_ERROR":return(0,_strategy.genericHandler)(state,action.payload);case"MOCK_USSD_FLOW_STATE":return(0,_strategy.genericHandler)(state,action.payload);default:return state;}}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IConfig, IKeywordShortcode, IUssdFlowReducerState } from './UssdTypes';
|
|
2
|
-
export default function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: {
|
|
3
|
-
[key: string]: string;
|
|
4
|
-
}): Promise<IKeywordShortcode>;
|
|
5
|
-
export declare function submitMSISDNWithConfig(window: Window, config: IConfig, internationalMSISDN: string, extraParams?: {
|
|
6
|
-
[key: string]: string;
|
|
7
|
-
}): Promise<IKeywordShortcode>;
|
|
8
|
-
export declare function checkSubscription(window: Window, maybeConfig: IConfig): Promise<string>;
|
|
9
|
-
export declare const formatSMSLink: (keywordAndShortcode: IKeywordShortcode) => string;
|
|
10
|
-
export declare const mockedMSISDNEntrySuccess: IUssdFlowReducerState;
|
|
11
|
-
export declare const mockedMSISDNEntryFailure: IUssdFlowReducerState;
|