@rebilly/risk-data-collector
Advanced tools
Comparing version 3.6.0 to 3.7.0
@@ -0,1 +1,8 @@ | ||
## [3.7.0](https://github.com/Rebilly/rebilly/compare/risk-data-collector-v3.6.0...risk-data-collector-v3.7.0) (2023-09-18) | ||
### Features | ||
* **instruments:** Setup telemetry ([#1185](https://github.com/Rebilly/rebilly/issues/1185)) ([b5ca186](https://github.com/Rebilly/rebilly/commit/b5ca18631c7a43a74c5f04e46fe78e1405e4258a)) | ||
## [3.6.0](https://github.com/Rebilly/rebilly/compare/risk-data-collector-v3.5.0...risk-data-collector-v3.6.0) (2023-09-05) | ||
@@ -2,0 +9,0 @@ |
function t(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function e(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=e.apply(r,n);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)}))}}function r(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var n=r((function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),o=r((function(t){var e=n.default;function r(){ | ||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ | ||
t.exports=r=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),u=new k(n||[]);return a(i,"_invoke",{value:_(t,r,u)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h={};function v(){}function y(){}function m(){}var R={};f(R,c,(function(){return this}));var E=Object.getPrototypeOf,g=E&&E(E(N([])));g&&g!==o&&i.call(g,c)&&(R=g);var w=m.prototype=v.prototype=Object.create(R);function b(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,r){function n(o,a,u,c){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==e(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=I(a,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=d(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function I(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,I(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}throw new TypeError(e(t)+" is not iterable")}return y.prototype=m,a(w,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:y,configurable:!0}),y.displayName=f(m,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,f(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},n.awrap=function(t){return{__await:t}},b(O.prototype),f(O.prototype,s,(function(){return this})),n.AsyncIterator=O,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new O(p(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(w),f(w,l,"Generator"),f(w,c,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=N,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),i=o(),a=i;try{regeneratorRuntime=i}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=function(){return c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},c.apply(this,arguments)};function s(t){for(var e="",r=0;r<t.length;++r)if(r>0){var n=t[r].toLowerCase();n!==t[r]?e+=" ".concat(n):e+=t[r]}else e+=t[r].toUpperCase();return e}"function"==typeof SuppressedError&&SuppressedError;var l="Blocked by CSP",f=s("WrongRegion"),p=s("SubscriptionNotActive"),d=s("UnsupportedVersion"),h=s("InstallationMethodRestricted"),v="API key required",y="API key not found",m="API key expired",R="9319";function E(t,e){var r=[];return function(t,e){var r,n,o=(n=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}([],t,!0),{current:function(){return n[0]},postpone:function(){var t=n.shift();void 0!==t&&n.push(t)},exclude:function(){n.shift()}}),i=(100,3e3,r=0,function(){return Math.random()*Math.min(3e3,100*Math.pow(2,r++))}),a=o.current();if(void 0===a)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var u=function(t,r){return e(t).catch((function(t){if(r+1>=5)throw t;!function(t){if(!(t instanceof Error))return!1;var e=t.message;return e===l||e===R}(t)?o.postpone():o.exclude();var e,n=o.current();if(void 0===n)throw t;return(e=i(),new Promise((function(t){return setTimeout(t,e)}))).then((function(){return u(n,r+1)}))}))};return u(a,0)}(t,(function(t){var n=new Date,o=function(e){return r.push({url:t,startedAt:n,finishedAt:new Date,error:e})},i=e(t);return i.then((function(){return o()}),o),i})).then((function(t){return[t,{attempts:r}]}))}var g="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",w="Failed to load the JS script of the agent";function b(t){return function(t,e,r,n){var o,i=document,a="securitypolicyviolation",u=function(e){var r=new URL(t,location.href),n=e.blockedURI;n!==r.href&&n!==r.protocol.slice(0,-1)&&n!==r.origin||(o=e,c())};i.addEventListener(a,u);var c=function(){return i.removeEventListener(a,u)};return Promise.resolve().then(e).then((function(t){return c(),t}),(function(t){return new Promise((function(t){return setTimeout(t)})).then((function(){if(c(),o)return function(){throw new Error(l)}();throw t}))}))}(t,(function(){return function(t){return new Promise((function(e,r){var n=document.createElement("script"),o=function(){var t;return null===(t=n.parentNode)||void 0===t?void 0:t.removeChild(n)},i=document.head||document.getElementsByTagName("head")[0];n.onload=function(){o(),e()},n.onerror=function(){o(),r(new Error(w))},n.async=!0,n.src=t,i.appendChild(n)}))}(t)})).then(O)}function O(){var t=window,e="__fpjs_p_l_b",r=t[e];if(function(t,e){var r,n=null===(r=Object.getOwnPropertyDescriptor)||void 0===r?void 0:r.call(Object,t,e);(null==n?void 0:n.configurable)?delete t[e]:n&&!n.writable||(t[e]=void 0)}(t,e),"function"!=typeof(null==r?void 0:r.load))throw new Error(R);return r}function _(t){throw t instanceof Error&&t.message===R?new Error(w):t}var I={load:function(t){var e;t.scriptUrlPattern;var r=t.token,n=t.apiKey,o=void 0===n?r:n,i=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(t,["scriptUrlPattern","token","apiKey"]),a=null!==(e=function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(t,e)?t[e]:void 0}(t,"scriptUrlPattern"))&&void 0!==e?e:g;return Promise.resolve().then((function(){if(!o||"string"!=typeof o)throw new Error(v);return E(function(t,e){return(Array.isArray(t)?t:[t]).map((function(t){return function(t,e){var r=encodeURIComponent;return t.replace(/<[^<>]+>/g,(function(t){return"<version>"===t?"3":"<apiKey>"===t?r(e):"<loaderVersion>"===t?r("3.8.5"):t}))}(String(t),e)}))}(a,o),b).catch(_)})).then((function(t){var e=t[0],r=t[1];return e.load(c(c({},i),{ldi:r}))}))},defaultScriptUrlPattern:g,ERROR_SCRIPT_LOAD_FAIL:w,ERROR_API_KEY_EXPIRED:m,ERROR_API_KEY_INVALID:y,ERROR_API_KEY_MISSING:v,ERROR_BAD_REQUEST_FORMAT:"Request cannot be parsed",ERROR_BAD_RESPONSE_FORMAT:"Response cannot be parsed",ERROR_CLIENT_TIMEOUT:"Client timeout",ERROR_CSP_BLOCK:l,ERROR_FORBIDDEN_ENDPOINT:s("HostnameRestricted"),ERROR_FORBIDDEN_HEADER:"Not available with restricted header",ERROR_FORBIDDEN_ORIGIN:"Not available for this origin",ERROR_GENERAL_SERVER_FAILURE:"Request failed",ERROR_INSTALLATION_METHOD_RESTRICTED:h,ERROR_INTEGRATION_FAILURE:s("IntegrationFailed"),ERROR_INVALID_ENDPOINT:"The endpoint parameter is not a valid URL",ERROR_NETWORK_ABORT:"Network request aborted",ERROR_NETWORK_CONNECTION:"Network connection error",ERROR_RATE_LIMIT:"Too many requests, rate limit exceeded",ERROR_SERVER_TIMEOUT:"Request failed to process",ERROR_SUBSCRIPTION_NOT_ACTIVE:p,ERROR_TOKEN_EXPIRED:m,ERROR_TOKEN_INVALID:y,ERROR_TOKEN_MISSING:v,ERROR_UNSUPPORTED_VERSION:d,ERROR_WRONG_REGION:f,defaultEndpoint:{default:"endpoint"},defaultTlsEndpoint:{default:"tlsEndpoint"}};function x(){return S.apply(this,arguments)}function S(){return(S=e(a.mark((function t(){var e,r,n,o;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e="object"===("undefined"==typeof Cypress?"undefined":u(Cypress)),r="object"===("undefined"==typeof process?"undefined":u(process))&&"test"===process.env.NODE_ENV,!e&&!r){t.next=5;break}return t.abrupt("return","a-mock-visitor-id");case 5:return t.next=7,I.load({apiKey:"hpFVJecm7Ni7AjSfvBIW"});case 7:return n=t.sent,t.next=10,n.get();case 10:return o=t.sent,t.abrupt("return",o.visitorId);case 14:return t.prev=14,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return","");case 18:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)}function k(){return N.apply(this,arguments)}function N(){return(N=e(a.mark((function t(){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){window.requestIdleCallback?requestIdleCallback(e(a.mark((function e(){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:r=e.sent,t(r);case 4:case"end":return e.stop()}}),e)})))):setTimeout(e(a.mark((function e(){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:r=e.sent,t(r);case 4:case"end":return e.stop()}}),e)}))),500)})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var L=function(t){var e=t.env,r=t.kountAccountId,n=t.kountSessionId,o=function(t){return"production"===t}(e)?"https://ssl.kaptcha.com":"https://tst.kaptcha.com",i=new URL("".concat(o,"/collect/sdk"));i.searchParams.append("m",r),n&&i.searchParams.append("m",n);var a=document.createElement("script");return a.setAttribute("class","kaxsdc"),a.setAttribute("data-event","load"),a.setAttribute("type","text/javascript"),a.setAttribute("src",i.href),document.body.append(a),a};function T(t){return A.apply(this,arguments)}function A(){return(A=e(a.mark((function t(e){var r,n,o;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.env,n=e.kountAccountId,o=e.kountSessionId,t.abrupt("return",new Promise((function(t,e){var i=L({env:r,kountAccountId:n,kountSessionId:o});i.onload=function(){var e=new ka.ClientSDK;e.setupCallback({"collect-begin":function(e){var r=e.MercSessId;t(r)}}),e.autoLoadEvents()},i.onerror=function(){e(new Error("Error attempting to mount Kount script"))}})));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function P(t){return j.apply(this,arguments)}function j(){return j=e(a.mark((function t(e){var r,n,o,i,u,c,s,l,f,p,d,h,v,y,m,R,E,g,w,b;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.env,n=void 0===r?null:r,o=e.screen,i=e.navigator,u=e.kountAccountId,c=void 0===u?null:u,s=e.kountSessionId,l=void 0===s?null:s,f=e.getFingerprint,p=e.getFraudSessionId,h=(d=o||{}).colorDepth,v=d.height,y=d.width,R=(m=i||{}).javaEnabled,E=m.language,t.prev=3,t.next=6,f();case 6:if(g=t.sent,!c){t.next=11;break}return t.next=10,p({env:n,kountAccountId:c,kountSessionId:l});case 10:w=t.sent;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),console.error(t.t0);case 16:return b={riskMetadata:{fingerprint:g||null,extraData:{kountFraudSessionId:w||null},browserData:{colorDepth:h||null,isJavaEnabled:R?R.call(i):null,language:E||null,screenHeight:v||null,screenWidth:y||null,timeZoneOffset:(new Date).getTimezoneOffset()}}},t.abrupt("return",b);case 18:case"end":return t.stop()}}),t,null,[[3,13]])}))),j.apply(this,arguments)}function D(){return C.apply(this,arguments)}function C(){return C=e(a.mark((function t(){var e,r,n,o,i,u,c,s=arguments;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(e=s.length>0&&void 0!==s[0]?s[0]:{}).env,n=void 0===r?null:r,o=e.kountAccountId,i=void 0===o?null:o,u=e.kountSessionId,c=void 0===u?null:u,t.abrupt("return",P({env:n,screen:screen,navigator:navigator,kountAccountId:i,kountSessionId:c,getFingerprint:k,getFraudSessionId:T}));case 2:case"end":return t.stop()}}),t)}))),C.apply(this,arguments)}export{D as collectData,P as collectDataHelper}; | ||
t.exports=r=function(){return o},t.exports.__esModule=!0,t.exports.default=t.exports;var n,o={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(n){p=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),a=new P(n||[]);return u(i,"_invoke",{value:N(t,r,a)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}o.wrap=h;var v="suspendedStart",y="suspendedYield",m="executing",R="completed",E={};function g(){}function w(){}function b(){}var O={};p(O,s,(function(){return this}));var _=Object.getPrototypeOf,I=_&&_(_(j([])));I&&I!==i&&a.call(I,s)&&(O=I);var x=b.prototype=g.prototype=Object.create(O);function S(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,r){function n(o,i,u,c){var s=d(t[o],t,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;u(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function N(t,e,r){var o=v;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===R){if("throw"===i)throw a;return{value:n,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=L(u,r);if(c){if(c===E)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=R,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var s=d(t,e,r);if("normal"===s.type){if(o=r.done?R:y,s.arg===E)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=R,r.method="throw",r.arg=s.arg)}}}function L(t,e){var r=e.method,o=t.iterator[r];if(o===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=n,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),E;var i=d(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,E;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,E):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,E)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function j(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(a.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=b,u(x,"constructor",{value:b,configurable:!0}),u(b,"constructor",{value:w,configurable:!0}),w.displayName=p(b,f,"GeneratorFunction"),o.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,p(t,f,"GeneratorFunction")),t.prototype=Object.create(x),t},o.awrap=function(t){return{__await:t}},S(k.prototype),p(k.prototype,l,(function(){return this})),o.AsyncIterator=k,o.async=function(t,e,r,n,i){void 0===i&&(i=Promise);var a=new k(h(t,e,r,n),i);return o.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),p(x,f,"Generator"),p(x,s,(function(){return this})),p(x,"toString",(function(){return"[object Generator]"})),o.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},o.values=j,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return u.type="throw",u.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,E):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),E},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),E}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),E}},o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),i=o(),a=i;try{regeneratorRuntime=i}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}var c=function(){return c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},c.apply(this,arguments)};function s(t){for(var e="",r=0;r<t.length;++r)if(r>0){var n=t[r].toLowerCase();n!==t[r]?e+=" ".concat(n):e+=t[r]}else e+=t[r].toUpperCase();return e}"function"==typeof SuppressedError&&SuppressedError;var l="Blocked by CSP",f=s("WrongRegion"),p=s("SubscriptionNotActive"),h=s("UnsupportedVersion"),d=s("InstallationMethodRestricted"),v="API key required",y="API key not found",m="API key expired",R="9319";function E(t,e){var r=[];return function(t,e){var r,n,o=(n=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}([],t,!0),{current:function(){return n[0]},postpone:function(){var t=n.shift();void 0!==t&&n.push(t)},exclude:function(){n.shift()}}),i=(100,3e3,r=0,function(){return Math.random()*Math.min(3e3,100*Math.pow(2,r++))}),a=o.current();if(void 0===a)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var u=function(t,r){return e(t).catch((function(t){if(r+1>=5)throw t;!function(t){if(!(t instanceof Error))return!1;var e=t.message;return e===l||e===R}(t)?o.postpone():o.exclude();var e,n=o.current();if(void 0===n)throw t;return(e=i(),new Promise((function(t){return setTimeout(t,e)}))).then((function(){return u(n,r+1)}))}))};return u(a,0)}(t,(function(t){var n=new Date,o=function(e){return r.push({url:t,startedAt:n,finishedAt:new Date,error:e})},i=e(t);return i.then((function(){return o()}),o),i})).then((function(t){return[t,{attempts:r}]}))}var g="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",w="Failed to load the JS script of the agent";function b(t){return function(t,e,r,n){var o,i=document,a="securitypolicyviolation",u=function(e){var r=new URL(t,location.href),n=e.blockedURI;n!==r.href&&n!==r.protocol.slice(0,-1)&&n!==r.origin||(o=e,c())};i.addEventListener(a,u);var c=function(){return i.removeEventListener(a,u)};return Promise.resolve().then(e).then((function(t){return c(),t}),(function(t){return new Promise((function(t){return setTimeout(t)})).then((function(){if(c(),o)return function(){throw new Error(l)}();throw t}))}))}(t,(function(){return function(t){return new Promise((function(e,r){var n=document.createElement("script"),o=function(){var t;return null===(t=n.parentNode)||void 0===t?void 0:t.removeChild(n)},i=document.head||document.getElementsByTagName("head")[0];n.onload=function(){o(),e()},n.onerror=function(){o(),r(new Error(w))},n.async=!0,n.src=t,i.appendChild(n)}))}(t)})).then(O)}function O(){var t=window,e="__fpjs_p_l_b",r=t[e];if(function(t,e){var r,n=null===(r=Object.getOwnPropertyDescriptor)||void 0===r?void 0:r.call(Object,t,e);(null==n?void 0:n.configurable)?delete t[e]:n&&!n.writable||(t[e]=void 0)}(t,e),"function"!=typeof(null==r?void 0:r.load))throw new Error(R);return r}function _(t){throw t instanceof Error&&t.message===R?new Error(w):t}var I={load:function(t){var e;t.scriptUrlPattern;var r=t.token,n=t.apiKey,o=void 0===n?r:n,i=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(t,["scriptUrlPattern","token","apiKey"]),a=null!==(e=function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(t,e)?t[e]:void 0}(t,"scriptUrlPattern"))&&void 0!==e?e:g;return Promise.resolve().then((function(){if(!o||"string"!=typeof o)throw new Error(v);return E(function(t,e){return(Array.isArray(t)?t:[t]).map((function(t){return function(t,e){var r=encodeURIComponent;return t.replace(/<[^<>]+>/g,(function(t){return"<version>"===t?"3":"<apiKey>"===t?r(e):"<loaderVersion>"===t?r("3.8.5"):t}))}(String(t),e)}))}(a,o),b).catch(_)})).then((function(t){var e=t[0],r=t[1];return e.load(c(c({},i),{ldi:r}))}))},defaultScriptUrlPattern:g,ERROR_SCRIPT_LOAD_FAIL:w,ERROR_API_KEY_EXPIRED:m,ERROR_API_KEY_INVALID:y,ERROR_API_KEY_MISSING:v,ERROR_BAD_REQUEST_FORMAT:"Request cannot be parsed",ERROR_BAD_RESPONSE_FORMAT:"Response cannot be parsed",ERROR_CLIENT_TIMEOUT:"Client timeout",ERROR_CSP_BLOCK:l,ERROR_FORBIDDEN_ENDPOINT:s("HostnameRestricted"),ERROR_FORBIDDEN_HEADER:"Not available with restricted header",ERROR_FORBIDDEN_ORIGIN:"Not available for this origin",ERROR_GENERAL_SERVER_FAILURE:"Request failed",ERROR_INSTALLATION_METHOD_RESTRICTED:d,ERROR_INTEGRATION_FAILURE:s("IntegrationFailed"),ERROR_INVALID_ENDPOINT:"The endpoint parameter is not a valid URL",ERROR_NETWORK_ABORT:"Network request aborted",ERROR_NETWORK_CONNECTION:"Network connection error",ERROR_RATE_LIMIT:"Too many requests, rate limit exceeded",ERROR_SERVER_TIMEOUT:"Request failed to process",ERROR_SUBSCRIPTION_NOT_ACTIVE:p,ERROR_TOKEN_EXPIRED:m,ERROR_TOKEN_INVALID:y,ERROR_TOKEN_MISSING:v,ERROR_UNSUPPORTED_VERSION:h,ERROR_WRONG_REGION:f,defaultEndpoint:{default:"endpoint"},defaultTlsEndpoint:{default:"tlsEndpoint"}};function x(){return S.apply(this,arguments)}function S(){return(S=e(a.mark((function t(){var e,r,n,o;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e="object"===("undefined"==typeof Cypress?"undefined":u(Cypress)),r="object"===("undefined"==typeof process?"undefined":u(process))&&"test"===process.env.NODE_ENV,!e&&!r){t.next=5;break}return t.abrupt("return","a-mock-visitor-id");case 5:return t.next=7,I.load({apiKey:"hpFVJecm7Ni7AjSfvBIW"});case 7:return n=t.sent,t.next=10,n.get();case 10:return o=t.sent,t.abrupt("return",o.visitorId);case 14:return t.prev=14,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return","");case 18:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)}function k(){return N.apply(this,arguments)}function N(){return(N=e(a.mark((function t(){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){window.requestIdleCallback?requestIdleCallback(e(a.mark((function e(){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:r=e.sent,t(r);case 4:case"end":return e.stop()}}),e)})))):setTimeout(e(a.mark((function e(){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x();case 2:r=e.sent,t(r);case 4:case"end":return e.stop()}}),e)}))),500)})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var L=function(t){var e=t.env,r=t.kountAccountId,n=t.kountSessionId,o=function(t){return"production"===t}(e)?"https://ssl.kaptcha.com":"https://tst.kaptcha.com",i=new URL("".concat(o,"/collect/sdk"));i.searchParams.append("m",r),n&&i.searchParams.append("m",n);var a=document.createElement("script");return a.setAttribute("class","kaxsdc"),a.setAttribute("data-event","load"),a.setAttribute("type","text/javascript"),a.setAttribute("src",i.href),document.body.append(a),a};function T(t){return A.apply(this,arguments)}function A(){return(A=e(a.mark((function t(e){var r,n,o;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.env,n=e.kountAccountId,o=e.kountSessionId,t.abrupt("return",new Promise((function(t,e){var i=L({env:r,kountAccountId:n,kountSessionId:o});i.onload=function(){var e=new ka.ClientSDK;e.setupCallback({"collect-begin":function(e){var r=e.MercSessId;t(r)}}),e.autoLoadEvents()},i.onerror=function(){e(new Error("Error attempting to mount Kount script"))}})));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function P(t){return j.apply(this,arguments)}function j(){return j=e(a.mark((function t(e){var r,n,o,i,u,c,s,l,f,p,h,d,v,y,m,R,E,g,w,b;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.env,n=void 0===r?null:r,o=e.screen,i=e.navigator,u=e.kountAccountId,c=void 0===u?null:u,s=e.kountSessionId,l=void 0===s?null:s,f=e.getFingerprint,p=e.getFraudSessionId,d=(h=o||{}).colorDepth,v=h.height,y=h.width,R=(m=i||{}).javaEnabled,E=m.language,t.prev=3,t.next=6,f();case 6:if(g=t.sent,!c){t.next=11;break}return t.next=10,p({env:n,kountAccountId:c,kountSessionId:l});case 10:w=t.sent;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),console.error(t.t0);case 16:return b={riskMetadata:{fingerprint:g||null,extraData:{kountFraudSessionId:w||null},browserData:{colorDepth:d||null,isJavaEnabled:R?R.call(i):null,language:E||null,screenHeight:v||null,screenWidth:y||null,timeZoneOffset:(new Date).getTimezoneOffset()}}},t.abrupt("return",b);case 18:case"end":return t.stop()}}),t,null,[[3,13]])}))),j.apply(this,arguments)}function D(){return C.apply(this,arguments)}function C(){return C=e(a.mark((function t(){var e,r,n,o,i,u,c,s=arguments;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(e=s.length>0&&void 0!==s[0]?s[0]:{}).env,n=void 0===r?null:r,o=e.kountAccountId,i=void 0===o?null:o,u=e.kountSessionId,c=void 0===u?null:u,t.abrupt("return",P({env:n,screen:screen,navigator:navigator,kountAccountId:i,kountSessionId:c,getFingerprint:k,getFraudSessionId:T}));case 2:case"end":return t.stop()}}),t)}))),C.apply(this,arguments)}export{D as collectData,P as collectDataHelper}; |
var RiskDataCollector=function(t){"use strict";function e(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function r(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function u(t){e(a,o,i,u,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)}))}}function n(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var o=n((function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),i=n((function(t){var e=o.default;function r(){ | ||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ | ||
t.exports=r=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",s=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),u=new k(n||[]);return a(i,"_invoke",{value:O(t,r,u)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}n.wrap=p;var h={};function v(){}function y(){}function m(){}var R={};f(R,c,(function(){return this}));var E=Object.getPrototypeOf,g=E&&E(E(N([])));g&&g!==o&&i.call(g,c)&&(R=g);var w=m.prototype=v.prototype=Object.create(R);function b(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,r){function n(o,a,u,c){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==e(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function O(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=I(a,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=d(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function I(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,I(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}throw new TypeError(e(t)+" is not iterable")}return y.prototype=m,a(w,"constructor",{value:m,configurable:!0}),a(m,"constructor",{value:y,configurable:!0}),y.displayName=f(m,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,f(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},n.awrap=function(t){return{__await:t}},b(_.prototype),f(_.prototype,s,(function(){return this})),n.AsyncIterator=_,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new _(p(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(w),f(w,l,"Generator"),f(w,c,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},n.values=N,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},n}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),a=i(),u=a;try{regeneratorRuntime=a}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=a:Function("r","regeneratorRuntime = r")(a)}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}var s=function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},s.apply(this,arguments)};function l(t){for(var e="",r=0;r<t.length;++r)if(r>0){var n=t[r].toLowerCase();n!==t[r]?e+=" ".concat(n):e+=t[r]}else e+=t[r].toUpperCase();return e}"function"==typeof SuppressedError&&SuppressedError;var f="Blocked by CSP",p=l("WrongRegion"),d=l("SubscriptionNotActive"),h=l("UnsupportedVersion"),v=l("InstallationMethodRestricted"),y="API key required",m="API key not found",R="API key expired",E="9319";function g(t,e){var r=[];return function(t,e){var r,n,o=(n=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}([],t,!0),{current:function(){return n[0]},postpone:function(){var t=n.shift();void 0!==t&&n.push(t)},exclude:function(){n.shift()}}),i=(100,3e3,r=0,function(){return Math.random()*Math.min(3e3,100*Math.pow(2,r++))}),a=o.current();if(void 0===a)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var u=function(t,r){return e(t).catch((function(t){if(r+1>=5)throw t;!function(t){if(!(t instanceof Error))return!1;var e=t.message;return e===f||e===E}(t)?o.postpone():o.exclude();var e,n=o.current();if(void 0===n)throw t;return(e=i(),new Promise((function(t){return setTimeout(t,e)}))).then((function(){return u(n,r+1)}))}))};return u(a,0)}(t,(function(t){var n=new Date,o=function(e){return r.push({url:t,startedAt:n,finishedAt:new Date,error:e})},i=e(t);return i.then((function(){return o()}),o),i})).then((function(t){return[t,{attempts:r}]}))}var w="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",b="Failed to load the JS script of the agent";function _(t){return function(t,e,r,n){var o,i=document,a="securitypolicyviolation",u=function(e){var r=new URL(t,location.href),n=e.blockedURI;n!==r.href&&n!==r.protocol.slice(0,-1)&&n!==r.origin||(o=e,c())};i.addEventListener(a,u);var c=function(){return i.removeEventListener(a,u)};return Promise.resolve().then(e).then((function(t){return c(),t}),(function(t){return new Promise((function(t){return setTimeout(t)})).then((function(){if(c(),o)return function(){throw new Error(f)}();throw t}))}))}(t,(function(){return function(t){return new Promise((function(e,r){var n=document.createElement("script"),o=function(){var t;return null===(t=n.parentNode)||void 0===t?void 0:t.removeChild(n)},i=document.head||document.getElementsByTagName("head")[0];n.onload=function(){o(),e()},n.onerror=function(){o(),r(new Error(b))},n.async=!0,n.src=t,i.appendChild(n)}))}(t)})).then(O)}function O(){var t=window,e="__fpjs_p_l_b",r=t[e];if(function(t,e){var r,n=null===(r=Object.getOwnPropertyDescriptor)||void 0===r?void 0:r.call(Object,t,e);(null==n?void 0:n.configurable)?delete t[e]:n&&!n.writable||(t[e]=void 0)}(t,e),"function"!=typeof(null==r?void 0:r.load))throw new Error(E);return r}function I(t){throw t instanceof Error&&t.message===E?new Error(b):t}var x={load:function(t){var e;t.scriptUrlPattern;var r=t.token,n=t.apiKey,o=void 0===n?r:n,i=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(t,["scriptUrlPattern","token","apiKey"]),a=null!==(e=function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(t,e)?t[e]:void 0}(t,"scriptUrlPattern"))&&void 0!==e?e:w;return Promise.resolve().then((function(){if(!o||"string"!=typeof o)throw new Error(y);return g(function(t,e){return(Array.isArray(t)?t:[t]).map((function(t){return function(t,e){var r=encodeURIComponent;return t.replace(/<[^<>]+>/g,(function(t){return"<version>"===t?"3":"<apiKey>"===t?r(e):"<loaderVersion>"===t?r("3.8.5"):t}))}(String(t),e)}))}(a,o),_).catch(I)})).then((function(t){var e=t[0],r=t[1];return e.load(s(s({},i),{ldi:r}))}))},defaultScriptUrlPattern:w,ERROR_SCRIPT_LOAD_FAIL:b,ERROR_API_KEY_EXPIRED:R,ERROR_API_KEY_INVALID:m,ERROR_API_KEY_MISSING:y,ERROR_BAD_REQUEST_FORMAT:"Request cannot be parsed",ERROR_BAD_RESPONSE_FORMAT:"Response cannot be parsed",ERROR_CLIENT_TIMEOUT:"Client timeout",ERROR_CSP_BLOCK:f,ERROR_FORBIDDEN_ENDPOINT:l("HostnameRestricted"),ERROR_FORBIDDEN_HEADER:"Not available with restricted header",ERROR_FORBIDDEN_ORIGIN:"Not available for this origin",ERROR_GENERAL_SERVER_FAILURE:"Request failed",ERROR_INSTALLATION_METHOD_RESTRICTED:v,ERROR_INTEGRATION_FAILURE:l("IntegrationFailed"),ERROR_INVALID_ENDPOINT:"The endpoint parameter is not a valid URL",ERROR_NETWORK_ABORT:"Network request aborted",ERROR_NETWORK_CONNECTION:"Network connection error",ERROR_RATE_LIMIT:"Too many requests, rate limit exceeded",ERROR_SERVER_TIMEOUT:"Request failed to process",ERROR_SUBSCRIPTION_NOT_ACTIVE:d,ERROR_TOKEN_EXPIRED:R,ERROR_TOKEN_INVALID:m,ERROR_TOKEN_MISSING:y,ERROR_UNSUPPORTED_VERSION:h,ERROR_WRONG_REGION:p,defaultEndpoint:{default:"endpoint"},defaultTlsEndpoint:{default:"tlsEndpoint"}};function S(){return k.apply(this,arguments)}function k(){return(k=r(u.mark((function t(){var e,r,n,o;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e="object"===("undefined"==typeof Cypress?"undefined":c(Cypress)),r="object"===("undefined"==typeof process?"undefined":c(process))&&"test"===process.env.NODE_ENV,!e&&!r){t.next=5;break}return t.abrupt("return","a-mock-visitor-id");case 5:return t.next=7,x.load({apiKey:"hpFVJecm7Ni7AjSfvBIW"});case 7:return n=t.sent,t.next=10,n.get();case 10:return o=t.sent,t.abrupt("return",o.visitorId);case 14:return t.prev=14,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return","");case 18:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)}function N(){return L.apply(this,arguments)}function L(){return(L=r(u.mark((function t(){return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){window.requestIdleCallback?requestIdleCallback(r(u.mark((function e(){var r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:r=e.sent,t(r);case 4:case"end":return e.stop()}}),e)})))):setTimeout(r(u.mark((function e(){var r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:r=e.sent,t(r);case 4:case"end":return e.stop()}}),e)}))),500)})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var T=function(t){var e=t.env,r=t.kountAccountId,n=t.kountSessionId,o=function(t){return"production"===t}(e)?"https://ssl.kaptcha.com":"https://tst.kaptcha.com",i=new URL("".concat(o,"/collect/sdk"));i.searchParams.append("m",r),n&&i.searchParams.append("m",n);var a=document.createElement("script");return a.setAttribute("class","kaxsdc"),a.setAttribute("data-event","load"),a.setAttribute("type","text/javascript"),a.setAttribute("src",i.href),document.body.append(a),a};function P(t){return A.apply(this,arguments)}function A(){return(A=r(u.mark((function t(e){var r,n,o;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.env,n=e.kountAccountId,o=e.kountSessionId,t.abrupt("return",new Promise((function(t,e){var i=T({env:r,kountAccountId:n,kountSessionId:o});i.onload=function(){var e=new ka.ClientSDK;e.setupCallback({"collect-begin":function(e){var r=e.MercSessId;t(r)}}),e.autoLoadEvents()},i.onerror=function(){e(new Error("Error attempting to mount Kount script"))}})));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function D(t){return j.apply(this,arguments)}function j(){return j=r(u.mark((function t(e){var r,n,o,i,a,c,s,l,f,p,d,h,v,y,m,R,E,g,w,b;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.env,n=void 0===r?null:r,o=e.screen,i=e.navigator,a=e.kountAccountId,c=void 0===a?null:a,s=e.kountSessionId,l=void 0===s?null:s,f=e.getFingerprint,p=e.getFraudSessionId,h=(d=o||{}).colorDepth,v=d.height,y=d.width,R=(m=i||{}).javaEnabled,E=m.language,t.prev=3,t.next=6,f();case 6:if(g=t.sent,!c){t.next=11;break}return t.next=10,p({env:n,kountAccountId:c,kountSessionId:l});case 10:w=t.sent;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),console.error(t.t0);case 16:return b={riskMetadata:{fingerprint:g||null,extraData:{kountFraudSessionId:w||null},browserData:{colorDepth:h||null,isJavaEnabled:R?R.call(i):null,language:E||null,screenHeight:v||null,screenWidth:y||null,timeZoneOffset:(new Date).getTimezoneOffset()}}},t.abrupt("return",b);case 18:case"end":return t.stop()}}),t,null,[[3,13]])}))),j.apply(this,arguments)}function C(){return C=r(u.mark((function t(){var e,r,n,o,i,a,c,s=arguments;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(e=s.length>0&&void 0!==s[0]?s[0]:{}).env,n=void 0===r?null:r,o=e.kountAccountId,i=void 0===o?null:o,a=e.kountSessionId,c=void 0===a?null:a,t.abrupt("return",D({env:n,screen:screen,navigator:navigator,kountAccountId:i,kountSessionId:c,getFingerprint:N,getFraudSessionId:P}));case 2:case"end":return t.stop()}}),t)}))),C.apply(this,arguments)}return t.collectData=function(){return C.apply(this,arguments)},t.collectDataHelper=D,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); | ||
t.exports=r=function(){return o},t.exports.__esModule=!0,t.exports.default=t.exports;var n,o={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(n){p=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),a=new A(n||[]);return u(i,"_invoke",{value:N(t,r,a)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}o.wrap=h;var v="suspendedStart",y="suspendedYield",m="executing",R="completed",E={};function g(){}function w(){}function b(){}var _={};p(_,s,(function(){return this}));var O=Object.getPrototypeOf,I=O&&O(O(D([])));I&&I!==i&&a.call(I,s)&&(_=I);var x=b.prototype=g.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,r){function n(o,i,u,c){var s=d(t[o],t,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):r.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;u(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,o){n(t,e,r,o)}))}return o=o?o.then(i,i):i()}})}function N(t,e,r){var o=v;return function(i,a){if(o===m)throw new Error("Generator is already running");if(o===R){if("throw"===i)throw a;return{value:n,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=L(u,r);if(c){if(c===E)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===v)throw o=R,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var s=d(t,e,r);if("normal"===s.type){if(o=r.done?R:y,s.arg===E)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=R,r.method="throw",r.arg=s.arg)}}}function L(t,e){var r=e.method,o=t.iterator[r];if(o===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=n,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),E;var i=d(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,E;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,E):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,E)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(a.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=b,u(x,"constructor",{value:b,configurable:!0}),u(b,"constructor",{value:w,configurable:!0}),w.displayName=p(b,f,"GeneratorFunction"),o.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,p(t,f,"GeneratorFunction")),t.prototype=Object.create(x),t},o.awrap=function(t){return{__await:t}},S(k.prototype),p(k.prototype,l,(function(){return this})),o.AsyncIterator=k,o.async=function(t,e,r,n,i){void 0===i&&(i=Promise);var a=new k(h(t,e,r,n),i);return o.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),p(x,f,"Generator"),p(x,s,(function(){return this})),p(x,"toString",(function(){return"[object Generator]"})),o.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},o.values=D,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return u.type="throw",u.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,E):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),E},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),E}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:D(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),E}},o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),a=i(),u=a;try{regeneratorRuntime=a}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=a:Function("r","regeneratorRuntime = r")(a)}function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}var s=function(){return s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},s.apply(this,arguments)};function l(t){for(var e="",r=0;r<t.length;++r)if(r>0){var n=t[r].toLowerCase();n!==t[r]?e+=" ".concat(n):e+=t[r]}else e+=t[r].toUpperCase();return e}"function"==typeof SuppressedError&&SuppressedError;var f="Blocked by CSP",p=l("WrongRegion"),h=l("SubscriptionNotActive"),d=l("UnsupportedVersion"),v=l("InstallationMethodRestricted"),y="API key required",m="API key not found",R="API key expired",E="9319";function g(t,e){var r=[];return function(t,e){var r,n,o=(n=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}([],t,!0),{current:function(){return n[0]},postpone:function(){var t=n.shift();void 0!==t&&n.push(t)},exclude:function(){n.shift()}}),i=(100,3e3,r=0,function(){return Math.random()*Math.min(3e3,100*Math.pow(2,r++))}),a=o.current();if(void 0===a)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var u=function(t,r){return e(t).catch((function(t){if(r+1>=5)throw t;!function(t){if(!(t instanceof Error))return!1;var e=t.message;return e===f||e===E}(t)?o.postpone():o.exclude();var e,n=o.current();if(void 0===n)throw t;return(e=i(),new Promise((function(t){return setTimeout(t,e)}))).then((function(){return u(n,r+1)}))}))};return u(a,0)}(t,(function(t){var n=new Date,o=function(e){return r.push({url:t,startedAt:n,finishedAt:new Date,error:e})},i=e(t);return i.then((function(){return o()}),o),i})).then((function(t){return[t,{attempts:r}]}))}var w="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",b="Failed to load the JS script of the agent";function _(t){return function(t,e,r,n){var o,i=document,a="securitypolicyviolation",u=function(e){var r=new URL(t,location.href),n=e.blockedURI;n!==r.href&&n!==r.protocol.slice(0,-1)&&n!==r.origin||(o=e,c())};i.addEventListener(a,u);var c=function(){return i.removeEventListener(a,u)};return Promise.resolve().then(e).then((function(t){return c(),t}),(function(t){return new Promise((function(t){return setTimeout(t)})).then((function(){if(c(),o)return function(){throw new Error(f)}();throw t}))}))}(t,(function(){return function(t){return new Promise((function(e,r){var n=document.createElement("script"),o=function(){var t;return null===(t=n.parentNode)||void 0===t?void 0:t.removeChild(n)},i=document.head||document.getElementsByTagName("head")[0];n.onload=function(){o(),e()},n.onerror=function(){o(),r(new Error(b))},n.async=!0,n.src=t,i.appendChild(n)}))}(t)})).then(O)}function O(){var t=window,e="__fpjs_p_l_b",r=t[e];if(function(t,e){var r,n=null===(r=Object.getOwnPropertyDescriptor)||void 0===r?void 0:r.call(Object,t,e);(null==n?void 0:n.configurable)?delete t[e]:n&&!n.writable||(t[e]=void 0)}(t,e),"function"!=typeof(null==r?void 0:r.load))throw new Error(E);return r}function I(t){throw t instanceof Error&&t.message===E?new Error(b):t}var x={load:function(t){var e;t.scriptUrlPattern;var r=t.token,n=t.apiKey,o=void 0===n?r:n,i=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(t,["scriptUrlPattern","token","apiKey"]),a=null!==(e=function(t,e){return function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}(t,e)?t[e]:void 0}(t,"scriptUrlPattern"))&&void 0!==e?e:w;return Promise.resolve().then((function(){if(!o||"string"!=typeof o)throw new Error(y);return g(function(t,e){return(Array.isArray(t)?t:[t]).map((function(t){return function(t,e){var r=encodeURIComponent;return t.replace(/<[^<>]+>/g,(function(t){return"<version>"===t?"3":"<apiKey>"===t?r(e):"<loaderVersion>"===t?r("3.8.5"):t}))}(String(t),e)}))}(a,o),_).catch(I)})).then((function(t){var e=t[0],r=t[1];return e.load(s(s({},i),{ldi:r}))}))},defaultScriptUrlPattern:w,ERROR_SCRIPT_LOAD_FAIL:b,ERROR_API_KEY_EXPIRED:R,ERROR_API_KEY_INVALID:m,ERROR_API_KEY_MISSING:y,ERROR_BAD_REQUEST_FORMAT:"Request cannot be parsed",ERROR_BAD_RESPONSE_FORMAT:"Response cannot be parsed",ERROR_CLIENT_TIMEOUT:"Client timeout",ERROR_CSP_BLOCK:f,ERROR_FORBIDDEN_ENDPOINT:l("HostnameRestricted"),ERROR_FORBIDDEN_HEADER:"Not available with restricted header",ERROR_FORBIDDEN_ORIGIN:"Not available for this origin",ERROR_GENERAL_SERVER_FAILURE:"Request failed",ERROR_INSTALLATION_METHOD_RESTRICTED:v,ERROR_INTEGRATION_FAILURE:l("IntegrationFailed"),ERROR_INVALID_ENDPOINT:"The endpoint parameter is not a valid URL",ERROR_NETWORK_ABORT:"Network request aborted",ERROR_NETWORK_CONNECTION:"Network connection error",ERROR_RATE_LIMIT:"Too many requests, rate limit exceeded",ERROR_SERVER_TIMEOUT:"Request failed to process",ERROR_SUBSCRIPTION_NOT_ACTIVE:h,ERROR_TOKEN_EXPIRED:R,ERROR_TOKEN_INVALID:m,ERROR_TOKEN_MISSING:y,ERROR_UNSUPPORTED_VERSION:d,ERROR_WRONG_REGION:p,defaultEndpoint:{default:"endpoint"},defaultTlsEndpoint:{default:"tlsEndpoint"}};function S(){return k.apply(this,arguments)}function k(){return(k=r(u.mark((function t(){var e,r,n,o;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e="object"===("undefined"==typeof Cypress?"undefined":c(Cypress)),r="object"===("undefined"==typeof process?"undefined":c(process))&&"test"===process.env.NODE_ENV,!e&&!r){t.next=5;break}return t.abrupt("return","a-mock-visitor-id");case 5:return t.next=7,x.load({apiKey:"hpFVJecm7Ni7AjSfvBIW"});case 7:return n=t.sent,t.next=10,n.get();case 10:return o=t.sent,t.abrupt("return",o.visitorId);case 14:return t.prev=14,t.t0=t.catch(0),console.log(t.t0),t.abrupt("return","");case 18:case"end":return t.stop()}}),t,null,[[0,14]])})))).apply(this,arguments)}function N(){return L.apply(this,arguments)}function L(){return(L=r(u.mark((function t(){return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){window.requestIdleCallback?requestIdleCallback(r(u.mark((function e(){var r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:r=e.sent,t(r);case 4:case"end":return e.stop()}}),e)})))):setTimeout(r(u.mark((function e(){var r;return u.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S();case 2:r=e.sent,t(r);case 4:case"end":return e.stop()}}),e)}))),500)})));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var T=function(t){var e=t.env,r=t.kountAccountId,n=t.kountSessionId,o=function(t){return"production"===t}(e)?"https://ssl.kaptcha.com":"https://tst.kaptcha.com",i=new URL("".concat(o,"/collect/sdk"));i.searchParams.append("m",r),n&&i.searchParams.append("m",n);var a=document.createElement("script");return a.setAttribute("class","kaxsdc"),a.setAttribute("data-event","load"),a.setAttribute("type","text/javascript"),a.setAttribute("src",i.href),document.body.append(a),a};function P(t){return A.apply(this,arguments)}function A(){return(A=r(u.mark((function t(e){var r,n,o;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.env,n=e.kountAccountId,o=e.kountSessionId,t.abrupt("return",new Promise((function(t,e){var i=T({env:r,kountAccountId:n,kountSessionId:o});i.onload=function(){var e=new ka.ClientSDK;e.setupCallback({"collect-begin":function(e){var r=e.MercSessId;t(r)}}),e.autoLoadEvents()},i.onerror=function(){e(new Error("Error attempting to mount Kount script"))}})));case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function D(t){return j.apply(this,arguments)}function j(){return j=r(u.mark((function t(e){var r,n,o,i,a,c,s,l,f,p,h,d,v,y,m,R,E,g,w,b;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.env,n=void 0===r?null:r,o=e.screen,i=e.navigator,a=e.kountAccountId,c=void 0===a?null:a,s=e.kountSessionId,l=void 0===s?null:s,f=e.getFingerprint,p=e.getFraudSessionId,d=(h=o||{}).colorDepth,v=h.height,y=h.width,R=(m=i||{}).javaEnabled,E=m.language,t.prev=3,t.next=6,f();case 6:if(g=t.sent,!c){t.next=11;break}return t.next=10,p({env:n,kountAccountId:c,kountSessionId:l});case 10:w=t.sent;case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(3),console.error(t.t0);case 16:return b={riskMetadata:{fingerprint:g||null,extraData:{kountFraudSessionId:w||null},browserData:{colorDepth:d||null,isJavaEnabled:R?R.call(i):null,language:E||null,screenHeight:v||null,screenWidth:y||null,timeZoneOffset:(new Date).getTimezoneOffset()}}},t.abrupt("return",b);case 18:case"end":return t.stop()}}),t,null,[[3,13]])}))),j.apply(this,arguments)}function C(){return C=r(u.mark((function t(){var e,r,n,o,i,a,c,s=arguments;return u.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(e=s.length>0&&void 0!==s[0]?s[0]:{}).env,n=void 0===r?null:r,o=e.kountAccountId,i=void 0===o?null:o,a=e.kountSessionId,c=void 0===a?null:a,t.abrupt("return",D({env:n,screen:screen,navigator:navigator,kountAccountId:i,kountSessionId:c,getFingerprint:N,getFraudSessionId:P}));case 2:case"end":return t.stop()}}),t)}))),C.apply(this,arguments)}return t.collectData=function(){return C.apply(this,arguments)},t.collectDataHelper=D,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); | ||
//# sourceMappingURL=data-collector.min.js.map |
{ | ||
"name": "@rebilly/risk-data-collector", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"description": "Microlibrary that collects browser data for risk assessment", | ||
@@ -33,3 +33,3 @@ "type": "module", | ||
"dependencies": { | ||
"@babel/runtime": "^7.10.4", | ||
"@babel/runtime": "^7.22.15", | ||
"@fingerprintjs/fingerprintjs-pro": "^3.8.5" | ||
@@ -36,0 +36,0 @@ }, |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
115738
Updated@babel/runtime@^7.22.15