ouisys-engine 4.6.2 → 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.
Files changed (222) hide show
  1. package/dist/RemoteDataState-CwHLI23e.js +75 -0
  2. package/dist/RemoteDataState-CwHLI23e.js.map +1 -0
  3. package/dist/bupperizeCountry-CCDIOHP6.js +4 -0
  4. package/dist/bupperizeCountry-CCDIOHP6.js.map +1 -0
  5. package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js +27 -0
  6. package/dist/checkSubscriptionByRockmanIdOnly-C89Ph9cV.js.map +1 -0
  7. package/dist/checkSubscriptionHander.js +53 -0
  8. package/dist/checkSubscriptionHander.js.map +1 -0
  9. package/dist/click2smsFlow.js +246 -0
  10. package/dist/click2smsFlow.js.map +1 -0
  11. package/dist/creditCardFlow.js +248 -0
  12. package/dist/creditCardFlow.js.map +1 -0
  13. package/dist/getConfig.js +14 -0
  14. package/dist/getConfig.js.map +1 -0
  15. package/dist/handleClickChainFlow.js +32 -0
  16. package/dist/handleClickChainFlow.js.map +1 -0
  17. package/dist/handleSubmitNumber.js +65 -0
  18. package/dist/handleSubmitNumber.js.map +1 -0
  19. package/dist/helpers-J_h-ZgxH.js +29 -0
  20. package/dist/helpers-J_h-ZgxH.js.map +1 -0
  21. package/dist/loadScriptInnerHtml-DPcoY467.js +26 -0
  22. package/dist/loadScriptInnerHtml-DPcoY467.js.map +1 -0
  23. package/dist/moFlow.js +275 -0
  24. package/dist/moFlow.js.map +1 -0
  25. package/dist/moRedirFlow.js +225 -0
  26. package/dist/moRedirFlow.js.map +1 -0
  27. package/dist/oneClickFlow.js +464 -0
  28. package/dist/oneClickFlow.js.map +1 -0
  29. package/dist/pinFlow.js +697 -0
  30. package/dist/pinFlow.js.map +1 -0
  31. package/dist/searchToObject.js +19 -0
  32. package/dist/searchToObject.js.map +1 -0
  33. package/dist/storeMsisdn-ChiBh8mI.js +58 -0
  34. package/dist/storeMsisdn-ChiBh8mI.js.map +1 -0
  35. package/dist/strategy.js +50 -0
  36. package/dist/strategy.js.map +1 -0
  37. package/dist/strategySlice-bF74rxDK.js +842 -0
  38. package/dist/strategySlice-bF74rxDK.js.map +1 -0
  39. package/dist/tracker-B_zsMRN2.js +79 -0
  40. package/dist/tracker-B_zsMRN2.js.map +1 -0
  41. package/dist/tracker.js +5 -0
  42. package/dist/tracker.js.map +1 -0
  43. package/dist/tryGetIPRangeName-C69HEG5W.js +42 -0
  44. package/dist/tryGetIPRangeName-C69HEG5W.js.map +1 -0
  45. package/dist/types/CreditCardTypes-B-IT-l6I.d.ts +72 -0
  46. package/dist/types/IHash-0OgZ_1ij.d.ts +5 -0
  47. package/dist/types/MoRedirTypes-4tEJjT1g.d.ts +31 -0
  48. package/dist/types/MoTypes-D-UK92gs.d.ts +45 -0
  49. package/dist/types/OneClickTypes-DF0jodl-.d.ts +69 -0
  50. package/dist/types/PinTypes-BLJDBZe6.d.ts +128 -0
  51. package/dist/types/RemoteDataState-D1aFrz8W.d.ts +61 -0
  52. package/dist/types/StrategyTypes-BEIYqoJV.d.ts +325 -0
  53. package/dist/types/UssdTypes-C7QlIW11.d.ts +34 -0
  54. package/dist/types/checkSubscriptionHander.d.ts +8 -0
  55. package/dist/types/click2smsFlow.d.ts +37 -0
  56. package/dist/types/creditCardFlow.d.ts +37 -0
  57. package/dist/types/getConfig.d.ts +38 -0
  58. package/dist/types/handleClickChainFlow.d.ts +6 -0
  59. package/dist/types/handleSubmitNumber.d.ts +26 -0
  60. package/dist/types/moFlow.d.ts +70 -0
  61. package/dist/types/moRedirFlow.d.ts +82 -0
  62. package/dist/types/oneClickFlow.d.ts +56 -0
  63. package/dist/types/pinFlow.d.ts +179 -0
  64. package/dist/types/searchToObject.d.ts +3 -0
  65. package/dist/types/strategy.d.ts +86 -0
  66. package/dist/types/tracker.d.ts +5 -0
  67. package/dist/types/ussdFlow.d.ts +84 -0
  68. package/dist/ussdFlow.js +211 -0
  69. package/dist/ussdFlow.js.map +1 -0
  70. package/package.json +85 -9
  71. package/.babelrc +0 -30
  72. package/.browserslistrc +0 -6
  73. package/.eslintrc.js +0 -3
  74. package/.nvmrc +0 -1
  75. package/.prettierignore +0 -4
  76. package/dist/@types/react-tracker.d.js +0 -1
  77. package/dist/@types/redux-cli-logger.d.js +0 -1
  78. package/dist/@types/tiny-async-pool.d.js +0 -1
  79. package/dist/@types/window.d.js +0 -1
  80. package/dist/api/index.d.ts +0 -43
  81. package/dist/api/index.js +0 -1
  82. package/dist/common-types/AppThunk.d.ts +0 -13
  83. package/dist/common-types/AppThunk.js +0 -1
  84. package/dist/common-types/Either.d.ts +0 -8
  85. package/dist/common-types/Either.js +0 -1
  86. package/dist/common-types/IError.d.ts +0 -3
  87. package/dist/common-types/IError.js +0 -1
  88. package/dist/common-types/IOptInFlowName.d.ts +0 -1
  89. package/dist/common-types/IOptInFlowName.js +0 -1
  90. package/dist/common-types/ITracker.d.ts +0 -9
  91. package/dist/common-types/ITracker.js +0 -1
  92. package/dist/common-types/IVisitor.d.ts +0 -14
  93. package/dist/common-types/IVisitor.js +0 -1
  94. package/dist/common-types/RemoteDataState.d.ts +0 -38
  95. package/dist/common-types/RemoteDataState.js +0 -1
  96. package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +0 -3
  97. package/dist/custom-hooks/useOneClickRedirectUrl.js +0 -1
  98. package/dist/custom-hooks/usePinEntryState.d.ts +0 -8
  99. package/dist/custom-hooks/usePinEntryState.js +0 -1
  100. package/dist/custom-hooks/useStrategyConfig.d.ts +0 -4
  101. package/dist/custom-hooks/useStrategyConfig.js +0 -1
  102. package/dist/flows/click2smsFlow.d.ts +0 -6
  103. package/dist/flows/click2smsFlow.js +0 -1
  104. package/dist/flows/creditCardFlow.d.ts +0 -6
  105. package/dist/flows/creditCardFlow.js +0 -1
  106. package/dist/flows/moFlow.d.ts +0 -6
  107. package/dist/flows/moFlow.js +0 -1
  108. package/dist/flows/moRedirFlow.d.ts +0 -6
  109. package/dist/flows/moRedirFlow.js +0 -1
  110. package/dist/flows/oneClickFlow.d.ts +0 -7
  111. package/dist/flows/oneClickFlow.js +0 -1
  112. package/dist/flows/pinFlow.d.ts +0 -7
  113. package/dist/flows/pinFlow.js +0 -1
  114. package/dist/flows/strategy.d.ts +0 -14
  115. package/dist/flows/strategy.js +0 -1
  116. package/dist/flows/ussdFlow.d.ts +0 -6
  117. package/dist/flows/ussdFlow.js +0 -1
  118. package/dist/index.d.ts +0 -0
  119. package/dist/index.js +0 -1
  120. package/dist/ips/tryGetIPRangeName.d.ts +0 -2
  121. package/dist/ips/tryGetIPRangeName.js +0 -1
  122. package/dist/jest.config.js +0 -194
  123. package/dist/pacman/index.d.ts +0 -6
  124. package/dist/pacman/index.js +0 -1
  125. package/dist/pacman/queryString.d.ts +0 -3
  126. package/dist/pacman/queryString.js +0 -1
  127. package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +0 -76
  128. package/dist/reducers/click2smsFlow/Click2smsTypes.js +0 -1
  129. package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +0 -2
  130. package/dist/reducers/click2smsFlow/IClick2smsConstants.js +0 -1
  131. package/dist/reducers/click2smsFlow/index.d.ts +0 -5
  132. package/dist/reducers/click2smsFlow/index.js +0 -1
  133. package/dist/reducers/click2smsFlow/utils.d.ts +0 -4
  134. package/dist/reducers/click2smsFlow/utils.js +0 -1
  135. package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +0 -79
  136. package/dist/reducers/creditCardFlow/CreditCardTypes.js +0 -1
  137. package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +0 -2
  138. package/dist/reducers/creditCardFlow/ICreditCardConstants.js +0 -1
  139. package/dist/reducers/creditCardFlow/index.d.ts +0 -5
  140. package/dist/reducers/creditCardFlow/index.js +0 -1
  141. package/dist/reducers/creditCardFlow/utils.d.ts +0 -8
  142. package/dist/reducers/creditCardFlow/utils.js +0 -1
  143. package/dist/reducers/moFlow/IMoConstants.d.ts +0 -2
  144. package/dist/reducers/moFlow/IMoConstants.js +0 -1
  145. package/dist/reducers/moFlow/MoTypes.d.ts +0 -88
  146. package/dist/reducers/moFlow/MoTypes.js +0 -1
  147. package/dist/reducers/moFlow/index.d.ts +0 -16
  148. package/dist/reducers/moFlow/index.js +0 -1
  149. package/dist/reducers/moFlow/utils.d.ts +0 -12
  150. package/dist/reducers/moFlow/utils.js +0 -1
  151. package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +0 -2
  152. package/dist/reducers/moRedirFlow/IMoRedirConstants.js +0 -1
  153. package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +0 -64
  154. package/dist/reducers/moRedirFlow/MoRedirTypes.js +0 -1
  155. package/dist/reducers/moRedirFlow/index.d.ts +0 -14
  156. package/dist/reducers/moRedirFlow/index.js +0 -1
  157. package/dist/reducers/moRedirFlow/utils.d.ts +0 -10
  158. package/dist/reducers/moRedirFlow/utils.js +0 -1
  159. package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +0 -2
  160. package/dist/reducers/oneClickFlow/IOneClickConstants.js +0 -1
  161. package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +0 -85
  162. package/dist/reducers/oneClickFlow/OneClickTypes.js +0 -1
  163. package/dist/reducers/oneClickFlow/index.d.ts +0 -13
  164. package/dist/reducers/oneClickFlow/index.js +0 -1
  165. package/dist/reducers/oneClickFlow/utils.d.ts +0 -16
  166. package/dist/reducers/oneClickFlow/utils.js +0 -1
  167. package/dist/reducers/pinFlow/IPinConstants.d.ts +0 -2
  168. package/dist/reducers/pinFlow/IPinConstants.js +0 -1
  169. package/dist/reducers/pinFlow/PinTypes.d.ts +0 -156
  170. package/dist/reducers/pinFlow/PinTypes.js +0 -1
  171. package/dist/reducers/pinFlow/index.d.ts +0 -19
  172. package/dist/reducers/pinFlow/index.js +0 -1
  173. package/dist/reducers/pinFlow/utils.d.ts +0 -11
  174. package/dist/reducers/pinFlow/utils.js +0 -1
  175. package/dist/reducers/strategy/IStategyActionContants.d.ts +0 -2
  176. package/dist/reducers/strategy/IStategyActionContants.js +0 -1
  177. package/dist/reducers/strategy/StrategyTypes.d.ts +0 -248
  178. package/dist/reducers/strategy/StrategyTypes.js +0 -1
  179. package/dist/reducers/strategy/index.d.ts +0 -13
  180. package/dist/reducers/strategy/index.js +0 -1
  181. package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +0 -15
  182. package/dist/reducers/strategy/strategies/ask_mobile_number.js +0 -1
  183. package/dist/reducers/strategy/strategies/ask_operator.d.ts +0 -5
  184. package/dist/reducers/strategy/strategies/ask_operator.js +0 -1
  185. package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +0 -10
  186. package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +0 -1
  187. package/dist/reducers/strategy/strategies/header_enrichment.d.ts +0 -7
  188. package/dist/reducers/strategy/strategies/header_enrichment.js +0 -1
  189. package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +0 -7
  190. package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +0 -1
  191. package/dist/reducers/strategy/utils.d.ts +0 -30
  192. package/dist/reducers/strategy/utils.js +0 -1
  193. package/dist/reducers/ussdFlow/IUssdConstants.d.ts +0 -2
  194. package/dist/reducers/ussdFlow/IUssdConstants.js +0 -1
  195. package/dist/reducers/ussdFlow/UssdTypes.d.ts +0 -77
  196. package/dist/reducers/ussdFlow/UssdTypes.js +0 -1
  197. package/dist/reducers/ussdFlow/index.d.ts +0 -14
  198. package/dist/reducers/ussdFlow/index.js +0 -1
  199. package/dist/reducers/ussdFlow/utils.d.ts +0 -11
  200. package/dist/reducers/ussdFlow/utils.js +0 -1
  201. package/dist/store/index.d.ts +0 -14
  202. package/dist/store/index.js +0 -1
  203. package/dist/store/reducers.d.ts +0 -20
  204. package/dist/store/reducers.js +0 -1
  205. package/dist/utilities/addEmpelloToken.d.ts +0 -4
  206. package/dist/utilities/addEmpelloToken.js +0 -1
  207. package/dist/utilities/handleSubmitNumber.d.ts +0 -21
  208. package/dist/utilities/handleSubmitNumber.js +0 -1
  209. package/dist/utilities/index.d.ts +0 -17
  210. package/dist/utilities/index.js +0 -1
  211. package/dist/utilities/loadScriptInnerHtml.d.ts +0 -2
  212. package/dist/utilities/loadScriptInnerHtml.js +0 -1
  213. package/dist/utilities/loadScriptSrc.d.ts +0 -8
  214. package/dist/utilities/loadScriptSrc.js +0 -1
  215. package/dist/utilities/replaceUrlParam.d.ts +0 -1
  216. package/dist/utilities/replaceUrlParam.js +0 -1
  217. package/dist/utilities/storeMsisdn.d.ts +0 -3
  218. package/dist/utilities/storeMsisdn.js +0 -1
  219. package/index.html +0 -49
  220. package/mockData/config.json +0 -28
  221. package/setupJest.js +0 -6
  222. package/tsconfig.json +0 -28
@@ -1,14 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- import { IMockMoRedirFlowStates, IMoRedirActions, IMoRedirFlowActionMaps, IMoRedirFlowReducerState, MSISDNEntryFailure, MSISDNEntrySuccess } from './MoRedirTypes';
4
- export declare function submitMSISDNAction(msisdn: string): AppThunk;
5
- export declare function backToStart(): {
6
- type: string;
7
- payload: {
8
- type: string;
9
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
10
- };
11
- };
12
- export declare function mockMoRedirFlow(mockState: IMockMoRedirFlowStates): AppThunk;
13
- export declare const MoRedirFlowActionMaps: IMoRedirFlowActionMaps;
14
- export default function MoRedirFlowReducer(state: IMoRedirFlowReducerState, action: IMoRedirActions): IMoRedirFlowReducerState;
@@ -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.MoRedirFlowActionMaps=void 0,exports.backToStart=backToStart,exports.default=MoRedirFlowReducer,exports.mockMoRedirFlow=mockMoRedirFlow,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 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,href,errorType;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(currentState=store().strategy.currentState,"MO_REDIR"!==currentState.type){_context.next=21;break}return config=currentState.result.config,_context.prev=3,dispatch({type:"MO_REDIR_MSISDN_SUBMIT",payload:{type:"MSISDNEntry",result:RDS.Loading()}}),_strategy.tracker.advancedInFlow("tallyman.v1-mo-redir","msisdn-submitted",{msisdn:msisdn}),_context.next=8,(0,_utils.default)(window,config,msisdn);case 8:href=_context.sent,_strategy.tracker.advancedInFlow("tallyman.v1-mo-redir","msisdn-submission-success",{msisdn:msisdn}),dispatch({type:"MO_REDIR_MSISDN_SUBMIT",payload:{type:"MSISDNEntry",result:RDS.Success({href:href})}}),_context.next=19;break;case 13:_context.prev=13,_context.t0=_context["catch"](3),console.warn(_context.t0),errorType="SEAlreadySubscribed"===_context.t0.type?"AlreadySubscribed":"SEInvalidMSISDN"==_context.t0.type?"InvalidMSISDN":"UnknownError",_strategy.tracker.recedeInFlow("tallyman.v1-mo-redir","msisdn-submission-failure",{msisdn:msisdn,errorType:errorType||"UnknownError"}),dispatch({type:"MO_REDIR_MSISDN_SUBMIT_ERROR",payload:{type:"MSISDNEntry",result:RDS.Failure({errorType:errorType,error:_context.t0,productUrl:_context.t0.productUrl})}});case 19:_context.next=24;break;case 21:throw _strategy.tracker.recedeInFlow("tallyman.v1-mo-redir","msisdn-submission-failure",{msisdn:msisdn,errorType:"UnknownError"}),dispatch({type:"MO_REDIR_MSISDN_SUBMIT_ERROR",payload:{type:"MSISDNEntry",result:RDS.Failure({errorType:"UnexpectedState",error:null})}}),"Unexpected state";case 24:case"end":return _context.stop();}},_callee,null,[[3,13]])}));return function(_x,_x2){return _ref.apply(this,arguments)}}()}function backToStart(){return{type:"MO_REDIR_BACK_TO_START",payload:{type:"MSISDNEntry",result:RDS.NothingYet()}}}function mockMoRedirFlow(mockState){return function(dispatch){if(mockState!==void 0)switch(mockState){case"msisdn-entry-failure-state":return dispatch({type:"MOCK_MO_REDIR_FLOW_STATE",payload:_utils.mockedMSISDNEntryFailure.currentState});case"msisdn-entry-success-state":return dispatch({type:"MOCK_MO_REDIR_FLOW_STATE",payload:_utils.mockedMSISDNEntrySuccess.currentState});default:throw"Mock Flow not supported";}}}var initialState={currentState:{type:"MSISDNEntry",result:RDS.NothingYet()}},MoRedirFlowActionMaps={submitMSISDNAction:submitMSISDNAction};exports.MoRedirFlowActionMaps=MoRedirFlowActionMaps;function MoRedirFlowReducer(){var state=0<arguments.length&&arguments[0]!==void 0?arguments[0]:initialState,action=1<arguments.length?arguments[1]:void 0;switch(action.type){case"MO_REDIR_MSISDN_SUBMIT":return(0,_strategy.genericHandler)(state,action.payload);case"MO_REDIR_BACK_TO_START":return(0,_strategy.genericHandler)(state,action.payload);case"MO_REDIR_MSISDN_SUBMIT_ERROR":return(0,_strategy.genericHandler)(state,action.payload);case"MOCK_MO_REDIR_FLOW_STATE":return(0,_strategy.genericHandler)(state,action.payload);default:return state;}}
@@ -1,10 +0,0 @@
1
- import { IConfig, IMoRedirFlowReducerState } from './MoRedirTypes';
2
- export default function submitMSISDN(window: Window, maybeConfig: IConfig, internationalMSISDN: string, extraParams?: {
3
- [key: string]: string;
4
- }): Promise<string>;
5
- export declare function submitMSISDNWithConfig(window: Window, config: IConfig, internationalMSISDN: string, extraParams?: {
6
- [key: string]: string;
7
- }): Promise<string>;
8
- export declare const startEvinaAgency: (config: IConfig) => void;
9
- export declare const mockedMSISDNEntrySuccess: IMoRedirFlowReducerState;
10
- export declare const mockedMSISDNEntryFailure: IMoRedirFlowReducerState;
@@ -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.array.filter.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.object.get-own-property-descriptors.js"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.iterator.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.symbol.async-iterator.js"),require("core-js/modules/es.symbol.to-string-tag.js"),require("core-js/modules/es.json.to-string-tag.js"),require("core-js/modules/es.math.to-string-tag.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.array.slice.js"),require("core-js/modules/es.weak-map.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=submitMSISDN,exports.startEvinaAgency=exports.mockedMSISDNEntrySuccess=exports.mockedMSISDNEntryFailure=void 0,exports.submitMSISDNWithConfig=submitMSISDNWithConfig,require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.string.match.js");var RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_tryGetIPRangeName=_interopRequireDefault(require("../../ips/tryGetIPRangeName")),_utilities=require("../../utilities"),_loadScriptInnerHtml=_interopRequireDefault(require("../../utilities/loadScriptInnerHtml")),_utils=require("../strategy/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 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 submitMSISDN(){return _submitMSISDN.apply(this,arguments)}function _submitMSISDN(){return _submitMSISDN=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(window,maybeConfig,internationalMSISDN,extraParams){var config;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:return config=_objectSpread({offer:window.pac_analytics.visitor.offer},maybeConfig||{}),_context.abrupt("return",submitMSISDNWithConfig(window,config,internationalMSISDN,extraParams));case 2:case"end":return _context.stop();}},_callee)})),_submitMSISDN.apply(this,arguments)}function submitMSISDNWithConfig(_x5,_x6,_x7,_x8){return _submitMSISDNWithConfig.apply(this,arguments)}function _submitMSISDNWithConfig(){return _submitMSISDNWithConfig=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(window,config,internationalMSISDN,extraParams){var slug,country,device,offer,host,search,extraParamsQs,msisdn,visitor,rockmanId,ip_range_name,result,type,error;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:if(slug=config.slug,country=config.country,device=config.device,offer=config.offer,host=config.host,search=window.location.search.substr(1)||"",extraParamsQs=extraParams?"&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")):"",msisdn=internationalMSISDN.match(/\d+/gi).join(""),visitor=window.pac_analytics.visitor,rockmanId=visitor.rockmanId,"ci"!==country){_context2.next=12;break}return _context2.next=9,(0,_tryGetIPRangeName.default)(visitor);case 9:_context2.t0=_context2.sent,_context2.next=13;break;case 12:_context2.t0=null;case 13:return ip_range_name=_context2.t0,_context2.next=16,window.tallymanApi.redirect({host:host,slug:slug,country:country,msisdn:msisdn,device:device,offer:offer,rockmanId:rockmanId,ip_range_name:ip_range_name,search:search,extraParamsQs:extraParamsQs});case 16:if(result=_context2.sent,!1!==result.success){_context2.next=25;break}throw type="ALREADY SUBSCRIBED"===result.message?"AlreadySubscribed":"InvalidMSISDN",error=new Error("".concat(type,":\n").concat(result.message)),error.type=type,console.error(error),error;case 25:return _context2.abrupt("return",result.redirect_url);case 26:case"end":return _context2.stop();}},_callee2)})),_submitMSISDNWithConfig.apply(this,arguments)}var startEvinaAgency=function startEvinaAgency(config){try{var configs=(0,_utils.getConfig)(),defaultFlowConfig=configs.strategyConfigs.default,_ref=config||defaultFlowConfig.flowConfig,host=_ref.host,newHost=(0,_utilities.getHost)({host:host}),rockmanId=window.pac_analytics.visitor.rockmanId,url="https://".concat(newHost,"/tallyman/helper/?action=mi-agency&process=a2-du-evina-start&rockman_id=").concat(rockmanId);fetch(url).then(function(x){return x.text()}).then(function(txt){return(0,_loadScriptInnerHtml.default)(txt)}).then(function(){console.log("Ev ready");var event=new Event("DCBProtectRun");"undefined"!=typeof window&&document.dispatchEvent(event)})}catch(err){console.error("startEvinaAgency ERROR",err)}};exports.startEvinaAgency=startEvinaAgency;var mockedMSISDNEntrySuccess={currentState:{type:"MSISDNEntry",result:RDS.Success({href:"/product"})}};exports.mockedMSISDNEntrySuccess=mockedMSISDNEntrySuccess;var mockedMSISDNEntryFailure={currentState:{type:"MSISDNEntry",result:RDS.Failure({errorType:"InvalidMSISDN",error:"Invalid Mobile Number"})}};exports.mockedMSISDNEntryFailure=mockedMSISDNEntryFailure;
@@ -1,2 +0,0 @@
1
- declare type IOneClickConstants = 'GET_REDIRECT_URL' | 'SUBCRIBE_AJAX';
2
- export default IOneClickConstants;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,85 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- export declare type IGETREDIRECTURLFailure = {
4
- errorType: string;
5
- };
6
- export declare type IGETREDIRECTURLSuccess = {
7
- redirectUrl: string;
8
- nextAction: 'getRedirectUrlAction';
9
- };
10
- export declare type SubscribeUserErrorTypes = 'SubscriptionError' | 'UnknownError' | 'AlreadySubscribed';
11
- export declare type SubscribeSuccess = {
12
- productUrl: string;
13
- };
14
- export declare type SubscribeFailure = {
15
- errorType: SubscribeUserErrorTypes;
16
- error: Error;
17
- productUrl?: string;
18
- };
19
- export declare type IOneClickCurrentState = {
20
- type: 'GET_REDIRECT_URL';
21
- result: RDS.RemoteDataState<IGETREDIRECTURLFailure, IGETREDIRECTURLSuccess>;
22
- } | {
23
- type: 'SUBCRIBE_AJAX';
24
- result: RDS.RemoteDataState<SubscribeFailure, SubscribeSuccess>;
25
- };
26
- export declare type IOneClickFlowReducerState = {
27
- currentState: IOneClickCurrentState;
28
- };
29
- export declare type IGetRedirectUrlPayload = {
30
- type: 'GET_REDIRECT_URL';
31
- result: RDS.RemoteDataState<IGETREDIRECTURLFailure, IGETREDIRECTURLSuccess>;
32
- };
33
- export declare type IOneClickFlowActionMaps = {
34
- getRedirectUrlAction: (extraParams?: ILinkExtraParams, autoRedirect?: boolean) => AppThunk;
35
- };
36
- export declare type IOneClickActions = {
37
- type: 'GET_REDIRECT_URL';
38
- payload: IGetRedirectUrlPayload;
39
- };
40
- export interface ILinkExtraParams {
41
- [key: string]: string;
42
- }
43
- export declare type IClickActionTypes = 'he' | 'redirect' | 'identify-user';
44
- export declare type IConfig = {
45
- host?: string;
46
- country?: string;
47
- slug?: string;
48
- queryString?: Array<[string, string]>;
49
- device?: string;
50
- apiAction?: IClickActionTypes;
51
- };
52
- export declare type IIDentifyUserResult = {
53
- success: true;
54
- rockman_id: string;
55
- subscription_url?: string;
56
- redirect_url?: string;
57
- } | {
58
- success: false;
59
- rockman_id: string;
60
- message: string;
61
- };
62
- export declare type IHEResult = {
63
- success: true;
64
- rockman_id: string;
65
- redirectUrlWithReplacedUniqid?: string;
66
- source: string;
67
- oldUniqid: string;
68
- newUniqid: string;
69
- } | {
70
- success: false;
71
- rockman_id: string;
72
- message: string;
73
- };
74
- export declare type ISubscribeResult = {
75
- success: true;
76
- rockman_id: string;
77
- product_url: string;
78
- redirect_url?: string;
79
- } | {
80
- success: false;
81
- rockman_id: string;
82
- message: string;
83
- product_url?: string;
84
- };
85
- export declare type IMockOneClickFlowStates = 'redirect-url-success-state' | 'subscribe-ajax-state';
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,13 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import { IHash } from '../strategy/StrategyTypes';
3
- import { ILinkExtraParams, IMockOneClickFlowStates, IOneClickActions, IOneClickFlowActionMaps, IOneClickFlowReducerState } from './OneClickTypes';
4
- export declare function getRedirectUrlAction({ extraParams, autoRedirect, isGetRedirectBupperWay }: {
5
- extraParams?: ILinkExtraParams;
6
- autoRedirect?: boolean;
7
- isGetRedirectBupperWay?: boolean;
8
- ignoreUrlParams?: boolean;
9
- }): AppThunk;
10
- export declare function subscribeUrlAction(autoRedirect?: boolean, extraParams?: IHash): AppThunk;
11
- export declare function mockOneClickFlow(mockState: IMockOneClickFlowStates): AppThunk;
12
- export declare const OneClickFlowActionMaps: IOneClickFlowActionMaps;
13
- export default function OneClickFlowReducer(state: IOneClickFlowReducerState, action: IOneClickActions): IOneClickFlowReducerState;
@@ -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.OneClickFlowActionMaps=void 0,exports.default=OneClickFlowReducer,exports.getRedirectUrlAction=getRedirectUrlAction,exports.mockOneClickFlow=mockOneClickFlow,exports.subscribeUrlAction=subscribeUrlAction,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.promise.js");var RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_addEmpelloToken=require("../../utilities/addEmpelloToken"),_strategy=require("../strategy"),_utils=require("./utils");function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!=key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _regeneratorRuntime(){"use strict";function define(obj,key,value){return Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}),obj[key]}function wrap(innerFn,outerFn,self,tryLocsList){var protoGenerator=outerFn&&outerFn.prototype instanceof Generator?outerFn:Generator,generator=Object.create(protoGenerator.prototype),context=new Context(tryLocsList||[]);return generator._invoke=function(innerFn,self,context){var state="suspendedStart";return function(method,arg){if("executing"===state)throw new Error("Generator is already running");if("completed"===state){if("throw"===method)throw arg;return doneResult()}for(context.method=method,context.arg=arg;;){var delegate=context.delegate;if(delegate){var delegateResult=maybeInvokeDelegate(delegate,context);if(delegateResult){if(delegateResult===ContinueSentinel)continue;return delegateResult}}if("next"===context.method)context.sent=context._sent=context.arg;else if("throw"===context.method){if("suspendedStart"===state)throw state="completed",context.arg;context.dispatchException(context.arg)}else"return"===context.method&&context.abrupt("return",context.arg);state="executing";var record=tryCatch(innerFn,self,context);if("normal"===record.type){if(state=context.done?"completed":"suspendedYield",record.arg===ContinueSentinel)continue;return{value:record.arg,done:context.done}}"throw"===record.type&&(state="completed",context.method="throw",context.arg=record.arg)}}}(innerFn,self,context),generator}function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(prototype){["next","throw","return"].forEach(function(method){define(prototype,method,function(arg){return this._invoke(method,arg)})})}function AsyncIterator(generator,PromiseImpl){function invoke(method,arg,resolve,reject){var record=tryCatch(generator[method],generator,arg);if("throw"!==record.type){var result=record.arg,value=result.value;return value&&"object"==_typeof(value)&&hasOwn.call(value,"__await")?PromiseImpl.resolve(value.__await).then(function(value){invoke("next",value,resolve,reject)},function(err){invoke("throw",err,resolve,reject)}):PromiseImpl.resolve(value).then(function(unwrapped){result.value=unwrapped,resolve(result)},function(error){return invoke("throw",error,resolve,reject)})}reject(record.arg)}var previousPromise;this._invoke=function(method,arg){function callInvokeWithMethodAndArg(){return new PromiseImpl(function(resolve,reject){invoke(method,arg,resolve,reject)})}return previousPromise=previousPromise?previousPromise.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(delegate,context){var method=delegate.iterator[context.method];if(void 0===method){if(context.delegate=null,"throw"===context.method){if(delegate.iterator.return&&(context.method="return",context.arg=void 0,maybeInvokeDelegate(delegate,context),"throw"===context.method))return ContinueSentinel;context.method="throw",context.arg=new TypeError("The iterator does not provide a 'throw' method")}return ContinueSentinel}var record=tryCatch(method,delegate.iterator,context.arg);if("throw"===record.type)return context.method="throw",context.arg=record.arg,context.delegate=null,ContinueSentinel;var info=record.arg;return info?info.done?(context[delegate.resultName]=info.value,context.next=delegate.nextLoc,"return"!==context.method&&(context.method="next",context.arg=void 0),context.delegate=null,ContinueSentinel):info:(context.method="throw",context.arg=new TypeError("iterator result is not an object"),context.delegate=null,ContinueSentinel)}function pushTryEntry(locs){var entry={tryLoc:locs[0]};1 in locs&&(entry.catchLoc=locs[1]),2 in locs&&(entry.finallyLoc=locs[2],entry.afterLoc=locs[3]),this.tryEntries.push(entry)}function resetTryEntry(entry){var record=entry.completion||{};record.type="normal",delete record.arg,entry.completion=record}function Context(tryLocsList){this.tryEntries=[{tryLoc:"root"}],tryLocsList.forEach(pushTryEntry,this),this.reset(!0)}function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod)return iteratorMethod.call(iterable);if("function"==typeof iterable.next)return iterable;if(!isNaN(iterable.length)){var i=-1,next=function next(){for(;++i<iterable.length;)if(hasOwn.call(iterable,i))return next.value=iterable[i],next.done=!1,next;return next.value=void 0,next.done=!0,next};return next.next=next}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}_regeneratorRuntime=function(){return exports};var exports={},Op=Object.prototype,hasOwn=Op.hasOwnProperty,$Symbol="function"==typeof Symbol?Symbol:{},iteratorSymbol=$Symbol.iterator||"@@iterator",asyncIteratorSymbol=$Symbol.asyncIterator||"@@asyncIterator",toStringTagSymbol=$Symbol.toStringTag||"@@toStringTag";try{define({},"")}catch(err){define=function(obj,key,value){return obj[key]=value}}exports.wrap=wrap;var ContinueSentinel={},IteratorPrototype={};define(IteratorPrototype,iteratorSymbol,function(){return this});var getProto=Object.getPrototypeOf,NativeIteratorPrototype=getProto&&getProto(getProto(values([])));NativeIteratorPrototype&&NativeIteratorPrototype!==Op&&hasOwn.call(NativeIteratorPrototype,iteratorSymbol)&&(IteratorPrototype=NativeIteratorPrototype);var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(IteratorPrototype);return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(Gp,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,toStringTagSymbol,"GeneratorFunction"),exports.isGeneratorFunction=function(genFun){var ctor="function"==typeof genFun&&genFun.constructor;return!!ctor&&(ctor===GeneratorFunction||"GeneratorFunction"===(ctor.displayName||ctor.name))},exports.mark=function(genFun){return Object.setPrototypeOf?Object.setPrototypeOf(genFun,GeneratorFunctionPrototype):(genFun.__proto__=GeneratorFunctionPrototype,define(genFun,toStringTagSymbol,"GeneratorFunction")),genFun.prototype=Object.create(Gp),genFun},exports.awrap=function(arg){return{__await:arg}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,asyncIteratorSymbol,function(){return this}),exports.AsyncIterator=AsyncIterator,exports.async=function(innerFn,outerFn,self,tryLocsList,PromiseImpl){void 0===PromiseImpl&&(PromiseImpl=Promise);var iter=new AsyncIterator(wrap(innerFn,outerFn,self,tryLocsList),PromiseImpl);return exports.isGeneratorFunction(outerFn)?iter:iter.next().then(function(result){return result.done?result.value:iter.next()})},defineIteratorMethods(Gp),define(Gp,toStringTagSymbol,"Generator"),define(Gp,iteratorSymbol,function(){return this}),define(Gp,"toString",function(){return"[object Generator]"}),exports.keys=function(object){var keys=[];for(var key in object)keys.push(key);return keys.reverse(),function next(){for(;keys.length;){var key=keys.pop();if(key in object)return next.value=key,next.done=!1,next}return next.done=!0,next}},exports.values=values,Context.prototype={constructor:Context,reset:function reset(skipTempReset){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(resetTryEntry),!skipTempReset)for(var name in this)"t"===name.charAt(0)&&hasOwn.call(this,name)&&!isNaN(+name.slice(1))&&(this[name]=void 0)},stop:function stop(){this.done=!0;var rootRecord=this.tryEntries[0].completion;if("throw"===rootRecord.type)throw rootRecord.arg;return this.rval},dispatchException:function dispatchException(exception){function handle(loc,caught){return record.type="throw",record.arg=exception,context.next=loc,caught&&(context.method="next",context.arg=void 0),!!caught}if(this.done)throw exception;for(var context=this,i=this.tryEntries.length-1;0<=i;--i){var entry=this.tryEntries[i],record=entry.completion;if("root"===entry.tryLoc)return handle("end");if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc"),hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0);if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(!hasCatch){if(!hasFinally)throw new Error("try statement without catch or finally");if(this.prev<entry.finallyLoc)return handle(entry.finallyLoc)}else if(this.prev<entry.catchLoc)return handle(entry.catchLoc,!0)}}},abrupt:function abrupt(type,arg){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&this.prev<entry.finallyLoc){var finallyEntry=entry;break}finallyEntry&&("break"===type||"continue"===type)&&finallyEntry.tryLoc<=arg&&arg<=finallyEntry.finallyLoc&&(finallyEntry=null);var record=finallyEntry?finallyEntry.completion:{};return record.type=type,record.arg=arg,finallyEntry?(this.method="next",this.next=finallyEntry.finallyLoc,ContinueSentinel):this.complete(record)},complete:function complete(record,afterLoc){if("throw"===record.type)throw record.arg;return"break"===record.type||"continue"===record.type?this.next=record.arg:"return"===record.type?(this.rval=this.arg=record.arg,this.method="return",this.next="end"):"normal"===record.type&&afterLoc&&(this.next=afterLoc),ContinueSentinel},finish:function finish(finallyLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.finallyLoc===finallyLoc)return this.complete(entry.completion,entry.afterLoc),resetTryEntry(entry),ContinueSentinel},catch:function _catch(tryLoc){for(var entry,i=this.tryEntries.length-1;0<=i;--i)if(entry=this.tryEntries[i],entry.tryLoc===tryLoc){var record=entry.completion;if("throw"===record.type){var thrown=record.arg;resetTryEntry(entry)}return thrown}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(iterable,resultName,nextLoc){return this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc},"next"===this.method&&(this.arg=void 0),ContinueSentinel}},exports}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}function getRedirectUrlAction(_ref){var extraParams=_ref.extraParams,_ref$autoRedirect=_ref.autoRedirect,autoRedirect=void 0!==_ref$autoRedirect&&_ref$autoRedirect,_ref$isGetRedirectBup=_ref.isGetRedirectBupperWay;return function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(dispatch,store){var currentState,_currentState$result,config,subscription_url,redirect_url,redirectUrl,updatedRedirectUrl,timer,_yield$getRedirectUrl,_redirect_url,updated_redirect_url;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(currentState=store().strategy.currentState,"ONE_CLICK"!==currentState.type){_context.next=40;break}if(_currentState$result=currentState.result,config=_currentState$result.config,subscription_url=_currentState$result.subscription_url,redirect_url=_currentState$result.redirect_url,_context.prev=3,dispatch({type:"GET_REDIRECT_URL",payload:{type:"GET_REDIRECT_URL",result:RDS.Loading()}}),!0!==(void 0!==_ref$isGetRedirectBup&&_ref$isGetRedirectBup)){_context.next=16;break}return _context.next=8,(0,_utils.getRedirectUrlBupperWay)(window,config,_objectSpread(_objectSpread({},currentState.result.operator&&{operator:currentState.result.operator}),extraParams));case 8:return redirectUrl=_context.sent,_context.next=11,(0,_addEmpelloToken.addEmpelloToken)({currentRedirectUrl:redirectUrl,country:config.country});case 11:updatedRedirectUrl=_context.sent,_strategy.tracker.customEvent("Flow","advance-auto","redirect-success",{redirect_url:updatedRedirectUrl}),!0===window.isAutoFraudScreener?timer=setInterval(function(){window.isEvinaSessionChecked&&(clearInterval(timer),_strategy.tracker.advancedInFlow("tallyman.v1-one-click","click-redirect-url",{redirect_url:updatedRedirectUrl}),setTimeout(function(){window.location.href=updatedRedirectUrl},0))},100):!0===autoRedirect?(_strategy.tracker.advancedInFlow("tallyman.v1-one-click","click-redirect-url",{redirect_url:updatedRedirectUrl}),setTimeout(function(){window.location.href=updatedRedirectUrl},0)):dispatch({type:"GET_REDIRECT_URL",payload:{type:"GET_REDIRECT_URL",result:RDS.Success({redirectUrl:updatedRedirectUrl})}}),_context.next=32;break;case 16:if(!(subscription_url&&null!=subscription_url)){_context.next=18;break}return _context.abrupt("return",dispatch({type:"GET_REDIRECT_URL",payload:{type:"SUBCRIBE_AJAX",result:RDS.NothingYet()}}));case 18:if(!(redirect_url&&null!==redirect_url)){_context.next=23;break}return _strategy.tracker.customEvent("Flow","advance-auto","redirect-success",{redirect_url:redirect_url}),_context.abrupt("return",dispatch({type:"GET_REDIRECT_URL",payload:{type:"GET_REDIRECT_URL",result:RDS.Success({redirectUrl:redirect_url})}}));case 23:return _context.next=25,(0,_utils.getRedirectUrl)({window:window,maybeConfig:config,extraParams:_objectSpread(_objectSpread({},currentState.result.operator&&{operator:currentState.result.operator}),extraParams)});case 25:return _yield$getRedirectUrl=_context.sent,_redirect_url=_yield$getRedirectUrl.redirect_url,_context.next=29,(0,_addEmpelloToken.addEmpelloToken)({currentRedirectUrl:_redirect_url,country:config.country});case 29:updated_redirect_url=_context.sent,_strategy.tracker.customEvent("Flow","advance-auto","redirect-success",{updated_redirect_url:updated_redirect_url}),!0===autoRedirect||!0===window.isAutoFraudScreener?(_strategy.tracker.advancedInFlow("tallyman.v1-one-click","click-redirect-url",{updated_redirect_url:updated_redirect_url}),setTimeout(function(){window.location.href=updated_redirect_url},0)):dispatch({type:"GET_REDIRECT_URL",payload:{type:"GET_REDIRECT_URL",result:RDS.Success({redirectUrl:updated_redirect_url})}});case 32:_context.next=38;break;case 34:_context.prev=34,_context.t0=_context["catch"](3),console.warn(_context.t0),!0!==autoRedirect&&dispatch({type:"GET_REDIRECT_URL",payload:{type:"GET_REDIRECT_URL",result:RDS.Failure({errorType:"UnknownError"})}});case 38:_context.next=42;break;case 40:throw dispatch({type:"GET_REDIRECT_URL",payload:{type:"GET_REDIRECT_URL",result:RDS.Failure({errorType:"UnexpectedState"})}}),new Error("Unexpected state");case 42:case"end":return _context.stop();}},_callee,null,[[3,34]])}));return function(_x,_x2){return _ref2.apply(this,arguments)}}()}function subscribeUrlAction(autoRedirect,extraParams){return function(){var _ref3=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(dispatch,store){var currentState,subscription_url,product_url,errorType;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:if(currentState=store().strategy.currentState,"ONE_CLICK"!==currentState.type){_context2.next=21;break}return subscription_url=currentState.result.subscription_url,_context2.prev=3,dispatch({type:"GET_REDIRECT_URL",payload:{type:"SUBCRIBE_AJAX",result:RDS.Loading()}}),_strategy.tracker.advancedInFlow("tallyman.v1-one-click","click-subscribe"),_context2.next=8,(0,_utils.subscribe)(subscription_url,extraParams);case 8:product_url=_context2.sent,_strategy.tracker.advancedInFlow("tallyman.v1-one-click","click-subscribe-success",{product_url:product_url}),!0===autoRedirect?(_strategy.tracker.customEvent("Flow","advance-auto","click-product-url",{product_url:product_url}),window.location.href=product_url):dispatch({type:"GET_REDIRECT_URL",payload:{type:"SUBCRIBE_AJAX",result:RDS.Success({productUrl:product_url})}}),_context2.next=19;break;case 13:_context2.prev=13,_context2.t0=_context2["catch"](3),console.warn(_context2.t0),errorType="AlreadySubscribed"===_context2.t0.type?"AlreadySubscribed":"SubscriptionError"===_context2.t0.type?"SubscriptionError":"UnknownError",_strategy.tracker.recedeInFlow("tallyman.v1-one-click","click-subscribe-failure",{error:_context2.t0.toString()}),dispatch({type:"GET_REDIRECT_URL",payload:{type:"SUBCRIBE_AJAX",result:RDS.Failure({errorType:errorType,error:_context2.t0,productUrl:_context2.t0.productUrl})}});case 19:_context2.next=24;break;case 21:throw _strategy.tracker.recedeInFlow("tallyman.v1-one-click","click-subscribe-failure",{error:"UnexpectedState"}),dispatch({type:"GET_REDIRECT_URL",payload:{type:"SUBCRIBE_AJAX",result:RDS.Failure({errorType:"UnexpectedState"})}}),new Error("Unexpected state");case 24:case"end":return _context2.stop();}},_callee2,null,[[3,13]])}));return function(_x3,_x4){return _ref3.apply(this,arguments)}}()}function mockOneClickFlow(mockState){return function(dispatch){if(mockState!==void 0)switch(mockState){case"redirect-url-success-state":return dispatch({type:"GET_REDIRECT_URL",payload:_utils.mockedRedirectUrlSuccessState.currentState});case"subscribe-ajax-state":return dispatch({type:"GET_REDIRECT_URL",payload:_utils.mockedSubscribeAjaxState.currentState});default:throw new Error("Mock Flow not supported");}}}var initialState={currentState:{type:"GET_REDIRECT_URL",result:RDS.NothingYet()}},OneClickFlowActionMaps={getRedirectUrlAction:getRedirectUrlAction};exports.OneClickFlowActionMaps=OneClickFlowActionMaps;function OneClickFlowReducer(){var state=0<arguments.length&&arguments[0]!==void 0?arguments[0]:initialState,action=1<arguments.length?arguments[1]:void 0;switch(action.type){case"GET_REDIRECT_URL":return(0,_strategy.genericHandler)(state,action.payload);default:return state;}}
@@ -1,16 +0,0 @@
1
- import { IHash } from '../strategy/StrategyTypes';
2
- import { IConfig, ILinkExtraParams, IOneClickFlowReducerState } from './OneClickTypes';
3
- export declare const additionalQueryString = "msisdnSubmitted=Y&legalCheckbox=Y&incentivizedCheckbox=Y&op_confirmCheckbox=N";
4
- export declare const getRedirectUrl: ({ window, maybeConfig, extraParams }: {
5
- window: Window;
6
- maybeConfig: IConfig;
7
- extraParams?: ILinkExtraParams;
8
- }) => Promise<{
9
- subscription_url?: string;
10
- redirect_url?: string;
11
- action?: () => Promise<string>;
12
- }>;
13
- export declare const subscribe: (url: string, extraParams?: IHash) => Promise<string>;
14
- export declare const getRedirectUrlBupperWay: (window: Window, maybeConfig: IConfig, extraParams?: ILinkExtraParams) => Promise<string>;
15
- export declare const mockedRedirectUrlSuccessState: IOneClickFlowReducerState;
16
- export declare const mockedSubscribeAjaxState: IOneClickFlowReducerState;
@@ -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.array.slice.js"),require("core-js/modules/es.function.name.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.regexp.test.js"),require("core-js/modules/es.symbol.async-iterator.js"),require("core-js/modules/es.symbol.to-string-tag.js"),require("core-js/modules/es.json.to-string-tag.js"),require("core-js/modules/es.math.to-string-tag.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.weak-map.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),Object.defineProperty(exports,"__esModule",{value:!0}),exports.subscribe=exports.mockedSubscribeAjaxState=exports.mockedRedirectUrlSuccessState=exports.getRedirectUrlBupperWay=exports.getRedirectUrl=exports.additionalQueryString=void 0,require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.regexp.exec.js"),require("core-js/modules/es.string.search.js"),require("core-js/modules/es.array.join.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.string.split.js");var RDS=_interopRequireWildcard(require("../../common-types/RemoteDataState")),_loadScriptInnerHtml=_interopRequireDefault(require("../../utilities/loadScriptInnerHtml")),_replaceUrlParam=require("../../utilities/replaceUrlParam"),_utils=require("../strategy/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 _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!(i&&_arr.length===i));_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i["return"]||_i["return"]()}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _asyncToGenerator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}var gen=fn.apply(self,args);_next(void 0)})}}var additionalQueryString="msisdnSubmitted=Y&legalCheckbox=Y&incentivizedCheckbox=Y&op_confirmCheckbox=N";exports.additionalQueryString=additionalQueryString;var fetchJsonp=function(_url){var url=_url,ouisys_callback_function="ouisys_callback_function".concat(Math.floor(1e4*Math.random()));return new Promise(function(resolve,reject){window[ouisys_callback_function]=function(arg){resolve(arg)},url+=-1===url.indexOf("?")?"?":"&",url+="jsonp=".concat(ouisys_callback_function);var script=document.createElement("script");script.src=url,script.id=ouisys_callback_function,document.body.appendChild(script),script.onerror=function(){reject(new Error("JSONP request to ".concat(_url," failed")))}})},getRedirectUrl=function(){var _ref2=_asyncToGenerator(_regeneratorRuntime().mark(function _callee(_ref){var window,maybeConfig,extraParams,country,slug,queryString,apiAction,customDomain,evinaTid,bupperizeCountry,offer,s,search,rockmanId,_url2,result,identifyError,_url3,_result,_identifyError,_window$location,searchObj,_identifyError2,_url4,_result2,_identifyError3;return _regeneratorRuntime().wrap(function _callee$(_context){for(;1;)switch(_context.prev=_context.next){case 0:if(window=_ref.window,maybeConfig=_ref.maybeConfig,extraParams=_ref.extraParams,"undefined"!=typeof window){_context.next=5;break}throw"javascript: console.error('SSR'); void 6";case 5:if(country=maybeConfig.country,slug=maybeConfig.slug,queryString=maybeConfig.queryString,apiAction=maybeConfig.apiAction,customDomain="de-ads.tallymans.com",evinaTid="undefined"!=typeof window&&window.tid?window.tid:"",bupperizeCountry=function bupperizeCountry(c){return"gb"===c?"uk":c},offer=window.pac_analytics.visitor.offer,s=window.location.search.substr(1),search=(!!s&&0<s.length?[s]:[]).concat((queryString||[]).map(function(_ref3){var _ref4=_slicedToArray(_ref3,2),k=_ref4[0],v=_ref4[1];return"".concat(k,"=").concat(v)})).join("&"),Object.keys(extraParams).forEach(function(element,index){0<search.length&&(search+="&"),search="".concat((0,_replaceUrlParam.replaceUrlParam)(search,element,extraParams[element])).concat(1===index?"&":"")}),rockmanId=window.pac_analytics.visitor.rockmanId,"identify-user"!==apiAction){_context.next=28;break}return _url2="https://de.tallymans.com/tallyman/v1/?action=identify-user&country=".concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=","smart","&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&sam_evina_tid=").concat(evinaTid,"&").concat(search),_context.next=18,fetchJsonp(_url2);case 18:if(result=_context.sent,!1!==result.success){_context.next=25;break}throw identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat(result.message)),identifyError.type="NotOn3g",identifyError;case 25:return _context.abrupt("return",{subscription_url:result.subscription_url||result.redirect_url,action:function action(){return subscribe(result.subscription_url)}});case 26:_context.next=63;break;case 28:if("he"!==apiAction){_context.next=43;break}return _url3="https://de.tallymans.com/tallyman/v1/?action=he&country=".concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=","smart","&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&sam_evina_tid=").concat(evinaTid,"&").concat(search),_context.next=32,fetch(_url3).then(function(x){return x.json()});case 32:if(_result=_context.sent,!1!==_result.success){_context.next=39;break}throw _identifyError=new Error("Error in getRedirectUrl() identify-user action:\n".concat(_result.message)),_identifyError.type="NotOn3g",_identifyError;case 39:return(0,_loadScriptInnerHtml.default)(_result.source),_context.abrupt("return",{redirect_url:_result.redirectUrlWithReplacedUniqid});case 41:_context.next=63;break;case 43:if("om"!==country.toLowerCase()){_context.next=52;break}if(searchObj=(0,_utils.searchToObject)(),"false"!==searchObj.success){_context.next=51;break}throw _identifyError2=new Error("Error in getRedirectUrl() identify-user"),_identifyError2.type="NotOn3g",_identifyError2;case 51:return _context.abrupt("return",{redirect_url:searchObj.redirect_url||searchObj.url});case 52:return _url4="https://".concat(customDomain,"/tallyman/v1/?action=redirect&country=").concat(bupperizeCountry(country),"&slug=").concat(slug,"&device=","smart","&offerId=").concat(offer,"&rockman_id=").concat(rockmanId,"&page=").concat(encodeURIComponent(null===window||void 0===window||null===(_window$location=window.location)||void 0===_window$location?void 0:_window$location.href),"&sam_evina_tid=").concat(evinaTid,"&").concat(search),_context.next=55,fetch(_url4).then(function(x){return x.json()});case 55:if(_result2=_context.sent,!1!==_result2.success){_context.next=62;break}throw _identifyError3=new Error("Error in getRedirectUrl() identify-user action:\n".concat(_result2.message)),_identifyError3.type="NotOn3g",_identifyError3;case 62:return _context.abrupt("return",{redirect_url:_result2.redirect_url});case 63:case"end":return _context.stop();}},_callee)}));return function getRedirectUrl(_x){return _ref2.apply(this,arguments)}}();exports.getRedirectUrl=getRedirectUrl;var subscribe=function(){var _ref5=_asyncToGenerator(_regeneratorRuntime().mark(function _callee2(url,extraParams){var evinaTid,extraParamsQs,isCleanTraffic,result,subscribeError;return _regeneratorRuntime().wrap(function _callee2$(_context2){for(;1;)switch(_context2.prev=_context2.next){case 0:return evinaTid="undefined"!=typeof window&&window.tid?window.tid:"",extraParamsQs=extraParams?"&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")):"",isCleanTraffic="undefined"!=typeof window&&!0===window.shouldBlock?"&is-clean-traffic=false":"&is-clean-traffic=true",_context2.next=5,fetch("".concat(url,"&sam_evina_tid=").concat(evinaTid).concat(isCleanTraffic).concat(extraParamsQs)).then(function(x){return x.json()});case 5:if(result=_context2.sent,!1!==result.success){_context2.next=13;break}throw subscribeError=new Error("Error in subscribe() one-click-subscribe action:\n".concat(result.message)),subscribeError.type="ALREADY SUBSCRIBED"===result.message?"AlreadySubscribed":"SubscriptionError",subscribeError.productUrl=result.product_url?result.product_url:"",subscribeError;case 13:return _context2.abrupt("return",result.product_url||result.redirect_url);case 14:case"end":return _context2.stop();}},_callee2)}));return function subscribe(_x2,_x3){return _ref5.apply(this,arguments)}}();exports.subscribe=subscribe;var getRedirectUrlBupperWay=function(){var _ref6=_asyncToGenerator(_regeneratorRuntime().mark(function _callee3(window,maybeConfig,extraParams){var host,country,slug,queryString,bupperizeCountry,offer,s,search,extraParamsQs,xcid,evinaTid;return _regeneratorRuntime().wrap(function _callee3$(_context3){for(;1;)switch(_context3.prev=_context3.next){case 0:if("undefined"!=typeof window){_context3.next=2;break}return _context3.abrupt("return","javascript: console.error('SSR'); void 6");case 2:return host=maybeConfig.host,country=maybeConfig.country,slug=maybeConfig.slug,queryString=maybeConfig.queryString,bupperizeCountry=function bupperizeCountry(c){return"gb"===c?"uk":c},offer=window.pac_analytics.visitor.offer,s=window.location.search.substr(1),search=(!!s&&0<s.length?[s]:[]).concat((queryString||[]).map(function(_ref7){var _ref8=_slicedToArray(_ref7,2),k=_ref8[0],v=_ref8[1];return"".concat(k,"=").concat(v)})).join("&"),extraParamsQs=extraParams?"&".concat(Object.keys(extraParams).map(function(k){return"".concat(k,"=").concat(extraParams[k])}).join("&")):"",xcid=window.location.href.split("/")[3].split("?")[0],evinaTid="undefined"!=typeof window&&window.tid?window.tid:"",_context3.abrupt("return","http://".concat(host,"/").concat(bupperizeCountry(country),"/").concat(slug,"?offer=").concat(offer,"&atmobirun=1&rockman_id=").concat(window.pac_analytics.visitor.rockmanId,"&redirPixels=").concat(window.location.host,"&sam_evina_tid=").concat(evinaTid,"&x-xcid=").concat(xcid).concat(extraParamsQs,"&").concat(search));case 11:case"end":return _context3.stop();}},_callee3)}));return function getRedirectUrlBupperWay(_x4,_x5,_x6){return _ref6.apply(this,arguments)}}();exports.getRedirectUrlBupperWay=getRedirectUrlBupperWay;var mockedRedirectUrlSuccessState={currentState:{type:"GET_REDIRECT_URL",result:RDS.Success({redirectUrl:"/product"})}};exports.mockedRedirectUrlSuccessState=mockedRedirectUrlSuccessState;var mockedSubscribeAjaxState={currentState:{type:"SUBCRIBE_AJAX",result:RDS.NothingYet()}};exports.mockedSubscribeAjaxState=mockedSubscribeAjaxState;
@@ -1,2 +0,0 @@
1
- declare type IPinConstants = 'PIN_FLOW_MSISDN_SUBMIT' | 'PIN_FLOW_MSISDN_SUBMIT_ERROR' | 'PIN_SUBMIT' | 'BACK_TO_START' | 'PIN_SUBMIT_ERROR' | 'MOCK_PIN_FLOW_STATE';
2
- export default IPinConstants;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,156 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- export declare type IPinFlowCurrentState = {
4
- type: 'MSISDNEntry';
5
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
6
- } | {
7
- type: 'PINEntry';
8
- result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
9
- data: IMsisdnSumbitNextData;
10
- };
11
- export declare type MSISDNEntryErrorTypes = 'AlreadySubscribed' | 'UnknownError' | 'InvalidMSISDN' | string;
12
- export declare type MSISDNEntryFailure = {
13
- errorType: MSISDNEntryErrorTypes;
14
- error: any;
15
- productUrl?: string;
16
- };
17
- export declare type MSISDNEntrySuccess = {
18
- type: 'PINEntry';
19
- result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
20
- };
21
- export declare type PINEntryFailure = {
22
- errorType: PINEntryErrorTypes;
23
- error?: Error;
24
- productUrl?: string;
25
- };
26
- export declare type PINEntrySuccess = {
27
- finalUrl: string;
28
- msisdn?: string;
29
- isAlreadySubscribed?: boolean;
30
- };
31
- export declare type PINEntryErrorTypes = 'UnknownError' | 'TooEarly' | 'InvalidPIN' | 'UnexpectedState' | 'SessionBlocked';
32
- export declare type IMsisdnSumbitNextData = {
33
- actualPIN: string;
34
- nextAction: 'submitPinAction';
35
- msisdn: string;
36
- pinMaxLength?: number | null;
37
- operator?: string;
38
- };
39
- export declare type IMsisnSubmitActionPayload = {
40
- type: 'MSISDNEntry';
41
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
42
- data: IMsisdnSumbitNextData;
43
- };
44
- export declare type IMsisdnSubmitErrorPayload = {
45
- type: 'MSISDNEntry';
46
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
47
- };
48
- export declare type IPinSubmitPayload = {
49
- type: 'PINEntry';
50
- result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
51
- actualPIN?: string;
52
- };
53
- export declare type IPinErrorPayload = {
54
- type: 'PINEntry';
55
- result: RDS.RemoteDataState<PINEntryFailure, PINEntrySuccess>;
56
- };
57
- export declare type IBackToStartPayload = {
58
- type: 'MSISDNEntry';
59
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
60
- };
61
- export declare type IPinActions = {
62
- type: 'PIN_FLOW_MSISDN_SUBMIT';
63
- payload: IMsisnSubmitActionPayload;
64
- } | {
65
- type: 'PIN_FLOW_MSISDN_SUBMIT_ERROR';
66
- payload: IMsisdnSubmitErrorPayload;
67
- } | {
68
- type: 'PIN_SUBMIT';
69
- payload: IPinSubmitPayload;
70
- } | {
71
- type: 'BACK_TO_START';
72
- payload: IBackToStartPayload;
73
- } | {
74
- type: 'PIN_SUBMIT_ERROR';
75
- payload: IPinErrorPayload;
76
- } | {
77
- type: 'MOCK_PIN_FLOW_STATE';
78
- payload: IPinFlowCurrentState;
79
- };
80
- export interface IPinFlowReducerState {
81
- currentState: IPinFlowCurrentState;
82
- }
83
- export declare type IConfig = {
84
- offer?: number;
85
- slug?: string;
86
- country?: string;
87
- host?: string;
88
- device?: 'smart' | 'feature';
89
- automaticallySubmitAllOperators?: boolean;
90
- operators?: string[];
91
- };
92
- export declare type IMSISDNSubmissionResult = {
93
- success: true;
94
- rockman_id: string;
95
- pin: string;
96
- product_url?: string;
97
- operator: string;
98
- redirect_to_url?: string;
99
- javascript?: string;
100
- } | {
101
- success: false;
102
- rockman_id: string;
103
- message: string;
104
- product_url?: string;
105
- };
106
- export declare type IPINSubmissionResult = {
107
- success: true;
108
- rockman_id: string;
109
- product_url?: string;
110
- async?: boolean;
111
- message?: string;
112
- } | {
113
- success: false;
114
- rockman_id: string;
115
- message: string;
116
- };
117
- export declare type ICheckSubscriptionResult = {
118
- success: false;
119
- rockman_id: string;
120
- message: string;
121
- } | {
122
- success: true;
123
- msisdn: string;
124
- product_url?: string;
125
- rockman_id: string;
126
- };
127
- export interface IHash {
128
- [key: string]: string;
129
- }
130
- export declare type SingleMSISDNSubmissionResult = {
131
- type: 'SingleMSISDNSubmissionResult';
132
- operator: string;
133
- pin?: string;
134
- uniqidResult?: string;
135
- redirectUrl?: string;
136
- };
137
- export declare type MultiOperatorMSISDNSubmissionResult = {
138
- type: 'MultiOperatorMSISDNSubmissionResult';
139
- };
140
- export declare type IMcpShieldResult = {
141
- success: true;
142
- rockman_id: string;
143
- source: string;
144
- uniqid: string;
145
- } | {
146
- success: false;
147
- rockman_id: string;
148
- message: string;
149
- };
150
- export declare type IMockPinFlowStates = 'msisdn-state' | 'pin-state' | 'completed-state' | 'msisdn-failure-state';
151
- export declare type IPinFlowActionMaps = {
152
- submitMSISDNAction: (msisdn: string, extraParams?: IHash) => AppThunk;
153
- submitPinAction: (msisdn: string, pin: string, extraParams?: {
154
- [key: string]: string;
155
- }) => AppThunk;
156
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
@@ -1,19 +0,0 @@
1
- import { AppThunk } from '../../common-types/AppThunk';
2
- import * as RDS from '../../common-types/RemoteDataState';
3
- import { IHash, IMockPinFlowStates, IPinActions, IPinFlowActionMaps, IPinFlowReducerState, MSISDNEntryFailure, MSISDNEntrySuccess } from './PinTypes';
4
- export declare function submitMSISDNAction(msisdn: string, extraParams?: IHash): AppThunk;
5
- export declare function checkLoadingAction(): AppThunk;
6
- export declare function reSubmitMSISDNAction(msisdn: string, extraParams?: IHash): AppThunk;
7
- export declare function submitPinAction(msisdn: string, pin: string, extraParams?: {
8
- [key: string]: string;
9
- }): AppThunk;
10
- export declare function mockPinFlow(mockState: IMockPinFlowStates): AppThunk;
11
- export declare function backToStart(): {
12
- type: string;
13
- payload: {
14
- type: string;
15
- result: RDS.RemoteDataState<MSISDNEntryFailure, MSISDNEntrySuccess>;
16
- };
17
- };
18
- export declare const PinFlowActionMaps: IPinFlowActionMaps;
19
- export default function PinFlowReducer(state: IPinFlowReducerState, action: IPinActions): IPinFlowReducerState;