@trustpayments/3ds-sdk-js 1.2.718 → 1.2.719
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.js +126 -60
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.tp-3ds-challenge-iframe{border:0;outline:0;overflow:hidden}@media (width
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.tp-3ds-challenge-iframe{border:0;outline:0;overflow:hidden}@media (max-width:440px){.tp-3ds-challenge-iframe{width:100%}}.tp-3ds-method-url-iframe{border:0;width:0;height:0}.tp-3ds-overlay{background-color:#ffffffe6;position:fixed;top:0;left:0}.tp-3ds-processing-screen{position:relative}.tp-3ds-processing-screen-wrapper{z-index:50;background-color:#ffffffe6;width:100%;height:100%;position:fixed;top:0;left:0}.tp-3ds-processing-screen-wrapper-attach-to-element{position:absolute}.tp-3ds-processing-screen-loader{box-sizing:border-box;will-change:animation;border:4px solid #e61c5b;border-color:#e61c5b #0000;border-radius:32px;width:40px;height:40px;animation:1.2s cubic-bezier(.5,0,.5,1) .15s infinite tp-3ds-spin;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%)rotate(0)}.tp-3ds-processing-screen-loader-with-logo{margin-top:30px}.tp-3ds-processing-screen-logo{-webkit-user-select:none;user-select:none;position:absolute;top:50%;left:50%}.tp-3ds-processing-screen-wrapper-visa .tp-3ds-processing-screen-logo{margin:-100px 0 0 -56px}.tp-3ds-processing-screen-wrapper-mastercard .tp-3ds-processing-screen-logo{margin:-123px 0 0 -79px}.tp-3ds-processing-screen-wrapper-amex .tp-3ds-processing-screen-logo{margin:-124px 0 0 -60px}@keyframes tp-3ds-spin{0%{transform:translate(-50%)rotate(0)}to{transform:translate(-50%)rotate(360deg)}}.tp-3ds-popup-view{content:"";z-index:999999;min-width:100vw;height:100vh}.tp-3ds-popup-view-overlay{box-sizing:border-box;background-color:#fff;flex-direction:column;padding:20px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:0 6px 22px -3px #000}.tp-3ds-popup-view-wrapper{height:100%}.tp-3ds-popup-view-header{justify-content:flex-end;display:flex}.tp-3ds-popup-view-header-button{background-color:#0000;border:0;font-size:12px;font-weight:600;position:relative;top:-10px;left:10px}.tp-3ds-popup-view-header-button:hover{cursor:pointer;text-decoration:underline}@media (max-width:440px){.tp-3ds-popup-view-overlay{width:100%;padding:5px}}.tp-3ds-inline-view iframe{width:100%;height:100%;min-height:200px;overflow:hidden}.tp-3ds-inline-view{height:100%}.tp-3ds-inline-view-wrapper{height:calc(100% - 18px)}.tp-3ds-inline-view-header{justify-content:flex-end;display:flex}.tp-3ds-inline-view-header-button{background-color:#0000;border:0;margin:10px;padding:0;font-size:12px;font-weight:600;position:relative}.tp-3ds-inline-view-header-button:hover{cursor:pointer;text-decoration:underline}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}function n(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function r(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function i(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function a(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function o(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function s(e){return this instanceof s?(this.v=e,this):new s(e)}function c(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),c(`next`),c(`throw`),c(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,f)}}function c(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||l(e,t)})},t&&(i[e]=t(i[e])))}function l(e,t){try{u(r[e](t))}catch(e){p(a[0][3],e)}}function u(e){e.value instanceof s?Promise.resolve(e.value.v).then(d,f):p(a[0][2],e)}function d(e){l(`next`,e)}function f(e){l(`throw`,e)}function p(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}function l(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof i==`function`?i(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,i){n=e[t](n),a(r,i,n.done,n.value)})}}function a(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function u(e){return typeof e==`function`}function d(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var f=d(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
3
3
|
`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
|
|
4
|
-
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function p(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var m=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=i(c),d=l.next();!d.done;d=l.next())d.value.remove(this)}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else c.remove(this);var p=this.initialTeardown;if(u(p))try{p()}catch(e){s=e instanceof f?e.errors:[e]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var h=i(m),g=h.next();!g.done;g=h.next()){var _=g.value;try{ee(_)}catch(e){s??=[],e instanceof f?s=o(o([],a(s)),a(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(s)throw new f(s)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)ee(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&p(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&p(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),h=m.EMPTY;function g(e){return e instanceof m||e&&`closed`in e&&u(e.remove)&&u(e.add)&&u(e.unsubscribe)}function ee(e){u(e)?e():e.unsubscribe()}var _={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},v={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=v.delegate;return i?.setTimeout?i.setTimeout.apply(i,o([e,t],a(n))):setTimeout.apply(void 0,o([e,t],a(n)))},clearTimeout:function(e){return(v.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function te(e){v.setTimeout(function(){var t=_.onUnhandledError;if(t)t(e);else throw e})}function ne(){}var re=(function(){return y(`C`,void 0,void 0)})();function ie(e){return y(`E`,void 0,e)}function ae(e){return y(`N`,e,void 0)}function y(e,t,n){return{kind:e,value:t,error:n}}var b=null;function x(e){if(_.useDeprecatedSynchronousErrorHandling){var t=!b;if(t&&(b={errorThrown:!1,error:null}),e(),t){var n=b,r=n.errorThrown,i=n.error;if(b=null,r)throw i}}else e()}function oe(e){_.useDeprecatedSynchronousErrorHandling&&b&&(b.errorThrown=!0,b.error=e)}var S=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,g(t)&&t.add(n)):n.destination=ue,n}return n.create=function(e,t,n){return new w(e,t,n)},n.prototype.next=function(e){this.isStopped?E(ae(e),this):this._next(e)},n.prototype.error=function(e){this.isStopped?E(ie(e),this):(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped?E(re,this):(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(m),se=Function.prototype.bind;function C(e,t){return se.call(e,t)}var ce=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){T(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){T(e)}else T(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){T(e)}},e}(),w=function(e){t(n,e);function n(t,n,r){var i=e.call(this)||this,a;if(u(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&_.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&C(t.next,o),error:t.error&&C(t.error,o),complete:t.complete&&C(t.complete,o)}):a=t}return i.destination=new ce(a),i}return n}(S);function T(e){_.useDeprecatedSynchronousErrorHandling?oe(e):te(e)}function le(e){throw e}function E(e,t){var n=_.onStoppedNotification;n&&v.setTimeout(function(){return n(e,t)})}var ue={closed:!0,next:ne,error:le,complete:ne},D=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function O(e){return e}function de(e){return e.length===0?O:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var k=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=me(e)?e:new w(e,t,n);return x(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=fe(t),new t(function(t,r){var i=new w({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[D]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return de(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=fe(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function fe(e){return e??_.Promise??Promise}function pe(e){return e&&u(e.next)&&u(e.error)&&u(e.complete)}function me(e){return e&&e instanceof S||pe(e)&&g(e)}function he(e){return u(e?.lift)}function A(e){return function(t){if(he(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function j(e,t,n,r,i){return new ge(e,t,n,r,i)}var ge=function(e){t(n,e);function n(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return n.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},n}(S),_e=d(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),M=function(e){t(n,e);function n(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return n.prototype.lift=function(e){var t=new ve(this,this);return t.operator=e,t},n.prototype._throwIfClosed=function(){if(this.closed)throw new _e},n.prototype.next=function(e){var t=this;x(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var a=i(t.currentObservers),o=a.next();!o.done;o=a.next())o.value.next(e)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}})},n.prototype.error=function(e){var t=this;x(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},n.prototype.complete=function(){var e=this;x(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},n.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?h:(this.currentObservers=null,a.push(e),new m(function(){t.currentObservers=null,p(a,e)}))},n.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},n.prototype.asObservable=function(){var e=new k;return e.source=this,e},n.create=function(e,t){return new ve(e,t)},n}(k),ve=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return n.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},n.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},n.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},n.prototype._subscribe=function(e){return this.source?.subscribe(e)??h},n}(M),ye=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(M),be={now:function(){return(be.delegate||Date).now()},delegate:void 0},xe=function(e){t(n,e);function n(t,n){return e.call(this)||this}return n.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},n}(m),N={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=N.delegate;return i?.setInterval?i.setInterval.apply(i,o([e,t],a(n))):setInterval.apply(void 0,o([e,t],a(n)))},clearInterval:function(e){return(N.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},Se=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return n.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},n.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),N.setInterval(e.flush.bind(e,this),n)},n.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&N.clearInterval(t)},n.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},n.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,p(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},n}(xe),Ce=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=be.now,e}(),we=new(function(e){t(n,e);function n(t,n){n===void 0&&(n=Ce.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return n.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},n}(Ce))(Se),Te=we,Ee=new k(function(e){return e.complete()});function De(e){return e&&u(e.schedule)}function Oe(e){return e[e.length-1]}function ke(e){return De(Oe(e))?e.pop():void 0}function Ae(e,t){return typeof Oe(e)==`number`?e.pop():t}var P=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function je(e){return u(e?.then)}function Me(e){return u(e[D])}function Ne(e){return Symbol.asyncIterator&&u(e?.[Symbol.asyncIterator])}function Pe(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Fe(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Ie=Fe();function Le(e){return u(e?.[Ie])}function Re(e){return c(this,arguments,function(){var t,n,i,a;return r(this,function(r){switch(r.label){case 0:t=e.getReader(),r.label=1;case 1:r.trys.push([1,,9,10]),r.label=2;case 2:return[4,s(t.read())];case 3:return n=r.sent(),i=n.value,a=n.done,a?[4,s(void 0)]:[3,5];case 4:return[2,r.sent()];case 5:return[4,s(i)];case 6:return[4,r.sent()];case 7:return r.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ze(e){return u(e?.getReader)}function F(e){if(e instanceof k)return e;if(e!=null){if(Me(e))return Be(e);if(P(e))return Ve(e);if(je(e))return He(e);if(Ne(e))return We(e);if(Le(e))return Ue(e);if(ze(e))return Ge(e)}throw Pe(e)}function Be(e){return new k(function(t){var n=e[D]();if(u(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function Ve(e){return new k(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function He(e){return new k(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,te)})}function Ue(e){return new k(function(t){var n,r;try{for(var a=i(e),o=a.next();!o.done;o=a.next()){var s=o.value;if(t.next(s),t.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}t.complete()})}function We(e){return new k(function(t){Ke(e,t).catch(function(e){return t.error(e)})})}function Ge(e){return We(Re(e))}function Ke(e,t){var i,a,o,s;return n(this,void 0,void 0,function(){var n,c;return r(this,function(r){switch(r.label){case 0:r.trys.push([0,5,6,11]),i=l(e),r.label=1;case 1:return[4,i.next()];case 2:if(a=r.sent(),a.done)return[3,4];if(n=a.value,t.next(n),t.closed)return[2];r.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=r.sent(),o={error:c},[3,11];case 6:return r.trys.push([6,,9,10]),a&&!a.done&&(s=i.return)?[4,s.call(i)]:[3,8];case 7:r.sent(),r.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function I(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function qe(e,t){return t===void 0&&(t=0),A(function(n,r){n.subscribe(j(r,function(n){return I(r,e,function(){return r.next(n)},t)},function(){return I(r,e,function(){return r.complete()},t)},function(n){return I(r,e,function(){return r.error(n)},t)}))})}function Je(e,t){return t===void 0&&(t=0),A(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Ye(e,t){return F(e).pipe(Je(t),qe(t))}function Xe(e,t){return F(e).pipe(Je(t),qe(t))}function Ze(e,t){return new k(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function Qe(e,t){return new k(function(n){var r;return I(n,t,function(){r=e[Ie](),I(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return u(r?.return)&&r.return()}})}function $e(e,t){if(!e)throw Error(`Iterable cannot be null`);return new k(function(n){I(n,t,function(){var r=e[Symbol.asyncIterator]();I(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function et(e,t){return $e(Re(e),t)}function tt(e,t){if(e!=null){if(Me(e))return Ye(e,t);if(P(e))return Ze(e,t);if(je(e))return Xe(e,t);if(Ne(e))return $e(e,t);if(Le(e))return Qe(e,t);if(ze(e))return et(e,t)}throw Pe(e)}function nt(e,t){return t?tt(e,t):F(e)}function L(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return nt(e,ke(e))}function R(e,t){var n=u(e)?e:function(){return e},r=function(e){return e.error(n())};return new k(t?function(e){return t.schedule(r,0,e)}:r)}var rt=d(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function it(e){return e instanceof Date&&!isNaN(e)}var at=d(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function ot(e,t){var n=it(e)?{first:e}:typeof e==`number`?{each:e}:e,r=n.first,i=n.each,a=n.with,o=a===void 0?st:a,s=n.scheduler,c=s===void 0?t??we:s,l=n.meta,u=l===void 0?null:l;if(r==null&&i==null)throw TypeError(`No timeout provided.`);return A(function(e,t){var n,a,s=null,l=0,d=function(e){a=I(t,c,function(){try{n.unsubscribe(),F(o({meta:u,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(j(t,function(e){a?.unsubscribe(),l++,t.next(s=e),i>0&&d(i)},void 0,void 0,function(){a?.closed||a?.unsubscribe(),s=null})),!l&&d(r==null?i:typeof r==`number`?r:+r-c.now())})}function st(e){throw new at(e)}function z(e,t){return A(function(n,r){var i=0;n.subscribe(j(r,function(n){r.next(e.call(t,n,i++))}))})}var ct=Array.isArray;function lt(e,t){return ct(t)?e.apply(void 0,o([],a(t))):e(t)}function ut(e){return z(function(t){return lt(e,t)})}function dt(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;F(n(e,u++)).subscribe(j(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?I(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(j(t,p,function(){d=!0,f()})),function(){s?.()}}function B(e,t,n){return n===void 0&&(n=1/0),u(t)?B(function(n,r){return z(function(e,i){return t(n,e,r,i)})(F(e(n,r)))},n):(typeof t==`number`&&(n=t),A(function(t,r){return dt(t,r,e,n)}))}function ft(e){return e===void 0&&(e=1/0),B(O,e)}function pt(e){return new k(function(t){F(e()).subscribe(t)})}var mt=[`addListener`,`removeListener`],ht=[`addEventListener`,`removeEventListener`],gt=[`on`,`off`];function V(e,t,n,r){if(u(n)&&(r=n,n=void 0),r)return V(e,t,n).pipe(ut(r));var i=a(bt(e)?ht.map(function(r){return function(i){return e[r](t,i,n)}}):vt(e)?mt.map(_t(e,t)):yt(e)?gt.map(_t(e,t)):[],2),o=i[0],s=i[1];if(!o&&P(e))return B(function(e){return V(e,t,n)})(F(e));if(!o)throw TypeError(`Invalid event target`);return new k(function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return o(t),function(){return s(t)}})}function _t(e,t){return function(n){return function(r){return e[n](t,r)}}}function vt(e){return u(e.addListener)&&u(e.removeListener)}function yt(e){return u(e.on)&&u(e.off)}function bt(e){return u(e.addEventListener)&&u(e.removeEventListener)}function xt(e,t,n){e===void 0&&(e=0),n===void 0&&(n=Te);var r=-1;return t!=null&&(De(t)?n=t:r=t),new k(function(t){var i=it(e)?+e-n.now():e;i<0&&(i=0);var a=0;return n.schedule(function(){t.closed||(t.next(a++),0<=r?this.schedule(void 0,r):t.complete())},i)})}function St(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ke(e),r=Ae(e,1/0),i=e;return i.length?i.length===1?F(i[0]):ft(r)(nt(i,n)):Ee}function Ct(e,t){return A(function(n,r){var i=0;n.subscribe(j(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function wt(e){return A(function(t,n){var r=null,i=!1,a;r=t.subscribe(j(n,void 0,void 0,function(o){a=F(e(o,wt(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Tt(e){return A(function(t,n){var r=!1;t.subscribe(j(n,function(e){r=!0,n.next(e)},function(){r||n.next(e),n.complete()}))})}function Et(e){return e<=0?function(){return Ee}:A(function(t,n){var r=0;t.subscribe(j(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function Dt(e){return e===void 0&&(e=Ot),A(function(t,n){var r=!1;t.subscribe(j(n,function(e){r=!0,n.next(e)},function(){return r?n.complete():n.error(e())}))})}function Ot(){return new rt}function kt(e){return A(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}function H(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Ct(function(t,n){return e(t,n,r)}):O,Et(1),n?Tt(t):Dt(function(){return new rt}))}}function At(e){e===void 0&&(e=1/0);var t=e&&typeof e==`object`?e:{count:e},n=t.count,r=n===void 0?1/0:n,i=t.delay,a=t.resetOnSuccess,o=a!==void 0&&a;return r<=0?O:A(function(e,t){var n=0,a,s=function(){var c=!1;a=e.subscribe(j(t,function(e){o&&(n=0),t.next(e)},void 0,function(e){if(n++<r){var o=function(){a?(a.unsubscribe(),a=null,s()):c=!0};if(i!=null){var l=typeof i==`number`?xt(i):F(i(e,n)),u=j(t,function(){u.unsubscribe(),o()},function(){t.complete()});l.subscribe(u)}else o()}else t.error(e)})),c&&(a.unsubscribe(),a=null,s())};s()})}function U(e,t){return A(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(j(r,function(n){i?.unsubscribe();var o=0,c=a++;F(e(n,c)).subscribe(i=j(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function W(e,t,n){var r=u(e)||t||n?{next:e,error:t,complete:n}:e;return r?A(function(e,t){var n;(n=r.subscribe)==null||n.call(r);var i=!0;e.subscribe(j(t,function(e){var n;(n=r.next)==null||n.call(r,e),t.next(e)},function(){var e;i=!1,(e=r.complete)==null||e.call(r),t.complete()},function(e){var n;i=!1,(n=r.error)==null||n.call(r,e),t.error(e)},function(){var e,t;i&&((e=r.unsubscribe)==null||e.call(r)),(t=r.finalize)==null||t.call(r)}))}):O}var G=function(e){return e.ERROR=`ERROR`,e.ALL=`ALL`,e}({}),jt=class{constructor(e,t,n,r,i,a,o){this.loggerService=e,this.configService=t,this.browserData=n,this.challengeService=r,this.methodURLService=i,this.sessionIdService=a,this.processingScreenService=o,this.addProcessingScreenDuration=e=>new Promise(t=>{setTimeout(()=>{t(`duration`)},e+2e3||2e3)}),this.logs$=this.loggerService.logs$}init$(e){try{return this.loggerService.init(e.loggingLevel||G.ERROR),this.configService.setConfig(e),this.sessionIdService.createId(),this.configService.getConfig$().pipe(H())}catch(e){return this.loggerService.error(e),R(this.loggerService.getErrorMessage(`Initialization failed\n\n${JSON.stringify(e)}`))}}run3DSMethod$(e,t,n){try{return this.methodURLService.run$(e,t,n).pipe(H())}catch(e){return this.loggerService.error(e),R(this.loggerService.getErrorMessage(`3DS Method failed\n\n${JSON.stringify(e)}`))}}doChallenge$(e,t,n,r,i,a){try{return this.challengeService.run$(e,t,n,r,i,a).pipe(H())}catch(e){return this.loggerService.error(e),R(this.loggerService.getErrorMessage(`3DS Challenge failed\n\n${JSON.stringify(e)}`))}}getBrowserData$(e,t){try{return this.browserData.getData$(e,t)}catch(e){throw this.loggerService.error(e),Error(`getBrowserData() failed.\n\n${JSON.stringify(e)}`)}}async showProcessingScreen(e,t=0){try{this.processingScreenService.show(e),await this.addProcessingScreenDuration(t)}catch(e){throw this.loggerService.error(e),Error(this.loggerService.getErrorMessage(`Show Processing Screen failed\n\n${JSON.stringify(e)}`))}}hideProcessingScreen(){try{this.processingScreenService.hide()}catch(e){throw this.loggerService.error(e),Error(this.loggerService.getErrorMessage(`Hide Processing Screen failed\n\n${JSON.stringify(e)}`))}}cancelChallenge$(){try{return this.challengeService.cancelChallenge$()}catch(e){throw this.loggerService.error(e),Error(this.loggerService.getErrorMessage(`Cancel process has failed\n\n${JSON.stringify(e)}`))}}},K=function(e){return e.ERROR=`error`,e.WARNING=`warning`,e.DEBUG=`debug`,e}({}),Mt=class{constructor(){this.logsSubject$=new M,this.loggingLevel=G.ERROR,this.logs$=this.logsSubject$.asObservable()}init(e){this.loggingLevel=e,this.logsSubject$.subscribe(e=>this.logToConsole(e))}getErrorMessage(e){return e instanceof Error?`3dsJS dev error\n\n${e.message}`:`3dsJS dev error\n\n${e}`}error(e){let t=typeof e==`string`?e:e.stack;this.logMessage(K.ERROR,`${t}`)}warning(e){this.logMessage(K.WARNING,`3dsJS dev warning\n\n${e}`)}debug(e){this.logMessage(K.DEBUG,`3dsJS dev debug\n\n${e}`)}logMessage(e,t){this.logsSubject$.next({type:e,message:t,time:new Date})}logToConsole(e){if(!(this.loggingLevel===G.ERROR&&e.type!==K.ERROR))switch(e.type){case K.ERROR:console.error(e.message);break;case K.WARNING:console.warn(e.message);break;case K.DEBUG:console.debug(e.message);break}}},q=class e extends Error{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}},J=function(e){return e.OVERLAY=`OVERLAY`,e.ATTACH_TO_ELEMENT=`ATTACH_TO_ELEMENT`,e}({}),Y=function(e){return e.POPUP=`POPUP`,e.INLINE=`INLINE`,e}({}),Nt=class{constructor(e){this.domMethodsService=e,this.translationsWhitelist=[`cancel`],this.config$=new ye({challengeDisplayMode:Y.POPUP,loggingLevel:G.ERROR,translations:{cancel:`X`},processingScreenMode:J.OVERLAY,threeDSMethodTimeout:1e4})}getConfig$(){return this.config$.asObservable()}setConfig(e){let t={...this.config$.value,...e};this.validateConfig(t),this.config$.next(t)}validateConfig(e){this.validateAgainstUnknownProperties(e),this.validateChallengeDisplayMode(e),this.validateLoggingLevel(e),this.validateTranslations(e),this.validateProcessingScreen(e),this.validateThreeDSMethodTimeout(e)}validateAgainstUnknownProperties(e){let t=[`challengeDisplayMode`,`challengeDisplayInlineTargetElementId`,`loggingLevel`,`translations`,`processingScreenMode`,`processingScreenWrapperElementId`,`threeDSMethodTimeout`],n=Object.keys(e).filter(e=>!t.includes(e));if(n.length>0)throw new q(`config contains unknown properties: ${n.join(`, `)}`)}validateChallengeDisplayMode(e){if(!Object.values(Y).includes(e.challengeDisplayMode))throw new q(`config.challengeDisplayMode must be either ${Y.POPUP} or ${Y.INLINE}`);if(e.challengeDisplayMode===Y.INLINE&&!this.domMethodsService.getElement(`#${e.challengeDisplayInlineTargetElementId}`))throw new q(`config.challengeDisplayInlineTargetElementId must exist when using display mode ${Y.INLINE}`)}validateLoggingLevel(e){if(!Object.values(G).includes(e.loggingLevel))throw new q(`config.loggingLevel must be: ${G.ERROR} or ${G.ALL}`)}validateTranslations(e){if(e.translations){let t=Object.keys(e.translations).filter(e=>!this.translationsWhitelist.includes(e));if(t.length>0)throw new q(`config.translations contains unknown keys: ${t.join(`,`)}. Whitelisted keys are: ${this.translationsWhitelist.join(`,`)}`)}else throw new q(`config.translations must be an object`)}validateProcessingScreen(e){if(!Object.values(J).includes(e.processingScreenMode))throw new q(`config.processingScreenMode must be either ${J.OVERLAY} or ${J.ATTACH_TO_ELEMENT}`);if(e.processingScreenMode===J.ATTACH_TO_ELEMENT&&!this.domMethodsService.getElement(`#${e.processingScreenWrapperElementId}`))throw new q(`config.processingScreenWrapperElementId must exist when using processing screen mode ${J.ATTACH_TO_ELEMENT}`)}validateThreeDSMethodTimeout(e){if(!(typeof e.threeDSMethodTimeout==`number`&&e.threeDSMethodTimeout>0&&e.threeDSMethodTimeout<=1e4))throw new q(`config.threeDSMethodTimeout must be a number in range from 1 to 10000 milliseconds`)}},Pt=class{constructor(){this.sessionId=null}createId(){this.sessionId=crypto.randomUUID()}getId(){return this.sessionId}},X=function(e){return e.METHOD_URL_RESPONSE=`TP_METHOD_URL_RESPONSE`,e.CHALLENGE_RESPONSE=`TP_CHALLENGE_RESPONSE`,e.BROWSER_DATA_RESPONSE=`TP_BROWSER_DATA_RESPONSE`,e}({}),Ft=class{constructor(e,t,n,r,i){this.window=e,this.domMethodsService=t,this.interFrameCommunicatorService=n,this.base64TranscoderService=r,this.loggerService=i,this.acceptableColorDepthValues=[1,4,8,15,16,24,32,48],this.fallbackColorDepthValue=24,this.browserDataIframeSelector=`tp-3ds-browser-data-iframe`,this.browserDataTimeout=1e4,this.fallbackAcceptHeaderValue=`*/*`}getData$(e,t){let n=this.getBrowserGeneralDataObject(t);return t&&!t.isRequiredBrowserIP&&!t.isRequiredBrowserAcceptHeader?L(n):this.getAcceptHeaderAndIPAddress$(e).pipe(z(e=>{let r={...n};return t?(t.isRequiredBrowserAcceptHeader&&(r.browserAcceptHeader=e.browserAcceptHeader),t.isRequiredBrowserIP&&(r.browserIP=e.browserIP)):(r.browserAcceptHeader=e.browserAcceptHeader,r.browserIP=e.browserIP),r}))}getBrowserGeneralDataObject(e){let t=e=>{if(!e)return``;let t=e.split(/[;,]/)[0].trim();t=t.replace(/_/g,`-`);let n=t.split(`-`);return n.length===1?n[0]:n.slice(0,2).join(`-`)},n={};return e?(e.isRequiredBrowserJavaEnabled&&(n.browserJavaEnabled=this.window.navigator.javaEnabled()),e.isRequiredBrowserJavascriptEnabled&&(n.browserJavascriptEnabled=!0),e.isRequiredBrowserLanguage&&(n.browserLanguage=t(this.window.navigator.language||this.window.navigator.userLanguage)),e.isRequiredBrowserScreenWidth&&(n.browserScreenWidth=this.window.screen.width),e.isRequiredBrowserScreenHeight&&(n.browserScreenHeight=this.getScreenHeight()),e.isRequiredBrowserColorDepth&&(n.browserColorDepth=this.getColorDepth(this.window.screen)),e.isRequiredBrowserUserAgent&&(n.browserUserAgent=this.window.navigator.userAgent),e.isRequiredBrowserTZ&&(n.browserTZ=new Date().getTimezoneOffset())):n={browserJavaEnabled:this.window.navigator.javaEnabled(),browserJavascriptEnabled:!0,browserLanguage:t(this.window.navigator.language),browserScreenWidth:this.window.screen.width,browserScreenHeight:this.getScreenHeight(),browserColorDepth:this.getColorDepth(this.window.screen),browserUserAgent:this.window.navigator.userAgent,browserTZ:new Date().getTimezoneOffset()},n}getScreenHeight(){let e=[this.window.screen.height,this.window.screen.availHeight,this.window.innerHeight,this.window.outerHeight],t=!1,n=999999,r=n;for(let i of e)if(i!==void 0&&typeof i==`number`&&i>0&&i<=n){r=i;break}else t=!0;return t&&this.loggerService.error(`Error in calculating screen height. Chosen value is ${r}. Options were ${JSON.stringify(e)}`),r}getColorDepth(e){return this.acceptableColorDepthValues.includes(e.colorDepth)?e.colorDepth:this.fallbackColorDepthValue}getAcceptHeaderAndIPAddress$(e){let t=typeof e==`string`?e:e[0];return pt(()=>L(this.createIframeForAcceptHeaderAndIPAddress(t))).pipe(U(()=>this.interFrameCommunicatorService.receive$(X.BROWSER_DATA_RESPONSE).pipe(Et(1))),W(e=>this.loggerService.debug(`Received raw browser data from iframe: ${e}`)),z(e=>this.base64TranscoderService.decode(e)),z(e=>({browserAcceptHeader:e.acceptHeader,browserIP:e.userIP})),W(e=>this.loggerService.debug(`Collected browser data: ${JSON.stringify(e)}`)),kt(()=>this.destroyView()),ot(this.browserDataTimeout),At(2),wt(e=>(this.loggerService.error(`Cannot retrieve user IP and accept header. Using fallback values instead.`),this.loggerService.error(e),L({browserAcceptHeader:this.fallbackAcceptHeaderValue,browserIP:``}))))}createIframeForAcceptHeaderAndIPAddress(e){let t=this.domMethodsService.createElement(`iframe`,{src:e,id:this.browserDataIframeSelector,width:`0px`,height:`0px`});this.domMethodsService.addToElement(t,this.domMethodsService.getElement(`body`)),this.loggerService.debug(`Created browser data iframe, url: ${e}`),t.addEventListener(`load`,()=>this.loggerService.debug(`Browser data iframe load completed, waiting for data`))}destroyView(){this.domMethodsService.removeElement(this.domMethodsService.getElement(`#${this.browserDataIframeSelector}`)),this.loggerService.debug(`Destroyed browser data iframe`)}},Z=class e{static get V2(){return new e(`2.0.0`)}static{this.versionNumberPattern=/^\d+\.\d+\.\d+$/}constructor(t){if(!t||!t.match(e.versionNumberPattern))throw Error(`Invalid 3DS version: ${t}`);let[n,r,i]=t.split(`.`);this.major=Number(n),this.minor=Number(r),this.patch=Number(i)}isEqual(e){return this.toString()===e.toString()}isHigherThan(e){return this.major===e.major?this.minor===e.minor?this.patch>e.patch:this.minor>e.minor:this.major>e.major}isHigherOrEqual(e){return this.isEqual(e)||this.isHigherThan(e)}isLowerThan(e){return!this.isHigherOrEqual(e)}isLowerOrEqual(e){return!this.isHigherThan(e)}toString(){return`${this.major}.${this.minor}.${this.patch}`}},It=class{constructor(e,t,n,r){this.configService=e,this.challengeV1Service=t,this.challengeV2Service=n,this.challengeCommonService=r}run$(e,t,n,r,i,a){return this.configService.getConfig$().pipe(U(o=>e.isLowerThan(Z.V2)?this.challengeV1Service.run$(o,t,n,i,a,r):this.challengeV2Service.run$(o,t,n,r)))}cancelChallenge$(){return this.configService.getConfig$().pipe(W(e=>this.challengeCommonService.cancelChallenge(e)),U(e=>this.challengeCommonService.handleCancelEvent$(e)))}},Q=function(e){return e.SUCCESS=`SUCCESS`,e.FAILURE=`FAILURE`,e.ERROR=`ERROR`,e.NOACTION=`NOACTION`,e.CANCELLED=`CANCELLED`,e.COMPLETED=`COMPLETED`,e.UNCOMPLETED=`UNCOMPLETED`,e}({}),Lt=class{constructor(e,t,n,r,i){this.domMethodsService=e,this.interFrameCommunicatorService=t,this.base64TranscoderService=n,this.iframeCreatorService=r,this.configService=i,this.methodURLIframeSelector=`tp-3ds-method-url-iframe`,this.methodURLIframeFormSelector=`tp-3ds-method-url-form`}run$(e,t,n){if(typeof e!=`string`||e.length===0)throw new q(`run3DSMethod$() requires transactionId`);if(typeof t!=`string`||t.length===0)throw new q(`run3DSMethod$() requires notificationURL`);if(typeof n!=`string`||n.length===0)throw new q(`run3DSMethod$() requires methodURL`);return this.domMethodsService.addToElement(this.createIframeForMethodURL(n,e,t),this.domMethodsService.getElement(`body`)),this.configService.getConfig$().pipe(U(t=>this.interFrameCommunicatorService.receive$(X.METHOD_URL_RESPONSE).pipe(z(e=>this.mapStatus(this.base64TranscoderService.decode(e))),ot({first:t.threeDSMethodTimeout,with:()=>L(this.getUncompletedResult(e))}),W(()=>{this.destroyView()}))))}createIframeForMethodURL(e,t,n){let r=this.base64TranscoderService.encode({threeDSServerTransID:t,threeDSMethodNotificationURL:n}),i=this.iframeCreatorService.getIframe(this.methodURLIframeSelector),a=()=>{i.contentWindow.document.body.innerHTML=this.iframeCreatorService.getIframeHTMLMarkup(this.methodURLIframeFormSelector,e,[{name:`threeDSMethodData`,value:r}]),i.removeEventListener(`load`,a),i.contentWindow.document.getElementById(this.methodURLIframeFormSelector).submit()};return i.addEventListener(`load`,a),i}mapStatus(e){return{status:e.actionCode,description:e.errorDescription,transactionId:e.threeDSServerTransID}}destroyView(){this.domMethodsService.removeElement(this.domMethodsService.getElement(`#${this.methodURLIframeSelector}`))}getUncompletedResult(e){return{status:Q.UNCOMPLETED,description:`Method URL did not complete`,transactionId:e}}},$=function(e){return e.VISA=`VISA`,e.ELECTRON=`ELECTRON`,e.DELTA=`DELTA`,e.VPAY=`VPAY`,e.PURCHASING=`PURCHASING`,e.MASTER_CARD=`MASTERCARD`,e.MASTER_CARD_DEBIT=`MASTERCARDDEBIT`,e.MAESTRO=`MAESTRO`,e.AMEX=`AMEX`,e.UNKNOWN=`UNKNOWN`,e}({}),Rt=`
|
|
4
|
+
`):``,this.name=`UnsubscriptionError`,this.errors=t}});function p(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var m=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=i(c),d=l.next();!d.done;d=l.next())d.value.remove(this)}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else c.remove(this);var p=this.initialTeardown;if(u(p))try{p()}catch(e){s=e instanceof f?e.errors:[e]}var m=this._finalizers;if(m){this._finalizers=null;try{for(var h=i(m),g=h.next();!g.done;g=h.next()){var _=g.value;try{ee(_)}catch(e){s??=[],e instanceof f?s=o(o([],a(s)),a(e.errors)):s.push(e)}}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(s)throw new f(s)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)ee(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&p(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&p(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),h=m.EMPTY;function g(e){return e instanceof m||e&&`closed`in e&&u(e.remove)&&u(e.add)&&u(e.unsubscribe)}function ee(e){u(e)?e():e.unsubscribe()}var _={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},v={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=v.delegate;return i?.setTimeout?i.setTimeout.apply(i,o([e,t],a(n))):setTimeout.apply(void 0,o([e,t],a(n)))},clearTimeout:function(e){return(v.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function te(e){v.setTimeout(function(){var t=_.onUnhandledError;if(t)t(e);else throw e})}function ne(){}var re=(function(){return y(`C`,void 0,void 0)})();function ie(e){return y(`E`,void 0,e)}function ae(e){return y(`N`,e,void 0)}function y(e,t,n){return{kind:e,value:t,error:n}}var b=null;function x(e){if(_.useDeprecatedSynchronousErrorHandling){var t=!b;if(t&&(b={errorThrown:!1,error:null}),e(),t){var n=b,r=n.errorThrown,i=n.error;if(b=null,r)throw i}}else e()}function oe(e){_.useDeprecatedSynchronousErrorHandling&&b&&(b.errorThrown=!0,b.error=e)}var S=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,g(t)&&t.add(n)):n.destination=ue,n}return n.create=function(e,t,n){return new w(e,t,n)},n.prototype.next=function(e){this.isStopped?E(ae(e),this):this._next(e)},n.prototype.error=function(e){this.isStopped?E(ie(e),this):(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped?E(re,this):(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},n.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},n}(m),se=Function.prototype.bind;function C(e,t){return se.call(e,t)}var ce=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){T(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){T(e)}else T(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){T(e)}},e}(),w=function(e){t(n,e);function n(t,n,r){var i=e.call(this)||this,a;if(u(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&_.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&C(t.next,o),error:t.error&&C(t.error,o),complete:t.complete&&C(t.complete,o)}):a=t}return i.destination=new ce(a),i}return n}(S);function T(e){_.useDeprecatedSynchronousErrorHandling?oe(e):te(e)}function le(e){throw e}function E(e,t){var n=_.onStoppedNotification;n&&v.setTimeout(function(){return n(e,t)})}var ue={closed:!0,next:ne,error:le,complete:ne},D=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function O(e){return e}function de(e){return e.length===0?O:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var k=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=me(e)?e:new w(e,t,n);return x(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=fe(t),new t(function(t,r){var i=new w({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[D]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return de(e)(this)},e.prototype.toPromise=function(e){var t=this;return e=fe(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function fe(e){return e??_.Promise??Promise}function pe(e){return e&&u(e.next)&&u(e.error)&&u(e.complete)}function me(e){return e&&e instanceof S||pe(e)&&g(e)}function he(e){return u(e?.lift)}function A(e){return function(t){if(he(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function j(e,t,n,r,i){return new ge(e,t,n,r,i)}var ge=function(e){t(n,e);function n(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return n.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},n}(S),_e=d(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),M=function(e){t(n,e);function n(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return n.prototype.lift=function(e){var t=new ve(this,this);return t.operator=e,t},n.prototype._throwIfClosed=function(){if(this.closed)throw new _e},n.prototype.next=function(e){var t=this;x(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var a=i(t.currentObservers),o=a.next();!o.done;o=a.next())o.value.next(e)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}})},n.prototype.error=function(e){var t=this;x(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},n.prototype.complete=function(){var e=this;x(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},n.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(n.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),n.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},n.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?h:(this.currentObservers=null,a.push(e),new m(function(){t.currentObservers=null,p(a,e)}))},n.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},n.prototype.asObservable=function(){var e=new k;return e.source=this,e},n.create=function(e,t){return new ve(e,t)},n}(k),ve=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return n.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},n.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},n.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},n.prototype._subscribe=function(e){return this.source?.subscribe(e)??h},n}(M),ye=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(M),be={now:function(){return(be.delegate||Date).now()},delegate:void 0},xe=function(e){t(n,e);function n(t,n){return e.call(this)||this}return n.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},n}(m),N={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=N.delegate;return i?.setInterval?i.setInterval.apply(i,o([e,t],a(n))):setInterval.apply(void 0,o([e,t],a(n)))},clearInterval:function(e){return(N.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},Se=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return n.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},n.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),N.setInterval(e.flush.bind(e,this),n)},n.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&N.clearInterval(t)},n.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},n.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,p(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},n}(xe),Ce=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=be.now,e}(),we=new(function(e){t(n,e);function n(t,n){n===void 0&&(n=Ce.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return n.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},n}(Ce))(Se),Te=we,Ee=new k(function(e){return e.complete()});function De(e){return e&&u(e.schedule)}function Oe(e){return e[e.length-1]}function ke(e){return De(Oe(e))?e.pop():void 0}function Ae(e,t){return typeof Oe(e)==`number`?e.pop():t}var P=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function je(e){return u(e?.then)}function Me(e){return u(e[D])}function Ne(e){return Symbol.asyncIterator&&u(e?.[Symbol.asyncIterator])}function Pe(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Fe(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var Ie=Fe();function Le(e){return u(e?.[Ie])}function Re(e){return c(this,arguments,function(){var t,n,i,a;return r(this,function(r){switch(r.label){case 0:t=e.getReader(),r.label=1;case 1:r.trys.push([1,,9,10]),r.label=2;case 2:return[4,s(t.read())];case 3:return n=r.sent(),i=n.value,a=n.done,a?[4,s(void 0)]:[3,5];case 4:return[2,r.sent()];case 5:return[4,s(i)];case 6:return[4,r.sent()];case 7:return r.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function ze(e){return u(e?.getReader)}function F(e){if(e instanceof k)return e;if(e!=null){if(Me(e))return Be(e);if(P(e))return Ve(e);if(je(e))return He(e);if(Ne(e))return We(e);if(Le(e))return Ue(e);if(ze(e))return Ge(e)}throw Pe(e)}function Be(e){return new k(function(t){var n=e[D]();if(u(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function Ve(e){return new k(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function He(e){return new k(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,te)})}function Ue(e){return new k(function(t){var n,r;try{for(var a=i(e),o=a.next();!o.done;o=a.next()){var s=o.value;if(t.next(s),t.closed)return}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}t.complete()})}function We(e){return new k(function(t){Ke(e,t).catch(function(e){return t.error(e)})})}function Ge(e){return We(Re(e))}function Ke(e,t){var i,a,o,s;return n(this,void 0,void 0,function(){var n,c;return r(this,function(r){switch(r.label){case 0:r.trys.push([0,5,6,11]),i=l(e),r.label=1;case 1:return[4,i.next()];case 2:if(a=r.sent(),a.done)return[3,4];if(n=a.value,t.next(n),t.closed)return[2];r.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=r.sent(),o={error:c},[3,11];case 6:return r.trys.push([6,,9,10]),a&&!a.done&&(s=i.return)?[4,s.call(i)]:[3,8];case 7:r.sent(),r.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function I(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function qe(e,t){return t===void 0&&(t=0),A(function(n,r){n.subscribe(j(r,function(n){return I(r,e,function(){return r.next(n)},t)},function(){return I(r,e,function(){return r.complete()},t)},function(n){return I(r,e,function(){return r.error(n)},t)}))})}function Je(e,t){return t===void 0&&(t=0),A(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function Ye(e,t){return F(e).pipe(Je(t),qe(t))}function Xe(e,t){return F(e).pipe(Je(t),qe(t))}function Ze(e,t){return new k(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function Qe(e,t){return new k(function(n){var r;return I(n,t,function(){r=e[Ie](),I(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return u(r?.return)&&r.return()}})}function $e(e,t){if(!e)throw Error(`Iterable cannot be null`);return new k(function(n){I(n,t,function(){var r=e[Symbol.asyncIterator]();I(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function et(e,t){return $e(Re(e),t)}function tt(e,t){if(e!=null){if(Me(e))return Ye(e,t);if(P(e))return Ze(e,t);if(je(e))return Xe(e,t);if(Ne(e))return $e(e,t);if(Le(e))return Qe(e,t);if(ze(e))return et(e,t)}throw Pe(e)}function nt(e,t){return t?tt(e,t):F(e)}function L(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return nt(e,ke(e))}function R(e,t){var n=u(e)?e:function(){return e},r=function(e){return e.error(n())};return new k(t?function(e){return t.schedule(r,0,e)}:r)}var rt=d(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function it(e){return e instanceof Date&&!isNaN(e)}var at=d(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function ot(e,t){var n=it(e)?{first:e}:typeof e==`number`?{each:e}:e,r=n.first,i=n.each,a=n.with,o=a===void 0?st:a,s=n.scheduler,c=s===void 0?t??we:s,l=n.meta,u=l===void 0?null:l;if(r==null&&i==null)throw TypeError(`No timeout provided.`);return A(function(e,t){var n,a,s=null,l=0,d=function(e){a=I(t,c,function(){try{n.unsubscribe(),F(o({meta:u,lastValue:s,seen:l})).subscribe(t)}catch(e){t.error(e)}},e)};n=e.subscribe(j(t,function(e){a?.unsubscribe(),l++,t.next(s=e),i>0&&d(i)},void 0,void 0,function(){a?.closed||a?.unsubscribe(),s=null})),!l&&d(r==null?i:typeof r==`number`?r:+r-c.now())})}function st(e){throw new at(e)}function z(e,t){return A(function(n,r){var i=0;n.subscribe(j(r,function(n){r.next(e.call(t,n,i++))}))})}var ct=Array.isArray;function lt(e,t){return ct(t)?e.apply(void 0,o([],a(t))):e(t)}function ut(e){return z(function(t){return lt(e,t)})}function dt(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;F(n(e,u++)).subscribe(j(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?I(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(j(t,p,function(){d=!0,f()})),function(){s?.()}}function B(e,t,n){return n===void 0&&(n=1/0),u(t)?B(function(n,r){return z(function(e,i){return t(n,e,r,i)})(F(e(n,r)))},n):(typeof t==`number`&&(n=t),A(function(t,r){return dt(t,r,e,n)}))}function ft(e){return e===void 0&&(e=1/0),B(O,e)}function pt(e){return new k(function(t){F(e()).subscribe(t)})}var mt=[`addListener`,`removeListener`],ht=[`addEventListener`,`removeEventListener`],gt=[`on`,`off`];function V(e,t,n,r){if(u(n)&&(r=n,n=void 0),r)return V(e,t,n).pipe(ut(r));var i=a(bt(e)?ht.map(function(r){return function(i){return e[r](t,i,n)}}):vt(e)?mt.map(_t(e,t)):yt(e)?gt.map(_t(e,t)):[],2),o=i[0],s=i[1];if(!o&&P(e))return B(function(e){return V(e,t,n)})(F(e));if(!o)throw TypeError(`Invalid event target`);return new k(function(e){var t=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.next(1<t.length?t:t[0])};return o(t),function(){return s(t)}})}function _t(e,t){return function(n){return function(r){return e[n](t,r)}}}function vt(e){return u(e.addListener)&&u(e.removeListener)}function yt(e){return u(e.on)&&u(e.off)}function bt(e){return u(e.addEventListener)&&u(e.removeEventListener)}function xt(e,t,n){e===void 0&&(e=0),n===void 0&&(n=Te);var r=-1;return t!=null&&(De(t)?n=t:r=t),new k(function(t){var i=it(e)?+e-n.now():e;i<0&&(i=0);var a=0;return n.schedule(function(){t.closed||(t.next(a++),0<=r?this.schedule(void 0,r):t.complete())},i)})}function St(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=ke(e),r=Ae(e,1/0),i=e;return i.length?i.length===1?F(i[0]):ft(r)(nt(i,n)):Ee}function Ct(e,t){return A(function(n,r){var i=0;n.subscribe(j(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function wt(e){return A(function(t,n){var r=null,i=!1,a;r=t.subscribe(j(n,void 0,void 0,function(o){a=F(e(o,wt(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Tt(e){return A(function(t,n){var r=!1;t.subscribe(j(n,function(e){r=!0,n.next(e)},function(){r||n.next(e),n.complete()}))})}function Et(e){return e<=0?function(){return Ee}:A(function(t,n){var r=0;t.subscribe(j(n,function(t){++r<=e&&(n.next(t),e<=r&&n.complete())}))})}function Dt(e){return e===void 0&&(e=Ot),A(function(t,n){var r=!1;t.subscribe(j(n,function(e){r=!0,n.next(e)},function(){return r?n.complete():n.error(e())}))})}function Ot(){return new rt}function kt(e){return A(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}function H(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?Ct(function(t,n){return e(t,n,r)}):O,Et(1),n?Tt(t):Dt(function(){return new rt}))}}function At(e){e===void 0&&(e=1/0);var t=e&&typeof e==`object`?e:{count:e},n=t.count,r=n===void 0?1/0:n,i=t.delay,a=t.resetOnSuccess,o=a!==void 0&&a;return r<=0?O:A(function(e,t){var n=0,a,s=function(){var c=!1;a=e.subscribe(j(t,function(e){o&&(n=0),t.next(e)},void 0,function(e){if(n++<r){var o=function(){a?(a.unsubscribe(),a=null,s()):c=!0};if(i!=null){var l=typeof i==`number`?xt(i):F(i(e,n)),u=j(t,function(){u.unsubscribe(),o()},function(){t.complete()});l.subscribe(u)}else o()}else t.error(e)})),c&&(a.unsubscribe(),a=null,s())};s()})}function U(e,t){return A(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(j(r,function(n){i?.unsubscribe();var o=0,c=a++;F(e(n,c)).subscribe(i=j(r,function(e){return r.next(t?t(n,e,c,o++):e)},function(){i=null,s()}))},function(){o=!0,s()}))})}function W(e,t,n){var r=u(e)||t||n?{next:e,error:t,complete:n}:e;return r?A(function(e,t){var n;(n=r.subscribe)==null||n.call(r);var i=!0;e.subscribe(j(t,function(e){var n;(n=r.next)==null||n.call(r,e),t.next(e)},function(){var e;i=!1,(e=r.complete)==null||e.call(r),t.complete()},function(e){var n;i=!1,(n=r.error)==null||n.call(r,e),t.error(e)},function(){var e,t;i&&((e=r.unsubscribe)==null||e.call(r)),(t=r.finalize)==null||t.call(r)}))}):O}var G=function(e){return e.ERROR=`ERROR`,e.ALL=`ALL`,e}({}),jt=class{loggerService;configService;browserData;challengeService;methodURLService;sessionIdService;processingScreenService;logs$;constructor(e,t,n,r,i,a,o){this.loggerService=e,this.configService=t,this.browserData=n,this.challengeService=r,this.methodURLService=i,this.sessionIdService=a,this.processingScreenService=o,this.logs$=this.loggerService.logs$}init$(e){try{return this.loggerService.init(e.loggingLevel||G.ERROR),this.configService.setConfig(e),this.sessionIdService.createId(),this.configService.getConfig$().pipe(H())}catch(e){return this.loggerService.error(e),R(this.loggerService.getErrorMessage(`Initialization failed\n\n${JSON.stringify(e)}`))}}run3DSMethod$(e,t,n){try{return this.methodURLService.run$(e,t,n).pipe(H())}catch(e){return this.loggerService.error(e),R(this.loggerService.getErrorMessage(`3DS Method failed\n\n${JSON.stringify(e)}`))}}doChallenge$(e,t,n,r,i,a){try{return this.challengeService.run$(e,t,n,r,i,a).pipe(H())}catch(e){return this.loggerService.error(e),R(this.loggerService.getErrorMessage(`3DS Challenge failed\n\n${JSON.stringify(e)}`))}}getBrowserData$(e,t){try{return this.browserData.getData$(e,t)}catch(e){throw this.loggerService.error(e),Error(`getBrowserData() failed.\n\n${JSON.stringify(e)}`)}}addProcessingScreenDuration=e=>new Promise(t=>{setTimeout(()=>{t(`duration`)},e+2e3||2e3)});async showProcessingScreen(e,t=0){try{this.processingScreenService.show(e),await this.addProcessingScreenDuration(t)}catch(e){throw this.loggerService.error(e),Error(this.loggerService.getErrorMessage(`Show Processing Screen failed\n\n${JSON.stringify(e)}`))}}hideProcessingScreen(){try{this.processingScreenService.hide()}catch(e){throw this.loggerService.error(e),Error(this.loggerService.getErrorMessage(`Hide Processing Screen failed\n\n${JSON.stringify(e)}`))}}cancelChallenge$(){try{return this.challengeService.cancelChallenge$()}catch(e){throw this.loggerService.error(e),Error(this.loggerService.getErrorMessage(`Cancel process has failed\n\n${JSON.stringify(e)}`))}}},K=function(e){return e.ERROR=`error`,e.WARNING=`warning`,e.DEBUG=`debug`,e}({}),Mt=class{logsSubject$=new M;loggingLevel=G.ERROR;logs$=this.logsSubject$.asObservable();init(e){this.loggingLevel=e,this.logsSubject$.subscribe(e=>this.logToConsole(e))}getErrorMessage(e){return e instanceof Error?`3dsJS dev error\n\n${e.message}`:`3dsJS dev error\n\n${e}`}error(e){let t=typeof e==`string`?e:e.stack;this.logMessage(K.ERROR,`${t}`)}warning(e){this.logMessage(K.WARNING,`3dsJS dev warning\n\n${e}`)}debug(e){this.logMessage(K.DEBUG,`3dsJS dev debug\n\n${e}`)}logMessage(e,t){this.logsSubject$.next({type:e,message:t,time:new Date})}logToConsole(e){if(!(this.loggingLevel===G.ERROR&&e.type!==K.ERROR))switch(e.type){case K.ERROR:console.error(e.message);break;case K.WARNING:console.warn(e.message);break;case K.DEBUG:console.debug(e.message);break}}},q=class e extends Error{constructor(t){super(t),this.name=`ValidationError`,Object.setPrototypeOf(this,e.prototype)}},J=function(e){return e.OVERLAY=`OVERLAY`,e.ATTACH_TO_ELEMENT=`ATTACH_TO_ELEMENT`,e}({}),Y=function(e){return e.POPUP=`POPUP`,e.INLINE=`INLINE`,e}({}),Nt=class{domMethodsService;translationsWhitelist=[`cancel`];constructor(e){this.domMethodsService=e}config$=new ye({challengeDisplayMode:Y.POPUP,loggingLevel:G.ERROR,translations:{cancel:`X`},processingScreenMode:J.OVERLAY,threeDSMethodTimeout:1e4});getConfig$(){return this.config$.asObservable()}setConfig(e){let t={...this.config$.value,...e};this.validateConfig(t),this.config$.next(t)}validateConfig(e){this.validateAgainstUnknownProperties(e),this.validateChallengeDisplayMode(e),this.validateLoggingLevel(e),this.validateTranslations(e),this.validateProcessingScreen(e),this.validateThreeDSMethodTimeout(e)}validateAgainstUnknownProperties(e){let t=[`challengeDisplayMode`,`challengeDisplayInlineTargetElementId`,`loggingLevel`,`translations`,`processingScreenMode`,`processingScreenWrapperElementId`,`threeDSMethodTimeout`],n=Object.keys(e).filter(e=>!t.includes(e));if(n.length>0)throw new q(`config contains unknown properties: ${n.join(`, `)}`)}validateChallengeDisplayMode(e){if(!Object.values(Y).includes(e.challengeDisplayMode))throw new q(`config.challengeDisplayMode must be either ${Y.POPUP} or ${Y.INLINE}`);if(e.challengeDisplayMode===Y.INLINE&&!this.domMethodsService.getElement(`#${e.challengeDisplayInlineTargetElementId}`))throw new q(`config.challengeDisplayInlineTargetElementId must exist when using display mode ${Y.INLINE}`)}validateLoggingLevel(e){if(!Object.values(G).includes(e.loggingLevel))throw new q(`config.loggingLevel must be: ${G.ERROR} or ${G.ALL}`)}validateTranslations(e){if(e.translations){let t=Object.keys(e.translations).filter(e=>!this.translationsWhitelist.includes(e));if(t.length>0)throw new q(`config.translations contains unknown keys: ${t.join(`,`)}. Whitelisted keys are: ${this.translationsWhitelist.join(`,`)}`)}else throw new q(`config.translations must be an object`)}validateProcessingScreen(e){if(!Object.values(J).includes(e.processingScreenMode))throw new q(`config.processingScreenMode must be either ${J.OVERLAY} or ${J.ATTACH_TO_ELEMENT}`);if(e.processingScreenMode===J.ATTACH_TO_ELEMENT&&!this.domMethodsService.getElement(`#${e.processingScreenWrapperElementId}`))throw new q(`config.processingScreenWrapperElementId must exist when using processing screen mode ${J.ATTACH_TO_ELEMENT}`)}validateThreeDSMethodTimeout(e){if(!(typeof e.threeDSMethodTimeout==`number`&&e.threeDSMethodTimeout>0&&e.threeDSMethodTimeout<=1e4))throw new q(`config.threeDSMethodTimeout must be a number in range from 1 to 10000 milliseconds`)}},Pt=class{sessionId=null;createId(){this.sessionId=crypto.randomUUID()}getId(){return this.sessionId}},X=function(e){return e.METHOD_URL_RESPONSE=`TP_METHOD_URL_RESPONSE`,e.CHALLENGE_RESPONSE=`TP_CHALLENGE_RESPONSE`,e.BROWSER_DATA_RESPONSE=`TP_BROWSER_DATA_RESPONSE`,e}({}),Ft=class{window;domMethodsService;interFrameCommunicatorService;base64TranscoderService;loggerService;acceptableColorDepthValues=[1,4,8,15,16,24,32,48];fallbackColorDepthValue=24;browserDataIframeSelector=`tp-3ds-browser-data-iframe`;browserDataTimeout=1e4;fallbackAcceptHeaderValue=`*/*`;constructor(e,t,n,r,i){this.window=e,this.domMethodsService=t,this.interFrameCommunicatorService=n,this.base64TranscoderService=r,this.loggerService=i}getData$(e,t){let n=this.getBrowserGeneralDataObject(t);return t&&!t.isRequiredBrowserIP&&!t.isRequiredBrowserAcceptHeader?L(n):this.getAcceptHeaderAndIPAddress$(e).pipe(z(e=>{let r={...n};return t?(t.isRequiredBrowserAcceptHeader&&(r.browserAcceptHeader=e.browserAcceptHeader),t.isRequiredBrowserIP&&(r.browserIP=e.browserIP)):(r.browserAcceptHeader=e.browserAcceptHeader,r.browserIP=e.browserIP),r}))}getBrowserGeneralDataObject(e){let t=e=>{if(!e)return``;let t=e.split(/[;,]/)[0].trim();t=t.replace(/_/g,`-`);let n=t.split(`-`);return n.length===1?n[0]:n.slice(0,2).join(`-`)},n={};return e?(e.isRequiredBrowserJavaEnabled&&(n.browserJavaEnabled=this.window.navigator.javaEnabled()),e.isRequiredBrowserJavascriptEnabled&&(n.browserJavascriptEnabled=!0),e.isRequiredBrowserLanguage&&(n.browserLanguage=t(this.window.navigator.language||this.window.navigator.userLanguage)),e.isRequiredBrowserScreenWidth&&(n.browserScreenWidth=this.window.screen.width),e.isRequiredBrowserScreenHeight&&(n.browserScreenHeight=this.getScreenHeight()),e.isRequiredBrowserColorDepth&&(n.browserColorDepth=this.getColorDepth(this.window.screen)),e.isRequiredBrowserUserAgent&&(n.browserUserAgent=this.window.navigator.userAgent),e.isRequiredBrowserTZ&&(n.browserTZ=new Date().getTimezoneOffset())):n={browserJavaEnabled:this.window.navigator.javaEnabled(),browserJavascriptEnabled:!0,browserLanguage:t(this.window.navigator.language),browserScreenWidth:this.window.screen.width,browserScreenHeight:this.getScreenHeight(),browserColorDepth:this.getColorDepth(this.window.screen),browserUserAgent:this.window.navigator.userAgent,browserTZ:new Date().getTimezoneOffset()},n}getScreenHeight(){let e=[this.window.screen.height,this.window.screen.availHeight,this.window.innerHeight,this.window.outerHeight],t=!1,n=999999,r=n;for(let i of e)if(i!==void 0&&typeof i==`number`&&i>0&&i<=n){r=i;break}else t=!0;return t&&this.loggerService.error(`Error in calculating screen height. Chosen value is ${r}. Options were ${JSON.stringify(e)}`),r}getColorDepth(e){return this.acceptableColorDepthValues.includes(e.colorDepth)?e.colorDepth:this.fallbackColorDepthValue}getAcceptHeaderAndIPAddress$(e){let t=typeof e==`string`?e:e[0];return pt(()=>L(this.createIframeForAcceptHeaderAndIPAddress(t))).pipe(U(()=>this.interFrameCommunicatorService.receive$(X.BROWSER_DATA_RESPONSE).pipe(Et(1))),W(e=>this.loggerService.debug(`Received raw browser data from iframe: ${e}`)),z(e=>this.base64TranscoderService.decode(e)),z(e=>({browserAcceptHeader:e.acceptHeader,browserIP:e.userIP})),W(e=>this.loggerService.debug(`Collected browser data: ${JSON.stringify(e)}`)),kt(()=>this.destroyView()),ot(this.browserDataTimeout),At(2),wt(e=>(this.loggerService.error(`Cannot retrieve user IP and accept header. Using fallback values instead.`),this.loggerService.error(e),L({browserAcceptHeader:this.fallbackAcceptHeaderValue,browserIP:``}))))}createIframeForAcceptHeaderAndIPAddress(e){let t=this.domMethodsService.createElement(`iframe`,{src:e,id:this.browserDataIframeSelector,width:`0px`,height:`0px`});this.domMethodsService.addToElement(t,this.domMethodsService.getElement(`body`)),this.loggerService.debug(`Created browser data iframe, url: ${e}`),t.addEventListener(`load`,()=>this.loggerService.debug(`Browser data iframe load completed, waiting for data`))}destroyView(){this.domMethodsService.removeElement(this.domMethodsService.getElement(`#${this.browserDataIframeSelector}`)),this.loggerService.debug(`Destroyed browser data iframe`)}},Z=class e{static get V2(){return new e(`2.0.0`)}static versionNumberPattern=/^\d+\.\d+\.\d+$/;major;minor;patch;constructor(t){if(!t||!t.match(e.versionNumberPattern))throw Error(`Invalid 3DS version: ${t}`);let[n,r,i]=t.split(`.`);this.major=Number(n),this.minor=Number(r),this.patch=Number(i)}isEqual(e){return this.toString()===e.toString()}isHigherThan(e){return this.major===e.major?this.minor===e.minor?this.patch>e.patch:this.minor>e.minor:this.major>e.major}isHigherOrEqual(e){return this.isEqual(e)||this.isHigherThan(e)}isLowerThan(e){return!this.isHigherOrEqual(e)}isLowerOrEqual(e){return!this.isHigherThan(e)}toString(){return`${this.major}.${this.minor}.${this.patch}`}},It=class{configService;challengeV1Service;challengeV2Service;challengeCommonService;constructor(e,t,n,r){this.configService=e,this.challengeV1Service=t,this.challengeV2Service=n,this.challengeCommonService=r}run$(e,t,n,r,i,a){return this.configService.getConfig$().pipe(U(o=>e.isLowerThan(Z.V2)?this.challengeV1Service.run$(o,t,n,i,a,r):this.challengeV2Service.run$(o,t,n,r)))}cancelChallenge$(){return this.configService.getConfig$().pipe(W(e=>this.challengeCommonService.cancelChallenge(e)),U(e=>this.challengeCommonService.handleCancelEvent$(e)))}},Q=function(e){return e.SUCCESS=`SUCCESS`,e.FAILURE=`FAILURE`,e.ERROR=`ERROR`,e.NOACTION=`NOACTION`,e.CANCELLED=`CANCELLED`,e.COMPLETED=`COMPLETED`,e.UNCOMPLETED=`UNCOMPLETED`,e}({}),Lt=class{domMethodsService;interFrameCommunicatorService;base64TranscoderService;iframeCreatorService;configService;methodURLIframeSelector=`tp-3ds-method-url-iframe`;methodURLIframeFormSelector=`tp-3ds-method-url-form`;constructor(e,t,n,r,i){this.domMethodsService=e,this.interFrameCommunicatorService=t,this.base64TranscoderService=n,this.iframeCreatorService=r,this.configService=i}run$(e,t,n){if(typeof e!=`string`||e.length===0)throw new q(`run3DSMethod$() requires transactionId`);if(typeof t!=`string`||t.length===0)throw new q(`run3DSMethod$() requires notificationURL`);if(typeof n!=`string`||n.length===0)throw new q(`run3DSMethod$() requires methodURL`);return this.domMethodsService.addToElement(this.createIframeForMethodURL(n,e,t),this.domMethodsService.getElement(`body`)),this.configService.getConfig$().pipe(U(t=>this.interFrameCommunicatorService.receive$(X.METHOD_URL_RESPONSE).pipe(z(e=>this.mapStatus(this.base64TranscoderService.decode(e))),ot({first:t.threeDSMethodTimeout,with:()=>L(this.getUncompletedResult(e))}),W(()=>{this.destroyView()}))))}createIframeForMethodURL(e,t,n){let r=this.base64TranscoderService.encode({threeDSServerTransID:t,threeDSMethodNotificationURL:n}),i=this.iframeCreatorService.getIframe(this.methodURLIframeSelector),a=()=>{i.contentWindow.document.body.innerHTML=this.iframeCreatorService.getIframeHTMLMarkup(this.methodURLIframeFormSelector,e,[{name:`threeDSMethodData`,value:r}]),i.removeEventListener(`load`,a),i.contentWindow.document.getElementById(this.methodURLIframeFormSelector).submit()};return i.addEventListener(`load`,a),i}mapStatus(e){return{status:e.actionCode,description:e.errorDescription,transactionId:e.threeDSServerTransID}}destroyView(){this.domMethodsService.removeElement(this.domMethodsService.getElement(`#${this.methodURLIframeSelector}`))}getUncompletedResult(e){return{status:Q.UNCOMPLETED,description:`Method URL did not complete`,transactionId:e}}},$=function(e){return e.VISA=`VISA`,e.ELECTRON=`ELECTRON`,e.DELTA=`DELTA`,e.VPAY=`VPAY`,e.PURCHASING=`PURCHASING`,e.MASTER_CARD=`MASTERCARD`,e.MASTER_CARD_DEBIT=`MASTERCARDDEBIT`,e.MAESTRO=`MAESTRO`,e.AMEX=`AMEX`,e.UNKNOWN=`UNKNOWN`,e}({}),Rt=`
|
|
5
5
|
<svg xmlns="http://www.w3.org/2000/svg" width="112px" height="112px" viewBox="0 0 179.23 179.23">
|
|
6
6
|
<defs>
|
|
7
7
|
<style>.cls-1{fill:#fff;}.cls-2{fill:#1a1f71;}</style>
|
|
@@ -52,7 +52,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=functio
|
|
|
52
52
|
<path d="m954.78 1677.4v-25.459h58.671c8.6812 0 12.44-4.6912 12.44-9.8363 0-4.9296-3.7471-9.9134-12.44-9.9134h-26.513c-23.046 0-35.88-14.041-35.88-35.121 0-18.802 11.753-36.934 45.999-36.934h57.089l-12.344 26.384h-49.374c-9.4382 0-12.344 4.9526-12.344 9.6821 0 4.8612 3.5904 10.222 10.801 10.222h27.773c25.69 0 36.838 14.572 36.838 33.656 0 20.516-12.422 37.32-38.236 37.32z" fill="#016fd0"/>
|
|
53
53
|
</g>
|
|
54
54
|
</svg>
|
|
55
|
-
`,Vt=class{
|
|
55
|
+
`,Vt=class{domMethodsService;loggerService;configService;document;classNames={mainContainer:`tp-3ds-processing-screen`,overlay:`tp-3ds-overlay`,screenWrapper:`tp-3ds-processing-screen-wrapper`,wrapperAttachToElement:`tp-3ds-processing-screen-wrapper-attach-to-element`,wrapperVisa:`tp-3ds-processing-screen-wrapper-visa`,wrapperMasterCard:`tp-3ds-processing-screen-wrapper-mastercard`,wrapperAmex:`tp-3ds-processing-screen-wrapper-amex`,loader:`tp-3ds-processing-screen-loader`,loaderWithLogo:`tp-3ds-processing-screen-loader-with-logo`,logo:`tp-3ds-processing-screen-logo`};processingScreenWrapperElement;loaderElement;constructor(e,t,n,r){this.domMethodsService=e,this.loggerService=t,this.configService=n,this.document=r,this.processingScreenWrapperElement=this.domMethodsService.createElement(`div`),this.domMethodsService.addClassesToElement(this.processingScreenWrapperElement,[this.classNames.overlay,this.classNames.screenWrapper]),this.loaderElement=this.domMethodsService.createElement(`div`),this.domMethodsService.addClassesToElement(this.loaderElement,[this.classNames.loader])}show(e){this.configService.getConfig$().pipe(H()).subscribe(t=>{if(t.processingScreenMode===J.OVERLAY)this.connectTo(this.document.body,e,J.OVERLAY);else{let n=this.domMethodsService.getElement(`#${t.processingScreenWrapperElementId}`);this.connectTo(n,e,J.ATTACH_TO_ELEMENT)}})}hide(){this.configService.getConfig$().pipe(H()).subscribe(e=>{if(e.processingScreenMode===J.OVERLAY)this.disconnectFrom(this.document.body);else{let t=this.domMethodsService.getElement(`#${e.processingScreenWrapperElementId}`);this.disconnectFrom(t)}})}connectTo(e,t,n){try{if(e)switch(this.processingScreenWrapperElement.innerText=``,this.domMethodsService.removeClassesFromElement(this.loaderElement,[this.classNames.loaderWithLogo]),this.domMethodsService.addClassesToElement(e,[this.classNames.mainContainer]),this.domMethodsService.addToElement(this.processingScreenWrapperElement,e),this.domMethodsService.addToElement(this.loaderElement,this.processingScreenWrapperElement),n===J.ATTACH_TO_ELEMENT&&this.domMethodsService.addClassesToElement(this.processingScreenWrapperElement,[this.classNames.wrapperAttachToElement]),t){case $.VISA:case $.ELECTRON:case $.DELTA:case $.VPAY:case $.PURCHASING:this.addCardLogo(Rt,this.classNames.wrapperVisa);break;case $.MASTER_CARD:case $.MASTER_CARD_DEBIT:case $.MAESTRO:this.addCardLogo(zt,this.classNames.wrapperMasterCard);break;case $.AMEX:this.addCardLogo(Bt,this.classNames.wrapperAmex);break;default:break}else throw Error(`Could not connect Processing Loader. targetElement: ${JSON.stringify(e)} not found. You must define existing targetElement.`)}catch(e){this.loggerService.error(e)}}disconnectFrom(e){let t=this.domMethodsService.getElement(`.${this.classNames.screenWrapper}`);try{if(e)this.domMethodsService.removeClassesFromElement(e,[this.classNames.overlay,this.classNames.mainContainer]),t&&this.domMethodsService.removeElement(t);else throw Error(`Could not disconnect Processing Loader. targetElement: ${JSON.stringify(e)} not found. You must define existing targetElement.`)}catch(e){this.loggerService.error(e)}}addCardLogo(e,t){let n=this.domMethodsService.createElement(`div`,{class:this.classNames.logo});n.innerHTML=e,this.domMethodsService.addToElement(n,this.processingScreenWrapperElement),this.domMethodsService.addClassesToElement(this.processingScreenWrapperElement,[t]),this.domMethodsService.addClassesToElement(this.loaderElement,[this.classNames.loaderWithLogo])}},Ht=class{document;loggerService;constructor(e,t){this.document=e,this.loggerService=t}getElement(e){return this.document.querySelector(e)||null}createElement(e,t){let n=this.document.createElement(e);return t&&Object.entries(t).forEach(([e,t])=>{n.setAttribute(e,t)}),n}addToElement(e,t){try{if(!e||!t)throw Error(`Cannot find element(s): element: ${JSON.stringify(e)}, targetElement: ${JSON.stringify(t)}`);t.appendChild(e)}catch(e){throw this.loggerService.error(e),Error(e)}}removeElement(e){try{if(!e)throw Error(`Cannot find element: ${JSON.stringify(e)}`);e.remove()}catch(e){throw this.loggerService.error(e),Error(e)}}addClassesToElement(e,t){try{if(!e)throw Error(`Cannot find element: ${JSON.stringify(e)}`);t.forEach(t=>{e.classList.add(t)})}catch(e){throw this.loggerService.error(e),Error(e)}}removeClassesFromElement(e,t){try{if(!e)throw Error(`Cannot find element: ${JSON.stringify(e)}`);t.forEach(t=>{e.classList.remove(t)})}catch(e){throw this.loggerService.error(e),Error(e)}}},Ut=class{window;constructor(e){this.window=e}encode(e){return this.window.btoa(JSON.stringify(e))}encodeString(e){return this.window.btoa(e)}decode(e){return JSON.parse(this.window.atob(e))}},Wt=class{window;constructor(e){this.window=e}receive$(e){return V(this.window,`message`).pipe(Ct(t=>t.data&&t.data.type===e),z(e=>e.data.data))}},Gt=`
|
|
56
56
|
.tp-3ds-processing-screen {
|
|
57
57
|
position: relative;
|
|
58
58
|
height: 100%;
|
|
@@ -105,7 +105,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=functio
|
|
|
105
105
|
transform: translate(-50%) rotate(360deg);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
`,Kt=class{constructor(e){this.domMethodsService=e}getIframe(e,t=0,n=0){return this.domMethodsService.createElement(`iframe`,{id:e,class:e,width:`${t}px`,height:`${n}px`})}getIframeHTMLMarkup(e,t,n,r,i){return`
|
|
108
|
+
`,Kt=class{domMethodsService;constructor(e){this.domMethodsService=e}getIframe(e,t=0,n=0){return this.domMethodsService.createElement(`iframe`,{id:e,class:e,width:`${t}px`,height:`${n}px`})}getIframeHTMLMarkup(e,t,n,r,i){return`
|
|
109
109
|
<div class="tp-3ds-processing-screen">
|
|
110
110
|
<div class="tp-3ds-processing-screen-wrapper ${this.getWrapperClass(r)}">
|
|
111
111
|
<div class="tp-3ds-processing-screen-logo">
|
|
@@ -117,4 +117,4 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=functio
|
|
|
117
117
|
${this.getInputs(n)}
|
|
118
118
|
</form>
|
|
119
119
|
</div>
|
|
120
|
-
`}getStylesMarkup(){let e=this.domMethodsService.createElement(`style`);return e.innerHTML=Gt,e}getInputs(e){return e.map(e=>`<input type="hidden" name="${e.name}" value="${e.value}">`).join(``)}getLogo(e){switch(e){case $.VISA:case $.ELECTRON:case $.DELTA:case $.VPAY:case $.PURCHASING:return Rt;case $.MASTER_CARD:case $.MASTER_CARD_DEBIT:case $.MAESTRO:return zt;case $.AMEX:return Bt;default:return``}}getWrapperClass(e){switch(e){case $.VISA:case $.ELECTRON:case $.DELTA:case $.VPAY:case $.PURCHASING:return`tp-3ds-processing-screen-wrapper-visa`;case $.MASTER_CARD:case $.MASTER_CARD_DEBIT:case $.MAESTRO:return`tp-3ds-processing-screen-wrapper-mastercard`;case $.AMEX:return`tp-3ds-processing-screen-wrapper-amex`;default:return``}}},qt=class{
|
|
120
|
+
`}getStylesMarkup(){let e=this.domMethodsService.createElement(`style`);return e.innerHTML=Gt,e}getInputs(e){return e.map(e=>`<input type="hidden" name="${e.name}" value="${e.value}">`).join(``)}getLogo(e){switch(e){case $.VISA:case $.ELECTRON:case $.DELTA:case $.VPAY:case $.PURCHASING:return Rt;case $.MASTER_CARD:case $.MASTER_CARD_DEBIT:case $.MAESTRO:return zt;case $.AMEX:return Bt;default:return``}}getWrapperClass(e){switch(e){case $.VISA:case $.ELECTRON:case $.DELTA:case $.VPAY:case $.PURCHASING:return`tp-3ds-processing-screen-wrapper-visa`;case $.MASTER_CARD:case $.MASTER_CARD_DEBIT:case $.MAESTRO:return`tp-3ds-processing-screen-wrapper-mastercard`;case $.AMEX:return`tp-3ds-processing-screen-wrapper-amex`;default:return``}}},qt=class{domMethodsService;document;cancelEmitter$=new M;classNames={mainContainer:`tp-3ds-popup-view`,wrapper:`tp-3ds-popup-view-wrapper`,overlay:`tp-3ds-overlay`,popupOverlay:`tp-3ds-popup-view-overlay`,header:`tp-3ds-popup-view-header`,headerButton:`tp-3ds-popup-view-header-button`};constructor(e,t){this.domMethodsService=e,this.document=t}init(e,t){this.destroyPopupView(),this.initializePopupView(e,t),this.cancelEmitter$.subscribe(()=>{this.destroyPopupView()})}cancelled$(){return this.cancelEmitter$.asObservable()}close(){this.destroyPopupView()}cancel(){this.cancelEmitter$.next(!0)}initializePopupView(e,t){let n=this.domMethodsService.createElement(`div`,{class:`${this.classNames.overlay} ${this.classNames.mainContainer}`}),r=this.domMethodsService.createElement(`div`,{class:this.classNames.wrapper}),i=this.domMethodsService.createElement(`div`,{class:this.classNames.popupOverlay}),a=this.createHeaderElement(t);this.domMethodsService.addToElement(e,r),this.domMethodsService.addToElement(a,i),this.domMethodsService.addToElement(r,i),this.domMethodsService.addToElement(i,n),this.domMethodsService.addToElement(n,this.document.body)}createHeaderElement(e){let t=this.domMethodsService.createElement(`div`,{class:this.classNames.header}),n=this.domMethodsService.createElement(`button`,{id:this.classNames.headerButton,class:this.classNames.headerButton});return n.textContent=e.cancel,this.domMethodsService.addToElement(n,t),this.addCancelListener(n),t}addCancelListener(e){e.addEventListener(`click`,()=>{this.cancel()})}destroyPopupView(){let e=this.domMethodsService.getElement(`.${this.classNames.mainContainer}`);e&&this.domMethodsService.removeElement(e)}},Jt=class{domMethodsService;cancelState$=new M;classNames={mainContainer:`tp-3ds-inline-view`,wrapper:`tp-3ds-inline-view-wrapper`,header:`tp-3ds-inline-view-header`,headerButton:`tp-3ds-inline-view-header-button`};constructor(e){this.domMethodsService=e}init(e,t,n){this.destroyInlineView(),this.initializeInlineView(e,t,n),this.cancelState$.subscribe(()=>{this.destroyInlineView()})}cancelled$(){return this.cancelState$.asObservable()}close(){this.destroyInlineView()}cancel(){this.cancelState$.next(!0)}initializeInlineView(e,t,n){let r=this.domMethodsService.createElement(`div`,{class:this.classNames.mainContainer}),i=this.domMethodsService.createElement(`div`,{class:this.classNames.wrapper}),a=this.createHeaderElement(n);this.domMethodsService.addToElement(e,i),this.domMethodsService.addToElement(a,r),this.domMethodsService.addToElement(i,r),this.domMethodsService.addToElement(r,t)}createHeaderElement(e){let t=this.domMethodsService.createElement(`div`,{class:this.classNames.header}),n=this.domMethodsService.createElement(`button`,{id:this.classNames.headerButton,class:this.classNames.headerButton});return n.textContent=e.cancel,this.domMethodsService.addToElement(n,t),n.addEventListener(`click`,()=>{this.cancel()}),t}destroyInlineView(){let e=this.domMethodsService.getElement(`.${this.classNames.mainContainer}`);e&&this.domMethodsService.removeElement(e)}},Yt=class{popupViewService;inlineViewService;sessionIdService;domMethodsService;window;challengeIframeSelector=`tp-3ds-challenge-iframe`;challengeIframeFormSelector=`tp-3ds-challenge-form`;constructor(e,t,n,r,i){this.popupViewService=e,this.inlineViewService=t,this.sessionIdService=n,this.domMethodsService=r,this.window=i}handleCancelEvent$(e,t){let n={status:Q.CANCELLED,description:`Challenge cancelled`,transactionId:t};return e.challengeDisplayMode===Y.POPUP?this.popupViewService.cancelled$().pipe(z(()=>n)):this.inlineViewService.cancelled$().pipe(z(()=>n))}getChallengeWindowSize(){let e=this.window.innerWidth;return{x:e<390?e-20:390,y:400}}closeChallengeWindow(e){e.challengeDisplayMode===Y.POPUP?this.popupViewService.close():this.inlineViewService.close()}cancelChallenge(e){e.challengeDisplayMode===Y.POPUP?this.popupViewService.cancel():this.inlineViewService.cancel()}validate(e){if(typeof this.sessionIdService.getId()!=`string`||this.sessionIdService.getId().length===0)throw new q(`doChallenge$() requires initialization of the library`);if(typeof e!=`string`||e.length===0)throw new q(`doChallenge$() requires challenge URL`)}initView(e,t){if(e.challengeDisplayMode===Y.POPUP)this.popupViewService.init(t,e.translations);else if(e.challengeDisplayMode===Y.INLINE){let n=this.domMethodsService.getElement(`#${e.challengeDisplayInlineTargetElementId}`);if(!n)throw new q(`challengeDisplayInlineTargetElementId must exist in the DOM when using challengeDisplayMode: ${Y.INLINE}. Element with ID = ${e.challengeDisplayInlineTargetElementId} was not found`);this.inlineViewService.init(t,n,e.translations)}}},Xt=class{challengeCommonService;interFrameCommunicatorService;iframeCreatorService;constructor(e,t,n){this.challengeCommonService=e,this.interFrameCommunicatorService=t,this.iframeCreatorService=n}run$(e,t,n,r,i,a){return this.validate(t,n,r,i),St(this.open$(e,t,n,r,i,a),this.challengeCommonService.handleCancelEvent$(e)).pipe(H())}open$(e,t,n,r,i,a){let o=this.createIframe(t,n,r,i,a);return this.challengeCommonService.initView(e,o),this.interFrameCommunicatorService.receive$(X.CHALLENGE_RESPONSE).pipe(z(e=>this.mapStatus(e)),W(()=>{this.challengeCommonService.closeChallengeWindow(e)}))}createIframe(e,t,n,r,i){let a=this.iframeCreatorService.getIframe(this.challengeCommonService.challengeIframeSelector,this.challengeCommonService.getChallengeWindowSize().x,this.challengeCommonService.getChallengeWindowSize().y),o=()=>{a.contentWindow.document.head.appendChild(this.iframeCreatorService.getStylesMarkup()),a.contentWindow.document.body.innerHTML=this.iframeCreatorService.getIframeHTMLMarkup(this.challengeCommonService.challengeIframeFormSelector,t,[{name:`PaReq`,value:e},{name:`MD`,value:r},{name:`TermUrl`,value:n},{name:`cardType`,value:i}],i),a.removeEventListener(`load`,o),a.contentWindow.document.getElementById(this.challengeCommonService.challengeIframeFormSelector).submit()};return a.addEventListener(`load`,o),a}mapStatus(e){return{status:Q.COMPLETED,description:`Challenge completed`,data:e}}validate(e,t,n,r){[{name:`PaReq`,value:e},{name:`challengeURL`,value:t},{name:`termURL`,value:n},{name:`merchantData`,value:r}].forEach(e=>{if(typeof e.value!=`string`||e.value.length===0)throw new q(`doChallenge$() requires ${e.name}`)})}},Zt=class{challengeCommonService;sessionIdService;base64TranscoderService;iframeCreatorService;interFrameCommunicatorService;constructor(e,t,n,r,i){this.challengeCommonService=e,this.sessionIdService=t,this.base64TranscoderService=n,this.iframeCreatorService=r,this.interFrameCommunicatorService=i}run$(e,t,n,r){let i=this.base64TranscoderService.decode(t);return this.challengeCommonService.validate(n),this.validateCReq(i),St(this.open$(e,t,n,r),this.challengeCommonService.handleCancelEvent$(e,i.threeDSServerTransID)).pipe(H())}open$(e,t,n,r){let i=this.createIframe(t,n,r);return this.challengeCommonService.initView(e,i),this.interFrameCommunicatorService.receive$(X.CHALLENGE_RESPONSE).pipe(z(e=>this.mapStatus(this.base64TranscoderService.decode(e))),W(()=>{this.challengeCommonService.closeChallengeWindow(e)}))}createIframe(e,t,n){let r=this.iframeCreatorService.getIframe(this.challengeCommonService.challengeIframeSelector,this.challengeCommonService.getChallengeWindowSize().x,this.challengeCommonService.getChallengeWindowSize().y),i=this.base64TranscoderService.encodeString(this.sessionIdService.getId()),a=()=>{r.contentWindow.document.head.appendChild(this.iframeCreatorService.getStylesMarkup()),r.contentWindow.document.body.innerHTML=this.iframeCreatorService.getIframeHTMLMarkup(this.challengeCommonService.challengeIframeFormSelector,t,[{name:`creq`,value:e},{name:`threeDSSessionData`,value:i},{name:`cardType`,value:n}],n),r.removeEventListener(`load`,a),r.contentWindow.document.getElementById(this.challengeCommonService.challengeIframeFormSelector).submit()};return r.addEventListener(`load`,a),r}mapStatus(e){return{status:e.actionCode,description:e.errorDescription,transactionId:e.threeDSServerTransID,data:{cres:this.base64TranscoderService.encode(e.cres)}}}validateCReq(e){if(typeof e.threeDSServerTransID!=`string`||e.threeDSServerTransID.length===0)throw new q(`doChallenge$() requires valid CReq threeDSServerTransID property`);let t;try{t=new Z(e.messageVersion)}catch{throw new q(`doChallenge$() in version 2 requires valid CReq.messageVersion property`)}if(t.isLowerThan(Z.V2))throw new q(`doChallenge$() in version 2 requires CReq.messageVersion property to be >= 2.0.0`);if(typeof e.acsTransID!=`string`||e.acsTransID.length===0)throw new q(`doChallenge$() requires valid CReq acsTransId property`)}},Qt=class{create(){let e=new Mt,t=new Ht(document,e),n=new Nt(t),r=new Pt,i=new Ut(window),a=new Wt(window),o=new Kt(t),s=new Yt(new qt(t,document),new Jt(t),r,t,window),c=new It(n,new Xt(s,a,o),new Zt(s,r,i,o,a),s),l=new Lt(t,a,i,o,n);return new jt(e,n,new Ft(window,t,a,i,e),c,l,r,new Vt(t,e,n,document))}};exports.CardType=$,exports.ChallengeDisplayMode=Y,exports.LoggingLevel=G,exports.ProcessingScreenMode=J,exports.ResultActionCode=Q,exports.ThreeDSecureFactory=Qt,exports.ThreeDSecureVersion=Z;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.tp-3ds-challenge-iframe{border:0;outline:0;overflow:hidden}@media (width
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.tp-3ds-challenge-iframe{border:0;outline:0;overflow:hidden}@media (max-width:440px){.tp-3ds-challenge-iframe{width:100%}}.tp-3ds-method-url-iframe{border:0;width:0;height:0}.tp-3ds-overlay{background-color:#ffffffe6;position:fixed;top:0;left:0}.tp-3ds-processing-screen{position:relative}.tp-3ds-processing-screen-wrapper{z-index:50;background-color:#ffffffe6;width:100%;height:100%;position:fixed;top:0;left:0}.tp-3ds-processing-screen-wrapper-attach-to-element{position:absolute}.tp-3ds-processing-screen-loader{box-sizing:border-box;will-change:animation;border:4px solid #e61c5b;border-color:#e61c5b #0000;border-radius:32px;width:40px;height:40px;animation:1.2s cubic-bezier(.5,0,.5,1) .15s infinite tp-3ds-spin;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%)rotate(0)}.tp-3ds-processing-screen-loader-with-logo{margin-top:30px}.tp-3ds-processing-screen-logo{-webkit-user-select:none;user-select:none;position:absolute;top:50%;left:50%}.tp-3ds-processing-screen-wrapper-visa .tp-3ds-processing-screen-logo{margin:-100px 0 0 -56px}.tp-3ds-processing-screen-wrapper-mastercard .tp-3ds-processing-screen-logo{margin:-123px 0 0 -79px}.tp-3ds-processing-screen-wrapper-amex .tp-3ds-processing-screen-logo{margin:-124px 0 0 -60px}@keyframes tp-3ds-spin{0%{transform:translate(-50%)rotate(0)}to{transform:translate(-50%)rotate(360deg)}}.tp-3ds-popup-view{content:"";z-index:999999;min-width:100vw;height:100vh}.tp-3ds-popup-view-overlay{box-sizing:border-box;background-color:#fff;flex-direction:column;padding:20px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:0 6px 22px -3px #000}.tp-3ds-popup-view-wrapper{height:100%}.tp-3ds-popup-view-header{justify-content:flex-end;display:flex}.tp-3ds-popup-view-header-button{background-color:#0000;border:0;font-size:12px;font-weight:600;position:relative;top:-10px;left:10px}.tp-3ds-popup-view-header-button:hover{cursor:pointer;text-decoration:underline}@media (max-width:440px){.tp-3ds-popup-view-overlay{width:100%;padding:5px}}.tp-3ds-inline-view iframe{width:100%;height:100%;min-height:200px;overflow:hidden}.tp-3ds-inline-view{height:100%}.tp-3ds-inline-view-wrapper{height:calc(100% - 18px)}.tp-3ds-inline-view-header{justify-content:flex-end;display:flex}.tp-3ds-inline-view-header-button{background-color:#0000;border:0;margin:10px;padding:0;font-size:12px;font-weight:600;position:relative}.tp-3ds-inline-view-header-button:hover{cursor:pointer;text-decoration:underline}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
//#region node_modules/tslib/tslib.es6.mjs
|
|
3
3
|
var e = function(t, n) {
|
|
4
4
|
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
|
|
@@ -1513,12 +1513,16 @@ function W(e, t, n) {
|
|
|
1513
1513
|
var G = /* @__PURE__ */ function(e) {
|
|
1514
1514
|
return e.ERROR = "ERROR", e.ALL = "ALL", e;
|
|
1515
1515
|
}({}), jt = class {
|
|
1516
|
+
loggerService;
|
|
1517
|
+
configService;
|
|
1518
|
+
browserData;
|
|
1519
|
+
challengeService;
|
|
1520
|
+
methodURLService;
|
|
1521
|
+
sessionIdService;
|
|
1522
|
+
processingScreenService;
|
|
1523
|
+
logs$;
|
|
1516
1524
|
constructor(e, t, n, r, i, a, o) {
|
|
1517
|
-
this.loggerService = e, this.configService = t, this.browserData = n, this.challengeService = r, this.methodURLService = i, this.sessionIdService = a, this.processingScreenService = o, this.
|
|
1518
|
-
setTimeout(() => {
|
|
1519
|
-
t("duration");
|
|
1520
|
-
}, e + 2e3 || 2e3);
|
|
1521
|
-
}), this.logs$ = this.loggerService.logs$;
|
|
1525
|
+
this.loggerService = e, this.configService = t, this.browserData = n, this.challengeService = r, this.methodURLService = i, this.sessionIdService = a, this.processingScreenService = o, this.logs$ = this.loggerService.logs$;
|
|
1522
1526
|
}
|
|
1523
1527
|
init$(e) {
|
|
1524
1528
|
try {
|
|
@@ -1548,6 +1552,11 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1548
1552
|
throw this.loggerService.error(e), Error(`getBrowserData() failed.\n\n${JSON.stringify(e)}`);
|
|
1549
1553
|
}
|
|
1550
1554
|
}
|
|
1555
|
+
addProcessingScreenDuration = (e) => new Promise((t) => {
|
|
1556
|
+
setTimeout(() => {
|
|
1557
|
+
t("duration");
|
|
1558
|
+
}, e + 2e3 || 2e3);
|
|
1559
|
+
});
|
|
1551
1560
|
async showProcessingScreen(e, t = 0) {
|
|
1552
1561
|
try {
|
|
1553
1562
|
this.processingScreenService.show(e), await this.addProcessingScreenDuration(t);
|
|
@@ -1572,9 +1581,9 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1572
1581
|
}, K = /* @__PURE__ */ function(e) {
|
|
1573
1582
|
return e.ERROR = "error", e.WARNING = "warning", e.DEBUG = "debug", e;
|
|
1574
1583
|
}({}), Mt = class {
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1584
|
+
logsSubject$ = new M();
|
|
1585
|
+
loggingLevel = G.ERROR;
|
|
1586
|
+
logs$ = this.logsSubject$.asObservable();
|
|
1578
1587
|
init(e) {
|
|
1579
1588
|
this.loggingLevel = e, this.logsSubject$.subscribe((e) => this.logToConsole(e));
|
|
1580
1589
|
}
|
|
@@ -1620,15 +1629,18 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1620
1629
|
}({}), Y = /* @__PURE__ */ function(e) {
|
|
1621
1630
|
return e.POPUP = "POPUP", e.INLINE = "INLINE", e;
|
|
1622
1631
|
}({}), Nt = class {
|
|
1632
|
+
domMethodsService;
|
|
1633
|
+
translationsWhitelist = ["cancel"];
|
|
1623
1634
|
constructor(e) {
|
|
1624
|
-
this.domMethodsService = e
|
|
1625
|
-
challengeDisplayMode: Y.POPUP,
|
|
1626
|
-
loggingLevel: G.ERROR,
|
|
1627
|
-
translations: { cancel: "X" },
|
|
1628
|
-
processingScreenMode: J.OVERLAY,
|
|
1629
|
-
threeDSMethodTimeout: 1e4
|
|
1630
|
-
});
|
|
1635
|
+
this.domMethodsService = e;
|
|
1631
1636
|
}
|
|
1637
|
+
config$ = new ye({
|
|
1638
|
+
challengeDisplayMode: Y.POPUP,
|
|
1639
|
+
loggingLevel: G.ERROR,
|
|
1640
|
+
translations: { cancel: "X" },
|
|
1641
|
+
processingScreenMode: J.OVERLAY,
|
|
1642
|
+
threeDSMethodTimeout: 1e4
|
|
1643
|
+
});
|
|
1632
1644
|
getConfig$() {
|
|
1633
1645
|
return this.config$.asObservable();
|
|
1634
1646
|
}
|
|
@@ -1675,9 +1687,7 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1675
1687
|
if (!(typeof e.threeDSMethodTimeout == "number" && e.threeDSMethodTimeout > 0 && e.threeDSMethodTimeout <= 1e4)) throw new q("config.threeDSMethodTimeout must be a number in range from 1 to 10000 milliseconds");
|
|
1676
1688
|
}
|
|
1677
1689
|
}, Pt = class {
|
|
1678
|
-
|
|
1679
|
-
this.sessionId = null;
|
|
1680
|
-
}
|
|
1690
|
+
sessionId = null;
|
|
1681
1691
|
createId() {
|
|
1682
1692
|
this.sessionId = crypto.randomUUID();
|
|
1683
1693
|
}
|
|
@@ -1687,17 +1697,27 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1687
1697
|
}, X = /* @__PURE__ */ function(e) {
|
|
1688
1698
|
return e.METHOD_URL_RESPONSE = "TP_METHOD_URL_RESPONSE", e.CHALLENGE_RESPONSE = "TP_CHALLENGE_RESPONSE", e.BROWSER_DATA_RESPONSE = "TP_BROWSER_DATA_RESPONSE", e;
|
|
1689
1699
|
}({}), Ft = class {
|
|
1700
|
+
window;
|
|
1701
|
+
domMethodsService;
|
|
1702
|
+
interFrameCommunicatorService;
|
|
1703
|
+
base64TranscoderService;
|
|
1704
|
+
loggerService;
|
|
1705
|
+
acceptableColorDepthValues = [
|
|
1706
|
+
1,
|
|
1707
|
+
4,
|
|
1708
|
+
8,
|
|
1709
|
+
15,
|
|
1710
|
+
16,
|
|
1711
|
+
24,
|
|
1712
|
+
32,
|
|
1713
|
+
48
|
|
1714
|
+
];
|
|
1715
|
+
fallbackColorDepthValue = 24;
|
|
1716
|
+
browserDataIframeSelector = "tp-3ds-browser-data-iframe";
|
|
1717
|
+
browserDataTimeout = 1e4;
|
|
1718
|
+
fallbackAcceptHeaderValue = "*/*";
|
|
1690
1719
|
constructor(e, t, n, r, i) {
|
|
1691
|
-
this.window = e, this.domMethodsService = t, this.interFrameCommunicatorService = n, this.base64TranscoderService = r, this.loggerService = i
|
|
1692
|
-
1,
|
|
1693
|
-
4,
|
|
1694
|
-
8,
|
|
1695
|
-
15,
|
|
1696
|
-
16,
|
|
1697
|
-
24,
|
|
1698
|
-
32,
|
|
1699
|
-
48
|
|
1700
|
-
], this.fallbackColorDepthValue = 24, this.browserDataIframeSelector = "tp-3ds-browser-data-iframe", this.browserDataTimeout = 1e4, this.fallbackAcceptHeaderValue = "*/*";
|
|
1720
|
+
this.window = e, this.domMethodsService = t, this.interFrameCommunicatorService = n, this.base64TranscoderService = r, this.loggerService = i;
|
|
1701
1721
|
}
|
|
1702
1722
|
getData$(e, t) {
|
|
1703
1723
|
let n = this.getBrowserGeneralDataObject(t);
|
|
@@ -1767,9 +1787,10 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1767
1787
|
static get V2() {
|
|
1768
1788
|
return new e("2.0.0");
|
|
1769
1789
|
}
|
|
1770
|
-
static
|
|
1771
|
-
|
|
1772
|
-
|
|
1790
|
+
static versionNumberPattern = /^\d+\.\d+\.\d+$/;
|
|
1791
|
+
major;
|
|
1792
|
+
minor;
|
|
1793
|
+
patch;
|
|
1773
1794
|
constructor(t) {
|
|
1774
1795
|
if (!t || !t.match(e.versionNumberPattern)) throw Error(`Invalid 3DS version: ${t}`);
|
|
1775
1796
|
let [n, r, i] = t.split(".");
|
|
@@ -1794,6 +1815,10 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1794
1815
|
return `${this.major}.${this.minor}.${this.patch}`;
|
|
1795
1816
|
}
|
|
1796
1817
|
}, It = class {
|
|
1818
|
+
configService;
|
|
1819
|
+
challengeV1Service;
|
|
1820
|
+
challengeV2Service;
|
|
1821
|
+
challengeCommonService;
|
|
1797
1822
|
constructor(e, t, n, r) {
|
|
1798
1823
|
this.configService = e, this.challengeV1Service = t, this.challengeV2Service = n, this.challengeCommonService = r;
|
|
1799
1824
|
}
|
|
@@ -1806,8 +1831,15 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1806
1831
|
}, Q = /* @__PURE__ */ function(e) {
|
|
1807
1832
|
return e.SUCCESS = "SUCCESS", e.FAILURE = "FAILURE", e.ERROR = "ERROR", e.NOACTION = "NOACTION", e.CANCELLED = "CANCELLED", e.COMPLETED = "COMPLETED", e.UNCOMPLETED = "UNCOMPLETED", e;
|
|
1808
1833
|
}({}), Lt = class {
|
|
1834
|
+
domMethodsService;
|
|
1835
|
+
interFrameCommunicatorService;
|
|
1836
|
+
base64TranscoderService;
|
|
1837
|
+
iframeCreatorService;
|
|
1838
|
+
configService;
|
|
1839
|
+
methodURLIframeSelector = "tp-3ds-method-url-iframe";
|
|
1840
|
+
methodURLIframeFormSelector = "tp-3ds-method-url-form";
|
|
1809
1841
|
constructor(e, t, n, r, i) {
|
|
1810
|
-
this.domMethodsService = e, this.interFrameCommunicatorService = t, this.base64TranscoderService = n, this.iframeCreatorService = r, this.configService = i
|
|
1842
|
+
this.domMethodsService = e, this.interFrameCommunicatorService = t, this.base64TranscoderService = n, this.iframeCreatorService = r, this.configService = i;
|
|
1811
1843
|
}
|
|
1812
1844
|
run$(e, t, n) {
|
|
1813
1845
|
if (typeof e != "string" || e.length === 0) throw new q("run3DSMethod$() requires transactionId");
|
|
@@ -1852,19 +1884,26 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1852
1884
|
}, $ = /* @__PURE__ */ function(e) {
|
|
1853
1885
|
return e.VISA = "VISA", e.ELECTRON = "ELECTRON", e.DELTA = "DELTA", e.VPAY = "VPAY", e.PURCHASING = "PURCHASING", e.MASTER_CARD = "MASTERCARD", e.MASTER_CARD_DEBIT = "MASTERCARDDEBIT", e.MAESTRO = "MAESTRO", e.AMEX = "AMEX", e.UNKNOWN = "UNKNOWN", e;
|
|
1854
1886
|
}({}), Rt = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"112px\" height=\"112px\" viewBox=\"0 0 179.23 179.23\">\n <defs>\n <style>.cls-1{fill:#fff;}.cls-2{fill:#1a1f71;}</style>\n </defs>\n <rect class=\"cls-1\" x=\"0.32\" y=\"0.13\" width=\"178.91\" height=\"178.91\"/>\n <rect class=\"cls-2\" x=\"4.27\" y=\"89.59\" width=\"171.02\" height=\"85.51\"/>\n <path class=\"cls-2\" d=\"M71.05,25.14,54.21,65.32h-11L34.94,33.26c-.51-2-.94-2.7-2.47-3.54a43.34,43.34,0,0,0-10.25-3.41l.24-1.17H40.14a4.85,4.85,0,0,1,4.8,4.1l4.38,23.25L60.13,25.14ZM114.1,52.21c0-10.6-14.66-11.19-14.56-15.93,0-1.44,1.4-3,4.41-3.37a19.71,19.71,0,0,1,10.25,1.8L116,26.19a28.13,28.13,0,0,0-9.72-1.77c-10.27,0-17.5,5.46-17.56,13.28-.06,5.79,5.16,9,9.09,10.94s5.42,3.23,5.4,5c0,2.69-3.24,3.88-6.22,3.93A21.65,21.65,0,0,1,86.33,55l-1.89,8.81A31.64,31.64,0,0,0,96,66c10.92,0,18.06-5.4,18.1-13.75m27.13,13.11h9.62l-8.4-40.18h-8.86a4.74,4.74,0,0,0-4.43,2.95L113.57,65.32h10.91l2.17-6H140Zm-11.6-14.23L135.11,36l3.14,15.09ZM85.9,25.14,77.31,65.32H66.92l8.59-40.18Z\"/>\n <path class=\"cls-1\" d=\"M42,139.14a10.16,10.16,0,0,0,4.9,1.29c2.35,0,3.67-1.11,3.67-2.76s-1-2.44-3.58-3.38c-3.37-1.17-5.51-3-5.51-5.87,0-3.34,2.77-5.84,7.19-5.84a10.91,10.91,0,0,1,4.85,1l-.88,3a8.86,8.86,0,0,0-4.07-1c-2.34,0-3.34,1.24-3.34,2.44,0,1.56,1.18,2.29,3.89,3.31,3.52,1.35,5.2,3.12,5.2,6,0,3.28-2.46,6.08-7.67,6.08a12.13,12.13,0,0,1-5.51-1.27Z\"/>\n <path class=\"cls-1\" d=\"M68.73,134.17H61.08v6h8.55v3H57.39V122.88h11.8v3h-8.1v5.24h7.65v3Z\"/>\n <path class=\"cls-1\" d=\"M87.12,142.56a13.21,13.21,0,0,1-5.26.91c-6.45,0-10.36-4-10.36-10.21,0-6.67,4.66-10.68,10.86-10.68a11.45,11.45,0,0,1,4.91.88l-.79,3a9.77,9.77,0,0,0-4-.79c-4.12,0-7.11,2.59-7.11,7.46,0,4.46,2.59,7.29,7.08,7.29a11,11,0,0,0,4-.73Z\"/>\n <path class=\"cls-1\" d=\"M93.66,122.88v11.83c0,4,1.65,5.81,4.15,5.81,2.68,0,4.28-1.83,4.28-5.81V122.88h3.7v11.59c0,6.26-3.21,9-8.09,9-4.7,0-7.74-2.62-7.74-9V122.87h3.7Z\"/>\n <path class=\"cls-1\" d=\"M109.73,123.18a31.93,31.93,0,0,1,5.61-.45c2.92,0,4.88.48,6.26,1.62a5.18,5.18,0,0,1,1.74,4.1,5.33,5.33,0,0,1-3.7,5.06v.09c1.47.54,2.35,2,2.83,3.91a48.55,48.55,0,0,0,1.6,5.66h-3.8a26.75,26.75,0,0,1-1.36-4.79c-.6-2.65-1.53-3.49-3.64-3.55H113.4v8.34h-3.67Zm3.68,8.95h2.2c2.5,0,4-1.33,4-3.35,0-2.19-1.54-3.25-3.94-3.25a10.66,10.66,0,0,0-2.29.18Z\"/>\n <path class=\"cls-1\" d=\"M137.91,134.17h-7.65v6h8.55v3H126.56V122.88h11.8v3h-8.1v5.24h7.65Z\"/>\n</svg>\n", zt = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"160px\" height=\"160px\" viewBox=\"0 0 177.12 177.46\">\n <defs>\n <style>.cls-1{fill:none;}.cls-2{fill:#ff5f00;}.cls-3{fill:#eb001b;}.cls-4{fill:#f79e1b;}</style>\n </defs>\n <rect class=\"cls-1\" width=\"177.12\" height=\"177.46\"/>\n <path d=\"M142.7,146.35h-.22v.59h-.11v-.59h-.22v-.11h.56Zm.86.59h-.11v-.57l-.2.5h-.12l-.2-.5v.57h-.11v-.7H143l.2.5.2-.5h.17Zm-105.33,0H36.7v-17.5h1.53Zm11.63-17.5a12,12,0,0,1,3.94.61,8.4,8.4,0,0,1,3,1.75,7.61,7.61,0,0,1,1.89,2.76,10.31,10.31,0,0,1,0,7.26,7.61,7.61,0,0,1-1.89,2.76,8.4,8.4,0,0,1-3,1.75,12,12,0,0,1-3.94.61H43.47v-17.5ZM45,130.89v14.6h4.86a10.21,10.21,0,0,0,3.38-.52,6.87,6.87,0,0,0,2.46-1.47,6.1,6.1,0,0,0,1.51-2.3,9.08,9.08,0,0,0,0-6,6.22,6.22,0,0,0-1.51-2.31,6.78,6.78,0,0,0-2.46-1.47,10.18,10.18,0,0,0-3.37-.51Zm33-1.65a9.41,9.41,0,0,1,2.18.25,9,9,0,0,1,2,.72,7.49,7.49,0,0,1,1.66,1.13,7,7,0,0,1,1.27,1.5l-1.27.85a6,6,0,0,0-1.07-1.24,6.73,6.73,0,0,0-1.36-.94,7,7,0,0,0-1.6-.59,7.52,7.52,0,0,0-1.77-.21,7.82,7.82,0,0,0-2.91.54,6.85,6.85,0,0,0-2.34,1.52,7.2,7.2,0,0,0-1.56,2.36,8.45,8.45,0,0,0,0,6.1,7.2,7.2,0,0,0,1.56,2.36,6.85,6.85,0,0,0,2.34,1.52,7.63,7.63,0,0,0,2.91.54,8.05,8.05,0,0,0,1.76-.2,6.69,6.69,0,0,0,3-1.52,6.38,6.38,0,0,0,1.07-1.25l1.25.91a7.52,7.52,0,0,1-1.29,1.47,8,8,0,0,1-1.65,1.11,9,9,0,0,1-1.94.71,9.78,9.78,0,0,1-5.71-.42,8.34,8.34,0,0,1-4.72-4.67,9.92,9.92,0,0,1,0-7.23,8.34,8.34,0,0,1,4.72-4.67,9.38,9.38,0,0,1,3.51-.65Zm12.26,8a4.38,4.38,0,0,1,.82-1,4.25,4.25,0,0,1,1-.69,5.23,5.23,0,0,1,1.15-.4,5.38,5.38,0,0,1,1.2-.13,5.67,5.67,0,0,1,2,.33,4.42,4.42,0,0,1,1.57.94,4.17,4.17,0,0,1,1,1.49,5.28,5.28,0,0,1,.36,2V147H97.93v-6.77a4.87,4.87,0,0,0-.25-1.6,3.15,3.15,0,0,0-1.93-2,4.59,4.59,0,0,0-1.6-.26,4.24,4.24,0,0,0-1.54.28,3.7,3.7,0,0,0-2.09,2,4.08,4.08,0,0,0-.31,1.58V147H88.79V129h1.42ZM108.7,135a5.23,5.23,0,0,1,3.92,1.68,5.89,5.89,0,0,1,1.16,1.9,6.87,6.87,0,0,1,.44,2.42v.59h-9.86a5,5,0,0,0,.46,1.82,4.19,4.19,0,0,0,2.41,2.2,5.09,5.09,0,0,0,1.69.29,5.27,5.27,0,0,0,2.21-.45,6.14,6.14,0,0,0,1.76-1.23l.76,1a7.3,7.3,0,0,1-1.14.94,6.32,6.32,0,0,1-1.19.6,5.84,5.84,0,0,1-1.23.31,8.9,8.9,0,0,1-1.26.09,6.19,6.19,0,0,1-2.37-.44,5.46,5.46,0,0,1-1.87-1.24,5.67,5.67,0,0,1-1.22-1.91,6.65,6.65,0,0,1-.44-2.46,6.59,6.59,0,0,1,.44-2.44,5.8,5.8,0,0,1,1.19-2,5.48,5.48,0,0,1,1.85-1.26,5.86,5.86,0,0,1,2.33-.48Zm0,1.26a4.18,4.18,0,0,0-3,1.16,4.53,4.53,0,0,0-.92,1.29,5.27,5.27,0,0,0-.46,1.65h8.41a5.05,5.05,0,0,0-.41-1.67,4.22,4.22,0,0,0-.88-1.29,3.9,3.9,0,0,0-2.79-1.14ZM122.94,135a6.15,6.15,0,0,1,2.43.47,5.27,5.27,0,0,1,1.91,1.36l-.92,1a5.13,5.13,0,0,0-1.54-1.07,4.81,4.81,0,0,0-3.7,0,4.34,4.34,0,0,0-1.44,1,4.59,4.59,0,0,0-1,1.5,5.38,5.38,0,0,0,0,3.79,4.38,4.38,0,0,0,2.4,2.47,4.74,4.74,0,0,0,3.72,0,5.38,5.38,0,0,0,1.56-1.06l.89,1a5.39,5.39,0,0,1-1.91,1.36,6.1,6.1,0,0,1-2.42.47,6.32,6.32,0,0,1-2.43-.46,5.71,5.71,0,0,1-3.15-3.19,6.78,6.78,0,0,1,0-4.82,5.66,5.66,0,0,1,3.15-3.2A6.35,6.35,0,0,1,123,135Zm9.13,5.15H134l5-5h1.8l-5.6,5.55,5.7,6.21h-1.81l-5-5.51h-1.91v5.51h-1.5v-18h1.42ZM51.5,120.45v-6a3.56,3.56,0,0,0-3.31-3.8,3.38,3.38,0,0,0-.45,0,3.69,3.69,0,0,0-3.36,1.7,3.5,3.5,0,0,0-3.16-1.7,3.15,3.15,0,0,0-2.8,1.42v-1.18H36.34v9.56h2.1v-5.3a2.23,2.23,0,0,1,1.92-2.52,2,2,0,0,1,.42,0c1.38,0,2.08.9,2.08,2.52v5.32H45v-5.3a2.25,2.25,0,0,1,1.94-2.52,1.79,1.79,0,0,1,.4,0c1.42,0,2.1.9,2.1,2.52v5.32Zm31.06-9.59h-3.4V108h-2.1v2.9H75.12v1.87h1.94v4.36c0,2.22.86,3.54,3.32,3.54a4.88,4.88,0,0,0,2.6-.74l-.6-1.78a3.81,3.81,0,0,1-1.82.62c-1,0-1.38-.64-1.38-1.6v-4.4h3.38Zm17.74-.24a2.83,2.83,0,0,0-2.52,1.4v-1.16H95.72v9.56H97.8v-5.36c0-1.58.68-2.46,2-2.46a3.41,3.41,0,0,1,1.3.24l.64-2a4.44,4.44,0,0,0-1.48-.26Zm-26.82,1a7.13,7.13,0,0,0-3.9-1c-2.42,0-4,1.16-4,3.06,0,1.56,1.16,2.52,3.3,2.82l1,.14c1.14.16,1.68.46,1.68,1,0,.74-.76,1.16-2.18,1.16a5.12,5.12,0,0,1-3.18-1l-1,1.62a6.87,6.87,0,0,0,4.14,1.24c2.76,0,4.36-1.3,4.36-3.12s-1.26-2.56-3.34-2.86l-1-.14c-.9-.12-1.62-.3-1.62-.94s.68-1.12,1.82-1.12a6.09,6.09,0,0,1,3,.82Zm55.71-1a2.83,2.83,0,0,0-2.52,1.4v-1.16h-2.06v9.56h2.08v-5.36c0-1.58.68-2.46,2-2.46a3.41,3.41,0,0,1,1.3.24l.64-2a4.44,4.44,0,0,0-1.48-.26Zm-26.8,5a4.82,4.82,0,0,0,4.65,5h.45a5,5,0,0,0,3.44-1.14l-1-1.68a4.2,4.2,0,0,1-2.5.86,3.07,3.07,0,0,1,0-6.12,4.2,4.2,0,0,1,2.5.86l1-1.68a5,5,0,0,0-3.44-1.14,4.85,4.85,0,0,0-5.1,4.55c0,.15,0,.3,0,.45Zm19.48,0v-4.78h-2.08V112a3.64,3.64,0,0,0-3-1.4,5,5,0,1,0,0,10,3.64,3.64,0,0,0,3-1.4v1.16h2.08Zm-7.74,0a2.82,2.82,0,1,1,0,.23A1.77,1.77,0,0,1,114.13,115.62Zm-25.1-5a5,5,0,0,0,.14,10,5.83,5.83,0,0,0,3.92-1.34l-1-1.54a4.55,4.55,0,0,1-2.78,1,2.65,2.65,0,0,1-2.86-2.34h7.11v-.8c0-3-1.86-5-4.54-5Zm0,1.86a2.37,2.37,0,0,1,2.42,2.32h-5A2.45,2.45,0,0,1,89,112.48Zm52.17,3.16V107h-2.08v5a3.64,3.64,0,0,0-3-1.4,5,5,0,0,0,0,10,3.64,3.64,0,0,0,3-1.4v1.16h2.08Zm-7.74,0a2.82,2.82,0,1,1,0,.23C133.45,115.79,133.46,115.72,133.46,115.64Zm-70.23,0v-4.78H61.15V112a3.64,3.64,0,0,0-3-1.4,5,5,0,0,0,0,10,3.64,3.64,0,0,0,3-1.4v1.16h2.08Zm-7.74,0a2.82,2.82,0,1,1,0,.23,1.77,1.77,0,0,1,0-.23ZM144.66,119a1,1,0,0,1,.38.07,1,1,0,0,1,.52.5,1,1,0,0,1,0,.74,1,1,0,0,1-.52.5,1,1,0,0,1-1.28-.5,1,1,0,0,1,0-.74,1,1,0,0,1,.52-.5,1,1,0,0,1,.38-.07Zm0,1.69a.72.72,0,0,0,.29-.06.72.72,0,0,0,0-1.32.73.73,0,0,0-.58,0,.78.78,0,0,0-.24.16.74.74,0,0,0,0,1,.78.78,0,0,0,.24.16.73.73,0,0,0,.29.07Zm.06-1.19a.4.4,0,0,1,.26.08.28.28,0,0,1,0,.39.4.4,0,0,1-.21.09l.29.33h-.23l-.27-.33h-.09v.33h-.19v-.88Zm-.22.17v.24h.22a.24.24,0,0,0,.12,0,.14.14,0,0,0,0-.09.14.14,0,0,0,0-.09.24.24,0,0,0-.12,0Z\"/>\n <rect class=\"cls-2\" x=\"72.81\" y=\"38.01\" width=\"31.5\" height=\"56.61\"/>\n <path id=\"_Path_\" data-name=\" Path \" class=\"cls-3\" d=\"M74.81,66.32A35.94,35.94,0,0,1,88.56,38a36,36,0,1,0,0,56.61A35.92,35.92,0,0,1,74.81,66.32Z\"/>\n <path class=\"cls-4\" d=\"M143.37,88.63V87.47h.47v-.24h-1.19v.24h.47v1.16Zm2.31,0v-1.4h-.36l-.42,1-.42-1h-.37v1.4h.26v-1l.39.91H145l.39-.91v1.06Z\"/>\n <path class=\"cls-4\" d=\"M146.81,66.32a36,36,0,0,1-58.25,28.3,36,36,0,0,0,0-56.61,36,36,0,0,1,58.25,28.3Z\"/>\n</svg>\n", Bt = "\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg version=\"1.1\" viewBox=\"0 0 1000 997.52\" width=\"120px\" height=\"120px\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n <g transform=\"translate(-55.5 -1002.3)\">\n <path d=\"m55.5 1002.3h997.52v538.49l-49.374 77.148 49.374 68.661v313.22h-997.52v-507.63l30.859-35.488-30.859-33.945z\" fill=\"#016fd0\"/>\n <path d=\"m249.14 1697.4v-156.61h165.82l17.791 23.192 18.379-23.192h601.89v145.81s-15.74 10.644-33.945 10.801h-333.28l-20.058-24.687v24.687h-65.73v-42.142s-8.9788 5.8825-28.39 5.8825h-22.373v36.259h-99.52l-17.765-23.69-18.038 23.69z\" fill=\"#fff\"/>\n <path d=\"m55.5 1422.8 37.393-87.177h64.668l21.221 48.833v-48.833h80.388l12.633 35.295 12.247-35.295h360.86v17.744s18.97-17.744 50.146-17.744l117.08 0.4092 20.855 48.194v-48.603h67.273l18.515 27.683v-27.683h67.89v156.61h-67.89l-17.744-27.773v27.773h-98.838l-9.9396-24.687h-26.571l-9.7778 24.687h-67.029c-26.826 0-43.974-17.382-43.974-17.382v17.382h-101.06l-20.058-24.687v24.687h-375.8l-9.9327-24.687h-26.486l-9.8625 24.687h-46.199z\" fill=\"#fff\"/>\n <path d=\"m106.13 1354.9-50.435 117.26h32.836l9.3059-23.482h54.1l9.2577 23.482h33.559l-50.387-117.26h-38.236zm18.66 27.291 16.49 41.033h-33.029l16.538-41.033z\" fill=\"#016fd0\"/>\n <path d=\"m198.22 1472.2v-117.26l46.662 0.1733 27.14 75.604 26.49-75.778h46.288v117.26h-29.316v-86.405l-31.076 86.405h-25.71l-31.162-86.405v86.405z\" fill=\"#016fd0\"/>\n <path d=\"m364.86 1472.2v-117.26h95.663v26.23h-66.038v20.058h64.495v24.687h-64.495v20.83h66.038v25.459z\" fill=\"#016fd0\"/>\n <path d=\"m477.5 1354.9v117.26h29.316v-41.66h12.344l35.15 41.66h35.825l-38.574-43.202c15.831-1.3359 32.161-14.923 32.161-36.018 0-24.676-19.368-38.043-40.985-38.043h-65.238zm29.316 26.23h33.511c8.0388 0 13.887 6.2882 13.887 12.344 0 7.7905-7.5767 12.344-13.453 12.344h-33.945v-24.687z\" fill=\"#016fd0\"/>\n <path d=\"m625.62 1472.2h-29.933v-117.26h29.933z\" fill=\"#016fd0\"/>\n <path d=\"m696.6 1472.2h-6.4611c-31.262 0-50.242-24.629-50.242-58.15 0-34.349 18.768-59.114 58.246-59.114h32.402v27.773h-33.587c-16.026 0-27.36 12.507-27.36 31.63 0 22.71 12.96 32.248 31.63 32.248h7.7147z\" fill=\"#016fd0\"/>\n <path d=\"m760.39 1354.9-50.435 117.26h32.836l9.3059-23.482h54.1l9.2577 23.482h33.559l-50.387-117.26h-38.236zm18.66 27.291 16.49 41.033h-33.029l16.538-41.033z\" fill=\"#016fd0\"/>\n <path d=\"m852.43 1472.2v-117.26h37.272l47.59 73.676v-73.676h29.316v117.26h-36.066l-48.796-75.604v75.604z\" fill=\"#016fd0\"/>\n <path d=\"m269.2 1677.4v-117.26h95.663v26.23h-66.038v20.058h64.495v24.687h-64.495v20.83h66.038v25.459z\" fill=\"#016fd0\"/>\n <path d=\"m737.95 1677.4v-117.26h95.663v26.23h-66.038v20.058h64.187v24.687h-64.187v20.83h66.038v25.459z\" fill=\"#016fd0\"/>\n <path d=\"m368.57 1677.4 46.578-57.909-47.687-59.355h36.934l28.4 36.693 28.496-36.693h35.488l-47.06 58.632 46.664 58.632h-36.929l-27.575-36.115-26.905 36.115z\" fill=\"#016fd0\"/>\n <path d=\"m499.87 1560.1v117.26h30.088v-37.031h30.859c26.111 0 45.903-13.852 45.903-40.792 0-22.316-15.523-39.442-42.094-39.442h-64.756zm30.088 26.519h32.498c8.4355 0 14.465 5.1701 14.465 13.501 0 7.8262-5.9992 13.501-14.562 13.501h-32.402v-27.002z\" fill=\"#016fd0\"/>\n <path d=\"m619.45 1560.1v117.26h29.316v-41.66h12.344l35.15 41.66h35.825l-38.574-43.203c15.831-1.3361 32.161-14.923 32.161-36.018 0-24.676-19.368-38.043-40.985-38.043h-65.238zm29.316 26.23h33.511c8.0388 0 13.887 6.2881 13.887 12.344 0 7.7906-7.5767 12.344-13.453 12.344h-33.945v-24.687z\" fill=\"#016fd0\"/>\n <path d=\"m847.19 1677.4v-25.459h58.671c8.6812 0 12.44-4.6912 12.44-9.8363 0-4.9296-3.747-9.9134-12.44-9.9134h-26.513c-23.046 0-35.88-14.041-35.88-35.121 0-18.802 11.753-36.934 45.999-36.934h57.089l-12.344 26.384h-49.374c-9.4382 0-12.344 4.9526-12.344 9.6821 0 4.8612 3.5904 10.222 10.801 10.222h27.773c25.69 0 36.838 14.572 36.838 33.656 0 20.516-12.422 37.32-38.236 37.32z\" fill=\"#016fd0\"/>\n <path d=\"m954.78 1677.4v-25.459h58.671c8.6812 0 12.44-4.6912 12.44-9.8363 0-4.9296-3.7471-9.9134-12.44-9.9134h-26.513c-23.046 0-35.88-14.041-35.88-35.121 0-18.802 11.753-36.934 45.999-36.934h57.089l-12.344 26.384h-49.374c-9.4382 0-12.344 4.9526-12.344 9.6821 0 4.8612 3.5904 10.222 10.801 10.222h27.773c25.69 0 36.838 14.572 36.838 33.656 0 20.516-12.422 37.32-38.236 37.32z\" fill=\"#016fd0\"/>\n </g>\n</svg>\n", Vt = class {
|
|
1887
|
+
domMethodsService;
|
|
1888
|
+
loggerService;
|
|
1889
|
+
configService;
|
|
1890
|
+
document;
|
|
1891
|
+
classNames = {
|
|
1892
|
+
mainContainer: "tp-3ds-processing-screen",
|
|
1893
|
+
overlay: "tp-3ds-overlay",
|
|
1894
|
+
screenWrapper: "tp-3ds-processing-screen-wrapper",
|
|
1895
|
+
wrapperAttachToElement: "tp-3ds-processing-screen-wrapper-attach-to-element",
|
|
1896
|
+
wrapperVisa: "tp-3ds-processing-screen-wrapper-visa",
|
|
1897
|
+
wrapperMasterCard: "tp-3ds-processing-screen-wrapper-mastercard",
|
|
1898
|
+
wrapperAmex: "tp-3ds-processing-screen-wrapper-amex",
|
|
1899
|
+
loader: "tp-3ds-processing-screen-loader",
|
|
1900
|
+
loaderWithLogo: "tp-3ds-processing-screen-loader-with-logo",
|
|
1901
|
+
logo: "tp-3ds-processing-screen-logo"
|
|
1902
|
+
};
|
|
1903
|
+
processingScreenWrapperElement;
|
|
1904
|
+
loaderElement;
|
|
1855
1905
|
constructor(e, t, n, r) {
|
|
1856
|
-
this.domMethodsService = e, this.loggerService = t, this.configService = n, this.document = r, this.classNames =
|
|
1857
|
-
mainContainer: "tp-3ds-processing-screen",
|
|
1858
|
-
overlay: "tp-3ds-overlay",
|
|
1859
|
-
screenWrapper: "tp-3ds-processing-screen-wrapper",
|
|
1860
|
-
wrapperAttachToElement: "tp-3ds-processing-screen-wrapper-attach-to-element",
|
|
1861
|
-
wrapperVisa: "tp-3ds-processing-screen-wrapper-visa",
|
|
1862
|
-
wrapperMasterCard: "tp-3ds-processing-screen-wrapper-mastercard",
|
|
1863
|
-
wrapperAmex: "tp-3ds-processing-screen-wrapper-amex",
|
|
1864
|
-
loader: "tp-3ds-processing-screen-loader",
|
|
1865
|
-
loaderWithLogo: "tp-3ds-processing-screen-loader-with-logo",
|
|
1866
|
-
logo: "tp-3ds-processing-screen-logo"
|
|
1867
|
-
}, this.processingScreenWrapperElement = this.domMethodsService.createElement("div"), this.domMethodsService.addClassesToElement(this.processingScreenWrapperElement, [this.classNames.overlay, this.classNames.screenWrapper]), this.loaderElement = this.domMethodsService.createElement("div"), this.domMethodsService.addClassesToElement(this.loaderElement, [this.classNames.loader]);
|
|
1906
|
+
this.domMethodsService = e, this.loggerService = t, this.configService = n, this.document = r, this.processingScreenWrapperElement = this.domMethodsService.createElement("div"), this.domMethodsService.addClassesToElement(this.processingScreenWrapperElement, [this.classNames.overlay, this.classNames.screenWrapper]), this.loaderElement = this.domMethodsService.createElement("div"), this.domMethodsService.addClassesToElement(this.loaderElement, [this.classNames.loader]);
|
|
1868
1907
|
}
|
|
1869
1908
|
show(e) {
|
|
1870
1909
|
this.configService.getConfig$().pipe(H()).subscribe((t) => {
|
|
@@ -1923,6 +1962,8 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1923
1962
|
n.innerHTML = e, this.domMethodsService.addToElement(n, this.processingScreenWrapperElement), this.domMethodsService.addClassesToElement(this.processingScreenWrapperElement, [t]), this.domMethodsService.addClassesToElement(this.loaderElement, [this.classNames.loaderWithLogo]);
|
|
1924
1963
|
}
|
|
1925
1964
|
}, Ht = class {
|
|
1965
|
+
document;
|
|
1966
|
+
loggerService;
|
|
1926
1967
|
constructor(e, t) {
|
|
1927
1968
|
this.document = e, this.loggerService = t;
|
|
1928
1969
|
}
|
|
@@ -1972,6 +2013,7 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1972
2013
|
}
|
|
1973
2014
|
}
|
|
1974
2015
|
}, Ut = class {
|
|
2016
|
+
window;
|
|
1975
2017
|
constructor(e) {
|
|
1976
2018
|
this.window = e;
|
|
1977
2019
|
}
|
|
@@ -1985,6 +2027,7 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1985
2027
|
return JSON.parse(this.window.atob(e));
|
|
1986
2028
|
}
|
|
1987
2029
|
}, Wt = class {
|
|
2030
|
+
window;
|
|
1988
2031
|
constructor(e) {
|
|
1989
2032
|
this.window = e;
|
|
1990
2033
|
}
|
|
@@ -1992,6 +2035,7 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
1992
2035
|
return V(this.window, "message").pipe(Ct((t) => t.data && t.data.type === e), z((e) => e.data.data));
|
|
1993
2036
|
}
|
|
1994
2037
|
}, Gt = "\n.tp-3ds-processing-screen {\n position: relative;\n height: 100%;\n}\n\n.tp-3ds-processing-screen-wrapper {\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 50;\n}\n\n.tp-3ds-processing-screen-loader {\n box-sizing: border-box;\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n width: 40px;\n height: 40px;\n margin-top: 30px;\n border: 4px solid #e61c5b;\n border-radius: 32px;\n animation: tp-3ds-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) 0.15s infinite;\n border-color: #e61c5b transparent;\n will-change: animation;\n transform: translate(-50%) rotate(0deg);\n}\n\n.tp-3ds-processing-screen-logo {\n position: absolute;\n top: 50%;\n left: 50%;\n user-select: none;\n}\n\n.tp-3ds-processing-screen-wrapper-visa .tp-3ds-processing-screen-logo {\n margin: -100px 0 0 -56px;\n}\n\n.tp-3ds-processing-screen-wrapper-mastercard .tp-3ds-processing-screen-logo {\n margin: -123px 0 0 -79px;\n}\n\n@keyframes tp-3ds-spin {\n from {\n transform: translate(-50%) rotate(0deg);\n }\n to {\n transform: translate(-50%) rotate(360deg);\n }\n}\n", Kt = class {
|
|
2038
|
+
domMethodsService;
|
|
1995
2039
|
constructor(e) {
|
|
1996
2040
|
this.domMethodsService = e;
|
|
1997
2041
|
}
|
|
@@ -2054,15 +2098,19 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
2054
2098
|
}
|
|
2055
2099
|
}
|
|
2056
2100
|
}, qt = class {
|
|
2101
|
+
domMethodsService;
|
|
2102
|
+
document;
|
|
2103
|
+
cancelEmitter$ = new M();
|
|
2104
|
+
classNames = {
|
|
2105
|
+
mainContainer: "tp-3ds-popup-view",
|
|
2106
|
+
wrapper: "tp-3ds-popup-view-wrapper",
|
|
2107
|
+
overlay: "tp-3ds-overlay",
|
|
2108
|
+
popupOverlay: "tp-3ds-popup-view-overlay",
|
|
2109
|
+
header: "tp-3ds-popup-view-header",
|
|
2110
|
+
headerButton: "tp-3ds-popup-view-header-button"
|
|
2111
|
+
};
|
|
2057
2112
|
constructor(e, t) {
|
|
2058
|
-
this.domMethodsService = e, this.document = t
|
|
2059
|
-
mainContainer: "tp-3ds-popup-view",
|
|
2060
|
-
wrapper: "tp-3ds-popup-view-wrapper",
|
|
2061
|
-
overlay: "tp-3ds-overlay",
|
|
2062
|
-
popupOverlay: "tp-3ds-popup-view-overlay",
|
|
2063
|
-
header: "tp-3ds-popup-view-header",
|
|
2064
|
-
headerButton: "tp-3ds-popup-view-header-button"
|
|
2065
|
-
};
|
|
2113
|
+
this.domMethodsService = e, this.document = t;
|
|
2066
2114
|
}
|
|
2067
2115
|
init(e, t) {
|
|
2068
2116
|
this.destroyPopupView(), this.initializePopupView(e, t), this.cancelEmitter$.subscribe(() => {
|
|
@@ -2099,13 +2147,16 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
2099
2147
|
e && this.domMethodsService.removeElement(e);
|
|
2100
2148
|
}
|
|
2101
2149
|
}, Jt = class {
|
|
2150
|
+
domMethodsService;
|
|
2151
|
+
cancelState$ = new M();
|
|
2152
|
+
classNames = {
|
|
2153
|
+
mainContainer: "tp-3ds-inline-view",
|
|
2154
|
+
wrapper: "tp-3ds-inline-view-wrapper",
|
|
2155
|
+
header: "tp-3ds-inline-view-header",
|
|
2156
|
+
headerButton: "tp-3ds-inline-view-header-button"
|
|
2157
|
+
};
|
|
2102
2158
|
constructor(e) {
|
|
2103
|
-
this.domMethodsService = e
|
|
2104
|
-
mainContainer: "tp-3ds-inline-view",
|
|
2105
|
-
wrapper: "tp-3ds-inline-view-wrapper",
|
|
2106
|
-
header: "tp-3ds-inline-view-header",
|
|
2107
|
-
headerButton: "tp-3ds-inline-view-header-button"
|
|
2108
|
-
};
|
|
2159
|
+
this.domMethodsService = e;
|
|
2109
2160
|
}
|
|
2110
2161
|
init(e, t, n) {
|
|
2111
2162
|
this.destroyInlineView(), this.initializeInlineView(e, t, n), this.cancelState$.subscribe(() => {
|
|
@@ -2139,8 +2190,15 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
2139
2190
|
e && this.domMethodsService.removeElement(e);
|
|
2140
2191
|
}
|
|
2141
2192
|
}, Yt = class {
|
|
2193
|
+
popupViewService;
|
|
2194
|
+
inlineViewService;
|
|
2195
|
+
sessionIdService;
|
|
2196
|
+
domMethodsService;
|
|
2197
|
+
window;
|
|
2198
|
+
challengeIframeSelector = "tp-3ds-challenge-iframe";
|
|
2199
|
+
challengeIframeFormSelector = "tp-3ds-challenge-form";
|
|
2142
2200
|
constructor(e, t, n, r, i) {
|
|
2143
|
-
this.popupViewService = e, this.inlineViewService = t, this.sessionIdService = n, this.domMethodsService = r, this.window = i
|
|
2201
|
+
this.popupViewService = e, this.inlineViewService = t, this.sessionIdService = n, this.domMethodsService = r, this.window = i;
|
|
2144
2202
|
}
|
|
2145
2203
|
handleCancelEvent$(e, t) {
|
|
2146
2204
|
let n = {
|
|
@@ -2176,6 +2234,9 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
2176
2234
|
}
|
|
2177
2235
|
}
|
|
2178
2236
|
}, Xt = class {
|
|
2237
|
+
challengeCommonService;
|
|
2238
|
+
interFrameCommunicatorService;
|
|
2239
|
+
iframeCreatorService;
|
|
2179
2240
|
constructor(e, t, n) {
|
|
2180
2241
|
this.challengeCommonService = e, this.interFrameCommunicatorService = t, this.iframeCreatorService = n;
|
|
2181
2242
|
}
|
|
@@ -2241,6 +2302,11 @@ var G = /* @__PURE__ */ function(e) {
|
|
|
2241
2302
|
});
|
|
2242
2303
|
}
|
|
2243
2304
|
}, Zt = class {
|
|
2305
|
+
challengeCommonService;
|
|
2306
|
+
sessionIdService;
|
|
2307
|
+
base64TranscoderService;
|
|
2308
|
+
iframeCreatorService;
|
|
2309
|
+
interFrameCommunicatorService;
|
|
2244
2310
|
constructor(e, t, n, r, i) {
|
|
2245
2311
|
this.challengeCommonService = e, this.sessionIdService = t, this.base64TranscoderService = n, this.iframeCreatorService = r, this.interFrameCommunicatorService = i;
|
|
2246
2312
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Trust Payments <support@trustpayments.com>",
|
|
3
3
|
"homepage": "https://docs.trustpayments.com",
|
|
4
4
|
"name": "@trustpayments/3ds-sdk-js",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.719",
|
|
6
6
|
"description": "",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.cjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"eslint-plugin-unused-imports": "4.4.1",
|
|
59
59
|
"jsdom": "26.1.0",
|
|
60
60
|
"prettier": "3.8.5",
|
|
61
|
-
"typescript": "
|
|
61
|
+
"typescript": "6.0.3",
|
|
62
62
|
"typescript-eslint": "8.62.1",
|
|
63
63
|
"vite": "8.1.5",
|
|
64
64
|
"vite-plugin-css-injected-by-js": "5.0.2",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"safari 16-17",
|
|
89
89
|
"Android 13-14"
|
|
90
90
|
],
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "63e32d97c6fced52f546c3e8fab903218d007816"
|
|
92
92
|
}
|