Your IP : 216.73.216.95


Current Path : /var/www/ooareogundevinitiative/wp-content/plugins/give/assets/dist/js/
Upload File :
Current File : /var/www/ooareogundevinitiative/wp-content/plugins/give/assets/dist/js/paypal-commerce.js

!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=852)}({10:function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},11:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},15:function(e,t,r){var n=r(87);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},20:function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},21:function(e,t,r){e.exports=r(86)},23:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},30:function(e,t,r){var n=r(11),o=r(23);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t}},36:function(e,t){function r(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function s(e){r(a,o,i,s,c,"next",e)}function c(e){r(a,o,i,s,c,"throw",e)}s(void 0)}))}}},42:function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},490:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return v}));var n=setTimeout;function o(e){return Boolean(e&&void 0!==e.length)}function i(){}function a(e){if(!(this instanceof a))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function s(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,a._immediateFn((function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var n;try{n=r(e._value)}catch(e){return void u(t.promise,e)}c(t.promise,n)}else(1===e._state?c:u)(t.promise,e._value)}))):e._deferreds.push(t)}function c(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var r=t.then;if(t instanceof a)return e._state=3,e._value=t,void l(e);if("function"==typeof r)return void f((n=r,o=t,function(){n.apply(o,arguments)}),e)}e._state=1,e._value=t,l(e)}catch(t){u(e,t)}var n,o}function u(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&a._immediateFn((function(){e._handled||a._unhandledRejectionFn(e._value)}));for(var t=0,r=e._deferreds.length;t<r;t++)s(e,e._deferreds[t]);e._deferreds=null}function d(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function f(e,t){var r=!1;try{e((function(e){r||(r=!0,c(t,e))}),(function(e){r||(r=!0,u(t,e))}))}catch(e){if(r)return;r=!0,u(t,e)}}function h(e){var t="";return p(e,(function(r){0!==t.length&&(t+="&"),t+=r+"="+e[r]})),t}function p(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r)}a.prototype.catch=function(e){return this.then(null,e)},a.prototype.then=function(e,t){var r=new this.constructor(i);return s(this,new d(e,t,r)),r},a.prototype.finally=
/*!
 * paypal-js v1.0.1 (2020-09-11T20:27:05.885Z)
 * Copyright 2020-present, PayPal, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
function(e){var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){return t.reject(r)}))}))},a.all=function(e){return new a((function(t,r){if(!o(e))return r(new TypeError("Promise.all accepts an array"));var n=Array.prototype.slice.call(e);if(0===n.length)return t([]);var i=n.length;function a(e,o){try{if(o&&("object"==typeof o||"function"==typeof o)){var s=o.then;if("function"==typeof s)return void s.call(o,(function(t){a(e,t)}),r)}n[e]=o,0==--i&&t(n)}catch(e){r(e)}}for(var s=0;s<n.length;s++)a(s,n[s])}))},a.resolve=function(e){return e&&"object"==typeof e&&e.constructor===a?e:new a((function(t){t(e)}))},a.reject=function(e){return new a((function(t,r){r(e)}))},a.race=function(e){return new a((function(t,r){if(!o(e))return r(new TypeError("Promise.race accepts an array"));for(var n=0,i=e.length;n<i;n++)a.resolve(e[n]).then(t,r)}))},a._immediateFn="function"==typeof e&&function(t){e(t)}||function(e){n(e,0)},a._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var y,m=!1;function v(e){return m?y:y=new a((function(t,r){if("undefined"==typeof window)return t(null);var n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={queryParams:{},dataAttributes:{}};p(e,(function(r){"data-"===r.substring(0,5)?t.dataAttributes[r]=e[r]:t.queryParams[r]=e[r]}));var r=t.queryParams,n=t.dataAttributes;return{queryString:h(r),dataAttributes:n}}(e),o=n.queryString,i=n.dataAttributes,a="".concat("https://www.paypal.com/sdk/js","?").concat(o);if(function(e){return document.querySelector('script[src="'.concat(e,'"]'))}(a)&&window.paypal)return t(window.paypal);m=!0,function(e){var t=e.url,r=e.dataAttributes,n=void 0===r?{}:r,o=e.onSuccess,i=e.onError,a=document.createElement("script");a.onerror=i,a.onload=o,p(n,(function(e){a.setAttribute(e,n[e])})),a.src=t,document.head.insertBefore(a,document.head.firstElementChild)}({url:a,dataAttributes:i,onSuccess:function(){return m=!1,window.paypal?t(window.paypal):r(new Error("The window.paypal global variable is not available."))},onError:function(){return m=!1,r(new Error('The script "'.concat(a,"\" didn't load correctly.")))}})}))}}).call(this,r(853).setImmediate)},6:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},77:function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c,u=[],l=!1,d=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):d=-1,u.length&&h())}function h(){if(!l){var e=s(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},8:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},852:function(e,t,r){r(885),e.exports=r(855)},853:function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(854),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(42))},854:function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,o,i,a,s,c=1,u={},l=!1,d=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,n=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return u[c]=o,n(c),c++},f.clearImmediate=h}function h(e){delete u[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(42),r(77))},855:function(e,t,r){},86:function(e,t,r){var n=function(e){"use strict";var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r,n){var o=t&&t.prototype instanceof l?t:l,i=Object.create(o.prototype),a=new P(n||[]);return i._invoke=function(e,t,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 _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=b(a,r);if(s){if(s===u)continue;return s}}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 l=c(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}(e,r,a),i}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var u={};function l(){}function d(){}function f(){}var h={};h[o]=function(){return this};var p=Object.getPrototypeOf,y=p&&p(p(C([])));y&&y!==t&&r.call(y,o)&&(h=y);var m=f.prototype=l.prototype=Object.create(h);function v(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function g(e,t){var n;this._invoke=function(o,i){function a(){return new t((function(n,a){!function n(o,i,a,s){var u=c(e[o],e,i);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}(o,i,n,a)}))}return n=n?n.then(a,a):a()}}function b(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,b(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,u;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=m.constructor=f,f.constructor=d,f[a]=d.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},v(g.prototype),g.prototype[i]=function(){return this},e.AsyncIterator=g,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new g(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(m),m[a]="Generator",m[o]=function(){return this},m.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=C,P.prototype={constructor:P,reset:function(e){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(F),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),F(r),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},87:function(e,t){function r(t,n){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(t,n)}e.exports=r},885:function(e,t,r){"use strict";r.r(t);var n=r(6),o=r.n(n),i=r(8),a=r.n(i),s=r(10),c=r.n(s),u=r(21),l=r.n(u),d=r(36),f=r.n(d),h=r(15),p=r.n(h),y=r(30),m=r.n(y),v=r(20),g=r.n(v),b=function(){function e(t){a()(this,e),this.form=t,this.jQueryForm=jQuery(t),this.ajaxurl=Give.fn.getGlobalVar("ajaxurl"),this.setupProperties()}var t;return c()(e,[{key:"setupProperties",value:function(){}},{key:"boot",value:function(){this.renderPaymentMethodOption()}},{key:"renderPaymentMethodOption",value:function(){}},{key:"showError",value:function(e){e.hasOwnProperty("details")?S.addErrors(this.jQueryForm,Give.form.fn.getErrorHTML([{message:e.details[0].description}])):S.addErrors(this.jQueryForm,e)}},{key:"isInTestMode",value:function(){return"1"===Give.fn.getGlobalVar("is_test_mode")}},{key:"displayErrorMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Give.form.fn.getErrorHTML([{message:window.givePayPalCommerce.genericDonorErrorMessage}]);(t||this.isInTestMode())&&(r=e),this.showError(r)}},{key:"isProcessingEventForForm",value:function(e){return e===this.form.getAttribute("id")&&S.isPayPalCommerceSelected(this.jQueryForm)}},{key:"createOrderHandler",value:(t=f()(l.a.mark((function e(t,r){var n,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.removeErrors(this.jQueryForm),e.next=3,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_create_order"),{method:"POST",body:S.getFormDataWithoutGiveActionField(this.form)});case 3:return n=e.sent,e.next=6,n.json();case 6:if((o=e.sent).success){e.next=9;break}throw o.data.error;case 9:return e.abrupt("return",o.data.id);case 10:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=g()(e);if(t){var o=g()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m()(this,r)}}var F=function(e){p()(r,e);var t=w(r);function r(){return a()(this,r),t.apply(this,arguments)}return c()(r,[{key:"setupProperties",value:function(){this.ccFieldsContainer=this.form.querySelector('[id^="give_cc_fields-"]'),this.cardFields=this.getCardFields(),this.recurringChoiceHiddenField=this.form.querySelector('input[name="_give_is_donation_recurring"]'),(this.separator=this.ccFieldsContainer.querySelector(".separator-with-text"))||(this.separator=this.cardFields.number.el?this.cardFields.number.el.parentElement.insertAdjacentElement("beforebegin",this.separatorHtml()):null)}},{key:"renderPaymentMethodOption",value:function(){this.toggleFields()}},{key:"getCardFields",value:function(){return{number:{el:this.form.querySelector('input[name="card_number"]')},cvv:{el:this.form.querySelector('input[name="card_cvc"]')},expirationDate:{el:this.form.querySelector('input[name="card_expiry"]')}}}},{key:"toggleFields",value:function(){var e=r.canShow(this.form)?"block":"none";for(var t in this.cardFields)this.cardFields[t].el.style.display=e,this.cardFields[t].el.disabled="none"===e}},{key:"removeFields",value:function(){for(var e in this.cardFields)this.cardFields[e].el&&this.cardFields[e].el.parentElement.remove();var t=this.form.querySelector('input[name="card_name"]');t&&t.parentElement.remove(),this.separator&&this.separator.remove()}},{key:"separatorHtml",value:function(){var e=document.createElement("div");return e.setAttribute("class","separator-with-text"),e.innerHTML='<div class="dashed-line"></div><div class="label">'.concat(givePayPalCommerce.separatorLabel,'</div><div class="dashed-line"></div>'),e}}],[{key:"canShow",value:function(e){return x.canShow()&&S.isRecurringDonation(e)&&["US","AU"].includes(window.givePayPalCommerce.accountCountry)}}]),r}(b);function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function C(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=g()(e);if(t){var o=g()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m()(this,r)}}var x=function(e){p()(u,e);var t,r,n,i,s=_(u);function u(e){var t;return a()(this,u),(t=s.call(this,e.form)).customCardFields=e,t.setFocusStyle(),t}return c()(u,[{key:"setupProperties",value:function(){this.cardFields={},this.hostedCardFieldsContainers={},this.hostedFieldContainerStyleProperties=["background-color","box-sizing","box-shadow","border","border-radius","margin","height"],this.hostedInputFieldStyleProperties=["color","direction","font-size","letter-spacing","line-height","padding"],this.hostedFocusedInputFieldStyleProperties=["color","border"],this.hostedInputFieldPlaceholderStyleProperties=["color"],this.styles={container:{},input:{},"input:focus":{},"input:placeholder":{}}}},{key:"renderPaymentMethodOption",value:(i=f()(l.a.mark((function e(){var t,r,n,o,i,a,s=this;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setupContainerForHostedCardFields(),this.applyStyleToContainer(),t="submit.".concat(this.form.getAttribute("id")),r=this.createOrderHandler.bind(this),e.next=6,this.getComputedInputFieldForHostedField();case 6:return n=e.sent,o=this.getPayPalHostedCardFields(),e.next=10,paypal.HostedFields.render({createOrder:r,styles:n,fields:o}).catch((function(e){s.displayErrorMessage(e)}));case 10:i=e.sent,a=this.onSubmitHandlerForDonationForm.bind(this),this.addEventToHostedFields(i),this.jQueryForm.off(t).on(t,{hostedCardFields:i},a);case 14:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"applyStyleToContainer",value:function(){this.setStyles(),this.addInitialStyleToHostedFieldsContainer(),this.setHostedFieldContainerHeight(),window.addEventListener("load",this.setHostedFieldContainerHeight.bind(this))}},{key:"setupContainerForHostedCardFields",value:function(){var e=this.customCardFields.cardFields,t="";for(var r in e){var n=document.createElement("div");t=e[r].el.getAttribute("name");var o="give-".concat(e[r].el.getAttribute("id")),i=void 0;(i=this.form.querySelector("#".concat(o)))?(i.innerHTML="",this.hostedCardFieldsContainers[this.getFieldTypeByFieldName(t)]=i):(n.setAttribute("id",o),n.setAttribute("class","give-paypal-commerce-cc-field"),this.hostedCardFieldsContainers[this.getFieldTypeByFieldName(t)]=e[r].el.parentElement.appendChild(n))}this.toggleFields()}},{key:"getPayPalHostedCardFields",value:function(){return{number:{selector:"#".concat(this.hostedCardFieldsContainers.number.getAttribute("id")),placeholder:givePayPalCommerce.cardFieldPlaceholders.cardNumber},cvv:{selector:"#".concat(this.hostedCardFieldsContainers.cvv.getAttribute("id")),placeholder:givePayPalCommerce.cardFieldPlaceholders.cardCvc},expirationDate:{selector:"#".concat(this.hostedCardFieldsContainers.expirationDate.getAttribute("id")),placeholder:givePayPalCommerce.cardFieldPlaceholders.expirationDate}}}},{key:"approvePayment",value:(n=f()(l.a.mark((function e(t){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_approve_order&order=")+t,{method:"POST",body:S.getFormDataWithoutGiveActionField(this.form)});case 2:return r=e.sent,e.next=5,r.json();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"getComputedInputFieldForHostedField",value:function(){return{input:C(C({},this.styles.input),givePayPalCommerce.hostedCardFieldStyles.input),":focus":C({color:this.styles["input:focus"].color},givePayPalCommerce.hostedCardFieldStyles[":focus"]),":placeholder":C({color:this.styles["input:placeholder"].color},givePayPalCommerce.hostedCardFieldStyles[":placeholder"])}}},{key:"onSubmitHandlerForDonationForm",value:(r=f()(l.a.mark((function e(t){var r,n,o,i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(S.isPayPalCommerceSelected(this.jQueryForm)){e.next=2;break}return e.abrupt("return",!0);case 2:if(!S.isRecurringDonation(this.form)){e.next=6;break}return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),this.submitDonationForm(),e.abrupt("return");case 6:return r=this.hostedFieldOnSubmitErrorHandler.bind(this),t.preventDefault(),Give.form.fn.removeErrors(this.jQueryForm),n=t.data.hostedCardFields,o=this.getExtraCardDetails.bind(this),e.next=13,n.submit(C({contingencies:["3D_SECURE"]},o)).catch(r);case 13:if(i=e.sent){e.next=16;break}return e.abrupt("return",!1);case 16:if(!this.canThreeDsAuthorizeCard(i)||this.IsCardThreeDsAuthorized(i)){e.next=19;break}return Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML([{message:givePayPalCommerce.threeDsCardAuthenticationFailedNotice}])),e.abrupt("return",!1);case 19:return e.next=21,this.onApproveHandler(i);case 21:return e.abrupt("return",!1);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"onApproveHandler",value:(t=f()(l.a.mark((function e(t){var r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),e.next=3,this.approvePayment(t.orderId);case 3:if((r=e.sent).success){e.next=10;break}if(Give.form.fn.hideProcessingState(),null!==r.data.error){e.next=9;break}return Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML([{message:givePayPalCommerce.defaultDonationCreationError}])),e.abrupt("return");case 9:Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML([{message:r.data.error.details[0].description}]));case 10:return e.next=12,S.addFieldToForm(this.form,r.data.order.id,"payPalOrderId");case 12:this.submitDonationForm();case 13:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"getExtraCardDetails",value:function(){return{cardholderName:this.form.getElementById("#card_name").value}}},{key:"addInitialStyleToHostedFieldsContainer",value:function(){var e=this,t=function(t){e.hostedFieldContainerStyleProperties.forEach((function(r){"height"===r&&["auto","0px"].includes(e.styles.container[r])||e.hostedCardFieldsContainers[t].style.setProperty(r,e.styles.container[r])}))};for(var r in this.hostedCardFieldsContainers)t(r)}},{key:"addEventToHostedFields",value:function(e){var t=this;e.on("focus",(function(e){t.hostedCardFieldsContainers[e.emittedBy].style.border=t.styles["input:focus"].border})),e.on("blur",(function(e){t.hostedCardFieldsContainers[e.emittedBy].style.border=t.styles.container.border}))}},{key:"setStyles",value:function(){this.computedStyles();var e=new Event("blur");this.form.querySelector('input[name="card_name"]').dispatchEvent(e)}},{key:"computedStyles",value:function(){var e=this,t=this.form.querySelector('input[name="card_name"]'),r=window.getComputedStyle(t,null);Array.from(this.styles.container).length||(this.hostedFieldContainerStyleProperties.forEach((function(t){e.styles.container=C(o()({},t,r.getPropertyValue(t)),e.styles.container)})),this.hostedInputFieldStyleProperties.forEach((function(t){e.styles.input=C(o()({},t,r.getPropertyValue(t)),e.styles.input)})),this.hostedInputFieldPlaceholderStyleProperties.forEach((function(t){e.styles["input:placeholder"]=C(o()({},t,r.getPropertyValue(t)),e.styles["input:placeholder"])})))}},{key:"setFocusStyle",value:function(){var e=this;this.form.querySelectorAll('input[type="text"]').forEach((function(t){t.addEventListener("focus",(function(t){if(!Array.from(e.styles["input:focus"]).length){var r=window.getComputedStyle(t.target,null);e.hostedFocusedInputFieldStyleProperties.forEach((function(t){e.styles["input:focus"]=C(o()({},t,r.getPropertyValue(t)),e.styles["input:focus"])}))}}),{once:!0})}))}},{key:"setHostedFieldContainerHeight",value:function(){if(this.styles.container.height="".concat(this.form.querySelector('input[name="card_name"]').offsetHeight,"px"),!["auto","0px"].includes(this.styles.container.height))for(var e in this.hostedCardFieldsContainers)this.hostedCardFieldsContainers[e].style.setProperty("height",this.styles.container.height)}},{key:"canThreeDsAuthorizeCard",value:function(e){return["NO","POSSIBLE"].includes(e.liabilityShift)}},{key:"IsCardThreeDsAuthorized",value:function(e){return e.liabilityShifted&&"POSSIBLE"===e.liabilityShift}},{key:"hostedFieldOnSubmitErrorHandler",value:function(e){var t={},r=[];if(!Object.values(e).length)throw Give.form.fn.resetDonationButton(this.jQueryForm),window.givePayPalCommerce.genericDonorErrorMessage;for(var n in e.details.forEach((function(e){if(e.hasOwnProperty("field")){if(!t.hasOwnProperty("".concat(e.field))){var n="";if(-1!==e.field.indexOf("expiry"))n=givePayPalCommerce.paypalCardInfoErrorPrefixes.expirationDateField;else if(-1!==e.field.indexOf("number"))n=givePayPalCommerce.paypalCardInfoErrorPrefixes.cardNumberField;else{if(-1===e.field.indexOf("security_code"))return e.hasOwnProperty("description")?void r.push({message:e.description}):void r.push({message:"".concat(givePayPalCommerce.genericDonorErrorMessage," ").concat(givePayPalCommerce.errorCodeLabel,": ").concat(e.issue)});n=givePayPalCommerce.paypalCardInfoErrorPrefixes.cardCvcField}t["".concat(e.field)]=n?["<strong>".concat(n,"</strong>")]:[]}t["".concat(e.field)].push("".concat(e.description,"."))}else r.push({message:e.description})})),t)r.push({message:t[n].join(" ")});Give.form.fn.addErrorsAndResetDonationButton(this.jQueryForm,Give.form.fn.getErrorHTML(r))}},{key:"submitDonationForm",value:function(){this.jQueryForm.off("submit"),this.jQueryForm.submit()}},{key:"toggleFields",value:function(){var e=S.isRecurringDonation(this.form)?"none":"block",t="none"===e&&!F.canShow(this.form);for(var r in this.toggleCardNameField(t),this.hostedCardFieldsContainers)this.hostedCardFieldsContainers[r].style.display=e,this.hostedCardFieldsContainers[r].parentElement.style.display=t?"none":"block";this.customCardFields.separator.style.display=t?"none":"flex"}},{key:"toggleCardNameField",value:function(e){var t=this.form.querySelector('input[name="card_name"]');t.parentElement.style.display=e?"none":"block",t.disabled=e}},{key:"getFieldTypeByFieldName",value:function(e){return"card_number"===e?"number":"card_cvc"===e?"cvv":"card_expiry"===e?"expirationDate":void 0}}],[{key:"canShow",value:function(){return!0===paypal.HostedFields.isEligible()&&!!window.givePayPalCommerce.supportsCustomPayments}}]),u}(b),S=function(){function e(){a()(this,e)}return c()(e,null,[{key:"getFormDataWithoutGiveActionField",value:function(e){var t=new FormData(e);return t.delete("give_action"),t}},{key:"addFieldToForm",value:function(e,t,r){var n=document.createElement("input");return n.type="hidden",n.name=r,n.value=t,new Promise((function(t,r){t(e.appendChild(n))}))}},{key:"isPayPalCommerceSelected",value:function(e){return"paypal-commerce"===Give.form.fn.getGateway(e)}},{key:"addErrors",value:function(e,t){e.find("#give-paypal-commerce-smart-buttons-wrap").before(t)}},{key:"isRecurringDonation",value:function(e){var t=e.querySelector('input[name="_give_is_donation_recurring"]');return t&&"1"===t.value}},{key:"trackRecurringHiddenFieldChange",value:function(t,r){new window.MutationObserver((function(t){t[0].oldValue!==t[0].target.value&&e.isPayPalCommerceSelected(jQuery(t[0].target).closest(".give-form"))&&r.call()})).observe(t,{attributeFilter:["value"],attributeOldValue:!0})}},{key:"trackDonationCurrencyChange",value:function(t,r){new window.MutationObserver((function(t){t[0].oldValue!==t[0].target.getAttribute("data-currency_code")&&e.isPayPalCommerceSelected(jQuery(t[0].target))&&r.call()})).observe(t,{attributeFilter:["data-currency_code"],attributeOldValue:!0})}},{key:"toggleDonateNowButton",value:function(t){var r="";(!x.canShow()||e.isRecurringDonation(t)&&!F.canShow(t))&&(r="none"),t.querySelector('input[name="give-purchase"]').style.display=r}}]),e}();function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=g()(e);if(t){var o=g()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m()(this,r)}}var k=function(e){p()(s,e);var t,r,n,o,i=E(s);function s(){return a()(this,s),i.apply(this,arguments)}return c()(s,[{key:"setupProperties",value:function(){this.ccFieldsContainer=this.form.querySelector('[id^="give_cc_fields-"]'),this.recurringChoiceHiddenField=this.form.querySelector('input[name="_give_is_donation_recurring"]'),this.smartButton=null}},{key:"getButtonContainer",value:function(){this.ccFieldsContainer=this.form.querySelector('[id^="give_cc_fields-"]');var e=this.ccFieldsContainer.querySelector("#give-paypal-commerce-smart-buttons-wrap");if(e)return e;var t=document.createElement("div"),r=this.ccFieldsContainer.querySelector(".separator-with-text");t.setAttribute("id","give-paypal-commerce-smart-buttons-wrap");var n=this.ccFieldsContainer.querySelector("[id^=give-card-number-wrap-]");return this.ccFieldsContainer.insertBefore(t,r||n)}},{key:"renderPaymentMethodOption",value:function(){var e=this;this.smartButtonContainer=this.getButtonContainer(),this.smartButton&&this.smartButton.close();var t={onInit:this.onInitHandler.bind(this),onClick:this.onClickHandler.bind(this),createOrder:this.createOrderHandler.bind(this),onApprove:this.orderApproveHandler.bind(this),style:{layout:"vertical",size:"responsive",shape:"rect",label:"paypal",color:"gold",tagline:!1},onError:function(t){e.displayErrorMessage(t)}};return S.isRecurringDonation(this.form)&&(t.createSubscription=this.creatSubscriptionHandler.bind(this),t.onApprove=this.subscriptionApproveHandler.bind(this),delete t.createOrder),S.toggleDonateNowButton(this.form),this.smartButton=paypal.Buttons(t),this.smartButton.render(this.smartButtonContainer)}},{key:"onInitHandler",value:function(e,t){}},{key:"onClickHandler",value:(o=f()(l.a.mark((function e(t,r){var n,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new FormData(this.form),x.canShow()&&(n.delete("card_name"),n.delete("card_cvc"),n.delete("card_number"),n.delete("card_expiry")),Give.form.fn.removeErrors(this.jQueryForm),e.next=5,Give.form.fn.isDonorFilledValidData(this.form,n);case 5:if("success"!==(o=e.sent)){e.next=8;break}return e.abrupt("return",r.resolve());case 8:return Give.form.fn.addErrors(this.jQueryForm,o),e.abrupt("return",r.reject());case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"creatSubscriptionHandler",value:(n=f()(l.a.mark((function e(t,r){var n,o;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.removeErrors(this.jQueryForm),e.next=3,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_create_plan_id"),{method:"POST",body:S.getFormDataWithoutGiveActionField(this.form)});case 3:return n=e.sent,e.next=6,n.json();case 6:if((o=e.sent).success){e.next=9;break}throw o.data.error;case 9:return e.abrupt("return",r.subscription.create({plan_id:o.data.id}));case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"subscriptionApproveHandler",value:(r=f()(l.a.mark((function e(t,r){return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),e.next=3,S.addFieldToForm(this.form,t.subscriptionID,"payPalSubscriptionId");case 3:this.submitDonationForm();case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"orderApproveHandler",value:(t=f()(l.a.mark((function e(t,r){var n,o,i,a;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Give.form.fn.showProcessingState(window.givePayPalCommerce.textForOverlayScreen),Give.form.fn.disable(this.jQueryForm,!0),Give.form.fn.removeErrors(this.jQueryForm),e.next=5,fetch("".concat(this.ajaxurl,"?action=give_paypal_commerce_approve_order&order=")+t.orderID,{method:"post",body:S.getFormDataWithoutGiveActionField(this.form)});case 5:return n=e.sent,e.next=8,n.json();case 8:if((o=e.sent).success){e.next=18;break}if(Give.form.fn.disable(this.jQueryForm,!1),Give.form.fn.hideProcessingState(),this.displayErrorMessage(o.data.error,!0),!(i=o.data.error.details[0])||"INSTRUMENT_DECLINED"!==i.issue){e.next=17;break}return e.abrupt("return",r.restart());case 17:return e.abrupt("return");case 18:return a=o.data.order,e.next=21,S.addFieldToForm(this.form,a.id,"payPalOrderId");case 21:this.submitDonationForm();case 22:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})},{key:"submitDonationForm",value:function(){this.jQueryForm.off("submit"),this.removeCreditCardFields(),this.form.submit()}},{key:"removeCreditCardFields",value:function(){if(x.canShow()){this.jQueryForm.find('input[name="card_name"]').parent().remove(),this.ccFieldsContainer.querySelector(".separator-with-text").remove();var e=new F(this.form);for(var t in e.cardFields)e.cardFields[t].el.parentElement.remove()}}}]),s}(b),O=r(490);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){o()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}document.addEventListener("DOMContentLoaded",(function(){var e=document.querySelectorAll(".give-form-wrap"),t=[];function r(){e.forEach((function(e){var t=e.querySelector(".give-form");S.isPayPalCommerceSelected(jQuery(t))&&n(t)}))}function n(e){var t=new k(e),r=new F(e);if(t.boot(),x.canShow()){var n=new x(r);return r.boot(),void n.boot()}r.removeFields()}function o(e){var t={},r=S.isRecurringDonation(e);return t.intent=r?"subscription":"capture",t.vault=!!r,t.currency=Give.form.fn.getInfo("currency_code",jQuery(e)),Object(O.a)(T(T({},givePayPalCommerce.payPalSdkQueryParameters),t))}e.forEach((function(e){Give.form.fn.hasDonationForm(e)&&t.push(e)})),t.length&&(o((e=t)[0].querySelector(".give-form")).then((function(){r()})),e.forEach((function(e){var t=e.querySelector(".give-form");!function(e){var t=e.querySelector('input[name="_give_is_donation_recurring"]');t&&S.trackRecurringHiddenFieldChange(t,(function(){o(e).then((function(){r()}))}))}(t),function(e){S.trackDonationCurrencyChange(e,(function(){o(e).then((function(){r()}))}))}(t),function(e){document.addEventListener("give_gateway_loaded",(function(){S.isPayPalCommerceSelected(jQuery(e))&&o(e).then((function(){n(e)}))}))}(t)})),jQuery("form.give-form").on("submit",(function(e){return!S.isPayPalCommerceSelected(jQuery(void 0))||(e.preventDefault(),!1)})))}))}});