@paypal/paypal-js
Advanced tools
Comparing version 8.1.1 to 8.1.2
/*! | ||
* paypal-js v8.1.1 (2024-08-27T17:57:39.778Z) | ||
* paypal-js v8.1.2 (2024-09-16T17:52:36.940Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -207,3 +207,3 @@ * | ||
// replaced with the package.json version at build time | ||
var version = "8.1.1"; | ||
var version = "8.1.2"; | ||
@@ -210,0 +210,0 @@ exports.loadCustomScript = loadCustomScript; |
/*! | ||
* paypal-js v8.1.1 (2024-08-27T17:57:39.778Z) | ||
* paypal-js v8.1.2 (2024-09-16T17:52:36.940Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -17,2 +17,2 @@ * | ||
*/ | ||
"use strict";function t(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function e(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function r(t,r){void 0===r&&(r=Promise),o(t,r);var n=t.url,a=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==a&&"object"!=typeof a)throw new Error("Expected attributes to be an object.");return new r((function(t,r){if("undefined"==typeof document)return t();!function(t){var r=t.url,n=t.attributes,o=t.onSuccess,a=t.onError,i=e(r,n);i.onerror=a,i.onload=o,document.head.insertBefore(i,document.head.firstElementChild)}({url:n,attributes:a,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return r(t)}})}))}function n(t){return window[t]}function o(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var r=t.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}exports.loadCustomScript=r,exports.loadScript=function(a,i){if(void 0===i&&(i=Promise),o(a,i),"undefined"==typeof document)return i.resolve(null);var c=function(e){var r="sandbox"===e.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete e.environment,e.sdkBaseUrl&&(r=e.sdkBaseUrl,delete e.sdkBaseUrl);var n=e,o=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r,o=n[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===e?t.attributes[e]=o:t.queryParams[e]=o,t}),{queryParams:{},attributes:{}}),a=o.queryParams,i=o.attributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(r,"?").concat(t(a)),attributes:i}}(a),s=c.url,u=c.attributes,d=u["data-namespace"]||"paypal",l=n(d);return u["data-js-sdk-library"]||(u["data-js-sdk-library"]="paypal-js"),function(t,r){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var o=e(t,r),a=n.cloneNode();if(delete a.dataset.uidAuto,Object.keys(a.dataset).length!==Object.keys(o.dataset).length)return null;var i=!0;return Object.keys(a.dataset).forEach((function(t){a.dataset[t]!==o.dataset[t]&&(i=!1)})),i?n:null}(s,u)&&l?i.resolve(l):r({url:s,attributes:u},i).then((function(){var t=n(d);if(t)return t;throw new Error("The window.".concat(d," global variable is not available."))}))},exports.version="8.1.1"; | ||
"use strict";function t(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function e(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function r(t,r){void 0===r&&(r=Promise),o(t,r);var n=t.url,a=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==a&&"object"!=typeof a)throw new Error("Expected attributes to be an object.");return new r((function(t,r){if("undefined"==typeof document)return t();!function(t){var r=t.url,n=t.attributes,o=t.onSuccess,a=t.onError,i=e(r,n);i.onerror=a,i.onload=o,document.head.insertBefore(i,document.head.firstElementChild)}({url:n,attributes:a,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return r(t)}})}))}function n(t){return window[t]}function o(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var r=t.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}exports.loadCustomScript=r,exports.loadScript=function(a,i){if(void 0===i&&(i=Promise),o(a,i),"undefined"==typeof document)return i.resolve(null);var c=function(e){var r="sandbox"===e.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete e.environment,e.sdkBaseUrl&&(r=e.sdkBaseUrl,delete e.sdkBaseUrl);var n=e,o=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r,o=n[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===e?t.attributes[e]=o:t.queryParams[e]=o,t}),{queryParams:{},attributes:{}}),a=o.queryParams,i=o.attributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(r,"?").concat(t(a)),attributes:i}}(a),s=c.url,u=c.attributes,d=u["data-namespace"]||"paypal",l=n(d);return u["data-js-sdk-library"]||(u["data-js-sdk-library"]="paypal-js"),function(t,r){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var o=e(t,r),a=n.cloneNode();if(delete a.dataset.uidAuto,Object.keys(a.dataset).length!==Object.keys(o.dataset).length)return null;var i=!0;return Object.keys(a.dataset).forEach((function(t){a.dataset[t]!==o.dataset[t]&&(i=!1)})),i?n:null}(s,u)&&l?i.resolve(l):r({url:s,attributes:u},i).then((function(){var t=n(d);if(t)return t;throw new Error("The window.".concat(d," global variable is not available."))}))},exports.version="8.1.2"; |
/*! | ||
* paypal-js v8.1.1 (2024-08-27T17:57:39.778Z) | ||
* paypal-js v8.1.2 (2024-09-16T17:52:36.940Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -205,4 +205,4 @@ * | ||
// replaced with the package.json version at build time | ||
var version = "8.1.1"; | ||
var version = "8.1.2"; | ||
export { loadCustomScript, loadScript, version }; |
/*! | ||
* paypal-js v8.1.1 (2024-08-27T17:57:39.778Z) | ||
* paypal-js v8.1.2 (2024-09-16T17:52:36.940Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -17,2 +17,2 @@ * | ||
*/ | ||
function t(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function e(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function r(r,i){if(void 0===i&&(i=Promise),a(r,i),"undefined"==typeof document)return i.resolve(null);var u=function(e){var r="sandbox"===e.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete e.environment,e.sdkBaseUrl&&(r=e.sdkBaseUrl,delete e.sdkBaseUrl);var n=e,o=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r,o=n[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===e?t.attributes[e]=o:t.queryParams[e]=o,t}),{queryParams:{},attributes:{}}),a=o.queryParams,i=o.attributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(r,"?").concat(t(a)),attributes:i}}(r),c=u.url,s=u.attributes,d=s["data-namespace"]||"paypal",l=o(d);return s["data-js-sdk-library"]||(s["data-js-sdk-library"]="paypal-js"),function(t,r){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var o=e(t,r),a=n.cloneNode();if(delete a.dataset.uidAuto,Object.keys(a.dataset).length!==Object.keys(o.dataset).length)return null;var i=!0;return Object.keys(a.dataset).forEach((function(t){a.dataset[t]!==o.dataset[t]&&(i=!1)})),i?n:null}(c,s)&&l?i.resolve(l):n({url:c,attributes:s},i).then((function(){var t=o(d);if(t)return t;throw new Error("The window.".concat(d," global variable is not available."))}))}function n(t,r){void 0===r&&(r=Promise),a(t,r);var n=t.url,o=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==o&&"object"!=typeof o)throw new Error("Expected attributes to be an object.");return new r((function(t,r){if("undefined"==typeof document)return t();!function(t){var r=t.url,n=t.attributes,o=t.onSuccess,a=t.onError,i=e(r,n);i.onerror=a,i.onload=o,document.head.insertBefore(i,document.head.firstElementChild)}({url:n,attributes:o,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return r(t)}})}))}function o(t){return window[t]}function a(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var r=t.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}var i="8.1.1";export{n as loadCustomScript,r as loadScript,i as version}; | ||
function t(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function e(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function r(r,i){if(void 0===i&&(i=Promise),a(r,i),"undefined"==typeof document)return i.resolve(null);var u=function(e){var r="sandbox"===e.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete e.environment,e.sdkBaseUrl&&(r=e.sdkBaseUrl,delete e.sdkBaseUrl);var n=e,o=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r,o=n[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===e?t.attributes[e]=o:t.queryParams[e]=o,t}),{queryParams:{},attributes:{}}),a=o.queryParams,i=o.attributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(r,"?").concat(t(a)),attributes:i}}(r),c=u.url,s=u.attributes,d=s["data-namespace"]||"paypal",l=o(d);return s["data-js-sdk-library"]||(s["data-js-sdk-library"]="paypal-js"),function(t,r){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var o=e(t,r),a=n.cloneNode();if(delete a.dataset.uidAuto,Object.keys(a.dataset).length!==Object.keys(o.dataset).length)return null;var i=!0;return Object.keys(a.dataset).forEach((function(t){a.dataset[t]!==o.dataset[t]&&(i=!1)})),i?n:null}(c,s)&&l?i.resolve(l):n({url:c,attributes:s},i).then((function(){var t=o(d);if(t)return t;throw new Error("The window.".concat(d," global variable is not available."))}))}function n(t,r){void 0===r&&(r=Promise),a(t,r);var n=t.url,o=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==o&&"object"!=typeof o)throw new Error("Expected attributes to be an object.");return new r((function(t,r){if("undefined"==typeof document)return t();!function(t){var r=t.url,n=t.attributes,o=t.onSuccess,a=t.onError,i=e(r,n);i.onerror=a,i.onload=o,document.head.insertBefore(i,document.head.firstElementChild)}({url:n,attributes:o,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return r(t)}})}))}function o(t){return window[t]}function a(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var r=t.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}var i="8.1.2";export{n as loadCustomScript,r as loadScript,i as version}; |
/*! | ||
* paypal-js v8.1.1 (2024-08-27T17:57:39.778Z) | ||
* paypal-js v8.1.2 (2024-09-16T17:52:36.940Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -208,3 +208,3 @@ * | ||
// replaced with the package.json version at build time | ||
var version = "8.1.1"; | ||
var version = "8.1.2"; | ||
@@ -211,0 +211,0 @@ exports.loadCustomScript = loadCustomScript; |
/*! | ||
* paypal-js v8.1.1 (2024-08-27T17:57:39.778Z) | ||
* paypal-js v8.1.2 (2024-09-16T17:52:36.940Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -584,3 +584,3 @@ * | ||
// replaced with the package.json version at build time | ||
var version = "8.1.1"; | ||
var version = "8.1.2"; | ||
@@ -587,0 +587,0 @@ exports.loadCustomScript = loadCustomScript; |
/*! | ||
* paypal-js v8.1.1 (2024-08-27T17:57:39.778Z) | ||
* paypal-js v8.1.2 (2024-09-16T17:52:36.940Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -17,2 +17,2 @@ * | ||
*/ | ||
var paypalLoadScript=function(t){"use strict";function e(t,e){this.name="AggregateError",this.errors=t,this.message=e||""}e.prototype=Error.prototype;var n=setTimeout;function r(t){return Boolean(t&&void 0!==t.length)}function o(){}function i(t){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}c(e.promise,r)}else(1===t._state?c:u)(e.promise,t._value)}))):t._deferreds.push(e)}function c(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){u(t,e)}var r,o}function u(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,c(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new f(t,e,n)),n},i.prototype.finally=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))},i.all=function(t){return new i((function(e,n){if(!r(t))return n(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);var i=o.length;function a(t,r){try{if(r&&("object"==typeof r||"function"==typeof r)){var c=r.then;if("function"==typeof c)return void c.call(r,(function(e){a(t,e)}),n)}o[t]=r,0==--i&&e(o)}catch(t){n(t)}}for(var c=0;c<o.length;c++)a(c,o[c])}))},i.any=function(t){var n=this;return new n((function(r,o){if(!t||void 0===t.length)return o(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(t);if(0===i.length)return o();for(var a=[],c=0;c<i.length;c++)try{n.resolve(i[c]).then(r).catch((function(t){a.push(t),a.length===i.length&&o(new e(a,"All promises were rejected"))}))}catch(t){o(t)}}))},i.allSettled=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,n){if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(e){i(t,e)}),(function(n){r[t]={status:"rejected",reason:n},0==--o&&e(r)}))}r[t]={status:"fulfilled",value:n},0==--o&&e(r)}for(var a=0;a<r.length;a++)i(a,r[a])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){if(!r(t))return n(new TypeError("Promise.race accepts an array"));for(var o=0,a=t.length;o<a;o++)i.resolve(t[o]).then(e,n)}))},i._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var d=Object.freeze({__proto__:null,default:i});function p(t){var e="";return Object.keys(t).forEach((function(n){0!==e.length&&(e+="&"),e+=n+"="+t[n]})),e}function h(t,e){void 0===e&&(e={});var n=document.createElement("script");return n.src=t,Object.keys(e).forEach((function(t){n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])})),n}function v(t,e){if(void 0===e&&(e=Promise),w(t,e),"undefined"==typeof document)return e.resolve(null);var n=function(t){var e="sandbox"===t.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete t.environment,t.sdkBaseUrl&&(e=t.sdkBaseUrl,delete t.sdkBaseUrl);var n=t,r=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r,o=n[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===e?t.attributes[e]=o:t.queryParams[e]=o,t}),{queryParams:{},attributes:{}}),o=r.queryParams,i=r.attributes;return o["merchant-id"]&&-1!==o["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=o["merchant-id"],o["merchant-id"]="*"),{url:"".concat(e,"?").concat(p(o)),attributes:i}}(t),r=n.url,o=n.attributes,i=o["data-namespace"]||"paypal",a=m(i);return o["data-js-sdk-library"]||(o["data-js-sdk-library"]="paypal-js"),function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var r=h(t,e),o=n.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(r.dataset).length)return null;var i=!0;return Object.keys(o.dataset).forEach((function(t){o.dataset[t]!==r.dataset[t]&&(i=!1)})),i?n:null}(r,o)&&a?e.resolve(a):y({url:r,attributes:o},e).then((function(){var t=m(i);if(t)return t;throw new Error("The window.".concat(i," global variable is not available."))}))}function y(t,e){void 0===e&&(e=Promise),w(t,e);var n=t.url,r=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.url,n=t.attributes,r=t.onSuccess,o=t.onError,i=h(e,n);i.onerror=o,i.onload=r,document.head.insertBefore(i,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(t)}})}))}function m(t){return window[t]}function w(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var n=t.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}return t.loadCustomScript=function(t){return y(t,d)},t.loadScript=function(t){return v(t,d)},t.version="8.1.1",t}({});window.paypalLoadCustomScript=paypalLoadScript.loadCustomScript,window.paypalLoadScript=paypalLoadScript.loadScript; | ||
var paypalLoadScript=function(t){"use strict";function e(t,e){this.name="AggregateError",this.errors=t,this.message=e||""}e.prototype=Error.prototype;var n=setTimeout;function r(t){return Boolean(t&&void 0!==t.length)}function o(){}function i(t){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function a(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,i._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void u(e.promise,t)}c(e.promise,r)}else(1===t._state?c:u)(e.promise,t._value)}))):t._deferreds.push(e)}function c(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){u(t,e)}var r,o}function u(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&i._immediateFn((function(){t._handled||i._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)a(t,t._deferreds[e]);t._deferreds=null}function f(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,c(e,t))}),(function(t){n||(n=!0,u(e,t))}))}catch(t){if(n)return;n=!0,u(e,t)}}i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var n=new this.constructor(o);return a(this,new f(t,e,n)),n},i.prototype.finally=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))},i.all=function(t){return new i((function(e,n){if(!r(t))return n(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return e([]);var i=o.length;function a(t,r){try{if(r&&("object"==typeof r||"function"==typeof r)){var c=r.then;if("function"==typeof c)return void c.call(r,(function(e){a(t,e)}),n)}o[t]=r,0==--i&&e(o)}catch(t){n(t)}}for(var c=0;c<o.length;c++)a(c,o[c])}))},i.any=function(t){var n=this;return new n((function(r,o){if(!t||void 0===t.length)return o(new TypeError("Promise.any accepts an array"));var i=Array.prototype.slice.call(t);if(0===i.length)return o();for(var a=[],c=0;c<i.length;c++)try{n.resolve(i[c]).then(r).catch((function(t){a.push(t),a.length===i.length&&o(new e(a,"All promises were rejected"))}))}catch(t){o(t)}}))},i.allSettled=function(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,n){if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(e){i(t,e)}),(function(n){r[t]={status:"rejected",reason:n},0==--o&&e(r)}))}r[t]={status:"fulfilled",value:n},0==--o&&e(r)}for(var a=0;a<r.length;a++)i(a,r[a])}))},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){if(!r(t))return n(new TypeError("Promise.race accepts an array"));for(var o=0,a=t.length;o<a;o++)i.resolve(t[o]).then(e,n)}))},i._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){n(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var d=Object.freeze({__proto__:null,default:i});function p(t){var e="";return Object.keys(t).forEach((function(n){0!==e.length&&(e+="&"),e+=n+"="+t[n]})),e}function h(t,e){void 0===e&&(e={});var n=document.createElement("script");return n.src=t,Object.keys(e).forEach((function(t){n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])})),n}function v(t,e){if(void 0===e&&(e=Promise),w(t,e),"undefined"==typeof document)return e.resolve(null);var n=function(t){var e="sandbox"===t.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete t.environment,t.sdkBaseUrl&&(e=t.sdkBaseUrl,delete t.sdkBaseUrl);var n=t,r=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r,o=n[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===e?t.attributes[e]=o:t.queryParams[e]=o,t}),{queryParams:{},attributes:{}}),o=r.queryParams,i=r.attributes;return o["merchant-id"]&&-1!==o["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=o["merchant-id"],o["merchant-id"]="*"),{url:"".concat(e,"?").concat(p(o)),attributes:i}}(t),r=n.url,o=n.attributes,i=o["data-namespace"]||"paypal",a=m(i);return o["data-js-sdk-library"]||(o["data-js-sdk-library"]="paypal-js"),function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var r=h(t,e),o=n.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(r.dataset).length)return null;var i=!0;return Object.keys(o.dataset).forEach((function(t){o.dataset[t]!==r.dataset[t]&&(i=!1)})),i?n:null}(r,o)&&a?e.resolve(a):y({url:r,attributes:o},e).then((function(){var t=m(i);if(t)return t;throw new Error("The window.".concat(i," global variable is not available."))}))}function y(t,e){void 0===e&&(e=Promise),w(t,e);var n=t.url,r=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.url,n=t.attributes,r=t.onSuccess,o=t.onError,i=h(e,n);i.onerror=o,i.onload=r,document.head.insertBefore(i,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(t)}})}))}function m(t){return window[t]}function w(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var n=t.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}return t.loadCustomScript=function(t){return y(t,d)},t.loadScript=function(t){return v(t,d)},t.version="8.1.2",t}({});window.paypalLoadCustomScript=paypalLoadScript.loadCustomScript,window.paypalLoadScript=paypalLoadScript.loadScript; |
/*! | ||
* paypal-js v8.1.1 (2024-08-27T17:57:39.778Z) | ||
* paypal-js v8.1.2 (2024-09-16T17:52:36.940Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -17,2 +17,2 @@ * | ||
*/ | ||
var paypalLoadScript=function(t){"use strict";function e(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function r(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function n(t,e){void 0===e&&(e=Promise),a(t,e);var n=t.url,o=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==o&&"object"!=typeof o)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.url,n=t.attributes,o=t.onSuccess,a=t.onError,i=r(e,n);i.onerror=a,i.onload=o,document.head.insertBefore(i,document.head.firstElementChild)}({url:n,attributes:o,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(t)}})}))}function o(t){return window[t]}function a(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var r=t.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}return t.loadCustomScript=n,t.loadScript=function(t,i){if(void 0===i&&(i=Promise),a(t,i),"undefined"==typeof document)return i.resolve(null);var c=function(t){var r="sandbox"===t.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete t.environment,t.sdkBaseUrl&&(r=t.sdkBaseUrl,delete t.sdkBaseUrl);var n=t,o=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r,o=n[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===e?t.attributes[e]=o:t.queryParams[e]=o,t}),{queryParams:{},attributes:{}}),a=o.queryParams,i=o.attributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(r,"?").concat(e(a)),attributes:i}}(t),u=c.url,s=c.attributes,d=s["data-namespace"]||"paypal",l=o(d);return s["data-js-sdk-library"]||(s["data-js-sdk-library"]="paypal-js"),function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var o=r(t,e),a=n.cloneNode();if(delete a.dataset.uidAuto,Object.keys(a.dataset).length!==Object.keys(o.dataset).length)return null;var i=!0;return Object.keys(a.dataset).forEach((function(t){a.dataset[t]!==o.dataset[t]&&(i=!1)})),i?n:null}(u,s)&&l?i.resolve(l):n({url:u,attributes:s},i).then((function(){var t=o(d);if(t)return t;throw new Error("The window.".concat(d," global variable is not available."))}))},t.version="8.1.1",t}({});window.paypalLoadCustomScript=paypalLoadScript.loadCustomScript,window.paypalLoadScript=paypalLoadScript.loadScript; | ||
var paypalLoadScript=function(t){"use strict";function e(t){var e="";return Object.keys(t).forEach((function(r){0!==e.length&&(e+="&"),e+=r+"="+t[r]})),e}function r(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach((function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function n(t,e){void 0===e&&(e=Promise),a(t,e);var n=t.url,o=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==o&&"object"!=typeof o)throw new Error("Expected attributes to be an object.");return new e((function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.url,n=t.attributes,o=t.onSuccess,a=t.onError,i=r(e,n);i.onerror=a,i.onload=o,document.head.insertBefore(i,document.head.firstElementChild)}({url:n,attributes:o,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(t)}})}))}function o(t){return window[t]}function a(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var r=t.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}return t.loadCustomScript=n,t.loadScript=function(t,i){if(void 0===i&&(i=Promise),a(t,i),"undefined"==typeof document)return i.resolve(null);var c=function(t){var r="sandbox"===t.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete t.environment,t.sdkBaseUrl&&(r=t.sdkBaseUrl,delete t.sdkBaseUrl);var n=t,o=Object.keys(n).filter((function(t){return void 0!==n[t]&&null!==n[t]&&""!==n[t]})).reduce((function(t,e){var r,o=n[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)||"crossorigin"===e?t.attributes[e]=o:t.queryParams[e]=o,t}),{queryParams:{},attributes:{}}),a=o.queryParams,i=o.attributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(r,"?").concat(e(a)),attributes:i}}(t),u=c.url,s=c.attributes,d=s["data-namespace"]||"paypal",l=o(d);return s["data-js-sdk-library"]||(s["data-js-sdk-library"]="paypal-js"),function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var o=r(t,e),a=n.cloneNode();if(delete a.dataset.uidAuto,Object.keys(a.dataset).length!==Object.keys(o.dataset).length)return null;var i=!0;return Object.keys(a.dataset).forEach((function(t){a.dataset[t]!==o.dataset[t]&&(i=!1)})),i?n:null}(u,s)&&l?i.resolve(l):n({url:u,attributes:s},i).then((function(){var t=o(d);if(t)return t;throw new Error("The window.".concat(d," global variable is not available."))}))},t.version="8.1.2",t}({});window.paypalLoadCustomScript=paypalLoadScript.loadCustomScript,window.paypalLoadScript=paypalLoadScript.loadScript; |
{ | ||
"name": "@paypal/paypal-js", | ||
"version": "8.1.1", | ||
"version": "8.1.2", | ||
"description": "Loading wrapper and TypeScript types for the PayPal JS SDK", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -276,3 +276,3 @@ import type { | ||
export type PayPalButtonMessage = { | ||
amount?: number; | ||
amount?: number | string; | ||
align?: "center" | "left" | "right"; | ||
@@ -279,0 +279,0 @@ color?: "black" | "white"; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
642444