1(()=>{"use strict";const e=window.wc.wcBlocksRegistry;var t=wc.wcSettings.getSetting("ppcp-pwc_data");(0,e.registerPaymentMethod)({name:t.id,label:React.createElement(React.Fragment,null,React.createElement("div",{dangerouslySetInnerHTML:{__html:t.title}}),t.icon&&React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})),content:React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}})),edit:React.createElement("div",null),ariaLabel:t.title,canMakePayment:function(){return!0},supports:{features:t.supports}})})();; 2(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-bancontact_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 3(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-blik_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 4(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-eps_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 5(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-ideal_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 6(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-mybank_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 7(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-p24_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 8(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-trustly_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 9(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-multibanco_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 10(()=>{"use strict";const e=window.wc.wcBlocksRegistry;function t(e){var t=e.config;return e.components.PaymentMethodIcons,React.createElement(React.Fragment,null,t.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:t.description}}),t.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(t.id),src:t.icon,alt:t.title})))}var n=wc.wcSettings.getSetting("ppcp-oxxo-gateway_data");(0,e.registerPaymentMethod)({name:n.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:n.title}}),content:React.createElement(t,{config:n}),edit:React.createElement("div",null),ariaLabel:n.title,canMakePayment:function(){return!0},supports:{features:n.supports}})})();; 11(()=>{"use strict";const e=window.wc.wcBlocksRegistry,t=window.wp.element;function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,i,c,o=[],l=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){s=!0,a=e}
11finally{try{if(!l&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(s)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e,t)||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 r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var a=wc.wcSettings.getSetting("ppcp-pay-upon-invoice-gateway_data"),i="de"===a.siteLanguage,c=function(e){var r=e.eventRegistration,c=e.emitResponse,o=r.onPaymentSetup,l=n((0,t.useState)(""),2),s=l[0],u=l[1],p=n((0,t.useState)(""),2),m=p[0],d=p[1];(0,t.useEffect)(function(){var e=o(function(){return a.requiresBirthDate&&!s?{type:c.responseTypes.ERROR,message:i?"Bitte geben Sie Ihr Geburtsdatum ein.":"Please enter your birth date."}:{type:c.responseTypes.SUCCESS,meta:{paymentMethodData:{billing_birth_date:s,billing_phone:m}}}});return function(){return e()}},[o,c.responseTypes.SUCCESS,c.responseTypes.ERROR,s,m]);var y=i?a.ratepayTerms.de:a.ratepayTerms.en;return React.createElement("div",{className:"ppcp-pui-fields"},a.description&&React.createElement("div",{dangerouslySetInnerHTML:{__html:a.description}}),a.icon&&React.createElement("div",{className:"wc-block-components-payment-method-icons wc-block-components-payment-method-icons--align-right"},React.createElement("img",{className:"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(a.id),src:a.icon,alt:a.title})),React.createElement("p",{className:"form-row form-row-wide"},React.createElement("label",{htmlFor:"ppcp-pui-birth-date"},i?"Geburtsdatum":"Birth date"),React.createElement("input",{type:"date",id:"ppcp-pui-birth-date",className:"input-text",value:s,onChange:function(e){return u(e.target.value)},required:!0})),a.requiresPhone&&React.createElement("p",{className:"form-row form-row-wide"},React.createElement("label",{htmlFor:"ppcp-pui-phone"},i?"Telefon":"Phone"),React.createElement("input",{type:"tel",id:"ppcp-pui-phone",className:"input-text",value:m,onChange:function(e){return d(e.target.value)},required:!0})),React.createElement("div",{className:"ppcp-pui-ratepay-terms",dangerouslySetInnerHTML:{__html:y}}))};(0,e.registerPaymentMethod)({name:a.id,label:React.createElement("div",{dangerouslySetInnerHTML:{__html:a.title}}),content:React.createElement(c,null),edit:React.createElement("div",null),ariaLabel:a.title,canMakePayment:function(){return!0},supports:{features:a.supports}})})();; 12(()=>{"use strict";var e={20:(e,t,o)=>{var r=o(609),s=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function i(e,t,o){var r,i={},p=null,d=null;for(r in void 0!==o&&(p=""+o),void 0!==t.key&&(p=""+t.key),void 0!==t.ref&&(d=t.ref),t)n.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:s,type:e,key:p,ref:d,props:i,_owner:a.current}}t.jsx=i,t.jsxs=i},609:e=>{e.exports=window.React},848:(e,t,o)=>{e.exports=o(20)}},t={};const o=window.wc.wcBlocksRegistry,r=window.wc.blocksCheckout,s=window.wc.wcSettings,n=window.wp.element,a=window.wp.htmlEntities,c="mercadopago_blocks_update_cart";var i=function o(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}(848);const p=({text:e,imgSrc:t,id:o})=>(0,i.jsxs)("div",{id:o,className:"row-image-select",children:[(0,i.jsx)("img",{src:t}),(0,i.jsx)("span",{children:e})]});var d;const u="mp_checkout_blocks",l="woo-mercado-pago-basic",m=(0,s.getSetting)("woo-mercado-pago-basic_data",{}),_=(0,a.decodeEntities)(m.title)||"Checkout Pro",w=e=>{const t=(0,a.decodeEntities)(m?.params?.fee_title||""),o=`${_} ${t}`;return(0,i.jsx)(p,{text:o,imgSrc:m.params.icon,id:"mp-checkout-pro-label"})},y=e=>((e=>{const{eventRegistration:t,emitResponse:o}=e,{onPaymentSetup:s,onCheckoutSuccess:a,onCheckoutFail:i}=t;(0,n.useEffect)((()=>{((e,t)=>
12{e({namespace:c,data:{action:"add",gateway:t}})})(r.extensionCartUpdate,l);const e=s((()=>({type:o.responseTypes.SUCCESS,meta:{paymentMethodData:{...window.mpHiddenInputDataFromBlocksCheckout}}})));return()=>(((e,t)=>{e({namespace:c,data:{action:"remove",gateway:t}})})(r.extensionCartUpdate,l),e())}),[s]),(0,n.useEffect)((()=>{const e=a((async e=>{const t=e.processingResponse;return sendMetric("MP_BASIC_BLOCKS_SUCCESS",t.paymentStatus,u),{type:o.responseTypes.SUCCESS}}));return()=>e()}),[a]),(0,n.useEffect)((()=>{const e=i((e=>{"undefined"!=typeof MPCheckoutErrorDispatcher&&MPCheckoutErrorDispatcher.dispatchEventWhenBlocksCheckoutErrorOccurred(e);const t=e.processingResponse;return sendMetric("MP_BASIC_BLOCKS_ERROR",t.paymentStatus,u),{type:o.responseTypes.FAIL,messageContext:o.noticeContexts.PAYMENTS}}));return()=>e()}),[i])})(e),(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:m.params.content}})),S={name:l,label:(0,i.jsx)(w,{}),content:(0,i.jsx)(y,{}),edit:(0,i.jsx)(y,{}),canMakePayment:()=>!0,ariaLabel:_,supports:{features:null!==(d=m?.supports)&&void 0!==d?d:[]}};(0,o.registerPaymentMethod)(S)})();; 13(()=>{"use strict";var e={20:(e,o,t)=>{var r=t(609),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(e,o,t){var r,i={},d=null,u=null;for(r in void 0!==t&&(d=""+t),void 0!==o.key&&(d=""+o.key),void 0!==o.ref&&(u=o.ref),o)a.call(o,r)&&!s.hasOwnProperty(r)&&(i[r]=o[r]);if(e&&e.defaultProps)for(r in o=e.defaultProps)void 0===i[r]&&(i[r]=o[r]);return{$$typeof:n,type:e,key:d,ref:u,props:i,_owner:c.current}}o.jsx=i,o.jsxs=i},609:e=>{e.exports=window.React},848:(e,o,t)=>{e.exports=t(20)}},o={};const t=window.wc.wcBlocksRegistry,r=window.wc.wcSettings,n=window.wp.element,a=window.wp.htmlEntities,c="mercadopago_blocks_update_cart";let s=!1,i=null;const d=(e,o)=>e({namespace:c,data:{action:"add",gateway:o}});async function u(e,o){const t=Date.now();let r=e();for(;!r;){if(Date.now()-t>=15e3)return"function"==typeof sendMetric&&sendMetric(o.name,o.message,o.errorType),null;await new Promise((e=>setTimeout(e,100))),r=e()}return r}async function p(e,o,t=1){if(s)i={value:e,currency:o,currencyRatio:t};else{s=!0;try{window.mpSuperTokenPaymentMethods?.hideSuperTokenError(),window.mpCustomCheckoutHandler?.cardForm&&"function"==typeof window.mpCustomCheckoutHandler?.cardForm.createLoadSpinner&&window.mpCustomCheckoutHandler?.cardForm?.createLoadSpinner();const r=await u((()=>window.mpCustomCheckoutHandler),{name:"MP_CUSTOM_CHECKOUT_HANDLER_NOT_READY_ON_CART_UPDATE",message:"Custom checkout handler did not load within the expected time on cart total change",errorType:"mp_cart_total_change_error"});if(!r)return;const n=!!document.querySelector(".wc-block-components-spinner");r.cardForm.formMounted&&!n&&r.cardForm.form.unmount();let a=function(e,o){if(!Number.isInteger(e)||"object"!=typeof o)throw new Error("Invalid input");return(e/Math.pow(10,o.minorUnit)).toFixed(o.minorUnit).split(".").join(".")}(e,o);const c=parseFloat(t);c>0&&(a=String(parseFloat(a)*c)),await r.cardForm.initCardForm(a);const s=await u((()=>window.mpSuperTokenTriggerHandler),{name:"MP_SUPER_TOKEN_HANDLER_NOT_READY_ON_CART_UPDATE",message:"Trigger handler did not load within the expected time on cart total change",errorType:"mp_super_token_init_error"});await(s?.loadSuperToken(a))}catch(e){"function"==typeof sendMetric&&sendMetric("error_to_update_cart_total",e?.message||"Unknown error","mp_cart_total_change_error")}finally{if(s=!1,null!==i){const e=i;i=null,p(e.value,e.currency,e.currencyRatio)}else setTimeout((()=>window.mpCustomCheckoutHandler?.cardForm?.removeLoadSpinner()),500)}}}const m=window.wc.wcBlocksData,l=window.wp.data,w=window.wc.blocksCheckout;var _=function t(r){var n=o[r];if(void 0!==n)return n.exports;var a=o[r]={exports:{}};return e[r](a,a.exports,t),a.exports}(848);const S=({text:e,imgSrc:o,id:t})=>(0,_.jsxs)("div",{id:t,className:"row-image-select",children:[(0,_.jsx)("img",{src:o}),(0,_.jsx)("span",{children:e})]});var k;const T="mp_checkout_blocks",E="woo-mercado-pago-custom",C=(0,r.getSetting)("woo-mercado-pago-custom_data",{}),h=(0,a.decodeEntities)(C.title)||"Checkout Custom",y=()=>{const e=(0,a.decodeEntities)(C?.params?.fee_title||""),o=`${h} ${e}`;return(0,_.jsx)(S,{text:o,imgSrc:C.params.icon})},f=e=>{const{eventRegistration:o,emitResponse:t,onSubmit:r}=e,{onPaymentSetup:a,onCheckoutSuccess:s,onCheckoutFail:i}
13=o,[u,S]=(0,n.useState)(null);return(0,n.useEffect)((()=>(d(w.extensionCartUpdate,E).then((e=>{S(e?.totals?.total_price)})).catch((e=>{console.error(e)})),()=>(((e,o)=>{e({namespace:c,data:{action:"remove",gateway:o}})})(w.extensionCartUpdate,E),a((()=>({type:t.responseTypes.SUCCESS})))()))),[a]),(0,n.useEffect)((()=>{e.billing.cartTotal.value==u?p(e.billing.cartTotal.value,e.billing.currency,C.params.currencyRatio):d(w.extensionCartUpdate,E).then((e=>{S(e?.totals?.total_price)})).catch((e=>{console.error(e)}))}),[e.billing.cartTotal.value,u]),(0,n.useEffect)((()=>{const e=a((async()=>{switch(window.mpSuperTokenPaymentMethods?.hideSuperTokenError(),document.querySelector("#mp_checkout_type")?.value){case"super_token":if("function"==typeof window.mpSuperTokenFinalizeBlocks&&window.mpSuperTokenPaymentMethods&&window.mpSuperTokenAuthenticator&&window.mpSuperTokenMetrics){const e=await window.mpSuperTokenFinalizeBlocks({paymentMethods:window.mpSuperTokenPaymentMethods,authenticator:window.mpSuperTokenAuthenticator,metrics:window.mpSuperTokenMetrics,triggerHandler:window.mpSuperTokenTriggerHandler,errorHandler:window.mpSuperTokenErrorHandler,emitResponse:t,hasValidationErrors:()=>(0,l.select)(m.VALIDATION_STORE_KEY).hasValidationErrors(),removeLoader:()=>{const e=window.mpCustomCheckoutHandler?.cardForm;e?.removeLoadSpinner?e.removeLoadSpinner():window.mpSuperTokenMetrics?.sendMetric?.("mp_custom_checkout_handler_missing","blocks_place_order_cleanup","mpCustomCheckoutHandler was undefined during Blocks place-order loader cleanup")}});if(e.type===t.responseTypes.ERROR)return e;break}try{const e=window.mpSuperTokenPaymentMethods,o=window.mpSuperTokenAuthenticator,r=window.mpSuperTokenMetrics;if(!e)throw new Error(MPSuperTokenErrorCodes.SUPER_TOKEN_PAYMENT_METHODS_NOT_FOUND);if(!o)throw new Error(MPSuperTokenErrorCodes.SUPER_TOKEN_AUTHENTICATOR_NOT_FOUND);if(!r)throw new Error(MPSuperTokenErrorCodes.SUPER_TOKEN_METRICS_NOT_FOUND);r.registerClickOnPlaceOrderButton();const n=e.getActivePaymentMethod(),a=n&&e.isSelectedPaymentMethodValid();if(n&&!a&&e.forceShowValidationErrors(),(0,l.select)(m.VALIDATION_STORE_KEY).hasValidationErrors()){e.selectLastPaymentMethodChoosen();break}if(!n)throw new Error(MPSuperTokenErrorCodes.SELECT_PAYMENT_METHOD_ERROR);if(!a)throw new Error(MPSuperTokenErrorCodes.SELECT_PAYMENT_METHOD_NOT_VALID);if(!e.validateInstallmentSelection())return window.mpCustomCheckoutHandler?window.mpCustomCheckoutHandler.cardForm?.removeLoadSpinner():r.sendMetric("mp_custom_checkout_handler_missing","installment_validation_failed","mpCustomCheckoutHandler was undefined during installment validation cleanup"),{type:t.responseTypes.ERROR};await e.updateSecurityCode(),await o.authorizePayment(n.token),window.mpSuperTokenAuthenticator?.setSuperTokenValidation(!0)}catch(e){if(window.mpCustomCheckoutHandler?.cardForm?.removeLoadSpinner(),e?.message===MPSuperTokenErrorCodes.SELECT_PAYMENT_METHOD_NOT_VALID)return window.mpSuperTokenErrorHandler&&window.mpSuperTokenErrorHandler.handleError(e),{type:t.responseTypes.ERROR};const o=[MPSuperTokenErrorCodes.UPDATE_SECURITY_CODE_ERROR,MPSuperTokenErrorCodes.AUTHORIZE_PAYMENT_METHOD_ERROR,MPSuperTokenErrorCodes.AUTHORIZE_PAYMENT_METHOD_USER_CANCELLED];return window.mpSuperTokenTriggerHandler?.resetSuperTokenOnError(o.includes(e?.message)),window.mpSuperTokenTriggerHandler?.setLastException(e),window.mpSuperTokenAuthenticator?.setSuperTokenValidation(!1),{type:t.responseTypes.ERROR}}break;case"wallet_button":break;default:if("undefined"!=typeof CheckoutPage&&"function"==typeof CheckoutPage.runPreSubmitGates&&!CheckoutPage.runPreSubmitGates(window.mpCustomCheckoutHandler?.cardForm).passed)return{type:t.responseTypes.ERROR};try{const e=window.callSdkWithMetrics||(e=>e()),o=await e((()=>window.mpCustomCheckoutHandler.cardForm.form.createCardToken()),"createCardToken");if(!o?.token)return"undefined"!=typeof CheckoutPage&&"function"==typeof CheckoutPage.emitGateBlockedMetric&&CheckoutPage.emitGateBlockedMetric("CARD","mp_custom_card_validation","empty_token"),window.mpCustomCheckoutHandler?.cardForm?.removeLoadSpinner(),window.mpCustomCheckoutHandler?.cardForm?.scrollToCardForm(),{type:t.responseTypes.ERROR};document.querySelector("#cardTokenId").value=o.token}catch(e){return console.warn("token creation error after submit: ",e),window.mpCustomCheckoutHandler?.cardForm?.removeLoadSpinner(),window.mpCustomCheckoutHandler?.cardForm?.scrollToCardForm(),{type:t.responseTypes.ERROR}}}const e=document.querySelector("#mpCardSessionId");e&&window.MP_DEVICE_SESSION_ID&&(e.value=window.MP_DEVICE_SESSION_ID);const o=document.querySelector("#mercadopago-utilities"),r={};o&&o.querySelectorAll("input[name]").forEach((e=>{r[e.name]=e.value}));const n=document.querySelector("#form-checkout__identificationType"),a=document.querySelector("#form-checkout__identificationNumber");return n&&n.value&&(r["mercadopago_custom[doc_type]"]=n.value),a&&a.value&&(r["mercadopago_custom[doc_number]"]=a.value),{type:t.responseTypes.SUCCESS,meta:{paymentMethodData:{...window.mpHiddenInputDataFromBlocksCheckout,...r}}}}));return()=>e()}),[a]),(0,n.useEffect)((()=>()=>{const e=window.mpSuperTokenPaymentMethods;e?.securityFieldsActiveInstance&&"function"==typeof e.unmountActiveSecurityCodeInstance&&e.unmountActiveSecurityCodeInstance();const o=window.mpCustomCheckoutHandler?.cardForm;o?.formMounted&&o?.form&&"function"==typeof o.form.unmount&&o.form.unmount()}),[]),(0,n.useEffect)((()=>{const e=s((async e=>{const o=e.processingResponse,r=e.processingResponse.paymentDetails;if(r.three_ds_flow){const e=new Promise(((e,o)=>{window.addEventListener("completed_3ds",(t=>{t.detail.error&&o(t.detail.error),e()}))}));return window.mpCustomCheckoutHandler.threeDSHandler.load3DSFlow(r.last_four_digits),await e.then((()=>({type:t.responseTypes.SUCCESS}
13))).catch((e=>({type:t.responseTypes.FAIL,message:e,messageContext:t.noticeContexts.PAYMENTS})))}return sendMetric("MP_CUSTOM_BLOCKS_SUCCESS",o.paymentStatus,T),{type:t.responseTypes.SUCCESS}}));return()=>e()}),[s]),(0,n.useEffect)((()=>{const e=i((e=>{"undefined"!=typeof MPCheckoutErrorDispatcher&&MPCheckoutErrorDispatcher.dispatchEventWhenBlocksCheckoutErrorOccurred(e),window.mpSuperTokenTriggerHandler?.resetSuperTokenOnError(!0);const o=e.processingResponse;return sendMetric("MP_CUSTOM_BLOCKS_ERROR",o.paymentStatus,T),{type:t.responseTypes.FAIL,messageContext:t.noticeContexts.PAYMENTS,message:o.paymentDetails.message}}));return()=>e()}),[i]),(0,n.useEffect)((()=>{window.mpFormId="blocks_checkout_form",window.mpCheckoutForm=document.querySelector(".wc-block-components-form.wc-block-checkout__form"),window.mpCheckoutForm&&jQuery(window.mpCheckoutForm).prop("id",window.mpFormId);const e=document.getElementById("mp-wallet-button");e&&e.addEventListener("click",(e=>{e.preventDefault(),document.querySelector("#mp_checkout_type").value="wallet_button",r()}))}),[]),(0,_.jsx)("div",{dangerouslySetInnerHTML:{__html:C.params.content}})},g={name:E,label:(0,_.jsx)(y,{}),content:(0,_.jsx)(f,{}),edit:(0,_.jsx)(f,{}),canMakePayment:()=>!0,ariaLabel:h,supports:{features:null!==(k=C?.supports)&&void 0!==k?k:[]}};(0,t.registerPaymentMethod)(g)})();; 14(()=>{"use strict";var e={20:(e,t,o)=>{var r=o(609),s=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function i(e,t,o){var r,i={},p=null,d=null;for(r in void 0!==o&&(p=""+o),void 0!==t.key&&(p=""+t.key),void 0!==t.ref&&(d=t.ref),t)n.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:s,type:e,key:p,ref:d,props:i,_owner:a.current}}t.jsx=i,t.jsxs=i},609:e=>{e.exports=window.React},848:(e,t,o)=>{e.exports=o(20)}},t={};const o=window.wp.element,r=window.wc.wcBlocksRegistry,s=window.wc.blocksCheckout,n=window.wp.htmlEntities,a=window.wc.wcSettings,c="mercadopago_blocks_update_cart";var i=function o(r){var s=t[r];if(void 0!==s)return s.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}(848);const p=({text:e,imgSrc:t,id:o})=>(0,i.jsxs)("div",{id:o,className:"row-image-select",children:[(0,i.jsx)("img",{src:t}),(0,i.jsx)("span",{children:e})]});var d;const u="mp_checkout_blocks",l="woo-mercado-pago-credits",m=(0,a.getSetting)("woo-mercado-pago-credits_data",{}),_=(0,n.decodeEntities)(m.title)||"Checkout Credits",w=()=>{const e=(0,n.decodeEntities)(m?.params?.fee_title||""),t=`${_} ${e}`;return(0,i.jsx)(p,{text:t,imgSrc:m.params.icon})},y=e=>((e=>{const{eventRegistration:t,emitResponse:r}=e,{onPaymentSetup:n,onCheckoutSuccess:a,onCheckoutFail:i}=t;(0,o.useEffect)((()=>{((e,t)=>
14{e({namespace:c,data:{action:"add",gateway:t}})})(s.extensionCartUpdate,l);const e=n((()=>({type:r.responseTypes.SUCCESS,meta:{paymentMethodData:{...window.mpHiddenInputDataFromBlocksCheckout}}})));return()=>(((e,t)=>{e({namespace:c,data:{action:"remove",gateway:t}})})(s.extensionCartUpdate,l),e())}),[n]),(0,o.useEffect)((()=>{const e=a((async e=>{const t=e.processingResponse;return sendMetric("MP_CREDITS_BLOCKS_SUCCESS",t.paymentStatus,u),{type:r.responseTypes.SUCCESS}}));return()=>e()}),[a]),(0,o.useEffect)((()=>{const e=i((e=>{"undefined"!=typeof MPCheckoutErrorDispatcher&&MPCheckoutErrorDispatcher.dispatchEventWhenBlocksCheckoutErrorOccurred(e);const t=e.processingResponse;return sendMetric("MP_CREDITS_BLOCKS_ERROR",t.paymentStatus,u),{type:r.responseTypes.FAIL,messageContext:r.noticeContexts.PAYMENTS}}));return()=>e()}),[i])})(e),(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:m.params.content}})),S={name:l,label:(0,i.jsx)(w,{}),content:(0,i.jsx)(y,{}),edit:(0,i.jsx)(y,{}),canMakePayment:()=>!0,ariaLabel:_,supports:{features:null!==(d=m?.supports)&&void 0!==d?d:[]}};(0,r.registerPaymentMethod)(S)})();; 15(()=>{"use strict";var e={20:(e,t,o)=>{var n=o(609),r=Symbol.for("react.element"),c=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,o){var n,d={},i=null,p=null;for(n in void 0!==o&&(i=""+o),void 0!==t.key&&(i=""+t.key),void 0!==t.ref&&(p=t.ref),t)c.call(t,n)&&!s.hasOwnProperty(n)&&(d[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===d[n]&&(d[n]=t[n]);return{$$typeof:r,type:e,key:i,ref:p,props:d,_owner:a.current}}t.jsx=d,t.jsxs=d},609:e=>{e.exports=window.React},848:(e,t,o)=>{e.exports=o(20)}},t={};const o=window.wc.wcBlocksRegistry,n=window.wc.blocksCheckout,r=window.wc.wcSettings,c=window.wp.element,a=window.wp.htmlEntities,s="mercadopago_blocks_update_cart";var d=function o(n){var r=t[n];if(void 0!==r)return r.exports;var c=t[n]={exports:{}};return e[n](c,c.exports,o),c.exports}(848);const i=({text:e,imgSrc:t,id:o})=>(0,d.jsxs)("div",{id:o,className:"row-image-select",children:[(0,d.jsx)("img",{src:t}),(0,d.jsx)("span",{children:e})]});var p;const m="mp_checkout_blocks",u="woo-mercado-pago-ticket",l=(0,r.getSetting)("woo-mercado-pago-ticket_data",{}),_=(0,a.decodeEntities)(l.title)||"Checkout Ticket";let y=!1;const g=()=>{const e=(0,a.decodeEntities)(l?.params?.fee_title||""),t=`${_} ${e}`;return(0,d.jsx)(i,{text:t,imgSrc:l.params.icon})},k=e=>{(e=>{const{eventRegistration:t,emitResponse:o}=e,{onPaymentSetup:r,onCheckoutSuccess:a,onCheckoutFail:d}=t;(0,c.useEffect)((()=>{((e,t)=>
15{e({namespace:s,data:{action:"add",gateway:t}})})(n.extensionCartUpdate,u);const e=r((()=>({type:o.responseTypes.SUCCESS})));return()=>(((e,t)=>{e({namespace:s,data:{action:"remove",gateway:t}})})(n.extensionCartUpdate,u),e())}),[r]),(0,c.useEffect)((()=>{const e=a((async e=>{const t=e.processingResponse;return sendMetric("MP_TICKET_BLOCKS_SUCCESS",t.paymentStatus,m),{type:o.responseTypes.SUCCESS}}));return()=>e()}),[a]),(0,c.useEffect)((()=>{const e=d((e=>{"undefined"!=typeof MPCheckoutErrorDispatcher&&MPCheckoutErrorDispatcher.dispatchEventWhenBlocksCheckoutErrorOccurred(e);const t=e.processingResponse;return sendMetric("MP_TICKET_BLOCKS_ERROR",t.paymentStatus,m),{type:o.responseTypes.FAIL,messageContext:o.noticeContexts.PAYMENTS,message:t.paymentDetails.message}}));return()=>e()}),[d])})(e);const{eventRegistration:t,emitResponse:o}=e,{onPaymentSetup:r}=t,a=["address_city","address_federal_unit","address_zip_code","address_street_name","address_street_number","address_neighborhood","address_complement"];return(0,c.useEffect)((()=>{y||("undefined"!=typeof MPCheckoutFieldsDispatcher?MPCheckoutFieldsDispatcher.addEventListenerDispatcher(document.getElementById("mp-ticket-gateway-document-input"),"focusout","ticket_document_filled",{dispatchOnlyIf:e=>e?.target?.value.length}):"function"==typeof sendMetric&&sendMetric("MP_CHECKOUT_FIELDS_DISPATCHER_MISSING","ticket_block","mp_checkout_init_error"),y=!0)}),[]),(0,c.useEffect)((()=>{const e=r((async()=>{var e,t,n,r;const c=document.querySelector(".mp-input"),s=document.getElementById("mp-doc-number-helper"),d=document.getElementById("mp-payment-method-helper"),i=null!==(e=document.getElementsByName("mercadopago_ticket[site_id]")[0]?.value)&&void 0!==e?e:"",p=null!==(t=null!==(n=document.getElementsByName("mercadopago_ticket[doc_number]")[0]?.value)&&void 0!==n?n:document.getElementsByName("mercadopago_ticket[docNumberError]")[0]?.value)&&void 0!==t?t:"",m={"mercadopago_ticket[site_id]":i,"mercadopago_ticket[amount]":null!==(r=document.getElementsByName("mercadopago_ticket[amount]")[0]?.value)&&void 0!==r?r:"","mercadopago_ticket[doc_type]":document.getElementsByName("mercadopago_ticket[doc_type]")[0]?.value,"mercadopago_ticket[doc_number]":"MLB"===i?p.toUpperCase().replace(/[^A-Z0-9]/g,""):p};if(document.querySelector(".mp-checkout-ticket-container")?.querySelectorAll(".mp-input-radio-radio").forEach((e=>{e.checked&&(m["mercadopago_ticket[payment_method_id]"]=e.value,l(d,"none"))})),!m["mercadopago_ticket[payment_method_id]"]){const e=document.querySelector('input[name="mercadopago_ticket[payment_method_id]"][type="hidden"]');e&&e.value&&(m["mercadopago_ticket[payment_method_id]"]=e.value,l(d,"none"))}"MLB"==i&&a.forEach((e=>{var t;m[`mercadopago_ticket[${e}]`]=null!==(t=document.querySelector(`#form-checkout__${e}`)?.value)&&void 0!==t?t:""})),"MLB"!=i&&"MLU"!=i||""!==m["mercadopago_ticket[doc_number]"]||(c?.classList.add("mp-error"),l(s,"flex")),m["mercadopago_ticket[payment_method_id]"]||l(d,"flex");const u="MLB"==i&&!addressFieldsFromTicketRowAreValid();function l(e,t){e&&e.style&&(e.style.display=t)}function _(e){return e&&"flex"===e.style.display}return{type:_(s)||_(d)||u?o.responseTypes.ERROR:o.responseTypes.SUCCESS,meta:{paymentMethodData:{...window.mpHiddenInputDataFromBlocksCheckout,...m}}}}));return()=>e()}),[o.responseTypes.ERROR,o.responseTypes.SUCCESS,r]),(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:l.params.content}})},f={name:u,label:(0,d.jsx)(g,{}),content:(0,d.jsx)(k,{}),edit:(0,d.jsx)(k,{}),canMakePayment:()=>!0,ariaLabel:_,supports:{features:null!==(p=l?.supports)&&void 0!==p?p:[]}};(0,o.registerPaymentMethod)(f)})();;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.