Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ (()=>{"use strict";var t={4744:t=>{var e=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===n}(t)}(t)},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?c((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function o(t,e,n){return t.concat(e).map(function(t){return r(t,n)})}function i(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}(t))}function a(t,e){try{return e in t}catch(t){return!1}}function c(t,n,u){(u=u||{}).arrayMerge=u.arrayMerge||o,u.isMergeableObject=u.isMergeableObject||e,u.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(t)?s?u.arrayMerge(t,n,u):function(t,e,n){var o={};return n.isMergeableObject(t)&&i(t).forEach(function(e){o[e]=r(t[e],n)}),i(e).forEach(function(i){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(a(t,i)&&n.isMergeableObject(e[i])?o[i]=function(t,e){if(!e.customMerge)return c;var n=e.customMerge(t);return"function"==typeof n?n:c}(i,n)(t[i],e[i],n):o[i]=r(e[i],n))}),o}(t,n,u):r(n,u)}c.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,n){return c(t,n,e)},{})};var u=c;t.exports=u}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const r=window.wp.element,o=window.wp.i18n,i=window.wc.wcBlocksRegistry,a=window.wp.data;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)}function u(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"info",i=null===(e=window.wc_ppcp_axo)||void 0===e?void 0:e.wp_debug,a=null===(n=window.wc_ppcp_axo)||void 0===n||null===(n=n.ajax)||void 0===n||null===(n=n.frontend_logger)||void 0===n?void 0:n.endpoint,c=null===(r=window.wc_ppcp_axo)||void 0===r?void 0:r.logging_enabled;if(i)switch(o){case"error":console.error("[AXO] ".concat(t));break;case"warn":console.warn("[AXO] ".concat(t));break;default:console.log("[AXO] ".concat(t))}a&&c&&fetch(a,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:window.wc_ppcp_axo.ajax.frontend_logger.nonce,log:{message:t,level:o}})})}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0:function(t){return""!==t}(n)})):t};function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n0&&void 0!==arguments[0]?arguments[0]:A,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_IS_PAYPAL_LOADED":return E(E({},t),{},{isPayPalLoaded:e.payload});case"SET_IS_GUEST":return E(E({},t),{},{isGuest:e.payload});case"SET_IS_AXO_ACTIVE":return E(E({},t),{},{isAxoActive:e.payload});case"SET_IS_AXO_SCRIPT_LOADED":return E(E({},t),{},{isAxoScriptLoaded:e.payload});case"SET_IS_EMAIL_SUBMITTED":return E(E({},t),{},{isEmailSubmitted:e.payload});case"SET_IS_EMAIL_LOOKUP_COMPLETED":return E(E({},t),{},{isEmailLookupCompleted:e.payload});case"SET_SHIPPING_ADDRESS":return E(E({},t),{},{shippingAddress:e.payload});case"SET_CARD_DETAILS":return E(E({},t),{},{cardDetails:e.payload});case"SET_PHONE_NUMBER":return E(E({},t),{},{phoneNumber:e.payload});case"SET_CARD_CHANGE_HANDLER":return E(E({},t),{},{cardChangeHandler:e.payload});default:return t}},actions:{setIsPayPalLoaded:function(t){return{type:"SET_IS_PAYPAL_LOADED",payload:t}},setIsGuest:function(t){return{type:"SET_IS_GUEST",payload:t}},setIsAxoActive:function(t){return{type:"SET_IS_AXO_ACTIVE",payload:t}},setIsAxoScriptLoaded:function(t){return{type:"SET_IS_AXO_SCRIPT_LOADED",payload:t}},setIsEmailSubmitted:function(t){return{type:"SET_IS_EMAIL_SUBMITTED",payload:t}},setIsEmailLookupCompleted:function(t){return{type:"SET_IS_EMAIL_LOOKUP_COMPLETED",payload:t}},setShippingAddress:function(t){return{type:"SET_SHIPPING_ADDRESS",payload:t}},setCardDetails:function(t){return{type:"SET_CARD_DETAILS",payload:t}},setPhoneNumber:function(t){return{type:"SET_PHONE_NUMBER",payload:t}},setCardChangeHandler:function(t){return{type:"SET_CARD_CHANGE_HANDLER",payload:t}}},selectors:{getIsPayPalLoaded:function(t){return t.isPayPalLoaded},getIsGuest:function(t){return t.isGuest},getIsAxoActive:function(t){return t.isAxoActive},getIsAxoScriptLoaded:function(t){return t.isAxoScriptLoaded},getIsEmailSubmitted:function(t){return t.isEmailSubmitted},getIsEmailLookupCompleted:function(t){return t.isEmailLookupCompleted},getShippingAddress:function(t){return t.shippingAddress},getCardDetails:function(t){return t.cardDetails},getPhoneNumber:function(t){return t.phoneNumber},getCardChangeHandler:function(t){return t.cardChangeHandler}}});(0,a.register)(j)}var P=function(t){(0,a.dispatch)(_).setIsGuest(t)},C=function(t){(0,a.dispatch)(_).setIsEmailLookupCompleted(t)};function x(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return T(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,u=t,d.n=n,a}};function p(n,r){for(c=n,u=r,e=0;!f&&s&&!o&&e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(T(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,T(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,T(f,"constructor",s),T(s,"constructor",u),u.displayName="GeneratorFunction",T(s,o,"GeneratorFunction"),T(f),T(f,o,"Generator"),T(f,r,function(){return this}),T(f,"toString",function(){return"[object Generator]"}),(x=function(){return{w:i,m:d}})()}function T(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}T=function(t,e,n,r){function i(e,n){T(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},T(t,e,n,r)}function I(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n3&&void 0!==arguments[3]?arguments[3]:null;fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:e.nonce})}).then(function(t){return t.json()}).then(function(o){var i;(function(t,e){return!(!t||t.user!==e||(new Date).getTime()>=1e3*t.expiration)})(o,e.user)&&(i=o,sessionStorage.setItem("ppcp-data-client-id",JSON.stringify(i)),t["data-client-token"]=o.token,D(t).then(function(t){"function"==typeof n&&n(t)}).catch(function(t){"function"==typeof r&&r(t)}))})};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)}function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||J(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=J(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function J(t,e){if(t){if("string"==typeof t)return W(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(t,e):void 0}}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n')),n.append(o)),e=o.get(0)}return jQuery(e).length?e:null}},{key:"toKey",value:function(t){return Array.isArray(t)?JSON.stringify(t):t}}])&&X(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();window.widgetBuilder=window.widgetBuilder||new z;const K=window.widgetBuilder;var V=n(4744),Q=n.n(V),Y=function(t){return t.replace(/([-_]\w)/g,function(t){return t[1].toUpperCase()})},Z=function(t){var e=function(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[Y(n)]=t[n]);return e}(t.url_params);t.script_attributes&&(e=Q()(e,t.script_attributes));var n=function(t){var e,n,r=null==t||null===(e=t.save_payment_methods)||void 0===e?void 0:e.id_token;return r&&!0===(null==t||null===(n=t.user)||void 0===n?void 0:n.is_logged)?{"data-user-id-token":r}:{}}(t);return Q().all([e,n])};function tt(t){return tt="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},tt(t)}function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function nt(t){for(var e=1;e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(it(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,it(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,it(f,"constructor",s),it(s,"constructor",u),u.displayName="GeneratorFunction",it(s,o,"GeneratorFunction"),it(f),it(f,o,"Generator"),it(f,r,function(){return this}),it(f,"toString",function(){return"[object Generator]"}),(ot=function(){return{w:i,m:d}})()}function it(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}it=function(t,e,n,r){function i(e,n){it(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},it(t,e,n,r)}function at(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function ct(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){at(i,r,o,a,c,"next",t)}function c(t){at(i,r,o,a,c,"throw",t)}a(void 0)})}}var ut=new Map,st=new Map,lt=function(){var t=ct(ot().m(function t(e,n){var r;return ot().w(function(t){for(;;)switch(t.n){case 0:if(null===(r=n.data_client_id)||void 0===r||!r.set_attribute||!0===n.vault_v3_enabled){t.n=1;break}return t.a(2,new Promise(function(t,r){B(e,n.data_client_id,function(e){K.setPaypal(e),t(e)},r)}));case 1:return t.a(2,null)}},t)}));return function(_x,e){return t.apply(this,arguments)}}(),ft=function(){var t=ct(ot().m(function t(e,n){var r,o,i;return ot().w(function(t){for(;;)switch(t.n){case 0:if(e){t.n=1;break}throw new Error("Namespace is required");case 1:if(!ut.has(e)){t.n=2;break}return console.log("Script already loaded for namespace: ".concat(e)),t.a(2,ut.get(e));case 2:if(!st.has(e)){t.n=3;break}return console.log("Script loading in progress for namespace: ".concat(e)),t.a(2,st.get(e));case 3:return r=nt(nt({},Z(n)),{},{"data-namespace":e}),t.n=4,lt(r,n);case 4:if(!(o=t.v)){t.n=5;break}return t.a(2,o);case 5:return i=new Promise(function(t,n){D(r).then(function(n){K.setPaypal(n),ut.set(e,n),console.log("Script loaded for namespace: ".concat(e)),t(n)}).catch(function(t){console.error("Failed to load script for namespace: ".concat(e),t),n(t)}).finally(function(){st.delete(e)})}),st.set(e,i),t.a(2,i)}},t)}));return function(e,n){return t.apply(this,arguments)}}();function dt(t){return dt="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},dt(t)}function pt(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return yt(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,u=t,d.n=n,a}};function p(n,r){for(c=n,u=r,e=0;!f&&s&&!o&&e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(yt(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,yt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,yt(f,"constructor",s),yt(s,"constructor",u),u.displayName="GeneratorFunction",yt(s,o,"GeneratorFunction"),yt(f),yt(f,o,"Generator"),yt(f,r,function(){return this}),yt(f,"toString",function(){return"[object Generator]"}),(pt=function(){return{w:i,m:d}})()}function yt(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}yt=function(t,e,n,r){function i(e,n){yt(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},yt(t,e,n,r)}function mt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function vt(t){for(var e=1;e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(wt(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,wt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,wt(f,"constructor",s),wt(s,"constructor",u),u.displayName="GeneratorFunction",wt(s,o,"GeneratorFunction"),wt(f),wt(f,o,"Generator"),wt(f,r,function(){return this}),wt(f,"toString",function(){return"[object Generator]"}),(gt=function(){return{w:i,m:d}})()}function wt(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}wt=function(t,e,n,r){function i(e,n){wt(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},wt(t,e,n,r)}function St(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}const Ot=function(t){var e=t.fastlaneSdk,n=t.name,o=void 0===n?"fastlane-watermark-container":n,i=t.includeAdditionalInfo,a=void 0===i||i,c=(0,r.useRef)(null),u=(0,r.useRef)(null);return(0,r.useEffect)(function(){var t=function(){var t,n=(t=gt().m(function t(){var n,r;return gt().w(function(t){for(;;)switch(t.p=t.n){case 0:if(c.current){t.n=1;break}return t.a(2);case 1:return c.current.innerHTML="",t.p=2,t.n=3,e.FastlaneWatermarkComponent({includeAdditionalInfo:a});case 3:n=t.v,u.current=n,n.render("#".concat(o)),t.n=5;break;case 4:t.p=4,r=t.v,d("Error rendering watermark: ".concat(r),"error");case 5:return t.a(2)}},t,null,[[2,4]])}),function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){St(i,r,o,a,c,"next",t)}function c(t){St(i,r,o,a,c,"throw",t)}a(void 0)})});return function(){return n.apply(this,arguments)}}();return t(),function(){c.current&&(c.current.innerHTML="")}},[e,o,a]),React.createElement("div",{id:o,ref:c})};var Et={container:null,root:null},kt=function(){if(Et.root&&Et.root.unmount(),Et.container)if(Et.container.parentNode)Et.container.parentNode.removeChild(Et.container);else{var t=document.querySelector(".wc-block-checkout-axo-block-watermark-container");t&&t.remove()}Object.assign(Et,{container:null,root:null})};const _t=function(t){var e=t.fastlaneSdk,n=(0,a.useSelect)(function(t){return t(_).getIsAxoActive()}),o=(0,a.useSelect)(function(t){return t(_).getIsAxoScriptLoaded()});return(0,r.useEffect)(function(){return n||!n&&!o?(function(){var t=document.querySelector(".wp-block-woocommerce-checkout-contact-information-block .wc-block-components-text-input");if(t&&!Et.container){var e=t.querySelector('input[id="email"]');if(e){Et.container=document.createElement("div"),Et.container.setAttribute("class","wc-block-checkout-axo-block-watermark-container");var n=t.querySelector(".wc-block-axo-email-submit-button-container")||e;n.parentNode.insertBefore(Et.container,n.nextSibling),Et.root=(0,r.createRoot)(Et.container)}}}(),function(t){var e,n=t.isAxoActive,o=t.fastlaneSdk;e=n||t.isAxoScriptLoaded?n?(0,r.createElement)(Ot,{fastlaneSdk:o,name:"fastlane-watermark-email",includeAdditionalInfo:!0}):null:(0,r.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"}),Et.root&&Et.root.render(e)}({isAxoActive:n,isAxoScriptLoaded:o,fastlaneSdk:e})):kt(),kt},[e,n,o]),null},At=function(t){var e=t.handleSubmit,n=(0,a.useSelect)(function(t){return{isGuest:t(_).getIsGuest(),isAxoActive:t(_).getIsAxoActive(),isEmailSubmitted:t(_).getIsEmailSubmitted()}}),r=n.isGuest,i=n.isAxoActive,c=n.isEmailSubmitted;return r&&i?React.createElement("button",{type:"button",onClick:e,className:"wc-block-components-button wp-element-button ".concat(c?"is-loading":""),disabled:c},React.createElement("span",{className:"wc-block-components-button__text",style:{visibility:c?"hidden":"visible"}},(0,o.__)("Continue","woocommerce-paypal-payments")),c&&React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}})):null};function jt(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return Pt(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,u=t,d.n=n,a}};function p(n,r){for(c=n,u=r,e=0;!f&&s&&!o&&e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(Pt(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Pt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Pt(f,"constructor",s),Pt(s,"constructor",u),u.displayName="GeneratorFunction",Pt(s,o,"GeneratorFunction"),Pt(f),Pt(f,o,"Generator"),Pt(f,r,function(){return this}),Pt(f,"toString",function(){return"[object Generator]"}),(jt=function(){return{w:i,m:d}})()}function Pt(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Pt=function(t,e,n,r){function i(e,n){Pt(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},Pt(t,e,n,r)}function Ct(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var xt=null,Tt={container:null,root:null,unsubscribe:null},It=null,Lt=function(){return xt||(xt=document.getElementById("email")),xt},Nt=function(t,e){t&&e||d("Shipping or billing address is missing: ".concat(JSON.stringify({shippingAddress:t,billingAddress:e})),"warn");var n={shippingAddress:t,billingAddress:e};d("Snapshot data: ".concat(JSON.stringify(n)));try{localStorage.setItem("axoOriginalCheckoutFields",JSON.stringify(n))}catch(t){d("Error saving to localStorage: ".concat(t),"error")}},Gt=function(t,e,n){d("Populating WooCommerce fields with profile data: ".concat(JSON.stringify(t)));var r=(0,a.dispatch)("wc/store/checkout");"function"==typeof r.__internalSetUseShippingAsBilling&&r.__internalSetUseShippingAsBilling(!1);var o=t.shippingAddress,i=o.address,c=o.name,u=o.phoneNumber,s={first_name:c.firstName,last_name:c.lastName,address_1:i.addressLine1,address_2:i.addressLine2||"",city:i.adminArea2,state:i.adminArea1||"",postcode:i.postalCode,country:i.countryCode,phone:u.nationalNumber};d("Setting WooCommerce shipping address: ".concat(JSON.stringify(s))),e(s);var l=t.card.paymentSource.card.billingAddress,f={first_name:t.name.firstName,last_name:t.name.lastName,address_1:l.addressLine1,address_2:l.addressLine2||"",city:l.adminArea2,state:l.adminArea1,postcode:l.postalCode,country:l.countryCode};d("Setting WooCommerce billing address: ".concat(JSON.stringify(f))),n(f),"function"==typeof r.setEditingShippingAddress&&r.setEditingShippingAddress(!1),"function"==typeof r.setEditingBillingAddress&&r.setEditingBillingAddress(!1)};const Rt=function(t){var e=t.onChangeShippingAddressClick;return React.createElement("a",{className:"wc-block-axo-change-link",role:"button",onClick:function(t){t.preventDefault(),e()}},(0,o.__)("Choose a different shipping address","woocommerce-paypal-payments"))},Dt=function(t){var e=t.onChangeShippingAddressClick;return(0,r.useEffect)(function(){var t=document.querySelector("#shipping-fields .wc-block-components-checkout-step__heading");if(t&&!t.querySelector(".wc-block-checkout-axo-block-card__edit")){var n=document.createElement("span");n.className="wc-block-checkout-axo-block-card__edit",t.appendChild(n);var o=(0,r.createRoot)(n);return o.render(React.createElement(Rt,{onChangeShippingAddressClick:e})),function(){o.unmount(),n.remove()}}},[e]),null};var Ft=function(t){if(!document.querySelector("#shipping-fields .wc-block-checkout-axo-block-card__edit")){var e=document.createElement("div");document.body.appendChild(e),(0,r.createRoot)(e).render(React.createElement(Dt,{onChangeShippingAddressClick:t}))}};function Mt(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return Bt(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,u=t,d.n=n,a}};function p(n,r){for(c=n,u=r,e=0;!f&&s&&!o&&e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(Bt(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Bt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Bt(f,"constructor",s),Bt(s,"constructor",u),u.displayName="GeneratorFunction",Bt(s,o,"GeneratorFunction"),Bt(f),Bt(f,o,"Generator"),Bt(f,r,function(){return this}),Bt(f,"toString",function(){return"[object Generator]"}),(Mt=function(){return{w:i,m:d}})()}function Bt(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Bt=function(t,e,n,r){function i(e,n){Bt(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},Bt(t,e,n,r)}function Ut(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var Ht=function(t,e){d("Update the phone prefill value: ".concat(e)),t.updatePrefills({phoneNumber:e})};var qt="wc/store/checkout",Jt=function(){var t=(0,a.useSelect)(function(t){var e=t(qt);return{isEditingShippingAddress:!e.getEditingShippingAddress||e.getEditingShippingAddress(),isEditingBillingAddress:!e.getEditingBillingAddress||e.getEditingBillingAddress()}},[]),e=t.isEditingShippingAddress,n=t.isEditingBillingAddress,o=(0,a.useDispatch)(qt),i=o.setEditingShippingAddress,c=o.setEditingBillingAddress;return{isEditingShippingAddress:e,isEditingBillingAddress:n,setShippingAddressEditing:(0,r.useCallback)(function(t){"function"==typeof i&&i(t)},[i]),setBillingAddressEditing:(0,r.useCallback)(function(t){"function"==typeof c&&c(t)},[c])}};function Wt(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return Xt(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,u=t,d.n=n,a}};function p(n,r){for(c=n,u=r,e=0;!f&&s&&!o&&e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(Xt(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Xt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Xt(f,"constructor",s),Xt(s,"constructor",u),u.displayName="GeneratorFunction",Xt(s,o,"GeneratorFunction"),Xt(f),Xt(f,o,"Generator"),Xt(f,r,function(){return this}),Xt(f,"toString",function(){return"[object Generator]"}),(Wt=function(){return{w:i,m:d}})()}function Xt(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Xt=function(t,e,n,r){function i(e,n){Xt(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},Xt(t,e,n,r)}function $t(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function zt(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){$t(i,r,o,a,c,"next",t)}function c(t){$t(i,r,o,a,c,"throw",t)}a(void 0)})}}function Kt(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return Vt(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,u=t,d.n=n,a}};function p(n,r){for(c=n,u=r,e=0;!f&&s&&!o&&e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(Vt(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Vt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Vt(f,"constructor",s),Vt(s,"constructor",u),u.displayName="GeneratorFunction",Vt(s,o,"GeneratorFunction"),Vt(f),Vt(f,o,"Generator"),Vt(f,r,function(){return this}),Vt(f,"toString",function(){return"[object Generator]"}),(Kt=function(){return{w:i,m:d}})()}function Vt(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Vt=function(t,e,n,r){function i(e,n){Vt(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},Vt(t,e,n,r)}function Qt(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function Yt(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){Qt(i,r,o,a,c,"next",t)}function c(t){Qt(i,r,o,a,c,"throw",t)}a(void 0)})}}function Zt(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return te(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,u=t,d.n=n,a}};function p(n,r){for(c=n,u=r,e=0;!f&&s&&!o&&e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(te(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,te(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,te(f,"constructor",s),te(s,"constructor",u),u.displayName="GeneratorFunction",te(s,o,"GeneratorFunction"),te(f),te(f,o,"Generator"),te(f,r,function(){return this}),te(f,"toString",function(){return"[object Generator]"}),(Zt=function(){return{w:i,m:d}})()}function te(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}te=function(t,e,n,r){function i(e,n){te(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},te(t,e,n,r)}function ee(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}const ne=function(t,e,n,o,i){var c=(0,a.useDispatch)(_),u=c.setIsAxoActive,s=c.setIsAxoScriptLoaded,l=c.setShippingAddress,f=c.setCardDetails,p=c.setCardChangeHandler,y=function(t,e,n){var o=(0,a.useDispatch)(_).setIsPayPalLoaded,i=(0,a.useSelect)(function(t){return{isPayPalLoaded:t(_).getIsPayPalLoaded()}},[]).isPayPalLoaded;return(0,r.useEffect)(function(){var r=function(){var r,a=(r=pt().m(function r(){var a,c,u,s;return pt().w(function(r){for(;;)switch(r.p=r.n){case 0:if(i||!n){r.n=7;break}return a=window.wc_ppcp_axo,r.p=1,r.n=2,fetch(a.ajax.axo_script_attributes.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:a.ajax.axo_script_attributes.nonce})});case 2:return c=r.v,r.n=3,c.json();case 3:if((u=r.v).success){r.n=4;break}return d("Failed to load axo script attributes: ".concat(u.data.message),"error"),r.a(2);case 4:return r.n=5,ft(t,vt(vt({},e),{},{script_attributes:vt(vt({},e.script_attributes),{},{"data-sdk-client-token":u.data.sdk_client_token})}));case 5:o(!0),r.n=7;break;case 6:r.p=6,s=r.v,d("Error loading PayPal script for namespace: ".concat(t,". Error: ").concat(s),"error");case 7:return r.a(2)}},r,null,[[1,6]])}),function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function a(t){ht(i,n,o,a,c,"next",t)}function c(t){ht(i,n,o,a,c,"throw",t)}a(void 0)})});return function(){return a.apply(this,arguments)}}();r()},[e,n,i]),i}(t,e,n),m=function(t){var e=Jt().setBillingAddressEditing,n=G().setBillingAddress,o=(0,a.useDispatch)(_).setCardDetails;return(0,r.useCallback)(Yt(Kt().m(function r(){var i,a,c,u,s,l,f,p,y,m,v;return Kt().w(function(r){for(;;)switch(r.n){case 0:if(!t){r.n=4;break}return r.n=1,t.profile.showCardSelector();case 1:if(a=r.v,c=a.selectionChanged,u=a.selectedCard,!c||null==u||null===(i=u.paymentSource)||void 0===i||!i.card){r.n=3;break}return s=u.paymentSource.card,l=s.name,f=s.billingAddress,p="",y="",l&&(m=l.split(" "),p=m[0],y=m.slice(1).join(" ")),v={first_name:p,last_name:y,address_1:(null==f?void 0:f.addressLine1)||"",address_2:(null==f?void 0:f.addressLine2)||"",city:(null==f?void 0:f.adminArea2)||"",state:(null==f?void 0:f.adminArea1)||"",postcode:(null==f?void 0:f.postalCode)||"",country:(null==f?void 0:f.countryCode)||""},r.n=2,Promise.all([new Promise(function(t){o(u),t()}),new Promise(function(t){n(v),t()}),new Promise(function(t){e(!1),t()})]);case 2:r.n=4;break;case 3:d("Selected card or billing address is missing.","error");case 4:return r.a(2)}},r)})),[t,o,n,e])}(o),v=function(t,e){var n=Jt().setShippingAddressEditing,o=G().setShippingAddress;return(0,r.useCallback)(zt(Wt().m(function r(){var i,a,c,u,s,l,f;return Wt().w(function(r){for(;;)switch(r.n){case 0:if(!t){r.n=3;break}return r.n=1,t.profile.showShippingAddressSelector();case 1:if(i=r.v,a=i.selectionChanged,c=i.selectedAddress,!a){r.n=3;break}return e(c),u=c.address,s=c.name,l=c.phoneNumber,f={first_name:s.firstName,last_name:s.lastName,address_1:u.addressLine1,address_2:u.addressLine2||"",city:u.adminArea2,state:u.adminArea1||"",postcode:u.postalCode,country:u.countryCode,phone:l.nationalNumber},r.n=2,new Promise(function(t){o(f),t()});case 2:return r.n=3,new Promise(function(t){n(!1),t()});case 3:return r.a(2)}},r)})),[t,e,o,n])}(o,l),b=G(),h=b.shippingAddress,g=b.billingAddress,w=b.setShippingAddress,S=b.setBillingAddress;return function(t){var e,n,o,i,c,u=(0,a.useDispatch)(_).setPhoneNumber,s=(0,a.useSelect)(function(t){return{phoneNumber:t(_).getPhoneNumber()}}).phoneNumber,l=G(),f=l.shippingAddress,d=l.billingAddress,p=(0,r.useRef)((e=Ht,n={timeoutId:null,args:null},o=function(){n.timeoutId&&window.clearTimeout(n.timeoutId),n.timeoutId=null,n.args=null},i=function(){n.timeoutId&&(e.apply(null,n.args||[]),o())},c=function(){o();for(var t=arguments.length,e=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:"").replace(/^\+?[01]+/,"").replace(/[^0-9]/g,"");return 10===t.length?t:""}(t||e);n&&n!==s&&u(n)},[d,f,s,u]);(0,r.useEffect)(function(){y()},[y]),(0,r.useEffect)(function(){t&&s&&p(t,s)},[p,t,s]),(0,r.useEffect)(function(){return function(){null!=p&&p.cancel&&p.cancel()}},[p])}(i),function(t){var e=(0,a.useDispatch)(_),n=e.setShippingAddress,o=e.setCardDetails,i=e.setIsGuest,c=(0,r.useRef)(!1);(0,r.useEffect)(function(){if(t&&!c.current){var e=new URLSearchParams(window.location.search);if("1"===e.get("ppcp_fastlane_error")){e.delete("ppcp_fastlane_error");var r=new URL(window.location);r.search=e.toString(),window.history.replaceState({},"",r),c.current=!0;var a=function(){var e,r=(e=Zt().m(function e(){var r,a,c,u,s;return Zt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,null==(r=document.getElementById("email"))||!r.value){e.n=3;break}return e.n=1,t.identity.lookupCustomerByEmail(r.value);case 1:if(a=e.v,wp.data.dispatch(_).setIsEmailSubmitted(!0),null==a||!a.customerContextId){e.n=3;break}return c=a.customerContextId,e.n=2,t.identity.triggerAuthenticationFlow(c);case 2:"succeeded"===(null==(u=e.v)?void 0:u.authenticationState)&&(s=u.profileData,i(!1),null!=s&&s.shippingAddress&&n(s.shippingAddress),null!=s&&s.card&&o(s.card),C(!0));case 3:e.n=5;break;case 4:e.p=4,e.v,d("Failed to restore Fastlane session","warn");case 5:return e.a(2)}},e,null,[[0,4]])}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(t){ee(i,r,o,a,c,"next",t)}function c(t){ee(i,r,o,a,c,"throw",t)}a(void 0)})});return function(){return r.apply(this,arguments)}}();a()}}},[t,n,o,i])}(o),(0,r.useEffect)(function(){var t,e,n;t=".wc-block-components-express-payment--checkout, .wp-block-woocommerce-checkout-express-payment-block",e="wc-block-axo-is-authenticated",(n=function(){var n=document.querySelector(t);n?(0,a.select)(_).getIsGuest()?n.classList.remove(e):n.classList.add(e):d("Authentication class target element not found: ".concat(t),"warn")})(),(0,a.subscribe)(function(){n()}),function(){var t=".wp-block-woocommerce-checkout-fields-block",e="wc-block-axo-email-lookup-completed",n=function(){var n=document.querySelector(t);n?(0,a.select)(_).getIsEmailLookupCompleted()?n.classList.add(e):n.classList.remove(e):d("Email lookup completed class target element not found: ".concat(t),"warn")};n(),(0,a.subscribe)(function(){n()})}(),function(){var t=".wp-block-woocommerce-checkout-fields-block",e="wc-block-axo-is-loaded",n="wc-block-axo-is-authenticated",r="wc-block-axo-email-lookup-completed",o=function(){var o=document.querySelector(t);if(o){var i=(0,a.select)(_).getIsAxoActive(),c=(0,a.select)(_).getIsGuest(),u=(0,a.select)(_).getIsEmailLookupCompleted();i?o.classList.add(e):o.classList.remove(e),c?o.classList.remove(n):o.classList.add(n),u?o.classList.add(r):o.classList.remove(r)}else d("Checkout block class target element not found: ".concat(t),"warn")};o(),(0,a.subscribe)(function(){o()})}()},[]),(0,r.useEffect)(function(){if(function(t){var e=document.createElement("div");document.body.appendChild(e),(0,r.createRoot)(e).render((0,r.createElement)(_t,{fastlaneSdk:t}))}(o),y&&o){s(!0),u(!0),p(m);var t=function(t,e,n,r,o,i,a,c,u){return function(){var s,l=(s=Mt().m(function s(l){var f,p,y,m,v;return Mt().w(function(s){for(;;)switch(s.p=s.n){case 0:if(s.p=0,d("Email value being looked up: ".concat(l)),t){s.n=1;break}throw new Error("FastlaneSDK is not initialized");case 1:if(t.identity){s.n=2;break}throw new Error("FastlaneSDK identity object is not available");case 2:return s.n=3,t.identity.lookupCustomerByEmail(l);case 3:if(f=s.v,d("Lookup response: ".concat(JSON.stringify(f))),f&&""===f.customerContextId&&C(!0),f&&f.customerContextId){s.n=4;break}return d("No customerContextId found in the response","warn"),s.a(2);case 4:return s.n=5,t.identity.triggerAuthenticationFlow(f.customerContextId);case 5:if((p=s.v)&&p.authenticationState){s.n=6;break}throw new Error("Invalid authentication response");case 6:y=p.authenticationState,m=p.profileData,p&&C(!0),"succeeded"===y?(r(o,i),P(!1),m&&m.shippingAddress&&e(m.shippingAddress),m&&m.card&&n(m.card),d("Profile Data: ".concat(JSON.stringify(m))),Gt(m,a,c),Ft(u)):d("Authentication failed or did not succeed","warn"),s.n=8;break;case 7:throw s.p=7,v=s.v,d("Error during email lookup or authentication:\n\t\t\t\t".concat(v)),v;case 8:return s.a(2)}},s,null,[[0,7]])}),function(){var t=this,e=arguments;return new Promise(function(n,r){var o=s.apply(t,e);function i(t){Ut(o,n,r,i,a,"next",t)}function a(t){Ut(o,n,r,i,a,"throw",t)}i(void 0)})});return function(_x){return l.apply(this,arguments)}}()}(o,l,f,Nt,h,g,w,S,v);!function(t){var e=Lt();if(e){var n=function(){var n,r=(n=jt().m(function n(){var r;return jt().w(function(n){for(;;)switch(n.p=n.n){case 0:if(!wp.data.select(_).getIsEmailSubmitted()&&e.value){n.n=1;break}return n.a(2);case 1:return wp.data.dispatch(_).setIsEmailSubmitted(!0),o(),n.p=2,n.n=3,t(e.value);case 3:n.n=5;break;case 4:n.p=4,r=n.v,d("Error during email submission: ".concat(r),"error");case 5:return n.p=5,wp.data.dispatch(_).setIsEmailSubmitted(!1),o(),n.f(5);case 6:return n.a(2)}},n,null,[[2,4,5,6]])}),function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){Ct(i,r,o,a,c,"next",t)}function c(t){Ct(i,r,o,a,c,"throw",t)}a(void 0)})});return function(){return r.apply(this,arguments)}}();It=function(t){var e=wp.data.select(_).getIsAxoActive();"Enter"===t.key&&e&&(t.preventDefault(),n())},e.addEventListener("keydown",It),Tt.container||(Tt.container=document.createElement("div"),Tt.container.setAttribute("class","wc-block-axo-email-submit-button-container"),e.parentNode.insertBefore(Tt.container,e.nextSibling),Tt.root=(0,r.createRoot)(Tt.container));var o=function(){Tt.root&&Tt.root.render((0,r.createElement)(At,{handleSubmit:n}))};o(),Tt.unsubscribe=wp.data.subscribe(function(){o()})}else d("Email input element not found. Functionality not added.","warn")}(t)}},[y,o,u,s,h,g,w,S,v,m,l,f,i,p]),y};function re(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,s=Object.create(u.prototype);return oe(s,"_invoke",function(n,r,o){var i,c,u,s=0,l=o||[],f=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,c=0,u=t,d.n=n,a}};function p(n,r){for(c=n,u=r,e=0;!f&&s&&!o&&e3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(oe(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,oe(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,oe(f,"constructor",s),oe(s,"constructor",u),u.displayName="GeneratorFunction",oe(s,o,"GeneratorFunction"),oe(f),oe(f,o,"Generator"),oe(f,r,function(){return this}),oe(f,"toString",function(){return"[object Generator]"}),(re=function(){return{w:i,m:d}})()}function oe(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}oe=function(t,e,n,r){function i(e,n){oe(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},oe(t,e,n,r)}function ie(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function ae(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){ie(i,r,o,a,c,"next",t)}function c(t){ie(i,r,o,a,c,"throw",t)}a(void 0)})}}function ce(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ue(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=n<2&&pr||r>y)&&(i[4]=n,i[5]=r,d.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,l,y){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,y),c=l,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(d.n=-1),p(c,u)):d.n=u:d.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=d.n<0)?u:n.call(r,d))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(n,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][r]?e(e([][r]())):(pe(e={},r,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,pe(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,pe(f,"constructor",s),pe(s,"constructor",u),u.displayName="GeneratorFunction",pe(s,o,"GeneratorFunction"),pe(f),pe(f,o,"Generator"),pe(f,r,function(){return this}),pe(f,"toString",function(){return"[object Generator]"}),(de=function(){return{w:i,m:d}})()}function pe(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}pe=function(t,e,n,r){function i(e,n){pe(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},pe(t,e,n,r)}function ye(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function me(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){ye(i,r,o,a,c,"next",t)}function c(t){ye(i,r,o,a,c,"throw",t)}a(void 0)})}}function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);nt.length)&&(e=t.length);for(var n=0,r=Array(e);n